@melcanz85/chaincss 1.11.1 → 1.11.2

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/browser/rtt.js CHANGED
@@ -1,48 +1,68 @@
1
1
  import { tokens, createTokens, responsive } from '../shared/tokens.mjs';
2
+
2
3
  let cssProperties = [];
3
- try {
4
- const module = await import('../node/css-properties.json', {
5
- assert: { type: 'json' },
6
- ignore: true
7
- });
8
- cssProperties = module.default;
9
- } catch (e) {
10
- console.log('CSS properties file not found, will fetch from CDN');
11
- }
4
+
5
+ // Instead of using dynamic import with unsupported options
6
+ // Use a try-catch with proper dynamic import syntax
7
+ const loadCSSProperties = async () => {
8
+ try {
9
+ // Remove the unsupported 'ignore' option
10
+ const module = await import('../node/css-properties.json', {
11
+ assert: { type: 'json' }
12
+ });
13
+ return module.default;
14
+ } catch (e) {
15
+ // If the file doesn't exist in the package, fallback to CDN
16
+ console.log('CSS properties file not found in package, will fetch from CDN');
17
+ return null;
18
+ }
19
+ };
20
+
21
+ // Initialize asynchronously
12
22
  const chain = {
13
23
  cssOutput: undefined,
14
24
  catcher: {},
15
25
  cachedValidProperties: [],
16
- async initializeProperties() {
17
- if (cssProperties && cssProperties.length > 0) {
18
- this.cachedValidProperties = cssProperties;
26
+ async initializeProperties() {
27
+ if (this.cachedValidProperties.length > 0) {
19
28
  return;
20
- }else{
21
- try {
22
- let CDNfallBackProp = [];
23
- const response = await fetch('https://raw.githubusercontent.com/mdn/data/main/css/properties.json');
24
- const data = await response.json();
25
- const allProperties = Object.keys(data);
26
-
27
- // Strip vendor prefixes and remove duplicates
28
- const baseProperties = new Set();
29
- allProperties.forEach(prop => {
30
- const baseProp = prop.replace(/^-(webkit|moz|ms|o)-/, '');
31
- baseProperties.add(baseProp);
32
- });
33
- CDNfallBackProp = Array.from(baseProperties).sort();
34
- this.cachedValidProperties = CDNfallBackProp;
35
- } catch (error) {
36
- console.error('Error loading from CDN:', error);
37
- return [];
38
- }
29
+ }
30
+
31
+ // Try to load from local file first
32
+ const localProperties = await loadCSSProperties();
33
+ if (localProperties && localProperties.length > 0) {
34
+ this.cachedValidProperties = localProperties;
35
+ return;
36
+ }
37
+
38
+ // Fallback to CDN
39
+ try {
40
+ console.log('Loading CSS properties from CDN...');
41
+ const response = await fetch('https://raw.githubusercontent.com/mdn/data/main/css/properties.json');
42
+ const data = await response.json();
43
+ const allProperties = Object.keys(data);
44
+
45
+ // Strip vendor prefixes and remove duplicates
46
+ const baseProperties = new Set();
47
+ allProperties.forEach(prop => {
48
+ const baseProp = prop.replace(/^-(webkit|moz|ms|o)-/, '');
49
+ baseProperties.add(baseProp);
50
+ });
51
+ this.cachedValidProperties = Array.from(baseProperties).sort();
52
+ } catch (error) {
53
+ console.error('Error loading from CDN:', error);
54
+ this.cachedValidProperties = [];
39
55
  }
40
56
  },
41
57
  getCachedProperties() {
42
58
  return this.cachedValidProperties;
43
59
  }
44
60
  };
61
+
62
+ // Start initialization but don't await (non-blocking)
45
63
  chain.initializeProperties();
64
+
65
+ // Rest of your code remains the same...
46
66
  const resolveToken = (value, useTokens) => {
47
67
  if (!useTokens || typeof value !== 'string' || !value.startsWith('$')) {
48
68
  return value;
@@ -54,6 +74,7 @@ const resolveToken = (value, useTokens) => {
54
74
  }
55
75
  return tokenValue;
56
76
  };
77
+
57
78
  function $(useTokens = true){
58
79
  const catcher = {};
59
80
  const validProperties = chain.cachedValidProperties;
@@ -87,6 +108,7 @@ function $(useTokens = true){
87
108
  const proxy = new Proxy({}, handler);
88
109
  return proxy;
89
110
  }
111
+
90
112
  const run = (...args) => {
91
113
  let cssOutput = '';
92
114
  args.forEach((value) => {
@@ -105,6 +127,7 @@ const run = (...args) => {
105
127
  chain.cssOutput = cssOutput.trim();
106
128
  return cssOutput.trim();
107
129
  };
130
+
108
131
  const compile = (obj) => {
109
132
  let cssString = '';
110
133
  for (const key in obj) {
@@ -0,0 +1,633 @@
1
+ [
2
+ "--*",
3
+ "accelerator",
4
+ "accent-color",
5
+ "align-content",
6
+ "align-items",
7
+ "align-self",
8
+ "align-tracks",
9
+ "alignment-baseline",
10
+ "all",
11
+ "anchor-name",
12
+ "anchor-scope",
13
+ "animation",
14
+ "animation-composition",
15
+ "animation-delay",
16
+ "animation-direction",
17
+ "animation-duration",
18
+ "animation-fill-mode",
19
+ "animation-iteration-count",
20
+ "animation-name",
21
+ "animation-play-state",
22
+ "animation-range",
23
+ "animation-range-end",
24
+ "animation-range-start",
25
+ "animation-timeline",
26
+ "animation-timing-function",
27
+ "animation-trigger",
28
+ "appearance",
29
+ "aspect-ratio",
30
+ "backdrop-filter",
31
+ "backface-visibility",
32
+ "background",
33
+ "background-attachment",
34
+ "background-blend-mode",
35
+ "background-clip",
36
+ "background-color",
37
+ "background-image",
38
+ "background-origin",
39
+ "background-position",
40
+ "background-position-x",
41
+ "background-position-y",
42
+ "background-repeat",
43
+ "background-size",
44
+ "baseline-shift",
45
+ "baseline-source",
46
+ "binding",
47
+ "block-progression",
48
+ "block-size",
49
+ "border",
50
+ "border-before",
51
+ "border-before-color",
52
+ "border-before-style",
53
+ "border-before-width",
54
+ "border-block",
55
+ "border-block-color",
56
+ "border-block-end",
57
+ "border-block-end-color",
58
+ "border-block-end-style",
59
+ "border-block-end-width",
60
+ "border-block-start",
61
+ "border-block-start-color",
62
+ "border-block-start-style",
63
+ "border-block-start-width",
64
+ "border-block-style",
65
+ "border-block-width",
66
+ "border-bottom",
67
+ "border-bottom-color",
68
+ "border-bottom-colors",
69
+ "border-bottom-left-radius",
70
+ "border-bottom-right-radius",
71
+ "border-bottom-style",
72
+ "border-bottom-width",
73
+ "border-collapse",
74
+ "border-color",
75
+ "border-end-end-radius",
76
+ "border-end-start-radius",
77
+ "border-image",
78
+ "border-image-outset",
79
+ "border-image-repeat",
80
+ "border-image-slice",
81
+ "border-image-source",
82
+ "border-image-width",
83
+ "border-inline",
84
+ "border-inline-color",
85
+ "border-inline-end",
86
+ "border-inline-end-color",
87
+ "border-inline-end-style",
88
+ "border-inline-end-width",
89
+ "border-inline-start",
90
+ "border-inline-start-color",
91
+ "border-inline-start-style",
92
+ "border-inline-start-width",
93
+ "border-inline-style",
94
+ "border-inline-width",
95
+ "border-left",
96
+ "border-left-color",
97
+ "border-left-colors",
98
+ "border-left-style",
99
+ "border-left-width",
100
+ "border-radius",
101
+ "border-right",
102
+ "border-right-color",
103
+ "border-right-colors",
104
+ "border-right-style",
105
+ "border-right-width",
106
+ "border-spacing",
107
+ "border-start-end-radius",
108
+ "border-start-start-radius",
109
+ "border-style",
110
+ "border-top",
111
+ "border-top-color",
112
+ "border-top-colors",
113
+ "border-top-left-radius",
114
+ "border-top-right-radius",
115
+ "border-top-style",
116
+ "border-top-width",
117
+ "border-width",
118
+ "bottom",
119
+ "box-align",
120
+ "box-decoration-break",
121
+ "box-direction",
122
+ "box-flex",
123
+ "box-flex-group",
124
+ "box-lines",
125
+ "box-ordinal-group",
126
+ "box-orient",
127
+ "box-pack",
128
+ "box-reflect",
129
+ "box-shadow",
130
+ "box-sizing",
131
+ "break-after",
132
+ "break-before",
133
+ "break-inside",
134
+ "caption-side",
135
+ "caret",
136
+ "caret-animation",
137
+ "caret-color",
138
+ "caret-shape",
139
+ "clear",
140
+ "clip",
141
+ "clip-path",
142
+ "clip-rule",
143
+ "color",
144
+ "color-interpolation-filters",
145
+ "color-scheme",
146
+ "column-count",
147
+ "column-fill",
148
+ "column-gap",
149
+ "column-height",
150
+ "column-rule",
151
+ "column-rule-color",
152
+ "column-rule-style",
153
+ "column-rule-width",
154
+ "column-span",
155
+ "column-width",
156
+ "column-wrap",
157
+ "columns",
158
+ "contain",
159
+ "contain-intrinsic-block-size",
160
+ "contain-intrinsic-height",
161
+ "contain-intrinsic-inline-size",
162
+ "contain-intrinsic-size",
163
+ "contain-intrinsic-width",
164
+ "container",
165
+ "container-name",
166
+ "container-type",
167
+ "content",
168
+ "content-visibility",
169
+ "content-zoom-chaining",
170
+ "content-zoom-limit",
171
+ "content-zoom-limit-max",
172
+ "content-zoom-limit-min",
173
+ "content-zoom-snap",
174
+ "content-zoom-snap-points",
175
+ "content-zoom-snap-type",
176
+ "content-zooming",
177
+ "context-properties",
178
+ "corner-block-end-shape",
179
+ "corner-block-start-shape",
180
+ "corner-bottom-left-shape",
181
+ "corner-bottom-right-shape",
182
+ "corner-bottom-shape",
183
+ "corner-end-end-shape",
184
+ "corner-end-start-shape",
185
+ "corner-inline-end-shape",
186
+ "corner-inline-start-shape",
187
+ "corner-left-shape",
188
+ "corner-right-shape",
189
+ "corner-shape",
190
+ "corner-start-end-shape",
191
+ "corner-start-start-shape",
192
+ "corner-top-left-shape",
193
+ "corner-top-right-shape",
194
+ "corner-top-shape",
195
+ "counter-increment",
196
+ "counter-reset",
197
+ "counter-set",
198
+ "cursor",
199
+ "cx",
200
+ "cy",
201
+ "d",
202
+ "direction",
203
+ "display",
204
+ "dominant-baseline",
205
+ "dynamic-range-limit",
206
+ "empty-cells",
207
+ "field-sizing",
208
+ "fill",
209
+ "fill-opacity",
210
+ "fill-rule",
211
+ "filter",
212
+ "flex",
213
+ "flex-basis",
214
+ "flex-direction",
215
+ "flex-flow",
216
+ "flex-grow",
217
+ "flex-shrink",
218
+ "flex-wrap",
219
+ "float",
220
+ "float-edge",
221
+ "flood-color",
222
+ "flood-opacity",
223
+ "flow-from",
224
+ "flow-into",
225
+ "font",
226
+ "font-family",
227
+ "font-feature-settings",
228
+ "font-kerning",
229
+ "font-language-override",
230
+ "font-optical-sizing",
231
+ "font-palette",
232
+ "font-size",
233
+ "font-size-adjust",
234
+ "font-smooth",
235
+ "font-stretch",
236
+ "font-style",
237
+ "font-synthesis",
238
+ "font-synthesis-position",
239
+ "font-synthesis-small-caps",
240
+ "font-synthesis-style",
241
+ "font-synthesis-weight",
242
+ "font-variant",
243
+ "font-variant-alternates",
244
+ "font-variant-caps",
245
+ "font-variant-east-asian",
246
+ "font-variant-emoji",
247
+ "font-variant-ligatures",
248
+ "font-variant-numeric",
249
+ "font-variant-position",
250
+ "font-variation-settings",
251
+ "font-weight",
252
+ "font-width",
253
+ "force-broken-image-icon",
254
+ "forced-color-adjust",
255
+ "gap",
256
+ "grid",
257
+ "grid-area",
258
+ "grid-auto-columns",
259
+ "grid-auto-flow",
260
+ "grid-auto-rows",
261
+ "grid-column",
262
+ "grid-column-end",
263
+ "grid-column-gap",
264
+ "grid-column-start",
265
+ "grid-columns",
266
+ "grid-gap",
267
+ "grid-row",
268
+ "grid-row-end",
269
+ "grid-row-gap",
270
+ "grid-row-start",
271
+ "grid-rows",
272
+ "grid-template",
273
+ "grid-template-areas",
274
+ "grid-template-columns",
275
+ "grid-template-rows",
276
+ "hanging-punctuation",
277
+ "height",
278
+ "high-contrast-adjust",
279
+ "hyphenate-character",
280
+ "hyphenate-limit-chars",
281
+ "hyphenate-limit-lines",
282
+ "hyphenate-limit-zone",
283
+ "hyphens",
284
+ "image-orientation",
285
+ "image-rendering",
286
+ "image-resolution",
287
+ "ime-align",
288
+ "ime-mode",
289
+ "initial-letter",
290
+ "initial-letter-align",
291
+ "inline-size",
292
+ "inset",
293
+ "inset-block",
294
+ "inset-block-end",
295
+ "inset-block-start",
296
+ "inset-inline",
297
+ "inset-inline-end",
298
+ "inset-inline-start",
299
+ "interactivity",
300
+ "interest-delay",
301
+ "interest-delay-end",
302
+ "interest-delay-start",
303
+ "interpolate-size",
304
+ "isolation",
305
+ "justify-content",
306
+ "justify-items",
307
+ "justify-self",
308
+ "justify-tracks",
309
+ "left",
310
+ "letter-spacing",
311
+ "lighting-color",
312
+ "line-break",
313
+ "line-clamp",
314
+ "line-height",
315
+ "line-height-step",
316
+ "list-style",
317
+ "list-style-image",
318
+ "list-style-position",
319
+ "list-style-type",
320
+ "margin",
321
+ "margin-block",
322
+ "margin-block-end",
323
+ "margin-block-start",
324
+ "margin-bottom",
325
+ "margin-inline",
326
+ "margin-inline-end",
327
+ "margin-inline-start",
328
+ "margin-left",
329
+ "margin-right",
330
+ "margin-top",
331
+ "margin-trim",
332
+ "marker",
333
+ "marker-end",
334
+ "marker-mid",
335
+ "marker-start",
336
+ "mask",
337
+ "mask-attachment",
338
+ "mask-border",
339
+ "mask-border-mode",
340
+ "mask-border-outset",
341
+ "mask-border-repeat",
342
+ "mask-border-slice",
343
+ "mask-border-source",
344
+ "mask-border-width",
345
+ "mask-clip",
346
+ "mask-composite",
347
+ "mask-image",
348
+ "mask-mode",
349
+ "mask-origin",
350
+ "mask-position",
351
+ "mask-position-x",
352
+ "mask-position-y",
353
+ "mask-repeat",
354
+ "mask-repeat-x",
355
+ "mask-repeat-y",
356
+ "mask-size",
357
+ "mask-type",
358
+ "masonry-auto-flow",
359
+ "math-depth",
360
+ "math-shift",
361
+ "math-style",
362
+ "max-block-size",
363
+ "max-height",
364
+ "max-inline-size",
365
+ "max-lines",
366
+ "max-width",
367
+ "min-block-size",
368
+ "min-height",
369
+ "min-inline-size",
370
+ "min-width",
371
+ "mix-blend-mode",
372
+ "object-fit",
373
+ "object-position",
374
+ "object-view-box",
375
+ "offset",
376
+ "offset-anchor",
377
+ "offset-distance",
378
+ "offset-path",
379
+ "offset-position",
380
+ "offset-rotate",
381
+ "opacity",
382
+ "order",
383
+ "orient",
384
+ "orphans",
385
+ "outline",
386
+ "outline-color",
387
+ "outline-offset",
388
+ "outline-radius",
389
+ "outline-radius-bottomleft",
390
+ "outline-radius-bottomright",
391
+ "outline-radius-topleft",
392
+ "outline-radius-topright",
393
+ "outline-style",
394
+ "outline-width",
395
+ "overflow",
396
+ "overflow-anchor",
397
+ "overflow-block",
398
+ "overflow-clip-box",
399
+ "overflow-clip-margin",
400
+ "overflow-inline",
401
+ "overflow-scrolling",
402
+ "overflow-style",
403
+ "overflow-wrap",
404
+ "overflow-x",
405
+ "overflow-y",
406
+ "overlay",
407
+ "overscroll-behavior",
408
+ "overscroll-behavior-block",
409
+ "overscroll-behavior-inline",
410
+ "overscroll-behavior-x",
411
+ "overscroll-behavior-y",
412
+ "padding",
413
+ "padding-block",
414
+ "padding-block-end",
415
+ "padding-block-start",
416
+ "padding-bottom",
417
+ "padding-inline",
418
+ "padding-inline-end",
419
+ "padding-inline-start",
420
+ "padding-left",
421
+ "padding-right",
422
+ "padding-top",
423
+ "page",
424
+ "page-break-after",
425
+ "page-break-before",
426
+ "page-break-inside",
427
+ "paint-order",
428
+ "perspective",
429
+ "perspective-origin",
430
+ "place-content",
431
+ "place-items",
432
+ "place-self",
433
+ "pointer-events",
434
+ "position",
435
+ "position-anchor",
436
+ "position-area",
437
+ "position-try",
438
+ "position-try-fallbacks",
439
+ "position-try-order",
440
+ "position-visibility",
441
+ "print-color-adjust",
442
+ "quotes",
443
+ "r",
444
+ "reading-flow",
445
+ "reading-order",
446
+ "resize",
447
+ "right",
448
+ "rotate",
449
+ "row-gap",
450
+ "ruby-align",
451
+ "ruby-merge",
452
+ "ruby-overhang",
453
+ "ruby-position",
454
+ "rx",
455
+ "ry",
456
+ "scale",
457
+ "scroll-behavior",
458
+ "scroll-chaining",
459
+ "scroll-initial-target",
460
+ "scroll-limit",
461
+ "scroll-limit-x-max",
462
+ "scroll-limit-x-min",
463
+ "scroll-limit-y-max",
464
+ "scroll-limit-y-min",
465
+ "scroll-margin",
466
+ "scroll-margin-block",
467
+ "scroll-margin-block-end",
468
+ "scroll-margin-block-start",
469
+ "scroll-margin-bottom",
470
+ "scroll-margin-inline",
471
+ "scroll-margin-inline-end",
472
+ "scroll-margin-inline-start",
473
+ "scroll-margin-left",
474
+ "scroll-margin-right",
475
+ "scroll-margin-top",
476
+ "scroll-marker-group",
477
+ "scroll-padding",
478
+ "scroll-padding-block",
479
+ "scroll-padding-block-end",
480
+ "scroll-padding-block-start",
481
+ "scroll-padding-bottom",
482
+ "scroll-padding-inline",
483
+ "scroll-padding-inline-end",
484
+ "scroll-padding-inline-start",
485
+ "scroll-padding-left",
486
+ "scroll-padding-right",
487
+ "scroll-padding-top",
488
+ "scroll-rails",
489
+ "scroll-snap-align",
490
+ "scroll-snap-coordinate",
491
+ "scroll-snap-destination",
492
+ "scroll-snap-points-x",
493
+ "scroll-snap-points-y",
494
+ "scroll-snap-stop",
495
+ "scroll-snap-type",
496
+ "scroll-snap-type-x",
497
+ "scroll-snap-type-y",
498
+ "scroll-snap-x",
499
+ "scroll-snap-y",
500
+ "scroll-target-group",
501
+ "scroll-timeline",
502
+ "scroll-timeline-axis",
503
+ "scroll-timeline-name",
504
+ "scroll-translation",
505
+ "scrollbar-3dlight-color",
506
+ "scrollbar-arrow-color",
507
+ "scrollbar-base-color",
508
+ "scrollbar-color",
509
+ "scrollbar-darkshadow-color",
510
+ "scrollbar-face-color",
511
+ "scrollbar-gutter",
512
+ "scrollbar-highlight-color",
513
+ "scrollbar-shadow-color",
514
+ "scrollbar-track-color",
515
+ "scrollbar-width",
516
+ "shape-image-threshold",
517
+ "shape-margin",
518
+ "shape-outside",
519
+ "shape-rendering",
520
+ "speak-as",
521
+ "stack-sizing",
522
+ "stop-color",
523
+ "stop-opacity",
524
+ "stroke",
525
+ "stroke-color",
526
+ "stroke-dasharray",
527
+ "stroke-dashoffset",
528
+ "stroke-linecap",
529
+ "stroke-linejoin",
530
+ "stroke-miterlimit",
531
+ "stroke-opacity",
532
+ "stroke-width",
533
+ "tab-size",
534
+ "table-layout",
535
+ "tap-highlight-color",
536
+ "text-align",
537
+ "text-align-last",
538
+ "text-anchor",
539
+ "text-autospace",
540
+ "text-blink",
541
+ "text-box",
542
+ "text-box-edge",
543
+ "text-box-trim",
544
+ "text-combine-upright",
545
+ "text-decoration",
546
+ "text-decoration-color",
547
+ "text-decoration-inset",
548
+ "text-decoration-line",
549
+ "text-decoration-skip",
550
+ "text-decoration-skip-ink",
551
+ "text-decoration-style",
552
+ "text-decoration-thickness",
553
+ "text-emphasis",
554
+ "text-emphasis-color",
555
+ "text-emphasis-position",
556
+ "text-emphasis-style",
557
+ "text-fill-color",
558
+ "text-indent",
559
+ "text-justify",
560
+ "text-orientation",
561
+ "text-overflow",
562
+ "text-rendering",
563
+ "text-shadow",
564
+ "text-size-adjust",
565
+ "text-spacing-trim",
566
+ "text-stroke",
567
+ "text-stroke-color",
568
+ "text-stroke-width",
569
+ "text-transform",
570
+ "text-underline-offset",
571
+ "text-underline-position",
572
+ "text-wrap",
573
+ "text-wrap-mode",
574
+ "text-wrap-style",
575
+ "timeline-scope",
576
+ "timeline-trigger",
577
+ "timeline-trigger-activation-range",
578
+ "timeline-trigger-activation-range-end",
579
+ "timeline-trigger-activation-range-start",
580
+ "timeline-trigger-active-range",
581
+ "timeline-trigger-active-range-end",
582
+ "timeline-trigger-active-range-start",
583
+ "timeline-trigger-name",
584
+ "timeline-trigger-source",
585
+ "top",
586
+ "touch-action",
587
+ "touch-callout",
588
+ "touch-select",
589
+ "transform",
590
+ "transform-box",
591
+ "transform-origin",
592
+ "transform-style",
593
+ "transition",
594
+ "transition-behavior",
595
+ "transition-delay",
596
+ "transition-duration",
597
+ "transition-property",
598
+ "transition-timing-function",
599
+ "translate",
600
+ "trigger-scope",
601
+ "unicode-bidi",
602
+ "user-focus",
603
+ "user-input",
604
+ "user-modify",
605
+ "user-select",
606
+ "vector-effect",
607
+ "vertical-align",
608
+ "view-timeline",
609
+ "view-timeline-axis",
610
+ "view-timeline-inset",
611
+ "view-timeline-name",
612
+ "view-transition-class",
613
+ "view-transition-name",
614
+ "visibility",
615
+ "white-space",
616
+ "white-space-collapse",
617
+ "widows",
618
+ "width",
619
+ "will-change",
620
+ "window-dragging",
621
+ "window-shadow",
622
+ "word-break",
623
+ "word-spacing",
624
+ "word-wrap",
625
+ "wrap-flow",
626
+ "wrap-margin",
627
+ "wrap-through",
628
+ "writing-mode",
629
+ "x",
630
+ "y",
631
+ "z-index",
632
+ "zoom"
633
+ ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@melcanz85/chaincss",
3
- "version": "1.11.1",
3
+ "version": "1.11.2",
4
4
  "description": "A simple package transpiler for js to css",
5
5
  "exports": {
6
6
  ".": {