@stylexjs/shared 0.11.1 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. package/lib/index.d.ts +10 -36
  2. package/lib/index.js +8 -25
  3. package/lib/index.js.flow +10 -43
  4. package/lib/utils/property-priorities.d.ts +4 -0
  5. package/lib/utils/property-priorities.js +54 -8
  6. package/lib/utils/property-priorities.js.flow +8 -0
  7. package/package.json +9 -22
  8. package/README.md +0 -81
  9. package/lib/common-types.d.ts +0 -47
  10. package/lib/common-types.js +0 -1
  11. package/lib/common-types.js.flow +0 -60
  12. package/lib/convert-to-className.d.ts +0 -20
  13. package/lib/convert-to-className.js +0 -66
  14. package/lib/convert-to-className.js.flow +0 -27
  15. package/lib/generate-css-rule.d.ts +0 -17
  16. package/lib/generate-css-rule.js +0 -25
  17. package/lib/generate-css-rule.js.flow +0 -17
  18. package/lib/hash.d.ts +0 -11
  19. package/lib/hash.js +0 -37
  20. package/lib/hash.js.flow +0 -10
  21. package/lib/messages.d.ts +0 -41
  22. package/lib/messages.js +0 -38
  23. package/lib/messages.js.flow +0 -44
  24. package/lib/physical-rtl/generate-ltr.d.ts +0 -13
  25. package/lib/physical-rtl/generate-ltr.js +0 -103
  26. package/lib/physical-rtl/generate-ltr.js.flow +0 -12
  27. package/lib/physical-rtl/generate-rtl.d.ts +0 -13
  28. package/lib/physical-rtl/generate-rtl.js +0 -177
  29. package/lib/physical-rtl/generate-rtl.js.flow +0 -12
  30. package/lib/preprocess-rules/PreRule.d.ts +0 -50
  31. package/lib/preprocess-rules/PreRule.js +0 -76
  32. package/lib/preprocess-rules/PreRule.js.flow +0 -62
  33. package/lib/preprocess-rules/application-order.d.ts +0 -183
  34. package/lib/preprocess-rules/application-order.js +0 -186
  35. package/lib/preprocess-rules/application-order.js.flow +0 -134
  36. package/lib/preprocess-rules/basic-validation.d.ts +0 -13
  37. package/lib/preprocess-rules/basic-validation.js +0 -73
  38. package/lib/preprocess-rules/basic-validation.js.flow +0 -13
  39. package/lib/preprocess-rules/flatten-raw-style-obj.d.ts +0 -20
  40. package/lib/preprocess-rules/flatten-raw-style-obj.js +0 -98
  41. package/lib/preprocess-rules/flatten-raw-style-obj.js.flow +0 -23
  42. package/lib/preprocess-rules/index.d.ts +0 -18
  43. package/lib/preprocess-rules/index.js +0 -33
  44. package/lib/preprocess-rules/index.js.flow +0 -22
  45. package/lib/preprocess-rules/legacy-expand-shorthands.d.ts +0 -165
  46. package/lib/preprocess-rules/legacy-expand-shorthands.js +0 -147
  47. package/lib/preprocess-rules/legacy-expand-shorthands.js.flow +0 -144
  48. package/lib/preprocess-rules/property-specificity.d.ts +0 -78
  49. package/lib/preprocess-rules/property-specificity.js +0 -107
  50. package/lib/preprocess-rules/property-specificity.js.flow +0 -87
  51. package/lib/stylex-create-theme.d.ts +0 -26
  52. package/lib/stylex-create-theme.js +0 -58
  53. package/lib/stylex-create-theme.js.flow +0 -19
  54. package/lib/stylex-create.d.ts +0 -27
  55. package/lib/stylex-create.js +0 -57
  56. package/lib/stylex-create.js.flow +0 -38
  57. package/lib/stylex-define-vars.d.ts +0 -28
  58. package/lib/stylex-define-vars.js +0 -94
  59. package/lib/stylex-define-vars.js.flow +0 -27
  60. package/lib/stylex-first-that-works.d.ts +0 -13
  61. package/lib/stylex-first-that-works.js +0 -26
  62. package/lib/stylex-first-that-works.js.flow +0 -12
  63. package/lib/stylex-include.d.ts +0 -18
  64. package/lib/stylex-include.js +0 -28
  65. package/lib/stylex-include.js.flow +0 -20
  66. package/lib/stylex-keyframes.d.ts +0 -17
  67. package/lib/stylex-keyframes.js +0 -55
  68. package/lib/stylex-keyframes.js.flow +0 -20
  69. package/lib/stylex-vars-utils.d.ts +0 -27
  70. package/lib/stylex-vars-utils.js +0 -69
  71. package/lib/stylex-vars-utils.js.flow +0 -31
  72. package/lib/transform-value.d.ts +0 -22
  73. package/lib/transform-value.js +0 -50
  74. package/lib/transform-value.js.flow +0 -25
  75. package/lib/types/index.d.ts +0 -240
  76. package/lib/types/index.js +0 -147
  77. package/lib/types/index.js.flow +0 -280
  78. package/lib/utils/Rule.d.ts +0 -58
  79. package/lib/utils/Rule.js +0 -50
  80. package/lib/utils/Rule.js.flow +0 -64
  81. package/lib/utils/dashify.d.ts +0 -11
  82. package/lib/utils/dashify.js +0 -9
  83. package/lib/utils/dashify.js.flow +0 -10
  84. package/lib/utils/default-options.d.ts +0 -11
  85. package/lib/utils/default-options.js +0 -15
  86. package/lib/utils/default-options.js.flow +0 -12
  87. package/lib/utils/file-based-identifier.d.ts +0 -15
  88. package/lib/utils/file-based-identifier.js +0 -14
  89. package/lib/utils/file-based-identifier.js.flow +0 -14
  90. package/lib/utils/genCSSRule.d.ts +0 -15
  91. package/lib/utils/genCSSRule.js +0 -15
  92. package/lib/utils/genCSSRule.js.flow +0 -15
  93. package/lib/utils/normalize-value.d.ts +0 -16
  94. package/lib/utils/normalize-value.js +0 -28
  95. package/lib/utils/normalize-value.js.flow +0 -16
  96. package/lib/utils/normalizers/convert-camel-case-values.d.ts +0 -14
  97. package/lib/utils/normalizers/convert-camel-case-values.js +0 -23
  98. package/lib/utils/normalizers/convert-camel-case-values.js.flow +0 -13
  99. package/lib/utils/normalizers/detect-unclosed-fns.d.ts +0 -17
  100. package/lib/utils/normalizers/detect-unclosed-fns.js +0 -17
  101. package/lib/utils/normalizers/detect-unclosed-fns.js.flow +0 -16
  102. package/lib/utils/normalizers/font-size-px-to-rem.d.ts +0 -19
  103. package/lib/utils/normalizers/font-size-px-to-rem.js +0 -24
  104. package/lib/utils/normalizers/font-size-px-to-rem.js.flow +0 -18
  105. package/lib/utils/normalizers/leading-zero.d.ts +0 -17
  106. package/lib/utils/normalizers/leading-zero.js +0 -24
  107. package/lib/utils/normalizers/leading-zero.js.flow +0 -16
  108. package/lib/utils/normalizers/quotes.d.ts +0 -18
  109. package/lib/utils/normalizers/quotes.js +0 -17
  110. package/lib/utils/normalizers/quotes.js.flow +0 -17
  111. package/lib/utils/normalizers/timings.d.ts +0 -18
  112. package/lib/utils/normalizers/timings.js +0 -25
  113. package/lib/utils/normalizers/timings.js.flow +0 -17
  114. package/lib/utils/normalizers/whitespace.d.ts +0 -19
  115. package/lib/utils/normalizers/whitespace.js +0 -54
  116. package/lib/utils/normalizers/whitespace.js.flow +0 -18
  117. package/lib/utils/normalizers/zero-dimensions.d.ts +0 -19
  118. package/lib/utils/normalizers/zero-dimensions.js +0 -42
  119. package/lib/utils/normalizers/zero-dimensions.js.flow +0 -18
  120. package/lib/utils/object-utils.d.ts +0 -66
  121. package/lib/utils/object-utils.js +0 -99
  122. package/lib/utils/object-utils.js.flow +0 -78
  123. package/lib/utils/rule-utils.d.ts +0 -15
  124. package/lib/utils/rule-utils.js +0 -41
  125. package/lib/utils/rule-utils.js.flow +0 -16
  126. package/lib/utils/split-css-value.d.ts +0 -14
  127. package/lib/utils/split-css-value.js +0 -33
  128. package/lib/utils/split-css-value.js.flow +0 -15
  129. package/lib/validate.d.ts +0 -12
  130. package/lib/validate.js +0 -21
  131. package/lib/validate.js.flow +0 -12
