css-in-props 3.8.9 → 3.14.1
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/README.md +6 -22
- package/dist/cjs/{props/defaults.js → defaults.js} +2 -2
- package/dist/cjs/index.js +19 -2
- package/dist/cjs/package.json +4 -0
- package/dist/cjs/props/animation.js +16 -80
- package/dist/cjs/props/block.js +71 -89
- package/dist/cjs/props/font.js +8 -7
- package/dist/cjs/props/index.js +0 -32
- package/dist/cjs/props/misc.js +9 -8
- package/dist/cjs/props/position.js +17 -14
- package/dist/cjs/props/theme.js +73 -70
- package/dist/cjs/props/timing.js +11 -11
- package/dist/cjs/registry.js +39 -0
- package/dist/cjs/set.js +1 -1
- package/dist/cjs/transform.js +80 -0
- package/index.js +1 -0
- package/package.json +13 -15
- package/src/index.js +4 -4
- package/src/props/animation.js +28 -23
- package/src/props/block.js +49 -57
- package/src/props/flex.js +4 -5
- package/src/props/index.js +18 -19
- package/src/props/misc.js +10 -3
- package/src/props/theme.js +10 -7
- package/src/set.js +11 -4
- package/src/transform/executors.js +60 -52
- package/src/transform/index.js +2 -2
- package/src/transform/transformers.js +85 -23
- package/dist/cjs/_transform.js +0 -30
- package/dist/cjs/props/flex.js +0 -45
- package/dist/cjs/props/grid.js +0 -39
- package/dist/cjs/transform/executors.js +0 -124
- package/dist/cjs/transform/index.js +0 -19
- package/dist/cjs/transform/transformers.js +0 -107
- package/dist/esm/_transform.js +0 -10
- package/dist/esm/emotion.js +0 -9
- package/dist/esm/index.js +0 -4
- package/dist/esm/props/animation.js +0 -101
- package/dist/esm/props/block.js +0 -171
- package/dist/esm/props/defaults.js +0 -321
- package/dist/esm/props/flex.js +0 -25
- package/dist/esm/props/font.js +0 -16
- package/dist/esm/props/grid.js +0 -19
- package/dist/esm/props/index.js +0 -35
- package/dist/esm/props/misc.js +0 -15
- package/dist/esm/props/position.js +0 -31
- package/dist/esm/props/theme.js +0 -134
- package/dist/esm/props/timing.js +0 -26
- package/dist/esm/set.js +0 -9
- package/dist/esm/transform/executors.js +0 -104
- package/dist/esm/transform/index.js +0 -2
- package/dist/esm/transform/transformers.js +0 -87
- package/dist/iife/index.js +0 -1084
- package/src/_transform.js +0 -10
- package/src/emotion.js +0 -9
package/dist/iife/index.js
DELETED
|
@@ -1,1084 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var CssInProps = (() => {
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
8
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
9
|
-
}) : x)(function(x) {
|
|
10
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
11
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
12
|
-
});
|
|
13
|
-
var __export = (target, all) => {
|
|
14
|
-
for (var name in all)
|
|
15
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
16
|
-
};
|
|
17
|
-
var __copyProps = (to, from, except, desc) => {
|
|
18
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
19
|
-
for (let key of __getOwnPropNames(from))
|
|
20
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
21
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
22
|
-
}
|
|
23
|
-
return to;
|
|
24
|
-
};
|
|
25
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
26
|
-
|
|
27
|
-
// src/index.js
|
|
28
|
-
var index_exports = {};
|
|
29
|
-
__export(index_exports, {
|
|
30
|
-
ANIMATION_PROPS: () => ANIMATION_PROPS,
|
|
31
|
-
BLOCK_PROPS: () => BLOCK_PROPS,
|
|
32
|
-
CSS_PROPS_REGISTRY: () => CSS_PROPS_REGISTRY,
|
|
33
|
-
DEFAULT_CSS_PROPERTIES_LIST: () => DEFAULT_CSS_PROPERTIES_LIST,
|
|
34
|
-
FLEX_PROPS: () => FLEX_PROPS,
|
|
35
|
-
FONT_PROPS: () => FONT_PROPS,
|
|
36
|
-
GRID_PROPS: () => GRID_PROPS,
|
|
37
|
-
MISC_PROPS: () => MISC_PROPS,
|
|
38
|
-
POSITION_PROPS: () => POSITION_PROPS,
|
|
39
|
-
THEME_PROPS: () => THEME_PROPS,
|
|
40
|
-
TIMING_PROPS: () => TIMING_PROPS,
|
|
41
|
-
applyTrueProps: () => applyTrueProps,
|
|
42
|
-
exetuteClassPerComponent: () => exetuteClassPerComponent,
|
|
43
|
-
getSystemGlobalTheme: () => getSystemGlobalTheme,
|
|
44
|
-
transformEmotion: () => transformEmotion,
|
|
45
|
-
transformersByPrefix: () => transformersByPrefix,
|
|
46
|
-
useCssInProps: () => useCssInProps,
|
|
47
|
-
usePropsAsCSS: () => usePropsAsCSS,
|
|
48
|
-
useSelectorsAsCSS: () => useSelectorsAsCSS
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
// src/transform/executors.js
|
|
52
|
-
var import_utils6 = __require("@domql/utils");
|
|
53
|
-
|
|
54
|
-
// src/props/animation.js
|
|
55
|
-
var import_utils = __require("@domql/utils");
|
|
56
|
-
var import_emotion = __require("@symbo.ls/emotion");
|
|
57
|
-
var import_scratch = __require("@symbo.ls/scratch");
|
|
58
|
-
var TIMING_FUNCTIONS = ["ease", "linear", "ease-in", "ease-out", "ease-in-out", "step-start", "step-end"];
|
|
59
|
-
var FILL_MODES = ["none", "forwards", "backwards", "both"];
|
|
60
|
-
var DIRECTIONS = ["normal", "reverse", "alternate", "alternate-reverse"];
|
|
61
|
-
var PLAY_STATES = ["running", "paused"];
|
|
62
|
-
var isDuration = (v) => /^[\d.]+m?s$/.test(v);
|
|
63
|
-
var applyAnimationProps = (animation, element) => {
|
|
64
|
-
const { emotion: ctxEmotion } = element.context;
|
|
65
|
-
const { keyframes } = ctxEmotion || import_emotion.emotion;
|
|
66
|
-
if ((0, import_utils.isObject)(animation)) return { animationName: keyframes(animation) };
|
|
67
|
-
const { ANIMATION } = element.context && element.context.designSystem;
|
|
68
|
-
const record = ANIMATION[animation];
|
|
69
|
-
return keyframes(record);
|
|
70
|
-
};
|
|
71
|
-
var parseAnimationShorthand = (val, el) => {
|
|
72
|
-
const { ANIMATION } = el.context && el.context.designSystem || {};
|
|
73
|
-
const tokens = val.split(/\s+/);
|
|
74
|
-
let name = null;
|
|
75
|
-
const durations = [];
|
|
76
|
-
let timingFunction = null;
|
|
77
|
-
let iterationCount = null;
|
|
78
|
-
let direction = null;
|
|
79
|
-
let fillMode = null;
|
|
80
|
-
let playState = null;
|
|
81
|
-
for (const token of tokens) {
|
|
82
|
-
if (ANIMATION && ANIMATION[token]) {
|
|
83
|
-
name = token;
|
|
84
|
-
} else if (isDuration(token)) {
|
|
85
|
-
durations.push(token);
|
|
86
|
-
} else if (TIMING_FUNCTIONS.includes(token) || token.startsWith("cubic-bezier") || token.startsWith("steps(")) {
|
|
87
|
-
timingFunction = token;
|
|
88
|
-
} else if (token === "infinite" || /^\d+$/.test(token)) {
|
|
89
|
-
iterationCount = token === "infinite" ? token : Number(token);
|
|
90
|
-
} else if (DIRECTIONS.includes(token)) {
|
|
91
|
-
direction = token;
|
|
92
|
-
} else if (FILL_MODES.includes(token)) {
|
|
93
|
-
fillMode = token;
|
|
94
|
-
} else if (PLAY_STATES.includes(token)) {
|
|
95
|
-
playState = token;
|
|
96
|
-
} else if (!name) {
|
|
97
|
-
name = token;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
return { name, durations, timingFunction, iterationCount, direction, fillMode, playState };
|
|
101
|
-
};
|
|
102
|
-
var ANIMATION_PROPS = {
|
|
103
|
-
animation: (val, el) => {
|
|
104
|
-
if ((0, import_utils.isString)(val) && val.includes(" ")) {
|
|
105
|
-
const parsed = parseAnimationShorthand(val, el);
|
|
106
|
-
return {
|
|
107
|
-
animationName: applyAnimationProps(parsed.name || val, el),
|
|
108
|
-
animationDuration: parsed.durations[0] || (0, import_scratch.getTimingByKey)(el.props.animationDuration || "A").timing,
|
|
109
|
-
animationDelay: parsed.durations[1] || (0, import_scratch.getTimingByKey)(el.props.animationDelay || "0s").timing,
|
|
110
|
-
animationTimingFunction: parsed.timingFunction || (0, import_scratch.getTimingFunction)(el.props.animationTimingFunction || "ease"),
|
|
111
|
-
animationFillMode: parsed.fillMode || el.props.animationFillMode || "both",
|
|
112
|
-
animationIterationCount: parsed.iterationCount != null ? parsed.iterationCount : el.props.animationIterationCount || 1,
|
|
113
|
-
animationPlayState: parsed.playState || el.props.animationPlayState,
|
|
114
|
-
animationDirection: parsed.direction || el.props.animationDirection
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
return {
|
|
118
|
-
animationName: applyAnimationProps(val, el),
|
|
119
|
-
animationDuration: (0, import_scratch.getTimingByKey)(el.props.animationDuration || "A").timing,
|
|
120
|
-
animationDelay: (0, import_scratch.getTimingByKey)(el.props.animationDelay || "0s").timing,
|
|
121
|
-
animationTimingFunction: (0, import_scratch.getTimingFunction)(el.props.animationTimingFunction || "ease"),
|
|
122
|
-
animationFillMode: el.props.animationFillMode || "both",
|
|
123
|
-
animationIterationCount: el.props.animationIterationCount || 1,
|
|
124
|
-
animationPlayState: el.props.animationPlayState,
|
|
125
|
-
animationDirection: el.props.animationDirection
|
|
126
|
-
};
|
|
127
|
-
},
|
|
128
|
-
animationName: (val, el) => ({
|
|
129
|
-
animationName: applyAnimationProps(val, el)
|
|
130
|
-
}),
|
|
131
|
-
animationDuration: (val) => ({
|
|
132
|
-
animationDuration: (0, import_scratch.getTimingByKey)(val).timing
|
|
133
|
-
}),
|
|
134
|
-
animationDelay: (val) => ({
|
|
135
|
-
animationDelay: (0, import_scratch.getTimingByKey)(val).timing
|
|
136
|
-
}),
|
|
137
|
-
animationTimingFunction: (val) => ({
|
|
138
|
-
animationTimingFunction: (0, import_scratch.getTimingFunction)(val)
|
|
139
|
-
}),
|
|
140
|
-
animationIterationCount: (val) => ({
|
|
141
|
-
animationIterationCount: val
|
|
142
|
-
}),
|
|
143
|
-
animationFillMode: (val) => ({
|
|
144
|
-
animationFillMode: val
|
|
145
|
-
}),
|
|
146
|
-
animationPlayState: (val) => ({
|
|
147
|
-
animationPlayState: val
|
|
148
|
-
}),
|
|
149
|
-
animationDirection: (val) => ({
|
|
150
|
-
animationDirection: val
|
|
151
|
-
})
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
// src/props/block.js
|
|
155
|
-
var import_utils2 = __require("@domql/utils");
|
|
156
|
-
var import_scratch2 = __require("@symbo.ls/scratch");
|
|
157
|
-
var BLOCK_PROPS = {
|
|
158
|
-
show: (val, el, s, ctx) => !!(ctx.utils.exec(val, el, s) === false) && {
|
|
159
|
-
display: "none !important"
|
|
160
|
-
},
|
|
161
|
-
hide: (val, el, s, ctx) => !!ctx.utils.exec(val, el, s) && {
|
|
162
|
-
display: "none !important"
|
|
163
|
-
},
|
|
164
|
-
height: (val, { props }) => (0, import_scratch2.transformSizeRatio)("height", val, props),
|
|
165
|
-
width: (val, { props }) => (0, import_scratch2.transformSizeRatio)("width", val, props),
|
|
166
|
-
boxSizing: (val) => !(0, import_utils2.isUndefined)(val) ? { boxSizing: val } : { boxSizing: "border-box" },
|
|
167
|
-
boxSize: (val) => {
|
|
168
|
-
if (!(0, import_utils2.isString)(val)) return;
|
|
169
|
-
const [height, width] = val.split(" ");
|
|
170
|
-
return {
|
|
171
|
-
...(0, import_scratch2.transformSize)("height", height),
|
|
172
|
-
...(0, import_scratch2.transformSize)("width", width || height)
|
|
173
|
-
};
|
|
174
|
-
},
|
|
175
|
-
inlineSize: (val, { props }) => (0, import_scratch2.transformSizeRatio)("inlineSize", val, props),
|
|
176
|
-
blockSize: (val, { props }) => (0, import_scratch2.transformSizeRatio)("blockSize", val, props),
|
|
177
|
-
minWidth: (val, { props }) => (0, import_scratch2.transformSizeRatio)("minWidth", val, props),
|
|
178
|
-
maxWidth: (val, { props }) => (0, import_scratch2.transformSizeRatio)("maxWidth", val, props),
|
|
179
|
-
widthRange: (val) => {
|
|
180
|
-
if (!(0, import_utils2.isString)(val)) return;
|
|
181
|
-
const [minWidth, maxWidth] = val.split(" ");
|
|
182
|
-
return {
|
|
183
|
-
...(0, import_scratch2.transformSize)("minWidth", minWidth),
|
|
184
|
-
...(0, import_scratch2.transformSize)("maxWidth", maxWidth || minWidth)
|
|
185
|
-
};
|
|
186
|
-
},
|
|
187
|
-
minHeight: (val, { props }) => (0, import_scratch2.transformSizeRatio)("minHeight", val, props),
|
|
188
|
-
maxHeight: (val, { props }) => (0, import_scratch2.transformSizeRatio)("maxHeight", val, props),
|
|
189
|
-
heightRange: (val) => {
|
|
190
|
-
if (!(0, import_utils2.isString)(val)) return;
|
|
191
|
-
const [minHeight, maxHeight] = val.split(" ");
|
|
192
|
-
return {
|
|
193
|
-
...(0, import_scratch2.transformSize)("minHeight", minHeight),
|
|
194
|
-
...(0, import_scratch2.transformSize)("maxHeight", maxHeight || minHeight)
|
|
195
|
-
};
|
|
196
|
-
},
|
|
197
|
-
size: (val) => {
|
|
198
|
-
if (!(0, import_utils2.isString)(val)) return;
|
|
199
|
-
const [inlineSize, blockSize] = val.split(" ");
|
|
200
|
-
return {
|
|
201
|
-
...(0, import_scratch2.transformSizeRatio)("inlineSize", inlineSize),
|
|
202
|
-
...(0, import_scratch2.transformSizeRatio)("blockSize", blockSize || inlineSize)
|
|
203
|
-
};
|
|
204
|
-
},
|
|
205
|
-
minBlockSize: (val, { props }) => (0, import_scratch2.transformSizeRatio)("minBlockSize", val, props),
|
|
206
|
-
minInlineSize: (val, { props }) => (0, import_scratch2.transformSizeRatio)("minInlineSize", val, props),
|
|
207
|
-
maxBlockSize: (val, { props }) => (0, import_scratch2.transformSizeRatio)("maxBlockSize", val, props),
|
|
208
|
-
maxInlineSize: (val, { props }) => (0, import_scratch2.transformSizeRatio)("maxInlineSize", val, props),
|
|
209
|
-
minSize: (val) => {
|
|
210
|
-
if (!(0, import_utils2.isString)(val)) return;
|
|
211
|
-
const [minInlineSize, minBlockSize] = val.split(" ");
|
|
212
|
-
return {
|
|
213
|
-
...(0, import_scratch2.transformSize)("minInlineSize", minInlineSize),
|
|
214
|
-
...(0, import_scratch2.transformSize)("minBlockSize", minBlockSize || minInlineSize)
|
|
215
|
-
};
|
|
216
|
-
},
|
|
217
|
-
maxSize: (val) => {
|
|
218
|
-
if (!(0, import_utils2.isString)(val)) return;
|
|
219
|
-
const [maxInlineSize, maxBlockSize] = val.split(" ");
|
|
220
|
-
return {
|
|
221
|
-
...(0, import_scratch2.transformSize)("maxInlineSize", maxInlineSize),
|
|
222
|
-
...(0, import_scratch2.transformSize)("maxBlockSize", maxBlockSize || maxInlineSize)
|
|
223
|
-
};
|
|
224
|
-
},
|
|
225
|
-
borderWidth: (val, { props }) => (0, import_scratch2.transformSizeRatio)("borderWidth", val, props),
|
|
226
|
-
padding: (val, { props }) => (0, import_scratch2.transformSizeRatio)("padding", val, props),
|
|
227
|
-
scrollPadding: (val, { props }) => (0, import_scratch2.transformSizeRatio)("scrollPadding", val, props),
|
|
228
|
-
paddingInline: (val) => {
|
|
229
|
-
if (!(0, import_utils2.isString)(val)) return;
|
|
230
|
-
const [paddingInlineStart, paddingInlineEnd] = val.split(" ");
|
|
231
|
-
return {
|
|
232
|
-
...(0, import_scratch2.transformSize)("paddingInlineStart", paddingInlineStart),
|
|
233
|
-
...(0, import_scratch2.transformSize)("paddingInlineEnd", paddingInlineEnd || paddingInlineStart)
|
|
234
|
-
};
|
|
235
|
-
},
|
|
236
|
-
paddingBlock: (val) => {
|
|
237
|
-
if (!(0, import_utils2.isString)(val)) return;
|
|
238
|
-
const [paddingBlockStart, paddingBlockEnd] = val.split(" ");
|
|
239
|
-
return {
|
|
240
|
-
...(0, import_scratch2.transformSize)("paddingBlockStart", paddingBlockStart),
|
|
241
|
-
...(0, import_scratch2.transformSize)("paddingBlockEnd", paddingBlockEnd || paddingBlockStart)
|
|
242
|
-
};
|
|
243
|
-
},
|
|
244
|
-
// Traditional directional padding
|
|
245
|
-
paddingTop: (val, { props }) => (0, import_scratch2.transformSizeRatio)("paddingBlockStart", val, props),
|
|
246
|
-
paddingBottom: (val, { props }) => (0, import_scratch2.transformSizeRatio)("paddingBlockEnd", val, props),
|
|
247
|
-
paddingLeft: (val, { props }) => (0, import_scratch2.transformSizeRatio)("paddingInlineStart", val, props),
|
|
248
|
-
paddingRight: (val, { props }) => (0, import_scratch2.transformSizeRatio)("paddingInlineEnd", val, props),
|
|
249
|
-
// Logical properties (for reference)
|
|
250
|
-
paddingBlockStart: (val, { props }) => (0, import_scratch2.transformSizeRatio)("paddingBlockStart", val, props),
|
|
251
|
-
// maps to top
|
|
252
|
-
paddingBlockEnd: (val, { props }) => (0, import_scratch2.transformSizeRatio)("paddingBlockEnd", val, props),
|
|
253
|
-
// maps to bottom
|
|
254
|
-
paddingInlineStart: (val, { props }) => (0, import_scratch2.transformSizeRatio)("paddingInlineStart", val, props),
|
|
255
|
-
// maps to left
|
|
256
|
-
paddingInlineEnd: (val, { props }) => (0, import_scratch2.transformSizeRatio)("paddingInlineEnd", val, props),
|
|
257
|
-
// maps to right
|
|
258
|
-
margin: (val, { props }) => (0, import_scratch2.transformSizeRatio)("margin", val, props),
|
|
259
|
-
marginInline: (val) => {
|
|
260
|
-
if (!(0, import_utils2.isString)(val)) return;
|
|
261
|
-
const [marginInlineStart, marginInlineEnd] = val.split(" ");
|
|
262
|
-
return {
|
|
263
|
-
...(0, import_scratch2.transformSize)("marginInlineStart", marginInlineStart),
|
|
264
|
-
...(0, import_scratch2.transformSize)("marginInlineEnd", marginInlineEnd || marginInlineStart)
|
|
265
|
-
};
|
|
266
|
-
},
|
|
267
|
-
marginBlock: (val, { props }) => {
|
|
268
|
-
if (!(0, import_utils2.isString)(props.marginBlock)) return;
|
|
269
|
-
const [marginBlockStart, marginBlockEnd] = props.marginBlock.split(" ");
|
|
270
|
-
return {
|
|
271
|
-
...(0, import_scratch2.transformSize)("marginBlockStart", marginBlockStart),
|
|
272
|
-
...(0, import_scratch2.transformSize)("marginBlockEnd", marginBlockEnd || marginBlockStart)
|
|
273
|
-
};
|
|
274
|
-
},
|
|
275
|
-
// Traditional directional margin
|
|
276
|
-
marginTop: (val, { props }) => (0, import_scratch2.transformSizeRatio)("marginBlockStart", val, props),
|
|
277
|
-
marginBottom: (val, { props }) => (0, import_scratch2.transformSizeRatio)("marginBlockEnd", val, props),
|
|
278
|
-
marginLeft: (val, { props }) => (0, import_scratch2.transformSizeRatio)("marginInlineStart", val, props),
|
|
279
|
-
marginRight: (val, { props }) => (0, import_scratch2.transformSizeRatio)("marginInlineEnd", val, props),
|
|
280
|
-
// Logical properties
|
|
281
|
-
marginInlineStart: (val, { props }) => (0, import_scratch2.transformSizeRatio)("marginInlineStart", val, props),
|
|
282
|
-
marginInlineEnd: (val, { props }) => (0, import_scratch2.transformSizeRatio)("marginInlineEnd", val, props),
|
|
283
|
-
marginBlockStart: (val, { props }) => (0, import_scratch2.transformSizeRatio)("marginBlockStart", val, props),
|
|
284
|
-
marginBlockEnd: (val, { props }) => (0, import_scratch2.transformSizeRatio)("marginBlockEnd", val, props),
|
|
285
|
-
gap: (val) => ({
|
|
286
|
-
gap: (0, import_scratch2.transfromGap)(val)
|
|
287
|
-
}),
|
|
288
|
-
columnGap: (val, { props }) => (0, import_scratch2.getSpacingBasedOnRatio)(props, "columnGap", val),
|
|
289
|
-
rowGap: (val, { props }) => (0, import_scratch2.getSpacingBasedOnRatio)(props, "rowGap", val),
|
|
290
|
-
flexWrap: (val, { props }) => ({
|
|
291
|
-
display: "flex",
|
|
292
|
-
flexFlow: (val || "row").split(" ")[0] + " " + props.flexWrap
|
|
293
|
-
}),
|
|
294
|
-
flexFlow: (val, { props }) => {
|
|
295
|
-
const { reverse } = props;
|
|
296
|
-
if (!(0, import_utils2.isString)(val)) return;
|
|
297
|
-
let [direction, wrap] = (val || "row").split(" ");
|
|
298
|
-
if (val.startsWith("x") || val === "row") direction = "row";
|
|
299
|
-
if (val.startsWith("y") || val === "column") direction = "column";
|
|
300
|
-
return {
|
|
301
|
-
display: "flex",
|
|
302
|
-
flexFlow: (direction || "") + (!direction.includes("-reverse") && reverse ? "-reverse" : "") + " " + (wrap || "")
|
|
303
|
-
};
|
|
304
|
-
},
|
|
305
|
-
flexAlign: (val) => {
|
|
306
|
-
if (!(0, import_utils2.isString)(val)) return;
|
|
307
|
-
const [alignItems, justifyContent] = val.split(" ");
|
|
308
|
-
return {
|
|
309
|
-
display: "flex",
|
|
310
|
-
alignItems,
|
|
311
|
-
justifyContent
|
|
312
|
-
};
|
|
313
|
-
},
|
|
314
|
-
round: (val, { props }) => (0, import_scratch2.transformBorderRadius)(val || props.borderRadius, props, "round"),
|
|
315
|
-
borderRadius: (val, { props }) => (0, import_scratch2.transformBorderRadius)(val || props.round, props, "borderRadius")
|
|
316
|
-
};
|
|
317
|
-
|
|
318
|
-
// src/props/font.js
|
|
319
|
-
var import_scratch3 = __require("@symbo.ls/scratch");
|
|
320
|
-
var FONT_PROPS = {
|
|
321
|
-
fontSize: (value) => {
|
|
322
|
-
return (0, import_scratch3.getFontSizeByKey)(value) || value;
|
|
323
|
-
},
|
|
324
|
-
fontFamily: (value) => ({
|
|
325
|
-
fontFamily: (0, import_scratch3.getFontFamily)(value) || value
|
|
326
|
-
}),
|
|
327
|
-
fontWeight: (value) => ({
|
|
328
|
-
fontWeight: value,
|
|
329
|
-
fontVariationSettings: '"wght" ' + value
|
|
330
|
-
})
|
|
331
|
-
};
|
|
332
|
-
|
|
333
|
-
// src/props/misc.js
|
|
334
|
-
var MISC_PROPS = {
|
|
335
|
-
overflow: (value) => ({
|
|
336
|
-
overflow: value,
|
|
337
|
-
scrollBehavior: "smooth"
|
|
338
|
-
}),
|
|
339
|
-
cursor: (value, el, s, ctx) => {
|
|
340
|
-
if (!value) return;
|
|
341
|
-
const file = ctx.files && ctx.files[value];
|
|
342
|
-
if (file && file.content) value = `url(${file.content.src})`;
|
|
343
|
-
return { cursor: value };
|
|
344
|
-
}
|
|
345
|
-
};
|
|
346
|
-
|
|
347
|
-
// src/props/position.js
|
|
348
|
-
var import_scratch4 = __require("@symbo.ls/scratch");
|
|
349
|
-
var POSITION_PROPS = {
|
|
350
|
-
inset: (val, el) => {
|
|
351
|
-
if (el.call("isNumber", val)) return { inset: val };
|
|
352
|
-
if (!el.call("isString", val)) return;
|
|
353
|
-
return { inset: val.split(" ").map((v) => (0, import_scratch4.getSpacingByKey)(v, "k").k).join(" ") };
|
|
354
|
-
},
|
|
355
|
-
left: (val) => (0, import_scratch4.getSpacingByKey)(val, "left"),
|
|
356
|
-
top: (val) => (0, import_scratch4.getSpacingByKey)(val, "top"),
|
|
357
|
-
right: (val) => (0, import_scratch4.getSpacingByKey)(val, "right"),
|
|
358
|
-
bottom: (val) => (0, import_scratch4.getSpacingByKey)(val, "bottom"),
|
|
359
|
-
verticalInset: (val) => {
|
|
360
|
-
if (typeof val !== "string") return;
|
|
361
|
-
const vi = val.split(" ").map((v) => (0, import_scratch4.getSpacingByKey)(v, "k").k);
|
|
362
|
-
return {
|
|
363
|
-
top: vi[0],
|
|
364
|
-
bottom: vi[1] || vi[0]
|
|
365
|
-
};
|
|
366
|
-
},
|
|
367
|
-
horizontalInset: (val) => {
|
|
368
|
-
if (typeof val !== "string") return;
|
|
369
|
-
const vi = val.split(" ").map((v) => (0, import_scratch4.getSpacingByKey)(v, "k").k);
|
|
370
|
-
return {
|
|
371
|
-
left: vi[0],
|
|
372
|
-
right: vi[1] || vi[0]
|
|
373
|
-
};
|
|
374
|
-
}
|
|
375
|
-
};
|
|
376
|
-
|
|
377
|
-
// src/props/theme.js
|
|
378
|
-
var import_scratch5 = __require("@symbo.ls/scratch");
|
|
379
|
-
var import_utils3 = __require("@domql/utils");
|
|
380
|
-
var getSystemGlobalTheme = ({ context, state }) => {
|
|
381
|
-
const theme = state?.root?.globalTheme || context.designSystem?.globalTheme;
|
|
382
|
-
return theme === "auto" ? null : theme;
|
|
383
|
-
};
|
|
384
|
-
var THEME_PROPS = {
|
|
385
|
-
theme: (val, element) => {
|
|
386
|
-
const { props } = element;
|
|
387
|
-
if (!val) return;
|
|
388
|
-
if (props.themeModifier) {
|
|
389
|
-
return (0, import_scratch5.getMediaTheme)(val, `@${props.themeModifier}`);
|
|
390
|
-
}
|
|
391
|
-
return (0, import_scratch5.getMediaTheme)(val);
|
|
392
|
-
},
|
|
393
|
-
color: (val, element) => {
|
|
394
|
-
const globalTheme = getSystemGlobalTheme(element);
|
|
395
|
-
if (!val) return;
|
|
396
|
-
return {
|
|
397
|
-
color: (0, import_scratch5.getMediaColor)(val, globalTheme)
|
|
398
|
-
};
|
|
399
|
-
},
|
|
400
|
-
background: (val, element) => {
|
|
401
|
-
const globalTheme = getSystemGlobalTheme(element);
|
|
402
|
-
if (!val) return;
|
|
403
|
-
if ((0, import_utils3.isString)(val) && val.includes("gradient")) {
|
|
404
|
-
return { background: (0, import_scratch5.resolveColorsInGradient)(val, globalTheme) };
|
|
405
|
-
}
|
|
406
|
-
return {
|
|
407
|
-
background: (0, import_scratch5.getMediaColor)(val, globalTheme)
|
|
408
|
-
};
|
|
409
|
-
},
|
|
410
|
-
backgroundColor: (val, element) => {
|
|
411
|
-
const globalTheme = getSystemGlobalTheme(element);
|
|
412
|
-
if (!val) return;
|
|
413
|
-
return {
|
|
414
|
-
backgroundColor: (0, import_scratch5.getMediaColor)(val, globalTheme)
|
|
415
|
-
};
|
|
416
|
-
},
|
|
417
|
-
backgroundImage: (val, element, s, ctx) => {
|
|
418
|
-
const globalTheme = getSystemGlobalTheme(element);
|
|
419
|
-
if (!val) return;
|
|
420
|
-
const file = ctx.files && ctx.files[val];
|
|
421
|
-
if (file && file.content) val = file.content.src;
|
|
422
|
-
return {
|
|
423
|
-
backgroundImage: (0, import_scratch5.transformBackgroundImage)(val, globalTheme)
|
|
424
|
-
};
|
|
425
|
-
},
|
|
426
|
-
textStroke: (val) => ({
|
|
427
|
-
WebkitTextStroke: (0, import_scratch5.transformTextStroke)(val)
|
|
428
|
-
}),
|
|
429
|
-
outline: (val) => ({
|
|
430
|
-
outline: (0, import_scratch5.transformBorder)(val)
|
|
431
|
-
}),
|
|
432
|
-
outlineOffset: (val, { props }) => (0, import_scratch5.transformSizeRatio)("outlineOffset", val, props),
|
|
433
|
-
border: (val) => ({
|
|
434
|
-
border: (0, import_scratch5.transformBorder)(val)
|
|
435
|
-
}),
|
|
436
|
-
borderColor: (val, element) => {
|
|
437
|
-
const globalTheme = getSystemGlobalTheme(element);
|
|
438
|
-
if (!val) return;
|
|
439
|
-
return {
|
|
440
|
-
borderColor: (0, import_scratch5.getMediaColor)(val, globalTheme)
|
|
441
|
-
};
|
|
442
|
-
},
|
|
443
|
-
borderTopColor: (val, element) => {
|
|
444
|
-
const globalTheme = getSystemGlobalTheme(element);
|
|
445
|
-
if (!val) return;
|
|
446
|
-
return { borderTopColor: (0, import_scratch5.getMediaColor)(val, globalTheme) };
|
|
447
|
-
},
|
|
448
|
-
borderBottomColor: (val, element) => {
|
|
449
|
-
const globalTheme = getSystemGlobalTheme(element);
|
|
450
|
-
if (!val) return;
|
|
451
|
-
return { borderBottomColor: (0, import_scratch5.getMediaColor)(val, globalTheme) };
|
|
452
|
-
},
|
|
453
|
-
borderLeftColor: (val, element) => {
|
|
454
|
-
const globalTheme = getSystemGlobalTheme(element);
|
|
455
|
-
if (!val) return;
|
|
456
|
-
return { borderLeftColor: (0, import_scratch5.getMediaColor)(val, globalTheme) };
|
|
457
|
-
},
|
|
458
|
-
borderRightColor: (val, element) => {
|
|
459
|
-
const globalTheme = getSystemGlobalTheme(element);
|
|
460
|
-
if (!val) return;
|
|
461
|
-
return { borderRightColor: (0, import_scratch5.getMediaColor)(val, globalTheme) };
|
|
462
|
-
},
|
|
463
|
-
borderLeft: (val) => ({
|
|
464
|
-
borderLeft: (0, import_scratch5.transformBorder)(val)
|
|
465
|
-
}),
|
|
466
|
-
borderTop: (val) => ({
|
|
467
|
-
borderTop: (0, import_scratch5.transformBorder)(val)
|
|
468
|
-
}),
|
|
469
|
-
borderRight: (val) => ({
|
|
470
|
-
borderRight: (0, import_scratch5.transformBorder)(val)
|
|
471
|
-
}),
|
|
472
|
-
borderBottom: (val) => ({
|
|
473
|
-
borderBottom: (0, import_scratch5.transformBorder)(val)
|
|
474
|
-
}),
|
|
475
|
-
shadow: (val, element) => {
|
|
476
|
-
const globalTheme = getSystemGlobalTheme(element);
|
|
477
|
-
if (!val) return;
|
|
478
|
-
return {
|
|
479
|
-
boxShadow: (0, import_scratch5.transformShadow)(val, globalTheme)
|
|
480
|
-
};
|
|
481
|
-
},
|
|
482
|
-
boxShadow: (val, element) => {
|
|
483
|
-
if (!(0, import_utils3.isString)(val)) return;
|
|
484
|
-
const [value, hasImportant] = val.split("!importan");
|
|
485
|
-
const globalTheme = getSystemGlobalTheme(element);
|
|
486
|
-
const important = hasImportant ? " !important" : "";
|
|
487
|
-
return {
|
|
488
|
-
boxShadow: (0, import_scratch5.transformBoxShadow)(value.trim(), globalTheme) + important
|
|
489
|
-
};
|
|
490
|
-
},
|
|
491
|
-
textShadow: (val, { context }) => ({
|
|
492
|
-
textShadow: (0, import_scratch5.transformBoxShadow)(val, context.designSystem.globalTheme)
|
|
493
|
-
}),
|
|
494
|
-
columnRule: (val) => ({
|
|
495
|
-
columnRule: (0, import_scratch5.transformBorder)(val)
|
|
496
|
-
})
|
|
497
|
-
};
|
|
498
|
-
|
|
499
|
-
// src/props/timing.js
|
|
500
|
-
var import_scratch6 = __require("@symbo.ls/scratch");
|
|
501
|
-
var TIMING_PROPS = {
|
|
502
|
-
transition: (val) => ({
|
|
503
|
-
transition: (0, import_scratch6.splitTransition)(val)
|
|
504
|
-
}),
|
|
505
|
-
transitionDuration: (val) => ({
|
|
506
|
-
transitionDuration: (0, import_scratch6.transformDuration)(val)
|
|
507
|
-
}),
|
|
508
|
-
transitionDelay: (val) => ({
|
|
509
|
-
transitionDelay: (0, import_scratch6.transformDuration)(val)
|
|
510
|
-
}),
|
|
511
|
-
transitionTimingFunction: (val) => ({
|
|
512
|
-
transitionTimingFunction: (0, import_scratch6.getTimingFunction)(val)
|
|
513
|
-
}),
|
|
514
|
-
transitionProperty: (val) => ({
|
|
515
|
-
transitionProperty: val,
|
|
516
|
-
willChange: val
|
|
517
|
-
})
|
|
518
|
-
};
|
|
519
|
-
|
|
520
|
-
// src/props/flex.js
|
|
521
|
-
var import_utils4 = __require("@domql/utils");
|
|
522
|
-
var FLEX_PROPS = {
|
|
523
|
-
flow: (value, el) => {
|
|
524
|
-
const { props } = el;
|
|
525
|
-
const { reverse } = props;
|
|
526
|
-
if (!(0, import_utils4.isString)(value)) return;
|
|
527
|
-
let [direction, wrap] = (value || "row").split(" ");
|
|
528
|
-
if (value.startsWith("x") || value === "row") direction = "row";
|
|
529
|
-
if (value.startsWith("y") || value === "column") direction = "column";
|
|
530
|
-
return {
|
|
531
|
-
display: "flex",
|
|
532
|
-
flexFlow: (direction || "") + (!direction.includes("-reverse") && reverse ? "-reverse" : "") + " " + (wrap || "")
|
|
533
|
-
};
|
|
534
|
-
},
|
|
535
|
-
wrap: (value, { props }) => {
|
|
536
|
-
return { display: "flex", flexWrap: value };
|
|
537
|
-
},
|
|
538
|
-
align: (value, { props }) => {
|
|
539
|
-
const [alignItems, justifyContent] = value.split(" ");
|
|
540
|
-
return { display: "flex", alignItems, justifyContent };
|
|
541
|
-
}
|
|
542
|
-
};
|
|
543
|
-
|
|
544
|
-
// src/props/grid.js
|
|
545
|
-
var GRID_PROPS = {
|
|
546
|
-
area: (value) => ({ gridArea: value }),
|
|
547
|
-
template: (value) => ({ gridTemplate: value }),
|
|
548
|
-
templateAreas: (value) => ({ gridTemplateAreas: value }),
|
|
549
|
-
column: (value) => ({ gridColumn: value }),
|
|
550
|
-
columns: (value) => ({ gridTemplateColumns: value }),
|
|
551
|
-
templateColumns: (value) => ({ gridTemplateColumns: value }),
|
|
552
|
-
autoColumns: (value) => ({ gridAutoColumns: value }),
|
|
553
|
-
columnStart: (value) => ({ gridColumnStart: value }),
|
|
554
|
-
row: (value) => ({ gridRow: value }),
|
|
555
|
-
rows: (value) => ({ gridTemplateRows: value }),
|
|
556
|
-
templateRows: (value) => ({ gridTemplateRows: value }),
|
|
557
|
-
autoRows: (value) => ({ gridAutoRows: value }),
|
|
558
|
-
rowStart: (value) => ({ gridRowStart: value }),
|
|
559
|
-
autoFlow: (value) => ({ gridAutoFlow: value })
|
|
560
|
-
};
|
|
561
|
-
|
|
562
|
-
// src/props/index.js
|
|
563
|
-
var CSS_PROPS_REGISTRY = {
|
|
564
|
-
...ANIMATION_PROPS,
|
|
565
|
-
...BLOCK_PROPS,
|
|
566
|
-
...FONT_PROPS,
|
|
567
|
-
...MISC_PROPS,
|
|
568
|
-
...MISC_PROPS,
|
|
569
|
-
...POSITION_PROPS,
|
|
570
|
-
...THEME_PROPS,
|
|
571
|
-
...TIMING_PROPS,
|
|
572
|
-
...FLEX_PROPS,
|
|
573
|
-
...GRID_PROPS
|
|
574
|
-
};
|
|
575
|
-
|
|
576
|
-
// src/props/defaults.js
|
|
577
|
-
var DEFAULT_CSS_PROPERTIES_LIST = /* @__PURE__ */ new Set([
|
|
578
|
-
"accentColor",
|
|
579
|
-
"alignContent",
|
|
580
|
-
"alignItems",
|
|
581
|
-
"alignSelf",
|
|
582
|
-
"alignmentBaseline",
|
|
583
|
-
"all",
|
|
584
|
-
"animation",
|
|
585
|
-
"animationDelay",
|
|
586
|
-
"animationDirection",
|
|
587
|
-
"animationDuration",
|
|
588
|
-
"animationFillMode",
|
|
589
|
-
"animationIterationCount",
|
|
590
|
-
"animationName",
|
|
591
|
-
"animationPlayState",
|
|
592
|
-
"animationTimingFunction",
|
|
593
|
-
"appearance",
|
|
594
|
-
"aspectRatio",
|
|
595
|
-
"backdropFilter",
|
|
596
|
-
"backfaceVisibility",
|
|
597
|
-
"background",
|
|
598
|
-
"backgroundAttachment",
|
|
599
|
-
"backgroundBlendMode",
|
|
600
|
-
"backgroundClip",
|
|
601
|
-
"backgroundColor",
|
|
602
|
-
"backgroundImage",
|
|
603
|
-
"backgroundOrigin",
|
|
604
|
-
"backgroundPosition",
|
|
605
|
-
"backgroundPositionX",
|
|
606
|
-
"backgroundPositionY",
|
|
607
|
-
"backgroundRepeat",
|
|
608
|
-
"backgroundRepeatX",
|
|
609
|
-
"backgroundRepeatY",
|
|
610
|
-
"backgroundSize",
|
|
611
|
-
"baselineShift",
|
|
612
|
-
"blockSize",
|
|
613
|
-
"border",
|
|
614
|
-
"borderBlock",
|
|
615
|
-
"borderBlockColor",
|
|
616
|
-
"borderBlockEnd",
|
|
617
|
-
"borderBlockEndColor",
|
|
618
|
-
"borderBlockEndStyle",
|
|
619
|
-
"borderBlockEndWidth",
|
|
620
|
-
"borderBlockStart",
|
|
621
|
-
"borderBlockStartColor",
|
|
622
|
-
"borderBlockStartStyle",
|
|
623
|
-
"borderBlockStartWidth",
|
|
624
|
-
"borderBlockStyle",
|
|
625
|
-
"borderBlockWidth",
|
|
626
|
-
"borderBottom",
|
|
627
|
-
"borderBottomColor",
|
|
628
|
-
"borderBottomLeftRadius",
|
|
629
|
-
"borderBottomRightRadius",
|
|
630
|
-
"borderBottomStyle",
|
|
631
|
-
"borderBottomWidth",
|
|
632
|
-
"borderCollapse",
|
|
633
|
-
"borderColor",
|
|
634
|
-
"borderImage",
|
|
635
|
-
"borderImageOutset",
|
|
636
|
-
"borderImageRepeat",
|
|
637
|
-
"borderImageSlice",
|
|
638
|
-
"borderImageSource",
|
|
639
|
-
"borderImageWidth",
|
|
640
|
-
"borderLeft",
|
|
641
|
-
"borderLeftColor",
|
|
642
|
-
"borderLeftStyle",
|
|
643
|
-
"borderLeftWidth",
|
|
644
|
-
"borderRadius",
|
|
645
|
-
"borderRight",
|
|
646
|
-
"borderRightColor",
|
|
647
|
-
"borderRightStyle",
|
|
648
|
-
"borderRightWidth",
|
|
649
|
-
"borderSpacing",
|
|
650
|
-
"borderStyle",
|
|
651
|
-
"borderTop",
|
|
652
|
-
"borderTopColor",
|
|
653
|
-
"borderTopLeftRadius",
|
|
654
|
-
"borderTopRightRadius",
|
|
655
|
-
"borderTopStyle",
|
|
656
|
-
"borderTopWidth",
|
|
657
|
-
"borderWidth",
|
|
658
|
-
"bottom",
|
|
659
|
-
"boxDecorationBreak",
|
|
660
|
-
"boxShadow",
|
|
661
|
-
"boxSizing",
|
|
662
|
-
"breakAfter",
|
|
663
|
-
"breakBefore",
|
|
664
|
-
"breakInside",
|
|
665
|
-
"captionSide",
|
|
666
|
-
"caretColor",
|
|
667
|
-
"clear",
|
|
668
|
-
"clip",
|
|
669
|
-
"clipPath",
|
|
670
|
-
"color",
|
|
671
|
-
"colorAdjust",
|
|
672
|
-
"colorInterpolation",
|
|
673
|
-
"colorInterpolationFilters",
|
|
674
|
-
"colorRendering",
|
|
675
|
-
"columnCount",
|
|
676
|
-
"columnFill",
|
|
677
|
-
"columnGap",
|
|
678
|
-
"columnRule",
|
|
679
|
-
"columnRuleColor",
|
|
680
|
-
"columnRuleStyle",
|
|
681
|
-
"columnRuleWidth",
|
|
682
|
-
"columnSpan",
|
|
683
|
-
"columnWidth",
|
|
684
|
-
"columns",
|
|
685
|
-
"contain",
|
|
686
|
-
"content",
|
|
687
|
-
"counterIncrement",
|
|
688
|
-
"counterReset",
|
|
689
|
-
"cursor",
|
|
690
|
-
"direction",
|
|
691
|
-
"display",
|
|
692
|
-
"emptyCells",
|
|
693
|
-
"filter",
|
|
694
|
-
"flex",
|
|
695
|
-
"flexBasis",
|
|
696
|
-
"flexDirection",
|
|
697
|
-
"flexFlow",
|
|
698
|
-
"flexGrow",
|
|
699
|
-
"flexShrink",
|
|
700
|
-
"flexWrap",
|
|
701
|
-
"float",
|
|
702
|
-
"font",
|
|
703
|
-
"fontFamily",
|
|
704
|
-
"fontFeatureSettings",
|
|
705
|
-
"fontKerning",
|
|
706
|
-
"fontLanguageOverride",
|
|
707
|
-
"fontSize",
|
|
708
|
-
"fontSizeAdjust",
|
|
709
|
-
"fontStretch",
|
|
710
|
-
"fontStyle",
|
|
711
|
-
"fontVariant",
|
|
712
|
-
"fontVariantAlternates",
|
|
713
|
-
"fontVariantCaps",
|
|
714
|
-
"fontVariantEastAsian",
|
|
715
|
-
"fontVariantNumeric",
|
|
716
|
-
"fontVariantPosition",
|
|
717
|
-
"fontWeight",
|
|
718
|
-
"fontVariationSettings",
|
|
719
|
-
"fontSynthesis",
|
|
720
|
-
"forcedColorAdjust",
|
|
721
|
-
"gap",
|
|
722
|
-
"grid",
|
|
723
|
-
"gridArea",
|
|
724
|
-
"gridAutoColumns",
|
|
725
|
-
"gridAutoFlow",
|
|
726
|
-
"gridAutoRows",
|
|
727
|
-
"gridColumn",
|
|
728
|
-
"gridColumnEnd",
|
|
729
|
-
"gridColumnGap",
|
|
730
|
-
"gridColumnStart",
|
|
731
|
-
"gridGap",
|
|
732
|
-
"gridRow",
|
|
733
|
-
"gridRowEnd",
|
|
734
|
-
"gridRowGap",
|
|
735
|
-
"gridRowStart",
|
|
736
|
-
"gridTemplate",
|
|
737
|
-
"gridTemplateAreas",
|
|
738
|
-
"gridTemplateColumns",
|
|
739
|
-
"gridTemplateRows",
|
|
740
|
-
"height",
|
|
741
|
-
"hyphens",
|
|
742
|
-
"imageOrientation",
|
|
743
|
-
"imageRendering",
|
|
744
|
-
"imeMode",
|
|
745
|
-
"inset",
|
|
746
|
-
"insetBlock",
|
|
747
|
-
"insetBlockEnd",
|
|
748
|
-
"insetBlockStart",
|
|
749
|
-
"insetInline",
|
|
750
|
-
"insetInlineEnd",
|
|
751
|
-
"insetInlineStart",
|
|
752
|
-
"initialLetter",
|
|
753
|
-
"isolation",
|
|
754
|
-
"justifyContent",
|
|
755
|
-
"justifyItems",
|
|
756
|
-
"justifySelf",
|
|
757
|
-
"left",
|
|
758
|
-
"letterSpacing",
|
|
759
|
-
"lineBreak",
|
|
760
|
-
"lineClamp",
|
|
761
|
-
"lineHeight",
|
|
762
|
-
"listStyle",
|
|
763
|
-
"listStyleImage",
|
|
764
|
-
"listStylePosition",
|
|
765
|
-
"listStyleType",
|
|
766
|
-
"margin",
|
|
767
|
-
"marginBottom",
|
|
768
|
-
"marginLeft",
|
|
769
|
-
"marginRight",
|
|
770
|
-
"marginTop",
|
|
771
|
-
"marginBlock",
|
|
772
|
-
"marginBlockEnd",
|
|
773
|
-
"marginBlockStart",
|
|
774
|
-
"marginInline",
|
|
775
|
-
"marginInlineEnd",
|
|
776
|
-
"marginInlineStart",
|
|
777
|
-
"mask",
|
|
778
|
-
"maskBorder",
|
|
779
|
-
"maskBorderImage",
|
|
780
|
-
"maskBorderOutset",
|
|
781
|
-
"maskBorderRepeat",
|
|
782
|
-
"maskBorderSlice",
|
|
783
|
-
"maskBorderSource",
|
|
784
|
-
"maskBorderWidth",
|
|
785
|
-
"maskClip",
|
|
786
|
-
"maskComposite",
|
|
787
|
-
"maskImage",
|
|
788
|
-
"maskOrigin",
|
|
789
|
-
"maskPosition",
|
|
790
|
-
"maskRepeat",
|
|
791
|
-
"maskSize",
|
|
792
|
-
"maskType",
|
|
793
|
-
"maxBlockSize",
|
|
794
|
-
"maxHeight",
|
|
795
|
-
"maxInlineSize",
|
|
796
|
-
"maxWidth",
|
|
797
|
-
"minBlockSize",
|
|
798
|
-
"minHeight",
|
|
799
|
-
"minInlineSize",
|
|
800
|
-
"minWidth",
|
|
801
|
-
"mixBlendMode",
|
|
802
|
-
"objectFit",
|
|
803
|
-
"objectPosition",
|
|
804
|
-
"objectViewBox",
|
|
805
|
-
"offset",
|
|
806
|
-
"offsetDistance",
|
|
807
|
-
"offsetPath",
|
|
808
|
-
"offsetRotate",
|
|
809
|
-
"opacity",
|
|
810
|
-
"order",
|
|
811
|
-
"orientation",
|
|
812
|
-
"outline",
|
|
813
|
-
"outlineColor",
|
|
814
|
-
"outlineOffset",
|
|
815
|
-
"outlineStyle",
|
|
816
|
-
"outlineWidth",
|
|
817
|
-
"overflow",
|
|
818
|
-
"overflowAnchor",
|
|
819
|
-
"overflowClip",
|
|
820
|
-
"overflowScrolling",
|
|
821
|
-
"overflowWrap",
|
|
822
|
-
"overflowX",
|
|
823
|
-
"overflowY",
|
|
824
|
-
"padding",
|
|
825
|
-
"paddingBottom",
|
|
826
|
-
"paddingLeft",
|
|
827
|
-
"paddingRight",
|
|
828
|
-
"paddingTop",
|
|
829
|
-
"pageBreakAfter",
|
|
830
|
-
"pageBreakBefore",
|
|
831
|
-
"pageBreakInside",
|
|
832
|
-
"paintOrder",
|
|
833
|
-
"perspective",
|
|
834
|
-
"perspectiveOrigin",
|
|
835
|
-
"placeContent",
|
|
836
|
-
"placeItems",
|
|
837
|
-
"placeSelf",
|
|
838
|
-
"pointerEvents",
|
|
839
|
-
"position",
|
|
840
|
-
"resize",
|
|
841
|
-
"right",
|
|
842
|
-
"rotate",
|
|
843
|
-
"rowGap",
|
|
844
|
-
"scrollBehavior",
|
|
845
|
-
"scrollPadding",
|
|
846
|
-
"scrollSnapAlign",
|
|
847
|
-
"scrollSnapType",
|
|
848
|
-
"scrollbarColor",
|
|
849
|
-
"scrollbarWidth",
|
|
850
|
-
"shapeImageThreshold",
|
|
851
|
-
"shapeMargin",
|
|
852
|
-
"shapeOutside",
|
|
853
|
-
"tabSize",
|
|
854
|
-
"tableLayout",
|
|
855
|
-
"textAlign",
|
|
856
|
-
"textAlignLast",
|
|
857
|
-
"textDecoration",
|
|
858
|
-
"textDecorationColor",
|
|
859
|
-
"textDecorationLine",
|
|
860
|
-
"textDecorationSkipInk",
|
|
861
|
-
"textDecorationStyle",
|
|
862
|
-
"textDecorationThickness",
|
|
863
|
-
"textIndent",
|
|
864
|
-
"textOverflow",
|
|
865
|
-
"textShadow",
|
|
866
|
-
"textTransform",
|
|
867
|
-
"textUnderlineOffset",
|
|
868
|
-
"top",
|
|
869
|
-
"transform",
|
|
870
|
-
"transformOrigin",
|
|
871
|
-
"transformStyle",
|
|
872
|
-
"transition",
|
|
873
|
-
"transitionDelay",
|
|
874
|
-
"transitionDuration",
|
|
875
|
-
"transitionProperty",
|
|
876
|
-
"transitionTimingFunction",
|
|
877
|
-
"translate",
|
|
878
|
-
"translateX",
|
|
879
|
-
"translateY",
|
|
880
|
-
"translateZ",
|
|
881
|
-
"unicodeBidi",
|
|
882
|
-
"userSelect",
|
|
883
|
-
"verticalAlign",
|
|
884
|
-
"visibility",
|
|
885
|
-
"whiteSpace",
|
|
886
|
-
"widows",
|
|
887
|
-
"width",
|
|
888
|
-
"willChange",
|
|
889
|
-
"wordBreak",
|
|
890
|
-
"wordSpacing",
|
|
891
|
-
"wordWrap",
|
|
892
|
-
"writingMode",
|
|
893
|
-
"zIndex"
|
|
894
|
-
]);
|
|
895
|
-
|
|
896
|
-
// src/transform/transformers.js
|
|
897
|
-
var import_utils5 = __require("@domql/utils");
|
|
898
|
-
var applyMediaProps = (key, selectorProps, element) => {
|
|
899
|
-
const { context } = element;
|
|
900
|
-
if (!context.designSystem?.media) return;
|
|
901
|
-
const mediaValue = context.designSystem.media[key.slice(1)];
|
|
902
|
-
const generatedClass = useCssInProps(selectorProps, element);
|
|
903
|
-
let mediaKey;
|
|
904
|
-
if (!mediaValue) {
|
|
905
|
-
mediaKey = key;
|
|
906
|
-
} else if (mediaValue === "print") {
|
|
907
|
-
mediaKey = "@media print";
|
|
908
|
-
} else if (mediaValue[0] === "(") {
|
|
909
|
-
mediaKey = `@media screen and ${mediaValue}`;
|
|
910
|
-
} else {
|
|
911
|
-
mediaKey = `${mediaValue} &`;
|
|
912
|
-
}
|
|
913
|
-
return { [mediaKey]: generatedClass };
|
|
914
|
-
};
|
|
915
|
-
var applyAndProps = (key, selectorProps, element) => {
|
|
916
|
-
return { [key]: useCssInProps(selectorProps, element) };
|
|
917
|
-
};
|
|
918
|
-
var applySelectorProps = (key, selectorProps, element) => {
|
|
919
|
-
const selectorKey = `&${key}`;
|
|
920
|
-
return { [selectorKey]: useCssInProps(selectorProps, element) };
|
|
921
|
-
};
|
|
922
|
-
var resolveCase = (caseKey, element) => {
|
|
923
|
-
const caseFn = element.context?.cases?.[caseKey];
|
|
924
|
-
if (caseFn === void 0) return void 0;
|
|
925
|
-
if ((0, import_utils5.isFunction)(caseFn)) return caseFn.call(element, element);
|
|
926
|
-
return !!caseFn;
|
|
927
|
-
};
|
|
928
|
-
var applyCaseProps = (key, selectorProps, element) => {
|
|
929
|
-
const caseKey = key.slice(1);
|
|
930
|
-
let isCaseTrue = resolveCase(caseKey, element);
|
|
931
|
-
if (isCaseTrue === void 0) {
|
|
932
|
-
isCaseTrue = !!element.props?.[caseKey];
|
|
933
|
-
}
|
|
934
|
-
if (!isCaseTrue) return;
|
|
935
|
-
return useCssInProps(selectorProps, element);
|
|
936
|
-
};
|
|
937
|
-
var applyVariableProps = (key, selectorVal, element) => {
|
|
938
|
-
return { [key]: selectorVal };
|
|
939
|
-
};
|
|
940
|
-
var applyConditionalCaseProps = (key, selectorProps, element) => {
|
|
941
|
-
const caseKey = key.slice(1);
|
|
942
|
-
let isCaseTrue = element.props[caseKey] === true || element.state[caseKey] || element[caseKey];
|
|
943
|
-
if (!isCaseTrue) {
|
|
944
|
-
const caseResult = resolveCase(caseKey, element);
|
|
945
|
-
if (caseResult !== void 0) isCaseTrue = caseResult;
|
|
946
|
-
}
|
|
947
|
-
if (!isCaseTrue) return;
|
|
948
|
-
return useCssInProps(selectorProps, element);
|
|
949
|
-
};
|
|
950
|
-
var applyConditionalFalsyProps = (key, selectorProps, element) => {
|
|
951
|
-
const caseKey = key.slice(1);
|
|
952
|
-
let isCaseTrue = element.props[caseKey] === true || element.state[caseKey] || element[caseKey];
|
|
953
|
-
if (!isCaseTrue) {
|
|
954
|
-
const caseResult = resolveCase(caseKey, element);
|
|
955
|
-
if (caseResult !== void 0) isCaseTrue = caseResult;
|
|
956
|
-
}
|
|
957
|
-
if (isCaseTrue) return;
|
|
958
|
-
return useCssInProps(selectorProps, element);
|
|
959
|
-
};
|
|
960
|
-
var applyTrueProps = (selectorProps, element) => {
|
|
961
|
-
return useCssInProps(selectorProps, element);
|
|
962
|
-
};
|
|
963
|
-
var transformersByPrefix = {
|
|
964
|
-
"@": applyMediaProps,
|
|
965
|
-
// Selector handlers
|
|
966
|
-
":": applySelectorProps,
|
|
967
|
-
"[": applySelectorProps,
|
|
968
|
-
"*": applySelectorProps,
|
|
969
|
-
"+": applySelectorProps,
|
|
970
|
-
"~": applySelectorProps,
|
|
971
|
-
"&": applyAndProps,
|
|
972
|
-
">": applyAndProps,
|
|
973
|
-
// Conditional and variable handlers
|
|
974
|
-
$: applyCaseProps,
|
|
975
|
-
"-": applyVariableProps,
|
|
976
|
-
".": applyConditionalCaseProps,
|
|
977
|
-
"!": applyConditionalFalsyProps
|
|
978
|
-
};
|
|
979
|
-
|
|
980
|
-
// src/transform/executors.js
|
|
981
|
-
var isProd = (0, import_utils6.isProduction)();
|
|
982
|
-
var usePropsAsCSS = (sourceObj, element, opts) => {
|
|
983
|
-
let obj = {};
|
|
984
|
-
const rest = {};
|
|
985
|
-
const setToObj = (key, val) => {
|
|
986
|
-
if (opts.unpack) {
|
|
987
|
-
obj = { ...obj, ...val };
|
|
988
|
-
return;
|
|
989
|
-
}
|
|
990
|
-
obj[key] = val;
|
|
991
|
-
};
|
|
992
|
-
for (const key in sourceObj) {
|
|
993
|
-
const value = sourceObj[key];
|
|
994
|
-
if (key === "class" && element.call("isString", sourceObj.class)) {
|
|
995
|
-
const val = value.split(" ");
|
|
996
|
-
if (val.length) {
|
|
997
|
-
const CLASS = element.context.designSystem.class;
|
|
998
|
-
const result = val.reduce((acc, curr) => (0, import_utils6.merge)(acc, CLASS[curr]), {});
|
|
999
|
-
obj.designSystemClass = result;
|
|
1000
|
-
}
|
|
1001
|
-
} else if (key === "true") {
|
|
1002
|
-
const val = (0, import_utils6.exec)(value, element);
|
|
1003
|
-
(0, import_utils6.merge)(obj, applyTrueProps(val, element));
|
|
1004
|
-
} else if (element.classlist[key]) {
|
|
1005
|
-
const originalFromClass = element.classlist[key];
|
|
1006
|
-
const result = (0, import_utils6.isFunction)(originalFromClass) ? originalFromClass(element, element.state, element.context) : originalFromClass;
|
|
1007
|
-
if (result) setToObj(key, result);
|
|
1008
|
-
if (!isProd && (0, import_utils6.isObject)(obj[key])) obj[key].label = key;
|
|
1009
|
-
} else if (CSS_PROPS_REGISTRY[key]) {
|
|
1010
|
-
let val = (0, import_utils6.exec)(value, element);
|
|
1011
|
-
if ((0, import_utils6.isArray)(val)) {
|
|
1012
|
-
val = val.reduce((a, c) => (0, import_utils6.merge)(a, c), {});
|
|
1013
|
-
}
|
|
1014
|
-
let result = CSS_PROPS_REGISTRY[key](val, element, element.state, element.context);
|
|
1015
|
-
if ((0, import_utils6.isArray)(result)) result = result.reduce((a, c) => (0, import_utils6.merge)(a, c), {});
|
|
1016
|
-
if (result) setToObj(key, result);
|
|
1017
|
-
if (!isProd && (0, import_utils6.isObject)(obj[key])) obj[key].label = key;
|
|
1018
|
-
} else if (DEFAULT_CSS_PROPERTIES_LIST.has(key)) {
|
|
1019
|
-
let result = (0, import_utils6.exec)(value, element);
|
|
1020
|
-
if (typeof result === "string" && result.charCodeAt(0) === 45 && result.charCodeAt(1) === 45) {
|
|
1021
|
-
result = `var(${result})`;
|
|
1022
|
-
}
|
|
1023
|
-
setToObj(key, { [key]: result });
|
|
1024
|
-
if (!isProd && (0, import_utils6.isObject)(obj[key])) obj[key].label = key;
|
|
1025
|
-
} else {
|
|
1026
|
-
rest[key] = value;
|
|
1027
|
-
}
|
|
1028
|
-
}
|
|
1029
|
-
return [obj, rest];
|
|
1030
|
-
};
|
|
1031
|
-
var useSelectorsAsCSS = (sourceObj, element) => {
|
|
1032
|
-
const obj = {};
|
|
1033
|
-
for (const key in sourceObj) {
|
|
1034
|
-
const selectroSetter = transformersByPrefix[key.slice(0, 1)];
|
|
1035
|
-
if (selectroSetter) {
|
|
1036
|
-
const result = selectroSetter(key, sourceObj[key], element);
|
|
1037
|
-
if (result) {
|
|
1038
|
-
for (const k in result) {
|
|
1039
|
-
if (Object.prototype.hasOwnProperty.call(result, k)) {
|
|
1040
|
-
if (obj[k] && typeof obj[k] === "object" && typeof result[k] === "object") {
|
|
1041
|
-
(0, import_utils6.overwriteDeep)(obj[k], result[k]);
|
|
1042
|
-
} else {
|
|
1043
|
-
obj[k] = result[k];
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
}
|
|
1047
|
-
}
|
|
1048
|
-
}
|
|
1049
|
-
}
|
|
1050
|
-
return obj;
|
|
1051
|
-
};
|
|
1052
|
-
var useCssInProps = (selectorProps, element, opts = { unpack: true }) => {
|
|
1053
|
-
const [cssObj, restProps] = usePropsAsCSS(selectorProps, element, opts);
|
|
1054
|
-
const selectorsObj = useSelectorsAsCSS(restProps, element);
|
|
1055
|
-
let hasSelectors = false;
|
|
1056
|
-
for (const _k in selectorsObj) {
|
|
1057
|
-
hasSelectors = true;
|
|
1058
|
-
break;
|
|
1059
|
-
}
|
|
1060
|
-
if (hasSelectors) {
|
|
1061
|
-
if (opts.unpack) return (0, import_utils6.overwrite)(cssObj, selectorsObj);
|
|
1062
|
-
cssObj._selectors = selectorsObj;
|
|
1063
|
-
}
|
|
1064
|
-
return cssObj;
|
|
1065
|
-
};
|
|
1066
|
-
var exetuteClassPerComponent = (component, element) => {
|
|
1067
|
-
const classObj = {};
|
|
1068
|
-
if (component.class) {
|
|
1069
|
-
for (const classProp in component.class) {
|
|
1070
|
-
classObj[classProp] = component.class[classProp](element);
|
|
1071
|
-
}
|
|
1072
|
-
}
|
|
1073
|
-
return classObj;
|
|
1074
|
-
};
|
|
1075
|
-
|
|
1076
|
-
// src/emotion.js
|
|
1077
|
-
var import_utils7 = __require("@domql/utils");
|
|
1078
|
-
var import_emotion2 = __require("@symbo.ls/emotion");
|
|
1079
|
-
var { css } = import_emotion2.emotion;
|
|
1080
|
-
var transformEmotion = (props, callback) => {
|
|
1081
|
-
return (0, import_utils7.isFunction)(callback) ? callback(props) : css(props);
|
|
1082
|
-
};
|
|
1083
|
-
return __toCommonJS(index_exports);
|
|
1084
|
-
})();
|