@everymatrix/general-preview-social-posts 1.53.0 → 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/general-preview-social-posts.cjs.entry.js +63 -21
- package/dist/cjs/general-preview-social-posts.cjs.js +2 -2
- package/dist/cjs/{index-7a7767d7.js → index-7a6ed959.js} +166 -71
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/general-preview-social-posts/general-preview-social-posts.js +90 -20
- package/dist/esm/general-preview-social-posts.entry.js +63 -21
- package/dist/esm/general-preview-social-posts.js +3 -3
- package/dist/esm/{index-25628404.js → index-5eb3d287.js} +166 -71
- package/dist/esm/loader.js +2 -2
- package/dist/general-preview-social-posts/general-preview-social-posts.esm.js +1 -1
- package/dist/general-preview-social-posts/p-bf1b4518.js +2 -0
- package/dist/general-preview-social-posts/{p-2d1b20fd.entry.js → p-f5fe9b93.entry.js} +1 -1
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/general-preview-social-posts/.stencil/packages/stencil/general-preview-social-posts/stencil.config.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/general-preview-social-posts/.stencil/packages/stencil/general-preview-social-posts/stencil.config.dev.d.ts +2 -0
- package/package.json +1 -1
- package/dist/general-preview-social-posts/p-ffbcefe1.js +0 -2
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/general-preview-social-posts/.stencil/packages/stencil/general-preview-social-posts/stencil.config.d.ts +0 -2
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/general-preview-social-posts/.stencil/packages/stencil/general-preview-social-posts/stencil.config.dev.d.ts +0 -2
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-7a6ed959.js');
|
|
6
6
|
|
|
7
7
|
const DEFAULT_LANGUAGE = 'en';
|
|
8
8
|
let TRANSLATIONS = {
|
|
@@ -114,6 +114,68 @@ const GeneralPreviewSocialPosts = class {
|
|
|
114
114
|
this.moreInfo = index.createEvent(this, "moreInfo", 7);
|
|
115
115
|
this.playNow = index.createEvent(this, "playNow", 7);
|
|
116
116
|
this.viewAll = index.createEvent(this, "viewAll", 7);
|
|
117
|
+
/**
|
|
118
|
+
* The userId
|
|
119
|
+
*/
|
|
120
|
+
this.userId = '';
|
|
121
|
+
/**
|
|
122
|
+
* The session
|
|
123
|
+
*/
|
|
124
|
+
this.session = '';
|
|
125
|
+
/**
|
|
126
|
+
* The Posts Title
|
|
127
|
+
*/
|
|
128
|
+
this.postsTitle = '';
|
|
129
|
+
/**
|
|
130
|
+
* The max cards displayed
|
|
131
|
+
*/
|
|
132
|
+
this.maxCards = '';
|
|
133
|
+
/**
|
|
134
|
+
* The language
|
|
135
|
+
*/
|
|
136
|
+
this.language = 'en';
|
|
137
|
+
/**
|
|
138
|
+
* The datasource
|
|
139
|
+
*/
|
|
140
|
+
this.datasource = '';
|
|
141
|
+
/**
|
|
142
|
+
* The NorWAy endpoint
|
|
143
|
+
*/
|
|
144
|
+
this.endpoint = '';
|
|
145
|
+
/**
|
|
146
|
+
* The NorWAy endpoint
|
|
147
|
+
*/
|
|
148
|
+
this.cmsEndpoint = '';
|
|
149
|
+
/**
|
|
150
|
+
* The userRoles
|
|
151
|
+
*/
|
|
152
|
+
this.userRoles = '';
|
|
153
|
+
/**
|
|
154
|
+
* The translationurl
|
|
155
|
+
*/
|
|
156
|
+
this.translationUrl = '';
|
|
157
|
+
/**
|
|
158
|
+
* Client custom styling via string
|
|
159
|
+
*/
|
|
160
|
+
this.clientStyling = '';
|
|
161
|
+
/**
|
|
162
|
+
* Client custom styling via url content
|
|
163
|
+
*/
|
|
164
|
+
this.clientStylingUrl = '';
|
|
165
|
+
/**
|
|
166
|
+
* CMS Endpoint stage
|
|
167
|
+
*/
|
|
168
|
+
this.cmsEnv = 'stage';
|
|
169
|
+
/**
|
|
170
|
+
* The page parameter for the cms call
|
|
171
|
+
*/
|
|
172
|
+
this.pageName = 'casino';
|
|
173
|
+
this.posts = []; // State to store fetched posts
|
|
174
|
+
this.stylingAppends = false;
|
|
175
|
+
this.isLoading = false;
|
|
176
|
+
this.isLoggedIn = false;
|
|
177
|
+
this.dataImages = []; // State to store fetched images
|
|
178
|
+
this.gameIds = ''; // State to store fetched images
|
|
117
179
|
this.platform = getDevicePlatform();
|
|
118
180
|
this.setClientStyling = () => {
|
|
119
181
|
let sheet = document.createElement('style');
|
|
@@ -133,26 +195,6 @@ const GeneralPreviewSocialPosts = class {
|
|
|
133
195
|
console.log('error ', err);
|
|
134
196
|
});
|
|
135
197
|
};
|
|
136
|
-
this.userId = '';
|
|
137
|
-
this.session = '';
|
|
138
|
-
this.postsTitle = '';
|
|
139
|
-
this.maxCards = '';
|
|
140
|
-
this.language = 'en';
|
|
141
|
-
this.datasource = '';
|
|
142
|
-
this.endpoint = '';
|
|
143
|
-
this.cmsEndpoint = '';
|
|
144
|
-
this.userRoles = '';
|
|
145
|
-
this.translationUrl = '';
|
|
146
|
-
this.clientStyling = '';
|
|
147
|
-
this.clientStylingUrl = '';
|
|
148
|
-
this.cmsEnv = 'stage';
|
|
149
|
-
this.pageName = 'casino';
|
|
150
|
-
this.posts = [];
|
|
151
|
-
this.stylingAppends = false;
|
|
152
|
-
this.isLoading = false;
|
|
153
|
-
this.isLoggedIn = false;
|
|
154
|
-
this.dataImages = [];
|
|
155
|
-
this.gameIds = '';
|
|
156
198
|
}
|
|
157
199
|
handleNewTranslations() {
|
|
158
200
|
this.isLoading = true;
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-7a6ed959.js');
|
|
6
6
|
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
7
|
|
|
8
8
|
/*
|
|
9
|
-
Stencil Client Patch Browser v4.
|
|
9
|
+
Stencil Client Patch Browser v4.25.1 | MIT Licensed | https://stenciljs.com
|
|
10
10
|
*/
|
|
11
11
|
var patchBrowser = () => {
|
|
12
12
|
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('general-preview-social-posts.cjs.js', document.baseURI).href));
|
|
@@ -21,19 +21,23 @@ function _interopNamespace(e) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const NAMESPACE = 'general-preview-social-posts';
|
|
24
|
-
const BUILD = /* general-preview-social-posts */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, 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: false, propMutable: false, 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: false, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: true };
|
|
24
|
+
const BUILD = /* general-preview-social-posts */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, 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: false, propMutable: false, 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: false, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: false, vdomText: true, vdomXlink: false, watchCallback: true };
|
|
25
25
|
|
|
26
26
|
/*
|
|
27
|
-
Stencil Client Platform v4.
|
|
27
|
+
Stencil Client Platform v4.25.1 | MIT Licensed | https://stenciljs.com
|
|
28
28
|
*/
|
|
29
29
|
var __defProp = Object.defineProperty;
|
|
30
30
|
var __export = (target, all) => {
|
|
31
31
|
for (var name in all)
|
|
32
32
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
33
33
|
};
|
|
34
|
+
|
|
35
|
+
// src/client/client-host-ref.ts
|
|
34
36
|
var hostRefs = /* @__PURE__ */ new WeakMap();
|
|
35
37
|
var getHostRef = (ref) => hostRefs.get(ref);
|
|
36
|
-
var registerInstance = (lazyInstance, hostRef) =>
|
|
38
|
+
var registerInstance = (lazyInstance, hostRef) => {
|
|
39
|
+
hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
|
|
40
|
+
};
|
|
37
41
|
var registerHost = (hostElement, cmpMeta) => {
|
|
38
42
|
const hostRef = {
|
|
39
43
|
$flags$: 0,
|
|
@@ -46,7 +50,8 @@ var registerHost = (hostElement, cmpMeta) => {
|
|
|
46
50
|
hostElement["s-p"] = [];
|
|
47
51
|
hostElement["s-rc"] = [];
|
|
48
52
|
}
|
|
49
|
-
|
|
53
|
+
const ref = hostRefs.set(hostElement, hostRef);
|
|
54
|
+
return ref;
|
|
50
55
|
};
|
|
51
56
|
var isMemberInElement = (elm, memberName) => memberName in elm;
|
|
52
57
|
var consoleError = (e, el) => (0, console.error)(e, el);
|
|
@@ -83,16 +88,22 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
83
88
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
84
89
|
/* webpackMode: "lazy" */
|
|
85
90
|
`./${bundleId}.entry.js${""}`
|
|
86
|
-
)); }).then(
|
|
87
|
-
{
|
|
88
|
-
|
|
91
|
+
)); }).then(
|
|
92
|
+
(importedModule) => {
|
|
93
|
+
{
|
|
94
|
+
cmpModules.set(bundleId, importedModule);
|
|
95
|
+
}
|
|
96
|
+
return importedModule[exportName];
|
|
97
|
+
},
|
|
98
|
+
(e) => {
|
|
99
|
+
consoleError(e, hostRef.$hostElement$);
|
|
89
100
|
}
|
|
90
|
-
|
|
91
|
-
}, consoleError);
|
|
101
|
+
);
|
|
92
102
|
};
|
|
93
103
|
|
|
94
104
|
// src/client/client-style.ts
|
|
95
105
|
var styles = /* @__PURE__ */ new Map();
|
|
106
|
+
var HYDRATED_STYLE_ID = "sty-id";
|
|
96
107
|
var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
|
|
97
108
|
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
|
98
109
|
var win = typeof window !== "undefined" ? window : {};
|
|
@@ -150,12 +161,6 @@ var flush = () => {
|
|
|
150
161
|
};
|
|
151
162
|
var nextTick = (cb) => promiseResolve().then(cb);
|
|
152
163
|
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
|
|
153
|
-
|
|
154
|
-
// src/utils/constants.ts
|
|
155
|
-
var EMPTY_OBJ = {};
|
|
156
|
-
|
|
157
|
-
// src/utils/helpers.ts
|
|
158
|
-
var isDef = (v) => v != null;
|
|
159
164
|
var isComplexType = (o) => {
|
|
160
165
|
o = typeof o;
|
|
161
166
|
return o === "object" || o === "function";
|
|
@@ -343,7 +348,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
343
348
|
}
|
|
344
349
|
if (!appliedStyles.has(scopeId2)) {
|
|
345
350
|
{
|
|
346
|
-
styleElm = doc.createElement("style");
|
|
351
|
+
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
|
|
347
352
|
styleElm.innerHTML = style;
|
|
348
353
|
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
|
|
349
354
|
if (nonce != null) {
|
|
@@ -353,7 +358,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
353
358
|
if (styleContainerNode.nodeName === "HEAD") {
|
|
354
359
|
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
355
360
|
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
356
|
-
styleContainerNode.insertBefore(
|
|
361
|
+
styleContainerNode.insertBefore(
|
|
362
|
+
styleElm,
|
|
363
|
+
(referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
|
|
364
|
+
);
|
|
357
365
|
} else if ("host" in styleContainerNode) {
|
|
358
366
|
if (supportsConstructableStylesheets) {
|
|
359
367
|
const stylesheet = new CSSStyleSheet();
|
|
@@ -403,16 +411,18 @@ var attachStyles = (hostRef) => {
|
|
|
403
411
|
endAttachStyles();
|
|
404
412
|
};
|
|
405
413
|
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
406
|
-
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
414
|
+
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
|
|
407
415
|
if (oldValue !== newValue) {
|
|
408
416
|
let isProp = isMemberInElement(elm, memberName);
|
|
409
417
|
let ln = memberName.toLowerCase();
|
|
410
418
|
if (memberName === "class") {
|
|
411
419
|
const classList = elm.classList;
|
|
412
420
|
const oldClasses = parseClassList(oldValue);
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
421
|
+
let newClasses = parseClassList(newValue);
|
|
422
|
+
{
|
|
423
|
+
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
424
|
+
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
425
|
+
}
|
|
416
426
|
} else if (memberName === "ref") {
|
|
417
427
|
if (newValue) {
|
|
418
428
|
newValue(elm);
|
|
@@ -450,7 +460,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
450
460
|
elm.setAttribute(memberName, n);
|
|
451
461
|
}
|
|
452
462
|
}
|
|
453
|
-
} else {
|
|
463
|
+
} else if (elm[memberName] !== newValue) {
|
|
454
464
|
elm[memberName] = newValue;
|
|
455
465
|
}
|
|
456
466
|
} catch (e) {
|
|
@@ -472,24 +482,44 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
472
482
|
}
|
|
473
483
|
};
|
|
474
484
|
var parseClassListRegex = /\s/;
|
|
475
|
-
var parseClassList = (value) =>
|
|
485
|
+
var parseClassList = (value) => {
|
|
486
|
+
if (typeof value === "object" && value && "baseVal" in value) {
|
|
487
|
+
value = value.baseVal;
|
|
488
|
+
}
|
|
489
|
+
if (!value || typeof value !== "string") {
|
|
490
|
+
return [];
|
|
491
|
+
}
|
|
492
|
+
return value.split(parseClassListRegex);
|
|
493
|
+
};
|
|
476
494
|
var CAPTURE_EVENT_SUFFIX = "Capture";
|
|
477
495
|
var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
|
|
478
496
|
|
|
479
497
|
// src/runtime/vdom/update-element.ts
|
|
480
|
-
var updateElement = (oldVnode, newVnode, isSvgMode2) => {
|
|
498
|
+
var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
|
|
481
499
|
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
482
|
-
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ ||
|
|
483
|
-
const newVnodeAttrs = newVnode.$attrs$ ||
|
|
500
|
+
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
|
|
501
|
+
const newVnodeAttrs = newVnode.$attrs$ || {};
|
|
484
502
|
{
|
|
485
503
|
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
486
504
|
if (!(memberName in newVnodeAttrs)) {
|
|
487
|
-
setAccessor(
|
|
505
|
+
setAccessor(
|
|
506
|
+
elm,
|
|
507
|
+
memberName,
|
|
508
|
+
oldVnodeAttrs[memberName],
|
|
509
|
+
void 0,
|
|
510
|
+
isSvgMode2,
|
|
511
|
+
newVnode.$flags$);
|
|
488
512
|
}
|
|
489
513
|
}
|
|
490
514
|
}
|
|
491
515
|
for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
|
|
492
|
-
setAccessor(
|
|
516
|
+
setAccessor(
|
|
517
|
+
elm,
|
|
518
|
+
memberName,
|
|
519
|
+
oldVnodeAttrs[memberName],
|
|
520
|
+
newVnodeAttrs[memberName],
|
|
521
|
+
isSvgMode2,
|
|
522
|
+
newVnode.$flags$);
|
|
493
523
|
}
|
|
494
524
|
};
|
|
495
525
|
function sortedAttrNames(attrNames) {
|
|
@@ -501,13 +531,10 @@ function sortedAttrNames(attrNames) {
|
|
|
501
531
|
attrNames
|
|
502
532
|
);
|
|
503
533
|
}
|
|
504
|
-
|
|
505
|
-
// src/runtime/vdom/vdom-render.ts
|
|
506
|
-
var scopeId;
|
|
507
534
|
var hostTagName;
|
|
508
535
|
var useNativeShadowDom = false;
|
|
509
536
|
var isSvgMode = false;
|
|
510
|
-
var createElm = (oldParentVNode, newParentVNode, childIndex
|
|
537
|
+
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
511
538
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
512
539
|
let i2 = 0;
|
|
513
540
|
let elm;
|
|
@@ -521,11 +548,6 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
521
548
|
{
|
|
522
549
|
updateElement(null, newVNode2, isSvgMode);
|
|
523
550
|
}
|
|
524
|
-
const rootNode = elm.getRootNode();
|
|
525
|
-
const isElementWithinShadowRoot = !rootNode.querySelector("body");
|
|
526
|
-
if (!isElementWithinShadowRoot && BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
527
|
-
elm.classList.add(elm["s-si"] = scopeId);
|
|
528
|
-
}
|
|
529
551
|
if (newVNode2.$children$) {
|
|
530
552
|
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
531
553
|
childNode = createElm(oldParentVNode, newVNode2, i2);
|
|
@@ -630,6 +652,9 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
630
652
|
};
|
|
631
653
|
var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
632
654
|
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
655
|
+
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
|
|
656
|
+
leftVNode.$key$ = rightVNode.$key$;
|
|
657
|
+
}
|
|
633
658
|
return true;
|
|
634
659
|
}
|
|
635
660
|
return false;
|
|
@@ -669,8 +694,9 @@ var nullifyVNodeRefs = (vNode) => {
|
|
|
669
694
|
}
|
|
670
695
|
};
|
|
671
696
|
var insertBefore = (parent, newNode, reference) => {
|
|
672
|
-
|
|
673
|
-
|
|
697
|
+
{
|
|
698
|
+
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
699
|
+
}
|
|
674
700
|
};
|
|
675
701
|
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
676
702
|
const hostElm = hostRef.$hostElement$;
|
|
@@ -695,9 +721,6 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
695
721
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
696
722
|
hostRef.$vnode$ = rootVnode;
|
|
697
723
|
rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
|
|
698
|
-
{
|
|
699
|
-
scopeId = hostElm["s-sc"];
|
|
700
|
-
}
|
|
701
724
|
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
702
725
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
703
726
|
};
|
|
@@ -705,7 +728,14 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
705
728
|
// src/runtime/update-component.ts
|
|
706
729
|
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
707
730
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
708
|
-
ancestorComponent["s-p"].push(
|
|
731
|
+
const index = ancestorComponent["s-p"].push(
|
|
732
|
+
new Promise(
|
|
733
|
+
(r) => hostRef.$onRenderResolve$ = () => {
|
|
734
|
+
ancestorComponent["s-p"].splice(index - 1, 1);
|
|
735
|
+
r();
|
|
736
|
+
}
|
|
737
|
+
)
|
|
738
|
+
);
|
|
709
739
|
}
|
|
710
740
|
};
|
|
711
741
|
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
@@ -732,7 +762,7 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
732
762
|
let maybePromise;
|
|
733
763
|
if (isInitialLoad) {
|
|
734
764
|
{
|
|
735
|
-
maybePromise = safeCall(instance, "componentWillLoad");
|
|
765
|
+
maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
|
|
736
766
|
}
|
|
737
767
|
}
|
|
738
768
|
endSchedule();
|
|
@@ -801,7 +831,7 @@ var postUpdateComponent = (hostRef) => {
|
|
|
801
831
|
const instance = hostRef.$lazyInstance$ ;
|
|
802
832
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
803
833
|
{
|
|
804
|
-
safeCall(instance, "componentDidRender");
|
|
834
|
+
safeCall(instance, "componentDidRender", void 0, elm);
|
|
805
835
|
}
|
|
806
836
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
807
837
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
@@ -809,7 +839,7 @@ var postUpdateComponent = (hostRef) => {
|
|
|
809
839
|
addHydratedFlag(elm);
|
|
810
840
|
}
|
|
811
841
|
{
|
|
812
|
-
safeCall(instance, "componentDidLoad");
|
|
842
|
+
safeCall(instance, "componentDidLoad", void 0, elm);
|
|
813
843
|
}
|
|
814
844
|
endPostUpdate();
|
|
815
845
|
{
|
|
@@ -838,12 +868,12 @@ var appDidLoad = (who) => {
|
|
|
838
868
|
}
|
|
839
869
|
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
840
870
|
};
|
|
841
|
-
var safeCall = (instance, method, arg) => {
|
|
871
|
+
var safeCall = (instance, method, arg, elm) => {
|
|
842
872
|
if (instance && instance[method]) {
|
|
843
873
|
try {
|
|
844
874
|
return instance[method](arg);
|
|
845
875
|
} catch (e) {
|
|
846
|
-
consoleError(e);
|
|
876
|
+
consoleError(e, elm);
|
|
847
877
|
}
|
|
848
878
|
}
|
|
849
879
|
return void 0;
|
|
@@ -902,15 +932,68 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
902
932
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
903
933
|
members.map(([memberName, [memberFlags]]) => {
|
|
904
934
|
if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
935
|
+
const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
|
|
936
|
+
if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
|
|
937
|
+
if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
|
|
938
|
+
if (flags & 1 /* isElementConstructor */ || !origGetter) {
|
|
939
|
+
Object.defineProperty(prototype, memberName, {
|
|
940
|
+
get() {
|
|
941
|
+
{
|
|
942
|
+
if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
|
|
943
|
+
return getValue(this, memberName);
|
|
944
|
+
}
|
|
945
|
+
const ref = getHostRef(this);
|
|
946
|
+
const instance = ref ? ref.$lazyInstance$ : prototype;
|
|
947
|
+
if (!instance) return;
|
|
948
|
+
return instance[memberName];
|
|
949
|
+
}
|
|
950
|
+
},
|
|
951
|
+
configurable: true,
|
|
952
|
+
enumerable: true
|
|
953
|
+
});
|
|
954
|
+
}
|
|
905
955
|
Object.defineProperty(prototype, memberName, {
|
|
906
|
-
get() {
|
|
907
|
-
return getValue(this, memberName);
|
|
908
|
-
},
|
|
909
956
|
set(newValue) {
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
957
|
+
const ref = getHostRef(this);
|
|
958
|
+
if (origSetter) {
|
|
959
|
+
const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
960
|
+
if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
|
|
961
|
+
newValue = ref.$instanceValues$.get(memberName);
|
|
962
|
+
} else if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
963
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
964
|
+
}
|
|
965
|
+
origSetter.apply(this, [parsePropertyValue(newValue, memberFlags)]);
|
|
966
|
+
newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
967
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
968
|
+
return;
|
|
969
|
+
}
|
|
970
|
+
{
|
|
971
|
+
if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
|
|
972
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
973
|
+
if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
|
|
974
|
+
ref.$onReadyPromise$.then(() => {
|
|
975
|
+
if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
|
|
976
|
+
ref.$lazyInstance$[memberName] = newValue;
|
|
977
|
+
}
|
|
978
|
+
});
|
|
979
|
+
}
|
|
980
|
+
return;
|
|
981
|
+
}
|
|
982
|
+
const setterSetVal = () => {
|
|
983
|
+
const currentValue = ref.$lazyInstance$[memberName];
|
|
984
|
+
if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
985
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
986
|
+
}
|
|
987
|
+
ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, memberFlags);
|
|
988
|
+
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
|
|
989
|
+
};
|
|
990
|
+
if (ref.$lazyInstance$) {
|
|
991
|
+
setterSetVal();
|
|
992
|
+
} else {
|
|
993
|
+
ref.$onReadyPromise$.then(() => setterSetVal());
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
}
|
|
914
997
|
});
|
|
915
998
|
}
|
|
916
999
|
});
|
|
@@ -920,7 +1003,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
920
1003
|
plt.jmp(() => {
|
|
921
1004
|
var _a2;
|
|
922
1005
|
const propName = attrNameToPropName.get(attrName);
|
|
923
|
-
if (this.hasOwnProperty(propName)) {
|
|
1006
|
+
if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
|
|
924
1007
|
newValue = this[propName];
|
|
925
1008
|
delete this[propName];
|
|
926
1009
|
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
|
|
@@ -940,7 +1023,11 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
940
1023
|
}
|
|
941
1024
|
return;
|
|
942
1025
|
}
|
|
943
|
-
|
|
1026
|
+
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
1027
|
+
newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
|
|
1028
|
+
if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
|
|
1029
|
+
this[propName] = newValue;
|
|
1030
|
+
}
|
|
944
1031
|
});
|
|
945
1032
|
};
|
|
946
1033
|
Cstr.observedAttributes = Array.from(
|
|
@@ -967,9 +1054,8 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
967
1054
|
let Cstr;
|
|
968
1055
|
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
969
1056
|
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
const CstrImport = loadModule(cmpMeta);
|
|
1057
|
+
{
|
|
1058
|
+
const CstrImport = loadModule(cmpMeta, hostRef);
|
|
973
1059
|
if (CstrImport && "then" in CstrImport) {
|
|
974
1060
|
const endLoad = uniqueTime();
|
|
975
1061
|
Cstr = await CstrImport;
|
|
@@ -994,7 +1080,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
994
1080
|
try {
|
|
995
1081
|
new Cstr(hostRef);
|
|
996
1082
|
} catch (e) {
|
|
997
|
-
consoleError(e);
|
|
1083
|
+
consoleError(e, elm);
|
|
998
1084
|
}
|
|
999
1085
|
{
|
|
1000
1086
|
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
@@ -1003,11 +1089,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1003
1089
|
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
1004
1090
|
}
|
|
1005
1091
|
endNewInstance();
|
|
1006
|
-
fireConnectedCallback(hostRef.$lazyInstance
|
|
1007
|
-
} else {
|
|
1008
|
-
Cstr = elm.constructor;
|
|
1009
|
-
const cmpTag = elm.localName;
|
|
1010
|
-
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
|
|
1092
|
+
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
1011
1093
|
}
|
|
1012
1094
|
if (Cstr && Cstr.style) {
|
|
1013
1095
|
let style;
|
|
@@ -1030,9 +1112,9 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1030
1112
|
schedule();
|
|
1031
1113
|
}
|
|
1032
1114
|
};
|
|
1033
|
-
var fireConnectedCallback = (instance) => {
|
|
1115
|
+
var fireConnectedCallback = (instance, elm) => {
|
|
1034
1116
|
{
|
|
1035
|
-
safeCall(instance, "connectedCallback");
|
|
1117
|
+
safeCall(instance, "connectedCallback", void 0, elm);
|
|
1036
1118
|
}
|
|
1037
1119
|
};
|
|
1038
1120
|
|
|
@@ -1067,15 +1149,15 @@ var connectedCallback = (elm) => {
|
|
|
1067
1149
|
}
|
|
1068
1150
|
} else {
|
|
1069
1151
|
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
1070
|
-
fireConnectedCallback(hostRef.$lazyInstance
|
|
1152
|
+
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
1071
1153
|
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
1072
|
-
hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance
|
|
1154
|
+
hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
|
|
1073
1155
|
}
|
|
1074
1156
|
}
|
|
1075
1157
|
endConnected();
|
|
1076
1158
|
}
|
|
1077
1159
|
};
|
|
1078
|
-
var disconnectInstance = (instance) => {
|
|
1160
|
+
var disconnectInstance = (instance, elm) => {
|
|
1079
1161
|
};
|
|
1080
1162
|
var disconnectedCallback = async (elm) => {
|
|
1081
1163
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
@@ -1084,6 +1166,12 @@ var disconnectedCallback = async (elm) => {
|
|
|
1084
1166
|
hostRef.$onReadyPromise$.then(() => disconnectInstance());
|
|
1085
1167
|
}
|
|
1086
1168
|
}
|
|
1169
|
+
if (rootAppliedStyles.has(elm)) {
|
|
1170
|
+
rootAppliedStyles.delete(elm);
|
|
1171
|
+
}
|
|
1172
|
+
if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
|
|
1173
|
+
rootAppliedStyles.delete(elm.shadowRoot);
|
|
1174
|
+
}
|
|
1087
1175
|
};
|
|
1088
1176
|
|
|
1089
1177
|
// src/runtime/bootstrap-lazy.ts
|
|
@@ -1164,6 +1252,13 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1164
1252
|
}
|
|
1165
1253
|
disconnectedCallback() {
|
|
1166
1254
|
plt.jmp(() => disconnectedCallback(this));
|
|
1255
|
+
plt.raf(() => {
|
|
1256
|
+
var _a3;
|
|
1257
|
+
const hostRef = getHostRef(this);
|
|
1258
|
+
if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
|
|
1259
|
+
delete hostRef.$vnode$.$elm$;
|
|
1260
|
+
}
|
|
1261
|
+
});
|
|
1167
1262
|
}
|
|
1168
1263
|
componentOnReady() {
|
|
1169
1264
|
return getHostRef(this).$onReadyPromise$;
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-7a6ed959.js');
|
|
6
6
|
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
7
|
|
|
8
8
|
const defineCustomElements = async (win, options) => {
|