@actdim/dynstruct 1.0.5 → 1.1.0

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 (51) hide show
  1. package/dist/appDomain/appContracts.d.ts +1 -1
  2. package/dist/appDomain/appContracts.es.js.map +1 -1
  3. package/dist/componentModel/DynamicContent.d.ts +2 -5
  4. package/dist/componentModel/DynamicContent.d.ts.map +1 -1
  5. package/dist/componentModel/DynamicContent.es.js +7 -6
  6. package/dist/componentModel/DynamicContent.es.js.map +1 -1
  7. package/dist/componentModel/adapters.d.ts +13 -0
  8. package/dist/componentModel/adapters.d.ts.map +1 -0
  9. package/dist/componentModel/adapters.es.js +30 -0
  10. package/dist/componentModel/adapters.es.js.map +1 -0
  11. package/dist/componentModel/componentContext.es.js +1 -1
  12. package/dist/componentModel/componentModel.d.ts +55 -43
  13. package/dist/componentModel/componentModel.d.ts.map +1 -1
  14. package/dist/componentModel/componentModel.es.js +257 -225
  15. package/dist/componentModel/componentModel.es.js.map +1 -1
  16. package/dist/componentModel/scope.d.ts +3 -6
  17. package/dist/componentModel/scope.d.ts.map +1 -1
  18. package/dist/componentModel/scope.es.js +2 -2
  19. package/dist/componentModel/scope.es.js.map +1 -1
  20. package/dist/net/request.d.ts +2 -2
  21. package/dist/net/request.d.ts.map +1 -1
  22. package/dist/net/request.es.js.map +1 -1
  23. package/dist/services/NavService.d.ts +4 -5
  24. package/dist/services/NavService.d.ts.map +1 -1
  25. package/dist/services/NavService.es.js +26 -27
  26. package/dist/services/NavService.es.js.map +1 -1
  27. package/dist/services/ServiceProvider.d.ts +6 -0
  28. package/dist/services/ServiceProvider.d.ts.map +1 -0
  29. package/dist/services/ServiceProvider.es.js +17 -0
  30. package/dist/services/ServiceProvider.es.js.map +1 -0
  31. package/dist/services/StorageService.d.ts +4 -4
  32. package/dist/services/StorageService.d.ts.map +1 -1
  33. package/dist/services/StorageService.es.js +13 -12
  34. package/dist/services/StorageService.es.js.map +1 -1
  35. package/package.json +3 -3
  36. package/dist/appDomain/adapters.d.ts +0 -10
  37. package/dist/appDomain/adapters.d.ts.map +0 -1
  38. package/dist/appDomain/adapters.es.js +0 -25
  39. package/dist/appDomain/adapters.es.js.map +0 -1
  40. package/dist/appDomain/reactHooks.d.ts +0 -6
  41. package/dist/appDomain/reactHooks.d.ts.map +0 -1
  42. package/dist/appDomain/reactHooks.es.js +0 -12
  43. package/dist/appDomain/reactHooks.es.js.map +0 -1
  44. package/dist/dist/componentModel/componentContext.es.es.js +0 -15
  45. package/dist/dist/componentModel/componentContext.es.es.js.map +0 -1
  46. package/dist/dist/componentModel/componentModel.es.es.js +0 -260
  47. package/dist/dist/componentModel/componentModel.es.es.js.map +0 -1
  48. package/dist/dist/globals.es.es.js +0 -10
  49. package/dist/dist/globals.es.es.js.map +0 -1
  50. package/dist/dist/reactHooks.es.es.js +0 -9
  51. package/dist/dist/reactHooks.es.es.js.map +0 -1
