@tachui/core 0.8.23 → 0.8.25

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 (56) hide show
  1. package/dist/assets/index.js +41 -40
  2. package/dist/{binding-DCV5PKkK.js → binding-DCr-JHsC.js} +9 -9
  3. package/dist/build-tools/typegen-runner.d.ts +4 -0
  4. package/dist/build-tools/typegen-runner.d.ts.map +1 -1
  5. package/dist/cleanup-BR8UpYPX.js +61 -0
  6. package/dist/common.js +272 -277
  7. package/dist/{component-D-O9yq0P.js → component-BzvSm8rM.js} +19 -19
  8. package/dist/{component-base-C41K3NTe.js → component-base-Do2EdQkr.js} +32 -33
  9. package/dist/{component-context-B9HI2nZH.js → component-context-C7Y6Xu6h.js} +1 -1
  10. package/dist/components/index.js +1 -1
  11. package/dist/computed-CA4Cgtoe.js +407 -0
  12. package/dist/{concatenated-component-2Gzy5e2c.js → concatenated-component-CA54ng_j.js} +43 -44
  13. package/dist/css-classes/index.js +2 -2
  14. package/dist/{effect-BsW3fy1q.js → effect-DgNm6jk9.js} +3 -3
  15. package/dist/{enhanced-renderer-t9Ni2EEG.js → enhanced-renderer-D05CCloF.js} +26 -28
  16. package/dist/essential.js +276 -281
  17. package/dist/factories-Bz6LZlk6.js +653 -0
  18. package/dist/{factory-gqfMcmOy.js → factory-B1YXfgU1.js} +23 -29
  19. package/dist/full.d.ts +12 -0
  20. package/dist/full.d.ts.map +1 -0
  21. package/dist/full.js +436 -0
  22. package/dist/gradients/index.js +53 -53
  23. package/dist/hooks-w_FYPLjI.js +158 -0
  24. package/dist/{index-DL9Cys3t.js → index-CmQmIgPK.js} +220 -233
  25. package/dist/index.d.ts +0 -1
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +295 -300
  28. package/dist/minimal-prod.js +106 -108
  29. package/dist/minimal.js +97 -98
  30. package/dist/modifiers/base.d.ts.map +1 -1
  31. package/dist/modifiers/base.js +188 -181
  32. package/dist/modifiers/builder.js +1 -1
  33. package/dist/modifiers/factories.d.ts.map +1 -1
  34. package/dist/modifiers/index.js +22 -23
  35. package/dist/modifiers/registry.js +1 -1
  36. package/dist/{observed-object-p1CLdrFm.js → observed-object-DCoyucmV.js} +3 -3
  37. package/dist/optimization-D9t53vNJ.js +308 -0
  38. package/dist/{proxy-Cp0QUXME.js → proxy-B7ZIqGd0.js} +3 -3
  39. package/dist/reactive/index.js +87 -85
  40. package/dist/runtime/dom-bridge.js +15 -17
  41. package/dist/runtime/index.js +71 -71
  42. package/dist/runtime/renderer.js +10 -11
  43. package/dist/signal-BRoiFOO7.js +262 -0
  44. package/dist/{signal-list-07gNXGiW.js → signal-list-_Eid-N7_.js} +285 -176
  45. package/dist/state/index.js +43 -44
  46. package/dist/theme-D5-09a8N.js +26 -0
  47. package/dist/validation/index.js +24 -26
  48. package/dist/version.js +1 -1
  49. package/package.json +16 -3
  50. package/dist/factories-B3-rmvkB.js +0 -268
  51. package/dist/hooks-WGmpzYgD.js +0 -446
  52. package/dist/optimization-CbKNA9w4.js +0 -21
  53. package/dist/presets-B9x94uRn.js +0 -381
  54. package/dist/scheduler-DppMK9mR.js +0 -169
  55. package/dist/theme-CRLPHryV.js +0 -687
  56. package/dist/{index-JQ1sW1SK.js → index-7vhCZc7g.js} +1 -1
