@everymatrix/general-stories 1.54.12 → 1.55.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/{general-stories-a5262e54.js → general-stories-caa7546c.js} +13 -27
- package/dist/cjs/general-stories.cjs.entry.js +2 -2
- package/dist/cjs/general-stories.cjs.js +2 -2
- package/dist/cjs/{index-5e8dba8b.js → index-bfe9e0e7.js} +69 -172
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/general-stories/general-stories.js +12 -40
- package/dist/esm/{general-stories-9cdd7600.js → general-stories-2b03e517.js} +13 -27
- package/dist/esm/general-stories.entry.js +2 -2
- package/dist/esm/general-stories.js +3 -3
- package/dist/esm/{index-3d519791.js → index-eb27780b.js} +69 -172
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +2 -2
- package/dist/general-stories/general-stories.esm.js +1 -1
- package/dist/general-stories/index.esm.js +1 -1
- package/dist/general-stories/p-33a823ba.js +2 -0
- package/dist/general-stories/p-7421aeac.entry.js +1 -0
- package/dist/general-stories/p-8492d966.js +1 -0
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/general-stories/.stencil/packages/stencil/general-stories/stencil.config.d.ts +2 -0
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/general-stories/.stencil/packages/stencil/general-stories/stencil.config.dev.d.ts +2 -0
- package/package.json +1 -1
- package/dist/general-stories/p-4cdc6e50.entry.js +0 -1
- package/dist/general-stories/p-9be4d8b5.js +0 -2
- package/dist/general-stories/p-e1e1a6fa.js +0 -1
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/general-stories/.stencil/packages/stencil/general-stories/stencil.config.d.ts +0 -2
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/general-stories/.stencil/packages/stencil/general-stories/stencil.config.dev.d.ts +0 -2
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/general-stories/.stencil/tools/plugins/index.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/general-stories/.stencil/tools/plugins/stencil-clean-deps-plugin.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/general-stories/.stencil/tools/plugins/vite-chunk-plugin.d.ts +0 -0
- /package/dist/types/Users/{adrian.pripon/Documents/Work → maria.bumbar/Desktop}/widgets-monorepo/packages/stencil/general-stories/.stencil/tools/plugins/vite-clean-deps-plugin.d.ts +0 -0
|
@@ -3,35 +3,9 @@ import { getDevicePlatform } from "../../utils/utils";
|
|
|
3
3
|
import { translate, getTranslations } from "../../utils/locale.utils";
|
|
4
4
|
export class GeneralStories {
|
|
5
5
|
constructor() {
|
|
6
|
-
/**
|
|
7
|
-
* Language of the widget
|
|
8
|
-
*/
|
|
9
|
-
this.language = 'en';
|
|
10
|
-
/**
|
|
11
|
-
* CMS Endpoint stage
|
|
12
|
-
*/
|
|
13
|
-
this.cmsEnv = 'stage';
|
|
14
|
-
/**
|
|
15
|
-
* Client custom styling via string
|
|
16
|
-
*/
|
|
17
|
-
this.clientStyling = '';
|
|
18
|
-
/**
|
|
19
|
-
* Client custom styling via url
|
|
20
|
-
*/
|
|
21
|
-
this.clientStylingUrl = '';
|
|
22
|
-
/**
|
|
23
|
-
* Translations via URL
|
|
24
|
-
*/
|
|
25
|
-
this.translationUrl = '';
|
|
26
|
-
/**
|
|
27
|
-
* Duration of progress bar
|
|
28
|
-
*/
|
|
29
|
-
this.progressBarDuration = 10;
|
|
30
6
|
this.hasErrors = false;
|
|
31
7
|
this.isLoading = true;
|
|
32
8
|
this.isSwipe = false;
|
|
33
|
-
this.currentStoryId = null;
|
|
34
|
-
this.progress = 0;
|
|
35
9
|
this.getStories = () => {
|
|
36
10
|
let url = new URL(`${this.cmsEndpoint}/${this.language}/stories`);
|
|
37
11
|
url.searchParams.append('env', this.cmsEnv);
|
|
@@ -127,6 +101,18 @@ export class GeneralStories {
|
|
|
127
101
|
const open = () => this.openFullScreenStory(props.id);
|
|
128
102
|
return (h("div", { class: `StoryThumbnailContainer ${props.viewed ? 'Viewed' : 'Highlighted'}`, onTouchStart: open }, h("img", { class: `StoryThumbnailImage ${props.viewed ? 'Viewed' : 'Highlighted'}`, src: props.icon, alt: "story-icon" })));
|
|
129
103
|
};
|
|
104
|
+
this.cmsEndpoint = undefined;
|
|
105
|
+
this.language = 'en';
|
|
106
|
+
this.cmsEnv = 'stage';
|
|
107
|
+
this.clientStyling = '';
|
|
108
|
+
this.clientStylingUrl = '';
|
|
109
|
+
this.translationUrl = '';
|
|
110
|
+
this.progressBarDuration = 10;
|
|
111
|
+
this.currentStory = undefined;
|
|
112
|
+
this.currentStoryId = null;
|
|
113
|
+
this.progress = 0;
|
|
114
|
+
this.touchPosStart = undefined;
|
|
115
|
+
this.touchPosEnd = undefined;
|
|
130
116
|
}
|
|
131
117
|
handleStylingUpdate() {
|
|
132
118
|
if (this.clientStyling)
|
|
@@ -232,8 +218,6 @@ export class GeneralStories {
|
|
|
232
218
|
"tags": [],
|
|
233
219
|
"text": "Endpoint URL for the source of data"
|
|
234
220
|
},
|
|
235
|
-
"getter": false,
|
|
236
|
-
"setter": false,
|
|
237
221
|
"attribute": "cms-endpoint",
|
|
238
222
|
"reflect": true
|
|
239
223
|
},
|
|
@@ -251,8 +235,6 @@ export class GeneralStories {
|
|
|
251
235
|
"tags": [],
|
|
252
236
|
"text": "Language of the widget"
|
|
253
237
|
},
|
|
254
|
-
"getter": false,
|
|
255
|
-
"setter": false,
|
|
256
238
|
"attribute": "language",
|
|
257
239
|
"reflect": true,
|
|
258
240
|
"defaultValue": "'en'"
|
|
@@ -271,8 +253,6 @@ export class GeneralStories {
|
|
|
271
253
|
"tags": [],
|
|
272
254
|
"text": "CMS Endpoint stage"
|
|
273
255
|
},
|
|
274
|
-
"getter": false,
|
|
275
|
-
"setter": false,
|
|
276
256
|
"attribute": "cms-env",
|
|
277
257
|
"reflect": true,
|
|
278
258
|
"defaultValue": "'stage'"
|
|
@@ -291,8 +271,6 @@ export class GeneralStories {
|
|
|
291
271
|
"tags": [],
|
|
292
272
|
"text": "Client custom styling via string"
|
|
293
273
|
},
|
|
294
|
-
"getter": false,
|
|
295
|
-
"setter": false,
|
|
296
274
|
"attribute": "client-styling",
|
|
297
275
|
"reflect": true,
|
|
298
276
|
"defaultValue": "''"
|
|
@@ -311,8 +289,6 @@ export class GeneralStories {
|
|
|
311
289
|
"tags": [],
|
|
312
290
|
"text": "Client custom styling via url"
|
|
313
291
|
},
|
|
314
|
-
"getter": false,
|
|
315
|
-
"setter": false,
|
|
316
292
|
"attribute": "client-styling-url",
|
|
317
293
|
"reflect": true,
|
|
318
294
|
"defaultValue": "''"
|
|
@@ -331,8 +307,6 @@ export class GeneralStories {
|
|
|
331
307
|
"tags": [],
|
|
332
308
|
"text": "Translations via URL"
|
|
333
309
|
},
|
|
334
|
-
"getter": false,
|
|
335
|
-
"setter": false,
|
|
336
310
|
"attribute": "translation-url",
|
|
337
311
|
"reflect": true,
|
|
338
312
|
"defaultValue": "''"
|
|
@@ -351,8 +325,6 @@ export class GeneralStories {
|
|
|
351
325
|
"tags": [],
|
|
352
326
|
"text": "Duration of progress bar"
|
|
353
327
|
},
|
|
354
|
-
"getter": false,
|
|
355
|
-
"setter": false,
|
|
356
328
|
"attribute": "progress-bar-duration",
|
|
357
329
|
"reflect": true,
|
|
358
330
|
"defaultValue": "10"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-
|
|
1
|
+
import { r as registerInstance, h } from './index-eb27780b.js';
|
|
2
2
|
|
|
3
3
|
const getDevice = () => {
|
|
4
4
|
let userAgent = window.navigator.userAgent;
|
|
@@ -89,35 +89,9 @@ const GeneralStoriesStyle0 = generalStoriesCss;
|
|
|
89
89
|
const GeneralStories = class {
|
|
90
90
|
constructor(hostRef) {
|
|
91
91
|
registerInstance(this, hostRef);
|
|
92
|
-
/**
|
|
93
|
-
* Language of the widget
|
|
94
|
-
*/
|
|
95
|
-
this.language = 'en';
|
|
96
|
-
/**
|
|
97
|
-
* CMS Endpoint stage
|
|
98
|
-
*/
|
|
99
|
-
this.cmsEnv = 'stage';
|
|
100
|
-
/**
|
|
101
|
-
* Client custom styling via string
|
|
102
|
-
*/
|
|
103
|
-
this.clientStyling = '';
|
|
104
|
-
/**
|
|
105
|
-
* Client custom styling via url
|
|
106
|
-
*/
|
|
107
|
-
this.clientStylingUrl = '';
|
|
108
|
-
/**
|
|
109
|
-
* Translations via URL
|
|
110
|
-
*/
|
|
111
|
-
this.translationUrl = '';
|
|
112
|
-
/**
|
|
113
|
-
* Duration of progress bar
|
|
114
|
-
*/
|
|
115
|
-
this.progressBarDuration = 10;
|
|
116
92
|
this.hasErrors = false;
|
|
117
93
|
this.isLoading = true;
|
|
118
94
|
this.isSwipe = false;
|
|
119
|
-
this.currentStoryId = null;
|
|
120
|
-
this.progress = 0;
|
|
121
95
|
this.getStories = () => {
|
|
122
96
|
let url = new URL(`${this.cmsEndpoint}/${this.language}/stories`);
|
|
123
97
|
url.searchParams.append('env', this.cmsEnv);
|
|
@@ -213,6 +187,18 @@ const GeneralStories = class {
|
|
|
213
187
|
const open = () => this.openFullScreenStory(props.id);
|
|
214
188
|
return (h("div", { class: `StoryThumbnailContainer ${props.viewed ? 'Viewed' : 'Highlighted'}`, onTouchStart: open }, h("img", { class: `StoryThumbnailImage ${props.viewed ? 'Viewed' : 'Highlighted'}`, src: props.icon, alt: "story-icon" })));
|
|
215
189
|
};
|
|
190
|
+
this.cmsEndpoint = undefined;
|
|
191
|
+
this.language = 'en';
|
|
192
|
+
this.cmsEnv = 'stage';
|
|
193
|
+
this.clientStyling = '';
|
|
194
|
+
this.clientStylingUrl = '';
|
|
195
|
+
this.translationUrl = '';
|
|
196
|
+
this.progressBarDuration = 10;
|
|
197
|
+
this.currentStory = undefined;
|
|
198
|
+
this.currentStoryId = null;
|
|
199
|
+
this.progress = 0;
|
|
200
|
+
this.touchPosStart = undefined;
|
|
201
|
+
this.touchPosEnd = undefined;
|
|
216
202
|
}
|
|
217
203
|
handleStylingUpdate() {
|
|
218
204
|
if (this.clientStyling)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { G as general_stories } from './general-stories-
|
|
2
|
-
import './index-
|
|
1
|
+
export { G as general_stories } from './general-stories-2b03e517.js';
|
|
2
|
+
import './index-eb27780b.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-eb27780b.js';
|
|
2
|
+
export { s as setNonce } from './index-eb27780b.js';
|
|
3
3
|
import { g as globalScripts } from './app-globals-0f993ce5.js';
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
|
-
Stencil Client Patch Browser v4.
|
|
6
|
+
Stencil Client Patch Browser v4.22.3 | MIT Licensed | https://stenciljs.com
|
|
7
7
|
*/
|
|
8
8
|
var patchBrowser = () => {
|
|
9
9
|
const importMeta = import.meta.url;
|
|
@@ -1,25 +1,17 @@
|
|
|
1
1
|
const NAMESPACE = 'general-stories';
|
|
2
|
-
const BUILD = /* general-stories */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: false, cmpDidRender: false, 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: false, 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,
|
|
2
|
+
const BUILD = /* general-stories */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: false, cmpDidRender: false, 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: false, 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: false, propMutable: false, propNumber: true, 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: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: false, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: false, watchCallback: true };
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
|
-
Stencil Client Platform v4.
|
|
5
|
+
Stencil Client Platform v4.22.3 | 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
|
|
18
12
|
var hostRefs = /* @__PURE__ */ new WeakMap();
|
|
19
13
|
var getHostRef = (ref) => hostRefs.get(ref);
|
|
20
|
-
var registerInstance = (lazyInstance, hostRef) =>
|
|
21
|
-
hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
|
|
22
|
-
};
|
|
14
|
+
var registerInstance = (lazyInstance, hostRef) => hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
|
|
23
15
|
var registerHost = (hostElement, cmpMeta) => {
|
|
24
16
|
const hostRef = {
|
|
25
17
|
$flags$: 0,
|
|
@@ -32,8 +24,7 @@ var registerHost = (hostElement, cmpMeta) => {
|
|
|
32
24
|
hostElement["s-p"] = [];
|
|
33
25
|
hostElement["s-rc"] = [];
|
|
34
26
|
}
|
|
35
|
-
|
|
36
|
-
return ref;
|
|
27
|
+
return hostRefs.set(hostElement, hostRef);
|
|
37
28
|
};
|
|
38
29
|
var isMemberInElement = (elm, memberName) => memberName in elm;
|
|
39
30
|
var consoleError = (e, el) => (0, console.error)(e, el);
|
|
@@ -70,22 +61,16 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
70
61
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
71
62
|
/* webpackMode: "lazy" */
|
|
72
63
|
`./${bundleId}.entry.js${""}`
|
|
73
|
-
).then(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
cmpModules.set(bundleId, importedModule);
|
|
77
|
-
}
|
|
78
|
-
return importedModule[exportName];
|
|
79
|
-
},
|
|
80
|
-
(e) => {
|
|
81
|
-
consoleError(e, hostRef.$hostElement$);
|
|
64
|
+
).then((importedModule) => {
|
|
65
|
+
{
|
|
66
|
+
cmpModules.set(bundleId, importedModule);
|
|
82
67
|
}
|
|
83
|
-
|
|
68
|
+
return importedModule[exportName];
|
|
69
|
+
}, consoleError);
|
|
84
70
|
};
|
|
85
71
|
|
|
86
72
|
// src/client/client-style.ts
|
|
87
73
|
var styles = /* @__PURE__ */ new Map();
|
|
88
|
-
var HYDRATED_STYLE_ID = "sty-id";
|
|
89
74
|
var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
|
|
90
75
|
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
|
91
76
|
var win = typeof window !== "undefined" ? window : {};
|
|
@@ -159,6 +144,14 @@ var flush = () => {
|
|
|
159
144
|
};
|
|
160
145
|
var nextTick = (cb) => promiseResolve().then(cb);
|
|
161
146
|
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;
|
|
162
155
|
var isComplexType = (o) => {
|
|
163
156
|
o = typeof o;
|
|
164
157
|
return o === "object" || o === "function";
|
|
@@ -370,7 +363,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
370
363
|
}
|
|
371
364
|
if (!appliedStyles.has(scopeId2)) {
|
|
372
365
|
{
|
|
373
|
-
styleElm =
|
|
366
|
+
styleElm = doc.createElement("style");
|
|
374
367
|
styleElm.innerHTML = style;
|
|
375
368
|
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
|
|
376
369
|
if (nonce != null) {
|
|
@@ -380,10 +373,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
380
373
|
if (styleContainerNode.nodeName === "HEAD") {
|
|
381
374
|
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
382
375
|
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
383
|
-
styleContainerNode.insertBefore(
|
|
384
|
-
styleElm,
|
|
385
|
-
(referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
|
|
386
|
-
);
|
|
376
|
+
styleContainerNode.insertBefore(styleElm, referenceNode2);
|
|
387
377
|
} else if ("host" in styleContainerNode) {
|
|
388
378
|
if (supportsConstructableStylesheets) {
|
|
389
379
|
const stylesheet = new CSSStyleSheet();
|
|
@@ -401,7 +391,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
401
391
|
styleContainerNode.append(styleElm);
|
|
402
392
|
}
|
|
403
393
|
}
|
|
404
|
-
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
394
|
+
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD") {
|
|
405
395
|
styleContainerNode.insertBefore(styleElm, null);
|
|
406
396
|
}
|
|
407
397
|
}
|
|
@@ -426,25 +416,23 @@ var attachStyles = (hostRef) => {
|
|
|
426
416
|
const scopeId2 = addStyle(
|
|
427
417
|
elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
428
418
|
cmpMeta);
|
|
429
|
-
if (
|
|
419
|
+
if (flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
|
|
430
420
|
elm["s-sc"] = scopeId2;
|
|
431
421
|
elm.classList.add(scopeId2 + "-h");
|
|
432
422
|
}
|
|
433
423
|
endAttachStyles();
|
|
434
424
|
};
|
|
435
425
|
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
436
|
-
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags
|
|
426
|
+
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
437
427
|
if (oldValue !== newValue) {
|
|
438
428
|
let isProp = isMemberInElement(elm, memberName);
|
|
439
429
|
let ln = memberName.toLowerCase();
|
|
440
430
|
if (memberName === "class") {
|
|
441
431
|
const classList = elm.classList;
|
|
442
432
|
const oldClasses = parseClassList(oldValue);
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
447
|
-
}
|
|
433
|
+
const newClasses = parseClassList(newValue);
|
|
434
|
+
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
435
|
+
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
448
436
|
} else if (memberName === "style") {
|
|
449
437
|
{
|
|
450
438
|
for (const prop in oldValue) {
|
|
@@ -503,7 +491,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
|
|
|
503
491
|
elm.setAttribute(memberName, n);
|
|
504
492
|
}
|
|
505
493
|
}
|
|
506
|
-
} else
|
|
494
|
+
} else {
|
|
507
495
|
elm[memberName] = newValue;
|
|
508
496
|
}
|
|
509
497
|
} catch (e) {
|
|
@@ -525,44 +513,24 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
|
|
|
525
513
|
}
|
|
526
514
|
};
|
|
527
515
|
var parseClassListRegex = /\s/;
|
|
528
|
-
var parseClassList = (value) =>
|
|
529
|
-
if (typeof value === "object" && value && "baseVal" in value) {
|
|
530
|
-
value = value.baseVal;
|
|
531
|
-
}
|
|
532
|
-
if (!value || typeof value !== "string") {
|
|
533
|
-
return [];
|
|
534
|
-
}
|
|
535
|
-
return value.split(parseClassListRegex);
|
|
536
|
-
};
|
|
516
|
+
var parseClassList = (value) => !value ? [] : value.split(parseClassListRegex);
|
|
537
517
|
var CAPTURE_EVENT_SUFFIX = "Capture";
|
|
538
518
|
var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
|
|
539
519
|
|
|
540
520
|
// src/runtime/vdom/update-element.ts
|
|
541
|
-
var updateElement = (oldVnode, newVnode, isSvgMode2
|
|
521
|
+
var updateElement = (oldVnode, newVnode, isSvgMode2) => {
|
|
542
522
|
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
543
|
-
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ ||
|
|
544
|
-
const newVnodeAttrs = newVnode.$attrs$ ||
|
|
523
|
+
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || EMPTY_OBJ;
|
|
524
|
+
const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
|
|
545
525
|
{
|
|
546
526
|
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
547
527
|
if (!(memberName in newVnodeAttrs)) {
|
|
548
|
-
setAccessor(
|
|
549
|
-
elm,
|
|
550
|
-
memberName,
|
|
551
|
-
oldVnodeAttrs[memberName],
|
|
552
|
-
void 0,
|
|
553
|
-
isSvgMode2,
|
|
554
|
-
newVnode.$flags$);
|
|
528
|
+
setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
|
|
555
529
|
}
|
|
556
530
|
}
|
|
557
531
|
}
|
|
558
532
|
for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
|
|
559
|
-
setAccessor(
|
|
560
|
-
elm,
|
|
561
|
-
memberName,
|
|
562
|
-
oldVnodeAttrs[memberName],
|
|
563
|
-
newVnodeAttrs[memberName],
|
|
564
|
-
isSvgMode2,
|
|
565
|
-
newVnode.$flags$);
|
|
533
|
+
setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode2, newVnode.$flags$);
|
|
566
534
|
}
|
|
567
535
|
};
|
|
568
536
|
function sortedAttrNames(attrNames) {
|
|
@@ -574,10 +542,13 @@ function sortedAttrNames(attrNames) {
|
|
|
574
542
|
attrNames
|
|
575
543
|
);
|
|
576
544
|
}
|
|
545
|
+
|
|
546
|
+
// src/runtime/vdom/vdom-render.ts
|
|
547
|
+
var scopeId;
|
|
577
548
|
var hostTagName;
|
|
578
549
|
var useNativeShadowDom = false;
|
|
579
550
|
var isSvgMode = false;
|
|
580
|
-
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
551
|
+
var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
581
552
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
582
553
|
let i2 = 0;
|
|
583
554
|
let elm;
|
|
@@ -598,6 +569,11 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
598
569
|
{
|
|
599
570
|
updateElement(null, newVNode2, isSvgMode);
|
|
600
571
|
}
|
|
572
|
+
const rootNode = elm.getRootNode();
|
|
573
|
+
const isElementWithinShadowRoot = !rootNode.querySelector("body");
|
|
574
|
+
if (!isElementWithinShadowRoot && BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
575
|
+
elm.classList.add(elm["s-si"] = scopeId);
|
|
576
|
+
}
|
|
601
577
|
if (newVNode2.$children$) {
|
|
602
578
|
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
603
579
|
childNode = createElm(oldParentVNode, newVNode2, i2);
|
|
@@ -709,9 +685,6 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
709
685
|
};
|
|
710
686
|
var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
711
687
|
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
712
|
-
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
|
|
713
|
-
leftVNode.$key$ = rightVNode.$key$;
|
|
714
|
-
}
|
|
715
688
|
return true;
|
|
716
689
|
}
|
|
717
690
|
return false;
|
|
@@ -758,9 +731,8 @@ var nullifyVNodeRefs = (vNode) => {
|
|
|
758
731
|
}
|
|
759
732
|
};
|
|
760
733
|
var insertBefore = (parent, newNode, reference) => {
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
}
|
|
734
|
+
const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
735
|
+
return inserted;
|
|
764
736
|
};
|
|
765
737
|
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
766
738
|
const hostElm = hostRef.$hostElement$;
|
|
@@ -785,21 +757,17 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
785
757
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
786
758
|
hostRef.$vnode$ = rootVnode;
|
|
787
759
|
rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
|
|
788
|
-
|
|
760
|
+
{
|
|
761
|
+
scopeId = hostElm["s-sc"];
|
|
762
|
+
}
|
|
763
|
+
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
789
764
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
790
765
|
};
|
|
791
766
|
|
|
792
767
|
// src/runtime/update-component.ts
|
|
793
768
|
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
794
769
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
795
|
-
|
|
796
|
-
new Promise(
|
|
797
|
-
(r) => hostRef.$onRenderResolve$ = () => {
|
|
798
|
-
ancestorComponent["s-p"].splice(index - 1, 1);
|
|
799
|
-
r();
|
|
800
|
-
}
|
|
801
|
-
)
|
|
802
|
-
);
|
|
770
|
+
ancestorComponent["s-p"].push(new Promise((r) => hostRef.$onRenderResolve$ = r));
|
|
803
771
|
}
|
|
804
772
|
};
|
|
805
773
|
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
@@ -828,12 +796,12 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
828
796
|
{
|
|
829
797
|
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
830
798
|
if (hostRef.$queuedListeners$) {
|
|
831
|
-
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event
|
|
799
|
+
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
832
800
|
hostRef.$queuedListeners$ = void 0;
|
|
833
801
|
}
|
|
834
802
|
}
|
|
835
803
|
{
|
|
836
|
-
maybePromise = safeCall(instance, "componentWillLoad"
|
|
804
|
+
maybePromise = safeCall(instance, "componentWillLoad");
|
|
837
805
|
}
|
|
838
806
|
}
|
|
839
807
|
endSchedule();
|
|
@@ -927,14 +895,17 @@ var postUpdateComponent = (hostRef) => {
|
|
|
927
895
|
}
|
|
928
896
|
};
|
|
929
897
|
var appDidLoad = (who) => {
|
|
898
|
+
{
|
|
899
|
+
addHydratedFlag(doc.documentElement);
|
|
900
|
+
}
|
|
930
901
|
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
931
902
|
};
|
|
932
|
-
var safeCall = (instance, method, arg
|
|
903
|
+
var safeCall = (instance, method, arg) => {
|
|
933
904
|
if (instance && instance[method]) {
|
|
934
905
|
try {
|
|
935
906
|
return instance[method](arg);
|
|
936
907
|
} catch (e) {
|
|
937
|
-
consoleError(e
|
|
908
|
+
consoleError(e);
|
|
938
909
|
}
|
|
939
910
|
}
|
|
940
911
|
return void 0;
|
|
@@ -993,68 +964,15 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
993
964
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
994
965
|
members.map(([memberName, [memberFlags]]) => {
|
|
995
966
|
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
|
-
}
|
|
1016
967
|
Object.defineProperty(prototype, memberName, {
|
|
968
|
+
get() {
|
|
969
|
+
return getValue(this, memberName);
|
|
970
|
+
},
|
|
1017
971
|
set(newValue) {
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
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
|
-
}
|
|
972
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
973
|
+
},
|
|
974
|
+
configurable: true,
|
|
975
|
+
enumerable: true
|
|
1058
976
|
});
|
|
1059
977
|
}
|
|
1060
978
|
});
|
|
@@ -1064,7 +982,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1064
982
|
plt.jmp(() => {
|
|
1065
983
|
var _a2;
|
|
1066
984
|
const propName = attrNameToPropName.get(attrName);
|
|
1067
|
-
if (this.hasOwnProperty(propName)
|
|
985
|
+
if (this.hasOwnProperty(propName)) {
|
|
1068
986
|
newValue = this[propName];
|
|
1069
987
|
delete this[propName];
|
|
1070
988
|
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
|
|
@@ -1084,11 +1002,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1084
1002
|
}
|
|
1085
1003
|
return;
|
|
1086
1004
|
}
|
|
1087
|
-
|
|
1088
|
-
newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
|
|
1089
|
-
if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
|
|
1090
|
-
this[propName] = newValue;
|
|
1091
|
-
}
|
|
1005
|
+
this[propName] = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
|
|
1092
1006
|
});
|
|
1093
1007
|
};
|
|
1094
1008
|
Cstr.observedAttributes = Array.from(
|
|
@@ -1117,7 +1031,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1117
1031
|
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
1118
1032
|
const bundleId = cmpMeta.$lazyBundleId$;
|
|
1119
1033
|
if (bundleId) {
|
|
1120
|
-
const CstrImport = loadModule(cmpMeta
|
|
1034
|
+
const CstrImport = loadModule(cmpMeta);
|
|
1121
1035
|
if (CstrImport && "then" in CstrImport) {
|
|
1122
1036
|
const endLoad = uniqueTime();
|
|
1123
1037
|
Cstr = await CstrImport;
|
|
@@ -1142,7 +1056,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1142
1056
|
try {
|
|
1143
1057
|
new Cstr(hostRef);
|
|
1144
1058
|
} catch (e) {
|
|
1145
|
-
consoleError(e
|
|
1059
|
+
consoleError(e);
|
|
1146
1060
|
}
|
|
1147
1061
|
{
|
|
1148
1062
|
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
@@ -1177,7 +1091,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1177
1091
|
schedule();
|
|
1178
1092
|
}
|
|
1179
1093
|
};
|
|
1180
|
-
var fireConnectedCallback = (instance
|
|
1094
|
+
var fireConnectedCallback = (instance) => {
|
|
1181
1095
|
};
|
|
1182
1096
|
|
|
1183
1097
|
// src/runtime/connected-callback.ts
|
|
@@ -1218,7 +1132,7 @@ var connectedCallback = (elm) => {
|
|
|
1218
1132
|
endConnected();
|
|
1219
1133
|
}
|
|
1220
1134
|
};
|
|
1221
|
-
var disconnectInstance = (instance
|
|
1135
|
+
var disconnectInstance = (instance) => {
|
|
1222
1136
|
};
|
|
1223
1137
|
var disconnectedCallback = async (elm) => {
|
|
1224
1138
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
@@ -1233,12 +1147,6 @@ var disconnectedCallback = async (elm) => {
|
|
|
1233
1147
|
hostRef.$onReadyPromise$.then(() => disconnectInstance());
|
|
1234
1148
|
}
|
|
1235
1149
|
}
|
|
1236
|
-
if (rootAppliedStyles.has(elm)) {
|
|
1237
|
-
rootAppliedStyles.delete(elm);
|
|
1238
|
-
}
|
|
1239
|
-
if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
|
|
1240
|
-
rootAppliedStyles.delete(elm.shadowRoot);
|
|
1241
|
-
}
|
|
1242
1150
|
};
|
|
1243
1151
|
|
|
1244
1152
|
// src/runtime/bootstrap-lazy.ts
|
|
@@ -1323,17 +1231,6 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1323
1231
|
}
|
|
1324
1232
|
disconnectedCallback() {
|
|
1325
1233
|
plt.jmp(() => disconnectedCallback(this));
|
|
1326
|
-
plt.raf(() => {
|
|
1327
|
-
var _a3;
|
|
1328
|
-
const hostRef = getHostRef(this);
|
|
1329
|
-
const i2 = deferredConnectedCallbacks.findIndex((host) => host === this);
|
|
1330
|
-
if (i2 > -1) {
|
|
1331
|
-
deferredConnectedCallbacks.splice(i2, 1);
|
|
1332
|
-
}
|
|
1333
|
-
if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
|
|
1334
|
-
delete hostRef.$vnode$.$elm$;
|
|
1335
|
-
}
|
|
1336
|
-
});
|
|
1337
1234
|
}
|
|
1338
1235
|
componentOnReady() {
|
|
1339
1236
|
return getHostRef(this).$onReadyPromise$;
|
|
@@ -1397,7 +1294,7 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
1397
1294
|
}
|
|
1398
1295
|
}
|
|
1399
1296
|
} catch (e) {
|
|
1400
|
-
consoleError(e
|
|
1297
|
+
consoleError(e);
|
|
1401
1298
|
}
|
|
1402
1299
|
};
|
|
1403
1300
|
var hostListenerOpts = (flags) => supportsListenerOptions ? {
|