@stylexjs/babel-plugin 0.2.0-beta.19 → 0.2.0-beta.20
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/lib/babel-path-utils.d.ts +0 -2
- package/lib/index.js +586 -76
- package/lib/utils/evaluate-path.d.ts +1 -1
- package/lib/utils/evaluate-path.js.flow +2 -2
- package/lib/utils/state-manager.d.ts +1 -0
- package/lib/utils/state-manager.js.flow +1 -0
- package/lib/visitors/stylex-create/index.d.ts +17 -0
- package/lib/visitors/stylex-create/index.js.flow +24 -0
- package/lib/visitors/stylex-create/parse-style-function.d.ts +18 -0
- package/lib/visitors/stylex-create/parse-style-function.js.flow +23 -0
- package/lib/visitors/stylex-create/parse-stylex-create-arg.d.ts +29 -0
- package/lib/visitors/stylex-create/parse-stylex-create-arg.js.flow +30 -0
- package/package.json +4 -3
package/lib/index.js
CHANGED
|
@@ -38,6 +38,7 @@ class StateManager {
|
|
|
38
38
|
stylexKeyframesImport = new Set();
|
|
39
39
|
stylexCreateVarsImport = new Set();
|
|
40
40
|
stylexOverrideVarsImport = new Set();
|
|
41
|
+
stylexTypesImport = new Set();
|
|
41
42
|
styleMap = new Map();
|
|
42
43
|
styleVars = new Map();
|
|
43
44
|
styleVarsToKeep = new Set();
|
|
@@ -208,6 +209,9 @@ function readImportDeclarations(path, state) {
|
|
|
208
209
|
if (specifier.imported.name === "unstable_overrideVars") {
|
|
209
210
|
state.stylexCreateVarsImport.add(specifier.local.name);
|
|
210
211
|
}
|
|
212
|
+
if (specifier.imported.name === "types") {
|
|
213
|
+
state.stylexTypesImport.add(specifier.local.name);
|
|
214
|
+
}
|
|
211
215
|
}
|
|
212
216
|
if (specifier.imported.type === "StringLiteral") {
|
|
213
217
|
if (specifier.imported.value === "create") {
|
|
@@ -228,6 +232,9 @@ function readImportDeclarations(path, state) {
|
|
|
228
232
|
if (specifier.imported.value === "unstable_overrideVars ") {
|
|
229
233
|
state.stylexCreateVarsImport.add(specifier.local.name);
|
|
230
234
|
}
|
|
235
|
+
if (specifier.imported.value === "types ") {
|
|
236
|
+
state.stylexTypesImport.add(specifier.local.name);
|
|
237
|
+
}
|
|
231
238
|
}
|
|
232
239
|
}
|
|
233
240
|
}
|
|
@@ -263,6 +270,9 @@ function readRequires(path, state) {
|
|
|
263
270
|
if (prop.key.name === "unstable_overrideVars") {
|
|
264
271
|
state.stylexCreateVarsImport.add(value.name);
|
|
265
272
|
}
|
|
273
|
+
if (prop.key.name === "types") {
|
|
274
|
+
state.stylexTypesImport.add(value.name);
|
|
275
|
+
}
|
|
266
276
|
}
|
|
267
277
|
}
|
|
268
278
|
}
|
|
@@ -344,9 +354,9 @@ stylexInclude$1.default = stylexInclude;
|
|
|
344
354
|
var messages$3 = _interopRequireWildcard$3(messages$4);
|
|
345
355
|
function _getRequireWildcardCache$3(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache$3 = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
346
356
|
function _interopRequireWildcard$3(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache$3(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
347
|
-
let number = 0;
|
|
357
|
+
let number$1 = 0;
|
|
348
358
|
function uuid() {
|
|
349
|
-
return `__included_${++number}__`;
|
|
359
|
+
return `__included_${++number$1}__`;
|
|
350
360
|
}
|
|
351
361
|
let IncludedStyles$1 = class IncludedStyles {
|
|
352
362
|
constructor(astNode) {
|
|
@@ -524,7 +534,7 @@ Object.defineProperty(applicationOrder, "__esModule", {
|
|
|
524
534
|
applicationOrder.default = void 0;
|
|
525
535
|
var _splitCssValue$2 = _interopRequireDefault$j(splitCssValue);
|
|
526
536
|
function _interopRequireDefault$j(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
527
|
-
const shorthands$
|
|
537
|
+
const shorthands$2 = {
|
|
528
538
|
all: _ => {
|
|
529
539
|
throw new Error("all is not supported");
|
|
530
540
|
},
|
|
@@ -532,24 +542,24 @@ const shorthands$1 = {
|
|
|
532
542
|
background: value => [["background", value], ["backgroundAttachment", null], ["backgroundClip", null], ["backgroundColor", null], ["backgroundImage", null], ["backgroundOrigin", null], ["backgroundPosition", null], ["backgroundRepeat", null], ["backgroundSize", null]],
|
|
533
543
|
border: rawValue => {
|
|
534
544
|
if (typeof rawValue === "number") {
|
|
535
|
-
return shorthands$
|
|
545
|
+
return shorthands$2.borderWidth(rawValue);
|
|
536
546
|
}
|
|
537
547
|
const [width, style, color] = (0, _splitCssValue$2.default)(rawValue);
|
|
538
|
-
return [...shorthands$
|
|
548
|
+
return [...shorthands$2.borderWidth(width), ...shorthands$2.borderStyle(style), ...shorthands$2.borderColor(color)];
|
|
539
549
|
},
|
|
540
550
|
borderInline: rawValue => {
|
|
541
551
|
if (typeof rawValue === "number") {
|
|
542
552
|
return [["borderInlineWidth", rawValue], ["borderInlineStartWidth", null], ["borderInlineEndWidth", null]];
|
|
543
553
|
}
|
|
544
554
|
const [width, style, color] = (0, _splitCssValue$2.default)(rawValue);
|
|
545
|
-
return [...shorthands$
|
|
555
|
+
return [...shorthands$2.borderInlineWidth(width), ...shorthands$2.borderInlineStyle(style), ...shorthands$2.borderInlineColor(color)];
|
|
546
556
|
},
|
|
547
557
|
borderBlock: rawValue => {
|
|
548
558
|
if (typeof rawValue === "number") {
|
|
549
559
|
return [["borderBlockWidth", rawValue], ["borderTopWidth", null], ["borderBottomWidth", null]];
|
|
550
560
|
}
|
|
551
561
|
const [width, style, color] = (0, _splitCssValue$2.default)(rawValue);
|
|
552
|
-
return [...shorthands$
|
|
562
|
+
return [...shorthands$2.borderBlockWidth(width), ...shorthands$2.borderBlockStyle(style), ...shorthands$2.borderBlockColor(color)];
|
|
553
563
|
},
|
|
554
564
|
borderTop: rawValue => {
|
|
555
565
|
if (typeof rawValue === "number") {
|
|
@@ -684,55 +694,61 @@ const shorthands$1 = {
|
|
|
684
694
|
textEmphasis: value => [["textEmphasis", value], ["textEmphasisColor", null], ["textEmphasisStyle", null]],
|
|
685
695
|
transition: value => [["transition", value], ["transitionDelay", null], ["transitionDuration", null], ["transitionProperty", null], ["transitionTimingFunction", null]]
|
|
686
696
|
};
|
|
687
|
-
const aliases$
|
|
688
|
-
borderHorizontal: shorthands$
|
|
689
|
-
borderVertical: shorthands$
|
|
690
|
-
borderBlockStart: shorthands$
|
|
691
|
-
borderEnd: shorthands$
|
|
692
|
-
borderBlockEnd: shorthands$
|
|
693
|
-
borderStart: shorthands$
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
697
|
+
const aliases$2 = {
|
|
698
|
+
borderHorizontal: shorthands$2.borderInline,
|
|
699
|
+
borderVertical: shorthands$2.borderBlock,
|
|
700
|
+
borderBlockStart: shorthands$2.borderTop,
|
|
701
|
+
borderEnd: shorthands$2.borderInlineEnd,
|
|
702
|
+
borderBlockEnd: shorthands$2.borderBottom,
|
|
703
|
+
borderStart: shorthands$2.borderInlineStart,
|
|
704
|
+
blockSize: val => [["height", val]],
|
|
705
|
+
inlineSize: val => [["width", val]],
|
|
706
|
+
minBlockSize: val => [["minHeight", val]],
|
|
707
|
+
minInlineSize: val => [["minWidth", val]],
|
|
708
|
+
maxBlockSize: val => [["maxHeight", val]],
|
|
709
|
+
maxInlineSize: val => [["maxWidth", val]],
|
|
710
|
+
borderHorizontalWidth: shorthands$2.borderInlineWidth,
|
|
711
|
+
borderHorizontalStyle: shorthands$2.borderInlineStyle,
|
|
712
|
+
borderHorizontalColor: shorthands$2.borderInlineColor,
|
|
713
|
+
borderVerticalWidth: shorthands$2.borderBlockWidth,
|
|
714
|
+
borderVerticalStyle: shorthands$2.borderBlockStyle,
|
|
715
|
+
borderVerticalColor: shorthands$2.borderBlockColor,
|
|
700
716
|
borderBlockStartColor: value => [["borderTopColor", value]],
|
|
701
717
|
borderBlockEndColor: value => [["borderBottomColor", value]],
|
|
702
718
|
borderBlockStartStyle: value => [["borderTopStyle", value]],
|
|
703
719
|
borderBlockEndStyle: value => [["borderBottomStyle", value]],
|
|
704
720
|
borderBlockStartWidth: value => [["borderTopWidth", value]],
|
|
705
721
|
borderBlockEndWidth: value => [["borderBottomWidth", value]],
|
|
706
|
-
borderStartColor: shorthands$
|
|
707
|
-
borderEndColor: shorthands$
|
|
708
|
-
borderStartStyle: shorthands$
|
|
709
|
-
borderEndStyle: shorthands$
|
|
710
|
-
borderStartWidth: shorthands$
|
|
711
|
-
borderEndWidth: shorthands$
|
|
722
|
+
borderStartColor: shorthands$2.borderInlineStartColor,
|
|
723
|
+
borderEndColor: shorthands$2.borderInlineEndColor,
|
|
724
|
+
borderStartStyle: shorthands$2.borderInlineStartStyle,
|
|
725
|
+
borderEndStyle: shorthands$2.borderInlineEndStyle,
|
|
726
|
+
borderStartWidth: shorthands$2.borderInlineStartWidth,
|
|
727
|
+
borderEndWidth: shorthands$2.borderInlineEndWidth,
|
|
712
728
|
borderTopStartRadius: value => [["borderStartStartRadius", value]],
|
|
713
729
|
borderTopEndRadius: value => [["borderStartEndRadius", value]],
|
|
714
730
|
borderBottomStartRadius: value => [["borderEndStartRadius", value]],
|
|
715
731
|
borderBottomEndRadius: value => [["borderEndEndRadius", value]],
|
|
716
732
|
marginBlockStart: value => [["marginTop", value]],
|
|
717
733
|
marginBlockEnd: value => [["marginBottom", value]],
|
|
718
|
-
marginStart: shorthands$
|
|
719
|
-
marginEnd: shorthands$
|
|
720
|
-
marginHorizontal: shorthands$
|
|
721
|
-
marginVertical: shorthands$
|
|
734
|
+
marginStart: shorthands$2.marginInlineStart,
|
|
735
|
+
marginEnd: shorthands$2.marginInlineEnd,
|
|
736
|
+
marginHorizontal: shorthands$2.marginInline,
|
|
737
|
+
marginVertical: shorthands$2.marginBlock,
|
|
722
738
|
paddingBlockStart: rawValue => [["paddingTop", rawValue]],
|
|
723
739
|
paddingBlockEnd: rawValue => [["paddingBottom", rawValue]],
|
|
724
|
-
paddingStart: shorthands$
|
|
725
|
-
paddingEnd: shorthands$
|
|
726
|
-
paddingHorizontal: shorthands$
|
|
727
|
-
paddingVertical: shorthands$
|
|
740
|
+
paddingStart: shorthands$2.paddingInlineStart,
|
|
741
|
+
paddingEnd: shorthands$2.paddingInlineEnd,
|
|
742
|
+
paddingHorizontal: shorthands$2.paddingInline,
|
|
743
|
+
paddingVertical: shorthands$2.paddingBlock,
|
|
728
744
|
insetBlockStart: value => [["top", value]],
|
|
729
745
|
insetBlockEnd: value => [["bottom", value]],
|
|
730
|
-
start: shorthands$
|
|
731
|
-
end: shorthands$
|
|
746
|
+
start: shorthands$2.insetInlineStart,
|
|
747
|
+
end: shorthands$2.insetInlineEnd
|
|
732
748
|
};
|
|
733
749
|
const expansions$3 = {
|
|
734
|
-
...shorthands$
|
|
735
|
-
...aliases$
|
|
750
|
+
...shorthands$2,
|
|
751
|
+
...aliases$2
|
|
736
752
|
};
|
|
737
753
|
var _default$4 = expansions$3;
|
|
738
754
|
applicationOrder.default = _default$4;
|
|
@@ -745,7 +761,7 @@ Object.defineProperty(legacyExpandShorthands, "__esModule", {
|
|
|
745
761
|
legacyExpandShorthands.default = void 0;
|
|
746
762
|
var _splitCssValue$1 = _interopRequireDefault$i(splitCssValue);
|
|
747
763
|
function _interopRequireDefault$i(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
748
|
-
const
|
|
764
|
+
const shorthands$1 = {
|
|
749
765
|
border: rawValue => {
|
|
750
766
|
return [["borderTop", rawValue], ["borderEnd", rawValue], ["borderBottom", rawValue], ["borderStart", rawValue]];
|
|
751
767
|
},
|
|
@@ -767,10 +783,19 @@ const expansions$2 = {
|
|
|
767
783
|
const [top, right = top, bottom = top, left = right] = (0, _splitCssValue$1.default)(rawValue);
|
|
768
784
|
return [["borderTopWidth", top], ["borderEndWidth", right], ["borderBottomWidth", bottom], ["borderStartWidth", left]];
|
|
769
785
|
},
|
|
786
|
+
borderHorizontalColor: rawValue => [["borderStartColor", rawValue], ["borderEndColor", rawValue]],
|
|
787
|
+
borderHorizontalStyle: rawValue => [["borderStartStyle", rawValue], ["borderEndStyle", rawValue]],
|
|
788
|
+
borderHorizontalWidth: rawValue => [["borderStartWidth", rawValue], ["borderEndWidth", rawValue]],
|
|
789
|
+
borderVerticalColor: rawValue => [["borderTopColor", rawValue], ["borderBottomColor", rawValue]],
|
|
790
|
+
borderVerticalStyle: rawValue => [["borderTopStyle", rawValue], ["borderBottomStyle", rawValue]],
|
|
791
|
+
borderVerticalWidth: rawValue => [["borderTopWidth", rawValue], ["borderBottomWidth", rawValue]],
|
|
770
792
|
borderRadius: rawValue => {
|
|
771
793
|
const [top, right = top, bottom = top, left = right] = (0, _splitCssValue$1.default)(rawValue);
|
|
772
794
|
return [["borderTopStartRadius", top], ["borderTopEndRadius", right], ["borderBottomEndRadius", bottom], ["borderBottomStartRadius", left]];
|
|
773
795
|
},
|
|
796
|
+
inset: rawValue => [["top", rawValue], ["end", rawValue], ["bottom", rawValue], ["start", rawValue]],
|
|
797
|
+
insetInline: rawValue => [["start", rawValue], ["end", rawValue]],
|
|
798
|
+
insetBlock: rawValue => [["top", rawValue], ["bottom", rawValue]],
|
|
774
799
|
margin: rawValue => {
|
|
775
800
|
const [top, right = top, bottom = top, left = right] = (0, _splitCssValue$1.default)(rawValue);
|
|
776
801
|
return [["marginTop", top], ["marginEnd", right], ["marginBottom", bottom], ["marginStart", left]];
|
|
@@ -789,13 +814,63 @@ const expansions$2 = {
|
|
|
789
814
|
const [top, right = top, bottom = top, left = right] = (0, _splitCssValue$1.default)(rawValue);
|
|
790
815
|
return [["paddingTop", top], ["paddingEnd", right], ["paddingBottom", bottom], ["paddingStart", left]];
|
|
791
816
|
},
|
|
792
|
-
paddingHorizontal:
|
|
793
|
-
return [["paddingStart",
|
|
817
|
+
paddingHorizontal: val => {
|
|
818
|
+
return [["paddingStart", val], ["paddingEnd", val]];
|
|
794
819
|
},
|
|
795
|
-
paddingVertical:
|
|
796
|
-
return [["paddingTop",
|
|
820
|
+
paddingVertical: val => {
|
|
821
|
+
return [["paddingTop", val], ["paddingBottom", val]];
|
|
797
822
|
}
|
|
798
823
|
};
|
|
824
|
+
const aliases$1 = {
|
|
825
|
+
insetBlockStart: val => [["top", val]],
|
|
826
|
+
insetBlockEnd: val => [["bottom", val]],
|
|
827
|
+
insetInlineStart: val => [["start", val]],
|
|
828
|
+
insetInlineEnd: val => [["end", val]],
|
|
829
|
+
blockSize: val => [["height", val]],
|
|
830
|
+
inlineSize: val => [["width", val]],
|
|
831
|
+
minBlockSize: val => [["minHeight", val]],
|
|
832
|
+
minInlineSize: val => [["minWidth", val]],
|
|
833
|
+
maxBlockSize: val => [["maxHeight", val]],
|
|
834
|
+
maxInlineSize: val => [["maxWidth", val]],
|
|
835
|
+
borderBlockWidth: shorthands$1.borderVerticalWidth,
|
|
836
|
+
borderBlockStyle: shorthands$1.borderVerticalStyle,
|
|
837
|
+
borderBlockColor: shorthands$1.borderVerticalColor,
|
|
838
|
+
borderBlockStartWidth: val => [["borderTopWidth", val]],
|
|
839
|
+
borderBlockStartStyle: val => [["borderTopStyle", val]],
|
|
840
|
+
borderBlockStartColor: val => [["borderTopColor", val]],
|
|
841
|
+
borderBlockEndWidth: val => [["borderBottomWidth", val]],
|
|
842
|
+
borderBlockEndStyle: val => [["borderBottomStyle", val]],
|
|
843
|
+
borderBlockEndColor: val => [["borderBottomColor", val]],
|
|
844
|
+
borderInlineWidth: shorthands$1.borderHorizontalWidth,
|
|
845
|
+
borderInlineStyle: shorthands$1.borderHorizontalStyle,
|
|
846
|
+
borderInlineColor: shorthands$1.borderHorizontalColor,
|
|
847
|
+
borderInlineStartWidth: val => [["borderStartWidth", val]],
|
|
848
|
+
borderInlineStartStyle: val => [["borderStartStyle", val]],
|
|
849
|
+
borderInlineStartColor: val => [["borderStartColor", val]],
|
|
850
|
+
borderInlineEndWidth: val => [["borderEndWidth", val]],
|
|
851
|
+
borderInlineEndStyle: val => [["borderEndStyle", val]],
|
|
852
|
+
borderInlineEndColor: val => [["borderEndColor", val]],
|
|
853
|
+
borderStartStartRadius: val => [["borderTopStartRadius", val]],
|
|
854
|
+
borderStartEndRadius: val => [["borderTopEndRadius", val]],
|
|
855
|
+
borderEndStartRadius: val => [["borderBottomStartRadius", val]],
|
|
856
|
+
borderEndEndRadius: val => [["borderBottomEndRadius", val]],
|
|
857
|
+
marginBlock: shorthands$1.marginVertical,
|
|
858
|
+
marginBlockStart: val => [["marginTop", val]],
|
|
859
|
+
marginBlockEnd: val => [["marginBottom", val]],
|
|
860
|
+
marginInline: shorthands$1.marginHorizontal,
|
|
861
|
+
marginInlineStart: val => [["marginStart", val]],
|
|
862
|
+
marginInlineEnd: val => [["marginEnd", val]],
|
|
863
|
+
paddingBlock: shorthands$1.paddingVertical,
|
|
864
|
+
paddingBlockStart: val => [["paddingTop", val]],
|
|
865
|
+
paddingBlockEnd: val => [["paddingBottom", val]],
|
|
866
|
+
paddingInline: shorthands$1.paddingHorizontal,
|
|
867
|
+
paddingInlineStart: val => [["paddingStart", val]],
|
|
868
|
+
paddingInlineEnd: val => [["paddingEnd", val]]
|
|
869
|
+
};
|
|
870
|
+
const expansions$2 = {
|
|
871
|
+
...shorthands$1,
|
|
872
|
+
...aliases$1
|
|
873
|
+
};
|
|
799
874
|
var _default$3 = expansions$2;
|
|
800
875
|
legacyExpandShorthands.default = _default$3;
|
|
801
876
|
|
|
@@ -867,6 +942,12 @@ const aliases = {
|
|
|
867
942
|
borderEnd: shorthands.borderInlineEnd,
|
|
868
943
|
borderBlockEnd: shorthands.borderBottom,
|
|
869
944
|
borderStart: shorthands.borderInlineStart,
|
|
945
|
+
blockSize: val => [["height", val]],
|
|
946
|
+
inlineSize: val => [["width", val]],
|
|
947
|
+
minBlockSize: val => [["minHeight", val]],
|
|
948
|
+
minInlineSize: val => [["minWidth", val]],
|
|
949
|
+
maxBlockSize: val => [["maxHeight", val]],
|
|
950
|
+
maxInlineSize: val => [["maxWidth", val]],
|
|
870
951
|
borderHorizontalWidth: value => [["borderInlineWidth", value]],
|
|
871
952
|
borderHorizontalStyle: value => [["borderInlineStyle", value]],
|
|
872
953
|
borderHorizontalColor: value => [["borderInlineColor", value]],
|
|
@@ -1208,6 +1289,8 @@ Object.defineProperty(transformValue$1, "__esModule", {
|
|
|
1208
1289
|
value: true
|
|
1209
1290
|
});
|
|
1210
1291
|
transformValue$1.default = transformValue;
|
|
1292
|
+
var getNumberSuffix_1 = transformValue$1.getNumberSuffix = getNumberSuffix;
|
|
1293
|
+
var timeUnits_1 = transformValue$1.timeUnits = lengthUnits_1 = transformValue$1.lengthUnits = void 0;
|
|
1211
1294
|
var _normalizeValue = _interopRequireDefault$a(normalizeValue$1);
|
|
1212
1295
|
function _interopRequireDefault$a(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1213
1296
|
function transformValue(key, rawValue) {
|
|
@@ -1234,7 +1317,7 @@ function getNumberSuffix(key) {
|
|
|
1234
1317
|
return suffix;
|
|
1235
1318
|
}
|
|
1236
1319
|
}
|
|
1237
|
-
const unitlessNumberProperties = new Set(["animationIterationCount", "borderImageOutset", "borderImageSlice", "borderImageWidth", "columnCount", "flex", "flexGrow", "flexPositive", "flexShrink", "flexOrder", "gridRow", "gridColumn", "fontWeight", "lineClamp", "lineHeight", "opacity", "order", "orphans", "tabSize", "widows", "zIndex", "fillOpacity", "floodOpacity", "stopOpacity", "strokeDasharray", "strokeDashoffset", "strokeMiterlimit", "strokeOpacity", "strokeWidth"]);
|
|
1320
|
+
const unitlessNumberProperties = new Set(["animationIterationCount", "aspectRatio", "borderImageOutset", "borderImageSlice", "borderImageWidth", "columnCount", "flex", "flexGrow", "flexPositive", "flexShrink", "flexOrder", "gridRow", "gridColumn", "fontWeight", "lineClamp", "lineHeight", "opacity", "order", "orphans", "tabSize", "widows", "zIndex", "fillOpacity", "floodOpacity", "stopOpacity", "strokeDasharray", "strokeDashoffset", "strokeMiterlimit", "strokeOpacity", "strokeWidth"]);
|
|
1238
1321
|
const numberPropertySuffixes = {
|
|
1239
1322
|
animationDelay: "ms",
|
|
1240
1323
|
animationDuration: "ms",
|
|
@@ -1242,6 +1325,10 @@ const numberPropertySuffixes = {
|
|
|
1242
1325
|
transitionDuration: "ms",
|
|
1243
1326
|
voiceDuration: "ms"
|
|
1244
1327
|
};
|
|
1328
|
+
const timeUnits = new Set(Object.keys(numberPropertySuffixes));
|
|
1329
|
+
timeUnits_1 = transformValue$1.timeUnits = timeUnits;
|
|
1330
|
+
const lengthUnits = new Set(["backgroundPositionX", "backgroundPositionY", "blockSize", "borderBlockEndWidth", "borderBlockStartWidth", "borderBlockWidth", "borderVerticalWidth", "borderVerticalWidth", "borderBottomLeftRadius", "borderBottomRightRadius", "borderBottomWidth", "borderEndEndRadius", "borderEndStartRadius", "borderImageWidth", "borderInlineEndWidth", "borderEndWidth", "borderInlineStartWidth", "borderStartWidth", "borderInlineWidth", "borderHorizontalWidth", "borderLeftWidth", "borderRightWidth", "borderSpacing", "borderStartEndRadius", "borderStartStartRadius", "borderTopLeftRadius", "borderTopRightRadius", "borderTopWidth", "bottom", "columnGap", "columnRuleWidth", "columnWidth", "containIntrinsicBlockSize", "containIntrinsicHeight", "containIntrinsicInlineSize", "containIntrinsicWidth", "flexBasis", "fontSize", "fontSmooth", "height", "inlineSize", "insetBlockEnd", "insetBlockStart", "insetInlineEnd", "insetInlineStart", "left", "letterSpacing", "marginBlockEnd", "marginBlockStart", "marginBottom", "marginInlineEnd", "marginEnd", "marginInlineStart", "marginStart", "marginLeft", "marginRight", "marginTop", "maskBorderOutset", "maskBorderWidth", "maxBlockSize", "maxHeight", "maxInlineSize", "maxWidth", "minBlockSize", "minHeight", "minInlineSize", "minWidth", "offsetDistance", "outlineOffset", "outlineWidth", "overflowClipMargin", "paddingBlockEnd", "paddingBlockStart", "paddingBottom", "paddingInlineEnd", "paddingEnd", "paddingInlineStart", "paddingStart", "paddingLeft", "paddingRight", "paddingTop", "perspective", "right", "rowGap", "scrollMarginBlockEnd", "scrollMarginBlockStart", "scrollMarginBottom", "scrollMarginInlineEnd", "scrollMarginInlineStart", "scrollMarginLeft", "scrollMarginRight", "scrollMarginTop", "scrollPaddingBlockEnd", "scrollPaddingBlockStart", "scrollPaddingBottom", "scrollPaddingInlineEnd", "scrollPaddingInlineStart", "scrollPaddingLeft", "scrollPaddingRight", "scrollPaddingTop", "scrollSnapMarginBottom", "scrollSnapMarginLeft", "scrollSnapMarginRight", "scrollSnapMarginTop", "shapeMargin", "tabSize", "textDecorationThickness", "textIndent", "textUnderlineOffset", "top", "transformOrigin", "translate", "verticalAlign", "width", "wordSpacing", "border", "borderBlock", "borderBlockEnd", "borderBlockStart", "borderBottom", "borderLeft", "borderRadius", "borderRight", "borderTop", "borderWidth", "columnRule", "containIntrinsicSize", "gap", "inset", "insetBlock", "insetInline", "margin", "marginBlock", "marginVertical", "marginInline", "marginHorizontal", "offset", "outline", "padding", "paddingBlock", "paddingVertical", "paddingInline", "paddingHorizontal", "scrollMargin", "scrollMarginBlock", "scrollMarginInline", "scrollPadding", "scrollPaddingBlock", "scrollPaddingInline", "scrollSnapMargin"]);
|
|
1331
|
+
var lengthUnits_1 = transformValue$1.lengthUnits = lengthUnits;
|
|
1245
1332
|
|
|
1246
1333
|
var generateCssRule = {};
|
|
1247
1334
|
|
|
@@ -2176,7 +2263,7 @@ function styleXOverrideVars(themeVars, variables, options) {
|
|
|
2176
2263
|
[themeVars.__themeName__]: overrideClassName
|
|
2177
2264
|
}, {
|
|
2178
2265
|
[overrideClassName]: {
|
|
2179
|
-
ltr: `.${overrideClassName}{${cssVariablesOverrideString}${atRulesCss}
|
|
2266
|
+
ltr: `.${overrideClassName}{${cssVariablesOverrideString}}${atRulesCss}`,
|
|
2180
2267
|
priority: 0.99,
|
|
2181
2268
|
rtl: undefined
|
|
2182
2269
|
}
|
|
@@ -2268,10 +2355,215 @@ function genFileBasedIdentifier(_ref) {
|
|
|
2268
2355
|
return `${fileName}//${exportName}${key != null ? `.${key}` : ""}`;
|
|
2269
2356
|
}
|
|
2270
2357
|
|
|
2358
|
+
var types$1 = {};
|
|
2359
|
+
|
|
2360
|
+
Object.defineProperty(types$1, "__esModule", {
|
|
2361
|
+
value: true
|
|
2362
|
+
});
|
|
2363
|
+
types$1.url = types$1.transformList = types$1.transformFunction = types$1.time = types$1.resolution = types$1.percentage = types$1.number = types$1.lengthPercentage = types$1.length = types$1.integer = types$1.image = types$1.color = types$1.angle = types$1.Url = types$1.TransformList = types$1.TransformFunction = types$1.Time = types$1.Resolution = types$1.Percentage = types$1.Num = types$1.LengthPercentage = types$1.Length = types$1.Integer = types$1.Image = types$1.Color = types$1.CSSType = types$1.Angle = void 0;
|
|
2364
|
+
class CSSType {}
|
|
2365
|
+
types$1.CSSType = CSSType;
|
|
2366
|
+
class Angle extends CSSType {
|
|
2367
|
+
syntax = "<angle>";
|
|
2368
|
+
static syntax = "<angle>";
|
|
2369
|
+
constructor(value) {
|
|
2370
|
+
super();
|
|
2371
|
+
this.value = value;
|
|
2372
|
+
}
|
|
2373
|
+
static create(value) {
|
|
2374
|
+
return new Angle(value);
|
|
2375
|
+
}
|
|
2376
|
+
}
|
|
2377
|
+
types$1.Angle = Angle;
|
|
2378
|
+
const angle = Angle.create;
|
|
2379
|
+
types$1.angle = angle;
|
|
2380
|
+
class Color extends CSSType {
|
|
2381
|
+
syntax = "<color>";
|
|
2382
|
+
constructor(value) {
|
|
2383
|
+
super();
|
|
2384
|
+
this.value = value;
|
|
2385
|
+
}
|
|
2386
|
+
static create(value) {
|
|
2387
|
+
return new Color(value);
|
|
2388
|
+
}
|
|
2389
|
+
}
|
|
2390
|
+
types$1.Color = Color;
|
|
2391
|
+
const color = Color.create;
|
|
2392
|
+
types$1.color = color;
|
|
2393
|
+
class Url extends CSSType {
|
|
2394
|
+
syntax = "<url>";
|
|
2395
|
+
constructor(value) {
|
|
2396
|
+
super();
|
|
2397
|
+
this.value = value;
|
|
2398
|
+
}
|
|
2399
|
+
static create(value) {
|
|
2400
|
+
return new Url(value);
|
|
2401
|
+
}
|
|
2402
|
+
}
|
|
2403
|
+
types$1.Url = Url;
|
|
2404
|
+
const url = Url.create;
|
|
2405
|
+
types$1.url = url;
|
|
2406
|
+
class Image extends Url {
|
|
2407
|
+
syntax = "<image>";
|
|
2408
|
+
constructor(value) {
|
|
2409
|
+
super(value);
|
|
2410
|
+
this.value = value;
|
|
2411
|
+
}
|
|
2412
|
+
static create(value) {
|
|
2413
|
+
return new Image(value);
|
|
2414
|
+
}
|
|
2415
|
+
}
|
|
2416
|
+
types$1.Image = Image;
|
|
2417
|
+
const image = Image.create;
|
|
2418
|
+
types$1.image = image;
|
|
2419
|
+
class Integer extends CSSType {
|
|
2420
|
+
syntax = "<integer>";
|
|
2421
|
+
constructor(value) {
|
|
2422
|
+
super();
|
|
2423
|
+
this.value = value;
|
|
2424
|
+
}
|
|
2425
|
+
static create(value) {
|
|
2426
|
+
return new Integer(value);
|
|
2427
|
+
}
|
|
2428
|
+
}
|
|
2429
|
+
types$1.Integer = Integer;
|
|
2430
|
+
const integer = Integer.create;
|
|
2431
|
+
types$1.integer = integer;
|
|
2432
|
+
class LengthPercentage extends CSSType {
|
|
2433
|
+
syntax = "<length-percentage>";
|
|
2434
|
+
constructor(value) {
|
|
2435
|
+
super();
|
|
2436
|
+
this.value = value;
|
|
2437
|
+
}
|
|
2438
|
+
static createLength(value) {
|
|
2439
|
+
return new LengthPercentage(convertNumberToLength(value));
|
|
2440
|
+
}
|
|
2441
|
+
static createPercentage(value) {
|
|
2442
|
+
return new LengthPercentage(convertNumberToPercentage(value));
|
|
2443
|
+
}
|
|
2444
|
+
}
|
|
2445
|
+
types$1.LengthPercentage = LengthPercentage;
|
|
2446
|
+
const lengthPercentage = LengthPercentage.createLength;
|
|
2447
|
+
types$1.lengthPercentage = lengthPercentage;
|
|
2448
|
+
class Length extends LengthPercentage {
|
|
2449
|
+
syntax = "<length>";
|
|
2450
|
+
constructor(value) {
|
|
2451
|
+
super(convertNumberToLength(value));
|
|
2452
|
+
}
|
|
2453
|
+
static create(value) {
|
|
2454
|
+
return new Length(value);
|
|
2455
|
+
}
|
|
2456
|
+
}
|
|
2457
|
+
types$1.Length = Length;
|
|
2458
|
+
const length = Length.create;
|
|
2459
|
+
types$1.length = length;
|
|
2460
|
+
class Percentage extends LengthPercentage {
|
|
2461
|
+
syntax = "<percentage>";
|
|
2462
|
+
constructor(value) {
|
|
2463
|
+
super(convertNumberToPercentage(value));
|
|
2464
|
+
}
|
|
2465
|
+
static create(value) {
|
|
2466
|
+
return new Percentage(value);
|
|
2467
|
+
}
|
|
2468
|
+
}
|
|
2469
|
+
types$1.Percentage = Percentage;
|
|
2470
|
+
const percentage = Percentage.create;
|
|
2471
|
+
types$1.percentage = percentage;
|
|
2472
|
+
class Num extends CSSType {
|
|
2473
|
+
syntax = "<number>";
|
|
2474
|
+
constructor(value) {
|
|
2475
|
+
super();
|
|
2476
|
+
this.value = value;
|
|
2477
|
+
}
|
|
2478
|
+
static create(value) {
|
|
2479
|
+
return new Num(value);
|
|
2480
|
+
}
|
|
2481
|
+
}
|
|
2482
|
+
types$1.Num = Num;
|
|
2483
|
+
const number = Num.create;
|
|
2484
|
+
types$1.number = number;
|
|
2485
|
+
class Resolution extends CSSType {
|
|
2486
|
+
syntax = "<resolution>";
|
|
2487
|
+
constructor(value) {
|
|
2488
|
+
super();
|
|
2489
|
+
this.value = value;
|
|
2490
|
+
}
|
|
2491
|
+
static create(value) {
|
|
2492
|
+
return new Resolution(value);
|
|
2493
|
+
}
|
|
2494
|
+
}
|
|
2495
|
+
types$1.Resolution = Resolution;
|
|
2496
|
+
const resolution = Resolution.create;
|
|
2497
|
+
types$1.resolution = resolution;
|
|
2498
|
+
class Time extends CSSType {
|
|
2499
|
+
syntax = "<time>";
|
|
2500
|
+
constructor(value) {
|
|
2501
|
+
super();
|
|
2502
|
+
this.value = value;
|
|
2503
|
+
}
|
|
2504
|
+
static create(value) {
|
|
2505
|
+
return new Time(value);
|
|
2506
|
+
}
|
|
2507
|
+
}
|
|
2508
|
+
types$1.Time = Time;
|
|
2509
|
+
const time = Time.create;
|
|
2510
|
+
types$1.time = time;
|
|
2511
|
+
class TransformFunction extends CSSType {
|
|
2512
|
+
syntax = "<transform-function>";
|
|
2513
|
+
constructor(value) {
|
|
2514
|
+
super();
|
|
2515
|
+
this.value = value;
|
|
2516
|
+
}
|
|
2517
|
+
static create(value) {
|
|
2518
|
+
return new TransformFunction(value);
|
|
2519
|
+
}
|
|
2520
|
+
}
|
|
2521
|
+
types$1.TransformFunction = TransformFunction;
|
|
2522
|
+
const transformFunction = TransformFunction.create;
|
|
2523
|
+
types$1.transformFunction = transformFunction;
|
|
2524
|
+
class TransformList extends CSSType {
|
|
2525
|
+
syntax = "<transform-list>";
|
|
2526
|
+
constructor(value) {
|
|
2527
|
+
super();
|
|
2528
|
+
this.value = value;
|
|
2529
|
+
}
|
|
2530
|
+
static create(value) {
|
|
2531
|
+
return new TransformList(value);
|
|
2532
|
+
}
|
|
2533
|
+
}
|
|
2534
|
+
types$1.TransformList = TransformList;
|
|
2535
|
+
const transformList = TransformList.create;
|
|
2536
|
+
types$1.transformList = transformList;
|
|
2537
|
+
const convertNumberToStringUsing = (transformNumber, defaultStr) => value => {
|
|
2538
|
+
if (typeof value === "number") {
|
|
2539
|
+
return transformNumber(value);
|
|
2540
|
+
}
|
|
2541
|
+
if (typeof value === "string") {
|
|
2542
|
+
return value;
|
|
2543
|
+
}
|
|
2544
|
+
if (typeof value === "object") {
|
|
2545
|
+
const {
|
|
2546
|
+
default: defaultValue,
|
|
2547
|
+
...rest
|
|
2548
|
+
} = value;
|
|
2549
|
+
const defaultResult = convertNumberToLength(defaultValue);
|
|
2550
|
+
const result = {
|
|
2551
|
+
default: typeof defaultResult === "string" ? defaultResult : defaultStr
|
|
2552
|
+
};
|
|
2553
|
+
for (const [key, value] of Object.entries(rest)) {
|
|
2554
|
+
result[key] = convertNumberToLength(value);
|
|
2555
|
+
}
|
|
2556
|
+
return result;
|
|
2557
|
+
}
|
|
2558
|
+
return value;
|
|
2559
|
+
};
|
|
2560
|
+
const convertNumberToLength = convertNumberToStringUsing(value => value === 0 ? "0" : `${value}px`, "0px");
|
|
2561
|
+
const convertNumberToPercentage = convertNumberToStringUsing(value => value === 0 ? "0" : `${value * 100}%`, "0");
|
|
2562
|
+
|
|
2271
2563
|
Object.defineProperty(lib, "__esModule", {
|
|
2272
2564
|
value: true
|
|
2273
2565
|
});
|
|
2274
|
-
var utils_1 = lib.utils = overrideVars_1 = lib.overrideVars = messages_1 = lib.messages = keyframes_1 = lib.keyframes = include_1 = lib.include = firstThatWorks_1 = lib.firstThatWorks = createVars_1 = lib.createVars = create_1 = lib.create = IncludedStyles_1 = lib.IncludedStyles = void 0;
|
|
2566
|
+
var utils_1 = lib.utils = lib.types = overrideVars_1 = lib.overrideVars = messages_1 = lib.messages = keyframes_1 = lib.keyframes = include_1 = lib.include = firstThatWorks_1 = lib.firstThatWorks = createVars_1 = lib.createVars = create_1 = lib.create = IncludedStyles_1 = lib.IncludedStyles = void 0;
|
|
2275
2567
|
var _stylexCreate = _interopRequireDefault$2(stylexCreate$1);
|
|
2276
2568
|
var _stylexCreateVars = _interopRequireDefault$2(stylexCreateVars$1);
|
|
2277
2569
|
var _stylexOverrideVars = _interopRequireDefault$2(stylexOverrideVars$1);
|
|
@@ -2281,6 +2573,8 @@ var _stylexFirstThatWorks = _interopRequireDefault$2(stylexFirstThatWorks$1);
|
|
|
2281
2573
|
var _hash = _interopRequireDefault$2(hash$1);
|
|
2282
2574
|
var _fileBasedIdentifier = _interopRequireDefault$2(fileBasedIdentifier);
|
|
2283
2575
|
var m = _interopRequireWildcard(messages$4);
|
|
2576
|
+
var _types = _interopRequireWildcard(types$1);
|
|
2577
|
+
lib.types = _types;
|
|
2284
2578
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
2285
2579
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
2286
2580
|
function _interopRequireDefault$2(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -2347,6 +2641,9 @@ function canBeIdentifier(str) {
|
|
|
2347
2641
|
function isArrayExpression(path, props) {
|
|
2348
2642
|
return path.isArrayExpression(props);
|
|
2349
2643
|
}
|
|
2644
|
+
function isArrowFunctionExpression(path, props) {
|
|
2645
|
+
return path.isArrowFunctionExpression(props);
|
|
2646
|
+
}
|
|
2350
2647
|
function isBinaryExpression(path, props) {
|
|
2351
2648
|
return path.isBinaryExpression(props);
|
|
2352
2649
|
}
|
|
@@ -2434,9 +2731,6 @@ function isTaggedTemplateExpression(path, props) {
|
|
|
2434
2731
|
function isTemplateLiteral(path, props) {
|
|
2435
2732
|
return path.isTemplateLiteral(props);
|
|
2436
2733
|
}
|
|
2437
|
-
function isTypeCastExpression(path, props) {
|
|
2438
|
-
return path.isTypeCastExpression(props);
|
|
2439
|
-
}
|
|
2440
2734
|
function isUnaryExpression(path, props) {
|
|
2441
2735
|
return path.isUnaryExpression(props);
|
|
2442
2736
|
}
|
|
@@ -2912,6 +3206,173 @@ function evaluate(path, traversalState) {
|
|
|
2912
3206
|
};
|
|
2913
3207
|
}
|
|
2914
3208
|
|
|
3209
|
+
function evaluateStyleXCreateArg(path, traversalState) {
|
|
3210
|
+
let functions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
3211
|
+
identifiers: {},
|
|
3212
|
+
memberExpressions: {}
|
|
3213
|
+
};
|
|
3214
|
+
if (!isObjectExpression(path)) {
|
|
3215
|
+
return evaluate(path, traversalState, functions);
|
|
3216
|
+
}
|
|
3217
|
+
const value = {};
|
|
3218
|
+
const fns = {};
|
|
3219
|
+
for (const prop of path.get("properties")) {
|
|
3220
|
+
if (!isObjectProperty(prop)) {
|
|
3221
|
+
return evaluate(path, traversalState, functions);
|
|
3222
|
+
}
|
|
3223
|
+
const objPropPath = prop;
|
|
3224
|
+
const keyResult = evaluateObjKey(objPropPath, traversalState, functions);
|
|
3225
|
+
if (!keyResult.confident) {
|
|
3226
|
+
return {
|
|
3227
|
+
confident: false,
|
|
3228
|
+
deopt: keyResult.deopt,
|
|
3229
|
+
value: null
|
|
3230
|
+
};
|
|
3231
|
+
}
|
|
3232
|
+
const key = keyResult.value;
|
|
3233
|
+
const valPath = prop.get("value");
|
|
3234
|
+
if (!isArrowFunctionExpression(valPath)) {
|
|
3235
|
+
const val = evaluate(valPath, traversalState, functions);
|
|
3236
|
+
if (!val.confident) {
|
|
3237
|
+
return val;
|
|
3238
|
+
}
|
|
3239
|
+
value[key] = val.value;
|
|
3240
|
+
continue;
|
|
3241
|
+
}
|
|
3242
|
+
const fnPath = valPath;
|
|
3243
|
+
const allParams = fnPath.get("params");
|
|
3244
|
+
const params = allParams.filter(param => isIdentifier(param)).map(param => param.node);
|
|
3245
|
+
if (params.length !== allParams.length) {
|
|
3246
|
+
return {
|
|
3247
|
+
confident: false,
|
|
3248
|
+
deopt: valPath,
|
|
3249
|
+
value: null
|
|
3250
|
+
};
|
|
3251
|
+
}
|
|
3252
|
+
const fnBody = fnPath.get("body");
|
|
3253
|
+
if (!isObjectExpression(fnBody)) {
|
|
3254
|
+
return evaluate(path, traversalState, functions);
|
|
3255
|
+
}
|
|
3256
|
+
const fnObjectBody = fnBody;
|
|
3257
|
+
const evalResult = evaluatePartialObjectRecursively(fnObjectBody, traversalState, functions);
|
|
3258
|
+
if (!evalResult.confident) {
|
|
3259
|
+
const {
|
|
3260
|
+
confident,
|
|
3261
|
+
value: v,
|
|
3262
|
+
deopt
|
|
3263
|
+
} = evalResult;
|
|
3264
|
+
return {
|
|
3265
|
+
confident,
|
|
3266
|
+
value: v,
|
|
3267
|
+
deopt
|
|
3268
|
+
};
|
|
3269
|
+
}
|
|
3270
|
+
const {
|
|
3271
|
+
value: v,
|
|
3272
|
+
inlineStyles
|
|
3273
|
+
} = evalResult;
|
|
3274
|
+
value[key] = v;
|
|
3275
|
+
fns[key] = [params, inlineStyles ?? {}];
|
|
3276
|
+
}
|
|
3277
|
+
return {
|
|
3278
|
+
value,
|
|
3279
|
+
confident: true,
|
|
3280
|
+
fns
|
|
3281
|
+
};
|
|
3282
|
+
}
|
|
3283
|
+
function evaluatePartialObjectRecursively(path, traversalState) {
|
|
3284
|
+
let functions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
3285
|
+
identifiers: {},
|
|
3286
|
+
memberExpressions: {}
|
|
3287
|
+
};
|
|
3288
|
+
let keyPath = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
3289
|
+
const obj = {};
|
|
3290
|
+
const inlineStyles = {};
|
|
3291
|
+
const props = path.get("properties");
|
|
3292
|
+
for (const prop of props) {
|
|
3293
|
+
if (isObjectMethod(prop)) {
|
|
3294
|
+
return {
|
|
3295
|
+
value: null,
|
|
3296
|
+
confident: false
|
|
3297
|
+
};
|
|
3298
|
+
}
|
|
3299
|
+
if (isSpreadElement(prop)) {
|
|
3300
|
+
const result = evaluate(prop.get("argument"), traversalState, functions);
|
|
3301
|
+
if (!result.confident) {
|
|
3302
|
+
return result;
|
|
3303
|
+
}
|
|
3304
|
+
Object.assign(obj, result.value);
|
|
3305
|
+
continue;
|
|
3306
|
+
}
|
|
3307
|
+
if (isObjectProperty(prop)) {
|
|
3308
|
+
const keyResult = evaluateObjKey(prop, traversalState, functions);
|
|
3309
|
+
if (!keyResult.confident) {
|
|
3310
|
+
return {
|
|
3311
|
+
confident: false,
|
|
3312
|
+
deopt: keyResult.deopt,
|
|
3313
|
+
value: null
|
|
3314
|
+
};
|
|
3315
|
+
}
|
|
3316
|
+
const key = keyResult.value;
|
|
3317
|
+
const valuePath = prop.get("value");
|
|
3318
|
+
if (isObjectExpression(valuePath)) {
|
|
3319
|
+
const result = evaluatePartialObjectRecursively(valuePath, traversalState, functions, [...keyPath, key]);
|
|
3320
|
+
if (!result.confident) {
|
|
3321
|
+
return {
|
|
3322
|
+
confident: false,
|
|
3323
|
+
deopt: result.deopt,
|
|
3324
|
+
value: null
|
|
3325
|
+
};
|
|
3326
|
+
}
|
|
3327
|
+
obj[key] = result.value;
|
|
3328
|
+
Object.assign(inlineStyles, result.inlineStyles);
|
|
3329
|
+
} else {
|
|
3330
|
+
const result = evaluate(valuePath, traversalState, functions);
|
|
3331
|
+
if (!result.confident) {
|
|
3332
|
+
const varName = "--" + (keyPath.length > 0 ? utils_1.hash([...keyPath, key].join("_")) : key);
|
|
3333
|
+
obj[key] = `var(${varName}, revert)`;
|
|
3334
|
+
const node = valuePath.node;
|
|
3335
|
+
if (!t__namespace.isExpression(node)) {
|
|
3336
|
+
throw new Error("Expected expression as style value");
|
|
3337
|
+
}
|
|
3338
|
+
const expression = node;
|
|
3339
|
+
const unit = timeUnits_1.has(key) || lengthUnits_1.has(key) ? getNumberSuffix_1(key) : "";
|
|
3340
|
+
inlineStyles[varName] = unit !== "" ? t__namespace.callExpression(t__namespace.arrowFunctionExpression([t__namespace.identifier("val")], t__namespace.conditionalExpression(t__namespace.binaryExpression("===", t__namespace.unaryExpression("typeof", t__namespace.identifier("val")), t__namespace.stringLiteral("number")), t__namespace.binaryExpression("+", t__namespace.identifier("val"), t__namespace.stringLiteral(unit)), t__namespace.logicalExpression("??", t__namespace.identifier("val"), t__namespace.stringLiteral("initial")))), [expression]) : t__namespace.logicalExpression("??", expression, t__namespace.stringLiteral("initial"));
|
|
3341
|
+
} else {
|
|
3342
|
+
obj[key] = result.value;
|
|
3343
|
+
}
|
|
3344
|
+
}
|
|
3345
|
+
}
|
|
3346
|
+
}
|
|
3347
|
+
return {
|
|
3348
|
+
value: obj,
|
|
3349
|
+
confident: true,
|
|
3350
|
+
inlineStyles
|
|
3351
|
+
};
|
|
3352
|
+
}
|
|
3353
|
+
function evaluateObjKey(prop, traversalState, functions) {
|
|
3354
|
+
const keyPath = prop.get("key");
|
|
3355
|
+
let key;
|
|
3356
|
+
if (prop.node.computed) {
|
|
3357
|
+
const result = evaluate(keyPath, traversalState, functions);
|
|
3358
|
+
if (!result.confident) {
|
|
3359
|
+
return {
|
|
3360
|
+
confident: false,
|
|
3361
|
+
deopt: result.deopt
|
|
3362
|
+
};
|
|
3363
|
+
}
|
|
3364
|
+
key = result.value;
|
|
3365
|
+
} else if (isIdentifier(keyPath)) {
|
|
3366
|
+
key = keyPath.node.name;
|
|
3367
|
+
} else {
|
|
3368
|
+
key = keyPath.node.value;
|
|
3369
|
+
}
|
|
3370
|
+
return {
|
|
3371
|
+
confident: true,
|
|
3372
|
+
value: String(key)
|
|
3373
|
+
};
|
|
3374
|
+
}
|
|
3375
|
+
|
|
2915
3376
|
function transformStyleXCreate(path, state) {
|
|
2916
3377
|
const {
|
|
2917
3378
|
node
|
|
@@ -2926,7 +3387,6 @@ function transformStyleXCreate(path, state) {
|
|
|
2926
3387
|
if (!isObjectExpression(firstArg)) {
|
|
2927
3388
|
throw new Error(messages_1.ILLEGAL_ARGUMENT_LENGTH);
|
|
2928
3389
|
}
|
|
2929
|
-
preProcessStyleArg(firstArg, state);
|
|
2930
3390
|
state.inStyleXCreate = true;
|
|
2931
3391
|
const injectedKeyframes = {};
|
|
2932
3392
|
function keyframes(animation) {
|
|
@@ -2969,8 +3429,9 @@ function transformStyleXCreate(path, state) {
|
|
|
2969
3429
|
});
|
|
2970
3430
|
const {
|
|
2971
3431
|
confident,
|
|
2972
|
-
value
|
|
2973
|
-
|
|
3432
|
+
value,
|
|
3433
|
+
fns
|
|
3434
|
+
} = evaluateStyleXCreateArg(firstArg, state, {
|
|
2974
3435
|
identifiers,
|
|
2975
3436
|
memberExpressions
|
|
2976
3437
|
});
|
|
@@ -3003,7 +3464,26 @@ function transformStyleXCreate(path, state) {
|
|
|
3003
3464
|
state.styleMap.set(varName, compiledStyles);
|
|
3004
3465
|
state.styleVars.set(varName, path.parentPath);
|
|
3005
3466
|
}
|
|
3006
|
-
|
|
3467
|
+
const resultAst = convertObjectToAST(compiledStyles);
|
|
3468
|
+
if (fns != null) {
|
|
3469
|
+
resultAst.properties = resultAst.properties.map(prop => {
|
|
3470
|
+
if (t__namespace.isObjectProperty(prop)) {
|
|
3471
|
+
const key = prop.key.type === "Identifier" && !prop.computed ? prop.key.name : prop.key.type === "StringLiteral" ? prop.key.value : null;
|
|
3472
|
+
if (key != null && Object.keys(fns).includes(key)) {
|
|
3473
|
+
const [params, inlineStyles] = fns[key];
|
|
3474
|
+
if (t__namespace.isExpression(prop.value)) {
|
|
3475
|
+
const value = prop.value;
|
|
3476
|
+
prop.value = t__namespace.arrowFunctionExpression(params, t__namespace.arrayExpression([value, t__namespace.objectExpression(Object.entries(inlineStyles).map(_ref => {
|
|
3477
|
+
let [key, value] = _ref;
|
|
3478
|
+
return t__namespace.objectProperty(t__namespace.stringLiteral(key), value);
|
|
3479
|
+
}))]));
|
|
3480
|
+
}
|
|
3481
|
+
}
|
|
3482
|
+
}
|
|
3483
|
+
return prop;
|
|
3484
|
+
});
|
|
3485
|
+
}
|
|
3486
|
+
path.replaceWith(resultAst);
|
|
3007
3487
|
if (Object.keys(injectedStyles).length === 0) {
|
|
3008
3488
|
return;
|
|
3009
3489
|
}
|
|
@@ -3051,25 +3531,6 @@ function findNearestStatementAncestor(path) {
|
|
|
3051
3531
|
}
|
|
3052
3532
|
return findNearestStatementAncestor(path.parentPath);
|
|
3053
3533
|
}
|
|
3054
|
-
function preProcessStyleArg(objPath, state) {
|
|
3055
|
-
objPath.traverse({
|
|
3056
|
-
SpreadElement(path) {
|
|
3057
|
-
const argument = path.get("argument");
|
|
3058
|
-
if (!isTypeCastExpression(argument)) {
|
|
3059
|
-
return;
|
|
3060
|
-
}
|
|
3061
|
-
const expression = argument.get("expression");
|
|
3062
|
-
if (!isIdentifier(expression) && !isMemberExpression(expression)) {
|
|
3063
|
-
throw new Error(messages_1.ILLEGAL_NAMESPACE_VALUE);
|
|
3064
|
-
}
|
|
3065
|
-
if (!(isObjectExpression(path.parentPath) && isObjectProperty(path.parentPath.parentPath) && isObjectExpression(path.parentPath.parentPath.parentPath) && isCallExpression(path.parentPath.parentPath.parentPath.parentPath))) {
|
|
3066
|
-
throw new Error(messages_1.ILLEGAL_NESTED_PSEUDO);
|
|
3067
|
-
}
|
|
3068
|
-
const stylexName = getStylexDefaultImport(path, state);
|
|
3069
|
-
argument.replaceWith(t__namespace.callExpression(t__namespace.memberExpression(t__namespace.identifier(stylexName), t__namespace.identifier("include")), [expression.node]));
|
|
3070
|
-
}
|
|
3071
|
-
});
|
|
3072
|
-
}
|
|
3073
3534
|
function getStylexDefaultImport(path, state) {
|
|
3074
3535
|
const statementPath = findNearestStatementAncestor(path);
|
|
3075
3536
|
let stylexName;
|
|
@@ -3102,10 +3563,15 @@ function transformStyleXCreateVars(callExpressionPath, state) {
|
|
|
3102
3563
|
const varId = variableDeclaratorNode.id;
|
|
3103
3564
|
const args = callExpressionPath.get("arguments");
|
|
3104
3565
|
const firstArg = args[0];
|
|
3566
|
+
const identifiers = {};
|
|
3567
|
+
const memberExpressions = {};
|
|
3105
3568
|
const {
|
|
3106
3569
|
confident,
|
|
3107
3570
|
value
|
|
3108
|
-
} = evaluate(firstArg, state
|
|
3571
|
+
} = evaluate(firstArg, state, {
|
|
3572
|
+
identifiers,
|
|
3573
|
+
memberExpressions
|
|
3574
|
+
});
|
|
3109
3575
|
if (!confident) {
|
|
3110
3576
|
throw new Error(messages_1.NON_STATIC_VALUE);
|
|
3111
3577
|
}
|
|
@@ -3490,7 +3956,7 @@ Object.defineProperty(stylex$1, "__esModule", {
|
|
|
3490
3956
|
});
|
|
3491
3957
|
stylex$1.keyframes = stylex$1.inject = stylex$1.include = stylex$1.firstThatWorks = default_1 = stylex$1.default = stylex$1.create = stylex$1.UNSUPPORTED_PROPERTY = void 0;
|
|
3492
3958
|
stylex$1.spread = spread;
|
|
3493
|
-
stylex$1.unstable_overrideVars = stylex$1.unstable_createVars = stylex$1.stylex = void 0;
|
|
3959
|
+
stylex$1.unstable_overrideVars = stylex$1.unstable_createVars = stylex$1.types = stylex$1.stylex = void 0;
|
|
3494
3960
|
var _stylexInject = _interopRequireDefault(stylexInject);
|
|
3495
3961
|
var _styleq = require$$1;
|
|
3496
3962
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -3521,6 +3987,49 @@ const unstable_overrideVars = stylexOverrideVars;
|
|
|
3521
3987
|
stylex$1.unstable_overrideVars = unstable_overrideVars;
|
|
3522
3988
|
const include = stylexIncludes;
|
|
3523
3989
|
stylex$1.include = include;
|
|
3990
|
+
const types = {
|
|
3991
|
+
angle: _v => {
|
|
3992
|
+
throw new Error(errorForType("angle"));
|
|
3993
|
+
},
|
|
3994
|
+
color: _v => {
|
|
3995
|
+
throw new Error(errorForType("color"));
|
|
3996
|
+
},
|
|
3997
|
+
url: _v => {
|
|
3998
|
+
throw new Error(errorForType("url"));
|
|
3999
|
+
},
|
|
4000
|
+
image: _v => {
|
|
4001
|
+
throw new Error(errorForType("image"));
|
|
4002
|
+
},
|
|
4003
|
+
integer: _v => {
|
|
4004
|
+
throw new Error(errorForType("integer"));
|
|
4005
|
+
},
|
|
4006
|
+
lengthPercentage: _v => {
|
|
4007
|
+
throw new Error(errorForType("lengthPercentage"));
|
|
4008
|
+
},
|
|
4009
|
+
length: _v => {
|
|
4010
|
+
throw new Error(errorForType("length"));
|
|
4011
|
+
},
|
|
4012
|
+
percentage: _v => {
|
|
4013
|
+
throw new Error(errorForType("percentage"));
|
|
4014
|
+
},
|
|
4015
|
+
number: _v => {
|
|
4016
|
+
throw new Error(errorForType("number"));
|
|
4017
|
+
},
|
|
4018
|
+
resolution: _v => {
|
|
4019
|
+
throw new Error(errorForType("resolution"));
|
|
4020
|
+
},
|
|
4021
|
+
time: _v => {
|
|
4022
|
+
throw new Error(errorForType("time"));
|
|
4023
|
+
},
|
|
4024
|
+
transformFunction: _v => {
|
|
4025
|
+
throw new Error(errorForType("transformFunction"));
|
|
4026
|
+
},
|
|
4027
|
+
transformList: _v => {
|
|
4028
|
+
throw new Error(errorForType("transformList"));
|
|
4029
|
+
}
|
|
4030
|
+
};
|
|
4031
|
+
stylex$1.types = types;
|
|
4032
|
+
const errorForType = type => `stylex.types.${type} should be compiled away by @stylexjs/babel-plugin`;
|
|
3524
4033
|
const keyframes = _keyframes => {
|
|
3525
4034
|
throw new Error("stylex.keyframes should never be called");
|
|
3526
4035
|
};
|
|
@@ -3551,10 +4060,11 @@ _stylex.keyframes = keyframes;
|
|
|
3551
4060
|
_stylex.firstThatWorks = firstThatWorks;
|
|
3552
4061
|
_stylex.inject = inject;
|
|
3553
4062
|
_stylex.UNSUPPORTED_PROPERTY = UNSUPPORTED_PROPERTY;
|
|
3554
|
-
|
|
3555
|
-
var default_1 = stylex$1.default = _default;
|
|
4063
|
+
_stylex.types = types;
|
|
3556
4064
|
const stylex = _stylex;
|
|
3557
4065
|
stylex$1.stylex = stylex;
|
|
4066
|
+
var _default = _stylex;
|
|
4067
|
+
var default_1 = stylex$1.default = _default;
|
|
3558
4068
|
|
|
3559
4069
|
function skipStylexMergeChildren(path, state) {
|
|
3560
4070
|
const {
|
|
@@ -45,6 +45,7 @@ declare class StateManager {
|
|
|
45
45
|
readonly stylexKeyframesImport: Set<string>;
|
|
46
46
|
readonly stylexCreateVarsImport: Set<string>;
|
|
47
47
|
readonly stylexOverrideVarsImport: Set<string>;
|
|
48
|
+
readonly stylexTypesImport: Set<string>;
|
|
48
49
|
readonly styleMap: Map<string, CompiledNamespaces>;
|
|
49
50
|
readonly styleVars: Map<string, NodePath>;
|
|
50
51
|
readonly styleVarsToKeep: Set<[string, null | string]>;
|
|
@@ -50,6 +50,7 @@ declare export default class StateManager {
|
|
|
50
50
|
+stylexKeyframesImport: Set<string>;
|
|
51
51
|
+stylexCreateVarsImport: Set<string>;
|
|
52
52
|
+stylexOverrideVarsImport: Set<string>;
|
|
53
|
+
+stylexTypesImport: Set<string>;
|
|
53
54
|
+styleMap: Map<string, CompiledNamespaces>;
|
|
54
55
|
+styleVars: Map<string, NodePath<>>;
|
|
55
56
|
+styleVarsToKeep: Set<[string, null | string]>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import * as t from '@babel/types';
|
|
11
|
+
import type { NodePath } from '@babel/traverse';
|
|
12
|
+
import StateManager from '../../utils/state-manager';
|
|
13
|
+
declare function transformStyleXCreate(
|
|
14
|
+
path: NodePath<t.CallExpression>,
|
|
15
|
+
state: StateManager,
|
|
16
|
+
): void;
|
|
17
|
+
export default transformStyleXCreate;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @flow strict
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import * as t from '../../../flow_modules/@babel/types';
|
|
11
|
+
import type { NodePath } from '../../../flow_modules/@babel/traverse';
|
|
12
|
+
import StateManager from '../../utils/state-manager';
|
|
13
|
+
/// This function looks for `stylex.create` calls and transforms them.
|
|
14
|
+
//. 1. It finds the first argument to `stylex.create` and validates it.
|
|
15
|
+
/// 2. It pre-processes valid-dynamic parts of style object such as custom presets (spreads)
|
|
16
|
+
/// 3. It envalues the style object to get a JS object. This also handles local constants automatically.
|
|
17
|
+
/// 4. It uses the `stylexCreate` from `@stylexjs/shared` to transform the JS
|
|
18
|
+
/// object and to get a list of injected styles.
|
|
19
|
+
/// 5. It converts the resulting Object back into an AST and replaces the call with it.
|
|
20
|
+
/// 6. It also inserts `stylex.inject` calls above the current statement as needed.
|
|
21
|
+
declare export default function transformStyleXCreate(
|
|
22
|
+
path: NodePath<t.CallExpression>,
|
|
23
|
+
state: StateManager,
|
|
24
|
+
): void;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*
|
|
8
|
+
* @flow strict
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type { NodePath } from '@babel/traverse';
|
|
12
|
+
import StateManager from '../../utils/state-manager';
|
|
13
|
+
import { type FunctionConfig } from '../../utils/evaluate-path';
|
|
14
|
+
export declare function evaluateStyleFunction(
|
|
15
|
+
path: NodePath,
|
|
16
|
+
traversalState: StateManager,
|
|
17
|
+
functions: FunctionConfig,
|
|
18
|
+
): { confident: boolean; value: any; deopt?: null | NodePath };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*
|
|
8
|
+
* @flow strict
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type { NodePath } from '../../../flow_modules/@babel/traverse';
|
|
12
|
+
import StateManager from '../../utils/state-manager';
|
|
13
|
+
import { type FunctionConfig } from '../../utils/evaluate-path';
|
|
14
|
+
// This
|
|
15
|
+
declare export function evaluateStyleFunction(
|
|
16
|
+
path: NodePath<>,
|
|
17
|
+
traversalState: StateManager,
|
|
18
|
+
functions: FunctionConfig,
|
|
19
|
+
): {
|
|
20
|
+
confident: boolean,
|
|
21
|
+
value: any,
|
|
22
|
+
deopt?: null | NodePath<>,
|
|
23
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*
|
|
8
|
+
* @flow strict
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type { NodePath } from '@babel/traverse';
|
|
12
|
+
import * as t from '@babel/types';
|
|
13
|
+
import StateManager from '../../utils/state-manager';
|
|
14
|
+
import { type FunctionConfig } from '../../utils/evaluate-path';
|
|
15
|
+
export declare function evaluateStyleXCreateArg(
|
|
16
|
+
path: NodePath,
|
|
17
|
+
traversalState: StateManager,
|
|
18
|
+
functions: FunctionConfig,
|
|
19
|
+
): Readonly<{
|
|
20
|
+
confident: boolean;
|
|
21
|
+
value: any;
|
|
22
|
+
deopt?: null | NodePath;
|
|
23
|
+
fns?: {
|
|
24
|
+
[$$Key$$: string]: [
|
|
25
|
+
Array<t.Identifier>,
|
|
26
|
+
{ readonly [$$Key$$: string]: t.Expression | t.PatternLike },
|
|
27
|
+
];
|
|
28
|
+
};
|
|
29
|
+
}>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*
|
|
8
|
+
* @flow strict
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type { NodePath } from '../../../flow_modules/@babel/traverse';
|
|
12
|
+
import * as t from '../../../flow_modules/@babel/types';
|
|
13
|
+
import StateManager from '../../utils/state-manager';
|
|
14
|
+
import { type FunctionConfig } from '../../utils/evaluate-path';
|
|
15
|
+
// This
|
|
16
|
+
declare export function evaluateStyleXCreateArg(
|
|
17
|
+
path: NodePath<>,
|
|
18
|
+
traversalState: StateManager,
|
|
19
|
+
functions: FunctionConfig,
|
|
20
|
+
): $ReadOnly<{
|
|
21
|
+
confident: boolean,
|
|
22
|
+
value: any,
|
|
23
|
+
deopt?: null | NodePath<>,
|
|
24
|
+
fns?: {
|
|
25
|
+
[string]: [
|
|
26
|
+
Array<t.Identifier>,
|
|
27
|
+
{ +[string]: t.Expression | t.PatternLike },
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stylexjs/babel-plugin",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.20",
|
|
4
4
|
"description": "StyleX babel plugin.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"repository": "https://github.com/facebook/stylex",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"test": "jest"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@stylexjs/shared": "0.2.0-beta.
|
|
15
|
+
"@stylexjs/shared": "0.2.0-beta.20"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
18
|
"@babel/core": "^7.19.6",
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
"verbose": true,
|
|
27
27
|
"snapshotFormat": {
|
|
28
28
|
"printBasicPrototype": false
|
|
29
|
-
}
|
|
29
|
+
},
|
|
30
|
+
"prettierPath": null
|
|
30
31
|
},
|
|
31
32
|
"files": [
|
|
32
33
|
"flow_modules/*",
|