@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.
- package/README.md +40 -2
- package/dist/assets/AssetCollection.d.ts.map +1 -1
- package/dist/assets/ColorAsset.d.ts.map +1 -1
- package/dist/assets/index.d.ts +1 -0
- package/dist/assets/index.d.ts.map +1 -1
- package/dist/assets/index.js +486 -0
- package/dist/assets/types.d.ts +8 -68
- package/dist/assets/types.d.ts.map +1 -1
- package/dist/binding-CYpEQquE.js +308 -0
- package/dist/build-plugins/index.d.ts +3 -0
- package/dist/build-plugins/index.d.ts.map +1 -0
- package/dist/build-plugins/modifier-types.d.ts +12 -0
- package/dist/build-plugins/modifier-types.d.ts.map +1 -0
- package/dist/build-tools/typegen-runner.d.ts +29 -0
- package/dist/build-tools/typegen-runner.d.ts.map +1 -0
- package/dist/bundles/minimal.d.ts +2 -0
- package/dist/bundles/minimal.d.ts.map +1 -1
- package/dist/common.js +427 -394
- package/dist/{component-XAzF1xqs.js → component-CECyfUOE.js} +80 -68
- package/dist/{component-base-x2XmHFjy.js → component-base-CJ__jTlr.js} +9 -7
- package/dist/component-context-B6qX_Qsg.js +176 -0
- package/dist/components/factory.d.ts +24 -0
- package/dist/components/factory.d.ts.map +1 -0
- package/dist/components/index.d.ts +3 -2
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +8 -6
- package/dist/components/wrapper.d.ts +70 -30
- package/dist/components/wrapper.d.ts.map +1 -1
- package/dist/concatenated-component-_tF1eMvy.js +2288 -0
- package/dist/concatenation/concatenated-component.d.ts +16 -2
- package/dist/concatenation/concatenated-component.d.ts.map +1 -1
- package/dist/concatenation/text-optimizer.d.ts.map +1 -1
- package/dist/config.d.ts +7 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/constants/layout.d.ts +2 -9
- package/dist/constants/layout.d.ts.map +1 -1
- package/dist/css-classes/index.js +15 -173
- package/dist/{effect-B9Knft0b.js → effect-DGmdACI2.js} +3 -3
- package/dist/enhanced-renderer-Bwqsh8Ku.js +172 -0
- package/dist/essential.js +427 -394
- package/dist/{index-DIvMCJQO.js → factories-Co2Lv2kJ.js} +13 -13
- package/dist/factory-D7jAY5Kn.js +485 -0
- package/dist/gradients/css-generator.js +99 -0
- package/dist/gradients/index.js +56 -0
- package/dist/gradients/reactive.d.ts.map +1 -1
- package/dist/gradients/types.d.ts +3 -91
- package/dist/gradients/types.d.ts.map +1 -1
- package/dist/hooks-DeLasj54.js +446 -0
- package/dist/index-JQ1sW1SK.js +2049 -0
- package/dist/index-X8MVY78C.js +618 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +427 -394
- package/dist/minimal-prod.js +94 -93
- package/dist/minimal.js +114 -108
- package/dist/modifiers/alignment.d.ts +5 -0
- package/dist/modifiers/alignment.d.ts.map +1 -0
- package/dist/modifiers/base.d.ts +6 -7
- package/dist/modifiers/base.d.ts.map +1 -1
- package/dist/modifiers/base.js +24 -16
- package/dist/modifiers/builder.d.ts +28 -165
- package/dist/modifiers/builder.d.ts.map +1 -1
- package/dist/modifiers/builder.js +7 -7
- package/dist/modifiers/core.d.ts +0 -1
- package/dist/modifiers/core.d.ts.map +1 -1
- package/dist/modifiers/corner-radius.d.ts +8 -0
- package/dist/modifiers/corner-radius.d.ts.map +1 -0
- package/dist/modifiers/index.d.ts +9 -6
- package/dist/modifiers/index.d.ts.map +1 -1
- package/dist/modifiers/index.js +36 -30
- package/dist/modifiers/layout-priority.d.ts +8 -0
- package/dist/modifiers/layout-priority.d.ts.map +1 -0
- package/dist/modifiers/opacity.d.ts +8 -0
- package/dist/modifiers/opacity.d.ts.map +1 -0
- package/dist/modifiers/presets.d.ts.map +1 -1
- package/dist/modifiers/proxy.d.ts +4 -0
- package/dist/modifiers/proxy.d.ts.map +1 -0
- package/dist/modifiers/registration-utils.d.ts +7 -0
- package/dist/modifiers/registration-utils.d.ts.map +1 -0
- package/dist/modifiers/registry.d.ts +18 -9
- package/dist/modifiers/registry.d.ts.map +1 -1
- package/dist/modifiers/registry.js +2 -2
- package/dist/modifiers/type-generator.d.ts +82 -0
- package/dist/modifiers/type-generator.d.ts.map +1 -0
- package/dist/modifiers/types.d.ts +2 -479
- package/dist/modifiers/types.d.ts.map +1 -1
- package/dist/modifiers/types.js +1 -4
- package/dist/{observed-object-Cos-FtjP.js → observed-object-DepiqSgg.js} +3 -3
- package/dist/optimization-CbKNA9w4.js +21 -0
- package/dist/plugins/index.js +28 -8
- package/dist/plugins/simplified-lazy-loader.d.ts.map +1 -1
- package/dist/presets-B9x94uRn.js +381 -0
- package/dist/proxy-Cqmbiyx0.js +175 -0
- package/dist/reactive/cleanup.d.ts.map +1 -1
- package/dist/reactive/computed.d.ts +1 -1
- package/dist/reactive/computed.d.ts.map +1 -1
- package/dist/reactive/context.d.ts +4 -3
- package/dist/reactive/context.d.ts.map +1 -1
- package/dist/reactive/index.d.ts +1 -0
- package/dist/reactive/index.d.ts.map +1 -1
- package/dist/reactive/index.js +84 -490
- package/dist/reactive/signal-list.d.ts +100 -0
- package/dist/reactive/signal-list.d.ts.map +1 -0
- package/dist/reactive/signal.d.ts.map +1 -1
- package/dist/reactive/types.d.ts +2 -89
- package/dist/reactive/types.d.ts.map +1 -1
- package/dist/reactive/types.js +1 -4
- package/dist/registration-utils-CNsN4eoU.js +27 -0
- package/dist/runtime/component.d.ts.map +1 -1
- package/dist/runtime/concatenation-aria.d.ts.map +1 -1
- package/dist/runtime/concatenation-aria.js +18 -13
- package/dist/runtime/concatenation-full.d.ts.map +1 -1
- package/dist/runtime/concatenation-full.js +42 -34
- package/dist/runtime/concatenation-minimal.d.ts.map +1 -1
- package/dist/runtime/concatenation-minimal.js +13 -8
- package/dist/runtime/context.d.ts.map +1 -1
- package/dist/runtime/dom-bridge.d.ts +1 -1
- package/dist/runtime/dom-bridge.d.ts.map +1 -1
- package/dist/runtime/dom-bridge.js +239 -12
- package/dist/runtime/event-delegation.d.ts +59 -0
- package/dist/runtime/event-delegation.d.ts.map +1 -0
- package/dist/runtime/index.d.ts +3 -1
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +96 -0
- package/dist/runtime/layout-scheduler.d.ts +89 -0
- package/dist/runtime/layout-scheduler.d.ts.map +1 -0
- package/dist/runtime/props.d.ts.map +1 -1
- package/dist/runtime/renderer.d.ts +54 -2
- package/dist/runtime/renderer.d.ts.map +1 -1
- package/dist/runtime/renderer.js +11 -7
- package/dist/runtime/semantic-role-manager.d.ts.map +1 -1
- package/dist/runtime/types.d.ts +2 -226
- package/dist/runtime/types.d.ts.map +1 -1
- package/dist/runtime/types.js +1 -1
- package/dist/scheduler-DI_8ykMk.js +169 -0
- package/dist/signal-list-BdpxSodS.js +525 -0
- package/dist/state/index.js +319 -0
- package/dist/theme-BFaKUcjZ.js +677 -0
- package/dist/utils/clone-helpers.d.ts +11 -0
- package/dist/utils/clone-helpers.d.ts.map +1 -0
- package/dist/validation/index.js +28 -26
- package/dist/version.d.ts +19 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +6 -0
- package/package.json +51 -11
- package/dist/concatenated-component-ByPl3_FF.js +0 -2933
- package/dist/dom-bridge-CAa1N2zX.js +0 -406
- package/dist/index-DEBd8cq7.js +0 -1144
- package/dist/index-vdsiw6gQ.js +0 -777
- package/dist/modifiers/as-html-validator.d.ts +0 -20
- package/dist/modifiers/as-html-validator.d.ts.map +0 -1
- package/dist/modifiers/as-html.d.ts +0 -65
- package/dist/modifiers/as-html.d.ts.map +0 -1
- package/dist/modifiers/background.d.ts +0 -51
- package/dist/modifiers/background.d.ts.map +0 -1
- package/dist/modifiers/basic-sanitizer.d.ts +0 -54
- package/dist/modifiers/basic-sanitizer.d.ts.map +0 -1
- package/dist/modifiers/css.d.ts +0 -86
- package/dist/modifiers/css.d.ts.map +0 -1
- package/dist/production-minimal-BY_gMc-l.js +0 -2532
- package/dist/scheduler-BKeqwrYE.js +0 -814
|
@@ -1,406 +0,0 @@
|
|
|
1
|
-
import { W as g, k as x, l as b } from "./scheduler-BKeqwrYE.js";
|
|
2
|
-
import { D as L } from "./concatenated-component-ByPl3_FF.js";
|
|
3
|
-
var S = Object.defineProperty, D = (e, t, o) => t in e ? S(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o, l = (e, t, o) => D(e, typeof t != "symbol" ? t + "" : t, o);
|
|
4
|
-
const d = Symbol("TachUI.ComponentContext"), k = Symbol("TachUI.Environment");
|
|
5
|
-
let u = null;
|
|
6
|
-
class O {
|
|
7
|
-
constructor(t, o) {
|
|
8
|
-
l(this, "id"), l(this, "parent"), l(this, "providers", /* @__PURE__ */ new Map()), l(this, "consumers", /* @__PURE__ */ new Set()), l(this, "cleanup", /* @__PURE__ */ new Set()), l(this, "stateStore", /* @__PURE__ */ new Map()), l(this, "bindingStore", /* @__PURE__ */ new Map()), l(this, "createdAt", Date.now()), l(this, "updateCount", 0), this.id = t, this.parent = o;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Store state value for a property
|
|
12
|
-
*/
|
|
13
|
-
setState(t, o) {
|
|
14
|
-
this.stateStore.set(t, o), this.updateCount++;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Get state value for a property
|
|
18
|
-
*/
|
|
19
|
-
getState(t) {
|
|
20
|
-
return this.stateStore.get(t);
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Check if state exists for a property
|
|
24
|
-
*/
|
|
25
|
-
hasState(t) {
|
|
26
|
-
return this.stateStore.has(t);
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Store binding for a property
|
|
30
|
-
*/
|
|
31
|
-
setBinding(t, o) {
|
|
32
|
-
this.bindingStore.set(t, o);
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Get binding for a property
|
|
36
|
-
*/
|
|
37
|
-
getBinding(t) {
|
|
38
|
-
return this.bindingStore.get(t);
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Provide a value for dependency injection
|
|
42
|
-
*/
|
|
43
|
-
provide(t, o) {
|
|
44
|
-
this.providers.set(t, o);
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Consume a value from dependency injection hierarchy
|
|
48
|
-
*/
|
|
49
|
-
consume(t) {
|
|
50
|
-
if (this.consumers.add(t), this.providers.has(t))
|
|
51
|
-
return this.providers.get(t);
|
|
52
|
-
let o = this.parent;
|
|
53
|
-
for (; o; ) {
|
|
54
|
-
if (o.providers.has(t))
|
|
55
|
-
return o.providers.get(t);
|
|
56
|
-
o = o.parent;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Register cleanup function
|
|
61
|
-
*/
|
|
62
|
-
onCleanup(t) {
|
|
63
|
-
this.cleanup.add(t);
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Dispose of context and run cleanup
|
|
67
|
-
*/
|
|
68
|
-
dispose() {
|
|
69
|
-
for (const t of this.cleanup)
|
|
70
|
-
try {
|
|
71
|
-
t();
|
|
72
|
-
} catch (o) {
|
|
73
|
-
console.error(`Error in component context cleanup (${this.id}):`, o);
|
|
74
|
-
}
|
|
75
|
-
this.cleanup.clear(), this.stateStore.clear(), this.bindingStore.clear(), this.providers.clear(), this.consumers.clear();
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Get performance metrics
|
|
79
|
-
*/
|
|
80
|
-
getMetrics() {
|
|
81
|
-
return {
|
|
82
|
-
id: this.id,
|
|
83
|
-
createdAt: this.createdAt,
|
|
84
|
-
updateCount: this.updateCount,
|
|
85
|
-
stateCount: this.stateStore.size,
|
|
86
|
-
bindingCount: this.bindingStore.size,
|
|
87
|
-
providerCount: this.providers.size,
|
|
88
|
-
consumerCount: this.consumers.size
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
function v(e, t) {
|
|
93
|
-
return new O(e, t);
|
|
94
|
-
}
|
|
95
|
-
function M() {
|
|
96
|
-
if (u)
|
|
97
|
-
return u;
|
|
98
|
-
let e = g();
|
|
99
|
-
for (; e; ) {
|
|
100
|
-
if (e.context.has(d))
|
|
101
|
-
return e.context.get(d);
|
|
102
|
-
e = e.parent;
|
|
103
|
-
}
|
|
104
|
-
throw new Error(
|
|
105
|
-
"@State can only be used within a component context. Make sure you are using @State inside a TachUI component render function."
|
|
106
|
-
);
|
|
107
|
-
}
|
|
108
|
-
function y(e) {
|
|
109
|
-
u = e;
|
|
110
|
-
}
|
|
111
|
-
function A(e, t) {
|
|
112
|
-
const o = u;
|
|
113
|
-
u = e;
|
|
114
|
-
const n = g();
|
|
115
|
-
n && n.context.set(d, e);
|
|
116
|
-
try {
|
|
117
|
-
return t();
|
|
118
|
-
} finally {
|
|
119
|
-
u === e && (u = o), n && (o ? n.context.set(d, o) : n.context.delete(d));
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
function B(e, t) {
|
|
123
|
-
return (o) => {
|
|
124
|
-
const n = t || `component-${Math.random().toString(36).substr(2, 9)}`, r = v(n, u || void 0);
|
|
125
|
-
return A(r, () => {
|
|
126
|
-
const a = e(o);
|
|
127
|
-
return a.context = r, a.cleanup || (a.cleanup = []), a.cleanup.push(() => r.dispose()), a;
|
|
128
|
-
});
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
function P(e, t) {
|
|
132
|
-
return {
|
|
133
|
-
symbol: Symbol(`Environment.${e}`),
|
|
134
|
-
defaultValue: t,
|
|
135
|
-
name: e
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
function W(e, t) {
|
|
139
|
-
M().provide(e.symbol, t);
|
|
140
|
-
}
|
|
141
|
-
function j(e) {
|
|
142
|
-
const o = M().consume(e.symbol);
|
|
143
|
-
if (o !== void 0)
|
|
144
|
-
return o;
|
|
145
|
-
if (e.defaultValue !== void 0)
|
|
146
|
-
return e.defaultValue;
|
|
147
|
-
throw new Error(
|
|
148
|
-
`Environment value for '${e.name}' not found. Make sure to provide this value higher in the component hierarchy.`
|
|
149
|
-
);
|
|
150
|
-
}
|
|
151
|
-
const z = {
|
|
152
|
-
getCurrentContext: () => u,
|
|
153
|
-
getContextHierarchy: () => {
|
|
154
|
-
const e = [];
|
|
155
|
-
let t = u || void 0;
|
|
156
|
-
for (; t; )
|
|
157
|
-
e.push(t), t = t.parent;
|
|
158
|
-
return e;
|
|
159
|
-
},
|
|
160
|
-
getContextMetrics: (e) => {
|
|
161
|
-
const t = e || u;
|
|
162
|
-
return t ? t.getMetrics() : null;
|
|
163
|
-
}
|
|
164
|
-
}, _ = new L(), p = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Set();
|
|
165
|
-
function V(e) {
|
|
166
|
-
e._enhancedLifecycle && C.add(e);
|
|
167
|
-
}
|
|
168
|
-
function F() {
|
|
169
|
-
for (const e of C) {
|
|
170
|
-
const t = e._enhancedLifecycle;
|
|
171
|
-
if (t && !e.domReady) {
|
|
172
|
-
const o = R(e);
|
|
173
|
-
if (o.length > 0) {
|
|
174
|
-
if (e.domElements = /* @__PURE__ */ new Map(), o.forEach((n, i) => {
|
|
175
|
-
const r = n.id || `element-${i}`;
|
|
176
|
-
e.domElements.set(r, n), e.primaryElement || (e.primaryElement = n);
|
|
177
|
-
}), e.domReady = !0, t.onDOMReady) {
|
|
178
|
-
console.log("🚀 Processing delayed onDOMReady for component:", e.id);
|
|
179
|
-
const n = t.onDOMReady(
|
|
180
|
-
e.domElements,
|
|
181
|
-
e.primaryElement
|
|
182
|
-
);
|
|
183
|
-
typeof n == "function" && (e.cleanup = e.cleanup || [], e.cleanup.push(n));
|
|
184
|
-
}
|
|
185
|
-
if (t.onMount) {
|
|
186
|
-
const n = t.onMount();
|
|
187
|
-
typeof n == "function" && (e.cleanup = e.cleanup || [], e.cleanup.push(n));
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
C.clear();
|
|
193
|
-
}
|
|
194
|
-
function R(e) {
|
|
195
|
-
if (e.id.startsWith("image-")) {
|
|
196
|
-
const t = document.querySelectorAll("img.tachui-image");
|
|
197
|
-
return Array.from(t);
|
|
198
|
-
}
|
|
199
|
-
return [];
|
|
200
|
-
}
|
|
201
|
-
function q(e) {
|
|
202
|
-
x((t) => {
|
|
203
|
-
const o = v("root-app");
|
|
204
|
-
y(o);
|
|
205
|
-
const n = b();
|
|
206
|
-
n && n.context.set(d, o);
|
|
207
|
-
let i;
|
|
208
|
-
try {
|
|
209
|
-
i = e();
|
|
210
|
-
const a = document.getElementById("app");
|
|
211
|
-
if (!a)
|
|
212
|
-
throw new Error('App container element with id="app" not found');
|
|
213
|
-
E(i, a);
|
|
214
|
-
} catch (a) {
|
|
215
|
-
throw y(null), n && n.context.delete(d), a;
|
|
216
|
-
}
|
|
217
|
-
const r = t;
|
|
218
|
-
return () => (y(null), n && n.context.delete(d), r());
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
function E(e, t, o = !0) {
|
|
222
|
-
try {
|
|
223
|
-
o && (t.innerHTML = "");
|
|
224
|
-
const n = e.render(), i = Array.isArray(n) ? n : [n], r = [];
|
|
225
|
-
for (const c of i) {
|
|
226
|
-
const s = _.render(c, t);
|
|
227
|
-
if (s instanceof DocumentFragment) {
|
|
228
|
-
const h = Array.from(s.childNodes);
|
|
229
|
-
for (const m of h)
|
|
230
|
-
m instanceof Element && (r.push(m), t.appendChild(m));
|
|
231
|
-
} else s instanceof Element && (r.push(s), t.appendChild(s));
|
|
232
|
-
}
|
|
233
|
-
if (r.length > 0) {
|
|
234
|
-
e.domElements = /* @__PURE__ */ new Map(), r.forEach((s, h) => {
|
|
235
|
-
const m = s.id || `element-${h}`;
|
|
236
|
-
e.domElements.set(m, s), e.primaryElement || (e.primaryElement = s);
|
|
237
|
-
}), e.domReady = !0;
|
|
238
|
-
const c = e._enhancedLifecycle;
|
|
239
|
-
if (c?.onDOMReady) {
|
|
240
|
-
const s = c.onDOMReady(
|
|
241
|
-
e.domElements,
|
|
242
|
-
e.primaryElement
|
|
243
|
-
);
|
|
244
|
-
typeof s == "function" && (e.cleanup = e.cleanup || [], e.cleanup.push(s));
|
|
245
|
-
}
|
|
246
|
-
if (c?.onMount) {
|
|
247
|
-
const s = c.onMount();
|
|
248
|
-
typeof s == "function" && (e.cleanup = e.cleanup || [], e.cleanup.push(s));
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
if (w(e))
|
|
252
|
-
for (const c of r)
|
|
253
|
-
T(c, e);
|
|
254
|
-
for (const c of r)
|
|
255
|
-
$(c, e);
|
|
256
|
-
const a = [];
|
|
257
|
-
return p.set(t, e), f.set(e, r), e.mounted = !0, setTimeout(() => {
|
|
258
|
-
F();
|
|
259
|
-
}, 0), () => {
|
|
260
|
-
a.forEach((c) => c()), I(e, t);
|
|
261
|
-
};
|
|
262
|
-
} catch (n) {
|
|
263
|
-
const i = Object.assign(new Error(), n, {
|
|
264
|
-
code: "MOUNT_FAILED",
|
|
265
|
-
context: "mountComponentTree"
|
|
266
|
-
}), r = e._enhancedLifecycle;
|
|
267
|
-
throw r?.onDOMError ? r.onDOMError(i, "mount") : r?.onError ? r.onError(i) : console.error("Failed to mount component tree:", n), n;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
function N(e, t) {
|
|
271
|
-
const o = f.get(e);
|
|
272
|
-
o && (o.forEach((n) => {
|
|
273
|
-
n.parentNode && n.parentNode.removeChild(n);
|
|
274
|
-
}), f.delete(e)), p.delete(t), e.mounted = !1, e.cleanup && (e.cleanup.forEach((n) => n()), e.cleanup = []);
|
|
275
|
-
}
|
|
276
|
-
function I(e, t) {
|
|
277
|
-
try {
|
|
278
|
-
const o = e._enhancedLifecycle;
|
|
279
|
-
o?.onUnmount && o.onUnmount(), e.cleanup && (e.cleanup.forEach((i) => {
|
|
280
|
-
try {
|
|
281
|
-
i();
|
|
282
|
-
} catch (r) {
|
|
283
|
-
console.error(`Cleanup error for component ${e.id}:`, r);
|
|
284
|
-
}
|
|
285
|
-
}), e.cleanup = []);
|
|
286
|
-
const n = f.get(e);
|
|
287
|
-
n && (n.forEach((i) => {
|
|
288
|
-
i.parentNode && i.parentNode.removeChild(i);
|
|
289
|
-
}), f.delete(e)), e.domElements && e.domElements.clear(), e.primaryElement = void 0, e.domReady = !1, e.mounted = !1, p.delete(t);
|
|
290
|
-
} catch (o) {
|
|
291
|
-
const n = Object.assign(new Error(), o, {
|
|
292
|
-
code: "UNMOUNT_FAILED",
|
|
293
|
-
context: "unmountComponentEnhanced"
|
|
294
|
-
}), i = e._enhancedLifecycle;
|
|
295
|
-
i?.onDOMError ? i.onDOMError(n, "unmount") : console.error("Component unmounting failed:", o);
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
function T(e, t) {
|
|
299
|
-
if (!("modifiers" in t) || !t.modifiers)
|
|
300
|
-
return;
|
|
301
|
-
const o = e, n = t.modifiers, i = {
|
|
302
|
-
type: "element",
|
|
303
|
-
tag: o.tagName.toLowerCase(),
|
|
304
|
-
props: {},
|
|
305
|
-
element: o
|
|
306
|
-
};
|
|
307
|
-
for (const r of n)
|
|
308
|
-
try {
|
|
309
|
-
r && typeof r.apply == "function" && r.apply(i, {
|
|
310
|
-
componentId: t.id,
|
|
311
|
-
componentInstance: t,
|
|
312
|
-
element: o,
|
|
313
|
-
phase: "creation"
|
|
314
|
-
});
|
|
315
|
-
} catch (a) {
|
|
316
|
-
console.warn("Failed to apply modifier:", r, a);
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
function $(e, t) {
|
|
320
|
-
const o = e;
|
|
321
|
-
if (t.props) {
|
|
322
|
-
const n = t.props;
|
|
323
|
-
n.onClick && typeof n.onClick == "function" && o.addEventListener("click", n.onClick), n.onMouseEnter && typeof n.onMouseEnter == "function" && o.addEventListener("mouseenter", n.onMouseEnter), n.onMouseLeave && typeof n.onMouseLeave == "function" && o.addEventListener("mouseleave", n.onMouseLeave), n.onFocus && typeof n.onFocus == "function" && o.addEventListener("focus", n.onFocus), n.onBlur && typeof n.onBlur == "function" && o.addEventListener("blur", n.onBlur);
|
|
324
|
-
}
|
|
325
|
-
if (w(t) && t.modifiers) {
|
|
326
|
-
for (const n of t.modifiers)
|
|
327
|
-
if (n && "eventHandlers" in n && n.eventHandlers)
|
|
328
|
-
for (const [i, r] of Object.entries(n.eventHandlers))
|
|
329
|
-
typeof r == "function" && o.addEventListener(
|
|
330
|
-
i,
|
|
331
|
-
r
|
|
332
|
-
);
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
function w(e) {
|
|
336
|
-
return e && typeof e == "object" && ("modifiers" in e || "modifier" in e);
|
|
337
|
-
}
|
|
338
|
-
function K(e, t) {
|
|
339
|
-
const o = [];
|
|
340
|
-
for (const n of e) {
|
|
341
|
-
const i = E(n, t);
|
|
342
|
-
o.push(i);
|
|
343
|
-
}
|
|
344
|
-
return o;
|
|
345
|
-
}
|
|
346
|
-
function G(e, t) {
|
|
347
|
-
const o = f.get(e);
|
|
348
|
-
if (!o) {
|
|
349
|
-
console.warn("Attempted to update unmounted component");
|
|
350
|
-
return;
|
|
351
|
-
}
|
|
352
|
-
e.prevProps = e.props, e.props = { ...e.props, ...t };
|
|
353
|
-
const n = o[0]?.parentElement;
|
|
354
|
-
n && (N(e, n), E(e, n));
|
|
355
|
-
}
|
|
356
|
-
function J(e) {
|
|
357
|
-
let t = e;
|
|
358
|
-
for (; t; ) {
|
|
359
|
-
const o = p.get(t);
|
|
360
|
-
if (o)
|
|
361
|
-
return o;
|
|
362
|
-
t = t.parentElement;
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
const Q = {
|
|
366
|
-
getMountedComponents: () => Array.from(p.entries()),
|
|
367
|
-
getComponentElements: (e) => f.get(e),
|
|
368
|
-
isComponentMounted: (e) => e.mounted || !1,
|
|
369
|
-
/**
|
|
370
|
-
* Validate that all components are properly mounted
|
|
371
|
-
*/
|
|
372
|
-
validateMounting() {
|
|
373
|
-
const e = [];
|
|
374
|
-
for (const [t, o] of p.entries()) {
|
|
375
|
-
document.contains(t) || e.push(`Container for component ${o.id} is not in DOM`), o.mounted || e.push(`Component ${o.id} marked as unmounted but still registered`);
|
|
376
|
-
const n = f.get(o);
|
|
377
|
-
(!n || n.length === 0) && e.push(`Component ${o.id} has no associated DOM elements`);
|
|
378
|
-
}
|
|
379
|
-
return {
|
|
380
|
-
valid: e.length === 0,
|
|
381
|
-
issues: e
|
|
382
|
-
};
|
|
383
|
-
}
|
|
384
|
-
};
|
|
385
|
-
export {
|
|
386
|
-
z as C,
|
|
387
|
-
Q as D,
|
|
388
|
-
k as E,
|
|
389
|
-
d as a,
|
|
390
|
-
v as b,
|
|
391
|
-
j as c,
|
|
392
|
-
P as d,
|
|
393
|
-
A as e,
|
|
394
|
-
J as f,
|
|
395
|
-
M as g,
|
|
396
|
-
K as h,
|
|
397
|
-
E as i,
|
|
398
|
-
I as j,
|
|
399
|
-
G as k,
|
|
400
|
-
q as m,
|
|
401
|
-
W as p,
|
|
402
|
-
V as r,
|
|
403
|
-
y as s,
|
|
404
|
-
N as u,
|
|
405
|
-
B as w
|
|
406
|
-
};
|