@telia-ace/widget-core 1.0.21-experimental.2 → 1.0.21-experimental.3
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/dist/component-resolver.d.ts +4 -3
- package/dist/index.js +372 -408
- package/dist/index.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,63 +1,61 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var V = Object.defineProperty, j = Object.defineProperties;
|
|
2
|
+
var z = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var S = Object.getOwnPropertySymbols;
|
|
4
|
+
var Q = Object.prototype.hasOwnProperty, q = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var D = (s, t, e) => t in s ? V(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, y = (s, t) => {
|
|
6
6
|
for (var e in t || (t = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var e of
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
class xt {
|
|
7
|
+
Q.call(t, e) && D(s, e, t[e]);
|
|
8
|
+
if (S)
|
|
9
|
+
for (var e of S(t))
|
|
10
|
+
q.call(t, e) && D(s, e, t[e]);
|
|
11
|
+
return s;
|
|
12
|
+
}, _ = (s, t) => j(s, z(t));
|
|
13
|
+
import { bootstrapImplementation as F, ConfigurationApi as G } from "@webprovisions/bootstrapping";
|
|
14
|
+
import { selectImplementations as K, createConfigurationApi as W, version as J, Environment as U, Implementation as X, Plugin as Y, WidgetType as Z } from "@webprovisions/platform";
|
|
15
|
+
import { uuid as O, Logger as k } from "@telia-ace/widget-utilities";
|
|
16
|
+
class yt {
|
|
18
17
|
constructor(t) {
|
|
19
|
-
u(this, "events");
|
|
20
18
|
const { events: e } = t.get("$widget");
|
|
21
19
|
this.events = e.createChild(this);
|
|
22
20
|
}
|
|
23
|
-
action(t, e,
|
|
24
|
-
this.events.dispatch("data:action", { action: e, value:
|
|
21
|
+
action(t, e, n) {
|
|
22
|
+
this.events.dispatch("data:action", { action: e, value: n, target: t }, { bubbles: !0 });
|
|
25
23
|
}
|
|
26
24
|
subscribe(t, e) {
|
|
27
25
|
return this.events.subscribe(
|
|
28
26
|
"data:action",
|
|
29
|
-
(
|
|
27
|
+
(n, { action: i, value: r, target: c }) => t === c && e(t, i, r)
|
|
30
28
|
);
|
|
31
29
|
}
|
|
32
30
|
}
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
const xt = (s, t, e = {}) => F(
|
|
32
|
+
s,
|
|
33
|
+
s.bindings,
|
|
36
34
|
() => {
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
if (typeof
|
|
40
|
-
return
|
|
41
|
-
if (
|
|
35
|
+
const n = s.container.get("$runtimecfg").map((i) => {
|
|
36
|
+
const r = i[0];
|
|
37
|
+
if (typeof r == "function")
|
|
38
|
+
return r;
|
|
39
|
+
if (K(r)(s))
|
|
42
40
|
return i[1];
|
|
43
41
|
}).filter((i) => !!i);
|
|
44
|
-
return (t ? [t] : []).concat(
|
|
42
|
+
return (t ? [t] : []).concat(n);
|
|
45
43
|
},
|
|
46
44
|
e.rootElementResolver || (() => document.body)
|
|
47
|
-
),
|
|
45
|
+
), tt = (s) => {
|
|
48
46
|
const t = [];
|
|
49
47
|
return [
|
|
50
|
-
(
|
|
51
|
-
t.push(
|
|
48
|
+
(n, i) => {
|
|
49
|
+
t.push(s.subscribe(n, i));
|
|
52
50
|
},
|
|
53
51
|
() => {
|
|
54
|
-
t.forEach((
|
|
55
|
-
|
|
52
|
+
t.forEach((n) => {
|
|
53
|
+
n();
|
|
56
54
|
});
|
|
57
55
|
}
|
|
58
56
|
];
|
|
59
57
|
};
|
|
60
|
-
class
|
|
58
|
+
class N {
|
|
61
59
|
constructor(t, e = []) {
|
|
62
60
|
this.platform = t, this.rules = e;
|
|
63
61
|
}
|
|
@@ -71,33 +69,30 @@ class R {
|
|
|
71
69
|
return this.rules.push({ id: t }), this;
|
|
72
70
|
}
|
|
73
71
|
select() {
|
|
74
|
-
return new
|
|
72
|
+
return new et(this.platform, this);
|
|
75
73
|
}
|
|
76
74
|
}
|
|
77
|
-
class
|
|
78
|
-
constructor(t, e,
|
|
79
|
-
|
|
80
|
-
u(this, "subscribe");
|
|
81
|
-
u(this, "unsubscribe");
|
|
82
|
-
this.platform = t, this.node = e, this.actions = new A(
|
|
75
|
+
class H {
|
|
76
|
+
constructor(t, e, n) {
|
|
77
|
+
this.platform = t, this.node = e, this.actions = new P(
|
|
83
78
|
t,
|
|
84
|
-
new
|
|
85
|
-
|
|
79
|
+
new N(t).withId(e.id),
|
|
80
|
+
n
|
|
86
81
|
);
|
|
87
|
-
const [i,
|
|
88
|
-
this.subscribe = i, this.unsubscribe =
|
|
82
|
+
const [i, r] = tt(this.platform.events);
|
|
83
|
+
this.subscribe = i, this.unsubscribe = r;
|
|
89
84
|
}
|
|
90
85
|
properties(t) {
|
|
91
86
|
return t && this.node.touchProperties((e) => t(e)), this.node.attributes.properties;
|
|
92
87
|
}
|
|
93
88
|
context(t) {
|
|
94
|
-
return t && this.subscribe("components:context-changed", (e, { node:
|
|
95
|
-
|
|
89
|
+
return t && this.subscribe("components:context-changed", (e, { node: n }) => {
|
|
90
|
+
n === this.node && t(this.node.attributes.context);
|
|
96
91
|
}), this.node.attributes.context;
|
|
97
92
|
}
|
|
98
93
|
layout(t) {
|
|
99
|
-
return t && this.subscribe("components:layout-changed", (e, { node:
|
|
100
|
-
|
|
94
|
+
return t && this.subscribe("components:layout-changed", (e, { node: n }) => {
|
|
95
|
+
n === this.node && t(this.node.attributes.layout);
|
|
101
96
|
}), this.node.attributes.layout;
|
|
102
97
|
}
|
|
103
98
|
writeProperties(t, e) {
|
|
@@ -113,11 +108,9 @@ class V {
|
|
|
113
108
|
this.unsubscribe(), this.actions.dispose();
|
|
114
109
|
}
|
|
115
110
|
}
|
|
116
|
-
class
|
|
117
|
-
constructor(t, e,
|
|
118
|
-
|
|
119
|
-
u(this, "removes", []);
|
|
120
|
-
this.platform = t, this.target = e, this.clearOnDispose = s, this.actions = new A(this.platform, this.target);
|
|
111
|
+
class et {
|
|
112
|
+
constructor(t, e, n = !0) {
|
|
113
|
+
this.platform = t, this.target = e, this.clearOnDispose = n, this.removes = [], this.actions = new P(this.platform, this.target);
|
|
121
114
|
}
|
|
122
115
|
writeProperties(t, e) {
|
|
123
116
|
this.removes.push(
|
|
@@ -155,63 +148,62 @@ class nt {
|
|
|
155
148
|
}), this.actions.dispose();
|
|
156
149
|
}
|
|
157
150
|
}
|
|
158
|
-
const
|
|
159
|
-
const
|
|
160
|
-
let
|
|
161
|
-
if (
|
|
162
|
-
const
|
|
163
|
-
return Promise.resolve(
|
|
164
|
-
cancelled:
|
|
151
|
+
const st = (s, t, e) => {
|
|
152
|
+
const n = s.concat(), i = (r, c, a) => {
|
|
153
|
+
let u = !0;
|
|
154
|
+
if (n.length) {
|
|
155
|
+
const h = n.shift(), o = (p, l) => (u = !1, i(p, Object.assign({}, c, l), a));
|
|
156
|
+
return Promise.resolve(h(r, o, a)).then((p) => _(y({}, p), {
|
|
157
|
+
cancelled: u
|
|
165
158
|
}));
|
|
166
159
|
}
|
|
167
|
-
return Promise.resolve({ data:
|
|
160
|
+
return Promise.resolve({ data: r, cancelled: !1, options: c });
|
|
168
161
|
};
|
|
169
162
|
return i(t, {}, e);
|
|
170
163
|
};
|
|
171
|
-
class
|
|
172
|
-
constructor(t, e,
|
|
173
|
-
|
|
174
|
-
this.platform = t, this.target = e, this.ns = s, this.create = this.create.bind(this);
|
|
164
|
+
class P {
|
|
165
|
+
constructor(t, e, n) {
|
|
166
|
+
this.platform = t, this.target = e, this.ns = n, this.subscriptions = [], this.create = this.create.bind(this);
|
|
175
167
|
}
|
|
176
168
|
create(t, e = () => {
|
|
177
169
|
}) {
|
|
178
|
-
const
|
|
170
|
+
const n = {
|
|
179
171
|
key: t,
|
|
180
172
|
fn: e,
|
|
181
173
|
target: this.target,
|
|
182
174
|
ns: this.ns
|
|
183
175
|
};
|
|
184
|
-
this.platform.actionsState.handlers.push(
|
|
176
|
+
this.platform.actionsState.handlers.push(n);
|
|
185
177
|
const i = () => {
|
|
186
|
-
const
|
|
187
|
-
|
|
178
|
+
const r = this.platform.actionsState.handlers.indexOf(n);
|
|
179
|
+
r > -1 && this.platform.actionsState.handlers.splice(r, 1);
|
|
188
180
|
};
|
|
189
181
|
return this.subscriptions.push(i), i;
|
|
190
182
|
}
|
|
191
183
|
dispatch(t, e) {
|
|
192
|
-
const
|
|
184
|
+
const n = this.platform.nodes.all.concat(
|
|
193
185
|
this.platform.nodes.detached
|
|
194
|
-
), i = {},
|
|
195
|
-
(
|
|
186
|
+
), i = {}, r = this.platform.actionsState.handlers.filter(
|
|
187
|
+
(c) => c.key === t && (!c.ns || !this.ns || c.ns === this.ns)
|
|
196
188
|
);
|
|
197
189
|
return Promise.all(
|
|
198
|
-
|
|
199
|
-
const
|
|
200
|
-
(
|
|
201
|
-
),
|
|
190
|
+
r.map((c) => {
|
|
191
|
+
const a = n.filter(
|
|
192
|
+
(h) => c.target.match(h) && this.target.match(h)
|
|
193
|
+
), u = this.platform.actionsState.watchers.filter((h) => h.key === t && (!h.ns || !this.ns || h.ns === this.ns) && a.some((o) => h.target.match(o))).map((h) => h.fn);
|
|
202
194
|
return Promise.all(
|
|
203
|
-
|
|
204
|
-
const
|
|
195
|
+
a.map((h) => {
|
|
196
|
+
const o = new H(
|
|
205
197
|
this.platform,
|
|
206
|
-
|
|
198
|
+
h,
|
|
207
199
|
this.ns
|
|
208
200
|
);
|
|
209
|
-
return
|
|
210
|
-
const { data:
|
|
201
|
+
return st(u, e, o).then((p) => {
|
|
202
|
+
const { data: l = {}, options: d, cancelled: b } = p;
|
|
211
203
|
return Promise.resolve(
|
|
212
|
-
|
|
213
|
-
).then((
|
|
214
|
-
i[
|
|
204
|
+
b ? {} : c.fn(l, d, o)
|
|
205
|
+
).then((g) => {
|
|
206
|
+
i[h.id] = g;
|
|
215
207
|
});
|
|
216
208
|
});
|
|
217
209
|
})
|
|
@@ -220,47 +212,38 @@ class A {
|
|
|
220
212
|
).then(() => i);
|
|
221
213
|
}
|
|
222
214
|
watch(t, e) {
|
|
223
|
-
let
|
|
224
|
-
const
|
|
225
|
-
|
|
226
|
-
const
|
|
215
|
+
let n = t, i = this.ns;
|
|
216
|
+
const r = t.split(".");
|
|
217
|
+
r.length > 1 && (i = r[0], n = r.splice(1).join("."));
|
|
218
|
+
const c = {
|
|
227
219
|
fn: e,
|
|
228
220
|
target: this.target,
|
|
229
|
-
key:
|
|
221
|
+
key: n,
|
|
230
222
|
ns: i
|
|
231
223
|
};
|
|
232
|
-
this.platform.actionsState.watchers.push(
|
|
233
|
-
const
|
|
234
|
-
const
|
|
235
|
-
|
|
224
|
+
this.platform.actionsState.watchers.push(c);
|
|
225
|
+
const a = () => {
|
|
226
|
+
const u = this.platform.actionsState.watchers.indexOf(c);
|
|
227
|
+
u > -1 && this.platform.actionsState.watchers.splice(u, 1);
|
|
236
228
|
};
|
|
237
|
-
return this.subscriptions.push(
|
|
229
|
+
return this.subscriptions.push(a), a;
|
|
238
230
|
}
|
|
239
231
|
dispose() {
|
|
240
232
|
this.subscriptions.forEach((t) => t());
|
|
241
233
|
}
|
|
242
234
|
}
|
|
243
|
-
const
|
|
244
|
-
|
|
245
|
-
t.events.subscribeOnce("components:platform-created", (
|
|
246
|
-
e.handlers && e.handlers.forEach(([
|
|
247
|
-
i.addComponentHandler(
|
|
235
|
+
const wt = W((s) => {
|
|
236
|
+
s.createCommand("components", (t) => (e) => {
|
|
237
|
+
t.events.subscribeOnce("components:platform-created", (n, { platform: i }) => {
|
|
238
|
+
e.handlers && e.handlers.forEach(([r, c]) => {
|
|
239
|
+
i.addComponentHandler(r, c);
|
|
248
240
|
});
|
|
249
241
|
});
|
|
250
242
|
});
|
|
251
243
|
});
|
|
252
|
-
class
|
|
244
|
+
class L {
|
|
253
245
|
constructor(t, e) {
|
|
254
|
-
|
|
255
|
-
u(this, "type");
|
|
256
|
-
u(this, "name");
|
|
257
|
-
u(this, "parent");
|
|
258
|
-
u(this, "tags", []);
|
|
259
|
-
u(this, "children", {});
|
|
260
|
-
u(this, "changesets", []);
|
|
261
|
-
u(this, "attributes");
|
|
262
|
-
u(this, "mountCount", 0);
|
|
263
|
-
this.events = t, this.id = k(), this.type = e, this.attributes = {
|
|
246
|
+
this.events = t, this.tags = [], this.children = {}, this.changesets = [], this.mountCount = 0, this.id = O(), this.type = e, this.attributes = {
|
|
264
247
|
context: {},
|
|
265
248
|
properties: {},
|
|
266
249
|
layout: {},
|
|
@@ -268,10 +251,10 @@ class M {
|
|
|
268
251
|
}, this.writeLayout({ size: "full", indent: 0 });
|
|
269
252
|
}
|
|
270
253
|
mount(t, e) {
|
|
271
|
-
let
|
|
272
|
-
return
|
|
254
|
+
let n = t.get("mounted-nodes");
|
|
255
|
+
return n || (n = /* @__PURE__ */ new Map(), t.register("mounted-nodes", n)), n.has(this) ? (process.env.NODE_ENV !== "production" && k.error("Trying to mount an already mounted component node.", this), () => {
|
|
273
256
|
}) : (this.events.dispatch("components:node-mounted", { node: this }), this.mountCount === 0 && (this.mountCount = this.mountCount + 1, this.events.dispatch("components:node-enter", { node: this })), () => {
|
|
274
|
-
|
|
257
|
+
n.delete(this), this.events.dispatch("components:node-unmounted", { node: this }), this.mountCount = this.mountCount - 1, this.mountCount === 0 && this.events.dispatch("components:node-exit", { node: this });
|
|
275
258
|
});
|
|
276
259
|
}
|
|
277
260
|
appendChild(t, e = "default") {
|
|
@@ -290,47 +273,47 @@ class M {
|
|
|
290
273
|
}
|
|
291
274
|
t.parent = this, this.children[e] || (this.children[e] = []), this.children[e].unshift(t), this.events.dispatch("components:node-appended", { node: t });
|
|
292
275
|
}
|
|
293
|
-
touchProperties(t, e = {},
|
|
294
|
-
const
|
|
295
|
-
return this.changesets.push(
|
|
296
|
-
if (
|
|
297
|
-
const
|
|
298
|
-
|
|
276
|
+
touchProperties(t, e = {}, n) {
|
|
277
|
+
const r = [{ properties: t }, e];
|
|
278
|
+
return this.changesets.push(r), this.events.dispatch("components:set-properties", { node: this }), () => {
|
|
279
|
+
if (n) {
|
|
280
|
+
const c = this.changesets.indexOf(r);
|
|
281
|
+
c > -1 && (this.changesets.splice(c, 1), this.events.dispatch("components:set-properties", { node: this }));
|
|
299
282
|
}
|
|
300
283
|
};
|
|
301
284
|
}
|
|
302
|
-
writeProperties(t, e = {},
|
|
303
|
-
const
|
|
304
|
-
return this.changesets.push(
|
|
305
|
-
if (
|
|
306
|
-
const
|
|
307
|
-
|
|
285
|
+
writeProperties(t, e = {}, n) {
|
|
286
|
+
const r = [{ properties: t }, e];
|
|
287
|
+
return this.changesets.push(r), this.events.dispatch("components:set-properties", { node: this }), () => {
|
|
288
|
+
if (n) {
|
|
289
|
+
const c = this.changesets.indexOf(r);
|
|
290
|
+
c > -1 && (this.changesets.splice(c, 1), this.events.dispatch("components:set-properties", { node: this }));
|
|
308
291
|
}
|
|
309
292
|
};
|
|
310
293
|
}
|
|
311
|
-
writeLayout(t, e = {},
|
|
312
|
-
const
|
|
313
|
-
return this.changesets.push(
|
|
314
|
-
if (!
|
|
294
|
+
writeLayout(t, e = {}, n) {
|
|
295
|
+
const r = [{ layout: t }, e];
|
|
296
|
+
return this.changesets.push(r), this.events.dispatch("components:set-layout", { node: this }), () => {
|
|
297
|
+
if (!n)
|
|
315
298
|
return;
|
|
316
|
-
const
|
|
317
|
-
|
|
299
|
+
const c = this.changesets.indexOf(r);
|
|
300
|
+
c > -1 && (this.changesets.splice(c, 1), this.events.dispatch("components:set-layout", { node: this }));
|
|
318
301
|
};
|
|
319
302
|
}
|
|
320
|
-
writeContext(t, e = {},
|
|
321
|
-
const
|
|
322
|
-
return this.changesets.push(
|
|
323
|
-
if (!
|
|
303
|
+
writeContext(t, e = {}, n) {
|
|
304
|
+
const r = [{ context: t }, e];
|
|
305
|
+
return this.changesets.push(r), this.events.dispatch("components:set-context", { node: this }), () => {
|
|
306
|
+
if (!n)
|
|
324
307
|
return;
|
|
325
|
-
const
|
|
326
|
-
|
|
308
|
+
const c = this.changesets.indexOf(r);
|
|
309
|
+
c > -1 && (this.changesets.splice(c, 1), this.events.dispatch("components:set-context", { node: this }));
|
|
327
310
|
};
|
|
328
311
|
}
|
|
329
312
|
getChildren(t = "default") {
|
|
330
313
|
const e = this.children[t] || [];
|
|
331
|
-
return e.reduce((
|
|
332
|
-
const { order:
|
|
333
|
-
return
|
|
314
|
+
return e.reduce((n, i, r) => {
|
|
315
|
+
const { order: c = r } = i.attributes.layout;
|
|
316
|
+
return n[c] ? n.splice(c, 0, i) : n[c] = i, n;
|
|
334
317
|
}, Array(e.length));
|
|
335
318
|
}
|
|
336
319
|
remove() {
|
|
@@ -338,60 +321,57 @@ class M {
|
|
|
338
321
|
}
|
|
339
322
|
removeChild(t) {
|
|
340
323
|
Object.keys(this.children).forEach((e) => {
|
|
341
|
-
const
|
|
342
|
-
i > -1 && (
|
|
324
|
+
const n = this.children[e], i = n.indexOf(t);
|
|
325
|
+
i > -1 && (n.splice(i, 1), this.events.dispatch("components:node-removed", { node: t, parentNode: this }));
|
|
343
326
|
}), delete t.parent;
|
|
344
327
|
}
|
|
345
328
|
}
|
|
346
|
-
const
|
|
347
|
-
for (let
|
|
348
|
-
const
|
|
349
|
-
|
|
329
|
+
const B = (s, t, e) => {
|
|
330
|
+
for (let n = 0, i = s.length; n < i && e(s[n]) !== !0; n++) {
|
|
331
|
+
const r = t[s[n].id] || "default", c = s[n].getChildren(r);
|
|
332
|
+
B(c, t, e);
|
|
350
333
|
}
|
|
351
|
-
},
|
|
352
|
-
if (e(
|
|
353
|
-
const
|
|
354
|
-
|
|
334
|
+
}, R = (s, t, e) => {
|
|
335
|
+
if (e(s) !== !0) {
|
|
336
|
+
const n = t[s.id] || "default", i = s.children[n];
|
|
337
|
+
B(i, t, e);
|
|
355
338
|
}
|
|
356
|
-
},
|
|
339
|
+
}, w = (s, t) => {
|
|
357
340
|
const e = [];
|
|
358
|
-
return
|
|
359
|
-
e.push(
|
|
341
|
+
return R(s, t, (n) => {
|
|
342
|
+
e.push(n);
|
|
360
343
|
}), e;
|
|
361
|
-
},
|
|
362
|
-
let
|
|
363
|
-
return
|
|
344
|
+
}, nt = (s, t, e) => {
|
|
345
|
+
let n;
|
|
346
|
+
return R(s, t, (i) => {
|
|
364
347
|
if (e(i))
|
|
365
|
-
return
|
|
366
|
-
}),
|
|
348
|
+
return n = i, !0;
|
|
349
|
+
}), n;
|
|
367
350
|
};
|
|
368
|
-
class
|
|
369
|
-
constructor(t, e,
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
this.all.
|
|
375
|
-
}),
|
|
376
|
-
|
|
377
|
-
o > -1 && this.all.splice(o, 1), o = this.visible.indexOf(c.node), o > -1 && this.visible.splice(o, 1), this.visible = E(t, e);
|
|
378
|
-
}), s.subscribe("components:node-switched", (i, c) => {
|
|
379
|
-
this.visible = E(t, e);
|
|
351
|
+
class it {
|
|
352
|
+
constructor(t, e, n) {
|
|
353
|
+
this.root = t, this.switches = e, this.all = [], this.visible = [], this.detached = [], n.subscribe("components:node-appended", (i, r) => {
|
|
354
|
+
this.all.push(r.node), this.visible = w(t, e);
|
|
355
|
+
}), n.subscribe("components:node-removed", (i, r) => {
|
|
356
|
+
let c = this.all.indexOf(r.node);
|
|
357
|
+
c > -1 && this.all.splice(c, 1), c = this.visible.indexOf(r.node), c > -1 && this.visible.splice(c, 1), this.visible = w(t, e);
|
|
358
|
+
}), n.subscribe("components:node-switched", (i, r) => {
|
|
359
|
+
this.visible = w(t, e);
|
|
380
360
|
});
|
|
381
361
|
}
|
|
382
362
|
query(t = {}) {
|
|
383
363
|
const e = [];
|
|
384
|
-
return
|
|
385
|
-
Object.keys(t).every((
|
|
364
|
+
return R(this.root, this.switches, (n) => {
|
|
365
|
+
Object.keys(t).every((r) => t[r] === n[r]) && e.push(n);
|
|
386
366
|
}), e;
|
|
387
367
|
}
|
|
388
368
|
get(t) {
|
|
389
|
-
return
|
|
369
|
+
return nt(this.root, this.switches, (e) => e.id === t) || this.detached.find((e) => e.id === t);
|
|
390
370
|
}
|
|
391
371
|
}
|
|
392
|
-
class
|
|
372
|
+
class ot {
|
|
393
373
|
constructor() {
|
|
394
|
-
|
|
374
|
+
this.handlers = /* @__PURE__ */ new Map();
|
|
395
375
|
}
|
|
396
376
|
add(t, e) {
|
|
397
377
|
this.handlers.set(t, e);
|
|
@@ -400,143 +380,134 @@ class ct {
|
|
|
400
380
|
return this.handlers.get(t);
|
|
401
381
|
}
|
|
402
382
|
}
|
|
403
|
-
const
|
|
404
|
-
let t =
|
|
383
|
+
const rt = (s) => {
|
|
384
|
+
let t = s, e = 0;
|
|
405
385
|
for (; t.parent; )
|
|
406
386
|
e = e + 1, t = t.parent;
|
|
407
387
|
return e;
|
|
408
|
-
},
|
|
388
|
+
}, ct = (s) => s.map(([e, n]) => [rt(e), e, n]).sort(([e], [n]) => e - n).map(([, e, n]) => [e, n]), C = (s) => s instanceof Date ? !1 : s && typeof s == "object" && !Array.isArray(s), v = (s, ...t) => {
|
|
409
389
|
if (!t.length)
|
|
410
|
-
return
|
|
390
|
+
return s;
|
|
411
391
|
const e = t.shift();
|
|
412
|
-
if (
|
|
413
|
-
for (const
|
|
414
|
-
|
|
415
|
-
return v(
|
|
416
|
-
},
|
|
417
|
-
let e = [],
|
|
418
|
-
const
|
|
392
|
+
if (C(s) && C(e))
|
|
393
|
+
for (const n in e)
|
|
394
|
+
C(e[n]) ? (s[n] || Object.assign(s, { [n]: {} }), v(s[n], e[n])) : Object.assign(s, { [n]: e[n] });
|
|
395
|
+
return v(s, ...t);
|
|
396
|
+
}, ht = (s, t) => !s || s === "all" ? !0 : s.some((e) => t.indexOf(e) > -1), at = (s, t) => {
|
|
397
|
+
let e = [], n = [], i;
|
|
398
|
+
const r = () => {
|
|
419
399
|
process.env.NODE_ENV !== "production" && console.time("state-processor.flush");
|
|
420
|
-
const
|
|
421
|
-
var
|
|
422
|
-
const
|
|
423
|
-
|
|
424
|
-
context:
|
|
425
|
-
properties:
|
|
426
|
-
layout:
|
|
427
|
-
}),
|
|
428
|
-
const
|
|
429
|
-
if (
|
|
430
|
-
const [m,
|
|
431
|
-
|
|
400
|
+
const a = /* @__PURE__ */ new Map(), u = ct(e.map((o, p) => [o, n[p]])), h = (o, p) => {
|
|
401
|
+
var I;
|
|
402
|
+
const l = a.get(o) || {}, d = p.context && !l.context, b = p.properties && !l.properties, g = p.layout && !l.layout;
|
|
403
|
+
a.set(o, {
|
|
404
|
+
context: l.context || d,
|
|
405
|
+
properties: l.properties || b,
|
|
406
|
+
layout: l.layout || g
|
|
407
|
+
}), b && (o.attributes.properties = {}), g && (o.attributes.layout = {}), d && (o.attributes.context = v({}, (I = o.parent) == null ? void 0 : I.attributes.context));
|
|
408
|
+
const $ = [], A = [], T = [];
|
|
409
|
+
if (o.changesets.forEach((f) => {
|
|
410
|
+
const [m, x] = f;
|
|
411
|
+
ht(x.breakpoints, s.breakpoints) && (b && (typeof m.properties == "function" ? $.push(
|
|
432
412
|
m.properties
|
|
433
|
-
) : v(
|
|
434
|
-
}),
|
|
435
|
-
v(
|
|
436
|
-
}),
|
|
437
|
-
v(
|
|
438
|
-
}),
|
|
439
|
-
v(
|
|
440
|
-
}),
|
|
441
|
-
const
|
|
442
|
-
context: !!
|
|
413
|
+
) : v(o.attributes.properties, m.properties)), g && (typeof m.layout == "function" ? A.push(m.layout) : v(o.attributes.layout, m.layout)), d && (typeof m.context == "function" ? T.push(m.context) : v(o.attributes.context, m.context)));
|
|
414
|
+
}), $.forEach((f) => {
|
|
415
|
+
v(o.attributes.properties, f(o.attributes.properties));
|
|
416
|
+
}), A.forEach((f) => {
|
|
417
|
+
v(o.attributes.layout, f(o.attributes.layout));
|
|
418
|
+
}), T.forEach((f) => {
|
|
419
|
+
v(o.attributes.context, f(o.attributes.context));
|
|
420
|
+
}), d || p.recursive) {
|
|
421
|
+
const f = s.getBranch(o), m = p.recursive ? p : {
|
|
422
|
+
context: !!d
|
|
443
423
|
};
|
|
444
|
-
|
|
445
|
-
|
|
424
|
+
o.getChildren(f).forEach((x) => {
|
|
425
|
+
h(x, m);
|
|
446
426
|
});
|
|
447
427
|
}
|
|
448
428
|
};
|
|
449
|
-
process.env.NODE_ENV !== "production" && console.timeEnd("state-processor.flush"),
|
|
450
|
-
|
|
451
|
-
}), e = [],
|
|
452
|
-
},
|
|
453
|
-
clearTimeout(i), i = setTimeout(
|
|
429
|
+
process.env.NODE_ENV !== "production" && console.timeEnd("state-processor.flush"), u.forEach(([o, p]) => {
|
|
430
|
+
h(o, p);
|
|
431
|
+
}), e = [], n = [], t(a);
|
|
432
|
+
}, c = () => {
|
|
433
|
+
clearTimeout(i), i = setTimeout(r, 0);
|
|
454
434
|
};
|
|
455
|
-
return (
|
|
456
|
-
const
|
|
457
|
-
if (
|
|
458
|
-
const
|
|
459
|
-
return
|
|
435
|
+
return (a, u) => {
|
|
436
|
+
const h = e.indexOf(a);
|
|
437
|
+
if (h > -1) {
|
|
438
|
+
const o = n[h];
|
|
439
|
+
return u.context && (o.context = !0), u.properties && (o.properties = !0), u.layout && (o.layout = !0), u.recursive && (o.recursive = !0), c();
|
|
460
440
|
}
|
|
461
|
-
return e.push(
|
|
441
|
+
return e.push(a), n.push(u), c();
|
|
462
442
|
};
|
|
463
443
|
};
|
|
464
|
-
class
|
|
444
|
+
class pt {
|
|
465
445
|
constructor(t, e = {}) {
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
u(this, "customComponentHandler", new ct());
|
|
475
|
-
this.providers = e, this.events = t.events.createChild(this);
|
|
476
|
-
const s = new M(this.events, "root");
|
|
477
|
-
s.name = `root-${t.name}`, this.nodes = new rt(s, this.switches, this.events);
|
|
478
|
-
const i = this.processNode = ut(this, (c) => {
|
|
479
|
-
const o = Array.from(c.keys());
|
|
480
|
-
process.env.NODE_ENV !== "production" && console.info(`STATE PROCESSOR: ${o.length} node(s) processed:
|
|
481
|
-
${o.map(
|
|
482
|
-
(h) => `${h.name || "<no name>"} (${h.id})
|
|
446
|
+
this.providers = e, this.breakpoints = [], this.actionsState = { handlers: [], watchers: [] }, this.switches = {}, this.changesets = [], this.subscriptions = [], this.customComponentHandler = new ot(), this.events = t.events.createChild(this);
|
|
447
|
+
const n = new L(this.events, "root");
|
|
448
|
+
n.name = `root-${t.name}`, this.nodes = new it(n, this.switches, this.events);
|
|
449
|
+
const i = this.processNode = at(this, (r) => {
|
|
450
|
+
const c = Array.from(r.keys());
|
|
451
|
+
process.env.NODE_ENV !== "production" && console.info(`STATE PROCESSOR: ${c.length} node(s) processed:
|
|
452
|
+
${c.map(
|
|
453
|
+
(a) => `${a.name || "<no name>"} (${a.id})
|
|
483
454
|
`
|
|
484
|
-
)}`),
|
|
485
|
-
const
|
|
486
|
-
|
|
455
|
+
)}`), c.forEach((a) => {
|
|
456
|
+
const u = r.get(a);
|
|
457
|
+
a.parent && a.parent.type === "root" && this.events.dispatch("components:root-children-changed", { node: a }), u != null && u.context && this.events.dispatch("components:context-changed", { node: a }), u != null && u.properties && this.events.dispatch("components:properties-changed", { node: a }), u != null && u.layout && this.events.dispatch("components:layout-changed", { node: a });
|
|
487
458
|
}), this.events.dispatch("components:component-model-initialized", {}, { bubbles: !0 });
|
|
488
459
|
});
|
|
489
460
|
Promise.all(
|
|
490
|
-
Object.keys(e).map((
|
|
461
|
+
Object.keys(e).map((r) => e[r].load(this))
|
|
491
462
|
), this.subscriptions.push(
|
|
492
463
|
this.events.subscribe(
|
|
493
464
|
"components:node-appended",
|
|
494
|
-
(
|
|
495
|
-
const { node:
|
|
496
|
-
this.changesets.forEach((
|
|
497
|
-
const { changeset:
|
|
498
|
-
|
|
465
|
+
(r, c) => {
|
|
466
|
+
const { node: a } = c;
|
|
467
|
+
this.changesets.forEach((u) => {
|
|
468
|
+
const { changeset: h, target: o, removes: p } = u, [l, d] = h;
|
|
469
|
+
o.match(c.node) && (l.properties && p.push(a.writeProperties(l.properties, d)), l.context && p.push(a.writeContext(l.context, d)), l.layout && p.push(a.writeLayout(l.layout, d)));
|
|
499
470
|
});
|
|
500
471
|
}
|
|
501
472
|
)
|
|
502
473
|
), this.subscriptions.push(
|
|
503
474
|
this.events.subscribe(
|
|
504
475
|
"components:node-appended",
|
|
505
|
-
(
|
|
506
|
-
i(
|
|
476
|
+
(r, c) => {
|
|
477
|
+
i(c.node, { properties: !0, context: !0 });
|
|
507
478
|
}
|
|
508
479
|
)
|
|
509
480
|
), this.subscriptions.push(
|
|
510
481
|
this.events.subscribe(
|
|
511
482
|
"components:set-properties",
|
|
512
|
-
(
|
|
513
|
-
i(
|
|
483
|
+
(r, c) => {
|
|
484
|
+
i(c.node, { properties: !0 });
|
|
514
485
|
}
|
|
515
486
|
)
|
|
516
487
|
), this.subscriptions.push(
|
|
517
488
|
this.events.subscribe(
|
|
518
489
|
"components:set-context",
|
|
519
|
-
(
|
|
520
|
-
i(
|
|
490
|
+
(r, c) => {
|
|
491
|
+
i(c.node, { properties: !0, context: !0 });
|
|
521
492
|
}
|
|
522
493
|
)
|
|
523
494
|
), this.subscriptions.push(
|
|
524
495
|
this.events.subscribe(
|
|
525
496
|
"components:set-indent",
|
|
526
|
-
(
|
|
527
|
-
i(
|
|
497
|
+
(r, c) => {
|
|
498
|
+
i(c.node, { layout: !0 });
|
|
528
499
|
}
|
|
529
500
|
)
|
|
530
501
|
), this.subscriptions.push(
|
|
531
502
|
this.events.subscribe(
|
|
532
503
|
"components:set-layout",
|
|
533
|
-
(
|
|
534
|
-
i(
|
|
504
|
+
(r, c) => {
|
|
505
|
+
i(c.node, { layout: !0 });
|
|
535
506
|
}
|
|
536
507
|
)
|
|
537
508
|
), this.subscriptions.push(
|
|
538
|
-
this.events.subscribe("components:node-switched", (
|
|
539
|
-
i(
|
|
509
|
+
this.events.subscribe("components:node-switched", (r, { node: c, branch: a }) => {
|
|
510
|
+
i(c, {
|
|
540
511
|
layout: !0,
|
|
541
512
|
recursive: !0,
|
|
542
513
|
properties: !0,
|
|
@@ -544,8 +515,8 @@ ${o.map(
|
|
|
544
515
|
});
|
|
545
516
|
})
|
|
546
517
|
), this.subscriptions.push(
|
|
547
|
-
this.events.subscribe("components:node-removed", (
|
|
548
|
-
i(
|
|
518
|
+
this.events.subscribe("components:node-removed", (r, { parentNode: c }) => {
|
|
519
|
+
i(c, { properties: !0 });
|
|
549
520
|
})
|
|
550
521
|
), this.events.parent && this.events.parent.dispatch("components:platform-created", { platform: this });
|
|
551
522
|
}
|
|
@@ -576,34 +547,34 @@ ${o.map(
|
|
|
576
547
|
return this.switches[t.id];
|
|
577
548
|
}
|
|
578
549
|
createNode(t, e = {}) {
|
|
579
|
-
const
|
|
580
|
-
return e.detached && this.nodes.detached.push(
|
|
550
|
+
const n = new L(this.events, t);
|
|
551
|
+
return e.detached && this.nodes.detached.push(n), n;
|
|
581
552
|
}
|
|
582
553
|
components() {
|
|
583
|
-
return new
|
|
554
|
+
return new N(this);
|
|
584
555
|
}
|
|
585
556
|
actions(t, e) {
|
|
586
|
-
return new
|
|
557
|
+
return new P(this, t, e);
|
|
587
558
|
}
|
|
588
559
|
write(t) {
|
|
589
|
-
const { provider: e, target:
|
|
560
|
+
const { provider: e, target: n, attributes: i, options: r = {}, removable: c } = t, a = t.key || O(), h = { changeset: [i, r], target: n, removes: [] };
|
|
590
561
|
if (e) {
|
|
591
|
-
const
|
|
592
|
-
|
|
593
|
-
|
|
562
|
+
const o = this.providers[e];
|
|
563
|
+
o.write(a, n, i, r), h.removes.push(() => {
|
|
564
|
+
o.remove(a);
|
|
594
565
|
});
|
|
595
566
|
}
|
|
596
|
-
return this.changesets.push(
|
|
597
|
-
if (
|
|
567
|
+
return this.changesets.push(h), this.nodes.all.forEach((o) => {
|
|
568
|
+
if (n.match(o)) {
|
|
598
569
|
let p = () => {
|
|
599
570
|
};
|
|
600
|
-
i.properties && (p =
|
|
571
|
+
i.properties && (p = o.writeProperties(i.properties, r, c)), i.context && (p = o.writeContext(i.context, r, c)), i.layout && (p = o.writeContext(i.layout, r, c)), h.removes.push(p);
|
|
601
572
|
}
|
|
602
573
|
}), () => {
|
|
603
|
-
if (
|
|
604
|
-
|
|
605
|
-
const
|
|
606
|
-
|
|
574
|
+
if (c) {
|
|
575
|
+
h.removes.forEach((p) => p());
|
|
576
|
+
const o = this.changesets.indexOf(h);
|
|
577
|
+
o > -1 && this.changesets.splice(o, 1);
|
|
607
578
|
}
|
|
608
579
|
};
|
|
609
580
|
}
|
|
@@ -617,119 +588,113 @@ ${o.map(
|
|
|
617
588
|
this.subscriptions.forEach((t) => t());
|
|
618
589
|
}
|
|
619
590
|
}
|
|
620
|
-
const
|
|
621
|
-
if (Array.isArray(
|
|
622
|
-
const [t, ...e] =
|
|
591
|
+
const ut = (s) => {
|
|
592
|
+
if (Array.isArray(s)) {
|
|
593
|
+
const [t, ...e] = s;
|
|
623
594
|
return {
|
|
624
595
|
definitionId: t,
|
|
625
596
|
overrides: e
|
|
626
597
|
};
|
|
627
598
|
}
|
|
628
599
|
return {
|
|
629
|
-
definitionId:
|
|
600
|
+
definitionId: s,
|
|
630
601
|
overrides: []
|
|
631
602
|
};
|
|
632
|
-
},
|
|
633
|
-
e.forEach((
|
|
634
|
-
const
|
|
635
|
-
if (
|
|
636
|
-
const
|
|
637
|
-
|
|
638
|
-
const p = i[
|
|
639
|
-
|
|
640
|
-
}), t.appendChild(
|
|
641
|
-
|
|
642
|
-
breakpoints:
|
|
643
|
-
}),
|
|
603
|
+
}, E = (s, t, e, n, i, r) => {
|
|
604
|
+
e.forEach((c) => {
|
|
605
|
+
const a = ut(c), u = n[a.definitionId];
|
|
606
|
+
if (a.definitionId === "view") {
|
|
607
|
+
const h = s.createNode("view");
|
|
608
|
+
h.name = "view", Object.keys(i).forEach((o) => {
|
|
609
|
+
const p = i[o];
|
|
610
|
+
E(s, h, [p.entry], n, i, o);
|
|
611
|
+
}), t.appendChild(h), a.overrides.forEach((o) => {
|
|
612
|
+
o.properties && h.writeProperties(o.properties, {
|
|
613
|
+
breakpoints: o.breakpoints
|
|
614
|
+
}), o.context && h.writeContext(o.context, { breakpoints: o.breakpoints }), o.layout && h.writeLayout(o.layout, { breakpoints: o.breakpoints });
|
|
644
615
|
});
|
|
645
|
-
} else if (
|
|
646
|
-
const
|
|
647
|
-
|
|
648
|
-
platform:
|
|
616
|
+
} else if (s.getComponentHandler(u.type)) {
|
|
617
|
+
const h = s.getComponentHandler(u.type);
|
|
618
|
+
h && h(a, {
|
|
619
|
+
platform: s,
|
|
649
620
|
node: t,
|
|
650
621
|
references: e,
|
|
651
|
-
definitions:
|
|
622
|
+
definitions: n,
|
|
652
623
|
views: i,
|
|
653
|
-
branch:
|
|
624
|
+
branch: r
|
|
654
625
|
});
|
|
655
626
|
} else {
|
|
656
|
-
const
|
|
657
|
-
if (process.env.NODE_ENV !== "production" && !
|
|
658
|
-
|
|
659
|
-
`No definition found for component type '${
|
|
627
|
+
const h = n[a.definitionId];
|
|
628
|
+
if (process.env.NODE_ENV !== "production" && !h) {
|
|
629
|
+
k.error(
|
|
630
|
+
`No definition found for component type '${a.definitionId}'.`
|
|
660
631
|
);
|
|
661
632
|
return;
|
|
662
633
|
}
|
|
663
|
-
const
|
|
664
|
-
|
|
665
|
-
const
|
|
666
|
-
p.properties &&
|
|
667
|
-
}),
|
|
634
|
+
const o = s.createNode(h.type);
|
|
635
|
+
o.name = a.definitionId, o.tags = h.tags || [], h.properties && o.writeProperties(h.properties), h.context && o.writeContext(h.context), h.layout && o.writeLayout(h.layout), t.appendChild(o, r), a.overrides.forEach((p) => {
|
|
636
|
+
const l = { breakpoints: p.breakpoints };
|
|
637
|
+
p.properties && o.writeProperties(p.properties, l), p.context && o.writeContext(p.context, l), p.layout && o.writeLayout(p.layout, l);
|
|
638
|
+
}), h.children && E(s, o, h.children, n, i);
|
|
668
639
|
}
|
|
669
640
|
});
|
|
670
|
-
},
|
|
671
|
-
const { entry: e, components:
|
|
672
|
-
return Object.keys(i).forEach((
|
|
673
|
-
const
|
|
674
|
-
|
|
675
|
-
const
|
|
676
|
-
p.matches ?
|
|
641
|
+
}, Ct = (s, t) => {
|
|
642
|
+
const { entry: e, components: n, breakpoints: i, views: r } = t, c = [];
|
|
643
|
+
return Object.keys(i).forEach((a) => {
|
|
644
|
+
const u = i[a], h = window.matchMedia(u);
|
|
645
|
+
h.matches && s.breakpoints.push(a);
|
|
646
|
+
const o = (p) => {
|
|
647
|
+
p.matches ? s.addBreakpoint(a) : s.removeBreakpoint(a);
|
|
677
648
|
};
|
|
678
|
-
|
|
679
|
-
}),
|
|
680
|
-
|
|
649
|
+
h.addListener(o), c.push(() => h.removeListener(o));
|
|
650
|
+
}), E(s, s.nodes.root, [e], n, r), () => c.forEach((a) => {
|
|
651
|
+
a();
|
|
681
652
|
});
|
|
682
|
-
},
|
|
683
|
-
id:
|
|
684
|
-
type:
|
|
685
|
-
name:
|
|
653
|
+
}, Et = (s, t) => ({
|
|
654
|
+
id: s.id,
|
|
655
|
+
type: s.type,
|
|
656
|
+
name: s.name,
|
|
686
657
|
branch: t || "default"
|
|
687
|
-
}),
|
|
688
|
-
let
|
|
658
|
+
}), Ot = (s, t, e, n = O(), i = {}) => s.getAsync("components").then((r) => {
|
|
659
|
+
let c;
|
|
689
660
|
if (typeof t == "string") {
|
|
690
|
-
const
|
|
691
|
-
|
|
661
|
+
const h = new N(r);
|
|
662
|
+
h.ofType(t), c = h;
|
|
692
663
|
} else
|
|
693
|
-
|
|
694
|
-
const
|
|
695
|
-
const
|
|
696
|
-
return
|
|
664
|
+
c = t;
|
|
665
|
+
const a = {}, u = (h) => {
|
|
666
|
+
const o = a[h.id];
|
|
667
|
+
return o ? Promise.resolve(o.controller) : pt.getInstance(s).then((p) => new H(p, h, n));
|
|
697
668
|
};
|
|
698
|
-
|
|
669
|
+
r.events.subscribe(
|
|
699
670
|
"components:node-enter",
|
|
700
|
-
(
|
|
701
|
-
|
|
702
|
-
Promise.resolve(e(p)).then((
|
|
703
|
-
|
|
704
|
-
dispose:
|
|
671
|
+
(h, { node: o }) => {
|
|
672
|
+
c.match(o) && u(o).then((p) => {
|
|
673
|
+
Promise.resolve(e(p)).then((l) => {
|
|
674
|
+
a[o.id] = {
|
|
675
|
+
dispose: l,
|
|
705
676
|
controller: p
|
|
706
677
|
};
|
|
707
678
|
});
|
|
708
679
|
});
|
|
709
680
|
}
|
|
710
|
-
),
|
|
681
|
+
), r.events.subscribe(
|
|
711
682
|
"components:node-exit",
|
|
712
|
-
(
|
|
713
|
-
const p =
|
|
714
|
-
p && (p.dispose && p.dispose(), i.reuseController || (p.controller.dispose(), delete
|
|
683
|
+
(h, { node: o }) => {
|
|
684
|
+
const p = a[o.id];
|
|
685
|
+
p && (p.dispose && p.dispose(), i.reuseController || (p.controller.dispose(), delete a[o.id]));
|
|
715
686
|
}
|
|
716
687
|
);
|
|
717
688
|
});
|
|
718
|
-
class
|
|
689
|
+
class kt {
|
|
719
690
|
constructor(t) {
|
|
720
|
-
|
|
721
|
-
u(this, "components", /* @__PURE__ */ new Map());
|
|
722
|
-
u(this, "events");
|
|
723
|
-
u(this, "logger", new $());
|
|
691
|
+
this.aliases = /* @__PURE__ */ new Map(), this.components = /* @__PURE__ */ new Map(), this.logger = new k();
|
|
724
692
|
const { events: e } = t.get("$widget");
|
|
725
693
|
this.events = e;
|
|
726
694
|
}
|
|
727
695
|
getComponent(t) {
|
|
728
|
-
const e = this.aliases.get(t)
|
|
729
|
-
return
|
|
730
|
-
e || t,
|
|
731
|
-
`Unable to resolve component: "${e || t}". You most likely forgot to register the required plugin for: ${e || t}.`
|
|
732
|
-
)), s;
|
|
696
|
+
const e = this.aliases.get(t);
|
|
697
|
+
return this.components.get(e || t) || null;
|
|
733
698
|
}
|
|
734
699
|
registerComponent(t, e) {
|
|
735
700
|
return this.components.set(t, e), this.events.dispatch("component-resolver:resolve", t), () => {
|
|
@@ -737,10 +702,10 @@ class Pt {
|
|
|
737
702
|
};
|
|
738
703
|
}
|
|
739
704
|
registerResolver(t, e) {
|
|
740
|
-
return this.events.subscribe("component-resolver:resolve", (
|
|
705
|
+
return this.events.subscribe("component-resolver:resolve", (n, i) => {
|
|
741
706
|
if (i === t) {
|
|
742
|
-
const
|
|
743
|
-
e(
|
|
707
|
+
const r = this.getComponent(t);
|
|
708
|
+
e(r);
|
|
744
709
|
}
|
|
745
710
|
});
|
|
746
711
|
}
|
|
@@ -750,82 +715,81 @@ class Pt {
|
|
|
750
715
|
};
|
|
751
716
|
}
|
|
752
717
|
}
|
|
753
|
-
const
|
|
754
|
-
constructor(
|
|
755
|
-
super(
|
|
756
|
-
transformPluginSettings: (
|
|
757
|
-
const
|
|
758
|
-
return
|
|
718
|
+
const lt = "b8924d7", M = class extends U {
|
|
719
|
+
constructor(s, t = []) {
|
|
720
|
+
super(s, t, {
|
|
721
|
+
transformPluginSettings: (e, n, i) => {
|
|
722
|
+
const r = i.get("$settings"), c = r.plugins && n ? r.plugins[n] || {} : {};
|
|
723
|
+
return y(y({}, c), e);
|
|
759
724
|
}
|
|
760
725
|
});
|
|
761
726
|
}
|
|
762
|
-
createImplementation(
|
|
763
|
-
const
|
|
764
|
-
return
|
|
727
|
+
createImplementation(s) {
|
|
728
|
+
const t = super.createImplementation(s);
|
|
729
|
+
return t.bindings = s.bindings, t;
|
|
765
730
|
}
|
|
766
|
-
navigate(t, e
|
|
767
|
-
this.widgets.query(
|
|
731
|
+
navigate(s, t, e) {
|
|
732
|
+
this.widgets.query(s).forEach((n) => n.invoke("navigate", { route: t, params: e }));
|
|
768
733
|
}
|
|
769
|
-
static create(
|
|
770
|
-
const
|
|
771
|
-
|
|
734
|
+
static create(s = {}) {
|
|
735
|
+
const t = [G].concat(
|
|
736
|
+
s.configurationApiExtensions || []
|
|
772
737
|
);
|
|
773
|
-
return new
|
|
738
|
+
return new M("humany", t);
|
|
774
739
|
}
|
|
775
|
-
static createFromGlobal(
|
|
776
|
-
if (this.isRuntime(
|
|
777
|
-
return
|
|
778
|
-
const
|
|
779
|
-
|
|
780
|
-
const
|
|
781
|
-
return
|
|
740
|
+
static createFromGlobal(s, t = {}) {
|
|
741
|
+
if (this.isRuntime(s))
|
|
742
|
+
return s.patch(t), s;
|
|
743
|
+
const e = [], n = s && s._c;
|
|
744
|
+
n && n.forEach((r) => e.push(r));
|
|
745
|
+
const i = this.create(t);
|
|
746
|
+
return i.container.register("$runtimecfg", e), i;
|
|
782
747
|
}
|
|
783
|
-
static isRuntime(
|
|
784
|
-
return !!(
|
|
748
|
+
static isRuntime(s) {
|
|
749
|
+
return !!(s && typeof s == "object" && s.container && typeof s.container.get == "function" && s.container.get("$environment") === s && s.container.owner === s);
|
|
785
750
|
}
|
|
786
751
|
};
|
|
787
|
-
let
|
|
788
|
-
|
|
789
|
-
class
|
|
752
|
+
let dt = M;
|
|
753
|
+
dt.version = `${lt} (${J})`;
|
|
754
|
+
class Nt extends X {
|
|
790
755
|
constructor() {
|
|
791
|
-
super(...arguments);
|
|
792
|
-
u(this, "bindings", []);
|
|
756
|
+
super(...arguments), this.bindings = [];
|
|
793
757
|
}
|
|
794
758
|
}
|
|
795
|
-
class
|
|
759
|
+
class Pt extends Y {
|
|
796
760
|
constructor(t, e) {
|
|
797
761
|
super(t, e);
|
|
798
762
|
}
|
|
799
763
|
}
|
|
800
|
-
var mt = /* @__PURE__ */ ((
|
|
801
|
-
class Rt extends
|
|
764
|
+
var mt = /* @__PURE__ */ ((s) => (s.open = "open", s.closed = "closed", s.hidden = "hidden", s))(mt || {});
|
|
765
|
+
class Rt extends Z {
|
|
802
766
|
constructor(t) {
|
|
803
767
|
super(t);
|
|
804
768
|
}
|
|
805
769
|
}
|
|
806
770
|
export {
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
771
|
+
yt as ActionResolver,
|
|
772
|
+
P as ActionsController,
|
|
773
|
+
L as ComponentNode,
|
|
774
|
+
H as ComponentNodeController,
|
|
775
|
+
pt as ComponentPlatform,
|
|
776
|
+
N as ComponentQuery,
|
|
777
|
+
kt as ComponentResolver,
|
|
778
|
+
dt as Environment,
|
|
779
|
+
Nt as Implementation,
|
|
780
|
+
Pt as Plugin,
|
|
817
781
|
mt as WidgetRenderState,
|
|
818
782
|
Rt as WidgetType,
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
783
|
+
Et as asDescriptor,
|
|
784
|
+
xt as bootstrap,
|
|
785
|
+
wt as componentConfigurationApi,
|
|
786
|
+
E as createChildren,
|
|
787
|
+
Ct as createComponentModel,
|
|
788
|
+
tt as createEventSubscriber,
|
|
789
|
+
Ot as extendComponent,
|
|
790
|
+
nt as findComponent,
|
|
791
|
+
w as findVisibleComponents,
|
|
792
|
+
R as traverseComponents,
|
|
793
|
+
lt as version
|
|
830
794
|
};
|
|
831
795
|
//# sourceMappingURL=index.js.map
|