@everymatrix/general-stories 0.3.6 → 0.5.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-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/builds/emfe-widgets/widgets-monorepo/packages/stencil/general-stories/.stencil/packages/stencil/general-stories/stencil.config.d.ts +2 -0
- package/dist/types/builds/emfe-widgets/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/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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
3
|
+
const index = require('./index-52216882.js');
|
|
4
4
|
|
|
5
5
|
const getDevice = () => {
|
|
6
6
|
let userAgent = window.navigator.userAgent;
|
|
@@ -91,9 +91,35 @@ const GeneralStoriesStyle0 = generalStoriesCss;
|
|
|
91
91
|
const GeneralStories = class {
|
|
92
92
|
constructor(hostRef) {
|
|
93
93
|
index.registerInstance(this, hostRef);
|
|
94
|
+
/**
|
|
95
|
+
* Language of the widget
|
|
96
|
+
*/
|
|
97
|
+
this.language = 'en';
|
|
98
|
+
/**
|
|
99
|
+
* CMS Endpoint stage
|
|
100
|
+
*/
|
|
101
|
+
this.cmsEnv = 'stage';
|
|
102
|
+
/**
|
|
103
|
+
* Client custom styling via string
|
|
104
|
+
*/
|
|
105
|
+
this.clientStyling = '';
|
|
106
|
+
/**
|
|
107
|
+
* Client custom styling via url
|
|
108
|
+
*/
|
|
109
|
+
this.clientStylingUrl = '';
|
|
110
|
+
/**
|
|
111
|
+
* Translations via URL
|
|
112
|
+
*/
|
|
113
|
+
this.translationUrl = '';
|
|
114
|
+
/**
|
|
115
|
+
* Duration of progress bar
|
|
116
|
+
*/
|
|
117
|
+
this.progressBarDuration = 10;
|
|
94
118
|
this.hasErrors = false;
|
|
95
119
|
this.isLoading = true;
|
|
96
120
|
this.isSwipe = false;
|
|
121
|
+
this.currentStoryId = null;
|
|
122
|
+
this.progress = 0;
|
|
97
123
|
this.getStories = () => {
|
|
98
124
|
let url = new URL(`${this.cmsEndpoint}/${this.language}/stories`);
|
|
99
125
|
url.searchParams.append('env', this.cmsEnv);
|
|
@@ -189,18 +215,6 @@ const GeneralStories = class {
|
|
|
189
215
|
const open = () => this.openFullScreenStory(props.id);
|
|
190
216
|
return (index.h("div", { class: `StoryThumbnailContainer ${props.viewed ? 'Viewed' : 'Highlighted'}`, onTouchStart: open }, index.h("img", { class: `StoryThumbnailImage ${props.viewed ? 'Viewed' : 'Highlighted'}`, src: props.icon, alt: "story-icon" })));
|
|
191
217
|
};
|
|
192
|
-
this.cmsEndpoint = undefined;
|
|
193
|
-
this.language = 'en';
|
|
194
|
-
this.cmsEnv = 'stage';
|
|
195
|
-
this.clientStyling = '';
|
|
196
|
-
this.clientStylingUrl = '';
|
|
197
|
-
this.translationUrl = '';
|
|
198
|
-
this.progressBarDuration = 10;
|
|
199
|
-
this.currentStory = undefined;
|
|
200
|
-
this.currentStoryId = null;
|
|
201
|
-
this.progress = 0;
|
|
202
|
-
this.touchPosStart = undefined;
|
|
203
|
-
this.touchPosEnd = undefined;
|
|
204
218
|
}
|
|
205
219
|
handleStylingUpdate() {
|
|
206
220
|
if (this.clientStyling)
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const generalStories = require('./general-stories-
|
|
6
|
-
require('./index-
|
|
5
|
+
const generalStories = require('./general-stories-0ddaadb7.js');
|
|
6
|
+
require('./index-52216882.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -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-52216882.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-stories.cjs.js', document.baseURI).href));
|
|
@@ -21,19 +21,27 @@ function _interopNamespace(e) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const NAMESPACE = 'general-stories';
|
|
24
|
-
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 };
|
|
24
|
+
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 };
|
|
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/utils/constants.ts
|
|
36
|
+
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
37
|
+
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
38
|
+
|
|
39
|
+
// src/client/client-host-ref.ts
|
|
34
40
|
var hostRefs = /* @__PURE__ */ new WeakMap();
|
|
35
41
|
var getHostRef = (ref) => hostRefs.get(ref);
|
|
36
|
-
var registerInstance = (lazyInstance, hostRef) =>
|
|
42
|
+
var registerInstance = (lazyInstance, hostRef) => {
|
|
43
|
+
hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
|
|
44
|
+
};
|
|
37
45
|
var registerHost = (hostElement, cmpMeta) => {
|
|
38
46
|
const hostRef = {
|
|
39
47
|
$flags$: 0,
|
|
@@ -46,7 +54,8 @@ var registerHost = (hostElement, cmpMeta) => {
|
|
|
46
54
|
hostElement["s-p"] = [];
|
|
47
55
|
hostElement["s-rc"] = [];
|
|
48
56
|
}
|
|
49
|
-
|
|
57
|
+
const ref = hostRefs.set(hostElement, hostRef);
|
|
58
|
+
return ref;
|
|
50
59
|
};
|
|
51
60
|
var isMemberInElement = (elm, memberName) => memberName in elm;
|
|
52
61
|
var consoleError = (e, el) => (0, console.error)(e, el);
|
|
@@ -83,16 +92,22 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
83
92
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
84
93
|
/* webpackMode: "lazy" */
|
|
85
94
|
`./${bundleId}.entry.js${""}`
|
|
86
|
-
)); }).then(
|
|
87
|
-
{
|
|
88
|
-
|
|
95
|
+
)); }).then(
|
|
96
|
+
(importedModule) => {
|
|
97
|
+
{
|
|
98
|
+
cmpModules.set(bundleId, importedModule);
|
|
99
|
+
}
|
|
100
|
+
return importedModule[exportName];
|
|
101
|
+
},
|
|
102
|
+
(e) => {
|
|
103
|
+
consoleError(e, hostRef.$hostElement$);
|
|
89
104
|
}
|
|
90
|
-
|
|
91
|
-
}, consoleError);
|
|
105
|
+
);
|
|
92
106
|
};
|
|
93
107
|
|
|
94
108
|
// src/client/client-style.ts
|
|
95
109
|
var styles = /* @__PURE__ */ new Map();
|
|
110
|
+
var HYDRATED_STYLE_ID = "sty-id";
|
|
96
111
|
var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
|
|
97
112
|
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
|
98
113
|
var win = typeof window !== "undefined" ? window : {};
|
|
@@ -166,14 +181,6 @@ var flush = () => {
|
|
|
166
181
|
};
|
|
167
182
|
var nextTick = (cb) => promiseResolve().then(cb);
|
|
168
183
|
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
|
|
169
|
-
|
|
170
|
-
// src/utils/constants.ts
|
|
171
|
-
var EMPTY_OBJ = {};
|
|
172
|
-
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
173
|
-
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
174
|
-
|
|
175
|
-
// src/utils/helpers.ts
|
|
176
|
-
var isDef = (v) => v != null;
|
|
177
184
|
var isComplexType = (o) => {
|
|
178
185
|
o = typeof o;
|
|
179
186
|
return o === "object" || o === "function";
|
|
@@ -385,7 +392,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
385
392
|
}
|
|
386
393
|
if (!appliedStyles.has(scopeId2)) {
|
|
387
394
|
{
|
|
388
|
-
styleElm = doc.createElement("style");
|
|
395
|
+
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
|
|
389
396
|
styleElm.innerHTML = style;
|
|
390
397
|
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
|
|
391
398
|
if (nonce != null) {
|
|
@@ -395,7 +402,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
395
402
|
if (styleContainerNode.nodeName === "HEAD") {
|
|
396
403
|
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
397
404
|
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
398
|
-
styleContainerNode.insertBefore(
|
|
405
|
+
styleContainerNode.insertBefore(
|
|
406
|
+
styleElm,
|
|
407
|
+
(referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
|
|
408
|
+
);
|
|
399
409
|
} else if ("host" in styleContainerNode) {
|
|
400
410
|
if (supportsConstructableStylesheets) {
|
|
401
411
|
const stylesheet = new CSSStyleSheet();
|
|
@@ -445,16 +455,18 @@ var attachStyles = (hostRef) => {
|
|
|
445
455
|
endAttachStyles();
|
|
446
456
|
};
|
|
447
457
|
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
448
|
-
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
458
|
+
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
|
|
449
459
|
if (oldValue !== newValue) {
|
|
450
460
|
let isProp = isMemberInElement(elm, memberName);
|
|
451
461
|
let ln = memberName.toLowerCase();
|
|
452
462
|
if (memberName === "class") {
|
|
453
463
|
const classList = elm.classList;
|
|
454
464
|
const oldClasses = parseClassList(oldValue);
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
465
|
+
let newClasses = parseClassList(newValue);
|
|
466
|
+
{
|
|
467
|
+
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
468
|
+
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
469
|
+
}
|
|
458
470
|
} else if (memberName === "style") {
|
|
459
471
|
{
|
|
460
472
|
for (const prop in oldValue) {
|
|
@@ -513,7 +525,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
513
525
|
elm.setAttribute(memberName, n);
|
|
514
526
|
}
|
|
515
527
|
}
|
|
516
|
-
} else {
|
|
528
|
+
} else if (elm[memberName] !== newValue) {
|
|
517
529
|
elm[memberName] = newValue;
|
|
518
530
|
}
|
|
519
531
|
} catch (e) {
|
|
@@ -535,24 +547,44 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
535
547
|
}
|
|
536
548
|
};
|
|
537
549
|
var parseClassListRegex = /\s/;
|
|
538
|
-
var parseClassList = (value) =>
|
|
550
|
+
var parseClassList = (value) => {
|
|
551
|
+
if (typeof value === "object" && value && "baseVal" in value) {
|
|
552
|
+
value = value.baseVal;
|
|
553
|
+
}
|
|
554
|
+
if (!value || typeof value !== "string") {
|
|
555
|
+
return [];
|
|
556
|
+
}
|
|
557
|
+
return value.split(parseClassListRegex);
|
|
558
|
+
};
|
|
539
559
|
var CAPTURE_EVENT_SUFFIX = "Capture";
|
|
540
560
|
var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
|
|
541
561
|
|
|
542
562
|
// src/runtime/vdom/update-element.ts
|
|
543
|
-
var updateElement = (oldVnode, newVnode, isSvgMode2) => {
|
|
563
|
+
var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
|
|
544
564
|
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
545
|
-
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ ||
|
|
546
|
-
const newVnodeAttrs = newVnode.$attrs$ ||
|
|
565
|
+
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
|
|
566
|
+
const newVnodeAttrs = newVnode.$attrs$ || {};
|
|
547
567
|
{
|
|
548
568
|
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
549
569
|
if (!(memberName in newVnodeAttrs)) {
|
|
550
|
-
setAccessor(
|
|
570
|
+
setAccessor(
|
|
571
|
+
elm,
|
|
572
|
+
memberName,
|
|
573
|
+
oldVnodeAttrs[memberName],
|
|
574
|
+
void 0,
|
|
575
|
+
isSvgMode2,
|
|
576
|
+
newVnode.$flags$);
|
|
551
577
|
}
|
|
552
578
|
}
|
|
553
579
|
}
|
|
554
580
|
for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
|
|
555
|
-
setAccessor(
|
|
581
|
+
setAccessor(
|
|
582
|
+
elm,
|
|
583
|
+
memberName,
|
|
584
|
+
oldVnodeAttrs[memberName],
|
|
585
|
+
newVnodeAttrs[memberName],
|
|
586
|
+
isSvgMode2,
|
|
587
|
+
newVnode.$flags$);
|
|
556
588
|
}
|
|
557
589
|
};
|
|
558
590
|
function sortedAttrNames(attrNames) {
|
|
@@ -564,13 +596,10 @@ function sortedAttrNames(attrNames) {
|
|
|
564
596
|
attrNames
|
|
565
597
|
);
|
|
566
598
|
}
|
|
567
|
-
|
|
568
|
-
// src/runtime/vdom/vdom-render.ts
|
|
569
|
-
var scopeId;
|
|
570
599
|
var hostTagName;
|
|
571
600
|
var useNativeShadowDom = false;
|
|
572
601
|
var isSvgMode = false;
|
|
573
|
-
var createElm = (oldParentVNode, newParentVNode, childIndex
|
|
602
|
+
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
574
603
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
575
604
|
let i2 = 0;
|
|
576
605
|
let elm;
|
|
@@ -591,11 +620,6 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
591
620
|
{
|
|
592
621
|
updateElement(null, newVNode2, isSvgMode);
|
|
593
622
|
}
|
|
594
|
-
const rootNode = elm.getRootNode();
|
|
595
|
-
const isElementWithinShadowRoot = !rootNode.querySelector("body");
|
|
596
|
-
if (!isElementWithinShadowRoot && BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
597
|
-
elm.classList.add(elm["s-si"] = scopeId);
|
|
598
|
-
}
|
|
599
623
|
if (newVNode2.$children$) {
|
|
600
624
|
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
601
625
|
childNode = createElm(oldParentVNode, newVNode2, i2);
|
|
@@ -707,6 +731,9 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
707
731
|
};
|
|
708
732
|
var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
709
733
|
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
734
|
+
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
|
|
735
|
+
leftVNode.$key$ = rightVNode.$key$;
|
|
736
|
+
}
|
|
710
737
|
return true;
|
|
711
738
|
}
|
|
712
739
|
return false;
|
|
@@ -753,8 +780,9 @@ var nullifyVNodeRefs = (vNode) => {
|
|
|
753
780
|
}
|
|
754
781
|
};
|
|
755
782
|
var insertBefore = (parent, newNode, reference) => {
|
|
756
|
-
|
|
757
|
-
|
|
783
|
+
{
|
|
784
|
+
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
785
|
+
}
|
|
758
786
|
};
|
|
759
787
|
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
760
788
|
const hostElm = hostRef.$hostElement$;
|
|
@@ -779,9 +807,6 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
779
807
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
780
808
|
hostRef.$vnode$ = rootVnode;
|
|
781
809
|
rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
|
|
782
|
-
{
|
|
783
|
-
scopeId = hostElm["s-sc"];
|
|
784
|
-
}
|
|
785
810
|
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
786
811
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
787
812
|
};
|
|
@@ -789,7 +814,14 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
789
814
|
// src/runtime/update-component.ts
|
|
790
815
|
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
791
816
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
792
|
-
ancestorComponent["s-p"].push(
|
|
817
|
+
const index = ancestorComponent["s-p"].push(
|
|
818
|
+
new Promise(
|
|
819
|
+
(r) => hostRef.$onRenderResolve$ = () => {
|
|
820
|
+
ancestorComponent["s-p"].splice(index - 1, 1);
|
|
821
|
+
r();
|
|
822
|
+
}
|
|
823
|
+
)
|
|
824
|
+
);
|
|
793
825
|
}
|
|
794
826
|
};
|
|
795
827
|
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
@@ -818,12 +850,12 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
818
850
|
{
|
|
819
851
|
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
820
852
|
if (hostRef.$queuedListeners$) {
|
|
821
|
-
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
853
|
+
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event, elm));
|
|
822
854
|
hostRef.$queuedListeners$ = void 0;
|
|
823
855
|
}
|
|
824
856
|
}
|
|
825
857
|
{
|
|
826
|
-
maybePromise = safeCall(instance, "componentWillLoad");
|
|
858
|
+
maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
|
|
827
859
|
}
|
|
828
860
|
}
|
|
829
861
|
endSchedule();
|
|
@@ -922,12 +954,12 @@ var appDidLoad = (who) => {
|
|
|
922
954
|
}
|
|
923
955
|
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
924
956
|
};
|
|
925
|
-
var safeCall = (instance, method, arg) => {
|
|
957
|
+
var safeCall = (instance, method, arg, elm) => {
|
|
926
958
|
if (instance && instance[method]) {
|
|
927
959
|
try {
|
|
928
960
|
return instance[method](arg);
|
|
929
961
|
} catch (e) {
|
|
930
|
-
consoleError(e);
|
|
962
|
+
consoleError(e, elm);
|
|
931
963
|
}
|
|
932
964
|
}
|
|
933
965
|
return void 0;
|
|
@@ -986,15 +1018,68 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
986
1018
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
987
1019
|
members.map(([memberName, [memberFlags]]) => {
|
|
988
1020
|
if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
1021
|
+
const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
|
|
1022
|
+
if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
|
|
1023
|
+
if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
|
|
1024
|
+
if (flags & 1 /* isElementConstructor */ || !origGetter) {
|
|
1025
|
+
Object.defineProperty(prototype, memberName, {
|
|
1026
|
+
get() {
|
|
1027
|
+
{
|
|
1028
|
+
if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
|
|
1029
|
+
return getValue(this, memberName);
|
|
1030
|
+
}
|
|
1031
|
+
const ref = getHostRef(this);
|
|
1032
|
+
const instance = ref ? ref.$lazyInstance$ : prototype;
|
|
1033
|
+
if (!instance) return;
|
|
1034
|
+
return instance[memberName];
|
|
1035
|
+
}
|
|
1036
|
+
},
|
|
1037
|
+
configurable: true,
|
|
1038
|
+
enumerable: true
|
|
1039
|
+
});
|
|
1040
|
+
}
|
|
989
1041
|
Object.defineProperty(prototype, memberName, {
|
|
990
|
-
get() {
|
|
991
|
-
return getValue(this, memberName);
|
|
992
|
-
},
|
|
993
1042
|
set(newValue) {
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
1043
|
+
const ref = getHostRef(this);
|
|
1044
|
+
if (origSetter) {
|
|
1045
|
+
const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
1046
|
+
if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
|
|
1047
|
+
newValue = ref.$instanceValues$.get(memberName);
|
|
1048
|
+
} else if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
1049
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
1050
|
+
}
|
|
1051
|
+
origSetter.apply(this, [parsePropertyValue(newValue, memberFlags)]);
|
|
1052
|
+
newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
1053
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
1054
|
+
return;
|
|
1055
|
+
}
|
|
1056
|
+
{
|
|
1057
|
+
if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
|
|
1058
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
1059
|
+
if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
|
|
1060
|
+
ref.$onReadyPromise$.then(() => {
|
|
1061
|
+
if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
|
|
1062
|
+
ref.$lazyInstance$[memberName] = newValue;
|
|
1063
|
+
}
|
|
1064
|
+
});
|
|
1065
|
+
}
|
|
1066
|
+
return;
|
|
1067
|
+
}
|
|
1068
|
+
const setterSetVal = () => {
|
|
1069
|
+
const currentValue = ref.$lazyInstance$[memberName];
|
|
1070
|
+
if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
1071
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
1072
|
+
}
|
|
1073
|
+
ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, memberFlags);
|
|
1074
|
+
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
|
|
1075
|
+
};
|
|
1076
|
+
if (ref.$lazyInstance$) {
|
|
1077
|
+
setterSetVal();
|
|
1078
|
+
} else {
|
|
1079
|
+
ref.$onReadyPromise$.then(() => setterSetVal());
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
998
1083
|
});
|
|
999
1084
|
}
|
|
1000
1085
|
});
|
|
@@ -1004,7 +1089,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1004
1089
|
plt.jmp(() => {
|
|
1005
1090
|
var _a2;
|
|
1006
1091
|
const propName = attrNameToPropName.get(attrName);
|
|
1007
|
-
if (this.hasOwnProperty(propName)) {
|
|
1092
|
+
if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
|
|
1008
1093
|
newValue = this[propName];
|
|
1009
1094
|
delete this[propName];
|
|
1010
1095
|
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
|
|
@@ -1024,7 +1109,11 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1024
1109
|
}
|
|
1025
1110
|
return;
|
|
1026
1111
|
}
|
|
1027
|
-
|
|
1112
|
+
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
1113
|
+
newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
|
|
1114
|
+
if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
|
|
1115
|
+
this[propName] = newValue;
|
|
1116
|
+
}
|
|
1028
1117
|
});
|
|
1029
1118
|
};
|
|
1030
1119
|
Cstr.observedAttributes = Array.from(
|
|
@@ -1051,9 +1140,8 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1051
1140
|
let Cstr;
|
|
1052
1141
|
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
1053
1142
|
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
const CstrImport = loadModule(cmpMeta);
|
|
1143
|
+
{
|
|
1144
|
+
const CstrImport = loadModule(cmpMeta, hostRef);
|
|
1057
1145
|
if (CstrImport && "then" in CstrImport) {
|
|
1058
1146
|
const endLoad = uniqueTime();
|
|
1059
1147
|
Cstr = await CstrImport;
|
|
@@ -1078,7 +1166,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1078
1166
|
try {
|
|
1079
1167
|
new Cstr(hostRef);
|
|
1080
1168
|
} catch (e) {
|
|
1081
|
-
consoleError(e);
|
|
1169
|
+
consoleError(e, elm);
|
|
1082
1170
|
}
|
|
1083
1171
|
{
|
|
1084
1172
|
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
@@ -1087,10 +1175,6 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1087
1175
|
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
1088
1176
|
}
|
|
1089
1177
|
endNewInstance();
|
|
1090
|
-
} else {
|
|
1091
|
-
Cstr = elm.constructor;
|
|
1092
|
-
const cmpTag = elm.localName;
|
|
1093
|
-
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
|
|
1094
1178
|
}
|
|
1095
1179
|
if (Cstr && Cstr.style) {
|
|
1096
1180
|
let style;
|
|
@@ -1113,7 +1197,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1113
1197
|
schedule();
|
|
1114
1198
|
}
|
|
1115
1199
|
};
|
|
1116
|
-
var fireConnectedCallback = (instance) => {
|
|
1200
|
+
var fireConnectedCallback = (instance, elm) => {
|
|
1117
1201
|
};
|
|
1118
1202
|
|
|
1119
1203
|
// src/runtime/connected-callback.ts
|
|
@@ -1154,7 +1238,7 @@ var connectedCallback = (elm) => {
|
|
|
1154
1238
|
endConnected();
|
|
1155
1239
|
}
|
|
1156
1240
|
};
|
|
1157
|
-
var disconnectInstance = (instance) => {
|
|
1241
|
+
var disconnectInstance = (instance, elm) => {
|
|
1158
1242
|
};
|
|
1159
1243
|
var disconnectedCallback = async (elm) => {
|
|
1160
1244
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
@@ -1169,6 +1253,12 @@ var disconnectedCallback = async (elm) => {
|
|
|
1169
1253
|
hostRef.$onReadyPromise$.then(() => disconnectInstance());
|
|
1170
1254
|
}
|
|
1171
1255
|
}
|
|
1256
|
+
if (rootAppliedStyles.has(elm)) {
|
|
1257
|
+
rootAppliedStyles.delete(elm);
|
|
1258
|
+
}
|
|
1259
|
+
if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
|
|
1260
|
+
rootAppliedStyles.delete(elm.shadowRoot);
|
|
1261
|
+
}
|
|
1172
1262
|
};
|
|
1173
1263
|
|
|
1174
1264
|
// src/runtime/bootstrap-lazy.ts
|
|
@@ -1253,6 +1343,13 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1253
1343
|
}
|
|
1254
1344
|
disconnectedCallback() {
|
|
1255
1345
|
plt.jmp(() => disconnectedCallback(this));
|
|
1346
|
+
plt.raf(() => {
|
|
1347
|
+
var _a3;
|
|
1348
|
+
const hostRef = getHostRef(this);
|
|
1349
|
+
if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
|
|
1350
|
+
delete hostRef.$vnode$.$elm$;
|
|
1351
|
+
}
|
|
1352
|
+
});
|
|
1256
1353
|
}
|
|
1257
1354
|
componentOnReady() {
|
|
1258
1355
|
return getHostRef(this).$onReadyPromise$;
|
|
@@ -1316,7 +1413,7 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
1316
1413
|
}
|
|
1317
1414
|
}
|
|
1318
1415
|
} catch (e) {
|
|
1319
|
-
consoleError(e);
|
|
1416
|
+
consoleError(e, hostRef.$hostElement$);
|
|
1320
1417
|
}
|
|
1321
1418
|
};
|
|
1322
1419
|
var hostListenerOpts = (flags) => supportsListenerOptions ? {
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const generalStories = require('./general-stories-
|
|
6
|
-
require('./index-
|
|
5
|
+
const generalStories = require('./general-stories-0ddaadb7.js');
|
|
6
|
+
require('./index-52216882.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
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-52216882.js');
|
|
6
6
|
const appGlobals = require('./app-globals-3a1e7e63.js');
|
|
7
7
|
|
|
8
8
|
const defineCustomElements = async (win, options) => {
|