@telia-ace/widget-components-copyright-flamingo 1.1.7-rc.0 → 1.1.7
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/{copyright-56d0ce76.mjs → copyright-050d0bf9.mjs} +127 -143
- package/{copyright-2913048a.js → copyright-187cc0ae.js} +10 -14
- package/index-07ac5583.js +144 -0
- package/{index-7a32537b.mjs → index-0f2db61c.mjs} +896 -867
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/package.json +3 -3
- package/index-c2c5bd73.js +0 -148
|
@@ -1,41 +1,22 @@
|
|
|
1
|
-
import { p as
|
|
1
|
+
import { p as _, P as z, h as P, i as g, n as x, r as l, E as f, m as M, x as L, s as V } from "./index-0f2db61c.mjs";
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2017 Google LLC
|
|
5
5
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
6
|
*/
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} };
|
|
12
|
-
})(o, t);
|
|
13
|
-
/**
|
|
14
|
-
* @license
|
|
15
|
-
* Copyright 2017 Google LLC
|
|
16
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
17
|
-
*/
|
|
18
|
-
const H = ({ finisher: o, descriptor: t }) => (c, e) => {
|
|
19
|
-
var s;
|
|
20
|
-
if (e === void 0) {
|
|
21
|
-
const i = (s = c.originalKey) !== null && s !== void 0 ? s : c.key, n = t != null ? { kind: "method", placement: "prototype", key: i, descriptor: t(c.key) } : { ...c, key: i };
|
|
22
|
-
return o != null && (n.finisher = function(r) {
|
|
23
|
-
o(r, i);
|
|
24
|
-
}), n;
|
|
25
|
-
}
|
|
26
|
-
{
|
|
27
|
-
const i = c.constructor;
|
|
28
|
-
t !== void 0 && Object.defineProperty(c, e, t(e)), o == null || o(i, e);
|
|
29
|
-
}
|
|
7
|
+
const H = (i) => (t, c) => {
|
|
8
|
+
c !== void 0 ? c.addInitializer(() => {
|
|
9
|
+
customElements.define(i, t);
|
|
10
|
+
}) : customElements.define(i, t);
|
|
30
11
|
};
|
|
31
12
|
/**
|
|
32
13
|
* @license
|
|
33
14
|
* Copyright 2021 Google LLC
|
|
34
15
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
35
16
|
*/
|
|
36
|
-
let
|
|
37
|
-
constructor(t, c,
|
|
38
|
-
super("context-request", { bubbles: !0, composed: !0 }), this.context = t, this.callback = c, this.subscribe =
|
|
17
|
+
let C = class extends Event {
|
|
18
|
+
constructor(t, c, s) {
|
|
19
|
+
super("context-request", { bubbles: !0, composed: !0 }), this.context = t, this.callback = c, this.subscribe = s ?? !1;
|
|
39
20
|
}
|
|
40
21
|
};
|
|
41
22
|
/**
|
|
@@ -48,16 +29,15 @@ let g = class extends Event {
|
|
|
48
29
|
* Copyright 2021 Google LLC
|
|
49
30
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
50
31
|
*/
|
|
51
|
-
let
|
|
52
|
-
constructor(t, c,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
this.unsubscribe && (this.unsubscribe !== r && (this.provided = !1, this.unsubscribe()), this.subscribe || this.unsubscribe()), this.value = n, this.host.requestUpdate(), this.provided && !this.subscribe || (this.provided = !0, this.callback && this.callback(n, r)), this.unsubscribe = r;
|
|
32
|
+
let y = class {
|
|
33
|
+
constructor(t, c, s, e) {
|
|
34
|
+
if (this.subscribe = !1, this.provided = !1, this.value = void 0, this.t = (o, n) => {
|
|
35
|
+
this.unsubscribe && (this.unsubscribe !== n && (this.provided = !1, this.unsubscribe()), this.subscribe || this.unsubscribe()), this.value = o, this.host.requestUpdate(), this.provided && !this.subscribe || (this.provided = !0, this.callback && this.callback(o, n)), this.unsubscribe = n;
|
|
56
36
|
}, this.host = t, c.context !== void 0) {
|
|
57
|
-
const
|
|
58
|
-
this.context =
|
|
37
|
+
const o = c;
|
|
38
|
+
this.context = o.context, this.callback = o.callback, this.subscribe = o.subscribe ?? !1;
|
|
59
39
|
} else
|
|
60
|
-
this.context = c, this.callback =
|
|
40
|
+
this.context = c, this.callback = s, this.subscribe = e ?? !1;
|
|
61
41
|
this.host.addController(this);
|
|
62
42
|
}
|
|
63
43
|
hostConnected() {
|
|
@@ -67,7 +47,7 @@ let k = class {
|
|
|
67
47
|
this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0);
|
|
68
48
|
}
|
|
69
49
|
dispatchRequest() {
|
|
70
|
-
this.host.dispatchEvent(new
|
|
50
|
+
this.host.dispatchEvent(new C(this.context, this.t, this.subscribe));
|
|
71
51
|
}
|
|
72
52
|
};
|
|
73
53
|
/**
|
|
@@ -76,12 +56,6 @@ let k = class {
|
|
|
76
56
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
77
57
|
*/
|
|
78
58
|
class D {
|
|
79
|
-
constructor(t) {
|
|
80
|
-
this.subscriptions = /* @__PURE__ */ new Map(), this.updateObservers = () => {
|
|
81
|
-
for (const [c, { disposer: e }] of this.subscriptions)
|
|
82
|
-
c(this.o, e);
|
|
83
|
-
}, t !== void 0 && (this.value = t);
|
|
84
|
-
}
|
|
85
59
|
get value() {
|
|
86
60
|
return this.o;
|
|
87
61
|
}
|
|
@@ -89,17 +63,23 @@ class D {
|
|
|
89
63
|
this.setValue(t);
|
|
90
64
|
}
|
|
91
65
|
setValue(t, c = !1) {
|
|
92
|
-
const
|
|
93
|
-
this.o = t,
|
|
66
|
+
const s = c || !Object.is(t, this.o);
|
|
67
|
+
this.o = t, s && this.updateObservers();
|
|
68
|
+
}
|
|
69
|
+
constructor(t) {
|
|
70
|
+
this.subscriptions = /* @__PURE__ */ new Map(), this.updateObservers = () => {
|
|
71
|
+
for (const [c, { disposer: s }] of this.subscriptions)
|
|
72
|
+
c(this.o, s);
|
|
73
|
+
}, t !== void 0 && (this.value = t);
|
|
94
74
|
}
|
|
95
|
-
addCallback(t, c,
|
|
96
|
-
if (!
|
|
75
|
+
addCallback(t, c, s) {
|
|
76
|
+
if (!s)
|
|
97
77
|
return void t(this.value);
|
|
98
78
|
this.subscriptions.has(t) || this.subscriptions.set(t, { disposer: () => {
|
|
99
79
|
this.subscriptions.delete(t);
|
|
100
80
|
}, consumerHost: c });
|
|
101
|
-
const { disposer:
|
|
102
|
-
t(this.value,
|
|
81
|
+
const { disposer: e } = this.subscriptions.get(t);
|
|
82
|
+
t(this.value, e);
|
|
103
83
|
}
|
|
104
84
|
clearCallbacks() {
|
|
105
85
|
this.subscriptions.clear();
|
|
@@ -116,18 +96,18 @@ class E extends Event {
|
|
|
116
96
|
}
|
|
117
97
|
}
|
|
118
98
|
class d extends D {
|
|
119
|
-
constructor(t, c,
|
|
120
|
-
super(c.context !== void 0 ? c.initialValue :
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
}, this.onProviderRequest = (
|
|
124
|
-
const
|
|
125
|
-
if (
|
|
99
|
+
constructor(t, c, s) {
|
|
100
|
+
super(c.context !== void 0 ? c.initialValue : s), this.onContextRequest = (e) => {
|
|
101
|
+
const o = e.composedPath()[0];
|
|
102
|
+
e.context === this.context && o !== this.host && (e.stopPropagation(), this.addCallback(e.callback, o, e.subscribe));
|
|
103
|
+
}, this.onProviderRequest = (e) => {
|
|
104
|
+
const o = e.composedPath()[0];
|
|
105
|
+
if (e.context !== this.context || o === this.host)
|
|
126
106
|
return;
|
|
127
107
|
const n = /* @__PURE__ */ new Set();
|
|
128
|
-
for (const [
|
|
129
|
-
n.has(
|
|
130
|
-
|
|
108
|
+
for (const [a, { consumerHost: b }] of this.subscriptions)
|
|
109
|
+
n.has(a) || (n.add(a), b.dispatchEvent(new C(this.context, a, !0)));
|
|
110
|
+
e.stopPropagation();
|
|
131
111
|
}, this.host = t, c.context !== void 0 ? this.context = c.context : this.context = c, this.attachListeners(), this.host.addController(this);
|
|
132
112
|
}
|
|
133
113
|
attachListeners() {
|
|
@@ -142,17 +122,21 @@ class d extends D {
|
|
|
142
122
|
* Copyright 2022 Google LLC
|
|
143
123
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
144
124
|
*/
|
|
145
|
-
function O({ context:
|
|
146
|
-
return
|
|
147
|
-
|
|
148
|
-
new
|
|
149
|
-
s
|
|
125
|
+
function O({ context: i, subscribe: t }) {
|
|
126
|
+
return (c, s) => {
|
|
127
|
+
typeof s == "object" ? s.addInitializer(function() {
|
|
128
|
+
new y(this, { context: i, callback: (e) => {
|
|
129
|
+
this[s.name] = e;
|
|
130
|
+
}, subscribe: t });
|
|
131
|
+
}) : c.constructor.addInitializer((e) => {
|
|
132
|
+
new y(e, { context: i, callback: (o) => {
|
|
133
|
+
e[s] = o;
|
|
150
134
|
}, subscribe: t });
|
|
151
135
|
});
|
|
152
|
-
}
|
|
136
|
+
};
|
|
153
137
|
}
|
|
154
|
-
const
|
|
155
|
-
class
|
|
138
|
+
const k = "children", R = "descriptor", q = "container", $ = "context", j = "layout", F = "properties";
|
|
139
|
+
class I {
|
|
156
140
|
constructor(t) {
|
|
157
141
|
(this.host = t).addController(this);
|
|
158
142
|
}
|
|
@@ -169,76 +153,76 @@ class N {
|
|
|
169
153
|
async dispatch(t, c) {
|
|
170
154
|
if (!this._container || !this._descriptor)
|
|
171
155
|
return;
|
|
172
|
-
const
|
|
156
|
+
const s = await _.getInstance(
|
|
173
157
|
this._container
|
|
174
|
-
),
|
|
158
|
+
), e = new z(s).withId(
|
|
175
159
|
this._descriptor.id
|
|
176
160
|
);
|
|
177
|
-
await
|
|
178
|
-
|
|
161
|
+
await s.actions(
|
|
162
|
+
e,
|
|
179
163
|
this._descriptor.type || P()
|
|
180
164
|
).dispatch(t, c);
|
|
181
165
|
}
|
|
182
166
|
}
|
|
183
|
-
const
|
|
167
|
+
const N = (i) => {
|
|
184
168
|
const t = {};
|
|
185
|
-
return Object.keys(
|
|
186
|
-
c.indexOf("css-") > -1 && (t[c] =
|
|
169
|
+
return Object.keys(i).forEach((c) => {
|
|
170
|
+
c.indexOf("css-") > -1 && (t[c] = i[c]);
|
|
187
171
|
}), t;
|
|
188
|
-
},
|
|
189
|
-
const c =
|
|
190
|
-
Object.entries(c).forEach(([
|
|
191
|
-
|
|
172
|
+
}, A = (i, t) => {
|
|
173
|
+
const c = N(t);
|
|
174
|
+
Object.entries(c).forEach(([s, e]) => {
|
|
175
|
+
i.style.setProperty(s.replace("css-", ""), e);
|
|
192
176
|
});
|
|
193
177
|
};
|
|
194
|
-
var
|
|
195
|
-
for (var
|
|
196
|
-
(n = o
|
|
197
|
-
return
|
|
178
|
+
var S = Object.defineProperty, W = Object.getOwnPropertyDescriptor, h = (i, t, c, s) => {
|
|
179
|
+
for (var e = s > 1 ? void 0 : s ? W(t, c) : t, o = i.length - 1, n; o >= 0; o--)
|
|
180
|
+
(n = i[o]) && (e = (s ? n(t, c, e) : n(e)) || e);
|
|
181
|
+
return s && e && S(t, c, e), e;
|
|
198
182
|
};
|
|
199
|
-
const
|
|
200
|
-
class t extends
|
|
183
|
+
const B = (i) => {
|
|
184
|
+
class t extends i {
|
|
201
185
|
constructor() {
|
|
202
186
|
super(...arguments), this.entry = "", this._descriptorProvider = new d(
|
|
203
187
|
this,
|
|
204
188
|
R,
|
|
205
189
|
void 0
|
|
206
|
-
), this._childrenProvider = new d(this,
|
|
190
|
+
), this._childrenProvider = new d(this, k, []), this._propertiesProvider = new d(this, F, {}), this._contextProvider = new d(this, $, {}), this._layoutProvider = new d(this, j, {}), this.actions = new I(this), this.context = {}, this.layout = {}, this.properties = {};
|
|
207
191
|
}
|
|
208
192
|
connectedCallback() {
|
|
209
|
-
super.connectedCallback(), this.container && (this.actions.setContainer(this.container),
|
|
210
|
-
async (
|
|
211
|
-
var
|
|
212
|
-
const
|
|
213
|
-
if (
|
|
214
|
-
this._propertyChangeListener =
|
|
193
|
+
super.connectedCallback(), this.container && (this.actions.setContainer(this.container), _.getInstance(this.container).then(
|
|
194
|
+
async (s) => {
|
|
195
|
+
var o, n;
|
|
196
|
+
const e = s.nodes.get(this.entry);
|
|
197
|
+
if (e) {
|
|
198
|
+
this._propertyChangeListener = s.events.subscribe(
|
|
215
199
|
"components:properties-changed",
|
|
216
|
-
(
|
|
217
|
-
|
|
200
|
+
(p, r) => {
|
|
201
|
+
e.id === r.node.id && this._setProperties(r.node.attributes.properties);
|
|
218
202
|
}
|
|
219
|
-
), this._contextChangeListener =
|
|
203
|
+
), this._contextChangeListener = s.events.subscribe(
|
|
220
204
|
"components:context-changed",
|
|
221
|
-
(
|
|
222
|
-
|
|
205
|
+
(p, r) => {
|
|
206
|
+
e.id === r.node.id && this._setContext(r.node.attributes.context);
|
|
223
207
|
}
|
|
224
|
-
), this._layoutChangeListener =
|
|
208
|
+
), this._layoutChangeListener = s.events.subscribe(
|
|
225
209
|
"components:layout-changed",
|
|
226
|
-
(
|
|
227
|
-
|
|
210
|
+
(p, r) => {
|
|
211
|
+
e.id === r.node.id && this._setLayout(r.node.attributes.layout);
|
|
228
212
|
}
|
|
229
213
|
);
|
|
230
|
-
const
|
|
231
|
-
this._unmountNode =
|
|
232
|
-
const
|
|
233
|
-
this._childrenProvider.setValue(
|
|
234
|
-
const
|
|
235
|
-
if (((
|
|
214
|
+
const a = "default";
|
|
215
|
+
this._unmountNode = e.mount(this.container), this._setDescriptor(f(e, a)), this._setProperties(e.attributes.properties), this._setContext(e.attributes.context), this._setLayout(this.layout);
|
|
216
|
+
const b = e.getChildren(a).map((p) => f(p));
|
|
217
|
+
this._childrenProvider.setValue(b);
|
|
218
|
+
const w = await this.container.getAsync("componentResolver");
|
|
219
|
+
if (((o = this.descriptor) == null ? void 0 : o.type) === "area")
|
|
236
220
|
return;
|
|
237
|
-
const
|
|
221
|
+
const v = w.getComponent(
|
|
238
222
|
((n = this.descriptor) == null ? void 0 : n.type) || ""
|
|
239
223
|
);
|
|
240
|
-
|
|
241
|
-
this.component =
|
|
224
|
+
v.then && v.then((p) => {
|
|
225
|
+
this.component = p.default;
|
|
242
226
|
});
|
|
243
227
|
}
|
|
244
228
|
}
|
|
@@ -248,27 +232,27 @@ const K = (o) => {
|
|
|
248
232
|
super.disconnectedCallback(), this._propertyChangeListener && this._propertyChangeListener(), this._contextChangeListener && this._contextChangeListener(), this._layoutChangeListener && this._layoutChangeListener(), this._unmountNode && this._unmountNode();
|
|
249
233
|
}
|
|
250
234
|
updated() {
|
|
251
|
-
this.container && this.actions.setContainer(this.container),
|
|
235
|
+
this.container && this.actions.setContainer(this.container), M(this.context, this.renderRoot.host), this.renderRoot.host.style.setProperty(
|
|
252
236
|
"--width",
|
|
253
237
|
this.layout.size === "full" ? "var(--columns, 1)" : `min(${this.layout.size || "var(--columns)"}, var(--columns))`
|
|
254
|
-
),
|
|
238
|
+
), A(this.renderRoot.host, this.properties);
|
|
255
239
|
}
|
|
256
|
-
_setProperties(
|
|
257
|
-
this._propertiesProvider.setValue(
|
|
240
|
+
_setProperties(s) {
|
|
241
|
+
this._propertiesProvider.setValue(s), this.properties = s;
|
|
258
242
|
}
|
|
259
|
-
_setContext(
|
|
260
|
-
this._contextProvider.setValue(
|
|
243
|
+
_setContext(s) {
|
|
244
|
+
this._contextProvider.setValue(s), this.context = s;
|
|
261
245
|
}
|
|
262
|
-
_setLayout(
|
|
263
|
-
this._layoutProvider.setValue(
|
|
246
|
+
_setLayout(s) {
|
|
247
|
+
this._layoutProvider.setValue(s), this.layout = s;
|
|
264
248
|
}
|
|
265
|
-
_setDescriptor(
|
|
266
|
-
this.descriptor =
|
|
249
|
+
_setDescriptor(s) {
|
|
250
|
+
this.descriptor = s, this._descriptorProvider.setValue(s), this.actions.setDescriptor(s);
|
|
267
251
|
}
|
|
268
252
|
}
|
|
269
253
|
return t.styles = [
|
|
270
|
-
|
|
271
|
-
|
|
254
|
+
i.styles ?? [],
|
|
255
|
+
g`
|
|
272
256
|
:host {
|
|
273
257
|
font-family: var(--font-family);
|
|
274
258
|
grid-column: span var(--width);
|
|
@@ -281,32 +265,32 @@ const K = (o) => {
|
|
|
281
265
|
box-sizing: border-box;
|
|
282
266
|
}
|
|
283
267
|
`
|
|
284
|
-
],
|
|
268
|
+
], h([
|
|
285
269
|
O({ context: q }),
|
|
286
270
|
x({ attribute: !1 })
|
|
287
|
-
], t.prototype, "container", 2),
|
|
271
|
+
], t.prototype, "container", 2), h([
|
|
288
272
|
x()
|
|
289
|
-
], t.prototype, "entry", 2),
|
|
290
|
-
|
|
291
|
-
], t.prototype, "descriptor", 2),
|
|
292
|
-
|
|
293
|
-
], t.prototype, "component", 2),
|
|
294
|
-
|
|
295
|
-
], t.prototype, "context", 2),
|
|
296
|
-
|
|
297
|
-
], t.prototype, "layout", 2),
|
|
298
|
-
|
|
273
|
+
], t.prototype, "entry", 2), h([
|
|
274
|
+
l()
|
|
275
|
+
], t.prototype, "descriptor", 2), h([
|
|
276
|
+
l()
|
|
277
|
+
], t.prototype, "component", 2), h([
|
|
278
|
+
l()
|
|
279
|
+
], t.prototype, "context", 2), h([
|
|
280
|
+
l()
|
|
281
|
+
], t.prototype, "layout", 2), h([
|
|
282
|
+
l()
|
|
299
283
|
], t.prototype, "properties", 2), t;
|
|
300
284
|
};
|
|
301
|
-
var T = Object.defineProperty, U = Object.getOwnPropertyDescriptor, G = (
|
|
302
|
-
for (var
|
|
303
|
-
(n = o
|
|
304
|
-
return
|
|
285
|
+
var T = Object.defineProperty, U = Object.getOwnPropertyDescriptor, G = (i, t, c, s) => {
|
|
286
|
+
for (var e = s > 1 ? void 0 : s ? U(t, c) : t, o = i.length - 1, n; o >= 0; o--)
|
|
287
|
+
(n = i[o]) && (e = (s ? n(t, c, e) : n(e)) || e);
|
|
288
|
+
return s && e && T(t, c, e), e;
|
|
305
289
|
};
|
|
306
|
-
const
|
|
307
|
-
let u = class extends
|
|
290
|
+
const m = B(V);
|
|
291
|
+
let u = class extends m {
|
|
308
292
|
render() {
|
|
309
|
-
return
|
|
293
|
+
return L` <div class="copyright">
|
|
310
294
|
<a
|
|
311
295
|
aria-label="Powered by Telia ACE"
|
|
312
296
|
href="https://ace-showcase.com/marketplace/ace-knowledge/"
|
|
@@ -423,8 +407,8 @@ let u = class extends C {
|
|
|
423
407
|
}
|
|
424
408
|
};
|
|
425
409
|
u.styles = [
|
|
426
|
-
|
|
427
|
-
|
|
410
|
+
m.styles || [],
|
|
411
|
+
g`
|
|
428
412
|
.copyright {
|
|
429
413
|
padding: var(--spacing-md);
|
|
430
414
|
box-shadow: 1px 0px 10px rgba(0, 0, 0, 0.1);
|
|
@@ -454,10 +438,10 @@ u.styles = [
|
|
|
454
438
|
`
|
|
455
439
|
];
|
|
456
440
|
u = G([
|
|
457
|
-
|
|
441
|
+
H("ace-copyright")
|
|
458
442
|
], u);
|
|
459
|
-
const
|
|
443
|
+
const X = u;
|
|
460
444
|
export {
|
|
461
445
|
u as CopyrightComponent,
|
|
462
|
-
|
|
446
|
+
X as default
|
|
463
447
|
};
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index-07ac5583.js");/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2017 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
-
*/const
|
|
6
|
-
* @license
|
|
7
|
-
* Copyright 2017 Google LLC
|
|
8
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
9
|
-
*/const C=({finisher:i,descriptor:t})=>(c,e)=>{var s;if(e===void 0){const o=(s=c.originalKey)!==null&&s!==void 0?s:c.key,n=t!=null?{kind:"method",placement:"prototype",key:o,descriptor:t(c.key)}:{...c,key:o};return i!=null&&(n.finisher=function(h){i(h,o)}),n}{const o=c.constructor;t!==void 0&&Object.defineProperty(c,e,t(e)),i==null||i(o,e)}};/**
|
|
5
|
+
*/const C=i=>(t,c)=>{c!==void 0?c.addInitializer(()=>{customElements.define(i,t)}):customElements.define(i,t)};/**
|
|
10
6
|
* @license
|
|
11
7
|
* Copyright 2021 Google LLC
|
|
12
8
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
13
|
-
*/let
|
|
9
|
+
*/let x=class extends Event{constructor(t,c,e){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.callback=c,this.subscribe=e??!1}};/**
|
|
14
10
|
* @license
|
|
15
11
|
* Copyright 2021 Google LLC
|
|
16
12
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -18,19 +14,19 @@
|
|
|
18
14
|
* @license
|
|
19
15
|
* Copyright 2021 Google LLC
|
|
20
16
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
21
|
-
*/let
|
|
17
|
+
*/let v=class{constructor(t,c,e,s){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(o,r)=>{this.unsubscribe&&(this.unsubscribe!==r&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=o,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(o,r)),this.unsubscribe=r},this.host=t,c.context!==void 0){const o=c;this.context=o.context,this.callback=o.callback,this.subscribe=o.subscribe??!1}else this.context=c,this.callback=e,this.subscribe=s??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new x(this.context,this.t,this.subscribe))}};/**
|
|
22
18
|
* @license
|
|
23
19
|
* Copyright 2021 Google LLC
|
|
24
20
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
25
|
-
*/class
|
|
21
|
+
*/class g{get value(){return this.o}set value(t){this.setValue(t)}setValue(t,c=!1){const e=c||!Object.is(t,this.o);this.o=t,e&&this.updateObservers()}constructor(t){this.subscriptions=new Map,this.updateObservers=()=>{for(const[c,{disposer:e}]of this.subscriptions)c(this.o,e)},t!==void 0&&(this.value=t)}addCallback(t,c,e){if(!e)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:()=>{this.subscriptions.delete(t)},consumerHost:c});const{disposer:s}=this.subscriptions.get(t);t(this.value,s)}clearCallbacks(){this.subscriptions.clear()}}/**
|
|
26
22
|
* @license
|
|
27
23
|
* Copyright 2021 Google LLC
|
|
28
24
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
29
|
-
*/class
|
|
25
|
+
*/class _ extends Event{constructor(t){super("context-provider",{bubbles:!0,composed:!0}),this.context=t}}class d extends g{constructor(t,c,e){super(c.context!==void 0?c.initialValue:e),this.onContextRequest=s=>{const o=s.composedPath()[0];s.context===this.context&&o!==this.host&&(s.stopPropagation(),this.addCallback(s.callback,o,s.subscribe))},this.onProviderRequest=s=>{const o=s.composedPath()[0];if(s.context!==this.context||o===this.host)return;const r=new Set;for(const[p,{consumerHost:u}]of this.subscriptions)r.has(p)||(r.add(p),u.dispatchEvent(new x(this.context,p,!0)));s.stopPropagation()},this.host=t,c.context!==void 0?this.context=c.context:this.context=c,this.attachListeners(),this.host.addController(this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new _(this.context))}}/**
|
|
30
26
|
* @license
|
|
31
27
|
* Copyright 2022 Google LLC
|
|
32
28
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
33
|
-
*/function
|
|
29
|
+
*/function m({context:i,subscribe:t}){return(c,e)=>{typeof e=="object"?e.addInitializer(function(){new v(this,{context:i,callback:s=>{this[e.name]=s},subscribe:t})}):c.constructor.addInitializer(s=>{new v(s,{context:i,callback:o=>{s[e]=o},subscribe:t})})}}const w="children",z="descriptor",P="container",M="context",L="layout",V="properties";class H{constructor(t){(this.host=t).addController(this)}hostConnected(){}hostDisconnected(){}setDescriptor(t){this._descriptor=t}setContainer(t){this._container=t}async dispatch(t,c){if(!this._container||!this._descriptor)return;const e=await n.pt.getInstance(this._container),s=new n.P(e).withId(this._descriptor.id);await e.actions(s,this._descriptor.type||n.ht()).dispatch(t,c)}}const D=i=>{const t={};return Object.keys(i).forEach(c=>{c.indexOf("css-")>-1&&(t[c]=i[c])}),t},E=(i,t)=>{const c=D(t);Object.entries(c).forEach(([e,s])=>{i.style.setProperty(e.replace("css-",""),s)})};var O=Object.defineProperty,k=Object.getOwnPropertyDescriptor,a=(i,t,c,e)=>{for(var s=e>1?void 0:e?k(t,c):t,o=i.length-1,r;o>=0;o--)(r=i[o])&&(s=(e?r(t,c,s):r(s))||s);return e&&s&&O(t,c,s),s};const q=i=>{class t extends i{constructor(){super(...arguments),this.entry="",this._descriptorProvider=new d(this,z,void 0),this._childrenProvider=new d(this,w,[]),this._propertiesProvider=new d(this,V,{}),this._contextProvider=new d(this,M,{}),this._layoutProvider=new d(this,L,{}),this.actions=new H(this),this.context={},this.layout={},this.properties={}}connectedCallback(){super.connectedCallback(),this.container&&(this.actions.setContainer(this.container),n.pt.getInstance(this.container).then(async e=>{var o,r;const s=e.nodes.get(this.entry);if(s){this._propertyChangeListener=e.events.subscribe("components:properties-changed",(l,h)=>{s.id===h.node.id&&this._setProperties(h.node.attributes.properties)}),this._contextChangeListener=e.events.subscribe("components:context-changed",(l,h)=>{s.id===h.node.id&&this._setContext(h.node.attributes.context)}),this._layoutChangeListener=e.events.subscribe("components:layout-changed",(l,h)=>{s.id===h.node.id&&this._setLayout(h.node.attributes.layout)});const p="default";this._unmountNode=s.mount(this.container),this._setDescriptor(n.Et(s,p)),this._setProperties(s.attributes.properties),this._setContext(s.attributes.context),this._setLayout(this.layout);const u=s.getChildren(p).map(l=>n.Et(l));this._childrenProvider.setValue(u);const f=await this.container.getAsync("componentResolver");if(((o=this.descriptor)==null?void 0:o.type)==="area")return;const b=f.getComponent(((r=this.descriptor)==null?void 0:r.type)||"");b.then&&b.then(l=>{this.component=l.default})}}))}disconnectedCallback(){super.disconnectedCallback(),this._propertyChangeListener&&this._propertyChangeListener(),this._contextChangeListener&&this._contextChangeListener(),this._layoutChangeListener&&this._layoutChangeListener(),this._unmountNode&&this._unmountNode()}updated(){this.container&&this.actions.setContainer(this.container),n.mapBranding(this.context,this.renderRoot.host),this.renderRoot.host.style.setProperty("--width",this.layout.size==="full"?"var(--columns, 1)":`min(${this.layout.size||"var(--columns)"}, var(--columns))`),E(this.renderRoot.host,this.properties)}_setProperties(e){this._propertiesProvider.setValue(e),this.properties=e}_setContext(e){this._contextProvider.setValue(e),this.context=e}_setLayout(e){this._layoutProvider.setValue(e),this.layout=e}_setDescriptor(e){this.descriptor=e,this._descriptorProvider.setValue(e),this.actions.setDescriptor(e)}}return t.styles=[i.styles??[],n.i`
|
|
34
30
|
:host {
|
|
35
31
|
font-family: var(--font-family);
|
|
36
32
|
grid-column: span var(--width);
|
|
@@ -42,7 +38,7 @@
|
|
|
42
38
|
* {
|
|
43
39
|
box-sizing: border-box;
|
|
44
40
|
}
|
|
45
|
-
`],
|
|
41
|
+
`],a([m({context:P}),n.n({attribute:!1})],t.prototype,"container",2),a([n.n()],t.prototype,"entry",2),a([n.r()],t.prototype,"descriptor",2),a([n.r()],t.prototype,"component",2),a([n.r()],t.prototype,"context",2),a([n.r()],t.prototype,"layout",2),a([n.r()],t.prototype,"properties",2),t};var R=Object.defineProperty,j=Object.getOwnPropertyDescriptor,F=(i,t,c,e)=>{for(var s=e>1?void 0:e?j(t,c):t,o=i.length-1,r;o>=0;o--)(r=i[o])&&(s=(e?r(t,c,s):r(s))||s);return e&&s&&R(t,c,s),s};const y=q(n.s);exports.CopyrightComponent=class extends y{render(){return n.x` <div class="copyright">
|
|
46
42
|
<a
|
|
47
43
|
aria-label="Powered by Telia ACE"
|
|
48
44
|
href="https://ace-showcase.com/marketplace/ace-knowledge/"
|
|
@@ -155,7 +151,7 @@
|
|
|
155
151
|
</g>
|
|
156
152
|
</svg>
|
|
157
153
|
</a>
|
|
158
|
-
</div>`}};exports.CopyrightComponent.styles=[
|
|
154
|
+
</div>`}};exports.CopyrightComponent.styles=[y.styles||[],n.i`
|
|
159
155
|
.copyright {
|
|
160
156
|
padding: var(--spacing-md);
|
|
161
157
|
box-shadow: 1px 0px 10px rgba(0, 0, 0, 0.1);
|
|
@@ -182,4 +178,4 @@
|
|
|
182
178
|
path {
|
|
183
179
|
fill: white;
|
|
184
180
|
}
|
|
185
|
-
`];exports.CopyrightComponent
|
|
181
|
+
`];exports.CopyrightComponent=F([C("ace-copyright")],exports.CopyrightComponent);const I=exports.CopyrightComponent;exports.default=I;
|