@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.
Files changed (47) hide show
  1. package/dist/assets/ColorAsset.d.ts +1 -0
  2. package/dist/assets/ColorAsset.d.ts.map +1 -1
  3. package/dist/assets/FontAsset.d.ts +3 -0
  4. package/dist/assets/FontAsset.d.ts.map +1 -1
  5. package/dist/assets/ImageAsset.d.ts.map +1 -1
  6. package/dist/assets/index.d.ts +1 -0
  7. package/dist/assets/index.d.ts.map +1 -1
  8. package/dist/assets/index.js +196 -132
  9. package/dist/assets/ssr-context.d.ts +8 -0
  10. package/dist/assets/ssr-context.d.ts.map +1 -0
  11. package/dist/{binding-DCr-JHsC.js → binding-DNl4QUbT.js} +1 -1
  12. package/dist/common.js +388 -386
  13. package/dist/{component-BzvSm8rM.js → component-DR1wgdPH.js} +66 -69
  14. package/dist/{component-context-C7Y6Xu6h.js → component-context-BB80qzyZ.js} +66 -44
  15. package/dist/components/index.js +1 -1
  16. package/dist/{concatenated-component-CA54ng_j.js → concatenated-component-DisxEqg6.js} +123 -113
  17. package/dist/essential.js +390 -388
  18. package/dist/{factories-B05hE6kc.js → factories-Bz6LZlk6.js} +108 -99
  19. package/dist/{factory-B1YXfgU1.js → factory-C2LUc2BF.js} +2 -2
  20. package/dist/full.js +390 -388
  21. package/dist/{index-CmQmIgPK.js → index-B1zQAJuG.js} +91 -89
  22. package/dist/index.d.ts +1 -1
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +390 -388
  25. package/dist/minimal-prod.js +3 -3
  26. package/dist/minimal.js +5 -5
  27. package/dist/modifiers/base.d.ts +17 -0
  28. package/dist/modifiers/base.d.ts.map +1 -1
  29. package/dist/modifiers/base.js +169 -133
  30. package/dist/modifiers/builder.js +1 -1
  31. package/dist/modifiers/factories.d.ts.map +1 -1
  32. package/dist/modifiers/index.js +3 -3
  33. package/dist/modifiers/registry.js +1 -1
  34. package/dist/{observed-object-DCoyucmV.js → observed-object-gKl1Kk85.js} +1 -1
  35. package/dist/{optimization-D9t53vNJ.js → optimization-CnRxoggr.js} +1 -1
  36. package/dist/{proxy-B7ZIqGd0.js → proxy-B6FFddJq.js} +1 -1
  37. package/dist/runtime/component-context.d.ts +2 -0
  38. package/dist/runtime/component-context.d.ts.map +1 -1
  39. package/dist/runtime/component.d.ts.map +1 -1
  40. package/dist/runtime/dom-bridge.js +2 -2
  41. package/dist/runtime/index.js +4 -4
  42. package/dist/runtime/lazy-component.d.ts.map +1 -1
  43. package/dist/runtime/renderer.d.ts.map +1 -1
  44. package/dist/runtime/renderer.js +1 -1
  45. package/dist/state/index.js +5 -5
  46. package/dist/version.js +1 -1
  47. package/package.json +3 -3
@@ -1,42 +1,42 @@
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";
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
- 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 });
6
+ v.LAYOUT;
7
+ const O = (e) => new S({ alignment: e });
13
8
  function T(e) {
14
9
  return O(e);
15
10
  }
