@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
@@ -1,94 +1,6 @@
1
- import type { Asset } from '../assets/types';
2
- export interface GradientColors {
3
- colors: (string | Asset)[];
4
- stops?: number[];
5
- }
6
- export type GradientStartPoint = 'top' | 'topLeading' | 'leading' | 'bottomLeading' | 'bottom' | 'bottomTrailing' | 'trailing' | 'topTrailing' | 'center';
7
- export type GradientCenter = 'center' | 'top' | 'bottom' | 'leading' | 'trailing' | [number, number];
8
- export interface LinearGradientOptions extends GradientColors {
9
- startPoint: GradientStartPoint;
10
- endPoint: GradientStartPoint;
11
- angle?: number;
12
- }
13
- export interface RadialGradientOptions extends GradientColors {
14
- center: GradientCenter;
15
- startRadius: number;
16
- endRadius: number;
17
- shape?: 'circle' | 'ellipse';
18
- }
19
- export interface AngularGradientOptions extends GradientColors {
20
- center: GradientCenter;
21
- startAngle: number;
22
- endAngle: number;
23
- }
24
- export interface RepeatingLinearGradientOptions extends GradientColors {
25
- direction: string;
26
- colorStops: string[];
27
- }
28
- export interface RepeatingRadialGradientOptions extends GradientColors {
29
- center: GradientCenter;
30
- shape?: 'circle' | 'ellipse';
31
- colorStops: string[];
32
- }
33
- export interface ConicGradientOptions extends GradientColors {
34
- center: GradientCenter;
35
- startAngle: number;
36
- endAngle?: number;
37
- }
38
- export interface EllipticalGradientOptions extends GradientColors {
39
- center: GradientCenter;
40
- radiusX: number;
41
- radiusY: number;
42
- }
43
- export type GradientType = 'linear' | 'radial' | 'angular' | 'conic' | 'repeating-linear' | 'repeating-radial' | 'elliptical';
44
- export interface GradientDefinition {
45
- type: GradientType;
46
- options: LinearGradientOptions | RadialGradientOptions | AngularGradientOptions | ConicGradientOptions | RepeatingLinearGradientOptions | RepeatingRadialGradientOptions | EllipticalGradientOptions;
47
- }
48
- export interface TransitionOptions {
49
- duration: number;
50
- easing?: string;
51
- }
52
- export interface GradientAssetDefinitions {
53
- light: GradientDefinition;
54
- dark: GradientDefinition;
55
- [key: string]: GradientDefinition;
56
- }
57
1
  /**
58
- * Animation configuration for gradient transitions
2
+ * TachUI Gradient Types
3
+ * Re-exported from @tachui/types for backward compatibility
59
4
  */
60
- export interface GradientAnimationOptions {
61
- duration?: number;
62
- easing?: 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'linear' | string;
63
- delay?: number;
64
- }
65
- /**
66
- * State-based gradient configuration
67
- */
68
- export interface StateGradientOptions {
69
- default: GradientDefinition | string | Asset;
70
- hover?: GradientDefinition | string | Asset;
71
- active?: GradientDefinition | string | Asset;
72
- focus?: GradientDefinition | string | Asset;
73
- disabled?: GradientDefinition | string | Asset;
74
- animation?: GradientAnimationOptions;
75
- }
76
- /**
77
- * Enhanced background value supporting state-based gradients
78
- */
79
- export type StatefulBackgroundValue = string | GradientDefinition | Asset | StateGradientOptions;
80
- export type HorizontalGradient = GradientDefinition & {
81
- type: 'linear';
82
- options: LinearGradientOptions & {
83
- startPoint: 'leading' | 'trailing';
84
- endPoint: 'trailing' | 'leading';
85
- };
86
- };
87
- export type VerticalGradient = GradientDefinition & {
88
- type: 'linear';
89
- options: LinearGradientOptions & {
90
- startPoint: 'top' | 'bottom';
91
- endPoint: 'bottom' | 'top';
92
- };
93
- };
5
+ export * from '@tachui/types/gradients';
94
6
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/gradients/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAE5C,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,CAAC,MAAM,GAAG,KAAK,CAAC,EAAE,CAAA;IAC1B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;CACjB;AAED,MAAM,MAAM,kBAAkB,GAC1B,KAAK,GACL,YAAY,GACZ,SAAS,GACT,eAAe,GACf,QAAQ,GACR,gBAAgB,GAChB,UAAU,GACV,aAAa,GACb,QAAQ,CAAA;AAEZ,MAAM,MAAM,cAAc,GACtB,QAAQ,GACR,KAAK,GACL,QAAQ,GACR,SAAS,GACT,UAAU,GACV,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAEpB,MAAM,WAAW,qBAAsB,SAAQ,cAAc;IAC3D,UAAU,EAAE,kBAAkB,CAAA;IAC9B,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,qBAAsB,SAAQ,cAAc;IAC3D,MAAM,EAAE,cAAc,CAAA;IACtB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,QAAQ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ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,yBAAyB,CAAA"}
@@ -0,0 +1,446 @@
1
+ import "./scheduler-DI_8ykMk.js";
2
+ import { c as g, a as x } from "./theme-BFaKUcjZ.js";
3
+ import "@tachui/types/reactive";
4
+ import { b } from "./component-context-B6qX_Qsg.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
+ };