@tachui/core 0.8.22 → 0.8.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/assets/FontAsset.d.ts.map +1 -1
  2. package/dist/assets/index.js +42 -41
  3. package/dist/{binding-DCV5PKkK.js → binding-DCr-JHsC.js} +9 -9
  4. package/dist/build-tools/typegen-runner.d.ts +4 -0
  5. package/dist/build-tools/typegen-runner.d.ts.map +1 -1
  6. package/dist/cleanup-BR8UpYPX.js +61 -0
  7. package/dist/common.js +272 -277
  8. package/dist/{component-D-O9yq0P.js → component-BzvSm8rM.js} +19 -19
  9. package/dist/{component-base-C41K3NTe.js → component-base-Do2EdQkr.js} +32 -33
  10. package/dist/{component-context-B9HI2nZH.js → component-context-C7Y6Xu6h.js} +1 -1
  11. package/dist/components/index.js +1 -1
  12. package/dist/computed-CA4Cgtoe.js +407 -0
  13. package/dist/{concatenated-component-2Gzy5e2c.js → concatenated-component-CA54ng_j.js} +43 -44
  14. package/dist/css-classes/index.js +2 -2
  15. package/dist/{effect-BsW3fy1q.js → effect-DgNm6jk9.js} +3 -3
  16. package/dist/{enhanced-renderer-t9Ni2EEG.js → enhanced-renderer-D05CCloF.js} +26 -28
  17. package/dist/essential.js +276 -281
  18. package/dist/factories-B05hE6kc.js +644 -0
  19. package/dist/{factory-gqfMcmOy.js → factory-B1YXfgU1.js} +23 -29
  20. package/dist/full.d.ts +12 -0
  21. package/dist/full.d.ts.map +1 -0
  22. package/dist/full.js +436 -0
  23. package/dist/gradients/index.js +53 -53
  24. package/dist/hooks-w_FYPLjI.js +158 -0
  25. package/dist/{index-DL9Cys3t.js → index-CmQmIgPK.js} +220 -233
  26. package/dist/index.d.ts +0 -1
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +295 -300
  29. package/dist/minimal-prod.js +106 -108
  30. package/dist/minimal.js +97 -98
  31. package/dist/modifiers/base.d.ts.map +1 -1
  32. package/dist/modifiers/base.js +121 -120
  33. package/dist/modifiers/builder.js +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,446 +0,0 @@
