@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,262 +1,223 @@
1
- 'use strict';
2
-
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region src/helpers/getPropertyPriority.ts
3
+ const longhands = Object.values({
4
+ animation: [
5
+ "animation-name",
6
+ "animation-duration",
7
+ "animation-timing-function",
8
+ "animation-delay",
9
+ "animation-iteration-count",
10
+ "animation-direction",
11
+ "animation-fill-mode",
12
+ "animation-play-state"
13
+ ],
14
+ background: [
15
+ "background-attachment",
16
+ "background-clip",
17
+ "background-color",
18
+ "background-image",
19
+ "background-origin",
20
+ "background-position",
21
+ "background-repeat",
22
+ "background-size"
23
+ ],
24
+ border: [
25
+ "border-color",
26
+ "border-style",
27
+ "border-width"
28
+ ],
29
+ "border-block-end": [
30
+ "border-block-end-color",
31
+ "border-block-end-style",
32
+ "border-block-end-width"
33
+ ],
34
+ "border-block-start": [
35
+ "border-block-start-color",
36
+ "border-block-start-style",
37
+ "border-block-start-width"
38
+ ],
39
+ "border-bottom": [
40
+ "border-bottom-color",
41
+ "border-bottom-style",
42
+ "border-bottom-width"
43
+ ],
44
+ "border-color": [
45
+ "border-bottom-color",
46
+ "border-left-color",
47
+ "border-right-color",
48
+ "border-top-color"
49
+ ],
50
+ "border-image": [
51
+ "border-image-outset",
52
+ "border-image-repeat",
53
+ "border-image-slice",
54
+ "border-image-source",
55
+ "border-image-width"
56
+ ],
57
+ "border-inline-end": [
58
+ "border-inline-end-color",
59
+ "border-inline-end-style",
60
+ "border-inline-end-width"
61
+ ],
62
+ "border-inline-start": [
63
+ "border-inline-start-color",
64
+ "border-inline-start-style",
65
+ "border-inline-start-width"
66
+ ],
67
+ "border-left": [
68
+ "border-left-color",
69
+ "border-left-style",
70
+ "border-left-width"
71
+ ],
72
+ "border-radius": [
73
+ "border-top-left-radius",
74
+ "border-top-right-radius",
75
+ "border-bottom-right-radius",
76
+ "border-bottom-left-radius"
77
+ ],
78
+ "border-right": [
79
+ "border-right-color",
80
+ "border-right-style",
81
+ "border-right-width"
82
+ ],
83
+ "border-style": [
84
+ "border-bottom-style",
85
+ "border-left-style",
86
+ "border-right-style",
87
+ "border-top-style"
88
+ ],
89
+ "border-top": [
90
+ "border-top-color",
91
+ "border-top-style",
92
+ "border-top-width"
93
+ ],
94
+ "border-width": [
95
+ "border-bottom-width",
96
+ "border-left-width",
97
+ "border-right-width",
98
+ "border-top-width"
99
+ ],
100
+ "column-rule": [
101
+ "column-rule-width",
102
+ "column-rule-style",
103
+ "column-rule-color"
104
+ ],
105
+ columns: ["column-count", "column-width"],
106
+ flex: [
107
+ "flex-grow",
108
+ "flex-shrink",
109
+ "flex-basis"
110
+ ],
111
+ "flex-flow": ["flex-direction", "flex-wrap"],
112
+ font: [
113
+ "font-family",
114
+ "font-size",
115
+ "font-stretch",
116
+ "font-style",
117
+ "font-variant",
118
+ "font-weight",
119
+ "line-height"
120
+ ],
121
+ gap: ["row-gap", "column-gap"],
122
+ grid: [
123
+ "grid-auto-columns",
124
+ "grid-auto-flow",
125
+ "grid-auto-rows",
126
+ "grid-template-areas",
127
+ "grid-template-columns",
128
+ "grid-template-rows"
129
+ ],
130
+ "grid-area": [
131
+ "grid-row-start",
132
+ "grid-column-start",
133
+ "grid-row-end",
134
+ "grid-column-end"
135
+ ],
136
+ "grid-column": ["grid-column-end", "grid-column-start"],
137
+ "grid-row": ["grid-row-end", "grid-row-start"],
138
+ "grid-template": [
139
+ "grid-template-areas",
140
+ "grid-template-columns",
141
+ "grid-template-rows"
142
+ ],
143
+ "list-style": [
144
+ "list-style-image",
145
+ "list-style-position",
146
+ "list-style-type"
147
+ ],
148
+ margin: [
149
+ "margin-bottom",
150
+ "margin-left",
151
+ "margin-right",
152
+ "margin-top"
153
+ ],
154
+ mask: [
155
+ "mask-clip",
156
+ "mask-composite",
157
+ "mask-image",
158
+ "mask-mode",
159
+ "mask-origin",
160
+ "mask-position",
161
+ "mask-repeat",
162
+ "mask-size"
163
+ ],
164
+ offset: [
165
+ "offset-anchor",
166
+ "offset-distance",
167
+ "offset-path",
168
+ "offset-position",
169
+ "offset-rotate"
170
+ ],
171
+ outline: [
172
+ "outline-color",
173
+ "outline-style",
174
+ "outline-width"
175
+ ],
176
+ overflow: ["overflow-x", "overflow-y"],
177
+ padding: [
178
+ "padding-bottom",
179
+ "padding-left",
180
+ "padding-right",
181
+ "padding-top"
182
+ ],
183
+ "place-content": ["align-content", "justify-content"],
184
+ "place-items": ["align-items", "justify-items"],
185
+ "place-self": ["align-self", "justify-self"],
186
+ "scroll-margin": [
187
+ "scroll-margin-bottom",
188
+ "scroll-margin-left",
189
+ "scroll-margin-right",
190
+ "scroll-margin-top"
191
+ ],
192
+ "scroll-padding": [
193
+ "scroll-padding-bottom",
194
+ "scroll-padding-left",
195
+ "scroll-padding-right",
196
+ "scroll-padding-top"
197
+ ],
198
+ "text-decoration": [
199
+ "text-decoration-color",
200
+ "text-decoration-line",
201
+ "text-decoration-style",
202
+ "text-decoration-thickness"
203
+ ],
204
+ "text-emphasis": ["text-emphasis-color", "text-emphasis-style"],
205
+ transition: [
206
+ "transition-delay",
207
+ "transition-duration",
208
+ "transition-property",
209
+ "transition-timing-function"
210
+ ]
211
+ }).reduce((a, b) => [...a, ...b], []);
3
212
  /**
4
- * This list comes from:
5
- * https://github.com/callstack/linaria/blob/master/packages/atomic/src/processors/helpers/propertyPriority.ts
6
- */ const shorthandProperties = {
7
- // The `all` property resets everything, and should effectively have priority zero.
8
- // In practice, this can be achieved by using: div { all: ... } to have even less specificity, but to avoid duplicating all selectors, we just let it be
9
- // 'all': []
10
- animation: [
11
- 'animation-name',
12
- 'animation-duration',
13
- 'animation-timing-function',
14
- 'animation-delay',
15
- 'animation-iteration-count',
16
- 'animation-direction',
17
- 'animation-fill-mode',
18
- 'animation-play-state'
19
- ],
20
- background: [
21
- 'background-attachment',
22
- 'background-clip',
23
- 'background-color',
24
- 'background-image',
25
- 'background-origin',
26
- 'background-position',
27
- 'background-repeat',
28
- 'background-size'
29
- ],
30
- border: [
31
- 'border-color',
32
- 'border-style',
33
- 'border-width'
34
- ],
35
- 'border-block-end': [
36
- 'border-block-end-color',
37
- 'border-block-end-style',
38
- 'border-block-end-width'
39
- ],
40
- 'border-block-start': [
41
- 'border-block-start-color',
42
- 'border-block-start-style',
43
- 'border-block-start-width'
44
- ],
45
- 'border-bottom': [
46
- 'border-bottom-color',
47
- 'border-bottom-style',
48
- 'border-bottom-width'
49
- ],
50
- 'border-color': [
51
- 'border-bottom-color',
52
- 'border-left-color',
53
- 'border-right-color',
54
- 'border-top-color'
55
- ],
56
- 'border-image': [
57
- 'border-image-outset',
58
- 'border-image-repeat',
59
- 'border-image-slice',
60
- 'border-image-source',
61
- 'border-image-width'
62
- ],
63
- 'border-inline-end': [
64
- 'border-inline-end-color',
65
- 'border-inline-end-style',
66
- 'border-inline-end-width'
67
- ],
68
- 'border-inline-start': [
69
- 'border-inline-start-color',
70
- 'border-inline-start-style',
71
- 'border-inline-start-width'
72
- ],
73
- 'border-left': [
74
- 'border-left-color',
75
- 'border-left-style',
76
- 'border-left-width'
77
- ],
78
- 'border-radius': [
79
- 'border-top-left-radius',
80
- 'border-top-right-radius',
81
- 'border-bottom-right-radius',
82
- 'border-bottom-left-radius'
83
- ],
84
- 'border-right': [
85
- 'border-right-color',
86
- 'border-right-style',
87
- 'border-right-width'
88
- ],
89
- 'border-style': [
90
- 'border-bottom-style',
91
- 'border-left-style',
92
- 'border-right-style',
93
- 'border-top-style'
94
- ],
95
- 'border-top': [
96
- 'border-top-color',
97
- 'border-top-style',
98
- 'border-top-width'
99
- ],
100
- 'border-width': [
101
- 'border-bottom-width',
102
- 'border-left-width',
103
- 'border-right-width',
104
- 'border-top-width'
105
- ],
106
- 'column-rule': [
107
- 'column-rule-width',
108
- 'column-rule-style',
109
- 'column-rule-color'
110
- ],
111
- columns: [
112
- 'column-count',
113
- 'column-width'
114
- ],
115
- flex: [
116
- 'flex-grow',
117
- 'flex-shrink',
118
- 'flex-basis'
119
- ],
120
- 'flex-flow': [
121
- 'flex-direction',
122
- 'flex-wrap'
123
- ],
124
- font: [
125
- 'font-family',
126
- 'font-size',
127
- 'font-stretch',
128
- 'font-style',
129
- 'font-variant',
130
- 'font-weight',
131
- 'line-height'
132
- ],
133
- gap: [
134
- 'row-gap',
135
- 'column-gap'
136
- ],
137
- grid: [
138
- 'grid-auto-columns',
139
- 'grid-auto-flow',
140
- 'grid-auto-rows',
141
- 'grid-template-areas',
142
- 'grid-template-columns',
143
- 'grid-template-rows'
144
- ],
145
- 'grid-area': [
146
- 'grid-row-start',
147
- 'grid-column-start',
148
- 'grid-row-end',
149
- 'grid-column-end'
150
- ],
151
- 'grid-column': [
152
- 'grid-column-end',
153
- 'grid-column-start'
154
- ],
155
- 'grid-row': [
156
- 'grid-row-end',
157
- 'grid-row-start'
158
- ],
159
- 'grid-template': [
160
- 'grid-template-areas',
161
- 'grid-template-columns',
162
- 'grid-template-rows'
163
- ],
164
- 'list-style': [
165
- 'list-style-image',
166
- 'list-style-position',
167
- 'list-style-type'
168
- ],
169
- margin: [
170
- 'margin-bottom',
171
- 'margin-left',
172
- 'margin-right',
173
- 'margin-top'
174
- ],
175
- mask: [
176
- 'mask-clip',
177
- 'mask-composite',
178
- 'mask-image',
179
- 'mask-mode',
180
- 'mask-origin',
181
- 'mask-position',
182
- 'mask-repeat',
183
- 'mask-size'
184
- ],
185
- offset: [
186
- 'offset-anchor',
187
- 'offset-distance',
188
- 'offset-path',
189
- 'offset-position',
190
- 'offset-rotate'
191
- ],
192
- outline: [
193
- 'outline-color',
194
- 'outline-style',
195
- 'outline-width'
196
- ],
197
- overflow: [
198
- 'overflow-x',
199
- 'overflow-y'
200
- ],
201
- padding: [
202
- 'padding-bottom',
203
- 'padding-left',
204
- 'padding-right',
205
- 'padding-top'
206
- ],
207
- 'place-content': [
208
- 'align-content',
209
- 'justify-content'
210
- ],
211
- 'place-items': [
212
- 'align-items',
213
- 'justify-items'
214
- ],
215
- 'place-self': [
216
- 'align-self',
217
- 'justify-self'
218
- ],
219
- 'scroll-margin': [
220
- 'scroll-margin-bottom',
221
- 'scroll-margin-left',
222
- 'scroll-margin-right',
223
- 'scroll-margin-top'
224
- ],
225
- 'scroll-padding': [
226
- 'scroll-padding-bottom',
227
- 'scroll-padding-left',
228
- 'scroll-padding-right',
229
- 'scroll-padding-top'
230
- ],
231
- 'text-decoration': [
232
- 'text-decoration-color',
233
- 'text-decoration-line',
234
- 'text-decoration-style',
235
- 'text-decoration-thickness'
236
- ],
237
- 'text-emphasis': [
238
- 'text-emphasis-color',
239
- 'text-emphasis-style'
240
- ],
241
- transition: [
242
- 'transition-delay',
243
- 'transition-duration',
244
- 'transition-property',
245
- 'transition-timing-function'
246
- ]
247
- };
248
- const longhands = Object.values(shorthandProperties).reduce((a, b)=>[
249
- ...a,
250
- ...b
251
- ], []);
252
- /**
253
- * The concept here is that shorthand properties, such as "border" gets
254
- * a priority of one, while longhand properties, such as "border-color" gets
255
- * a priority of 2.
256
- *
257
- * Read more:
258
- * @see https://weser.io/blog/the-shorthand-longhand-problem-in-atomic-css
259
- * @see https://www.w3.org/TR/selectors-3/#specificity
260
- */ const getPropertyPriority = (property)=>longhands.includes(property) ? 2 : 1;
261
-
213
+ * The concept here is that shorthand properties, such as "border" gets
214
+ * a priority of one, while longhand properties, such as "border-color" gets
215
+ * a priority of 2.
216
+ *
217
+ * Read more:
218
+ * @see https://weser.io/blog/the-shorthand-longhand-problem-in-atomic-css
219
+ * @see https://www.w3.org/TR/selectors-3/#specificity
220
+ */
221
+ const getPropertyPriority = (property) => longhands.includes(property) ? 2 : 1;
222
+ //#endregion
262
223
  exports.getPropertyPriority = getPropertyPriority;