@master/css 2.0.0-rc.4 → 2.0.0-rc.41

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 (112) hide show
  1. package/README.md +4 -43
  2. package/dist/_virtual/_commonjsHelpers.cjs +5 -0
  3. package/dist/_virtual/_commonjsHelpers.mjs +3 -0
  4. package/dist/_virtual/css-escape.cjs +5 -0
  5. package/dist/_virtual/css-escape.mjs +3 -0
  6. package/dist/bin/index.cjs +11 -0
  7. package/dist/bin/index.d.ts +0 -1
  8. package/dist/bin/index.mjs +9 -0
  9. package/dist/common.cjs +159 -0
  10. package/dist/common.d.ts +26 -0
  11. package/dist/common.mjs +137 -0
  12. package/dist/config/animations.cjs +113 -0
  13. package/dist/config/animations.mjs +111 -0
  14. package/dist/config/at.cjs +14 -0
  15. package/dist/config/at.d.ts +11 -0
  16. package/dist/config/at.mjs +12 -0
  17. package/dist/config/functions.cjs +351 -0
  18. package/dist/config/functions.mjs +349 -0
  19. package/dist/config/index.cjs +36 -0
  20. package/dist/config/index.d.ts +24 -21
  21. package/dist/config/index.mjs +26 -0
  22. package/dist/config/modes.cjs +8 -0
  23. package/dist/config/modes.d.ts +3 -0
  24. package/dist/config/modes.mjs +6 -0
  25. package/dist/config/selectors.cjs +28 -0
  26. package/dist/config/selectors.d.ts +0 -1
  27. package/dist/config/selectors.mjs +26 -0
  28. package/dist/config/styles.cjs +2 -0
  29. package/dist/config/styles.mjs +1 -0
  30. package/dist/config/syntaxes.cjs +2283 -0
  31. package/dist/config/syntaxes.d.ts +282 -0
  32. package/dist/config/syntaxes.mjs +2281 -0
  33. package/dist/config/utilities.cjs +204 -0
  34. package/dist/config/{semantics.d.ts → utilities.d.ts} +15 -5
  35. package/dist/config/utilities.mjs +202 -0
  36. package/dist/config/variables.cjs +337 -0
  37. package/dist/config/variables.d.ts +1 -550
  38. package/dist/config/variables.mjs +335 -0
  39. package/dist/core.cjs +1040 -0
  40. package/dist/core.d.ts +39 -35
  41. package/dist/core.mjs +1035 -0
  42. package/dist/index.cjs +73 -0
  43. package/dist/index.d.ts +15 -8
  44. package/dist/index.mjs +22 -0
  45. package/dist/layer.cjs +28 -0
  46. package/dist/layer.d.ts +26 -9
  47. package/dist/layer.mjs +26 -0
  48. package/dist/polyfills/css-escape.cjs +8 -0
  49. package/dist/polyfills/css-escape.mjs +2 -0
  50. package/dist/polyfills/css-escape2.cjs +68 -0
  51. package/dist/polyfills/css-escape2.mjs +64 -0
  52. package/dist/rule.cjs +722 -0
  53. package/dist/rule.d.ts +62 -24
  54. package/dist/rule.mjs +720 -0
  55. package/dist/shared/utils/css-escape.cjs +56 -0
  56. package/dist/shared/utils/css-escape.mjs +54 -0
  57. package/dist/types/global.cjs +2 -0
  58. package/dist/types/global.d.ts +3 -3
  59. package/dist/types/global.mjs +1 -0
  60. package/dist/utils/are-rule-at-equal.cjs +22 -0
  61. package/dist/utils/are-rule-at-equal.d.ts +2 -0
  62. package/dist/utils/are-rule-at-equal.mjs +20 -0
  63. package/dist/utils/are-rule-modes-equal.cjs +7 -0
  64. package/dist/utils/are-rule-modes-equal.d.ts +2 -0
  65. package/dist/utils/are-rule-modes-equal.mjs +5 -0
  66. package/dist/utils/are-rule-selectors-equal.cjs +29 -0
  67. package/dist/utils/are-rule-selectors-equal.d.ts +2 -0
  68. package/dist/utils/are-rule-selectors-equal.mjs +27 -0
  69. package/dist/utils/are-rule-states-equal.cjs +11 -0
  70. package/dist/utils/are-rule-states-equal.d.ts +2 -0
  71. package/dist/utils/are-rule-states-equal.mjs +9 -0
  72. package/dist/utils/are-syntaxes-duplicated.cjs +17 -0
  73. package/dist/utils/are-syntaxes-duplicated.d.ts +2 -0
  74. package/dist/utils/are-syntaxes-duplicated.mjs +15 -0
  75. package/dist/utils/autofill-solid-style.cjs +31 -0
  76. package/dist/utils/autofill-solid-style.d.ts +3 -0
  77. package/dist/utils/autofill-solid-style.mjs +29 -0
  78. package/dist/utils/extend-config.cjs +74 -0
  79. package/dist/utils/extend-config.d.ts +1 -1
  80. package/dist/utils/extend-config.mjs +72 -0
  81. package/dist/utils/flatten-object.cjs +15 -0
  82. package/dist/utils/flatten-object.mjs +13 -0
  83. package/dist/utils/generate-css.cjs +13 -0
  84. package/dist/utils/generate-css.d.ts +2 -0
  85. package/dist/utils/generate-css.mjs +11 -0
  86. package/dist/utils/hex-to-rgb.cjs +30 -0
  87. package/dist/utils/hex-to-rgb.d.ts +1 -1
  88. package/dist/utils/hex-to-rgb.mjs +28 -0
  89. package/dist/utils/is-core-rule.cjs +9 -0
  90. package/dist/utils/is-core-rule.d.ts +1 -0
  91. package/dist/utils/is-core-rule.mjs +7 -0
  92. package/dist/utils/reorder-for-readable-classes.cjs +62 -0
  93. package/dist/{functions → utils}/reorder-for-readable-classes.d.ts +2 -6
  94. package/dist/utils/reorder-for-readable-classes.mjs +60 -0
  95. package/package.json +1 -1
  96. package/dist/bin/index.bundle.js +0 -36
  97. package/dist/config/media-queries.d.ts +0 -1
  98. package/dist/config/rules.d.ts +0 -279
  99. package/dist/constants/base-unit-regex.d.ts +0 -1
  100. package/dist/constants/config-esm-text.d.ts +0 -1
  101. package/dist/constants/config-text.d.ts +0 -1
  102. package/dist/constants/config-ts-text.d.ts +0 -1
  103. package/dist/constants/start-symbol.d.ts +0 -6
  104. package/dist/functions/transform-color-with-opacity.d.ts +0 -1
  105. package/dist/index.bundle.js +0 -35
  106. package/dist/index.bundle.mjs +0 -35
  107. package/dist/tokens/screen-sizes.d.ts +0 -14
  108. package/dist/utils/concat-arrays.d.ts +0 -1
  109. package/dist/utils/get-type.d.ts +0 -7
  110. package/dist/utils/is-plain-object.d.ts +0 -8
  111. package/dist/utils/is-symbol.d.ts +0 -7
  112. package/dist/utils/rgb-to-hex.d.ts +0 -1
