@master/css-tooling 0.0.0-site.1793659883.g69c9aebcf628 → 0.0.0-stage
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -57
- package/package.json +5 -126
- package/dist/browser.d.ts +0 -2
- package/dist/browser.js +0 -1
- package/dist/css-tree-version.d.ts +0 -2
- package/dist/css-tree-version.js +0 -4
- package/dist/css.d.ts +0 -32
- package/dist/css.js +0 -120
- package/dist/immutable.d.ts +0 -2
- package/dist/immutable.js +0 -7
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -1
- package/dist/language/binding-session.d.ts +0 -6
- package/dist/language/binding-session.js +0 -8
- package/dist/language/browser.d.ts +0 -10
- package/dist/language/browser.js +0 -12
- package/dist/language/common.d.ts +0 -12
- package/dist/language/common.js +0 -55
- package/dist/language/contracts.d.ts +0 -197
- package/dist/language/contracts.js +0 -1
- package/dist/language/index.d.ts +0 -29
- package/dist/language/index.js +0 -39
- package/dist/language/master-css.d.ts +0 -13
- package/dist/language/master-css.js +0 -35
- package/dist/language/node.d.ts +0 -21
- package/dist/language/node.js +0 -36
- package/dist/language/semantic/scopes.d.ts +0 -55
- package/dist/language/semantic/scopes.js +0 -73
- package/dist/language/semantic/types.d.ts +0 -11
- package/dist/language/semantic/types.js +0 -1
- package/dist/language/session.d.ts +0 -37
- package/dist/language/session.js +0 -87
- package/dist/language/settings.d.ts +0 -13
- package/dist/language/settings.js +0 -19
- package/dist/language/utils/mdn-css-data.d.ts +0 -5
- package/dist/language/utils/mdn-css-data.js +0 -63
- package/dist/lexer/browser.d.ts +0 -6
- package/dist/lexer/browser.js +0 -11
- package/dist/lexer/contracts.d.ts +0 -41
- package/dist/lexer/contracts.js +0 -1
- package/dist/lexer/index.d.ts +0 -8
- package/dist/lexer/index.js +0 -11
- package/dist/lexer/node.d.ts +0 -7
- package/dist/lexer/node.js +0 -11
- package/dist/lexer/session.d.ts +0 -17
- package/dist/lexer/session.js +0 -25
- package/dist/lint/analysis.d.ts +0 -90
- package/dist/lint/analysis.js +0 -1
- package/dist/lint/binding-session.d.ts +0 -21
- package/dist/lint/binding-session.js +0 -97
- package/dist/lint/constants.d.ts +0 -7
- package/dist/lint/constants.js +0 -18
- package/dist/lint/contracts.d.ts +0 -17
- package/dist/lint/contracts.js +0 -6
- package/dist/lint/diagnostic-format.d.ts +0 -5
- package/dist/lint/diagnostic-format.js +0 -15
- package/dist/lint/diagnostics.d.ts +0 -42
- package/dist/lint/diagnostics.js +0 -1
- package/dist/lint/index.d.ts +0 -21
- package/dist/lint/index.js +0 -30
- package/dist/lint/node.d.ts +0 -6
- package/dist/lint/node.js +0 -11
- package/dist/lint/rule-signatures.d.ts +0 -23
- package/dist/lint/rule-signatures.js +0 -27
- package/dist/lint/source.d.ts +0 -70
- package/dist/lint/source.js +0 -261
- package/dist/math-types.d.ts +0 -11
- package/dist/math-types.js +0 -236
- package/dist/math-validation.d.ts +0 -7
- package/dist/math-validation.js +0 -74
- package/dist/node.d.ts +0 -12
- package/dist/node.js +0 -32
- package/dist/scanner/binding-session.d.ts +0 -29
- package/dist/scanner/binding-session.js +0 -37
- package/dist/scanner/core.d.ts +0 -130
- package/dist/scanner/core.js +0 -480
- package/dist/scanner/index.d.ts +0 -3
- package/dist/scanner/index.js +0 -3
- package/dist/scanner/node.d.ts +0 -5
- package/dist/scanner/node.js +0 -4
- package/dist/scanner/options/index.d.ts +0 -16
- package/dist/scanner/options/index.js +0 -57
- package/dist/scanner/source-policy.d.ts +0 -15
- package/dist/scanner/source-policy.js +0 -131
- package/dist/source/adapters/optional-peer.d.ts +0 -5
- package/dist/source/adapters/optional-peer.js +0 -29
- package/dist/source/adapters/oxc.d.ts +0 -2
- package/dist/source/adapters/oxc.js +0 -6
- package/dist/source/adapters/svelte.d.ts +0 -5
- package/dist/source/adapters/svelte.js +0 -82
- package/dist/source/adapters/types.d.ts +0 -11
- package/dist/source/adapters/types.js +0 -9
- package/dist/source/adapters/vue.d.ts +0 -5
- package/dist/source/adapters/vue.js +0 -50
- package/dist/source/browser.d.ts +0 -7
- package/dist/source/browser.js +0 -11
- package/dist/source/contracts.d.ts +0 -35
- package/dist/source/contracts.js +0 -1
- package/dist/source/index.d.ts +0 -8
- package/dist/source/index.js +0 -11
- package/dist/source/native.d.ts +0 -5
- package/dist/source/native.js +0 -53
- package/dist/source/node.d.ts +0 -7
- package/dist/source/node.js +0 -11
- package/dist/source/session.d.ts +0 -25
- package/dist/source/session.js +0 -37
- package/dist/syntax-validation.d.ts +0 -10
- package/dist/syntax-validation.js +0 -54
- package/dist/tooling-session.d.ts +0 -66
- package/dist/tooling-session.js +0 -188
- package/dist/validator/binding-session.d.ts +0 -17
- package/dist/validator/binding-session.js +0 -29
- package/dist/validator/contracts.d.ts +0 -24
- package/dist/validator/contracts.js +0 -1
- package/dist/validator/index.d.ts +0 -10
- package/dist/validator/index.js +0 -13
- package/dist/validator/node.d.ts +0 -6
- package/dist/validator/node.js +0 -11
- package/dist/validator/types/syntax-error.d.ts +0 -22
- package/dist/validator/types/syntax-error.js +0 -1
- package/dist/value-validation.d.ts +0 -46
- package/dist/value-validation.js +0 -162
package/README.md
CHANGED
|
@@ -1,58 +1,3 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Temporary Holding Version
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install @master/css-tooling
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
The package groups related tooling responsibilities behind explicit subpaths:
|
|
12
|
-
|
|
13
|
-
```ts
|
|
14
|
-
import { createToolingSession } from '@master/css-tooling'
|
|
15
|
-
import { analyzeClassList } from '@master/css-tooling/lexer'
|
|
16
|
-
import { extractSource } from '@master/css-tooling/source'
|
|
17
|
-
import { validateClassNames } from '@master/css-tooling/validator'
|
|
18
|
-
import { lintClassNames } from '@master/css-tooling/lint'
|
|
19
|
-
import { analyzeDocument } from '@master/css-tooling/language'
|
|
20
|
-
import { MasterCSSScanner } from '@master/css-tooling/scanner/node'
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
Every semantic operation requires an explicit manifest. Use
|
|
24
|
-
`createToolingSession({ manifest })` to share one binding/cache across validator,
|
|
25
|
-
lint, and language operations. Feature subpaths provide async one-shot APIs; their
|
|
26
|
-
`./node` entries provide native synchronous counterparts with a `Sync` suffix.
|
|
27
|
-
`MasterCSSScanner` is available only from `./scanner/node` and owns filesystem/watch
|
|
28
|
-
graph lifecycle.
|
|
29
|
-
|
|
30
|
-
Both language sessions and composite tooling sessions expose `tokenFamilies()`.
|
|
31
|
-
The readonly result is `{ version, families }`, derived from the active manifest's
|
|
32
|
-
loaded utilities. Each family has `utility`, `prefix`, `namespace`, `properties`, and
|
|
33
|
-
`argument: 'value' | 'key'`. Definitions are included even without current token
|
|
34
|
-
values; class completions still require tokens. Direct-value families forward a
|
|
35
|
-
CSS value, while string recipes receive a token key. Theme-only manifests must
|
|
36
|
-
load or define utilities explicitly.
|
|
37
|
-
|
|
38
|
-
`scanner.scanSource(source, content)` uses the same built-in adapters and Rust
|
|
39
|
-
scanner as `scan`, returning a `MasterCSSScannerSourceResult` with `changed` and
|
|
40
|
-
all `candidates` extracted from that input. Candidates include repeated classes,
|
|
41
|
-
cache hits and blocklisted candidates; they are source occurrences, not a list of
|
|
42
|
-
newly generated rules. Use the scanner state for final classification. `scan` and
|
|
43
|
-
`scanModule` continue to return a boolean indicating a scanner change.
|
|
44
|
-
|
|
45
|
-
For host parsers that decode enclosing HTML before parsing expressions,
|
|
46
|
-
`session.decodeHTMLAttribute(source)` decodes attribute contents without their
|
|
47
|
-
delimiters and returns `{ value, spans }`. Each span maps a decoded UTF-16 `range`
|
|
48
|
-
to its original UTF-16 `sourceRange`; an entire character reference stays one
|
|
49
|
-
indivisible source span. The decoder follows HTML attribute reference rules and
|
|
50
|
-
input newline normalization. `MasterCSSDecodedHTMLAttribute` is available from
|
|
51
|
-
`@master/css-tooling/source`. Both native and tooling-Wasm bindings support this
|
|
52
|
-
operation; older bindings without the mapping response fail explicitly.
|
|
53
|
-
|
|
54
|
-
Scanner source adapters are first-party implementation details. The package does not
|
|
55
|
-
provide a public third-party adapter registry.
|
|
56
|
-
|
|
57
|
-
Shiki helpers and the shared TextMate grammar live in
|
|
58
|
-
`@master/css-language-service`.
|
|
3
|
+
This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
|
package/package.json
CHANGED
|
@@ -1,127 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"license": "MIT",
|
|
8
|
-
"description": "Rust-backed extraction, scanning, linting, language, validation, and diagnostics sessions for Master CSS",
|
|
9
|
-
"author": "Aoyue Design LLC.",
|
|
10
|
-
"homepage": "https://css.master.co",
|
|
11
|
-
"bugs": {
|
|
12
|
-
"url": "https://github.com/master-co/css/issues"
|
|
13
|
-
},
|
|
14
|
-
"repository": {
|
|
15
|
-
"type": "git",
|
|
16
|
-
"url": "https://github.com/master-co/css.git",
|
|
17
|
-
"directory": "packages/tooling"
|
|
18
|
-
},
|
|
19
|
-
"keywords": [
|
|
20
|
-
"tooling",
|
|
21
|
-
"scanner",
|
|
22
|
-
"lint",
|
|
23
|
-
"language-service",
|
|
24
|
-
"css",
|
|
25
|
-
"mastercss"
|
|
26
|
-
],
|
|
27
|
-
"sideEffects": false,
|
|
28
|
-
"types": "./dist/index.d.ts",
|
|
29
|
-
"exports": {
|
|
30
|
-
".": {
|
|
31
|
-
"types": "./dist/index.d.ts",
|
|
32
|
-
"import": "./dist/index.js",
|
|
33
|
-
"default": "./dist/index.js"
|
|
34
|
-
},
|
|
35
|
-
"./node": {
|
|
36
|
-
"types": "./dist/node.d.ts",
|
|
37
|
-
"import": "./dist/node.js",
|
|
38
|
-
"default": "./dist/node.js"
|
|
39
|
-
},
|
|
40
|
-
"./lexer": {
|
|
41
|
-
"types": "./dist/lexer/index.d.ts",
|
|
42
|
-
"import": "./dist/lexer/index.js",
|
|
43
|
-
"default": "./dist/lexer/index.js"
|
|
44
|
-
},
|
|
45
|
-
"./lexer/node": {
|
|
46
|
-
"types": "./dist/lexer/node.d.ts",
|
|
47
|
-
"import": "./dist/lexer/node.js",
|
|
48
|
-
"default": "./dist/lexer/node.js"
|
|
49
|
-
},
|
|
50
|
-
"./source": {
|
|
51
|
-
"types": "./dist/source/index.d.ts",
|
|
52
|
-
"import": "./dist/source/index.js",
|
|
53
|
-
"default": "./dist/source/index.js"
|
|
54
|
-
},
|
|
55
|
-
"./source/node": {
|
|
56
|
-
"types": "./dist/source/node.d.ts",
|
|
57
|
-
"import": "./dist/source/node.js",
|
|
58
|
-
"default": "./dist/source/node.js"
|
|
59
|
-
},
|
|
60
|
-
"./scanner/node": {
|
|
61
|
-
"types": "./dist/scanner/node.d.ts",
|
|
62
|
-
"import": "./dist/scanner/node.js",
|
|
63
|
-
"default": "./dist/scanner/node.js"
|
|
64
|
-
},
|
|
65
|
-
"./validator": {
|
|
66
|
-
"types": "./dist/validator/index.d.ts",
|
|
67
|
-
"import": "./dist/validator/index.js",
|
|
68
|
-
"default": "./dist/validator/index.js"
|
|
69
|
-
},
|
|
70
|
-
"./validator/node": {
|
|
71
|
-
"types": "./dist/validator/node.d.ts",
|
|
72
|
-
"import": "./dist/validator/node.js",
|
|
73
|
-
"default": "./dist/validator/node.js"
|
|
74
|
-
},
|
|
75
|
-
"./lint": {
|
|
76
|
-
"types": "./dist/lint/index.d.ts",
|
|
77
|
-
"import": "./dist/lint/index.js",
|
|
78
|
-
"default": "./dist/lint/index.js"
|
|
79
|
-
},
|
|
80
|
-
"./lint/node": {
|
|
81
|
-
"types": "./dist/lint/node.d.ts",
|
|
82
|
-
"import": "./dist/lint/node.js",
|
|
83
|
-
"default": "./dist/lint/node.js"
|
|
84
|
-
},
|
|
85
|
-
"./language": {
|
|
86
|
-
"types": "./dist/language/index.d.ts",
|
|
87
|
-
"import": "./dist/language/index.js",
|
|
88
|
-
"default": "./dist/language/index.js"
|
|
89
|
-
},
|
|
90
|
-
"./language/node": {
|
|
91
|
-
"types": "./dist/language/node.d.ts",
|
|
92
|
-
"import": "./dist/language/node.js",
|
|
93
|
-
"default": "./dist/language/node.js"
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
"files": [
|
|
97
|
-
"dist"
|
|
98
|
-
],
|
|
99
|
-
"publishConfig": {
|
|
100
|
-
"access": "public",
|
|
101
|
-
"provenance": true
|
|
102
|
-
},
|
|
103
|
-
"dependencies": {
|
|
104
|
-
"@eslint/css-tree": "^4.1.2",
|
|
105
|
-
"@master/css-binding": "0.0.0-site.1793659883.g69c9aebcf628",
|
|
106
|
-
"@master/css-schema": "0.0.0-site.1793659883.g69c9aebcf628",
|
|
107
|
-
"consola": "^3.4.2",
|
|
108
|
-
"defu": "^6.1.7",
|
|
109
|
-
"ignore": "^7.0.14",
|
|
110
|
-
"mdn-data": "^2.37.2",
|
|
111
|
-
"minimatch": "^10.2.6"
|
|
112
|
-
},
|
|
113
|
-
"peerDependencies": {
|
|
114
|
-
"svelte": ">=4",
|
|
115
|
-
"vue": ">=3"
|
|
116
|
-
},
|
|
117
|
-
"peerDependenciesMeta": {
|
|
118
|
-
"svelte": {
|
|
119
|
-
"optional": true
|
|
120
|
-
},
|
|
121
|
-
"vue": {
|
|
122
|
-
"optional": true
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
"version": "0.0.0-site.1793659883.g69c9aebcf628",
|
|
126
|
-
"gitHead": "69c9aebcf628eb529001b9fa1b3536306f1b139e"
|
|
127
|
-
}
|
|
2
|
+
"name": "@master/css-tooling",
|
|
3
|
+
"version": "0.0.0-stage",
|
|
4
|
+
"stub": true,
|
|
5
|
+
"description": "Temporary package placeholder for staged publishing"
|
|
6
|
+
}
|
package/dist/browser.d.ts
DELETED
package/dist/browser.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { MasterCSSToolingSession, createToolingSession } from "./tooling-session.js";
|
package/dist/css-tree-version.js
DELETED
package/dist/css.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { SyntaxError } from "./validator/types/syntax-error.js";
|
|
2
|
-
declare function validateCSS(text: string, parseOptions?: {
|
|
3
|
-
parseAtrulePrelude: boolean;
|
|
4
|
-
parseRulePrelude: boolean;
|
|
5
|
-
parseValue: boolean;
|
|
6
|
-
parseCustomProperty: boolean;
|
|
7
|
-
}): any[];
|
|
8
|
-
declare function parseCSSDeclarations(text: string): Record<string, string>;
|
|
9
|
-
declare function isTargetError(error: SyntaxError | null): SyntaxError | null;
|
|
10
|
-
declare function validateAtrule(node: {
|
|
11
|
-
name: any;
|
|
12
|
-
prelude: any;
|
|
13
|
-
block: {
|
|
14
|
-
children: any[];
|
|
15
|
-
};
|
|
16
|
-
}, nestedInRule?: boolean): (SyntaxError & {
|
|
17
|
-
atrule: any;
|
|
18
|
-
})[];
|
|
19
|
-
declare function validateAtrulePrelude(atrule: string, prelude: any): (SyntaxError & {
|
|
20
|
-
atrule: string;
|
|
21
|
-
})[];
|
|
22
|
-
declare function validateAtruleDescriptor(atrule: any, descriptor: string, value: any): (SyntaxError & {
|
|
23
|
-
atrule: any;
|
|
24
|
-
descriptor: string;
|
|
25
|
-
})[];
|
|
26
|
-
declare function validateDeclaration(property: string, value: any): any[];
|
|
27
|
-
declare function validateRule(node: {
|
|
28
|
-
block: {
|
|
29
|
-
children: any[];
|
|
30
|
-
};
|
|
31
|
-
}): any[];
|
|
32
|
-
export { isTargetError, parseCSSDeclarations, validateAtrule, validateAtruleDescriptor, validateAtrulePrelude, validateCSS, validateDeclaration, validateRule };
|
package/dist/css.js
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { generate, lexer, parse, property, walk } from "@eslint/css-tree";
|
|
2
|
-
// src/css.ts
|
|
3
|
-
function validateCSS(text, parseOptions = {
|
|
4
|
-
parseAtrulePrelude: false,
|
|
5
|
-
parseRulePrelude: false,
|
|
6
|
-
parseValue: false,
|
|
7
|
-
parseCustomProperty: false
|
|
8
|
-
}) {
|
|
9
|
-
const errors = [];
|
|
10
|
-
const ast = parse(text, {
|
|
11
|
-
...parseOptions,
|
|
12
|
-
onParseError(error) {
|
|
13
|
-
errors.push(error);
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
walk(ast, {
|
|
17
|
-
visit: "Atrule",
|
|
18
|
-
enter(node) {
|
|
19
|
-
errors.push(...validateAtrule(node, !!this.rule));
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
walk(ast, {
|
|
23
|
-
visit: "Rule",
|
|
24
|
-
enter(node) {
|
|
25
|
-
errors.push(...validateRule(node));
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
return errors;
|
|
29
|
-
}
|
|
30
|
-
function parseCSSDeclarations(text) {
|
|
31
|
-
const declarations = {};
|
|
32
|
-
const ast = parse(text, { positions: true });
|
|
33
|
-
walk(ast, {
|
|
34
|
-
visit: "Declaration",
|
|
35
|
-
enter(node) {
|
|
36
|
-
const value = node.value.loc ? text.slice(node.value.loc.start.offset, node.value.loc.end.offset) : generate(node.value);
|
|
37
|
-
declarations[node.property] = node.important ? `${value}!important` : value;
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
return declarations;
|
|
41
|
-
}
|
|
42
|
-
function isTargetError(error) {
|
|
43
|
-
if (!error) return null;
|
|
44
|
-
if (error.name === "UnsupportedMatchingTree") return null;
|
|
45
|
-
if (error.name !== "SyntaxError" && error.name !== "SyntaxMatchError" && error.name !== "SyntaxReferenceError") return null;
|
|
46
|
-
return error;
|
|
47
|
-
}
|
|
48
|
-
function validateAtrule(node, nestedInRule = false) {
|
|
49
|
-
const atrule = node.name;
|
|
50
|
-
const errors = [];
|
|
51
|
-
let error;
|
|
52
|
-
if (error = isTargetError(lexer.checkAtruleName(atrule))) {
|
|
53
|
-
errors.push(Object.assign(error, { atrule }));
|
|
54
|
-
return errors;
|
|
55
|
-
}
|
|
56
|
-
errors.push(...validateAtrulePrelude(atrule, node.prelude));
|
|
57
|
-
if (node.block && node.block.children) node.block.children.forEach((child) => {
|
|
58
|
-
if (child.type === "Declaration") errors.push(...nestedInRule && [
|
|
59
|
-
"media",
|
|
60
|
-
"supports",
|
|
61
|
-
"container",
|
|
62
|
-
"layer",
|
|
63
|
-
"scope",
|
|
64
|
-
"starting-style"
|
|
65
|
-
].includes(atrule.toLowerCase()) ? validateDeclaration(child.property, child.value) : validateAtruleDescriptor(atrule, child.property, child.value));
|
|
66
|
-
});
|
|
67
|
-
return errors;
|
|
68
|
-
}
|
|
69
|
-
function validateAtrulePrelude(atrule, prelude) {
|
|
70
|
-
const errors = [];
|
|
71
|
-
let error;
|
|
72
|
-
if (error = isTargetError(lexer.checkAtrulePrelude(atrule, prelude))) errors.push(Object.assign(error, { atrule }));
|
|
73
|
-
else if (error = isTargetError(lexer.matchAtrulePrelude(atrule, prelude).error)) errors.push(Object.assign(error, {
|
|
74
|
-
atrule,
|
|
75
|
-
...error.rawMessage === "Mismatch" && {
|
|
76
|
-
details: error.message,
|
|
77
|
-
message: "Invalid value for `@" + atrule + "` prelude"
|
|
78
|
-
}
|
|
79
|
-
}));
|
|
80
|
-
return errors;
|
|
81
|
-
}
|
|
82
|
-
function validateAtruleDescriptor(atrule, descriptor, value) {
|
|
83
|
-
const errors = [];
|
|
84
|
-
let error;
|
|
85
|
-
if (error = isTargetError(lexer.checkAtruleDescriptorName(atrule, descriptor))) errors.push(Object.assign(error, {
|
|
86
|
-
atrule,
|
|
87
|
-
descriptor
|
|
88
|
-
}));
|
|
89
|
-
else if (error = isTargetError(lexer.matchAtruleDescriptor(atrule, descriptor, value).error)) errors.push(Object.assign(error, {
|
|
90
|
-
atrule,
|
|
91
|
-
descriptor,
|
|
92
|
-
...error.rawMessage === "Mismatch" && {
|
|
93
|
-
details: error.message,
|
|
94
|
-
message: "Invalid value for `" + descriptor + "` descriptor"
|
|
95
|
-
}
|
|
96
|
-
}));
|
|
97
|
-
return errors;
|
|
98
|
-
}
|
|
99
|
-
function validateDeclaration(property$1, value) {
|
|
100
|
-
const errors = [];
|
|
101
|
-
let error;
|
|
102
|
-
if (property(property$1).custom) return errors;
|
|
103
|
-
if (error = isTargetError(lexer.checkPropertyName(property$1))) errors.push(Object.assign(error, { property: property$1 }));
|
|
104
|
-
else if (error = isTargetError(lexer.matchProperty(property$1, value).error)) errors.push(Object.assign(error, {
|
|
105
|
-
property: property$1,
|
|
106
|
-
...error.rawMessage === "Mismatch" && {
|
|
107
|
-
details: error.message,
|
|
108
|
-
message: "Invalid value for `" + property$1 + "` property"
|
|
109
|
-
}
|
|
110
|
-
}));
|
|
111
|
-
return errors;
|
|
112
|
-
}
|
|
113
|
-
function validateRule(node) {
|
|
114
|
-
const errors = [];
|
|
115
|
-
if (node.block && node.block.children) node.block.children.forEach((child) => {
|
|
116
|
-
if (child.type === "Declaration") errors.push(...validateDeclaration(child.property, child.value));
|
|
117
|
-
});
|
|
118
|
-
return errors;
|
|
119
|
-
}
|
|
120
|
-
export { isTargetError, parseCSSDeclarations, validateAtrule, validateAtruleDescriptor, validateAtrulePrelude, validateCSS, validateDeclaration, validateRule };
|
package/dist/immutable.d.ts
DELETED
package/dist/immutable.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// src/immutable.ts
|
|
2
|
-
function freezeToolingResult(value) {
|
|
3
|
-
if (value === null || typeof value !== "object" || Object.isFrozen(value)) return value;
|
|
4
|
-
for (const nested of Object.values(value)) freezeToolingResult(nested);
|
|
5
|
-
return Object.freeze(value);
|
|
6
|
-
}
|
|
7
|
-
export { freezeToolingResult };
|
package/dist/index.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { MasterCSSDocumentAnalysis, MasterCSSDocumentAnalysisRequest, MasterCSSFormatDirectivesRequest, MasterCSSFormatDirectivesResult, MasterCSSLanguageClassListContext, MasterCSSLanguageClassPosition, MasterCSSLanguageTokenFamilies, MasterCSSTokenFamily } from "./language/contracts.js";
|
|
2
|
-
import { MasterCSSToolingSession, MasterCSSToolingSessionOptions, createToolingSession } from "./tooling-session.js";
|
|
3
|
-
export { type MasterCSSDocumentAnalysis, type MasterCSSDocumentAnalysisRequest, type MasterCSSFormatDirectivesRequest, type MasterCSSFormatDirectivesResult, type MasterCSSLanguageClassListContext, type MasterCSSLanguageClassPosition, type MasterCSSLanguageTokenFamilies, type MasterCSSTokenFamily, MasterCSSToolingSession, type MasterCSSToolingSessionOptions, createToolingSession };
|
package/dist/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { MasterCSSToolingSession, createToolingSession } from "./tooling-session.js";
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { LanguageSession, bindLanguageSession } from "./session.js";
|
|
2
|
-
import { MasterCSSManifest } from "@master/css-schema/manifest";
|
|
3
|
-
declare function createLanguageSession(manifest: MasterCSSManifest, options?: {
|
|
4
|
-
readonly binding?: 'auto' | 'native' | 'wasm';
|
|
5
|
-
}): Promise<LanguageSession>;
|
|
6
|
-
export { type LanguageSession, bindLanguageSession, createLanguageSession };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { bindLanguageSession } from "./session.js";
|
|
2
|
-
import { createToolingBinding } from "@master/css-binding/tooling";
|
|
3
|
-
// src/language/binding-session.ts
|
|
4
|
-
async function createLanguageSession(manifest, options = {}) {
|
|
5
|
-
const tooling = await createToolingBinding({ binding: options.binding });
|
|
6
|
-
return bindLanguageSession(tooling.binding, await tooling.createLanguageSession(manifest));
|
|
7
|
-
}
|
|
8
|
-
export { bindLanguageSession, createLanguageSession };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { SEMANTIC_TOKENS_LEGEND, SEMANTIC_TOKEN_MODIFIERS, SEMANTIC_TOKEN_TYPES } from "./common.js";
|
|
2
|
-
import { LanguageSession } from "./session.js";
|
|
3
|
-
import { MasterCSSWasmBindingLoadOptions } from "@master/css-binding/tooling";
|
|
4
|
-
import { MasterCSSManifest } from "@master/css-schema/manifest";
|
|
5
|
-
interface BrowserLanguageSessionOptions {
|
|
6
|
-
manifest: MasterCSSManifest;
|
|
7
|
-
wasm?: MasterCSSWasmBindingLoadOptions;
|
|
8
|
-
}
|
|
9
|
-
declare function createLanguageSession(options: BrowserLanguageSessionOptions): Promise<LanguageSession>;
|
|
10
|
-
export { BrowserLanguageSessionOptions, type LanguageSession, type MasterCSSWasmBindingLoadOptions, SEMANTIC_TOKENS_LEGEND, SEMANTIC_TOKEN_MODIFIERS, SEMANTIC_TOKEN_TYPES, createLanguageSession };
|
package/dist/language/browser.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { bindLanguageSession } from "./session.js";
|
|
2
|
-
import { SEMANTIC_TOKENS_LEGEND, SEMANTIC_TOKEN_MODIFIERS, SEMANTIC_TOKEN_TYPES } from "./common.js";
|
|
3
|
-
import { createToolingBinding } from "@master/css-binding/tooling";
|
|
4
|
-
// src/language/browser.ts
|
|
5
|
-
async function createLanguageSession(options) {
|
|
6
|
-
const tooling = await createToolingBinding({
|
|
7
|
-
binding: "wasm",
|
|
8
|
-
wasm: options.wasm
|
|
9
|
-
});
|
|
10
|
-
return bindLanguageSession(tooling.binding, await tooling.createLanguageSession(options.manifest));
|
|
11
|
-
}
|
|
12
|
-
export { SEMANTIC_TOKENS_LEGEND, SEMANTIC_TOKEN_MODIFIERS, SEMANTIC_TOKEN_TYPES, createLanguageSession };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
declare const INVOKED_TRIGGER_CHARACTERS: string[];
|
|
2
|
-
declare const VALUE_TRIGGER_CHARACTERS: string[];
|
|
3
|
-
declare const SELECTOR_TRIGGER_CHARACTERS: string[];
|
|
4
|
-
declare const AT_TRIGGER_CHARACTER = "@";
|
|
5
|
-
declare const QUERY_TRIGGER_CHARACTERS: string[];
|
|
6
|
-
declare const SEMANTIC_TOKEN_TYPES: readonly ['class', 'enumMember', 'property', 'variable', 'function', 'number', 'string', 'keyword', 'modifier', 'operator', 'type'];
|
|
7
|
-
declare const SEMANTIC_TOKEN_MODIFIERS: readonly ['declaration', 'defaultLibrary', 'component', 'directive', 'important', 'pseudoClass', 'pseudoElement', 'query', 'quoted', 'selector', 'unit', 'blockBrace', 'declarationSeparator', 'declarationTerminator', 'directiveTerminator', 'functionPunctuation', 'valueSeparator', 'valueOperator', 'queryOperator', 'queryPunctuation', 'selectorCombinator', 'selectorPunctuation', 'pseudoClassDelimiter', 'pseudoElementDelimiter'];
|
|
8
|
-
declare const SEMANTIC_TOKENS_LEGEND: {
|
|
9
|
-
tokenTypes: ("class" | "enumMember" | "function" | "keyword" | "modifier" | "number" | "operator" | "property" | "string" | "type" | "variable")[];
|
|
10
|
-
tokenModifiers: ("blockBrace" | "component" | "declaration" | "declarationSeparator" | "declarationTerminator" | "defaultLibrary" | "directive" | "directiveTerminator" | "functionPunctuation" | "important" | "pseudoClass" | "pseudoClassDelimiter" | "pseudoElement" | "pseudoElementDelimiter" | "query" | "queryOperator" | "queryPunctuation" | "quoted" | "selector" | "selectorCombinator" | "selectorPunctuation" | "unit" | "valueOperator" | "valueSeparator")[];
|
|
11
|
-
};
|
|
12
|
-
export { AT_TRIGGER_CHARACTER, INVOKED_TRIGGER_CHARACTERS, QUERY_TRIGGER_CHARACTERS, SELECTOR_TRIGGER_CHARACTERS, SEMANTIC_TOKENS_LEGEND, SEMANTIC_TOKEN_MODIFIERS, SEMANTIC_TOKEN_TYPES, VALUE_TRIGGER_CHARACTERS };
|
package/dist/language/common.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { QUERY_COMPARISON_OPERATORS, QUERY_LOGICAL_OPERATORS, SELECTOR_SIGNS } from "./master-css.js";
|
|
2
|
-
// src/language/common.ts
|
|
3
|
-
const INVOKED_TRIGGER_CHARACTERS = [
|
|
4
|
-
"\"",
|
|
5
|
-
" ",
|
|
6
|
-
"'"
|
|
7
|
-
];
|
|
8
|
-
const VALUE_TRIGGER_CHARACTERS = [",", "|"];
|
|
9
|
-
const SELECTOR_TRIGGER_CHARACTERS = SELECTOR_SIGNS;
|
|
10
|
-
const AT_TRIGGER_CHARACTER = "@";
|
|
11
|
-
const QUERY_TRIGGER_CHARACTERS = [...QUERY_COMPARISON_OPERATORS, ...QUERY_LOGICAL_OPERATORS];
|
|
12
|
-
const SEMANTIC_TOKEN_TYPES = [
|
|
13
|
-
"class",
|
|
14
|
-
"enumMember",
|
|
15
|
-
"property",
|
|
16
|
-
"variable",
|
|
17
|
-
"function",
|
|
18
|
-
"number",
|
|
19
|
-
"string",
|
|
20
|
-
"keyword",
|
|
21
|
-
"modifier",
|
|
22
|
-
"operator",
|
|
23
|
-
"type"
|
|
24
|
-
];
|
|
25
|
-
const SEMANTIC_TOKEN_MODIFIERS = [
|
|
26
|
-
"declaration",
|
|
27
|
-
"defaultLibrary",
|
|
28
|
-
"component",
|
|
29
|
-
"directive",
|
|
30
|
-
"important",
|
|
31
|
-
"pseudoClass",
|
|
32
|
-
"pseudoElement",
|
|
33
|
-
"query",
|
|
34
|
-
"quoted",
|
|
35
|
-
"selector",
|
|
36
|
-
"unit",
|
|
37
|
-
"blockBrace",
|
|
38
|
-
"declarationSeparator",
|
|
39
|
-
"declarationTerminator",
|
|
40
|
-
"directiveTerminator",
|
|
41
|
-
"functionPunctuation",
|
|
42
|
-
"valueSeparator",
|
|
43
|
-
"valueOperator",
|
|
44
|
-
"queryOperator",
|
|
45
|
-
"queryPunctuation",
|
|
46
|
-
"selectorCombinator",
|
|
47
|
-
"selectorPunctuation",
|
|
48
|
-
"pseudoClassDelimiter",
|
|
49
|
-
"pseudoElementDelimiter"
|
|
50
|
-
];
|
|
51
|
-
const SEMANTIC_TOKENS_LEGEND = {
|
|
52
|
-
tokenTypes: [...SEMANTIC_TOKEN_TYPES],
|
|
53
|
-
tokenModifiers: [...SEMANTIC_TOKEN_MODIFIERS]
|
|
54
|
-
};
|
|
55
|
-
export { AT_TRIGGER_CHARACTER, INVOKED_TRIGGER_CHARACTERS, QUERY_TRIGGER_CHARACTERS, SELECTOR_TRIGGER_CHARACTERS, SEMANTIC_TOKENS_LEGEND, SEMANTIC_TOKEN_MODIFIERS, SEMANTIC_TOKEN_TYPES, VALUE_TRIGGER_CHARACTERS };
|