@stylexjs/shared 0.2.0-beta.15 → 0.2.0-beta.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/lib/convert-to-className.d.ts +1 -1
  2. package/lib/convert-to-className.js +6 -22
  3. package/lib/convert-to-className.js.flow +1 -1
  4. package/lib/generate-css-rule.d.ts +1 -1
  5. package/lib/generate-css-rule.js +3 -14
  6. package/lib/generate-css-rule.js.flow +1 -1
  7. package/lib/hash.d.ts +2 -2
  8. package/lib/hash.js +9 -33
  9. package/lib/hash.js.flow +1 -3
  10. package/lib/index.d.ts +9 -9
  11. package/lib/index.js +0 -14
  12. package/lib/index.js.flow +9 -9
  13. package/lib/messages.d.ts +26 -26
  14. package/lib/messages.js +26 -36
  15. package/lib/messages.js.flow +26 -26
  16. package/lib/physical-rtl/generate-ltr.js +39 -67
  17. package/lib/physical-rtl/generate-ltr.js.flow +1 -1
  18. package/lib/physical-rtl/generate-rtl.d.ts +1 -2
  19. package/lib/physical-rtl/generate-rtl.js +57 -89
  20. package/lib/physical-rtl/generate-rtl.js.flow +1 -2
  21. package/lib/preprocess-rules/PreRule.d.ts +3 -3
  22. package/lib/preprocess-rules/PreRule.js +3 -17
  23. package/lib/preprocess-rules/PreRule.js.flow +3 -3
  24. package/lib/preprocess-rules/application-order.d.ts +8 -5
  25. package/lib/preprocess-rules/application-order.js +121 -160
  26. package/lib/preprocess-rules/application-order.js.flow +6 -5
  27. package/lib/preprocess-rules/basic-validation.d.ts +1 -1
  28. package/lib/preprocess-rules/basic-validation.js +6 -15
  29. package/lib/preprocess-rules/basic-validation.js.flow +1 -1
  30. package/lib/preprocess-rules/flatten-raw-style-obj.d.ts +2 -2
  31. package/lib/preprocess-rules/flatten-raw-style-obj.js +14 -43
  32. package/lib/preprocess-rules/flatten-raw-style-obj.js.flow +2 -2
  33. package/lib/preprocess-rules/index.d.ts +2 -2
  34. package/lib/preprocess-rules/index.js +6 -15
  35. package/lib/preprocess-rules/index.js.flow +2 -2
  36. package/lib/preprocess-rules/legacy-expand-shorthands.d.ts +3 -2
  37. package/lib/preprocess-rules/legacy-expand-shorthands.js +14 -33
  38. package/lib/preprocess-rules/legacy-expand-shorthands.js.flow +2 -2
  39. package/lib/preprocess-rules/property-specificity.d.ts +8 -5
  40. package/lib/preprocess-rules/property-specificity.js +54 -76
  41. package/lib/preprocess-rules/property-specificity.js.flow +6 -5
  42. package/lib/stylex-create-vars.d.ts +17 -8
  43. package/lib/stylex-create-vars.js +30 -17
  44. package/lib/stylex-create-vars.js.flow +10 -4
  45. package/lib/stylex-create.d.ts +2 -2
  46. package/lib/stylex-create.js +1 -20
  47. package/lib/stylex-create.js.flow +1 -1
  48. package/lib/stylex-first-that-works.js +0 -10
  49. package/lib/stylex-include.js +0 -10
  50. package/lib/stylex-keyframes.d.ts +1 -1
  51. package/lib/stylex-keyframes.js +7 -27
  52. package/lib/stylex-keyframes.js.flow +1 -1
  53. package/lib/stylex-override-vars.d.ts +11 -4
  54. package/lib/stylex-override-vars.js +32 -18
  55. package/lib/stylex-override-vars.js.flow +3 -3
  56. package/lib/transform-value.js +11 -29
  57. package/lib/transform-value.js.flow +1 -1
  58. package/lib/utils/Rule.d.ts +2 -2
  59. package/lib/utils/Rule.js +0 -21
  60. package/lib/utils/Rule.js.flow +2 -2
  61. package/lib/utils/dashify.js +1 -9
  62. package/lib/utils/default-options.d.ts +1 -1
  63. package/lib/utils/default-options.js +2 -23
  64. package/lib/utils/default-options.js.flow +1 -1
  65. package/lib/utils/file-based-identifier.js +1 -9
  66. package/lib/utils/genCSSRule.d.ts +1 -1
  67. package/lib/utils/genCSSRule.js +6 -16
  68. package/lib/utils/genCSSRule.js.flow +1 -1
  69. package/lib/utils/normalize-value.js +1 -13
  70. package/lib/utils/normalize-value.js.flow +1 -1
  71. package/lib/utils/normalizers/detect-unclosed-fns.d.ts +1 -1
  72. package/lib/utils/normalizers/detect-unclosed-fns.js +2 -14
  73. package/lib/utils/normalizers/detect-unclosed-fns.js.flow +1 -1
  74. package/lib/utils/normalizers/font-size-px-to-rem.d.ts +1 -1
  75. package/lib/utils/normalizers/font-size-px-to-rem.js +4 -19
  76. package/lib/utils/normalizers/font-size-px-to-rem.js.flow +1 -1
  77. package/lib/utils/normalizers/leading-zero.d.ts +1 -1
  78. package/lib/utils/normalizers/leading-zero.js +3 -15
  79. package/lib/utils/normalizers/leading-zero.js.flow +1 -1
  80. package/lib/utils/normalizers/quotes.d.ts +1 -1
  81. package/lib/utils/normalizers/quotes.js +4 -17
  82. package/lib/utils/normalizers/quotes.js.flow +1 -1
  83. package/lib/utils/normalizers/timings.d.ts +1 -1
  84. package/lib/utils/normalizers/timings.js +4 -18
  85. package/lib/utils/normalizers/timings.js.flow +1 -1
  86. package/lib/utils/normalizers/whitespace.d.ts +1 -1
  87. package/lib/utils/normalizers/whitespace.js +12 -27
  88. package/lib/utils/normalizers/whitespace.js.flow +1 -1
  89. package/lib/utils/normalizers/zero-dimensions.d.ts +1 -1
  90. package/lib/utils/normalizers/zero-dimensions.js +8 -23
  91. package/lib/utils/normalizers/zero-dimensions.js.flow +1 -1
  92. package/lib/utils/object-utils.d.ts +28 -20
  93. package/lib/utils/object-utils.js +2 -15
  94. package/lib/utils/object-utils.js.flow +23 -27
  95. package/lib/utils/property-priorities.js +68 -83
  96. package/lib/utils/split-css-value.d.ts +1 -1
  97. package/lib/utils/split-css-value.js +8 -22
  98. package/lib/utils/split-css-value.js.flow +1 -1
  99. package/lib/validate.js +2 -11
  100. package/package.json +2 -3
