@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.
Files changed (67) hide show
  1. package/_virtual/_rolldown/runtime.cjs +23 -0
  2. package/cache.cjs +26 -26
  3. package/cache.mjs +28 -24
  4. package/helpers/declarationsToBlock.cjs +10 -14
  5. package/helpers/declarationsToBlock.mjs +12 -12
  6. package/helpers/generateCombinedAtRules.cjs +5 -7
  7. package/helpers/generateCombinedAtRules.mjs +7 -5
  8. package/helpers/getPropertyPriority.cjs +221 -260
  9. package/helpers/getPropertyPriority.mjs +223 -258
  10. package/helpers/hyphenateProperty.cjs +8 -9
  11. package/helpers/hyphenateProperty.mjs +10 -7
  12. package/helpers/isContainerQuery.cjs +4 -4
  13. package/helpers/isContainerQuery.mjs +6 -2
  14. package/helpers/isMediaQuery.cjs +4 -4
  15. package/helpers/isMediaQuery.mjs +6 -2
  16. package/helpers/isNestedSelector.cjs +5 -5
  17. package/helpers/isNestedSelector.mjs +7 -3
  18. package/helpers/isObject.cjs +4 -4
  19. package/helpers/isObject.mjs +6 -2
  20. package/helpers/isSupportsQuery.cjs +4 -4
  21. package/helpers/isSupportsQuery.mjs +6 -2
  22. package/helpers/normalizeCSSVarsProperty.cjs +7 -11
  23. package/helpers/normalizeCSSVarsProperty.mjs +9 -9
  24. package/helpers/normalizeCSSVarsValue.cjs +6 -8
  25. package/helpers/normalizeCSSVarsValue.mjs +8 -6
  26. package/helpers/normalizeNestedProperty.cjs +5 -7
  27. package/helpers/normalizeNestedProperty.mjs +7 -5
  28. package/helpers/pixelifyProperties.cjs +50 -53
  29. package/helpers/pixelifyProperties.mjs +52 -51
  30. package/helpers/splitSelectorList.cjs +55 -0
  31. package/helpers/splitSelectorList.mjs +57 -0
  32. package/helpers/splitStyleBlocks.cjs +23 -25
  33. package/helpers/splitStyleBlocks.mjs +25 -23
  34. package/helpers/transformContentProperty.cjs +4 -5
  35. package/helpers/transformContentProperty.mjs +6 -3
  36. package/identifiers/IDGenerator.cjs +9 -9
  37. package/identifiers/IDGenerator.mjs +11 -7
  38. package/identifiers/alphaIDGenerator.cjs +23 -26
  39. package/identifiers/alphaIDGenerator.mjs +25 -24
  40. package/identifiers/propertyValueIDGenerator.cjs +18 -23
  41. package/identifiers/propertyValueIDGenerator.mjs +20 -21
  42. package/index.cjs +187 -238
  43. package/index.d.ts +91 -84
  44. package/index.mjs +184 -234
  45. package/package.json +4 -4
  46. package/printers/printFontFaces.cjs +7 -12
  47. package/printers/printFontFaces.mjs +9 -10
  48. package/printers/printKeyFrames.cjs +10 -16
  49. package/printers/printKeyFrames.mjs +12 -14
  50. package/printers/printSourceMap.cjs +34 -39
  51. package/printers/printSourceMap.mjs +36 -37
  52. package/printers/printStyleBlocks.cjs +71 -70
  53. package/printers/printStyleBlocks.mjs +73 -68
  54. package/printers/sortAtRules.cjs +8 -7
  55. package/printers/sortAtRules.mjs +7 -4
  56. package/processKeyframes.cjs +16 -22
  57. package/processKeyframes.mjs +19 -20
  58. package/processStyles.cjs +99 -105
  59. package/processStyles.mjs +101 -103
  60. package/types.cjs +0 -2
  61. package/types.mjs +4 -1
  62. package/wrappers/classList.cjs +4 -5
  63. package/wrappers/classList.mjs +6 -3
  64. package/wrappers/static.cjs +4 -5
  65. package/wrappers/static.mjs +6 -3
  66. package/printers/sortStatic.cjs +0 -7
  67. 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