1
- import "./scheduler-DppMK9mR.js";
2
- import { c as g, a as x } from "./theme-CRLPHryV.js";
3
- import "@tachui/types/reactive";
4
- import { b } from "./component-context-B9HI2nZH.js";
5
- var w = Object.defineProperty, M = (s, e, t) => e in s ? w(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, c = (s, e, t) => M(s, typeof e != "symbol" ? e + "" : e, t);
6
- const v = class f {
7
- constructor() {
8
- c(this, "contexts", /* @__PURE__ */ new Map()), c(this, "providerStack", /* @__PURE__ */ new Map()), c(this, "currentComponent", null);
9
- }
10
- static getInstance() {
11
- return f.instance || (f.instance = new f()), f.instance;
12
- }
13
- /**
14
- * Set the current component context for provider resolution
15
- */
16
- setCurrentComponent(e) {
17
- this.currentComponent = e;
18
- }
19
- /**
20
- * Get the current component context
21
- */
22
- getCurrentComponent() {
23
- return this.currentComponent;
24
- }
25
- /**
26
- * Register a context provider
27
- */
28
- registerProvider(e, t, n) {
29
- this.providerStack.has(e) || this.providerStack.set(e, []);
30
- const r = this.providerStack.get(e), [o, i] = g(t), a = {
31
- value: t,
32
- signal: [o, i],
33
- subscribers: /* @__PURE__ */ new Set(),
34
- providers: /* @__PURE__ */ new Set([n])
35
- };
36
- return r.push(a), n.providers.set(e, a), () => {
37
- const l = r.indexOf(a);
38
- l !== -1 && r.splice(l, 1), n.providers.delete(e), a.subscribers.clear(), a.providers.clear();
39
- };
40
- }
41
- /**
42
- * Get context value with reactive subscription
43
- */
44
- getContextValue(e, t) {
45
- const n = this.providerStack.get(e), r = n && n.length > 0 ? n[n.length - 1] : null;
46
- if (r)
47
- return this.currentComponent && (r.subscribers.add(this.currentComponent.id), this.currentComponent.consumers.add(e)), [r.signal[0], !0];
48
- const [o] = g(t);
49
- return [o, !1];
50
- }
51
- /**
52
- * Update context value and notify subscribers
53
- */
54
- updateContextValue(e, t) {
55
- const n = this.providerStack.get(e), r = n && n.length > 0 ? n[n.length - 1] : null;
56
- return r ? (r.value = t, r.signal[1](t), !0) : !1;
57
- }
58
- /**
59
- * Get all registered contexts (for debugging)
60
- */
61
- getAllContexts() {
62
- const e = /* @__PURE__ */ new Map();
63
- for (const [t, n] of this.providerStack.entries())
64
- n.length > 0 && e.set(t, n[n.length - 1]);
65
- return e;
66
- }
67
- /**
68
- * Clear all contexts (for testing)
69
- */
70
- clear() {
71
- this.contexts.clear(), this.providerStack.clear(), this.currentComponent = null;
72
- }
73
- };
74
- c(v, "instance");
75
- let y = v;
76
- class p {
77
- constructor() {
78
- c(this, "registry", y.getInstance());
79
- }
80
- /**
81
- * Create a context provider component
82
- */
83
- createProvider(e, t, n) {
84
- return {
85
- type: "component",
86
- render: () => {
87
- const r = this.registry.registerProvider(
88
- e.symbol,
89
- t,
90
- b(`provider_${e.symbol.toString()}`)
91
- ), o = n.flatMap((i) => {
92
- let a = i;
93
- "build" in i && typeof i.build == "function" && (a = i.build());
94
- const l = a.render();
95
- return Array.isArray(l) ? l : [l];
96
- });
97
- return [
98
- {
99
- type: "element",
100
- tag: "div",
101
- props: { "data-context-provider": e.displayName || "provider" },
102
- children: o,
103
- dispose: r
104
- }
105
- ];
106
- },
107
- props: { children: n },
108
- id: `provider_${Date.now()}`,
109
- children: n
110
- };
111
- }
112
- /**
113
- * Set current component for context resolution
114
- */
115
- setCurrentComponent(e) {
116
- this.registry.setCurrentComponent(e);
117
- }
118
- /**
119
- * Update a context value
120
- */
121
- updateContext(e, t) {
122
- return this.registry.updateContextValue(e.symbol, t);
123
- }
124
- /**
125
- * Get all active contexts (for debugging)
126
- */
127
- getAllContexts() {
128
- return this.registry.getAllContexts();
129
- }
130
- /**
131
- * Clear all contexts
132
- */
133
- clear() {
134
- this.registry.clear();
135
- }
136
- }
137
- function m(s, e = {}) {
138
- return {
139
- symbol: Symbol(e.displayName || "TachUIContext"),
140
- defaultValue: s,
141
- displayName: e.displayName
142
- };
143
- }
144
- function S(s) {
145
- const e = y.getInstance(), [t, n] = e.getContextValue(s.symbol, s.defaultValue);
146
- return n || console.warn(
147
- `Context ${s.displayName || "unnamed"} used without a Provider. Using default value.`
148
- ), t;
149
- }
150
- function E(s, e) {
151
- return (t) => function(r) {
152
- return new p().createProvider(s, e, [t(r)]);
153
- };
154
- }
155
- function V(s, e) {
156
- return {
157
- type: "component",
158
- render: () => {
159
- const t = S(s);
160
- let r = x(() => {
161
- const i = t();
162
- return e(i);
163
- })();
164
- "build" in r && typeof r.build == "function" && (r = r.build());
165
- const o = r.render();
166
- return Array.isArray(o) ? o : [o];
167
- },
168
- props: {},
169
- id: `consumer_${Date.now()}`
170
- };
171
- }
172
- class I {
173
- constructor() {
174
- c(this, "services", /* @__PURE__ */ new Map()), c(this, "factories", /* @__PURE__ */ new Map()), c(this, "singletons", /* @__PURE__ */ new Map()), c(this, "scoped", /* @__PURE__ */ new Map()), c(this, "dependencies", /* @__PURE__ */ new Map());
175
- }
176
- /**
177
- * Register a service with the container
178
- */
179
- register(e, t, n = {}) {
180
- this.services.set(e, t), n.dependencies && this.dependencies.set(e, n.dependencies), n.singleton && this.singletons.set(e, null), n.scoped && this.scoped.set(e, null);
181
- }
182
- /**
183
- * Resolve a service from the container
184
- */
185
- resolve(e) {
186
- if (this.singletons.has(e)) {
187
- let t = this.singletons.get(e);
188
- return t === null && (t = this.createInstance(e), this.singletons.set(e, t)), t;
189
- }
190
- if (this.scoped.has(e)) {
191
- let t = this.scoped.get(e);
192
- return t === null && (t = this.createInstance(e), this.scoped.set(e, t)), t;
193
- }
194
- return this.createInstance(e);
195
- }
196
- /**
197
- * Create instance with dependency injection
198
- */
199
- createInstance(e) {
200
- const n = (this.dependencies.get(e) || []).map((i) => this.resolve(i)), r = this.factories.get(e);
201
- if (r)
202
- return r(...n);
203
- const o = this.services.get(e);
204
- if (o) {
205
- if (typeof o == "function")
206
- try {
207
- return new o(...n);
208
- } catch {
209
- return o(...n);
210
- }
211
- return o;
212
- }
213
- throw new Error(`Service ${String(e)} not found in DI container`);
214
- }
215
- /**
216
- * Check if service is registered
217
- */
218
- has(e) {
219
- return this.services.has(e) || this.factories.has(e);
220
- }
221
- /**
222
- * Clear the container
223
- */
224
- clear() {
225
- this.services.clear(), this.factories.clear(), this.singletons.clear(), this.scoped.clear(), this.dependencies.clear();
226
- }
227
- /**
228
- * Get all registered services (for debugging)
229
- */
230
- getRegistered() {
231
- return [...this.services.keys(), ...this.factories.keys()];
232
- }
233
- }
234
- const C = new I();
235
- function $(s) {
236
- return C.resolve(s);
237
- }
238
- function q(s) {
239
- return (e) => {
240
- const t = s || e.name;
241
- return C.register(t, e), e;
242
- };
243
- }
244
- const F = {
245
- /**
246
- * Create multiple contexts at once
247
- */
248
- createContextGroup(s, e = {}) {
249
- const t = {};
250
- for (const [n, r] of Object.entries(s))
251
- t[n] = m(r, {
252
- displayName: e.prefix ? `${e.prefix}.${n}` : n
253
- });
254
- return t;
255
- },
256
- /**
257
- * Combine multiple context providers
258
- */
259
- combineProviders(s, e, t) {
260
- const n = new p();
261
- let r = t;
262
- for (const [o, i] of Object.entries(s)) {
263
- const a = e[o];
264
- r = [n.createProvider(i, a, r)];
265
- }
266
- return r[0];
267
- },
268
- /**
269
- * Create context with validation
270
- */
271
- createValidatedContext(s, e, t = {}) {
272
- return {
273
- ...m(s, t),
274
- validate: e
275
- };
276
- }
277
- }, N = new p();
278
- function d(s, e) {
279
- s._enhancedLifecycle = {
280
- ...s._enhancedLifecycle,
281
- ...e
282
- };
283
- }
284
- function L(s, e) {
285
- d(s, { onMount: e });
286
- }
287
- function u(s, e) {
288
- d(s, { onDOMReady: e });
289
- }
290
- function D(s, e) {
291
- d(s, { onUnmount: e });
292
- }
293
- function T(s, e) {
294
- d(s, { onError: e });
295
- }
296
- function W(s, e) {
297
- d(s, { onDOMError: e });
298
- }
299
- function U(s, e) {
300
- return d(s, {
301
- onError: (t) => e(t),
302
- onDOMError: (t, n) => e(t, `DOM:${n}`)
303
- }), s;
304
- }
305
- function _(s, e) {
306
- u(s, (t, n) => {
307
- if (n)
308
- return e(n);
309
- });
310
- }
311
- function j(s, e, t) {
312
- _(s, (n) => {
313
- if (typeof e?.resolve == "function") {
314
- const r = e.resolve();
315
- t(n, r);
316
- }
317
- });
318
- }
319
- function k(s, e) {
320
- console.warn("⚠️ setTimeout workaround detected. Consider migrating to onDOMReady."), u(s, () => {
321
- e();
322
- });
323
- }
324
- const B = {
325
- /**
326
- * Focus element when DOM is ready (replaces setTimeout focus hacks)
327
- */
328
- focusWhenReady(s, e, t) {
329
- u(s, (n, r) => {
330
- let o = null;
331
- t ? o = t : e ? o = r?.querySelector(e) || null : o = r || null, o instanceof HTMLElement && typeof o.focus == "function" && requestAnimationFrame(() => {
332
- try {
333
- o.focus();
334
- } catch (i) {
335
- console.warn("Focus failed:", i);
336
- }
337
- });
338
- });
339
- },
340
- /**
341
- * Focus first focusable element in component
342
- */
343
- focusFirstFocusable(s) {
344
- u(s, (e, t) => {
345
- if (t) {
346
- const n = t.querySelector(
347
- 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
348
- );
349
- n && this.focusWhenReady(s, void 0, n);
350
- }
351
- });
352
- }
353
- }, G = {
354
- /**
355
- * Coordinate animations with DOM readiness
356
- */
357
- animateWhenReady(s, e) {
358
- u(s, (t, n) => {
359
- let r = null;
360
- e.element ? r = e.element : e.selector ? r = n?.querySelector(e.selector) || null : r = n || null, r && (e.setup(r), requestAnimationFrame(() => {
361
- e.animate(r);
362
- }));
363
- });
364
- },
365
- /**
366
- * Fade in animation (common pattern)
367
- */
368
- fadeIn(s, e, t = 300) {
369
- this.animateWhenReady(s, {
370
- element: e,
371
- setup: (n) => {
372
- const r = n;
373
- r.style.opacity = "0", r.style.transition = `opacity ${t}ms ease-out`;
374
- },
375
- animate: (n) => {
376
- const r = n;
377
- r.style.opacity = "1";
378
- }
379
- });
380
- },
381
- /**
382
- * Scale in animation (common for modals/alerts)
383
- */
384
- scaleIn(s, e, t = 300) {
385
- this.animateWhenReady(s, {
386
- element: e,
387
- setup: (n) => {
388
- const r = n;
389
- r.style.transform = "scale(0.8)", r.style.opacity = "0", r.style.transition = `all ${t}ms ease-out`;
390
- },
391
- animate: (n) => {
392
- const r = n;
393
- r.style.transform = "scale(1)", r.style.opacity = "1";
394
- }
395
- });
396
- }
397
- };
398
- function K(s, e, t) {
399
- u(s, (n, r) => {
400
- const o = t ? r?.querySelector(t) : r;
401
- if (o) {
402
- const i = (a) => {
403
- o.contains(a.target) || e();
404
- };
405
- document.addEventListener("click", i), D(s, () => {
406
- document.removeEventListener("click", i);
407
- });
408
- }
409
- });
410
- }
411
- function z(s, e, t, n) {
412
- u(s, (r, o) => {
413
- const i = o?.querySelector(e), a = o?.querySelector(t);
414
- if (i && a) {
415
- const l = n(i, a), h = a;
416
- h.style.left = `${l.x}px`, h.style.top = `${l.y}px`;
417
- }
418
- });
419
- }
420
- export {
421
- G as A,
422
- p as C,
423
- I as D,
424
- B as F,
425
- q as I,
426
- m as a,
427
- V as b,
428
- F as c,
429
- N as d,
430
- u as e,
431
- T as f,
432
- C as g,
433
- L as h,
434
- $ as i,
435
- D as j,
436
- z as k,
437
- d as l,
438
- k as m,
439
- _ as n,
440
- W as o,
441
- U as p,
442
- j as q,
443
- K as s,
444
- S as u,
445
- E as w
446
- };
@@ -1,21 +0,0 @@
1
- class a {
2
- // Placeholder implementation
3
- }
4
- function o() {
5
- }
6
- function u() {
7
- }
8
- function s() {
9
- }
10
- function t() {
11
- }
12
- function c() {
13
- }
14
- export {
15
- a as L,
16
- s as a,
17
- t as b,
18
- c as l,
19
- o as m,
20
- u
21
- };