@tachui/core 0.8.1-alpha → 0.8.5-alpha

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 (161) hide show
  1. package/README.md +40 -2
  2. package/dist/assets/AssetCollection.d.ts.map +1 -1
  3. package/dist/assets/ColorAsset.d.ts.map +1 -1
  4. package/dist/assets/index.d.ts +1 -0
  5. package/dist/assets/index.d.ts.map +1 -1
  6. package/dist/assets/index.js +486 -0
  7. package/dist/assets/types.d.ts +8 -68
  8. package/dist/assets/types.d.ts.map +1 -1
  9. package/dist/binding-CYpEQquE.js +308 -0
  10. package/dist/build-plugins/index.d.ts +3 -0
  11. package/dist/build-plugins/index.d.ts.map +1 -0
  12. package/dist/build-plugins/modifier-types.d.ts +12 -0
  13. package/dist/build-plugins/modifier-types.d.ts.map +1 -0
  14. package/dist/build-tools/typegen-runner.d.ts +29 -0
  15. package/dist/build-tools/typegen-runner.d.ts.map +1 -0
  16. package/dist/bundles/minimal.d.ts +2 -0
  17. package/dist/bundles/minimal.d.ts.map +1 -1
  18. package/dist/common.js +427 -394
  19. package/dist/{component-XAzF1xqs.js → component-CECyfUOE.js} +80 -68
  20. package/dist/{component-base-x2XmHFjy.js → component-base-CJ__jTlr.js} +9 -7
  21. package/dist/component-context-B6qX_Qsg.js +176 -0
  22. package/dist/components/factory.d.ts +24 -0
  23. package/dist/components/factory.d.ts.map +1 -0
  24. package/dist/components/index.d.ts +3 -2
  25. package/dist/components/index.d.ts.map +1 -1
  26. package/dist/components/index.js +8 -6
  27. package/dist/components/wrapper.d.ts +70 -30
  28. package/dist/components/wrapper.d.ts.map +1 -1
  29. package/dist/concatenated-component-_tF1eMvy.js +2288 -0
  30. package/dist/concatenation/concatenated-component.d.ts +16 -2
  31. package/dist/concatenation/concatenated-component.d.ts.map +1 -1
  32. package/dist/concatenation/text-optimizer.d.ts.map +1 -1
  33. package/dist/config.d.ts +7 -0
  34. package/dist/config.d.ts.map +1 -0
  35. package/dist/constants/layout.d.ts +2 -9
  36. package/dist/constants/layout.d.ts.map +1 -1
  37. package/dist/css-classes/index.js +15 -173
  38. package/dist/{effect-B9Knft0b.js → effect-DGmdACI2.js} +3 -3
  39. package/dist/enhanced-renderer-Bwqsh8Ku.js +172 -0
  40. package/dist/essential.js +427 -394
  41. package/dist/{index-DIvMCJQO.js → factories-Co2Lv2kJ.js} +13 -13
  42. package/dist/factory-D7jAY5Kn.js +485 -0
  43. package/dist/gradients/css-generator.js +99 -0
  44. package/dist/gradients/index.js +56 -0
  45. package/dist/gradients/reactive.d.ts.map +1 -1
  46. package/dist/gradients/types.d.ts +3 -91
  47. package/dist/gradients/types.d.ts.map +1 -1
  48. package/dist/hooks-DeLasj54.js +446 -0
  49. package/dist/index-JQ1sW1SK.js +2049 -0
  50. package/dist/index-X8MVY78C.js +618 -0
  51. package/dist/index.d.ts +8 -1
  52. package/dist/index.d.ts.map +1 -1
  53. package/dist/index.js +427 -394
  54. package/dist/minimal-prod.js +94 -93
  55. package/dist/minimal.js +114 -108
  56. package/dist/modifiers/alignment.d.ts +5 -0
  57. package/dist/modifiers/alignment.d.ts.map +1 -0
  58. package/dist/modifiers/base.d.ts +6 -7
  59. package/dist/modifiers/base.d.ts.map +1 -1
  60. package/dist/modifiers/base.js +24 -16
  61. package/dist/modifiers/builder.d.ts +28 -165
  62. package/dist/modifiers/builder.d.ts.map +1 -1
  63. package/dist/modifiers/builder.js +7 -7
  64. package/dist/modifiers/core.d.ts +0 -1
  65. package/dist/modifiers/core.d.ts.map +1 -1
  66. package/dist/modifiers/corner-radius.d.ts +8 -0
  67. package/dist/modifiers/corner-radius.d.ts.map +1 -0
  68. package/dist/modifiers/index.d.ts +9 -6
  69. package/dist/modifiers/index.d.ts.map +1 -1
  70. package/dist/modifiers/index.js +36 -30
  71. package/dist/modifiers/layout-priority.d.ts +8 -0
  72. package/dist/modifiers/layout-priority.d.ts.map +1 -0
  73. package/dist/modifiers/opacity.d.ts +8 -0
  74. package/dist/modifiers/opacity.d.ts.map +1 -0
  75. package/dist/modifiers/presets.d.ts.map +1 -1
  76. package/dist/modifiers/proxy.d.ts +4 -0
  77. package/dist/modifiers/proxy.d.ts.map +1 -0
  78. package/dist/modifiers/registration-utils.d.ts +7 -0
  79. package/dist/modifiers/registration-utils.d.ts.map +1 -0
  80. package/dist/modifiers/registry.d.ts +18 -9
  81. package/dist/modifiers/registry.d.ts.map +1 -1
  82. package/dist/modifiers/registry.js +2 -2
  83. package/dist/modifiers/type-generator.d.ts +82 -0
  84. package/dist/modifiers/type-generator.d.ts.map +1 -0
  85. package/dist/modifiers/types.d.ts +2 -479
  86. package/dist/modifiers/types.d.ts.map +1 -1
  87. package/dist/modifiers/types.js +1 -4
  88. package/dist/{observed-object-Cos-FtjP.js → observed-object-DepiqSgg.js} +3 -3
  89. package/dist/optimization-CbKNA9w4.js +21 -0
  90. package/dist/plugins/index.js +28 -8
  91. package/dist/plugins/simplified-lazy-loader.d.ts.map +1 -1
  92. package/dist/presets-B9x94uRn.js +381 -0
  93. package/dist/proxy-Cqmbiyx0.js +175 -0
  94. package/dist/reactive/cleanup.d.ts.map +1 -1
  95. package/dist/reactive/computed.d.ts +1 -1
  96. package/dist/reactive/computed.d.ts.map +1 -1
  97. package/dist/reactive/context.d.ts +4 -3
  98. package/dist/reactive/context.d.ts.map +1 -1
  99. package/dist/reactive/index.d.ts +1 -0
  100. package/dist/reactive/index.d.ts.map +1 -1
  101. package/dist/reactive/index.js +84 -490
  102. package/dist/reactive/signal-list.d.ts +100 -0
  103. package/dist/reactive/signal-list.d.ts.map +1 -0
  104. package/dist/reactive/signal.d.ts.map +1 -1
  105. package/dist/reactive/types.d.ts +2 -89
  106. package/dist/reactive/types.d.ts.map +1 -1
  107. package/dist/reactive/types.js +1 -4
  108. package/dist/registration-utils-CNsN4eoU.js +27 -0
  109. package/dist/runtime/component.d.ts.map +1 -1
  110. package/dist/runtime/concatenation-aria.d.ts.map +1 -1
  111. package/dist/runtime/concatenation-aria.js +18 -13
  112. package/dist/runtime/concatenation-full.d.ts.map +1 -1
  113. package/dist/runtime/concatenation-full.js +42 -34
  114. package/dist/runtime/concatenation-minimal.d.ts.map +1 -1
  115. package/dist/runtime/concatenation-minimal.js +13 -8
  116. package/dist/runtime/context.d.ts.map +1 -1
  117. package/dist/runtime/dom-bridge.d.ts +1 -1
  118. package/dist/runtime/dom-bridge.d.ts.map +1 -1
  119. package/dist/runtime/dom-bridge.js +239 -12
  120. package/dist/runtime/event-delegation.d.ts +59 -0
  121. package/dist/runtime/event-delegation.d.ts.map +1 -0
  122. package/dist/runtime/index.d.ts +3 -1
  123. package/dist/runtime/index.d.ts.map +1 -1
  124. package/dist/runtime/index.js +96 -0
  125. package/dist/runtime/layout-scheduler.d.ts +89 -0
  126. package/dist/runtime/layout-scheduler.d.ts.map +1 -0
  127. package/dist/runtime/props.d.ts.map +1 -1
  128. package/dist/runtime/renderer.d.ts +54 -2
  129. package/dist/runtime/renderer.d.ts.map +1 -1
  130. package/dist/runtime/renderer.js +11 -7
  131. package/dist/runtime/semantic-role-manager.d.ts.map +1 -1
  132. package/dist/runtime/types.d.ts +2 -226
  133. package/dist/runtime/types.d.ts.map +1 -1
  134. package/dist/runtime/types.js +1 -1
  135. package/dist/scheduler-DI_8ykMk.js +169 -0
  136. package/dist/signal-list-BdpxSodS.js +525 -0
  137. package/dist/state/index.js +319 -0
  138. package/dist/theme-BFaKUcjZ.js +677 -0
  139. package/dist/utils/clone-helpers.d.ts +11 -0
  140. package/dist/utils/clone-helpers.d.ts.map +1 -0
  141. package/dist/validation/index.js +28 -26
  142. package/dist/version.d.ts +19 -0
  143. package/dist/version.d.ts.map +1 -0
  144. package/dist/version.js +6 -0
  145. package/package.json +51 -11
  146. package/dist/concatenated-component-ByPl3_FF.js +0 -2933
  147. package/dist/dom-bridge-CAa1N2zX.js +0 -406
  148. package/dist/index-DEBd8cq7.js +0 -1144
  149. package/dist/index-vdsiw6gQ.js +0 -777
  150. package/dist/modifiers/as-html-validator.d.ts +0 -20
  151. package/dist/modifiers/as-html-validator.d.ts.map +0 -1
  152. package/dist/modifiers/as-html.d.ts +0 -65
  153. package/dist/modifiers/as-html.d.ts.map +0 -1
  154. package/dist/modifiers/background.d.ts +0 -51
  155. package/dist/modifiers/background.d.ts.map +0 -1
  156. package/dist/modifiers/basic-sanitizer.d.ts +0 -54
  157. package/dist/modifiers/basic-sanitizer.d.ts.map +0 -1
  158. package/dist/modifiers/css.d.ts +0 -86
  159. package/dist/modifiers/css.d.ts.map +0 -1
  160. package/dist/production-minimal-BY_gMc-l.js +0 -2532
  161. package/dist/scheduler-BKeqwrYE.js +0 -814