package/dist/rule.d.ts CHANGED
@@ -1,41 +1,68 @@
1
- import type { MasterCSS, Variable } from './core';
2
- import { Layer } from './layer';
3
- import { PropertiesHyphen } from 'csstype';
1
+ import MasterCSS, { type Variable } from './core';
2
+ import Layer from './layer';
3
+ import { type PropertiesHyphen } from 'csstype';
4
4
  export declare class Rule {
5
5
  readonly className: string;
6
+ readonly RegisteredRule: RegisteredRule;
6
7
  css: MasterCSS;
7
- readonly at: Record<string, string>;
8
+ readonly at: Record<string, AtComponent[]>;
8
9
  readonly priority: number;
9
10
  readonly natives: NativeRule[];
10
11
  readonly order: number;
11
12
  readonly layer: Layer;
12
- readonly stateToken: string;
13
13
  readonly declarations?: PropertiesHyphen;
14
14
  animationNames?: string[];
15
15
  variableNames?: string[];
16
16
  constructor(className: string, RegisteredRule: RegisteredRule, css: MasterCSS);
17
+ resolveAtComponent(atComponent: AtComponent): string;
17
18
  resolveValue: (valueComponents: ValueComponent[], unit: string, bypassVariableNames: string[], bypassParsing: boolean) => string;
18
19
  get text(): string;
19
- parseValue: (currentValueComponents: ValueComponent[], i: number, value: string, unit: string, endSymbol: string, parentFunctionName?: string, bypassParsing?: boolean, bypassVariableNames?: string[]) => number;
20
- parseValueComponent(token: string | number, unit?: any): StringValueComponent | NumericValueComponent;
20
+ parseValues: (currentValueComponents: ValueComponent[], i: number, value: string, unit: string, endSymbol: string, parentFunctionName?: string, bypassParsing?: boolean, bypassVariableNames?: string[]) => number;
21
+ parseValue(token: string | number, unit?: any): {
22
+ value: string;
23
+ type: 'string';
24
+ } | {
25
+ value: number;
26
+ unit: string;
27
+ type: 'number';
28
+ };
29
+ }
30
+ export type AtComponent = AtArbitraryComponent | AtFeatureComponent | AtOperatorComponent;
31
+ export interface AtArbitraryComponent {
32
+ type: 'arbitrary';
33
+ token?: string;
34
+ value: string;
35
+ }
36
+ export interface AtFeatureComponent {
37
+ type: 'feature';
38
+ token?: string;
39
+ name: string;
40
+ valueType: 'number' | 'string';
41
+ value: string | number;
42
+ unit?: string;
43
+ }
44
+ export interface AtOperatorComponent {
45
+ type: 'operator';
46
+ token: '&';
47
+ value: 'and';
21
48
  }
