@tokens-studio/tokenscript-interpreter 0.32.0 → 0.34.0
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/dist/chunk-33CDF4L4.js +6444 -0
- package/dist/chunk-33CDF4L4.js.map +1 -0
- package/dist/chunk-AXH5N7KV.js +99 -0
- package/dist/chunk-AXH5N7KV.js.map +1 -0
- package/dist/chunk-QP7M6WUR.js +6227 -0
- package/dist/chunk-QP7M6WUR.js.map +1 -0
- package/dist/cli.js +242 -2
- package/dist/cli.js.map +1 -1
- package/dist/compliance-suite.js +2 -2
- package/dist/config-DtbN3iyg.d.ts +918 -0
- package/dist/lib/{chunk-QYRJ6NSL.cjs → chunk-LEYHQJTL.cjs} +3 -2
- package/dist/lib/chunk-LEYHQJTL.cjs.map +1 -0
- package/dist/lib/{chunk-GKSWF7FF.cjs → chunk-LMGHS2NP.cjs} +102 -100
- package/dist/lib/chunk-LMGHS2NP.cjs.map +1 -0
- package/dist/lib/{chunk-LI2D53SH.js → chunk-LSTH2XJ4.js} +5 -3
- package/dist/lib/chunk-LSTH2XJ4.js.map +1 -0
- package/dist/lib/{chunk-YD3MIYOO.js → chunk-ODVWXGOM.js} +3 -2
- package/dist/lib/chunk-ODVWXGOM.js.map +1 -0
- package/dist/lib/{chunk-UYVHWJIC.js → chunk-RWXDOZAS.js} +250 -5
- package/dist/lib/chunk-RWXDOZAS.js.map +1 -0
- package/dist/lib/{chunk-QGOGK2VP.cjs → chunk-YCIBJDRB.cjs} +790 -543
- package/dist/lib/chunk-YCIBJDRB.cjs.map +1 -0
- package/dist/lib/index.cjs +97 -89
- package/dist/lib/index.d.cts +5 -5
- package/dist/lib/index.d.ts +5 -5
- package/dist/lib/index.js +3 -3
- package/dist/lib/{interpreter-DNmBc--s.d.ts → interpreter-6QwMkUqD.d.cts} +30 -2
- package/dist/lib/{interpreter-CP7CNwDa.d.cts → interpreter-v7WiwSP9.d.ts} +30 -2
- package/dist/lib/interpreter.cjs +73 -73
- package/dist/lib/interpreter.d.cts +4 -4
- package/dist/lib/interpreter.d.ts +4 -4
- package/dist/lib/interpreter.js +3 -3
- package/dist/lib/processor-node.cjs +12 -12
- package/dist/lib/processor-node.d.cts +3 -3
- package/dist/lib/processor-node.d.ts +3 -3
- package/dist/lib/processor-node.js +3 -3
- package/dist/lib/processor.cjs +23 -15
- package/dist/lib/processor.d.cts +18 -5
- package/dist/lib/processor.d.ts +18 -5
- package/dist/lib/processor.js +3 -3
- package/dist/lib/schema.cjs +5 -5
- package/dist/lib/schema.d.cts +1 -1
- package/dist/lib/schema.d.ts +1 -1
- package/dist/lib/schema.js +3 -3
- package/dist/lib/syntax-highlighting.cjs +15 -15
- package/dist/lib/syntax-highlighting.d.cts +1 -1
- package/dist/lib/syntax-highlighting.d.ts +1 -1
- package/dist/lib/syntax-highlighting.js +2 -2
- package/dist/lib/{types-DHgmzR1Z.d.ts → types-BI0AZ4Ej.d.ts} +2 -2
- package/dist/lib/{types-BimJex2v.d.cts → types-EB8V9c46.d.cts} +1 -0
- package/dist/lib/{types-BimJex2v.d.ts → types-EB8V9c46.d.ts} +1 -0
- package/dist/lib/{types-DsJuwrq3.d.cts → types-cFwP43uv.d.cts} +2 -2
- package/dist/lib/types.cjs +6 -6
- package/dist/lib/types.d.cts +1 -1
- package/dist/lib/types.d.ts +1 -1
- package/dist/lib/types.js +1 -1
- package/dist/processor/index.d.ts +15 -2
- package/dist/processor/index.js +24 -3
- package/dist/processor/index.js.map +1 -1
- package/dist/repl.d.ts +1 -1
- package/dist/repl.js +2 -2
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/package.json +1 -1
- package/dist/lib/chunk-GKSWF7FF.cjs.map +0 -1
- package/dist/lib/chunk-LI2D53SH.js.map +0 -1
- package/dist/lib/chunk-QGOGK2VP.cjs.map +0 -1
- package/dist/lib/chunk-QYRJ6NSL.cjs.map +0 -1
- package/dist/lib/chunk-UYVHWJIC.js.map +0 -1
- package/dist/lib/chunk-YD3MIYOO.js.map +0 -1
package/dist/lib/processor.cjs
CHANGED
|
@@ -1,58 +1,66 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
3
|
+
var chunkYCIBJDRB_cjs = require('./chunk-YCIBJDRB.cjs');
|
|
4
|
+
require('./chunk-LMGHS2NP.cjs');
|
|
5
|
+
require('./chunk-LEYHQJTL.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "TokenResolver", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkYCIBJDRB_cjs.TokenResolver; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "ValidationSeverity", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkYCIBJDRB_cjs.ValidationSeverity; }
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "buildTokens", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkYCIBJDRB_cjs.buildTokens; }
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(exports, "builders", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunkYCIBJDRB_cjs.builders_exports; }
|
|
24
24
|
});
|
|
25
25
|
Object.defineProperty(exports, "flattenChildrenMap", {
|
|
26
26
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
27
|
+
get: function () { return chunkYCIBJDRB_cjs.flattenChildrenMap; }
|
|
28
28
|
});
|
|
29
29
|
Object.defineProperty(exports, "flattenChildrenObject", {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
31
|
+
get: function () { return chunkYCIBJDRB_cjs.flattenChildrenObject; }
|
|
32
32
|
});
|
|
33
33
|
Object.defineProperty(exports, "getAffectedTokens", {
|
|
34
34
|
enumerable: true,
|
|
35
|
-
get: function () { return
|
|
35
|
+
get: function () { return chunkYCIBJDRB_cjs.getAffectedTokens; }
|
|
36
36
|
});
|
|
37
37
|
Object.defineProperty(exports, "getBrokenReferences", {
|
|
38
38
|
enumerable: true,
|
|
39
|
-
get: function () { return
|
|
39
|
+
get: function () { return chunkYCIBJDRB_cjs.getBrokenReferences; }
|
|
40
40
|
});
|
|
41
41
|
Object.defineProperty(exports, "getModifiedDependants", {
|
|
42
42
|
enumerable: true,
|
|
43
|
-
get: function () { return
|
|
43
|
+
get: function () { return chunkYCIBJDRB_cjs.getModifiedDependants; }
|
|
44
44
|
});
|
|
45
45
|
Object.defineProperty(exports, "getRenamedReferences", {
|
|
46
46
|
enumerable: true,
|
|
47
|
-
get: function () { return
|
|
47
|
+
get: function () { return chunkYCIBJDRB_cjs.getRenamedReferences; }
|
|
48
48
|
});
|
|
49
49
|
Object.defineProperty(exports, "processTokenSets", {
|
|
50
50
|
enumerable: true,
|
|
51
|
-
get: function () { return
|
|
51
|
+
get: function () { return chunkYCIBJDRB_cjs.processTokenSets; }
|
|
52
52
|
});
|
|
53
53
|
Object.defineProperty(exports, "processTokens", {
|
|
54
54
|
enumerable: true,
|
|
55
|
-
get: function () { return
|
|
55
|
+
get: function () { return chunkYCIBJDRB_cjs.processTokens; }
|
|
56
|
+
});
|
|
57
|
+
Object.defineProperty(exports, "validateTokenName", {
|
|
58
|
+
enumerable: true,
|
|
59
|
+
get: function () { return chunkYCIBJDRB_cjs.validateTokenName; }
|
|
60
|
+
});
|
|
61
|
+
Object.defineProperty(exports, "validateTokenPath", {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
get: function () { return chunkYCIBJDRB_cjs.validateTokenPath; }
|
|
56
64
|
});
|
|
57
65
|
//# sourceMappingURL=processor.cjs.map
|
|
58
66
|
//# sourceMappingURL=processor.cjs.map
|
package/dist/lib/processor.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { T as TokenBuilder, B as BuildTokensOptions, m as BuilderFormat, g as TokenDataMap, l as buildTokens, n as ProcessSetsOptions, a as ProcessResult, f as TokenData, o as ProcessOptions, h as TokenOperationResult, p as RefPath } from './types-
|
|
2
|
-
export { C as CreateTokenParams, b as CreateTokenResult, D as DeleteTokenParams, c as DeleteTokenResult, I as IssuesMap, d as ProcessorOutput, e as ProcessorResult, R as ResolveIssue, i as TokenResolver, U as UpdateTokenParams, j as UpdateTokenResult, V as ValidationIssue, k as ValidationSeverity } from './types-
|
|
3
|
-
import { l as InterpreterResult } from './interpreter-
|
|
4
|
-
import './types-
|
|
1
|
+
import { T as TokenBuilder, B as BuildTokensOptions, m as BuilderFormat, g as TokenDataMap, l as buildTokens, n as ProcessSetsOptions, a as ProcessResult, f as TokenData, o as ProcessOptions, h as TokenOperationResult, p as RefPath } from './types-cFwP43uv.cjs';
|
|
2
|
+
export { C as CreateTokenParams, b as CreateTokenResult, D as DeleteTokenParams, c as DeleteTokenResult, I as IssuesMap, d as ProcessorOutput, e as ProcessorResult, R as ResolveIssue, i as TokenResolver, U as UpdateTokenParams, j as UpdateTokenResult, V as ValidationIssue, k as ValidationSeverity } from './types-cFwP43uv.cjs';
|
|
3
|
+
import { l as InterpreterResult } from './interpreter-6QwMkUqD.cjs';
|
|
4
|
+
import './types-EB8V9c46.cjs';
|
|
5
5
|
import '@tokens-studio/schema-validation';
|
|
6
6
|
|
|
7
7
|
type FlattenCallback<T> = (key: string, value: InterpreterResult) => T;
|
|
@@ -134,4 +134,17 @@ declare function getRenamedReferences(_result: TokenOperationResult, modifiedTok
|
|
|
134
134
|
*/
|
|
135
135
|
declare function getModifiedDependants(oldTokens: Map<RefPath, any>, result: TokenOperationResult): Set<RefPath>;
|
|
136
136
|
|
|
137
|
-
|
|
137
|
+
/**
|
|
138
|
+
* Token name validation.
|
|
139
|
+
*
|
|
140
|
+
* Must stay in sync with the Go and Ruby versions. The shared fixture
|
|
141
|
+
* at tokenscript/test-suites/token-name-validation.json proves they agree.
|
|
142
|
+
* Uses explicit whitespace chars (not \s) to ensure identical behavior
|
|
143
|
+
* across Go/JS/Ruby regex engines.
|
|
144
|
+
*/
|
|
145
|
+
/** Returns true if a single name segment is valid: non-empty and contains no whitespace, braces, or brackets. */
|
|
146
|
+
declare function validateTokenName(name: string): boolean;
|
|
147
|
+
/** Returns true if every segment of a dot-delimited token path is a valid token name. */
|
|
148
|
+
declare function validateTokenPath(path: string): boolean;
|
|
149
|
+
|
|
150
|
+
export { BuildTokensOptions, type FlattenCallback, TokenBuilder, TokenData, TokenDataMap, TokenOperationResult, buildTokens, index as builders, flattenChildrenMap, flattenChildrenObject, getAffectedTokens, getBrokenReferences, getModifiedDependants, getRenamedReferences, processTokenSets, processTokens, validateTokenName, validateTokenPath };
|
package/dist/lib/processor.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { T as TokenBuilder, B as BuildTokensOptions, m as BuilderFormat, g as TokenDataMap, l as buildTokens, n as ProcessSetsOptions, a as ProcessResult, f as TokenData, o as ProcessOptions, h as TokenOperationResult, p as RefPath } from './types-
|
|
2
|
-
export { C as CreateTokenParams, b as CreateTokenResult, D as DeleteTokenParams, c as DeleteTokenResult, I as IssuesMap, d as ProcessorOutput, e as ProcessorResult, R as ResolveIssue, i as TokenResolver, U as UpdateTokenParams, j as UpdateTokenResult, V as ValidationIssue, k as ValidationSeverity } from './types-
|
|
3
|
-
import { l as InterpreterResult } from './interpreter-
|
|
4
|
-
import './types-
|
|
1
|
+
import { T as TokenBuilder, B as BuildTokensOptions, m as BuilderFormat, g as TokenDataMap, l as buildTokens, n as ProcessSetsOptions, a as ProcessResult, f as TokenData, o as ProcessOptions, h as TokenOperationResult, p as RefPath } from './types-BI0AZ4Ej.js';
|
|
2
|
+
export { C as CreateTokenParams, b as CreateTokenResult, D as DeleteTokenParams, c as DeleteTokenResult, I as IssuesMap, d as ProcessorOutput, e as ProcessorResult, R as ResolveIssue, i as TokenResolver, U as UpdateTokenParams, j as UpdateTokenResult, V as ValidationIssue, k as ValidationSeverity } from './types-BI0AZ4Ej.js';
|
|
3
|
+
import { l as InterpreterResult } from './interpreter-v7WiwSP9.js';
|
|
4
|
+
import './types-EB8V9c46.js';
|
|
5
5
|
import '@tokens-studio/schema-validation';
|
|
6
6
|
|
|
7
7
|
type FlattenCallback<T> = (key: string, value: InterpreterResult) => T;
|
|
@@ -134,4 +134,17 @@ declare function getRenamedReferences(_result: TokenOperationResult, modifiedTok
|
|
|
134
134
|
*/
|
|
135
135
|
declare function getModifiedDependants(oldTokens: Map<RefPath, any>, result: TokenOperationResult): Set<RefPath>;
|
|
136
136
|
|
|
137
|
-
|
|
137
|
+
/**
|
|
138
|
+
* Token name validation.
|
|
139
|
+
*
|
|
140
|
+
* Must stay in sync with the Go and Ruby versions. The shared fixture
|
|
141
|
+
* at tokenscript/test-suites/token-name-validation.json proves they agree.
|
|
142
|
+
* Uses explicit whitespace chars (not \s) to ensure identical behavior
|
|
143
|
+
* across Go/JS/Ruby regex engines.
|
|
144
|
+
*/
|
|
145
|
+
/** Returns true if a single name segment is valid: non-empty and contains no whitespace, braces, or brackets. */
|
|
146
|
+
declare function validateTokenName(name: string): boolean;
|
|
147
|
+
/** Returns true if every segment of a dot-delimited token path is a valid token name. */
|
|
148
|
+
declare function validateTokenPath(path: string): boolean;
|
|
149
|
+
|
|
150
|
+
export { BuildTokensOptions, type FlattenCallback, TokenBuilder, TokenData, TokenDataMap, TokenOperationResult, buildTokens, index as builders, flattenChildrenMap, flattenChildrenObject, getAffectedTokens, getBrokenReferences, getModifiedDependants, getRenamedReferences, processTokenSets, processTokens, validateTokenName, validateTokenPath };
|
package/dist/lib/processor.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { TokenResolver, ValidationSeverity, buildTokens, builders_exports as builders, flattenChildrenMap, flattenChildrenObject, getAffectedTokens, getBrokenReferences, getModifiedDependants, getRenamedReferences, processTokenSets, processTokens } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
1
|
+
export { TokenResolver, ValidationSeverity, buildTokens, builders_exports as builders, flattenChildrenMap, flattenChildrenObject, getAffectedTokens, getBrokenReferences, getModifiedDependants, getRenamedReferences, processTokenSets, processTokens, validateTokenName, validateTokenPath } from './chunk-RWXDOZAS.js';
|
|
2
|
+
import './chunk-LSTH2XJ4.js';
|
|
3
|
+
import './chunk-ODVWXGOM.js';
|
|
4
4
|
//# sourceMappingURL=processor.js.map
|
|
5
5
|
//# sourceMappingURL=processor.js.map
|
package/dist/lib/schema.cjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
3
|
+
var chunkYCIBJDRB_cjs = require('./chunk-YCIBJDRB.cjs');
|
|
4
|
+
require('./chunk-LMGHS2NP.cjs');
|
|
5
|
+
require('./chunk-LEYHQJTL.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "fetchAndRegisterSchemas", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkYCIBJDRB_cjs.fetchAndRegisterSchemas; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "fetchTokenScriptSchema", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkYCIBJDRB_cjs.fetchTokenScriptSchema; }
|
|
16
16
|
});
|
|
17
17
|
//# sourceMappingURL=schema.cjs.map
|
|
18
18
|
//# sourceMappingURL=schema.cjs.map
|
package/dist/lib/schema.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as ColorSpecification, F as FunctionSpecification, e as Config } from './types-
|
|
1
|
+
import { b as ColorSpecification, F as FunctionSpecification, e as Config } from './types-EB8V9c46.cjs';
|
|
2
2
|
import '@tokens-studio/schema-validation';
|
|
3
3
|
|
|
4
4
|
interface TokenScriptSchemaResponse {
|
package/dist/lib/schema.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as ColorSpecification, F as FunctionSpecification, e as Config } from './types-
|
|
1
|
+
import { b as ColorSpecification, F as FunctionSpecification, e as Config } from './types-EB8V9c46.js';
|
|
2
2
|
import '@tokens-studio/schema-validation';
|
|
3
3
|
|
|
4
4
|
interface TokenScriptSchemaResponse {
|
package/dist/lib/schema.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { fetchAndRegisterSchemas, fetchTokenScriptSchema } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
1
|
+
export { fetchAndRegisterSchemas, fetchTokenScriptSchema } from './chunk-RWXDOZAS.js';
|
|
2
|
+
import './chunk-LSTH2XJ4.js';
|
|
3
|
+
import './chunk-ODVWXGOM.js';
|
|
4
4
|
//# sourceMappingURL=schema.js.map
|
|
5
5
|
//# sourceMappingURL=schema.js.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkLMGHS2NP_cjs = require('./chunk-LMGHS2NP.cjs');
|
|
4
|
+
var chunkLEYHQJTL_cjs = require('./chunk-LEYHQJTL.cjs');
|
|
5
5
|
|
|
6
6
|
// src/syntax-highlighter/spec.ts
|
|
7
|
-
var KEYWORDS = Object.values(
|
|
7
|
+
var KEYWORDS = Object.values(chunkLEYHQJTL_cjs.ReservedKeyword);
|
|
8
8
|
var TYPES = [
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
chunkLMGHS2NP_cjs.StringSymbol.type,
|
|
10
|
+
chunkLMGHS2NP_cjs.NumberSymbol.type,
|
|
11
|
+
chunkLMGHS2NP_cjs.NumberWithUnitSymbol.type,
|
|
12
|
+
chunkLMGHS2NP_cjs.ColorSymbol.type,
|
|
13
|
+
chunkLMGHS2NP_cjs.ListSymbol.type,
|
|
14
|
+
chunkLMGHS2NP_cjs.DictionarySymbol.type,
|
|
15
|
+
chunkLMGHS2NP_cjs.BooleanSymbol.type
|
|
16
16
|
];
|
|
17
17
|
var BUILTIN_FUNCTIONS = [
|
|
18
18
|
"rgb",
|
|
@@ -35,9 +35,9 @@ var BUILTIN_FUNCTIONS = [
|
|
|
35
35
|
"linear-gradient",
|
|
36
36
|
"type"
|
|
37
37
|
];
|
|
38
|
-
var UNITS = Object.values(
|
|
38
|
+
var UNITS = Object.values(chunkLEYHQJTL_cjs.SupportedFormats);
|
|
39
39
|
var OPERATORS = [
|
|
40
|
-
...Object.values(
|
|
40
|
+
...Object.values(chunkLEYHQJTL_cjs.Operations),
|
|
41
41
|
"=",
|
|
42
42
|
">",
|
|
43
43
|
"<",
|
|
@@ -91,12 +91,12 @@ var MONACO_PATTERNS = {
|
|
|
91
91
|
function createKeywordPattern(keywords) {
|
|
92
92
|
return new RegExp(`\\b(?:${keywords.join("|")})\\b`);
|
|
93
93
|
}
|
|
94
|
-
|
|
94
|
+
chunkLEYHQJTL_cjs.__name(createKeywordPattern, "createKeywordPattern");
|
|
95
95
|
function createUnitPattern(units) {
|
|
96
96
|
const escapedUnits = units.map((unit) => unit.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
|
|
97
97
|
return new RegExp(`\\b\\d+(?:\\.\\d+)?(?:${escapedUnits.join("|")})(?!\\w)`);
|
|
98
98
|
}
|
|
99
|
-
|
|
99
|
+
chunkLEYHQJTL_cjs.__name(createUnitPattern, "createUnitPattern");
|
|
100
100
|
|
|
101
101
|
// src/syntax-highlighter/monaco.ts
|
|
102
102
|
var tokenscriptLanguageDefinition = {
|
|
@@ -269,7 +269,7 @@ function tokenscriptLanguage(Prism) {
|
|
|
269
269
|
Prism.languages.ts = Prism.languages.tokenscript;
|
|
270
270
|
return Prism.languages.tokenscript;
|
|
271
271
|
}
|
|
272
|
-
|
|
272
|
+
chunkLEYHQJTL_cjs.__name(tokenscriptLanguage, "tokenscriptLanguage");
|
|
273
273
|
|
|
274
274
|
exports.BUILTIN_FUNCTIONS = BUILTIN_FUNCTIONS;
|
|
275
275
|
exports.KEYWORDS = KEYWORDS;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { languages } from 'monaco-editor';
|
|
2
|
-
import { p as ReservedKeyword, O as Operations, q as SupportedFormats } from './types-
|
|
2
|
+
import { p as ReservedKeyword, O as Operations, q as SupportedFormats } from './types-EB8V9c46.cjs';
|
|
3
3
|
import '@tokens-studio/schema-validation';
|
|
4
4
|
|
|
5
5
|
declare const tokenscriptLanguageDefinition: languages.IMonarchLanguage;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { languages } from 'monaco-editor';
|
|
2
|
-
import { p as ReservedKeyword, O as Operations, q as SupportedFormats } from './types-
|
|
2
|
+
import { p as ReservedKeyword, O as Operations, q as SupportedFormats } from './types-EB8V9c46.js';
|
|
3
3
|
import '@tokens-studio/schema-validation';
|
|
4
4
|
|
|
5
5
|
declare const tokenscriptLanguageDefinition: languages.IMonarchLanguage;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { StringSymbol, NumberSymbol, NumberWithUnitSymbol, ColorSymbol, ListSymbol, DictionarySymbol, BooleanSymbol } from './chunk-
|
|
2
|
-
import { ReservedKeyword, SupportedFormats, Operations, __name } from './chunk-
|
|
1
|
+
import { StringSymbol, NumberSymbol, NumberWithUnitSymbol, ColorSymbol, ListSymbol, DictionarySymbol, BooleanSymbol } from './chunk-LSTH2XJ4.js';
|
|
2
|
+
import { ReservedKeyword, SupportedFormats, Operations, __name } from './chunk-ODVWXGOM.js';
|
|
3
3
|
|
|
4
4
|
// src/syntax-highlighter/spec.ts
|
|
5
5
|
var KEYWORDS = Object.values(ReservedKeyword);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as InterpreterResult, L as LanguageError } from './interpreter-
|
|
2
|
-
import { e as Config, I as ISymbolType, r as SymbolMetadata } from './types-
|
|
1
|
+
import { l as InterpreterResult, L as LanguageError } from './interpreter-v7WiwSP9.js';
|
|
2
|
+
import { e as Config, I as ISymbolType, r as SymbolMetadata } from './types-EB8V9c46.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* ObjectParser allows custom transformation of structured values into interpreter symbols.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as InterpreterResult, L as LanguageError } from './interpreter-
|
|
2
|
-
import { e as Config, I as ISymbolType, r as SymbolMetadata } from './types-
|
|
1
|
+
import { l as InterpreterResult, L as LanguageError } from './interpreter-6QwMkUqD.cjs';
|
|
2
|
+
import { e as Config, I as ISymbolType, r as SymbolMetadata } from './types-EB8V9c46.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* ObjectParser allows custom transformation of structured values into interpreter symbols.
|
package/dist/lib/types.cjs
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkLEYHQJTL_cjs = require('./chunk-LEYHQJTL.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "Operations", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkLEYHQJTL_cjs.Operations; }
|
|
10
10
|
});
|
|
11
11
|
Object.defineProperty(exports, "ReservedKeyword", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkLEYHQJTL_cjs.ReservedKeyword; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "SupportedFormats", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkLEYHQJTL_cjs.SupportedFormats; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "TokenType", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkLEYHQJTL_cjs.TokenType; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "UNINTERPRETED_KEYWORDS", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkLEYHQJTL_cjs.UNINTERPRETED_KEYWORDS; }
|
|
26
26
|
});
|
|
27
27
|
//# sourceMappingURL=types.cjs.map
|
|
28
28
|
//# sourceMappingURL=types.cjs.map
|
package/dist/lib/types.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { A as ASTNode, I as ISymbolType, O as Operations, R as ReferenceRecord, o as ReferenceRecordValue, p as ReservedKeyword, q as SupportedFormats, r as SymbolMetadata, T as Token, t as TokenType, U as UNINTERPRETED_KEYWORDS } from './types-
|
|
1
|
+
export { A as ASTNode, I as ISymbolType, O as Operations, R as ReferenceRecord, o as ReferenceRecordValue, p as ReservedKeyword, q as SupportedFormats, r as SymbolMetadata, T as Token, t as TokenType, U as UNINTERPRETED_KEYWORDS } from './types-EB8V9c46.cjs';
|
|
2
2
|
import '@tokens-studio/schema-validation';
|
package/dist/lib/types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { A as ASTNode, I as ISymbolType, O as Operations, R as ReferenceRecord, o as ReferenceRecordValue, p as ReservedKeyword, q as SupportedFormats, r as SymbolMetadata, T as Token, t as TokenType, U as UNINTERPRETED_KEYWORDS } from './types-
|
|
1
|
+
export { A as ASTNode, I as ISymbolType, O as Operations, R as ReferenceRecord, o as ReferenceRecordValue, p as ReservedKeyword, q as SupportedFormats, r as SymbolMetadata, T as Token, t as TokenType, U as UNINTERPRETED_KEYWORDS } from './types-EB8V9c46.js';
|
|
2
2
|
import '@tokens-studio/schema-validation';
|
package/dist/lib/types.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { Operations, ReservedKeyword, SupportedFormats, TokenType, UNINTERPRETED_KEYWORDS } from './chunk-
|
|
1
|
+
export { Operations, ReservedKeyword, SupportedFormats, TokenType, UNINTERPRETED_KEYWORDS } from './chunk-ODVWXGOM.js';
|
|
2
2
|
//# sourceMappingURL=types.js.map
|
|
3
3
|
//# sourceMappingURL=types.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { I as ISymbolType, C as Config, T as Token, S as SymbolMetadata } from '../config-
|
|
1
|
+
import { I as ISymbolType, C as Config, T as Token, S as SymbolMetadata } from '../config-DtbN3iyg.js';
|
|
2
2
|
import '@tokens-studio/schema-validation';
|
|
3
3
|
|
|
4
4
|
type InterpreterResult = ISymbolType | string | null;
|
|
@@ -474,4 +474,17 @@ declare function getTokensWithIssues(issues: IssuesMap | undefined): Set<string>
|
|
|
474
474
|
*/
|
|
475
475
|
declare function hasAnyIssues(issues: IssuesMap | undefined): boolean;
|
|
476
476
|
|
|
477
|
-
|
|
477
|
+
/**
|
|
478
|
+
* Token name validation.
|
|
479
|
+
*
|
|
480
|
+
* Must stay in sync with the Go and Ruby versions. The shared fixture
|
|
481
|
+
* at tokenscript/test-suites/token-name-validation.json proves they agree.
|
|
482
|
+
* Uses explicit whitespace chars (not \s) to ensure identical behavior
|
|
483
|
+
* across Go/JS/Ruby regex engines.
|
|
484
|
+
*/
|
|
485
|
+
/** Returns true if a single name segment is valid: non-empty and contains no whitespace, braces, or brackets. */
|
|
486
|
+
declare function validateTokenName(name: string): boolean;
|
|
487
|
+
/** Returns true if every segment of a dot-delimited token path is a valid token name. */
|
|
488
|
+
declare function validateTokenPath(path: string): boolean;
|
|
489
|
+
|
|
490
|
+
export { type BuildTokensOptions, type BuilderFormat, type CreateTokenParams, type CreateTokenResult, type DeleteTokenParams, type DeleteTokenResult, FlatObjectBuilder, type FlattenCallback, type IssuesMap, MapBuilder, NestedObjectBuilder, type ObjectParser, type ProcessFilesOptions, type ProcessOptions, type ProcessResult, type ProcessSetsOptions, type ProcessorOutput, type ProcessorResult, type ResolveIssue, type ResolveValueParams, type ResolveValueResult, StringMapBuilder, type TokenBuilder, type TokenDataMap, type TokenOperationResult, TokenResolver, type UpdateTokenParams, type UpdateTokenResult, type ValidationIssue, ValidationSeverity, buildTokens, createDependencyError, defaultObjectParsers, flattenChildrenMap, flattenChildrenObject, getAffectedTokens, getBrokenReferences, getModifiedDependants, getRenamedReferences, getTokensWithIssues, hasAnyIssues, hasIssueWithCode, numberWithUnitParser, processTokenSets, processTokens, tokenHasIssueWithCode, validateTokenName, validateTokenPath };
|
package/dist/processor/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NumberWithUnitSymbol, isLanguageError, ProcessorError, isObject, isNumber, isString, renameReferences, parseExpression, DictionarySymbol, serializeInterpreterResult, stringifyInterpreterResult, StringSymbol, NumberSymbol, isBoolean, BooleanSymbol, isNull, NullSymbol, isArray, TokenSymbol, ListSymbol, isTokenscriptSymbol, Interpreter, jsValueToSymbolType, getKeyAlt } from '../chunk-
|
|
2
|
-
import { UNINTERPRETED_KEYWORDS } from '../chunk-
|
|
1
|
+
import { NumberWithUnitSymbol, isLanguageError, ProcessorError, isObject, isNumber, isString, renameReferences, parseExpression, DictionarySymbol, serializeInterpreterResult, stringifyInterpreterResult, StringSymbol, NumberSymbol, isBoolean, BooleanSymbol, isNull, NullSymbol, isArray, TokenSymbol, ListSymbol, isTokenscriptSymbol, Interpreter, jsValueToSymbolType, getKeyAlt } from '../chunk-33CDF4L4.js';
|
|
2
|
+
import { UNINTERPRETED_KEYWORDS } from '../chunk-AXH5N7KV.js';
|
|
3
3
|
import { z } from '@tokens-studio/schema-validation';
|
|
4
4
|
|
|
5
5
|
// src/processor/resolver/DependencyTracker.ts
|
|
@@ -945,6 +945,18 @@ var DependencyGraph = class {
|
|
|
945
945
|
}
|
|
946
946
|
};
|
|
947
947
|
|
|
948
|
+
// src/processor/utils/name-validation.ts
|
|
949
|
+
var INVALID_TOKEN_NAME_CHARS = /[ \t\n\r\f{}[\]]/;
|
|
950
|
+
function validateTokenName(name) {
|
|
951
|
+
return name.length > 0 && !INVALID_TOKEN_NAME_CHARS.test(name);
|
|
952
|
+
}
|
|
953
|
+
function splitTokenPath(path) {
|
|
954
|
+
return path.split(".");
|
|
955
|
+
}
|
|
956
|
+
function validateTokenPath(path) {
|
|
957
|
+
return splitTokenPath(path).every(validateTokenName);
|
|
958
|
+
}
|
|
959
|
+
|
|
948
960
|
// src/processor/utils/structured-tokens.ts
|
|
949
961
|
function matchesObjectParser(value, parsers) {
|
|
950
962
|
if (!isObject(value)) return false;
|
|
@@ -1303,6 +1315,15 @@ var PrefixResolver = class _PrefixResolver {
|
|
|
1303
1315
|
parseAndBuildGraph() {
|
|
1304
1316
|
this.earlyResolved = [];
|
|
1305
1317
|
for (const [tokenName, tokenData] of this.tokens.entries()) {
|
|
1318
|
+
if (!validateTokenPath(tokenName)) {
|
|
1319
|
+
this.addIssue(tokenName, {
|
|
1320
|
+
code: "INVALID_TOKEN_NAME",
|
|
1321
|
+
severity: "error" /* ERROR */,
|
|
1322
|
+
message: `token "${tokenName}" contains invalid characters in name (spaces, braces, or brackets are not allowed)`,
|
|
1323
|
+
tokenName,
|
|
1324
|
+
data: { path: tokenName }
|
|
1325
|
+
});
|
|
1326
|
+
}
|
|
1306
1327
|
const tokenValue = getTokenValue(tokenData);
|
|
1307
1328
|
if (isString(tokenValue) && UNINTERPRETED_KEYWORDS.includes(tokenValue)) {
|
|
1308
1329
|
const symbol = new StringSymbol(tokenValue, this.config);
|
|
@@ -2227,6 +2248,6 @@ var StringMapBuilder = class extends MapBuilder {
|
|
|
2227
2248
|
}
|
|
2228
2249
|
};
|
|
2229
2250
|
|
|
2230
|
-
export { FlatObjectBuilder, MapBuilder, NestedObjectBuilder, StringMapBuilder, TokenResolver, ValidationSeverity, buildTokens, createDependencyError, defaultObjectParsers, flattenChildrenMap, flattenChildrenObject, getAffectedTokens, getBrokenReferences, getModifiedDependants, getRenamedReferences, getTokensWithIssues, hasAnyIssues, hasIssueWithCode, numberWithUnitParser, processTokenSets, processTokens, tokenHasIssueWithCode };
|
|
2251
|
+
export { FlatObjectBuilder, MapBuilder, NestedObjectBuilder, StringMapBuilder, TokenResolver, ValidationSeverity, buildTokens, createDependencyError, defaultObjectParsers, flattenChildrenMap, flattenChildrenObject, getAffectedTokens, getBrokenReferences, getModifiedDependants, getRenamedReferences, getTokensWithIssues, hasAnyIssues, hasIssueWithCode, numberWithUnitParser, processTokenSets, processTokens, tokenHasIssueWithCode, validateTokenName, validateTokenPath };
|
|
2231
2252
|
//# sourceMappingURL=index.js.map
|
|
2232
2253
|
//# sourceMappingURL=index.js.map
|