@everymatrix/general-stories 0.4.0 → 1.54.2
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-1bd0cc77.js → general-stories-0ddaadb7.js} +27 -13
- package/dist/cjs/general-stories.cjs.entry.js +2 -2
- package/dist/cjs/general-stories.cjs.js +2 -2
- package/dist/cjs/{index-bfe9e0e7.js → index-52216882.js} +166 -69
- 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 +40 -12
- package/dist/esm/{general-stories-e69e7533.js → general-stories-8e6d8657.js} +27 -13
- package/dist/esm/general-stories.entry.js +2 -2
- package/dist/esm/general-stories.js +3 -3
- package/dist/esm/{index-eb27780b.js → index-12456b89.js} +166 -69
- 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-0efd3a4d.entry.js +1 -0
- package/dist/general-stories/p-505f1e06.js +1 -0
- package/dist/general-stories/p-734e82f3.js +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/general-stories/.stencil/packages/stencil/general-stories/stencil.config.d.ts +2 -0
- package/dist/types/Users/adrian.pripon/Documents/Work/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-33a823ba.js +0 -2
- package/dist/general-stories/p-75ef31af.js +0 -1
- package/dist/general-stories/p-ad516adf.entry.js +0 -1
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/general-stories/.stencil/packages/stencil/general-stories/stencil.config.d.ts +0 -2
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/general-stories/.stencil/packages/stencil/general-stories/stencil.config.dev.d.ts +0 -2
|
@@ -3,9 +3,35 @@ 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;
|
|
6
30
|
this.hasErrors = false;
|
|
7
31
|
this.isLoading = true;
|
|
8
32
|
this.isSwipe = false;
|
|
33
|
+
this.currentStoryId = null;
|
|
34
|
+
this.progress = 0;
|
|
9
35
|
this.getStories = () => {
|
|
10
36
|
let url = new URL(`${this.cmsEndpoint}/${this.language}/stories`);
|
|
11
37
|
url.searchParams.append('env', this.cmsEnv);
|
|
@@ -101,18 +127,6 @@ export class GeneralStories {
|
|
|
101
127
|
const open = () => this.openFullScreenStory(props.id);
|
|
102
128
|
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" })));
|
|
103
129
|
};
|
|
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;
|
|
116
130
|
}
|
|
117
131
|
handleStylingUpdate() {
|
|
118
132
|
if (this.clientStyling)
|
|
@@ -218,6 +232,8 @@ export class GeneralStories {
|
|
|
218
232
|
"tags": [],
|
|
219
233
|
"text": "Endpoint URL for the source of data"
|
|
220
234
|
},
|
|
235
|
+
"getter": false,
|
|
236
|
+
"setter": false,
|
|
221
237
|
"attribute": "cms-endpoint",
|
|
222
238
|
"reflect": true
|
|
223
239
|
},
|
|
@@ -235,6 +251,8 @@ export class GeneralStories {
|
|
|
235
251
|
"tags": [],
|
|
236
252
|
"text": "Language of the widget"
|
|
237
253
|
},
|
|
254
|
+
"getter": false,
|
|
255
|
+
"setter": false,
|
|
238
256
|
"attribute": "language",
|
|
239
257
|
"reflect": true,
|
|
240
258
|
"defaultValue": "'en'"
|
|
@@ -253,6 +271,8 @@ export class GeneralStories {
|
|
|
253
271
|
"tags": [],
|
|
254
272
|
"text": "CMS Endpoint stage"
|
|
255
273
|
},
|
|
274
|
+
"getter": false,
|
|
275
|
+
"setter": false,
|
|
256
276
|
"attribute": "cms-env",
|
|
257
277
|
"reflect": true,
|
|
258
278
|
"defaultValue": "'stage'"
|
|
@@ -271,6 +291,8 @@ export class GeneralStories {
|
|
|
271
291
|
"tags": [],
|
|
272
292
|
"text": "Client custom styling via string"
|
|
273
293
|
},
|
|
294
|
+
"getter": false,
|
|
295
|
+
"setter": false,
|
|
274
296
|
"attribute": "client-styling",
|
|
275
297
|
"reflect": true,
|
|
276
298
|
"defaultValue": "''"
|
|
@@ -289,6 +311,8 @@ export class GeneralStories {
|
|
|
289
311
|
"tags": [],
|
|
290
312
|
"text": "Client custom styling via url"
|
|
291
313
|
},
|
|
314
|
+
"getter": false,
|
|
315
|
+
"setter": false,
|
|
292
316
|
"attribute": "client-styling-url",
|
|
293
317
|
"reflect": true,
|
|
294
318
|
"defaultValue": "''"
|
|
@@ -307,6 +331,8 @@ export class GeneralStories {
|
|
|
307
331
|
"tags": [],
|
|
308
332
|
"text": "Translations via URL"
|
|
309
333
|
},
|
|
334
|
+
"getter": false,
|
|
335
|
+
"setter": false,
|
|
310
336
|
"attribute": "translation-url",
|
|
311
337
|
"reflect": true,
|
|
312
338
|
"defaultValue": "''"
|
|
@@ -325,6 +351,8 @@ export class GeneralStories {
|
|
|
325
351
|
"tags": [],
|
|
326
352
|
"text": "Duration of progress bar"
|
|
327
353
|
},
|
|
354
|
+
"getter": false,
|
|
355
|
+
"setter": false,
|
|
328
356
|
"attribute": "progress-bar-duration",
|
|
329
357
|
"reflect": true,
|
|
330
358
|
"defaultValue": "10"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h } from './index-
|
|
1
|
+
import { r as registerInstance, h } from './index-12456b89.js';
|
|
2
2
|
|
|
3
3
|
const getDevice = () => {
|
|
4
4
|
let userAgent = window.navigator.userAgent;
|
|
@@ -89,9 +89,35 @@ 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;
|
|
92
116
|
this.hasErrors = false;
|
|
93
117
|
this.isLoading = true;
|
|
94
118
|
this.isSwipe = false;
|
|
119
|
+
this.currentStoryId = null;
|
|
120
|
+
this.progress = 0;
|
|
95
121
|
this.getStories = () => {
|
|
96
122
|
let url = new URL(`${this.cmsEndpoint}/${this.language}/stories`);
|
|
97
123
|
url.searchParams.append('env', this.cmsEnv);
|
|
@@ -187,18 +213,6 @@ const GeneralStories = class {
|
|
|
187
213
|
const open = () => this.openFullScreenStory(props.id);
|
|
188
214
|
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" })));
|
|
189
215
|
};
|
|
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;
|
|
202
216
|
}
|
|
203
217
|
handleStylingUpdate() {
|
|
204
218
|
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-8e6d8657.js';
|
|
2
|
+
import './index-12456b89.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-12456b89.js';
|
|
2
|
+
export { s as setNonce } from './index-12456b89.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.25.1 | MIT Licensed | https://stenciljs.com
|
|
7
7
|
*/
|
|
8
8
|
var patchBrowser = () => {
|
|
9
9
|
const importMeta = import.meta.url;
|
|
@@ -1,17 +1,25 @@
|
|
|
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, 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 };
|
|
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, modernPropertyDecls: 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.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";
|
|
@@ -363,7 +370,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
363
370
|
}
|
|
364
371
|
if (!appliedStyles.has(scopeId2)) {
|
|
365
372
|
{
|
|
366
|
-
styleElm = doc.createElement("style");
|
|
373
|
+
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
|
|
367
374
|
styleElm.innerHTML = style;
|
|
368
375
|
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
|
|
369
376
|
if (nonce != null) {
|
|
@@ -373,7 +380,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
373
380
|
if (styleContainerNode.nodeName === "HEAD") {
|
|
374
381
|
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
375
382
|
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
376
|
-
styleContainerNode.insertBefore(
|
|
383
|
+
styleContainerNode.insertBefore(
|
|
384
|
+
styleElm,
|
|
385
|
+
(referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
|
|
386
|
+
);
|
|
377
387
|
} else if ("host" in styleContainerNode) {
|
|
378
388
|
if (supportsConstructableStylesheets) {
|
|
379
389
|
const stylesheet = new CSSStyleSheet();
|
|
@@ -423,16 +433,18 @@ var attachStyles = (hostRef) => {
|
|
|
423
433
|
endAttachStyles();
|
|
424
434
|
};
|
|
425
435
|
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
426
|
-
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
436
|
+
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
|
|
427
437
|
if (oldValue !== newValue) {
|
|
428
438
|
let isProp = isMemberInElement(elm, memberName);
|
|
429
439
|
let ln = memberName.toLowerCase();
|
|
430
440
|
if (memberName === "class") {
|
|
431
441
|
const classList = elm.classList;
|
|
432
442
|
const oldClasses = parseClassList(oldValue);
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
443
|
+
let newClasses = parseClassList(newValue);
|
|
444
|
+
{
|
|
445
|
+
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
446
|
+
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
447
|
+
}
|
|
436
448
|
} else if (memberName === "style") {
|
|
437
449
|
{
|
|
438
450
|
for (const prop in oldValue) {
|
|
@@ -491,7 +503,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
491
503
|
elm.setAttribute(memberName, n);
|
|
492
504
|
}
|
|
493
505
|
}
|
|
494
|
-
} else {
|
|
506
|
+
} else if (elm[memberName] !== newValue) {
|
|
495
507
|
elm[memberName] = newValue;
|
|
496
508
|
}
|
|
497
509
|
} catch (e) {
|
|
@@ -513,24 +525,44 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
513
525
|
}
|
|
514
526
|
};
|
|
515
527
|
var parseClassListRegex = /\s/;
|
|
516
|
-
var parseClassList = (value) =>
|
|
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
|
+
};
|
|
517
537
|
var CAPTURE_EVENT_SUFFIX = "Capture";
|
|
518
538
|
var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
|
|
519
539
|
|
|
520
540
|
// src/runtime/vdom/update-element.ts
|
|
521
|
-
var updateElement = (oldVnode, newVnode, isSvgMode2) => {
|
|
541
|
+
var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
|
|
522
542
|
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
523
|
-
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ ||
|
|
524
|
-
const newVnodeAttrs = newVnode.$attrs$ ||
|
|
543
|
+
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
|
|
544
|
+
const newVnodeAttrs = newVnode.$attrs$ || {};
|
|
525
545
|
{
|
|
526
546
|
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
527
547
|
if (!(memberName in newVnodeAttrs)) {
|
|
528
|
-
setAccessor(
|
|
548
|
+
setAccessor(
|
|
549
|
+
elm,
|
|
550
|
+
memberName,
|
|
551
|
+
oldVnodeAttrs[memberName],
|
|
552
|
+
void 0,
|
|
553
|
+
isSvgMode2,
|
|
554
|
+
newVnode.$flags$);
|
|
529
555
|
}
|
|
530
556
|
}
|
|
531
557
|
}
|
|
532
558
|
for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
|
|
533
|
-
setAccessor(
|
|
559
|
+
setAccessor(
|
|
560
|
+
elm,
|
|
561
|
+
memberName,
|
|
562
|
+
oldVnodeAttrs[memberName],
|
|
563
|
+
newVnodeAttrs[memberName],
|
|
564
|
+
isSvgMode2,
|
|
565
|
+
newVnode.$flags$);
|
|
534
566
|
}
|
|
535
567
|
};
|
|
536
568
|
function sortedAttrNames(attrNames) {
|
|
@@ -542,13 +574,10 @@ function sortedAttrNames(attrNames) {
|
|
|
542
574
|
attrNames
|
|
543
575
|
);
|
|
544
576
|
}
|
|
545
|
-
|
|
546
|
-
// src/runtime/vdom/vdom-render.ts
|
|
547
|
-
var scopeId;
|
|
548
577
|
var hostTagName;
|
|
549
578
|
var useNativeShadowDom = false;
|
|
550
579
|
var isSvgMode = false;
|
|
551
|
-
var createElm = (oldParentVNode, newParentVNode, childIndex
|
|
580
|
+
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
552
581
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
553
582
|
let i2 = 0;
|
|
554
583
|
let elm;
|
|
@@ -569,11 +598,6 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
569
598
|
{
|
|
570
599
|
updateElement(null, newVNode2, isSvgMode);
|
|
571
600
|
}
|
|
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
|
-
}
|
|
577
601
|
if (newVNode2.$children$) {
|
|
578
602
|
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
579
603
|
childNode = createElm(oldParentVNode, newVNode2, i2);
|
|
@@ -685,6 +709,9 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
685
709
|
};
|
|
686
710
|
var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
687
711
|
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
712
|
+
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
|
|
713
|
+
leftVNode.$key$ = rightVNode.$key$;
|
|
714
|
+
}
|
|
688
715
|
return true;
|
|
689
716
|
}
|
|
690
717
|
return false;
|
|
@@ -731,8 +758,9 @@ var nullifyVNodeRefs = (vNode) => {
|
|
|
731
758
|
}
|
|
732
759
|
};
|
|
733
760
|
var insertBefore = (parent, newNode, reference) => {
|
|
734
|
-
|
|
735
|
-
|
|
761
|
+
{
|
|
762
|
+
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
763
|
+
}
|
|
736
764
|
};
|
|
737
765
|
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
738
766
|
const hostElm = hostRef.$hostElement$;
|
|
@@ -757,9 +785,6 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
757
785
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
758
786
|
hostRef.$vnode$ = rootVnode;
|
|
759
787
|
rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
|
|
760
|
-
{
|
|
761
|
-
scopeId = hostElm["s-sc"];
|
|
762
|
-
}
|
|
763
788
|
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
764
789
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
765
790
|
};
|
|
@@ -767,7 +792,14 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
767
792
|
// src/runtime/update-component.ts
|
|
768
793
|
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
769
794
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
770
|
-
ancestorComponent["s-p"].push(
|
|
795
|
+
const index = ancestorComponent["s-p"].push(
|
|
796
|
+
new Promise(
|
|
797
|
+
(r) => hostRef.$onRenderResolve$ = () => {
|
|
798
|
+
ancestorComponent["s-p"].splice(index - 1, 1);
|
|
799
|
+
r();
|
|
800
|
+
}
|
|
801
|
+
)
|
|
802
|
+
);
|
|
771
803
|
}
|
|
772
804
|
};
|
|
773
805
|
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
@@ -796,12 +828,12 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
796
828
|
{
|
|
797
829
|
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
798
830
|
if (hostRef.$queuedListeners$) {
|
|
799
|
-
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
831
|
+
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event, elm));
|
|
800
832
|
hostRef.$queuedListeners$ = void 0;
|
|
801
833
|
}
|
|
802
834
|
}
|
|
803
835
|
{
|
|
804
|
-
maybePromise = safeCall(instance, "componentWillLoad");
|
|
836
|
+
maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
|
|
805
837
|
}
|
|
806
838
|
}
|
|
807
839
|
endSchedule();
|
|
@@ -900,12 +932,12 @@ var appDidLoad = (who) => {
|
|
|
900
932
|
}
|
|
901
933
|
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
902
934
|
};
|
|
903
|
-
var safeCall = (instance, method, arg) => {
|
|
935
|
+
var safeCall = (instance, method, arg, elm) => {
|
|
904
936
|
if (instance && instance[method]) {
|
|
905
937
|
try {
|
|
906
938
|
return instance[method](arg);
|
|
907
939
|
} catch (e) {
|
|
908
|
-
consoleError(e);
|
|
940
|
+
consoleError(e, elm);
|
|
909
941
|
}
|
|
910
942
|
}
|
|
911
943
|
return void 0;
|
|
@@ -964,15 +996,68 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
964
996
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
965
997
|
members.map(([memberName, [memberFlags]]) => {
|
|
966
998
|
if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
999
|
+
const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
|
|
1000
|
+
if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
|
|
1001
|
+
if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
|
|
1002
|
+
if (flags & 1 /* isElementConstructor */ || !origGetter) {
|
|
1003
|
+
Object.defineProperty(prototype, memberName, {
|
|
1004
|
+
get() {
|
|
1005
|
+
{
|
|
1006
|
+
if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
|
|
1007
|
+
return getValue(this, memberName);
|
|
1008
|
+
}
|
|
1009
|
+
const ref = getHostRef(this);
|
|
1010
|
+
const instance = ref ? ref.$lazyInstance$ : prototype;
|
|
1011
|
+
if (!instance) return;
|
|
1012
|
+
return instance[memberName];
|
|
1013
|
+
}
|
|
1014
|
+
},
|
|
1015
|
+
configurable: true,
|
|
1016
|
+
enumerable: true
|
|
1017
|
+
});
|
|
1018
|
+
}
|
|
967
1019
|
Object.defineProperty(prototype, memberName, {
|
|
968
|
-
get() {
|
|
969
|
-
return getValue(this, memberName);
|
|
970
|
-
},
|
|
971
1020
|
set(newValue) {
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
1021
|
+
const ref = getHostRef(this);
|
|
1022
|
+
if (origSetter) {
|
|
1023
|
+
const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
1024
|
+
if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
|
|
1025
|
+
newValue = ref.$instanceValues$.get(memberName);
|
|
1026
|
+
} else if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
1027
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
1028
|
+
}
|
|
1029
|
+
origSetter.apply(this, [parsePropertyValue(newValue, memberFlags)]);
|
|
1030
|
+
newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
1031
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
1032
|
+
return;
|
|
1033
|
+
}
|
|
1034
|
+
{
|
|
1035
|
+
if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
|
|
1036
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
1037
|
+
if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
|
|
1038
|
+
ref.$onReadyPromise$.then(() => {
|
|
1039
|
+
if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
|
|
1040
|
+
ref.$lazyInstance$[memberName] = newValue;
|
|
1041
|
+
}
|
|
1042
|
+
});
|
|
1043
|
+
}
|
|
1044
|
+
return;
|
|
1045
|
+
}
|
|
1046
|
+
const setterSetVal = () => {
|
|
1047
|
+
const currentValue = ref.$lazyInstance$[memberName];
|
|
1048
|
+
if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
1049
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
1050
|
+
}
|
|
1051
|
+
ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, memberFlags);
|
|
1052
|
+
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
|
|
1053
|
+
};
|
|
1054
|
+
if (ref.$lazyInstance$) {
|
|
1055
|
+
setterSetVal();
|
|
1056
|
+
} else {
|
|
1057
|
+
ref.$onReadyPromise$.then(() => setterSetVal());
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
976
1061
|
});
|
|
977
1062
|
}
|
|
978
1063
|
});
|
|
@@ -982,7 +1067,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
982
1067
|
plt.jmp(() => {
|
|
983
1068
|
var _a2;
|
|
984
1069
|
const propName = attrNameToPropName.get(attrName);
|
|
985
|
-
if (this.hasOwnProperty(propName)) {
|
|
1070
|
+
if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
|
|
986
1071
|
newValue = this[propName];
|
|
987
1072
|
delete this[propName];
|
|
988
1073
|
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
|
|
@@ -1002,7 +1087,11 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1002
1087
|
}
|
|
1003
1088
|
return;
|
|
1004
1089
|
}
|
|
1005
|
-
|
|
1090
|
+
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
1091
|
+
newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
|
|
1092
|
+
if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
|
|
1093
|
+
this[propName] = newValue;
|
|
1094
|
+
}
|
|
1006
1095
|
});
|
|
1007
1096
|
};
|
|
1008
1097
|
Cstr.observedAttributes = Array.from(
|
|
@@ -1029,9 +1118,8 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1029
1118
|
let Cstr;
|
|
1030
1119
|
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
1031
1120
|
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
const CstrImport = loadModule(cmpMeta);
|
|
1121
|
+
{
|
|
1122
|
+
const CstrImport = loadModule(cmpMeta, hostRef);
|
|
1035
1123
|
if (CstrImport && "then" in CstrImport) {
|
|
1036
1124
|
const endLoad = uniqueTime();
|
|
1037
1125
|
Cstr = await CstrImport;
|
|
@@ -1056,7 +1144,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1056
1144
|
try {
|
|
1057
1145
|
new Cstr(hostRef);
|
|
1058
1146
|
} catch (e) {
|
|
1059
|
-
consoleError(e);
|
|
1147
|
+
consoleError(e, elm);
|
|
1060
1148
|
}
|
|
1061
1149
|
{
|
|
1062
1150
|
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
@@ -1065,10 +1153,6 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1065
1153
|
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
1066
1154
|
}
|
|
1067
1155
|
endNewInstance();
|
|
1068
|
-
} else {
|
|
1069
|
-
Cstr = elm.constructor;
|
|
1070
|
-
const cmpTag = elm.localName;
|
|
1071
|
-
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
|
|
1072
1156
|
}
|
|
1073
1157
|
if (Cstr && Cstr.style) {
|
|
1074
1158
|
let style;
|
|
@@ -1091,7 +1175,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1091
1175
|
schedule();
|
|
1092
1176
|
}
|
|
1093
1177
|
};
|
|
1094
|
-
var fireConnectedCallback = (instance) => {
|
|
1178
|
+
var fireConnectedCallback = (instance, elm) => {
|
|
1095
1179
|
};
|
|
1096
1180
|
|
|
1097
1181
|
// src/runtime/connected-callback.ts
|
|
@@ -1132,7 +1216,7 @@ var connectedCallback = (elm) => {
|
|
|
1132
1216
|
endConnected();
|
|
1133
1217
|
}
|
|
1134
1218
|
};
|
|
1135
|
-
var disconnectInstance = (instance) => {
|
|
1219
|
+
var disconnectInstance = (instance, elm) => {
|
|
1136
1220
|
};
|
|
1137
1221
|
var disconnectedCallback = async (elm) => {
|
|
1138
1222
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
@@ -1147,6 +1231,12 @@ var disconnectedCallback = async (elm) => {
|
|
|
1147
1231
|
hostRef.$onReadyPromise$.then(() => disconnectInstance());
|
|
1148
1232
|
}
|
|
1149
1233
|
}
|
|
1234
|
+
if (rootAppliedStyles.has(elm)) {
|
|
1235
|
+
rootAppliedStyles.delete(elm);
|
|
1236
|
+
}
|
|
1237
|
+
if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
|
|
1238
|
+
rootAppliedStyles.delete(elm.shadowRoot);
|
|
1239
|
+
}
|
|
1150
1240
|
};
|
|
1151
1241
|
|
|
1152
1242
|
// src/runtime/bootstrap-lazy.ts
|
|
@@ -1231,6 +1321,13 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1231
1321
|
}
|
|
1232
1322
|
disconnectedCallback() {
|
|
1233
1323
|
plt.jmp(() => disconnectedCallback(this));
|
|
1324
|
+
plt.raf(() => {
|
|
1325
|
+
var _a3;
|
|
1326
|
+
const hostRef = getHostRef(this);
|
|
1327
|
+
if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
|
|
1328
|
+
delete hostRef.$vnode$.$elm$;
|
|
1329
|
+
}
|
|
1330
|
+
});
|
|
1234
1331
|
}
|
|
1235
1332
|
componentOnReady() {
|
|
1236
1333
|
return getHostRef(this).$onReadyPromise$;
|
|
@@ -1294,7 +1391,7 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
1294
1391
|
}
|
|
1295
1392
|
}
|
|
1296
1393
|
} catch (e) {
|
|
1297
|
-
consoleError(e);
|
|
1394
|
+
consoleError(e, hostRef.$hostElement$);
|
|
1298
1395
|
}
|
|
1299
1396
|
};
|
|
1300
1397
|
var hostListenerOpts = (flags) => supportsListenerOptions ? {
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { G as GeneralStories } from './general-stories-
|
|
2
|
-
import './index-
|
|
1
|
+
export { G as GeneralStories } from './general-stories-8e6d8657.js';
|
|
2
|
+
import './index-12456b89.js';
|