@@ -1,76 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.PreRuleSet = exports.PreRule = exports.NullPreRule = void 0;
7
- var _convertToClassName = require("../convert-to-className");
8
- var _objectUtils = require("../utils/object-utils");
9
- var _ruleUtils = require("../utils/rule-utils");
10
- class NullPreRule {
11
- compiled(_options) {
12
- return [null];
13
- }
14
- equals(other) {
15
- return other instanceof NullPreRule;
16
- }
17
- }
18
- exports.NullPreRule = NullPreRule;
19
- class PreRule {
20
- constructor(property, value, keyPath) {
21
- this.property = property;
22
- this.keyPath = keyPath ?? [];
23
- this.value = value;
24
- }
25
- get pseudos() {
26
- const unsortedPseudos = this.keyPath.filter(key => key.startsWith(':'));
27
- return (0, _ruleUtils.sortPseudos)(unsortedPseudos);
28
- }
29
- get atRules() {
30
- const unsortedAtRules = this.keyPath.filter(key => key.startsWith('@'));
31
- return (0, _ruleUtils.sortAtRules)(unsortedAtRules);
32
- }
33
- compiled(options) {
34
- const [_key, className, rule] = (0, _convertToClassName.convertStyleToClassName)([this.property, this.value], this.pseudos ?? [], this.atRules ?? [], options);
35
- return [[className, rule, {
36
- [className]: this.keyPath
37
- }]];
38
- }
39
- equals(other) {
40
- if (!(other instanceof PreRule)) {
41
- return false;
42
- }
43
- const valuesEqual = Array.isArray(this.value) && Array.isArray(other.value) ? (0, _objectUtils.arrayEquals)(this.value, other.value) : this.value === other.value;
44
- return this.property === other.property && valuesEqual && (0, _objectUtils.arrayEquals)(this.pseudos, other.pseudos) && (0, _objectUtils.arrayEquals)(this.atRules, other.atRules);
45
- }
46
- }
47
- exports.PreRule = PreRule;
48
- class PreRuleSet {
49
- constructor(rules) {
50
- this.rules = rules;
51
- }
52
- static create(rules) {
53
- const flatRules = rules.flatMap(rule => rule instanceof PreRuleSet ? rule.rules : [rule]);
54
- if (flatRules.length === 0) {
55
- return new NullPreRule();
56
- }
57
- if (flatRules.length === 1) {
58
- return flatRules[0];
59
- }
60
- return new PreRuleSet(flatRules);
61
- }
62
- compiled(options) {
63
- const styleTuple = this.rules.flatMap(rule => rule.compiled(options)).filter(Boolean);
64
- return styleTuple.length > 0 ? styleTuple : [null];
65
- }
66
- equals(other) {
67
- if (!(other instanceof PreRuleSet)) {
68
- return false;
69
- }
70
- if (this.rules.length !== other.rules.length) {
71
- return false;
72
- }
73
- return (0, _objectUtils.arrayEquals)(this.rules, other.rules, (a, b) => a.equals(b));
74
- }
75
- }
76
- exports.PreRuleSet = PreRuleSet;
@@ -1,62 +0,0 @@
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 type { InjectableStyle, StyleXOptions } from '../common-types';
11
-
12
- export type ClassesToOriginalPaths = {
13
- +[className: string]: $ReadOnlyArray<string>,
14
- };
15
-
16
- export type ComputedStyle = null | $ReadOnly<
17
- [string, InjectableStyle, ClassesToOriginalPaths],
18
- >;
19
-
20
- // The classes in this file are used to represent objects that
21
- // can be compiled into one or CSS rules.
22
- //
23
- // These are thin wrappers around the "values" in Raw Style Objects
24
- // with all the metadata needed to compile them into CSS.
25
- export interface IPreRule {
26
- compiled(options: StyleXOptions): $ReadOnlyArray<ComputedStyle>;
27
- equals(other: IPreRule): boolean;
28
- }
29
-
30
- export type AnyPreRule = NullPreRule | PreRule | PreRuleSet;
31
-
32
- declare export class NullPreRule implements IPreRule {
33
- compiled(_options: StyleXOptions): [null];
34
- equals(other: IPreRule): boolean;
35
- }
36
-
37
- declare export class PreRule implements IPreRule {
38
- +property: string;
39
- +value: string | number | $ReadOnlyArray<string | number>;
40
- +keyPath: $ReadOnlyArray<string>;
41
- constructor(
42
- property: string,
43
- value: string | number | $ReadOnlyArray<string | number>,
44
- keyPath?: $ReadOnlyArray<string>,
45
- ): void;
46
- get pseudos(): $ReadOnlyArray<string>;
47
- get atRules(): $ReadOnlyArray<string>;
48
- compiled(
49
- options: StyleXOptions,
50
- ): $ReadOnlyArray<[string, InjectableStyle, ClassesToOriginalPaths]>;
51
- equals(other: IPreRule): boolean;
52
- }
53
-
54
- declare export class PreRuleSet implements IPreRule {
55
- +rules: $ReadOnlyArray<PreRule | NullPreRule>;
56
- constructor(rules: $ReadOnlyArray<PreRule | NullPreRule>): void;
57
- static create(
58
- rules: $ReadOnlyArray<PreRule | NullPreRule | PreRuleSet>,
59
- ): AnyPreRule;
60
- compiled(options: StyleXOptions): $ReadOnlyArray<ComputedStyle>;
61
- equals(other: IPreRule): boolean;
62
- }
@@ -1,183 +0,0 @@
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 type { TStyleValue } from '../common-types';
11
- /**
12
- * Shorthand properties:
13
- * - [x] all - Should be banned
14
- * - [x] animation
15
- * - [x] background
16
- * - [x] border
17
- * - [x] border-block-end
18
- * - [x] border-block-start
19
- * - [x] border-bottom
20
- * - [x] border-color
21
- * - [x] border-image
22
- * - [x] border-inline-end
23
- * - [x] border-inline-start
24
- * - [x] border-left
25
- * - [x] border-radius
26
- * - [x] border-right
27
- * - [x] border-style
28
- * - [x] border-top
29
- * - [x] border-width
30
- * - [x] column-rule
31
- * - [x] columns
32
- * - [x] container
33
- * - [x] flex
34
- * - [x] flex-flow
35
- * - [x] font
36
- * - [x] gap
37
- * - [x] grid
38
- * - [x] grid-area
39
- * - [x] grid-column
40
- * - [x] grid-row
41
- * - [x] grid-template
42
- * - [x] inset
43
- * - [x] inset-block
44
- * - [x] inset-inline
45
- * - [x] list-style
46
- * - [x] margin
47
- * - [x] mask
48
- * - [x] offset
49
- * - [x] outline
50
- * - [x] overflow
51
- * - [x] padding
52
- * - [x] place-content
53
- * - [x] place-items
54
- * - [x] place-self
55
- * - [x] scroll-margin
56
- * - [x] scroll-padding
57
- * - [x] text-decoration
58
- * - [x] text-emphasis
59
- * - [x] transition
60
- */
61
-
62
- /**
63
- * Shorthand properties:
64
- * - [x] all - Should be banned
65
- * - [x] animation
66
- * - [x] background
67
- * - [x] border
68
- * - [x] border-block-end
69
- * - [x] border-block-start
70
- * - [x] border-bottom
71
- * - [x] border-color
72
- * - [x] border-image
73
- * - [x] border-inline-end
74
- * - [x] border-inline-start
75
- * - [x] border-left
76
- * - [x] border-radius
77
- * - [x] border-right
78
- * - [x] border-style
79
- * - [x] border-top
80
- * - [x] border-width
81
- * - [x] column-rule
82
- * - [x] columns
83
- * - [x] container
84
- * - [x] flex
85
- * - [x] flex-flow
86
- * - [x] font
87
- * - [x] gap
88
- * - [x] grid
89
- * - [x] grid-area
90
- * - [x] grid-column
91
- * - [x] grid-row
92
- * - [x] grid-template
93
- * - [x] inset
94
- * - [x] inset-block
95
- * - [x] inset-inline
96
- * - [x] list-style
97
- * - [x] margin
98
- * - [x] mask
99
- * - [x] offset
100
- * - [x] outline
101
- * - [x] overflow
102
- * - [x] padding
103
- * - [x] place-content
104
- * - [x] place-items
105
- * - [x] place-self
106
- * - [x] scroll-margin
107
- * - [x] scroll-padding
108
- * - [x] text-decoration
109
- * - [x] text-emphasis
110
- * - [x] transition
111
- */
112
-
113
- type TReturn = ReadonlyArray<[string, TStyleValue]>;
114
- declare const shorthands: Readonly<{
115
- [key: string]: ($$PARAM_0$$: TStyleValue) => TReturn;
116
- }>;
117
- declare const aliases: {
118
- borderHorizontal: any;
119
- borderVertical: any;
120
- borderBlockStart: any;
121
- borderEnd: any;
122
- borderBlockEnd: any;
123
- borderStart: any;
124
- blockSize: (val: TStyleValue) => TReturn;
125
- inlineSize: (val: TStyleValue) => TReturn;
126
- minBlockSize: (val: TStyleValue) => TReturn;
127
- minInlineSize: (val: TStyleValue) => TReturn;
128
- maxBlockSize: (val: TStyleValue) => TReturn;
129
- maxInlineSize: (val: TStyleValue) => TReturn;
130
- borderHorizontalWidth: any;
131
- borderHorizontalStyle: any;
132
- borderHorizontalColor: any;
133
- borderVerticalWidth: any;
134
- borderVerticalStyle: any;
135
- borderVerticalColor: any;
136
- borderBlockStartColor: (value: TStyleValue) => TReturn;
137
- borderBlockEndColor: (value: TStyleValue) => TReturn;
138
- borderBlockStartStyle: (value: TStyleValue) => TReturn;
139
- borderBlockEndStyle: (value: TStyleValue) => TReturn;
140
- borderBlockStartWidth: (value: TStyleValue) => TReturn;
141
- borderBlockEndWidth: (value: TStyleValue) => TReturn;
142
- borderStartColor: any;
143
- borderEndColor: any;
144
- borderStartStyle: any;
145
- borderEndStyle: any;
146
- borderStartWidth: any;
147
- borderEndWidth: any;
148
- borderTopStartRadius: (value: TStyleValue) => TReturn;
149
- borderTopEndRadius: (value: TStyleValue) => TReturn;
150
- borderBottomStartRadius: (value: TStyleValue) => TReturn;
151
- borderBottomEndRadius: (value: TStyleValue) => TReturn;
152
- containIntrinsicBlockSize: (value: TStyleValue) => TReturn;
153
- containIntrinsicInlineSize: (value: TStyleValue) => TReturn;
154
- gridGap: any;
155
- gridRowGap: (value: TStyleValue) => TReturn;
156
- gridColumnGap: (value: TStyleValue) => TReturn;
157
- marginBlockStart: (value: TStyleValue) => TReturn;
158
- marginBlockEnd: (value: TStyleValue) => TReturn;
159
- marginStart: any;
160
- marginEnd: any;
161
- marginHorizontal: any;
162
- marginVertical: any;
163
- overflowBlock: (value: TStyleValue) => TReturn;
164
- overflowInline: (value: TStyleValue) => TReturn;
165
- paddingBlockStart: (rawValue: TStyleValue) => TReturn;
166
- paddingBlockEnd: (rawValue: TStyleValue) => TReturn;
167
- paddingStart: any;
168
- paddingEnd: any;
169
- paddingHorizontal: any;
170
- paddingVertical: any;
171
- scrollMarginBlockStart: (value: TStyleValue) => TReturn;
172
- scrollMarginBlockEnd: (value: TStyleValue) => TReturn;
173
- insetBlockStart: (value: TStyleValue) => TReturn;
174
- insetBlockEnd: (value: TStyleValue) => TReturn;
175
- start: any;
176
- end: any;
177
- };
178
- declare const $$EXPORT_DEFAULT_DECLARATION$$: Readonly</**
179
- * > 132 | ...typeof shorthands,
180
- * | ^^^^^^^^^^^^^^^^^^^^ Unsupported feature: Translating "object types with complex spreads" is currently not supported.
181
- **/
182
- any>;
183
- export default $$EXPORT_DEFAULT_DECLARATION$$;
@@ -1,186 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- const shorthands = {
8
- all: _ => {
9
- throw new Error('all is not supported');
10
- },
11
- animation: value => [['animation', value], ['animationComposition', null], ['animationName', null], ['animationDuration', null], ['animationTimingFunction', null], ['animationDelay', null], ['animationIterationCount', null], ['animationDirection', null], ['animationFillMode', null], ['animationPlayState', null], ...shorthands.animationRange(null), ['animationTimeline', null]],
12
- animationRange: value => [['animationRange', value], ['animationRangeEnd', null], ['animationRangeStart', null]],
13
- background: value => [['background', value], ['backgroundAttachment', null], ['backgroundClip', null], ['backgroundColor', null], ['backgroundImage', null], ['backgroundOrigin', null], ...shorthands.backgroundPosition(null), ['backgroundRepeat', null], ['backgroundSize', null]],
14
- backgroundPosition: value => [['backgroundPosition', value], ['backgroundPositionX', null], ['backgroundPositionY', null]],
15
- border: rawValue => [['border', rawValue], ...shorthands.borderWidth(null), ...shorthands.borderStyle(null), ...shorthands.borderColor(null)],
16
- borderInline: rawValue => [['borderInline', rawValue], ...shorthands.borderInlineWidth(null), ...shorthands.borderInlineStyle(null), ...shorthands.borderInlineColor(null)],
17
- borderBlock: rawValue => [['borderBlock', rawValue], ...shorthands.borderBlockWidth(null), ...shorthands.borderBlockStyle(null), ...shorthands.borderBlockColor(null)],
18
- borderTop: rawValue => [['borderTop', rawValue], ['borderTopWidth', null], ['borderTopStyle', null], ['borderTopColor', null]],
19
- borderInlineEnd: rawValue => [['borderInlineEnd', rawValue], ...shorthands.borderInlineEndWidth(null), ...shorthands.borderInlineEndStyle(null), ...shorthands.borderInlineEndColor(null)],
20
- borderRight: rawValue => [['borderRight', rawValue], ...shorthands.borderRightWidth(null), ...shorthands.borderRightStyle(null), ...shorthands.borderRightColor(null)],
21
- borderBottom: rawValue => [['borderBottom', rawValue], ['borderBottomWidth', null], ['borderBottomStyle', null], ['borderBottomColor', null]],
22
- borderInlineStart: rawValue => [['borderInlineStart', rawValue], ...shorthands.borderInlineStartWidth(null), ...shorthands.borderInlineStartStyle(null), ...shorthands.borderInlineStartColor(null)],
23
- borderLeft: rawValue => [['borderLeft', rawValue], ...shorthands.borderLeftWidth(null), ...shorthands.borderLeftStyle(null), ...shorthands.borderLeftColor(null)],
24
- borderInlineWidth: rawValue => [['borderInlineWidth', rawValue], ['borderInlineStartWidth', null], ['borderLeftWidth', null], ['borderInlineEndWidth', null], ['borderRightWidth', null]],
25
- borderInlineStyle: rawValue => [['borderInlineStyle', rawValue], ['borderInlineStartStyle', null], ['borderLeftStyle', null], ['borderInlineEndStyle', null], ['borderRightStyle', null]],
26
- borderInlineColor: rawValue => [['borderInlineColor', rawValue], ['borderInlineStartColor', null], ['borderLeftColor', null], ['borderInlineEndColor', null], ['borderRightColor', null]],
27
- borderBlockWidth: rawValue => [['borderBlockWidth', rawValue], ['borderTopWidth', null], ['borderBottomWidth', null]],
28
- borderBlockStyle: rawValue => [['borderBlockStyle', rawValue], ['borderTopStyle', null], ['borderBottomStyle', null]],
29
- borderBlockColor: rawValue => [['borderBlockColor', rawValue], ['borderTopColor', null], ['borderBottomColor', null]],
30
- borderColor: value => [['borderColor', value], ...shorthands.borderInlineColor(null), ...shorthands.borderBlockColor(null)],
31
- borderStyle: value => [['borderStyle', value], ...shorthands.borderInlineStyle(null), ...shorthands.borderBlockStyle(null)],
32
- borderWidth: value => [['borderWidth', value], ...shorthands.borderInlineWidth(null), ...shorthands.borderBlockWidth(null)],
33
- borderInlineStartColor: value => [['borderInlineStartColor', value], ['borderLeftColor', null], ['borderRightColor', null]],
34
- borderInlineEndColor: value => [['borderInlineEndColor', value], ['borderLeftColor', null], ['borderRightColor', null]],
35
- borderInlineStartStyle: value => [['borderInlineStartStyle', value], ['borderLeftStyle', null], ['borderRightStyle', null]],
36
- borderInlineEndStyle: value => [['borderInlineEndStyle', value], ['borderLeftStyle', null], ['borderRightStyle', null]],
37
- borderInlineStartWidth: value => [['borderInlineStartWidth', value], ['borderLeftWidth', null], ['borderRightWidth', null]],
38
- borderInlineEndWidth: value => [['borderInlineEndWidth', value], ['borderLeftWidth', null], ['borderRightWidth', null]],
39
- borderLeftColor: value => [['borderLeftColor', value], ['borderInlineStartColor', null], ['borderInlineEndColor', null]],
40
- borderRightColor: value => [['borderRightColor', value], ['borderInlineStartColor', null], ['borderInlineEndColor', null]],
41
- borderLeftStyle: value => [['borderLeftStyle', value], ['borderInlineStartStyle', null], ['borderInlineEndStyle', null]],
42
- borderRightStyle: value => [['borderRightStyle', value], ['borderInlineStartStyle', null], ['borderInlineEndStyle', null]],
43
- borderLeftWidth: value => [['borderLeftWidth', value], ['borderInlineStartWidth', null], ['borderInlineEndWidth', null]],
44
- borderRightWidth: value => [['borderRightWidth', value], ['borderInlineStartWidth', null], ['borderInlineEndWidth', null]],
45
- borderRadius: value => [['borderRadius', value], ['borderStartStartRadius', null], ['borderStartEndRadius', null], ['borderEndStartRadius', null], ['borderEndEndRadius', null], ['borderTopLeftRadius', null], ['borderTopRightRadius', null], ['borderBottomLeftRadius', null], ['borderBottomRightRadius', null]],
46
- borderStartStartRadius: value => [['borderStartStartRadius', value], ['borderTopLeftRadius', null], ['borderTopRightRadius', null]],
47
- borderStartEndRadius: value => [['borderStartEndRadius', value], ['borderTopLeftRadius', null], ['borderTopRightRadius', null]],
48
- borderEndStartRadius: value => [['borderEndStartRadius', value], ['borderBottomLeftRadius', null], ['borderBottomRightRadius', null]],
49
- borderEndEndRadius: value => [['borderEndEndRadius', value], ['borderBottomLeftRadius', null], ['borderBottomRightRadius', null]],
50
- borderTopLeftRadius: value => [['borderTopLeftRadius', value], ['borderStartStartRadius', null], ['borderStartEndRadius', null]],
51
- borderTopRightRadius: value => [['borderTopRightRadius', value], ['borderStartStartRadius', null], ['borderStartEndRadius', null]],
52
- borderBottomLeftRadius: value => [['borderBottomLeftRadius', value], ['borderEndStartRadius', null], ['borderEndEndRadius', null]],
53
- borderBottomRightRadius: value => [['borderBottomRightRadius', value], ['borderEndStartRadius', null], ['borderEndEndRadius', null]],
54
- borderImage: value => [['borderImage', value], ['borderImageOutset', null], ['borderImageRepeat', null], ['borderImageSlice', null], ['borderImageSource', null], ['borderImageWidth', null]],
55
- columnRule: value => [['columnRule', value], ['columnRuleColor', null], ['columnRuleStyle', null], ['columnRuleWidth', null]],
56
- columns: value => [['columns', value], ['columnCount', null], ['columnWidth', null]],
57
- container: value => [['container', value], ['containerName', null], ['containerType', null]],
58
- containIntrinsicSize: value => [['containIntrinsicSize', value], ['containIntrinsicWidth', null], ['containIntrinsicHeight', null]],
59
- flex: value => [['flex', value], ['flexGrow', null], ['flexShrink', null], ['flexBasis', null]],
60
- flexFlow: value => [['flexFlow', value], ['flexDirection', null], ['flexWrap', null]],
61
- font: value => [['font', value], ['fontFamily', null], ['fontSize', null], ['fontStretch', null], ['fontStyle', null], ...shorthands.fontVariant(null), ['fontWeight', null], ['lineHeight', null]],
62
- fontVariant: value => [['fontVariant', value], ['fontVariantAlternates', null], ['fontVariantCaps', null], ['fontVariantEastAsian', null], ['fontVariantEmoji', null], ['fontVariantLigatures', null], ['fontVariantNumeric', null], ['fontVariantPosition', null]],
63
- gap: value => [['gap', value], ['rowGap', null], ['columnGap', null]],
64
- grid: value => [['grid', value], ...shorthands.gridTemplate(null), ['gridAutoRows', null], ['gridAutoColumns', null], ['gridAutoFlow', null]],
65
- gridArea: value => [['gridArea', value], ['gridRow', null], ['gridRowStart', null], ['gridRowEnd', null], ['gridColumn', null], ['gridColumnStart', null], ['gridColumnEnd', null]],
66
- gridRow: value => [['gridRow', value], ['gridRowStart', null], ['gridRowEnd', null]],
67
- gridColumn: value => [['gridColumn', value], ['gridColumnStart', null], ['gridColumnEnd', null]],
68
- gridTemplate: value => [['gridTemplate', value], ['gridTemplateAreas', null], ['gridTemplateColumns', null], ['gridTemplateRows', null]],
69
- inset: value => [['inset', value], ...shorthands.insetInline(null), ...shorthands.insetBlock(null)],
70
- insetInline: value => [['insetInline', value], ['insetInlineStart', null], ['insetInlineEnd', null], ['left', null], ['right', null]],
71
- insetBlock: value => [['insetBlock', value], ['top', null], ['bottom', null]],
72
- insetInlineStart: value => [['insetInlineStart', value], ['left', null], ['right', null]],
73
- insetInlineEnd: value => [['insetInlineEnd', value], ['left', null], ['right', null]],
74
- left: value => [['left', value], ['insetInlineStart', null], ['insetInlineEnd', null]],
75
- right: value => [['right', value], ['insetInlineStart', null], ['insetInlineEnd', null]],
76
- listStyle: value => [['listStyle', value], ['listStyleImage', null], ['listStylePosition', null], ['listStyleType', null]],
77
- margin: value => [['margin', value], ...shorthands.marginInline(null), ...shorthands.marginBlock(null)],
78
- marginInline: value => [['marginInline', value], ['marginInlineStart', null], ['marginLeft', null], ['marginInlineEnd', null], ['marginRight', null]],
79
- marginBlock: value => [['marginBlock', value], ['marginTop', null], ['marginBottom', null]],
80
- marginInlineStart: value => [['marginInlineStart', value], ['marginLeft', null], ['marginRight', null]],
81
- marginInlineEnd: value => [['marginInlineEnd', value], ['marginLeft', null], ['marginRight', null]],
82
- marginLeft: value => [['marginLeft', value], ['marginInlineStart', null], ['marginInlineEnd', null]],
83
- marginRight: value => [['marginRight', value], ['marginInlineStart', null], ['marginInlineEnd', null]],
84
- mask: value => [['mask', value], ['maskClip', null], ['maskComposite', null], ['maskImage', null], ['maskMode', null], ['maskOrigin', null], ['maskPosition', null], ['maskRepeat', null], ['maskSize', null]],
85
- maskBorder: value => [['maskBorder', value], ['maskBorderMode', null], ['maskBorderOutset', null], ['maskBorderRepeat', null], ['maskBorderSlice', null], ['maskBorderSource', null], ['maskBorderWidth', null]],
86
- offset: value => [['offset', value], ['offsetAnchor', null], ['offsetDistance', null], ['offsetPath', null], ['offsetPosition', null], ['offsetRotate', null]],
87
- outline: value => [['outline', value], ['outlineColor', null], ['outlineOffset', null], ['outlineStyle', null], ['outlineWidth', null]],
88
- overflow: value => [['overflow', value], ['overflowX', null], ['overflowY', null]],
89
- padding: rawValue => {
90
- return [['padding', rawValue], ...shorthands.paddingInline(null), ...shorthands.paddingBlock(null)];
91
- },
92
- paddingInline: rawValue => [['paddingInline', rawValue], ['paddingStart', null], ['paddingLeft', null], ['paddingEnd', null], ['paddingRight', null]],
93
- paddingBlock: rawValue => [['paddingBlock', rawValue], ['paddingTop', null], ['paddingBottom', null]],
94
- paddingInlineStart: value => [['paddingInlineStart', value], ['paddingLeft', null], ['paddingRight', null]],
95
- paddingInlineEnd: value => [['paddingInlineEnd', value], ['paddingLeft', null], ['paddingRight', null]],
96
- paddingLeft: value => [['paddingLeft', value], ['paddingInlineStart', null], ['paddingInlineEnd', null]],
97
- paddingRight: value => [['paddingRight', value], ['paddingInlineStart', null], ['paddingInlineEnd', null]],
98
- placeContent: value => [['placeContent', value], ['alignContent', null], ['justifyContent', null]],
99
- placeItems: value => [['placeItems', value], ['alignItems', null], ['justifyItems', null]],
100
- placeSelf: value => [['placeSelf', value], ['alignSelf', null], ['justifySelf', null]],
101
- scrollMargin: value => [['scrollMargin', value], ...shorthands.scrollMarginBlock(null), ...shorthands.scrollMarginInline(null)],
102
- scrollMarginBlock: value => [['scrollMarginBlock', value], ['scrollMarginTop', null], ['scrollMarginBottom', null]],
103
- scrollMarginInline: value => [['scrollMarginInline', value], ['scrollMarginInlineStart', null], ['scrollMarginInlineEnd', null], ['scrollMarginLeft', null], ['scrollMarginRight', null]],
104
- scrollMarginInlineStart: value => [['scrollMarginInlineStart', value], ['scrollMarginLeft', null], ['scrollMarginRight', null]],
105
- scrollMarginInlineEnd: value => [['scrollMarginInlineEnd', value], ['scrollMarginLeft', null], ['scrollMarginRight', null]],
106
- scrollMarginLeft: value => [['scrollMarginLeft', value], ['scrollMarginInlineStart', null], ['scrollMarginInlineEnd', null]],
107
- scrollMarginRight: value => [['scrollMarginRight', value], ['scrollMarginInlineStart', null], ['scrollMarginInlineEnd', null]],
108
- scrollPadding: value => [['scrollPadding', value], ...shorthands.scrollPaddingBlock(null), ...shorthands.scrollPaddingInline(null)],
109
- scrollPaddingBlock: value => [['scrollPaddingBlock', value], ['scrollPaddingTop', null], ['scrollPaddingBottom', null]],
110
- scrollPaddingInline: value => [['scrollPaddingInline', value], ['scrollPaddingInlineStart', null], ['scrollPaddingInlineEnd', null], ['scrollPaddingLeft', null], ['scrollPaddingRight', null]],
111
- scrollPaddingInlineStart: value => [['scrollPaddingInlineStart', value], ['scrollPaddingLeft', null], ['scrollPaddingRight', null]],
112
- scrollPaddingInlineEnd: value => [['scrollPaddingInlineEnd', value], ['scrollPaddingLeft', null], ['scrollPaddingRight', null]],
113
- scrollPaddingLeft: value => [['scrollPaddingLeft', value], ['scrollPaddingInlineStart', null], ['scrollPaddingInlineEnd', null]],
114
- scrollPaddingRight: value => [['scrollPaddingRight', value], ['scrollPaddingInlineStart', null], ['scrollPaddingInlineEnd', null]],
115
- scrollSnapType: value => [['scrollSnapType', value], ['scrollSnapTypeX', null], ['scrollSnapTypeY', null]],
116
- scrollTimeline: value => [['scrollTimeline', value], ['scrollTimelineName', null], ['scrollTimelineAxis', null]],
117
- textDecoration: value => [['textDecoration', value], ['textDecorationColor', null], ['textDecorationLine', null], ['textDecorationStyle', null], ['textDecorationThickness', null]],
118
- textEmphasis: value => [['textEmphasis', value], ['textEmphasisColor', null], ['textEmphasisStyle', null]],
119
- transition: value => [['transition', value], ['transitionBehavior', null], ['transitionDelay', null], ['transitionDuration', null], ['transitionProperty', null], ['transitionTimingFunction', null]]
120
- };
121
- const aliases = {
122
- borderHorizontal: shorthands.borderInline,
123
- borderVertical: shorthands.borderBlock,
124
- borderBlockStart: shorthands.borderTop,
125
- borderEnd: shorthands.borderInlineEnd,
126
- borderBlockEnd: shorthands.borderBottom,
127
- borderStart: shorthands.borderInlineStart,
128
- blockSize: val => [['height', val]],
129
- inlineSize: val => [['width', val]],
130
- minBlockSize: val => [['minHeight', val]],
131
- minInlineSize: val => [['minWidth', val]],
132
- maxBlockSize: val => [['maxHeight', val]],
133
- maxInlineSize: val => [['maxWidth', val]],
134
- borderHorizontalWidth: shorthands.borderInlineWidth,
135
- borderHorizontalStyle: shorthands.borderInlineStyle,
136
- borderHorizontalColor: shorthands.borderInlineColor,
137
- borderVerticalWidth: shorthands.borderBlockWidth,
138
- borderVerticalStyle: shorthands.borderBlockStyle,
139
- borderVerticalColor: shorthands.borderBlockColor,
140
- borderBlockStartColor: value => [['borderTopColor', value]],
141
- borderBlockEndColor: value => [['borderBottomColor', value]],
142
- borderBlockStartStyle: value => [['borderTopStyle', value]],
143
- borderBlockEndStyle: value => [['borderBottomStyle', value]],
144
- borderBlockStartWidth: value => [['borderTopWidth', value]],
145
- borderBlockEndWidth: value => [['borderBottomWidth', value]],
146
- borderStartColor: shorthands.borderInlineStartColor,
147
- borderEndColor: shorthands.borderInlineEndColor,
148
- borderStartStyle: shorthands.borderInlineStartStyle,
149
- borderEndStyle: shorthands.borderInlineEndStyle,
150
- borderStartWidth: shorthands.borderInlineStartWidth,
151
- borderEndWidth: shorthands.borderInlineEndWidth,
152
- borderTopStartRadius: value => [['borderStartStartRadius', value]],
153
- borderTopEndRadius: value => [['borderStartEndRadius', value]],
154
- borderBottomStartRadius: value => [['borderEndStartRadius', value]],
155
- borderBottomEndRadius: value => [['borderEndEndRadius', value]],
156
- containIntrinsicBlockSize: value => [['containIntrinsicHeight', value]],
157
- containIntrinsicInlineSize: value => [['containIntrinsicWidth', value]],
158
- gridGap: shorthands.gap,
159
- gridRowGap: value => [['rowGap', value]],
160
- gridColumnGap: value => [['columnGap', value]],
161
- marginBlockStart: value => [['marginTop', value]],
162
- marginBlockEnd: value => [['marginBottom', value]],
163
- marginStart: shorthands.marginInlineStart,
164
- marginEnd: shorthands.marginInlineEnd,
165
- marginHorizontal: shorthands.marginInline,
166
- marginVertical: shorthands.marginBlock,
167
- overflowBlock: value => [['overflowY', value]],
168
- overflowInline: value => [['overflowX', value]],
169
- paddingBlockStart: rawValue => [['paddingTop', rawValue]],
170
- paddingBlockEnd: rawValue => [['paddingBottom', rawValue]],
171
- paddingStart: shorthands.paddingInlineStart,
172
- paddingEnd: shorthands.paddingInlineEnd,
173
- paddingHorizontal: shorthands.paddingInline,
174
- paddingVertical: shorthands.paddingBlock,
175
- scrollMarginBlockStart: value => [['scrollMarginTop', value]],
176
- scrollMarginBlockEnd: value => [['scrollMarginBottom', value]],
177
- insetBlockStart: value => [['top', value]],
178
- insetBlockEnd: value => [['bottom', value]],
179
- start: shorthands.insetInlineStart,
180
- end: shorthands.insetInlineEnd
181
- };
182
- const expansions = {
183
- ...shorthands,
184
- ...aliases
185
- };
186
- var _default = exports.default = expansions;
@@ -1,134 +0,0 @@
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 type { TStyleValue } from '../common-types';
11
-
12
- /**
13
- * Shorthand properties:
14
- * - [x] all - Should be banned
15
- * - [x] animation
16
- * - [x] background
17
- * - [x] border
18
- * - [x] border-block-end
19
- * - [x] border-block-start
20
- * - [x] border-bottom
21
- * - [x] border-color
22
- * - [x] border-image
23
- * - [x] border-inline-end
24
- * - [x] border-inline-start
25
- * - [x] border-left
26
- * - [x] border-radius
27
- * - [x] border-right
28
- * - [x] border-style
29
- * - [x] border-top
30
- * - [x] border-width
31
- * - [x] column-rule
32
- * - [x] columns
33
- * - [x] container
34
- * - [x] flex
35
- * - [x] flex-flow
36
- * - [x] font
37
- * - [x] gap
38
- * - [x] grid
39
- * - [x] grid-area
40
- * - [x] grid-column
41
- * - [x] grid-row
42
- * - [x] grid-template
43
- * - [x] inset
44
- * - [x] inset-block
45
- * - [x] inset-inline
46
- * - [x] list-style
47
- * - [x] margin
48
- * - [x] mask
49
- * - [x] offset
50
- * - [x] outline
51
- * - [x] overflow
52
- * - [x] padding
53
- * - [x] place-content
54
- * - [x] place-items
55
- * - [x] place-self
56
- * - [x] scroll-margin
57
- * - [x] scroll-padding
58
- * - [x] text-decoration
59
- * - [x] text-emphasis
60
- * - [x] transition
61
- */
62
-
63
- type TReturn = $ReadOnlyArray<[string, TStyleValue]>;
64
-
65
- declare const shorthands: $ReadOnly<{
66
- [key: string]: (TStyleValue) => TReturn,
67
- }>;
68
-
69
- declare const aliases: {
70
- borderHorizontal: $FlowFixMe,
71
- borderVertical: $FlowFixMe,
72
- borderBlockStart: $FlowFixMe,
73
- borderEnd: $FlowFixMe,
74
- borderBlockEnd: $FlowFixMe,
75
- borderStart: $FlowFixMe,
76
- blockSize: (val: TStyleValue) => TReturn,
77
- inlineSize: (val: TStyleValue) => TReturn,
78
- minBlockSize: (val: TStyleValue) => TReturn,
79
- minInlineSize: (val: TStyleValue) => TReturn,
80
- maxBlockSize: (val: TStyleValue) => TReturn,
81
- maxInlineSize: (val: TStyleValue) => TReturn,
82
- borderHorizontalWidth: $FlowFixMe,
83
- borderHorizontalStyle: $FlowFixMe,
84
- borderHorizontalColor: $FlowFixMe,
85
- borderVerticalWidth: $FlowFixMe,
86
- borderVerticalStyle: $FlowFixMe,
87
- borderVerticalColor: $FlowFixMe,
88
- borderBlockStartColor: (value: TStyleValue) => TReturn,
89
- borderBlockEndColor: (value: TStyleValue) => TReturn,
90
- borderBlockStartStyle: (value: TStyleValue) => TReturn,
91
- borderBlockEndStyle: (value: TStyleValue) => TReturn,
92
- borderBlockStartWidth: (value: TStyleValue) => TReturn,
93
- borderBlockEndWidth: (value: TStyleValue) => TReturn,
94
- borderStartColor: $FlowFixMe,
95
- borderEndColor: $FlowFixMe,
96
- borderStartStyle: $FlowFixMe,
97
- borderEndStyle: $FlowFixMe,
98
- borderStartWidth: $FlowFixMe,
99
- borderEndWidth: $FlowFixMe,
100
- borderTopStartRadius: (value: TStyleValue) => TReturn,
101
- borderTopEndRadius: (value: TStyleValue) => TReturn,
102
- borderBottomStartRadius: (value: TStyleValue) => TReturn,
103
- borderBottomEndRadius: (value: TStyleValue) => TReturn,
104
- containIntrinsicBlockSize: (value: TStyleValue) => TReturn,
105
- containIntrinsicInlineSize: (value: TStyleValue) => TReturn,
106
- gridGap: $FlowFixMe,
107
- gridRowGap: (value: TStyleValue) => TReturn,
108
- gridColumnGap: (value: TStyleValue) => TReturn,
109
- marginBlockStart: (value: TStyleValue) => TReturn,
110
- marginBlockEnd: (value: TStyleValue) => TReturn,
111
- marginStart: $FlowFixMe,
112
- marginEnd: $FlowFixMe,
113
- marginHorizontal: $FlowFixMe,
114
- marginVertical: $FlowFixMe,
115
- overflowBlock: (value: TStyleValue) => TReturn,
116
- overflowInline: (value: TStyleValue) => TReturn,
117
- paddingBlockStart: (rawValue: TStyleValue) => TReturn,
118
- paddingBlockEnd: (rawValue: TStyleValue) => TReturn,
119
- paddingStart: $FlowFixMe,
120
- paddingEnd: $FlowFixMe,
121
- paddingHorizontal: $FlowFixMe,
122
- paddingVertical: $FlowFixMe,
123
- scrollMarginBlockStart: (value: TStyleValue) => TReturn,
124
- scrollMarginBlockEnd: (value: TStyleValue) => TReturn,
125
- insetBlockStart: (value: TStyleValue) => TReturn,
126
- insetBlockEnd: (value: TStyleValue) => TReturn,
127
- start: $FlowFixMe,
128
- end: $FlowFixMe,
129
- };
130
-
131
- declare export default $ReadOnly<{
132
- ...typeof shorthands,
133
- ...typeof aliases,
134
- }>;
@@ -1,13 +0,0 @@
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
- export declare function validateNamespace(
11
- namespace: unknown,
12
- conditions: ReadonlyArray<string>,
13
- ): void;