@tachui/core 0.8.0-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 (176) hide show
  1. package/README.md +58 -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/assets.d.ts +19 -0
  17. package/dist/bundles/assets.d.ts.map +1 -0
  18. package/dist/bundles/context.d.ts +22 -0
  19. package/dist/bundles/context.d.ts.map +1 -0
  20. package/dist/bundles/minimal.d.ts +8 -2
  21. package/dist/bundles/minimal.d.ts.map +1 -1
  22. package/dist/common.js +427 -393
  23. package/dist/compiler/codegen.d.ts.map +1 -1
  24. package/dist/compiler/index.js +6 -1393
  25. package/dist/compiler/parser.d.ts +1 -1
  26. package/dist/compiler/parser.d.ts.map +1 -1
  27. package/dist/compiler/plugin.d.ts.map +1 -1
  28. package/dist/compiler/types.d.ts +28 -0
  29. package/dist/compiler/types.d.ts.map +1 -1
  30. package/dist/{component-XAzF1xqs.js → component-CECyfUOE.js} +80 -68
  31. package/dist/{component-base-x2XmHFjy.js → component-base-CJ__jTlr.js} +9 -7
  32. package/dist/component-context-B6qX_Qsg.js +176 -0
  33. package/dist/components/factory.d.ts +24 -0
  34. package/dist/components/factory.d.ts.map +1 -0
  35. package/dist/components/index.d.ts +3 -2
  36. package/dist/components/index.d.ts.map +1 -1
  37. package/dist/components/index.js +8 -6
  38. package/dist/components/wrapper.d.ts +70 -30
  39. package/dist/components/wrapper.d.ts.map +1 -1
  40. package/dist/concatenated-component-_tF1eMvy.js +2288 -0
  41. package/dist/concatenation/concatenated-component.d.ts +16 -2
  42. package/dist/concatenation/concatenated-component.d.ts.map +1 -1
  43. package/dist/concatenation/text-optimizer.d.ts.map +1 -1
  44. package/dist/config.d.ts +7 -0
  45. package/dist/config.d.ts.map +1 -0
  46. package/dist/constants/layout.d.ts +2 -9
  47. package/dist/constants/layout.d.ts.map +1 -1
  48. package/dist/css-classes/index.js +15 -173
  49. package/dist/{effect-B9Knft0b.js → effect-DGmdACI2.js} +3 -3
  50. package/dist/enhanced-renderer-Bwqsh8Ku.js +172 -0
  51. package/dist/essential.js +425 -391
  52. package/dist/{index-DIvMCJQO.js → factories-Co2Lv2kJ.js} +13 -13
  53. package/dist/factory-D7jAY5Kn.js +485 -0
  54. package/dist/gradients/css-generator.js +99 -0
  55. package/dist/gradients/index.js +56 -0
  56. package/dist/gradients/reactive.d.ts.map +1 -1
  57. package/dist/gradients/types.d.ts +3 -91
  58. package/dist/gradients/types.d.ts.map +1 -1
  59. package/dist/hooks-DeLasj54.js +446 -0
  60. package/dist/index-JQ1sW1SK.js +2049 -0
  61. package/dist/index-X8MVY78C.js +618 -0
  62. package/dist/index.d.ts +8 -1
  63. package/dist/index.d.ts.map +1 -1
  64. package/dist/index.js +426 -392
  65. package/dist/minimal-prod.js +94 -93
  66. package/dist/minimal.js +126 -106
  67. package/dist/modifiers/alignment.d.ts +5 -0
  68. package/dist/modifiers/alignment.d.ts.map +1 -0
  69. package/dist/modifiers/base.d.ts +6 -7
  70. package/dist/modifiers/base.d.ts.map +1 -1
  71. package/dist/modifiers/base.js +24 -16
  72. package/dist/modifiers/builder.d.ts +28 -165
  73. package/dist/modifiers/builder.d.ts.map +1 -1
  74. package/dist/modifiers/builder.js +7 -7
  75. package/dist/modifiers/core.d.ts +0 -1
  76. package/dist/modifiers/core.d.ts.map +1 -1
  77. package/dist/modifiers/corner-radius.d.ts +8 -0
  78. package/dist/modifiers/corner-radius.d.ts.map +1 -0
  79. package/dist/modifiers/index.d.ts +9 -6
  80. package/dist/modifiers/index.d.ts.map +1 -1
  81. package/dist/modifiers/index.js +36 -30
  82. package/dist/modifiers/layout-priority.d.ts +8 -0
  83. package/dist/modifiers/layout-priority.d.ts.map +1 -0
  84. package/dist/modifiers/opacity.d.ts +8 -0
  85. package/dist/modifiers/opacity.d.ts.map +1 -0
  86. package/dist/modifiers/presets.d.ts.map +1 -1
  87. package/dist/modifiers/proxy.d.ts +4 -0
  88. package/dist/modifiers/proxy.d.ts.map +1 -0
  89. package/dist/modifiers/registration-utils.d.ts +7 -0
  90. package/dist/modifiers/registration-utils.d.ts.map +1 -0
  91. package/dist/modifiers/registry.d.ts +18 -9
  92. package/dist/modifiers/registry.d.ts.map +1 -1
  93. package/dist/modifiers/registry.js +2 -2
  94. package/dist/modifiers/type-generator.d.ts +82 -0
  95. package/dist/modifiers/type-generator.d.ts.map +1 -0
  96. package/dist/modifiers/types.d.ts +2 -479
  97. package/dist/modifiers/types.d.ts.map +1 -1
  98. package/dist/modifiers/types.js +1 -4
  99. package/dist/observed-object-DepiqSgg.js +269 -0
  100. package/dist/optimization-CbKNA9w4.js +21 -0
  101. package/dist/plugin-BCAdZXKq.js +1680 -0
  102. package/dist/plugins/index.js +28 -8
  103. package/dist/plugins/simplified-lazy-loader.d.ts.map +1 -1
  104. package/dist/presets-B9x94uRn.js +381 -0
  105. package/dist/proxy-Cqmbiyx0.js +175 -0
  106. package/dist/reactive/cleanup.d.ts.map +1 -1
  107. package/dist/reactive/computed.d.ts +1 -1
  108. package/dist/reactive/computed.d.ts.map +1 -1
  109. package/dist/reactive/context.d.ts +4 -3
  110. package/dist/reactive/context.d.ts.map +1 -1
  111. package/dist/reactive/index.d.ts +1 -0
  112. package/dist/reactive/index.d.ts.map +1 -1
  113. package/dist/reactive/index.js +84 -490
  114. package/dist/reactive/signal-list.d.ts +100 -0
  115. package/dist/reactive/signal-list.d.ts.map +1 -0
  116. package/dist/reactive/signal.d.ts.map +1 -1
  117. package/dist/reactive/types.d.ts +2 -89
  118. package/dist/reactive/types.d.ts.map +1 -1
  119. package/dist/reactive/types.js +1 -4
  120. package/dist/registration-utils-CNsN4eoU.js +27 -0
  121. package/dist/runtime/component.d.ts.map +1 -1
  122. package/dist/runtime/concatenation-aria.d.ts +24 -0
  123. package/dist/runtime/concatenation-aria.d.ts.map +1 -0
  124. package/dist/runtime/concatenation-aria.js +58 -0
  125. package/dist/runtime/concatenation-full.d.ts +30 -0
  126. package/dist/runtime/concatenation-full.d.ts.map +1 -0
  127. package/dist/runtime/concatenation-full.js +85 -0
  128. package/dist/runtime/concatenation-minimal.d.ts +25 -0
  129. package/dist/runtime/concatenation-minimal.d.ts.map +1 -0
  130. package/dist/runtime/concatenation-minimal.js +45 -0
  131. package/dist/runtime/context.d.ts.map +1 -1
  132. package/dist/runtime/dom-bridge.d.ts +1 -1
  133. package/dist/runtime/dom-bridge.d.ts.map +1 -1
  134. package/dist/runtime/dom-bridge.js +239 -12
  135. package/dist/runtime/event-delegation.d.ts +59 -0
  136. package/dist/runtime/event-delegation.d.ts.map +1 -0
  137. package/dist/runtime/index.d.ts +3 -1
  138. package/dist/runtime/index.d.ts.map +1 -1
  139. package/dist/runtime/index.js +96 -0
  140. package/dist/runtime/layout-scheduler.d.ts +89 -0
  141. package/dist/runtime/layout-scheduler.d.ts.map +1 -0
  142. package/dist/runtime/props.d.ts.map +1 -1
  143. package/dist/runtime/renderer.d.ts +54 -2
  144. package/dist/runtime/renderer.d.ts.map +1 -1
  145. package/dist/runtime/renderer.js +11 -7
  146. package/dist/runtime/semantic-role-manager.d.ts.map +1 -1
  147. package/dist/runtime/types.d.ts +2 -226
  148. package/dist/runtime/types.d.ts.map +1 -1
  149. package/dist/runtime/types.js +1 -1
  150. package/dist/scheduler-DI_8ykMk.js +169 -0
  151. package/dist/signal-list-BdpxSodS.js +525 -0
  152. package/dist/state/index.js +319 -0
  153. package/dist/theme-BFaKUcjZ.js +677 -0
  154. package/dist/utils/clone-helpers.d.ts +11 -0
  155. package/dist/utils/clone-helpers.d.ts.map +1 -0
  156. package/dist/validation/index.js +28 -26
  157. package/dist/version.d.ts +19 -0
  158. package/dist/version.d.ts.map +1 -0
  159. package/dist/version.js +6 -0
  160. package/package.json +69 -9
  161. package/dist/concatenated-component-ByPl3_FF.js +0 -2933
  162. package/dist/dom-bridge-CAa1N2zX.js +0 -406
  163. package/dist/index-DCPJFUm9.js +0 -1407
  164. package/dist/index-vdsiw6gQ.js +0 -777
  165. package/dist/modifiers/as-html-validator.d.ts +0 -20
  166. package/dist/modifiers/as-html-validator.d.ts.map +0 -1
  167. package/dist/modifiers/as-html.d.ts +0 -65
  168. package/dist/modifiers/as-html.d.ts.map +0 -1
  169. package/dist/modifiers/background.d.ts +0 -51
  170. package/dist/modifiers/background.d.ts.map +0 -1
  171. package/dist/modifiers/basic-sanitizer.d.ts +0 -54
  172. package/dist/modifiers/basic-sanitizer.d.ts.map +0 -1
  173. package/dist/modifiers/css.d.ts +0 -86
  174. package/dist/modifiers/css.d.ts.map +0 -1
  175. package/dist/production-minimal-BY_gMc-l.js +0 -2532
  176. package/dist/scheduler-BKeqwrYE.js +0 -814
