更新前端静态网页获取方式,放弃使用后端获取api

This commit is contained in:
2025-09-09 10:47:51 +08:00
parent 6889ca37e5
commit 44a4f1bae1
25558 changed files with 2463152 additions and 153 deletions

48
frontend/node_modules/postcss-font-variant/CHANGELOG.md generated vendored Executable file
View File

@@ -0,0 +1,48 @@
# 5.0.0 - 2021-01-12
- Changed: use PostCSS 7 API
- Updated: Node support to 10.0.0 (major)
# 4.0.1 - 2020-10-28
- Fixed: Incorrect conversion of small-caps ([#15](https://github.com/postcss/postcss-font-variant/pull/15))
# 4.0.0 - 2018-09-17
- Changed: use PostCSS 7 API
# 3.0.0 - 2017-05-11
- Changed: use PostCSS 6 API
# 2.0.1 - 2016-07-08
- Fixed: existing font-feature-settings being duplicated.
([#8](https://github.com/postcss/postcss-font-variant/pull/8) - @ChaosExAnima)
# 2.0.0 - 2015-09-08
- Added: compatibility with postcss v5.x
- Removed: compatiblity with postcss v4.x
# 1.2.0 - 2015-08-13
- Added: compatibility with postcss v4.1.x
([#5](https://github.com/postcss/postcss-font-variant/pull/5))
# 1.1.0 - 2015-01-29
- Fixed: Properly handle font-variant-position:normal ([#3](https://github.com/postcss/postcss-font-variant/pull/3))
- Added: support font-kerning ([#2](https://github.com/postcss/postcss-font-variant/pull/2))
# 1.0.2 - 2015-01-27
- Fixed: Reuse existing font-feature-settings declarations to avoid creating multiples that override themselves ([#1](https://github.com/postcss/postcss-font-variant/pull/1))
# 1.0.1 - 2014-11-11
- Fixed: wrong space char that breaks on some environnements
# 1.0.0 - 2014-10-09
✨ First release based on [rework-font-variant](https://github.com/ianstormtaylor/rework-font-variant) v1.0.1

20
frontend/node_modules/postcss-font-variant/LICENSE generated vendored Executable file
View File

@@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2014 Maxime Thirouin & Ian Storm Taylor
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

74
frontend/node_modules/postcss-font-variant/README.md generated vendored Executable file
View File

@@ -0,0 +1,74 @@
# PostCSS Font-Variant [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">](https://github.com/postcss/postcss/)
[![CSS Status](https://cssdb.org/badge/font-variant-property.svg)](https://cssdb.org/#font-variant-property)
[![Build Status](https://travis-ci.org/postcss/postcss-font-variant.svg)](https://travis-ci.org/postcss/postcss-font-variant)
PostCSS Font-Variant lets you use `font-variant` in CSS, following the
[CSS Fonts](https://www.w3.org/TR/css-fonts-3/#font-variant-prop) specification.
## Installation
```console
$ npm install postcss-font-variant
```
## Usage
```js
// dependencies
var postcss = require("postcss")
var fontVariant = require("postcss-font-variant")
// css to be processed
var css = fs.readFileSync("input.css", "utf8")
// process css using postcss-font-variant
var out = postcss()
.use(fontVariant())
.process(css)
.css
```
Using this `input.css`:
```css
h2 {
font-variant-caps: small-caps;
}
table {
font-variant-numeric: lining-nums;
}
```
you will get:
```css
h2 {
font-feature-settings: "smcp";
font-variant-caps: small-caps;
}
table {
font-feature-settings: "lnum";
font-variant-numeric: lining-nums;
}
```
Checkout [tests](test) for more examples.
---
## Contributing
Work on a branch, install dev-dependencies, respect coding style & run tests before submitting a bug fix or a feature.
$ git clone https://github.com/postcss/postcss-font-variant.git
$ git checkout -b patch-1
$ npm install
$ npm test
## [Changelog](CHANGELOG.md)
## [License](LICENSE)

126
frontend/node_modules/postcss-font-variant/index.js generated vendored Executable file
View File

@@ -0,0 +1,126 @@
/**
* font variant convertion map
*
* @type {Object}
*/
const fontVariantProperties = {
"font-variant-ligatures": {
"common-ligatures": "\"liga\", \"clig\"",
"no-common-ligatures": "\"liga\", \"clig off\"",
"discretionary-ligatures": "\"dlig\"",
"no-discretionary-ligatures": "\"dlig\" off",
"historical-ligatures": "\"hlig\"",
"no-historical-ligatures": "\"hlig\" off",
contextual: "\"calt\"",
"no-contextual": "\"calt\" off"
},
"font-variant-position": {
sub: "\"subs\"",
"super": "\"sups\"",
normal: "\"subs\" off, \"sups\" off"
},
"font-variant-caps": {
"small-caps": "\"smcp\"",
"all-small-caps": "\"smcp\", \"c2sc\"",
"petite-caps": "\"pcap\"",
"all-petite-caps": "\"pcap\", \"c2pc\"",
unicase: "\"unic\"",
"titling-caps": "\"titl\""
},
"font-variant-numeric": {
"lining-nums": "\"lnum\"",
"oldstyle-nums": "\"onum\"",
"proportional-nums": "\"pnum\"",
"tabular-nums": "\"tnum\"",
"diagonal-fractions": "\"frac\"",
"stacked-fractions": "\"afrc\"",
ordinal: "\"ordn\"",
"slashed-zero": "\"zero\""
},
"font-kerning": {
normal: "\"kern\"",
none: "\"kern\" off"
},
"font-variant": {
normal: "normal",
inherit: "inherit"
}
}
// The `font-variant` property is a shorthand for all the others.
for (const prop in fontVariantProperties) {
const keys = fontVariantProperties[prop]
for (const key in keys) {
if (!(key in fontVariantProperties["font-variant"])) {
fontVariantProperties["font-variant"][key] = keys[key]
}
}
}
// Find font-feature-settings declaration before given declaration,
// create if does not exist
function getFontFeatureSettingsPrevTo(decl) {
let fontFeatureSettings = null;
decl.parent.walkDecls((decl) => {
if (decl.prop === "font-feature-settings") {
fontFeatureSettings = decl;
}
})
if (fontFeatureSettings === null) {
fontFeatureSettings = decl.clone()
fontFeatureSettings.prop = "font-feature-settings"
fontFeatureSettings.value = ""
decl.parent.insertBefore(decl, fontFeatureSettings)
}
return fontFeatureSettings
}
function walkRule(rule) {
let fontFeatureSettings = null
// read custom media queries
rule.walkDecls((decl) => {
if (!fontVariantProperties[decl.prop]) {
return null
}
let newValue = decl.value
if (decl.prop === "font-variant") {
newValue = decl.value.split(/\s+/g).map((val) => {
return fontVariantProperties["font-variant"][val]
}).join(", ")
}
else if (fontVariantProperties[decl.prop][decl.value]) {
newValue = fontVariantProperties[decl.prop][decl.value]
}
if (fontFeatureSettings === null) {
fontFeatureSettings = getFontFeatureSettingsPrevTo(decl);
}
if (fontFeatureSettings.value && fontFeatureSettings.value !== newValue) {
fontFeatureSettings.value += ", " + newValue;
}
else {
fontFeatureSettings.value = newValue;
}
})
}
/**
* Expose the font-variant plugin.
*/
module.exports = () => {
return {
postcssPlugin: "postcss-font-variant",
Once(root) {
root.walkRules(walkRule)
}
}
}
module.exports.postcss = true

View File

@@ -0,0 +1,36 @@
{
"name": "postcss-font-variant",
"version": "5.0.0",
"description": "PostCSS plugin to transform W3C font-variant properties to more compatible CSS (font-feature-settings)",
"keywords": [
"css",
"postcss",
"postcss-plugin",
"font",
"variant",
"font-variant"
],
"author": "Maxime Thirouin",
"license": "MIT",
"repository": "https://github.com/postcss/postcss-font-variant.git",
"files": [
"index.js"
],
"peerDependencies": {
"postcss": "^8.1.0"
},
"devDependencies": {
"jscs": "^3.0.7",
"jshint": "^2.9.6",
"npmpub": "^4.1.0",
"postcss": "^8.1.0",
"tape": "^5.0.0"
},
"scripts": {
"lint": "npm run jscs && npm run jshint",
"jscs": "jscs index.js test/index.js",
"jshint": "jshint . --exclude-path .gitignore",
"test": "npm run lint && tape test",
"release": "npmpub"
}
}