@@ -1,13 +1,13 @@
1
- import P, { useLayoutEffect as G, useMemo as S, useEffect as U } from "react";
2
- import { observer as z } from "mobx-react-lite";
3
- import { observable as A, runInAction as L } from "mobx";
4
- import { useLazyRef as M } from "../reactHooks.es.js";
5
- import { getGlobalFlags as w } from "../globals.es.js";
6
- import { useComponentContext as _, ReactComponentContext as p } from "./componentContext.es.js";
7
- import { lazy as V } from "@actdim/utico/utils";
8
- var Z = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.FromAncestors = 1] = "FromAncestors", e[e.FromDescendants = 2] = "FromDescendants", e))(Z || {});
9
- const E = Symbol("$isBinding");
10
- class H {
1
+ import O, { useLayoutEffect as S, useMemo as p, useEffect as J } from "react";
2
+ import { observer as V } from "mobx-react-lite";
3
+ import { autorun as Z, observable as G, isObservable as R, runInAction as K, toJS as T } from "mobx";
4
+ import { useLazyRef as W } from "../reactHooks.es.js";
5
+ import { getGlobalFlags as P } from "../globals.es.js";
6
+ import { useComponentContext as q, ReactComponentContext as Q } from "./componentContext.es.js";
7
+ import { lazy as X } from "@actdim/utico/utils";
8
+ var Y = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.FromAncestors = 1] = "FromAncestors", e[e.FromDescendants = 2] = "FromDescendants", e))(Y || {});
9
+ const x = Symbol("$isBinding");
10
+ class U {
11
11
  // getter
12
12
  get;
13
13
  // setter
@@ -15,195 +15,277 @@ class H {
15
15
  converter;
16
16
  validator;
17
17
  readOnly;
18
- constructor(t, o, n, r) {
19
- this.get = t, this.set = o, this.converter = n, this.validator = r, this.readOnly = !!o, this[E] = !0;
18
+ constructor(n, t, r, a) {
19
+ this.get = n, this.set = t, this.converter = r, this.validator = a, this.readOnly = !!t, this[x] = !0;
20
20
  }
21
- [E];
21
+ [x];
22
22
  }
23
- function J(e) {
24
- return e[E] === !0;
23
+ function D(e) {
24
+ return e[x] === !0;
25
25
  }
26
- function ue(e, t, o, n) {
27
- return new H(e, t, o, n);
26
+ function ye(e, n, t, r) {
27
+ return new U(e, n, t, r);
28
28
  }
29
- function ae(e, t) {
30
- return new H(
31
- () => e()[t],
32
- (o) => {
33
- e()[t] = o;
29
+ function be(e, n) {
30
+ return new U(
31
+ () => e()[n],
32
+ (t) => {
33
+ e()[n] = t;
34
34
  }
35
35
  );
36
36
  }
37
- const K = "onGet", T = "onChanging", q = "onChange";
38
- function Q(e, t, o) {
39
- const n = o.onPropChanging, r = o.onPropChange;
40
- return new Proxy(e, {
41
- get(c, l, a) {
42
- const h = o[l]?.onGet;
43
- if (h)
44
- return h();
45
- const b = t.get(String(l));
46
- if (b) {
47
- let d;
48
- return d = b.get(), d;
49
- }
50
- return Reflect.get(c, l, a);
37
+ const m = "onGet", ee = "onChanging", te = "onChange", H = /* @__PURE__ */ new WeakMap();
38
+ function z(e, n, t) {
39
+ if (typeof e != "object" || e === null || !R(e))
40
+ return e;
41
+ if (H.has(e))
42
+ return H.get(e);
43
+ const r = new Proxy(e, {
44
+ get(a, s, u) {
45
+ const l = t[s]?.onGet;
46
+ if (l) return l();
47
+ const d = n.get(s);
48
+ if (d?.get)
49
+ return d.get();
50
+ const f = Reflect.get(a, s, u);
51
+ return typeof f == "object" && f !== null && R(f) ? z(f, n, t) : f;
51
52
  },
52
- set(c, l, a, h) {
53
- const b = c[l], d = o[l]?.onChanging;
54
- if (d && !d(b, a) || n && !n(l, b, a))
53
+ set(a, s, u, l) {
54
+ const d = a[s], f = t[s]?.onChanging;
55
+ if (f && f(d, u) === !1 || t.onPropChanging && t.onPropChanging(s, d, u) === !1)
55
56
  return !0;
56
- const k = L(() => Reflect.set(c, l, a, h)), g = t.get(l);
57
- g?.set && g.set(a);
58
- const f = o[l]?.onChange;
59
- return f && f(a), r && r(l, a), k;
57
+ const h = K(() => Reflect.set(a, s, u, l));
58
+ return n.get(s)?.set?.(u), t[s]?.onChange?.(u), t.onPropChange?.(s, u), h;
60
59
  }
61
60
  });
61
+ return H.set(e, r), r;
62
62
  }
63
- function N(e) {
63
+ function $(e) {
64
64
  return e.replace(/^./, e[0].toUpperCase());
65
65
  }
66
- const D = {
66
+ const j = {
67
67
  sources: /* @__PURE__ */ new Map(),
68
68
  count: 0
69
69
  };
70
- function W(e, t = 1) {
71
- return e.split(/[?#]/)[0].split("/").filter(Boolean).map((a) => decodeURIComponent(a)).slice(-t).join("-").normalize("NFKD").replace(/[^a-zA-Z0-9\-_:.+#]/g, "-").replace(/-+/g, "-").replace(/^[^a-zA-Z]+/, "-").replace(/[+#]$/, "-");
70
+ function re(e, n = 1) {
71
+ return e.split(/[?#]/)[0].split("/").filter(Boolean).map((l) => decodeURIComponent(l)).slice(-n).join("-").normalize("NFKD").replace(/[^a-zA-Z0-9\-_:.+#]/g, "-").replace(/-+/g, "-").replace(/^[^a-zA-Z]+/, "-").replace(/[+#]$/, "-");
72
72
  }
73
- function X(e = 2) {
74
- const o = new Error().stack?.split(`
73
+ function ne(e = 2) {
74
+ const t = new Error().stack?.split(`
75
75
  `);
76
- if (!o || o.length <= e) return null;
77
- const n = o[e].match(/\((.*):\d+:\d+\)/);
78
- return n ? n[1] : null;
76
+ if (!t || t.length <= e) return null;
77
+ const r = t[e].match(/\((.*):\d+:\d+\)/);
78
+ return r ? r[1] : null;
79
79
  }
80
- function Y(e) {
81
- const t = e?.msgBroker.provide;
82
- if (t)
83
- for (const [n, r] of Object.entries(t))
84
- for (const [c, l] of Object.entries(r)) {
85
- const a = l, h = a.callback;
86
- h && (a.callback = (g, f) => h(g, f, e));
87
- const b = a.filter, d = a.componentFilter || 0, k = (g) => {
88
- let f = !0;
89
- return d & 1 && (f = e.$.getChainUp().indexOf(g.headers?.sourceId) >= 0), f && d & 2 && (f = e.$.getChainDown().indexOf(g.headers?.sourceId) >= 0), f && b && (f = b(g, e)), f;
80
+ function oe(e) {
81
+ const n = e?.msgBroker.provide;
82
+ if (n)
83
+ for (const [r, a] of Object.entries(n))
84
+ for (const [s, u] of Object.entries(a)) {
85
+ const l = u, d = l.callback;
86
+ d && (l.callback = (y, g) => d(y, g, e));
87
+ const f = l.filter, h = l.componentFilter || 0, v = (y) => {
88
+ let g = !0;
89
+ return h & 1 && (g = e.getChainUp().indexOf(y.headers?.sourceId) >= 0), g && h & 2 && (g = e.getChainDown().indexOf(y.headers?.sourceId) >= 0), g && f && (g = f(y, e)), g;
90
90
  };
91
- a.filter = k, e.msgBus.provide({
92
- ...l,
93
- channel: n,
94
- group: c,
91
+ l.filter = v, e.msgBus.provide({
92
+ ...u,
93
+ channel: r,
94
+ group: s,
95
95
  config: {
96
96
  abortSignal: e.msgBroker.abortController.signal
97
97
  }
98
98
  });
99
99
  }
100
- const o = e?.msgBroker?.subscribe;
101
- if (o)
102
- for (const [n, r] of Object.entries(o))
103
- for (const [c, l] of Object.entries(r)) {
104
- const a = l, h = a.callback;
105
- h && (a.callback = (g) => h(g, e));
106
- const b = a.filter, d = a.componentFilter || 0, k = (g) => {
107
- let f = !0;
108
- return d & 1 && (f = e.$.getChainUp().indexOf(g.headers?.sourceId) >= 0), f && d & 2 && (f = e.$.getChainDown().indexOf(g.headers?.sourceId) >= 0), f && b && (f = b(g, e)), f;
100
+ const t = e?.msgBroker?.subscribe;
101
+ if (t)
102
+ for (const [r, a] of Object.entries(t))
103
+ for (const [s, u] of Object.entries(a)) {
104
+ const l = u, d = l.callback;
105
+ d && (l.callback = (y) => d(y, e));
106
+ const f = l.filter, h = l.componentFilter || 0, v = (y) => {
107
+ let g = !0;
108
+ return h & 1 && (g = e.getChainUp().indexOf(y.headers?.sourceId) >= 0), g && h & 2 && (g = e.getChainDown().indexOf(y.headers?.sourceId) >= 0), g && f && (g = f(y, e)), g;
109
109
  };
110
- a.filter = k, e.msgBus.on({
111
- ...l,
112
- channel: n,
113
- group: c,
110
+ l.filter = v, e.msgBus.on({
111
+ ...u,
112
+ channel: r,
113
+ group: s,
114
114
  config: {
115
115
  abortSignal: e.msgBroker.abortController.signal
116
116
  }
117
117
  });
118
118
  }
119
119
  }
120
- function m(e, t) {
121
- const o = (n) => {
122
- n.headers || (n.headers = {}), n.headers.sourceId == null && (n.headers.sourceId = t.id);
120
+ function ie(e, n) {
121
+ const t = (r) => {
122
+ r.payload != null && (r.payload = structuredClone(T(r.payload))), r.headers || (r.headers = {}), n?.(r.headers);
123
123
  };
124
124
  return {
125
125
  config: e.config,
126
- on: (n) => e.on(n),
127
- onceAsync: (n) => e.onceAsync(n),
128
- stream: (n) => e.stream(n),
129
- provide: (n) => (o(n), e.provide(n)),
130
- dispatch: (n) => (o(n), e.dispatch(n)),
131
- dispatchAsync: (n) => (o(n), e.dispatchAsync(n))
126
+ on: (r) => e.on(r),
127
+ onceAsync: (r) => e.onceAsync(r),
128
+ stream: (r) => e.stream(r),
129
+ provide: (r) => (t(r), e.provide(r)),
130
+ dispatch: (r) => (t(r), e.dispatch(r)),
131
+ dispatchAsync: (r) => (t(r), e.dispatchAsync(r))
132
132
  };
133
133
  }
134
- function ee(e, t) {
135
- const o = /* @__PURE__ */ new Map(), n = e.view;
136
- let r, c, l = e.msgBus;
137
- const a = V(() => m(l, c));
138
- let h = {
134
+ function se(e, n, t) {
135
+ let r = null, a = !1, s;
136
+ const u = () => {
137
+ r || (r = Z(
138
+ () => {
139
+ if (!a) {
140
+ const v = t(e);
141
+ typeof v == "function" && (v(), s = v);
142
+ }
143
+ },
144
+ { name: `effect:${n}` }
145
+ ));
146
+ }, l = () => {
147
+ r?.(), r = null, s && (s(), s = void 0);
148
+ }, d = () => {
149
+ a = !0;
150
+ }, f = () => {
151
+ a = !1;
152
+ }, h = () => {
153
+ l(), u();
154
+ };
155
+ return u(), { start: u, pause: d, resume: f, stop: l, restart: h };
156
+ }
157
+ function ce(e, n) {
158
+ let t, r;
159
+ e || (e = {}), n || (n = {});
160
+ const a = e.view;
161
+ let s = e.msgBus;
162
+ const u = /* @__PURE__ */ new Map(), l = X(() => ie(s, (o) => {
163
+ o?.sourceId == null && (o.sourceId = t.id);
164
+ }));
165
+ let d = {
139
166
  ...e.msgBroker
140
167
  };
141
- h.abortController || (h.abortController = new AbortController());
142
- const b = z((s) => {
143
- const i = c.id, u = _(), v = u.currentId;
144
- c.parentId = v, l || (l = u.msgBus);
145
- const y = S(
146
- () => ({ ...u, currentId: i }),
147
- [e, t, u]
168
+ d.abortController || (d.abortController = new AbortController());
169
+ const f = V((o) => {
170
+ const i = t.id, c = q(), I = c.currentId;
171
+ t.parentId = I, s || (s = c.msgBus);
172
+ const C = p(
173
+ () => ({ ...c, currentId: i }),
174
+ [e, n, c]
148
175
  );
149
- G(() => {
176
+ S(() => {
150
177
  try {
151
- if (w().debug) {
152
- const C = c.getHierarchyId;
153
- console.debug(`${C}>layout`);
178
+ if (P().debug) {
179
+ const b = t.getHierarchyId();
180
+ console.debug(`${b}>layout`);
154
181
  }
155
- u.register(i, v), c.getHierarchyId = () => u.getHierarchyPath(i), c.getChainDown = () => u.getChainDown(i), c.getChainUp = () => u.getChainUp(i), c.getChildren = () => u.getChildren(i), c.getParent = () => u.getParent(i), c.getNodeMap = () => u.getNodeMap(), Y(r), e.events?.onLayout?.(r), t?.onLayout?.(r);
156
- } catch (C) {
157
- e.events?.onError?.(r, C), t?.onError?.(r, C);
182
+ c.register(i, I), t.getHierarchyId = () => c.getHierarchyPath(i), t.getChainDown = () => c.getChainDown(i), t.getChainUp = () => c.getChainUp(i), t.getChildren = () => c.getChildren(i), t.getParent = () => c.getParent(i), t.getNodeMap = () => c.getNodeMap(), oe(t), e.events?.onLayout?.(t), n.onLayout?.(t);
183
+ } catch (b) {
184
+ e.events?.onError?.(t, b), n.onError?.(t, b);
158
185
  }
159
186
  return () => {
160
- if (w().debug) {
161
- const C = c.getHierarchyId;
162
- console.debug(`${C}>layout-destroy`);
187
+ if (P().debug) {
188
+ const b = t.getHierarchyId();
189
+ console.debug(`${b}>layout-destroy`);
163
190
  }
164
- u.unregister(i), h.abortController.abort(), e.events?.onLayoutDestroy?.(r), t?.onLayoutDestroy?.(r);
191
+ c.unregister(i), d.abortController?.abort(), e.events?.onLayoutDestroy?.(t), n.onLayoutDestroy?.(t);
165
192
  };
166
- }, [e, t, u]), U(() => {
193
+ }, [e, n, c]), J(() => {
167
194
  try {
168
- if (w().debug) {
169
- const C = c.getHierarchyId;
170
- console.debug(`${C}>ready`);
195
+ if (P().debug) {
196
+ const b = t.getHierarchyId();
197
+ console.debug(`${b}>ready`);
171
198
  }
172
- e.events?.onReady?.(r), t?.onReady?.(r);
173
- } catch (C) {
174
- if (w().debug) {
175
- const B = c.getHierarchyId;
176
- console.debug(`${B}>destroy`);
199
+ e.events?.onReady?.(t), n.onReady?.(t);
200
+ } catch (b) {
201
+ if (P().debug) {
202
+ const N = t.getHierarchyId();
203
+ console.debug(`${N}>destroy`);
177
204
  }
178
- e.events?.onError?.(r, C), t?.onError?.(r, C);
205
+ e.events?.onError?.(t, b), n.onError?.(t, b);
179
206
  }
180
207
  return () => {
181
- e.events?.onDestroy?.(r), t?.onDestroy?.(r);
208
+ e.events?.onDestroy?.(t), n.onDestroy?.(t);
182
209
  };
183
- }, [e, t, u]);
184
- let I;
210
+ }, [e, n, c]);
211
+ let k;
185
212
  try {
186
- if (w().debug) {
187
- const C = c.getHierarchyId;
188
- console.debug(`${C}>view`);
213
+ if (P().debug) {
214
+ const b = t.getHierarchyId();
215
+ console.debug(`${b}>view`);
189
216
  }
190
- typeof n == "function" ? I = n(s, r) : I = /* @__PURE__ */ P.createElement(P.Fragment, null, s.children);
191
- } catch (C) {
192
- const B = JSON.stringify(C);
193
- I = /* @__PURE__ */ P.createElement(P.Fragment, null, B);
217
+ typeof a == "function" ? k = a(o, t) : k = /* @__PURE__ */ O.createElement(O.Fragment, null, o.children);
218
+ } catch (b) {
219
+ const N = JSON.stringify(b);
220
+ k = /* @__PURE__ */ O.createElement(O.Fragment, null, N);
194
221
  }
195
- return /* @__PURE__ */ P.createElement(p.Provider, { value: y }, I);
222
+ return /* @__PURE__ */ O.createElement(Q.Provider, { value: C }, k);
196
223
  });
197
- let d;
198
- const k = D.sources, g = X(6), f = W(g, 2);
199
- k.has(g) ? (d = k.get(g), d.count++) : (d = {
200
- structId: e.name || f || `Component_${D.count}`,
224
+ let h;
225
+ const v = j.sources, y = ne(6), g = re(y, 2);
226
+ v.has(y) ? (h = v.get(y), h.count++) : (h = {
227
+ structId: e.name || g || `Component_${j.count}`,
201
228
  count: 0
202
- }, k.set(g, d), D.count++);
203
- const $ = `${d.structId}#${d.count}`;
204
- if (c = {
205
- bindings: o,
206
- id: $,
229
+ }, v.set(y, h), j.count++);
230
+ const w = `${h.structId}#${h.count}`, E = {};
231
+ if (r = {}, e.props && Object.assign(r, e.props), e.actions && Object.assign(r, e.actions), e.children)
232
+ for (const [o, i] of Object.entries(e.children))
233
+ if (typeof i == "function") {
234
+ const c = i, I = (C) => {
235
+ const k = c(C);
236
+ return /* @__PURE__ */ O.createElement(k.View, null);
237
+ };
238
+ Reflect.set(E, $(o), I);
239
+ } else
240
+ Reflect.set(E, o, i);
241
+ for (const [o, i] of Object.entries(n))
242
+ o in r && (D(i) ? u.set(o, i) : Reflect.set(r, o, i));
243
+ const B = {
244
+ onPropChanging: n.onPropChanging || e.events?.onPropChanging ? (o, i, c) => {
245
+ let I = !0, C = n.onPropChanging;
246
+ return C && (I = C(String(o), i, c)), I && (C = e.events?.onPropChanging, C && (I = C(String(o), i, c))), I;
247
+ } : void 0,
248
+ onPropChange: n.onPropChange || e.events?.onPropChange ? (o, i) => {
249
+ n.onPropChange?.(String(o), i), e.events?.onPropChange?.(String(o), i);
250
+ } : void 0
251
+ };
252
+ function L(o) {
253
+ const i = `${m}${$(o)}`;
254
+ return n[i] || e.events?.[i];
255
+ }
256
+ function M(o) {
257
+ const i = `${ee}${$(o)}`;
258
+ return ((c, I) => {
259
+ let C = !0, k = n[i];
260
+ return k && (C = k(c, I)), C && (k = e.events?.[i], k && (C = k(c, I))), C;
261
+ });
262
+ }
263
+ function _(o) {
264
+ const i = `${te}${$(o)}`;
265
+ return ((c) => {
266
+ n[i]?.(c), e.events?.[i]?.(c);
267
+ });
268
+ }
269
+ let F = {};
270
+ if (e.props) {
271
+ for (const o of Object.keys(e.props))
272
+ B[o] = {
273
+ onGet: L(o),
274
+ onChanging: M(o),
275
+ onChange: _(o)
276
+ };
277
+ for (const o of Object.keys(e.props))
278
+ F[o] = G.deep;
279
+ }
280
+ if (e.actions)
281
+ for (const o of Object.keys(e.actions))
282
+ ;
283
+ r = G(r, F, {
284
+ deep: !0
285
+ }), r = z(r, u, B);
286
+ let A = {};
287
+ if (t = {
288
+ id: w,
207
289
  parentId: void 0,
208
290
  getHierarchyId: () => {
209
291
  },
@@ -216,96 +298,46 @@ function ee(e, t) {
216
298
  getParent: () => {
217
299
  },
218
300
  getNodeMap: () => {
219
- }
220
- }, r = {
221
- ...e.props,
222
- ...e.methods,
223
- // view: component.view,
224
- View: b,
301
+ },
302
+ bindings: u,
225
303
  get msgBus() {
226
- return a();
304
+ return l();
227
305
  },
228
- msgBroker: h,
229
- $: c
230
- }, e.children)
231
- for (const [s, i] of Object.entries(e.children))
232
- if (typeof i == "function") {
233
- const u = i, v = (y) => {
234
- const I = u(y);
235
- return /* @__PURE__ */ P.createElement(I.View, null);
236
- };
237
- Reflect.set(r, N(s), v);
238
- } else
239
- Reflect.set(r, s, i);
240
- for (const [s, i] of Object.entries(t))
241
- J(i) ? o.set(s, i) : Reflect.set(r, s, i);
242
- const O = {};
243
- if (e.props)
244
- for (const s of Object.keys(e.props))
245
- O[s] = A.ref;
246
- if (e.methods)
247
- for (const s of Object.keys(e.methods))
248
- O[s] = !1;
249
- if (e.children)
250
- for (const s of Object.keys(e.children))
251
- O[s] = !1;
252
- O.View = !1, O.msgBus = !1, O.$ = !1;
253
- const F = {
254
- onPropChanging: t?.onPropChanging || e.events?.onPropChanging ? (s, i, u) => {
255
- let v = !0, y = t.onPropChanging;
256
- return y && (v = y(String(s), i, u)), v && (y = e.events?.onPropChanging, y && (v = y(String(s), i, u))), v;
257
- } : void 0,
258
- onPropChange: t?.onPropChange || e.events?.onPropChange ? (s, i) => {
259
- t.onPropChange?.(String(s), i), e.events.onPropChange?.(String(s), i);
260
- } : void 0
261
- };
262
- function R(s) {
263
- const i = `${K}${N(s)}`;
264
- return t[i] || e.events?.[i];
265
- }
266
- function j(s) {
267
- const i = `${T}${N(s)}`;
268
- return ((u, v) => {
269
- let y = !0, I = t[i];
270
- return I && (y = I(u, v)), y && (I = e.events[i], I && (y = I(u, v))), y;
271
- });
272
- }
273
- function x(s) {
274
- const i = `${q}${N(s)}`;
275
- return ((u) => {
276
- t[i]?.(u), e.events[i]?.(u);
277
- });
278
- }
279
- if (e.props)
280
- for (const s of Object.keys(e.props))
281
- F[s] = {
282
- onGet: R(s),
283
- onChanging: j(s),
284
- onChange: x(s)
285
- };
286
- return r = A(r, O, {
287
- deep: !0
288
- }), r = Q(r, o, F), e.events?.onInit && e.events.onInit(r), t?.onInit && t.onInit(r), r;
306
+ msgBroker: d,
307
+ effects: A,
308
+ // view: componentDef.view,
309
+ View: f,
310
+ children: E,
311
+ model: r
312
+ }, e.effects)
313
+ for (const [o, i] of Object.entries(e.effects))
314
+ A[o] = se(
315
+ t,
316
+ o,
317
+ i
318
+ );
319
+ return e.events?.onInit && e.events.onInit(t), n.onInit && n.onInit(t), t;
289
320
  }
290
- function le(e, t) {
291
- const o = M(() => ee(e, t));
292
- return G(() => () => {
293
- o.current = null;
294
- }, [e, t]), o.current;
321
+ function Ce(e, n) {
322
+ const t = W(() => ce(e, n));
323
+ return S(() => () => {
324
+ t.current = null;
325
+ }, [e, n]), t.current;
295
326
  }
296
- function fe(e) {
297
- return (o) => {
298
- const n = e(o);
299
- return /* @__PURE__ */ P.createElement(n.View, { ...o });
327
+ function ve(e) {
328
+ return (t) => {
329
+ const r = e(t);
330
+ return /* @__PURE__ */ O.createElement(r.View, { ...t });
300
331
  };
301
332
  }
302
333
  export {
303
- Z as ComponentMsgFilter,
304
- ue as bind,
305
- ae as bindProp,
306
- fe as getFC,
307
- J as isBinding,
308
- W as toHtmlId,
309
- le as useComponent
334
+ Y as ComponentMsgFilter,
335
+ ye as bind,
336
+ be as bindProp,
337
+ se as createEffect,
338
+ ve as getFC,
339
+ D as isBinding,
340
+ re as toHtmlId,
341
+ Ce as useComponent
310
342
  };
311
343
  //# sourceMappingURL=componentModel.es.js.map