@@ -0,0 +1,618 @@
1
+ import { infinity as c } from "./constants/layout.js";
2
+ import { LayoutModifier as m } from "./modifiers/base.js";
3
+ import { y as h, t as T, h as w } from "./concatenated-component-_tF1eMvy.js";
4
+ import { g as z, a as E } from "./proxy-Cqmbiyx0.js";
5
+ import "./assets/index.js";
6
+ import "./scheduler-DI_8ykMk.js";
7
+ import "./theme-BFaKUcjZ.js";
8
+ import "@tachui/types/reactive";
9
+ import "@tachui/types/modifiers";
10
+ import "typescript";
11
+ import "@tachui/registry";
12
+ import "./presets-B9x94uRn.js";
13
+ import "./component-CECyfUOE.js";
14
+ import "./hooks-DeLasj54.js";
15
+ import "./runtime/dom-bridge.js";
16
+ import "./component-base-CJ__jTlr.js";
17
+ import "@tachui/types/gradients";
18
+ import "./index-JQ1sW1SK.js";
19
+ import "./plugins/index.js";
20
+ import "./state/index.js";
21
+ import "./validation/index.js";
22
+ function X() {
23
+ return new m({
24
+ frame: {
25
+ maxWidth: c
26
+ }
27
+ });
28
+ }
29
+ function Y() {
30
+ return new m({
31
+ frame: {
32
+ maxHeight: c
33
+ }
34
+ });
35
+ }
36
+ function Z() {
37
+ return new m({
38
+ frame: {
39
+ maxWidth: c,
40
+ maxHeight: c
41
+ }
42
+ });
43
+ }
44
+ function Q() {
45
+ return new m({
46
+ frame: {
47
+ width: c,
48
+ height: c
49
+ }
50
+ });
51
+ }
52
+ function ee(o) {
53
+ return new m({
54
+ frame: {
55
+ width: o,
56
+ maxHeight: c
57
+ }
58
+ });
59
+ }
60
+ function te(o) {
61
+ return new m({
62
+ frame: {
63
+ height: o,
64
+ maxWidth: c
65
+ }
66
+ });
67
+ }
68
+ function ne(o, e) {
69
+ return new m({
70
+ frame: {
71
+ width: c,
72
+ height: c,
73
+ maxWidth: o,
74
+ maxHeight: e
75
+ }
76
+ });
77
+ }
78
+ function re(o, e, t, n) {
79
+ return new m({
80
+ frame: {
81
+ width: c,
82
+ height: c,
83
+ minWidth: o,
84
+ maxWidth: e,
85
+ minHeight: t,
86
+ maxHeight: n
87
+ }
88
+ });
89
+ }
90
+ function oe() {
91
+ return new m({
92
+ frame: {
93
+ maxWidth: c,
94
+ maxHeight: c
95
+ }
96
+ });
97
+ }
98
+ function ie() {
99
+ return new m({
100
+ frame: {
101
+ width: "100vw",
102
+ height: "100vh"
103
+ }
104
+ });
105
+ }
106
+ function ae() {
107
+ return new m({
108
+ frame: {
109
+ width: c,
110
+ height: c
111
+ }
112
+ });
113
+ }
114
+ function ce() {
115
+ return new m({
116
+ frame: {
117
+ width: c
118
+ }
119
+ });
120
+ }
121
+ const se = Symbol.for("tachui.concat");
122
+ function me(o) {
123
+ return o && typeof o == "object" && typeof o.isConcatenatable == "function" && o.isConcatenatable();
124
+ }
125
+ function ue(o) {
126
+ return o && typeof o == "object" && o.constructor.name === "ConcatenatedComponent";
127
+ }
128
+ const le = Symbol.for("tachui.concat");
129
+ class pe {
130
+ /**
131
+ * Concatenate this component with another concatenatable component
132
+ */
133
+ concat(e) {
134
+ const t = this.toSegment(), n = e.toSegment();
135
+ return e instanceof h ? new h(
136
+ [t, ...e.segments],
137
+ this.mergeMetadata(e.metadata, e.segments.length + 1)
138
+ ) : new h(
139
+ [t, n],
140
+ this.createMetadata(2)
141
+ );
142
+ }
143
+ /**
144
+ * Check if this component supports concatenation
145
+ */
146
+ isConcatenatable() {
147
+ return !0;
148
+ }
149
+ /**
150
+ * Create metadata for a new concatenated component
151
+ */
152
+ createMetadata(e) {
153
+ return {
154
+ totalSegments: e,
155
+ accessibilityRole: this.determineAccessibilityRole(),
156
+ semanticStructure: this.determineSemanticStructure()
157
+ };
158
+ }
159
+ /**
160
+ * Merge metadata when concatenating with existing concatenated component
161
+ */
162
+ mergeMetadata(e, t) {
163
+ return {
164
+ totalSegments: t,
165
+ accessibilityRole: this.mergeAccessibilityRoles(e.accessibilityRole),
166
+ semanticStructure: this.mergeSemanticStructures(e.semanticStructure)
167
+ };
168
+ }
169
+ /**
170
+ * Determine the accessibility role for this component
171
+ */
172
+ determineAccessibilityRole() {
173
+ const e = this.constructor.name;
174
+ return e === "EnhancedText" ? "text" : e === "EnhancedImage" || e === "EnhancedButton" || e === "EnhancedLink" ? "group" : "composite";
175
+ }
176
+ /**
177
+ * Determine the semantic structure for this component
178
+ */
179
+ determineSemanticStructure() {
180
+ const e = this.constructor.name;
181
+ return e === "EnhancedText" || e === "EnhancedImage" ? "inline" : "mixed";
182
+ }
183
+ /**
184
+ * Merge accessibility roles when combining components
185
+ */
186
+ mergeAccessibilityRoles(e) {
187
+ const t = this.determineAccessibilityRole();
188
+ return t === "text" && e === "text" ? "text" : t === "composite" || e === "composite" ? "composite" : "group";
189
+ }
190
+ /**
191
+ * Merge semantic structures when combining components
192
+ */
193
+ mergeSemanticStructures(e) {
194
+ const t = this.determineSemanticStructure();
195
+ return t === "inline" && e === "inline" ? "inline" : t === "block" && e === "block" ? "block" : "mixed";
196
+ }
197
+ }
198
+ function de(o) {
199
+ const e = o;
200
+ return e.concat = function(t) {
201
+ const n = {
202
+ id: this.id,
203
+ component: this,
204
+ modifiers: this.modifiers || [],
205
+ render: () => {
206
+ const i = this.render();
207
+ return Array.isArray(i) ? i[0] : i;
208
+ }
209
+ }, r = t.toSegment();
210
+ return t instanceof h ? new h(
211
+ [n, ...t.segments],
212
+ {
213
+ totalSegments: t.segments.length + 1,
214
+ accessibilityRole: "group",
215
+ semanticStructure: "mixed"
216
+ }
217
+ ) : new h(
218
+ [n, r],
219
+ {
220
+ totalSegments: 2,
221
+ accessibilityRole: "group",
222
+ semanticStructure: "mixed"
223
+ }
224
+ );
225
+ }, e.toSegment = function() {
226
+ return {
227
+ id: this.id,
228
+ component: this,
229
+ modifiers: this.modifiers || [],
230
+ render: () => {
231
+ const t = this.render();
232
+ return Array.isArray(t) ? t[0] : t;
233
+ }
234
+ };
235
+ }, e.isConcatenatable = function() {
236
+ return !0;
237
+ }, e;
238
+ }
239
+ const l = /* @__PURE__ */ new Map(), M = 300 * 1e3, S = 100;
240
+ class fe {
241
+ /**
242
+ * Optimize an array of segments by merging compatible adjacent text segments
243
+ * Enhanced with caching and performance monitoring
244
+ */
245
+ static optimize(e) {
246
+ const t = performance.now();
247
+ if (e.length < 2) return e;
248
+ const n = this.generateCacheKey(e), r = this.getCachedOptimization(n);
249
+ if (r)
250
+ return r.optimizedSegments;
251
+ const i = this.performOptimization(e), s = performance.now() - t, a = {
252
+ ...this.getOptimizationStats(e, i),
253
+ processingTimeMs: s
254
+ };
255
+ return this.cacheOptimization(n, i, a), process.env.NODE_ENV === "development" && s > 5 && console.log(`TachUI Concatenation: Optimization took ${s.toFixed(2)}ms for ${e.length} segments`), i;
256
+ }
257
+ /**
258
+ * Core optimization algorithm separated for clarity
259
+ */
260
+ static performOptimization(e) {
261
+ const t = [];
262
+ for (const n of e) {
263
+ const r = t[t.length - 1];
264
+ r && this.canMergeTextSegments(r, n) ? t[t.length - 1] = this.mergeTextSegments(r, n) : t.push(n);
265
+ }
266
+ return t;
267
+ }
268
+ /**
269
+ * Generate a cache key from segments
270
+ */
271
+ static generateCacheKey(e) {
272
+ return e.map((n) => {
273
+ const r = n.component, i = this.extractTextContent(r), s = this.hashModifiers(n.modifiers);
274
+ return `${r.constructor.name}:${i}:${s}`;
275
+ }).join("|");
276
+ }
277
+ /**
278
+ * Hash modifiers for cache key generation
279
+ */
280
+ static hashModifiers(e) {
281
+ if (e.length === 0) return "none";
282
+ try {
283
+ const t = e.map((r) => ({
284
+ type: r.type,
285
+ props: r.properties
286
+ })), n = JSON.stringify(t);
287
+ return typeof btoa == "function" ? btoa(n).substring(0, 8) : this.simpleHash(n).toString(16).substring(0, 8);
288
+ } catch {
289
+ return "hash-error";
290
+ }
291
+ }
292
+ /**
293
+ * Simple hash function fallback for environments without btoa
294
+ */
295
+ static simpleHash(e) {
296
+ let t = 0;
297
+ for (let n = 0; n < e.length; n++) {
298
+ const r = e.charCodeAt(n);
299
+ t = (t << 5) - t + r, t = t & t;
300
+ }
301
+ return Math.abs(t);
302
+ }
303
+ /**
304
+ * Get cached optimization result
305
+ */
306
+ static getCachedOptimization(e) {
307
+ const t = l.get(e);
308
+ return t ? Date.now() - t.timestamp > M ? (l.delete(e), null) : t : null;
309
+ }
310
+ /**
311
+ * Cache optimization result
312
+ */
313
+ static cacheOptimization(e, t, n) {
314
+ if (l.size >= S) {
315
+ const r = l.keys().next().value;
316
+ r && l.delete(r);
317
+ }
318
+ l.set(e, {
319
+ optimizedSegments: t,
320
+ stats: n,
321
+ timestamp: Date.now()
322
+ });
323
+ }
324
+ /**
325
+ * Clear optimization cache (useful for testing)
326
+ */
327
+ static clearCache() {
328
+ l.clear();
329
+ }
330
+ /**
331
+ * Get cache statistics
332
+ */
333
+ static getCacheStats() {
334
+ return {
335
+ size: l.size,
336
+ maxSize: S,
337
+ hitRate: 0
338
+ // Would need to track hits/misses to calculate this
339
+ };
340
+ }
341
+ /**
342
+ * Check if two segments can be merged
343
+ */
344
+ static canMergeTextSegments(e, t) {
345
+ return e.component.constructor.name !== "EnhancedText" || t.component.constructor.name !== "EnhancedText" ? !1 : this.modifiersCompatible(e.modifiers, t.modifiers);
346
+ }
347
+ /**
348
+ * Check if two modifier arrays are compatible for merging
349
+ */
350
+ static modifiersCompatible(e, t) {
351
+ if (e.length !== t.length) return !1;
352
+ for (let n = 0; n < e.length; n++)
353
+ if (!this.modifierEqual(e[n], t[n]))
354
+ return !1;
355
+ return !0;
356
+ }
357
+ /**
358
+ * Check if two modifiers are equal (simplified comparison)
359
+ */
360
+ static modifierEqual(e, t) {
361
+ if (e.type !== t.type) return !1;
362
+ try {
363
+ return JSON.stringify(e.properties) === JSON.stringify(t.properties);
364
+ } catch {
365
+ return !1;
366
+ }
367
+ }
368
+ /**
369
+ * Merge two text segments into a single segment
370
+ */
371
+ static mergeTextSegments(e, t) {
372
+ const n = e.component, r = t.component, i = this.extractTextContent(n), s = this.extractTextContent(r), a = i + s;
373
+ return {
374
+ id: `merged-${e.id}-${t.id}`,
375
+ component: this.createMergedTextComponent(a, n.props, e.modifiers),
376
+ modifiers: e.modifiers,
377
+ // Use modifiers from first segment (they're identical)
378
+ render: () => this.createMergedTextComponent(a, n.props, e.modifiers).render()[0]
379
+ };
380
+ }
381
+ /**
382
+ * Extract text content from a text component
383
+ */
384
+ static extractTextContent(e) {
385
+ const t = e.props?.content;
386
+ return typeof t == "string" ? t : typeof t == "function" ? t() : t && typeof t == "object" && "peek" in t && t.peek() || "";
387
+ }
388
+ /**
389
+ * Create a new merged text component
390
+ */
391
+ static createMergedTextComponent(e, t, n) {
392
+ const r = {
393
+ ...t,
394
+ content: e
395
+ };
396
+ return {
397
+ type: "Text",
398
+ id: `merged-text-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,
399
+ props: r,
400
+ mounted: !1,
401
+ cleanup: [],
402
+ modifiers: n,
403
+ render() {
404
+ const i = T(e);
405
+ return [w("span", {}, i)];
406
+ }
407
+ };
408
+ }
409
+ /**
410
+ * Analyze segments and determine if optimization would be beneficial
411
+ */
412
+ static shouldOptimize(e) {
413
+ if (e.length < 2) return !1;
414
+ let t = 0;
415
+ for (let n = 0; n < e.length - 1; n++) {
416
+ const r = e[n], i = e[n + 1];
417
+ r.component.constructor.name === "EnhancedText" && i.component.constructor.name === "EnhancedText" && t++;
418
+ }
419
+ return t > 0;
420
+ }
421
+ /**
422
+ * Get optimization statistics (enhanced for Phase 4.1)
423
+ */
424
+ static getOptimizationStats(e, t) {
425
+ const n = e.length - t.length, r = e.length > 0 ? Math.round(n / e.length * 100) : 0;
426
+ return {
427
+ originalCount: e.length,
428
+ optimizedCount: t.length,
429
+ reductionPercent: r,
430
+ textSegmentsMerged: n
431
+ };
432
+ }
433
+ /**
434
+ * Advanced optimization analysis for performance monitoring
435
+ */
436
+ static analyzeOptimizationOpportunities(e) {
437
+ let t = 0, n = 0, r = 0, i = 0;
438
+ for (let a = 0; a < e.length; a++) {
439
+ const u = e[a];
440
+ switch (u.component.constructor.name) {
441
+ case "EnhancedText":
442
+ if (t++, a < e.length - 1) {
443
+ const f = e[a + 1];
444
+ this.canMergeTextSegments(u, f) && i++;
445
+ }
446
+ break;
447
+ case "EnhancedImage":
448
+ n++;
449
+ break;
450
+ case "EnhancedButton":
451
+ case "EnhancedLinkComponent":
452
+ r++;
453
+ break;
454
+ }
455
+ }
456
+ const s = e.length > 0 ? Math.round(i / e.length * 100) : 0;
457
+ return {
458
+ totalSegments: e.length,
459
+ textSegments: t,
460
+ imageSegments: n,
461
+ interactiveSegments: r,
462
+ optimizableTextPairs: i,
463
+ estimatedReductionPercent: s
464
+ };
465
+ }
466
+ }
467
+ function C(o, e = {}) {
468
+ const { fallback: t, errorFallback: n, timeout: r = 1e4, preload: i = "never" } = e;
469
+ let s = !1, a = null, u = !1, d = null, f = null;
470
+ const y = async () => {
471
+ s || u || a || f || (s = !0, u = !0, d = null, f = (async () => {
472
+ try {
473
+ const p = await Promise.race([
474
+ o(),
475
+ new Promise(
476
+ (g, x) => setTimeout(() => x(new Error("Component load timeout")), r)
477
+ )
478
+ ]);
479
+ a = "default" in p ? p.default : p;
480
+ } catch (p) {
481
+ const g = p;
482
+ (typeof process > "u" || process.env.NODE_ENV !== "test") && console.error("Failed to load lazy component:", g), d = g;
483
+ } finally {
484
+ u = !1, f = null;
485
+ }
486
+ })(), await f);
487
+ };
488
+ return i === "idle" && typeof requestIdleCallback < "u" ? requestIdleCallback(() => {
489
+ y().catch(() => {
490
+ });
491
+ }) : i === "idle" ? setTimeout(() => {
492
+ y().catch(() => {
493
+ });
494
+ }, 100) : i === "immediate" && y().catch(() => {
495
+ }), (p) => {
496
+ if (!s && !u && !a && y().catch(() => {
497
+ }), d)
498
+ return n ? n(d) : b(d);
499
+ if (u || !a)
500
+ return t || k();
501
+ try {
502
+ return typeof a == "function" ? a(p) : a;
503
+ } catch (g) {
504
+ const x = g;
505
+ return (typeof process > "u" || process.env.NODE_ENV !== "test") && console.error("Error rendering lazy component:", x), b(x);
506
+ }
507
+ };
508
+ }
509
+ function he(o) {
510
+ return {
511
+ type: "component",
512
+ render: () => ({
513
+ type: "element",
514
+ tag: "div",
515
+ props: { class: "tachui-suspense" },
516
+ children: o.children.map(() => ({
517
+ type: "element",
518
+ tag: "div",
519
+ children: []
520
+ }))
521
+ }),
522
+ props: o,
523
+ id: `suspense-${Math.random().toString(36).substr(2, 9)}`
524
+ };
525
+ }
526
+ function O(o) {
527
+ return o().then((e) => e && typeof e == "object" && "default" in e ? e.default : e);
528
+ }
529
+ function ge(o, e = {}) {
530
+ const t = {};
531
+ for (const [n, r] of Object.entries(o))
532
+ t[n] = C(r, e);
533
+ return t;
534
+ }
535
+ function ye(o) {
536
+ const e = Object.entries(o).map(
537
+ async ([t, n]) => [t, await O(n)]
538
+ );
539
+ return Promise.all(e).then((t) => {
540
+ const n = {};
541
+ for (const [r, i] of t)
542
+ n[r] = i;
543
+ return n;
544
+ });
545
+ }
546
+ function k() {
547
+ return {
548
+ type: "element",
549
+ tag: "div",
550
+ props: {
551
+ class: "tachui-lazy-loading",
552
+ style: "padding: 16px; color: #666; text-align: center;"
553
+ },
554
+ children: [
555
+ {
556
+ type: "text",
557
+ text: "Loading component..."
558
+ }
559
+ ]
560
+ };
561
+ }
562
+ function b(o) {
563
+ return {
564
+ type: "element",
565
+ tag: "div",
566
+ props: {
567
+ class: "tachui-lazy-error",
568
+ style: "padding: 16px; color: #d32f2f; border: 1px solid #d32f2f; border-radius: 4px; background: #ffeaea;"
569
+ },
570
+ children: [
571
+ {
572
+ type: "text",
573
+ text: `Failed to load component: ${o.message}`
574
+ }
575
+ ]
576
+ };
577
+ }
578
+ function xe(o, e = {}) {
579
+ const { rootMargin: t = "50px", threshold: n = 0.1, ...r } = e;
580
+ return r.preload === "visible" && typeof IntersectionObserver < "u" ? (i) => {
581
+ const s = C(o, { ...r, preload: "never" });
582
+ return setTimeout(() => {
583
+ s(i);
584
+ }, 100), s(i);
585
+ } : C(o, r);
586
+ }
587
+ const Ce = Object.freeze({
588
+ configure: E,
589
+ getFeatureFlags: z
590
+ });
591
+ export {
592
+ se as C,
593
+ he as S,
594
+ fe as T,
595
+ ue as a,
596
+ pe as b,
597
+ le as c,
598
+ Y as d,
599
+ Z as e,
600
+ X as f,
601
+ Q as g,
602
+ ee as h,
603
+ me as i,
604
+ te as j,
605
+ ne as k,
606
+ oe as l,
607
+ de as m,
608
+ ie as n,
609
+ ae as o,
610
+ ce as p,
611
+ ge as q,
612
+ re as r,
613
+ xe as s,
614
+ Ce as t,
615
+ C as u,
616
+ O as v,
617
+ ye as w
618
+ };
package/dist/index.d.ts CHANGED
@@ -4,8 +4,15 @@
4
4
  * A SwiftUI-inspired web framework with SolidJS-style reactivity,
5
5
  * compile-time optimization, and TypeScript-first design.
6
6
  */
7
+ import { configureCore, getCoreFeatureFlags, isProxyEnabled } from './config';
7
8
  export { Assets, Asset, ColorAsset, ImageAsset, FontAsset, FontWidth, SystemFonts, createSystemFont, createGoogleFont, createVariableFont, registerAsset, createColorAsset, createImageAsset, createFontAsset, getAssetInfo, listAssetNames, type FontAssetOptions, type FontWeightValue, type FontWidthValue, type AssetInfo, type AssetsInterface, } from './assets';
8
9
  export { infinity, Layout, isInfinity, dimensionToCSS, infinityToFlexCSS, shouldExpandForInfinity, type Dimension, type InfinityValue, } from './constants';
10
+ export { configureCore, getCoreFeatureFlags, isProxyEnabled };
11
+ export declare const tachui: Readonly<{
12
+ configure: typeof configureCore;
13
+ getFeatureFlags: typeof getCoreFeatureFlags;
14
+ }>;
15
+ export { clonePropsPreservingReactivity, createResetLifecycleState, resetLifecycleState, } from './utils/clone-helpers';
9
16
  export { type ComponentSegment, type ConcatenationMetadata, type AccessibilityNode, type ConcatenationResult, type Concatenatable, ConcatenationSymbol, isConcatenatable, isConcatenatedComponent, ConcatenatableBase, makeConcatenatable, CONCAT_SYMBOL, ConcatenatedComponent, Concatenated, TextConcatenationOptimizer, } from './concatenation';
10
17
  export { fillMaxWidth, fillMaxHeight, fillMaxSize, expand, fixedWidthExpandHeight, fixedHeightExpandWidth, constrainedExpand, responsive, flexible, fullScreen, remainingSpace, equalShare, } from './constants/frame-utils';
11
18
  export * from './compiler';
@@ -22,5 +29,5 @@ export * from './css-classes';
22
29
  export { createLazyComponentGroup, createVisibilityLazyComponent, lazy, preloadComponent, preloadComponentGroup, Suspense, } from './runtime/lazy-component';
23
30
  export * from './state';
24
31
  export { ValidationDevTools, ValidationSetup, LifecycleValidationUtils, getComponentValidator, ProductionUtils, } from './validation';
25
- export declare const VERSION = "0.1.0";
32
+ export { TACHUI_PACKAGE, TACHUI_PACKAGE_VERSION, VERSION } from './version';
26
33
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,MAAM,EACN,KAAK,EACL,UAAU,EACV,UAAU,EACV,SAAS,EACT,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,cAAc,EACd,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,eAAe,GACrB,MAAM,UAAU,CAAA;AAGjB,OAAO,EACL,QAAQ,EACR,MAAM,EACN,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,uBAAuB,EACvB,KAAK,SAAS,EACd,KAAK,aAAa,GACnB,MAAM,aAAa,CAAA;AAGpB,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,uBAAuB,EACvB,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,qBAAqB,EACrB,YAAY,EACZ,0BAA0B,GAC3B,MAAM,iBAAiB,CAAA;AAGxB,OAAO,EACL,YAAY,EACZ,aAAa,EACb,WAAW,EACX,MAAM,EACN,sBAAsB,EACtB,sBAAsB,EACtB,iBAAiB,EACjB,UAAU,EACV,QAAQ,EACR,UAAU,EACV,cAAc,EACd,UAAU,GACX,MAAM,yBAAyB,CAAA;AAGhC,cAAc,YAAY,CAAA;AAG1B,cAAc,cAAc,CAAA;AAK5B,cAAc,aAAa,CAAA;AAO3B,cAAc,aAAa,CAAA;AAE3B,OAAO,EACL,uBAAuB,EACvB,2BAA2B,EAC3B,wBAAwB,EACxB,oBAAoB,EACpB,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,yBAAyB,EACzB,gBAAgB,EAChB,yBAAyB,EACzB,cAAc,EACd,WAAW,EACX,WAAW,EACX,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,GAEf,MAAM,WAAW,CAAA;AAClB,YAAY,EACV,YAAY,EACZ,cAAc,EACd,4BAA4B,EAC5B,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,WAAW,CAAA;AAGlB,cAAc,YAAY,CAAA;AAE1B,cAAc,WAAW,CAAA;AACzB,OAAO,EAAE,mCAAmC,EAAE,MAAM,sBAAsB,CAAA;AAG1E,YAAY,EACV,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,OAAO,GACR,MAAM,iBAAiB,CAAA;AAGxB,cAAc,eAAe,CAAA;AAE7B,OAAO,EACL,wBAAwB,EACxB,6BAA6B,EAC7B,IAAI,EACJ,gBAAgB,EAChB,qBAAqB,EACrB,QAAQ,GACT,MAAM,0BAA0B,CAAA;AAEjC,cAAc,SAAS,CAAA;AAQvB,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,wBAAwB,EACxB,qBAAqB,EACrB,eAAe,GAChB,MAAM,cAAc,CAAA;AAGrB,eAAO,MAAM,OAAO,UAAU,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAG7E,OAAO,EACL,MAAM,EACN,KAAK,EACL,UAAU,EACV,UAAU,EACV,SAAS,EACT,SAAS,EACT,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,cAAc,EACd,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,eAAe,GACrB,MAAM,UAAU,CAAA;AAGjB,OAAO,EACL,QAAQ,EACR,MAAM,EACN,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,uBAAuB,EACvB,KAAK,SAAS,EACd,KAAK,aAAa,GACnB,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,cAAc,EAAE,CAAA;AAE7D,eAAO,MAAM,MAAM;;;EAGjB,CAAA;AAGF,OAAO,EACL,8BAA8B,EAC9B,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,uBAAuB,CAAA;AAG9B,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,uBAAuB,EACvB,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,qBAAqB,EACrB,YAAY,EACZ,0BAA0B,GAC3B,MAAM,iBAAiB,CAAA;AAGxB,OAAO,EACL,YAAY,EACZ,aAAa,EACb,WAAW,EACX,MAAM,EACN,sBAAsB,EACtB,sBAAsB,EACtB,iBAAiB,EACjB,UAAU,EACV,QAAQ,EACR,UAAU,EACV,cAAc,EACd,UAAU,GACX,MAAM,yBAAyB,CAAA;AAGhC,cAAc,YAAY,CAAA;AAG1B,cAAc,cAAc,CAAA;AAK5B,cAAc,aAAa,CAAA;AAO3B,cAAc,aAAa,CAAA;AAE3B,OAAO,EACL,uBAAuB,EACvB,2BAA2B,EAC3B,wBAAwB,EACxB,oBAAoB,EACpB,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,yBAAyB,EACzB,gBAAgB,EAChB,yBAAyB,EACzB,cAAc,EACd,WAAW,EACX,WAAW,EACX,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,GAEf,MAAM,WAAW,CAAA;AAClB,YAAY,EACV,YAAY,EACZ,cAAc,EACd,4BAA4B,EAC5B,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,WAAW,CAAA;AAGlB,cAAc,YAAY,CAAA;AAE1B,cAAc,WAAW,CAAA;AACzB,OAAO,EAAE,mCAAmC,EAAE,MAAM,sBAAsB,CAAA;AAG1E,YAAY,EACV,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,OAAO,GACR,MAAM,iBAAiB,CAAA;AAGxB,cAAc,eAAe,CAAA;AAE7B,OAAO,EACL,wBAAwB,EACxB,6BAA6B,EAC7B,IAAI,EACJ,gBAAgB,EAChB,qBAAqB,EACrB,QAAQ,GACT,MAAM,0BAA0B,CAAA;AAEjC,cAAc,SAAS,CAAA;AAQvB,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,wBAAwB,EACxB,qBAAqB,EACrB,eAAe,GAChB,MAAM,cAAc,CAAA;AAGrB,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA"}