- if (!property.startsWith('var(')) {
4
- return property;
5
- }
6
- const matches = property.match(regex);
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
- 'use strict';
2
-
3
- const cssVarRegex = /(?<!var\()(\s*)(--[a-zA-Z0-9_-]+)/g;
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
- if (value.includes('--')) {
6
- return value.replace(cssVarRegex, "$1var($2)");
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
- const cssVarRegex = /(?<!var\()(\s*)(--[a-zA-Z0-9_-]+)/g;
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
- if (value.includes('--')) {
4
- return value.replace(cssVarRegex, "$1var($2)");
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
- 'use strict';
2
-
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region src/helpers/normalizeNestedProperty.ts
3
3
  function normalizeNestedProperty(nestedProperty) {
4
- if (nestedProperty.charAt(0) === '&') {
5
- return nestedProperty.slice(1);
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
- if (nestedProperty.charAt(0) === '&') {
3
- return nestedProperty.slice(1);
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
- 'use strict';
2
-
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region src/helpers/pixelifyProperties.ts
3
3
  const UNITLESS = {
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
- // svg properties
38
- fillOpacity: true,
39
- floodOpacity: true,
40
- maskBorder: true,
41
- maskBorderOutset: true,
42
- maskBorderSlice: true,
43
- maskBorderWidth: true,
44
- shapeImageThreshold: true,
45
- stopOpacity: true,
46
- strokeDashoffset: true,
47
- strokeMiterlimit: true,
48
- strokeOpacity: true,
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
- if (value !== 0 && !UNITLESS[property]) {
53
- return `${value}px`;
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
- animationIterationCount: true,
3
- borderImage: true,
4
- borderImageOutset: true,
5
- borderImageSlice: true,
6
- borderImageWidth: true,
7
- boxFlex: true,
8
- boxFlexGroup: true,
9
- columnCount: true,
10
- columns: true,
11
- flex: true,
12
- flexGrow: true,
13
- flexShrink: true,
14
- fontWeight: true,
15
- gridArea: true,
16
- gridColumn: true,
17
- gridColumnEnd: true,
18
- gridColumnStart: true,
19
- gridRow: true,
20
- gridRowEnd: true,
21
- gridRowStart: true,
22
- initialLetter: true,
23
- lineClamp: true,
24
- lineHeight: true,
25
- maxLines: true,
26
- opacity: true,
27
- order: true,
28
- orphans: true,
29
- scale: true,
30
- tabSize: true,
31
- WebkitLineClamp: true,
32
- widows: true,
33
- zIndex: true,
34
- zoom: true,
35
- // svg properties
36
- fillOpacity: true,
37
- floodOpacity: true,
38
- maskBorder: true,
39
- maskBorderOutset: true,
40
- maskBorderSlice: true,
41
- maskBorderWidth: true,
42
- shapeImageThreshold: true,
43
- stopOpacity: true,
44
- strokeDashoffset: true,
45
- strokeMiterlimit: true,
46
- strokeOpacity: true,
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
- if (value !== 0 && !UNITLESS[property]) {
51
- return `${value}px`;
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
- 'use strict';
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
- 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
- };
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
- const lowPriorityProperties = [
2
- 'all'
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
- 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
- };
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
- 'use strict';
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
- return value && (value.includes('"') || value.includes("'") || /^([A-Za-z\-]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)(\s|$)/.test(value)) ? value : `"${value}"`;
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
- // https://github.com/vanilla-extract-css/vanilla-extract/blob/40d7e72c041989a4dc847dc66b94a4c680b5536e/packages/css/src/transformCss.ts#L277
1
+ import "node:path";
2
+ import "node:url";
3
+ import.meta.url;
4
+ //#region src/helpers/transformContentProperty.ts
2
5
  function transformContentProperty(value) {
3
- return value && (value.includes('"') || value.includes("'") || /^([A-Za-z\-]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)(\s|$)/.test(value)) ? value : `"${value}"`;
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
- 'use strict';
2
-
3
- class IDGenerator {
4
- counter = 1;
5
- next() {
6
- return this.counter++;
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
- class IDGenerator {
2
- counter = 1;
3
- next() {
4
- return this.counter++;
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
- 'use strict';
2
-
3
- const chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
4
- const charLength = chars.length;
5
- class AlphaIDGenerator {
6
- constructor(blacklist = [
7
- 'ad'
8
- ]){
9
- this.blacklist = blacklist;
10
- this.counter = 1;
11
- }
12
- next() {
13
- const nextString = (id, className = '')=>{
14
- if (id <= charLength) {
15
- return chars[id - 1] + className;
16
- }
17
- return nextString(id / charLength | 0, chars[(id - 1) % charLength] + className);
18
- };
19
- let className;
20
- do {
21
- className = nextString(this.counter++);
22
- }while (this.blacklist.includes(className.toLowerCase()))
23
- return className;
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;