@navita/engine 0.2.1 → 3.0.0-next.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/_virtual/_rolldown/runtime.cjs +23 -0
- package/cache.cjs +26 -26
- package/cache.mjs +28 -24
- package/helpers/declarationsToBlock.cjs +10 -14
- package/helpers/declarationsToBlock.mjs +12 -12
- package/helpers/generateCombinedAtRules.cjs +5 -7
- package/helpers/generateCombinedAtRules.mjs +7 -5
- package/helpers/getPropertyPriority.cjs +221 -260
- package/helpers/getPropertyPriority.mjs +223 -258
- package/helpers/hyphenateProperty.cjs +8 -9
- package/helpers/hyphenateProperty.mjs +10 -7
- package/helpers/isContainerQuery.cjs +4 -4
- package/helpers/isContainerQuery.mjs +6 -2
- package/helpers/isMediaQuery.cjs +4 -4
- package/helpers/isMediaQuery.mjs +6 -2
- package/helpers/isNestedSelector.cjs +5 -5
- package/helpers/isNestedSelector.mjs +7 -3
- package/helpers/isObject.cjs +4 -4
- package/helpers/isObject.mjs +6 -2
- package/helpers/isSupportsQuery.cjs +4 -4
- package/helpers/isSupportsQuery.mjs +6 -2
- package/helpers/normalizeCSSVarsProperty.cjs +7 -11
- package/helpers/normalizeCSSVarsProperty.mjs +9 -9
- package/helpers/normalizeCSSVarsValue.cjs +6 -8
- package/helpers/normalizeCSSVarsValue.mjs +8 -6
- package/helpers/normalizeNestedProperty.cjs +5 -7
- package/helpers/normalizeNestedProperty.mjs +7 -5
- package/helpers/pixelifyProperties.cjs +50 -53
- package/helpers/pixelifyProperties.mjs +52 -51
- package/helpers/splitSelectorList.cjs +55 -0
- package/helpers/splitSelectorList.mjs +57 -0
- package/helpers/splitStyleBlocks.cjs +23 -25
- package/helpers/splitStyleBlocks.mjs +25 -23
- package/helpers/transformContentProperty.cjs +4 -5
- package/helpers/transformContentProperty.mjs +6 -3
- package/identifiers/IDGenerator.cjs +9 -9
- package/identifiers/IDGenerator.mjs +11 -7
- package/identifiers/alphaIDGenerator.cjs +23 -26
- package/identifiers/alphaIDGenerator.mjs +25 -24
- package/identifiers/propertyValueIDGenerator.cjs +18 -23
- package/identifiers/propertyValueIDGenerator.mjs +20 -21
- package/index.cjs +187 -238
- package/index.d.ts +91 -84
- package/index.mjs +184 -234
- package/package.json +4 -4
- package/printers/printFontFaces.cjs +7 -12
- package/printers/printFontFaces.mjs +9 -10
- package/printers/printKeyFrames.cjs +10 -16
- package/printers/printKeyFrames.mjs +12 -14
- package/printers/printSourceMap.cjs +34 -39
- package/printers/printSourceMap.mjs +36 -37
- package/printers/printStyleBlocks.cjs +71 -70
- package/printers/printStyleBlocks.mjs +73 -68
- package/printers/sortAtRules.cjs +8 -7
- package/printers/sortAtRules.mjs +7 -4
- package/processKeyframes.cjs +16 -22
- package/processKeyframes.mjs +19 -20
- package/processStyles.cjs +99 -105
- package/processStyles.mjs +101 -103
- package/types.cjs +0 -2
- package/types.mjs +4 -1
- package/wrappers/classList.cjs +4 -5
- package/wrappers/classList.mjs +6 -3
- package/wrappers/static.cjs +4 -5
- package/wrappers/static.mjs +6 -3
- package/printers/sortStatic.cjs +0 -7
- package/printers/sortStatic.mjs +0 -5
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
//#region src/helpers/normalizeCSSVarsProperty.ts
|
|
1
5
|
const regex = /var\(([^,]+).*\)/;
|
|
2
6
|
function normalizeCSSVarsProperty(property) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
if (!matches) {
|
|
8
|
-
return property;
|
|
9
|
-
}
|
|
10
|
-
return matches[1];
|
|
7
|
+
if (!property.startsWith("var(")) return property;
|
|
8
|
+
const matches = property.match(regex);
|
|
9
|
+
if (!matches) return property;
|
|
10
|
+
return matches[1];
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
//#endregion
|
|
13
13
|
export { normalizeCSSVarsProperty };
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const cssVarRegex = /(?<!var\()(
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/helpers/normalizeCSSVarsValue.ts
|
|
3
|
+
const cssVarRegex = /(?<!var\()(?<![A-Za-z0-9])(--[a-zA-Z0-9_-]+)/g;
|
|
4
4
|
function normalizeCSSVarsValue(value) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
return value;
|
|
5
|
+
if (value.includes("--")) return value.replace(cssVarRegex, "var($1)");
|
|
6
|
+
return value;
|
|
9
7
|
}
|
|
10
|
-
|
|
8
|
+
//#endregion
|
|
11
9
|
exports.normalizeCSSVarsValue = normalizeCSSVarsValue;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
//#region src/helpers/normalizeCSSVarsValue.ts
|
|
5
|
+
const cssVarRegex = /(?<!var\()(?<![A-Za-z0-9])(--[a-zA-Z0-9_-]+)/g;
|
|
2
6
|
function normalizeCSSVarsValue(value) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
return value;
|
|
7
|
+
if (value.includes("--")) return value.replace(cssVarRegex, "var($1)");
|
|
8
|
+
return value;
|
|
7
9
|
}
|
|
8
|
-
|
|
10
|
+
//#endregion
|
|
9
11
|
export { normalizeCSSVarsValue };
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/helpers/normalizeNestedProperty.ts
|
|
3
3
|
function normalizeNestedProperty(nestedProperty) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
return nestedProperty;
|
|
4
|
+
if (nestedProperty.charAt(0) === "&") return nestedProperty.slice(1);
|
|
5
|
+
return nestedProperty;
|
|
8
6
|
}
|
|
9
|
-
|
|
7
|
+
//#endregion
|
|
10
8
|
exports.normalizeNestedProperty = normalizeNestedProperty;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
//#region src/helpers/normalizeNestedProperty.ts
|
|
1
5
|
function normalizeNestedProperty(nestedProperty) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
return nestedProperty;
|
|
6
|
+
if (nestedProperty.charAt(0) === "&") return nestedProperty.slice(1);
|
|
7
|
+
return nestedProperty;
|
|
6
8
|
}
|
|
7
|
-
|
|
9
|
+
//#endregion
|
|
8
10
|
export { normalizeNestedProperty };
|
|
@@ -1,58 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/helpers/pixelifyProperties.ts
|
|
3
3
|
const UNITLESS = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
strokeWidth: true
|
|
4
|
+
animationIterationCount: true,
|
|
5
|
+
borderImage: true,
|
|
6
|
+
borderImageOutset: true,
|
|
7
|
+
borderImageSlice: true,
|
|
8
|
+
borderImageWidth: true,
|
|
9
|
+
boxFlex: true,
|
|
10
|
+
boxFlexGroup: true,
|
|
11
|
+
columnCount: true,
|
|
12
|
+
columns: true,
|
|
13
|
+
flex: true,
|
|
14
|
+
flexGrow: true,
|
|
15
|
+
flexShrink: true,
|
|
16
|
+
fontWeight: true,
|
|
17
|
+
gridArea: true,
|
|
18
|
+
gridColumn: true,
|
|
19
|
+
gridColumnEnd: true,
|
|
20
|
+
gridColumnStart: true,
|
|
21
|
+
gridRow: true,
|
|
22
|
+
gridRowEnd: true,
|
|
23
|
+
gridRowStart: true,
|
|
24
|
+
initialLetter: true,
|
|
25
|
+
lineClamp: true,
|
|
26
|
+
lineHeight: true,
|
|
27
|
+
maxLines: true,
|
|
28
|
+
opacity: true,
|
|
29
|
+
order: true,
|
|
30
|
+
orphans: true,
|
|
31
|
+
scale: true,
|
|
32
|
+
tabSize: true,
|
|
33
|
+
WebkitLineClamp: true,
|
|
34
|
+
widows: true,
|
|
35
|
+
zIndex: true,
|
|
36
|
+
zoom: true,
|
|
37
|
+
fillOpacity: true,
|
|
38
|
+
floodOpacity: true,
|
|
39
|
+
maskBorder: true,
|
|
40
|
+
maskBorderOutset: true,
|
|
41
|
+
maskBorderSlice: true,
|
|
42
|
+
maskBorderWidth: true,
|
|
43
|
+
shapeImageThreshold: true,
|
|
44
|
+
stopOpacity: true,
|
|
45
|
+
strokeDashoffset: true,
|
|
46
|
+
strokeMiterlimit: true,
|
|
47
|
+
strokeOpacity: true,
|
|
48
|
+
strokeWidth: true
|
|
50
49
|
};
|
|
51
50
|
function pixelifyProperties(property, value) {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
return value;
|
|
51
|
+
if (value !== 0 && !property.startsWith("--") && !UNITLESS[property]) return `${value}px`;
|
|
52
|
+
return value;
|
|
56
53
|
}
|
|
57
|
-
|
|
54
|
+
//#endregion
|
|
58
55
|
exports.pixelifyProperties = pixelifyProperties;
|
|
@@ -1,56 +1,57 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
//#region src/helpers/pixelifyProperties.ts
|
|
1
5
|
const UNITLESS = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
strokeWidth: true
|
|
6
|
+
animationIterationCount: true,
|
|
7
|
+
borderImage: true,
|
|
8
|
+
borderImageOutset: true,
|
|
9
|
+
borderImageSlice: true,
|
|
10
|
+
borderImageWidth: true,
|
|
11
|
+
boxFlex: true,
|
|
12
|
+
boxFlexGroup: true,
|
|
13
|
+
columnCount: true,
|
|
14
|
+
columns: true,
|
|
15
|
+
flex: true,
|
|
16
|
+
flexGrow: true,
|
|
17
|
+
flexShrink: true,
|
|
18
|
+
fontWeight: true,
|
|
19
|
+
gridArea: true,
|
|
20
|
+
gridColumn: true,
|
|
21
|
+
gridColumnEnd: true,
|
|
22
|
+
gridColumnStart: true,
|
|
23
|
+
gridRow: true,
|
|
24
|
+
gridRowEnd: true,
|
|
25
|
+
gridRowStart: true,
|
|
26
|
+
initialLetter: true,
|
|
27
|
+
lineClamp: true,
|
|
28
|
+
lineHeight: true,
|
|
29
|
+
maxLines: true,
|
|
30
|
+
opacity: true,
|
|
31
|
+
order: true,
|
|
32
|
+
orphans: true,
|
|
33
|
+
scale: true,
|
|
34
|
+
tabSize: true,
|
|
35
|
+
WebkitLineClamp: true,
|
|
36
|
+
widows: true,
|
|
37
|
+
zIndex: true,
|
|
38
|
+
zoom: true,
|
|
39
|
+
fillOpacity: true,
|
|
40
|
+
floodOpacity: true,
|
|
41
|
+
maskBorder: true,
|
|
42
|
+
maskBorderOutset: true,
|
|
43
|
+
maskBorderSlice: true,
|
|
44
|
+
maskBorderWidth: true,
|
|
45
|
+
shapeImageThreshold: true,
|
|
46
|
+
stopOpacity: true,
|
|
47
|
+
strokeDashoffset: true,
|
|
48
|
+
strokeMiterlimit: true,
|
|
49
|
+
strokeOpacity: true,
|
|
50
|
+
strokeWidth: true
|
|
48
51
|
};
|
|
49
52
|
function pixelifyProperties(property, value) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
return value;
|
|
53
|
+
if (value !== 0 && !property.startsWith("--") && !UNITLESS[property]) return `${value}px`;
|
|
54
|
+
return value;
|
|
54
55
|
}
|
|
55
|
-
|
|
56
|
+
//#endregion
|
|
56
57
|
export { pixelifyProperties };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/helpers/splitSelectorList.ts
|
|
3
|
+
/**
|
|
4
|
+
* Splits a CSS selector list on top-level commas, ignoring commas that live
|
|
5
|
+
* inside parentheses (`:is(.a, .b)`, `:not(.x, .y)`), square brackets
|
|
6
|
+
* (`[data-x=","]`) or quoted strings.
|
|
7
|
+
*
|
|
8
|
+
* A naive `selector.split(',')` mangles grouped selectors, which is why this
|
|
9
|
+
* paren/bracket/quote-aware split exists.
|
|
10
|
+
*
|
|
11
|
+
* Each returned segment is trimmed; empty segments are dropped.
|
|
12
|
+
*/
|
|
13
|
+
function splitSelectorList(selectorList) {
|
|
14
|
+
const segments = [];
|
|
15
|
+
let current = "";
|
|
16
|
+
let parenDepth = 0;
|
|
17
|
+
let bracketDepth = 0;
|
|
18
|
+
let quote = null;
|
|
19
|
+
for (let i = 0; i < selectorList.length; i++) {
|
|
20
|
+
const char = selectorList[i];
|
|
21
|
+
if (quote) {
|
|
22
|
+
current += char;
|
|
23
|
+
if (char === quote && selectorList[i - 1] !== "\\") quote = null;
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
switch (char) {
|
|
27
|
+
case "\"":
|
|
28
|
+
case "'":
|
|
29
|
+
quote = char;
|
|
30
|
+
break;
|
|
31
|
+
case "(":
|
|
32
|
+
parenDepth++;
|
|
33
|
+
break;
|
|
34
|
+
case ")":
|
|
35
|
+
if (parenDepth > 0) parenDepth--;
|
|
36
|
+
break;
|
|
37
|
+
case "[":
|
|
38
|
+
bracketDepth++;
|
|
39
|
+
break;
|
|
40
|
+
case "]":
|
|
41
|
+
if (bracketDepth > 0) bracketDepth--;
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
if (char === "," && parenDepth === 0 && bracketDepth === 0) {
|
|
45
|
+
segments.push(current);
|
|
46
|
+
current = "";
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
current += char;
|
|
50
|
+
}
|
|
51
|
+
segments.push(current);
|
|
52
|
+
return segments.map((segment) => segment.trim()).filter(Boolean);
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
exports.splitSelectorList = splitSelectorList;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
//#region src/helpers/splitSelectorList.ts
|
|
5
|
+
/**
|
|
6
|
+
* Splits a CSS selector list on top-level commas, ignoring commas that live
|
|
7
|
+
* inside parentheses (`:is(.a, .b)`, `:not(.x, .y)`), square brackets
|
|
8
|
+
* (`[data-x=","]`) or quoted strings.
|
|
9
|
+
*
|
|
10
|
+
* A naive `selector.split(',')` mangles grouped selectors, which is why this
|
|
11
|
+
* paren/bracket/quote-aware split exists.
|
|
12
|
+
*
|
|
13
|
+
* Each returned segment is trimmed; empty segments are dropped.
|
|
14
|
+
*/
|
|
15
|
+
function splitSelectorList(selectorList) {
|
|
16
|
+
const segments = [];
|
|
17
|
+
let current = "";
|
|
18
|
+
let parenDepth = 0;
|
|
19
|
+
let bracketDepth = 0;
|
|
20
|
+
let quote = null;
|
|
21
|
+
for (let i = 0; i < selectorList.length; i++) {
|
|
22
|
+
const char = selectorList[i];
|
|
23
|
+
if (quote) {
|
|
24
|
+
current += char;
|
|
25
|
+
if (char === quote && selectorList[i - 1] !== "\\") quote = null;
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
switch (char) {
|
|
29
|
+
case "\"":
|
|
30
|
+
case "'":
|
|
31
|
+
quote = char;
|
|
32
|
+
break;
|
|
33
|
+
case "(":
|
|
34
|
+
parenDepth++;
|
|
35
|
+
break;
|
|
36
|
+
case ")":
|
|
37
|
+
if (parenDepth > 0) parenDepth--;
|
|
38
|
+
break;
|
|
39
|
+
case "[":
|
|
40
|
+
bracketDepth++;
|
|
41
|
+
break;
|
|
42
|
+
case "]":
|
|
43
|
+
if (bracketDepth > 0) bracketDepth--;
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
if (char === "," && parenDepth === 0 && bracketDepth === 0) {
|
|
47
|
+
segments.push(current);
|
|
48
|
+
current = "";
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
current += char;
|
|
52
|
+
}
|
|
53
|
+
segments.push(current);
|
|
54
|
+
return segments.map((segment) => segment.trim()).filter(Boolean);
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
export { splitSelectorList };
|
|
@@ -1,28 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const lowPriorityProperties = [
|
|
4
|
-
'all'
|
|
5
|
-
];
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/helpers/splitStyleBlocks.ts
|
|
3
|
+
const lowPriorityProperties = ["all"];
|
|
6
4
|
function splitStyleBlocks(blocks) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
5
|
+
const atRules = [];
|
|
6
|
+
const rules = [];
|
|
7
|
+
const lowPrioRules = [];
|
|
8
|
+
for (const block of blocks) {
|
|
9
|
+
if (block.media || block.support || block.container) {
|
|
10
|
+
atRules.push(block);
|
|
11
|
+
continue;
|
|
12
|
+
}
|
|
13
|
+
if (lowPriorityProperties.includes(block.property.toLowerCase())) {
|
|
14
|
+
lowPrioRules.push(block);
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
rules.push(block);
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
atRules,
|
|
21
|
+
lowPrioRules,
|
|
22
|
+
rules
|
|
23
|
+
};
|
|
26
24
|
}
|
|
27
|
-
|
|
25
|
+
//#endregion
|
|
28
26
|
exports.splitStyleBlocks = splitStyleBlocks;
|
|
@@ -1,26 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
//#region src/helpers/splitStyleBlocks.ts
|
|
5
|
+
const lowPriorityProperties = ["all"];
|
|
4
6
|
function splitStyleBlocks(blocks) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
7
|
+
const atRules = [];
|
|
8
|
+
const rules = [];
|
|
9
|
+
const lowPrioRules = [];
|
|
10
|
+
for (const block of blocks) {
|
|
11
|
+
if (block.media || block.support || block.container) {
|
|
12
|
+
atRules.push(block);
|
|
13
|
+
continue;
|
|
14
|
+
}
|
|
15
|
+
if (lowPriorityProperties.includes(block.property.toLowerCase())) {
|
|
16
|
+
lowPrioRules.push(block);
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
rules.push(block);
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
atRules,
|
|
23
|
+
lowPrioRules,
|
|
24
|
+
rules
|
|
25
|
+
};
|
|
24
26
|
}
|
|
25
|
-
|
|
27
|
+
//#endregion
|
|
26
28
|
export { splitStyleBlocks };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
// https://github.com/vanilla-extract-css/vanilla-extract/blob/40d7e72c041989a4dc847dc66b94a4c680b5536e/packages/css/src/transformCss.ts#L277
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/helpers/transformContentProperty.ts
|
|
4
3
|
function transformContentProperty(value) {
|
|
5
|
-
|
|
4
|
+
return value && (value.includes("\"") || value.includes("'") || /^([A-Za-z-]+\([\s\S]*|[\s\S]*-quote|inherit|initial|none|normal|revert|unset)(\s|$)/.test(value)) ? value : `"${value}"`;
|
|
6
5
|
}
|
|
7
|
-
|
|
6
|
+
//#endregion
|
|
8
7
|
exports.transformContentProperty = transformContentProperty;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
//#region src/helpers/transformContentProperty.ts
|
|
2
5
|
function transformContentProperty(value) {
|
|
3
|
-
|
|
6
|
+
return value && (value.includes("\"") || value.includes("'") || /^([A-Za-z-]+\([\s\S]*|[\s\S]*-quote|inherit|initial|none|normal|revert|unset)(\s|$)/.test(value)) ? value : `"${value}"`;
|
|
4
7
|
}
|
|
5
|
-
|
|
8
|
+
//#endregion
|
|
6
9
|
export { transformContentProperty };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/identifiers/IDGenerator.ts
|
|
3
|
+
var IDGenerator = class {
|
|
4
|
+
counter = 1;
|
|
5
|
+
next() {
|
|
6
|
+
return this.counter++;
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
10
|
exports.IDGenerator = IDGenerator;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
//#region src/identifiers/IDGenerator.ts
|
|
5
|
+
var IDGenerator = class {
|
|
6
|
+
counter = 1;
|
|
7
|
+
next() {
|
|
8
|
+
return this.counter++;
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
8
12
|
export { IDGenerator };
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const chars =
|
|
4
|
-
const charLength =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/identifiers/alphaIDGenerator.ts
|
|
3
|
+
const chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
4
|
+
const charLength = 52;
|
|
5
|
+
var AlphaIDGenerator = class {
|
|
6
|
+
blacklist;
|
|
7
|
+
counter = 1;
|
|
8
|
+
constructor(blacklist = ["ad"]) {
|
|
9
|
+
this.blacklist = blacklist;
|
|
10
|
+
}
|
|
11
|
+
next() {
|
|
12
|
+
const nextString = (id, className = "") => {
|
|
13
|
+
if (id <= charLength) return chars[id - 1] + className;
|
|
14
|
+
return nextString(id / charLength | 0, chars[(id - 1) % charLength] + className);
|
|
15
|
+
};
|
|
16
|
+
let className;
|
|
17
|
+
do
|
|
18
|
+
className = nextString(this.counter++);
|
|
19
|
+
while (this.blacklist.includes(className.toLowerCase()));
|
|
20
|
+
return className;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
//#endregion
|
|
27
24
|
exports.AlphaIDGenerator = AlphaIDGenerator;
|