@tamagui/tailwind 3.0.0-beta.924.1 → 3.0.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.
- package/dist/cjs/candidate.cjs +312 -137
- package/dist/cjs/candidate.native.cjs +342 -153
- package/dist/cjs/candidate.native.js +342 -153
- package/dist/cjs/candidate.native.js.map +1 -1
- package/dist/cjs/compose.cjs +383 -0
- package/dist/cjs/compose.native.cjs +389 -0
- package/dist/cjs/compose.native.js +391 -0
- package/dist/cjs/compose.native.js.map +1 -0
- package/dist/cjs/composedResolver.cjs +226 -0
- package/dist/cjs/composedResolver.native.cjs +255 -0
- package/dist/cjs/composedResolver.native.js +257 -0
- package/dist/cjs/composedResolver.native.js.map +1 -0
- package/dist/cjs/frontend.cjs +4 -11
- package/dist/cjs/frontend.native.cjs +5 -16
- package/dist/cjs/frontend.native.js +5 -16
- package/dist/cjs/frontend.native.js.map +1 -1
- package/dist/cjs/index.cjs +2 -0
- package/dist/cjs/index.native.cjs +2 -0
- package/dist/cjs/index.native.js +2 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/esm/candidate.mjs +314 -140
- package/dist/esm/candidate.mjs.map +1 -1
- package/dist/esm/candidate.native.js +344 -156
- package/dist/esm/candidate.native.js.map +1 -1
- package/dist/esm/compose.mjs +359 -0
- package/dist/esm/compose.mjs.map +1 -0
- package/dist/esm/compose.native.js +363 -0
- package/dist/esm/compose.native.js.map +1 -0
- package/dist/esm/composedResolver.mjs +206 -0
- package/dist/esm/composedResolver.mjs.map +1 -0
- package/dist/esm/composedResolver.native.js +233 -0
- package/dist/esm/composedResolver.native.js.map +1 -0
- package/dist/esm/frontend.mjs +4 -11
- package/dist/esm/frontend.mjs.map +1 -1
- package/dist/esm/frontend.native.js +5 -16
- package/dist/esm/frontend.native.js.map +1 -1
- package/dist/esm/index.mjs +3 -2
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +3 -2
- package/dist/esm/index.native.js.map +1 -1
- package/package.json +18 -15
- package/src/candidate.ts +396 -60
- package/src/frontend.ts +3 -16
- package/src/index.tsx +14 -2
- package/src/types.ts +32 -4
- package/types/candidate.d.ts +2 -1
- package/types/candidate.d.ts.map +1 -1
- package/types/compose.d.ts +19 -0
- package/types/compose.d.ts.map +1 -0
- package/types/composedResolver.d.ts +19 -0
- package/types/composedResolver.d.ts.map +1 -0
- package/types/frontend.d.ts.map +1 -1
- package/types/index.d.ts +11 -1
- package/types/index.d.ts.map +1 -1
- package/types/types.d.ts +18 -3
- package/types/types.d.ts.map +1 -1
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
import { plainValueToPayload } from "@tamagui/core/internal-runtime";
|
|
2
|
+
import { canonicalClauseModifier, splitColorOpacitySuffix } from "@tamagui/style-grammar/runtime";
|
|
3
|
+
import { classifyCandidate, decodeArbitrary, hasTokenName, splitCandidate } from "@tamagui/style-grammar/tooling/candidate";
|
|
4
|
+
import { isAndroid, isWeb } from "@tamagui/constants";
|
|
5
|
+
|
|
6
|
+
var transformProps = /* @__PURE__ */ new Set([
|
|
7
|
+
"perspective",
|
|
8
|
+
"rotateX",
|
|
9
|
+
"rotateY",
|
|
10
|
+
"rotateZ",
|
|
11
|
+
"skewX",
|
|
12
|
+
"skewY"
|
|
13
|
+
]);
|
|
14
|
+
var nativeTarget = !isWeb || true;
|
|
15
|
+
var linearTo = {
|
|
16
|
+
t: "to top",
|
|
17
|
+
tr: "to top right",
|
|
18
|
+
r: "to right",
|
|
19
|
+
br: "to bottom right",
|
|
20
|
+
b: "to bottom",
|
|
21
|
+
bl: "to bottom left",
|
|
22
|
+
l: "to left",
|
|
23
|
+
tl: "to top left"
|
|
24
|
+
};
|
|
25
|
+
var colorKeywords = {
|
|
26
|
+
transparent: "transparent",
|
|
27
|
+
current: "currentColor",
|
|
28
|
+
inherit: "inherit",
|
|
29
|
+
black: "black",
|
|
30
|
+
white: "white"
|
|
31
|
+
};
|
|
32
|
+
var dropShadowPresets = {
|
|
33
|
+
xs: {
|
|
34
|
+
geometry: "0 1px 1px",
|
|
35
|
+
defaultColor: "rgb(0 0 0 / 0.05)"
|
|
36
|
+
},
|
|
37
|
+
sm: {
|
|
38
|
+
geometry: "0 1px 2px",
|
|
39
|
+
defaultColor: "rgb(0 0 0 / 0.15)"
|
|
40
|
+
},
|
|
41
|
+
md: {
|
|
42
|
+
geometry: "0 3px 3px",
|
|
43
|
+
defaultColor: "rgb(0 0 0 / 0.12)"
|
|
44
|
+
},
|
|
45
|
+
lg: {
|
|
46
|
+
geometry: "0 4px 4px",
|
|
47
|
+
defaultColor: "rgb(0 0 0 / 0.15)"
|
|
48
|
+
},
|
|
49
|
+
xl: {
|
|
50
|
+
geometry: "0 9px 7px",
|
|
51
|
+
defaultColor: "rgb(0 0 0 / 0.1)"
|
|
52
|
+
},
|
|
53
|
+
"2xl": {
|
|
54
|
+
geometry: "0 25px 25px",
|
|
55
|
+
defaultColor: "rgb(0 0 0 / 0.15)"
|
|
56
|
+
},
|
|
57
|
+
none: {
|
|
58
|
+
geometry: "0 0 0",
|
|
59
|
+
defaultColor: "transparent"
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
var textShadowPresets = {
|
|
63
|
+
"2xs": {
|
|
64
|
+
offset: {
|
|
65
|
+
width: 0,
|
|
66
|
+
height: 1
|
|
67
|
+
},
|
|
68
|
+
radius: 0,
|
|
69
|
+
defaultColor: "rgb(0 0 0 / 0.15)"
|
|
70
|
+
},
|
|
71
|
+
xs: {
|
|
72
|
+
offset: {
|
|
73
|
+
width: 0,
|
|
74
|
+
height: 1
|
|
75
|
+
},
|
|
76
|
+
radius: 1,
|
|
77
|
+
defaultColor: "rgb(0 0 0 / 0.2)"
|
|
78
|
+
},
|
|
79
|
+
none: {
|
|
80
|
+
offset: {
|
|
81
|
+
width: 0,
|
|
82
|
+
height: 0
|
|
83
|
+
},
|
|
84
|
+
radius: 0,
|
|
85
|
+
defaultColor: "transparent"
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
var insetShadowPresets = {
|
|
89
|
+
"2xs": {
|
|
90
|
+
geometry: "inset 0 1px 0",
|
|
91
|
+
defaultColor: "rgb(0 0 0 / 0.05)"
|
|
92
|
+
},
|
|
93
|
+
xs: {
|
|
94
|
+
geometry: "inset 0 1px 1px",
|
|
95
|
+
defaultColor: "rgb(0 0 0 / 0.05)"
|
|
96
|
+
},
|
|
97
|
+
sm: {
|
|
98
|
+
geometry: "inset 0 2px 4px",
|
|
99
|
+
defaultColor: "rgb(0 0 0 / 0.05)"
|
|
100
|
+
},
|
|
101
|
+
none: {
|
|
102
|
+
geometry: "",
|
|
103
|
+
defaultColor: "transparent"
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
var filterPropMap = {
|
|
107
|
+
blur: "__filter_blur",
|
|
108
|
+
brightness: "__filter_brightness",
|
|
109
|
+
contrast: "__filter_contrast",
|
|
110
|
+
grayscale: "__filter_grayscale",
|
|
111
|
+
"hue-rotate": "__filter_hueRotate",
|
|
112
|
+
invert: "__filter_invert",
|
|
113
|
+
saturate: "__filter_saturate",
|
|
114
|
+
sepia: "__filter_sepia"
|
|
115
|
+
};
|
|
116
|
+
function composerKind(core) {
|
|
117
|
+
var first = core.charCodeAt(0);
|
|
118
|
+
if (first === 100) return core.startsWith("drop-shadow-") ? "drop-shadow" : null;
|
|
119
|
+
if (first === 102) return core.startsWith("from-") ? "from" : null;
|
|
120
|
+
if (first === 118) return core.startsWith("via-") ? "via" : null;
|
|
121
|
+
if (first === 116) {
|
|
122
|
+
if (core.startsWith("text-shadow-")) return "text-shadow";
|
|
123
|
+
return core.startsWith("to-") ? "to" : null;
|
|
124
|
+
}
|
|
125
|
+
if (first === 98) {
|
|
126
|
+
if (core.startsWith("bg-linear-to-")) return "image";
|
|
127
|
+
return core.startsWith("blur-") || core.startsWith("brightness-") ? "filter" : null;
|
|
128
|
+
}
|
|
129
|
+
if (first === 114) {
|
|
130
|
+
if (core.startsWith("ring-offset-")) return "ring-offset";
|
|
131
|
+
return core === "ring" || core.startsWith("ring-") ? "ring" : null;
|
|
132
|
+
}
|
|
133
|
+
if (first === 99) return core.startsWith("contrast-") ? "filter" : null;
|
|
134
|
+
if (first === 103) return core === "grayscale" || core.startsWith("grayscale-") ? "filter" : null;
|
|
135
|
+
if (first === 104) return core.startsWith("hue-rotate-") ? "filter" : null;
|
|
136
|
+
if (first === 105) return core.startsWith("inset-ring") ? "inset-ring" : core.startsWith("inset-shadow-") ? "inset-shadow" : core === "invert" || core.startsWith("invert-") ? "filter" : null;
|
|
137
|
+
if (first === 115) {
|
|
138
|
+
if (core.startsWith("shadow-")) return "shadow-color";
|
|
139
|
+
return core.startsWith("saturate-") || core === "sepia" || core.startsWith("sepia-") ? "filter" : null;
|
|
140
|
+
}
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
function filterPart(core) {
|
|
144
|
+
if (core.startsWith("blur-")) {
|
|
145
|
+
var value = {
|
|
146
|
+
none: 0,
|
|
147
|
+
xs: 4,
|
|
148
|
+
sm: 8,
|
|
149
|
+
md: 12,
|
|
150
|
+
lg: 16,
|
|
151
|
+
xl: 24,
|
|
152
|
+
"2xl": 40,
|
|
153
|
+
"3xl": 64
|
|
154
|
+
}[core.slice(5)];
|
|
155
|
+
return value === void 0 ? null : ["blur", `${value}px`];
|
|
156
|
+
}
|
|
157
|
+
for (var _i = 0, _iter = [
|
|
158
|
+
"brightness",
|
|
159
|
+
"contrast",
|
|
160
|
+
"saturate"
|
|
161
|
+
]; _i < _iter.length; _i++) {
|
|
162
|
+
var name = _iter[_i];
|
|
163
|
+
if (!core.startsWith(`${name}-`)) continue;
|
|
164
|
+
var value1 = core.slice(name.length + 1);
|
|
165
|
+
if (!/^\d+$/.test(value1)) return null;
|
|
166
|
+
return [name, `${value1}%`];
|
|
167
|
+
}
|
|
168
|
+
for (var _i1 = 0, _iter1 = [
|
|
169
|
+
"grayscale",
|
|
170
|
+
"invert",
|
|
171
|
+
"sepia"
|
|
172
|
+
]; _i1 < _iter1.length; _i1++) {
|
|
173
|
+
var name1 = _iter1[_i1];
|
|
174
|
+
if (core === name1) return [name1, "100%"];
|
|
175
|
+
if (!core.startsWith(`${name1}-`)) continue;
|
|
176
|
+
var value2 = core.slice(name1.length + 1);
|
|
177
|
+
if (!/^\d+$/.test(value2)) return null;
|
|
178
|
+
return [name1, `${value2}%`];
|
|
179
|
+
}
|
|
180
|
+
if (core.startsWith("hue-rotate-")) {
|
|
181
|
+
var value3 = core.slice(11);
|
|
182
|
+
if (!/^\d+$/.test(value3)) return null;
|
|
183
|
+
return ["hue-rotate", `${value3}deg`];
|
|
184
|
+
}
|
|
185
|
+
return null;
|
|
186
|
+
}
|
|
187
|
+
function resolveColor(raw, config) {
|
|
188
|
+
if (raw.length > 1 && raw[0] === "[" && raw[raw.length - 1] === "]") return decodeArbitrary(raw.slice(1, -1)) || null;
|
|
189
|
+
if (raw.endsWith("%")) return null;
|
|
190
|
+
var keyword = colorKeywords[raw];
|
|
191
|
+
if (keyword) return keyword;
|
|
192
|
+
var suffix = splitColorOpacitySuffix(raw);
|
|
193
|
+
if (!hasTokenName(config, "color", suffix.kind === "none" ? raw : suffix.name)) return null;
|
|
194
|
+
return raw;
|
|
195
|
+
}
|
|
196
|
+
function emit(sink, property, value, modifiers) {
|
|
197
|
+
if (modifiers.length === 0) {
|
|
198
|
+
sink([property, value]);
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
var _plainValueToPayload;
|
|
202
|
+
var payload = (_plainValueToPayload = plainValueToPayload(value, property)) !== null && _plainValueToPayload !== void 0 ? _plainValueToPayload : value;
|
|
203
|
+
if (payload === null) return;
|
|
204
|
+
var condition = modifiers[0];
|
|
205
|
+
for (var index = 1; index < modifiers.length; index++) condition += `:${modifiers[index]}`;
|
|
206
|
+
sink([
|
|
207
|
+
property,
|
|
208
|
+
payload,
|
|
209
|
+
condition,
|
|
210
|
+
modifiers
|
|
211
|
+
]);
|
|
212
|
+
}
|
|
213
|
+
function ringWidth(raw) {
|
|
214
|
+
if (raw === "inset") return null;
|
|
215
|
+
if (/^\d+$/.test(raw)) return `${raw}px`;
|
|
216
|
+
if (raw.length > 1 && raw[0] === "[" && raw[raw.length - 1] === "]") {
|
|
217
|
+
var inner = decodeArbitrary(raw.slice(1, -1));
|
|
218
|
+
if (/^-?(?:\d+|\d*\.\d+)$/.test(inner)) return `${inner}px`;
|
|
219
|
+
if (/^-?(?:\d+|\d*\.\d+)px$/.test(inner)) return inner;
|
|
220
|
+
return null;
|
|
221
|
+
}
|
|
222
|
+
return null;
|
|
223
|
+
}
|
|
224
|
+
function tryCompose(candidate, config, sink) {
|
|
225
|
+
var modified = candidate.indexOf(":") !== -1;
|
|
226
|
+
var split = modified ? splitCandidate(candidate) : null;
|
|
227
|
+
if (modified && !split) return void 0;
|
|
228
|
+
var core = split ? split.base : candidate;
|
|
229
|
+
if (!core) return void 0;
|
|
230
|
+
var kind = composerKind(core);
|
|
231
|
+
if (kind == null) return void 0;
|
|
232
|
+
var modifiers = split ? split.modifiers.map(canonicalClauseModifier) : [];
|
|
233
|
+
if (kind === "filter") {
|
|
234
|
+
var part = filterPart(core);
|
|
235
|
+
if (!part) return true;
|
|
236
|
+
if (nativeTarget && part[0] !== "brightness" && !isAndroid) return null;
|
|
237
|
+
var prop = filterPropMap[part[0]];
|
|
238
|
+
if (prop) emit(sink, prop, part[1], modifiers);
|
|
239
|
+
return false;
|
|
240
|
+
}
|
|
241
|
+
if (kind === "drop-shadow") {
|
|
242
|
+
if (nativeTarget && !isAndroid) return null;
|
|
243
|
+
var raw = core.slice(12);
|
|
244
|
+
var shadow = dropShadowPresets[raw];
|
|
245
|
+
if (shadow) {
|
|
246
|
+
emit(sink, "__dropShadowGeometry", shadow.geometry, modifiers);
|
|
247
|
+
emit(sink, "__dropShadowDefaultColor", shadow.defaultColor, modifiers);
|
|
248
|
+
} else {
|
|
249
|
+
var color = resolveColor(raw, config);
|
|
250
|
+
if (color == null) return void 0;
|
|
251
|
+
emit(sink, "__dropShadowColor", color, modifiers);
|
|
252
|
+
}
|
|
253
|
+
return false;
|
|
254
|
+
}
|
|
255
|
+
if (kind === "text-shadow") {
|
|
256
|
+
var raw1 = core.slice(12);
|
|
257
|
+
var geometry = textShadowPresets[raw1];
|
|
258
|
+
if (geometry) {
|
|
259
|
+
if (modifiers.length > 0) return nativeTarget ? null : void 0;
|
|
260
|
+
emit(sink, "__textShadow_preset", geometry, modifiers);
|
|
261
|
+
} else {
|
|
262
|
+
var _classified_parsed_entry;
|
|
263
|
+
var resolved = resolveColor(raw1, config);
|
|
264
|
+
var classified = resolved == null ? classifyCandidate(core, config) : null;
|
|
265
|
+
var color1 = resolved !== null && resolved !== void 0 ? resolved : (classified === null || classified === void 0 ? void 0 : classified.kind) === "tamagui" && ((_classified_parsed_entry = classified.parsed.entry) === null || _classified_parsed_entry === void 0 ? void 0 : _classified_parsed_entry.prop) === "textShadowColor" ? raw1 : null;
|
|
266
|
+
if (color1 == null) return void 0;
|
|
267
|
+
emit(sink, "__textShadow_color", color1, modifiers);
|
|
268
|
+
}
|
|
269
|
+
return false;
|
|
270
|
+
}
|
|
271
|
+
if (kind === "inset-ring") {
|
|
272
|
+
var raw2 = core === "inset-ring" ? "" : core.slice(11);
|
|
273
|
+
var width = raw2 === "" ? "1px" : ringWidth(raw2);
|
|
274
|
+
if (width != null) emit(sink, "__insetRingWidth", width, modifiers);
|
|
275
|
+
else {
|
|
276
|
+
var color2 = resolveColor(raw2, config);
|
|
277
|
+
if (color2 == null) return void 0;
|
|
278
|
+
emit(sink, "__insetRingColor", color2, modifiers);
|
|
279
|
+
}
|
|
280
|
+
return false;
|
|
281
|
+
}
|
|
282
|
+
if (kind === "inset-shadow") {
|
|
283
|
+
var raw3 = core.slice(13);
|
|
284
|
+
var shadow1 = insetShadowPresets[raw3];
|
|
285
|
+
if (shadow1) {
|
|
286
|
+
emit(sink, "__insetShadowGeometry", shadow1.geometry, modifiers);
|
|
287
|
+
emit(sink, "__insetShadowDefaultColor", shadow1.defaultColor, modifiers);
|
|
288
|
+
} else {
|
|
289
|
+
var color3 = resolveColor(raw3, config);
|
|
290
|
+
if (color3 == null) return void 0;
|
|
291
|
+
emit(sink, "__insetShadowColor", color3, modifiers);
|
|
292
|
+
}
|
|
293
|
+
return false;
|
|
294
|
+
}
|
|
295
|
+
if (kind === "shadow-color") {
|
|
296
|
+
var raw4 = core.slice(7);
|
|
297
|
+
var color4 = resolveColor(raw4, config);
|
|
298
|
+
if (color4 == null || raw4[0] === "[" && /\s/.test(color4.replace(/\([^)]*\)/g, ""))) return void 0;
|
|
299
|
+
emit(sink, "__shadowColor", color4, modifiers);
|
|
300
|
+
return false;
|
|
301
|
+
}
|
|
302
|
+
if (kind === "ring-offset") {
|
|
303
|
+
var raw5 = core.slice(12);
|
|
304
|
+
var width1 = ringWidth(raw5);
|
|
305
|
+
if (width1 != null) {
|
|
306
|
+
emit(sink, "__ringOffsetWidth", width1, modifiers);
|
|
307
|
+
return false;
|
|
308
|
+
}
|
|
309
|
+
var color5 = resolveColor(raw5, config);
|
|
310
|
+
if (color5 == null) return void 0;
|
|
311
|
+
emit(sink, "__ringOffsetColor", color5, modifiers);
|
|
312
|
+
return false;
|
|
313
|
+
}
|
|
314
|
+
if (kind === "image") {
|
|
315
|
+
var dir = linearTo[core.slice(13)];
|
|
316
|
+
if (!dir) return true;
|
|
317
|
+
emit(sink, "__gradientDirection", dir, modifiers);
|
|
318
|
+
return false;
|
|
319
|
+
}
|
|
320
|
+
if (kind === "from" || kind === "via" || kind === "to") {
|
|
321
|
+
var raw6 = core.slice(kind.length + 1);
|
|
322
|
+
var prop1 = kind === "from" ? "__gradientFrom" : kind === "via" ? "__gradientVia" : "__gradientTo";
|
|
323
|
+
if (/^\d+(?:\.\d+)?%$/.test(raw6)) {
|
|
324
|
+
emit(sink, `${prop1}Position`, raw6, modifiers);
|
|
325
|
+
return false;
|
|
326
|
+
}
|
|
327
|
+
var color6 = resolveColor(raw6, config);
|
|
328
|
+
if (color6 == null) return true;
|
|
329
|
+
emit(sink, prop1, color6, modifiers);
|
|
330
|
+
return false;
|
|
331
|
+
}
|
|
332
|
+
if (core === "ring") {
|
|
333
|
+
emit(sink, "__ring", "1px", modifiers);
|
|
334
|
+
return false;
|
|
335
|
+
}
|
|
336
|
+
if (core === "ring-inset") {
|
|
337
|
+
emit(sink, "__ringInset", true, modifiers);
|
|
338
|
+
return false;
|
|
339
|
+
}
|
|
340
|
+
var raw7 = core.slice(5);
|
|
341
|
+
var width2 = ringWidth(raw7);
|
|
342
|
+
if (width2 != null) {
|
|
343
|
+
emit(sink, "__ring", width2, modifiers);
|
|
344
|
+
return false;
|
|
345
|
+
}
|
|
346
|
+
var color7 = resolveColor(raw7, config);
|
|
347
|
+
if (color7 == null) return true;
|
|
348
|
+
emit(sink, "__ringColor", color7, modifiers);
|
|
349
|
+
return false;
|
|
350
|
+
}
|
|
351
|
+
function noteTailwindTransform(sink, entry) {
|
|
352
|
+
if (!transformProps.has(entry[0])) return false;
|
|
353
|
+
emit(sink, `__transform_${entry[0]}`, entry[1], entry[3] || []);
|
|
354
|
+
return true;
|
|
355
|
+
}
|
|
356
|
+
function noteBoxShadow(sink, value, modifiers) {
|
|
357
|
+
if (typeof value !== "string" || value === "unset") return;
|
|
358
|
+
if (value.indexOf(" ") === -1 && value !== "none" && !value.startsWith("inset")) return;
|
|
359
|
+
emit(sink, "__shadow", value, modifiers);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
export { noteBoxShadow, noteTailwindTransform, tryCompose };
|
|
363
|
+
//# sourceMappingURL=compose.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose.native.js","names":[],"sources":["esm/compose.native.js"],"sourcesContent":["import { plainValueToPayload } from \"@tamagui/core/internal-runtime\";\nimport { canonicalClauseModifier, splitColorOpacitySuffix } from \"@tamagui/style-grammar/runtime\";\nimport { classifyCandidate, decodeArbitrary, hasTokenName, splitCandidate } from \"@tamagui/style-grammar/tooling/candidate\";\nimport { isAndroid, isWeb } from \"@tamagui/constants\";\n\nvar transformProps = /* @__PURE__ */ new Set([\n\t\"perspective\",\n\t\"rotateX\",\n\t\"rotateY\",\n\t\"rotateZ\",\n\t\"skewX\",\n\t\"skewY\"\n]);\nvar nativeTarget = !isWeb || true;\nvar linearTo = {\n\tt: \"to top\",\n\ttr: \"to top right\",\n\tr: \"to right\",\n\tbr: \"to bottom right\",\n\tb: \"to bottom\",\n\tbl: \"to bottom left\",\n\tl: \"to left\",\n\ttl: \"to top left\"\n};\nvar colorKeywords = {\n\ttransparent: \"transparent\",\n\tcurrent: \"currentColor\",\n\tinherit: \"inherit\",\n\tblack: \"black\",\n\twhite: \"white\"\n};\nvar dropShadowPresets = {\n\txs: {\n\t\tgeometry: \"0 1px 1px\",\n\t\tdefaultColor: \"rgb(0 0 0 / 0.05)\"\n\t},\n\tsm: {\n\t\tgeometry: \"0 1px 2px\",\n\t\tdefaultColor: \"rgb(0 0 0 / 0.15)\"\n\t},\n\tmd: {\n\t\tgeometry: \"0 3px 3px\",\n\t\tdefaultColor: \"rgb(0 0 0 / 0.12)\"\n\t},\n\tlg: {\n\t\tgeometry: \"0 4px 4px\",\n\t\tdefaultColor: \"rgb(0 0 0 / 0.15)\"\n\t},\n\txl: {\n\t\tgeometry: \"0 9px 7px\",\n\t\tdefaultColor: \"rgb(0 0 0 / 0.1)\"\n\t},\n\t\"2xl\": {\n\t\tgeometry: \"0 25px 25px\",\n\t\tdefaultColor: \"rgb(0 0 0 / 0.15)\"\n\t},\n\tnone: {\n\t\tgeometry: \"0 0 0\",\n\t\tdefaultColor: \"transparent\"\n\t}\n};\nvar textShadowPresets = {\n\t\"2xs\": {\n\t\toffset: {\n\t\t\twidth: 0,\n\t\t\theight: 1\n\t\t},\n\t\tradius: 0,\n\t\tdefaultColor: \"rgb(0 0 0 / 0.15)\"\n\t},\n\txs: {\n\t\toffset: {\n\t\t\twidth: 0,\n\t\t\theight: 1\n\t\t},\n\t\tradius: 1,\n\t\tdefaultColor: \"rgb(0 0 0 / 0.2)\"\n\t},\n\tnone: {\n\t\toffset: {\n\t\t\twidth: 0,\n\t\t\theight: 0\n\t\t},\n\t\tradius: 0,\n\t\tdefaultColor: \"transparent\"\n\t}\n};\nvar insetShadowPresets = {\n\t\"2xs\": {\n\t\tgeometry: \"inset 0 1px 0\",\n\t\tdefaultColor: \"rgb(0 0 0 / 0.05)\"\n\t},\n\txs: {\n\t\tgeometry: \"inset 0 1px 1px\",\n\t\tdefaultColor: \"rgb(0 0 0 / 0.05)\"\n\t},\n\tsm: {\n\t\tgeometry: \"inset 0 2px 4px\",\n\t\tdefaultColor: \"rgb(0 0 0 / 0.05)\"\n\t},\n\tnone: {\n\t\tgeometry: \"\",\n\t\tdefaultColor: \"transparent\"\n\t}\n};\nvar filterPropMap = {\n\tblur: \"__filter_blur\",\n\tbrightness: \"__filter_brightness\",\n\tcontrast: \"__filter_contrast\",\n\tgrayscale: \"__filter_grayscale\",\n\t\"hue-rotate\": \"__filter_hueRotate\",\n\tinvert: \"__filter_invert\",\n\tsaturate: \"__filter_saturate\",\n\tsepia: \"__filter_sepia\"\n};\nfunction composerKind(core) {\n\tvar first = core.charCodeAt(0);\n\tif (first === 100) return core.startsWith(\"drop-shadow-\") ? \"drop-shadow\" : null;\n\tif (first === 102) return core.startsWith(\"from-\") ? \"from\" : null;\n\tif (first === 118) return core.startsWith(\"via-\") ? \"via\" : null;\n\tif (first === 116) {\n\t\tif (core.startsWith(\"text-shadow-\")) return \"text-shadow\";\n\t\treturn core.startsWith(\"to-\") ? \"to\" : null;\n\t}\n\tif (first === 98) {\n\t\tif (core.startsWith(\"bg-linear-to-\")) return \"image\";\n\t\treturn core.startsWith(\"blur-\") || core.startsWith(\"brightness-\") ? \"filter\" : null;\n\t}\n\tif (first === 114) {\n\t\tif (core.startsWith(\"ring-offset-\")) return \"ring-offset\";\n\t\treturn core === \"ring\" || core.startsWith(\"ring-\") ? \"ring\" : null;\n\t}\n\tif (first === 99) return core.startsWith(\"contrast-\") ? \"filter\" : null;\n\tif (first === 103) return core === \"grayscale\" || core.startsWith(\"grayscale-\") ? \"filter\" : null;\n\tif (first === 104) return core.startsWith(\"hue-rotate-\") ? \"filter\" : null;\n\tif (first === 105) return core.startsWith(\"inset-ring\") ? \"inset-ring\" : core.startsWith(\"inset-shadow-\") ? \"inset-shadow\" : core === \"invert\" || core.startsWith(\"invert-\") ? \"filter\" : null;\n\tif (first === 115) {\n\t\tif (core.startsWith(\"shadow-\")) return \"shadow-color\";\n\t\treturn core.startsWith(\"saturate-\") || core === \"sepia\" || core.startsWith(\"sepia-\") ? \"filter\" : null;\n\t}\n\treturn null;\n}\nfunction filterPart(core) {\n\tif (core.startsWith(\"blur-\")) {\n\t\tvar value = {\n\t\t\tnone: 0,\n\t\t\txs: 4,\n\t\t\tsm: 8,\n\t\t\tmd: 12,\n\t\t\tlg: 16,\n\t\t\txl: 24,\n\t\t\t\"2xl\": 40,\n\t\t\t\"3xl\": 64\n\t\t}[core.slice(5)];\n\t\treturn value === void 0 ? null : [\"blur\", `${value}px`];\n\t}\n\tfor (var _i = 0, _iter = [\n\t\t\"brightness\",\n\t\t\"contrast\",\n\t\t\"saturate\"\n\t]; _i < _iter.length; _i++) {\n\t\tvar name = _iter[_i];\n\t\tif (!core.startsWith(`${name}-`)) continue;\n\t\tvar value1 = core.slice(name.length + 1);\n\t\tif (!/^\\d+$/.test(value1)) return null;\n\t\treturn [name, `${value1}%`];\n\t}\n\tfor (var _i1 = 0, _iter1 = [\n\t\t\"grayscale\",\n\t\t\"invert\",\n\t\t\"sepia\"\n\t]; _i1 < _iter1.length; _i1++) {\n\t\tvar name1 = _iter1[_i1];\n\t\tif (core === name1) return [name1, \"100%\"];\n\t\tif (!core.startsWith(`${name1}-`)) continue;\n\t\tvar value2 = core.slice(name1.length + 1);\n\t\tif (!/^\\d+$/.test(value2)) return null;\n\t\treturn [name1, `${value2}%`];\n\t}\n\tif (core.startsWith(\"hue-rotate-\")) {\n\t\tvar value3 = core.slice(11);\n\t\tif (!/^\\d+$/.test(value3)) return null;\n\t\treturn [\"hue-rotate\", `${value3}deg`];\n\t}\n\treturn null;\n}\nfunction resolveColor(raw, config) {\n\tif (raw.length > 1 && raw[0] === \"[\" && raw[raw.length - 1] === \"]\") return decodeArbitrary(raw.slice(1, -1)) || null;\n\tif (raw.endsWith(\"%\")) return null;\n\tvar keyword = colorKeywords[raw];\n\tif (keyword) return keyword;\n\tvar suffix = splitColorOpacitySuffix(raw);\n\tif (!hasTokenName(config, \"color\", suffix.kind === \"none\" ? raw : suffix.name)) return null;\n\treturn raw;\n}\nfunction emit(sink, property, value, modifiers) {\n\tif (modifiers.length === 0) {\n\t\tsink([property, value]);\n\t\treturn;\n\t}\n\tvar _plainValueToPayload;\n\tvar payload = (_plainValueToPayload = plainValueToPayload(value, property)) !== null && _plainValueToPayload !== void 0 ? _plainValueToPayload : value;\n\tif (payload === null) return;\n\tvar condition = modifiers[0];\n\tfor (var index = 1; index < modifiers.length; index++) condition += `:${modifiers[index]}`;\n\tsink([\n\t\tproperty,\n\t\tpayload,\n\t\tcondition,\n\t\tmodifiers\n\t]);\n}\nfunction ringWidth(raw) {\n\tif (raw === \"inset\") return null;\n\tif (/^\\d+$/.test(raw)) return `${raw}px`;\n\tif (raw.length > 1 && raw[0] === \"[\" && raw[raw.length - 1] === \"]\") {\n\t\tvar inner = decodeArbitrary(raw.slice(1, -1));\n\t\tif (/^-?(?:\\d+|\\d*\\.\\d+)$/.test(inner)) return `${inner}px`;\n\t\tif (/^-?(?:\\d+|\\d*\\.\\d+)px$/.test(inner)) return inner;\n\t\treturn null;\n\t}\n\treturn null;\n}\nfunction tryCompose(candidate, config, sink) {\n\tvar modified = candidate.indexOf(\":\") !== -1;\n\tvar split = modified ? splitCandidate(candidate) : null;\n\tif (modified && !split) return void 0;\n\tvar core = split ? split.base : candidate;\n\tif (!core) return void 0;\n\tvar kind = composerKind(core);\n\tif (kind == null) return void 0;\n\tvar modifiers = split ? split.modifiers.map(canonicalClauseModifier) : [];\n\tif (kind === \"filter\") {\n\t\tvar part = filterPart(core);\n\t\tif (!part) return true;\n\t\tif (nativeTarget && part[0] !== \"brightness\" && !isAndroid) return null;\n\t\tvar prop = filterPropMap[part[0]];\n\t\tif (prop) emit(sink, prop, part[1], modifiers);\n\t\treturn false;\n\t}\n\tif (kind === \"drop-shadow\") {\n\t\tif (nativeTarget && !isAndroid) return null;\n\t\tvar raw = core.slice(12);\n\t\tvar shadow = dropShadowPresets[raw];\n\t\tif (shadow) {\n\t\t\temit(sink, \"__dropShadowGeometry\", shadow.geometry, modifiers);\n\t\t\temit(sink, \"__dropShadowDefaultColor\", shadow.defaultColor, modifiers);\n\t\t} else {\n\t\t\tvar color = resolveColor(raw, config);\n\t\t\tif (color == null) return void 0;\n\t\t\temit(sink, \"__dropShadowColor\", color, modifiers);\n\t\t}\n\t\treturn false;\n\t}\n\tif (kind === \"text-shadow\") {\n\t\tvar raw1 = core.slice(12);\n\t\tvar geometry = textShadowPresets[raw1];\n\t\tif (geometry) {\n\t\t\tif (modifiers.length > 0) return nativeTarget ? null : void 0;\n\t\t\temit(sink, \"__textShadow_preset\", geometry, modifiers);\n\t\t} else {\n\t\t\tvar _classified_parsed_entry;\n\t\t\tvar resolved = resolveColor(raw1, config);\n\t\t\tvar classified = resolved == null ? classifyCandidate(core, config) : null;\n\t\t\tvar color1 = resolved !== null && resolved !== void 0 ? resolved : (classified === null || classified === void 0 ? void 0 : classified.kind) === \"tamagui\" && ((_classified_parsed_entry = classified.parsed.entry) === null || _classified_parsed_entry === void 0 ? void 0 : _classified_parsed_entry.prop) === \"textShadowColor\" ? raw1 : null;\n\t\t\tif (color1 == null) return void 0;\n\t\t\temit(sink, \"__textShadow_color\", color1, modifiers);\n\t\t}\n\t\treturn false;\n\t}\n\tif (kind === \"inset-ring\") {\n\t\tvar raw2 = core === \"inset-ring\" ? \"\" : core.slice(11);\n\t\tvar width = raw2 === \"\" ? \"1px\" : ringWidth(raw2);\n\t\tif (width != null) emit(sink, \"__insetRingWidth\", width, modifiers);\n\t\telse {\n\t\t\tvar color2 = resolveColor(raw2, config);\n\t\t\tif (color2 == null) return void 0;\n\t\t\temit(sink, \"__insetRingColor\", color2, modifiers);\n\t\t}\n\t\treturn false;\n\t}\n\tif (kind === \"inset-shadow\") {\n\t\tvar raw3 = core.slice(13);\n\t\tvar shadow1 = insetShadowPresets[raw3];\n\t\tif (shadow1) {\n\t\t\temit(sink, \"__insetShadowGeometry\", shadow1.geometry, modifiers);\n\t\t\temit(sink, \"__insetShadowDefaultColor\", shadow1.defaultColor, modifiers);\n\t\t} else {\n\t\t\tvar color3 = resolveColor(raw3, config);\n\t\t\tif (color3 == null) return void 0;\n\t\t\temit(sink, \"__insetShadowColor\", color3, modifiers);\n\t\t}\n\t\treturn false;\n\t}\n\tif (kind === \"shadow-color\") {\n\t\tvar raw4 = core.slice(7);\n\t\tvar color4 = resolveColor(raw4, config);\n\t\tif (color4 == null || raw4[0] === \"[\" && /\\s/.test(color4.replace(/\\([^)]*\\)/g, \"\"))) return void 0;\n\t\temit(sink, \"__shadowColor\", color4, modifiers);\n\t\treturn false;\n\t}\n\tif (kind === \"ring-offset\") {\n\t\tvar raw5 = core.slice(12);\n\t\tvar width1 = ringWidth(raw5);\n\t\tif (width1 != null) {\n\t\t\temit(sink, \"__ringOffsetWidth\", width1, modifiers);\n\t\t\treturn false;\n\t\t}\n\t\tvar color5 = resolveColor(raw5, config);\n\t\tif (color5 == null) return void 0;\n\t\temit(sink, \"__ringOffsetColor\", color5, modifiers);\n\t\treturn false;\n\t}\n\tif (kind === \"image\") {\n\t\tvar dir = linearTo[core.slice(13)];\n\t\tif (!dir) return true;\n\t\temit(sink, \"__gradientDirection\", dir, modifiers);\n\t\treturn false;\n\t}\n\tif (kind === \"from\" || kind === \"via\" || kind === \"to\") {\n\t\tvar raw6 = core.slice(kind.length + 1);\n\t\tvar prop1 = kind === \"from\" ? \"__gradientFrom\" : kind === \"via\" ? \"__gradientVia\" : \"__gradientTo\";\n\t\tif (/^\\d+(?:\\.\\d+)?%$/.test(raw6)) {\n\t\t\temit(sink, `${prop1}Position`, raw6, modifiers);\n\t\t\treturn false;\n\t\t}\n\t\tvar color6 = resolveColor(raw6, config);\n\t\tif (color6 == null) return true;\n\t\temit(sink, prop1, color6, modifiers);\n\t\treturn false;\n\t}\n\tif (core === \"ring\") {\n\t\temit(sink, \"__ring\", \"1px\", modifiers);\n\t\treturn false;\n\t}\n\tif (core === \"ring-inset\") {\n\t\temit(sink, \"__ringInset\", true, modifiers);\n\t\treturn false;\n\t}\n\tvar raw7 = core.slice(5);\n\tvar width2 = ringWidth(raw7);\n\tif (width2 != null) {\n\t\temit(sink, \"__ring\", width2, modifiers);\n\t\treturn false;\n\t}\n\tvar color7 = resolveColor(raw7, config);\n\tif (color7 == null) return true;\n\temit(sink, \"__ringColor\", color7, modifiers);\n\treturn false;\n}\nfunction noteTailwindTransform(sink, entry) {\n\tif (!transformProps.has(entry[0])) return false;\n\temit(sink, `__transform_${entry[0]}`, entry[1], entry[3] || []);\n\treturn true;\n}\nfunction noteBoxShadow(sink, value, modifiers) {\n\tif (typeof value !== \"string\" || value === \"unset\") return;\n\tif (value.indexOf(\" \") === -1 && value !== \"none\" && !value.startsWith(\"inset\")) return;\n\temit(sink, \"__shadow\", value, modifiers);\n}\n\nexport { noteBoxShadow, noteTailwindTransform, tryCompose };"],"mappings":";;;;;;AAKA,IAAI,iCAAiC,IAAI,IAAI;CAC5C;CACA;CACA;CACA;CACA;CACA;AACD,CAAC;AACD,IAAI,eAAe,CAAC,SAAS;AAC7B,IAAI,WAAW;CACd,GAAG;CACH,IAAI;CACJ,GAAG;CACH,IAAI;CACJ,GAAG;CACH,IAAI;CACJ,GAAG;CACH,IAAI;AACL;AACA,IAAI,gBAAgB;CACnB,aAAa;CACb,SAAS;CACT,SAAS;CACT,OAAO;CACP,OAAO;AACR;AACA,IAAI,oBAAoB;CACvB,IAAI;EACH,UAAU;EAC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AAkB;EACpF,IAAI,mBAAmB,KAAK,IAAI,GAAG;GAClC,KAAK,MAAM,GAAG,MAAM,WAAW,MAAM,SAAS;GAC9C,OAAO;EACR;EACA,IAAI,SAAS,aAAa,MAAM,MAAM;EACtC,IAAI,UAAU,MAAM,OAAO;EAC3B,KAAK,MAAM,OAAO,QAAQ,SAAS;EACnC,OAAO;CACR;CACA,IAAI,SAAS,QAAQ;EACpB,KAAK,MAAM,UAAU,OAAO,SAAS;EACrC,OAAO;CACR;CACA,IAAI,SAAS,cAAc;EAC1B,KAAK,MAAM,eAAe,MAAM,SAAS;EACzC,OAAO;CACR;CACA,IAAI,OAAO,KAAK,MAAM,CAAC;CACvB,IAAI,SAAS,UAAU,IAAI;CAC3B,IAAI,UAAU,MAAM;EACnB,KAAK,MAAM,UAAU,QAAQ,SAAS;EACtC,OAAO;CACR;CACA,IAAI,SAAS,aAAa,MAAM,MAAM;CACtC,IAAI,UAAU,MAAM,OAAO;CAC3B,KAAK,MAAM,eAAe,QAAQ,SAAS;CAC3C,OAAO;AACR;AACA,SAAS,sBAAsB,MAAM,OAAO;CAC3C,IAAI,CAAC,eAAe,IAAI,MAAM,EAAE,GAAG,OAAO;CAC1C,KAAK,MAAM,eAAe,MAAM,MAAM,MAAM,IAAI,MAAM,MAAM,CAAC,CAAC;CAC9D,OAAO;AACR;AACA,SAAS,cAAc,MAAM,OAAO,WAAW;CAC9C,IAAI,OAAO,UAAU,YAAY,UAAU,SAAS;CACpD,IAAI,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,MAAM,WAAW,OAAO,GAAG;CACjF,KAAK,MAAM,YAAY,OAAO,SAAS;AACxC"}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
function compose(props, keys, build) {
|
|
2
|
+
let conditions = null;
|
|
3
|
+
let present = false;
|
|
4
|
+
for (let index = 0; index < keys.length; index++) {
|
|
5
|
+
const value = props[keys[index]];
|
|
6
|
+
if (value == null) continue;
|
|
7
|
+
present = true;
|
|
8
|
+
if (typeof value === "object" && !Array.isArray(value)) {
|
|
9
|
+
conditions ||= /* @__PURE__ */ new Set();
|
|
10
|
+
for (const condition in value) conditions.add(condition);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
if (!present) return null;
|
|
14
|
+
if (!conditions) return build((key) => props[key]);
|
|
15
|
+
conditions.add("default");
|
|
16
|
+
const result = {};
|
|
17
|
+
for (const condition of conditions) {
|
|
18
|
+
const value = build((key) => {
|
|
19
|
+
const raw = props[key];
|
|
20
|
+
return raw && typeof raw === "object" && !Array.isArray(raw) ? raw[condition] ?? raw.default : raw;
|
|
21
|
+
});
|
|
22
|
+
if (value != null && value !== "") result[condition] = value;
|
|
23
|
+
}
|
|
24
|
+
return Object.keys(result).length > 0 ? result : null;
|
|
25
|
+
}
|
|
26
|
+
const gradientKeys = [
|
|
27
|
+
"__gradientDirection",
|
|
28
|
+
"__gradientFrom",
|
|
29
|
+
"__gradientVia",
|
|
30
|
+
"__gradientTo",
|
|
31
|
+
"__gradientFromPosition",
|
|
32
|
+
"__gradientViaPosition",
|
|
33
|
+
"__gradientToPosition"
|
|
34
|
+
];
|
|
35
|
+
function gradientStop(color, position) {
|
|
36
|
+
return position ? `${color} ${position}` : color;
|
|
37
|
+
}
|
|
38
|
+
function buildGradient(at) {
|
|
39
|
+
const dir = at("__gradientDirection");
|
|
40
|
+
const from = at("__gradientFrom");
|
|
41
|
+
const via = at("__gradientVia");
|
|
42
|
+
const to = at("__gradientTo");
|
|
43
|
+
if (!dir || !from && !via && !to) return null;
|
|
44
|
+
const start = gradientStop(from || "transparent", at("__gradientFromPosition"));
|
|
45
|
+
const end = gradientStop(to || "transparent", at("__gradientToPosition"));
|
|
46
|
+
return via ? `linear-gradient(${dir}, ${start}, ${gradientStop(via, at("__gradientViaPosition"))}, ${end})` : `linear-gradient(${dir}, ${start}, ${end})`;
|
|
47
|
+
}
|
|
48
|
+
const boxShadowKeys = [
|
|
49
|
+
"__ring",
|
|
50
|
+
"__ringColor",
|
|
51
|
+
"__ringInset",
|
|
52
|
+
"__ringOffsetWidth",
|
|
53
|
+
"__ringOffsetColor",
|
|
54
|
+
"__insetRingWidth",
|
|
55
|
+
"__insetRingColor",
|
|
56
|
+
"__insetShadowGeometry",
|
|
57
|
+
"__insetShadowDefaultColor",
|
|
58
|
+
"__insetShadowColor",
|
|
59
|
+
"__shadow",
|
|
60
|
+
"__shadowColor"
|
|
61
|
+
];
|
|
62
|
+
function splitTopLevel(value, separator) {
|
|
63
|
+
const parts = [];
|
|
64
|
+
let depth = 0;
|
|
65
|
+
let start = 0;
|
|
66
|
+
for (let index = 0; index < value.length; index++) {
|
|
67
|
+
const char = value[index];
|
|
68
|
+
if (char === "(") depth++;
|
|
69
|
+
else if (char === ")") depth--;
|
|
70
|
+
else if (char === separator && depth === 0) {
|
|
71
|
+
const part = value.slice(start, index).trim();
|
|
72
|
+
if (part) parts.push(part);
|
|
73
|
+
start = index + 1;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const last = value.slice(start).trim();
|
|
77
|
+
if (last) parts.push(last);
|
|
78
|
+
return parts;
|
|
79
|
+
}
|
|
80
|
+
const shadowLength = /^(?:inset|-?(?:\d+|\d*\.\d+)(?:px)?)$/;
|
|
81
|
+
function recolorShadow(shadow, color) {
|
|
82
|
+
return splitTopLevel(shadow, ",").map((layer) => {
|
|
83
|
+
const geometry = splitTopLevel(layer, " ").filter((part) => shadowLength.test(part));
|
|
84
|
+
return `${geometry.join(" ")} ${color}`;
|
|
85
|
+
}).join(", ");
|
|
86
|
+
}
|
|
87
|
+
function px(value) {
|
|
88
|
+
return Number.parseFloat(value) || 0;
|
|
89
|
+
}
|
|
90
|
+
function buildBoxShadow(at) {
|
|
91
|
+
const shadows = [];
|
|
92
|
+
const insetShadowGeometry = at("__insetShadowGeometry");
|
|
93
|
+
if (insetShadowGeometry) {
|
|
94
|
+
const color = at("__insetShadowColor") || at("__insetShadowDefaultColor") || "rgb(0 0 0 / 0.05)";
|
|
95
|
+
shadows.push(`${insetShadowGeometry} ${color}`.trim());
|
|
96
|
+
}
|
|
97
|
+
const insetRingWidth = at("__insetRingWidth");
|
|
98
|
+
if (insetRingWidth != null) {
|
|
99
|
+
shadows.push(`inset 0 0 0 ${insetRingWidth} ${at("__insetRingColor") || "currentColor"}`);
|
|
100
|
+
}
|
|
101
|
+
const ring = at("__ring");
|
|
102
|
+
if (ring != null) {
|
|
103
|
+
const inset = at("__ringInset") ? "inset " : "";
|
|
104
|
+
const offset = at("__ringOffsetWidth");
|
|
105
|
+
if (offset != null && px(offset) > 0) {
|
|
106
|
+
shadows.push(`${inset}0 0 0 ${offset} ${at("__ringOffsetColor") || "#fff"}`);
|
|
107
|
+
}
|
|
108
|
+
const spread = offset != null ? `${px(ring) + px(offset)}px` : ring;
|
|
109
|
+
shadows.push(`${inset}0 0 0 ${spread} ${at("__ringColor") || "currentColor"}`);
|
|
110
|
+
}
|
|
111
|
+
const shadow = at("__shadow");
|
|
112
|
+
if (shadow && shadow !== "none") {
|
|
113
|
+
const color = at("__shadowColor");
|
|
114
|
+
shadows.push(color ? recolorShadow(shadow, color) : shadow);
|
|
115
|
+
}
|
|
116
|
+
return shadows.length > 0 ? shadows.join(", ") : null;
|
|
117
|
+
}
|
|
118
|
+
const filterFunctions = [
|
|
119
|
+
["__filter_blur", "blur"],
|
|
120
|
+
["__filter_brightness", "brightness"],
|
|
121
|
+
["__filter_contrast", "contrast"],
|
|
122
|
+
["__filter_grayscale", "grayscale"],
|
|
123
|
+
["__filter_hueRotate", "hue-rotate"],
|
|
124
|
+
["__filter_invert", "invert"],
|
|
125
|
+
["__filter_saturate", "saturate"],
|
|
126
|
+
["__filter_sepia", "sepia"]
|
|
127
|
+
];
|
|
128
|
+
const filterKeys = [
|
|
129
|
+
"__filter_blur",
|
|
130
|
+
"__filter_brightness",
|
|
131
|
+
"__filter_contrast",
|
|
132
|
+
"__filter_grayscale",
|
|
133
|
+
"__filter_hueRotate",
|
|
134
|
+
"__filter_invert",
|
|
135
|
+
"__filter_saturate",
|
|
136
|
+
"__filter_sepia",
|
|
137
|
+
"__dropShadowGeometry",
|
|
138
|
+
"__dropShadowDefaultColor",
|
|
139
|
+
"__dropShadowColor"
|
|
140
|
+
];
|
|
141
|
+
function buildFilter(at) {
|
|
142
|
+
const parts = [];
|
|
143
|
+
for (let index = 0; index < filterFunctions.length; index++) {
|
|
144
|
+
const [key, cssName] = filterFunctions[index];
|
|
145
|
+
const value = at(key);
|
|
146
|
+
if (value != null && value !== "") parts.push(`${cssName}(${value})`);
|
|
147
|
+
}
|
|
148
|
+
const geometry = at("__dropShadowGeometry");
|
|
149
|
+
if (geometry) {
|
|
150
|
+
const color = at("__dropShadowColor") || at("__dropShadowDefaultColor") || "rgb(0 0 0 / 0.15)";
|
|
151
|
+
parts.push(`drop-shadow(${geometry} ${color})`.trim());
|
|
152
|
+
}
|
|
153
|
+
return parts.length > 0 ? parts.join(" ") : null;
|
|
154
|
+
}
|
|
155
|
+
const transformFunctions = [
|
|
156
|
+
["__transform_perspective", "perspective"],
|
|
157
|
+
["__transform_rotateX", "rotateX"],
|
|
158
|
+
["__transform_rotateY", "rotateY"],
|
|
159
|
+
["__transform_rotateZ", "rotateZ"],
|
|
160
|
+
["__transform_skewX", "skewX"],
|
|
161
|
+
["__transform_skewY", "skewY"]
|
|
162
|
+
];
|
|
163
|
+
const transformKeys = transformFunctions.map(([key]) => key);
|
|
164
|
+
function buildTransform(at) {
|
|
165
|
+
const parts = [];
|
|
166
|
+
for (let index = 0; index < transformFunctions.length; index++) {
|
|
167
|
+
const [key, cssName] = transformFunctions[index];
|
|
168
|
+
const value = at(key);
|
|
169
|
+
if (value != null && value !== "") parts.push(`${cssName}(${value})`);
|
|
170
|
+
}
|
|
171
|
+
return parts.length > 0 ? parts.join(" ") : null;
|
|
172
|
+
}
|
|
173
|
+
const leadingKeys = ["__leading", "__textLeading"];
|
|
174
|
+
function buildLeading(at) {
|
|
175
|
+
return at("__leading") ?? at("__textLeading") ?? null;
|
|
176
|
+
}
|
|
177
|
+
function composedResolver(props) {
|
|
178
|
+
let result = null;
|
|
179
|
+
const backgroundImage = compose(props, gradientKeys, buildGradient);
|
|
180
|
+
if (backgroundImage) (result ??= {}).backgroundImage = backgroundImage;
|
|
181
|
+
if (props.__ring != null || props.__insetRingWidth != null || props.__insetShadowGeometry != null || props.__shadowColor != null) {
|
|
182
|
+
const boxShadow = compose(props, boxShadowKeys, buildBoxShadow);
|
|
183
|
+
if (boxShadow) (result ??= {}).boxShadow = boxShadow;
|
|
184
|
+
}
|
|
185
|
+
const filter = compose(props, filterKeys, buildFilter);
|
|
186
|
+
if (filter) (result ??= {}).filter = filter;
|
|
187
|
+
const transform = compose(props, transformKeys, buildTransform);
|
|
188
|
+
if (transform) (result ??= {}).transform = transform;
|
|
189
|
+
const lineHeight = compose(props, leadingKeys, buildLeading);
|
|
190
|
+
if (lineHeight != null) (result ??= {}).lineHeight = lineHeight;
|
|
191
|
+
const preset = props.__textShadow_preset;
|
|
192
|
+
const color = props.__textShadow_color;
|
|
193
|
+
if (preset) {
|
|
194
|
+
result ??= {};
|
|
195
|
+
result.textShadowOffset = preset.offset;
|
|
196
|
+
result.textShadowRadius = preset.radius;
|
|
197
|
+
result.textShadowColor = color || preset.defaultColor;
|
|
198
|
+
} else if (color) {
|
|
199
|
+
;
|
|
200
|
+
(result ??= {}).textShadowColor = color;
|
|
201
|
+
}
|
|
202
|
+
return result;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export { composedResolver };
|
|
206
|
+
//# sourceMappingURL=composedResolver.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composedResolver.js","names":[],"sources":["esm/composedResolver.js"],"sourcesContent":["function compose(props, keys, build) {\n let conditions = null;\n let present = false;\n for (let index = 0; index < keys.length; index++) {\n const value = props[keys[index]];\n if (value == null) continue;\n present = true;\n if (typeof value === \"object\" && !Array.isArray(value)) {\n conditions ||= /* @__PURE__ */ new Set();\n for (const condition in value) conditions.add(condition);\n }\n }\n if (!present) return null;\n if (!conditions) return build((key) => props[key]);\n conditions.add(\"default\");\n const result = {};\n for (const condition of conditions) {\n const value = build((key) => {\n const raw = props[key];\n return raw && typeof raw === \"object\" && !Array.isArray(raw) ? raw[condition] ?? raw.default : raw;\n });\n if (value != null && value !== \"\") result[condition] = value;\n }\n return Object.keys(result).length > 0 ? result : null;\n}\nconst gradientKeys = [\n \"__gradientDirection\",\n \"__gradientFrom\",\n \"__gradientVia\",\n \"__gradientTo\",\n \"__gradientFromPosition\",\n \"__gradientViaPosition\",\n \"__gradientToPosition\"\n];\nfunction gradientStop(color, position) {\n return position ? `${color} ${position}` : color;\n}\nfunction buildGradient(at) {\n const dir = at(\"__gradientDirection\");\n const from = at(\"__gradientFrom\");\n const via = at(\"__gradientVia\");\n const to = at(\"__gradientTo\");\n if (!dir || !from && !via && !to) return null;\n const start = gradientStop(from || \"transparent\", at(\"__gradientFromPosition\"));\n const end = gradientStop(to || \"transparent\", at(\"__gradientToPosition\"));\n return via ? `linear-gradient(${dir}, ${start}, ${gradientStop(via, at(\"__gradientViaPosition\"))}, ${end})` : `linear-gradient(${dir}, ${start}, ${end})`;\n}\nconst boxShadowKeys = [\n \"__ring\",\n \"__ringColor\",\n \"__ringInset\",\n \"__ringOffsetWidth\",\n \"__ringOffsetColor\",\n \"__insetRingWidth\",\n \"__insetRingColor\",\n \"__insetShadowGeometry\",\n \"__insetShadowDefaultColor\",\n \"__insetShadowColor\",\n \"__shadow\",\n \"__shadowColor\"\n];\nfunction splitTopLevel(value, separator) {\n const parts = [];\n let depth = 0;\n let start = 0;\n for (let index = 0; index < value.length; index++) {\n const char = value[index];\n if (char === \"(\") depth++;\n else if (char === \")\") depth--;\n else if (char === separator && depth === 0) {\n const part = value.slice(start, index).trim();\n if (part) parts.push(part);\n start = index + 1;\n }\n }\n const last = value.slice(start).trim();\n if (last) parts.push(last);\n return parts;\n}\nconst shadowLength = /^(?:inset|-?(?:\\d+|\\d*\\.\\d+)(?:px)?)$/;\nfunction recolorShadow(shadow, color) {\n return splitTopLevel(shadow, \",\").map((layer) => {\n const geometry = splitTopLevel(layer, \" \").filter((part) => shadowLength.test(part));\n return `${geometry.join(\" \")} ${color}`;\n }).join(\", \");\n}\nfunction px(value) {\n return Number.parseFloat(value) || 0;\n}\nfunction buildBoxShadow(at) {\n const shadows = [];\n const insetShadowGeometry = at(\"__insetShadowGeometry\");\n if (insetShadowGeometry) {\n const color = at(\"__insetShadowColor\") || at(\"__insetShadowDefaultColor\") || \"rgb(0 0 0 / 0.05)\";\n shadows.push(`${insetShadowGeometry} ${color}`.trim());\n }\n const insetRingWidth = at(\"__insetRingWidth\");\n if (insetRingWidth != null) {\n shadows.push(\n `inset 0 0 0 ${insetRingWidth} ${at(\"__insetRingColor\") || \"currentColor\"}`\n );\n }\n const ring = at(\"__ring\");\n if (ring != null) {\n const inset = at(\"__ringInset\") ? \"inset \" : \"\";\n const offset = at(\"__ringOffsetWidth\");\n if (offset != null && px(offset) > 0) {\n shadows.push(`${inset}0 0 0 ${offset} ${at(\"__ringOffsetColor\") || \"#fff\"}`);\n }\n const spread = offset != null ? `${px(ring) + px(offset)}px` : ring;\n shadows.push(`${inset}0 0 0 ${spread} ${at(\"__ringColor\") || \"currentColor\"}`);\n }\n const shadow = at(\"__shadow\");\n if (shadow && shadow !== \"none\") {\n const color = at(\"__shadowColor\");\n shadows.push(color ? recolorShadow(shadow, color) : shadow);\n }\n return shadows.length > 0 ? shadows.join(\", \") : null;\n}\nconst filterFunctions = [\n [\"__filter_blur\", \"blur\"],\n [\"__filter_brightness\", \"brightness\"],\n [\"__filter_contrast\", \"contrast\"],\n [\"__filter_grayscale\", \"grayscale\"],\n [\"__filter_hueRotate\", \"hue-rotate\"],\n [\"__filter_invert\", \"invert\"],\n [\"__filter_saturate\", \"saturate\"],\n [\"__filter_sepia\", \"sepia\"]\n];\nconst filterKeys = [\n \"__filter_blur\",\n \"__filter_brightness\",\n \"__filter_contrast\",\n \"__filter_grayscale\",\n \"__filter_hueRotate\",\n \"__filter_invert\",\n \"__filter_saturate\",\n \"__filter_sepia\",\n \"__dropShadowGeometry\",\n \"__dropShadowDefaultColor\",\n \"__dropShadowColor\"\n];\nfunction buildFilter(at) {\n const parts = [];\n for (let index = 0; index < filterFunctions.length; index++) {\n const [key, cssName] = filterFunctions[index];\n const value = at(key);\n if (value != null && value !== \"\") parts.push(`${cssName}(${value})`);\n }\n const geometry = at(\"__dropShadowGeometry\");\n if (geometry) {\n const color = at(\"__dropShadowColor\") || at(\"__dropShadowDefaultColor\") || \"rgb(0 0 0 / 0.15)\";\n parts.push(`drop-shadow(${geometry} ${color})`.trim());\n }\n return parts.length > 0 ? parts.join(\" \") : null;\n}\nconst transformFunctions = [\n [\"__transform_perspective\", \"perspective\"],\n [\"__transform_rotateX\", \"rotateX\"],\n [\"__transform_rotateY\", \"rotateY\"],\n [\"__transform_rotateZ\", \"rotateZ\"],\n [\"__transform_skewX\", \"skewX\"],\n [\"__transform_skewY\", \"skewY\"]\n];\nconst transformKeys = transformFunctions.map(([key]) => key);\nfunction buildTransform(at) {\n const parts = [];\n for (let index = 0; index < transformFunctions.length; index++) {\n const [key, cssName] = transformFunctions[index];\n const value = at(key);\n if (value != null && value !== \"\") parts.push(`${cssName}(${value})`);\n }\n return parts.length > 0 ? parts.join(\" \") : null;\n}\nconst leadingKeys = [\"__leading\", \"__textLeading\"];\nfunction buildLeading(at) {\n return at(\"__leading\") ?? at(\"__textLeading\") ?? null;\n}\nfunction composedResolver(props) {\n let result = null;\n const backgroundImage = compose(props, gradientKeys, buildGradient);\n if (backgroundImage) (result ??= {}).backgroundImage = backgroundImage;\n if (props.__ring != null || props.__insetRingWidth != null || props.__insetShadowGeometry != null || props.__shadowColor != null) {\n const boxShadow = compose(props, boxShadowKeys, buildBoxShadow);\n if (boxShadow) (result ??= {}).boxShadow = boxShadow;\n }\n const filter = compose(props, filterKeys, buildFilter);\n if (filter) (result ??= {}).filter = filter;\n const transform = compose(props, transformKeys, buildTransform);\n if (transform) (result ??= {}).transform = transform;\n const lineHeight = compose(props, leadingKeys, buildLeading);\n if (lineHeight != null) (result ??= {}).lineHeight = lineHeight;\n const preset = props.__textShadow_preset;\n const color = props.__textShadow_color;\n if (preset) {\n result ??= {};\n result.textShadowOffset = preset.offset;\n result.textShadowRadius = preset.radius;\n result.textShadowColor = color || preset.defaultColor;\n } else if (color) {\n ;\n (result ??= {}).textShadowColor = color;\n }\n return result;\n}\nexport {\n composedResolver\n};\n//# sourceMappingURL=composedResolver.js.map\n"],"mappings":";AAAA,SAAS,QAAQ,OAAO,MAAM,OAAO;CACnC,IAAI,aAAa;CACjB,IAAI,UAAU;CACd,KAAK,IAAI,QAAQ,GAAG,QAAQ,KAAK,QAAQ,SAAS;EAChD,MAAM,QAAQ,MAAM,KAAK;EACzB,IAAI,SAAS,MAAM;EACnB,UAAU;EACV,IAAI,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK,GAAG;GACtD,+BAA+B,IAAI,IAAI;GACvC,KAAK,MAAM,aAAa,OAAO,WAAW,IAAI,SAAS;EACzD;CACF;CACA,IAAI,CAAC,SAAS,OAAO;CACrB,IAAI,CAAC,YAAY,OAAO,OAAO,QAAQ,MAAM,IAAI;CACjD,WAAW,IAAI,SAAS;CACxB,MAAM,SAAS,CAAC;CAChB,KAAK,MAAM,aAAa,YAAY;EAClC,MAAM,QAAQ,OAAO,QAAQ;GAC3B,MAAM,MAAM,MAAM;GAClB,OAAO,OAAO,OAAO,QAAQ,YAAY,CAAC,MAAM,QAAQ,GAAG,IAAI,IAAI,cAAc,IAAI,UAAU;EACjG,CAAC;EACD,IAAI,SAAS,QAAQ,UAAU,IAAI,OAAO,aAAa;CACzD;CACA,OAAO,OAAO,KAAK,MAAM,CAAC,CAAC,SAAS,IAAI,SAAS;AACnD;AACA,MAAM,eAAe;CACnB;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AACA,SAAS,aAAa,OA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