16
- h.APPEARANCE;
17
- const j = (e) => new S({ opacity: e });
18
- function D(e) {
19
- return j(e);
11
+ v.LAYOUT;
12
+ const D = (e) => new S({ layoutPriority: e });
13
+ function $(e) {
14
+ return D(e);
20
15
  }
21
- h.APPEARANCE;
22
- const $ = (e) => new S({ cornerRadius: e });
16
+ v.APPEARANCE;
17
+ const H = (e) => new F({ opacity: e });
23
18
  function V(e) {
24
- return $(e);
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 c(e, ...r) {
27
- const t = k.get(e);
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 v = {
34
+ const h = {
35
35
  /**
36
36
  * Set foreground (text) color
37
37
  */
38
38
  foregroundColor(e) {
39
- return c("foregroundColor", e);
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 P({ frame: i });
50
+ }), new S({ frame: i });
51
51
  },
52
52
  /**
53
53
  * Set padding on all sides
54
54
  */
55
55
  padding(e) {
56
- return c("padding", e);
56
+ return u("padding", e);
57
57
  },
58
58
  /**
59
59
  * Set margin on all sides
60
60
  */
61
61
  margin(e) {
62
- return c("margin", e);
62
+ return u("margin", e);
63
63
  },
64
64
  /**
65
65
  * Set content alignment
66
66
  */
67
67
  alignment(e) {
68
- return H(e);
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 T(e);
75
+ return $(e);
76
76
  }
77
77
  }, p = {
78
78
  /**
79
79
  * Set foreground (text) color
80
80
  */
81
81
  foregroundColor(e) {
82
- return c("foregroundColor", e);
82
+ return u("foregroundColor", e);
83
83
  },
84
84
  /**
85
85
  * Set background color
86
86
  */
87
87
  backgroundColor(e) {
88
- return c("backgroundColor", e);
88
+ return u("backgroundColor", e);
89
89
  },
90
90
  /**
91
91
  * Set background (supports gradients)
92
92
  */
93
93
  background(e) {
94
- return c("background", e);
94
+ return u("background", e);
95
95
  },
96
96
  /**
97
97
  * Set font properties
98
98
  */
99
99
  font(e) {
100
- return c("font", e);
100
+ return u("font", e);
101
101
  },
102
102
  /**
103
103
  * Set font size
104
104
  */
105
105
  fontSize(e) {
106
- return c("fontSize", e);
106
+ return u("fontSize", e);
107
107
  },
108
108
  /**
109
109
  * Set font weight
110
110
  */
111
111
  fontWeight(e) {
112
- return c("fontWeight", e);
112
+ return u("fontWeight", e);
113
113
  },
114
114
  /**
115
115
  * Set font family
116
116
  */
117
117
  fontFamily(e) {
118
- return c("fontFamily", e);
118
+ return u("fontFamily", e);
119
119
  },
120
120
  /**
121
121
  * Set opacity
122
122
  */
123
123
  opacity(e) {
124
- return D(e);
124
+ return V(e);
125
125
  },
126
126
  /**
127
127
  * Set corner radius (enhanced)
128
128
  */
129
129
  cornerRadius(e) {
130
- return V(e);
130
+ return Y(e);
131
131
  },
132
132
  /**
133
133
  * Set border
134
134
  */
135
135
  border(e, r = "#000000", t = "solid") {
136
- return c("border", e, r, t);
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 c("border", e);
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
- }, W = {
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
- }, Y = {
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
- v.padding(e)
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
- v.padding(12),
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
- v.padding(8),
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
- }, Z = {
368
- ...v,
367
+ }, J = {
368
+ ...h,
369
369
  ...p,
370
370
  ...A,
371
371
  ...L,
372
- ...W,
373
- presets: Y
372
+ ...I,
373
+ presets: B
374
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 = {
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 l(e, r, t) {
434
- class i extends F {
442
+ function c(e, r, t) {
443
+ class i extends z {
435
444
  constructor() {
436
- super(...arguments), _(this, "type", e), _(this, "priority", r);
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 x(e, r, t = 100) {
445
- return l(e, t, (i, s, o) => {
446
- if (s.element instanceof HTMLElement) {
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 G(e, r, t = 100) {
454
- return () => l(e, t, (i, s) => (s.element instanceof HTMLElement && Object.assign(s.element.style, r), i))({});
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 J(e, ...r) {
465
+ function re(e, ...r) {
457
466
  return console.warn("createComponentVariant is not yet implemented"), e;
458
467
  }
459
- function Q(e, r = "combined", t = 999) {
460
- return l(r, t, (i, s, o) => {
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 ee(e, r) {
470
- return l(
478
+ function ne(e, r) {
479
+ return c(
471
480
  `conditional-${r.type}`,
472
481
  r.priority,
473
482
  (t, i, s) => {
474
- if (E.resolveValue(e))
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 re(e, r) {
495
- return l("state", 500, (t, i, s) => {
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 u = M.apply(o, i);
501
- u && typeof u == "object" && "type" in u && (o = u);
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 te(e, r = []) {
521
- return l("responsive", 100, (t, i, s) => {
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 [u, m] of Object.entries(e)) {
527
- const R = parseInt(u);
528
- d >= R && (M = m);
535
+ for (const [l, m] of Object.entries(e)) {
536
+ const k = parseInt(l);
537
+ d >= k && (M = m);
529
538
  }
530
- for (const u of M) {
531
- const m = u.apply(o, i);
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 ne(e) {
551
- return l("class", 50, (r, t, i) => {
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 instanceof HTMLElement && t.element.classList.add(...n);
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 instanceof HTMLElement && (t.element.classList.remove(...o), t.element.classList.add(...f), o = f);
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 ie(e) {
577
- return l("style", 200, (r, t, i) => {
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 instanceof HTMLElement)
589
+ if (U(t.element))
581
590
  for (const [n, a] of Object.entries(o)) {
582
- const f = E.toKebabCase(n), d = E.normalizeCSSValue(a);
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 oe(e) {
605
- return l("event", 300, (r, t, i) => {
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
- Z as c,
628
- ne as d,
629
- Q as e,
630
- ee as f,
631
- l as g,
632
- x as h,
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
- 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
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-CA54ng_j.js";
3
- import { i as T, a as x } from "./proxy-B7ZIqGd0.js";
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";