@penn-libraries/web 0.3.0-dev.1 → 0.3.0-dev.3
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/app-globals-V2Kpy_OQ.js +8 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js.map +1 -0
- package/dist/cjs/{index-c5f988a8.js → index-B6Rjt_WH.js} +377 -260
- package/dist/cjs/index-B6Rjt_WH.js.map +1 -0
- package/dist/cjs/index.cjs.js +2 -3
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/loader.cjs.js +4 -5
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/pennlibs-banner.cjs.entry.js +3 -5
- package/dist/cjs/pennlibs-banner.cjs.entry.js.map +1 -1
- package/dist/cjs/pennlibs-banner.entry.cjs.js.map +1 -0
- package/dist/cjs/pennlibs-chat.pennlibs-feedback.pennlibs-footer.pennlibs-header.pennlibs-hero.entry.cjs.js.map +1 -0
- package/dist/cjs/pennlibs-chat_5.cjs.entry.js +245 -0
- package/dist/cjs/pennlibs-chat_5.cjs.entry.js.map +1 -0
- package/dist/cjs/pennlibs-colors.cjs.entry.js +3 -6
- package/dist/cjs/pennlibs-colors.cjs.entry.js.map +1 -1
- package/dist/cjs/pennlibs-colors.entry.cjs.js.map +1 -0
- package/dist/cjs/web.cjs.js +8 -7
- package/dist/cjs/web.cjs.js.map +1 -1
- package/dist/collection/collection-manifest.json +4 -3
- package/dist/collection/components/pennlibs-chat/pennlibs-chat.js.map +1 -1
- package/dist/collection/components/pennlibs-colors/pennlibs-colors.js +4 -4
- package/dist/collection/components/pennlibs-colors/pennlibs-colors.js.map +1 -1
- package/dist/collection/components/pennlibs-feedback/pennlibs-feedback.css +1 -1
- package/dist/collection/components/pennlibs-feedback/pennlibs-feedback.js.map +1 -1
- package/dist/collection/components/pennlibs-footer/pennlibs-footer.js +4 -5
- package/dist/collection/components/pennlibs-footer/pennlibs-footer.js.map +1 -1
- package/dist/collection/components/pennlibs-header/logo-blue.js +5 -0
- package/dist/collection/components/pennlibs-header/logo-blue.js.map +1 -0
- package/dist/collection/components/pennlibs-header/logo-white.js +5 -0
- package/dist/collection/components/pennlibs-header/logo-white.js.map +1 -0
- package/dist/collection/components/pennlibs-header/pennlibs-header.css +83 -40
- package/dist/collection/components/pennlibs-header/pennlibs-header.js +45 -22
- package/dist/collection/components/pennlibs-header/pennlibs-header.js.map +1 -1
- package/dist/collection/components/pennlibs-hero/pennlibs-hero.css +132 -0
- package/dist/collection/components/pennlibs-hero/pennlibs-hero.js +71 -0
- package/dist/collection/components/pennlibs-hero/pennlibs-hero.js.map +1 -0
- package/dist/components/index.d.ts +50 -0
- package/dist/components/index.js +11 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/pennlibs-banner.d.ts +11 -0
- package/dist/components/pennlibs-banner.js +38 -0
- package/dist/components/pennlibs-banner.js.map +1 -0
- package/dist/components/pennlibs-chat.d.ts +11 -0
- package/dist/components/pennlibs-chat.js +43 -0
- package/dist/components/pennlibs-chat.js.map +1 -0
- package/dist/components/pennlibs-colors.d.ts +11 -0
- package/dist/components/pennlibs-colors.js +38 -0
- package/dist/components/pennlibs-colors.js.map +1 -0
- package/dist/components/pennlibs-feedback.d.ts +11 -0
- package/dist/components/pennlibs-feedback.js +79 -0
- package/dist/components/pennlibs-feedback.js.map +1 -0
- package/dist/components/pennlibs-footer.d.ts +11 -0
- package/dist/components/pennlibs-footer.js +70 -0
- package/dist/components/pennlibs-footer.js.map +1 -0
- package/dist/components/pennlibs-header.d.ts +11 -0
- package/dist/components/pennlibs-header.js +98 -0
- package/dist/components/pennlibs-header.js.map +1 -0
- package/dist/components/pennlibs-hero.d.ts +11 -0
- package/dist/components/pennlibs-hero.js +83 -0
- package/dist/components/pennlibs-hero.js.map +1 -0
- package/dist/esm/app-globals-DQuL1Twl.js +6 -0
- package/dist/esm/app-globals-DQuL1Twl.js.map +1 -0
- package/dist/esm/{index-453c2e4e.js → index-BQRdy1TQ.js} +377 -240
- package/dist/esm/index-BQRdy1TQ.js.map +1 -0
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/loader.js +5 -4
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/pennlibs-banner.entry.js +3 -3
- package/dist/esm/pennlibs-banner.entry.js.map +1 -1
- package/dist/esm/pennlibs-chat.pennlibs-feedback.pennlibs-footer.pennlibs-header.pennlibs-hero.entry.js.map +1 -0
- package/dist/esm/pennlibs-chat_5.entry.js +239 -0
- package/dist/esm/pennlibs-chat_5.entry.js.map +1 -0
- package/dist/esm/pennlibs-colors.entry.js +3 -4
- package/dist/esm/pennlibs-colors.entry.js.map +1 -1
- package/dist/esm/web.js +7 -5
- package/dist/esm/web.js.map +1 -1
- package/dist/types/components/pennlibs-header/logo-blue.d.ts +2 -0
- package/dist/types/components/pennlibs-header/logo-white.d.ts +2 -0
- package/dist/types/components/pennlibs-header/pennlibs-header.d.ts +8 -4
- package/dist/types/components/pennlibs-hero/pennlibs-hero.d.ts +13 -0
- package/dist/types/components.d.ts +21 -0
- package/dist/types/stencil-public-runtime.d.ts +9 -0
- package/dist/web/index.esm.js +2 -1
- package/dist/web/index.esm.js.map +1 -1
- package/dist/web/loader.esm.js.map +1 -0
- package/dist/web/{p-9cf30789.entry.js → p-2edaa432.entry.js} +4 -5
- package/dist/web/p-2edaa432.entry.js.map +1 -0
- package/dist/web/{p-17fe1bcb.js → p-BQRdy1TQ.js} +377 -240
- package/dist/web/p-BQRdy1TQ.js.map +1 -0
- package/dist/web/p-DQuL1Twl.js +6 -0
- package/dist/web/p-DQuL1Twl.js.map +1 -0
- package/dist/web/p-a921fec4.entry.js +239 -0
- package/dist/web/p-a921fec4.entry.js.map +1 -0
- package/dist/web/{p-83eaa414.entry.js → p-dac033ee.entry.js} +4 -4
- package/dist/web/p-dac033ee.entry.js.map +1 -0
- package/dist/web/pennlibs-banner.entry.esm.js.map +1 -0
- package/dist/web/pennlibs-chat.pennlibs-feedback.pennlibs-footer.pennlibs-header.pennlibs-hero.entry.esm.js.map +1 -0
- package/dist/web/pennlibs-colors.entry.esm.js.map +1 -0
- package/dist/web/web.css +1 -0
- package/dist/web/web.esm.js +7 -5
- package/dist/web/web.esm.js.map +1 -1
- package/package.json +4 -4
- package/dist/cjs/app-globals-3a1e7e63.js +0 -7
- package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
- package/dist/cjs/index-c5f988a8.js.map +0 -1
- package/dist/cjs/pennlibs-chat_4.cjs.entry.js +0 -170
- package/dist/cjs/pennlibs-chat_4.cjs.entry.js.map +0 -1
- package/dist/esm/app-globals-0f993ce5.js +0 -5
- package/dist/esm/app-globals-0f993ce5.js.map +0 -1
- package/dist/esm/index-453c2e4e.js.map +0 -1
- package/dist/esm/pennlibs-chat_4.entry.js +0 -163
- package/dist/esm/pennlibs-chat_4.entry.js.map +0 -1
- package/dist/web/p-17fe1bcb.js.map +0 -1
- package/dist/web/p-83eaa414.entry.js.map +0 -1
- package/dist/web/p-88a9b822.entry.js +0 -163
- package/dist/web/p-88a9b822.entry.js.map +0 -1
- package/dist/web/p-9cf30789.entry.js.map +0 -1
- package/dist/web/p-e1255160.js +0 -5
- package/dist/web/p-e1255160.js.map +0 -1
- package/loader/package.json +0 -11
|
@@ -1,39 +1,32 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
function _interopNamespace(e) {
|
|
4
|
-
if (e && e.__esModule) return e;
|
|
5
|
-
var n = Object.create(null);
|
|
6
|
-
if (e) {
|
|
7
|
-
Object.keys(e).forEach(function (k) {
|
|
8
|
-
if (k !== 'default') {
|
|
9
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
10
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return e[k];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
n['default'] = e;
|
|
20
|
-
return Object.freeze(n);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
3
|
const NAMESPACE = 'web';
|
|
24
|
-
const BUILD = /* web */ {
|
|
4
|
+
const BUILD = /* web */ { hydratedSelectorName: "hydrated", lazyLoad: true, updatable: true, watchCallback: false };
|
|
25
5
|
|
|
26
6
|
/*
|
|
27
|
-
Stencil Client Platform v4.
|
|
7
|
+
Stencil Client Platform v4.29.3 | MIT Licensed | https://stenciljs.com
|
|
28
8
|
*/
|
|
29
9
|
var __defProp = Object.defineProperty;
|
|
30
10
|
var __export = (target, all) => {
|
|
31
11
|
for (var name in all)
|
|
32
12
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
33
13
|
};
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
var
|
|
14
|
+
|
|
15
|
+
// src/utils/constants.ts
|
|
16
|
+
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
17
|
+
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
18
|
+
|
|
19
|
+
// src/client/client-host-ref.ts
|
|
20
|
+
var getHostRef = (ref) => {
|
|
21
|
+
if (ref.__stencil__getHostRef) {
|
|
22
|
+
return ref.__stencil__getHostRef();
|
|
23
|
+
}
|
|
24
|
+
return void 0;
|
|
25
|
+
};
|
|
26
|
+
var registerInstance = (lazyInstance, hostRef) => {
|
|
27
|
+
lazyInstance.__stencil__getHostRef = () => hostRef;
|
|
28
|
+
hostRef.$lazyInstance$ = lazyInstance;
|
|
29
|
+
};
|
|
37
30
|
var registerHost = (hostElement, cmpMeta) => {
|
|
38
31
|
const hostRef = {
|
|
39
32
|
$flags$: 0,
|
|
@@ -46,7 +39,9 @@ var registerHost = (hostElement, cmpMeta) => {
|
|
|
46
39
|
hostElement["s-p"] = [];
|
|
47
40
|
hostElement["s-rc"] = [];
|
|
48
41
|
}
|
|
49
|
-
|
|
42
|
+
const ref = hostRef;
|
|
43
|
+
hostElement.__stencil__getHostRef = () => ref;
|
|
44
|
+
return ref;
|
|
50
45
|
};
|
|
51
46
|
var isMemberInElement = (elm, memberName) => memberName in elm;
|
|
52
47
|
var consoleError = (e, el) => (0, console.error)(e, el);
|
|
@@ -64,26 +59,31 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
64
59
|
return module[exportName];
|
|
65
60
|
}
|
|
66
61
|
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/
|
|
67
|
-
return
|
|
62
|
+
return import(
|
|
68
63
|
/* @vite-ignore */
|
|
69
64
|
/* webpackInclude: /\.entry\.js$/ */
|
|
70
65
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
71
66
|
/* webpackMode: "lazy" */
|
|
72
67
|
`./${bundleId}.entry.js${""}`
|
|
73
|
-
)
|
|
74
|
-
{
|
|
75
|
-
|
|
68
|
+
).then(
|
|
69
|
+
(importedModule) => {
|
|
70
|
+
{
|
|
71
|
+
cmpModules.set(bundleId, importedModule);
|
|
72
|
+
}
|
|
73
|
+
return importedModule[exportName];
|
|
74
|
+
},
|
|
75
|
+
(e) => {
|
|
76
|
+
consoleError(e, hostRef.$hostElement$);
|
|
76
77
|
}
|
|
77
|
-
|
|
78
|
-
}, consoleError);
|
|
78
|
+
);
|
|
79
79
|
};
|
|
80
80
|
|
|
81
81
|
// src/client/client-style.ts
|
|
82
82
|
var styles = /* @__PURE__ */ new Map();
|
|
83
|
+
var HYDRATED_STYLE_ID = "sty-id";
|
|
83
84
|
var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
|
|
84
85
|
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
|
85
86
|
var win = typeof window !== "undefined" ? window : {};
|
|
86
|
-
var doc = win.document || { head: {} };
|
|
87
87
|
var plt = {
|
|
88
88
|
$flags$: 0,
|
|
89
89
|
$resourcesUrl$: "",
|
|
@@ -93,22 +93,6 @@ var plt = {
|
|
|
93
93
|
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
94
94
|
ce: (eventName, opts) => new CustomEvent(eventName, opts)
|
|
95
95
|
};
|
|
96
|
-
var supportsListenerOptions = /* @__PURE__ */ (() => {
|
|
97
|
-
let supportsListenerOptions2 = false;
|
|
98
|
-
try {
|
|
99
|
-
doc.addEventListener(
|
|
100
|
-
"e",
|
|
101
|
-
null,
|
|
102
|
-
Object.defineProperty({}, "passive", {
|
|
103
|
-
get() {
|
|
104
|
-
supportsListenerOptions2 = true;
|
|
105
|
-
}
|
|
106
|
-
})
|
|
107
|
-
);
|
|
108
|
-
} catch (e) {
|
|
109
|
-
}
|
|
110
|
-
return supportsListenerOptions2;
|
|
111
|
-
})();
|
|
112
96
|
var promiseResolve = (v) => Promise.resolve(v);
|
|
113
97
|
var supportsConstructableStylesheets = /* @__PURE__ */ (() => {
|
|
114
98
|
try {
|
|
@@ -160,25 +144,22 @@ var getAssetPath = (path) => {
|
|
|
160
144
|
return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
|
|
161
145
|
};
|
|
162
146
|
var setAssetPath = (path) => plt.$resourcesUrl$ = path;
|
|
163
|
-
|
|
164
|
-
// src/utils/constants.ts
|
|
165
|
-
var EMPTY_OBJ = {};
|
|
166
|
-
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
167
|
-
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
168
|
-
|
|
169
|
-
// src/utils/helpers.ts
|
|
170
|
-
var isDef = (v) => v != null;
|
|
171
147
|
var isComplexType = (o) => {
|
|
172
148
|
o = typeof o;
|
|
173
149
|
return o === "object" || o === "function";
|
|
174
150
|
};
|
|
175
151
|
|
|
176
152
|
// src/utils/query-nonce-meta-tag-content.ts
|
|
177
|
-
function queryNonceMetaTagContent(
|
|
153
|
+
function queryNonceMetaTagContent(doc) {
|
|
178
154
|
var _a, _b, _c;
|
|
179
|
-
return (_c = (_b = (_a =
|
|
155
|
+
return (_c = (_b = (_a = doc.head) == null ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) == null ? void 0 : _b.getAttribute("content")) != null ? _c : void 0;
|
|
180
156
|
}
|
|
181
157
|
|
|
158
|
+
// src/utils/regular-expression.ts
|
|
159
|
+
var escapeRegExpSpecialCharacters = (text) => {
|
|
160
|
+
return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
161
|
+
};
|
|
162
|
+
|
|
182
163
|
// src/utils/result.ts
|
|
183
164
|
var result_exports = {};
|
|
184
165
|
__export(result_exports, {
|
|
@@ -277,6 +258,13 @@ var h = (nodeName, vnodeData, ...children) => {
|
|
|
277
258
|
}
|
|
278
259
|
}
|
|
279
260
|
}
|
|
261
|
+
if (typeof nodeName === "function") {
|
|
262
|
+
return nodeName(
|
|
263
|
+
vnodeData === null ? {} : vnodeData,
|
|
264
|
+
vNodeChildren,
|
|
265
|
+
vdomFnUtils
|
|
266
|
+
);
|
|
267
|
+
}
|
|
280
268
|
const vnode = newVNode(nodeName, null);
|
|
281
269
|
vnode.$attrs$ = vnodeData;
|
|
282
270
|
if (vNodeChildren.length > 0) {
|
|
@@ -305,6 +293,48 @@ var newVNode = (tag, text) => {
|
|
|
305
293
|
};
|
|
306
294
|
var Host = {};
|
|
307
295
|
var isHost = (node) => node && node.$tag$ === Host;
|
|
296
|
+
var vdomFnUtils = {
|
|
297
|
+
forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
|
|
298
|
+
map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate)
|
|
299
|
+
};
|
|
300
|
+
var convertToPublic = (node) => ({
|
|
301
|
+
vattrs: node.$attrs$,
|
|
302
|
+
vchildren: node.$children$,
|
|
303
|
+
vkey: node.$key$,
|
|
304
|
+
vname: node.$name$,
|
|
305
|
+
vtag: node.$tag$,
|
|
306
|
+
vtext: node.$text$
|
|
307
|
+
});
|
|
308
|
+
var convertToPrivate = (node) => {
|
|
309
|
+
if (typeof node.vtag === "function") {
|
|
310
|
+
const vnodeData = { ...node.vattrs };
|
|
311
|
+
if (node.vkey) {
|
|
312
|
+
vnodeData.key = node.vkey;
|
|
313
|
+
}
|
|
314
|
+
if (node.vname) {
|
|
315
|
+
vnodeData.name = node.vname;
|
|
316
|
+
}
|
|
317
|
+
return h(node.vtag, vnodeData, ...node.vchildren || []);
|
|
318
|
+
}
|
|
319
|
+
const vnode = newVNode(node.vtag, node.vtext);
|
|
320
|
+
vnode.$attrs$ = node.vattrs;
|
|
321
|
+
vnode.$children$ = node.vchildren;
|
|
322
|
+
vnode.$key$ = node.vkey;
|
|
323
|
+
vnode.$name$ = node.vname;
|
|
324
|
+
return vnode;
|
|
325
|
+
};
|
|
326
|
+
var createSupportsRuleRe = (selector) => {
|
|
327
|
+
const safeSelector2 = escapeRegExpSpecialCharacters(selector);
|
|
328
|
+
return new RegExp(
|
|
329
|
+
// First capture group: match any context before the selector that's not inside @supports selector()
|
|
330
|
+
// Using negative lookahead to avoid matching inside @supports selector(...) condition
|
|
331
|
+
`(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${safeSelector2}))(${safeSelector2}\\b)`,
|
|
332
|
+
"g"
|
|
333
|
+
);
|
|
334
|
+
};
|
|
335
|
+
createSupportsRuleRe("::slotted");
|
|
336
|
+
createSupportsRuleRe(":host");
|
|
337
|
+
createSupportsRuleRe(":host-context");
|
|
308
338
|
var parsePropertyValue = (propValue, propType) => {
|
|
309
339
|
if (propValue != null && !isComplexType(propValue)) {
|
|
310
340
|
if (propType & 1 /* String */) {
|
|
@@ -322,9 +352,9 @@ var createEvent = (ref, name, flags) => {
|
|
|
322
352
|
return {
|
|
323
353
|
emit: (detail) => {
|
|
324
354
|
return emitEvent(elm, name, {
|
|
325
|
-
bubbles:
|
|
326
|
-
composed:
|
|
327
|
-
cancelable:
|
|
355
|
+
bubbles: true,
|
|
356
|
+
composed: true,
|
|
357
|
+
cancelable: true,
|
|
328
358
|
detail
|
|
329
359
|
});
|
|
330
360
|
}
|
|
@@ -354,7 +384,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
354
384
|
var _a;
|
|
355
385
|
const scopeId2 = getScopeId(cmpMeta);
|
|
356
386
|
const style = styles.get(scopeId2);
|
|
357
|
-
|
|
387
|
+
if (!win.document) {
|
|
388
|
+
return scopeId2;
|
|
389
|
+
}
|
|
390
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
|
|
358
391
|
if (style) {
|
|
359
392
|
if (typeof style === "string") {
|
|
360
393
|
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
@@ -365,23 +398,39 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
365
398
|
}
|
|
366
399
|
if (!appliedStyles.has(scopeId2)) {
|
|
367
400
|
{
|
|
368
|
-
styleElm =
|
|
401
|
+
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || win.document.createElement("style");
|
|
369
402
|
styleElm.innerHTML = style;
|
|
370
|
-
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(
|
|
403
|
+
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
|
371
404
|
if (nonce != null) {
|
|
372
405
|
styleElm.setAttribute("nonce", nonce);
|
|
373
406
|
}
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
407
|
+
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
408
|
+
if (styleContainerNode.nodeName === "HEAD") {
|
|
409
|
+
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
410
|
+
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
411
|
+
styleContainerNode.insertBefore(
|
|
412
|
+
styleElm,
|
|
413
|
+
(referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
|
|
414
|
+
);
|
|
415
|
+
} else if ("host" in styleContainerNode) {
|
|
416
|
+
if (supportsConstructableStylesheets) {
|
|
417
|
+
const stylesheet = new CSSStyleSheet();
|
|
418
|
+
stylesheet.replaceSync(style);
|
|
419
|
+
styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
|
|
420
|
+
} else {
|
|
421
|
+
const existingStyleContainer = styleContainerNode.querySelector("style");
|
|
422
|
+
if (existingStyleContainer) {
|
|
423
|
+
existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
|
|
424
|
+
} else {
|
|
425
|
+
styleContainerNode.prepend(styleElm);
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
} else {
|
|
429
|
+
styleContainerNode.append(styleElm);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
433
|
+
styleContainerNode.insertBefore(styleElm, null);
|
|
385
434
|
}
|
|
386
435
|
}
|
|
387
436
|
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
@@ -405,117 +454,144 @@ var attachStyles = (hostRef) => {
|
|
|
405
454
|
const scopeId2 = addStyle(
|
|
406
455
|
elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
407
456
|
cmpMeta);
|
|
408
|
-
if (flags & 10 /* needsScopedEncapsulation */
|
|
457
|
+
if (flags & 10 /* needsScopedEncapsulation */) {
|
|
409
458
|
elm["s-sc"] = scopeId2;
|
|
410
459
|
elm.classList.add(scopeId2 + "-h");
|
|
411
460
|
}
|
|
412
461
|
endAttachStyles();
|
|
413
462
|
};
|
|
414
463
|
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
415
|
-
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
416
|
-
if (oldValue
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
464
|
+
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
|
|
465
|
+
if (oldValue === newValue) {
|
|
466
|
+
return;
|
|
467
|
+
}
|
|
468
|
+
let isProp = isMemberInElement(elm, memberName);
|
|
469
|
+
let ln = memberName.toLowerCase();
|
|
470
|
+
if (memberName === "class") {
|
|
471
|
+
const classList = elm.classList;
|
|
472
|
+
const oldClasses = parseClassList(oldValue);
|
|
473
|
+
let newClasses = parseClassList(newValue);
|
|
474
|
+
{
|
|
423
475
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
424
476
|
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
elm.style.removeProperty(prop);
|
|
431
|
-
} else {
|
|
432
|
-
elm.style[prop] = "";
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
for (const prop in newValue) {
|
|
438
|
-
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
477
|
+
}
|
|
478
|
+
} else if (memberName === "style") {
|
|
479
|
+
{
|
|
480
|
+
for (const prop in oldValue) {
|
|
481
|
+
if (!newValue || newValue[prop] == null) {
|
|
439
482
|
if (prop.includes("-")) {
|
|
440
|
-
elm.style.
|
|
483
|
+
elm.style.removeProperty(prop);
|
|
441
484
|
} else {
|
|
442
|
-
elm.style[prop] =
|
|
485
|
+
elm.style[prop] = "";
|
|
443
486
|
}
|
|
444
487
|
}
|
|
445
488
|
}
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
} else if (isMemberInElement(win, ln)) {
|
|
454
|
-
memberName = ln.slice(2);
|
|
455
|
-
} else {
|
|
456
|
-
memberName = ln[2] + memberName.slice(3);
|
|
457
|
-
}
|
|
458
|
-
if (oldValue || newValue) {
|
|
459
|
-
const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
|
|
460
|
-
memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
|
|
461
|
-
if (oldValue) {
|
|
462
|
-
plt.rel(elm, memberName, oldValue, capture);
|
|
463
|
-
}
|
|
464
|
-
if (newValue) {
|
|
465
|
-
plt.ael(elm, memberName, newValue, capture);
|
|
489
|
+
}
|
|
490
|
+
for (const prop in newValue) {
|
|
491
|
+
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
492
|
+
if (prop.includes("-")) {
|
|
493
|
+
elm.style.setProperty(prop, newValue[prop]);
|
|
494
|
+
} else {
|
|
495
|
+
elm.style[prop] = newValue[prop];
|
|
466
496
|
}
|
|
467
497
|
}
|
|
498
|
+
}
|
|
499
|
+
} else if (memberName === "key") ; else if (memberName === "ref") {
|
|
500
|
+
if (newValue) {
|
|
501
|
+
newValue(elm);
|
|
502
|
+
}
|
|
503
|
+
} else if ((!isProp ) && memberName[0] === "o" && memberName[1] === "n") {
|
|
504
|
+
if (memberName[2] === "-") {
|
|
505
|
+
memberName = memberName.slice(3);
|
|
506
|
+
} else if (isMemberInElement(win, ln)) {
|
|
507
|
+
memberName = ln.slice(2);
|
|
468
508
|
} else {
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
509
|
+
memberName = ln[2] + memberName.slice(3);
|
|
510
|
+
}
|
|
511
|
+
if (oldValue || newValue) {
|
|
512
|
+
const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
|
|
513
|
+
memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
|
|
514
|
+
if (oldValue) {
|
|
515
|
+
plt.rel(elm, memberName, oldValue, capture);
|
|
516
|
+
}
|
|
517
|
+
if (newValue) {
|
|
518
|
+
plt.ael(elm, memberName, newValue, capture);
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
} else {
|
|
522
|
+
const isComplex = isComplexType(newValue);
|
|
523
|
+
if ((isProp || isComplex && newValue !== null) && !isSvg) {
|
|
524
|
+
try {
|
|
525
|
+
if (!elm.tagName.includes("-")) {
|
|
526
|
+
const n = newValue == null ? "" : newValue;
|
|
527
|
+
if (memberName === "list") {
|
|
528
|
+
isProp = false;
|
|
529
|
+
} else if (oldValue == null || elm[memberName] != n) {
|
|
530
|
+
if (typeof elm.__lookupSetter__(memberName) === "function") {
|
|
477
531
|
elm[memberName] = n;
|
|
532
|
+
} else {
|
|
533
|
+
elm.setAttribute(memberName, n);
|
|
478
534
|
}
|
|
479
|
-
} else {
|
|
480
|
-
elm[memberName] = newValue;
|
|
481
535
|
}
|
|
482
|
-
}
|
|
536
|
+
} else if (elm[memberName] !== newValue) {
|
|
537
|
+
elm[memberName] = newValue;
|
|
483
538
|
}
|
|
539
|
+
} catch (e) {
|
|
484
540
|
}
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
elm.removeAttribute(memberName);
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
492
|
-
newValue = newValue === true ? "" : newValue;
|
|
541
|
+
}
|
|
542
|
+
if (newValue == null || newValue === false) {
|
|
543
|
+
if (newValue !== false || elm.getAttribute(memberName) === "") {
|
|
493
544
|
{
|
|
494
|
-
elm.
|
|
545
|
+
elm.removeAttribute(memberName);
|
|
495
546
|
}
|
|
496
547
|
}
|
|
548
|
+
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex && elm.nodeType === 1 /* ElementNode */) {
|
|
549
|
+
newValue = newValue === true ? "" : newValue;
|
|
550
|
+
{
|
|
551
|
+
elm.setAttribute(memberName, newValue);
|
|
552
|
+
}
|
|
497
553
|
}
|
|
498
554
|
}
|
|
499
555
|
};
|
|
500
556
|
var parseClassListRegex = /\s/;
|
|
501
|
-
var parseClassList = (value) =>
|
|
557
|
+
var parseClassList = (value) => {
|
|
558
|
+
if (typeof value === "object" && value && "baseVal" in value) {
|
|
559
|
+
value = value.baseVal;
|
|
560
|
+
}
|
|
561
|
+
if (!value || typeof value !== "string") {
|
|
562
|
+
return [];
|
|
563
|
+
}
|
|
564
|
+
return value.split(parseClassListRegex);
|
|
565
|
+
};
|
|
502
566
|
var CAPTURE_EVENT_SUFFIX = "Capture";
|
|
503
567
|
var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
|
|
504
568
|
|
|
505
569
|
// src/runtime/vdom/update-element.ts
|
|
506
|
-
var updateElement = (oldVnode, newVnode, isSvgMode2) => {
|
|
570
|
+
var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
|
|
507
571
|
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
508
|
-
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ ||
|
|
509
|
-
const newVnodeAttrs = newVnode.$attrs$ ||
|
|
572
|
+
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
|
|
573
|
+
const newVnodeAttrs = newVnode.$attrs$ || {};
|
|
510
574
|
{
|
|
511
575
|
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
512
576
|
if (!(memberName in newVnodeAttrs)) {
|
|
513
|
-
setAccessor(
|
|
577
|
+
setAccessor(
|
|
578
|
+
elm,
|
|
579
|
+
memberName,
|
|
580
|
+
oldVnodeAttrs[memberName],
|
|
581
|
+
void 0,
|
|
582
|
+
isSvgMode2,
|
|
583
|
+
newVnode.$flags$);
|
|
514
584
|
}
|
|
515
585
|
}
|
|
516
586
|
}
|
|
517
587
|
for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
|
|
518
|
-
setAccessor(
|
|
588
|
+
setAccessor(
|
|
589
|
+
elm,
|
|
590
|
+
memberName,
|
|
591
|
+
oldVnodeAttrs[memberName],
|
|
592
|
+
newVnodeAttrs[memberName],
|
|
593
|
+
isSvgMode2,
|
|
594
|
+
newVnode.$flags$);
|
|
519
595
|
}
|
|
520
596
|
};
|
|
521
597
|
function sortedAttrNames(attrNames) {
|
|
@@ -527,26 +603,27 @@ function sortedAttrNames(attrNames) {
|
|
|
527
603
|
attrNames
|
|
528
604
|
);
|
|
529
605
|
}
|
|
530
|
-
|
|
531
|
-
// src/runtime/vdom/vdom-render.ts
|
|
532
|
-
var scopeId;
|
|
533
606
|
var hostTagName;
|
|
534
|
-
var useNativeShadowDom = false;
|
|
535
607
|
var isSvgMode = false;
|
|
536
|
-
var createElm = (oldParentVNode, newParentVNode, childIndex
|
|
608
|
+
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
537
609
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
538
610
|
let i2 = 0;
|
|
539
611
|
let elm;
|
|
540
612
|
let childNode;
|
|
541
613
|
if (newVNode2.$text$ !== null) {
|
|
542
|
-
elm = newVNode2.$elm$ =
|
|
614
|
+
elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);
|
|
543
615
|
} else {
|
|
544
616
|
if (!isSvgMode) {
|
|
545
617
|
isSvgMode = newVNode2.$tag$ === "svg";
|
|
546
618
|
}
|
|
547
|
-
|
|
619
|
+
if (!win.document) {
|
|
620
|
+
throw new Error(
|
|
621
|
+
"You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component."
|
|
622
|
+
);
|
|
623
|
+
}
|
|
624
|
+
elm = newVNode2.$elm$ = win.document.createElementNS(
|
|
548
625
|
isSvgMode ? SVG_NS : HTML_NS,
|
|
549
|
-
|
|
626
|
+
newVNode2.$tag$
|
|
550
627
|
) ;
|
|
551
628
|
if (isSvgMode && newVNode2.$tag$ === "foreignObject") {
|
|
552
629
|
isSvgMode = false;
|
|
@@ -554,11 +631,6 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
554
631
|
{
|
|
555
632
|
updateElement(null, newVNode2, isSvgMode);
|
|
556
633
|
}
|
|
557
|
-
const rootNode = elm.getRootNode();
|
|
558
|
-
const isElementWithinShadowRoot = !rootNode.querySelector("body");
|
|
559
|
-
if (!isElementWithinShadowRoot && BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
560
|
-
elm.classList.add(elm["s-si"] = scopeId);
|
|
561
|
-
}
|
|
562
634
|
if (newVNode2.$children$) {
|
|
563
635
|
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
564
636
|
childNode = createElm(oldParentVNode, newVNode2, i2);
|
|
@@ -695,6 +767,9 @@ var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
|
695
767
|
if (!isInitialRender) {
|
|
696
768
|
return leftVNode.$key$ === rightVNode.$key$;
|
|
697
769
|
}
|
|
770
|
+
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
|
|
771
|
+
leftVNode.$key$ = rightVNode.$key$;
|
|
772
|
+
}
|
|
698
773
|
return true;
|
|
699
774
|
}
|
|
700
775
|
return false;
|
|
@@ -710,9 +785,7 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
710
785
|
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
|
711
786
|
}
|
|
712
787
|
{
|
|
713
|
-
|
|
714
|
-
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
715
|
-
}
|
|
788
|
+
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
716
789
|
}
|
|
717
790
|
if (oldChildren !== null && newChildren !== null) {
|
|
718
791
|
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
|
|
@@ -741,14 +814,15 @@ var nullifyVNodeRefs = (vNode) => {
|
|
|
741
814
|
}
|
|
742
815
|
};
|
|
743
816
|
var insertBefore = (parent, newNode, reference) => {
|
|
744
|
-
|
|
745
|
-
|
|
817
|
+
{
|
|
818
|
+
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
819
|
+
}
|
|
746
820
|
};
|
|
747
821
|
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
748
822
|
const hostElm = hostRef.$hostElement$;
|
|
749
|
-
const cmpMeta = hostRef.$cmpMeta$;
|
|
750
823
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
751
|
-
const
|
|
824
|
+
const isHostElement = isHost(renderFnResults);
|
|
825
|
+
const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
|
|
752
826
|
hostTagName = hostElm.tagName;
|
|
753
827
|
if (isInitialLoad && rootVnode.$attrs$) {
|
|
754
828
|
for (const key of Object.keys(rootVnode.$attrs$)) {
|
|
@@ -761,17 +835,20 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
761
835
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
762
836
|
hostRef.$vnode$ = rootVnode;
|
|
763
837
|
rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
|
|
764
|
-
{
|
|
765
|
-
scopeId = hostElm["s-sc"];
|
|
766
|
-
}
|
|
767
|
-
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
768
838
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
769
839
|
};
|
|
770
840
|
|
|
771
841
|
// src/runtime/update-component.ts
|
|
772
842
|
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
773
843
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
774
|
-
ancestorComponent["s-p"].push(
|
|
844
|
+
const index = ancestorComponent["s-p"].push(
|
|
845
|
+
new Promise(
|
|
846
|
+
(r) => hostRef.$onRenderResolve$ = () => {
|
|
847
|
+
ancestorComponent["s-p"].splice(index - 1, 1);
|
|
848
|
+
r();
|
|
849
|
+
}
|
|
850
|
+
)
|
|
851
|
+
);
|
|
775
852
|
}
|
|
776
853
|
};
|
|
777
854
|
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
@@ -797,17 +874,11 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
797
874
|
}
|
|
798
875
|
let maybePromise;
|
|
799
876
|
if (isInitialLoad) {
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
804
|
-
hostRef.$queuedListeners$ = void 0;
|
|
805
|
-
}
|
|
806
|
-
}
|
|
807
|
-
{
|
|
808
|
-
maybePromise = safeCall(instance, "componentWillLoad");
|
|
809
|
-
}
|
|
877
|
+
maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
|
|
878
|
+
} else {
|
|
879
|
+
maybePromise = safeCall(instance, "componentWillUpdate", void 0, elm);
|
|
810
880
|
}
|
|
881
|
+
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
|
|
811
882
|
endSchedule();
|
|
812
883
|
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
813
884
|
};
|
|
@@ -850,7 +921,7 @@ var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
|
850
921
|
try {
|
|
851
922
|
instance = instance.render() ;
|
|
852
923
|
{
|
|
853
|
-
hostRef.$flags$ &=
|
|
924
|
+
hostRef.$flags$ &= -17 /* isQueuedForUpdate */;
|
|
854
925
|
}
|
|
855
926
|
{
|
|
856
927
|
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
@@ -873,14 +944,13 @@ var postUpdateComponent = (hostRef) => {
|
|
|
873
944
|
const endPostUpdate = createTime("postUpdate", tagName);
|
|
874
945
|
const instance = hostRef.$lazyInstance$ ;
|
|
875
946
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
876
|
-
|
|
877
|
-
safeCall(instance, "componentDidRender");
|
|
878
|
-
}
|
|
947
|
+
safeCall(instance, "componentDidRender", void 0, elm);
|
|
879
948
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
880
949
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
881
950
|
{
|
|
882
951
|
addHydratedFlag(elm);
|
|
883
952
|
}
|
|
953
|
+
safeCall(instance, "componentDidLoad", void 0, elm);
|
|
884
954
|
endPostUpdate();
|
|
885
955
|
{
|
|
886
956
|
hostRef.$onReadyResolve$(elm);
|
|
@@ -889,6 +959,7 @@ var postUpdateComponent = (hostRef) => {
|
|
|
889
959
|
}
|
|
890
960
|
}
|
|
891
961
|
} else {
|
|
962
|
+
safeCall(instance, "componentDidUpdate", void 0, elm);
|
|
892
963
|
endPostUpdate();
|
|
893
964
|
}
|
|
894
965
|
{
|
|
@@ -899,21 +970,18 @@ var postUpdateComponent = (hostRef) => {
|
|
|
899
970
|
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
|
900
971
|
nextTick(() => scheduleUpdate(hostRef, false));
|
|
901
972
|
}
|
|
902
|
-
hostRef.$flags$ &=
|
|
973
|
+
hostRef.$flags$ &= -517;
|
|
903
974
|
}
|
|
904
975
|
};
|
|
905
976
|
var appDidLoad = (who) => {
|
|
906
|
-
{
|
|
907
|
-
addHydratedFlag(doc.documentElement);
|
|
908
|
-
}
|
|
909
977
|
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
910
978
|
};
|
|
911
|
-
var safeCall = (instance, method, arg) => {
|
|
979
|
+
var safeCall = (instance, method, arg, elm) => {
|
|
912
980
|
if (instance && instance[method]) {
|
|
913
981
|
try {
|
|
914
982
|
return instance[method](arg);
|
|
915
983
|
} catch (e) {
|
|
916
|
-
consoleError(e);
|
|
984
|
+
consoleError(e, elm);
|
|
917
985
|
}
|
|
918
986
|
}
|
|
919
987
|
return void 0;
|
|
@@ -929,7 +997,7 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
929
997
|
const hostRef = getHostRef(ref);
|
|
930
998
|
if (!hostRef) {
|
|
931
999
|
throw new Error(
|
|
932
|
-
`Couldn't find host element for "${cmpMeta.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/
|
|
1000
|
+
`Couldn't find host element for "${cmpMeta.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`
|
|
933
1001
|
);
|
|
934
1002
|
}
|
|
935
1003
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
@@ -942,6 +1010,11 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
942
1010
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
943
1011
|
if (instance) {
|
|
944
1012
|
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
1013
|
+
if (instance.componentShouldUpdate) {
|
|
1014
|
+
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
|
1015
|
+
return;
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
945
1018
|
scheduleUpdate(hostRef, false);
|
|
946
1019
|
}
|
|
947
1020
|
}
|
|
@@ -952,19 +1025,72 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
952
1025
|
var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
953
1026
|
var _a, _b;
|
|
954
1027
|
const prototype = Cstr.prototype;
|
|
955
|
-
if (cmpMeta.$members$ || BUILD.watchCallback
|
|
1028
|
+
if (cmpMeta.$members$ || BUILD.watchCallback) {
|
|
956
1029
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
957
1030
|
members.map(([memberName, [memberFlags]]) => {
|
|
958
1031
|
if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
1032
|
+
const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
|
|
1033
|
+
if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
|
|
1034
|
+
if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
|
|
1035
|
+
if (flags & 1 /* isElementConstructor */ || !origGetter) {
|
|
1036
|
+
Object.defineProperty(prototype, memberName, {
|
|
1037
|
+
get() {
|
|
1038
|
+
{
|
|
1039
|
+
if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
|
|
1040
|
+
return getValue(this, memberName);
|
|
1041
|
+
}
|
|
1042
|
+
const ref = getHostRef(this);
|
|
1043
|
+
const instance = ref ? ref.$lazyInstance$ : prototype;
|
|
1044
|
+
if (!instance) return;
|
|
1045
|
+
return instance[memberName];
|
|
1046
|
+
}
|
|
1047
|
+
},
|
|
1048
|
+
configurable: true,
|
|
1049
|
+
enumerable: true
|
|
1050
|
+
});
|
|
1051
|
+
}
|
|
959
1052
|
Object.defineProperty(prototype, memberName, {
|
|
960
|
-
get() {
|
|
961
|
-
return getValue(this, memberName);
|
|
962
|
-
},
|
|
963
1053
|
set(newValue) {
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
1054
|
+
const ref = getHostRef(this);
|
|
1055
|
+
if (origSetter) {
|
|
1056
|
+
const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
1057
|
+
if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
|
|
1058
|
+
newValue = ref.$instanceValues$.get(memberName);
|
|
1059
|
+
} else if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
1060
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
1061
|
+
}
|
|
1062
|
+
origSetter.apply(this, [parsePropertyValue(newValue, memberFlags)]);
|
|
1063
|
+
newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
1064
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
1065
|
+
return;
|
|
1066
|
+
}
|
|
1067
|
+
{
|
|
1068
|
+
if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
|
|
1069
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
1070
|
+
if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
|
|
1071
|
+
ref.$onReadyPromise$.then(() => {
|
|
1072
|
+
if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
|
|
1073
|
+
ref.$lazyInstance$[memberName] = newValue;
|
|
1074
|
+
}
|
|
1075
|
+
});
|
|
1076
|
+
}
|
|
1077
|
+
return;
|
|
1078
|
+
}
|
|
1079
|
+
const setterSetVal = () => {
|
|
1080
|
+
const currentValue = ref.$lazyInstance$[memberName];
|
|
1081
|
+
if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
1082
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
1083
|
+
}
|
|
1084
|
+
ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, memberFlags);
|
|
1085
|
+
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
|
|
1086
|
+
};
|
|
1087
|
+
if (ref.$lazyInstance$) {
|
|
1088
|
+
setterSetVal();
|
|
1089
|
+
} else {
|
|
1090
|
+
ref.$onReadyPromise$.then(() => setterSetVal());
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
968
1094
|
});
|
|
969
1095
|
}
|
|
970
1096
|
});
|
|
@@ -974,7 +1100,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
974
1100
|
plt.jmp(() => {
|
|
975
1101
|
var _a2;
|
|
976
1102
|
const propName = attrNameToPropName.get(attrName);
|
|
977
|
-
if (this.hasOwnProperty(propName)) {
|
|
1103
|
+
if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
|
|
978
1104
|
newValue = this[propName];
|
|
979
1105
|
delete this[propName];
|
|
980
1106
|
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
|
|
@@ -994,7 +1120,11 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
994
1120
|
}
|
|
995
1121
|
return;
|
|
996
1122
|
}
|
|
997
|
-
|
|
1123
|
+
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
1124
|
+
newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
|
|
1125
|
+
if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
|
|
1126
|
+
this[propName] = newValue;
|
|
1127
|
+
}
|
|
998
1128
|
});
|
|
999
1129
|
};
|
|
1000
1130
|
Cstr.observedAttributes = Array.from(
|
|
@@ -1019,7 +1149,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1019
1149
|
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
1020
1150
|
const bundleId = cmpMeta.$lazyBundleId$;
|
|
1021
1151
|
if (bundleId) {
|
|
1022
|
-
const CstrImport = loadModule(cmpMeta);
|
|
1152
|
+
const CstrImport = loadModule(cmpMeta, hostRef);
|
|
1023
1153
|
if (CstrImport && "then" in CstrImport) {
|
|
1024
1154
|
const endLoad = uniqueTime();
|
|
1025
1155
|
Cstr = await CstrImport;
|
|
@@ -1041,13 +1171,13 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1041
1171
|
try {
|
|
1042
1172
|
new Cstr(hostRef);
|
|
1043
1173
|
} catch (e) {
|
|
1044
|
-
consoleError(e);
|
|
1174
|
+
consoleError(e, elm);
|
|
1045
1175
|
}
|
|
1046
1176
|
{
|
|
1047
|
-
hostRef.$flags$ &=
|
|
1177
|
+
hostRef.$flags$ &= -9 /* isConstructingInstance */;
|
|
1048
1178
|
}
|
|
1049
1179
|
endNewInstance();
|
|
1050
|
-
fireConnectedCallback(hostRef.$lazyInstance
|
|
1180
|
+
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
1051
1181
|
} else {
|
|
1052
1182
|
Cstr = elm.constructor;
|
|
1053
1183
|
const cmpTag = elm.localName;
|
|
@@ -1074,9 +1204,9 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1074
1204
|
schedule();
|
|
1075
1205
|
}
|
|
1076
1206
|
};
|
|
1077
|
-
var fireConnectedCallback = (instance) => {
|
|
1207
|
+
var fireConnectedCallback = (instance, elm) => {
|
|
1078
1208
|
{
|
|
1079
|
-
safeCall(instance, "connectedCallback");
|
|
1209
|
+
safeCall(instance, "connectedCallback", void 0, elm);
|
|
1080
1210
|
}
|
|
1081
1211
|
};
|
|
1082
1212
|
|
|
@@ -1110,48 +1240,56 @@ var connectedCallback = (elm) => {
|
|
|
1110
1240
|
initializeComponent(elm, hostRef, cmpMeta);
|
|
1111
1241
|
}
|
|
1112
1242
|
} else {
|
|
1113
|
-
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
1114
1243
|
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
1115
|
-
fireConnectedCallback(hostRef.$lazyInstance
|
|
1244
|
+
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
1116
1245
|
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
1117
|
-
hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance
|
|
1246
|
+
hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
|
|
1118
1247
|
}
|
|
1119
1248
|
}
|
|
1120
1249
|
endConnected();
|
|
1121
1250
|
}
|
|
1122
1251
|
};
|
|
1123
|
-
var disconnectInstance = (instance) => {
|
|
1252
|
+
var disconnectInstance = (instance, elm) => {
|
|
1253
|
+
{
|
|
1254
|
+
safeCall(instance, "disconnectedCallback", void 0, elm || instance);
|
|
1255
|
+
}
|
|
1124
1256
|
};
|
|
1125
1257
|
var disconnectedCallback = async (elm) => {
|
|
1126
1258
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1127
1259
|
const hostRef = getHostRef(elm);
|
|
1128
|
-
{
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
}
|
|
1133
|
-
}
|
|
1134
|
-
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) ; else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
1135
|
-
hostRef.$onReadyPromise$.then(() => disconnectInstance());
|
|
1260
|
+
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
1261
|
+
disconnectInstance(hostRef.$lazyInstance$, elm);
|
|
1262
|
+
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
1263
|
+
hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$, elm));
|
|
1136
1264
|
}
|
|
1137
1265
|
}
|
|
1266
|
+
if (rootAppliedStyles.has(elm)) {
|
|
1267
|
+
rootAppliedStyles.delete(elm);
|
|
1268
|
+
}
|
|
1269
|
+
if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
|
|
1270
|
+
rootAppliedStyles.delete(elm.shadowRoot);
|
|
1271
|
+
}
|
|
1138
1272
|
};
|
|
1139
1273
|
|
|
1140
1274
|
// src/runtime/bootstrap-lazy.ts
|
|
1141
1275
|
var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1142
1276
|
var _a;
|
|
1277
|
+
if (!win.document) {
|
|
1278
|
+
console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");
|
|
1279
|
+
return;
|
|
1280
|
+
}
|
|
1143
1281
|
const endBootstrap = createTime();
|
|
1144
1282
|
const cmpTags = [];
|
|
1145
1283
|
const exclude = options.exclude || [];
|
|
1146
1284
|
const customElements2 = win.customElements;
|
|
1147
|
-
const head =
|
|
1285
|
+
const head = win.document.head;
|
|
1148
1286
|
const metaCharset = /* @__PURE__ */ head.querySelector("meta[charset]");
|
|
1149
|
-
const dataStyles = /* @__PURE__ */
|
|
1287
|
+
const dataStyles = /* @__PURE__ */ win.document.createElement("style");
|
|
1150
1288
|
const deferredConnectedCallbacks = [];
|
|
1151
1289
|
let appLoadFallback;
|
|
1152
1290
|
let isBootstrapping = true;
|
|
1153
1291
|
Object.assign(plt, options);
|
|
1154
|
-
plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./",
|
|
1292
|
+
plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", win.document.baseURI).href;
|
|
1155
1293
|
let hasSlotRelocation = false;
|
|
1156
1294
|
lazyBundles.map((lazyBundle) => {
|
|
1157
1295
|
lazyBundle[1].map((compactMeta) => {
|
|
@@ -1167,9 +1305,6 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1167
1305
|
{
|
|
1168
1306
|
cmpMeta.$members$ = compactMeta[2];
|
|
1169
1307
|
}
|
|
1170
|
-
{
|
|
1171
|
-
cmpMeta.$listeners$ = compactMeta[3];
|
|
1172
|
-
}
|
|
1173
1308
|
const tagName = cmpMeta.$tagName$;
|
|
1174
1309
|
const HostElement = class extends HTMLElement {
|
|
1175
1310
|
// StencilLazyHost
|
|
@@ -1195,10 +1330,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1195
1330
|
}
|
|
1196
1331
|
}
|
|
1197
1332
|
connectedCallback() {
|
|
1198
|
-
|
|
1333
|
+
getHostRef(this);
|
|
1199
1334
|
if (!this.hasRegisteredEventListeners) {
|
|
1200
1335
|
this.hasRegisteredEventListeners = true;
|
|
1201
|
-
addHostEventListeners(this, hostRef, cmpMeta.$listeners$);
|
|
1202
1336
|
}
|
|
1203
1337
|
if (appLoadFallback) {
|
|
1204
1338
|
clearTimeout(appLoadFallback);
|
|
@@ -1212,6 +1346,17 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1212
1346
|
}
|
|
1213
1347
|
disconnectedCallback() {
|
|
1214
1348
|
plt.jmp(() => disconnectedCallback(this));
|
|
1349
|
+
plt.raf(() => {
|
|
1350
|
+
var _a3;
|
|
1351
|
+
const hostRef = getHostRef(this);
|
|
1352
|
+
const i2 = deferredConnectedCallbacks.findIndex((host) => host === this);
|
|
1353
|
+
if (i2 > -1) {
|
|
1354
|
+
deferredConnectedCallbacks.splice(i2, 1);
|
|
1355
|
+
}
|
|
1356
|
+
if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
|
|
1357
|
+
delete hostRef.$vnode$.$elm$;
|
|
1358
|
+
}
|
|
1359
|
+
});
|
|
1215
1360
|
}
|
|
1216
1361
|
componentOnReady() {
|
|
1217
1362
|
return getHostRef(this).$onReadyPromise$;
|
|
@@ -1236,7 +1381,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1236
1381
|
}
|
|
1237
1382
|
if (dataStyles.innerHTML.length) {
|
|
1238
1383
|
dataStyles.setAttribute("data-styles", "");
|
|
1239
|
-
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(
|
|
1384
|
+
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
|
1240
1385
|
if (nonce != null) {
|
|
1241
1386
|
dataStyles.setAttribute("nonce", nonce);
|
|
1242
1387
|
}
|
|
@@ -1253,35 +1398,6 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1253
1398
|
}
|
|
1254
1399
|
endBootstrap();
|
|
1255
1400
|
};
|
|
1256
|
-
var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
1257
|
-
if (listeners) {
|
|
1258
|
-
listeners.map(([flags, name, method]) => {
|
|
1259
|
-
const target = elm;
|
|
1260
|
-
const handler = hostListenerProxy(hostRef, method);
|
|
1261
|
-
const opts = hostListenerOpts(flags);
|
|
1262
|
-
plt.ael(target, name, handler, opts);
|
|
1263
|
-
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
1264
|
-
});
|
|
1265
|
-
}
|
|
1266
|
-
};
|
|
1267
|
-
var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
1268
|
-
var _a;
|
|
1269
|
-
try {
|
|
1270
|
-
{
|
|
1271
|
-
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
1272
|
-
(_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev);
|
|
1273
|
-
} else {
|
|
1274
|
-
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
1275
|
-
}
|
|
1276
|
-
}
|
|
1277
|
-
} catch (e) {
|
|
1278
|
-
consoleError(e);
|
|
1279
|
-
}
|
|
1280
|
-
};
|
|
1281
|
-
var hostListenerOpts = (flags) => supportsListenerOptions ? {
|
|
1282
|
-
passive: (flags & 1 /* Passive */) !== 0,
|
|
1283
|
-
capture: (flags & 2 /* Capture */) !== 0
|
|
1284
|
-
} : (flags & 2 /* Capture */) !== 0;
|
|
1285
1401
|
|
|
1286
1402
|
// src/runtime/nonce.ts
|
|
1287
1403
|
var setNonce = (nonce) => plt.$nonce$ = nonce;
|
|
@@ -1295,5 +1411,6 @@ exports.promiseResolve = promiseResolve;
|
|
|
1295
1411
|
exports.registerInstance = registerInstance;
|
|
1296
1412
|
exports.setAssetPath = setAssetPath;
|
|
1297
1413
|
exports.setNonce = setNonce;
|
|
1414
|
+
//# sourceMappingURL=index-B6Rjt_WH.js.map
|
|
1298
1415
|
|
|
1299
|
-
//# sourceMappingURL=index-
|
|
1416
|
+
//# sourceMappingURL=index-B6Rjt_WH.js.map
|