css-in-props 3.4.4 → 3.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/props/animation.js +121 -0
- package/dist/cjs/props/block.js +179 -0
- package/dist/cjs/props/defaults.js +340 -0
- package/dist/cjs/props/flex.js +45 -0
- package/dist/cjs/props/font.js +36 -0
- package/dist/cjs/props/grid.js +39 -0
- package/dist/cjs/props/index.js +56 -0
- package/dist/cjs/props/misc.js +35 -0
- package/dist/cjs/props/position.js +51 -0
- package/dist/cjs/props/theme.js +149 -0
- package/dist/cjs/props/timing.js +42 -0
- package/dist/cjs/transform/executors.js +111 -0
- package/dist/cjs/transform/index.js +18 -0
- package/dist/cjs/transform/transformers.js +81 -0
- package/dist/esm/props/animation.js +101 -0
- package/dist/esm/props/block.js +165 -0
- package/dist/esm/props/defaults.js +321 -0
- package/dist/esm/props/flex.js +25 -0
- package/dist/esm/props/font.js +16 -0
- package/dist/esm/props/grid.js +19 -0
- package/dist/esm/props/index.js +35 -0
- package/dist/esm/props/misc.js +15 -0
- package/dist/esm/props/position.js +31 -0
- package/dist/esm/props/theme.js +139 -0
- package/dist/esm/props/timing.js +26 -0
- package/dist/esm/transform/executors.js +91 -0
- package/dist/esm/transform/index.js +1 -0
- package/dist/esm/transform/transformers.js +61 -0
- package/package.json +10 -10
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var animation_exports = {};
|
|
20
|
+
__export(animation_exports, {
|
|
21
|
+
ANIMATION_PROPS: () => ANIMATION_PROPS
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(animation_exports);
|
|
24
|
+
var import_utils = require("@domql/utils");
|
|
25
|
+
var import_emotion = require("@symbo.ls/emotion");
|
|
26
|
+
var import_scratch = require("@symbo.ls/scratch");
|
|
27
|
+
const TIMING_FUNCTIONS = ["ease", "linear", "ease-in", "ease-out", "ease-in-out", "step-start", "step-end"];
|
|
28
|
+
const FILL_MODES = ["none", "forwards", "backwards", "both"];
|
|
29
|
+
const DIRECTIONS = ["normal", "reverse", "alternate", "alternate-reverse"];
|
|
30
|
+
const PLAY_STATES = ["running", "paused"];
|
|
31
|
+
const isDuration = (v) => /^[\d.]+m?s$/.test(v);
|
|
32
|
+
const applyAnimationProps = (animation, element) => {
|
|
33
|
+
const { emotion: ctxEmotion } = element.context;
|
|
34
|
+
const { keyframes } = ctxEmotion || import_emotion.emotion;
|
|
35
|
+
if ((0, import_utils.isObject)(animation)) return { animationName: keyframes(animation) };
|
|
36
|
+
const { ANIMATION } = element.context && element.context.designSystem;
|
|
37
|
+
const record = ANIMATION[animation];
|
|
38
|
+
return keyframes(record);
|
|
39
|
+
};
|
|
40
|
+
const parseAnimationShorthand = (val, el) => {
|
|
41
|
+
const { ANIMATION } = el.context && el.context.designSystem || {};
|
|
42
|
+
const tokens = val.split(/\s+/);
|
|
43
|
+
let name = null;
|
|
44
|
+
const durations = [];
|
|
45
|
+
let timingFunction = null;
|
|
46
|
+
let iterationCount = null;
|
|
47
|
+
let direction = null;
|
|
48
|
+
let fillMode = null;
|
|
49
|
+
let playState = null;
|
|
50
|
+
for (const token of tokens) {
|
|
51
|
+
if (ANIMATION && ANIMATION[token]) {
|
|
52
|
+
name = token;
|
|
53
|
+
} else if (isDuration(token)) {
|
|
54
|
+
durations.push(token);
|
|
55
|
+
} else if (TIMING_FUNCTIONS.includes(token) || token.startsWith("cubic-bezier") || token.startsWith("steps(")) {
|
|
56
|
+
timingFunction = token;
|
|
57
|
+
} else if (token === "infinite" || /^\d+$/.test(token)) {
|
|
58
|
+
iterationCount = token === "infinite" ? token : Number(token);
|
|
59
|
+
} else if (DIRECTIONS.includes(token)) {
|
|
60
|
+
direction = token;
|
|
61
|
+
} else if (FILL_MODES.includes(token)) {
|
|
62
|
+
fillMode = token;
|
|
63
|
+
} else if (PLAY_STATES.includes(token)) {
|
|
64
|
+
playState = token;
|
|
65
|
+
} else if (!name) {
|
|
66
|
+
name = token;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return { name, durations, timingFunction, iterationCount, direction, fillMode, playState };
|
|
70
|
+
};
|
|
71
|
+
const ANIMATION_PROPS = {
|
|
72
|
+
animation: (val, el) => {
|
|
73
|
+
if ((0, import_utils.isString)(val) && val.includes(" ")) {
|
|
74
|
+
const parsed = parseAnimationShorthand(val, el);
|
|
75
|
+
return {
|
|
76
|
+
animationName: applyAnimationProps(parsed.name || val, el),
|
|
77
|
+
animationDuration: parsed.durations[0] || (0, import_scratch.getTimingByKey)(el.props.animationDuration || "A").timing,
|
|
78
|
+
animationDelay: parsed.durations[1] || (0, import_scratch.getTimingByKey)(el.props.animationDelay || "0s").timing,
|
|
79
|
+
animationTimingFunction: parsed.timingFunction || (0, import_scratch.getTimingFunction)(el.props.animationTimingFunction || "ease"),
|
|
80
|
+
animationFillMode: parsed.fillMode || el.props.animationFillMode || "both",
|
|
81
|
+
animationIterationCount: parsed.iterationCount != null ? parsed.iterationCount : el.props.animationIterationCount || 1,
|
|
82
|
+
animationPlayState: parsed.playState || el.props.animationPlayState,
|
|
83
|
+
animationDirection: parsed.direction || el.props.animationDirection
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
animationName: applyAnimationProps(val, el),
|
|
88
|
+
animationDuration: (0, import_scratch.getTimingByKey)(el.props.animationDuration || "A").timing,
|
|
89
|
+
animationDelay: (0, import_scratch.getTimingByKey)(el.props.animationDelay || "0s").timing,
|
|
90
|
+
animationTimingFunction: (0, import_scratch.getTimingFunction)(el.props.animationTimingFunction || "ease"),
|
|
91
|
+
animationFillMode: el.props.animationFillMode || "both",
|
|
92
|
+
animationIterationCount: el.props.animationIterationCount || 1,
|
|
93
|
+
animationPlayState: el.props.animationPlayState,
|
|
94
|
+
animationDirection: el.props.animationDirection
|
|
95
|
+
};
|
|
96
|
+
},
|
|
97
|
+
animationName: (val, el) => ({
|
|
98
|
+
animationName: applyAnimationProps(val, el)
|
|
99
|
+
}),
|
|
100
|
+
animationDuration: (val) => ({
|
|
101
|
+
animationDuration: (0, import_scratch.getTimingByKey)(val).timing
|
|
102
|
+
}),
|
|
103
|
+
animationDelay: (val) => ({
|
|
104
|
+
animationDelay: (0, import_scratch.getTimingByKey)(val).timing
|
|
105
|
+
}),
|
|
106
|
+
animationTimingFunction: (val) => ({
|
|
107
|
+
animationTimingFunction: (0, import_scratch.getTimingFunction)(val)
|
|
108
|
+
}),
|
|
109
|
+
animationIterationCount: (val) => ({
|
|
110
|
+
animationIterationCount: val
|
|
111
|
+
}),
|
|
112
|
+
animationFillMode: (val) => ({
|
|
113
|
+
animationFillMode: val
|
|
114
|
+
}),
|
|
115
|
+
animationPlayState: (val) => ({
|
|
116
|
+
animationPlayState: val
|
|
117
|
+
}),
|
|
118
|
+
animationDirection: (val) => ({
|
|
119
|
+
animationDirection: val
|
|
120
|
+
})
|
|
121
|
+
};
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var block_exports = {};
|
|
20
|
+
__export(block_exports, {
|
|
21
|
+
BLOCK_PROPS: () => BLOCK_PROPS
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(block_exports);
|
|
24
|
+
var import_utils = require("@domql/utils");
|
|
25
|
+
var import_scratch = require("@symbo.ls/scratch");
|
|
26
|
+
const BLOCK_PROPS = {
|
|
27
|
+
show: (val, el, s, ctx) => !!(ctx.utils.exec(val, el, s) === false) && {
|
|
28
|
+
display: "none !important"
|
|
29
|
+
},
|
|
30
|
+
hide: (val, el, s, ctx) => !!ctx.utils.exec(val, el, s) && {
|
|
31
|
+
display: "none !important"
|
|
32
|
+
},
|
|
33
|
+
height: (val, { props }) => (0, import_scratch.transformSizeRatio)("height", val, props),
|
|
34
|
+
width: (val, { props }) => (0, import_scratch.transformSizeRatio)("width", val, props),
|
|
35
|
+
boxSizing: (val) => !(0, import_utils.isUndefined)(val) ? { boxSizing: val } : { boxSizing: "border-box" },
|
|
36
|
+
boxSize: (val) => {
|
|
37
|
+
if (!(0, import_utils.isString)(val)) return;
|
|
38
|
+
const [height, width] = val.split(" ");
|
|
39
|
+
return {
|
|
40
|
+
...(0, import_scratch.transformSize)("height", height),
|
|
41
|
+
...(0, import_scratch.transformSize)("width", width || height)
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
inlineSize: (val, { props }) => (0, import_scratch.transformSizeRatio)("inlineSize", val, props),
|
|
45
|
+
blockSize: (val, { props }) => (0, import_scratch.transformSizeRatio)("blockSize", val, props),
|
|
46
|
+
minWidth: (val, { props }) => (0, import_scratch.transformSizeRatio)("minWidth", val, props),
|
|
47
|
+
maxWidth: (val, { props }) => (0, import_scratch.transformSizeRatio)("maxWidth", val, props),
|
|
48
|
+
widthRange: (val) => {
|
|
49
|
+
if (!(0, import_utils.isString)(val)) return;
|
|
50
|
+
const [minWidth, maxWidth] = val.split(" ");
|
|
51
|
+
return {
|
|
52
|
+
...(0, import_scratch.transformSize)("minWidth", minWidth),
|
|
53
|
+
...(0, import_scratch.transformSize)("maxWidth", maxWidth || minWidth)
|
|
54
|
+
};
|
|
55
|
+
},
|
|
56
|
+
minHeight: (val, { props }) => (0, import_scratch.transformSizeRatio)("minHeight", val, props),
|
|
57
|
+
maxHeight: (val, { props }) => (0, import_scratch.transformSizeRatio)("maxHeight", val, props),
|
|
58
|
+
heightRange: (val) => {
|
|
59
|
+
if (!(0, import_utils.isString)(val)) return;
|
|
60
|
+
const [minHeight, maxHeight] = val.split(" ");
|
|
61
|
+
return {
|
|
62
|
+
...(0, import_scratch.transformSize)("minHeight", minHeight),
|
|
63
|
+
...(0, import_scratch.transformSize)("maxHeight", maxHeight || minHeight)
|
|
64
|
+
};
|
|
65
|
+
},
|
|
66
|
+
size: (val) => {
|
|
67
|
+
if (!(0, import_utils.isString)(val)) return;
|
|
68
|
+
const [inlineSize, blockSize] = val.split(" ");
|
|
69
|
+
return {
|
|
70
|
+
...(0, import_scratch.transformSizeRatio)("inlineSize", inlineSize),
|
|
71
|
+
...(0, import_scratch.transformSizeRatio)("blockSize", blockSize || inlineSize)
|
|
72
|
+
};
|
|
73
|
+
},
|
|
74
|
+
minBlockSize: (val, { props }) => (0, import_scratch.transformSizeRatio)("minBlockSize", val, props),
|
|
75
|
+
minInlineSize: (val, { props }) => (0, import_scratch.transformSizeRatio)("minInlineSize", val, props),
|
|
76
|
+
maxBlockSize: (val, { props }) => (0, import_scratch.transformSizeRatio)("maxBlockSize", val, props),
|
|
77
|
+
maxInlineSize: (val, { props }) => (0, import_scratch.transformSizeRatio)("maxInlineSize", val, props),
|
|
78
|
+
minSize: (val) => {
|
|
79
|
+
if (!(0, import_utils.isString)(val)) return;
|
|
80
|
+
const [minInlineSize, minBlockSize] = val.split(" ");
|
|
81
|
+
return {
|
|
82
|
+
...(0, import_scratch.transformSize)("minInlineSize", minInlineSize),
|
|
83
|
+
...(0, import_scratch.transformSize)("minBlockSize", minBlockSize || minInlineSize)
|
|
84
|
+
};
|
|
85
|
+
},
|
|
86
|
+
maxSize: (val) => {
|
|
87
|
+
if (!(0, import_utils.isString)(val)) return;
|
|
88
|
+
const [maxInlineSize, maxBlockSize] = val.split(" ");
|
|
89
|
+
return {
|
|
90
|
+
...(0, import_scratch.transformSize)("maxInlineSize", maxInlineSize),
|
|
91
|
+
...(0, import_scratch.transformSize)("maxBlockSize", maxBlockSize || maxInlineSize)
|
|
92
|
+
};
|
|
93
|
+
},
|
|
94
|
+
borderWidth: (val, { props }) => (0, import_scratch.transformSizeRatio)("borderWidth", val, props),
|
|
95
|
+
padding: (val, { props }) => (0, import_scratch.transformSizeRatio)("padding", val, props),
|
|
96
|
+
scrollPadding: (val, { props }) => (0, import_scratch.transformSizeRatio)("scrollPadding", val, props),
|
|
97
|
+
paddingInline: (val) => {
|
|
98
|
+
if (!(0, import_utils.isString)(val)) return;
|
|
99
|
+
const [paddingInlineStart, paddingInlineEnd] = val.split(" ");
|
|
100
|
+
return {
|
|
101
|
+
...(0, import_scratch.transformSize)("paddingInlineStart", paddingInlineStart),
|
|
102
|
+
...(0, import_scratch.transformSize)("paddingInlineEnd", paddingInlineEnd || paddingInlineStart)
|
|
103
|
+
};
|
|
104
|
+
},
|
|
105
|
+
paddingBlock: (val) => {
|
|
106
|
+
if (!(0, import_utils.isString)(val)) return;
|
|
107
|
+
const [paddingBlockStart, paddingBlockEnd] = val.split(" ");
|
|
108
|
+
return {
|
|
109
|
+
...(0, import_scratch.transformSize)("paddingBlockStart", paddingBlockStart),
|
|
110
|
+
...(0, import_scratch.transformSize)("paddingBlockEnd", paddingBlockEnd || paddingBlockStart)
|
|
111
|
+
};
|
|
112
|
+
},
|
|
113
|
+
// Traditional directional padding
|
|
114
|
+
paddingTop: (val, { props }) => (0, import_scratch.transformSizeRatio)("paddingBlockStart", val, props),
|
|
115
|
+
paddingBottom: (val, { props }) => (0, import_scratch.transformSizeRatio)("paddingBlockEnd", val, props),
|
|
116
|
+
paddingLeft: (val, { props }) => (0, import_scratch.transformSizeRatio)("paddingInlineStart", val, props),
|
|
117
|
+
paddingRight: (val, { props }) => (0, import_scratch.transformSizeRatio)("paddingInlineEnd", val, props),
|
|
118
|
+
// Logical properties (for reference)
|
|
119
|
+
paddingBlockStart: (val, { props }) => (0, import_scratch.transformSizeRatio)("paddingBlockStart", val, props),
|
|
120
|
+
// maps to top
|
|
121
|
+
paddingBlockEnd: (val, { props }) => (0, import_scratch.transformSizeRatio)("paddingBlockEnd", val, props),
|
|
122
|
+
// maps to bottom
|
|
123
|
+
paddingInlineStart: (val, { props }) => (0, import_scratch.transformSizeRatio)("paddingInlineStart", val, props),
|
|
124
|
+
// maps to left
|
|
125
|
+
paddingInlineEnd: (val, { props }) => (0, import_scratch.transformSizeRatio)("paddingInlineEnd", val, props),
|
|
126
|
+
// maps to right
|
|
127
|
+
margin: (val, { props }) => (0, import_scratch.transformSizeRatio)("margin", val, props),
|
|
128
|
+
marginInline: (val) => {
|
|
129
|
+
if (!(0, import_utils.isString)(val)) return;
|
|
130
|
+
const [marginInlineStart, marginInlineEnd] = val.split(" ");
|
|
131
|
+
return {
|
|
132
|
+
...(0, import_scratch.transformSize)("marginInlineStart", marginInlineStart),
|
|
133
|
+
...(0, import_scratch.transformSize)("marginInlineEnd", marginInlineEnd || marginInlineStart)
|
|
134
|
+
};
|
|
135
|
+
},
|
|
136
|
+
marginBlock: (val, { props }) => {
|
|
137
|
+
if (!(0, import_utils.isString)(props.marginBlock)) return;
|
|
138
|
+
const [marginBlockStart, marginBlockEnd] = props.marginBlock.split(" ");
|
|
139
|
+
return {
|
|
140
|
+
...(0, import_scratch.transformSize)("marginBlockStart", marginBlockStart),
|
|
141
|
+
...(0, import_scratch.transformSize)("marginBlockEnd", marginBlockEnd || marginBlockStart)
|
|
142
|
+
};
|
|
143
|
+
},
|
|
144
|
+
marginInlineStart: (val, { props }) => (0, import_scratch.transformSizeRatio)("marginInlineStart", val, props),
|
|
145
|
+
marginInlineEnd: (val, { props }) => (0, import_scratch.transformSizeRatio)("marginInlineEnd", val, props),
|
|
146
|
+
marginBlockStart: (val, { props }) => (0, import_scratch.transformSizeRatio)("marginBlockStart", val, props),
|
|
147
|
+
marginBlockEnd: (val, { props }) => (0, import_scratch.transformSizeRatio)("marginBlockEnd", val, props),
|
|
148
|
+
gap: (val) => ({
|
|
149
|
+
gap: (0, import_scratch.transfromGap)(val)
|
|
150
|
+
}),
|
|
151
|
+
columnGap: (val, { props }) => (0, import_scratch.getSpacingBasedOnRatio)(props, "columnGap", val),
|
|
152
|
+
rowGap: (val, { props }) => (0, import_scratch.getSpacingBasedOnRatio)(props, "rowGap", val),
|
|
153
|
+
flexWrap: (val, { props }) => ({
|
|
154
|
+
display: "flex",
|
|
155
|
+
flexFlow: (val || "row").split(" ")[0] + " " + props.flexWrap
|
|
156
|
+
}),
|
|
157
|
+
flexFlow: (val, { props }) => {
|
|
158
|
+
const { reverse } = props;
|
|
159
|
+
if (!(0, import_utils.isString)(val)) return;
|
|
160
|
+
let [direction, wrap] = (val || "row").split(" ");
|
|
161
|
+
if (val.startsWith("x") || val === "row") direction = "row";
|
|
162
|
+
if (val.startsWith("y") || val === "column") direction = "column";
|
|
163
|
+
return {
|
|
164
|
+
display: "flex",
|
|
165
|
+
flexFlow: (direction || "") + (!direction.includes("-reverse") && reverse ? "-reverse" : "") + " " + (wrap || "")
|
|
166
|
+
};
|
|
167
|
+
},
|
|
168
|
+
flexAlign: (val) => {
|
|
169
|
+
if (!(0, import_utils.isString)(val)) return;
|
|
170
|
+
const [alignItems, justifyContent] = val.split(" ");
|
|
171
|
+
return {
|
|
172
|
+
display: "flex",
|
|
173
|
+
alignItems,
|
|
174
|
+
justifyContent
|
|
175
|
+
};
|
|
176
|
+
},
|
|
177
|
+
round: (val, { props }) => (0, import_scratch.transformBorderRadius)(val || props.borderRadius, props, "round"),
|
|
178
|
+
borderRadius: (val, { props }) => (0, import_scratch.transformBorderRadius)(val || props.round, props, "borderRadius")
|
|
179
|
+
};
|
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var defaults_exports = {};
|
|
19
|
+
__export(defaults_exports, {
|
|
20
|
+
DEFAULT_CSS_PROPERTIES_LIST: () => DEFAULT_CSS_PROPERTIES_LIST
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(defaults_exports);
|
|
23
|
+
const DEFAULT_CSS_PROPERTIES_LIST = /* @__PURE__ */ new Set([
|
|
24
|
+
"accentColor",
|
|
25
|
+
"alignContent",
|
|
26
|
+
"alignItems",
|
|
27
|
+
"alignSelf",
|
|
28
|
+
"alignmentBaseline",
|
|
29
|
+
"all",
|
|
30
|
+
"animation",
|
|
31
|
+
"animationDelay",
|
|
32
|
+
"animationDirection",
|
|
33
|
+
"animationDuration",
|
|
34
|
+
"animationFillMode",
|
|
35
|
+
"animationIterationCount",
|
|
36
|
+
"animationName",
|
|
37
|
+
"animationPlayState",
|
|
38
|
+
"animationTimingFunction",
|
|
39
|
+
"appearance",
|
|
40
|
+
"aspectRatio",
|
|
41
|
+
"backdropFilter",
|
|
42
|
+
"backfaceVisibility",
|
|
43
|
+
"background",
|
|
44
|
+
"backgroundAttachment",
|
|
45
|
+
"backgroundBlendMode",
|
|
46
|
+
"backgroundClip",
|
|
47
|
+
"backgroundColor",
|
|
48
|
+
"backgroundImage",
|
|
49
|
+
"backgroundOrigin",
|
|
50
|
+
"backgroundPosition",
|
|
51
|
+
"backgroundPositionX",
|
|
52
|
+
"backgroundPositionY",
|
|
53
|
+
"backgroundRepeat",
|
|
54
|
+
"backgroundRepeatX",
|
|
55
|
+
"backgroundRepeatY",
|
|
56
|
+
"backgroundSize",
|
|
57
|
+
"baselineShift",
|
|
58
|
+
"blockSize",
|
|
59
|
+
"border",
|
|
60
|
+
"borderBlock",
|
|
61
|
+
"borderBlockColor",
|
|
62
|
+
"borderBlockEnd",
|
|
63
|
+
"borderBlockEndColor",
|
|
64
|
+
"borderBlockEndStyle",
|
|
65
|
+
"borderBlockEndWidth",
|
|
66
|
+
"borderBlockStart",
|
|
67
|
+
"borderBlockStartColor",
|
|
68
|
+
"borderBlockStartStyle",
|
|
69
|
+
"borderBlockStartWidth",
|
|
70
|
+
"borderBlockStyle",
|
|
71
|
+
"borderBlockWidth",
|
|
72
|
+
"borderBottom",
|
|
73
|
+
"borderBottomColor",
|
|
74
|
+
"borderBottomLeftRadius",
|
|
75
|
+
"borderBottomRightRadius",
|
|
76
|
+
"borderBottomStyle",
|
|
77
|
+
"borderBottomWidth",
|
|
78
|
+
"borderCollapse",
|
|
79
|
+
"borderColor",
|
|
80
|
+
"borderImage",
|
|
81
|
+
"borderImageOutset",
|
|
82
|
+
"borderImageRepeat",
|
|
83
|
+
"borderImageSlice",
|
|
84
|
+
"borderImageSource",
|
|
85
|
+
"borderImageWidth",
|
|
86
|
+
"borderLeft",
|
|
87
|
+
"borderLeftColor",
|
|
88
|
+
"borderLeftStyle",
|
|
89
|
+
"borderLeftWidth",
|
|
90
|
+
"borderRadius",
|
|
91
|
+
"borderRight",
|
|
92
|
+
"borderRightColor",
|
|
93
|
+
"borderRightStyle",
|
|
94
|
+
"borderRightWidth",
|
|
95
|
+
"borderSpacing",
|
|
96
|
+
"borderStyle",
|
|
97
|
+
"borderTop",
|
|
98
|
+
"borderTopColor",
|
|
99
|
+
"borderTopLeftRadius",
|
|
100
|
+
"borderTopRightRadius",
|
|
101
|
+
"borderTopStyle",
|
|
102
|
+
"borderTopWidth",
|
|
103
|
+
"borderWidth",
|
|
104
|
+
"bottom",
|
|
105
|
+
"boxDecorationBreak",
|
|
106
|
+
"boxShadow",
|
|
107
|
+
"boxSizing",
|
|
108
|
+
"breakAfter",
|
|
109
|
+
"breakBefore",
|
|
110
|
+
"breakInside",
|
|
111
|
+
"captionSide",
|
|
112
|
+
"caretColor",
|
|
113
|
+
"clear",
|
|
114
|
+
"clip",
|
|
115
|
+
"clipPath",
|
|
116
|
+
"color",
|
|
117
|
+
"colorAdjust",
|
|
118
|
+
"colorInterpolation",
|
|
119
|
+
"colorInterpolationFilters",
|
|
120
|
+
"colorRendering",
|
|
121
|
+
"columnCount",
|
|
122
|
+
"columnFill",
|
|
123
|
+
"columnGap",
|
|
124
|
+
"columnRule",
|
|
125
|
+
"columnRuleColor",
|
|
126
|
+
"columnRuleStyle",
|
|
127
|
+
"columnRuleWidth",
|
|
128
|
+
"columnSpan",
|
|
129
|
+
"columnWidth",
|
|
130
|
+
"columns",
|
|
131
|
+
"contain",
|
|
132
|
+
"content",
|
|
133
|
+
"counterIncrement",
|
|
134
|
+
"counterReset",
|
|
135
|
+
"cursor",
|
|
136
|
+
"direction",
|
|
137
|
+
"display",
|
|
138
|
+
"emptyCells",
|
|
139
|
+
"filter",
|
|
140
|
+
"flex",
|
|
141
|
+
"flexBasis",
|
|
142
|
+
"flexDirection",
|
|
143
|
+
"flexFlow",
|
|
144
|
+
"flexGrow",
|
|
145
|
+
"flexShrink",
|
|
146
|
+
"flexWrap",
|
|
147
|
+
"float",
|
|
148
|
+
"font",
|
|
149
|
+
"fontFamily",
|
|
150
|
+
"fontFeatureSettings",
|
|
151
|
+
"fontKerning",
|
|
152
|
+
"fontLanguageOverride",
|
|
153
|
+
"fontSize",
|
|
154
|
+
"fontSizeAdjust",
|
|
155
|
+
"fontStretch",
|
|
156
|
+
"fontStyle",
|
|
157
|
+
"fontVariant",
|
|
158
|
+
"fontVariantAlternates",
|
|
159
|
+
"fontVariantCaps",
|
|
160
|
+
"fontVariantEastAsian",
|
|
161
|
+
"fontVariantNumeric",
|
|
162
|
+
"fontVariantPosition",
|
|
163
|
+
"fontWeight",
|
|
164
|
+
"fontVariationSettings",
|
|
165
|
+
"fontSynthesis",
|
|
166
|
+
"forcedColorAdjust",
|
|
167
|
+
"gap",
|
|
168
|
+
"grid",
|
|
169
|
+
"gridArea",
|
|
170
|
+
"gridAutoColumns",
|
|
171
|
+
"gridAutoFlow",
|
|
172
|
+
"gridAutoRows",
|
|
173
|
+
"gridColumn",
|
|
174
|
+
"gridColumnEnd",
|
|
175
|
+
"gridColumnGap",
|
|
176
|
+
"gridColumnStart",
|
|
177
|
+
"gridGap",
|
|
178
|
+
"gridRow",
|
|
179
|
+
"gridRowEnd",
|
|
180
|
+
"gridRowGap",
|
|
181
|
+
"gridRowStart",
|
|
182
|
+
"gridTemplate",
|
|
183
|
+
"gridTemplateAreas",
|
|
184
|
+
"gridTemplateColumns",
|
|
185
|
+
"gridTemplateRows",
|
|
186
|
+
"height",
|
|
187
|
+
"hyphens",
|
|
188
|
+
"imageOrientation",
|
|
189
|
+
"imageRendering",
|
|
190
|
+
"imeMode",
|
|
191
|
+
"inset",
|
|
192
|
+
"insetBlock",
|
|
193
|
+
"insetBlockEnd",
|
|
194
|
+
"insetBlockStart",
|
|
195
|
+
"insetInline",
|
|
196
|
+
"insetInlineEnd",
|
|
197
|
+
"insetInlineStart",
|
|
198
|
+
"initialLetter",
|
|
199
|
+
"isolation",
|
|
200
|
+
"justifyContent",
|
|
201
|
+
"justifyItems",
|
|
202
|
+
"justifySelf",
|
|
203
|
+
"left",
|
|
204
|
+
"letterSpacing",
|
|
205
|
+
"lineBreak",
|
|
206
|
+
"lineClamp",
|
|
207
|
+
"lineHeight",
|
|
208
|
+
"listStyle",
|
|
209
|
+
"listStyleImage",
|
|
210
|
+
"listStylePosition",
|
|
211
|
+
"listStyleType",
|
|
212
|
+
"margin",
|
|
213
|
+
"marginBottom",
|
|
214
|
+
"marginLeft",
|
|
215
|
+
"marginRight",
|
|
216
|
+
"marginTop",
|
|
217
|
+
"marginBlock",
|
|
218
|
+
"marginBlockEnd",
|
|
219
|
+
"marginBlockStart",
|
|
220
|
+
"marginInline",
|
|
221
|
+
"marginInlineEnd",
|
|
222
|
+
"marginInlineStart",
|
|
223
|
+
"mask",
|
|
224
|
+
"maskBorder",
|
|
225
|
+
"maskBorderImage",
|
|
226
|
+
"maskBorderOutset",
|
|
227
|
+
"maskBorderRepeat",
|
|
228
|
+
"maskBorderSlice",
|
|
229
|
+
"maskBorderSource",
|
|
230
|
+
"maskBorderWidth",
|
|
231
|
+
"maskClip",
|
|
232
|
+
"maskComposite",
|
|
233
|
+
"maskImage",
|
|
234
|
+
"maskOrigin",
|
|
235
|
+
"maskPosition",
|
|
236
|
+
"maskRepeat",
|
|
237
|
+
"maskSize",
|
|
238
|
+
"maskType",
|
|
239
|
+
"maxBlockSize",
|
|
240
|
+
"maxHeight",
|
|
241
|
+
"maxInlineSize",
|
|
242
|
+
"maxWidth",
|
|
243
|
+
"minBlockSize",
|
|
244
|
+
"minHeight",
|
|
245
|
+
"minInlineSize",
|
|
246
|
+
"minWidth",
|
|
247
|
+
"mixBlendMode",
|
|
248
|
+
"objectFit",
|
|
249
|
+
"objectPosition",
|
|
250
|
+
"objectViewBox",
|
|
251
|
+
"offset",
|
|
252
|
+
"offsetDistance",
|
|
253
|
+
"offsetPath",
|
|
254
|
+
"offsetRotate",
|
|
255
|
+
"opacity",
|
|
256
|
+
"order",
|
|
257
|
+
"orientation",
|
|
258
|
+
"outline",
|
|
259
|
+
"outlineColor",
|
|
260
|
+
"outlineOffset",
|
|
261
|
+
"outlineStyle",
|
|
262
|
+
"outlineWidth",
|
|
263
|
+
"overflow",
|
|
264
|
+
"overflowAnchor",
|
|
265
|
+
"overflowClip",
|
|
266
|
+
"overflowScrolling",
|
|
267
|
+
"overflowWrap",
|
|
268
|
+
"overflowX",
|
|
269
|
+
"overflowY",
|
|
270
|
+
"padding",
|
|
271
|
+
"paddingBottom",
|
|
272
|
+
"paddingLeft",
|
|
273
|
+
"paddingRight",
|
|
274
|
+
"paddingTop",
|
|
275
|
+
"pageBreakAfter",
|
|
276
|
+
"pageBreakBefore",
|
|
277
|
+
"pageBreakInside",
|
|
278
|
+
"paintOrder",
|
|
279
|
+
"perspective",
|
|
280
|
+
"perspectiveOrigin",
|
|
281
|
+
"placeContent",
|
|
282
|
+
"placeItems",
|
|
283
|
+
"placeSelf",
|
|
284
|
+
"pointerEvents",
|
|
285
|
+
"position",
|
|
286
|
+
"resize",
|
|
287
|
+
"right",
|
|
288
|
+
"rotate",
|
|
289
|
+
"rowGap",
|
|
290
|
+
"scrollBehavior",
|
|
291
|
+
"scrollPadding",
|
|
292
|
+
"scrollSnapAlign",
|
|
293
|
+
"scrollSnapType",
|
|
294
|
+
"scrollbarColor",
|
|
295
|
+
"scrollbarWidth",
|
|
296
|
+
"shapeImageThreshold",
|
|
297
|
+
"shapeMargin",
|
|
298
|
+
"shapeOutside",
|
|
299
|
+
"tabSize",
|
|
300
|
+
"tableLayout",
|
|
301
|
+
"textAlign",
|
|
302
|
+
"textAlignLast",
|
|
303
|
+
"textDecoration",
|
|
304
|
+
"textDecorationColor",
|
|
305
|
+
"textDecorationLine",
|
|
306
|
+
"textDecorationSkipInk",
|
|
307
|
+
"textDecorationStyle",
|
|
308
|
+
"textDecorationThickness",
|
|
309
|
+
"textIndent",
|
|
310
|
+
"textOverflow",
|
|
311
|
+
"textShadow",
|
|
312
|
+
"textTransform",
|
|
313
|
+
"textUnderlineOffset",
|
|
314
|
+
"top",
|
|
315
|
+
"transform",
|
|
316
|
+
"transformOrigin",
|
|
317
|
+
"transformStyle",
|
|
318
|
+
"transition",
|
|
319
|
+
"transitionDelay",
|
|
320
|
+
"transitionDuration",
|
|
321
|
+
"transitionProperty",
|
|
322
|
+
"transitionTimingFunction",
|
|
323
|
+
"translate",
|
|
324
|
+
"translateX",
|
|
325
|
+
"translateY",
|
|
326
|
+
"translateZ",
|
|
327
|
+
"unicodeBidi",
|
|
328
|
+
"userSelect",
|
|
329
|
+
"verticalAlign",
|
|
330
|
+
"visibility",
|
|
331
|
+
"whiteSpace",
|
|
332
|
+
"widows",
|
|
333
|
+
"width",
|
|
334
|
+
"willChange",
|
|
335
|
+
"wordBreak",
|
|
336
|
+
"wordSpacing",
|
|
337
|
+
"wordWrap",
|
|
338
|
+
"writingMode",
|
|
339
|
+
"zIndex"
|
|
340
|
+
]);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var flex_exports = {};
|
|
20
|
+
__export(flex_exports, {
|
|
21
|
+
FLEX_PROPS: () => FLEX_PROPS
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(flex_exports);
|
|
24
|
+
var import_utils = require("@domql/utils");
|
|
25
|
+
const FLEX_PROPS = {
|
|
26
|
+
flow: (value, el) => {
|
|
27
|
+
const { props } = el;
|
|
28
|
+
const { reverse } = props;
|
|
29
|
+
if (!(0, import_utils.isString)(value)) return;
|
|
30
|
+
let [direction, wrap] = (value || "row").split(" ");
|
|
31
|
+
if (value.startsWith("x") || value === "row") direction = "row";
|
|
32
|
+
if (value.startsWith("y") || value === "column") direction = "column";
|
|
33
|
+
return {
|
|
34
|
+
display: "flex",
|
|
35
|
+
flexFlow: (direction || "") + (!direction.includes("-reverse") && reverse ? "-reverse" : "") + " " + (wrap || "")
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
wrap: (value, { props }) => {
|
|
39
|
+
return { display: "flex", flexWrap: value };
|
|
40
|
+
},
|
|
41
|
+
align: (value, { props }) => {
|
|
42
|
+
const [alignItems, justifyContent] = value.split(" ");
|
|
43
|
+
return { display: "flex", alignItems, justifyContent };
|
|
44
|
+
}
|
|
45
|
+
};
|