Update from Vibe Studio

This commit is contained in:
Vibe Studio
2026-01-16 02:20:32 +00:00
parent a4605e311a
commit 71de1506ca
28603 changed files with 2179459 additions and 0 deletions

22
node_modules/style-to-object/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2017 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.

213
node_modules/style-to-object/README.md generated vendored Normal file
View File

@@ -0,0 +1,213 @@
# style-to-object
[![NPM](https://nodei.co/npm/style-to-object.png)](https://nodei.co/npm/style-to-object/)
[![NPM version](https://badgen.net/npm/v/style-to-object)](https://www.npmjs.com/package/style-to-object)
[![Bundlephobia minified + gzip](https://badgen.net/bundlephobia/minzip/style-to-object)](https://bundlephobia.com/package/style-to-object)
[![build](https://github.com/remarkablemark/style-to-object/actions/workflows/build.yml/badge.svg)](https://github.com/remarkablemark/style-to-object/actions/workflows/build.yml)
[![codecov](https://codecov.io/gh/remarkablemark/style-to-object/branch/master/graph/badge.svg?token=XWxph9dpa4)](https://codecov.io/gh/remarkablemark/style-to-object)
[![NPM downloads](https://badgen.net/npm/dm/style-to-object)](https://www.npmjs.com/package/style-to-object)
Parses inline style to object:
```js
var parse = require('style-to-object');
parse('color: #C0FFEE; background: #BADA55;');
```
Output:
```js
{ color: '#C0FFEE', background: '#BADA55' }
```
[JSFiddle](https://jsfiddle.net/remarkablemark/ykz2meot/) | [Replit](https://replit.com/@remarkablemark/style-to-object) | [Examples](https://github.com/remarkablemark/style-to-object/tree/master/examples)
## Installation
[NPM](https://www.npmjs.com/package/style-to-object):
```sh
npm install style-to-object --save
```
[Yarn](https://yarn.fyi/style-to-object):
```sh
yarn add style-to-object
```
[CDN](https://unpkg.com/style-to-object/):
```html
<script src="https://unpkg.com/style-to-object@latest/dist/style-to-object.min.js"></script>
<script>
window.StyleToObject(/* string */);
</script>
```
## Usage
Import the module:
```js
// CommonJS
const parse = require('style-to-object');
// ES Modules
import parse from 'style-to-object';
```
Parse single declaration:
```js
parse('line-height: 42');
```
Output:
```js
{ 'line-height': '42' }
```
Parse multiple declarations:
```js
parse(`
border-color: #ACE;
z-index: 1337;
`);
```
Output:
```js
{ 'border-color': '#ACE', 'z-index': '1337' }
```
Parse unknown declarations:
```js
parse('answer: 42;');
```
Output:
```js
{ 'answer': '42' }
```
Invalid declarations/arguments:
<!-- prettier-ignore-start -->
```js
parse(`
top: ;
right: 1em;
`); // { right: '1em' }
parse(); // null
parse(null); // null
parse(1); // null
parse(true); // null
parse('top:'); // null
parse(':12px'); // null
parse(':'); // null
parse(';'); // null
parse('top'); // throws Error
parse('/*'); // throws Error
```
<!-- prettier-ignore-end -->
### Iterator
If the 2nd argument is a function, then the parser will return `null`:
```js
parse('color: #f00', function() {}); // null
```
But the function will iterate through each declaration:
<!-- prettier-ignore-start -->
```js
parse('color: #f00', function(name, value, declaration) {
console.log(name); // 'color'
console.log(value); // '#f00'
console.log(declaration); // { type: 'declaration', property: 'color', value: '#f00' }
});
```
<!-- prettier-ignore-end -->
This makes it easy to customize the output:
```js
const style = `
color: red;
background: blue;
`;
const output = [];
function iterator(name, value) {
output.push([name, value]);
}
parse(style, iterator);
console.log(output); // [['color', 'red'], ['background', 'blue']]
```
## Testing
Run tests:
```sh
npm test
```
Run tests in watch mode:
```sh
npm run test:watch
```
Run tests with coverage:
```sh
npm run test:coverage
```
Lint files:
```sh
npm run lint
```
Fix lint errors:
```sh
npm run lint:fix
```
Test TypeScript declaration file for style and correctness:
```sh
npm run lint:dts
```
## Release
Release and publish are automated by [Release Please](https://github.com/googleapis/release-please).
## Special Thanks
- [inline-style-parser](https://github.com/remarkablemark/inline-style-parser)
- [Contributors](https://github.com/remarkablemark/style-to-object/graphs/contributors)
## License
[MIT](https://github.com/remarkablemark/style-to-object/blob/master/LICENSE)

45
node_modules/style-to-object/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,45 @@
/**
* Parses inline style to object.
*
* @example
*
* ```ts
* import parse from 'style-to-object';
* parse('line-height: 42;'); // { 'line-height': '42' }
* ```
*/
export default function StyleToObject(
style: string,
iterator?: Iterator
): { [name: string]: string } | null;
interface Position {
start: {
line: number;
column: number;
};
end: {
line: number;
column: number;
};
source?: string;
}
export interface Declaration {
type: 'declaration';
property: string;
value: string;
position: Position;
}
export interface Comment {
type: 'comment';
comment: string;
position: Position;
}
type Iterator = (
property: string,
value: string,
declaration: Declaration | Comment
) => void;

43
node_modules/style-to-object/index.js generated vendored Normal file
View File

@@ -0,0 +1,43 @@
var parse = require('inline-style-parser');
/**
* Parses inline style to object.
*
* @example
* // returns { 'line-height': '42' }
* StyleToObject('line-height: 42;');
*
* @param {String} style - The inline style.
* @param {Function} [iterator] - The iterator function.
* @return {null|Object}
*/
function StyleToObject(style, iterator) {
var output = null;
if (!style || typeof style !== 'string') {
return output;
}
var declaration;
var declarations = parse(style);
var hasIterator = typeof iterator === 'function';
var property;
var value;
for (var i = 0, len = declarations.length; i < len; i++) {
declaration = declarations[i];
property = declaration.property;
value = declaration.value;
if (hasIterator) {
iterator(property, value, declaration);
} else if (value) {
output || (output = {});
output[property] = value;
}
}
return output;
}
module.exports = StyleToObject;
module.exports.default = StyleToObject; // ESM support

3
node_modules/style-to-object/index.mjs generated vendored Normal file
View File

@@ -0,0 +1,3 @@
import StyleToObject from './index.js';
export default StyleToObject;

73
node_modules/style-to-object/package.json generated vendored Normal file
View File

@@ -0,0 +1,73 @@
{
"name": "style-to-object",
"version": "0.4.4",
"description": "Converts inline style to object.",
"author": "Mark <mark@remarkablemark.org>",
"main": "index.js",
"types": "index.d.ts",
"module": "index.mjs",
"exports": {
"types": "./index.d.ts",
"import": "./index.mjs",
"require": "./index.js"
},
"scripts": {
"build": "rollup --config --failAfterWarnings",
"clean": "rm -rf dist",
"lint": "eslint --ignore-path .gitignore .",
"lint:fix": "npm run lint -- --fix",
"lint:dts": "dtslint .",
"_postinstall": "husky install",
"postpublish": "pinst --enable",
"prepublishOnly": "pinst --disable && run-s lint lint:dts test clean build",
"test": "jest",
"test:ci": "CI=true jest --ci --colors --coverage",
"test:esm": "node --test __tests__/index.test.mjs",
"test:watch": "npm run test -- --watch"
},
"repository": {
"type": "git",
"url": "https://github.com/remarkablemark/style-to-object"
},
"bugs": {
"url": "https://github.com/remarkablemark/style-to-object/issues"
},
"keywords": [
"style-to-object",
"inline",
"style",
"parser",
"css",
"object",
"pojo"
],
"dependencies": {
"inline-style-parser": "0.1.1"
},
"devDependencies": {
"@commitlint/cli": "17.8.0",
"@commitlint/config-conventional": "17.8.0",
"@definitelytyped/dtslint": "0.0.182",
"@rollup/plugin-commonjs": "25.0.5",
"@rollup/plugin-node-resolve": "15.2.3",
"@rollup/plugin-terser": "0.4.4",
"@typescript-eslint/parser": "5.62.0",
"eslint": "8.51.0",
"eslint-plugin-prettier": "5.0.1",
"husky": "8.0.3",
"jest": "29.7.0",
"lint-staged": "14.0.1",
"npm-run-all": "4.1.5",
"pinst": "3.0.0",
"prettier": "3.0.3",
"rollup": "4.1.0",
"typescript": "5.2.2"
},
"files": [
"/dist",
"index.d.ts",
"index.js",
"index.mjs"
],
"license": "MIT"
}