完成世界书、骰子、apiconfig页面处理
This commit is contained in:
22
frontend/node_modules/style-to-js/LICENSE
generated
vendored
Normal file
22
frontend/node_modules/style-to-js/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2020 Menglin "Mark" Xu <mark@remarkablemark.org>
|
||||
|
||||
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.
|
||||
271
frontend/node_modules/style-to-js/README.md
generated
vendored
Normal file
271
frontend/node_modules/style-to-js/README.md
generated
vendored
Normal file
@@ -0,0 +1,271 @@
|
||||
# style-to-js
|
||||
|
||||
[](https://nodei.co/npm/style-to-js/)
|
||||
|
||||
[](https://www.npmjs.com/package/style-to-js)
|
||||
[](https://bundlephobia.com/package/style-to-js)
|
||||
[](https://github.com/remarkablemark/style-to-js/actions/workflows/build.yml)
|
||||
[](https://codecov.io/gh/remarkablemark/style-to-js)
|
||||
[](https://www.npmjs.com/package/style-to-js)
|
||||
|
||||
Parses CSS inline style to JavaScript object (camelCased):
|
||||
|
||||
```
|
||||
StyleToJS(string)
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
import parse from 'style-to-js';
|
||||
|
||||
parse('background-color: #BADA55;');
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
```json
|
||||
{ "backgroundColor": "#BADA55" }
|
||||
```
|
||||
|
||||
[JSFiddle](https://jsfiddle.net/remarkablemark/04nob1y7/) | [Examples](https://github.com/remarkablemark/style-to-js/tree/master/examples)
|
||||
|
||||
## Install
|
||||
|
||||
[NPM](https://www.npmjs.com/package/style-to-js):
|
||||
|
||||
```sh
|
||||
npm install style-to-js --save
|
||||
```
|
||||
|
||||
[Yarn](https://yarnpkg.com/package/style-to-js):
|
||||
|
||||
```sh
|
||||
yarn add style-to-js
|
||||
```
|
||||
|
||||
[CDN](https://unpkg.com/style-to-js/):
|
||||
|
||||
```html
|
||||
<script src="https://unpkg.com/style-to-js@latest/umd/style-to-js.min.js"></script>
|
||||
<script>
|
||||
window.StyleToJS(/* string */);
|
||||
</script>
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### Import
|
||||
|
||||
Import with ES Modules:
|
||||
|
||||
```js
|
||||
import parse from 'style-to-js';
|
||||
```
|
||||
|
||||
Require with CommonJS:
|
||||
|
||||
```js
|
||||
const parse = require('style-to-js');
|
||||
```
|
||||
|
||||
### Parse style
|
||||
|
||||
Parse single declaration:
|
||||
|
||||
```js
|
||||
parse('line-height: 42');
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
```json
|
||||
{ "lineHeight": "42" }
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> Notice that the CSS property is camelCased.
|
||||
|
||||
Parse multiple declarations:
|
||||
|
||||
```js
|
||||
parse(`
|
||||
border-color: #ACE;
|
||||
z-index: 1337;
|
||||
`);
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
```json
|
||||
{
|
||||
"borderColor": "#ACE",
|
||||
"zIndex": "1337"
|
||||
}
|
||||
```
|
||||
|
||||
### Vendor prefix
|
||||
|
||||
Parse [vendor prefix](https://developer.mozilla.org/en-US/docs/Glossary/Vendor_Prefix):
|
||||
|
||||
```js
|
||||
parse(`
|
||||
-webkit-transition: all 4s ease;
|
||||
-moz-transition: all 4s ease;
|
||||
-ms-transition: all 4s ease;
|
||||
-o-transition: all 4s ease;
|
||||
-khtml-transition: all 4s ease;
|
||||
`);
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
```json
|
||||
{
|
||||
"webkitTransition": "all 4s ease",
|
||||
"mozTransition": "all 4s ease",
|
||||
"msTransition": "all 4s ease",
|
||||
"oTransition": "all 4s ease",
|
||||
"khtmlTransition": "all 4s ease"
|
||||
}
|
||||
```
|
||||
|
||||
### Custom property
|
||||
|
||||
Parse [custom property](https://developer.mozilla.org/en-US/docs/Web/CSS/--*):
|
||||
|
||||
```js
|
||||
parse('--custom-property: #f00');
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
```json
|
||||
{ "--custom-property": "#f00" }
|
||||
```
|
||||
|
||||
### Unknown declaration
|
||||
|
||||
This library does not validate declarations, so unknown declarations can be parsed:
|
||||
|
||||
```js
|
||||
parse('the-answer: 42;');
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
```json
|
||||
{ "theAnswer": "42" }
|
||||
```
|
||||
|
||||
### Invalid declaration
|
||||
|
||||
Declarations with missing value are removed:
|
||||
|
||||
```js
|
||||
parse(`
|
||||
margin-top: ;
|
||||
margin-right: 1em;
|
||||
`);
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
```json
|
||||
{ "marginRight": "1em" }
|
||||
```
|
||||
|
||||
Other invalid declarations or arguments:
|
||||
|
||||
```js
|
||||
parse(); // {}
|
||||
parse(null); // {}
|
||||
parse(1); // {}
|
||||
parse(true); // {}
|
||||
parse('top:'); // {}
|
||||
parse(':12px'); // {}
|
||||
parse(':'); // {}
|
||||
parse(';'); // {}
|
||||
```
|
||||
|
||||
The following values will throw an error:
|
||||
|
||||
```js
|
||||
parse('top'); // Uncaught Error: property missing ':'
|
||||
parse('/*'); // Uncaught Error: End of comment missing
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
#### reactCompat
|
||||
|
||||
When option `reactCompat` is true, the [vendor prefix](https://developer.mozilla.org/en-US/docs/Glossary/Vendor_Prefix) will be capitalized:
|
||||
|
||||
```js
|
||||
parse(
|
||||
`
|
||||
-webkit-transition: all 4s ease;
|
||||
-moz-transition: all 4s ease;
|
||||
-ms-transition: all 4s ease;
|
||||
-o-transition: all 4s ease;
|
||||
-khtml-transition: all 4s ease;
|
||||
`,
|
||||
{ reactCompat: true },
|
||||
);
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
```json
|
||||
{
|
||||
"WebkitTransition": "all 4s ease",
|
||||
"MozTransition": "all 4s ease",
|
||||
"msTransition": "all 4s ease",
|
||||
"OTransition": "all 4s ease",
|
||||
"KhtmlTransition": "all 4s ease"
|
||||
}
|
||||
```
|
||||
|
||||
This removes the React warning:
|
||||
|
||||
```
|
||||
Warning: Unsupported vendor-prefixed style property %s. Did you mean %s?%s", "oTransition", "OTransition"
|
||||
```
|
||||
|
||||
## Testing
|
||||
|
||||
Run tests with coverage:
|
||||
|
||||
```sh
|
||||
npm test
|
||||
```
|
||||
|
||||
Run tests in watch mode:
|
||||
|
||||
```sh
|
||||
npm run test:watch
|
||||
```
|
||||
|
||||
Lint files:
|
||||
|
||||
```sh
|
||||
npm run lint
|
||||
```
|
||||
|
||||
Fix lint errors:
|
||||
|
||||
```sh
|
||||
npm run lint:fix
|
||||
```
|
||||
|
||||
## Release
|
||||
|
||||
Release and publish are automated by [Release Please](https://github.com/googleapis/release-please).
|
||||
|
||||
## Special Thanks
|
||||
|
||||
- [style-to-object](https://github.com/remarkablemark/style-to-object)
|
||||
|
||||
## License
|
||||
|
||||
[MIT](https://github.com/remarkablemark/style-to-js/blob/master/LICENSE)
|
||||
14
frontend/node_modules/style-to-js/cjs/index.d.ts
generated
vendored
Normal file
14
frontend/node_modules/style-to-js/cjs/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import { CamelCaseOptions } from './utilities';
|
||||
type StyleObject = Record<string, string>;
|
||||
interface StyleToJSOptions extends CamelCaseOptions {
|
||||
}
|
||||
/**
|
||||
* Parses CSS inline style to JavaScript object (camelCased).
|
||||
*/
|
||||
declare function StyleToJS(style: string, options?: StyleToJSOptions): StyleObject;
|
||||
declare namespace StyleToJS {
|
||||
var _a: typeof StyleToJS;
|
||||
export { _a as default };
|
||||
}
|
||||
export = StyleToJS;
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
frontend/node_modules/style-to-js/cjs/index.d.ts.map
generated
vendored
Normal file
1
frontend/node_modules/style-to-js/cjs/index.d.ts.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAa,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE1D,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE1C,UAAU,gBAAiB,SAAQ,gBAAgB;CAAG;AAEtD;;GAEG;AACH,iBAAS,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,WAAW,CAezE;kBAfQ,SAAS;;;;AAmBlB,SAAS,SAAS,CAAC"}
|
||||
11
frontend/node_modules/style-to-js/cjs/utilities.d.ts
generated
vendored
Normal file
11
frontend/node_modules/style-to-js/cjs/utilities.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* CamelCase options.
|
||||
*/
|
||||
export interface CamelCaseOptions {
|
||||
reactCompat?: boolean;
|
||||
}
|
||||
/**
|
||||
* CamelCases a CSS property.
|
||||
*/
|
||||
export declare const camelCase: (property: string, options?: CamelCaseOptions) => string;
|
||||
//# sourceMappingURL=utilities.d.ts.map
|
||||
70
frontend/node_modules/style-to-js/package.json
generated
vendored
Normal file
70
frontend/node_modules/style-to-js/package.json
generated
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"name": "style-to-js",
|
||||
"version": "1.1.21",
|
||||
"description": "Parses CSS inline style to JavaScript object (camelCased).",
|
||||
"author": "Mark <mark@remarkablemark.org>",
|
||||
"main": "cjs/index.js",
|
||||
"scripts": {
|
||||
"build": "npm run build:cjs && npm run build:umd",
|
||||
"build:cjs": "tsc --declaration --outDir cjs",
|
||||
"build:umd": "rollup --config --failAfterWarnings",
|
||||
"clean": "rm -rf cjs umd",
|
||||
"lint": "eslint .",
|
||||
"lint:tsc": "tsc --noEmit",
|
||||
"lint:fix": "npm run lint -- --fix",
|
||||
"prepare": "husky",
|
||||
"prepublishOnly": "npm run lint && npm run lint:tsc && npm run test:ci && npm run clean && npm run build",
|
||||
"test": "jest",
|
||||
"test:ci": "CI=true jest --ci --colors --coverage",
|
||||
"test:watch": "jest --watch"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/remarkablemark/style-to-js.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/remarkablemark/style-to-js/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"style-to-js",
|
||||
"css",
|
||||
"style",
|
||||
"javascript",
|
||||
"object",
|
||||
"pojo"
|
||||
],
|
||||
"dependencies": {
|
||||
"style-to-object": "1.0.14"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "20.1.0",
|
||||
"@commitlint/config-conventional": "20.0.0",
|
||||
"@eslint/compat": "2.0.0",
|
||||
"@eslint/eslintrc": "3.3.1",
|
||||
"@eslint/js": "9.39.1",
|
||||
"@rollup/plugin-commonjs": "29.0.0",
|
||||
"@rollup/plugin-node-resolve": "16.0.3",
|
||||
"@rollup/plugin-terser": "0.4.4",
|
||||
"@types/jest": "30.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "8.46.4",
|
||||
"@typescript-eslint/parser": "8.46.4",
|
||||
"eslint": "9.39.1",
|
||||
"eslint-plugin-prettier": "5.5.4",
|
||||
"eslint-plugin-simple-import-sort": "12.1.1",
|
||||
"globals": "16.5.0",
|
||||
"husky": "9.1.7",
|
||||
"jest": "30.2.0",
|
||||
"lint-staged": "16.2.6",
|
||||
"prettier": "3.6.2",
|
||||
"rollup": "4.53.2",
|
||||
"ts-jest": "29.4.5",
|
||||
"ts-node": "10.9.2",
|
||||
"typescript": "5.9.3"
|
||||
},
|
||||
"files": [
|
||||
"cjs/",
|
||||
"src/",
|
||||
"umd/"
|
||||
],
|
||||
"license": "MIT"
|
||||
}
|
||||
Reference in New Issue
Block a user