@everymatrix/player-user-consents 1.55.0 → 1.56.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.
- package/dist/cjs/{index-025ec107.js → index-2b0d6186.js} +170 -69
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/player-user-consents.cjs.entry.js +32 -6
- package/dist/cjs/player-user-consents.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/player-user-consents/player-user-consents.js +51 -5
- package/dist/esm/{index-d1010d42.js → index-ddeaee0b.js} +170 -69
- package/dist/esm/loader.js +2 -2
- package/dist/esm/player-user-consents.entry.js +32 -6
- package/dist/esm/player-user-consents.js +3 -3
- package/dist/player-user-consents/p-2ea10158.entry.js +1 -0
- package/dist/player-user-consents/p-97e255e9.js +2 -0
- package/dist/player-user-consents/player-user-consents.esm.js +1 -1
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/player-user-consents/.stencil/packages/stencil/player-user-consents/stencil.config.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/player-user-consents/.stencil/packages/stencil/player-user-consents/stencil.config.dev.d.ts +2 -0
- package/package.json +1 -1
- package/dist/player-user-consents/p-69e15f00.js +0 -2
- package/dist/player-user-consents/p-77c91e34.entry.js +0 -1
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/player-user-consents/.stencil/packages/stencil/player-user-consents/stencil.config.d.ts +0 -2
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/player-user-consents/.stencil/packages/stencil/player-user-consents/stencil.config.dev.d.ts +0 -2
- /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/player-user-consents/.stencil/tools/plugins/index.d.ts +0 -0
- /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/player-user-consents/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +0 -0
- /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/player-user-consents/.stencil/tools/plugins/vite-chunk-plugin.d.ts +0 -0
- /package/dist/types/Users/{maria.bumbar/Desktop → adrian.pripon/Documents/Work}/widgets-monorepo/packages/stencil/player-user-consents/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +0 -0
|
@@ -3,26 +3,52 @@ import { getTranslations, translate } from "../../utils/locale.utils";
|
|
|
3
3
|
import { setClientStyling, setClientStylingURL, setStreamStyling } from "../../../../../../../../libs/common/src/styling/index";
|
|
4
4
|
export class PlayerUserConsents {
|
|
5
5
|
constructor() {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Language
|
|
8
|
+
*/
|
|
8
9
|
this.lang = 'en';
|
|
10
|
+
/**
|
|
11
|
+
* 'true' when parent expects component to emit it's current value
|
|
12
|
+
*/
|
|
9
13
|
this.queried = false;
|
|
14
|
+
/**
|
|
15
|
+
* the type of the consent, used to determine render details
|
|
16
|
+
*/
|
|
10
17
|
this.consentType = '';
|
|
18
|
+
/**
|
|
19
|
+
* wether or not this consent is mandatory. Used for render details
|
|
20
|
+
*/
|
|
11
21
|
this.mandatory = false;
|
|
22
|
+
/**
|
|
23
|
+
* Select GM version
|
|
24
|
+
*/
|
|
12
25
|
this.gmVersion = '';
|
|
26
|
+
/**
|
|
27
|
+
* the title of the consent to be displayed
|
|
28
|
+
*/
|
|
13
29
|
this.consentTitle = '';
|
|
30
|
+
/**
|
|
31
|
+
* Client custom styling via inline style
|
|
32
|
+
*/
|
|
14
33
|
this.clientStyling = '';
|
|
34
|
+
/**
|
|
35
|
+
* Client custom styling via url
|
|
36
|
+
*/
|
|
15
37
|
this.clientStylingUrl = '';
|
|
38
|
+
/**
|
|
39
|
+
* Translation url
|
|
40
|
+
*/
|
|
16
41
|
this.translationUrl = '';
|
|
17
|
-
this.mbSource = undefined;
|
|
18
42
|
this.textContent = '';
|
|
43
|
+
this.goToTermsAndConditions = () => window.postMessage({ type: 'GoToTermsAndConditions' });
|
|
44
|
+
this.goToPrivacyPolicy = () => window.postMessage({ type: 'GoToPrivacyPolicy' });
|
|
19
45
|
}
|
|
20
46
|
handleNewTranslations() {
|
|
21
47
|
getTranslations(this.translationUrl);
|
|
22
48
|
}
|
|
23
49
|
handleStylingUrlChange(newValue, oldValue) {
|
|
24
50
|
if (newValue !== oldValue)
|
|
25
|
-
this.
|
|
51
|
+
setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
|
|
26
52
|
}
|
|
27
53
|
async componentWillLoad() {
|
|
28
54
|
if (this.translationUrl.length > 2) {
|
|
@@ -72,7 +98,7 @@ export class PlayerUserConsents {
|
|
|
72
98
|
if (this.queried) {
|
|
73
99
|
this.userLegislationConsentHandler();
|
|
74
100
|
}
|
|
75
|
-
return (h("div", { key: '
|
|
101
|
+
return (h("div", { key: 'aba04e96251f2f0febe96883b931193fb5ca8c94', ref: el => this.stylingContainer = el }, h("p", { key: 'd3f0cbeb5b45b4538462a53c41ab041b176a7c26', class: "ConsentTitle" }, this.consentTitle), h("label", { key: '800ab8d45e87b075402c3178e60a16866d0321d4', class: "UserConsent", htmlFor: "userConsent" }, h("input", { key: '919c15c353a8146661eca2870e7a63f7c689953e', ref: el => this.checkboxInput = el, id: "userConsent", type: "checkbox", onInput: () => this.userLegislationConsentHandler() }), this.determineTextContent(), this.mandatory && h("span", { key: 'f7126adee1ba5540837da4b852961d08a9eae857', class: "MandatoryItem" }, "*"))));
|
|
76
102
|
}
|
|
77
103
|
static get is() { return "player-user-consents"; }
|
|
78
104
|
static get encapsulation() { return "shadow"; }
|
|
@@ -102,6 +128,8 @@ export class PlayerUserConsents {
|
|
|
102
128
|
"tags": [],
|
|
103
129
|
"text": "Language"
|
|
104
130
|
},
|
|
131
|
+
"getter": false,
|
|
132
|
+
"setter": false,
|
|
105
133
|
"attribute": "lang",
|
|
106
134
|
"reflect": true,
|
|
107
135
|
"defaultValue": "'en'"
|
|
@@ -120,6 +148,8 @@ export class PlayerUserConsents {
|
|
|
120
148
|
"tags": [],
|
|
121
149
|
"text": "'true' when parent expects component to emit it's current value"
|
|
122
150
|
},
|
|
151
|
+
"getter": false,
|
|
152
|
+
"setter": false,
|
|
123
153
|
"attribute": "queried",
|
|
124
154
|
"reflect": true,
|
|
125
155
|
"defaultValue": "false"
|
|
@@ -138,6 +168,8 @@ export class PlayerUserConsents {
|
|
|
138
168
|
"tags": [],
|
|
139
169
|
"text": "the type of the consent, used to determine render details"
|
|
140
170
|
},
|
|
171
|
+
"getter": false,
|
|
172
|
+
"setter": false,
|
|
141
173
|
"attribute": "consent-type",
|
|
142
174
|
"reflect": true,
|
|
143
175
|
"defaultValue": "''"
|
|
@@ -156,6 +188,8 @@ export class PlayerUserConsents {
|
|
|
156
188
|
"tags": [],
|
|
157
189
|
"text": "wether or not this consent is mandatory. Used for render details"
|
|
158
190
|
},
|
|
191
|
+
"getter": false,
|
|
192
|
+
"setter": false,
|
|
159
193
|
"attribute": "mandatory",
|
|
160
194
|
"reflect": true,
|
|
161
195
|
"defaultValue": "false"
|
|
@@ -174,6 +208,8 @@ export class PlayerUserConsents {
|
|
|
174
208
|
"tags": [],
|
|
175
209
|
"text": "Select GM version"
|
|
176
210
|
},
|
|
211
|
+
"getter": false,
|
|
212
|
+
"setter": false,
|
|
177
213
|
"attribute": "gm-version",
|
|
178
214
|
"reflect": false,
|
|
179
215
|
"defaultValue": "''"
|
|
@@ -192,6 +228,8 @@ export class PlayerUserConsents {
|
|
|
192
228
|
"tags": [],
|
|
193
229
|
"text": "the title of the consent to be displayed"
|
|
194
230
|
},
|
|
231
|
+
"getter": false,
|
|
232
|
+
"setter": false,
|
|
195
233
|
"attribute": "consent-title",
|
|
196
234
|
"reflect": true,
|
|
197
235
|
"defaultValue": "''"
|
|
@@ -210,6 +248,8 @@ export class PlayerUserConsents {
|
|
|
210
248
|
"tags": [],
|
|
211
249
|
"text": "Client custom styling via inline style"
|
|
212
250
|
},
|
|
251
|
+
"getter": false,
|
|
252
|
+
"setter": false,
|
|
213
253
|
"attribute": "client-styling",
|
|
214
254
|
"reflect": false,
|
|
215
255
|
"defaultValue": "''"
|
|
@@ -228,6 +268,8 @@ export class PlayerUserConsents {
|
|
|
228
268
|
"tags": [],
|
|
229
269
|
"text": "Client custom styling via url"
|
|
230
270
|
},
|
|
271
|
+
"getter": false,
|
|
272
|
+
"setter": false,
|
|
231
273
|
"attribute": "client-styling-url",
|
|
232
274
|
"reflect": true,
|
|
233
275
|
"defaultValue": "''"
|
|
@@ -246,6 +288,8 @@ export class PlayerUserConsents {
|
|
|
246
288
|
"tags": [],
|
|
247
289
|
"text": "Translation url"
|
|
248
290
|
},
|
|
291
|
+
"getter": false,
|
|
292
|
+
"setter": false,
|
|
249
293
|
"attribute": "translation-url",
|
|
250
294
|
"reflect": true,
|
|
251
295
|
"defaultValue": "''"
|
|
@@ -264,6 +308,8 @@ export class PlayerUserConsents {
|
|
|
264
308
|
"tags": [],
|
|
265
309
|
"text": "the text content to be rendered by the component. Determined at runtime"
|
|
266
310
|
},
|
|
311
|
+
"getter": false,
|
|
312
|
+
"setter": false,
|
|
267
313
|
"attribute": "mb-source",
|
|
268
314
|
"reflect": true
|
|
269
315
|
}
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
const NAMESPACE = 'player-user-consents';
|
|
2
|
-
const BUILD = /* player-user-consents */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: false, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: true };
|
|
2
|
+
const BUILD = /* player-user-consents */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, modernPropertyDecls: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: false, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: false, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: false, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: true };
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
|
-
Stencil Client Platform v4.
|
|
5
|
+
Stencil Client Platform v4.26.0 | MIT Licensed | https://stenciljs.com
|
|
6
6
|
*/
|
|
7
7
|
var __defProp = Object.defineProperty;
|
|
8
8
|
var __export = (target, all) => {
|
|
9
9
|
for (var name in all)
|
|
10
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
11
|
};
|
|
12
|
+
|
|
13
|
+
// src/client/client-host-ref.ts
|
|
12
14
|
var hostRefs = /* @__PURE__ */ new WeakMap();
|
|
13
15
|
var getHostRef = (ref) => hostRefs.get(ref);
|
|
14
|
-
var registerInstance = (lazyInstance, hostRef) =>
|
|
16
|
+
var registerInstance = (lazyInstance, hostRef) => {
|
|
17
|
+
hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
|
|
18
|
+
};
|
|
15
19
|
var registerHost = (hostElement, cmpMeta) => {
|
|
16
20
|
const hostRef = {
|
|
17
21
|
$flags$: 0,
|
|
@@ -24,7 +28,8 @@ var registerHost = (hostElement, cmpMeta) => {
|
|
|
24
28
|
hostElement["s-p"] = [];
|
|
25
29
|
hostElement["s-rc"] = [];
|
|
26
30
|
}
|
|
27
|
-
|
|
31
|
+
const ref = hostRefs.set(hostElement, hostRef);
|
|
32
|
+
return ref;
|
|
28
33
|
};
|
|
29
34
|
var isMemberInElement = (elm, memberName) => memberName in elm;
|
|
30
35
|
var consoleError = (e, el) => (0, console.error)(e, el);
|
|
@@ -61,16 +66,22 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
61
66
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
62
67
|
/* webpackMode: "lazy" */
|
|
63
68
|
`./${bundleId}.entry.js${""}`
|
|
64
|
-
).then(
|
|
65
|
-
{
|
|
66
|
-
|
|
69
|
+
).then(
|
|
70
|
+
(importedModule) => {
|
|
71
|
+
{
|
|
72
|
+
cmpModules.set(bundleId, importedModule);
|
|
73
|
+
}
|
|
74
|
+
return importedModule[exportName];
|
|
75
|
+
},
|
|
76
|
+
(e) => {
|
|
77
|
+
consoleError(e, hostRef.$hostElement$);
|
|
67
78
|
}
|
|
68
|
-
|
|
69
|
-
}, consoleError);
|
|
79
|
+
);
|
|
70
80
|
};
|
|
71
81
|
|
|
72
82
|
// src/client/client-style.ts
|
|
73
83
|
var styles = /* @__PURE__ */ new Map();
|
|
84
|
+
var HYDRATED_STYLE_ID = "sty-id";
|
|
74
85
|
var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
|
|
75
86
|
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
|
76
87
|
var win = typeof window !== "undefined" ? window : {};
|
|
@@ -128,12 +139,6 @@ var flush = () => {
|
|
|
128
139
|
};
|
|
129
140
|
var nextTick = (cb) => promiseResolve().then(cb);
|
|
130
141
|
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
|
|
131
|
-
|
|
132
|
-
// src/utils/constants.ts
|
|
133
|
-
var EMPTY_OBJ = {};
|
|
134
|
-
|
|
135
|
-
// src/utils/helpers.ts
|
|
136
|
-
var isDef = (v) => v != null;
|
|
137
142
|
var isComplexType = (o) => {
|
|
138
143
|
o = typeof o;
|
|
139
144
|
return o === "object" || o === "function";
|
|
@@ -334,7 +339,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
334
339
|
}
|
|
335
340
|
if (!appliedStyles.has(scopeId2)) {
|
|
336
341
|
{
|
|
337
|
-
styleElm = doc.createElement("style");
|
|
342
|
+
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
|
|
338
343
|
styleElm.innerHTML = style;
|
|
339
344
|
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
|
|
340
345
|
if (nonce != null) {
|
|
@@ -344,7 +349,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
344
349
|
if (styleContainerNode.nodeName === "HEAD") {
|
|
345
350
|
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
346
351
|
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
347
|
-
styleContainerNode.insertBefore(
|
|
352
|
+
styleContainerNode.insertBefore(
|
|
353
|
+
styleElm,
|
|
354
|
+
(referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
|
|
355
|
+
);
|
|
348
356
|
} else if ("host" in styleContainerNode) {
|
|
349
357
|
if (supportsConstructableStylesheets) {
|
|
350
358
|
const stylesheet = new CSSStyleSheet();
|
|
@@ -362,7 +370,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
362
370
|
styleContainerNode.append(styleElm);
|
|
363
371
|
}
|
|
364
372
|
}
|
|
365
|
-
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */
|
|
373
|
+
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
366
374
|
styleContainerNode.insertBefore(styleElm, null);
|
|
367
375
|
}
|
|
368
376
|
}
|
|
@@ -387,23 +395,25 @@ var attachStyles = (hostRef) => {
|
|
|
387
395
|
const scopeId2 = addStyle(
|
|
388
396
|
elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
389
397
|
cmpMeta);
|
|
390
|
-
if (flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
|
|
398
|
+
if ((flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */ || flags & 128 /* shadowNeedsScopedCss */)) {
|
|
391
399
|
elm["s-sc"] = scopeId2;
|
|
392
400
|
elm.classList.add(scopeId2 + "-h");
|
|
393
401
|
}
|
|
394
402
|
endAttachStyles();
|
|
395
403
|
};
|
|
396
404
|
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
397
|
-
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
405
|
+
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
|
|
398
406
|
if (oldValue !== newValue) {
|
|
399
407
|
let isProp = isMemberInElement(elm, memberName);
|
|
400
408
|
let ln = memberName.toLowerCase();
|
|
401
409
|
if (memberName === "class") {
|
|
402
410
|
const classList = elm.classList;
|
|
403
411
|
const oldClasses = parseClassList(oldValue);
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
412
|
+
let newClasses = parseClassList(newValue);
|
|
413
|
+
{
|
|
414
|
+
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
415
|
+
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
416
|
+
}
|
|
407
417
|
} else if (memberName === "key") ; else if (memberName === "ref") {
|
|
408
418
|
if (newValue) {
|
|
409
419
|
newValue(elm);
|
|
@@ -441,7 +451,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
441
451
|
elm.setAttribute(memberName, n);
|
|
442
452
|
}
|
|
443
453
|
}
|
|
444
|
-
} else {
|
|
454
|
+
} else if (elm[memberName] !== newValue) {
|
|
445
455
|
elm[memberName] = newValue;
|
|
446
456
|
}
|
|
447
457
|
} catch (e) {
|
|
@@ -463,24 +473,44 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
463
473
|
}
|
|
464
474
|
};
|
|
465
475
|
var parseClassListRegex = /\s/;
|
|
466
|
-
var parseClassList = (value) =>
|
|
476
|
+
var parseClassList = (value) => {
|
|
477
|
+
if (typeof value === "object" && value && "baseVal" in value) {
|
|
478
|
+
value = value.baseVal;
|
|
479
|
+
}
|
|
480
|
+
if (!value || typeof value !== "string") {
|
|
481
|
+
return [];
|
|
482
|
+
}
|
|
483
|
+
return value.split(parseClassListRegex);
|
|
484
|
+
};
|
|
467
485
|
var CAPTURE_EVENT_SUFFIX = "Capture";
|
|
468
486
|
var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
|
|
469
487
|
|
|
470
488
|
// src/runtime/vdom/update-element.ts
|
|
471
|
-
var updateElement = (oldVnode, newVnode, isSvgMode2) => {
|
|
489
|
+
var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
|
|
472
490
|
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
473
|
-
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ ||
|
|
474
|
-
const newVnodeAttrs = newVnode.$attrs$ ||
|
|
491
|
+
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
|
|
492
|
+
const newVnodeAttrs = newVnode.$attrs$ || {};
|
|
475
493
|
{
|
|
476
494
|
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
477
495
|
if (!(memberName in newVnodeAttrs)) {
|
|
478
|
-
setAccessor(
|
|
496
|
+
setAccessor(
|
|
497
|
+
elm,
|
|
498
|
+
memberName,
|
|
499
|
+
oldVnodeAttrs[memberName],
|
|
500
|
+
void 0,
|
|
501
|
+
isSvgMode2,
|
|
502
|
+
newVnode.$flags$);
|
|
479
503
|
}
|
|
480
504
|
}
|
|
481
505
|
}
|
|
482
506
|
for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
|
|
483
|
-
setAccessor(
|
|
507
|
+
setAccessor(
|
|
508
|
+
elm,
|
|
509
|
+
memberName,
|
|
510
|
+
oldVnodeAttrs[memberName],
|
|
511
|
+
newVnodeAttrs[memberName],
|
|
512
|
+
isSvgMode2,
|
|
513
|
+
newVnode.$flags$);
|
|
484
514
|
}
|
|
485
515
|
};
|
|
486
516
|
function sortedAttrNames(attrNames) {
|
|
@@ -492,13 +522,10 @@ function sortedAttrNames(attrNames) {
|
|
|
492
522
|
attrNames
|
|
493
523
|
);
|
|
494
524
|
}
|
|
495
|
-
|
|
496
|
-
// src/runtime/vdom/vdom-render.ts
|
|
497
|
-
var scopeId;
|
|
498
525
|
var hostTagName;
|
|
499
526
|
var useNativeShadowDom = false;
|
|
500
527
|
var isSvgMode = false;
|
|
501
|
-
var createElm = (oldParentVNode, newParentVNode, childIndex
|
|
528
|
+
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
502
529
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
503
530
|
let i2 = 0;
|
|
504
531
|
let elm;
|
|
@@ -512,11 +539,6 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
512
539
|
{
|
|
513
540
|
updateElement(null, newVNode2, isSvgMode);
|
|
514
541
|
}
|
|
515
|
-
const rootNode = elm.getRootNode();
|
|
516
|
-
const isElementWithinShadowRoot = !rootNode.querySelector("body");
|
|
517
|
-
if (!isElementWithinShadowRoot && BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
518
|
-
elm.classList.add(elm["s-si"] = scopeId);
|
|
519
|
-
}
|
|
520
542
|
if (newVNode2.$children$) {
|
|
521
543
|
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
522
544
|
childNode = createElm(oldParentVNode, newVNode2, i2);
|
|
@@ -646,6 +668,9 @@ var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
|
646
668
|
if (!isInitialRender) {
|
|
647
669
|
return leftVNode.$key$ === rightVNode.$key$;
|
|
648
670
|
}
|
|
671
|
+
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
|
|
672
|
+
leftVNode.$key$ = rightVNode.$key$;
|
|
673
|
+
}
|
|
649
674
|
return true;
|
|
650
675
|
}
|
|
651
676
|
return false;
|
|
@@ -685,8 +710,9 @@ var nullifyVNodeRefs = (vNode) => {
|
|
|
685
710
|
}
|
|
686
711
|
};
|
|
687
712
|
var insertBefore = (parent, newNode, reference) => {
|
|
688
|
-
|
|
689
|
-
|
|
713
|
+
{
|
|
714
|
+
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
715
|
+
}
|
|
690
716
|
};
|
|
691
717
|
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
692
718
|
const hostElm = hostRef.$hostElement$;
|
|
@@ -711,17 +737,21 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
711
737
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
712
738
|
hostRef.$vnode$ = rootVnode;
|
|
713
739
|
rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
|
|
714
|
-
|
|
715
|
-
scopeId = hostElm["s-sc"];
|
|
716
|
-
}
|
|
717
|
-
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
740
|
+
useNativeShadowDom = !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && !(cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */);
|
|
718
741
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
719
742
|
};
|
|
720
743
|
|
|
721
744
|
// src/runtime/update-component.ts
|
|
722
745
|
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
723
746
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
724
|
-
ancestorComponent["s-p"].push(
|
|
747
|
+
const index = ancestorComponent["s-p"].push(
|
|
748
|
+
new Promise(
|
|
749
|
+
(r) => hostRef.$onRenderResolve$ = () => {
|
|
750
|
+
ancestorComponent["s-p"].splice(index - 1, 1);
|
|
751
|
+
r();
|
|
752
|
+
}
|
|
753
|
+
)
|
|
754
|
+
);
|
|
725
755
|
}
|
|
726
756
|
};
|
|
727
757
|
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
@@ -748,7 +778,7 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
748
778
|
let maybePromise;
|
|
749
779
|
if (isInitialLoad) {
|
|
750
780
|
{
|
|
751
|
-
maybePromise = safeCall(instance, "componentWillLoad");
|
|
781
|
+
maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
|
|
752
782
|
}
|
|
753
783
|
}
|
|
754
784
|
endSchedule();
|
|
@@ -822,7 +852,7 @@ var postUpdateComponent = (hostRef) => {
|
|
|
822
852
|
addHydratedFlag(elm);
|
|
823
853
|
}
|
|
824
854
|
{
|
|
825
|
-
safeCall(instance, "componentDidLoad");
|
|
855
|
+
safeCall(instance, "componentDidLoad", void 0, elm);
|
|
826
856
|
}
|
|
827
857
|
endPostUpdate();
|
|
828
858
|
{
|
|
@@ -846,17 +876,14 @@ var postUpdateComponent = (hostRef) => {
|
|
|
846
876
|
}
|
|
847
877
|
};
|
|
848
878
|
var appDidLoad = (who) => {
|
|
849
|
-
{
|
|
850
|
-
addHydratedFlag(doc.documentElement);
|
|
851
|
-
}
|
|
852
879
|
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
853
880
|
};
|
|
854
|
-
var safeCall = (instance, method, arg) => {
|
|
881
|
+
var safeCall = (instance, method, arg, elm) => {
|
|
855
882
|
if (instance && instance[method]) {
|
|
856
883
|
try {
|
|
857
884
|
return instance[method](arg);
|
|
858
885
|
} catch (e) {
|
|
859
|
-
consoleError(e);
|
|
886
|
+
consoleError(e, elm);
|
|
860
887
|
}
|
|
861
888
|
}
|
|
862
889
|
return void 0;
|
|
@@ -915,15 +942,68 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
915
942
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
916
943
|
members.map(([memberName, [memberFlags]]) => {
|
|
917
944
|
if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
945
|
+
const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
|
|
946
|
+
if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
|
|
947
|
+
if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
|
|
948
|
+
if (flags & 1 /* isElementConstructor */ || !origGetter) {
|
|
949
|
+
Object.defineProperty(prototype, memberName, {
|
|
950
|
+
get() {
|
|
951
|
+
{
|
|
952
|
+
if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
|
|
953
|
+
return getValue(this, memberName);
|
|
954
|
+
}
|
|
955
|
+
const ref = getHostRef(this);
|
|
956
|
+
const instance = ref ? ref.$lazyInstance$ : prototype;
|
|
957
|
+
if (!instance) return;
|
|
958
|
+
return instance[memberName];
|
|
959
|
+
}
|
|
960
|
+
},
|
|
961
|
+
configurable: true,
|
|
962
|
+
enumerable: true
|
|
963
|
+
});
|
|
964
|
+
}
|
|
918
965
|
Object.defineProperty(prototype, memberName, {
|
|
919
|
-
get() {
|
|
920
|
-
return getValue(this, memberName);
|
|
921
|
-
},
|
|
922
966
|
set(newValue) {
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
967
|
+
const ref = getHostRef(this);
|
|
968
|
+
if (origSetter) {
|
|
969
|
+
const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
970
|
+
if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
|
|
971
|
+
newValue = ref.$instanceValues$.get(memberName);
|
|
972
|
+
} else if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
973
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
974
|
+
}
|
|
975
|
+
origSetter.apply(this, [parsePropertyValue(newValue, memberFlags)]);
|
|
976
|
+
newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
977
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
978
|
+
return;
|
|
979
|
+
}
|
|
980
|
+
{
|
|
981
|
+
if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
|
|
982
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
983
|
+
if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
|
|
984
|
+
ref.$onReadyPromise$.then(() => {
|
|
985
|
+
if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
|
|
986
|
+
ref.$lazyInstance$[memberName] = newValue;
|
|
987
|
+
}
|
|
988
|
+
});
|
|
989
|
+
}
|
|
990
|
+
return;
|
|
991
|
+
}
|
|
992
|
+
const setterSetVal = () => {
|
|
993
|
+
const currentValue = ref.$lazyInstance$[memberName];
|
|
994
|
+
if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
995
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
996
|
+
}
|
|
997
|
+
ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, memberFlags);
|
|
998
|
+
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
|
|
999
|
+
};
|
|
1000
|
+
if (ref.$lazyInstance$) {
|
|
1001
|
+
setterSetVal();
|
|
1002
|
+
} else {
|
|
1003
|
+
ref.$onReadyPromise$.then(() => setterSetVal());
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
927
1007
|
});
|
|
928
1008
|
}
|
|
929
1009
|
});
|
|
@@ -933,7 +1013,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
933
1013
|
plt.jmp(() => {
|
|
934
1014
|
var _a2;
|
|
935
1015
|
const propName = attrNameToPropName.get(attrName);
|
|
936
|
-
if (this.hasOwnProperty(propName)) {
|
|
1016
|
+
if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
|
|
937
1017
|
newValue = this[propName];
|
|
938
1018
|
delete this[propName];
|
|
939
1019
|
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
|
|
@@ -953,7 +1033,11 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
953
1033
|
}
|
|
954
1034
|
return;
|
|
955
1035
|
}
|
|
956
|
-
|
|
1036
|
+
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
1037
|
+
newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
|
|
1038
|
+
if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
|
|
1039
|
+
this[propName] = newValue;
|
|
1040
|
+
}
|
|
957
1041
|
});
|
|
958
1042
|
};
|
|
959
1043
|
Cstr.observedAttributes = Array.from(
|
|
@@ -982,7 +1066,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
982
1066
|
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
983
1067
|
const bundleId = cmpMeta.$lazyBundleId$;
|
|
984
1068
|
if (bundleId) {
|
|
985
|
-
const CstrImport = loadModule(cmpMeta);
|
|
1069
|
+
const CstrImport = loadModule(cmpMeta, hostRef);
|
|
986
1070
|
if (CstrImport && "then" in CstrImport) {
|
|
987
1071
|
const endLoad = uniqueTime();
|
|
988
1072
|
Cstr = await CstrImport;
|
|
@@ -1007,7 +1091,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1007
1091
|
try {
|
|
1008
1092
|
new Cstr(hostRef);
|
|
1009
1093
|
} catch (e) {
|
|
1010
|
-
consoleError(e);
|
|
1094
|
+
consoleError(e, elm);
|
|
1011
1095
|
}
|
|
1012
1096
|
{
|
|
1013
1097
|
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
@@ -1042,7 +1126,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1042
1126
|
schedule();
|
|
1043
1127
|
}
|
|
1044
1128
|
};
|
|
1045
|
-
var fireConnectedCallback = (instance) => {
|
|
1129
|
+
var fireConnectedCallback = (instance, elm) => {
|
|
1046
1130
|
};
|
|
1047
1131
|
|
|
1048
1132
|
// src/runtime/connected-callback.ts
|
|
@@ -1082,20 +1166,26 @@ var connectedCallback = (elm) => {
|
|
|
1082
1166
|
endConnected();
|
|
1083
1167
|
}
|
|
1084
1168
|
};
|
|
1085
|
-
var disconnectInstance = (instance) => {
|
|
1169
|
+
var disconnectInstance = (instance, elm) => {
|
|
1086
1170
|
{
|
|
1087
|
-
safeCall(instance, "disconnectedCallback");
|
|
1171
|
+
safeCall(instance, "disconnectedCallback", void 0, elm || instance);
|
|
1088
1172
|
}
|
|
1089
1173
|
};
|
|
1090
1174
|
var disconnectedCallback = async (elm) => {
|
|
1091
1175
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1092
1176
|
const hostRef = getHostRef(elm);
|
|
1093
1177
|
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
1094
|
-
disconnectInstance(hostRef.$lazyInstance
|
|
1178
|
+
disconnectInstance(hostRef.$lazyInstance$, elm);
|
|
1095
1179
|
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
1096
|
-
hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance
|
|
1180
|
+
hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$, elm));
|
|
1097
1181
|
}
|
|
1098
1182
|
}
|
|
1183
|
+
if (rootAppliedStyles.has(elm)) {
|
|
1184
|
+
rootAppliedStyles.delete(elm);
|
|
1185
|
+
}
|
|
1186
|
+
if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
|
|
1187
|
+
rootAppliedStyles.delete(elm.shadowRoot);
|
|
1188
|
+
}
|
|
1099
1189
|
};
|
|
1100
1190
|
|
|
1101
1191
|
// src/runtime/bootstrap-lazy.ts
|
|
@@ -1176,6 +1266,17 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1176
1266
|
}
|
|
1177
1267
|
disconnectedCallback() {
|
|
1178
1268
|
plt.jmp(() => disconnectedCallback(this));
|
|
1269
|
+
plt.raf(() => {
|
|
1270
|
+
var _a3;
|
|
1271
|
+
const hostRef = getHostRef(this);
|
|
1272
|
+
const i2 = deferredConnectedCallbacks.findIndex((host) => host === this);
|
|
1273
|
+
if (i2 > -1) {
|
|
1274
|
+
deferredConnectedCallbacks.splice(i2, 1);
|
|
1275
|
+
}
|
|
1276
|
+
if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
|
|
1277
|
+
delete hostRef.$vnode$.$elm$;
|
|
1278
|
+
}
|
|
1279
|
+
});
|
|
1179
1280
|
}
|
|
1180
1281
|
componentOnReady() {
|
|
1181
1282
|
return getHostRef(this).$onReadyPromise$;
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { b as bootstrapLazy } from './index-ddeaee0b.js';
|
|
2
|
+
export { s as setNonce } from './index-ddeaee0b.js';
|
|
3
3
|
import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
4
4
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|