@@ -4,102 +4,76 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = generateLTR;
7
- /**
8
- * Copyright (c) Meta Platforms, Inc. and affiliates.
9
- *
10
- * This source code is licensed under the MIT license found in the
11
- * LICENSE file in the root directory of this source tree.
12
- *
13
- *
14
- *
15
- */
16
-
17
7
  const logicalToPhysical = {
18
- start: 'left',
19
- end: 'right'
8
+ start: "left",
9
+ end: "right"
20
10
  };
21
11
  const propertyToLTR = {
22
- 'margin-start': _ref => {
12
+ "margin-start": _ref => {
23
13
  let [_key, val] = _ref;
24
- return ['margin-left', val];
14
+ return ["margin-left", val];
25
15
  },
26
- // 'margin-inline-start': ([_key, val]) => ['margin-left', val],
27
- 'margin-end': _ref2 => {
16
+ "margin-end": _ref2 => {
28
17
  let [_key, val] = _ref2;
29
- return ['margin-right', val];
18
+ return ["margin-right", val];
30
19
  },
31
- // 'margin-inline-end': ([_key, val]: [string, string]) => ['margin-right', val],
32
- 'padding-start': _ref3 => {
20
+ "padding-start": _ref3 => {
33
21
  let [_key, val] = _ref3;
34
- return ['padding-left', val];
22
+ return ["padding-left", val];
35
23
  },
36
- // 'padding-inline-start': ([_key, val]: [string, string]) => ['padding-left', val],
37
- 'padding-end': _ref4 => {
24
+ "padding-end": _ref4 => {
38
25
  let [_key, val] = _ref4;
39
- return ['padding-right', val];
26
+ return ["padding-right", val];
40
27
  },
41
- // 'padding-inline-end': ([_key, val]: [string, string]) => ['padding-right', val],
42
- 'border-start': _ref5 => {
28
+ "border-start": _ref5 => {
43
29
  let [_key, val] = _ref5;
44
- return ['border-left', val];
30
+ return ["border-left", val];
45
31
  },
46
- // 'border-inline-start': ([_key, val]: [string, string]) => ['border-left', val],
47
- 'border-end': _ref6 => {
32
+ "border-end": _ref6 => {
48
33
  let [_key, val] = _ref6;
49
- return ['border-right', val];
34
+ return ["border-right", val];
50
35
  },
51
- // 'border-inline-end': ([_key, val]: [string, string]) => ['border-right', val],
52
- 'border-start-width': _ref7 => {
36
+ "border-start-width": _ref7 => {
53
37
  let [_key, val] = _ref7;
54
- return ['border-left-width', val];
38
+ return ["border-left-width", val];
55
39
  },
56
- // 'border-inline-start-width': ([key, val]: [string, string]) => ['border-left-width', val],
57
- 'border-end-width': _ref8 => {
40
+ "border-end-width": _ref8 => {
58
41
  let [_key, val] = _ref8;
59
- return ['border-right-width', val];
42
+ return ["border-right-width", val];
60
43
  },
61
- // 'border-inline-end-width': ([_key, val]: [string, string]) => ['border-right-width', val],
62
- 'border-start-color': _ref9 => {
44
+ "border-start-color": _ref9 => {
63
45
  let [_key, val] = _ref9;
64
- return ['border-left-color', val];
46
+ return ["border-left-color", val];
65
47
  },
66
- // 'border-inline-start-color': ([_key, val]: [string, string]) => ['border-left-color', val],
67
- 'border-end-color': _ref10 => {
48
+ "border-end-color": _ref10 => {
68
49
  let [_key, val] = _ref10;
69
- return ['border-right-color', val];
50
+ return ["border-right-color", val];
70
51
  },
71
- // 'border-inline-end-color': ([_key, val]: [string, string]) => ['border-right-color', val],
72
- 'border-start-style': _ref11 => {
52
+ "border-start-style": _ref11 => {
73
53
  let [_key, val] = _ref11;
74
- return ['border-left-style', val];
54
+ return ["border-left-style", val];
75
55
  },
76
- // 'border-inline-start-style': ([_key, val]: [string, string]) => ['border-left-style', val],
77
- 'border-end-style': _ref12 => {
56
+ "border-end-style": _ref12 => {
78
57
  let [_key, val] = _ref12;
79
- return ['border-right-style', val];
58
+ return ["border-right-style", val];
80
59
  },
81
- // 'border-inline-end-style': ([_key, val]: [string, string]) => ['border-right-style', val],
82
- 'border-top-start-radius': _ref13 => {
60
+ "border-top-start-radius": _ref13 => {
83
61
  let [_key, val] = _ref13;
84
- return ['border-top-left-radius', val];
62
+ return ["border-top-left-radius", val];
85
63
  },
86
- // 'border-start-start-radius': ([_key, val]: [string, string]) => ['border-top-left-radius', val],
87
- 'border-bottom-start-radius': _ref14 => {
64
+ "border-bottom-start-radius": _ref14 => {
88
65
  let [_key, val] = _ref14;
89
- return ['border-bottom-left-radius', val];
66
+ return ["border-bottom-left-radius", val];
90
67
  },
91
- // 'border-end-start-radius': ([_key, val]: [string, string]) => ['border-bottom-left-radius', val],
92
- 'border-top-end-radius': _ref15 => {
68
+ "border-top-end-radius": _ref15 => {
93
69
  let [_key, val] = _ref15;
94
- return ['border-top-right-radius', val];
70
+ return ["border-top-right-radius", val];
95
71
  },
96
- // 'border-start-end-radius': ([_key, val]: [string, string]) => ['border-top-right-radius', val],
97
- 'border-bottom-end-radius': _ref16 => {
72
+ "border-bottom-end-radius": _ref16 => {
98
73
  let [_key, val] = _ref16;
99
- return ['border-bottom-right-radius', val];
74
+ return ["border-bottom-right-radius", val];
100
75
  },
101
- // 'border-end-end-radius': ([key, val]: [string, string]) => ['border-bottom-right-radius', val],
102
- 'text-align': _ref17 => {
76
+ "text-align": _ref17 => {
103
77
  let [key, val] = _ref17;
104
78
  return [key, logicalToPhysical[val] ?? val];
105
79
  },
@@ -113,17 +87,15 @@ const propertyToLTR = {
113
87
  },
114
88
  start: _ref20 => {
115
89
  let [_key, val] = _ref20;
116
- return ['left', val];
90
+ return ["left", val];
117
91
  },
118
- // 'inset-inline-start': ([key, val]: [string, string]) => ['left', val],
119
92
  end: _ref21 => {
120
93
  let [_key, val] = _ref21;
121
- return ['right', val];
94
+ return ["right", val];
122
95
  },
123
- // 'inset-inline-end': ([key, val]) => ['right', val],
124
- 'background-position': _ref22 => {
96
+ "background-position": _ref22 => {
125
97
  let [key, val] = _ref22;
126
- return [key, val.split(' ').map(word => word === 'start' ? 'left' : word === 'end' ? 'right' : word).join(' ')];
98
+ return [key, val.split(" ").map(word => word === "start" ? "left" : word === "end" ? "right" : word).join(" ")];
127
99
  }
128
100
  };
129
101
  function generateLTR(pair) {
@@ -9,5 +9,5 @@
9
9
  */
10
10
 
11
11
  declare export default function generateLTR(
12
- pair: [string, string]
12
+ pair: [string, string],
13
13
  ): [string, string];
@@ -5,10 +5,9 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  *
8
- *
9
8
  */
10
9
 
11
10
  declare function generateRTL(
12
- $$PARAM_0$$: [string, string]
11
+ $$PARAM_0$$: [string, string],
13
12
  ): null | undefined | [string, string];
14
13
  export default generateRTL;
@@ -6,25 +6,15 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = generateRTL;
7
7
  var _postcssValueParser = _interopRequireDefault(require("postcss-value-parser"));
8
8
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
- /**
10
- * Copyright (c) Meta Platforms, Inc. and affiliates.
11
- *
12
- * This source code is licensed under the MIT license found in the
13
- * LICENSE file in the root directory of this source tree.
14
- *
15
- *
16
- *
17
- */
18
-
19
9
  const cursorFlip = {
20
- 'e-resize': 'w-resize',
21
- 'w-resize': 'e-resize',
22
- 'ne-resize': 'nw-resize',
23
- 'nesw-resize': 'nwse-resize',
24
- 'nw-resize': 'ne-resize',
25
- 'nwse-resize': 'nesw-resize',
26
- 'se-resize': 'sw-resize',
27
- 'sw-resize': 'se-resize'
10
+ "e-resize": "w-resize",
11
+ "w-resize": "e-resize",
12
+ "ne-resize": "nw-resize",
13
+ "nesw-resize": "nwse-resize",
14
+ "nw-resize": "ne-resize",
15
+ "nwse-resize": "nesw-resize",
16
+ "se-resize": "sw-resize",
17
+ "sw-resize": "se-resize"
28
18
  };
29
19
  function splitByDivisor(value) {
30
20
  const ast = (0, _postcssValueParser.default)(value);
@@ -38,7 +28,7 @@ function splitByDivisor(value) {
38
28
  currGroup = [];
39
29
  }
40
30
  for (const node of ast.nodes) {
41
- if (node.type === 'div') {
31
+ if (node.type === "div") {
42
32
  push();
43
33
  } else {
44
34
  currGroup.push(node);
@@ -48,130 +38,110 @@ function splitByDivisor(value) {
48
38
  return groups;
49
39
  }
50
40
  function flipSign(value) {
51
- if (value === '0') {
41
+ if (value === "0") {
52
42
  return value;
53
43
  } else {
54
- return value[0] === '-' ? value.slice(1) : '-' + value;
44
+ return value[0] === "-" ? value.slice(1) : "-" + value;
55
45
  }
56
46
  }
57
47
  function flipShadow(value) {
58
48
  const defs = splitByDivisor(value);
59
49
  const builtDefs = [];
60
50
  for (const def of defs) {
61
- const parts = def.split(' ');
51
+ const parts = def.split(" ");
62
52
  const index = _postcssValueParser.default.unit(parts[0]) === false ? 1 : 0;
63
53
  if (index < parts.length) {
64
54
  parts[index] = flipSign(parts[index]);
65
55
  }
66
- builtDefs.push(parts.join(' '));
56
+ builtDefs.push(parts.join(" "));
67
57
  }
68
- const rtl = builtDefs.join(', ');
58
+ const rtl = builtDefs.join(", ");
69
59
  if (rtl !== value) {
70
60
  return rtl;
71
61
  }
72
62
  }
73
-
74
- // Should we be flipping shadows at all?
75
- // I think the better approach would be to let engineers use
76
- // CSS-vars directly.
77
63
  const shadowsFlip = {
78
- 'box-shadow': _ref => {
64
+ "box-shadow": _ref => {
79
65
  let [key, val] = _ref;
80
66
  const rtlVal = flipShadow(val);
81
67
  return rtlVal ? [key, rtlVal] : null;
82
68
  },
83
- 'text-shadow': _ref2 => {
69
+ "text-shadow": _ref2 => {
84
70
  let [key, val] = _ref2;
85
71
  const rtlVal = flipShadow(val);
86
72
  return rtlVal ? [key, rtlVal] : null;
87
73
  }
88
74
  };
89
75
  const logicalToPhysical = {
90
- start: 'right',
91
- end: 'left'
76
+ start: "right",
77
+ end: "left"
92
78
  };
93
79
  const propertyToRTL = {
94
- 'margin-start': _ref3 => {
80
+ "margin-start": _ref3 => {
95
81
  let [_key, val] = _ref3;
96
- return ['margin-right', val];
82
+ return ["margin-right", val];
97
83
  },
98
- // 'margin-inline-start': ([key, val]: [string, string]) => ['margin-right', val],
99
- 'margin-end': _ref4 => {
84
+ "margin-end": _ref4 => {
100
85
  let [_key, val] = _ref4;
101
- return ['margin-left', val];
86
+ return ["margin-left", val];
102
87
  },
103
- // 'margin-inline-end': ([key, val]: [string, string]) => ['margin-left', val],
104
- 'padding-start': _ref5 => {
88
+ "padding-start": _ref5 => {
105
89
  let [_key, val] = _ref5;
106
- return ['padding-right', val];
90
+ return ["padding-right", val];
107
91
  },
108
- // 'padding-inline-start': ([key, val]: [string, string]) => ['padding-right', val],
109
- 'padding-end': _ref6 => {
92
+ "padding-end": _ref6 => {
110
93
  let [_key, val] = _ref6;
111
- return ['padding-left', val];
94
+ return ["padding-left", val];
112
95
  },
113
- // 'padding-inline-end': ([_key, val]: [string, string]) => ['padding-left', val],
114
- 'border-start': _ref7 => {
96
+ "border-start": _ref7 => {
115
97
  let [_key, val] = _ref7;
116
- return ['border-right', val];
98
+ return ["border-right", val];
117
99
  },
118
- // 'border-inline-start': ([_key, val]: [string, string]) => ['border-right', val],
119
- 'border-end': _ref8 => {
100
+ "border-end": _ref8 => {
120
101
  let [_key, val] = _ref8;
121
- return ['border-left', val];
102
+ return ["border-left", val];
122
103
  },
123
- // 'border-inline-end': ([_key, val]: [string, string]) => ['border-left', val],
124
- 'border-start-width': _ref9 => {
104
+ "border-start-width": _ref9 => {
125
105
  let [_key, val] = _ref9;
126
- return ['border-right-width', val];
106
+ return ["border-right-width", val];
127
107
  },
128
- // 'border-inline-start-width': ([_key, val]: [string, string]) => ['border-right-width', val],
129
- 'border-end-width': _ref10 => {
108
+ "border-end-width": _ref10 => {
130
109
  let [_key, val] = _ref10;
131
- return ['border-left-width', val];
110
+ return ["border-left-width", val];
132
111
  },
133
- // 'border-inline-end-width': ([_key, val]: [string, string]) => ['border-left-width', val],
134
- 'border-start-color': _ref11 => {
112
+ "border-start-color": _ref11 => {
135
113
  let [_key, val] = _ref11;
136
- return ['border-right-color', val];
114
+ return ["border-right-color", val];
137
115
  },
138
- // 'border-inline-start-color': ([_key, val]: [string, string]) => ['border-right-color', val],
139
- 'border-end-color': _ref12 => {
116
+ "border-end-color": _ref12 => {
140
117
  let [_key, val] = _ref12;
141
- return ['border-left-color', val];
118
+ return ["border-left-color", val];
142
119
  },
143
- // 'border-inline-end-color': ([_key, val]: [string, string]) => ['border-left-color', val],
144
- 'border-start-style': _ref13 => {
120
+ "border-start-style": _ref13 => {
145
121
  let [_key, val] = _ref13;
146
- return ['border-right-style', val];
122
+ return ["border-right-style", val];
147
123
  },
148
- // 'border-inline-start-style': ([_key, val]: [string, string]) => ['border-right-style', val],
149
- 'border-end-style': _ref14 => {
124
+ "border-end-style": _ref14 => {
150
125
  let [_key, val] = _ref14;
151
- return ['border-left-style', val];
126
+ return ["border-left-style", val];
152
127
  },
153
- // 'border-inline-end-style': ([_key, val]: [string, string]) => ['border-left-style', val],
154
- 'border-top-start-radius': _ref15 => {
128
+ "border-top-start-radius": _ref15 => {
155
129
  let [_key, val] = _ref15;
156
- return ['border-top-right-radius', val];
130
+ return ["border-top-right-radius", val];
157
131
  },
158
- // 'border-start-start-radius': ([_key, val]: [string, string]) => ['border-top-right-radius', val],
159
- 'border-bottom-start-radius': _ref16 => {
132
+ "border-bottom-start-radius": _ref16 => {
160
133
  let [_key, val] = _ref16;
161
- return ['border-bottom-right-radius', val];
134
+ return ["border-bottom-right-radius", val];
162
135
  },
163
- // 'border-end-start-radius': ([_key, val]: [string, string]) => ['border-bottom-right-radius', val],
164
- 'border-top-end-radius': _ref17 => {
136
+ "border-top-end-radius": _ref17 => {
165
137
  let [_key, val] = _ref17;
166
- return ['border-top-left-radius', val];
138
+ return ["border-top-left-radius", val];
167
139
  },
168
- // 'border-start-end-radius': ([_key, val]: [string, string]) => ['border-top-left-radius', val],
169
- 'border-bottom-end-radius': _ref18 => {
140
+ "border-bottom-end-radius": _ref18 => {
170
141
  let [_key, val] = _ref18;
171
- return ['border-bottom-left-radius', val];
142
+ return ["border-bottom-left-radius", val];
172
143
  },
173
- // 'border-end-end-radius': ([key, val]: [string, string]) => ['border-bottom-left-radius', val],
174
- 'text-align': _ref19 => {
144
+ "text-align": _ref19 => {
175
145
  let [key, val] = _ref19;
176
146
  return logicalToPhysical[val] != null ? [key, logicalToPhysical[val]] : null;
177
147
  },
@@ -185,21 +155,19 @@ const propertyToRTL = {
185
155
  },
186
156
  start: _ref22 => {
187
157
  let [_key, val] = _ref22;
188
- return ['right', val];
158
+ return ["right", val];
189
159
  },
190
- // 'inset-inline-start': ([key, val]: [string, string]) => ['right', val],
191
160
  end: _ref23 => {
192
161
  let [_key, val] = _ref23;
193
- return ['left', val];
162
+ return ["left", val];
194
163
  },
195
- // 'inset-inline-end': ([key, val]: [string, string]) => ['left', val],
196
- 'background-position': _ref24 => {
164
+ "background-position": _ref24 => {
197
165
  let [key, val] = _ref24;
198
- const words = val.split(' ');
199
- if (!words.includes('start') && !words.includes('end')) {
166
+ const words = val.split(" ");
167
+ if (!words.includes("start") && !words.includes("end")) {
200
168
  return null;
201
169
  }
202
- return [key, words.map(word => word === 'start' ? 'right' : word === 'end' ? 'left' : word).join(' ')];
170
+ return [key, words.map(word => word === "start" ? "right" : word === "end" ? "left" : word).join(" ")];
203
171
  },
204
172
  cursor: _ref25 => {
205
173
  let [key, val] = _ref25;
@@ -5,9 +5,8 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  * @flow strict
8
- *
9
8
  */
10
9
 
11
10
  declare export default function generateRTL(
12
- [string, string]
11
+ [string, string],
13
12
  ): ?[string, string];
@@ -12,7 +12,7 @@ import type { IncludedStyles } from '../stylex-include';
12
12
  export type ComputedStyle = null | Readonly<[string, InjectableStyle]>;
13
13
  export interface IPreRule {
14
14
  compiled(
15
- options: StyleXOptions
15
+ options: StyleXOptions,
16
16
  ): IncludedStyles | ReadonlyArray<ComputedStyle>;
17
17
  equals(other: IPreRule): boolean;
18
18
  }
@@ -36,7 +36,7 @@ export declare class PreRule implements IPreRule {
36
36
  property: string,
37
37
  value: string | number | ReadonlyArray<string | number>,
38
38
  pseudos?: null | undefined | ReadonlyArray<string>,
39
- atRules?: null | undefined | ReadonlyArray<string>
39
+ atRules?: null | undefined | ReadonlyArray<string>,
40
40
  );
41
41
  compiled(options: StyleXOptions): ReadonlyArray<[string, InjectableStyle]>;
42
42
  equals(other: IPreRule): boolean;
@@ -45,7 +45,7 @@ export declare class PreRuleSet implements IPreRule {
45
45
  readonly rules: ReadonlyArray<PreRule | NullPreRule>;
46
46
  constructor(rules: ReadonlyArray<PreRule | NullPreRule>);
47
47
  static create(
48
- rules: ReadonlyArray<PreRule | NullPreRule | PreRuleSet>
48
+ rules: ReadonlyArray<PreRule | NullPreRule | PreRuleSet>,
49
49
  ): AnyPreRule;
50
50
  compiled(options: StyleXOptions): ReadonlyArray<ComputedStyle>;
51
51
  equals(other: IPreRule): boolean;
@@ -6,15 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.PreRuleSet = exports.PreRule = exports.PreIncludedStylesRule = exports.NullPreRule = void 0;
7
7
  var _convertToClassName = require("../convert-to-className");
8
8
  var _objectUtils = require("../utils/object-utils");
9
- /**
10
- * Copyright (c) Meta Platforms, Inc. and affiliates.
11
- *
12
- * This source code is licensed under the MIT license found in the
13
- * LICENSE file in the root directory of this source tree.
14
- *
15
- *
16
- */
17
-
18
9
  class NullPreRule {
19
10
  compiled(_options) {
20
11
  return [null];
@@ -29,23 +20,18 @@ class PreIncludedStylesRule {
29
20
  this.includedStyles = IncludedStyles;
30
21
  }
31
22
  equals(other) {
32
- return other instanceof PreIncludedStylesRule &&
33
- // We can use reference equality here.
34
- this.includedStyles === other.includedStyles;
23
+ return other instanceof PreIncludedStylesRule && this.includedStyles === other.includedStyles;
35
24
  }
36
25
  compiled(_options) {
37
26
  return this.includedStyles;
38
27
  }
39
28
  }
40
-
41
- // a comparator function that sorts strings alphabetically
42
- // but where `default` always comes first
43
29
  exports.PreIncludedStylesRule = PreIncludedStylesRule;
44
30
  const stringComparator = (a, b) => {
45
- if (a === 'default') {
31
+ if (a === "default") {
46
32
  return -1;
47
33
  }
48
- if (b === 'default') {
34
+ if (b === "default") {
49
35
  return 1;
50
36
  }
51
37
  return a.localeCompare(b);
@@ -19,7 +19,7 @@ export type ComputedStyle = null | $ReadOnly<[string, InjectableStyle]>;
19
19
  // with all the metadata needed to compile them into CSS.
20
20
  export interface IPreRule {
21
21
  compiled(
22
- options: StyleXOptions
22
+ options: StyleXOptions,
23
23
  ): IncludedStyles | $ReadOnlyArray<ComputedStyle>;
24
24
  equals(other: IPreRule): boolean;
25
25
  }
@@ -47,7 +47,7 @@ declare export class PreRule implements IPreRule {
47
47
  property: string,
48
48
  value: string | number | $ReadOnlyArray<string | number>,
49
49
  pseudos?: ?$ReadOnlyArray<string>,
50
- atRules?: ?$ReadOnlyArray<string>
50
+ atRules?: ?$ReadOnlyArray<string>,
51
51
  ): void;
52
52
  compiled(options: StyleXOptions): $ReadOnlyArray<[string, InjectableStyle]>;
53
53
  equals(other: IPreRule): boolean;
@@ -57,7 +57,7 @@ declare export class PreRuleSet implements IPreRule {
57
57
  +rules: $ReadOnlyArray<PreRule | NullPreRule>;
58
58
  constructor(rules: $ReadOnlyArray<PreRule | NullPreRule>): void;
59
59
  static create(
60
- rules: $ReadOnlyArray<PreRule | NullPreRule | PreRuleSet>
60
+ rules: $ReadOnlyArray<PreRule | NullPreRule | PreRuleSet>,
61
61
  ): AnyPreRule;
62
62
  compiled(options: StyleXOptions): $ReadOnlyArray<ComputedStyle>;
63
63
  equals(other: IPreRule): boolean;
@@ -111,7 +111,7 @@ import type { TStyleValue } from '../common-types';
111
111
  */
112
112
 
113
113
  type TReturn = ReadonlyArray<[string, TStyleValue]>;
114
- declare var shorthands: {
114
+ declare const shorthands: {
115
115
  all: (_: TStyleValue) => TReturn;
116
116
  animation: (value: TStyleValue) => Array<[string, TStyleValue]>;
117
117
  background: (value: TStyleValue) => TReturn;
@@ -202,7 +202,7 @@ declare var shorthands: {
202
202
  textEmphasis: (value: TStyleValue) => TReturn;
203
203
  transition: (value: TStyleValue) => TReturn;
204
204
  };
205
- declare var aliases: {
205
+ declare const aliases: {
206
206
  borderHorizontal: any;
207
207
  borderVertical: any;
208
208
  borderBlockStart: any;
@@ -248,6 +248,9 @@ declare var aliases: {
248
248
  start: any;
249
249
  end: any;
250
250
  };
251
- declare var expansions: Omit<shorthands, keyof (aliases | {})> &
252
- Omit<aliases, keyof ({})> & {};
253
- export default expansions;
251
+ declare const $$EXPORT_DEFAULT_DECLARATION$$: Readonly</**
252
+ * > 205 | ...typeof shorthands,
253
+ * | ^^^^^^^^^^^^^^^^^^^^ Unsupported feature: Translating "object types with complex spreads" is currently not supported.
254
+ **/
255
+ any>;
256
+ export default $$EXPORT_DEFAULT_DECLARATION$$;