@breadstone-infrastructure/style-dictionary 0.0.174 → 0.0.176
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/CHANGELOG.md +20 -0
- package/formats/tailwind/DesignTokenType.d.ts +10 -0
- package/formats/tailwind/DesignTokenType.d.ts.map +1 -0
- package/formats/tailwind/DesignTokenType.js +3 -0
- package/formats/tailwind/DesignTokenType.js.map +1 -0
- package/formats/tailwind/TailwindPropertyMapping.d.ts +61 -0
- package/formats/tailwind/TailwindPropertyMapping.d.ts.map +1 -0
- package/formats/tailwind/TailwindPropertyMapping.js +326 -0
- package/formats/tailwind/TailwindPropertyMapping.js.map +1 -0
- package/formats/tailwind/buildTailwindConfig.d.ts +23 -0
- package/formats/tailwind/buildTailwindConfig.d.ts.map +1 -0
- package/formats/tailwind/buildTailwindConfig.js +258 -0
- package/formats/tailwind/buildTailwindConfig.js.map +1 -0
- package/formats/tailwind/index.d.ts +2 -0
- package/formats/tailwind/index.d.ts.map +1 -0
- package/formats/tailwind/index.js +18 -0
- package/formats/tailwind/index.js.map +1 -0
- package/formats/tailwind/tailwindFormat.d.ts +17 -0
- package/formats/tailwind/tailwindFormat.d.ts.map +1 -0
- package/formats/tailwind/tailwindFormat.js +77 -0
- package/formats/tailwind/tailwindFormat.js.map +1 -0
- package/index.d.ts +9 -9
- package/index.d.ts.map +1 -1
- package/index.js +31 -19
- package/index.js.map +1 -1
- package/package.json +4 -3
- package/preprocessors/{Shadow.d.ts → expandShadowPreprocessor.d.ts} +1 -1
- package/preprocessors/expandShadowPreprocessor.d.ts.map +1 -0
- package/preprocessors/{Shadow.js → expandShadowPreprocessor.js} +1 -12
- package/preprocessors/expandShadowPreprocessor.js.map +1 -0
- package/preprocessors/lint/engine/preprocessor.d.ts +12 -0
- package/preprocessors/lint/engine/preprocessor.d.ts.map +1 -0
- package/preprocessors/lint/engine/preprocessor.js +44 -0
- package/preprocessors/lint/engine/preprocessor.js.map +1 -0
- package/preprocessors/lint/engine/types.d.ts +21 -0
- package/preprocessors/lint/engine/types.d.ts.map +1 -0
- package/preprocessors/lint/engine/types.js +4 -0
- package/preprocessors/lint/engine/types.js.map +1 -0
- package/preprocessors/lint/engine/walker.d.ts +13 -0
- package/preprocessors/lint/engine/walker.d.ts.map +1 -0
- package/preprocessors/lint/engine/walker.js +30 -0
- package/preprocessors/lint/engine/walker.js.map +1 -0
- package/preprocessors/lint/index.d.ts +4 -0
- package/preprocessors/lint/index.d.ts.map +1 -0
- package/preprocessors/lint/index.js +19 -0
- package/preprocessors/lint/index.js.map +1 -0
- package/preprocessors/lint/rules/forbiddenTokenName.d.ts +25 -0
- package/preprocessors/lint/rules/forbiddenTokenName.d.ts.map +1 -0
- package/preprocessors/lint/rules/forbiddenTokenName.js +40 -0
- package/preprocessors/lint/rules/forbiddenTokenName.js.map +1 -0
- package/preprocessors/lint/rules/forbiddenValue.d.ts +31 -0
- package/preprocessors/lint/rules/forbiddenValue.d.ts.map +1 -0
- package/preprocessors/lint/rules/forbiddenValue.js +48 -0
- package/preprocessors/lint/rules/forbiddenValue.js.map +1 -0
- package/preprocessors/lint/rules/index.d.ts +9 -0
- package/preprocessors/lint/rules/index.d.ts.map +1 -0
- package/preprocessors/lint/rules/index.js +25 -0
- package/preprocessors/lint/rules/index.js.map +1 -0
- package/preprocessors/lint/rules/namingConvention.d.ts +26 -0
- package/preprocessors/lint/rules/namingConvention.d.ts.map +1 -0
- package/preprocessors/lint/rules/namingConvention.js +35 -0
- package/preprocessors/lint/rules/namingConvention.js.map +1 -0
- package/preprocessors/lint/rules/noDollarProps.d.ts +6 -0
- package/preprocessors/lint/rules/noDollarProps.d.ts.map +1 -0
- package/preprocessors/lint/rules/noDollarProps.js +27 -0
- package/preprocessors/lint/rules/noDollarProps.js.map +1 -0
- package/preprocessors/lint/rules/requireType.d.ts +6 -0
- package/preprocessors/lint/rules/requireType.d.ts.map +1 -0
- package/preprocessors/lint/rules/requireType.js +21 -0
- package/preprocessors/lint/rules/requireType.js.map +1 -0
- package/preprocessors/lint/rules/requireValue.d.ts +6 -0
- package/preprocessors/lint/rules/requireValue.d.ts.map +1 -0
- package/preprocessors/lint/rules/requireValue.js +21 -0
- package/preprocessors/lint/rules/requireValue.js.map +1 -0
- package/preprocessors/lint/rules/validType.d.ts +25 -0
- package/preprocessors/lint/rules/validType.d.ts.map +1 -0
- package/preprocessors/lint/rules/validType.js +41 -0
- package/preprocessors/lint/rules/validType.js.map +1 -0
- package/preprocessors/lint/rules/valueTypeByTokenType.d.ts +40 -0
- package/preprocessors/lint/rules/valueTypeByTokenType.d.ts.map +1 -0
- package/preprocessors/lint/rules/valueTypeByTokenType.js +80 -0
- package/preprocessors/lint/rules/valueTypeByTokenType.js.map +1 -0
- package/transforms/gradientCssTransform.d.ts +3 -0
- package/transforms/gradientCssTransform.d.ts.map +1 -0
- package/transforms/{Gradient.js → gradientCssTransform.js} +4 -4
- package/transforms/gradientCssTransform.js.map +1 -0
- package/transforms/letterSpacingCalcCssTransform.d.ts +3 -0
- package/transforms/letterSpacingCalcCssTransform.d.ts.map +1 -0
- package/transforms/{LetterSpacing.js → letterSpacingCalcCssTransform.js} +4 -4
- package/transforms/letterSpacingCalcCssTransform.js.map +1 -0
- package/transforms/listScssTransform.d.ts +3 -0
- package/transforms/listScssTransform.d.ts.map +1 -0
- package/transforms/{List.js → listScssTransform.js} +4 -4
- package/transforms/listScssTransform.js.map +1 -0
- package/transforms/oklchCssTransform.d.ts +7 -0
- package/transforms/oklchCssTransform.d.ts.map +1 -0
- package/transforms/oklchCssTransform.js +52 -0
- package/transforms/oklchCssTransform.js.map +1 -0
- package/transforms/{QuoteString.d.ts → quoteStringTransform.d.ts} +1 -1
- package/transforms/quoteStringTransform.d.ts.map +1 -0
- package/transforms/{QuoteString.js → quoteStringTransform.js} +2 -2
- package/transforms/quoteStringTransform.js.map +1 -0
- package/transforms/{Shadow.d.ts → shadowCssTransform.d.ts} +1 -1
- package/transforms/shadowCssTransform.d.ts.map +1 -0
- package/transforms/{Shadow.js → shadowCssTransform.js} +2 -2
- package/transforms/shadowCssTransform.js.map +1 -0
- package/utilities/{Extract.d.ts → extractTokensByType.d.ts} +1 -1
- package/utilities/extractTokensByType.d.ts.map +1 -0
- package/utilities/{Extract.js → extractTokensByType.js} +2 -2
- package/utilities/extractTokensByType.js.map +1 -0
- package/formats/tailwind.d.ts +0 -3
- package/formats/tailwind.d.ts.map +0 -1
- package/formats/tailwind.js +0 -209
- package/formats/tailwind.js.map +0 -1
- package/preprocessors/Lint.d.ts +0 -3
- package/preprocessors/Lint.d.ts.map +0 -1
- package/preprocessors/Lint.js +0 -65
- package/preprocessors/Lint.js.map +0 -1
- package/preprocessors/Shadow.d.ts.map +0 -1
- package/preprocessors/Shadow.js.map +0 -1
- package/transforms/Gradient.d.ts +0 -3
- package/transforms/Gradient.d.ts.map +0 -1
- package/transforms/Gradient.js.map +0 -1
- package/transforms/LetterSpacing.d.ts +0 -3
- package/transforms/LetterSpacing.d.ts.map +0 -1
- package/transforms/LetterSpacing.js.map +0 -1
- package/transforms/List.d.ts +0 -3
- package/transforms/List.d.ts.map +0 -1
- package/transforms/List.js.map +0 -1
- package/transforms/NameSnakeUpperCase.d.ts +0 -6
- package/transforms/NameSnakeUpperCase.d.ts.map +0 -1
- package/transforms/NameSnakeUpperCase.js +0 -20
- package/transforms/NameSnakeUpperCase.js.map +0 -1
- package/transforms/QuoteString.d.ts.map +0 -1
- package/transforms/QuoteString.js.map +0 -1
- package/transforms/Shadow.d.ts.map +0 -1
- package/transforms/Shadow.js.map +0 -1
- package/utilities/Extract.d.ts.map +0 -1
- package/utilities/Extract.js.map +0 -1
- /package/utilities/{GetValue.d.ts → getValue.d.ts} +0 -0
- /package/utilities/{GetValue.d.ts.map → getValue.d.ts.map} +0 -0
- /package/utilities/{GetValue.js → getValue.js} +0 -0
- /package/utilities/{GetValue.js.map → getValue.js.map} +0 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ruleValidType = ruleValidType;
|
|
4
|
+
/**
|
|
5
|
+
* Rule: token.type must exist (optional) and must be part of a known set.
|
|
6
|
+
*/
|
|
7
|
+
function ruleValidType(options) {
|
|
8
|
+
const { allowedTypes, severity = 'error', requireType = false } = options;
|
|
9
|
+
const allowed = new Set(allowedTypes);
|
|
10
|
+
return (token, path) => {
|
|
11
|
+
const issues = [];
|
|
12
|
+
if (!('type' in token)) {
|
|
13
|
+
if (requireType) {
|
|
14
|
+
issues.push({
|
|
15
|
+
message: 'Token is missing required "type" property.',
|
|
16
|
+
severity,
|
|
17
|
+
path
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return issues;
|
|
21
|
+
}
|
|
22
|
+
const typeValue = token.type;
|
|
23
|
+
if (typeof typeValue !== 'string') {
|
|
24
|
+
issues.push({
|
|
25
|
+
message: `Token "type" must be a string, but is "${typeof typeValue}".`,
|
|
26
|
+
severity,
|
|
27
|
+
path
|
|
28
|
+
});
|
|
29
|
+
return issues;
|
|
30
|
+
}
|
|
31
|
+
if (!allowed.has(typeValue)) {
|
|
32
|
+
issues.push({
|
|
33
|
+
message: `Token type "${typeValue}" is not in the allowed list: [${Array.from(allowed).join(', ')}].`,
|
|
34
|
+
severity,
|
|
35
|
+
path
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return issues;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=validType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validType.js","sourceRoot":"","sources":["../../../../src/preprocessors/lint/rules/validType.ts"],"names":[],"mappings":";;AA4BA,sCAgDC;AAnDD;;GAEG;AACH,SAAgB,aAAa,CACzB,OAA6B;IAE7B,MAAM,EACF,YAAY,EACZ,QAAQ,GAAG,OAAO,EAClB,WAAW,GAAG,KAAK,EACtB,GAAG,OAAO,CAAC;IAEZ,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,YAAY,CAAC,CAAC;IAEtC,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QACnB,MAAM,MAAM,GAAG,EAAE,CAAC;QAElB,IAAI,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC,EAAE,CAAC;YACrB,IAAI,WAAW,EAAE,CAAC;gBACd,MAAM,CAAC,IAAI,CAAC;oBACR,OAAO,EAAE,4CAA4C;oBACrD,QAAQ;oBACR,IAAI;iBACP,CAAC,CAAC;YACP,CAAC;YACD,OAAO,MAAM,CAAC;QAClB,CAAC;QAED,MAAM,SAAS,GAAI,KAAa,CAAC,IAAI,CAAC;QAEtC,IAAI,OAAO,SAAS,KAAK,QAAQ,EAAE,CAAC;YAChC,MAAM,CAAC,IAAI,CAAC;gBACR,OAAO,EAAE,0CAA0C,OAAO,SAAS,IAAI;gBACvE,QAAQ;gBACR,IAAI;aACP,CAAC,CAAC;YACH,OAAO,MAAM,CAAC;QAClB,CAAC;QAED,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;YAC1B,MAAM,CAAC,IAAI,CAAC;gBACR,OAAO,EAAE,eAAe,SAAS,kCAAkC,KAAK,CAAC,IAAI,CACzE,OAAO,CACV,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;gBAChB,QAAQ;gBACR,IAAI;aACP,CAAC,CAAC;QACP,CAAC;QAED,OAAO,MAAM,CAAC;IAClB,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { LintRule, LintSeverity } from '../engine/types';
|
|
2
|
+
/**
|
|
3
|
+
* Supported JS-level classifications for token values.
|
|
4
|
+
*/
|
|
5
|
+
export type ValueKind = 'string' | 'number' | 'boolean' | 'object' | 'array';
|
|
6
|
+
/**
|
|
7
|
+
* Mapping from token.type -> allowed JS value kinds.
|
|
8
|
+
*/
|
|
9
|
+
export type ValueTypeMap = Record<string, ValueKind | Array<ValueKind>>;
|
|
10
|
+
/**
|
|
11
|
+
* Options for the value-type-by-token-type rule.
|
|
12
|
+
*/
|
|
13
|
+
export interface ValueTypeByTokenTypeRuleOptions {
|
|
14
|
+
/**
|
|
15
|
+
* Mapping from token.type (e.g. "color") to allowed JS value kinds (e.g. "string").
|
|
16
|
+
*/
|
|
17
|
+
readonly map: ValueTypeMap;
|
|
18
|
+
/**
|
|
19
|
+
* Severity when a mismatch is detected.
|
|
20
|
+
* Defaults to "error".
|
|
21
|
+
*/
|
|
22
|
+
readonly severity?: LintSeverity;
|
|
23
|
+
/**
|
|
24
|
+
* If true, tokens without "type" will be reported as issues.
|
|
25
|
+
* If false, tokens without "type" are ignored by this rule.
|
|
26
|
+
* Defaults to false.
|
|
27
|
+
*/
|
|
28
|
+
readonly requireType?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* If true, tokens without "value" are reported as issues.
|
|
31
|
+
* Defaults to false (usually covered by a separate rule).
|
|
32
|
+
*/
|
|
33
|
+
readonly requireValue?: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Rule: enforces that token.value has a JS type compatible with token.type,
|
|
37
|
+
* based on a provided mapping.
|
|
38
|
+
*/
|
|
39
|
+
export declare function ruleValueTypeByTokenType(options: ValueTypeByTokenTypeRuleOptions): LintRule;
|
|
40
|
+
//# sourceMappingURL=valueTypeByTokenType.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"valueTypeByTokenType.d.ts","sourceRoot":"","sources":["../../../../src/preprocessors/lint/rules/valueTypeByTokenType.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,QAAQ,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEzE;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE7E;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;AAExE;;GAEG;AACH,MAAM,WAAW,+BAA+B;IAE5C;;OAEG;IACH,QAAQ,CAAC,GAAG,EAAE,YAAY,CAAC;IAE3B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC;IAEjC;;;;OAIG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAE/B;;;OAGG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;CACnC;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACpC,OAAO,EAAE,+BAA+B,GACzC,QAAQ,CA8DV"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ruleValueTypeByTokenType = ruleValueTypeByTokenType;
|
|
4
|
+
/**
|
|
5
|
+
* Rule: enforces that token.value has a JS type compatible with token.type,
|
|
6
|
+
* based on a provided mapping.
|
|
7
|
+
*/
|
|
8
|
+
function ruleValueTypeByTokenType(options) {
|
|
9
|
+
const { map, severity = 'error', requireType = false, requireValue = false } = options;
|
|
10
|
+
return (token, path) => {
|
|
11
|
+
const issues = [];
|
|
12
|
+
if (!('value' in token)) {
|
|
13
|
+
if (requireValue) {
|
|
14
|
+
issues.push({
|
|
15
|
+
message: 'Token is missing required "value" property.',
|
|
16
|
+
severity,
|
|
17
|
+
path
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return issues;
|
|
21
|
+
}
|
|
22
|
+
if (!('type' in token)) {
|
|
23
|
+
if (requireType) {
|
|
24
|
+
issues.push({
|
|
25
|
+
message: 'Token is missing required "type" property.',
|
|
26
|
+
severity,
|
|
27
|
+
path
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
return issues;
|
|
31
|
+
}
|
|
32
|
+
const typeValue = token.type;
|
|
33
|
+
const rawValue = token.value;
|
|
34
|
+
if (typeof typeValue !== 'string') {
|
|
35
|
+
issues.push({
|
|
36
|
+
message: 'Token "type" must be a string for value-type validation.',
|
|
37
|
+
severity,
|
|
38
|
+
path
|
|
39
|
+
});
|
|
40
|
+
return issues;
|
|
41
|
+
}
|
|
42
|
+
const allowed = map[typeValue];
|
|
43
|
+
const allowedKinds = Array.isArray(allowed) ? allowed : [allowed];
|
|
44
|
+
const actualKind = classifyValueKind(rawValue);
|
|
45
|
+
if (!allowedKinds.includes(actualKind)) {
|
|
46
|
+
issues.push({
|
|
47
|
+
message: `Token value type "${actualKind}" is not allowed for token type "${typeValue}". Allowed kinds: [${allowedKinds.join(', ')}].`,
|
|
48
|
+
severity,
|
|
49
|
+
path
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
return issues;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Classifies a JS value into a ValueKind.
|
|
57
|
+
*/
|
|
58
|
+
function classifyValueKind(value) {
|
|
59
|
+
if (Array.isArray(value)) {
|
|
60
|
+
return 'array';
|
|
61
|
+
}
|
|
62
|
+
const t = typeof value;
|
|
63
|
+
switch (t) {
|
|
64
|
+
case 'string':
|
|
65
|
+
return 'string';
|
|
66
|
+
case 'number':
|
|
67
|
+
case 'bigint':
|
|
68
|
+
return 'number';
|
|
69
|
+
case 'boolean':
|
|
70
|
+
return 'boolean';
|
|
71
|
+
case 'object':
|
|
72
|
+
return 'object';
|
|
73
|
+
case 'undefined':
|
|
74
|
+
case 'function':
|
|
75
|
+
case 'symbol':
|
|
76
|
+
default:
|
|
77
|
+
return 'object';
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=valueTypeByTokenType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"valueTypeByTokenType.js","sourceRoot":"","sources":["../../../../src/preprocessors/lint/rules/valueTypeByTokenType.ts"],"names":[],"mappings":";;AA8CA,4DAgEC;AApED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CAAC,CAAC;QAE/C,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;YACrC,MAAM,CAAC,IAAI,CAAC;gBACR,OAAO,EAAE,qBAAqB,UAAU,oCAAoC,SAAS,sBAAsB,YAAY,CAAC,IAAI,CACxH,IAAI,CACP,IAAI;gBACL,QAAQ;gBACR,IAAI;aACP,CAAC,CAAC;QACP,CAAC;QAED,OAAO,MAAM,CAAC;IAClB,CAAC,CAAC;AACN,CAAC;AAED;;GAEG;AACH,SAAS,iBAAiB,CAAC,KAAc;IACrC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,OAAO,CAAC;IACnB,CAAC;IACD,MAAM,CAAC,GAAG,OAAO,KAAK,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC;QACR,KAAK,QAAQ;YACT,OAAO,QAAQ,CAAC;QACpB,KAAK,QAAQ,CAAC;QACd,KAAK,QAAQ;YACT,OAAO,QAAQ,CAAC;QACpB,KAAK,SAAS;YACV,OAAO,SAAS,CAAC;QACrB,KAAK,QAAQ;YACT,OAAO,QAAQ,CAAC;QACpB,KAAK,WAAW,CAAC;QACjB,KAAK,UAAU,CAAC;QAChB,KAAK,QAAQ,CAAC;QACd;YACI,OAAO,QAAQ,CAAC;IACxB,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gradientCssTransform.d.ts","sourceRoot":"","sources":["../../src/transforms/gradientCssTransform.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAoB,MAAM,wBAAwB,CAAC;AAU1E,eAAO,MAAM,oBAAoB,EAAE,SAalC,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// #region Imports
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.gradientCssTransform = void 0;
|
|
5
5
|
const getValue_js_1 = require("../utilities/getValue.js");
|
|
6
|
-
exports.
|
|
7
|
-
name: 'gradient/css',
|
|
6
|
+
exports.gradientCssTransform = {
|
|
7
|
+
name: 'gradient/css/value',
|
|
8
8
|
type: 'value',
|
|
9
9
|
transitive: true,
|
|
10
10
|
filter: (token) => token.$type === 'gradient' || token.type === 'gradient',
|
|
@@ -16,4 +16,4 @@ exports.gradientTransform = {
|
|
|
16
16
|
return `${token.angle ? `${token.angle}, ` : ''}${stops}`;
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
|
-
//# sourceMappingURL=
|
|
19
|
+
//# sourceMappingURL=gradientCssTransform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gradientCssTransform.js","sourceRoot":"","sources":["../../src/transforms/gradientCssTransform.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;AAGlB,0DAAoD;AASvC,QAAA,oBAAoB,GAAc;IAC3C,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,IAAI;IAChB,MAAM,EAAE,CAAC,KAAuB,EAAW,EAAE,CAAC,KAAK,CAAC,KAAK,KAAK,UAAU,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU;IACrG,SAAS,EAAE,CAAC,KAAuB,EAAE,EAAE;QACnC,MAAM,UAAU,GAAG,IAAA,sBAAQ,EAAuB,KAAK,CAAC,CAAC;QACzD,MAAM,KAAK,GAAG,UAAU;aACnB,GAAG,CAAC,CAAC,IAAmB,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;aAC3G,IAAI,CAAC,IAAI,CAAC,CAAC;QAEhB,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC;IAC9D,CAAC;CACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"letterSpacingCalcCssTransform.d.ts","sourceRoot":"","sources":["../../src/transforms/letterSpacingCalcCssTransform.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAIxD,eAAO,MAAM,6BAA6B,EAAE,SAgB3C,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// #region Imports
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.letterSpacingCalcCssTransform = void 0;
|
|
5
5
|
// #endregion
|
|
6
|
-
exports.
|
|
6
|
+
exports.letterSpacingCalcCssTransform = {
|
|
7
7
|
type: 'value',
|
|
8
8
|
transitive: true,
|
|
9
|
-
name: '
|
|
9
|
+
name: 'letterSpacingCalc/css/value',
|
|
10
10
|
filter: (token) => token.type === 'letterSpacing' && typeof token.value === 'string' && token.value === '' && Boolean(token.attributes),
|
|
11
11
|
transform: (token) => {
|
|
12
12
|
if (token.attributes) {
|
|
@@ -18,4 +18,4 @@ exports.letterSpacingTransform = {
|
|
|
18
18
|
return token.value;
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
|
-
//# sourceMappingURL=
|
|
21
|
+
//# sourceMappingURL=letterSpacingCalcCssTransform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"letterSpacingCalcCssTransform.js","sourceRoot":"","sources":["../../src/transforms/letterSpacingCalcCssTransform.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;AAIlB,aAAa;AAEA,QAAA,6BAA6B,GAAc;IACpD,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,IAAI;IAChB,IAAI,EAAE,6BAA6B;IACnC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,eAAe,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,KAAK,KAAK,EAAE,IAAI,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC;IACvI,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE;QACjB,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC;YACnB,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,QAAkB,CAAC;YACrD,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,OAAiB,CAAC;YAEnD,MAAM,EAAE,GAAG,GAAG,QAAQ,GAAG,OAAO,IAAI,CAAC;YACrC,OAAO,EAAE,CAAC;QACd,CAAC;QAED,OAAO,KAAK,CAAC,KAAK,CAAC;IACvB,CAAC;CACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listScssTransform.d.ts","sourceRoot":"","sources":["../../src/transforms/listScssTransform.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAoB,MAAM,wBAAwB,CAAC;AAK1E,eAAO,MAAM,iBAAiB,EAAE,SAM/B,CAAC"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// #region Imports
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.listScssTransform = void 0;
|
|
5
5
|
const getValue_1 = require("../utilities/getValue");
|
|
6
6
|
// #endregion
|
|
7
|
-
exports.
|
|
8
|
-
name: 'list/scss',
|
|
7
|
+
exports.listScssTransform = {
|
|
8
|
+
name: 'list/scss/value',
|
|
9
9
|
type: 'value',
|
|
10
10
|
transitive: true,
|
|
11
11
|
filter: (token) => Array.isArray(token.value),
|
|
12
12
|
transform: (token) => `(${(0, getValue_1.getValue)(token).join(', ')})`
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=
|
|
14
|
+
//# sourceMappingURL=listScssTransform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"listScssTransform.js","sourceRoot":"","sources":["../../src/transforms/listScssTransform.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;AAGlB,oDAAiD;AAEjD,aAAa;AAEA,QAAA,iBAAiB,GAAc;IACxC,IAAI,EAAE,iBAAiB;IACvB,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,IAAI;IAChB,MAAM,EAAE,CAAC,KAAK,EAAW,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;IACtD,SAAS,EAAE,CAAC,KAAuB,EAAE,EAAE,CAAC,IAAI,IAAA,mBAAQ,EAAgB,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;CAC3F,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Transform } from 'style-dictionary/types';
|
|
2
|
+
/**
|
|
3
|
+
* Transform that converts OKLCH color values to CSS-compatible format.
|
|
4
|
+
* Handles OKLCH color space values and converts them to oklch() CSS function.
|
|
5
|
+
*/
|
|
6
|
+
export declare const oklchCssTransform: Transform;
|
|
7
|
+
//# sourceMappingURL=oklchCssTransform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oklchCssTransform.d.ts","sourceRoot":"","sources":["../../src/transforms/oklchCssTransform.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAoB,MAAM,wBAAwB,CAAC;AAK1E;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAwC/B,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// #region Imports
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.oklchCssTransform = void 0;
|
|
8
|
+
const chroma_js_1 = __importDefault(require("chroma-js"));
|
|
9
|
+
const getValue_js_1 = require("../utilities/getValue.js");
|
|
10
|
+
// #endregion
|
|
11
|
+
/**
|
|
12
|
+
* Transform that converts OKLCH color values to CSS-compatible format.
|
|
13
|
+
* Handles OKLCH color space values and converts them to oklch() CSS function.
|
|
14
|
+
*/
|
|
15
|
+
exports.oklchCssTransform = {
|
|
16
|
+
name: 'oklch/css/value',
|
|
17
|
+
type: 'value',
|
|
18
|
+
transitive: true,
|
|
19
|
+
filter: (token) => {
|
|
20
|
+
const type = token.$type ?? token.type;
|
|
21
|
+
return type === 'color' || type === 'oklch';
|
|
22
|
+
},
|
|
23
|
+
transform: (token) => {
|
|
24
|
+
const tokenValue = (0, getValue_js_1.getValue)(token);
|
|
25
|
+
// If already a string (e.g., hex, rgb), try to parse and convert to OKLCH
|
|
26
|
+
if (typeof tokenValue === 'string') {
|
|
27
|
+
try {
|
|
28
|
+
const color = (0, chroma_js_1.default)(tokenValue);
|
|
29
|
+
const [l, c, h] = color.oklch();
|
|
30
|
+
const alpha = color.alpha();
|
|
31
|
+
if (alpha < 1) {
|
|
32
|
+
return `oklch(${(l * 100).toFixed(2)}% ${c.toFixed(4)} ${h.toFixed(2)} / ${alpha.toFixed(2)})`;
|
|
33
|
+
}
|
|
34
|
+
return `oklch(${(l * 100).toFixed(2)}% ${c.toFixed(4)} ${h.toFixed(2)})`;
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
// If parsing fails, return original value
|
|
38
|
+
return tokenValue;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
// If object with OKLCH components
|
|
42
|
+
if (typeof tokenValue === 'object' && 'l' in tokenValue && 'c' in tokenValue && 'h' in tokenValue) {
|
|
43
|
+
const { l, c, h, alpha } = tokenValue;
|
|
44
|
+
if (alpha !== undefined && alpha < 1) {
|
|
45
|
+
return `oklch(${(l * 100).toFixed(2)}% ${c.toFixed(4)} ${h.toFixed(2)} / ${alpha.toFixed(2)})`;
|
|
46
|
+
}
|
|
47
|
+
return `oklch(${(l * 100).toFixed(2)}% ${c.toFixed(4)} ${h.toFixed(2)})`;
|
|
48
|
+
}
|
|
49
|
+
return tokenValue;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=oklchCssTransform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oklchCssTransform.js","sourceRoot":"","sources":["../../src/transforms/oklchCssTransform.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;;;;AAElB,0DAA+B;AAE/B,0DAAoD;AAEpD,aAAa;AAEb;;;GAGG;AACU,QAAA,iBAAiB,GAAc;IACxC,IAAI,EAAE,iBAAiB;IACvB,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,IAAI;IAChB,MAAM,EAAE,CAAC,KAAuB,EAAW,EAAE;QACzC,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC;QACvC,OAAO,IAAI,KAAK,OAAO,IAAI,IAAI,KAAK,OAAO,CAAC;IAChD,CAAC;IACD,SAAS,EAAE,CAAC,KAAuB,EAAE,EAAE;QACnC,MAAM,UAAU,GAAG,IAAA,sBAAQ,EAA+D,KAAK,CAAC,CAAC;QAEjG,0EAA0E;QAC1E,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;YACjC,IAAI,CAAC;gBACD,MAAM,KAAK,GAAG,IAAA,mBAAM,EAAC,UAAU,CAAC,CAAC;gBACjC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;gBAChC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;gBAE5B,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;oBACZ,OAAO,SAAS,CAAC,CAAC,GAAG,GAAG,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
|
|
1
|
+
{"version":3,"file":"quoteStringTransform.d.ts","sourceRoot":"","sources":["../../src/transforms/quoteStringTransform.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAoB,MAAM,wBAAwB,CAAC;AAK1E,eAAO,MAAM,oBAAoB,EAAE,SAMlC,CAAC"}
|
|
@@ -5,10 +5,10 @@ exports.quoteStringTransform = void 0;
|
|
|
5
5
|
const getValue_1 = require("../utilities/getValue");
|
|
6
6
|
// #endregion
|
|
7
7
|
exports.quoteStringTransform = {
|
|
8
|
-
name: 'value
|
|
8
|
+
name: 'quoteString/value',
|
|
9
9
|
type: 'value',
|
|
10
10
|
transitive: true,
|
|
11
11
|
filter: (token) => token.$type === 'string' || token.type === 'string',
|
|
12
12
|
transform: (token) => `"${(0, getValue_1.getValue)(token)}"`
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=
|
|
14
|
+
//# sourceMappingURL=quoteStringTransform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quoteStringTransform.js","sourceRoot":"","sources":["../../src/transforms/quoteStringTransform.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;AAGlB,oDAAiD;AAEjD,aAAa;AAEA,QAAA,oBAAoB,GAAc;IAC3C,IAAI,EAAE,mBAAmB;IACzB,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,IAAI;IAChB,MAAM,EAAE,CAAC,KAAK,EAAW,EAAE,CAAC,KAAK,CAAC,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ;IAC/E,SAAS,EAAE,CAAC,KAAuB,EAAE,EAAE,CAAC,IAAI,IAAA,mBAAQ,EAAS,KAAK,CAAC,GAAG;CACzE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shadowCssTransform.d.ts","sourceRoot":"","sources":["../../src/transforms/shadowCssTransform.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAoB,MAAM,wBAAwB,CAAC;AAyB1E,eAAO,MAAM,kBAAkB,EAAE,SAkBhC,CAAC"}
|
|
@@ -7,7 +7,7 @@ function formatShadow({ offsetX = '0', offsetY = '0', blur = '0', spread = '0',
|
|
|
7
7
|
return `${offsetX} ${offsetY} ${blur} ${spread} ${color} ${inset ? 'inset' : ''}`.trim();
|
|
8
8
|
}
|
|
9
9
|
exports.shadowCssTransform = {
|
|
10
|
-
name: 'shadow/css',
|
|
10
|
+
name: 'shadow/css/value',
|
|
11
11
|
type: 'value',
|
|
12
12
|
transitive: true,
|
|
13
13
|
filter: (token) => token.$type === 'shadow' || token.type === 'shadow',
|
|
@@ -22,4 +22,4 @@ exports.shadowCssTransform = {
|
|
|
22
22
|
return tokenValue;
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=
|
|
25
|
+
//# sourceMappingURL=shadowCssTransform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shadowCssTransform.js","sourceRoot":"","sources":["../../src/transforms/shadowCssTransform.ts"],"names":[],"mappings":";AAAA,kBAAkB;;;AAGlB,0DAAoD;AAapD,SAAS,YAAY,CAAC,EAClB,OAAO,GAAG,GAAG,EACb,OAAO,GAAG,GAAG,EACb,IAAI,GAAG,GAAG,EACV,MAAM,GAAG,GAAG,EACZ,KAAK,EACL,KAAK,GAAG,KAAK,EACF;IACX,OAAO,GAAG,OAAO,IAAI,OAAO,IAAI,IAAI,IAAI,MAAM,IAAI,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC;AAC7F,CAAC;AAEY,QAAA,kBAAkB,GAAc;IACzC,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,IAAI;IAChB,MAAM,EAAE,CAAC,KAAK,EAAW,EAAE,CAAC,KAAK,CAAC,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ;IAC/E,SAAS,EAAE,CAAC,KAAuB,EAAE,EAAE;QACnC,MAAM,UAAU,GAAG,IAAA,sBAAQ,EAAe,KAAK,CAAC,CAAC;QAEjD,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;YAC5B,OAAO,UAAU,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnD,CAAC;QAED,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;YACjC,OAAO,YAAY,CAAC,UAAU,CAAC,CAAC;QACpC,CAAC;QAED,OAAO,UAAU,CAAC;IACtB,CAAC;CACJ,CAAC"}
|
|
@@ -7,4 +7,4 @@ import type { DesignToken } from 'style-dictionary/types';
|
|
|
7
7
|
* @returns Flat map of tokens with dot-path keys
|
|
8
8
|
*/
|
|
9
9
|
export declare function extractTokensByType(tokens: Record<string, any>, matchType: string): Record<string, DesignToken>;
|
|
10
|
-
//# sourceMappingURL=
|
|
10
|
+
//# sourceMappingURL=extractTokensByType.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractTokensByType.d.ts","sourceRoot":"","sources":["../../src/utilities/extractTokensByType.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAI1D;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,SAAS,EAAE,MAAM,GAClB,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CA6B7B"}
|
|
@@ -18,7 +18,7 @@ function extractTokensByType(tokens, matchType) {
|
|
|
18
18
|
}
|
|
19
19
|
const type = node?.type ?? node?.$type;
|
|
20
20
|
const value = node?.value ?? node?.$value;
|
|
21
|
-
const isToken = typeof value !== 'undefined' && (type
|
|
21
|
+
const isToken = typeof value !== 'undefined' && (type ?? node?.name ?? node?.comment);
|
|
22
22
|
if (isToken && type === matchType) {
|
|
23
23
|
const key = path.join('.');
|
|
24
24
|
result[key] = {
|
|
@@ -35,4 +35,4 @@ function extractTokensByType(tokens, matchType) {
|
|
|
35
35
|
walk(tokens);
|
|
36
36
|
return result;
|
|
37
37
|
}
|
|
38
|
-
//# sourceMappingURL=
|
|
38
|
+
//# sourceMappingURL=extractTokensByType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractTokensByType.js","sourceRoot":"","sources":["../../src/utilities/extractTokensByType.ts"],"names":[],"mappings":";AAAA,kBAAkB;;AAalB,kDAgCC;AAzCD,aAAa;AAEb;;;;;;GAMG;AACH,SAAgB,mBAAmB,CAC/B,MAA2B,EAC3B,SAAiB;IAEjB,MAAM,MAAM,GAAgC,EAAE,CAAC;IAE/C,MAAM,IAAI,GAAG,CAAC,IAAS,EAAE,OAAsB,EAAE,EAAQ,EAAE;QACvD,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAAC,OAAO;QAAC,CAAC;QAE1D,MAAM,IAAI,GAAG,IAAI,EAAE,IAAI,IAAI,IAAI,EAAE,KAAK,CAAC;QACvC,MAAM,KAAK,GAAG,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,MAAM,CAAC;QAE1C,MAAM,OAAO,GAAG,OAAO,KAAK,KAAK,WAAW,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE,IAAI,IAAI,IAAI,EAAE,OAAO,CAAC,CAAC;QAEtF,IAAI,OAAO,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YAChC,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAC3B,MAAM,CAAC,GAAG,CAAC,GAAG;gBACV,GAAG,IAAI;gBACP,GAAG;aACN,CAAC;QACN,CAAC;QAED,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAA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