@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,17 +1,30 @@
|
|
|
1
1
|
const NAMESPACE = 'web';
|
|
2
|
-
const BUILD = /* web */ {
|
|
2
|
+
const BUILD = /* web */ { hydratedSelectorName: "hydrated", lazyLoad: true, updatable: true, watchCallback: false };
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
|
-
Stencil Client Platform v4.
|
|
5
|
+
Stencil Client Platform v4.29.3 | MIT Licensed | https://stenciljs.com
|
|
6
6
|
*/
|
|
7
7
|
var __defProp = Object.defineProperty;
|
|
8
8
|
var __export = (target, all) => {
|
|
9
9
|
for (var name in all)
|
|
10
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
11
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var
|
|
12
|
+
|
|
13
|
+
// src/utils/constants.ts
|
|
14
|
+
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
15
|
+
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
16
|
+
|
|
17
|
+
// src/client/client-host-ref.ts
|
|
18
|
+
var getHostRef = (ref) => {
|
|
19
|
+
if (ref.__stencil__getHostRef) {
|
|
20
|
+
return ref.__stencil__getHostRef();
|
|
21
|
+
}
|
|
22
|
+
return void 0;
|
|
23
|
+
};
|
|
24
|
+
var registerInstance = (lazyInstance, hostRef) => {
|
|
25
|
+
lazyInstance.__stencil__getHostRef = () => hostRef;
|
|
26
|
+
hostRef.$lazyInstance$ = lazyInstance;
|
|
27
|
+
};
|
|
15
28
|
var registerHost = (hostElement, cmpMeta) => {
|
|
16
29
|
const hostRef = {
|
|
17
30
|
$flags$: 0,
|
|
@@ -24,7 +37,9 @@ var registerHost = (hostElement, cmpMeta) => {
|
|
|
24
37
|
hostElement["s-p"] = [];
|
|
25
38
|
hostElement["s-rc"] = [];
|
|
26
39
|
}
|
|
27
|
-
|
|
40
|
+
const ref = hostRef;
|
|
41
|
+
hostElement.__stencil__getHostRef = () => ref;
|
|
42
|
+
return ref;
|
|
28
43
|
};
|
|
29
44
|
var isMemberInElement = (elm, memberName) => memberName in elm;
|
|
30
45
|
var consoleError = (e, el) => (0, console.error)(e, el);
|
|
@@ -48,20 +63,25 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
48
63
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
49
64
|
/* webpackMode: "lazy" */
|
|
50
65
|
`./${bundleId}.entry.js${""}`
|
|
51
|
-
).then(
|
|
52
|
-
{
|
|
53
|
-
|
|
66
|
+
).then(
|
|
67
|
+
(importedModule) => {
|
|
68
|
+
{
|
|
69
|
+
cmpModules.set(bundleId, importedModule);
|
|
70
|
+
}
|
|
71
|
+
return importedModule[exportName];
|
|
72
|
+
},
|
|
73
|
+
(e) => {
|
|
74
|
+
consoleError(e, hostRef.$hostElement$);
|
|
54
75
|
}
|
|
55
|
-
|
|
56
|
-
}, consoleError);
|
|
76
|
+
);
|
|
57
77
|
};
|
|
58
78
|
|
|
59
79
|
// src/client/client-style.ts
|
|
60
80
|
var styles = /* @__PURE__ */ new Map();
|
|
81
|
+
var HYDRATED_STYLE_ID = "sty-id";
|
|
61
82
|
var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
|
|
62
83
|
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
|
63
84
|
var win = typeof window !== "undefined" ? window : {};
|
|
64
|
-
var doc = win.document || { head: {} };
|
|
65
85
|
var plt = {
|
|
66
86
|
$flags$: 0,
|
|
67
87
|
$resourcesUrl$: "",
|
|
@@ -71,22 +91,6 @@ var plt = {
|
|
|
71
91
|
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
72
92
|
ce: (eventName, opts) => new CustomEvent(eventName, opts)
|
|
73
93
|
};
|
|
74
|
-
var supportsListenerOptions = /* @__PURE__ */ (() => {
|
|
75
|
-
let supportsListenerOptions2 = false;
|
|
76
|
-
try {
|
|
77
|
-
doc.addEventListener(
|
|
78
|
-
"e",
|
|
79
|
-
null,
|
|
80
|
-
Object.defineProperty({}, "passive", {
|
|
81
|
-
get() {
|
|
82
|
-
supportsListenerOptions2 = true;
|
|
83
|
-
}
|
|
84
|
-
})
|
|
85
|
-
);
|
|
86
|
-
} catch (e) {
|
|
87
|
-
}
|
|
88
|
-
return supportsListenerOptions2;
|
|
89
|
-
})();
|
|
90
94
|
var promiseResolve = (v) => Promise.resolve(v);
|
|
91
95
|
var supportsConstructableStylesheets = /* @__PURE__ */ (() => {
|
|
92
96
|
try {
|
|
@@ -138,25 +142,22 @@ var getAssetPath = (path) => {
|
|
|
138
142
|
return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
|
|
139
143
|
};
|
|
140
144
|
var setAssetPath = (path) => plt.$resourcesUrl$ = path;
|
|
141
|
-
|
|
142
|
-
// src/utils/constants.ts
|
|
143
|
-
var EMPTY_OBJ = {};
|
|
144
|
-
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
145
|
-
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
146
|
-
|
|
147
|
-
// src/utils/helpers.ts
|
|
148
|
-
var isDef = (v) => v != null;
|
|
149
145
|
var isComplexType = (o) => {
|
|
150
146
|
o = typeof o;
|
|
151
147
|
return o === "object" || o === "function";
|
|
152
148
|
};
|
|
153
149
|
|
|
154
150
|
// src/utils/query-nonce-meta-tag-content.ts
|
|
155
|
-
function queryNonceMetaTagContent(
|
|
151
|
+
function queryNonceMetaTagContent(doc) {
|
|
156
152
|
var _a, _b, _c;
|
|
157
|
-
return (_c = (_b = (_a =
|
|
153
|
+
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;
|
|
158
154
|
}
|
|
159
155
|
|
|
156
|
+
// src/utils/regular-expression.ts
|
|
157
|
+
var escapeRegExpSpecialCharacters = (text) => {
|
|
158
|
+
return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
159
|
+
};
|
|
160
|
+
|
|
160
161
|
// src/utils/result.ts
|
|
161
162
|
var result_exports = {};
|
|
162
163
|
__export(result_exports, {
|
|
@@ -255,6 +256,13 @@ var h = (nodeName, vnodeData, ...children) => {
|
|
|
255
256
|
}
|
|
256
257
|
}
|
|
257
258
|
}
|
|
259
|
+
if (typeof nodeName === "function") {
|
|
260
|
+
return nodeName(
|
|
261
|
+
vnodeData === null ? {} : vnodeData,
|
|
262
|
+
vNodeChildren,
|
|
263
|
+
vdomFnUtils
|
|
264
|
+
);
|
|
265
|
+
}
|
|
258
266
|
const vnode = newVNode(nodeName, null);
|
|
259
267
|
vnode.$attrs$ = vnodeData;
|
|
260
268
|
if (vNodeChildren.length > 0) {
|
|
@@ -283,6 +291,48 @@ var newVNode = (tag, text) => {
|
|
|
283
291
|
};
|
|
284
292
|
var Host = {};
|
|
285
293
|
var isHost = (node) => node && node.$tag$ === Host;
|
|
294
|
+
var vdomFnUtils = {
|
|
295
|
+
forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
|
|
296
|
+
map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate)
|
|
297
|
+
};
|
|
298
|
+
var convertToPublic = (node) => ({
|
|
299
|
+
vattrs: node.$attrs$,
|
|
300
|
+
vchildren: node.$children$,
|
|
301
|
+
vkey: node.$key$,
|
|
302
|
+
vname: node.$name$,
|
|
303
|
+
vtag: node.$tag$,
|
|
304
|
+
vtext: node.$text$
|
|
305
|
+
});
|
|
306
|
+
var convertToPrivate = (node) => {
|
|
307
|
+
if (typeof node.vtag === "function") {
|
|
308
|
+
const vnodeData = { ...node.vattrs };
|
|
309
|
+
if (node.vkey) {
|
|
310
|
+
vnodeData.key = node.vkey;
|
|
311
|
+
}
|
|
312
|
+
if (node.vname) {
|
|
313
|
+
vnodeData.name = node.vname;
|
|
314
|
+
}
|
|
315
|
+
return h(node.vtag, vnodeData, ...node.vchildren || []);
|
|
316
|
+
}
|
|
317
|
+
const vnode = newVNode(node.vtag, node.vtext);
|
|
318
|
+
vnode.$attrs$ = node.vattrs;
|
|
319
|
+
vnode.$children$ = node.vchildren;
|
|
320
|
+
vnode.$key$ = node.vkey;
|
|
321
|
+
vnode.$name$ = node.vname;
|
|
322
|
+
return vnode;
|
|
323
|
+
};
|
|
324
|
+
var createSupportsRuleRe = (selector) => {
|
|
325
|
+
const safeSelector2 = escapeRegExpSpecialCharacters(selector);
|
|
326
|
+
return new RegExp(
|
|
327
|
+
// First capture group: match any context before the selector that's not inside @supports selector()
|
|
328
|
+
// Using negative lookahead to avoid matching inside @supports selector(...) condition
|
|
329
|
+
`(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${safeSelector2}))(${safeSelector2}\\b)`,
|
|
330
|
+
"g"
|
|
331
|
+
);
|
|
332
|
+
};
|
|
333
|
+
createSupportsRuleRe("::slotted");
|
|
334
|
+
createSupportsRuleRe(":host");
|
|
335
|
+
createSupportsRuleRe(":host-context");
|
|
286
336
|
var parsePropertyValue = (propValue, propType) => {
|
|
287
337
|
if (propValue != null && !isComplexType(propValue)) {
|
|
288
338
|
if (propType & 1 /* String */) {
|
|
@@ -300,9 +350,9 @@ var createEvent = (ref, name, flags) => {
|
|
|
300
350
|
return {
|
|
301
351
|
emit: (detail) => {
|
|
302
352
|
return emitEvent(elm, name, {
|
|
303
|
-
bubbles:
|
|
304
|
-
composed:
|
|
305
|
-
cancelable:
|
|
353
|
+
bubbles: true,
|
|
354
|
+
composed: true,
|
|
355
|
+
cancelable: true,
|
|
306
356
|
detail
|
|
307
357
|
});
|
|
308
358
|
}
|
|
@@ -332,7 +382,10 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
332
382
|
var _a;
|
|
333
383
|
const scopeId2 = getScopeId(cmpMeta);
|
|
334
384
|
const style = styles.get(scopeId2);
|
|
335
|
-
|
|
385
|
+
if (!win.document) {
|
|
386
|
+
return scopeId2;
|
|
387
|
+
}
|
|
388
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
|
|
336
389
|
if (style) {
|
|
337
390
|
if (typeof style === "string") {
|
|
338
391
|
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
@@ -343,23 +396,39 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
343
396
|
}
|
|
344
397
|
if (!appliedStyles.has(scopeId2)) {
|
|
345
398
|
{
|
|
346
|
-
styleElm =
|
|
399
|
+
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || win.document.createElement("style");
|
|
347
400
|
styleElm.innerHTML = style;
|
|
348
|
-
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(
|
|
401
|
+
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
|
349
402
|
if (nonce != null) {
|
|
350
403
|
styleElm.setAttribute("nonce", nonce);
|
|
351
404
|
}
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
405
|
+
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
406
|
+
if (styleContainerNode.nodeName === "HEAD") {
|
|
407
|
+
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
408
|
+
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
409
|
+
styleContainerNode.insertBefore(
|
|
410
|
+
styleElm,
|
|
411
|
+
(referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
|
|
412
|
+
);
|
|
413
|
+
} else if ("host" in styleContainerNode) {
|
|
414
|
+
if (supportsConstructableStylesheets) {
|
|
415
|
+
const stylesheet = new CSSStyleSheet();
|
|
416
|
+
stylesheet.replaceSync(style);
|
|
417
|
+
styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
|
|
418
|
+
} else {
|
|
419
|
+
const existingStyleContainer = styleContainerNode.querySelector("style");
|
|
420
|
+
if (existingStyleContainer) {
|
|
421
|
+
existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
|
|
422
|
+
} else {
|
|
423
|
+
styleContainerNode.prepend(styleElm);
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
} else {
|
|
427
|
+
styleContainerNode.append(styleElm);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
431
|
+
styleContainerNode.insertBefore(styleElm, null);
|
|
363
432
|
}
|
|
364
433
|
}
|
|
365
434
|
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
@@ -383,117 +452,144 @@ var attachStyles = (hostRef) => {
|
|
|
383
452
|
const scopeId2 = addStyle(
|
|
384
453
|
elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
385
454
|
cmpMeta);
|
|
386
|
-
if (flags & 10 /* needsScopedEncapsulation */
|
|
455
|
+
if (flags & 10 /* needsScopedEncapsulation */) {
|
|
387
456
|
elm["s-sc"] = scopeId2;
|
|
388
457
|
elm.classList.add(scopeId2 + "-h");
|
|
389
458
|
}
|
|
390
459
|
endAttachStyles();
|
|
391
460
|
};
|
|
392
461
|
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
393
|
-
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
394
|
-
if (oldValue
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
462
|
+
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
|
|
463
|
+
if (oldValue === newValue) {
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
let isProp = isMemberInElement(elm, memberName);
|
|
467
|
+
let ln = memberName.toLowerCase();
|
|
468
|
+
if (memberName === "class") {
|
|
469
|
+
const classList = elm.classList;
|
|
470
|
+
const oldClasses = parseClassList(oldValue);
|
|
471
|
+
let newClasses = parseClassList(newValue);
|
|
472
|
+
{
|
|
401
473
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
402
474
|
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
elm.style.removeProperty(prop);
|
|
409
|
-
} else {
|
|
410
|
-
elm.style[prop] = "";
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
for (const prop in newValue) {
|
|
416
|
-
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
475
|
+
}
|
|
476
|
+
} else if (memberName === "style") {
|
|
477
|
+
{
|
|
478
|
+
for (const prop in oldValue) {
|
|
479
|
+
if (!newValue || newValue[prop] == null) {
|
|
417
480
|
if (prop.includes("-")) {
|
|
418
|
-
elm.style.
|
|
481
|
+
elm.style.removeProperty(prop);
|
|
419
482
|
} else {
|
|
420
|
-
elm.style[prop] =
|
|
483
|
+
elm.style[prop] = "";
|
|
421
484
|
}
|
|
422
485
|
}
|
|
423
486
|
}
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
} else if (isMemberInElement(win, ln)) {
|
|
432
|
-
memberName = ln.slice(2);
|
|
433
|
-
} else {
|
|
434
|
-
memberName = ln[2] + memberName.slice(3);
|
|
435
|
-
}
|
|
436
|
-
if (oldValue || newValue) {
|
|
437
|
-
const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
|
|
438
|
-
memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
|
|
439
|
-
if (oldValue) {
|
|
440
|
-
plt.rel(elm, memberName, oldValue, capture);
|
|
441
|
-
}
|
|
442
|
-
if (newValue) {
|
|
443
|
-
plt.ael(elm, memberName, newValue, capture);
|
|
487
|
+
}
|
|
488
|
+
for (const prop in newValue) {
|
|
489
|
+
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
490
|
+
if (prop.includes("-")) {
|
|
491
|
+
elm.style.setProperty(prop, newValue[prop]);
|
|
492
|
+
} else {
|
|
493
|
+
elm.style[prop] = newValue[prop];
|
|
444
494
|
}
|
|
445
495
|
}
|
|
496
|
+
}
|
|
497
|
+
} else if (memberName === "key") ; else if (memberName === "ref") {
|
|
498
|
+
if (newValue) {
|
|
499
|
+
newValue(elm);
|
|
500
|
+
}
|
|
501
|
+
} else if ((!isProp ) && memberName[0] === "o" && memberName[1] === "n") {
|
|
502
|
+
if (memberName[2] === "-") {
|
|
503
|
+
memberName = memberName.slice(3);
|
|
504
|
+
} else if (isMemberInElement(win, ln)) {
|
|
505
|
+
memberName = ln.slice(2);
|
|
446
506
|
} else {
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
507
|
+
memberName = ln[2] + memberName.slice(3);
|
|
508
|
+
}
|
|
509
|
+
if (oldValue || newValue) {
|
|
510
|
+
const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
|
|
511
|
+
memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
|
|
512
|
+
if (oldValue) {
|
|
513
|
+
plt.rel(elm, memberName, oldValue, capture);
|
|
514
|
+
}
|
|
515
|
+
if (newValue) {
|
|
516
|
+
plt.ael(elm, memberName, newValue, capture);
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
} else {
|
|
520
|
+
const isComplex = isComplexType(newValue);
|
|
521
|
+
if ((isProp || isComplex && newValue !== null) && !isSvg) {
|
|
522
|
+
try {
|
|
523
|
+
if (!elm.tagName.includes("-")) {
|
|
524
|
+
const n = newValue == null ? "" : newValue;
|
|
525
|
+
if (memberName === "list") {
|
|
526
|
+
isProp = false;
|
|
527
|
+
} else if (oldValue == null || elm[memberName] != n) {
|
|
528
|
+
if (typeof elm.__lookupSetter__(memberName) === "function") {
|
|
455
529
|
elm[memberName] = n;
|
|
530
|
+
} else {
|
|
531
|
+
elm.setAttribute(memberName, n);
|
|
456
532
|
}
|
|
457
|
-
} else {
|
|
458
|
-
elm[memberName] = newValue;
|
|
459
533
|
}
|
|
460
|
-
}
|
|
534
|
+
} else if (elm[memberName] !== newValue) {
|
|
535
|
+
elm[memberName] = newValue;
|
|
461
536
|
}
|
|
537
|
+
} catch (e) {
|
|
462
538
|
}
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
elm.removeAttribute(memberName);
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
470
|
-
newValue = newValue === true ? "" : newValue;
|
|
539
|
+
}
|
|
540
|
+
if (newValue == null || newValue === false) {
|
|
541
|
+
if (newValue !== false || elm.getAttribute(memberName) === "") {
|
|
471
542
|
{
|
|
472
|
-
elm.
|
|
543
|
+
elm.removeAttribute(memberName);
|
|
473
544
|
}
|
|
474
545
|
}
|
|
546
|
+
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex && elm.nodeType === 1 /* ElementNode */) {
|
|
547
|
+
newValue = newValue === true ? "" : newValue;
|
|
548
|
+
{
|
|
549
|
+
elm.setAttribute(memberName, newValue);
|
|
550
|
+
}
|
|
475
551
|
}
|
|
476
552
|
}
|
|
477
553
|
};
|
|
478
554
|
var parseClassListRegex = /\s/;
|
|
479
|
-
var parseClassList = (value) =>
|
|
555
|
+
var parseClassList = (value) => {
|
|
556
|
+
if (typeof value === "object" && value && "baseVal" in value) {
|
|
557
|
+
value = value.baseVal;
|
|
558
|
+
}
|
|
559
|
+
if (!value || typeof value !== "string") {
|
|
560
|
+
return [];
|
|
561
|
+
}
|
|
562
|
+
return value.split(parseClassListRegex);
|
|
563
|
+
};
|
|
480
564
|
var CAPTURE_EVENT_SUFFIX = "Capture";
|
|
481
565
|
var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
|
|
482
566
|
|
|
483
567
|
// src/runtime/vdom/update-element.ts
|
|
484
|
-
var updateElement = (oldVnode, newVnode, isSvgMode2) => {
|
|
568
|
+
var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
|
|
485
569
|
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
486
|
-
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ ||
|
|
487
|
-
const newVnodeAttrs = newVnode.$attrs$ ||
|
|
570
|
+
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
|
|
571
|
+
const newVnodeAttrs = newVnode.$attrs$ || {};
|
|
488
572
|
{
|
|
489
573
|
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
490
574
|
if (!(memberName in newVnodeAttrs)) {
|
|
491
|
-
setAccessor(
|
|
575
|
+
setAccessor(
|
|
576
|
+
elm,
|
|
577
|
+
memberName,
|
|
578
|
+
oldVnodeAttrs[memberName],
|
|
579
|
+
void 0,
|
|
580
|
+
isSvgMode2,
|
|
581
|
+
newVnode.$flags$);
|
|
492
582
|
}
|
|
493
583
|
}
|
|
494
584
|
}
|
|
495
585
|
for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
|
|
496
|
-
setAccessor(
|
|
586
|
+
setAccessor(
|
|
587
|
+
elm,
|
|
588
|
+
memberName,
|
|
589
|
+
oldVnodeAttrs[memberName],
|
|
590
|
+
newVnodeAttrs[memberName],
|
|
591
|
+
isSvgMode2,
|
|
592
|
+
newVnode.$flags$);
|
|
497
593
|
}
|
|
498
594
|
};
|
|
499
595
|
function sortedAttrNames(attrNames) {
|
|
@@ -505,26 +601,27 @@ function sortedAttrNames(attrNames) {
|
|
|
505
601
|
attrNames
|
|
506
602
|
);
|
|
507
603
|
}
|
|
508
|
-
|
|
509
|
-
// src/runtime/vdom/vdom-render.ts
|
|
510
|
-
var scopeId;
|
|
511
604
|
var hostTagName;
|
|
512
|
-
var useNativeShadowDom = false;
|
|
513
605
|
var isSvgMode = false;
|
|
514
|
-
var createElm = (oldParentVNode, newParentVNode, childIndex
|
|
606
|
+
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
515
607
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
516
608
|
let i2 = 0;
|
|
517
609
|
let elm;
|
|
518
610
|
let childNode;
|
|
519
611
|
if (newVNode2.$text$ !== null) {
|
|
520
|
-
elm = newVNode2.$elm$ =
|
|
612
|
+
elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);
|
|
521
613
|
} else {
|
|
522
614
|
if (!isSvgMode) {
|
|
523
615
|
isSvgMode = newVNode2.$tag$ === "svg";
|
|
524
616
|
}
|
|
525
|
-
|
|
617
|
+
if (!win.document) {
|
|
618
|
+
throw new Error(
|
|
619
|
+
"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."
|
|
620
|
+
);
|
|
621
|
+
}
|
|
622
|
+
elm = newVNode2.$elm$ = win.document.createElementNS(
|
|
526
623
|
isSvgMode ? SVG_NS : HTML_NS,
|
|
527
|
-
|
|
624
|
+
newVNode2.$tag$
|
|
528
625
|
) ;
|
|
529
626
|
if (isSvgMode && newVNode2.$tag$ === "foreignObject") {
|
|
530
627
|
isSvgMode = false;
|
|
@@ -532,11 +629,6 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
532
629
|
{
|
|
533
630
|
updateElement(null, newVNode2, isSvgMode);
|
|
534
631
|
}
|
|
535
|
-
const rootNode = elm.getRootNode();
|
|
536
|
-
const isElementWithinShadowRoot = !rootNode.querySelector("body");
|
|
537
|
-
if (!isElementWithinShadowRoot && BUILD.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
538
|
-
elm.classList.add(elm["s-si"] = scopeId);
|
|
539
|
-
}
|
|
540
632
|
if (newVNode2.$children$) {
|
|
541
633
|
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
542
634
|
childNode = createElm(oldParentVNode, newVNode2, i2);
|
|
@@ -673,6 +765,9 @@ var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
|
673
765
|
if (!isInitialRender) {
|
|
674
766
|
return leftVNode.$key$ === rightVNode.$key$;
|
|
675
767
|
}
|
|
768
|
+
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
|
|
769
|
+
leftVNode.$key$ = rightVNode.$key$;
|
|
770
|
+
}
|
|
676
771
|
return true;
|
|
677
772
|
}
|
|
678
773
|
return false;
|
|
@@ -688,9 +783,7 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
688
783
|
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
|
689
784
|
}
|
|
690
785
|
{
|
|
691
|
-
|
|
692
|
-
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
693
|
-
}
|
|
786
|
+
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
694
787
|
}
|
|
695
788
|
if (oldChildren !== null && newChildren !== null) {
|
|
696
789
|
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
|
|
@@ -719,14 +812,15 @@ var nullifyVNodeRefs = (vNode) => {
|
|
|
719
812
|
}
|
|
720
813
|
};
|
|
721
814
|
var insertBefore = (parent, newNode, reference) => {
|
|
722
|
-
|
|
723
|
-
|
|
815
|
+
{
|
|
816
|
+
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
817
|
+
}
|
|
724
818
|
};
|
|
725
819
|
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
726
820
|
const hostElm = hostRef.$hostElement$;
|
|
727
|
-
const cmpMeta = hostRef.$cmpMeta$;
|
|
728
821
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
729
|
-
const
|
|
822
|
+
const isHostElement = isHost(renderFnResults);
|
|
823
|
+
const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
|
|
730
824
|
hostTagName = hostElm.tagName;
|
|
731
825
|
if (isInitialLoad && rootVnode.$attrs$) {
|
|
732
826
|
for (const key of Object.keys(rootVnode.$attrs$)) {
|
|
@@ -739,17 +833,20 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
739
833
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
740
834
|
hostRef.$vnode$ = rootVnode;
|
|
741
835
|
rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
|
|
742
|
-
{
|
|
743
|
-
scopeId = hostElm["s-sc"];
|
|
744
|
-
}
|
|
745
|
-
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
746
836
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
747
837
|
};
|
|
748
838
|
|
|
749
839
|
// src/runtime/update-component.ts
|
|
750
840
|
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
751
841
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
752
|
-
ancestorComponent["s-p"].push(
|
|
842
|
+
const index = ancestorComponent["s-p"].push(
|
|
843
|
+
new Promise(
|
|
844
|
+
(r) => hostRef.$onRenderResolve$ = () => {
|
|
845
|
+
ancestorComponent["s-p"].splice(index - 1, 1);
|
|
846
|
+
r();
|
|
847
|
+
}
|
|
848
|
+
)
|
|
849
|
+
);
|
|
753
850
|
}
|
|
754
851
|
};
|
|
755
852
|
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
@@ -775,17 +872,11 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
775
872
|
}
|
|
776
873
|
let maybePromise;
|
|
777
874
|
if (isInitialLoad) {
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
782
|
-
hostRef.$queuedListeners$ = void 0;
|
|
783
|
-
}
|
|
784
|
-
}
|
|
785
|
-
{
|
|
786
|
-
maybePromise = safeCall(instance, "componentWillLoad");
|
|
787
|
-
}
|
|
875
|
+
maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
|
|
876
|
+
} else {
|
|
877
|
+
maybePromise = safeCall(instance, "componentWillUpdate", void 0, elm);
|
|
788
878
|
}
|
|
879
|
+
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
|
|
789
880
|
endSchedule();
|
|
790
881
|
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
791
882
|
};
|
|
@@ -828,7 +919,7 @@ var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
|
828
919
|
try {
|
|
829
920
|
instance = instance.render() ;
|
|
830
921
|
{
|
|
831
|
-
hostRef.$flags$ &=
|
|
922
|
+
hostRef.$flags$ &= -17 /* isQueuedForUpdate */;
|
|
832
923
|
}
|
|
833
924
|
{
|
|
834
925
|
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
@@ -851,14 +942,13 @@ var postUpdateComponent = (hostRef) => {
|
|
|
851
942
|
const endPostUpdate = createTime("postUpdate", tagName);
|
|
852
943
|
const instance = hostRef.$lazyInstance$ ;
|
|
853
944
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
854
|
-
|
|
855
|
-
safeCall(instance, "componentDidRender");
|
|
856
|
-
}
|
|
945
|
+
safeCall(instance, "componentDidRender", void 0, elm);
|
|
857
946
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
858
947
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
859
948
|
{
|
|
860
949
|
addHydratedFlag(elm);
|
|
861
950
|
}
|
|
951
|
+
safeCall(instance, "componentDidLoad", void 0, elm);
|
|
862
952
|
endPostUpdate();
|
|
863
953
|
{
|
|
864
954
|
hostRef.$onReadyResolve$(elm);
|
|
@@ -867,6 +957,7 @@ var postUpdateComponent = (hostRef) => {
|
|
|
867
957
|
}
|
|
868
958
|
}
|
|
869
959
|
} else {
|
|
960
|
+
safeCall(instance, "componentDidUpdate", void 0, elm);
|
|
870
961
|
endPostUpdate();
|
|
871
962
|
}
|
|
872
963
|
{
|
|
@@ -877,21 +968,18 @@ var postUpdateComponent = (hostRef) => {
|
|
|
877
968
|
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
|
878
969
|
nextTick(() => scheduleUpdate(hostRef, false));
|
|
879
970
|
}
|
|
880
|
-
hostRef.$flags$ &=
|
|
971
|
+
hostRef.$flags$ &= -517;
|
|
881
972
|
}
|
|
882
973
|
};
|
|
883
974
|
var appDidLoad = (who) => {
|
|
884
|
-
{
|
|
885
|
-
addHydratedFlag(doc.documentElement);
|
|
886
|
-
}
|
|
887
975
|
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
888
976
|
};
|
|
889
|
-
var safeCall = (instance, method, arg) => {
|
|
977
|
+
var safeCall = (instance, method, arg, elm) => {
|
|
890
978
|
if (instance && instance[method]) {
|
|
891
979
|
try {
|
|
892
980
|
return instance[method](arg);
|
|
893
981
|
} catch (e) {
|
|
894
|
-
consoleError(e);
|
|
982
|
+
consoleError(e, elm);
|
|
895
983
|
}
|
|
896
984
|
}
|
|
897
985
|
return void 0;
|
|
@@ -907,7 +995,7 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
907
995
|
const hostRef = getHostRef(ref);
|
|
908
996
|
if (!hostRef) {
|
|
909
997
|
throw new Error(
|
|
910
|
-
`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/
|
|
998
|
+
`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).`
|
|
911
999
|
);
|
|
912
1000
|
}
|
|
913
1001
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
@@ -920,6 +1008,11 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
920
1008
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
921
1009
|
if (instance) {
|
|
922
1010
|
if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
1011
|
+
if (instance.componentShouldUpdate) {
|
|
1012
|
+
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
|
1013
|
+
return;
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
923
1016
|
scheduleUpdate(hostRef, false);
|
|
924
1017
|
}
|
|
925
1018
|
}
|
|
@@ -930,19 +1023,72 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
930
1023
|
var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
931
1024
|
var _a, _b;
|
|
932
1025
|
const prototype = Cstr.prototype;
|
|
933
|
-
if (cmpMeta.$members$ || BUILD.watchCallback
|
|
1026
|
+
if (cmpMeta.$members$ || BUILD.watchCallback) {
|
|
934
1027
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
935
1028
|
members.map(([memberName, [memberFlags]]) => {
|
|
936
1029
|
if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
1030
|
+
const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
|
|
1031
|
+
if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
|
|
1032
|
+
if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
|
|
1033
|
+
if (flags & 1 /* isElementConstructor */ || !origGetter) {
|
|
1034
|
+
Object.defineProperty(prototype, memberName, {
|
|
1035
|
+
get() {
|
|
1036
|
+
{
|
|
1037
|
+
if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
|
|
1038
|
+
return getValue(this, memberName);
|
|
1039
|
+
}
|
|
1040
|
+
const ref = getHostRef(this);
|
|
1041
|
+
const instance = ref ? ref.$lazyInstance$ : prototype;
|
|
1042
|
+
if (!instance) return;
|
|
1043
|
+
return instance[memberName];
|
|
1044
|
+
}
|
|
1045
|
+
},
|
|
1046
|
+
configurable: true,
|
|
1047
|
+
enumerable: true
|
|
1048
|
+
});
|
|
1049
|
+
}
|
|
937
1050
|
Object.defineProperty(prototype, memberName, {
|
|
938
|
-
get() {
|
|
939
|
-
return getValue(this, memberName);
|
|
940
|
-
},
|
|
941
1051
|
set(newValue) {
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
1052
|
+
const ref = getHostRef(this);
|
|
1053
|
+
if (origSetter) {
|
|
1054
|
+
const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
1055
|
+
if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
|
|
1056
|
+
newValue = ref.$instanceValues$.get(memberName);
|
|
1057
|
+
} else if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
1058
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
1059
|
+
}
|
|
1060
|
+
origSetter.apply(this, [parsePropertyValue(newValue, memberFlags)]);
|
|
1061
|
+
newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
1062
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
1063
|
+
return;
|
|
1064
|
+
}
|
|
1065
|
+
{
|
|
1066
|
+
if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
|
|
1067
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
1068
|
+
if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
|
|
1069
|
+
ref.$onReadyPromise$.then(() => {
|
|
1070
|
+
if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
|
|
1071
|
+
ref.$lazyInstance$[memberName] = newValue;
|
|
1072
|
+
}
|
|
1073
|
+
});
|
|
1074
|
+
}
|
|
1075
|
+
return;
|
|
1076
|
+
}
|
|
1077
|
+
const setterSetVal = () => {
|
|
1078
|
+
const currentValue = ref.$lazyInstance$[memberName];
|
|
1079
|
+
if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
1080
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
1081
|
+
}
|
|
1082
|
+
ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, memberFlags);
|
|
1083
|
+
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
|
|
1084
|
+
};
|
|
1085
|
+
if (ref.$lazyInstance$) {
|
|
1086
|
+
setterSetVal();
|
|
1087
|
+
} else {
|
|
1088
|
+
ref.$onReadyPromise$.then(() => setterSetVal());
|
|
1089
|
+
}
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
946
1092
|
});
|
|
947
1093
|
}
|
|
948
1094
|
});
|
|
@@ -952,7 +1098,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
952
1098
|
plt.jmp(() => {
|
|
953
1099
|
var _a2;
|
|
954
1100
|
const propName = attrNameToPropName.get(attrName);
|
|
955
|
-
if (this.hasOwnProperty(propName)) {
|
|
1101
|
+
if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
|
|
956
1102
|
newValue = this[propName];
|
|
957
1103
|
delete this[propName];
|
|
958
1104
|
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
|
|
@@ -972,7 +1118,11 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
972
1118
|
}
|
|
973
1119
|
return;
|
|
974
1120
|
}
|
|
975
|
-
|
|
1121
|
+
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
1122
|
+
newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
|
|
1123
|
+
if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
|
|
1124
|
+
this[propName] = newValue;
|
|
1125
|
+
}
|
|
976
1126
|
});
|
|
977
1127
|
};
|
|
978
1128
|
Cstr.observedAttributes = Array.from(
|
|
@@ -997,7 +1147,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
997
1147
|
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
998
1148
|
const bundleId = cmpMeta.$lazyBundleId$;
|
|
999
1149
|
if (bundleId) {
|
|
1000
|
-
const CstrImport = loadModule(cmpMeta);
|
|
1150
|
+
const CstrImport = loadModule(cmpMeta, hostRef);
|
|
1001
1151
|
if (CstrImport && "then" in CstrImport) {
|
|
1002
1152
|
const endLoad = uniqueTime();
|
|
1003
1153
|
Cstr = await CstrImport;
|
|
@@ -1019,13 +1169,13 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1019
1169
|
try {
|
|
1020
1170
|
new Cstr(hostRef);
|
|
1021
1171
|
} catch (e) {
|
|
1022
|
-
consoleError(e);
|
|
1172
|
+
consoleError(e, elm);
|
|
1023
1173
|
}
|
|
1024
1174
|
{
|
|
1025
|
-
hostRef.$flags$ &=
|
|
1175
|
+
hostRef.$flags$ &= -9 /* isConstructingInstance */;
|
|
1026
1176
|
}
|
|
1027
1177
|
endNewInstance();
|
|
1028
|
-
fireConnectedCallback(hostRef.$lazyInstance
|
|
1178
|
+
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
1029
1179
|
} else {
|
|
1030
1180
|
Cstr = elm.constructor;
|
|
1031
1181
|
const cmpTag = elm.localName;
|
|
@@ -1052,9 +1202,9 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1052
1202
|
schedule();
|
|
1053
1203
|
}
|
|
1054
1204
|
};
|
|
1055
|
-
var fireConnectedCallback = (instance) => {
|
|
1205
|
+
var fireConnectedCallback = (instance, elm) => {
|
|
1056
1206
|
{
|
|
1057
|
-
safeCall(instance, "connectedCallback");
|
|
1207
|
+
safeCall(instance, "connectedCallback", void 0, elm);
|
|
1058
1208
|
}
|
|
1059
1209
|
};
|
|
1060
1210
|
|
|
@@ -1088,48 +1238,56 @@ var connectedCallback = (elm) => {
|
|
|
1088
1238
|
initializeComponent(elm, hostRef, cmpMeta);
|
|
1089
1239
|
}
|
|
1090
1240
|
} else {
|
|
1091
|
-
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
1092
1241
|
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
1093
|
-
fireConnectedCallback(hostRef.$lazyInstance
|
|
1242
|
+
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
1094
1243
|
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
1095
|
-
hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance
|
|
1244
|
+
hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
|
|
1096
1245
|
}
|
|
1097
1246
|
}
|
|
1098
1247
|
endConnected();
|
|
1099
1248
|
}
|
|
1100
1249
|
};
|
|
1101
|
-
var disconnectInstance = (instance) => {
|
|
1250
|
+
var disconnectInstance = (instance, elm) => {
|
|
1251
|
+
{
|
|
1252
|
+
safeCall(instance, "disconnectedCallback", void 0, elm || instance);
|
|
1253
|
+
}
|
|
1102
1254
|
};
|
|
1103
1255
|
var disconnectedCallback = async (elm) => {
|
|
1104
1256
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1105
1257
|
const hostRef = getHostRef(elm);
|
|
1106
|
-
{
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
}
|
|
1111
|
-
}
|
|
1112
|
-
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) ; else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
1113
|
-
hostRef.$onReadyPromise$.then(() => disconnectInstance());
|
|
1258
|
+
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
1259
|
+
disconnectInstance(hostRef.$lazyInstance$, elm);
|
|
1260
|
+
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
1261
|
+
hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$, elm));
|
|
1114
1262
|
}
|
|
1115
1263
|
}
|
|
1264
|
+
if (rootAppliedStyles.has(elm)) {
|
|
1265
|
+
rootAppliedStyles.delete(elm);
|
|
1266
|
+
}
|
|
1267
|
+
if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
|
|
1268
|
+
rootAppliedStyles.delete(elm.shadowRoot);
|
|
1269
|
+
}
|
|
1116
1270
|
};
|
|
1117
1271
|
|
|
1118
1272
|
// src/runtime/bootstrap-lazy.ts
|
|
1119
1273
|
var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
1120
1274
|
var _a;
|
|
1275
|
+
if (!win.document) {
|
|
1276
|
+
console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");
|
|
1277
|
+
return;
|
|
1278
|
+
}
|
|
1121
1279
|
const endBootstrap = createTime();
|
|
1122
1280
|
const cmpTags = [];
|
|
1123
1281
|
const exclude = options.exclude || [];
|
|
1124
1282
|
const customElements2 = win.customElements;
|
|
1125
|
-
const head =
|
|
1283
|
+
const head = win.document.head;
|
|
1126
1284
|
const metaCharset = /* @__PURE__ */ head.querySelector("meta[charset]");
|
|
1127
|
-
const dataStyles = /* @__PURE__ */
|
|
1285
|
+
const dataStyles = /* @__PURE__ */ win.document.createElement("style");
|
|
1128
1286
|
const deferredConnectedCallbacks = [];
|
|
1129
1287
|
let appLoadFallback;
|
|
1130
1288
|
let isBootstrapping = true;
|
|
1131
1289
|
Object.assign(plt, options);
|
|
1132
|
-
plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./",
|
|
1290
|
+
plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", win.document.baseURI).href;
|
|
1133
1291
|
let hasSlotRelocation = false;
|
|
1134
1292
|
lazyBundles.map((lazyBundle) => {
|
|
1135
1293
|
lazyBundle[1].map((compactMeta) => {
|
|
@@ -1145,9 +1303,6 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1145
1303
|
{
|
|
1146
1304
|
cmpMeta.$members$ = compactMeta[2];
|
|
1147
1305
|
}
|
|
1148
|
-
{
|
|
1149
|
-
cmpMeta.$listeners$ = compactMeta[3];
|
|
1150
|
-
}
|
|
1151
1306
|
const tagName = cmpMeta.$tagName$;
|
|
1152
1307
|
const HostElement = class extends HTMLElement {
|
|
1153
1308
|
// StencilLazyHost
|
|
@@ -1173,10 +1328,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1173
1328
|
}
|
|
1174
1329
|
}
|
|
1175
1330
|
connectedCallback() {
|
|
1176
|
-
|
|
1331
|
+
getHostRef(this);
|
|
1177
1332
|
if (!this.hasRegisteredEventListeners) {
|
|
1178
1333
|
this.hasRegisteredEventListeners = true;
|
|
1179
|
-
addHostEventListeners(this, hostRef, cmpMeta.$listeners$);
|
|
1180
1334
|
}
|
|
1181
1335
|
if (appLoadFallback) {
|
|
1182
1336
|
clearTimeout(appLoadFallback);
|
|
@@ -1190,6 +1344,17 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1190
1344
|
}
|
|
1191
1345
|
disconnectedCallback() {
|
|
1192
1346
|
plt.jmp(() => disconnectedCallback(this));
|
|
1347
|
+
plt.raf(() => {
|
|
1348
|
+
var _a3;
|
|
1349
|
+
const hostRef = getHostRef(this);
|
|
1350
|
+
const i2 = deferredConnectedCallbacks.findIndex((host) => host === this);
|
|
1351
|
+
if (i2 > -1) {
|
|
1352
|
+
deferredConnectedCallbacks.splice(i2, 1);
|
|
1353
|
+
}
|
|
1354
|
+
if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
|
|
1355
|
+
delete hostRef.$vnode$.$elm$;
|
|
1356
|
+
}
|
|
1357
|
+
});
|
|
1193
1358
|
}
|
|
1194
1359
|
componentOnReady() {
|
|
1195
1360
|
return getHostRef(this).$onReadyPromise$;
|
|
@@ -1214,7 +1379,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1214
1379
|
}
|
|
1215
1380
|
if (dataStyles.innerHTML.length) {
|
|
1216
1381
|
dataStyles.setAttribute("data-styles", "");
|
|
1217
|
-
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(
|
|
1382
|
+
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
|
1218
1383
|
if (nonce != null) {
|
|
1219
1384
|
dataStyles.setAttribute("nonce", nonce);
|
|
1220
1385
|
}
|
|
@@ -1231,39 +1396,11 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1231
1396
|
}
|
|
1232
1397
|
endBootstrap();
|
|
1233
1398
|
};
|
|
1234
|
-
var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
1235
|
-
if (listeners) {
|
|
1236
|
-
listeners.map(([flags, name, method]) => {
|
|
1237
|
-
const target = elm;
|
|
1238
|
-
const handler = hostListenerProxy(hostRef, method);
|
|
1239
|
-
const opts = hostListenerOpts(flags);
|
|
1240
|
-
plt.ael(target, name, handler, opts);
|
|
1241
|
-
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
1242
|
-
});
|
|
1243
|
-
}
|
|
1244
|
-
};
|
|
1245
|
-
var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
1246
|
-
var _a;
|
|
1247
|
-
try {
|
|
1248
|
-
{
|
|
1249
|
-
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
1250
|
-
(_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev);
|
|
1251
|
-
} else {
|
|
1252
|
-
(hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
|
|
1253
|
-
}
|
|
1254
|
-
}
|
|
1255
|
-
} catch (e) {
|
|
1256
|
-
consoleError(e);
|
|
1257
|
-
}
|
|
1258
|
-
};
|
|
1259
|
-
var hostListenerOpts = (flags) => supportsListenerOptions ? {
|
|
1260
|
-
passive: (flags & 1 /* Passive */) !== 0,
|
|
1261
|
-
capture: (flags & 2 /* Capture */) !== 0
|
|
1262
|
-
} : (flags & 2 /* Capture */) !== 0;
|
|
1263
1399
|
|
|
1264
1400
|
// src/runtime/nonce.ts
|
|
1265
1401
|
var setNonce = (nonce) => plt.$nonce$ = nonce;
|
|
1266
1402
|
|
|
1267
|
-
export {
|
|
1403
|
+
export { getElement as a, bootstrapLazy as b, createEvent as c, setAssetPath as d, getAssetPath as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
|
|
1404
|
+
//# sourceMappingURL=index-BQRdy1TQ.js.map
|
|
1268
1405
|
|
|
1269
|
-
//# sourceMappingURL=index-
|
|
1406
|
+
//# sourceMappingURL=index-BQRdy1TQ.js.map
|