@tachui/core 0.8.24 → 0.8.26
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/ColorAsset.d.ts +1 -0
- package/dist/assets/ColorAsset.d.ts.map +1 -1
- package/dist/assets/FontAsset.d.ts +3 -0
- package/dist/assets/FontAsset.d.ts.map +1 -1
- package/dist/assets/ImageAsset.d.ts.map +1 -1
- package/dist/assets/index.d.ts +1 -0
- package/dist/assets/index.d.ts.map +1 -1
- package/dist/assets/index.js +196 -132
- package/dist/assets/ssr-context.d.ts +8 -0
- package/dist/assets/ssr-context.d.ts.map +1 -0
- package/dist/{binding-DCr-JHsC.js → binding-DNl4QUbT.js} +1 -1
- package/dist/common.js +388 -386
- package/dist/{component-BzvSm8rM.js → component-DR1wgdPH.js} +66 -69
- package/dist/{component-context-C7Y6Xu6h.js → component-context-BB80qzyZ.js} +66 -44
- package/dist/components/index.js +1 -1
- package/dist/{concatenated-component-CA54ng_j.js → concatenated-component-DisxEqg6.js} +123 -113
- package/dist/essential.js +390 -388
- package/dist/{factories-B05hE6kc.js → factories-Bz6LZlk6.js} +108 -99
- package/dist/{factory-B1YXfgU1.js → factory-C2LUc2BF.js} +2 -2
- package/dist/full.js +390 -388
- package/dist/{index-CmQmIgPK.js → index-B1zQAJuG.js} +91 -89
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +390 -388
- package/dist/minimal-prod.js +3 -3
- package/dist/minimal.js +5 -5
- package/dist/modifiers/base.d.ts +17 -0
- package/dist/modifiers/base.d.ts.map +1 -1
- package/dist/modifiers/base.js +169 -133
- package/dist/modifiers/builder.js +1 -1
- package/dist/modifiers/factories.d.ts.map +1 -1
- package/dist/modifiers/index.js +3 -3
- package/dist/modifiers/registry.js +1 -1
- package/dist/{observed-object-DCoyucmV.js → observed-object-gKl1Kk85.js} +1 -1
- package/dist/{optimization-D9t53vNJ.js → optimization-CnRxoggr.js} +1 -1
- package/dist/{proxy-B7ZIqGd0.js → proxy-B6FFddJq.js} +1 -1
- package/dist/runtime/component-context.d.ts +2 -0
- package/dist/runtime/component-context.d.ts.map +1 -1
- package/dist/runtime/component.d.ts.map +1 -1
- package/dist/runtime/dom-bridge.js +2 -2
- package/dist/runtime/index.js +4 -4
- package/dist/runtime/lazy-component.d.ts.map +1 -1
- package/dist/runtime/renderer.d.ts.map +1 -1
- package/dist/runtime/renderer.js +1 -1
- package/dist/state/index.js +5 -5
- package/dist/version.js +1 -1
- package/package.json +3 -3
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import { LayoutModifier as
|
|
2
|
-
import { ModifierPriority as
|
|
3
|
-
import { globalModifierRegistry as
|
|
1
|
+
import { LayoutModifier as S, AppearanceModifier as F, AnimationModifier as y, LifecycleModifier as C, InteractionModifier as g, BaseModifier as z } from "./modifiers/base.js";
|
|
2
|
+
import { ModifierPriority as v } from "@tachui/types/modifiers";
|
|
3
|
+
import { globalModifierRegistry as j } from "@tachui/registry";
|
|
4
4
|
import { c as w } from "./effect-DgNm6jk9.js";
|
|
5
5
|
import { i as b } from "./signal-BRoiFOO7.js";
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
function H(e) {
|
|
9
|
-
return z(e);
|
|
10
|
-
}
|
|
11
|
-
h.LAYOUT;
|
|
12
|
-
const O = (e) => new P({ layoutPriority: e });
|
|
6
|
+
v.LAYOUT;
|
|
7
|
+
const O = (e) => new S({ alignment: e });
|
|
13
8
|
function T(e) {
|
|
14
9
|
return O(e);
|
|
15
10
|
}
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
function
|
|
19
|
-
return
|
|
11
|
+
v.LAYOUT;
|
|
12
|
+
const D = (e) => new S({ layoutPriority: e });
|
|
13
|
+
function $(e) {
|
|
14
|
+
return D(e);
|
|
20
15
|
}
|
|
21
|
-
|
|
22
|
-
const
|
|
16
|
+
v.APPEARANCE;
|
|
17
|
+
const H = (e) => new F({ opacity: e });
|
|
23
18
|
function V(e) {
|
|
24
|
-
return
|
|
19
|
+
return H(e);
|
|
20
|
+
}
|
|
21
|
+
v.APPEARANCE;
|
|
22
|
+
const W = (e) => new F({ cornerRadius: e });
|
|
23
|
+
function Y(e) {
|
|
24
|
+
return W(e);
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
const t =
|
|
26
|
+
function u(e, ...r) {
|
|
27
|
+
const t = j.get(e);
|
|
28
28
|
if (!t)
|
|
29
29
|
throw new Error(
|
|
30
30
|
`Modifier '${e}' not found in registry. Import '@tachui/modifiers' or the relevant segmented bundle before using preset helpers.`
|
|
31
31
|
);
|
|
32
32
|
return t(...r);
|
|
33
33
|
}
|
|
34
|
-
const
|
|
34
|
+
const h = {
|
|
35
35
|
/**
|
|
36
36
|
* Set foreground (text) color
|
|
37
37
|
*/
|
|
38
38
|
foregroundColor(e) {
|
|
39
|
-
return
|
|
39
|
+
return u("foregroundColor", e);
|
|
40
40
|
},
|
|
41
41
|
/**
|
|
42
42
|
* Set frame dimensions with support for infinity
|
|
@@ -47,99 +47,99 @@ const v = {
|
|
|
47
47
|
...i,
|
|
48
48
|
...e !== void 0 ? { width: e } : {},
|
|
49
49
|
...r !== void 0 ? { height: r } : {}
|
|
50
|
-
}), new
|
|
50
|
+
}), new S({ frame: i });
|
|
51
51
|
},
|
|
52
52
|
/**
|
|
53
53
|
* Set padding on all sides
|
|
54
54
|
*/
|
|
55
55
|
padding(e) {
|
|
56
|
-
return
|
|
56
|
+
return u("padding", e);
|
|
57
57
|
},
|
|
58
58
|
/**
|
|
59
59
|
* Set margin on all sides
|
|
60
60
|
*/
|
|
61
61
|
margin(e) {
|
|
62
|
-
return
|
|
62
|
+
return u("margin", e);
|
|
63
63
|
},
|
|
64
64
|
/**
|
|
65
65
|
* Set content alignment
|
|
66
66
|
*/
|
|
67
67
|
alignment(e) {
|
|
68
|
-
return
|
|
68
|
+
return T(e);
|
|
69
69
|
},
|
|
70
70
|
/**
|
|
71
71
|
* Set layout priority for ZStack container sizing and flexible layout
|
|
72
72
|
* Higher priority views determine container size in ZStack
|
|
73
73
|
*/
|
|
74
74
|
layoutPriority(e) {
|
|
75
|
-
return
|
|
75
|
+
return $(e);
|
|
76
76
|
}
|
|
77
77
|
}, p = {
|
|
78
78
|
/**
|
|
79
79
|
* Set foreground (text) color
|
|
80
80
|
*/
|
|
81
81
|
foregroundColor(e) {
|
|
82
|
-
return
|
|
82
|
+
return u("foregroundColor", e);
|
|
83
83
|
},
|
|
84
84
|
/**
|
|
85
85
|
* Set background color
|
|
86
86
|
*/
|
|
87
87
|
backgroundColor(e) {
|
|
88
|
-
return
|
|
88
|
+
return u("backgroundColor", e);
|
|
89
89
|
},
|
|
90
90
|
/**
|
|
91
91
|
* Set background (supports gradients)
|
|
92
92
|
*/
|
|
93
93
|
background(e) {
|
|
94
|
-
return
|
|
94
|
+
return u("background", e);
|
|
95
95
|
},
|
|
96
96
|
/**
|
|
97
97
|
* Set font properties
|
|
98
98
|
*/
|
|
99
99
|
font(e) {
|
|
100
|
-
return
|
|
100
|
+
return u("font", e);
|
|
101
101
|
},
|
|
102
102
|
/**
|
|
103
103
|
* Set font size
|
|
104
104
|
*/
|
|
105
105
|
fontSize(e) {
|
|
106
|
-
return
|
|
106
|
+
return u("fontSize", e);
|
|
107
107
|
},
|
|
108
108
|
/**
|
|
109
109
|
* Set font weight
|
|
110
110
|
*/
|
|
111
111
|
fontWeight(e) {
|
|
112
|
-
return
|
|
112
|
+
return u("fontWeight", e);
|
|
113
113
|
},
|
|
114
114
|
/**
|
|
115
115
|
* Set font family
|
|
116
116
|
*/
|
|
117
117
|
fontFamily(e) {
|
|
118
|
-
return
|
|
118
|
+
return u("fontFamily", e);
|
|
119
119
|
},
|
|
120
120
|
/**
|
|
121
121
|
* Set opacity
|
|
122
122
|
*/
|
|
123
123
|
opacity(e) {
|
|
124
|
-
return
|
|
124
|
+
return V(e);
|
|
125
125
|
},
|
|
126
126
|
/**
|
|
127
127
|
* Set corner radius (enhanced)
|
|
128
128
|
*/
|
|
129
129
|
cornerRadius(e) {
|
|
130
|
-
return
|
|
130
|
+
return Y(e);
|
|
131
131
|
},
|
|
132
132
|
/**
|
|
133
133
|
* Set border
|
|
134
134
|
*/
|
|
135
135
|
border(e, r = "#000000", t = "solid") {
|
|
136
|
-
return
|
|
136
|
+
return u("border", e, r, t);
|
|
137
137
|
},
|
|
138
138
|
/**
|
|
139
139
|
* Set detailed border properties
|
|
140
140
|
*/
|
|
141
141
|
borderDetailed(e) {
|
|
142
|
-
return
|
|
142
|
+
return u("border", e);
|
|
143
143
|
}
|
|
144
144
|
// Shadow functionality moved to @tachui/modifiers/effects entry point
|
|
145
145
|
}, A = {
|
|
@@ -266,7 +266,7 @@ const v = {
|
|
|
266
266
|
}
|
|
267
267
|
});
|
|
268
268
|
}
|
|
269
|
-
},
|
|
269
|
+
}, I = {
|
|
270
270
|
/**
|
|
271
271
|
* Execute handler when component appears in viewport
|
|
272
272
|
*/
|
|
@@ -302,7 +302,7 @@ const v = {
|
|
|
302
302
|
}
|
|
303
303
|
});
|
|
304
304
|
}
|
|
305
|
-
},
|
|
305
|
+
}, B = {
|
|
306
306
|
/**
|
|
307
307
|
* Card-like appearance
|
|
308
308
|
*/
|
|
@@ -311,7 +311,7 @@ const v = {
|
|
|
311
311
|
p.backgroundColor("#ffffff"),
|
|
312
312
|
p.cornerRadius(8),
|
|
313
313
|
// shadow moved to @tachui/modifiers/effects entry point
|
|
314
|
-
|
|
314
|
+
h.padding(e)
|
|
315
315
|
];
|
|
316
316
|
},
|
|
317
317
|
/**
|
|
@@ -322,7 +322,7 @@ const v = {
|
|
|
322
322
|
p.backgroundColor(e),
|
|
323
323
|
p.foregroundColor(r),
|
|
324
324
|
p.cornerRadius(6),
|
|
325
|
-
|
|
325
|
+
h.padding(12),
|
|
326
326
|
// Simplified to single value for now
|
|
327
327
|
A.onHover((t) => {
|
|
328
328
|
}),
|
|
@@ -336,7 +336,7 @@ const v = {
|
|
|
336
336
|
return [
|
|
337
337
|
p.border(1, "#d1d5db"),
|
|
338
338
|
p.cornerRadius(4),
|
|
339
|
-
|
|
339
|
+
h.padding(8),
|
|
340
340
|
L.transition("border-color", 150),
|
|
341
341
|
A.onFocus((e) => {
|
|
342
342
|
})
|
|
@@ -364,16 +364,25 @@ const v = {
|
|
|
364
364
|
p.opacity(0.7)
|
|
365
365
|
]
|
|
366
366
|
}
|
|
367
|
-
},
|
|
368
|
-
...
|
|
367
|
+
}, J = {
|
|
368
|
+
...h,
|
|
369
369
|
...p,
|
|
370
370
|
...A,
|
|
371
371
|
...L,
|
|
372
|
-
...
|
|
373
|
-
presets:
|
|
372
|
+
...I,
|
|
373
|
+
presets: B
|
|
374
374
|
};
|
|
375
|
-
var
|
|
376
|
-
|
|
375
|
+
var N = Object.defineProperty, X = (e, r, t) => r in e ? N(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t, E = (e, r, t) => X(e, typeof r != "symbol" ? r + "" : r, t);
|
|
376
|
+
function R(e) {
|
|
377
|
+
return typeof HTMLElement < "u" && e instanceof HTMLElement;
|
|
378
|
+
}
|
|
379
|
+
function _(e) {
|
|
380
|
+
return typeof e == "object" && e !== null && "style" in e && !!e.style;
|
|
381
|
+
}
|
|
382
|
+
function U(e) {
|
|
383
|
+
return _(e) && typeof e.style.setProperty == "function";
|
|
384
|
+
}
|
|
385
|
+
const P = {
|
|
377
386
|
/**
|
|
378
387
|
* Check if a value is a reactive signal
|
|
379
388
|
*/
|
|
@@ -430,10 +439,10 @@ const E = {
|
|
|
430
439
|
return typeof e == "number" ? `${e}px` : typeof e == "string" ? e : String(e);
|
|
431
440
|
}
|
|
432
441
|
};
|
|
433
|
-
function
|
|
434
|
-
class i extends
|
|
442
|
+
function c(e, r, t) {
|
|
443
|
+
class i extends z {
|
|
435
444
|
constructor() {
|
|
436
|
-
super(...arguments),
|
|
445
|
+
super(...arguments), E(this, "type", e), E(this, "priority", r);
|
|
437
446
|
}
|
|
438
447
|
apply(o, n) {
|
|
439
448
|
return t(o, n, this.properties);
|
|
@@ -441,23 +450,23 @@ function l(e, r, t) {
|
|
|
441
450
|
}
|
|
442
451
|
return (s) => new i(s);
|
|
443
452
|
}
|
|
444
|
-
function
|
|
445
|
-
return
|
|
446
|
-
if (s.element
|
|
453
|
+
function Q(e, r, t = 100) {
|
|
454
|
+
return c(e, t, (i, s, o) => {
|
|
455
|
+
if (_(s.element)) {
|
|
447
456
|
const n = r(o);
|
|
448
457
|
Object.assign(s.element.style, n);
|
|
449
458
|
}
|
|
450
459
|
return i;
|
|
451
460
|
});
|
|
452
461
|
}
|
|
453
|
-
function
|
|
454
|
-
return () =>
|
|
462
|
+
function ee(e, r, t = 100) {
|
|
463
|
+
return () => c(e, t, (i, s) => (_(s.element) && Object.assign(s.element.style, r), i))({});
|
|
455
464
|
}
|
|
456
|
-
function
|
|
465
|
+
function re(e, ...r) {
|
|
457
466
|
return console.warn("createComponentVariant is not yet implemented"), e;
|
|
458
467
|
}
|
|
459
|
-
function
|
|
460
|
-
return
|
|
468
|
+
function te(e, r = "combined", t = 999) {
|
|
469
|
+
return c(r, t, (i, s, o) => {
|
|
461
470
|
let n = i;
|
|
462
471
|
for (const a of e) {
|
|
463
472
|
const f = a.apply(n, s);
|
|
@@ -466,12 +475,12 @@ function Q(e, r = "combined", t = 999) {
|
|
|
466
475
|
return n;
|
|
467
476
|
})({});
|
|
468
477
|
}
|
|
469
|
-
function
|
|
470
|
-
return
|
|
478
|
+
function ne(e, r) {
|
|
479
|
+
return c(
|
|
471
480
|
`conditional-${r.type}`,
|
|
472
481
|
r.priority,
|
|
473
482
|
(t, i, s) => {
|
|
474
|
-
if (
|
|
483
|
+
if (P.resolveValue(e))
|
|
475
484
|
return r.apply(t, i);
|
|
476
485
|
if (b(e)) {
|
|
477
486
|
const n = w(() => {
|
|
@@ -491,14 +500,14 @@ function ee(e, r) {
|
|
|
491
500
|
}
|
|
492
501
|
)({});
|
|
493
502
|
}
|
|
494
|
-
function
|
|
495
|
-
return
|
|
503
|
+
function ie(e, r) {
|
|
504
|
+
return c("state", 500, (t, i, s) => {
|
|
496
505
|
let o = t;
|
|
497
506
|
const n = (f) => {
|
|
498
507
|
const d = r[f] || [];
|
|
499
508
|
for (const M of d) {
|
|
500
|
-
const
|
|
501
|
-
|
|
509
|
+
const l = M.apply(o, i);
|
|
510
|
+
l && typeof l == "object" && "type" in l && (o = l);
|
|
502
511
|
}
|
|
503
512
|
};
|
|
504
513
|
n(e());
|
|
@@ -517,18 +526,18 @@ function re(e, r) {
|
|
|
517
526
|
return o;
|
|
518
527
|
})({});
|
|
519
528
|
}
|
|
520
|
-
function
|
|
521
|
-
return
|
|
529
|
+
function oe(e, r = []) {
|
|
530
|
+
return c("responsive", 100, (t, i, s) => {
|
|
522
531
|
let o = t;
|
|
523
532
|
const n = () => {
|
|
524
533
|
const d = window.innerWidth;
|
|
525
534
|
let M = r;
|
|
526
|
-
for (const [
|
|
527
|
-
const
|
|
528
|
-
d >=
|
|
535
|
+
for (const [l, m] of Object.entries(e)) {
|
|
536
|
+
const k = parseInt(l);
|
|
537
|
+
d >= k && (M = m);
|
|
529
538
|
}
|
|
530
|
-
for (const
|
|
531
|
-
const m =
|
|
539
|
+
for (const l of M) {
|
|
540
|
+
const m = l.apply(o, i);
|
|
532
541
|
m && typeof m == "object" && "type" in m && (o = m);
|
|
533
542
|
}
|
|
534
543
|
};
|
|
@@ -547,18 +556,18 @@ function te(e, r = []) {
|
|
|
547
556
|
return o;
|
|
548
557
|
})({});
|
|
549
558
|
}
|
|
550
|
-
function
|
|
551
|
-
return
|
|
559
|
+
function se(e) {
|
|
560
|
+
return c("class", 50, (r, t, i) => {
|
|
552
561
|
if (!t.element) return r;
|
|
553
562
|
const s = (o) => {
|
|
554
563
|
const n = Array.isArray(o) ? o : o.split(" ").filter(Boolean);
|
|
555
|
-
t.element
|
|
564
|
+
R(t.element) && t.element.classList.add(...n);
|
|
556
565
|
};
|
|
557
566
|
if (b(e)) {
|
|
558
567
|
let o = [];
|
|
559
568
|
const n = w(() => {
|
|
560
569
|
const a = e(), f = Array.isArray(a) ? a : a.split(" ").filter(Boolean);
|
|
561
|
-
t.element
|
|
570
|
+
R(t.element) && (t.element.classList.remove(...o), t.element.classList.add(...f), o = f);
|
|
562
571
|
});
|
|
563
572
|
if (!r.dispose)
|
|
564
573
|
r.dispose = () => n.dispose();
|
|
@@ -573,13 +582,13 @@ function ne(e) {
|
|
|
573
582
|
return r;
|
|
574
583
|
})({});
|
|
575
584
|
}
|
|
576
|
-
function
|
|
577
|
-
return
|
|
585
|
+
function ae(e) {
|
|
586
|
+
return c("style", 200, (r, t, i) => {
|
|
578
587
|
if (!t.element) return r;
|
|
579
588
|
const s = (o) => {
|
|
580
|
-
if (t.element
|
|
589
|
+
if (U(t.element))
|
|
581
590
|
for (const [n, a] of Object.entries(o)) {
|
|
582
|
-
const f =
|
|
591
|
+
const f = P.toKebabCase(n), d = P.normalizeCSSValue(a);
|
|
583
592
|
t.element.style.setProperty(f, d);
|
|
584
593
|
}
|
|
585
594
|
};
|
|
@@ -601,8 +610,8 @@ function ie(e) {
|
|
|
601
610
|
return r;
|
|
602
611
|
})({});
|
|
603
612
|
}
|
|
604
|
-
function
|
|
605
|
-
return
|
|
613
|
+
function fe(e) {
|
|
614
|
+
return c("event", 300, (r, t, i) => {
|
|
606
615
|
if (!t.element) return r;
|
|
607
616
|
const s = [];
|
|
608
617
|
for (const [n, a] of Object.entries(e))
|
|
@@ -624,21 +633,21 @@ function oe(e) {
|
|
|
624
633
|
export {
|
|
625
634
|
L as a,
|
|
626
635
|
p as b,
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
636
|
+
J as c,
|
|
637
|
+
se as d,
|
|
638
|
+
te as e,
|
|
639
|
+
ne as f,
|
|
640
|
+
c as g,
|
|
641
|
+
Q as h,
|
|
633
642
|
A as i,
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
643
|
+
fe as j,
|
|
644
|
+
ae as k,
|
|
645
|
+
h as l,
|
|
646
|
+
P as m,
|
|
647
|
+
I as n,
|
|
648
|
+
ee as o,
|
|
649
|
+
B as p,
|
|
650
|
+
re as q,
|
|
651
|
+
oe as r,
|
|
652
|
+
ie as s
|
|
644
653
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "@tachui/types/modifiers";
|
|
2
|
-
import { p as z, h as _, d as M, c as L } from "./concatenated-component-
|
|
3
|
-
import { i as T, a as x } from "./proxy-
|
|
2
|
+
import { p as z, h as _, d as M, c as L } from "./concatenated-component-DisxEqg6.js";
|
|
3
|
+
import { i as T, a as x } from "./proxy-B6FFddJq.js";
|
|
4
4
|
import { registerComponentWithLifecycleHooks as O } from "./runtime/dom-bridge.js";
|
|
5
5
|
import { u as D } from "./hooks-w_FYPLjI.js";
|
|
6
6
|
import { b as $ } from "./component-base-Do2EdQkr.js";
|