22
49
  export type ValueComponent = StringValueComponent | NumericValueComponent | FunctionValueComponent | VariableValueComponent | SeparatorValueComponent;
23
50
  export interface StringValueComponent {
24
51
  text?: string;
25
- token?: string;
52
+ token: string;
26
53
  type: 'string';
27
54
  value: string;
28
55
  }
29
56
  export interface NumericValueComponent {
30
57
  text?: string;
31
- token?: string;
58
+ token: string;
32
59
  type: 'number';
33
60
  value: number;
34
61
  unit?: string;
35
62
  }
36
63
  export interface FunctionValueComponent {
37
64
  text?: string;
38
- token?: string;
65
+ token: string;
39
66
  type: 'function';
40
67
  name: string;
41
68
  symbol: string;
@@ -44,7 +71,7 @@ export interface FunctionValueComponent {
44
71
  }
45
72
  export interface VariableValueComponent {
46
73
  text?: string;
47
- token?: string;
74
+ token: string;
48
75
  type: 'variable';
49
76
  name: string;
50
77
  alpha?: string;
@@ -53,41 +80,52 @@ export interface VariableValueComponent {
53
80
  }
54
81
  export interface SeparatorValueComponent {
55
82
  text?: string;
83
+ token: string;
56
84
  type: 'separator';
57
85
  value: string;
58
86
  }
59
87
  export interface Rule extends RegisteredRule {
60
- colored: boolean;
61
- prefix: string;
62
88
  token: string;
63
89
  vendorPrefixSelectors: Record<string, string[]>;
64
90
  vendorSuffixSelectors: Record<string, string[]>;
65
91
  important: boolean;
66
- media: MediaQuery;
67
92
  direction: string;
68
- theme: string;
93
+ mode: string;
69
94
  unitToken: string;
95
+ keyToken: string;
96
+ valueToken: string;
97
+ stateToken: string;
98
+ atToken: string;
70
99
  hasWhere: boolean;
71
100
  valueComponents: Array<ValueComponent>;
72
101
  }
73
102
  export interface RegisteredRule {
74
103
  id: string;
75
- match?: RegExp;
76
- variables?: any;
104
+ key?: string;
105
+ keys: string[];
106
+ matchers: {
107
+ key?: RegExp;
108
+ variable?: RegExp;
109
+ value?: RegExp;
110
+ arbitrary?: RegExp;
111
+ };
112
+ variables: Record<string, Variable>;
77
113
  order: number;
78
- definition: RuleDefinition;
114
+ definition: SyntaxDefinition;
79
115
  }
80
- export interface RuleDefinition {
116
+ export interface SyntaxDefinition {
81
117
  layer?: Layer;
82
- match?: RegExp | [string, string[]?];
118
+ matcher?: RegExp;
119
+ sign?: string;
120
+ key?: string;
121
+ subkey?: string;
122
+ ambiguousKeys?: string[];
123
+ ambiguousValues?: (RegExp | string)[];
83
124
  variables?: string[];
84
125
  separators?: string[];
85
- shorthand?: string;
86
- colored?: boolean;
87
- numeric?: boolean;
88
126
  unit?: any;
89
- native?: boolean;
90
127
  declarations?: PropertiesHyphen;
128
+ includeAnimations?: boolean;
91
129
  analyze?: (this: Rule, className: string) => [valueToken: string, prefixToken?: string];
92
130
  transformValue?(this: Rule, value: string): string;
93
131
  transformValueComponents?(this: Rule, valueComponents: ValueComponent[]): ValueComponent[];