@measured/puck-plugin-emotion-cache 0.17.0-canary.f71da6d → 0.17.0-canary.fe9321f
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/dist/index.js +65 -6
- package/dist/index.mjs +65 -6
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -211,12 +211,14 @@ function slice(begin, end) {
|
|
|
211
211
|
}
|
|
212
212
|
function token(type) {
|
|
213
213
|
switch (type) {
|
|
214
|
+
// \0 \t \n \r \s whitespace token
|
|
214
215
|
case 0:
|
|
215
216
|
case 9:
|
|
216
217
|
case 10:
|
|
217
218
|
case 13:
|
|
218
219
|
case 32:
|
|
219
220
|
return 5;
|
|
221
|
+
// ! + , / > @ ~ isolate token
|
|
220
222
|
case 33:
|
|
221
223
|
case 43:
|
|
222
224
|
case 44:
|
|
@@ -224,17 +226,21 @@ function token(type) {
|
|
|
224
226
|
case 62:
|
|
225
227
|
case 64:
|
|
226
228
|
case 126:
|
|
229
|
+
// ; { } breakpoint token
|
|
227
230
|
case 59:
|
|
228
231
|
case 123:
|
|
229
232
|
case 125:
|
|
230
233
|
return 4;
|
|
234
|
+
// : accompanied token
|
|
231
235
|
case 58:
|
|
232
236
|
return 3;
|
|
237
|
+
// " ' ( [ opening delimit token
|
|
233
238
|
case 34:
|
|
234
239
|
case 39:
|
|
235
240
|
case 40:
|
|
236
241
|
case 91:
|
|
237
242
|
return 2;
|
|
243
|
+
// ) ] closing delimit token
|
|
238
244
|
case 41:
|
|
239
245
|
case 93:
|
|
240
246
|
return 1;
|
|
@@ -267,17 +273,21 @@ function escaping(index, count) {
|
|
|
267
273
|
function delimiter(type) {
|
|
268
274
|
while (next())
|
|
269
275
|
switch (character) {
|
|
276
|
+
// ] ) " '
|
|
270
277
|
case type:
|
|
271
278
|
return position;
|
|
279
|
+
// " '
|
|
272
280
|
case 34:
|
|
273
281
|
case 39:
|
|
274
282
|
if (type !== 34 && type !== 39)
|
|
275
283
|
delimiter(character);
|
|
276
284
|
break;
|
|
285
|
+
// (
|
|
277
286
|
case 40:
|
|
278
287
|
if (type === 41)
|
|
279
288
|
delimiter(type);
|
|
280
289
|
break;
|
|
290
|
+
// \
|
|
281
291
|
case 92:
|
|
282
292
|
next();
|
|
283
293
|
break;
|
|
@@ -320,26 +330,31 @@ function parse(value, root, parent, rule, rules, rulesets, pseudo, points, decla
|
|
|
320
330
|
var characters2 = type;
|
|
321
331
|
while (scanning)
|
|
322
332
|
switch (previous = character2, character2 = next()) {
|
|
333
|
+
// (
|
|
323
334
|
case 40:
|
|
324
335
|
if (previous != 108 && charat(characters2, length2 - 1) == 58) {
|
|
325
336
|
if (indexof(characters2 += replace(delimit(character2), "&", "&\f"), "&\f") != -1)
|
|
326
337
|
ampersand = -1;
|
|
327
338
|
break;
|
|
328
339
|
}
|
|
340
|
+
// " ' [
|
|
329
341
|
case 34:
|
|
330
342
|
case 39:
|
|
331
343
|
case 91:
|
|
332
344
|
characters2 += delimit(character2);
|
|
333
345
|
break;
|
|
346
|
+
// \t \n \r \s
|
|
334
347
|
case 9:
|
|
335
348
|
case 10:
|
|
336
349
|
case 13:
|
|
337
350
|
case 32:
|
|
338
351
|
characters2 += whitespace(previous);
|
|
339
352
|
break;
|
|
353
|
+
// \
|
|
340
354
|
case 92:
|
|
341
355
|
characters2 += escaping(caret() - 1, 7);
|
|
342
356
|
continue;
|
|
357
|
+
// /
|
|
343
358
|
case 47:
|
|
344
359
|
switch (peek()) {
|
|
345
360
|
case 42:
|
|
@@ -350,22 +365,28 @@ function parse(value, root, parent, rule, rules, rulesets, pseudo, points, decla
|
|
|
350
365
|
characters2 += "/";
|
|
351
366
|
}
|
|
352
367
|
break;
|
|
368
|
+
// {
|
|
353
369
|
case 123 * variable:
|
|
354
370
|
points[index++] = strlen(characters2) * ampersand;
|
|
371
|
+
// } ; \0
|
|
355
372
|
case 125 * variable:
|
|
356
373
|
case 59:
|
|
357
374
|
case 0:
|
|
358
375
|
switch (character2) {
|
|
376
|
+
// \0 }
|
|
359
377
|
case 0:
|
|
360
378
|
case 125:
|
|
361
379
|
scanning = 0;
|
|
380
|
+
// ;
|
|
362
381
|
case 59 + offset:
|
|
363
382
|
if (ampersand == -1) characters2 = replace(characters2, /\f/g, "");
|
|
364
383
|
if (property > 0 && strlen(characters2) - length2)
|
|
365
384
|
append(property > 32 ? declaration(characters2 + ";", rule, parent, length2 - 1) : declaration(replace(characters2, " ", "") + ";", rule, parent, length2 - 2), declarations);
|
|
366
385
|
break;
|
|
386
|
+
// @ ;
|
|
367
387
|
case 59:
|
|
368
388
|
characters2 += ";";
|
|
389
|
+
// { rule/at-rule
|
|
369
390
|
default:
|
|
370
391
|
append(reference = ruleset(characters2, root, parent, index, offset, rules, points, type, props = [], children = [], length2), rulesets);
|
|
371
392
|
if (character2 === 123)
|
|
@@ -373,6 +394,7 @@ function parse(value, root, parent, rule, rules, rulesets, pseudo, points, decla
|
|
|
373
394
|
parse(characters2, root, reference, reference, props, rulesets, length2, points, children);
|
|
374
395
|
else
|
|
375
396
|
switch (atrule === 99 && charat(characters2, 3) === 110 ? 100 : atrule) {
|
|
397
|
+
// d l m s
|
|
376
398
|
case 100:
|
|
377
399
|
case 108:
|
|
378
400
|
case 109:
|
|
@@ -385,6 +407,7 @@ function parse(value, root, parent, rule, rules, rulesets, pseudo, points, decla
|
|
|
385
407
|
}
|
|
386
408
|
index = offset = property = 0, variable = ampersand = 1, type = characters2 = "", length2 = pseudo;
|
|
387
409
|
break;
|
|
410
|
+
// :
|
|
388
411
|
case 58:
|
|
389
412
|
length2 = 1 + strlen(characters2), property = previous;
|
|
390
413
|
default:
|
|
@@ -395,17 +418,21 @@ function parse(value, root, parent, rule, rules, rulesets, pseudo, points, decla
|
|
|
395
418
|
continue;
|
|
396
419
|
}
|
|
397
420
|
switch (characters2 += from(character2), character2 * variable) {
|
|
421
|
+
// &
|
|
398
422
|
case 38:
|
|
399
423
|
ampersand = offset > 0 ? 1 : (characters2 += "\f", -1);
|
|
400
424
|
break;
|
|
425
|
+
// ,
|
|
401
426
|
case 44:
|
|
402
427
|
points[index++] = (strlen(characters2) - 1) * ampersand, ampersand = 1;
|
|
403
428
|
break;
|
|
429
|
+
// @
|
|
404
430
|
case 64:
|
|
405
431
|
if (peek() === 45)
|
|
406
432
|
characters2 += delimit(next());
|
|
407
433
|
atrule = peek(), offset = length2 = strlen(type = characters2 += identifier(caret())), character2++;
|
|
408
434
|
break;
|
|
435
|
+
// -
|
|
409
436
|
case 45:
|
|
410
437
|
if (previous === 45 && strlen(characters2) == 2)
|
|
411
438
|
variable = 0;
|
|
@@ -534,6 +561,7 @@ var toRules = function toRules2(parsed, points) {
|
|
|
534
561
|
points[index] = parsed[index].length;
|
|
535
562
|
break;
|
|
536
563
|
}
|
|
564
|
+
// fallthrough
|
|
537
565
|
default:
|
|
538
566
|
parsed[index] += from(character2);
|
|
539
567
|
}
|
|
@@ -550,7 +578,8 @@ var compat = function compat2(element) {
|
|
|
550
578
|
element.length < 1) {
|
|
551
579
|
return;
|
|
552
580
|
}
|
|
553
|
-
var value = element.value
|
|
581
|
+
var value = element.value;
|
|
582
|
+
var parent = element.parent;
|
|
554
583
|
var isImplicitRule = element.column === parent.column && element.line === parent.line;
|
|
555
584
|
while (parent.type !== "rule") {
|
|
556
585
|
parent = parent.parent;
|
|
@@ -587,8 +616,10 @@ var removeLabel = function removeLabel2(element) {
|
|
|
587
616
|
};
|
|
588
617
|
function prefix(value, length2) {
|
|
589
618
|
switch (hash(value, length2)) {
|
|
619
|
+
// color-adjust
|
|
590
620
|
case 5103:
|
|
591
621
|
return WEBKIT + "print-" + value + value;
|
|
622
|
+
// animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)
|
|
592
623
|
case 5737:
|
|
593
624
|
case 4201:
|
|
594
625
|
case 3177:
|
|
@@ -596,18 +627,21 @@ function prefix(value, length2) {
|
|
|
596
627
|
case 1641:
|
|
597
628
|
case 4457:
|
|
598
629
|
case 2921:
|
|
630
|
+
// text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break
|
|
599
631
|
case 5572:
|
|
600
632
|
case 6356:
|
|
601
633
|
case 5844:
|
|
602
634
|
case 3191:
|
|
603
635
|
case 6645:
|
|
604
636
|
case 3005:
|
|
637
|
+
// mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,
|
|
605
638
|
case 6391:
|
|
606
639
|
case 5879:
|
|
607
640
|
case 5623:
|
|
608
641
|
case 6135:
|
|
609
642
|
case 4599:
|
|
610
643
|
case 4855:
|
|
644
|
+
// background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)
|
|
611
645
|
case 4215:
|
|
612
646
|
case 6389:
|
|
613
647
|
case 5109:
|
|
@@ -615,43 +649,58 @@ function prefix(value, length2) {
|
|
|
615
649
|
case 5621:
|
|
616
650
|
case 3829:
|
|
617
651
|
return WEBKIT + value + value;
|
|
652
|
+
// appearance, user-select, transform, hyphens, text-size-adjust
|
|
618
653
|
case 5349:
|
|
619
654
|
case 4246:
|
|
620
655
|
case 4810:
|
|
621
656
|
case 6968:
|
|
622
657
|
case 2756:
|
|
623
658
|
return WEBKIT + value + MOZ + value + MS + value + value;
|
|
659
|
+
// flex, flex-direction
|
|
624
660
|
case 6828:
|
|
625
661
|
case 4268:
|
|
626
662
|
return WEBKIT + value + MS + value + value;
|
|
663
|
+
// order
|
|
627
664
|
case 6165:
|
|
628
665
|
return WEBKIT + value + MS + "flex-" + value + value;
|
|
666
|
+
// align-items
|
|
629
667
|
case 5187:
|
|
630
668
|
return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + "box-$1$2" + MS + "flex-$1$2") + value;
|
|
669
|
+
// align-self
|
|
631
670
|
case 5443:
|
|
632
671
|
return WEBKIT + value + MS + "flex-item-" + replace(value, /flex-|-self/, "") + value;
|
|
672
|
+
// align-content
|
|
633
673
|
case 4675:
|
|
634
674
|
return WEBKIT + value + MS + "flex-line-pack" + replace(value, /align-content|flex-|-self/, "") + value;
|
|
675
|
+
// flex-shrink
|
|
635
676
|
case 5548:
|
|
636
677
|
return WEBKIT + value + MS + replace(value, "shrink", "negative") + value;
|
|
678
|
+
// flex-basis
|
|
637
679
|
case 5292:
|
|
638
680
|
return WEBKIT + value + MS + replace(value, "basis", "preferred-size") + value;
|
|
681
|
+
// flex-grow
|
|
639
682
|
case 6060:
|
|
640
683
|
return WEBKIT + "box-" + replace(value, "-grow", "") + WEBKIT + value + MS + replace(value, "grow", "positive") + value;
|
|
684
|
+
// transition
|
|
641
685
|
case 4554:
|
|
642
686
|
return WEBKIT + replace(value, /([^-])(transform)/g, "$1" + WEBKIT + "$2") + value;
|
|
687
|
+
// cursor
|
|
643
688
|
case 6187:
|
|
644
689
|
return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + "$1"), /(image-set)/, WEBKIT + "$1"), value, "") + value;
|
|
690
|
+
// background, background-image
|
|
645
691
|
case 5495:
|
|
646
692
|
case 3959:
|
|
647
693
|
return replace(value, /(image-set\([^]*)/, WEBKIT + "$1$`$1");
|
|
694
|
+
// justify-content
|
|
648
695
|
case 4968:
|
|
649
696
|
return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + "box-pack:$3" + MS + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + WEBKIT + value + value;
|
|
697
|
+
// (margin|padding)-inline-(start|end)
|
|
650
698
|
case 4095:
|
|
651
699
|
case 3583:
|
|
652
700
|
case 4068:
|
|
653
701
|
case 2532:
|
|
654
702
|
return replace(value, /(.+)-inline(.+)/, WEBKIT + "$1$2") + value;
|
|
703
|
+
// (min|max)?(width|height|inline-size|block-size)
|
|
655
704
|
case 8116:
|
|
656
705
|
case 7059:
|
|
657
706
|
case 5753:
|
|
@@ -665,30 +714,41 @@ function prefix(value, length2) {
|
|
|
665
714
|
case 5021:
|
|
666
715
|
case 4765:
|
|
667
716
|
if (strlen(value) - 1 - length2 > 6) switch (charat(value, length2 + 1)) {
|
|
717
|
+
// (m)ax-content, (m)in-content
|
|
668
718
|
case 109:
|
|
669
719
|
if (charat(value, length2 + 4) !== 45) break;
|
|
720
|
+
// (f)ill-available, (f)it-content
|
|
670
721
|
case 102:
|
|
671
722
|
return replace(value, /(.+:)(.+)-([^]+)/, "$1" + WEBKIT + "$2-$3$1" + MOZ + (charat(value, length2 + 3) == 108 ? "$3" : "$2-$3")) + value;
|
|
723
|
+
// (s)tretch
|
|
672
724
|
case 115:
|
|
673
725
|
return ~indexof(value, "stretch") ? prefix(replace(value, "stretch", "fill-available"), length2) + value : value;
|
|
674
726
|
}
|
|
675
727
|
break;
|
|
728
|
+
// position: sticky
|
|
676
729
|
case 4949:
|
|
677
730
|
if (charat(value, length2 + 1) !== 115) break;
|
|
731
|
+
// display: (flex|inline-flex)
|
|
678
732
|
case 6444:
|
|
679
733
|
switch (charat(value, strlen(value) - 3 - (~indexof(value, "!important") && 10))) {
|
|
734
|
+
// stic(k)y
|
|
680
735
|
case 107:
|
|
681
736
|
return replace(value, ":", ":" + WEBKIT) + value;
|
|
737
|
+
// (inline-)?fl(e)x
|
|
682
738
|
case 101:
|
|
683
739
|
return replace(value, /(.+:)([^;!]+)(;|!.+)?/, "$1" + WEBKIT + (charat(value, 14) === 45 ? "inline-" : "") + "box$3$1" + WEBKIT + "$2$3$1" + MS + "$2box$3") + value;
|
|
684
740
|
}
|
|
685
741
|
break;
|
|
742
|
+
// writing-mode
|
|
686
743
|
case 5936:
|
|
687
744
|
switch (charat(value, length2 + 11)) {
|
|
745
|
+
// vertical-l(r)
|
|
688
746
|
case 114:
|
|
689
747
|
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb") + value;
|
|
748
|
+
// vertical-r(l)
|
|
690
749
|
case 108:
|
|
691
750
|
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb-rl") + value;
|
|
751
|
+
// horizontal(-)tb
|
|
692
752
|
case 45:
|
|
693
753
|
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "lr") + value;
|
|
694
754
|
}
|
|
@@ -709,11 +769,13 @@ var prefixer = function prefixer2(element, index, children, callback) {
|
|
|
709
769
|
case RULESET:
|
|
710
770
|
if (element.length) return combine(element.props, function(value) {
|
|
711
771
|
switch (match(value, /(::plac\w+|:read-\w+)/)) {
|
|
772
|
+
// :read-(only|write)
|
|
712
773
|
case ":read-only":
|
|
713
774
|
case ":read-write":
|
|
714
775
|
return serialize([copy(element, {
|
|
715
776
|
props: [replace(value, /:(read-\w+)/, ":" + MOZ + "$1")]
|
|
716
777
|
})], callback);
|
|
778
|
+
// :placeholder
|
|
717
779
|
case "::placeholder":
|
|
718
780
|
return serialize([copy(element, {
|
|
719
781
|
props: [replace(value, /:(plac\w+)/, ":" + WEBKIT + "input-$1")]
|
|
@@ -730,10 +792,7 @@ var prefixer = function prefixer2(element, index, children, callback) {
|
|
|
730
792
|
};
|
|
731
793
|
var getServerStylisCache = isBrowser ? void 0 : weakMemoize(function() {
|
|
732
794
|
return memoize(function() {
|
|
733
|
-
|
|
734
|
-
return function(name) {
|
|
735
|
-
return cache[name];
|
|
736
|
-
};
|
|
795
|
+
return {};
|
|
737
796
|
});
|
|
738
797
|
});
|
|
739
798
|
var defaultStylisPlugins = [prefixer];
|
|
@@ -771,7 +830,7 @@ var createCache = function createCache2(options) {
|
|
|
771
830
|
}
|
|
772
831
|
var _insert;
|
|
773
832
|
var omnipresentPlugins = [compat, removeLabel];
|
|
774
|
-
if (
|
|
833
|
+
if (!getServerStylisCache) {
|
|
775
834
|
var currentSheet;
|
|
776
835
|
var finalizingPlugins = [stringify, rulesheet(function(rule) {
|
|
777
836
|
currentSheet.insert(rule);
|
package/dist/index.mjs
CHANGED
|
@@ -175,12 +175,14 @@ function slice(begin, end) {
|
|
|
175
175
|
}
|
|
176
176
|
function token(type) {
|
|
177
177
|
switch (type) {
|
|
178
|
+
// \0 \t \n \r \s whitespace token
|
|
178
179
|
case 0:
|
|
179
180
|
case 9:
|
|
180
181
|
case 10:
|
|
181
182
|
case 13:
|
|
182
183
|
case 32:
|
|
183
184
|
return 5;
|
|
185
|
+
// ! + , / > @ ~ isolate token
|
|
184
186
|
case 33:
|
|
185
187
|
case 43:
|
|
186
188
|
case 44:
|
|
@@ -188,17 +190,21 @@ function token(type) {
|
|
|
188
190
|
case 62:
|
|
189
191
|
case 64:
|
|
190
192
|
case 126:
|
|
193
|
+
// ; { } breakpoint token
|
|
191
194
|
case 59:
|
|
192
195
|
case 123:
|
|
193
196
|
case 125:
|
|
194
197
|
return 4;
|
|
198
|
+
// : accompanied token
|
|
195
199
|
case 58:
|
|
196
200
|
return 3;
|
|
201
|
+
// " ' ( [ opening delimit token
|
|
197
202
|
case 34:
|
|
198
203
|
case 39:
|
|
199
204
|
case 40:
|
|
200
205
|
case 91:
|
|
201
206
|
return 2;
|
|
207
|
+
// ) ] closing delimit token
|
|
202
208
|
case 41:
|
|
203
209
|
case 93:
|
|
204
210
|
return 1;
|
|
@@ -231,17 +237,21 @@ function escaping(index, count) {
|
|
|
231
237
|
function delimiter(type) {
|
|
232
238
|
while (next())
|
|
233
239
|
switch (character) {
|
|
240
|
+
// ] ) " '
|
|
234
241
|
case type:
|
|
235
242
|
return position;
|
|
243
|
+
// " '
|
|
236
244
|
case 34:
|
|
237
245
|
case 39:
|
|
238
246
|
if (type !== 34 && type !== 39)
|
|
239
247
|
delimiter(character);
|
|
240
248
|
break;
|
|
249
|
+
// (
|
|
241
250
|
case 40:
|
|
242
251
|
if (type === 41)
|
|
243
252
|
delimiter(type);
|
|
244
253
|
break;
|
|
254
|
+
// \
|
|
245
255
|
case 92:
|
|
246
256
|
next();
|
|
247
257
|
break;
|
|
@@ -284,26 +294,31 @@ function parse(value, root, parent, rule, rules, rulesets, pseudo, points, decla
|
|
|
284
294
|
var characters2 = type;
|
|
285
295
|
while (scanning)
|
|
286
296
|
switch (previous = character2, character2 = next()) {
|
|
297
|
+
// (
|
|
287
298
|
case 40:
|
|
288
299
|
if (previous != 108 && charat(characters2, length2 - 1) == 58) {
|
|
289
300
|
if (indexof(characters2 += replace(delimit(character2), "&", "&\f"), "&\f") != -1)
|
|
290
301
|
ampersand = -1;
|
|
291
302
|
break;
|
|
292
303
|
}
|
|
304
|
+
// " ' [
|
|
293
305
|
case 34:
|
|
294
306
|
case 39:
|
|
295
307
|
case 91:
|
|
296
308
|
characters2 += delimit(character2);
|
|
297
309
|
break;
|
|
310
|
+
// \t \n \r \s
|
|
298
311
|
case 9:
|
|
299
312
|
case 10:
|
|
300
313
|
case 13:
|
|
301
314
|
case 32:
|
|
302
315
|
characters2 += whitespace(previous);
|
|
303
316
|
break;
|
|
317
|
+
// \
|
|
304
318
|
case 92:
|
|
305
319
|
characters2 += escaping(caret() - 1, 7);
|
|
306
320
|
continue;
|
|
321
|
+
// /
|
|
307
322
|
case 47:
|
|
308
323
|
switch (peek()) {
|
|
309
324
|
case 42:
|
|
@@ -314,22 +329,28 @@ function parse(value, root, parent, rule, rules, rulesets, pseudo, points, decla
|
|
|
314
329
|
characters2 += "/";
|
|
315
330
|
}
|
|
316
331
|
break;
|
|
332
|
+
// {
|
|
317
333
|
case 123 * variable:
|
|
318
334
|
points[index++] = strlen(characters2) * ampersand;
|
|
335
|
+
// } ; \0
|
|
319
336
|
case 125 * variable:
|
|
320
337
|
case 59:
|
|
321
338
|
case 0:
|
|
322
339
|
switch (character2) {
|
|
340
|
+
// \0 }
|
|
323
341
|
case 0:
|
|
324
342
|
case 125:
|
|
325
343
|
scanning = 0;
|
|
344
|
+
// ;
|
|
326
345
|
case 59 + offset:
|
|
327
346
|
if (ampersand == -1) characters2 = replace(characters2, /\f/g, "");
|
|
328
347
|
if (property > 0 && strlen(characters2) - length2)
|
|
329
348
|
append(property > 32 ? declaration(characters2 + ";", rule, parent, length2 - 1) : declaration(replace(characters2, " ", "") + ";", rule, parent, length2 - 2), declarations);
|
|
330
349
|
break;
|
|
350
|
+
// @ ;
|
|
331
351
|
case 59:
|
|
332
352
|
characters2 += ";";
|
|
353
|
+
// { rule/at-rule
|
|
333
354
|
default:
|
|
334
355
|
append(reference = ruleset(characters2, root, parent, index, offset, rules, points, type, props = [], children = [], length2), rulesets);
|
|
335
356
|
if (character2 === 123)
|
|
@@ -337,6 +358,7 @@ function parse(value, root, parent, rule, rules, rulesets, pseudo, points, decla
|
|
|
337
358
|
parse(characters2, root, reference, reference, props, rulesets, length2, points, children);
|
|
338
359
|
else
|
|
339
360
|
switch (atrule === 99 && charat(characters2, 3) === 110 ? 100 : atrule) {
|
|
361
|
+
// d l m s
|
|
340
362
|
case 100:
|
|
341
363
|
case 108:
|
|
342
364
|
case 109:
|
|
@@ -349,6 +371,7 @@ function parse(value, root, parent, rule, rules, rulesets, pseudo, points, decla
|
|
|
349
371
|
}
|
|
350
372
|
index = offset = property = 0, variable = ampersand = 1, type = characters2 = "", length2 = pseudo;
|
|
351
373
|
break;
|
|
374
|
+
// :
|
|
352
375
|
case 58:
|
|
353
376
|
length2 = 1 + strlen(characters2), property = previous;
|
|
354
377
|
default:
|
|
@@ -359,17 +382,21 @@ function parse(value, root, parent, rule, rules, rulesets, pseudo, points, decla
|
|
|
359
382
|
continue;
|
|
360
383
|
}
|
|
361
384
|
switch (characters2 += from(character2), character2 * variable) {
|
|
385
|
+
// &
|
|
362
386
|
case 38:
|
|
363
387
|
ampersand = offset > 0 ? 1 : (characters2 += "\f", -1);
|
|
364
388
|
break;
|
|
389
|
+
// ,
|
|
365
390
|
case 44:
|
|
366
391
|
points[index++] = (strlen(characters2) - 1) * ampersand, ampersand = 1;
|
|
367
392
|
break;
|
|
393
|
+
// @
|
|
368
394
|
case 64:
|
|
369
395
|
if (peek() === 45)
|
|
370
396
|
characters2 += delimit(next());
|
|
371
397
|
atrule = peek(), offset = length2 = strlen(type = characters2 += identifier(caret())), character2++;
|
|
372
398
|
break;
|
|
399
|
+
// -
|
|
373
400
|
case 45:
|
|
374
401
|
if (previous === 45 && strlen(characters2) == 2)
|
|
375
402
|
variable = 0;
|
|
@@ -498,6 +525,7 @@ var toRules = function toRules2(parsed, points) {
|
|
|
498
525
|
points[index] = parsed[index].length;
|
|
499
526
|
break;
|
|
500
527
|
}
|
|
528
|
+
// fallthrough
|
|
501
529
|
default:
|
|
502
530
|
parsed[index] += from(character2);
|
|
503
531
|
}
|
|
@@ -514,7 +542,8 @@ var compat = function compat2(element) {
|
|
|
514
542
|
element.length < 1) {
|
|
515
543
|
return;
|
|
516
544
|
}
|
|
517
|
-
var value = element.value
|
|
545
|
+
var value = element.value;
|
|
546
|
+
var parent = element.parent;
|
|
518
547
|
var isImplicitRule = element.column === parent.column && element.line === parent.line;
|
|
519
548
|
while (parent.type !== "rule") {
|
|
520
549
|
parent = parent.parent;
|
|
@@ -551,8 +580,10 @@ var removeLabel = function removeLabel2(element) {
|
|
|
551
580
|
};
|
|
552
581
|
function prefix(value, length2) {
|
|
553
582
|
switch (hash(value, length2)) {
|
|
583
|
+
// color-adjust
|
|
554
584
|
case 5103:
|
|
555
585
|
return WEBKIT + "print-" + value + value;
|
|
586
|
+
// animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)
|
|
556
587
|
case 5737:
|
|
557
588
|
case 4201:
|
|
558
589
|
case 3177:
|
|
@@ -560,18 +591,21 @@ function prefix(value, length2) {
|
|
|
560
591
|
case 1641:
|
|
561
592
|
case 4457:
|
|
562
593
|
case 2921:
|
|
594
|
+
// text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break
|
|
563
595
|
case 5572:
|
|
564
596
|
case 6356:
|
|
565
597
|
case 5844:
|
|
566
598
|
case 3191:
|
|
567
599
|
case 6645:
|
|
568
600
|
case 3005:
|
|
601
|
+
// mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,
|
|
569
602
|
case 6391:
|
|
570
603
|
case 5879:
|
|
571
604
|
case 5623:
|
|
572
605
|
case 6135:
|
|
573
606
|
case 4599:
|
|
574
607
|
case 4855:
|
|
608
|
+
// background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)
|
|
575
609
|
case 4215:
|
|
576
610
|
case 6389:
|
|
577
611
|
case 5109:
|
|
@@ -579,43 +613,58 @@ function prefix(value, length2) {
|
|
|
579
613
|
case 5621:
|
|
580
614
|
case 3829:
|
|
581
615
|
return WEBKIT + value + value;
|
|
616
|
+
// appearance, user-select, transform, hyphens, text-size-adjust
|
|
582
617
|
case 5349:
|
|
583
618
|
case 4246:
|
|
584
619
|
case 4810:
|
|
585
620
|
case 6968:
|
|
586
621
|
case 2756:
|
|
587
622
|
return WEBKIT + value + MOZ + value + MS + value + value;
|
|
623
|
+
// flex, flex-direction
|
|
588
624
|
case 6828:
|
|
589
625
|
case 4268:
|
|
590
626
|
return WEBKIT + value + MS + value + value;
|
|
627
|
+
// order
|
|
591
628
|
case 6165:
|
|
592
629
|
return WEBKIT + value + MS + "flex-" + value + value;
|
|
630
|
+
// align-items
|
|
593
631
|
case 5187:
|
|
594
632
|
return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + "box-$1$2" + MS + "flex-$1$2") + value;
|
|
633
|
+
// align-self
|
|
595
634
|
case 5443:
|
|
596
635
|
return WEBKIT + value + MS + "flex-item-" + replace(value, /flex-|-self/, "") + value;
|
|
636
|
+
// align-content
|
|
597
637
|
case 4675:
|
|
598
638
|
return WEBKIT + value + MS + "flex-line-pack" + replace(value, /align-content|flex-|-self/, "") + value;
|
|
639
|
+
// flex-shrink
|
|
599
640
|
case 5548:
|
|
600
641
|
return WEBKIT + value + MS + replace(value, "shrink", "negative") + value;
|
|
642
|
+
// flex-basis
|
|
601
643
|
case 5292:
|
|
602
644
|
return WEBKIT + value + MS + replace(value, "basis", "preferred-size") + value;
|
|
645
|
+
// flex-grow
|
|
603
646
|
case 6060:
|
|
604
647
|
return WEBKIT + "box-" + replace(value, "-grow", "") + WEBKIT + value + MS + replace(value, "grow", "positive") + value;
|
|
648
|
+
// transition
|
|
605
649
|
case 4554:
|
|
606
650
|
return WEBKIT + replace(value, /([^-])(transform)/g, "$1" + WEBKIT + "$2") + value;
|
|
651
|
+
// cursor
|
|
607
652
|
case 6187:
|
|
608
653
|
return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + "$1"), /(image-set)/, WEBKIT + "$1"), value, "") + value;
|
|
654
|
+
// background, background-image
|
|
609
655
|
case 5495:
|
|
610
656
|
case 3959:
|
|
611
657
|
return replace(value, /(image-set\([^]*)/, WEBKIT + "$1$`$1");
|
|
658
|
+
// justify-content
|
|
612
659
|
case 4968:
|
|
613
660
|
return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + "box-pack:$3" + MS + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + WEBKIT + value + value;
|
|
661
|
+
// (margin|padding)-inline-(start|end)
|
|
614
662
|
case 4095:
|
|
615
663
|
case 3583:
|
|
616
664
|
case 4068:
|
|
617
665
|
case 2532:
|
|
618
666
|
return replace(value, /(.+)-inline(.+)/, WEBKIT + "$1$2") + value;
|
|
667
|
+
// (min|max)?(width|height|inline-size|block-size)
|
|
619
668
|
case 8116:
|
|
620
669
|
case 7059:
|
|
621
670
|
case 5753:
|
|
@@ -629,30 +678,41 @@ function prefix(value, length2) {
|
|
|
629
678
|
case 5021:
|
|
630
679
|
case 4765:
|
|
631
680
|
if (strlen(value) - 1 - length2 > 6) switch (charat(value, length2 + 1)) {
|
|
681
|
+
// (m)ax-content, (m)in-content
|
|
632
682
|
case 109:
|
|
633
683
|
if (charat(value, length2 + 4) !== 45) break;
|
|
684
|
+
// (f)ill-available, (f)it-content
|
|
634
685
|
case 102:
|
|
635
686
|
return replace(value, /(.+:)(.+)-([^]+)/, "$1" + WEBKIT + "$2-$3$1" + MOZ + (charat(value, length2 + 3) == 108 ? "$3" : "$2-$3")) + value;
|
|
687
|
+
// (s)tretch
|
|
636
688
|
case 115:
|
|
637
689
|
return ~indexof(value, "stretch") ? prefix(replace(value, "stretch", "fill-available"), length2) + value : value;
|
|
638
690
|
}
|
|
639
691
|
break;
|
|
692
|
+
// position: sticky
|
|
640
693
|
case 4949:
|
|
641
694
|
if (charat(value, length2 + 1) !== 115) break;
|
|
695
|
+
// display: (flex|inline-flex)
|
|
642
696
|
case 6444:
|
|
643
697
|
switch (charat(value, strlen(value) - 3 - (~indexof(value, "!important") && 10))) {
|
|
698
|
+
// stic(k)y
|
|
644
699
|
case 107:
|
|
645
700
|
return replace(value, ":", ":" + WEBKIT) + value;
|
|
701
|
+
// (inline-)?fl(e)x
|
|
646
702
|
case 101:
|
|
647
703
|
return replace(value, /(.+:)([^;!]+)(;|!.+)?/, "$1" + WEBKIT + (charat(value, 14) === 45 ? "inline-" : "") + "box$3$1" + WEBKIT + "$2$3$1" + MS + "$2box$3") + value;
|
|
648
704
|
}
|
|
649
705
|
break;
|
|
706
|
+
// writing-mode
|
|
650
707
|
case 5936:
|
|
651
708
|
switch (charat(value, length2 + 11)) {
|
|
709
|
+
// vertical-l(r)
|
|
652
710
|
case 114:
|
|
653
711
|
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb") + value;
|
|
712
|
+
// vertical-r(l)
|
|
654
713
|
case 108:
|
|
655
714
|
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb-rl") + value;
|
|
715
|
+
// horizontal(-)tb
|
|
656
716
|
case 45:
|
|
657
717
|
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "lr") + value;
|
|
658
718
|
}
|
|
@@ -673,11 +733,13 @@ var prefixer = function prefixer2(element, index, children, callback) {
|
|
|
673
733
|
case RULESET:
|
|
674
734
|
if (element.length) return combine(element.props, function(value) {
|
|
675
735
|
switch (match(value, /(::plac\w+|:read-\w+)/)) {
|
|
736
|
+
// :read-(only|write)
|
|
676
737
|
case ":read-only":
|
|
677
738
|
case ":read-write":
|
|
678
739
|
return serialize([copy(element, {
|
|
679
740
|
props: [replace(value, /:(read-\w+)/, ":" + MOZ + "$1")]
|
|
680
741
|
})], callback);
|
|
742
|
+
// :placeholder
|
|
681
743
|
case "::placeholder":
|
|
682
744
|
return serialize([copy(element, {
|
|
683
745
|
props: [replace(value, /:(plac\w+)/, ":" + WEBKIT + "input-$1")]
|
|
@@ -694,10 +756,7 @@ var prefixer = function prefixer2(element, index, children, callback) {
|
|
|
694
756
|
};
|
|
695
757
|
var getServerStylisCache = isBrowser ? void 0 : weakMemoize(function() {
|
|
696
758
|
return memoize(function() {
|
|
697
|
-
|
|
698
|
-
return function(name) {
|
|
699
|
-
return cache[name];
|
|
700
|
-
};
|
|
759
|
+
return {};
|
|
701
760
|
});
|
|
702
761
|
});
|
|
703
762
|
var defaultStylisPlugins = [prefixer];
|
|
@@ -735,7 +794,7 @@ var createCache = function createCache2(options) {
|
|
|
735
794
|
}
|
|
736
795
|
var _insert;
|
|
737
796
|
var omnipresentPlugins = [compat, removeLabel];
|
|
738
|
-
if (
|
|
797
|
+
if (!getServerStylisCache) {
|
|
739
798
|
var currentSheet;
|
|
740
799
|
var finalizingPlugins = [stringify, rulesheet(function(rule) {
|
|
741
800
|
currentSheet.insert(rule);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@measured/puck-plugin-emotion-cache",
|
|
3
|
-
"version": "0.17.0-canary.
|
|
3
|
+
"version": "0.17.0-canary.fe9321f",
|
|
4
4
|
"author": "Measured Corporation Ltd <hello@measured.co>",
|
|
5
5
|
"repository": "measuredco/puck",
|
|
6
6
|
"bugs": "https://github.com/measuredco/puck/issues",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
],
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@emotion/react": "^11.13.3",
|
|
26
|
-
"@measured/puck": "^0.17.0-canary.
|
|
26
|
+
"@measured/puck": "^0.17.0-canary.fe9321f",
|
|
27
27
|
"@types/react": "^18.2.0",
|
|
28
28
|
"@types/react-dom": "^18.2.0",
|
|
29
29
|
"eslint": "^7.32.0",
|
|
@@ -35,6 +35,6 @@
|
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"@emotion/react": "^11.0.0",
|
|
38
|
-
"react": "^17.0.0 || ^18.0.0"
|
|
38
|
+
"react": "^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
39
39
|
}
|
|
40
40
|
}
|