@@ -1,131 +1,138 @@
1
- import { o as R } from "../scheduler-DppMK9mR.js";
2
- import { p as O, d as m, r as D, i as v, K as B } from "../theme-CRLPHryV.js";
3
- import { c as b } from "../effect-BsW3fy1q.js";
4
- import "@tachui/types/reactive";
5
- import { ModifierPriority as S } from "@tachui/types/modifiers";
6
- import { shouldExpandForInfinity as _, dimensionToCSS as h, isInfinity as g } from "../constants/layout.js";
7
- const w = /* @__PURE__ */ new WeakMap();
8
- let p = null;
9
- function ee(s) {
10
- if (s === null)
11
- return p = null, () => {
1
+ import { i as m, r as D } from "../computed-CA4Cgtoe.js";
2
+ import { c as b } from "../effect-DgNm6jk9.js";
3
+ import { g as B, i as S } from "../signal-BRoiFOO7.js";
4
+ import { a as _ } from "../theme-D5-09a8N.js";
5
+ import { ModifierPriority as C } from "@tachui/types/modifiers";
6
+ import { shouldExpandForInfinity as z, dimensionToCSS as g, isInfinity as p } from "../constants/layout.js";
7
+ import { o as F } from "../cleanup-BR8UpYPX.js";
8
+ const L = /* @__PURE__ */ new WeakMap();
9
+ let y = null;
10
+ function ne(o) {
11
+ if (o === null)
12
+ return y = null, () => {
12
13
  };
13
- const i = p;
14
- return p = (t, e) => {
15
- i?.(t, e), s(t, e);
14
+ const i = y;
15
+ return y = (t, e) => {
16
+ i?.(t, e), o(t, e);
16
17
  }, () => {
17
- p = i;
18
+ y = i;
18
19
  };
19
20
  }
20
- function k(s, i, t) {
21
+ function I(o, i, t) {
21
22
  try {
22
- s(i);
23
+ o(i);
23
24
  } catch (e) {
24
- if (p) {
25
- p(e, { updaterId: t, value: i });
25
+ if (y) {
26
+ y(e, { updaterId: t, value: i });
26
27
  return;
27
28
  }
28
29
  console.error(`Reactive style updater failed (${t}):`, e);
29
30
  }
30
31
  }
31
- const M = 200, u = /* @__PURE__ */ new WeakMap(), A = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new Set();
32
- let P = !1, T = !1;
33
- function z(s) {
34
- u.get(s)?.forEach((t) => t()), u.delete(s), A.delete(s);
32
+ const P = 200, c = /* @__PURE__ */ new WeakMap(), M = /* @__PURE__ */ new WeakMap(), v = /* @__PURE__ */ new Set();
33
+ let $ = !1, k = !1;
34
+ function W(o) {
35
+ c.get(o)?.forEach((t) => t()), c.delete(o), M.delete(o);
35
36
  }
36
- function H() {
37
- const s = Date.now();
38
- for (const i of Array.from(y)) {
37
+ function R() {
38
+ const o = Date.now();
39
+ for (const i of Array.from(v)) {
39
40
  const t = i.deref();
40
41
  if (!t) {
41
- y.delete(i);
42
+ v.delete(i);
42
43
  continue;
43
44
  }
44
- const e = A.get(t), n = u.get(t);
45
+ const e = M.get(t), n = c.get(t);
45
46
  if (!e || !n || n.size === 0) {
46
- y.delete(i);
47
+ v.delete(i);
47
48
  continue;
48
49
  }
49
50
  if (t.isConnected) {
50
51
  e.wasConnected = !0;
51
52
  continue;
52
53
  }
53
- (e.wasConnected || s - e.trackedAt >= M) && (z(t), y.delete(i));
54
+ (e.wasConnected || o - e.trackedAt >= P) && (W(t), v.delete(i));
54
55
  }
55
56
  }
56
- function F() {
57
- if (T || typeof setTimeout != "function") return;
58
- T = !0;
59
- const s = () => {
60
- if (H(), y.size === 0) {
61
- T = !1;
57
+ function U() {
58
+ if (k || typeof setTimeout != "function") return;
59
+ k = !0;
60
+ const o = () => {
61
+ if (R(), v.size === 0) {
62
+ k = !1;
62
63
  return;
63
64
  }
64
- setTimeout(s, M);
65
+ setTimeout(o, P);
65
66
  };
66
- setTimeout(s, M);
67
+ setTimeout(o, P);
67
68
  }
68
- function W() {
69
- if (P || typeof document > "u" || !document.documentElement || typeof MutationObserver > "u")
69
+ function j() {
70
+ if ($ || typeof document > "u" || !document.documentElement || typeof MutationObserver > "u")
70
71
  return;
71
72
  new MutationObserver(() => {
72
- H();
73
- }).observe(document.documentElement, { childList: !0, subtree: !0 }), P = !0;
73
+ R();
74
+ }).observe(document.documentElement, { childList: !0, subtree: !0 }), $ = !0;
74
75
  }
75
- function U(s, i) {
76
- W(), F();
77
- const t = u.get(s) ?? /* @__PURE__ */ new Set(), e = t.size > 0;
78
- return t.add(i), u.set(s, t), e || (A.set(s, {
76
+ function N(o, i) {
77
+ j(), U();
78
+ const t = c.get(o) ?? /* @__PURE__ */ new Set(), e = t.size > 0;
79
+ return t.add(i), c.set(o, t), e || (M.set(o, {
79
80
  trackedAt: Date.now(),
80
- wasConnected: s.isConnected
81
- }), y.add(new WeakRef(s))), () => {
82
- const n = u.get(s);
83
- n && (n.delete(i), n.size === 0 && (u.delete(s), A.delete(s)));
81
+ wasConnected: o.isConnected
82
+ }), v.add(new WeakRef(o))), () => {
83
+ const n = c.get(o);
84
+ n && (n.delete(i), n.size === 0 && (c.delete(o), M.delete(o)));
84
85
  };
85
86
  }
86
- function N({
87
- element: s,
87
+ function K({
88
+ element: o,
88
89
  accessor: i,
89
90
  updater: t,
90
91
  updaterId: e
91
92
  }) {
92
- const n = w.get(s) ?? /* @__PURE__ */ new Map();
93
- w.has(s) || w.set(s, n);
93
+ const n = L.get(o) ?? /* @__PURE__ */ new Map();
94
+ L.has(o) || L.set(o, n);
94
95
  let r = n.get(i);
95
96
  if (!r) {
96
97
  const a = /* @__PURE__ */ new Map();
97
98
  r = { effect: b(() => {
98
- const c = i();
99
+ const u = i();
99
100
  a.forEach(
100
- (E, L) => k(E, c, L)
101
+ (w, h) => I(w, u, h)
101
102
  );
102
103
  }), updaters: a }, n.set(i, r);
103
104
  }
104
- r.updaters.set(e, t), k(t, i(), e);
105
- let o = null;
105
+ r.updaters.set(e, t), I(t, i(), e);
106
+ let s = null;
106
107
  const l = () => {
107
- o && (o(), o = null);
108
- const a = w.get(s), d = a?.get(i);
109
- d && (d.updaters.delete(e), d.updaters.size === 0 && (d.effect.dispose(), a?.delete(i), m(i) && D(i)), a && a.size === 0 && w.delete(s));
108
+ s && (s(), s = null);
109
+ const a = L.get(o), d = a?.get(i);
110
+ d && (d.updaters.delete(e), d.updaters.size === 0 && (d.effect.dispose(), a?.delete(i), m(i) && D(i)), a && a.size === 0 && L.delete(o));
110
111
  };
111
- O() ? R(l) : o = U(s, l);
112
+ B() ? F(l) : s = N(o, l);
112
113
  }
113
- var j = Object.defineProperty, K = (s, i, t) => i in s ? j(s, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[i] = t, f = (s, i, t) => K(s, typeof i != "symbol" ? i + "" : i, t);
114
- const I = Symbol.for("tachui.modifier.instanceId"), x = "core";
115
- let $ = 0;
116
- function Y(s) {
117
- const i = s[I];
114
+ var x = Object.defineProperty, Y = (o, i, t) => i in o ? x(o, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[i] = t, f = (o, i, t) => Y(o, typeof i != "symbol" ? i + "" : i, t);
115
+ const H = Symbol.for("tachui.modifier.instanceId"), G = "core";
116
+ let V = 0;
117
+ function T(o) {
118
+ return typeof HTMLElement < "u" && o instanceof HTMLElement;
119
+ }
120
+ function A(o) {
121
+ return typeof o == "object" && o !== null && "style" in o && !!o.style;
122
+ }
123
+ function X(o) {
124
+ const i = o[H];
118
125
  if (typeof i == "number") return i;
119
- $ += 1;
120
- const t = $;
121
- return Object.defineProperty(s, I, {
126
+ V += 1;
127
+ const t = V;
128
+ return Object.defineProperty(o, H, {
122
129
  value: t,
123
130
  enumerable: !1,
124
131
  configurable: !1,
125
132
  writable: !1
126
133
  }), t;
127
134
  }
128
- class C {
135
+ class E {
129
136
  constructor(i) {
130
137
  this.properties = i;
131
138
  }
@@ -135,33 +142,32 @@ class C {
135
142
  resolveReactiveProps(i, t) {
136
143
  const e = {};
137
144
  for (const [n, r] of Object.entries(i))
138
- v(r) || m(r), e[n] = r;
145
+ S(r) || m(r), e[n] = r;
139
146
  return e;
140
147
  }
141
148
  /**
142
149
  * Apply a single style change to an element with reactive support
143
150
  */
144
151
  applyStyleChange(i, t, e) {
145
- if (i instanceof HTMLElement) {
146
- const n = this.toCSSProperty(t);
147
- if (v(e) || m(e))
148
- b(() => {
149
- const r = e(), o = String(r);
150
- if (o.includes("!important")) {
151
- const l = o.replace(/\s*!important\s*$/, "").trim();
152
- i.style.setProperty(n, l, "important");
153
- } else
154
- i.style.setProperty(n, o);
155
- });
156
- else {
157
- const r = String(e);
158
- if (r.includes("!important")) {
159
- const o = r.replace(/\s*!important\s*$/, "").trim();
160
- i.style.setProperty(n, o, "important");
161
- } else
162
- i.style.setProperty(n, r);
152
+ const n = typeof HTMLElement < "u" && i instanceof HTMLElement;
153
+ if (!n && !i.style)
154
+ return;
155
+ const r = this.toCSSProperty(t), s = i.style, l = (a) => {
156
+ if (a.includes("!important")) {
157
+ const d = a.replace(/\s*!important\s*$/, "").trim();
158
+ s.setProperty(r, d, "important");
159
+ return;
163
160
  }
161
+ s.setProperty(r, a);
162
+ };
163
+ if (S(e) || m(e)) {
164
+ b(() => {
165
+ const a = e();
166
+ l(String(a));
167
+ });
168
+ return;
164
169
  }
170
+ l(String(e));
165
171
  }
166
172
  /**
167
173
  * Convert camelCase property to CSS kebab-case
@@ -207,34 +213,35 @@ class C {
207
213
  * Apply multiple CSS properties to an element with reactive support
208
214
  */
209
215
  applyStyles(i, t) {
210
- if (i instanceof HTMLElement || i.style) {
211
- const e = (i instanceof HTMLElement, i.style), n = (r, o) => {
212
- if (e.setProperty)
213
- if (typeof o == "string" && o.includes("!important")) {
214
- const l = o.replace(/\s*!important\s*$/, "").trim();
215
- e.setProperty(r, l, "important");
216
+ const e = typeof HTMLElement < "u" && i instanceof HTMLElement;
217
+ if (e || i.style) {
218
+ const n = i.style, r = (s, l) => {
219
+ if (n.setProperty)
220
+ if (typeof l == "string" && l.includes("!important")) {
221
+ const a = l.replace(/\s*!important\s*$/, "").trim();
222
+ n.setProperty(s, a, "important");
216
223
  } else
217
- e.setProperty(r, o);
224
+ n.setProperty(s, l);
218
225
  else
219
- e[r] = o;
226
+ n[s] = l;
220
227
  };
221
- for (const [r, o] of Object.entries(t))
222
- if (o !== void 0) {
223
- const l = this.toCSSProperty(r);
224
- if (v(o) || m(o)) {
225
- const a = o, d = Y(this);
226
- N({
228
+ for (const [s, l] of Object.entries(t))
229
+ if (l !== void 0) {
230
+ const a = this.toCSSProperty(s);
231
+ if (S(l) || m(l)) {
232
+ const d = l, u = X(this);
233
+ K({
227
234
  element: i,
228
- accessor: a,
229
- updaterId: `${x}:${d}:${l}`,
230
- updater: (c) => {
231
- const E = this.toCSSValueForProperty(l, c);
232
- n(l, E);
235
+ accessor: d,
236
+ updaterId: `${G}:${u}:${a}`,
237
+ updater: (w) => {
238
+ const h = this.toCSSValueForProperty(a, w);
239
+ r(a, h);
233
240
  }
234
241
  });
235
242
  } else {
236
- const a = this.toCSSValueForProperty(l, o);
237
- n(l, a);
243
+ const d = this.toCSSValueForProperty(a, l);
244
+ r(a, d);
238
245
  }
239
246
  }
240
247
  }
@@ -243,13 +250,13 @@ class C {
243
250
  * Add CSS classes to an element
244
251
  */
245
252
  addClasses(i, t) {
246
- i instanceof HTMLElement && i.classList.add(...t);
253
+ T(i) && i.classList.add(...t);
247
254
  }
248
255
  /**
249
256
  * Remove CSS classes from an element
250
257
  */
251
258
  removeClasses(i, t) {
252
- i instanceof HTMLElement && i.classList.remove(...t);
259
+ T(i) && i.classList.remove(...t);
253
260
  }
254
261
  /**
255
262
  * Create a style computation context
@@ -264,9 +271,9 @@ class C {
264
271
  };
265
272
  }
266
273
  }
267
- class te extends C {
274
+ class re extends E {
268
275
  constructor() {
269
- super(...arguments), f(this, "type", "layout"), f(this, "priority", S.LAYOUT);
276
+ super(...arguments), f(this, "type", "layout"), f(this, "priority", C.LAYOUT);
270
277
  }
271
278
  apply(i, t) {
272
279
  if (!i.element || !t.element) return;
@@ -280,41 +287,41 @@ class te extends C {
280
287
  );
281
288
  this.applyStyles(t.element, n);
282
289
  const r = this.properties;
283
- r.position && t.element instanceof HTMLElement && this.applyAbsolutePosition(t.element, r.position);
290
+ r.position && T(t.element) && this.applyAbsolutePosition(t.element, r.position);
284
291
  }
285
292
  // Layout modifier implementations have been migrated to @tachui/modifiers/layout
286
293
  applyAbsolutePosition(i, t) {
287
- const { x: e, y: n } = t, r = e ?? "auto", o = n ?? "auto";
288
- i.style.left = this.toCSSValue(r), i.style.top = this.toCSSValue(o);
294
+ const { x: e, y: n } = t, r = e ?? "auto", s = n ?? "auto";
295
+ i.style.left = this.toCSSValue(r), i.style.top = this.toCSSValue(s);
289
296
  }
290
297
  computeLayoutStyles(i, t) {
291
298
  const e = {};
292
299
  if (i.frame) {
293
- const n = i.frame, r = _(n);
300
+ const n = i.frame, r = z(n);
294
301
  if (Object.assign(e, r.cssProps), n.width !== void 0) {
295
- const o = h(n.width);
296
- o !== void 0 && !g(n.width) && !r.expandWidth && (e.width = o);
302
+ const s = g(n.width);
303
+ s !== void 0 && !p(n.width) && !r.expandWidth && (e.width = s);
297
304
  }
298
305
  if (n.height !== void 0) {
299
- const o = h(n.height);
300
- o !== void 0 && !g(n.height) && !r.expandHeight && (e.height = o);
306
+ const s = g(n.height);
307
+ s !== void 0 && !p(n.height) && !r.expandHeight && (e.height = s);
301
308
  }
302
309
  if (n.minWidth !== void 0) {
303
- const o = h(n.minWidth);
304
- o !== void 0 && (e.minWidth = o);
310
+ const s = g(n.minWidth);
311
+ s !== void 0 && (e.minWidth = s);
305
312
  }
306
- if (n.maxWidth !== void 0 && !g(n.maxWidth)) {
307
- const o = h(n.maxWidth);
308
- o !== void 0 && (e.maxWidth = o);
309
- } else g(n.maxWidth) && (e.maxWidth = "none", e.flexGrow = "1 !important", e.flexShrink = "1 !important", e.flexBasis = "0% !important", e.alignSelf = "stretch !important");
313
+ if (n.maxWidth !== void 0 && !p(n.maxWidth)) {
314
+ const s = g(n.maxWidth);
315
+ s !== void 0 && (e.maxWidth = s);
316
+ } else p(n.maxWidth) && (e.maxWidth = "none", e.flexGrow = "1 !important", e.flexShrink = "1 !important", e.flexBasis = "0% !important", e.alignSelf = "stretch !important");
310
317
  if (n.minHeight !== void 0) {
311
- const o = h(n.minHeight);
312
- o !== void 0 && (e.minHeight = o);
318
+ const s = g(n.minHeight);
319
+ s !== void 0 && (e.minHeight = s);
313
320
  }
314
- if (n.maxHeight !== void 0 && !g(n.maxHeight)) {
315
- const o = h(n.maxHeight);
316
- o !== void 0 && (e.maxHeight = o);
317
- } else g(n.maxHeight) && (e.maxHeight = "none", e.flexGrow = "1 !important", e.flexShrink = "1 !important", e.flexBasis = "0% !important", e.alignSelf = "stretch !important");
321
+ if (n.maxHeight !== void 0 && !p(n.maxHeight)) {
322
+ const s = g(n.maxHeight);
323
+ s !== void 0 && (e.maxHeight = s);
324
+ } else p(n.maxHeight) && (e.maxHeight = "none", e.flexGrow = "1 !important", e.flexShrink = "1 !important", e.flexBasis = "0% !important", e.alignSelf = "stretch !important");
318
325
  }
319
326
  if (i.padding !== void 0)
320
327
  if (typeof i.padding == "number")
@@ -363,9 +370,9 @@ class te extends C {
363
370
  return e;
364
371
  }
365
372
  }
366
- class ie extends C {
373
+ class oe extends E {
367
374
  constructor() {
368
- super(...arguments), f(this, "type", "appearance"), f(this, "priority", S.APPEARANCE);
375
+ super(...arguments), f(this, "type", "appearance"), f(this, "priority", C.APPEARANCE);
369
376
  }
370
377
  apply(i, t) {
371
378
  if (!i.element || !t.element)
@@ -386,7 +393,7 @@ class ie extends C {
386
393
  * Apply Asset-based styles with theme reactivity
387
394
  */
388
395
  applyAssetBasedStyles(i, t) {
389
- const e = B();
396
+ const e = _();
390
397
  t.foregroundColor && this.isAsset(t.foregroundColor) && b(() => {
391
398
  e();
392
399
  const n = t.foregroundColor.resolve();
@@ -417,7 +424,7 @@ class ie extends C {
417
424
  t.fontFamily = r;
418
425
  } else
419
426
  t.fontFamily = n.family;
420
- n.size !== void 0 && (t.fontSize = v(n.size) || m(n.size) ? n.size : this.toCSSValue(n.size)), n.weight !== void 0 && (t.fontWeight = v(n.weight) || m(n.weight) ? n.weight : String(n.weight)), n.style && (t.fontStyle = n.style);
427
+ n.size !== void 0 && (t.fontSize = S(n.size) || m(n.size) ? n.size : this.toCSSValue(n.size)), n.weight !== void 0 && (t.fontWeight = S(n.weight) || m(n.weight) ? n.weight : String(n.weight)), n.style && (t.fontStyle = n.style);
421
428
  }
422
429
  if (i.cornerRadius !== void 0 && (t.borderRadius = this.toCSSValue(i.cornerRadius)), i.border) {
423
430
  const n = i.border;
@@ -450,9 +457,9 @@ class ie extends C {
450
457
  return i._tachui_component || null;
451
458
  }
452
459
  }
453
- class ne extends C {
460
+ class se extends E {
454
461
  constructor() {
455
- super(...arguments), f(this, "type", "interaction"), f(this, "priority", S.INTERACTION);
462
+ super(...arguments), f(this, "type", "interaction"), f(this, "priority", C.INTERACTION);
456
463
  }
457
464
  apply(i, t) {
458
465
  if (!t.element) return;
@@ -469,16 +476,16 @@ class ne extends C {
469
476
  let n = 0, r = 0;
470
477
  t.element.addEventListener(
471
478
  "touchstart",
472
- (o) => {
473
- const a = o.touches[0];
479
+ (s) => {
480
+ const a = s.touches[0];
474
481
  n = a.clientX, r = a.clientY;
475
482
  },
476
483
  { passive: !0 }
477
484
  ), t.element.addEventListener(
478
485
  "touchend",
479
- (o) => {
480
- const a = o.changedTouches[0], d = a.clientX - n, c = a.clientY - r;
481
- Math.abs(d) > Math.abs(c) && Math.abs(d) > 50 && (d < 0 && e.onSwipeLeft ? e.onSwipeLeft() : d > 0 && e.onSwipeRight && e.onSwipeRight());
486
+ (s) => {
487
+ const a = s.changedTouches[0], d = a.clientX - n, u = a.clientY - r;
488
+ Math.abs(d) > Math.abs(u) && Math.abs(d) > 50 && (d < 0 && e.onSwipeLeft ? e.onSwipeLeft() : d > 0 && e.onSwipeRight && e.onSwipeRight());
482
489
  },
483
490
  { passive: !0 }
484
491
  );
@@ -488,39 +495,39 @@ class ne extends C {
488
495
  }), e.onWheel && t.element.addEventListener("wheel", e.onWheel, {
489
496
  passive: !1
490
497
  }), e.onInput && t.element.addEventListener("input", e.onInput), e.onChange && t.element.addEventListener("change", (n) => {
491
- const r = n.target, o = r.value || r.textContent || "";
492
- e.onChange(o, n);
493
- }), e.onCopy && t.element.addEventListener("copy", e.onCopy), e.onCut && t.element.addEventListener("cut", e.onCut), e.onPaste && t.element.addEventListener("paste", e.onPaste), e.onSelect && t.element.addEventListener("select", e.onSelect), e.disabled !== void 0 && t.element instanceof HTMLElement && (e.disabled ? (t.element.setAttribute("disabled", "true"), t.element.style.pointerEvents = "none", t.element.style.opacity = "0.6") : (t.element.removeAttribute("disabled"), t.element.style.pointerEvents = "", t.element.style.opacity = "")), e.draggable !== void 0 && t.element instanceof HTMLElement && (t.element.draggable = e.draggable), e.accessibilityLabel && t.element.setAttribute("aria-label", e.accessibilityLabel), e.accessibilityHint && t.element.setAttribute("aria-describedby", e.accessibilityHint);
498
+ const r = n.target, s = r.value || r.textContent || "";
499
+ e.onChange(s, n);
500
+ }), e.onCopy && t.element.addEventListener("copy", e.onCopy), e.onCut && t.element.addEventListener("cut", e.onCut), e.onPaste && t.element.addEventListener("paste", e.onPaste), e.onSelect && t.element.addEventListener("select", e.onSelect), e.disabled !== void 0 && T(t.element) && (e.disabled ? (t.element.setAttribute("disabled", "true"), t.element.style.pointerEvents = "none", t.element.style.opacity = "0.6") : (t.element.removeAttribute("disabled"), t.element.style.pointerEvents = "", t.element.style.opacity = "")), e.draggable !== void 0 && T(t.element) && (t.element.draggable = e.draggable), e.accessibilityLabel && t.element.setAttribute("aria-label", e.accessibilityLabel), e.accessibilityHint && t.element.setAttribute("aria-describedby", e.accessibilityHint);
494
501
  }
495
502
  }
496
- class re extends C {
503
+ class ae extends E {
497
504
  constructor() {
498
- super(...arguments), f(this, "type", "animation"), f(this, "priority", S.ANIMATION);
505
+ super(...arguments), f(this, "type", "animation"), f(this, "priority", C.ANIMATION);
499
506
  }
500
507
  apply(i, t) {
501
508
  if (!t.element) return;
502
509
  const e = this.properties;
503
510
  if (e.transition) {
504
- const n = e.transition, r = n.property || "all", o = n.duration || 300, l = n.easing || "ease", a = n.delay || 0;
505
- t.element instanceof HTMLElement && (t.element.style.transition = `${r} ${o}ms ${l} ${a}ms`);
511
+ const n = e.transition, r = n.property || "all", s = n.duration || 300, l = n.easing || "ease", a = n.delay || 0;
512
+ A(t.element) && (t.element.style.transition = `${r} ${s}ms ${l} ${a}ms`);
506
513
  }
507
- if (e.animation && t.element instanceof HTMLElement) {
514
+ if (e.animation && A(t.element)) {
508
515
  const n = e.animation;
509
- if (n.keyframes) {
510
- const r = `tachui-animation-${t.componentId}-${Date.now()}`, o = this.createKeyframeRule(
516
+ if (n.keyframes && typeof document < "u") {
517
+ const r = `tachui-animation-${t.componentId}-${Date.now()}`, s = this.createKeyframeRule(
511
518
  r,
512
519
  n.keyframes
513
520
  );
514
- this.addKeyframesToStylesheet(o);
515
- const l = n.duration || 1e3, a = n.easing || "ease", d = n.iterations || 1, c = n.direction || "normal";
516
- t.element.style.animation = `${r} ${l}ms ${a} ${d} ${c}`;
521
+ this.addKeyframesToStylesheet(s);
522
+ const l = n.duration || 1e3, a = n.easing || "ease", d = n.iterations || 1, u = n.direction || "normal";
523
+ t.element.style.animation = `${r} ${l}ms ${a} ${d} ${u}`;
517
524
  }
518
525
  }
519
- if (e.transform && t.element instanceof HTMLElement && (v(e.transform) || m(e.transform) ? b(() => {
526
+ if (e.transform && A(t.element) && (S(e.transform) || m(e.transform) ? b(() => {
520
527
  const n = e.transform();
521
- t.element instanceof HTMLElement && (t.element.style.transform = n);
522
- }) : t.element.style.transform = e.transform), e.scaleEffect && t.element instanceof HTMLElement) {
523
- const { x: n, y: r, anchor: o } = e.scaleEffect, l = r ?? n, d = {
528
+ A(t.element) && (t.element.style.transform = n);
529
+ }) : t.element.style.transform = e.transform), e.scaleEffect && A(t.element)) {
530
+ const { x: n, y: r, anchor: s } = e.scaleEffect, l = r ?? n, d = {
524
531
  center: "50% 50%",
525
532
  top: "50% 0%",
526
533
  topLeading: "0% 0%",
@@ -530,10 +537,10 @@ class re extends C {
530
537
  bottomTrailing: "100% 100%",
531
538
  leading: "0% 50%",
532
539
  trailing: "100% 50%"
533
- }[o || "center"] || "50% 50%";
540
+ }[s || "center"] || "50% 50%";
534
541
  t.element.style.transformOrigin = d;
535
- const c = `scale(${n}, ${l})`, L = (t.element.style.transform || "").replace(/\s*scale[XYZ3d]*\([^)]*\)\s*/g, " ").replace(/\s+/g, " ").trim(), V = L ? `${L} ${c}`.trim() : c;
536
- t.element.style.transform = V;
542
+ const u = `scale(${n}, ${l})`, h = (t.element.style.transform || "").replace(/\s*scale[XYZ3d]*\([^)]*\)\s*/g, " ").replace(/\s+/g, " ").trim(), O = h ? `${h} ${u}`.trim() : u;
543
+ t.element.style.transform = O;
537
544
  }
538
545
  }
539
546
  createKeyframeRule(i, t) {
@@ -542,8 +549,8 @@ class re extends C {
542
549
  for (const [n, r] of Object.entries(t)) {
543
550
  e += ` ${n} {
544
551
  `;
545
- for (const [o, l] of Object.entries(r)) {
546
- const a = this.toCSSProperty(o);
552
+ for (const [s, l] of Object.entries(r)) {
553
+ const a = this.toCSSProperty(s);
547
554
  e += ` ${a}: ${l};
548
555
  `;
549
556
  }
@@ -559,9 +566,9 @@ class re extends C {
559
566
  t || (t = document.createElement("style"), t.id = "tachui-animations", document.head.appendChild(t)), t.appendChild(document.createTextNode(i));
560
567
  }
561
568
  }
562
- class oe extends C {
569
+ class le extends E {
563
570
  constructor() {
564
- super(...arguments), f(this, "type", "lifecycle"), f(this, "priority", S.CUSTOM), f(this, "activeAbortController");
571
+ super(...arguments), f(this, "type", "lifecycle"), f(this, "priority", C.CUSTOM), f(this, "activeAbortController");
565
572
  }
566
573
  apply(i, t) {
567
574
  if (!t.element) return;
@@ -600,22 +607,22 @@ class oe extends C {
600
607
  this.properties._cleanupFunctions || (this.properties._cleanupFunctions = []), this.properties._cleanupFunctions.push(i);
601
608
  }
602
609
  }
603
- class se extends C {
610
+ class de extends E {
604
611
  constructor() {
605
- super(...arguments), f(this, "type", "resizable"), f(this, "priority", S.APPEARANCE);
612
+ super(...arguments), f(this, "type", "resizable"), f(this, "priority", C.APPEARANCE);
606
613
  }
607
614
  apply(i, t) {
608
615
  t.element && t.element instanceof HTMLImageElement && (t.element.style.objectFit = "fill");
609
616
  }
610
617
  }
611
618
  export {
612
- re as AnimationModifier,
613
- ie as AppearanceModifier,
614
- C as BaseModifier,
615
- ne as InteractionModifier,
616
- te as LayoutModifier,
617
- oe as LifecycleModifier,
618
- se as ResizableModifier,
619
- N as bindReactiveStyle,
620
- ee as setReactiveStyleUpdaterErrorHandler
619
+ ae as AnimationModifier,
620
+ oe as AppearanceModifier,
621
+ E as BaseModifier,
622
+ se as InteractionModifier,
623
+ re as LayoutModifier,
624
+ le as LifecycleModifier,
625
+ de as ResizableModifier,
626
+ K as bindReactiveStyle,
627
+ ne as setReactiveStyleUpdaterErrorHandler
621
628
  };
@@ -1,5 +1,5 @@
1
1
  import "@tachui/registry";
2
- import { M as s, a, c as o, m as d, s as t } from "../concatenated-component-2Gzy5e2c.js";
2
+ import { M as s, a, c as o, m as d, s as t } from "../concatenated-component-CA54ng_j.js";
3
3
  export {
4
4
  s as ModifierBuilderImpl,
5
5
  a as applyModifiers,
@@ -1 +1 @@
1
- {"version":3,"file":"factories.d.ts","sourceRoot":"","sources":["../../src/modifiers/factories.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAElE,OAAO,KAAK,EACV,QAAQ,EACR,eAAe,EACf,eAAe,EAEhB,MAAM,SAAS,CAAA;AAEhB;;GAEG;AACH,eAAO,MAAM,eAAe;IAC1B;;OAEG;eACQ,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC;IAIvD;;OAEG;iBACU,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC;IAIxC;;OAEG;yBACkB,CAAC,SACb,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,YACV,CAAC,QAAQ,EAAE,CAAC,KAAK,IAAI,GAC9B,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI;IAWtB;;OAEG;oBACa,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,QACrC,CAAC,YACG,OAAO,CAAC,CAAC,CAAC,GACnB,CAAC;IAYJ;;OAEG;6BACsB,MAAM,GAAG,MAAM;IAMxC;;OAEG;+BACwB,MAAM,GAAG,MAAM;IAI1C;;OAEG;6BACsB,GAAG,GAAG,MAAM;CAStC,CAAA;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACrE,IAAI,EAAE,MAAM,EACZ,Q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