@everymatrix/user-action-controller 1.52.6 → 1.53.10
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-b067df3d.js → index-3737bf3d.js} +167 -70
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/player-user-consents_2.cjs.entry.js +73 -30
- package/dist/cjs/user-action-controller.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/user-action-controller/user-action-controller.js +49 -18
- package/dist/esm/{index-0c8be11b.js → index-fb9e84e2.js} +167 -70
- package/dist/esm/loader.js +2 -2
- package/dist/esm/player-user-consents_2.entry.js +73 -30
- package/dist/esm/user-action-controller.js +3 -3
- package/dist/user-action-controller/p-6d487ec9.js +2 -0
- package/dist/user-action-controller/{p-0bb99851.entry.js → p-cf2c1cc4.entry.js} +1 -1
- package/dist/user-action-controller/user-action-controller.esm.js +1 -1
- package/package.json +1 -1
- package/dist/user-action-controller/p-1fd217dd.js +0 -2
|
@@ -3,6 +3,37 @@ import { getTranslations, translate } from "../../utils/locale.utils";
|
|
|
3
3
|
import "../../../../../player-user-consents/dist/types/index";
|
|
4
4
|
export class UserActionController {
|
|
5
5
|
constructor() {
|
|
6
|
+
/**
|
|
7
|
+
* Language
|
|
8
|
+
*/
|
|
9
|
+
this.lang = 'en';
|
|
10
|
+
/**
|
|
11
|
+
* Select GM version
|
|
12
|
+
*/
|
|
13
|
+
this.gmVersion = '';
|
|
14
|
+
/**
|
|
15
|
+
* Translation url
|
|
16
|
+
*/
|
|
17
|
+
this.translationUrl = '';
|
|
18
|
+
/**
|
|
19
|
+
* Client custom styling via inline style
|
|
20
|
+
*/
|
|
21
|
+
this.clientStyling = '';
|
|
22
|
+
/**
|
|
23
|
+
* Client custom styling via url
|
|
24
|
+
*/
|
|
25
|
+
this.clientStylingUrl = '';
|
|
26
|
+
/**
|
|
27
|
+
* Which actions are required in order to activate the "Apply" button. Other actions are considered optional.
|
|
28
|
+
*/
|
|
29
|
+
this.queryFired = false;
|
|
30
|
+
this.readyActionsCount = 0;
|
|
31
|
+
this.activeUserActions = [];
|
|
32
|
+
this.userActionsValidated = true;
|
|
33
|
+
this.receivedQueryResponses = 0;
|
|
34
|
+
this.limitStylingAppends = false;
|
|
35
|
+
this.isLoading = true;
|
|
36
|
+
this.mandatoryActionsChecked = 0;
|
|
6
37
|
//for now this variable is hardcoded bcs we have terms and conditions and privacy policy mandatory and we dont receive with these new functionality the mandatory actions
|
|
7
38
|
this.mandatoryActions = ['termsandconditions', 'privacypolicy'];
|
|
8
39
|
this.userActions = [];
|
|
@@ -30,24 +61,6 @@ export class UserActionController {
|
|
|
30
61
|
console.log('error ', err);
|
|
31
62
|
});
|
|
32
63
|
};
|
|
33
|
-
this.endpoint = undefined;
|
|
34
|
-
this.userSession = undefined;
|
|
35
|
-
this.userId = undefined;
|
|
36
|
-
this.lang = 'en';
|
|
37
|
-
this.includeSubmitButton = undefined;
|
|
38
|
-
this.gmVersion = '';
|
|
39
|
-
this.translationUrl = '';
|
|
40
|
-
this.clientStyling = '';
|
|
41
|
-
this.clientStylingUrl = '';
|
|
42
|
-
this.queryFired = false;
|
|
43
|
-
this.readyActionsCount = 0;
|
|
44
|
-
this.activeUserActions = [];
|
|
45
|
-
this.userActionsValidated = true;
|
|
46
|
-
this.receivedQueryResponses = 0;
|
|
47
|
-
this.limitStylingAppends = false;
|
|
48
|
-
this.isLoading = true;
|
|
49
|
-
this.mandatoryActionsChecked = 0;
|
|
50
|
-
this.mandatoryItems = undefined;
|
|
51
64
|
}
|
|
52
65
|
handleNewTranslations() {
|
|
53
66
|
getTranslations(this.translationUrl);
|
|
@@ -244,6 +257,8 @@ export class UserActionController {
|
|
|
244
257
|
"tags": [],
|
|
245
258
|
"text": "the endpoint required for the update call"
|
|
246
259
|
},
|
|
260
|
+
"getter": false,
|
|
261
|
+
"setter": false,
|
|
247
262
|
"attribute": "endpoint",
|
|
248
263
|
"reflect": true
|
|
249
264
|
},
|
|
@@ -261,6 +276,8 @@ export class UserActionController {
|
|
|
261
276
|
"tags": [],
|
|
262
277
|
"text": "user session required for the update call"
|
|
263
278
|
},
|
|
279
|
+
"getter": false,
|
|
280
|
+
"setter": false,
|
|
264
281
|
"attribute": "user-session",
|
|
265
282
|
"reflect": true
|
|
266
283
|
},
|
|
@@ -278,6 +295,8 @@ export class UserActionController {
|
|
|
278
295
|
"tags": [],
|
|
279
296
|
"text": "user id required for the update call"
|
|
280
297
|
},
|
|
298
|
+
"getter": false,
|
|
299
|
+
"setter": false,
|
|
281
300
|
"attribute": "user-id",
|
|
282
301
|
"reflect": true
|
|
283
302
|
},
|
|
@@ -295,6 +314,8 @@ export class UserActionController {
|
|
|
295
314
|
"tags": [],
|
|
296
315
|
"text": "Language"
|
|
297
316
|
},
|
|
317
|
+
"getter": false,
|
|
318
|
+
"setter": false,
|
|
298
319
|
"attribute": "lang",
|
|
299
320
|
"reflect": true,
|
|
300
321
|
"defaultValue": "'en'"
|
|
@@ -313,6 +334,8 @@ export class UserActionController {
|
|
|
313
334
|
"tags": [],
|
|
314
335
|
"text": "whether or not to include the submit button (in case we want to compose a different )"
|
|
315
336
|
},
|
|
337
|
+
"getter": false,
|
|
338
|
+
"setter": false,
|
|
316
339
|
"attribute": "include-submit-button",
|
|
317
340
|
"reflect": true
|
|
318
341
|
},
|
|
@@ -330,6 +353,8 @@ export class UserActionController {
|
|
|
330
353
|
"tags": [],
|
|
331
354
|
"text": "Select GM version"
|
|
332
355
|
},
|
|
356
|
+
"getter": false,
|
|
357
|
+
"setter": false,
|
|
333
358
|
"attribute": "gm-version",
|
|
334
359
|
"reflect": false,
|
|
335
360
|
"defaultValue": "''"
|
|
@@ -348,6 +373,8 @@ export class UserActionController {
|
|
|
348
373
|
"tags": [],
|
|
349
374
|
"text": "Translation url"
|
|
350
375
|
},
|
|
376
|
+
"getter": false,
|
|
377
|
+
"setter": false,
|
|
351
378
|
"attribute": "translation-url",
|
|
352
379
|
"reflect": true,
|
|
353
380
|
"defaultValue": "''"
|
|
@@ -366,6 +393,8 @@ export class UserActionController {
|
|
|
366
393
|
"tags": [],
|
|
367
394
|
"text": "Client custom styling via inline style"
|
|
368
395
|
},
|
|
396
|
+
"getter": false,
|
|
397
|
+
"setter": false,
|
|
369
398
|
"attribute": "client-styling",
|
|
370
399
|
"reflect": true,
|
|
371
400
|
"defaultValue": "''"
|
|
@@ -384,6 +413,8 @@ export class UserActionController {
|
|
|
384
413
|
"tags": [],
|
|
385
414
|
"text": "Client custom styling via url"
|
|
386
415
|
},
|
|
416
|
+
"getter": false,
|
|
417
|
+
"setter": false,
|
|
387
418
|
"attribute": "client-styling-url",
|
|
388
419
|
"reflect": true,
|
|
389
420
|
"defaultValue": "''"
|
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
const NAMESPACE = 'user-action-controller';
|
|
2
|
-
const BUILD = /* user-action-controller */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: false, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, 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: true, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: true, 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 = /* user-action-controller */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: false, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, 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: true, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: true, 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.25.1 | 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/utils/constants.ts
|
|
14
|
+
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
15
|
+
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
16
|
+
|
|
17
|
+
// src/client/client-host-ref.ts
|
|
12
18
|
var hostRefs = /* @__PURE__ */ new WeakMap();
|
|
13
19
|
var getHostRef = (ref) => hostRefs.get(ref);
|
|
14
|
-
var registerInstance = (lazyInstance, hostRef) =>
|
|
20
|
+
var registerInstance = (lazyInstance, hostRef) => {
|
|
21
|
+
hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
|
|
22
|
+
};
|
|
15
23
|
var registerHost = (hostElement, cmpMeta) => {
|
|
16
24
|
const hostRef = {
|
|
17
25
|
$flags$: 0,
|
|
@@ -24,7 +32,8 @@ var registerHost = (hostElement, cmpMeta) => {
|
|
|
24
32
|
hostElement["s-p"] = [];
|
|
25
33
|
hostElement["s-rc"] = [];
|
|
26
34
|
}
|
|
27
|
-
|
|
35
|
+
const ref = hostRefs.set(hostElement, hostRef);
|
|
36
|
+
return ref;
|
|
28
37
|
};
|
|
29
38
|
var isMemberInElement = (elm, memberName) => memberName in elm;
|
|
30
39
|
var consoleError = (e, el) => (0, console.error)(e, el);
|
|
@@ -61,16 +70,22 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
61
70
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
62
71
|
/* webpackMode: "lazy" */
|
|
63
72
|
`./${bundleId}.entry.js${""}`
|
|
64
|
-
).then(
|
|
65
|
-
{
|
|
66
|
-
|
|
73
|
+
).then(
|
|
74
|
+
(importedModule) => {
|
|
75
|
+
{
|
|
76
|
+
cmpModules.set(bundleId, importedModule);
|
|
77
|
+
}
|
|
78
|
+
return importedModule[exportName];
|
|
79
|
+
},
|
|
80
|
+
(e) => {
|
|
81
|
+
consoleError(e, hostRef.$hostElement$);
|
|
67
82
|
}
|
|
68
|
-
|
|
69
|
-
}, consoleError);
|
|
83
|
+
);
|
|
70
84
|
};
|
|
71
85
|
|
|
72
86
|
// src/client/client-style.ts
|
|
73
87
|
var styles = /* @__PURE__ */ new Map();
|
|
88
|
+
var HYDRATED_STYLE_ID = "sty-id";
|
|
74
89
|
var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
|
|
75
90
|
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
|
76
91
|
var win = typeof window !== "undefined" ? window : {};
|
|
@@ -144,14 +159,6 @@ var flush = () => {
|
|
|
144
159
|
};
|
|
145
160
|
var nextTick = (cb) => promiseResolve().then(cb);
|
|
146
161
|
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
|
|
147
|
-
|
|
148
|
-
// src/utils/constants.ts
|
|
149
|
-
var EMPTY_OBJ = {};
|
|
150
|
-
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
151
|
-
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
152
|
-
|
|
153
|
-
// src/utils/helpers.ts
|
|
154
|
-
var isDef = (v) => v != null;
|
|
155
162
|
var isComplexType = (o) => {
|
|
156
163
|
o = typeof o;
|
|
157
164
|
return o === "object" || o === "function";
|
|
@@ -352,7 +359,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
352
359
|
}
|
|
353
360
|
if (!appliedStyles.has(scopeId2)) {
|
|
354
361
|
{
|
|
355
|
-
styleElm = doc.createElement("style");
|
|
362
|
+
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
|
|
356
363
|
styleElm.innerHTML = style;
|
|
357
364
|
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
|
|
358
365
|
if (nonce != null) {
|
|
@@ -362,7 +369,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
362
369
|
if (styleContainerNode.nodeName === "HEAD") {
|
|
363
370
|
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
364
371
|
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
365
|
-
styleContainerNode.insertBefore(
|
|
372
|
+
styleContainerNode.insertBefore(
|
|
373
|
+
styleElm,
|
|
374
|
+
(referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
|
|
375
|
+
);
|
|
366
376
|
} else if ("host" in styleContainerNode) {
|
|
367
377
|
if (supportsConstructableStylesheets) {
|
|
368
378
|
const stylesheet = new CSSStyleSheet();
|
|
@@ -412,16 +422,18 @@ var attachStyles = (hostRef) => {
|
|
|
412
422
|
endAttachStyles();
|
|
413
423
|
};
|
|
414
424
|
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
415
|
-
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
425
|
+
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
|
|
416
426
|
if (oldValue !== newValue) {
|
|
417
427
|
let isProp = isMemberInElement(elm, memberName);
|
|
418
428
|
let ln = memberName.toLowerCase();
|
|
419
429
|
if (memberName === "class") {
|
|
420
430
|
const classList = elm.classList;
|
|
421
431
|
const oldClasses = parseClassList(oldValue);
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
432
|
+
let newClasses = parseClassList(newValue);
|
|
433
|
+
{
|
|
434
|
+
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
435
|
+
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
436
|
+
}
|
|
425
437
|
} else if (memberName === "key") ; else if (memberName === "ref") {
|
|
426
438
|
if (newValue) {
|
|
427
439
|
newValue(elm);
|
|
@@ -459,7 +471,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
459
471
|
elm.setAttribute(memberName, n);
|
|
460
472
|
}
|
|
461
473
|
}
|
|
462
|
-
} else {
|
|
474
|
+
} else if (elm[memberName] !== newValue) {
|
|
463
475
|
elm[memberName] = newValue;
|
|
464
476
|
}
|
|
465
477
|
} catch (e) {
|
|
@@ -481,24 +493,44 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
481
493
|
}
|
|
482
494
|
};
|
|
483
495
|
var parseClassListRegex = /\s/;
|
|
484
|
-
var parseClassList = (value) =>
|
|
496
|
+
var parseClassList = (value) => {
|
|
497
|
+
if (typeof value === "object" && value && "baseVal" in value) {
|
|
498
|
+
value = value.baseVal;
|
|
499
|
+
}
|
|
500
|
+
if (!value || typeof value !== "string") {
|
|
501
|
+
return [];
|
|
502
|
+
}
|
|
503
|
+
return value.split(parseClassListRegex);
|
|
504
|
+
};
|
|
485
505
|
var CAPTURE_EVENT_SUFFIX = "Capture";
|
|
486
506
|
var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
|
|
487
507
|
|
|
488
508
|
// src/runtime/vdom/update-element.ts
|
|
489
|
-
var updateElement = (oldVnode, newVnode, isSvgMode2) => {
|
|
509
|
+
var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
|
|
490
510
|
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
491
|
-
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ ||
|
|
492
|
-
const newVnodeAttrs = newVnode.$attrs$ ||
|
|
511
|
+
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
|
|
512
|
+
const newVnodeAttrs = newVnode.$attrs$ || {};
|
|
493
513
|
{
|
|
494
514
|
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
495
515
|
if (!(memberName in newVnodeAttrs)) {
|
|
496
|
-
setAccessor(
|
|
516
|
+
setAccessor(
|
|
517
|
+
elm,
|
|
518
|
+
memberName,
|
|
519
|
+
oldVnodeAttrs[memberName],
|
|
520
|
+
void 0,
|
|
521
|
+
isSvgMode2,
|
|
522
|
+
newVnode.$flags$);
|
|
497
523
|
}
|
|
498
524
|
}
|
|
499
525
|
}
|
|
500
526
|
for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
|
|
501
|
-
setAccessor(
|
|
527
|
+
setAccessor(
|
|
528
|
+
elm,
|
|
529
|
+
memberName,
|
|
530
|
+
oldVnodeAttrs[memberName],
|
|
531
|
+
newVnodeAttrs[memberName],
|
|
532
|
+
isSvgMode2,
|
|
533
|
+
newVnode.$flags$);
|
|
502
534
|
}
|
|
503
535
|
};
|
|
504
536
|
function sortedAttrNames(attrNames) {
|
|
@@ -510,13 +542,10 @@ function sortedAttrNames(attrNames) {
|
|
|
510
542
|
attrNames
|
|
511
543
|
);
|
|
512
544
|
}
|
|
513
|
-
|
|
514
|
-
// src/runtime/vdom/vdom-render.ts
|
|
515
|
-
var scopeId;
|
|
516
545
|
var hostTagName;
|
|
517
546
|
var useNativeShadowDom = false;
|
|
518
547
|
var isSvgMode = false;
|
|
519
|
-
var createElm = (oldParentVNode, newParentVNode, childIndex
|
|
548
|
+
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
520
549
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
521
550
|
let i2 = 0;
|
|
522
551
|
let elm;
|
|
@@ -537,11 +566,6 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
537
566
|
{
|
|
538
567
|
updateElement(null, newVNode2, isSvgMode);
|
|
539
568
|
}
|
|
540
|
-
const rootNode = elm.getRootNode();
|
|
541
|
-
const isElementWithinShadowRoot = !rootNode.querySelector("body");
|
|
542
|
-
if (!isElementWithinShadowRoot && BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
543
|
-
elm.classList.add(elm["s-si"] = scopeId);
|
|
544
|
-
}
|
|
545
569
|
if (newVNode2.$children$) {
|
|
546
570
|
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
547
571
|
childNode = createElm(oldParentVNode, newVNode2, i2);
|
|
@@ -678,6 +702,9 @@ var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
|
678
702
|
if (!isInitialRender) {
|
|
679
703
|
return leftVNode.$key$ === rightVNode.$key$;
|
|
680
704
|
}
|
|
705
|
+
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
|
|
706
|
+
leftVNode.$key$ = rightVNode.$key$;
|
|
707
|
+
}
|
|
681
708
|
return true;
|
|
682
709
|
}
|
|
683
710
|
return false;
|
|
@@ -724,8 +751,9 @@ var nullifyVNodeRefs = (vNode) => {
|
|
|
724
751
|
}
|
|
725
752
|
};
|
|
726
753
|
var insertBefore = (parent, newNode, reference) => {
|
|
727
|
-
|
|
728
|
-
|
|
754
|
+
{
|
|
755
|
+
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
756
|
+
}
|
|
729
757
|
};
|
|
730
758
|
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
731
759
|
const hostElm = hostRef.$hostElement$;
|
|
@@ -750,9 +778,6 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
750
778
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
751
779
|
hostRef.$vnode$ = rootVnode;
|
|
752
780
|
rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
|
|
753
|
-
{
|
|
754
|
-
scopeId = hostElm["s-sc"];
|
|
755
|
-
}
|
|
756
781
|
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
757
782
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
758
783
|
};
|
|
@@ -760,7 +785,14 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
760
785
|
// src/runtime/update-component.ts
|
|
761
786
|
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
762
787
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
763
|
-
ancestorComponent["s-p"].push(
|
|
788
|
+
const index = ancestorComponent["s-p"].push(
|
|
789
|
+
new Promise(
|
|
790
|
+
(r) => hostRef.$onRenderResolve$ = () => {
|
|
791
|
+
ancestorComponent["s-p"].splice(index - 1, 1);
|
|
792
|
+
r();
|
|
793
|
+
}
|
|
794
|
+
)
|
|
795
|
+
);
|
|
764
796
|
}
|
|
765
797
|
};
|
|
766
798
|
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
@@ -789,12 +821,12 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
789
821
|
{
|
|
790
822
|
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
791
823
|
if (hostRef.$queuedListeners$) {
|
|
792
|
-
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
824
|
+
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event, elm));
|
|
793
825
|
hostRef.$queuedListeners$ = void 0;
|
|
794
826
|
}
|
|
795
827
|
}
|
|
796
828
|
{
|
|
797
|
-
maybePromise = safeCall(instance, "componentWillLoad");
|
|
829
|
+
maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
|
|
798
830
|
}
|
|
799
831
|
}
|
|
800
832
|
endSchedule();
|
|
@@ -863,7 +895,7 @@ var postUpdateComponent = (hostRef) => {
|
|
|
863
895
|
const instance = hostRef.$lazyInstance$ ;
|
|
864
896
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
865
897
|
{
|
|
866
|
-
safeCall(instance, "componentDidRender");
|
|
898
|
+
safeCall(instance, "componentDidRender", void 0, elm);
|
|
867
899
|
}
|
|
868
900
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
869
901
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
@@ -897,12 +929,12 @@ var appDidLoad = (who) => {
|
|
|
897
929
|
}
|
|
898
930
|
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
899
931
|
};
|
|
900
|
-
var safeCall = (instance, method, arg) => {
|
|
932
|
+
var safeCall = (instance, method, arg, elm) => {
|
|
901
933
|
if (instance && instance[method]) {
|
|
902
934
|
try {
|
|
903
935
|
return instance[method](arg);
|
|
904
936
|
} catch (e) {
|
|
905
|
-
consoleError(e);
|
|
937
|
+
consoleError(e, elm);
|
|
906
938
|
}
|
|
907
939
|
}
|
|
908
940
|
return void 0;
|
|
@@ -961,15 +993,68 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
961
993
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
962
994
|
members.map(([memberName, [memberFlags]]) => {
|
|
963
995
|
if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
996
|
+
const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
|
|
997
|
+
if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
|
|
998
|
+
if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
|
|
999
|
+
if (flags & 1 /* isElementConstructor */ || !origGetter) {
|
|
1000
|
+
Object.defineProperty(prototype, memberName, {
|
|
1001
|
+
get() {
|
|
1002
|
+
{
|
|
1003
|
+
if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
|
|
1004
|
+
return getValue(this, memberName);
|
|
1005
|
+
}
|
|
1006
|
+
const ref = getHostRef(this);
|
|
1007
|
+
const instance = ref ? ref.$lazyInstance$ : prototype;
|
|
1008
|
+
if (!instance) return;
|
|
1009
|
+
return instance[memberName];
|
|
1010
|
+
}
|
|
1011
|
+
},
|
|
1012
|
+
configurable: true,
|
|
1013
|
+
enumerable: true
|
|
1014
|
+
});
|
|
1015
|
+
}
|
|
964
1016
|
Object.defineProperty(prototype, memberName, {
|
|
965
|
-
get() {
|
|
966
|
-
return getValue(this, memberName);
|
|
967
|
-
},
|
|
968
1017
|
set(newValue) {
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
1018
|
+
const ref = getHostRef(this);
|
|
1019
|
+
if (origSetter) {
|
|
1020
|
+
const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
1021
|
+
if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
|
|
1022
|
+
newValue = ref.$instanceValues$.get(memberName);
|
|
1023
|
+
} else if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
1024
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
1025
|
+
}
|
|
1026
|
+
origSetter.apply(this, [parsePropertyValue(newValue, memberFlags)]);
|
|
1027
|
+
newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
1028
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
1029
|
+
return;
|
|
1030
|
+
}
|
|
1031
|
+
{
|
|
1032
|
+
if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
|
|
1033
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
1034
|
+
if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
|
|
1035
|
+
ref.$onReadyPromise$.then(() => {
|
|
1036
|
+
if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
|
|
1037
|
+
ref.$lazyInstance$[memberName] = newValue;
|
|
1038
|
+
}
|
|
1039
|
+
});
|
|
1040
|
+
}
|
|
1041
|
+
return;
|
|
1042
|
+
}
|
|
1043
|
+
const setterSetVal = () => {
|
|
1044
|
+
const currentValue = ref.$lazyInstance$[memberName];
|
|
1045
|
+
if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
1046
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
1047
|
+
}
|
|
1048
|
+
ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, memberFlags);
|
|
1049
|
+
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
|
|
1050
|
+
};
|
|
1051
|
+
if (ref.$lazyInstance$) {
|
|
1052
|
+
setterSetVal();
|
|
1053
|
+
} else {
|
|
1054
|
+
ref.$onReadyPromise$.then(() => setterSetVal());
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
973
1058
|
});
|
|
974
1059
|
}
|
|
975
1060
|
});
|
|
@@ -979,7 +1064,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
979
1064
|
plt.jmp(() => {
|
|
980
1065
|
var _a2;
|
|
981
1066
|
const propName = attrNameToPropName.get(attrName);
|
|
982
|
-
if (this.hasOwnProperty(propName)) {
|
|
1067
|
+
if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
|
|
983
1068
|
newValue = this[propName];
|
|
984
1069
|
delete this[propName];
|
|
985
1070
|
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
|
|
@@ -999,7 +1084,11 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
999
1084
|
}
|
|
1000
1085
|
return;
|
|
1001
1086
|
}
|
|
1002
|
-
|
|
1087
|
+
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
1088
|
+
newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
|
|
1089
|
+
if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
|
|
1090
|
+
this[propName] = newValue;
|
|
1091
|
+
}
|
|
1003
1092
|
});
|
|
1004
1093
|
};
|
|
1005
1094
|
Cstr.observedAttributes = Array.from(
|
|
@@ -1026,9 +1115,8 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1026
1115
|
let Cstr;
|
|
1027
1116
|
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
1028
1117
|
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
const CstrImport = loadModule(cmpMeta);
|
|
1118
|
+
{
|
|
1119
|
+
const CstrImport = loadModule(cmpMeta, hostRef);
|
|
1032
1120
|
if (CstrImport && "then" in CstrImport) {
|
|
1033
1121
|
const endLoad = uniqueTime();
|
|
1034
1122
|
Cstr = await CstrImport;
|
|
@@ -1053,7 +1141,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1053
1141
|
try {
|
|
1054
1142
|
new Cstr(hostRef);
|
|
1055
1143
|
} catch (e) {
|
|
1056
|
-
consoleError(e);
|
|
1144
|
+
consoleError(e, elm);
|
|
1057
1145
|
}
|
|
1058
1146
|
{
|
|
1059
1147
|
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
@@ -1062,10 +1150,6 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1062
1150
|
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
1063
1151
|
}
|
|
1064
1152
|
endNewInstance();
|
|
1065
|
-
} else {
|
|
1066
|
-
Cstr = elm.constructor;
|
|
1067
|
-
const cmpTag = elm.localName;
|
|
1068
|
-
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
|
|
1069
1153
|
}
|
|
1070
1154
|
if (Cstr && Cstr.style) {
|
|
1071
1155
|
let style;
|
|
@@ -1088,7 +1172,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1088
1172
|
schedule();
|
|
1089
1173
|
}
|
|
1090
1174
|
};
|
|
1091
|
-
var fireConnectedCallback = (instance) => {
|
|
1175
|
+
var fireConnectedCallback = (instance, elm) => {
|
|
1092
1176
|
};
|
|
1093
1177
|
|
|
1094
1178
|
// src/runtime/connected-callback.ts
|
|
@@ -1129,7 +1213,7 @@ var connectedCallback = (elm) => {
|
|
|
1129
1213
|
endConnected();
|
|
1130
1214
|
}
|
|
1131
1215
|
};
|
|
1132
|
-
var disconnectInstance = (instance) => {
|
|
1216
|
+
var disconnectInstance = (instance, elm) => {
|
|
1133
1217
|
};
|
|
1134
1218
|
var disconnectedCallback = async (elm) => {
|
|
1135
1219
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
@@ -1144,6 +1228,12 @@ var disconnectedCallback = async (elm) => {
|
|
|
1144
1228
|
hostRef.$onReadyPromise$.then(() => disconnectInstance());
|
|
1145
1229
|
}
|
|
1146
1230
|
}
|
|
1231
|
+
if (rootAppliedStyles.has(elm)) {
|
|
1232
|
+
rootAppliedStyles.delete(elm);
|
|
1233
|
+
}
|
|
1234
|
+
if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
|
|
1235
|
+
rootAppliedStyles.delete(elm.shadowRoot);
|
|
1236
|
+
}
|
|
1147
1237
|
};
|
|
1148
1238
|
|
|
1149
1239
|
// src/runtime/bootstrap-lazy.ts
|
|
@@ -1228,6 +1318,13 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1228
1318
|
}
|
|
1229
1319
|
disconnectedCallback() {
|
|
1230
1320
|
plt.jmp(() => disconnectedCallback(this));
|
|
1321
|
+
plt.raf(() => {
|
|
1322
|
+
var _a3;
|
|
1323
|
+
const hostRef = getHostRef(this);
|
|
1324
|
+
if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
|
|
1325
|
+
delete hostRef.$vnode$.$elm$;
|
|
1326
|
+
}
|
|
1327
|
+
});
|
|
1231
1328
|
}
|
|
1232
1329
|
componentOnReady() {
|
|
1233
1330
|
return getHostRef(this).$onReadyPromise$;
|
|
@@ -1291,7 +1388,7 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
1291
1388
|
}
|
|
1292
1389
|
}
|
|
1293
1390
|
} catch (e) {
|
|
1294
|
-
consoleError(e);
|
|
1391
|
+
consoleError(e, hostRef.$hostElement$);
|
|
1295
1392
|
}
|
|
1296
1393
|
};
|
|
1297
1394
|
var hostListenerOpts = (flags) => supportsListenerOptions ? {
|
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-fb9e84e2.js';
|
|
2
|
+
export { s as setNonce } from './index-fb9e84e2.js';
|
|
3
3
|
import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
4
4
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|