@@ -1,777 +0,0 @@
1
- import { G as R, g as $ } from "./scheduler-BKeqwrYE.js";
2
- import { c as P, d as k, F as O, v as I } from "./concatenated-component-ByPl3_FF.js";
3
- import "./component-XAzF1xqs.js";
4
- import { b as V, r as F } from "./dom-bridge-CAa1N2zX.js";
5
- import { b as L } from "./component-base-x2XmHFjy.js";
6
- var N = Object.defineProperty, W = (n, e, r) => e in n ? N(n, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : n[e] = r, m = (n, e, r) => W(n, typeof e != "symbol" ? e + "" : e, r);
7
- const _ = class x {
8
- constructor() {
9
- m(this, "contexts", /* @__PURE__ */ new Map()), m(this, "providerStack", /* @__PURE__ */ new Map()), m(this, "currentComponent", null);
10
- }
11
- static getInstance() {
12
- return x.instance || (x.instance = new x()), x.instance;
13
- }
14
- /**
15
- * Set the current component context for provider resolution
16
- */
17
- setCurrentComponent(e) {
18
- this.currentComponent = e;
19
- }
20
- /**
21
- * Get the current component context
22
- */
23
- getCurrentComponent() {
24
- return this.currentComponent;
25
- }
26
- /**
27
- * Register a context provider
28
- */
29
- registerProvider(e, r, t) {
30
- this.providerStack.has(e) || this.providerStack.set(e, []);
31
- const s = this.providerStack.get(e), [i, c] = R(r), o = {
32
- value: r,
33
- signal: [i, c],
34
- subscribers: /* @__PURE__ */ new Set(),
35
- providers: /* @__PURE__ */ new Set([t])
36
- };
37
- return s.push(o), t.providers.set(e, o), () => {
38
- const d = s.indexOf(o);
39
- d !== -1 && s.splice(d, 1), t.providers.delete(e), o.subscribers.clear(), o.providers.clear();
40
- };
41
- }
42
- /**
43
- * Get context value with reactive subscription
44
- */
45
- getContextValue(e, r) {
46
- const t = this.providerStack.get(e), s = t && t.length > 0 ? t[t.length - 1] : null;
47
- if (s)
48
- return this.currentComponent && (s.subscribers.add(this.currentComponent.id), this.currentComponent.consumers.add(e)), [s.signal[0], !0];
49
- const [i] = R(r);
50
- return [i, !1];
51
- }
52
- /**
53
- * Update context value and notify subscribers
54
- */
55
- updateContextValue(e, r) {
56
- const t = this.providerStack.get(e), s = t && t.length > 0 ? t[t.length - 1] : null;
57
- return s ? (s.value = r, s.signal[1](r), !0) : !1;
58
- }
59
- /**
60
- * Get all registered contexts (for debugging)
61
- */
62
- getAllContexts() {
63
- const e = /* @__PURE__ */ new Map();
64
- for (const [r, t] of this.providerStack.entries())
65
- t.length > 0 && e.set(r, t[t.length - 1]);
66
- return e;
67
- }
68
- /**
69
- * Clear all contexts (for testing)
70
- */
71
- clear() {
72
- this.contexts.clear(), this.providerStack.clear(), this.currentComponent = null;
73
- }
74
- };
75
- m(_, "instance");
76
- let T = _;
77
- class A {
78
- constructor() {
79
- m(this, "registry", T.getInstance());
80
- }
81
- /**
82
- * Create a context provider component
83
- */
84
- createProvider(e, r, t) {
85
- return {
86
- type: "component",
87
- render: () => {
88
- const s = this.registry.registerProvider(
89
- e.symbol,
90
- r,
91
- V(`provider_${e.symbol.toString()}`)
92
- ), i = t.flatMap((c) => {
93
- const o = c.render();
94
- return Array.isArray(o) ? o : [o];
95
- });
96
- return [
97
- {
98
- type: "element",
99
- tag: "div",
100
- props: { "data-context-provider": e.displayName || "provider" },
101
- children: i,
102
- dispose: s
103
- }
104
- ];
105
- },
106
- props: { children: t },
107
- id: `provider_${Date.now()}`,
108
- children: t
109
- };
110
- }
111
- /**
112
- * Set current component for context resolution
113
- */
114
- setCurrentComponent(e) {
115
- this.registry.setCurrentComponent(e);
116
- }
117
- /**
118
- * Update a context value
119
- */
120
- updateContext(e, r) {
121
- return this.registry.updateContextValue(e.symbol, r);
122
- }
123
- /**
124
- * Get all active contexts (for debugging)
125
- */
126
- getAllContexts() {
127
- return this.registry.getAllContexts();
128
- }
129
- /**
130
- * Clear all contexts
131
- */
132
- clear() {
133
- this.registry.clear();
134
- }
135
- }
136
- function E(n, e = {}) {
137
- return {
138
- symbol: Symbol(e.displayName || "TachUIContext"),
139
- defaultValue: n,
140
- displayName: e.displayName
141
- };
142
- }
143
- function q(n) {
144
- const e = T.getInstance(), [r, t] = e.getContextValue(n.symbol, n.defaultValue);
145
- return t || console.warn(
146
- `Context ${n.displayName || "unnamed"} used without a Provider. Using default value.`
147
- ), r;
148
- }
149
- function Y(n, e) {
150
- return (r) => function(s) {
151
- return new A().createProvider(n, e, [r(s)]);
152
- };
153
- }
154
- function ee(n, e) {
155
- return {
156
- type: "component",
157
- render: () => {
158
- const r = q(n), s = $(() => {
159
- const i = r();
160
- return e(i);
161
- })().render();
162
- return Array.isArray(s) ? s : [s];
163
- },
164
- props: {},
165
- id: `consumer_${Date.now()}`
166
- };
167
- }
168
- class H {
169
- constructor() {
170
- m(this, "services", /* @__PURE__ */ new Map()), m(this, "factories", /* @__PURE__ */ new Map()), m(this, "singletons", /* @__PURE__ */ new Map()), m(this, "scoped", /* @__PURE__ */ new Map()), m(this, "dependencies", /* @__PURE__ */ new Map());
171
- }
172
- /**
173
- * Register a service with the container
174
- */
175
- register(e, r, t = {}) {
176
- this.services.set(e, r), t.dependencies && this.dependencies.set(e, t.dependencies), t.singleton && this.singletons.set(e, null), t.scoped && this.scoped.set(e, null);
177
- }
178
- /**
179
- * Resolve a service from the container
180
- */
181
- resolve(e) {
182
- if (this.singletons.has(e)) {
183
- let r = this.singletons.get(e);
184
- return r === null && (r = this.createInstance(e), this.singletons.set(e, r)), r;
185
- }
186
- if (this.scoped.has(e)) {
187
- let r = this.scoped.get(e);
188
- return r === null && (r = this.createInstance(e), this.scoped.set(e, r)), r;
189
- }
190
- return this.createInstance(e);
191
- }
192
- /**
193
- * Create instance with dependency injection
194
- */
195
- createInstance(e) {
196
- const t = (this.dependencies.get(e) || []).map((c) => this.resolve(c)), s = this.factories.get(e);
197
- if (s)
198
- return s(...t);
199
- const i = this.services.get(e);
200
- if (i) {
201
- if (typeof i == "function")
202
- try {
203
- return new i(...t);
204
- } catch {
205
- return i(...t);
206
- }
207
- return i;
208
- }
209
- throw new Error(`Service ${String(e)} not found in DI container`);
210
- }
211
- /**
212
- * Check if service is registered
213
- */
214
- has(e) {
215
- return this.services.has(e) || this.factories.has(e);
216
- }
217
- /**
218
- * Clear the container
219
- */
220
- clear() {
221
- this.services.clear(), this.factories.clear(), this.singletons.clear(), this.scoped.clear(), this.dependencies.clear();
222
- }
223
- /**
224
- * Get all registered services (for debugging)
225
- */
226
- getRegistered() {
227
- return [...this.services.keys(), ...this.factories.keys()];
228
- }
229
- }
230
- const D = new H();
231
- function te(n) {
232
- return D.resolve(n);
233
- }
234
- function ne(n) {
235
- return (e) => {
236
- const r = n || e.name;
237
- return D.register(r, e), e;
238
- };
239
- }
240
- const re = {
241
- /**
242
- * Create multiple contexts at once
243
- */
244
- createContextGroup(n, e = {}) {
245
- const r = {};
246
- for (const [t, s] of Object.entries(n))
247
- r[t] = E(s, {
248
- displayName: e.prefix ? `${e.prefix}.${t}` : t
249
- });
250
- return r;
251
- },
252
- /**
253
- * Combine multiple context providers
254
- */
255
- combineProviders(n, e, r) {
256
- const t = new A();
257
- let s = r;
258
- for (const [i, c] of Object.entries(n)) {
259
- const o = e[i];
260
- s = [t.createProvider(c, o, s)];
261
- }
262
- return s[0];
263
- },
264
- /**
265
- * Create context with validation
266
- */
267
- createValidatedContext(n, e, r = {}) {
268
- return {
269
- ...E(n, r),
270
- validate: e
271
- };
272
- }
273
- }, se = new A();
274
- function b(n, e) {
275
- n._enhancedLifecycle = {
276
- ...n._enhancedLifecycle,
277
- ...e
278
- };
279
- }
280
- function ie(n, e) {
281
- b(n, { onMount: e });
282
- }
283
- function C(n, e) {
284
- b(n, { onDOMReady: e });
285
- }
286
- function U(n, e) {
287
- b(n, { onUnmount: e });
288
- }
289
- function oe(n, e) {
290
- b(n, { onError: e });
291
- }
292
- function ae(n, e) {
293
- b(n, { onDOMError: e });
294
- }
295
- function ce(n, e) {
296
- return b(n, {
297
- onError: (r) => e(r),
298
- onDOMError: (r, t) => e(r, `DOM:${t}`)
299
- }), n;
300
- }
301
- function j(n, e) {
302
- C(n, (r, t) => {
303
- if (t)
304
- return e(t);
305
- });
306
- }
307
- function le(n, e, r) {
308
- j(n, (t) => {
309
- if (typeof e?.resolve == "function") {
310
- const s = e.resolve();
311
- r(t, s);
312
- }
313
- });
314
- }
315
- function ue(n, e) {
316
- console.warn("⚠️ setTimeout workaround detected. Consider migrating to onDOMReady."), C(n, () => {
317
- e();
318
- });
319
- }
320
- const de = {
321
- /**
322
- * Focus element when DOM is ready (replaces setTimeout focus hacks)
323
- */
324
- focusWhenReady(n, e, r) {
325
- C(n, (t, s) => {
326
- let i = null;
327
- r ? i = r : e ? i = s?.querySelector(e) || null : i = s || null, i instanceof HTMLElement && typeof i.focus == "function" && requestAnimationFrame(() => {
328
- try {
329
- i.focus();
330
- } catch (c) {
331
- console.warn("Focus failed:", c);
332
- }
333
- });
334
- });
335
- },
336
- /**
337
- * Focus first focusable element in component
338
- */
339
- focusFirstFocusable(n) {
340
- C(n, (e, r) => {
341
- if (r) {
342
- const t = r.querySelector(
343
- 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
344
- );
345
- t && this.focusWhenReady(n, void 0, t);
346
- }
347
- });
348
- }
349
- }, fe = {
350
- /**
351
- * Coordinate animations with DOM readiness
352
- */
353
- animateWhenReady(n, e) {
354
- C(n, (r, t) => {
355
- let s = null;
356
- e.element ? s = e.element : e.selector ? s = t?.querySelector(e.selector) || null : s = t || null, s && (e.setup(s), requestAnimationFrame(() => {
357
- e.animate(s);
358
- }));
359
- });
360
- },
361
- /**
362
- * Fade in animation (common pattern)
363
- */
364
- fadeIn(n, e, r = 300) {
365
- this.animateWhenReady(n, {
366
- element: e,
367
- setup: (t) => {
368
- const s = t;
369
- s.style.opacity = "0", s.style.transition = `opacity ${r}ms ease-out`;
370
- },
371
- animate: (t) => {
372
- const s = t;
373
- s.style.opacity = "1";
374
- }
375
- });
376
- },
377
- /**
378
- * Scale in animation (common for modals/alerts)
379
- */
380
- scaleIn(n, e, r = 300) {
381
- this.animateWhenReady(n, {
382
- element: e,
383
- setup: (t) => {
384
- const s = t;
385
- s.style.transform = "scale(0.8)", s.style.opacity = "0", s.style.transition = `all ${r}ms ease-out`;
386
- },
387
- animate: (t) => {
388
- const s = t;
389
- s.style.transform = "scale(1)", s.style.opacity = "1";
390
- }
391
- });
392
- }
393
- };
394
- function pe(n, e, r) {
395
- C(n, (t, s) => {
396
- const i = r ? s?.querySelector(r) : s;
397
- if (i) {
398
- const c = (o) => {
399
- i.contains(o.target) || e();
400
- };
401
- document.addEventListener("click", c), U(n, () => {
402
- document.removeEventListener("click", c);
403
- });
404
- }
405
- });
406
- }
407
- function he(n, e, r, t) {
408
- C(n, (s, i) => {
409
- const c = i?.querySelector(e), o = i?.querySelector(r);
410
- if (c && o) {
411
- const d = t(c, o), a = o;
412
- a.style.left = `${d.x}px`, a.style.top = `${d.y}px`;
413
- }
414
- });
415
- }
416
- var z = Object.defineProperty, B = (n, e, r) => e in n ? z(n, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : n[e] = r, v = (n, e, r) => B(n, typeof e != "symbol" ? e + "" : e, r);
417
- const w = {
418
- isEnabled: () => !1,
419
- logComponent: (...n) => {
420
- },
421
- addDebugAttributes: (...n) => {
422
- }
423
- };
424
- function Z(n) {
425
- return n && typeof n.concat == "function" && typeof n.toSegment == "function" && typeof n.isConcatenatable == "function";
426
- }
427
- function y(n) {
428
- const e = k(n), r = P(e), t = {
429
- ...e,
430
- modifier: r,
431
- modifierBuilder: r
432
- };
433
- return Z(n) && (t.concat = function(s) {
434
- return n.concat(s);
435
- }, t.toSegment = function() {
436
- return n.toSegment();
437
- }, t.isConcatenatable = function() {
438
- return n.isConcatenatable();
439
- }), t;
440
- }
441
- function me(n, e = {}) {
442
- const { enableModifiers: r = !0 } = e;
443
- return (t) => {
444
- const s = {
445
- type: "component",
446
- id: `wrapper-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
447
- props: t,
448
- mounted: !1,
449
- cleanup: [],
450
- render() {
451
- const i = n(t);
452
- return Array.isArray(i) ? i : [i];
453
- }
454
- };
455
- return y(s);
456
- };
457
- }
458
- class S extends L {
459
- constructor(e, r, t = [], s = {}) {
460
- super(), this.props = e, this.layoutType = r, this.children = t, this.layoutProps = s, v(this, "type", "component"), v(this, "id"), v(this, "mounted", !1), v(this, "cleanup", []), v(this, "effectiveTag"), v(this, "validationResult"), this.id = `layout-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
461
- const i = this.layoutType === "hstack" ? "HStack" : this.layoutType === "vstack" ? "VStack" : "ZStack", c = O(
462
- i,
463
- "div",
464
- this.props.element
465
- );
466
- this.effectiveTag = c.tag, this.validationResult = c.validation, b(this, {
467
- onDOMReady: (o, d) => {
468
- this.children.forEach((a, l) => {
469
- const f = a._enhancedLifecycle;
470
- if (f && f.onDOMReady && !a.domReady)
471
- try {
472
- if (d) {
473
- const u = this.findChildDOMElements(
474
- a,
475
- d,
476
- l
477
- );
478
- if (u.length > 0) {
479
- a.domElements = /* @__PURE__ */ new Map(), u.forEach((h, p) => {
480
- const g = h.id || `element-${p}`;
481
- a.domElements.set(g, h), a.primaryElement || (a.primaryElement = h);
482
- }), a.domReady = !0;
483
- const M = f.onDOMReady(
484
- a.domElements,
485
- a.primaryElement
486
- );
487
- if (typeof M == "function" && (a.cleanup = a.cleanup || [], a.cleanup.push(M)), f.onMount) {
488
- const h = f.onMount();
489
- typeof h == "function" && (a.cleanup = a.cleanup || [], a.cleanup.push(h));
490
- }
491
- }
492
- }
493
- } catch (u) {
494
- console.error(
495
- `Error processing lifecycle hooks for child ${a.id}:`,
496
- u
497
- );
498
- }
499
- });
500
- }
501
- }), F(this);
502
- }
503
- /**
504
- * Find DOM elements for a specific child component within the layout container
505
- */
506
- findChildDOMElements(e, r, t) {
507
- if (e.id.startsWith("image-")) {
508
- const i = r.querySelectorAll("img.tachui-image");
509
- return i[t] ? [i[t]] : Array.from(i);
510
- }
511
- if (e.id.startsWith("button-")) {
512
- const i = r.querySelectorAll("button.tachui-button");
513
- return i[t] ? [i[t]] : Array.from(i);
514
- }
515
- if (e.id.startsWith("text-")) {
516
- const i = r.querySelectorAll(
517
- "span.tachui-text, .tachui-text"
518
- );
519
- return i[t] ? [i[t]] : Array.from(i);
520
- }
521
- const s = Array.from(r.children);
522
- return s[t] ? [s[t]] : s;
523
- }
524
- render() {
525
- const { spacing: e = 0, debugLabel: r } = this.layoutProps, t = this.layoutProps.alignment !== void 0 ? this.layoutProps.alignment : "center";
526
- w.logComponent(this.layoutType.toUpperCase(), r);
527
- const s = [
528
- `tachui-${this.layoutType}`
529
- ], i = this.createClassString(this.props, s);
530
- switch (this.layoutType) {
531
- case "vstack": {
532
- const o = this.children.map((a) => {
533
- const l = a.render();
534
- return Array.isArray(l) ? l : [l];
535
- }).flat();
536
- return [{
537
- type: "element",
538
- tag: this.effectiveTag,
539
- props: {
540
- className: i,
541
- style: {
542
- display: "flex",
543
- flexDirection: "column",
544
- gap: e ? `${e}px` : "0",
545
- alignItems: t === "leading" ? "flex-start" : t === "trailing" ? "flex-end" : "center"
546
- },
547
- // Add debug attributes
548
- ...w.isEnabled()
549
- },
550
- children: o,
551
- // Add component metadata for semantic role processing
552
- componentMetadata: {
553
- originalType: "VStack",
554
- overriddenTo: this.effectiveTag !== "div" ? this.effectiveTag : void 0,
555
- validationResult: this.validationResult
556
- }
557
- }];
558
- }
559
- case "hstack": {
560
- const o = this.children.map((a) => {
561
- const l = a.render();
562
- return Array.isArray(l) ? l : [l];
563
- }).flat();
564
- return [{
565
- type: "element",
566
- tag: this.effectiveTag,
567
- props: {
568
- className: i,
569
- style: {
570
- display: "flex",
571
- flexDirection: "row",
572
- gap: e ? `${e}px` : "0",
573
- alignItems: t === "top" ? "flex-start" : t === "bottom" ? "flex-end" : "center"
574
- },
575
- // Add debug attributes
576
- ...w.isEnabled()
577
- },
578
- children: o,
579
- // Add component metadata for semantic role processing
580
- componentMetadata: {
581
- originalType: "HStack",
582
- overriddenTo: this.effectiveTag !== "div" ? this.effectiveTag : void 0,
583
- validationResult: this.validationResult
584
- }
585
- }];
586
- }
587
- case "zstack": {
588
- let c = -1 / 0, o = null;
589
- this.children.forEach((l) => {
590
- if ("modifiers" in l && Array.isArray(l.modifiers)) {
591
- const f = l.modifiers.find(
592
- (u) => u.type === "layout" && u.properties && "layoutPriority" in u.properties && typeof u.properties.layoutPriority == "number"
593
- );
594
- if (f) {
595
- const u = f.properties.layoutPriority;
596
- u > c && (c = u, o = l);
597
- }
598
- }
599
- });
600
- const d = I("div", {
601
- className: i,
602
- style: {
603
- position: "relative",
604
- display: "flex",
605
- justifyContent: t.includes("Leading") ? "flex-start" : t.includes("Trailing") ? "flex-end" : "center",
606
- alignItems: t.includes("top") ? "flex-start" : t.includes("bottom") ? "flex-end" : "center",
607
- // Container sizes to the highest priority child
608
- ...o ? {
609
- minWidth: "fit-content",
610
- minHeight: "fit-content"
611
- } : {}
612
- },
613
- // Add debug attributes
614
- ...w.isEnabled()
615
- }), a = this.children.flatMap((l, f) => {
616
- const u = l.render(), M = Array.isArray(u) ? u : [u];
617
- let h = f;
618
- if ("modifiers" in l && Array.isArray(l.modifiers)) {
619
- const p = l.modifiers.find(
620
- (g) => g.type === "layout" && g.properties && "layoutPriority" in g.properties
621
- );
622
- p && typeof p.properties.layoutPriority == "number" && (h = p.properties.layoutPriority);
623
- }
624
- return M.map((p) => {
625
- if (p.type === "element") {
626
- const g = l === o;
627
- return {
628
- ...p,
629
- props: {
630
- ...p.props,
631
- style: {
632
- ...p.props?.style,
633
- // Highest priority child determines container size
634
- ...g ? {
635
- position: "relative",
636
- zIndex: h
637
- } : {
638
- position: "absolute",
639
- top: 0,
640
- left: 0,
641
- right: 0,
642
- bottom: 0,
643
- zIndex: h
644
- }
645
- }
646
- }
647
- };
648
- }
649
- return p;
650
- });
651
- });
652
- return [
653
- {
654
- type: "element",
655
- tag: this.effectiveTag,
656
- props: {
657
- ...d.props,
658
- className: i
659
- },
660
- children: a,
661
- // Add component metadata for semantic role processing
662
- componentMetadata: {
663
- originalType: "ZStack",
664
- overriddenTo: this.effectiveTag !== "div" ? this.effectiveTag : void 0,
665
- validationResult: this.validationResult
666
- }
667
- }
668
- ];
669
- }
670
- default:
671
- return [
672
- {
673
- type: "element",
674
- tag: "div",
675
- props: {},
676
- children: []
677
- }
678
- ];
679
- }
680
- }
681
- }
682
- const ye = {
683
- /**
684
- * Vertical stack container (flexbox column)
685
- */
686
- VStack: (n = {}) => {
687
- const { children: e = [], spacing: r = 0, alignment: t = "center" } = n, s = new S(n, "vstack", e, {
688
- spacing: r,
689
- alignment: t
690
- });
691
- return y(s);
692
- },
693
- /**
694
- * Horizontal stack container (flexbox row)
695
- */
696
- HStack: (n = {}) => {
697
- const { children: e = [], spacing: r = 0, alignment: t = "center" } = n, s = new S(n, "hstack", e, {
698
- spacing: r,
699
- alignment: t
700
- });
701
- return y(s);
702
- },
703
- /**
704
- * Z-index stack container (absolute positioning)
705
- */
706
- ZStack: (n = {}) => {
707
- const { children: e = [], alignment: r = "center" } = n, t = new S(n, "zstack", e, {
708
- alignment: r
709
- });
710
- return y(t);
711
- }
712
- };
713
- function ge(n) {
714
- return y(n);
715
- }
716
- function ve(n) {
717
- return class extends n {
718
- constructor(e) {
719
- super(e), v(this, "_modifiableComponent"), this._modifiableComponent = y(this);
720
- }
721
- get modifier() {
722
- return P(this._modifiableComponent);
723
- }
724
- get modifiers() {
725
- return this._modifiableComponent.modifiers;
726
- }
727
- };
728
- }
729
- function Ce(n) {
730
- return (e) => {
731
- const r = {
732
- type: "component",
733
- id: `factory-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
734
- props: e,
735
- mounted: !1,
736
- cleanup: [],
737
- render() {
738
- const t = n(e);
739
- return Array.isArray(t) ? t : [t];
740
- }
741
- };
742
- return y(r);
743
- };
744
- }
745
- export {
746
- fe as A,
747
- A as C,
748
- H as D,
749
- de as F,
750
- ne as I,
751
- ye as L,
752
- me as a,
753
- y as b,
754
- Ce as c,
755
- ge as d,
756
- re as e,
757
- E as f,
758
- ee as g,
759
- se as h,
760
- D as i,
761
- te as j,
762
- Y as k,
763
- C as l,
764
- ue as m,
765
- oe as n,
766
- ae as o,
767
- ie as p,
768
- U as q,
769
- he as r,
770
- pe as s,
771
- b as t,
772
- q as u,
773
- j as v,
774
- ve as w,
775
- ce as x,
776
- le as y
777
- };