更新前端静态网页获取方式,放弃使用后端获取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

30
frontend/node_modules/graphemer/CHANGELOG.md generated vendored Normal file
View File

@@ -0,0 +1,30 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.3.0] - 2021-12-13
### Added
- Updated to include support for Unicode 14
## [1.2.0] - 2021-01-29
### Updated
- Refactored to increase speed
## [1.1.0] - 2020-09-14
### Added
- Updated to include support for Unicode 13
## [1.0.0] - 2020-09-13
- Forked from work by @JLHwung on original `Grapheme-Splitter` library: https://github.com/JLHwung/grapheme-splitter/tree/next
- Converted to Typescript
- Added development and build tooling

18
frontend/node_modules/graphemer/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,18 @@
Copyright 2020 Filament (Anomalous Technologies Limited)
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.

132
frontend/node_modules/graphemer/README.md generated vendored Normal file
View File

@@ -0,0 +1,132 @@
# Graphemer: Unicode Character Splitter 🪓
## Introduction
This library continues the work of [Grapheme Splitter](https://github.com/orling/grapheme-splitter) and supports the following unicode versions:
- Unicode 15 and below `[v1.4.0]`
- Unicode 14 and below `[v1.3.0]`
- Unicode 13 and below `[v1.1.0]`
- Unicode 11 and below `[v1.0.0]` (Unicode 10 supported by `grapheme-splitter`)
In JavaScript there is not always a one-to-one relationship between string characters and what a user would call a separate visual "letter". Some symbols are represented by several characters. This can cause issues when splitting strings and inadvertently cutting a multi-char letter in half, or when you need the actual number of letters in a string.
For example, emoji characters like "🌷","🎁","💩","😜" and "👍" are represented by two JavaScript characters each (high surrogate and low surrogate). That is,
```javascript
'🌷'.length == 2;
```
The combined emoji are even longer:
```javascript
'🏳️‍🌈'.length == 6;
```
What's more, some languages often include combining marks - characters that are used to modify the letters before them. Common examples are the German letter ü and the Spanish letter ñ. Sometimes they can be represented alternatively both as a single character and as a letter + combining mark, with both forms equally valid:
```javascript
var two = 'ñ'; // unnormalized two-char n+◌̃, i.e. "\u006E\u0303";
var one = 'ñ'; // normalized single-char, i.e. "\u00F1"
console.log(one != two); // prints 'true'
```
Unicode normalization, as performed by the popular punycode.js library or ECMAScript 6's String.normalize, can **sometimes** fix those differences and turn two-char sequences into single characters. But it is **not** enough in all cases. Some languages like Hindi make extensive use of combining marks on their letters, that have no dedicated single-codepoint Unicode sequences, due to the sheer number of possible combinations.
For example, the Hindi word "अनुच्छेद" is comprised of 5 letters and 3 combining marks:
अ + न + ु + च + ् + छ + े + द
which is in fact just 5 user-perceived letters:
अ + नु + च् + छे + द
and which Unicode normalization would not combine properly.
There are also the unusual letter+combining mark combinations which have no dedicated Unicode codepoint. The string Z͑ͫ̓ͪ̂ͫ̽͏̴̙̤̞͉͚̯̞̠͍A̴̵̜̰͔ͫ͗͢L̠ͨͧͩ͘G̴̻͈͍͔̹̑͗̎̅͛́Ǫ̵̹̻̝̳͂̌̌͘ obviously has 5 separate letters, but is in fact comprised of 58 JavaScript characters, most of which are combining marks.
Enter the `graphemer` library. It can be used to properly split JavaScript strings into what a human user would call separate letters (or "extended grapheme clusters" in Unicode terminology), no matter what their internal representation is. It is an implementation on the [Default Grapheme Cluster Boundary](http://unicode.org/reports/tr29/#Default_Grapheme_Cluster_Table) of [UAX #29](http://www.unicode.org/reports/tr29/).
## Installation
Install `graphemer` using the NPM command below:
```
$ npm i graphemer
```
## Usage
If you're using [Typescript](https://www.typescriptlang.org/) or a compiler like [Babel](https://babeljs.io/) (or something like Create React App) things are pretty simple; just import, initialize and use!
```javascript
import Graphemer from 'graphemer';
const splitter = new Graphemer();
// split the string to an array of grapheme clusters (one string each)
const graphemes = splitter.splitGraphemes(string);
// iterate the string to an iterable iterator of grapheme clusters (one string each)
const graphemeIterator = splitter.iterateGraphemes(string);
// or do this if you just need their number
const graphemeCount = splitter.countGraphemes(string);
```
If you're using vanilla Node you can use the `require()` method.
```javascript
const Graphemer = require('graphemer').default;
const splitter = new Graphemer();
const graphemes = splitter.splitGraphemes(string);
```
## Examples
```javascript
import Graphemer from 'graphemer';
const splitter = new Graphemer();
// plain latin alphabet - nothing spectacular
splitter.splitGraphemes('abcd'); // returns ["a", "b", "c", "d"]
// two-char emojis and six-char combined emoji
splitter.splitGraphemes('🌷🎁💩😜👍🏳️‍🌈'); // returns ["🌷","🎁","💩","😜","👍","🏳️‍🌈"]
// diacritics as combining marks, 10 JavaScript chars
splitter.splitGraphemes('Ĺo͂řȩm̅'); // returns ["Ĺ","o͂","ř","ȩ","m̅"]
// individual Korean characters (Jamo), 4 JavaScript chars
splitter.splitGraphemes('뎌쉐'); // returns ["뎌","쉐"]
// Hindi text with combining marks, 8 JavaScript chars
splitter.splitGraphemes('अनुच्छेद'); // returns ["अ","नु","च्","छे","द"]
// demonic multiple combining marks, 75 JavaScript chars
splitter.splitGraphemes('Z͑ͫ̓ͪ̂ͫ̽͏̴̙̤̞͉͚̯̞̠͍A̴̵̜̰͔ͫ͗͢L̠ͨͧͩ͘G̴̻͈͍͔̹̑͗̎̅͛́Ǫ̵̹̻̝̳͂̌̌͘!͖̬̰̙̗̿̋ͥͥ̂ͣ̐́́͜͞'); // returns ["Z͑ͫ̓ͪ̂ͫ̽͏̴̙̤̞͉͚̯̞̠͍","A̴̵̜̰͔ͫ͗͢","L̠ͨͧͩ͘","G̴̻͈͍͔̹̑͗̎̅͛́","Ǫ̵̹̻̝̳͂̌̌͘","!͖̬̰̙̗̿̋ͥͥ̂ͣ̐́́͜͞"]
```
## TypeScript
Graphemer is built with TypeScript and, of course, includes type declarations.
```javascript
import Graphemer from 'graphemer';
const splitter = new Graphemer();
const split: string[] = splitter.splitGraphemes('Z͑ͫ̓ͪ̂ͫ̽͏̴̙̤̞͉͚̯̞̠͍A̴̵̜̰͔ͫ͗͢L̠ͨͧͩ͘G̴̻͈͍͔̹̑͗̎̅͛́Ǫ̵̹̻̝̳͂̌̌͘!͖̬̰̙̗̿̋ͥͥ̂ͣ̐́́͜͞');
```
## Contributing
See [Contribution Guide](./CONTRIBUTING.md).
## Acknowledgements
This library is a fork of the incredible work done by Orlin Georgiev and Huáng Jùnliàng at https://github.com/orling/grapheme-splitter.
The original library was heavily influenced by Devon Govett's excellent [grapheme-breaker](https://github.com/devongovett/grapheme-breaker) CoffeeScript library.

54
frontend/node_modules/graphemer/package.json generated vendored Normal file
View File

@@ -0,0 +1,54 @@
{
"name": "graphemer",
"version": "1.4.0",
"description": "A JavaScript library that breaks strings into their individual user-perceived characters (including emojis!)",
"homepage": "https://github.com/flmnt/graphemer",
"author": "Matt Davies <matt@filament.so> (https://github.com/mattpauldavies)",
"contributors": [
"Orlin Georgiev (https://github.com/orling)",
"Huáng Jùnliàng (https://github.com/JLHwung)"
],
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"files": [
"lib"
],
"license": "MIT",
"keywords": [
"utf-8",
"strings",
"emoji",
"split"
],
"scripts": {
"prepublishOnly": "npm run build",
"build": "tsc --project tsconfig.json",
"pretest": "npm run build",
"test": "ts-node node_modules/tape/bin/tape tests/**.ts",
"prettier:check": "prettier --check .",
"prettier:fix": "prettier --write ."
},
"repository": {
"type": "git",
"url": "https://github.com/flmnt/graphemer.git"
},
"bugs": "https://github.com/flmnt/graphemer/issues",
"devDependencies": {
"@types/tape": "^4.13.0",
"husky": "^4.3.0",
"lint-staged": "^10.3.0",
"prettier": "^2.1.1",
"tape": "^4.6.3",
"ts-node": "^9.0.0",
"typescript": "^4.0.2"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"pre-push": "npm test"
}
},
"lint-staged": {
"*.{js,ts,md,json}": "prettier --write"
}
}