@tachui/core 0.8.22 → 0.8.24
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/assets/FontAsset.d.ts.map +1 -1
- package/dist/assets/index.js +42 -41
- package/dist/{binding-DCV5PKkK.js → binding-DCr-JHsC.js} +9 -9
- package/dist/build-tools/typegen-runner.d.ts +4 -0
- package/dist/build-tools/typegen-runner.d.ts.map +1 -1
- package/dist/cleanup-BR8UpYPX.js +61 -0
- package/dist/common.js +272 -277
- package/dist/{component-D-O9yq0P.js → component-BzvSm8rM.js} +19 -19
- package/dist/{component-base-C41K3NTe.js → component-base-Do2EdQkr.js} +32 -33
- package/dist/{component-context-B9HI2nZH.js → component-context-C7Y6Xu6h.js} +1 -1
- package/dist/components/index.js +1 -1
- package/dist/computed-CA4Cgtoe.js +407 -0
- package/dist/{concatenated-component-2Gzy5e2c.js → concatenated-component-CA54ng_j.js} +43 -44
- package/dist/css-classes/index.js +2 -2
- package/dist/{effect-BsW3fy1q.js → effect-DgNm6jk9.js} +3 -3
- package/dist/{enhanced-renderer-t9Ni2EEG.js → enhanced-renderer-D05CCloF.js} +26 -28
- package/dist/essential.js +276 -281
- package/dist/factories-B05hE6kc.js +644 -0
- package/dist/{factory-gqfMcmOy.js → factory-B1YXfgU1.js} +23 -29
- package/dist/full.d.ts +12 -0
- package/dist/full.d.ts.map +1 -0
- package/dist/full.js +436 -0
- package/dist/gradients/index.js +53 -53
- package/dist/hooks-w_FYPLjI.js +158 -0
- package/dist/{index-DL9Cys3t.js → index-CmQmIgPK.js} +220 -233
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +295 -300
- package/dist/minimal-prod.js +106 -108
- package/dist/minimal.js +97 -98
- package/dist/modifiers/base.d.ts.map +1 -1
- package/dist/modifiers/base.js +121 -120
- package/dist/modifiers/builder.js +1 -1
- package/dist/modifiers/index.js +22 -23
- package/dist/modifiers/registry.js +1 -1
- package/dist/{observed-object-p1CLdrFm.js → observed-object-DCoyucmV.js} +3 -3
- package/dist/optimization-D9t53vNJ.js +308 -0
- package/dist/{proxy-Cp0QUXME.js → proxy-B7ZIqGd0.js} +3 -3
- package/dist/reactive/index.js +87 -85
- package/dist/runtime/dom-bridge.js +15 -17
- package/dist/runtime/index.js +71 -71
- package/dist/runtime/renderer.js +10 -11
- package/dist/signal-BRoiFOO7.js +262 -0
- package/dist/{signal-list-07gNXGiW.js → signal-list-_Eid-N7_.js} +285 -176
- package/dist/state/index.js +43 -44
- package/dist/theme-D5-09a8N.js +26 -0
- package/dist/validation/index.js +24 -26
- package/dist/version.js +1 -1
- package/package.json +16 -3
- package/dist/factories-B3-rmvkB.js +0 -268
- package/dist/hooks-WGmpzYgD.js +0 -446
- package/dist/optimization-CbKNA9w4.js +0 -21
- package/dist/presets-B9x94uRn.js +0 -381
- package/dist/scheduler-DppMK9mR.js +0 -169
- package/dist/theme-CRLPHryV.js +0 -687
- package/dist/{index-JQ1sW1SK.js → index-7vhCZc7g.js} +1 -1
|
@@ -0,0 +1,644 @@
|
|
|
1
|
+
import { LayoutModifier as P, AppearanceModifier as S, AnimationModifier as y, LifecycleModifier as C, InteractionModifier as g, BaseModifier as F } from "./modifiers/base.js";
|
|
2
|
+
import { ModifierPriority as h } from "@tachui/types/modifiers";
|
|
3
|
+
import { globalModifierRegistry as k } from "@tachui/registry";
|
|
4
|
+
import { c as w } from "./effect-DgNm6jk9.js";
|
|
5
|
+
import { i as b } from "./signal-BRoiFOO7.js";
|
|
6
|
+
h.LAYOUT;
|
|
7
|
+
const z = (e) => new P({ alignment: e });
|
|
8
|
+
function H(e) {
|
|
9
|
+
return z(e);
|
|
10
|
+
}
|
|
11
|
+
h.LAYOUT;
|
|
12
|
+
const O = (e) => new P({ layoutPriority: e });
|
|
13
|
+
function T(e) {
|
|
14
|
+
return O(e);
|
|
15
|
+
}
|
|
16
|
+
h.APPEARANCE;
|
|
17
|
+
const j = (e) => new S({ opacity: e });
|
|
18
|
+
function D(e) {
|
|
19
|
+
return j(e);
|
|
20
|
+
}
|
|
21
|
+
h.APPEARANCE;
|
|
22
|
+
const $ = (e) => new S({ cornerRadius: e });
|
|
23
|
+
function V(e) {
|
|
24
|
+
return $(e);
|
|
25
|
+
}
|
|
26
|
+
function c(e, ...r) {
|
|
27
|
+
const t = k.get(e);
|
|
28
|
+
if (!t)
|
|
29
|
+
throw new Error(
|
|
30
|
+
`Modifier '${e}' not found in registry. Import '@tachui/modifiers' or the relevant segmented bundle before using preset helpers.`
|
|
31
|
+
);
|
|
32
|
+
return t(...r);
|
|
33
|
+
}
|
|
34
|
+
const v = {
|
|
35
|
+
/**
|
|
36
|
+
* Set foreground (text) color
|
|
37
|
+
*/
|
|
38
|
+
foregroundColor(e) {
|
|
39
|
+
return c("foregroundColor", e);
|
|
40
|
+
},
|
|
41
|
+
/**
|
|
42
|
+
* Set frame dimensions with support for infinity
|
|
43
|
+
*/
|
|
44
|
+
frame(e, r, t) {
|
|
45
|
+
let i = t || {};
|
|
46
|
+
return (e !== void 0 || r !== void 0) && (i = {
|
|
47
|
+
...i,
|
|
48
|
+
...e !== void 0 ? { width: e } : {},
|
|
49
|
+
...r !== void 0 ? { height: r } : {}
|
|
50
|
+
}), new P({ frame: i });
|
|
51
|
+
},
|
|
52
|
+
/**
|
|
53
|
+
* Set padding on all sides
|
|
54
|
+
*/
|
|
55
|
+
padding(e) {
|
|
56
|
+
return c("padding", e);
|
|
57
|
+
},
|
|
58
|
+
/**
|
|
59
|
+
* Set margin on all sides
|
|
60
|
+
*/
|
|
61
|
+
margin(e) {
|
|
62
|
+
return c("margin", e);
|
|
63
|
+
},
|
|
64
|
+
/**
|
|
65
|
+
* Set content alignment
|
|
66
|
+
*/
|
|
67
|
+
alignment(e) {
|
|
68
|
+
return H(e);
|
|
69
|
+
},
|
|
70
|
+
/**
|
|
71
|
+
* Set layout priority for ZStack container sizing and flexible layout
|
|
72
|
+
* Higher priority views determine container size in ZStack
|
|
73
|
+
*/
|
|
74
|
+
layoutPriority(e) {
|
|
75
|
+
return T(e);
|
|
76
|
+
}
|
|
77
|
+
}, p = {
|
|
78
|
+
/**
|
|
79
|
+
* Set foreground (text) color
|
|
80
|
+
*/
|
|
81
|
+
foregroundColor(e) {
|
|
82
|
+
return c("foregroundColor", e);
|
|
83
|
+
},
|
|
84
|
+
/**
|
|
85
|
+
* Set background color
|
|
86
|
+
*/
|
|
87
|
+
backgroundColor(e) {
|
|
88
|
+
return c("backgroundColor", e);
|
|
89
|
+
},
|
|
90
|
+
/**
|
|
91
|
+
* Set background (supports gradients)
|
|
92
|
+
*/
|
|
93
|
+
background(e) {
|
|
94
|
+
return c("background", e);
|
|
95
|
+
},
|
|
96
|
+
/**
|
|
97
|
+
* Set font properties
|
|
98
|
+
*/
|
|
99
|
+
font(e) {
|
|
100
|
+
return c("font", e);
|
|
101
|
+
},
|
|
102
|
+
/**
|
|
103
|
+
* Set font size
|
|
104
|
+
*/
|
|
105
|
+
fontSize(e) {
|
|
106
|
+
return c("fontSize", e);
|
|
107
|
+
},
|
|
108
|
+
/**
|
|
109
|
+
* Set font weight
|
|
110
|
+
*/
|
|
111
|
+
fontWeight(e) {
|
|
112
|
+
return c("fontWeight", e);
|
|
113
|
+
},
|
|
114
|
+
/**
|
|
115
|
+
* Set font family
|
|
116
|
+
*/
|
|
117
|
+
fontFamily(e) {
|
|
118
|
+
return c("fontFamily", e);
|
|
119
|
+
},
|
|
120
|
+
/**
|
|
121
|
+
* Set opacity
|
|
122
|
+
*/
|
|
123
|
+
opacity(e) {
|
|
124
|
+
return D(e);
|
|
125
|
+
},
|
|
126
|
+
/**
|
|
127
|
+
* Set corner radius (enhanced)
|
|
128
|
+
*/
|
|
129
|
+
cornerRadius(e) {
|
|
130
|
+
return V(e);
|
|
131
|
+
},
|
|
132
|
+
/**
|
|
133
|
+
* Set border
|
|
134
|
+
*/
|
|
135
|
+
border(e, r = "#000000", t = "solid") {
|
|
136
|
+
return c("border", e, r, t);
|
|
137
|
+
},
|
|
138
|
+
/**
|
|
139
|
+
* Set detailed border properties
|
|
140
|
+
*/
|
|
141
|
+
borderDetailed(e) {
|
|
142
|
+
return c("border", e);
|
|
143
|
+
}
|
|
144
|
+
// Shadow functionality moved to @tachui/modifiers/effects entry point
|
|
145
|
+
}, A = {
|
|
146
|
+
/**
|
|
147
|
+
* Add tap handler
|
|
148
|
+
*/
|
|
149
|
+
onTap(e) {
|
|
150
|
+
return new g({ onTap: e });
|
|
151
|
+
},
|
|
152
|
+
/**
|
|
153
|
+
* Add hover handler
|
|
154
|
+
*/
|
|
155
|
+
onHover(e) {
|
|
156
|
+
return new g({ onHover: e });
|
|
157
|
+
},
|
|
158
|
+
/**
|
|
159
|
+
* Add focus handler
|
|
160
|
+
*/
|
|
161
|
+
onFocus(e) {
|
|
162
|
+
return new g({ onFocus: e });
|
|
163
|
+
},
|
|
164
|
+
/**
|
|
165
|
+
* Set disabled state
|
|
166
|
+
*/
|
|
167
|
+
disabled(e = !0) {
|
|
168
|
+
return new g({ disabled: e });
|
|
169
|
+
},
|
|
170
|
+
/**
|
|
171
|
+
* Set accessibility label
|
|
172
|
+
*/
|
|
173
|
+
accessibilityLabel(e) {
|
|
174
|
+
return new g({ accessibilityLabel: e });
|
|
175
|
+
},
|
|
176
|
+
/**
|
|
177
|
+
* Set accessibility hint
|
|
178
|
+
*/
|
|
179
|
+
accessibilityHint(e) {
|
|
180
|
+
return new g({ accessibilityHint: e });
|
|
181
|
+
}
|
|
182
|
+
}, L = {
|
|
183
|
+
/**
|
|
184
|
+
* Add transition
|
|
185
|
+
*/
|
|
186
|
+
transition(e = "all", r = 300, t = "ease", i = 0) {
|
|
187
|
+
return new y({
|
|
188
|
+
transition: { property: e, duration: r, easing: t, delay: i }
|
|
189
|
+
});
|
|
190
|
+
},
|
|
191
|
+
/**
|
|
192
|
+
* Add detailed transition
|
|
193
|
+
*/
|
|
194
|
+
transitionDetailed(e) {
|
|
195
|
+
return new y({ transition: e });
|
|
196
|
+
},
|
|
197
|
+
/**
|
|
198
|
+
* Add animation
|
|
199
|
+
*/
|
|
200
|
+
animation(e) {
|
|
201
|
+
return new y({ animation: e });
|
|
202
|
+
},
|
|
203
|
+
/**
|
|
204
|
+
* Add fade in animation
|
|
205
|
+
*/
|
|
206
|
+
fadeIn(e = 300) {
|
|
207
|
+
return new y({
|
|
208
|
+
animation: {
|
|
209
|
+
keyframes: {
|
|
210
|
+
"0%": { opacity: "0" },
|
|
211
|
+
"100%": { opacity: "1" }
|
|
212
|
+
},
|
|
213
|
+
duration: e,
|
|
214
|
+
easing: "ease-out"
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
},
|
|
218
|
+
/**
|
|
219
|
+
* Add fade out animation
|
|
220
|
+
*/
|
|
221
|
+
fadeOut(e = 300) {
|
|
222
|
+
return new y({
|
|
223
|
+
animation: {
|
|
224
|
+
keyframes: {
|
|
225
|
+
"0%": { opacity: "1" },
|
|
226
|
+
"100%": { opacity: "0" }
|
|
227
|
+
},
|
|
228
|
+
duration: e,
|
|
229
|
+
easing: "ease-in"
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
},
|
|
233
|
+
/**
|
|
234
|
+
* Add slide in animation
|
|
235
|
+
*/
|
|
236
|
+
slideIn(e = "up", r = 300, t = 20) {
|
|
237
|
+
const i = {
|
|
238
|
+
up: [`translateY(${t}px)`, "translateY(0)"],
|
|
239
|
+
down: [`translateY(-${t}px)`, "translateY(0)"],
|
|
240
|
+
left: [`translateX(${t}px)`, "translateX(0)"],
|
|
241
|
+
right: [`translateX(-${t}px)`, "translateX(0)"]
|
|
242
|
+
}, [s, o] = i[e];
|
|
243
|
+
return new y({
|
|
244
|
+
animation: {
|
|
245
|
+
keyframes: {
|
|
246
|
+
"0%": { transform: s, opacity: "0" },
|
|
247
|
+
"100%": { transform: o, opacity: "1" }
|
|
248
|
+
},
|
|
249
|
+
duration: r,
|
|
250
|
+
easing: "ease-out"
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
},
|
|
254
|
+
/**
|
|
255
|
+
* Add scale animation
|
|
256
|
+
*/
|
|
257
|
+
scaleAnimation(e = 0.8, r = 1, t = 300) {
|
|
258
|
+
return new y({
|
|
259
|
+
animation: {
|
|
260
|
+
keyframes: {
|
|
261
|
+
"0%": { transform: `scale(${e})`, opacity: "0" },
|
|
262
|
+
"100%": { transform: `scale(${r})`, opacity: "1" }
|
|
263
|
+
},
|
|
264
|
+
duration: t,
|
|
265
|
+
easing: "ease-out"
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
}, W = {
|
|
270
|
+
/**
|
|
271
|
+
* Execute handler when component appears in viewport
|
|
272
|
+
*/
|
|
273
|
+
onAppear(e) {
|
|
274
|
+
return new C({ onAppear: e });
|
|
275
|
+
},
|
|
276
|
+
/**
|
|
277
|
+
* Execute handler when component disappears from viewport
|
|
278
|
+
*/
|
|
279
|
+
onDisappear(e) {
|
|
280
|
+
return new C({ onDisappear: e });
|
|
281
|
+
},
|
|
282
|
+
/**
|
|
283
|
+
* Execute async task with automatic cancellation on component unmount
|
|
284
|
+
*/
|
|
285
|
+
task(e, r) {
|
|
286
|
+
return new C({
|
|
287
|
+
task: {
|
|
288
|
+
operation: e,
|
|
289
|
+
id: r?.id,
|
|
290
|
+
priority: r?.priority || "default"
|
|
291
|
+
}
|
|
292
|
+
});
|
|
293
|
+
},
|
|
294
|
+
/**
|
|
295
|
+
* Add pull-to-refresh functionality
|
|
296
|
+
*/
|
|
297
|
+
refreshable(e, r) {
|
|
298
|
+
return new C({
|
|
299
|
+
refreshable: {
|
|
300
|
+
onRefresh: e,
|
|
301
|
+
isRefreshing: r
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
}, Y = {
|
|
306
|
+
/**
|
|
307
|
+
* Card-like appearance
|
|
308
|
+
*/
|
|
309
|
+
card(e = 16) {
|
|
310
|
+
return [
|
|
311
|
+
p.backgroundColor("#ffffff"),
|
|
312
|
+
p.cornerRadius(8),
|
|
313
|
+
// shadow moved to @tachui/modifiers/effects entry point
|
|
314
|
+
v.padding(e)
|
|
315
|
+
];
|
|
316
|
+
},
|
|
317
|
+
/**
|
|
318
|
+
* Button-like appearance
|
|
319
|
+
*/
|
|
320
|
+
button(e = "#007AFF", r = "#ffffff") {
|
|
321
|
+
return [
|
|
322
|
+
p.backgroundColor(e),
|
|
323
|
+
p.foregroundColor(r),
|
|
324
|
+
p.cornerRadius(6),
|
|
325
|
+
v.padding(12),
|
|
326
|
+
// Simplified to single value for now
|
|
327
|
+
A.onHover((t) => {
|
|
328
|
+
}),
|
|
329
|
+
L.transition("all", 150)
|
|
330
|
+
];
|
|
331
|
+
},
|
|
332
|
+
/**
|
|
333
|
+
* Input field appearance
|
|
334
|
+
*/
|
|
335
|
+
input() {
|
|
336
|
+
return [
|
|
337
|
+
p.border(1, "#d1d5db"),
|
|
338
|
+
p.cornerRadius(4),
|
|
339
|
+
v.padding(8),
|
|
340
|
+
L.transition("border-color", 150),
|
|
341
|
+
A.onFocus((e) => {
|
|
342
|
+
})
|
|
343
|
+
];
|
|
344
|
+
},
|
|
345
|
+
/**
|
|
346
|
+
* Typography presets
|
|
347
|
+
*/
|
|
348
|
+
typography: {
|
|
349
|
+
title: () => [
|
|
350
|
+
p.fontSize(24),
|
|
351
|
+
p.fontWeight("bold")
|
|
352
|
+
],
|
|
353
|
+
heading: () => [
|
|
354
|
+
p.fontSize(20),
|
|
355
|
+
p.fontWeight("600")
|
|
356
|
+
],
|
|
357
|
+
body: () => [
|
|
358
|
+
p.fontSize(16),
|
|
359
|
+
p.fontWeight("normal")
|
|
360
|
+
],
|
|
361
|
+
caption: () => [
|
|
362
|
+
p.fontSize(12),
|
|
363
|
+
p.fontWeight("normal"),
|
|
364
|
+
p.opacity(0.7)
|
|
365
|
+
]
|
|
366
|
+
}
|
|
367
|
+
}, Z = {
|
|
368
|
+
...v,
|
|
369
|
+
...p,
|
|
370
|
+
...A,
|
|
371
|
+
...L,
|
|
372
|
+
...W,
|
|
373
|
+
presets: Y
|
|
374
|
+
};
|
|
375
|
+
var I = Object.defineProperty, N = (e, r, t) => r in e ? I(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t, _ = (e, r, t) => N(e, typeof r != "symbol" ? r + "" : r, t);
|
|
376
|
+
const E = {
|
|
377
|
+
/**
|
|
378
|
+
* Check if a value is a reactive signal
|
|
379
|
+
*/
|
|
380
|
+
isReactive(e) {
|
|
381
|
+
return b(e);
|
|
382
|
+
},
|
|
383
|
+
/**
|
|
384
|
+
* Resolve a potentially reactive value
|
|
385
|
+
*/
|
|
386
|
+
resolveValue(e) {
|
|
387
|
+
return b(e) ? e() : e;
|
|
388
|
+
},
|
|
389
|
+
/**
|
|
390
|
+
* Create a reactive effect for a value
|
|
391
|
+
*/
|
|
392
|
+
createReactiveEffect(e, r) {
|
|
393
|
+
if (b(e)) {
|
|
394
|
+
const t = w(() => {
|
|
395
|
+
const i = e();
|
|
396
|
+
r(i);
|
|
397
|
+
});
|
|
398
|
+
return () => t.dispose();
|
|
399
|
+
}
|
|
400
|
+
return null;
|
|
401
|
+
},
|
|
402
|
+
/**
|
|
403
|
+
* Merge modifier properties
|
|
404
|
+
*/
|
|
405
|
+
mergeProperties(e, r) {
|
|
406
|
+
const t = { ...e };
|
|
407
|
+
for (const [i, s] of Object.entries(r))
|
|
408
|
+
s !== void 0 && (t[i] = s);
|
|
409
|
+
return t;
|
|
410
|
+
},
|
|
411
|
+
/**
|
|
412
|
+
* Convert a CSS property name to camelCase
|
|
413
|
+
*/
|
|
414
|
+
toCamelCase(e) {
|
|
415
|
+
return e.replace(
|
|
416
|
+
/-([a-z])/g,
|
|
417
|
+
(r, t) => t.toUpperCase()
|
|
418
|
+
);
|
|
419
|
+
},
|
|
420
|
+
/**
|
|
421
|
+
* Convert a camelCase property to CSS kebab-case
|
|
422
|
+
*/
|
|
423
|
+
toKebabCase(e) {
|
|
424
|
+
return e.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
425
|
+
},
|
|
426
|
+
/**
|
|
427
|
+
* Normalize a CSS value
|
|
428
|
+
*/
|
|
429
|
+
normalizeCSSValue(e) {
|
|
430
|
+
return typeof e == "number" ? `${e}px` : typeof e == "string" ? e : String(e);
|
|
431
|
+
}
|
|
432
|
+
};
|
|
433
|
+
function l(e, r, t) {
|
|
434
|
+
class i extends F {
|
|
435
|
+
constructor() {
|
|
436
|
+
super(...arguments), _(this, "type", e), _(this, "priority", r);
|
|
437
|
+
}
|
|
438
|
+
apply(o, n) {
|
|
439
|
+
return t(o, n, this.properties);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
return (s) => new i(s);
|
|
443
|
+
}
|
|
444
|
+
function x(e, r, t = 100) {
|
|
445
|
+
return l(e, t, (i, s, o) => {
|
|
446
|
+
if (s.element instanceof HTMLElement) {
|
|
447
|
+
const n = r(o);
|
|
448
|
+
Object.assign(s.element.style, n);
|
|
449
|
+
}
|
|
450
|
+
return i;
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
function G(e, r, t = 100) {
|
|
454
|
+
return () => l(e, t, (i, s) => (s.element instanceof HTMLElement && Object.assign(s.element.style, r), i))({});
|
|
455
|
+
}
|
|
456
|
+
function J(e, ...r) {
|
|
457
|
+
return console.warn("createComponentVariant is not yet implemented"), e;
|
|
458
|
+
}
|
|
459
|
+
function Q(e, r = "combined", t = 999) {
|
|
460
|
+
return l(r, t, (i, s, o) => {
|
|
461
|
+
let n = i;
|
|
462
|
+
for (const a of e) {
|
|
463
|
+
const f = a.apply(n, s);
|
|
464
|
+
f && typeof f == "object" && "type" in f && (n = f);
|
|
465
|
+
}
|
|
466
|
+
return n;
|
|
467
|
+
})({});
|
|
468
|
+
}
|
|
469
|
+
function ee(e, r) {
|
|
470
|
+
return l(
|
|
471
|
+
`conditional-${r.type}`,
|
|
472
|
+
r.priority,
|
|
473
|
+
(t, i, s) => {
|
|
474
|
+
if (E.resolveValue(e))
|
|
475
|
+
return r.apply(t, i);
|
|
476
|
+
if (b(e)) {
|
|
477
|
+
const n = w(() => {
|
|
478
|
+
const a = e();
|
|
479
|
+
i.element && a && r.apply(t, i);
|
|
480
|
+
});
|
|
481
|
+
if (!t.dispose)
|
|
482
|
+
t.dispose = () => n.dispose();
|
|
483
|
+
else {
|
|
484
|
+
const a = t.dispose;
|
|
485
|
+
t.dispose = () => {
|
|
486
|
+
n.dispose(), a();
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
return t;
|
|
491
|
+
}
|
|
492
|
+
)({});
|
|
493
|
+
}
|
|
494
|
+
function re(e, r) {
|
|
495
|
+
return l("state", 500, (t, i, s) => {
|
|
496
|
+
let o = t;
|
|
497
|
+
const n = (f) => {
|
|
498
|
+
const d = r[f] || [];
|
|
499
|
+
for (const M of d) {
|
|
500
|
+
const u = M.apply(o, i);
|
|
501
|
+
u && typeof u == "object" && "type" in u && (o = u);
|
|
502
|
+
}
|
|
503
|
+
};
|
|
504
|
+
n(e());
|
|
505
|
+
const a = w(() => {
|
|
506
|
+
const f = e();
|
|
507
|
+
n(f);
|
|
508
|
+
});
|
|
509
|
+
if (!t.dispose)
|
|
510
|
+
t.dispose = () => a.dispose();
|
|
511
|
+
else {
|
|
512
|
+
const f = t.dispose;
|
|
513
|
+
t.dispose = () => {
|
|
514
|
+
a.dispose(), f();
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
return o;
|
|
518
|
+
})({});
|
|
519
|
+
}
|
|
520
|
+
function te(e, r = []) {
|
|
521
|
+
return l("responsive", 100, (t, i, s) => {
|
|
522
|
+
let o = t;
|
|
523
|
+
const n = () => {
|
|
524
|
+
const d = window.innerWidth;
|
|
525
|
+
let M = r;
|
|
526
|
+
for (const [u, m] of Object.entries(e)) {
|
|
527
|
+
const R = parseInt(u);
|
|
528
|
+
d >= R && (M = m);
|
|
529
|
+
}
|
|
530
|
+
for (const u of M) {
|
|
531
|
+
const m = u.apply(o, i);
|
|
532
|
+
m && typeof m == "object" && "type" in m && (o = m);
|
|
533
|
+
}
|
|
534
|
+
};
|
|
535
|
+
n();
|
|
536
|
+
const a = () => n();
|
|
537
|
+
window.addEventListener("resize", a);
|
|
538
|
+
const f = () => window.removeEventListener("resize", a);
|
|
539
|
+
if (!t.dispose)
|
|
540
|
+
t.dispose = f;
|
|
541
|
+
else {
|
|
542
|
+
const d = t.dispose;
|
|
543
|
+
t.dispose = () => {
|
|
544
|
+
f(), d();
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
return o;
|
|
548
|
+
})({});
|
|
549
|
+
}
|
|
550
|
+
function ne(e) {
|
|
551
|
+
return l("class", 50, (r, t, i) => {
|
|
552
|
+
if (!t.element) return r;
|
|
553
|
+
const s = (o) => {
|
|
554
|
+
const n = Array.isArray(o) ? o : o.split(" ").filter(Boolean);
|
|
555
|
+
t.element instanceof HTMLElement && t.element.classList.add(...n);
|
|
556
|
+
};
|
|
557
|
+
if (b(e)) {
|
|
558
|
+
let o = [];
|
|
559
|
+
const n = w(() => {
|
|
560
|
+
const a = e(), f = Array.isArray(a) ? a : a.split(" ").filter(Boolean);
|
|
561
|
+
t.element instanceof HTMLElement && (t.element.classList.remove(...o), t.element.classList.add(...f), o = f);
|
|
562
|
+
});
|
|
563
|
+
if (!r.dispose)
|
|
564
|
+
r.dispose = () => n.dispose();
|
|
565
|
+
else {
|
|
566
|
+
const a = r.dispose;
|
|
567
|
+
r.dispose = () => {
|
|
568
|
+
n.dispose(), a();
|
|
569
|
+
};
|
|
570
|
+
}
|
|
571
|
+
} else
|
|
572
|
+
s(e);
|
|
573
|
+
return r;
|
|
574
|
+
})({});
|
|
575
|
+
}
|
|
576
|
+
function ie(e) {
|
|
577
|
+
return l("style", 200, (r, t, i) => {
|
|
578
|
+
if (!t.element) return r;
|
|
579
|
+
const s = (o) => {
|
|
580
|
+
if (t.element instanceof HTMLElement)
|
|
581
|
+
for (const [n, a] of Object.entries(o)) {
|
|
582
|
+
const f = E.toKebabCase(n), d = E.normalizeCSSValue(a);
|
|
583
|
+
t.element.style.setProperty(f, d);
|
|
584
|
+
}
|
|
585
|
+
};
|
|
586
|
+
if (b(e)) {
|
|
587
|
+
const o = w(() => {
|
|
588
|
+
const n = e();
|
|
589
|
+
s(n);
|
|
590
|
+
});
|
|
591
|
+
if (!r.dispose)
|
|
592
|
+
r.dispose = () => o.dispose();
|
|
593
|
+
else {
|
|
594
|
+
const n = r.dispose;
|
|
595
|
+
r.dispose = () => {
|
|
596
|
+
o.dispose(), n();
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
} else
|
|
600
|
+
s(e);
|
|
601
|
+
return r;
|
|
602
|
+
})({});
|
|
603
|
+
}
|
|
604
|
+
function oe(e) {
|
|
605
|
+
return l("event", 300, (r, t, i) => {
|
|
606
|
+
if (!t.element) return r;
|
|
607
|
+
const s = [];
|
|
608
|
+
for (const [n, a] of Object.entries(e))
|
|
609
|
+
t.element.addEventListener(n, a), s.push(() => {
|
|
610
|
+
t.element?.removeEventListener(n, a);
|
|
611
|
+
});
|
|
612
|
+
const o = () => s.forEach((n) => n());
|
|
613
|
+
if (!r.dispose)
|
|
614
|
+
r.dispose = o;
|
|
615
|
+
else {
|
|
616
|
+
const n = r.dispose;
|
|
617
|
+
r.dispose = () => {
|
|
618
|
+
o(), n();
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
return r;
|
|
622
|
+
})({});
|
|
623
|
+
}
|
|
624
|
+
export {
|
|
625
|
+
L as a,
|
|
626
|
+
p as b,
|
|
627
|
+
Z as c,
|
|
628
|
+
ne as d,
|
|
629
|
+
Q as e,
|
|
630
|
+
ee as f,
|
|
631
|
+
l as g,
|
|
632
|
+
x as h,
|
|
633
|
+
A as i,
|
|
634
|
+
oe as j,
|
|
635
|
+
ie as k,
|
|
636
|
+
v as l,
|
|
637
|
+
E as m,
|
|
638
|
+
W as n,
|
|
639
|
+
G as o,
|
|
640
|
+
Y as p,
|
|
641
|
+
J as q,
|
|
642
|
+
te as r,
|
|
643
|
+
re as s
|
|
644
|
+
};
|