@stencil/core 4.24.0 → 4.25.0-dev.1737694903.66340b2
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/cli/index.cjs +1 -1
- package/cli/index.js +1 -1
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +5 -6
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +2 -2
- package/dev-server/index.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +2 -2
- package/internal/app-data/package.json +1 -1
- package/internal/client/index.js +361 -346
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/hydrate/index.js +371 -326
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.js +102 -33
- package/internal/package.json +1 -1
- package/internal/testing/index.js +30 -25
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +67 -3
- package/mock-doc/index.d.ts +9 -0
- package/mock-doc/index.js +67 -3
- package/mock-doc/package.json +1 -1
- package/package.json +1 -1
- package/screenshot/index.js +1 -1
- package/screenshot/package.json +1 -1
- package/screenshot/pixel-match.js +1 -1
- package/sys/node/autoprefixer.js +1 -1
- package/sys/node/index.js +1 -1
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +2 -2
- package/testing/package.json +1 -1
package/internal/client/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Stencil Client Platform v4.
|
|
2
|
+
Stencil Client Platform v4.25.0-dev.1737694903.66340b2 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __export = (target, all) => {
|
|
@@ -17,19 +17,46 @@ var Build = {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
// src/client/client-host-ref.ts
|
|
20
|
+
import { BUILD as BUILD3 } from "@stencil/core/internal/app-data";
|
|
21
|
+
|
|
22
|
+
// src/utils/es2022-rewire-class-members.ts
|
|
20
23
|
import { BUILD as BUILD2 } from "@stencil/core/internal/app-data";
|
|
21
24
|
|
|
22
25
|
// src/utils/constants.ts
|
|
23
26
|
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
24
27
|
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
25
28
|
|
|
29
|
+
// src/utils/es2022-rewire-class-members.ts
|
|
30
|
+
var reWireGetterSetter = (instance, hostRef) => {
|
|
31
|
+
var _a;
|
|
32
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
33
|
+
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
34
|
+
members.map(([memberName, [memberFlags]]) => {
|
|
35
|
+
if ((BUILD2.state || BUILD2.prop) && (memberFlags & 31 /* Prop */ || memberFlags & 32 /* State */)) {
|
|
36
|
+
const ogValue = instance[memberName];
|
|
37
|
+
const ogDescriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(instance), memberName);
|
|
38
|
+
Object.defineProperty(instance, memberName, {
|
|
39
|
+
get() {
|
|
40
|
+
return ogDescriptor.get.call(this);
|
|
41
|
+
},
|
|
42
|
+
set(newValue) {
|
|
43
|
+
ogDescriptor.set.call(this, newValue);
|
|
44
|
+
},
|
|
45
|
+
configurable: true,
|
|
46
|
+
enumerable: true
|
|
47
|
+
});
|
|
48
|
+
instance[memberName] = hostRef.$instanceValues$.has(memberName) ? hostRef.$instanceValues$.get(memberName) : ogValue;
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
|
|
26
53
|
// src/client/client-host-ref.ts
|
|
27
|
-
var hostRefs =
|
|
54
|
+
var hostRefs = BUILD3.hotModuleReplacement ? window.__STENCIL_HOSTREFS__ || (window.__STENCIL_HOSTREFS__ = /* @__PURE__ */ new WeakMap()) : /* @__PURE__ */ new WeakMap();
|
|
28
55
|
var deleteHostRef = (ref) => hostRefs.delete(ref);
|
|
29
56
|
var getHostRef = (ref) => hostRefs.get(ref);
|
|
30
57
|
var registerInstance = (lazyInstance, hostRef) => {
|
|
31
58
|
hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
|
|
32
|
-
if (
|
|
59
|
+
if (BUILD3.modernPropertyDecls && (BUILD3.state || BUILD3.prop)) {
|
|
33
60
|
reWireGetterSetter(lazyInstance, hostRef);
|
|
34
61
|
}
|
|
35
62
|
};
|
|
@@ -40,55 +67,33 @@ var registerHost = (hostElement, cmpMeta) => {
|
|
|
40
67
|
$cmpMeta$: cmpMeta,
|
|
41
68
|
$instanceValues$: /* @__PURE__ */ new Map()
|
|
42
69
|
};
|
|
43
|
-
if (
|
|
70
|
+
if (BUILD3.isDev) {
|
|
44
71
|
hostRef.$renderCount$ = 0;
|
|
45
72
|
}
|
|
46
|
-
if (
|
|
73
|
+
if (BUILD3.method && BUILD3.lazyLoad) {
|
|
47
74
|
hostRef.$onInstancePromise$ = new Promise((r) => hostRef.$onInstanceResolve$ = r);
|
|
48
75
|
}
|
|
49
|
-
if (
|
|
76
|
+
if (BUILD3.asyncLoading) {
|
|
50
77
|
hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r);
|
|
51
78
|
hostElement["s-p"] = [];
|
|
52
79
|
hostElement["s-rc"] = [];
|
|
53
80
|
}
|
|
54
81
|
const ref = hostRefs.set(hostElement, hostRef);
|
|
55
|
-
if (!
|
|
82
|
+
if (!BUILD3.lazyLoad && BUILD3.modernPropertyDecls && (BUILD3.state || BUILD3.prop)) {
|
|
56
83
|
reWireGetterSetter(hostElement, hostRef);
|
|
57
84
|
}
|
|
58
85
|
return ref;
|
|
59
86
|
};
|
|
60
87
|
var isMemberInElement = (elm, memberName) => memberName in elm;
|
|
61
|
-
var reWireGetterSetter = (instance, hostRef) => {
|
|
62
|
-
var _a;
|
|
63
|
-
const cmpMeta = hostRef.$cmpMeta$;
|
|
64
|
-
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
65
|
-
members.map(([memberName, [memberFlags]]) => {
|
|
66
|
-
if ((BUILD2.state || BUILD2.prop) && (memberFlags & 31 /* Prop */ || memberFlags & 32 /* State */)) {
|
|
67
|
-
const ogValue = instance[memberName];
|
|
68
|
-
const ogDescriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(instance), memberName);
|
|
69
|
-
Object.defineProperty(instance, memberName, {
|
|
70
|
-
get() {
|
|
71
|
-
return ogDescriptor.get.call(this);
|
|
72
|
-
},
|
|
73
|
-
set(newValue) {
|
|
74
|
-
ogDescriptor.set.call(this, newValue);
|
|
75
|
-
},
|
|
76
|
-
configurable: true,
|
|
77
|
-
enumerable: true
|
|
78
|
-
});
|
|
79
|
-
instance[memberName] = hostRef.$instanceValues$.has(memberName) ? hostRef.$instanceValues$.get(memberName) : ogValue;
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
};
|
|
83
88
|
|
|
84
89
|
// src/client/client-load-module.ts
|
|
85
|
-
import { BUILD as
|
|
90
|
+
import { BUILD as BUILD5 } from "@stencil/core/internal/app-data";
|
|
86
91
|
|
|
87
92
|
// src/client/client-log.ts
|
|
88
|
-
import { BUILD as
|
|
93
|
+
import { BUILD as BUILD4 } from "@stencil/core/internal/app-data";
|
|
89
94
|
var customError;
|
|
90
95
|
var consoleError = (e, el) => (customError || console.error)(e, el);
|
|
91
|
-
var STENCIL_DEV_MODE =
|
|
96
|
+
var STENCIL_DEV_MODE = BUILD4.isTesting ? ["STENCIL:"] : [
|
|
92
97
|
"%cstencil",
|
|
93
98
|
"color: white;background:#4c47ff;font-weight: bold; font-size:10px; padding:2px 6px; border-radius: 5px"
|
|
94
99
|
];
|
|
@@ -103,7 +108,7 @@ var MODULE_IMPORT_PREFIX = "./";
|
|
|
103
108
|
var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
104
109
|
const exportName = cmpMeta.$tagName$.replace(/-/g, "_");
|
|
105
110
|
const bundleId = cmpMeta.$lazyBundleId$;
|
|
106
|
-
if (
|
|
111
|
+
if (BUILD5.isDev && typeof bundleId !== "string") {
|
|
107
112
|
consoleDevError(
|
|
108
113
|
`Trying to lazily load component <${cmpMeta.$tagName$}> with style mode "${hostRef.$modeName$}", but it does not exist.`
|
|
109
114
|
);
|
|
@@ -111,7 +116,7 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
111
116
|
} else if (!bundleId) {
|
|
112
117
|
return void 0;
|
|
113
118
|
}
|
|
114
|
-
const module = !
|
|
119
|
+
const module = !BUILD5.hotModuleReplacement ? cmpModules.get(bundleId) : false;
|
|
115
120
|
if (module) {
|
|
116
121
|
return module[exportName];
|
|
117
122
|
}
|
|
@@ -121,13 +126,18 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
121
126
|
/* webpackInclude: /\.entry\.js$/ */
|
|
122
127
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
123
128
|
/* webpackMode: "lazy" */
|
|
124
|
-
`./${bundleId}.entry.js${
|
|
125
|
-
).then(
|
|
126
|
-
|
|
127
|
-
|
|
129
|
+
`./${bundleId}.entry.js${BUILD5.hotModuleReplacement && hmrVersionId ? "?s-hmr=" + hmrVersionId : ""}`
|
|
130
|
+
).then(
|
|
131
|
+
(importedModule) => {
|
|
132
|
+
if (!BUILD5.hotModuleReplacement) {
|
|
133
|
+
cmpModules.set(bundleId, importedModule);
|
|
134
|
+
}
|
|
135
|
+
return importedModule[exportName];
|
|
136
|
+
},
|
|
137
|
+
(e) => {
|
|
138
|
+
consoleError(e, hostRef.$hostElement$);
|
|
128
139
|
}
|
|
129
|
-
|
|
130
|
-
}, consoleError);
|
|
140
|
+
);
|
|
131
141
|
};
|
|
132
142
|
|
|
133
143
|
// src/client/client-style.ts
|
|
@@ -135,7 +145,7 @@ var styles = /* @__PURE__ */ new Map();
|
|
|
135
145
|
var modeResolutionChain = [];
|
|
136
146
|
|
|
137
147
|
// src/client/client-task-queue.ts
|
|
138
|
-
import { BUILD as
|
|
148
|
+
import { BUILD as BUILD7 } from "@stencil/core/internal/app-data";
|
|
139
149
|
|
|
140
150
|
// src/runtime/runtime-constants.ts
|
|
141
151
|
var CONTENT_REF_ID = "r";
|
|
@@ -163,7 +173,7 @@ var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
|
|
|
163
173
|
];
|
|
164
174
|
|
|
165
175
|
// src/client/client-window.ts
|
|
166
|
-
import { BUILD as
|
|
176
|
+
import { BUILD as BUILD6 } from "@stencil/core/internal/app-data";
|
|
167
177
|
var win = typeof window !== "undefined" ? window : {};
|
|
168
178
|
var doc = win.document || { head: {} };
|
|
169
179
|
var H = win.HTMLElement || class {
|
|
@@ -180,7 +190,7 @@ var plt = {
|
|
|
180
190
|
var setPlatformHelpers = (helpers) => {
|
|
181
191
|
Object.assign(plt, helpers);
|
|
182
192
|
};
|
|
183
|
-
var supportsShadow =
|
|
193
|
+
var supportsShadow = BUILD6.shadowDom;
|
|
184
194
|
var supportsListenerOptions = /* @__PURE__ */ (() => {
|
|
185
195
|
let supportsListenerOptions2 = false;
|
|
186
196
|
try {
|
|
@@ -198,7 +208,7 @@ var supportsListenerOptions = /* @__PURE__ */ (() => {
|
|
|
198
208
|
return supportsListenerOptions2;
|
|
199
209
|
})();
|
|
200
210
|
var promiseResolve = (v) => Promise.resolve(v);
|
|
201
|
-
var supportsConstructableStylesheets =
|
|
211
|
+
var supportsConstructableStylesheets = BUILD6.constructableCSS ? /* @__PURE__ */ (() => {
|
|
202
212
|
try {
|
|
203
213
|
new CSSStyleSheet();
|
|
204
214
|
return typeof new CSSStyleSheet().replaceSync === "function";
|
|
@@ -251,11 +261,11 @@ var consumeTimeout = (queue, timeout) => {
|
|
|
251
261
|
}
|
|
252
262
|
};
|
|
253
263
|
var flush = () => {
|
|
254
|
-
if (
|
|
264
|
+
if (BUILD7.asyncQueue) {
|
|
255
265
|
queueCongestion++;
|
|
256
266
|
}
|
|
257
267
|
consume(queueDomReads);
|
|
258
|
-
if (
|
|
268
|
+
if (BUILD7.asyncQueue) {
|
|
259
269
|
const timeout = (plt.$flags$ & 6 /* queueMask */) === 2 /* appLoaded */ ? performance.now() + 14 * Math.ceil(queueCongestion * (1 / 10)) : Infinity;
|
|
260
270
|
consumeTimeout(queueDomWrites, timeout);
|
|
261
271
|
consumeTimeout(queueDomWritesLow, timeout);
|
|
@@ -280,7 +290,7 @@ var readTask = /* @__PURE__ */ queueTask(queueDomReads, false);
|
|
|
280
290
|
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
|
|
281
291
|
|
|
282
292
|
// src/client/index.ts
|
|
283
|
-
import { BUILD as
|
|
293
|
+
import { BUILD as BUILD29, Env, NAMESPACE as NAMESPACE2 } from "@stencil/core/internal/app-data";
|
|
284
294
|
|
|
285
295
|
// src/runtime/asset-path.ts
|
|
286
296
|
var getAssetPath = (path) => {
|
|
@@ -290,7 +300,7 @@ var getAssetPath = (path) => {
|
|
|
290
300
|
var setAssetPath = (path) => plt.$resourcesUrl$ = path;
|
|
291
301
|
|
|
292
302
|
// src/runtime/bootstrap-custom-element.ts
|
|
293
|
-
import { BUILD as
|
|
303
|
+
import { BUILD as BUILD26 } from "@stencil/core/internal/app-data";
|
|
294
304
|
|
|
295
305
|
// src/utils/helpers.ts
|
|
296
306
|
var isDef = (v) => v != null && v !== void 0;
|
|
@@ -355,16 +365,16 @@ var unwrapErr = (result) => {
|
|
|
355
365
|
};
|
|
356
366
|
|
|
357
367
|
// src/runtime/connected-callback.ts
|
|
358
|
-
import { BUILD as
|
|
368
|
+
import { BUILD as BUILD24 } from "@stencil/core/internal/app-data";
|
|
359
369
|
|
|
360
370
|
// src/runtime/client-hydrate.ts
|
|
361
|
-
import { BUILD as
|
|
371
|
+
import { BUILD as BUILD12 } from "@stencil/core/internal/app-data";
|
|
362
372
|
|
|
363
373
|
// src/runtime/dom-extras.ts
|
|
364
|
-
import { BUILD as
|
|
374
|
+
import { BUILD as BUILD9 } from "@stencil/core/internal/app-data";
|
|
365
375
|
|
|
366
376
|
// src/runtime/slot-polyfill-utils.ts
|
|
367
|
-
import { BUILD as
|
|
377
|
+
import { BUILD as BUILD8 } from "@stencil/core/internal/app-data";
|
|
368
378
|
var updateFallbackSlotVisibility = (elm) => {
|
|
369
379
|
const childNodes = elm.__childNodes || elm.childNodes;
|
|
370
380
|
if (elm.tagName && elm.tagName.includes("-") && elm["s-cr"] && elm.tagName !== "SLOT-FB") {
|
|
@@ -444,7 +454,7 @@ var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
|
|
|
444
454
|
const parent = slotNode["s-cr"].parentNode;
|
|
445
455
|
const appendMethod = prepend ? parent.__prepend || parent.prepend : parent.__appendChild || parent.appendChild;
|
|
446
456
|
if (typeof position !== "undefined") {
|
|
447
|
-
if (
|
|
457
|
+
if (BUILD8.hydrateClientSide) {
|
|
448
458
|
slottedNodeLocation["s-oo"] = position;
|
|
449
459
|
const childNodes = parent.__childNodes || parent.childNodes;
|
|
450
460
|
const slotRelocateNodes = [slottedNodeLocation];
|
|
@@ -484,9 +494,9 @@ var patchCloneNode = (HostElementPrototype) => {
|
|
|
484
494
|
const orgCloneNode = HostElementPrototype.cloneNode;
|
|
485
495
|
HostElementPrototype.cloneNode = function(deep) {
|
|
486
496
|
const srcNode = this;
|
|
487
|
-
const isShadowDom =
|
|
497
|
+
const isShadowDom = BUILD9.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
|
|
488
498
|
const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);
|
|
489
|
-
if (
|
|
499
|
+
if (BUILD9.slot && !isShadowDom && deep) {
|
|
490
500
|
let i2 = 0;
|
|
491
501
|
let slotted, nonStencilNode;
|
|
492
502
|
const stencilPrivates = [
|
|
@@ -511,7 +521,7 @@ var patchCloneNode = (HostElementPrototype) => {
|
|
|
511
521
|
slotted = childNodes[i2]["s-nr"];
|
|
512
522
|
nonStencilNode = stencilPrivates.every((privateField) => !childNodes[i2][privateField]);
|
|
513
523
|
if (slotted) {
|
|
514
|
-
if (
|
|
524
|
+
if (BUILD9.appendChildSlotFix && clonedNode.__appendChild) {
|
|
515
525
|
clonedNode.__appendChild(slotted.cloneNode(true));
|
|
516
526
|
} else {
|
|
517
527
|
clonedNode.appendChild(slotted.cloneNode(true));
|
|
@@ -847,10 +857,10 @@ function intrnlCall(node, method) {
|
|
|
847
857
|
}
|
|
848
858
|
|
|
849
859
|
// src/runtime/profile.ts
|
|
850
|
-
import { BUILD as
|
|
860
|
+
import { BUILD as BUILD10 } from "@stencil/core/internal/app-data";
|
|
851
861
|
var i = 0;
|
|
852
862
|
var createTime = (fnName, tagName = "") => {
|
|
853
|
-
if (
|
|
863
|
+
if (BUILD10.profile && performance.mark) {
|
|
854
864
|
const key = `st:${fnName}:${tagName}:${i++}`;
|
|
855
865
|
performance.mark(key);
|
|
856
866
|
return () => performance.measure(`[Stencil] ${fnName}() <${tagName}>`, key);
|
|
@@ -861,7 +871,7 @@ var createTime = (fnName, tagName = "") => {
|
|
|
861
871
|
}
|
|
862
872
|
};
|
|
863
873
|
var uniqueTime = (key, measureText) => {
|
|
864
|
-
if (
|
|
874
|
+
if (BUILD10.profile && performance.mark) {
|
|
865
875
|
if (performance.getEntriesByName(key, "mark").length === 0) {
|
|
866
876
|
performance.mark(key);
|
|
867
877
|
}
|
|
@@ -919,7 +929,7 @@ var inspect = (ref) => {
|
|
|
919
929
|
};
|
|
920
930
|
};
|
|
921
931
|
var installDevTools = () => {
|
|
922
|
-
if (
|
|
932
|
+
if (BUILD10.devTools) {
|
|
923
933
|
const stencil = win.stencil = win.stencil || {};
|
|
924
934
|
const originalInspect = stencil.inspect;
|
|
925
935
|
stencil.inspect = (ref) => {
|
|
@@ -933,7 +943,7 @@ var installDevTools = () => {
|
|
|
933
943
|
};
|
|
934
944
|
|
|
935
945
|
// src/runtime/vdom/h.ts
|
|
936
|
-
import { BUILD as
|
|
946
|
+
import { BUILD as BUILD11 } from "@stencil/core/internal/app-data";
|
|
937
947
|
var h = (nodeName, vnodeData, ...children) => {
|
|
938
948
|
let child = null;
|
|
939
949
|
let key = null;
|
|
@@ -949,7 +959,7 @@ var h = (nodeName, vnodeData, ...children) => {
|
|
|
949
959
|
} else if (child != null && typeof child !== "boolean") {
|
|
950
960
|
if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
|
|
951
961
|
child = String(child);
|
|
952
|
-
} else if (
|
|
962
|
+
} else if (BUILD11.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
|
|
953
963
|
consoleDevError(`vNode passed as children has unexpected type.
|
|
954
964
|
Make sure it's using the correct h() function.
|
|
955
965
|
Empty objects can also be the cause, look for JSX comments that became objects.`);
|
|
@@ -965,28 +975,28 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
|
|
|
965
975
|
};
|
|
966
976
|
walk(children);
|
|
967
977
|
if (vnodeData) {
|
|
968
|
-
if (
|
|
978
|
+
if (BUILD11.isDev && nodeName === "input") {
|
|
969
979
|
validateInputProperties(vnodeData);
|
|
970
980
|
}
|
|
971
|
-
if (
|
|
981
|
+
if (BUILD11.vdomKey && vnodeData.key) {
|
|
972
982
|
key = vnodeData.key;
|
|
973
983
|
}
|
|
974
|
-
if (
|
|
984
|
+
if (BUILD11.slotRelocation && vnodeData.name) {
|
|
975
985
|
slotName = vnodeData.name;
|
|
976
986
|
}
|
|
977
|
-
if (
|
|
987
|
+
if (BUILD11.vdomClass) {
|
|
978
988
|
const classData = vnodeData.className || vnodeData.class;
|
|
979
989
|
if (classData) {
|
|
980
990
|
vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
|
|
981
991
|
}
|
|
982
992
|
}
|
|
983
993
|
}
|
|
984
|
-
if (
|
|
994
|
+
if (BUILD11.isDev && vNodeChildren.some(isHost)) {
|
|
985
995
|
consoleDevError(`The <Host> must be the single root component. Make sure:
|
|
986
996
|
- You are NOT using hostData() and <Host> in the same component.
|
|
987
997
|
- <Host> is used once, and it's the single root component of the render() function.`);
|
|
988
998
|
}
|
|
989
|
-
if (
|
|
999
|
+
if (BUILD11.vdomFunctional && typeof nodeName === "function") {
|
|
990
1000
|
return nodeName(
|
|
991
1001
|
vnodeData === null ? {} : vnodeData,
|
|
992
1002
|
vNodeChildren,
|
|
@@ -998,10 +1008,10 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
|
|
|
998
1008
|
if (vNodeChildren.length > 0) {
|
|
999
1009
|
vnode.$children$ = vNodeChildren;
|
|
1000
1010
|
}
|
|
1001
|
-
if (
|
|
1011
|
+
if (BUILD11.vdomKey) {
|
|
1002
1012
|
vnode.$key$ = key;
|
|
1003
1013
|
}
|
|
1004
|
-
if (
|
|
1014
|
+
if (BUILD11.slotRelocation) {
|
|
1005
1015
|
vnode.$name$ = slotName;
|
|
1006
1016
|
}
|
|
1007
1017
|
return vnode;
|
|
@@ -1014,13 +1024,13 @@ var newVNode = (tag, text) => {
|
|
|
1014
1024
|
$elm$: null,
|
|
1015
1025
|
$children$: null
|
|
1016
1026
|
};
|
|
1017
|
-
if (
|
|
1027
|
+
if (BUILD11.vdomAttribute) {
|
|
1018
1028
|
vnode.$attrs$ = null;
|
|
1019
1029
|
}
|
|
1020
|
-
if (
|
|
1030
|
+
if (BUILD11.vdomKey) {
|
|
1021
1031
|
vnode.$key$ = null;
|
|
1022
1032
|
}
|
|
1023
|
-
if (
|
|
1033
|
+
if (BUILD11.slotRelocation) {
|
|
1024
1034
|
vnode.$name$ = null;
|
|
1025
1035
|
}
|
|
1026
1036
|
return vnode;
|
|
@@ -1079,11 +1089,11 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1079
1089
|
const childRenderNodes = [];
|
|
1080
1090
|
const slotNodes = [];
|
|
1081
1091
|
const slottedNodes = [];
|
|
1082
|
-
const shadowRootNodes =
|
|
1092
|
+
const shadowRootNodes = BUILD12.shadowDom && shadowRoot ? [] : null;
|
|
1083
1093
|
const vnode = newVNode(tagName, null);
|
|
1084
1094
|
vnode.$elm$ = hostElm;
|
|
1085
1095
|
let scopeId2;
|
|
1086
|
-
if (
|
|
1096
|
+
if (BUILD12.scoped) {
|
|
1087
1097
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
1088
1098
|
if (cmpMeta && cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */ && hostElm["s-sc"]) {
|
|
1089
1099
|
scopeId2 = hostElm["s-sc"];
|
|
@@ -1171,7 +1181,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1171
1181
|
slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
|
|
1172
1182
|
}
|
|
1173
1183
|
addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
|
|
1174
|
-
if (
|
|
1184
|
+
if (BUILD12.experimentalSlotFixes) {
|
|
1175
1185
|
patchSlottedNode(slottedItem.node);
|
|
1176
1186
|
}
|
|
1177
1187
|
}
|
|
@@ -1180,12 +1190,12 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1180
1190
|
}
|
|
1181
1191
|
}
|
|
1182
1192
|
}
|
|
1183
|
-
if (
|
|
1193
|
+
if (BUILD12.scoped && scopeId2 && slotNodes.length) {
|
|
1184
1194
|
slotNodes.forEach((slot) => {
|
|
1185
1195
|
slot.$elm$.parentElement.classList.add(scopeId2 + "-s");
|
|
1186
1196
|
});
|
|
1187
1197
|
}
|
|
1188
|
-
if (
|
|
1198
|
+
if (BUILD12.shadowDom && shadowRoot) {
|
|
1189
1199
|
let rnIdex = 0;
|
|
1190
1200
|
const rnLen = shadowRootNodes.length;
|
|
1191
1201
|
for (rnIdex; rnIdex < rnLen; rnIdex++) {
|
|
@@ -1228,7 +1238,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1228
1238
|
if (!parentVNode.$children$) {
|
|
1229
1239
|
parentVNode.$children$ = [];
|
|
1230
1240
|
}
|
|
1231
|
-
if (
|
|
1241
|
+
if (BUILD12.scoped && scopeId2) {
|
|
1232
1242
|
node["s-si"] = scopeId2;
|
|
1233
1243
|
childVNode.$attrs$.class += " " + scopeId2;
|
|
1234
1244
|
}
|
|
@@ -1246,7 +1256,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1246
1256
|
shadowRootNodes,
|
|
1247
1257
|
slottedNodes
|
|
1248
1258
|
);
|
|
1249
|
-
if (
|
|
1259
|
+
if (BUILD12.scoped && scopeId2) {
|
|
1250
1260
|
node.classList.add(scopeId2);
|
|
1251
1261
|
}
|
|
1252
1262
|
}
|
|
@@ -1343,9 +1353,9 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1343
1353
|
slottedNodes
|
|
1344
1354
|
);
|
|
1345
1355
|
} else if (childNodeType === CONTENT_REF_ID) {
|
|
1346
|
-
if (
|
|
1356
|
+
if (BUILD12.shadowDom && shadowRootNodes) {
|
|
1347
1357
|
node.remove();
|
|
1348
|
-
} else if (
|
|
1358
|
+
} else if (BUILD12.slotRelocation) {
|
|
1349
1359
|
hostElm["s-cr"] = node;
|
|
1350
1360
|
node["s-cn"] = true;
|
|
1351
1361
|
}
|
|
@@ -1407,7 +1417,7 @@ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNod
|
|
|
1407
1417
|
childVNode.$name$ = slotName || null;
|
|
1408
1418
|
childVNode.$tag$ = "slot";
|
|
1409
1419
|
const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
|
|
1410
|
-
if (
|
|
1420
|
+
if (BUILD12.shadowDom && shadowRootNodes) {
|
|
1411
1421
|
const slot = childVNode.$elm$ = doc.createElement(childVNode.$tag$);
|
|
1412
1422
|
if (childVNode.$name$) {
|
|
1413
1423
|
childVNode.$elm$.setAttribute("name", slotName);
|
|
@@ -1448,7 +1458,7 @@ var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) =>
|
|
|
1448
1458
|
};
|
|
1449
1459
|
|
|
1450
1460
|
// src/runtime/initialize-component.ts
|
|
1451
|
-
import { BUILD as
|
|
1461
|
+
import { BUILD as BUILD23 } from "@stencil/core/internal/app-data";
|
|
1452
1462
|
|
|
1453
1463
|
// src/runtime/mode.ts
|
|
1454
1464
|
var computeMode = (elm) => modeResolutionChain.map((h2) => h2(elm)).find((m) => !!m);
|
|
@@ -1456,22 +1466,22 @@ var setMode = (handler) => modeResolutionChain.push(handler);
|
|
|
1456
1466
|
var getMode = (ref) => getHostRef(ref).$modeName$;
|
|
1457
1467
|
|
|
1458
1468
|
// src/runtime/proxy-component.ts
|
|
1459
|
-
import { BUILD as
|
|
1469
|
+
import { BUILD as BUILD22 } from "@stencil/core/internal/app-data";
|
|
1460
1470
|
|
|
1461
1471
|
// src/runtime/set-value.ts
|
|
1462
|
-
import { BUILD as
|
|
1472
|
+
import { BUILD as BUILD21 } from "@stencil/core/internal/app-data";
|
|
1463
1473
|
|
|
1464
1474
|
// src/runtime/parse-property-value.ts
|
|
1465
|
-
import { BUILD as
|
|
1475
|
+
import { BUILD as BUILD13 } from "@stencil/core/internal/app-data";
|
|
1466
1476
|
var parsePropertyValue = (propValue, propType) => {
|
|
1467
1477
|
if (propValue != null && !isComplexType(propValue)) {
|
|
1468
|
-
if (
|
|
1478
|
+
if (BUILD13.propBoolean && propType & 4 /* Boolean */) {
|
|
1469
1479
|
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
1470
1480
|
}
|
|
1471
|
-
if (
|
|
1481
|
+
if (BUILD13.propNumber && propType & 2 /* Number */) {
|
|
1472
1482
|
return parseFloat(propValue);
|
|
1473
1483
|
}
|
|
1474
|
-
if (
|
|
1484
|
+
if (BUILD13.propString && propType & 1 /* String */) {
|
|
1475
1485
|
return String(propValue);
|
|
1476
1486
|
}
|
|
1477
1487
|
return propValue;
|
|
@@ -1480,21 +1490,21 @@ var parsePropertyValue = (propValue, propType) => {
|
|
|
1480
1490
|
};
|
|
1481
1491
|
|
|
1482
1492
|
// src/runtime/update-component.ts
|
|
1483
|
-
import { BUILD as
|
|
1493
|
+
import { BUILD as BUILD20, NAMESPACE } from "@stencil/core/internal/app-data";
|
|
1484
1494
|
|
|
1485
1495
|
// src/runtime/event-emitter.ts
|
|
1486
|
-
import { BUILD as
|
|
1496
|
+
import { BUILD as BUILD15 } from "@stencil/core/internal/app-data";
|
|
1487
1497
|
|
|
1488
1498
|
// src/runtime/element.ts
|
|
1489
|
-
import { BUILD as
|
|
1490
|
-
var getElement = (ref) =>
|
|
1499
|
+
import { BUILD as BUILD14 } from "@stencil/core/internal/app-data";
|
|
1500
|
+
var getElement = (ref) => BUILD14.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
|
|
1491
1501
|
|
|
1492
1502
|
// src/runtime/event-emitter.ts
|
|
1493
1503
|
var createEvent = (ref, name, flags) => {
|
|
1494
1504
|
const elm = getElement(ref);
|
|
1495
1505
|
return {
|
|
1496
1506
|
emit: (detail) => {
|
|
1497
|
-
if (
|
|
1507
|
+
if (BUILD15.isDev && !elm.isConnected) {
|
|
1498
1508
|
consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
|
|
1499
1509
|
}
|
|
1500
1510
|
return emitEvent(elm, name, {
|
|
@@ -1513,7 +1523,7 @@ var emitEvent = (elm, name, opts) => {
|
|
|
1513
1523
|
};
|
|
1514
1524
|
|
|
1515
1525
|
// src/runtime/styles.ts
|
|
1516
|
-
import { BUILD as
|
|
1526
|
+
import { BUILD as BUILD16 } from "@stencil/core/internal/app-data";
|
|
1517
1527
|
var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
|
|
1518
1528
|
var registerStyle = (scopeId2, cssText, allowCS) => {
|
|
1519
1529
|
let style = styles.get(scopeId2);
|
|
@@ -1533,7 +1543,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
1533
1543
|
var _a;
|
|
1534
1544
|
const scopeId2 = getScopeId(cmpMeta, mode);
|
|
1535
1545
|
const style = styles.get(scopeId2);
|
|
1536
|
-
if (!
|
|
1546
|
+
if (!BUILD16.attachStyles) {
|
|
1537
1547
|
return scopeId2;
|
|
1538
1548
|
}
|
|
1539
1549
|
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
|
@@ -1546,7 +1556,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
1546
1556
|
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
1547
1557
|
}
|
|
1548
1558
|
if (!appliedStyles.has(scopeId2)) {
|
|
1549
|
-
if (
|
|
1559
|
+
if (BUILD16.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
|
|
1550
1560
|
styleElm.innerHTML = style;
|
|
1551
1561
|
} else {
|
|
1552
1562
|
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
|
|
@@ -1555,7 +1565,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
1555
1565
|
if (nonce != null) {
|
|
1556
1566
|
styleElm.setAttribute("nonce", nonce);
|
|
1557
1567
|
}
|
|
1558
|
-
if ((
|
|
1568
|
+
if ((BUILD16.hydrateServerSide || BUILD16.hotModuleReplacement) && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
1559
1569
|
styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
|
|
1560
1570
|
}
|
|
1561
1571
|
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
@@ -1591,7 +1601,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
1591
1601
|
appliedStyles.add(scopeId2);
|
|
1592
1602
|
}
|
|
1593
1603
|
}
|
|
1594
|
-
} else if (
|
|
1604
|
+
} else if (BUILD16.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
1595
1605
|
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
1596
1606
|
}
|
|
1597
1607
|
}
|
|
@@ -1603,31 +1613,31 @@ var attachStyles = (hostRef) => {
|
|
|
1603
1613
|
const flags = cmpMeta.$flags$;
|
|
1604
1614
|
const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
|
|
1605
1615
|
const scopeId2 = addStyle(
|
|
1606
|
-
|
|
1616
|
+
BUILD16.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
1607
1617
|
cmpMeta,
|
|
1608
1618
|
hostRef.$modeName$
|
|
1609
1619
|
);
|
|
1610
|
-
if ((
|
|
1620
|
+
if ((BUILD16.shadowDom || BUILD16.scoped) && BUILD16.cssAnnotations && flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
|
|
1611
1621
|
elm["s-sc"] = scopeId2;
|
|
1612
1622
|
elm.classList.add(scopeId2 + "-h");
|
|
1613
1623
|
}
|
|
1614
1624
|
endAttachStyles();
|
|
1615
1625
|
};
|
|
1616
|
-
var getScopeId = (cmp, mode) => "sc-" + (
|
|
1626
|
+
var getScopeId = (cmp, mode) => "sc-" + (BUILD16.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
|
|
1617
1627
|
|
|
1618
1628
|
// src/runtime/vdom/vdom-render.ts
|
|
1619
|
-
import { BUILD as
|
|
1629
|
+
import { BUILD as BUILD19 } from "@stencil/core/internal/app-data";
|
|
1620
1630
|
|
|
1621
1631
|
// src/runtime/vdom/update-element.ts
|
|
1622
|
-
import { BUILD as
|
|
1632
|
+
import { BUILD as BUILD18 } from "@stencil/core/internal/app-data";
|
|
1623
1633
|
|
|
1624
1634
|
// src/runtime/vdom/set-accessor.ts
|
|
1625
|
-
import { BUILD as
|
|
1635
|
+
import { BUILD as BUILD17 } from "@stencil/core/internal/app-data";
|
|
1626
1636
|
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
1627
1637
|
if (oldValue !== newValue) {
|
|
1628
1638
|
let isProp = isMemberInElement(elm, memberName);
|
|
1629
1639
|
let ln = memberName.toLowerCase();
|
|
1630
|
-
if (
|
|
1640
|
+
if (BUILD17.vdomClass && memberName === "class") {
|
|
1631
1641
|
const classList = elm.classList;
|
|
1632
1642
|
const oldClasses = parseClassList(oldValue);
|
|
1633
1643
|
let newClasses = parseClassList(newValue);
|
|
@@ -1643,11 +1653,11 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
1643
1653
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
1644
1654
|
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
1645
1655
|
}
|
|
1646
|
-
} else if (
|
|
1647
|
-
if (
|
|
1656
|
+
} else if (BUILD17.vdomStyle && memberName === "style") {
|
|
1657
|
+
if (BUILD17.updatable) {
|
|
1648
1658
|
for (const prop in oldValue) {
|
|
1649
1659
|
if (!newValue || newValue[prop] == null) {
|
|
1650
|
-
if (!
|
|
1660
|
+
if (!BUILD17.hydrateServerSide && prop.includes("-")) {
|
|
1651
1661
|
elm.style.removeProperty(prop);
|
|
1652
1662
|
} else {
|
|
1653
1663
|
elm.style[prop] = "";
|
|
@@ -1657,19 +1667,19 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
1657
1667
|
}
|
|
1658
1668
|
for (const prop in newValue) {
|
|
1659
1669
|
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
1660
|
-
if (!
|
|
1670
|
+
if (!BUILD17.hydrateServerSide && prop.includes("-")) {
|
|
1661
1671
|
elm.style.setProperty(prop, newValue[prop]);
|
|
1662
1672
|
} else {
|
|
1663
1673
|
elm.style[prop] = newValue[prop];
|
|
1664
1674
|
}
|
|
1665
1675
|
}
|
|
1666
1676
|
}
|
|
1667
|
-
} else if (
|
|
1668
|
-
} else if (
|
|
1677
|
+
} else if (BUILD17.vdomKey && memberName === "key") {
|
|
1678
|
+
} else if (BUILD17.vdomRef && memberName === "ref") {
|
|
1669
1679
|
if (newValue) {
|
|
1670
1680
|
newValue(elm);
|
|
1671
1681
|
}
|
|
1672
|
-
} else if (
|
|
1682
|
+
} else if (BUILD17.vdomListener && (BUILD17.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
|
|
1673
1683
|
if (memberName[2] === "-") {
|
|
1674
1684
|
memberName = memberName.slice(3);
|
|
1675
1685
|
} else if (isMemberInElement(win, ln)) {
|
|
@@ -1687,7 +1697,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
1687
1697
|
plt.ael(elm, memberName, newValue, capture);
|
|
1688
1698
|
}
|
|
1689
1699
|
}
|
|
1690
|
-
} else if (
|
|
1700
|
+
} else if (BUILD17.vdomPropOrAttr) {
|
|
1691
1701
|
const isComplex = isComplexType(newValue);
|
|
1692
1702
|
if ((isProp || isComplex && newValue !== null) && !isSvg) {
|
|
1693
1703
|
try {
|
|
@@ -1709,7 +1719,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
1709
1719
|
}
|
|
1710
1720
|
}
|
|
1711
1721
|
let xlink = false;
|
|
1712
|
-
if (
|
|
1722
|
+
if (BUILD17.vdomXlink) {
|
|
1713
1723
|
if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) {
|
|
1714
1724
|
memberName = ln;
|
|
1715
1725
|
xlink = true;
|
|
@@ -1717,7 +1727,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
1717
1727
|
}
|
|
1718
1728
|
if (newValue == null || newValue === false) {
|
|
1719
1729
|
if (newValue !== false || elm.getAttribute(memberName) === "") {
|
|
1720
|
-
if (
|
|
1730
|
+
if (BUILD17.vdomXlink && xlink) {
|
|
1721
1731
|
elm.removeAttributeNS(XLINK_NS, memberName);
|
|
1722
1732
|
} else {
|
|
1723
1733
|
elm.removeAttribute(memberName);
|
|
@@ -1725,7 +1735,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
1725
1735
|
}
|
|
1726
1736
|
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
1727
1737
|
newValue = newValue === true ? "" : newValue;
|
|
1728
|
-
if (
|
|
1738
|
+
if (BUILD17.vdomXlink && xlink) {
|
|
1729
1739
|
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
|
1730
1740
|
} else {
|
|
1731
1741
|
elm.setAttribute(memberName, newValue);
|
|
@@ -1752,7 +1762,7 @@ var updateElement = (oldVnode, newVnode, isSvgMode2) => {
|
|
|
1752
1762
|
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
1753
1763
|
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
|
|
1754
1764
|
const newVnodeAttrs = newVnode.$attrs$ || {};
|
|
1755
|
-
if (
|
|
1765
|
+
if (BUILD18.updatable) {
|
|
1756
1766
|
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
1757
1767
|
if (!(memberName in newVnodeAttrs)) {
|
|
1758
1768
|
setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
|
|
@@ -1788,7 +1798,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
1788
1798
|
let elm;
|
|
1789
1799
|
let childNode;
|
|
1790
1800
|
let oldVNode;
|
|
1791
|
-
if (
|
|
1801
|
+
if (BUILD19.slotRelocation && !useNativeShadowDom) {
|
|
1792
1802
|
checkSlotRelocate = true;
|
|
1793
1803
|
if (newVNode2.$tag$ === "slot") {
|
|
1794
1804
|
newVNode2.$flags$ |= newVNode2.$children$ ? (
|
|
@@ -1803,32 +1813,32 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
1803
1813
|
);
|
|
1804
1814
|
}
|
|
1805
1815
|
}
|
|
1806
|
-
if (
|
|
1816
|
+
if (BUILD19.isDev && newVNode2.$elm$) {
|
|
1807
1817
|
consoleDevError(
|
|
1808
1818
|
`The JSX ${newVNode2.$text$ !== null ? `"${newVNode2.$text$}" text` : `"${newVNode2.$tag$}" element`} node should not be shared within the same renderer. The renderer caches element lookups in order to improve performance. However, a side effect from this is that the exact same JSX node should not be reused. For more information please see https://stenciljs.com/docs/templating-jsx#avoid-shared-jsx-nodes`
|
|
1809
1819
|
);
|
|
1810
1820
|
}
|
|
1811
|
-
if (
|
|
1821
|
+
if (BUILD19.vdomText && newVNode2.$text$ !== null) {
|
|
1812
1822
|
elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
|
|
1813
|
-
} else if (
|
|
1814
|
-
elm = newVNode2.$elm$ =
|
|
1823
|
+
} else if (BUILD19.slotRelocation && newVNode2.$flags$ & 1 /* isSlotReference */) {
|
|
1824
|
+
elm = newVNode2.$elm$ = BUILD19.isDebug || BUILD19.hydrateServerSide ? slotReferenceDebugNode(newVNode2) : doc.createTextNode("");
|
|
1815
1825
|
} else {
|
|
1816
|
-
if (
|
|
1826
|
+
if (BUILD19.svg && !isSvgMode) {
|
|
1817
1827
|
isSvgMode = newVNode2.$tag$ === "svg";
|
|
1818
1828
|
}
|
|
1819
|
-
elm = newVNode2.$elm$ =
|
|
1829
|
+
elm = newVNode2.$elm$ = BUILD19.svg ? doc.createElementNS(
|
|
1820
1830
|
isSvgMode ? SVG_NS : HTML_NS,
|
|
1821
|
-
!useNativeShadowDom &&
|
|
1831
|
+
!useNativeShadowDom && BUILD19.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
1822
1832
|
) : doc.createElement(
|
|
1823
|
-
!useNativeShadowDom &&
|
|
1833
|
+
!useNativeShadowDom && BUILD19.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
1824
1834
|
);
|
|
1825
|
-
if (
|
|
1835
|
+
if (BUILD19.svg && isSvgMode && newVNode2.$tag$ === "foreignObject") {
|
|
1826
1836
|
isSvgMode = false;
|
|
1827
1837
|
}
|
|
1828
|
-
if (
|
|
1838
|
+
if (BUILD19.vdomAttribute) {
|
|
1829
1839
|
updateElement(null, newVNode2, isSvgMode);
|
|
1830
1840
|
}
|
|
1831
|
-
if (
|
|
1841
|
+
if (BUILD19.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
1832
1842
|
elm.classList.add(elm["s-si"] = scopeId);
|
|
1833
1843
|
}
|
|
1834
1844
|
if (newVNode2.$children$) {
|
|
@@ -1839,7 +1849,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
1839
1849
|
}
|
|
1840
1850
|
}
|
|
1841
1851
|
}
|
|
1842
|
-
if (
|
|
1852
|
+
if (BUILD19.svg) {
|
|
1843
1853
|
if (newVNode2.$tag$ === "svg") {
|
|
1844
1854
|
isSvgMode = false;
|
|
1845
1855
|
} else if (elm.tagName === "foreignObject") {
|
|
@@ -1848,7 +1858,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
1848
1858
|
}
|
|
1849
1859
|
}
|
|
1850
1860
|
elm["s-hn"] = hostTagName;
|
|
1851
|
-
if (
|
|
1861
|
+
if (BUILD19.slotRelocation) {
|
|
1852
1862
|
if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
|
|
1853
1863
|
elm["s-sr"] = true;
|
|
1854
1864
|
elm["s-cr"] = contentRef;
|
|
@@ -1856,13 +1866,13 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
1856
1866
|
elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
|
|
1857
1867
|
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
|
1858
1868
|
if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
|
|
1859
|
-
if (
|
|
1869
|
+
if (BUILD19.experimentalSlotFixes) {
|
|
1860
1870
|
relocateToHostRoot(oldParentVNode.$elm$);
|
|
1861
1871
|
} else {
|
|
1862
1872
|
putBackInOriginalLocation(oldParentVNode.$elm$, false);
|
|
1863
1873
|
}
|
|
1864
1874
|
}
|
|
1865
|
-
if (
|
|
1875
|
+
if (BUILD19.scoped) {
|
|
1866
1876
|
addRemoveSlotScopedClass(contentRef, elm, newParentVNode.$elm$, oldParentVNode == null ? void 0 : oldParentVNode.$elm$);
|
|
1867
1877
|
}
|
|
1868
1878
|
}
|
|
@@ -1892,7 +1902,7 @@ var relocateToHostRoot = (parentElm) => {
|
|
|
1892
1902
|
var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
1893
1903
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1894
1904
|
const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
|
|
1895
|
-
if (parentElm["s-sr"] &&
|
|
1905
|
+
if (parentElm["s-sr"] && BUILD19.experimentalSlotFixes) {
|
|
1896
1906
|
let node = parentElm;
|
|
1897
1907
|
while (node = node.nextSibling) {
|
|
1898
1908
|
if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
|
|
@@ -1916,9 +1926,9 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
1916
1926
|
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
1917
1927
|
};
|
|
1918
1928
|
var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
1919
|
-
let containerElm =
|
|
1929
|
+
let containerElm = BUILD19.slotRelocation && parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
|
|
1920
1930
|
let childNode;
|
|
1921
|
-
if (
|
|
1931
|
+
if (BUILD19.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
1922
1932
|
containerElm = containerElm.shadowRoot;
|
|
1923
1933
|
}
|
|
1924
1934
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
@@ -1926,7 +1936,7 @@ var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
|
1926
1936
|
childNode = createElm(null, parentVNode, startIdx);
|
|
1927
1937
|
if (childNode) {
|
|
1928
1938
|
vnodes[startIdx].$elm$ = childNode;
|
|
1929
|
-
insertBefore(containerElm, childNode,
|
|
1939
|
+
insertBefore(containerElm, childNode, BUILD19.slotRelocation ? referenceNode(before) : before);
|
|
1930
1940
|
}
|
|
1931
1941
|
}
|
|
1932
1942
|
}
|
|
@@ -1938,7 +1948,7 @@ var removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
|
1938
1948
|
const elm = vnode.$elm$;
|
|
1939
1949
|
nullifyVNodeRefs(vnode);
|
|
1940
1950
|
if (elm) {
|
|
1941
|
-
if (
|
|
1951
|
+
if (BUILD19.slotRelocation) {
|
|
1942
1952
|
checkSlotFallbackVisibility = true;
|
|
1943
1953
|
if (elm["s-ol"]) {
|
|
1944
1954
|
elm["s-ol"].remove();
|
|
@@ -1982,7 +1992,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1982
1992
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
1983
1993
|
newEndVnode = newCh[--newEndIdx];
|
|
1984
1994
|
} else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
|
|
1985
|
-
if (
|
|
1995
|
+
if (BUILD19.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
1986
1996
|
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
1987
1997
|
}
|
|
1988
1998
|
patch(oldStartVnode, newEndVnode, isInitialRender);
|
|
@@ -1990,7 +2000,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1990
2000
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
1991
2001
|
newEndVnode = newCh[--newEndIdx];
|
|
1992
2002
|
} else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
|
|
1993
|
-
if (
|
|
2003
|
+
if (BUILD19.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
1994
2004
|
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
1995
2005
|
}
|
|
1996
2006
|
patch(oldEndVnode, newStartVnode, isInitialRender);
|
|
@@ -1999,7 +2009,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1999
2009
|
newStartVnode = newCh[++newStartIdx];
|
|
2000
2010
|
} else {
|
|
2001
2011
|
idxInOld = -1;
|
|
2002
|
-
if (
|
|
2012
|
+
if (BUILD19.vdomKey) {
|
|
2003
2013
|
for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
|
|
2004
2014
|
if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
|
|
2005
2015
|
idxInOld = i2;
|
|
@@ -2007,7 +2017,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
2007
2017
|
}
|
|
2008
2018
|
}
|
|
2009
2019
|
}
|
|
2010
|
-
if (
|
|
2020
|
+
if (BUILD19.vdomKey && idxInOld >= 0) {
|
|
2011
2021
|
elmToMove = oldCh[idxInOld];
|
|
2012
2022
|
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
2013
2023
|
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
|
|
@@ -2022,7 +2032,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
2022
2032
|
newStartVnode = newCh[++newStartIdx];
|
|
2023
2033
|
}
|
|
2024
2034
|
if (node) {
|
|
2025
|
-
if (
|
|
2035
|
+
if (BUILD19.slotRelocation) {
|
|
2026
2036
|
insertBefore(
|
|
2027
2037
|
referenceNode(oldStartVnode.$elm$).parentNode,
|
|
2028
2038
|
node,
|
|
@@ -2043,16 +2053,16 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
2043
2053
|
newStartIdx,
|
|
2044
2054
|
newEndIdx
|
|
2045
2055
|
);
|
|
2046
|
-
} else if (
|
|
2056
|
+
} else if (BUILD19.updatable && newStartIdx > newEndIdx) {
|
|
2047
2057
|
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
|
2048
2058
|
}
|
|
2049
2059
|
};
|
|
2050
2060
|
var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
2051
2061
|
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
2052
|
-
if (
|
|
2062
|
+
if (BUILD19.slotRelocation && leftVNode.$tag$ === "slot") {
|
|
2053
2063
|
return leftVNode.$name$ === rightVNode.$name$;
|
|
2054
2064
|
}
|
|
2055
|
-
if (
|
|
2065
|
+
if (BUILD19.vdomKey && !isInitialRender) {
|
|
2056
2066
|
return leftVNode.$key$ === rightVNode.$key$;
|
|
2057
2067
|
}
|
|
2058
2068
|
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
|
|
@@ -2070,13 +2080,13 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
2070
2080
|
const tag = newVNode2.$tag$;
|
|
2071
2081
|
const text = newVNode2.$text$;
|
|
2072
2082
|
let defaultHolder;
|
|
2073
|
-
if (!
|
|
2074
|
-
if (
|
|
2083
|
+
if (!BUILD19.vdomText || text === null) {
|
|
2084
|
+
if (BUILD19.svg) {
|
|
2075
2085
|
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
|
2076
2086
|
}
|
|
2077
|
-
if (
|
|
2078
|
-
if (
|
|
2079
|
-
if (
|
|
2087
|
+
if (BUILD19.vdomAttribute || BUILD19.reflect) {
|
|
2088
|
+
if (BUILD19.slot && tag === "slot" && !useNativeShadowDom) {
|
|
2089
|
+
if (BUILD19.experimentalSlotFixes && oldVNode.$name$ !== newVNode2.$name$) {
|
|
2080
2090
|
newVNode2.$elm$["s-sn"] = newVNode2.$name$ || "";
|
|
2081
2091
|
relocateToHostRoot(newVNode2.$elm$.parentElement);
|
|
2082
2092
|
}
|
|
@@ -2084,25 +2094,25 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
2084
2094
|
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
2085
2095
|
}
|
|
2086
2096
|
}
|
|
2087
|
-
if (
|
|
2097
|
+
if (BUILD19.updatable && oldChildren !== null && newChildren !== null) {
|
|
2088
2098
|
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
|
|
2089
2099
|
} else if (newChildren !== null) {
|
|
2090
|
-
if (
|
|
2100
|
+
if (BUILD19.updatable && BUILD19.vdomText && oldVNode.$text$ !== null) {
|
|
2091
2101
|
elm.textContent = "";
|
|
2092
2102
|
}
|
|
2093
2103
|
addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
|
|
2094
2104
|
} else if (
|
|
2095
2105
|
// don't do this on initial render as it can cause non-hydrated content to be removed
|
|
2096
|
-
!isInitialRender &&
|
|
2106
|
+
!isInitialRender && BUILD19.updatable && oldChildren !== null
|
|
2097
2107
|
) {
|
|
2098
2108
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
2099
2109
|
}
|
|
2100
|
-
if (
|
|
2110
|
+
if (BUILD19.svg && isSvgMode && tag === "svg") {
|
|
2101
2111
|
isSvgMode = false;
|
|
2102
2112
|
}
|
|
2103
|
-
} else if (
|
|
2113
|
+
} else if (BUILD19.vdomText && BUILD19.slotRelocation && (defaultHolder = elm["s-cr"])) {
|
|
2104
2114
|
defaultHolder.parentNode.textContent = text;
|
|
2105
|
-
} else if (
|
|
2115
|
+
} else if (BUILD19.vdomText && oldVNode.$text$ !== text) {
|
|
2106
2116
|
elm.data = text;
|
|
2107
2117
|
}
|
|
2108
2118
|
};
|
|
@@ -2118,7 +2128,7 @@ var markSlotContentForRelocation = (elm) => {
|
|
|
2118
2128
|
const slotName = childNode["s-sn"];
|
|
2119
2129
|
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
|
2120
2130
|
node = hostContentNodes[j];
|
|
2121
|
-
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!
|
|
2131
|
+
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!BUILD19.experimentalSlotFixes || !node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
|
|
2122
2132
|
if (isNodeLocatedInSlot(node, slotName)) {
|
|
2123
2133
|
let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
2124
2134
|
checkSlotFallbackVisibility = true;
|
|
@@ -2157,21 +2167,21 @@ var markSlotContentForRelocation = (elm) => {
|
|
|
2157
2167
|
}
|
|
2158
2168
|
};
|
|
2159
2169
|
var nullifyVNodeRefs = (vNode) => {
|
|
2160
|
-
if (
|
|
2170
|
+
if (BUILD19.vdomRef) {
|
|
2161
2171
|
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
2162
2172
|
vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
|
|
2163
2173
|
}
|
|
2164
2174
|
};
|
|
2165
2175
|
var insertBefore = (parent, newNode, reference) => {
|
|
2166
|
-
if (
|
|
2176
|
+
if (BUILD19.scoped && typeof newNode["s-sn"] === "string" && !!newNode["s-sr"] && !!newNode["s-cr"]) {
|
|
2167
2177
|
addRemoveSlotScopedClass(newNode["s-cr"], newNode, parent, newNode.parentElement);
|
|
2168
|
-
} else if (
|
|
2178
|
+
} else if (BUILD19.experimentalSlotFixes && typeof newNode["s-sn"] === "string") {
|
|
2169
2179
|
if (parent.getRootNode().nodeType !== 11 /* DOCUMENT_FRAGMENT_NODE */) {
|
|
2170
2180
|
patchParentNode(newNode);
|
|
2171
2181
|
}
|
|
2172
2182
|
return parent.insertBefore(newNode, reference);
|
|
2173
2183
|
}
|
|
2174
|
-
if (
|
|
2184
|
+
if (BUILD19.experimentalSlotFixes && parent.__insertBefore) {
|
|
2175
2185
|
return parent.__insertBefore(newNode, reference);
|
|
2176
2186
|
} else {
|
|
2177
2187
|
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
@@ -2205,7 +2215,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
2205
2215
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
2206
2216
|
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
2207
2217
|
hostTagName = hostElm.tagName;
|
|
2208
|
-
if (
|
|
2218
|
+
if (BUILD19.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
|
|
2209
2219
|
throw new Error(`The <Host> must be the single root component.
|
|
2210
2220
|
Looks like the render() function of "${hostTagName.toLowerCase()}" is returning an array that contains the <Host>.
|
|
2211
2221
|
|
|
@@ -2219,7 +2229,7 @@ render() {
|
|
|
2219
2229
|
}
|
|
2220
2230
|
`);
|
|
2221
2231
|
}
|
|
2222
|
-
if (
|
|
2232
|
+
if (BUILD19.reflect && cmpMeta.$attrsToReflect$) {
|
|
2223
2233
|
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
2224
2234
|
cmpMeta.$attrsToReflect$.map(
|
|
2225
2235
|
([propName, attribute]) => rootVnode.$attrs$[attribute] = hostElm[propName]
|
|
@@ -2235,24 +2245,24 @@ render() {
|
|
|
2235
2245
|
rootVnode.$tag$ = null;
|
|
2236
2246
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
2237
2247
|
hostRef.$vnode$ = rootVnode;
|
|
2238
|
-
rootVnode.$elm$ = oldVNode.$elm$ =
|
|
2239
|
-
if (
|
|
2248
|
+
rootVnode.$elm$ = oldVNode.$elm$ = BUILD19.shadowDom ? hostElm.shadowRoot || hostElm : hostElm;
|
|
2249
|
+
if (BUILD19.scoped || BUILD19.shadowDom) {
|
|
2240
2250
|
scopeId = hostElm["s-sc"];
|
|
2241
2251
|
}
|
|
2242
2252
|
useNativeShadowDom = supportsShadow && (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
2243
|
-
if (
|
|
2253
|
+
if (BUILD19.slotRelocation) {
|
|
2244
2254
|
contentRef = hostElm["s-cr"];
|
|
2245
2255
|
checkSlotFallbackVisibility = false;
|
|
2246
2256
|
}
|
|
2247
2257
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
2248
|
-
if (
|
|
2258
|
+
if (BUILD19.slotRelocation) {
|
|
2249
2259
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
2250
2260
|
if (checkSlotRelocate) {
|
|
2251
2261
|
markSlotContentForRelocation(rootVnode.$elm$);
|
|
2252
2262
|
for (const relocateData of relocateNodes) {
|
|
2253
2263
|
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
2254
2264
|
if (!nodeToRelocate["s-ol"]) {
|
|
2255
|
-
const orgLocationNode =
|
|
2265
|
+
const orgLocationNode = BUILD19.isDebug || BUILD19.hydrateServerSide ? originalLocationDebugNode(nodeToRelocate) : doc.createTextNode("");
|
|
2256
2266
|
orgLocationNode["s-nr"] = nodeToRelocate;
|
|
2257
2267
|
insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
|
|
2258
2268
|
}
|
|
@@ -2263,7 +2273,7 @@ render() {
|
|
|
2263
2273
|
if (slotRefNode) {
|
|
2264
2274
|
const parentNodeRef = slotRefNode.parentNode;
|
|
2265
2275
|
let insertBeforeNode = slotRefNode.nextSibling;
|
|
2266
|
-
if (!
|
|
2276
|
+
if (!BUILD19.hydrateServerSide && (!BUILD19.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */)) {
|
|
2267
2277
|
let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
|
|
2268
2278
|
while (orgLocationNode) {
|
|
2269
2279
|
let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
|
|
@@ -2284,7 +2294,7 @@ render() {
|
|
|
2284
2294
|
const nextSibling = nodeToRelocate.__nextSibling || nodeToRelocate.nextSibling;
|
|
2285
2295
|
if (!insertBeforeNode && parentNodeRef !== parent || nextSibling !== insertBeforeNode) {
|
|
2286
2296
|
if (nodeToRelocate !== insertBeforeNode) {
|
|
2287
|
-
if (!
|
|
2297
|
+
if (!BUILD19.experimentalSlotFixes && !nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
|
|
2288
2298
|
nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
|
|
2289
2299
|
}
|
|
2290
2300
|
insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
|
|
@@ -2310,7 +2320,7 @@ render() {
|
|
|
2310
2320
|
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
2311
2321
|
relocateNodes.length = 0;
|
|
2312
2322
|
}
|
|
2313
|
-
if (
|
|
2323
|
+
if (BUILD19.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2314
2324
|
const children = rootVnode.$elm$.__childNodes || rootVnode.$elm$.childNodes;
|
|
2315
2325
|
for (const childNode of children) {
|
|
2316
2326
|
if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
|
|
@@ -2332,7 +2342,7 @@ var originalLocationDebugNode = (nodeToRelocate) => doc.createComment(
|
|
|
2332
2342
|
|
|
2333
2343
|
// src/runtime/update-component.ts
|
|
2334
2344
|
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
2335
|
-
if (
|
|
2345
|
+
if (BUILD20.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
2336
2346
|
const index = ancestorComponent["s-p"].push(
|
|
2337
2347
|
new Promise(
|
|
2338
2348
|
(r) => hostRef.$onRenderResolve$ = () => {
|
|
@@ -2344,21 +2354,21 @@ var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
|
2344
2354
|
}
|
|
2345
2355
|
};
|
|
2346
2356
|
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
2347
|
-
if (
|
|
2357
|
+
if (BUILD20.taskQueue && BUILD20.updatable) {
|
|
2348
2358
|
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
|
|
2349
2359
|
}
|
|
2350
|
-
if (
|
|
2360
|
+
if (BUILD20.asyncLoading && hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
|
2351
2361
|
hostRef.$flags$ |= 512 /* needsRerender */;
|
|
2352
2362
|
return;
|
|
2353
2363
|
}
|
|
2354
2364
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
2355
2365
|
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
|
|
2356
|
-
return
|
|
2366
|
+
return BUILD20.taskQueue ? writeTask(dispatch) : dispatch();
|
|
2357
2367
|
};
|
|
2358
2368
|
var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
2359
2369
|
const elm = hostRef.$hostElement$;
|
|
2360
2370
|
const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
|
|
2361
|
-
const instance =
|
|
2371
|
+
const instance = BUILD20.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2362
2372
|
if (!instance) {
|
|
2363
2373
|
throw new Error(
|
|
2364
2374
|
`Can't render component <${elm.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`
|
|
@@ -2366,26 +2376,26 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
2366
2376
|
}
|
|
2367
2377
|
let maybePromise;
|
|
2368
2378
|
if (isInitialLoad) {
|
|
2369
|
-
if (
|
|
2379
|
+
if (BUILD20.lazyLoad && BUILD20.hostListener) {
|
|
2370
2380
|
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
2371
2381
|
if (hostRef.$queuedListeners$) {
|
|
2372
|
-
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
2382
|
+
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event, elm));
|
|
2373
2383
|
hostRef.$queuedListeners$ = void 0;
|
|
2374
2384
|
}
|
|
2375
2385
|
}
|
|
2376
2386
|
emitLifecycleEvent(elm, "componentWillLoad");
|
|
2377
|
-
if (
|
|
2378
|
-
maybePromise = safeCall(instance, "componentWillLoad");
|
|
2387
|
+
if (BUILD20.cmpWillLoad) {
|
|
2388
|
+
maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
|
|
2379
2389
|
}
|
|
2380
2390
|
} else {
|
|
2381
2391
|
emitLifecycleEvent(elm, "componentWillUpdate");
|
|
2382
|
-
if (
|
|
2383
|
-
maybePromise = safeCall(instance, "componentWillUpdate");
|
|
2392
|
+
if (BUILD20.cmpWillUpdate) {
|
|
2393
|
+
maybePromise = safeCall(instance, "componentWillUpdate", void 0, elm);
|
|
2384
2394
|
}
|
|
2385
2395
|
}
|
|
2386
2396
|
emitLifecycleEvent(elm, "componentWillRender");
|
|
2387
|
-
if (
|
|
2388
|
-
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender"));
|
|
2397
|
+
if (BUILD20.cmpWillRender) {
|
|
2398
|
+
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
|
|
2389
2399
|
}
|
|
2390
2400
|
endSchedule();
|
|
2391
2401
|
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
@@ -2400,23 +2410,23 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
2400
2410
|
const elm = hostRef.$hostElement$;
|
|
2401
2411
|
const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
|
|
2402
2412
|
const rc = elm["s-rc"];
|
|
2403
|
-
if (
|
|
2413
|
+
if (BUILD20.style && isInitialLoad) {
|
|
2404
2414
|
attachStyles(hostRef);
|
|
2405
2415
|
}
|
|
2406
2416
|
const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
|
|
2407
|
-
if (
|
|
2417
|
+
if (BUILD20.isDev) {
|
|
2408
2418
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
2409
2419
|
}
|
|
2410
|
-
if (
|
|
2420
|
+
if (BUILD20.hydrateServerSide) {
|
|
2411
2421
|
await callRender(hostRef, instance, elm, isInitialLoad);
|
|
2412
2422
|
} else {
|
|
2413
2423
|
callRender(hostRef, instance, elm, isInitialLoad);
|
|
2414
2424
|
}
|
|
2415
|
-
if (
|
|
2425
|
+
if (BUILD20.isDev) {
|
|
2416
2426
|
hostRef.$renderCount$ = hostRef.$renderCount$ === void 0 ? 1 : hostRef.$renderCount$ + 1;
|
|
2417
2427
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
2418
2428
|
}
|
|
2419
|
-
if (
|
|
2429
|
+
if (BUILD20.hydrateServerSide) {
|
|
2420
2430
|
try {
|
|
2421
2431
|
serverSideConnected(elm);
|
|
2422
2432
|
if (isInitialLoad) {
|
|
@@ -2430,13 +2440,13 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
2430
2440
|
consoleError(e, elm);
|
|
2431
2441
|
}
|
|
2432
2442
|
}
|
|
2433
|
-
if (
|
|
2443
|
+
if (BUILD20.asyncLoading && rc) {
|
|
2434
2444
|
rc.map((cb) => cb());
|
|
2435
2445
|
elm["s-rc"] = void 0;
|
|
2436
2446
|
}
|
|
2437
2447
|
endRender();
|
|
2438
2448
|
endUpdate();
|
|
2439
|
-
if (
|
|
2449
|
+
if (BUILD20.asyncLoading) {
|
|
2440
2450
|
const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
|
|
2441
2451
|
const postUpdate = () => postUpdateComponent(hostRef);
|
|
2442
2452
|
if (childrenPromises.length === 0) {
|
|
@@ -2452,10 +2462,10 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
2452
2462
|
};
|
|
2453
2463
|
var renderingRef = null;
|
|
2454
2464
|
var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
2455
|
-
const allRenderFn =
|
|
2456
|
-
const lazyLoad =
|
|
2457
|
-
const taskQueue =
|
|
2458
|
-
const updatable =
|
|
2465
|
+
const allRenderFn = BUILD20.allRenderFn ? true : false;
|
|
2466
|
+
const lazyLoad = BUILD20.lazyLoad ? true : false;
|
|
2467
|
+
const taskQueue = BUILD20.taskQueue ? true : false;
|
|
2468
|
+
const updatable = BUILD20.updatable ? true : false;
|
|
2459
2469
|
try {
|
|
2460
2470
|
renderingRef = instance;
|
|
2461
2471
|
instance = allRenderFn ? instance.render() : instance.render && instance.render();
|
|
@@ -2465,9 +2475,9 @@ var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
|
2465
2475
|
if (updatable || lazyLoad) {
|
|
2466
2476
|
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
2467
2477
|
}
|
|
2468
|
-
if (
|
|
2469
|
-
if (
|
|
2470
|
-
if (
|
|
2478
|
+
if (BUILD20.hasRenderFn || BUILD20.reflect) {
|
|
2479
|
+
if (BUILD20.vdomRender || BUILD20.reflect) {
|
|
2480
|
+
if (BUILD20.hydrateServerSide) {
|
|
2471
2481
|
return Promise.resolve(instance).then((value) => renderVdom(hostRef, value, isInitialLoad));
|
|
2472
2482
|
} else {
|
|
2473
2483
|
renderVdom(hostRef, instance, isInitialLoad);
|
|
@@ -2492,57 +2502,57 @@ var postUpdateComponent = (hostRef) => {
|
|
|
2492
2502
|
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
2493
2503
|
const elm = hostRef.$hostElement$;
|
|
2494
2504
|
const endPostUpdate = createTime("postUpdate", tagName);
|
|
2495
|
-
const instance =
|
|
2505
|
+
const instance = BUILD20.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2496
2506
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
2497
|
-
if (
|
|
2498
|
-
if (
|
|
2507
|
+
if (BUILD20.cmpDidRender) {
|
|
2508
|
+
if (BUILD20.isDev) {
|
|
2499
2509
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
2500
2510
|
}
|
|
2501
|
-
safeCall(instance, "componentDidRender");
|
|
2502
|
-
if (
|
|
2511
|
+
safeCall(instance, "componentDidRender", void 0, elm);
|
|
2512
|
+
if (BUILD20.isDev) {
|
|
2503
2513
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
2504
2514
|
}
|
|
2505
2515
|
}
|
|
2506
2516
|
emitLifecycleEvent(elm, "componentDidRender");
|
|
2507
2517
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
2508
2518
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
2509
|
-
if (
|
|
2519
|
+
if (BUILD20.asyncLoading && BUILD20.cssAnnotations) {
|
|
2510
2520
|
addHydratedFlag(elm);
|
|
2511
2521
|
}
|
|
2512
|
-
if (
|
|
2513
|
-
if (
|
|
2522
|
+
if (BUILD20.cmpDidLoad) {
|
|
2523
|
+
if (BUILD20.isDev) {
|
|
2514
2524
|
hostRef.$flags$ |= 2048 /* devOnDidLoad */;
|
|
2515
2525
|
}
|
|
2516
|
-
safeCall(instance, "componentDidLoad");
|
|
2517
|
-
if (
|
|
2526
|
+
safeCall(instance, "componentDidLoad", void 0, elm);
|
|
2527
|
+
if (BUILD20.isDev) {
|
|
2518
2528
|
hostRef.$flags$ &= ~2048 /* devOnDidLoad */;
|
|
2519
2529
|
}
|
|
2520
2530
|
}
|
|
2521
2531
|
emitLifecycleEvent(elm, "componentDidLoad");
|
|
2522
2532
|
endPostUpdate();
|
|
2523
|
-
if (
|
|
2533
|
+
if (BUILD20.asyncLoading) {
|
|
2524
2534
|
hostRef.$onReadyResolve$(elm);
|
|
2525
2535
|
if (!ancestorComponent) {
|
|
2526
2536
|
appDidLoad(tagName);
|
|
2527
2537
|
}
|
|
2528
2538
|
}
|
|
2529
2539
|
} else {
|
|
2530
|
-
if (
|
|
2531
|
-
if (
|
|
2540
|
+
if (BUILD20.cmpDidUpdate) {
|
|
2541
|
+
if (BUILD20.isDev) {
|
|
2532
2542
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
2533
2543
|
}
|
|
2534
|
-
safeCall(instance, "componentDidUpdate");
|
|
2535
|
-
if (
|
|
2544
|
+
safeCall(instance, "componentDidUpdate", void 0, elm);
|
|
2545
|
+
if (BUILD20.isDev) {
|
|
2536
2546
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
2537
2547
|
}
|
|
2538
2548
|
}
|
|
2539
2549
|
emitLifecycleEvent(elm, "componentDidUpdate");
|
|
2540
2550
|
endPostUpdate();
|
|
2541
2551
|
}
|
|
2542
|
-
if (
|
|
2552
|
+
if (BUILD20.method && BUILD20.lazyLoad) {
|
|
2543
2553
|
hostRef.$onInstanceResolve$(elm);
|
|
2544
2554
|
}
|
|
2545
|
-
if (
|
|
2555
|
+
if (BUILD20.asyncLoading) {
|
|
2546
2556
|
if (hostRef.$onRenderResolve$) {
|
|
2547
2557
|
hostRef.$onRenderResolve$();
|
|
2548
2558
|
hostRef.$onRenderResolve$ = void 0;
|
|
@@ -2554,7 +2564,7 @@ var postUpdateComponent = (hostRef) => {
|
|
|
2554
2564
|
}
|
|
2555
2565
|
};
|
|
2556
2566
|
var forceUpdate = (ref) => {
|
|
2557
|
-
if (
|
|
2567
|
+
if (BUILD20.updatable && (Build.isBrowser || Build.isTesting)) {
|
|
2558
2568
|
const hostRef = getHostRef(ref);
|
|
2559
2569
|
const isConnected = hostRef.$hostElement$.isConnected;
|
|
2560
2570
|
if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
@@ -2565,29 +2575,29 @@ var forceUpdate = (ref) => {
|
|
|
2565
2575
|
return false;
|
|
2566
2576
|
};
|
|
2567
2577
|
var appDidLoad = (who) => {
|
|
2568
|
-
if (
|
|
2578
|
+
if (BUILD20.cssAnnotations) {
|
|
2569
2579
|
addHydratedFlag(doc.documentElement);
|
|
2570
2580
|
}
|
|
2571
|
-
if (
|
|
2581
|
+
if (BUILD20.asyncQueue) {
|
|
2572
2582
|
plt.$flags$ |= 2 /* appLoaded */;
|
|
2573
2583
|
}
|
|
2574
2584
|
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
2575
|
-
if (
|
|
2585
|
+
if (BUILD20.profile && performance.measure) {
|
|
2576
2586
|
performance.measure(`[Stencil] ${NAMESPACE} initial load (by ${who})`, "st:app:start");
|
|
2577
2587
|
}
|
|
2578
2588
|
};
|
|
2579
|
-
var safeCall = (instance, method, arg) => {
|
|
2589
|
+
var safeCall = (instance, method, arg, elm) => {
|
|
2580
2590
|
if (instance && instance[method]) {
|
|
2581
2591
|
try {
|
|
2582
2592
|
return instance[method](arg);
|
|
2583
2593
|
} catch (e) {
|
|
2584
|
-
consoleError(e);
|
|
2594
|
+
consoleError(e, elm);
|
|
2585
2595
|
}
|
|
2586
2596
|
}
|
|
2587
2597
|
return void 0;
|
|
2588
2598
|
};
|
|
2589
2599
|
var emitLifecycleEvent = (elm, lifecycleName) => {
|
|
2590
|
-
if (
|
|
2600
|
+
if (BUILD20.lifecycleDOMEvents) {
|
|
2591
2601
|
emitEvent(elm, "stencil_" + lifecycleName, {
|
|
2592
2602
|
bubbles: true,
|
|
2593
2603
|
composed: true,
|
|
@@ -2599,7 +2609,7 @@ var emitLifecycleEvent = (elm, lifecycleName) => {
|
|
|
2599
2609
|
};
|
|
2600
2610
|
var addHydratedFlag = (elm) => {
|
|
2601
2611
|
var _a, _b;
|
|
2602
|
-
return
|
|
2612
|
+
return BUILD20.hydratedClass ? elm.classList.add((_a = BUILD20.hydratedSelectorName) != null ? _a : "hydrated") : BUILD20.hydratedAttribute ? elm.setAttribute((_b = BUILD20.hydratedSelectorName) != null ? _b : "hydrated", "") : void 0;
|
|
2603
2613
|
};
|
|
2604
2614
|
var serverSideConnected = (elm) => {
|
|
2605
2615
|
const children = elm.children;
|
|
@@ -2618,21 +2628,21 @@ var serverSideConnected = (elm) => {
|
|
|
2618
2628
|
var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
2619
2629
|
var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
2620
2630
|
const hostRef = getHostRef(ref);
|
|
2621
|
-
if (
|
|
2631
|
+
if (BUILD21.lazyLoad && !hostRef) {
|
|
2622
2632
|
throw new Error(
|
|
2623
2633
|
`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/ionic-team/stencil/issues/5457).`
|
|
2624
2634
|
);
|
|
2625
2635
|
}
|
|
2626
|
-
const elm =
|
|
2636
|
+
const elm = BUILD21.lazyLoad ? hostRef.$hostElement$ : ref;
|
|
2627
2637
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
2628
2638
|
const flags = hostRef.$flags$;
|
|
2629
|
-
const instance =
|
|
2639
|
+
const instance = BUILD21.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2630
2640
|
newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
|
|
2631
2641
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
2632
2642
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
2633
|
-
if ((!
|
|
2643
|
+
if ((!BUILD21.lazyLoad || !(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
|
|
2634
2644
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
2635
|
-
if (
|
|
2645
|
+
if (BUILD21.isDev) {
|
|
2636
2646
|
if (hostRef.$flags$ & 1024 /* devOnRender */) {
|
|
2637
2647
|
consoleDevWarn(
|
|
2638
2648
|
`The state/prop "${propName}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`,
|
|
@@ -2655,8 +2665,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
2655
2665
|
);
|
|
2656
2666
|
}
|
|
2657
2667
|
}
|
|
2658
|
-
if (!
|
|
2659
|
-
if (
|
|
2668
|
+
if (!BUILD21.lazyLoad || instance) {
|
|
2669
|
+
if (BUILD21.watchCallback && cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
|
|
2660
2670
|
const watchMethods = cmpMeta.$watchers$[propName];
|
|
2661
2671
|
if (watchMethods) {
|
|
2662
2672
|
watchMethods.map((watchMethodName) => {
|
|
@@ -2668,8 +2678,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
2668
2678
|
});
|
|
2669
2679
|
}
|
|
2670
2680
|
}
|
|
2671
|
-
if (
|
|
2672
|
-
if (
|
|
2681
|
+
if (BUILD21.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
2682
|
+
if (BUILD21.cmpShouldUpdate && instance.componentShouldUpdate) {
|
|
2673
2683
|
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
|
2674
2684
|
return;
|
|
2675
2685
|
}
|
|
@@ -2684,40 +2694,46 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
2684
2694
|
var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
2685
2695
|
var _a, _b;
|
|
2686
2696
|
const prototype = Cstr.prototype;
|
|
2687
|
-
if (
|
|
2697
|
+
if (BUILD22.isTesting) {
|
|
2698
|
+
if (prototype.done) {
|
|
2699
|
+
return;
|
|
2700
|
+
}
|
|
2701
|
+
prototype.done = true;
|
|
2702
|
+
}
|
|
2703
|
+
if (BUILD22.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
|
|
2688
2704
|
FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach((cbName) => {
|
|
2689
2705
|
const originalFormAssociatedCallback = prototype[cbName];
|
|
2690
2706
|
Object.defineProperty(prototype, cbName, {
|
|
2691
2707
|
value(...args) {
|
|
2692
2708
|
const hostRef = getHostRef(this);
|
|
2693
|
-
const instance =
|
|
2709
|
+
const instance = BUILD22.lazyLoad ? hostRef.$lazyInstance$ : this;
|
|
2694
2710
|
if (!instance) {
|
|
2695
2711
|
hostRef.$onReadyPromise$.then((asyncInstance) => {
|
|
2696
2712
|
const cb = asyncInstance[cbName];
|
|
2697
2713
|
typeof cb === "function" && cb.call(asyncInstance, ...args);
|
|
2698
2714
|
});
|
|
2699
2715
|
} else {
|
|
2700
|
-
const cb =
|
|
2716
|
+
const cb = BUILD22.lazyLoad ? instance[cbName] : originalFormAssociatedCallback;
|
|
2701
2717
|
typeof cb === "function" && cb.call(instance, ...args);
|
|
2702
2718
|
}
|
|
2703
2719
|
}
|
|
2704
2720
|
});
|
|
2705
2721
|
});
|
|
2706
2722
|
}
|
|
2707
|
-
if (
|
|
2708
|
-
if (
|
|
2723
|
+
if (BUILD22.member && cmpMeta.$members$ || BUILD22.watchCallback && (cmpMeta.$watchers$ || Cstr.watchers)) {
|
|
2724
|
+
if (BUILD22.watchCallback && Cstr.watchers && !cmpMeta.$watchers$) {
|
|
2709
2725
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
2710
2726
|
}
|
|
2711
2727
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
2712
2728
|
members.map(([memberName, [memberFlags]]) => {
|
|
2713
|
-
if ((
|
|
2729
|
+
if ((BUILD22.prop || BUILD22.state) && (memberFlags & 31 /* Prop */ || (!BUILD22.lazyLoad || flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
2714
2730
|
const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
|
|
2715
2731
|
if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
|
|
2716
2732
|
if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
|
|
2717
2733
|
if (flags & 1 /* isElementConstructor */ || !origGetter) {
|
|
2718
2734
|
Object.defineProperty(prototype, memberName, {
|
|
2719
2735
|
get() {
|
|
2720
|
-
if (
|
|
2736
|
+
if (BUILD22.lazyLoad) {
|
|
2721
2737
|
if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
|
|
2722
2738
|
return getValue(this, memberName);
|
|
2723
2739
|
}
|
|
@@ -2726,7 +2742,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
2726
2742
|
if (!instance) return;
|
|
2727
2743
|
return instance[memberName];
|
|
2728
2744
|
}
|
|
2729
|
-
if (!
|
|
2745
|
+
if (!BUILD22.lazyLoad) {
|
|
2730
2746
|
return origGetter ? origGetter.apply(this) : getValue(this, memberName);
|
|
2731
2747
|
}
|
|
2732
2748
|
},
|
|
@@ -2737,14 +2753,14 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
2737
2753
|
Object.defineProperty(prototype, memberName, {
|
|
2738
2754
|
set(newValue) {
|
|
2739
2755
|
const ref = getHostRef(this);
|
|
2740
|
-
if (
|
|
2756
|
+
if (BUILD22.isDev) {
|
|
2741
2757
|
if (
|
|
2742
2758
|
// we are proxying the instance (not element)
|
|
2743
2759
|
(flags & 1 /* isElementConstructor */) === 0 && // if the class has a setter, then the Element can update instance values, so ignore
|
|
2744
2760
|
(cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0 && // the element is not constructing
|
|
2745
2761
|
(ref && ref.$flags$ & 8 /* isConstructingInstance */) === 0 && // the member is a prop
|
|
2746
|
-
(
|
|
2747
|
-
(
|
|
2762
|
+
(memberFlags & 31 /* Prop */) !== 0 && // the member is not mutable
|
|
2763
|
+
(memberFlags & 1024 /* Mutable */) === 0
|
|
2748
2764
|
) {
|
|
2749
2765
|
consoleDevWarn(
|
|
2750
2766
|
`@Prop() "${memberName}" on <${cmpMeta.$tagName$}> is immutable but was modified from within the component.
|
|
@@ -2764,11 +2780,11 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2764
2780
|
setValue(this, memberName, newValue, cmpMeta);
|
|
2765
2781
|
return;
|
|
2766
2782
|
}
|
|
2767
|
-
if (!
|
|
2783
|
+
if (!BUILD22.lazyLoad) {
|
|
2768
2784
|
setValue(this, memberName, newValue, cmpMeta);
|
|
2769
2785
|
return;
|
|
2770
2786
|
}
|
|
2771
|
-
if (
|
|
2787
|
+
if (BUILD22.lazyLoad) {
|
|
2772
2788
|
if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
|
|
2773
2789
|
setValue(this, memberName, newValue, cmpMeta);
|
|
2774
2790
|
if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
|
|
@@ -2796,7 +2812,7 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2796
2812
|
}
|
|
2797
2813
|
}
|
|
2798
2814
|
});
|
|
2799
|
-
} else if (
|
|
2815
|
+
} else if (BUILD22.lazyLoad && BUILD22.method && flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
|
|
2800
2816
|
Object.defineProperty(prototype, memberName, {
|
|
2801
2817
|
value(...args) {
|
|
2802
2818
|
var _a2;
|
|
@@ -2809,13 +2825,13 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2809
2825
|
});
|
|
2810
2826
|
}
|
|
2811
2827
|
});
|
|
2812
|
-
if (
|
|
2828
|
+
if (BUILD22.observeAttribute && (!BUILD22.lazyLoad || flags & 1 /* isElementConstructor */)) {
|
|
2813
2829
|
const attrNameToPropName = /* @__PURE__ */ new Map();
|
|
2814
2830
|
prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
|
|
2815
2831
|
plt.jmp(() => {
|
|
2816
2832
|
var _a2;
|
|
2817
2833
|
const propName = attrNameToPropName.get(attrName);
|
|
2818
|
-
if (this.hasOwnProperty(propName) &&
|
|
2834
|
+
if (this.hasOwnProperty(propName) && BUILD22.lazyLoad) {
|
|
2819
2835
|
newValue = this[propName];
|
|
2820
2836
|
delete this[propName];
|
|
2821
2837
|
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
|
|
@@ -2825,8 +2841,8 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2825
2841
|
const hostRef = getHostRef(this);
|
|
2826
2842
|
const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
|
|
2827
2843
|
if (flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
|
|
2828
|
-
const elm =
|
|
2829
|
-
const instance =
|
|
2844
|
+
const elm = BUILD22.lazyLoad ? hostRef.$hostElement$ : this;
|
|
2845
|
+
const instance = BUILD22.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2830
2846
|
const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
|
|
2831
2847
|
entry == null ? void 0 : entry.forEach((callbackName) => {
|
|
2832
2848
|
if (instance[callbackName] != null) {
|
|
@@ -2850,7 +2866,7 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
2850
2866
|
var _a2;
|
|
2851
2867
|
const attrName = m[1] || propName;
|
|
2852
2868
|
attrNameToPropName.set(attrName, propName);
|
|
2853
|
-
if (
|
|
2869
|
+
if (BUILD22.reflect && m[0] & 512 /* ReflectAttr */) {
|
|
2854
2870
|
(_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);
|
|
2855
2871
|
}
|
|
2856
2872
|
return attrName;
|
|
@@ -2867,8 +2883,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2867
2883
|
let Cstr;
|
|
2868
2884
|
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
2869
2885
|
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
2870
|
-
|
|
2871
|
-
if ((BUILD22.lazyLoad || BUILD22.hydrateClientSide) && bundleId) {
|
|
2886
|
+
if (BUILD23.lazyLoad || BUILD23.hydrateClientSide) {
|
|
2872
2887
|
const CstrImport = loadModule(cmpMeta, hostRef, hmrVersionId);
|
|
2873
2888
|
if (CstrImport && "then" in CstrImport) {
|
|
2874
2889
|
const endLoad = uniqueTime(
|
|
@@ -2883,53 +2898,53 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2883
2898
|
if (!Cstr) {
|
|
2884
2899
|
throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
|
|
2885
2900
|
}
|
|
2886
|
-
if (
|
|
2887
|
-
if (
|
|
2901
|
+
if (BUILD23.member && !Cstr.isProxied) {
|
|
2902
|
+
if (BUILD23.watchCallback) {
|
|
2888
2903
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
2889
2904
|
}
|
|
2890
2905
|
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
2891
2906
|
Cstr.isProxied = true;
|
|
2892
2907
|
}
|
|
2893
2908
|
const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
|
|
2894
|
-
if (
|
|
2909
|
+
if (BUILD23.member) {
|
|
2895
2910
|
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
|
2896
2911
|
}
|
|
2897
2912
|
try {
|
|
2898
2913
|
new Cstr(hostRef);
|
|
2899
2914
|
} catch (e) {
|
|
2900
|
-
consoleError(e);
|
|
2915
|
+
consoleError(e, elm);
|
|
2901
2916
|
}
|
|
2902
|
-
if (
|
|
2917
|
+
if (BUILD23.member) {
|
|
2903
2918
|
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
2904
2919
|
}
|
|
2905
|
-
if (
|
|
2920
|
+
if (BUILD23.watchCallback) {
|
|
2906
2921
|
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
2907
2922
|
}
|
|
2908
2923
|
endNewInstance();
|
|
2909
|
-
fireConnectedCallback(hostRef.$lazyInstance
|
|
2924
|
+
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
2910
2925
|
} else {
|
|
2911
2926
|
Cstr = elm.constructor;
|
|
2912
2927
|
const cmpTag = elm.localName;
|
|
2913
2928
|
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
|
|
2914
2929
|
}
|
|
2915
|
-
if (
|
|
2930
|
+
if (BUILD23.style && Cstr && Cstr.style) {
|
|
2916
2931
|
let style;
|
|
2917
2932
|
if (typeof Cstr.style === "string") {
|
|
2918
2933
|
style = Cstr.style;
|
|
2919
|
-
} else if (
|
|
2934
|
+
} else if (BUILD23.mode && typeof Cstr.style !== "string") {
|
|
2920
2935
|
hostRef.$modeName$ = computeMode(elm);
|
|
2921
2936
|
if (hostRef.$modeName$) {
|
|
2922
2937
|
style = Cstr.style[hostRef.$modeName$];
|
|
2923
2938
|
}
|
|
2924
|
-
if (
|
|
2939
|
+
if (BUILD23.hydrateServerSide && hostRef.$modeName$) {
|
|
2925
2940
|
elm.setAttribute("s-mode", hostRef.$modeName$);
|
|
2926
2941
|
}
|
|
2927
2942
|
}
|
|
2928
2943
|
const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
|
|
2929
2944
|
if (!styles.has(scopeId2)) {
|
|
2930
2945
|
const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
|
|
2931
|
-
if (!
|
|
2932
|
-
|
|
2946
|
+
if (!BUILD23.hydrateServerSide && BUILD23.shadowDom && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
2947
|
+
BUILD23.shadowDomShim && cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
|
|
2933
2948
|
style = await import("./shadow-css.js").then((m) => m.scopeCss(style, scopeId2));
|
|
2934
2949
|
}
|
|
2935
2950
|
registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
@@ -2939,15 +2954,15 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2939
2954
|
}
|
|
2940
2955
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
2941
2956
|
const schedule = () => scheduleUpdate(hostRef, true);
|
|
2942
|
-
if (
|
|
2957
|
+
if (BUILD23.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
|
|
2943
2958
|
ancestorComponent["s-rc"].push(schedule);
|
|
2944
2959
|
} else {
|
|
2945
2960
|
schedule();
|
|
2946
2961
|
}
|
|
2947
2962
|
};
|
|
2948
|
-
var fireConnectedCallback = (instance) => {
|
|
2949
|
-
if (
|
|
2950
|
-
safeCall(instance, "connectedCallback");
|
|
2963
|
+
var fireConnectedCallback = (instance, elm) => {
|
|
2964
|
+
if (BUILD23.lazyLoad && BUILD23.connectedCallback) {
|
|
2965
|
+
safeCall(instance, "connectedCallback", void 0, elm);
|
|
2951
2966
|
}
|
|
2952
2967
|
};
|
|
2953
2968
|
|
|
@@ -2957,41 +2972,41 @@ var connectedCallback = (elm) => {
|
|
|
2957
2972
|
const hostRef = getHostRef(elm);
|
|
2958
2973
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
2959
2974
|
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
|
|
2960
|
-
if (
|
|
2975
|
+
if (BUILD24.hostListenerTargetParent) {
|
|
2961
2976
|
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);
|
|
2962
2977
|
}
|
|
2963
2978
|
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
2964
2979
|
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
2965
2980
|
let hostId;
|
|
2966
|
-
if (
|
|
2981
|
+
if (BUILD24.hydrateClientSide) {
|
|
2967
2982
|
hostId = elm.getAttribute(HYDRATE_ID);
|
|
2968
2983
|
if (hostId) {
|
|
2969
|
-
if (
|
|
2970
|
-
const scopeId2 =
|
|
2984
|
+
if (BUILD24.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2985
|
+
const scopeId2 = BUILD24.mode ? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute("s-mode")) : addStyle(elm.shadowRoot, cmpMeta);
|
|
2971
2986
|
elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
|
|
2972
|
-
} else if (
|
|
2973
|
-
const scopeId2 = getScopeId(cmpMeta,
|
|
2987
|
+
} else if (BUILD24.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2988
|
+
const scopeId2 = getScopeId(cmpMeta, BUILD24.mode ? elm.getAttribute("s-mode") : void 0);
|
|
2974
2989
|
elm["s-sc"] = scopeId2;
|
|
2975
2990
|
}
|
|
2976
2991
|
initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
|
|
2977
2992
|
}
|
|
2978
2993
|
}
|
|
2979
|
-
if (
|
|
2980
|
-
if (
|
|
2994
|
+
if (BUILD24.slotRelocation && !hostId) {
|
|
2995
|
+
if (BUILD24.hydrateServerSide || (BUILD24.slot || BUILD24.shadowDom) && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
2981
2996
|
cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
|
|
2982
2997
|
setContentReference(elm);
|
|
2983
2998
|
}
|
|
2984
2999
|
}
|
|
2985
|
-
if (
|
|
3000
|
+
if (BUILD24.asyncLoading) {
|
|
2986
3001
|
let ancestorComponent = elm;
|
|
2987
3002
|
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
|
|
2988
|
-
if (
|
|
3003
|
+
if (BUILD24.hydrateClientSide && ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
|
|
2989
3004
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
|
|
2990
3005
|
break;
|
|
2991
3006
|
}
|
|
2992
3007
|
}
|
|
2993
3008
|
}
|
|
2994
|
-
if (
|
|
3009
|
+
if (BUILD24.prop && !BUILD24.hydrateServerSide && cmpMeta.$members$) {
|
|
2995
3010
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
2996
3011
|
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
|
2997
3012
|
const value = elm[memberName];
|
|
@@ -3000,7 +3015,7 @@ var connectedCallback = (elm) => {
|
|
|
3000
3015
|
}
|
|
3001
3016
|
});
|
|
3002
3017
|
}
|
|
3003
|
-
if (
|
|
3018
|
+
if (BUILD24.initializeNextTick) {
|
|
3004
3019
|
nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
|
|
3005
3020
|
} else {
|
|
3006
3021
|
initializeComponent(elm, hostRef, cmpMeta);
|
|
@@ -3008,9 +3023,9 @@ var connectedCallback = (elm) => {
|
|
|
3008
3023
|
} else {
|
|
3009
3024
|
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, false);
|
|
3010
3025
|
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
3011
|
-
fireConnectedCallback(hostRef.$lazyInstance
|
|
3026
|
+
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
3012
3027
|
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
3013
|
-
hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance
|
|
3028
|
+
hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
|
|
3014
3029
|
}
|
|
3015
3030
|
}
|
|
3016
3031
|
endConnected();
|
|
@@ -3018,37 +3033,37 @@ var connectedCallback = (elm) => {
|
|
|
3018
3033
|
};
|
|
3019
3034
|
var setContentReference = (elm) => {
|
|
3020
3035
|
const contentRefElm = elm["s-cr"] = doc.createComment(
|
|
3021
|
-
|
|
3036
|
+
BUILD24.isDebug ? `content-ref (host=${elm.localName})` : ""
|
|
3022
3037
|
);
|
|
3023
3038
|
contentRefElm["s-cn"] = true;
|
|
3024
3039
|
insertBefore(elm, contentRefElm, elm.firstChild);
|
|
3025
3040
|
};
|
|
3026
3041
|
|
|
3027
3042
|
// src/runtime/disconnected-callback.ts
|
|
3028
|
-
import { BUILD as
|
|
3029
|
-
var disconnectInstance = (instance) => {
|
|
3030
|
-
if (
|
|
3031
|
-
safeCall(instance, "disconnectedCallback");
|
|
3043
|
+
import { BUILD as BUILD25 } from "@stencil/core/internal/app-data";
|
|
3044
|
+
var disconnectInstance = (instance, elm) => {
|
|
3045
|
+
if (BUILD25.lazyLoad && BUILD25.disconnectedCallback) {
|
|
3046
|
+
safeCall(instance, "disconnectedCallback", void 0, elm || instance);
|
|
3032
3047
|
}
|
|
3033
|
-
if (
|
|
3034
|
-
safeCall(instance, "componentDidUnload");
|
|
3048
|
+
if (BUILD25.cmpDidUnload) {
|
|
3049
|
+
safeCall(instance, "componentDidUnload", void 0, elm || instance);
|
|
3035
3050
|
}
|
|
3036
3051
|
};
|
|
3037
3052
|
var disconnectedCallback = async (elm) => {
|
|
3038
3053
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
3039
3054
|
const hostRef = getHostRef(elm);
|
|
3040
|
-
if (
|
|
3055
|
+
if (BUILD25.hostListener) {
|
|
3041
3056
|
if (hostRef.$rmListeners$) {
|
|
3042
3057
|
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
3043
3058
|
hostRef.$rmListeners$ = void 0;
|
|
3044
3059
|
}
|
|
3045
3060
|
}
|
|
3046
|
-
if (!
|
|
3061
|
+
if (!BUILD25.lazyLoad) {
|
|
3047
3062
|
disconnectInstance(elm);
|
|
3048
3063
|
} else if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
3049
|
-
disconnectInstance(hostRef.$lazyInstance
|
|
3064
|
+
disconnectInstance(hostRef.$lazyInstance$, elm);
|
|
3050
3065
|
} else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
3051
|
-
hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance
|
|
3066
|
+
hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$, elm));
|
|
3052
3067
|
}
|
|
3053
3068
|
}
|
|
3054
3069
|
if (rootAppliedStyles.has(elm)) {
|
|
@@ -3068,36 +3083,36 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
3068
3083
|
$flags$: compactMeta[0],
|
|
3069
3084
|
$tagName$: compactMeta[1]
|
|
3070
3085
|
};
|
|
3071
|
-
if (
|
|
3086
|
+
if (BUILD26.member) {
|
|
3072
3087
|
cmpMeta.$members$ = compactMeta[2];
|
|
3073
3088
|
}
|
|
3074
|
-
if (
|
|
3089
|
+
if (BUILD26.hostListener) {
|
|
3075
3090
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
3076
3091
|
}
|
|
3077
|
-
if (
|
|
3092
|
+
if (BUILD26.watchCallback) {
|
|
3078
3093
|
cmpMeta.$watchers$ = Cstr.$watchers$;
|
|
3079
3094
|
}
|
|
3080
|
-
if (
|
|
3095
|
+
if (BUILD26.reflect) {
|
|
3081
3096
|
cmpMeta.$attrsToReflect$ = [];
|
|
3082
3097
|
}
|
|
3083
|
-
if (
|
|
3098
|
+
if (BUILD26.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
3084
3099
|
cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
|
|
3085
3100
|
}
|
|
3086
|
-
if (
|
|
3087
|
-
if (
|
|
3101
|
+
if (BUILD26.experimentalSlotFixes) {
|
|
3102
|
+
if (BUILD26.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
3088
3103
|
patchPseudoShadowDom(Cstr.prototype);
|
|
3089
3104
|
}
|
|
3090
3105
|
} else {
|
|
3091
|
-
if (
|
|
3106
|
+
if (BUILD26.slotChildNodesFix) {
|
|
3092
3107
|
patchChildSlotNodes(Cstr.prototype);
|
|
3093
3108
|
}
|
|
3094
|
-
if (
|
|
3109
|
+
if (BUILD26.cloneNodeFix) {
|
|
3095
3110
|
patchCloneNode(Cstr.prototype);
|
|
3096
3111
|
}
|
|
3097
|
-
if (
|
|
3112
|
+
if (BUILD26.appendChildSlotFix) {
|
|
3098
3113
|
patchSlotAppendChild(Cstr.prototype);
|
|
3099
3114
|
}
|
|
3100
|
-
if (
|
|
3115
|
+
if (BUILD26.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
3101
3116
|
patchTextContent(Cstr.prototype);
|
|
3102
3117
|
}
|
|
3103
3118
|
}
|
|
@@ -3115,13 +3130,13 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
3115
3130
|
this.__hasHostListenerAttached = true;
|
|
3116
3131
|
}
|
|
3117
3132
|
connectedCallback(this);
|
|
3118
|
-
if (
|
|
3133
|
+
if (BUILD26.connectedCallback && originalConnectedCallback) {
|
|
3119
3134
|
originalConnectedCallback.call(this);
|
|
3120
3135
|
}
|
|
3121
3136
|
},
|
|
3122
3137
|
disconnectedCallback() {
|
|
3123
3138
|
disconnectedCallback(this);
|
|
3124
|
-
if (
|
|
3139
|
+
if (BUILD26.disconnectedCallback && originalDisconnectedCallback) {
|
|
3125
3140
|
originalDisconnectedCallback.call(this);
|
|
3126
3141
|
}
|
|
3127
3142
|
plt.raf(() => {
|
|
@@ -3138,7 +3153,7 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
3138
3153
|
__attachShadow() {
|
|
3139
3154
|
if (supportsShadow) {
|
|
3140
3155
|
if (!this.shadowRoot) {
|
|
3141
|
-
if (
|
|
3156
|
+
if (BUILD26.shadowDelegatesFocus) {
|
|
3142
3157
|
this.attachShadow({
|
|
3143
3158
|
mode: "open",
|
|
3144
3159
|
delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
|
|
@@ -3162,7 +3177,7 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
3162
3177
|
return proxyComponent(Cstr, cmpMeta, 1 /* isElementConstructor */ | 2 /* proxyState */);
|
|
3163
3178
|
};
|
|
3164
3179
|
var forceModeUpdate = (elm) => {
|
|
3165
|
-
if (
|
|
3180
|
+
if (BUILD26.style && BUILD26.mode && !BUILD26.lazyLoad) {
|
|
3166
3181
|
const mode = computeMode(elm);
|
|
3167
3182
|
const hostRef = getHostRef(elm);
|
|
3168
3183
|
if (hostRef.$modeName$ !== mode) {
|
|
@@ -3185,7 +3200,7 @@ var forceModeUpdate = (elm) => {
|
|
|
3185
3200
|
};
|
|
3186
3201
|
|
|
3187
3202
|
// src/runtime/bootstrap-lazy.ts
|
|
3188
|
-
import { BUILD as
|
|
3203
|
+
import { BUILD as BUILD27 } from "@stencil/core/internal/app-data";
|
|
3189
3204
|
|
|
3190
3205
|
// src/runtime/hmr-component.ts
|
|
3191
3206
|
var hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
|
|
@@ -3197,7 +3212,7 @@ var hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
|
|
|
3197
3212
|
// src/runtime/bootstrap-lazy.ts
|
|
3198
3213
|
var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
3199
3214
|
var _a;
|
|
3200
|
-
if (
|
|
3215
|
+
if (BUILD27.profile && performance.mark) {
|
|
3201
3216
|
performance.mark("st:app:start");
|
|
3202
3217
|
}
|
|
3203
3218
|
installDevTools();
|
|
@@ -3213,12 +3228,12 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3213
3228
|
let isBootstrapping = true;
|
|
3214
3229
|
Object.assign(plt, options);
|
|
3215
3230
|
plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", doc.baseURI).href;
|
|
3216
|
-
if (
|
|
3231
|
+
if (BUILD27.asyncQueue) {
|
|
3217
3232
|
if (options.syncQueue) {
|
|
3218
3233
|
plt.$flags$ |= 4 /* queueSync */;
|
|
3219
3234
|
}
|
|
3220
3235
|
}
|
|
3221
|
-
if (
|
|
3236
|
+
if (BUILD27.hydrateClientSide) {
|
|
3222
3237
|
plt.$flags$ |= 2 /* appLoaded */;
|
|
3223
3238
|
}
|
|
3224
3239
|
let hasSlotRelocation = false;
|
|
@@ -3234,22 +3249,22 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3234
3249
|
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
3235
3250
|
hasSlotRelocation = true;
|
|
3236
3251
|
}
|
|
3237
|
-
if (
|
|
3252
|
+
if (BUILD27.member) {
|
|
3238
3253
|
cmpMeta.$members$ = compactMeta[2];
|
|
3239
3254
|
}
|
|
3240
|
-
if (
|
|
3255
|
+
if (BUILD27.hostListener) {
|
|
3241
3256
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
3242
3257
|
}
|
|
3243
|
-
if (
|
|
3258
|
+
if (BUILD27.reflect) {
|
|
3244
3259
|
cmpMeta.$attrsToReflect$ = [];
|
|
3245
3260
|
}
|
|
3246
|
-
if (
|
|
3261
|
+
if (BUILD27.watchCallback) {
|
|
3247
3262
|
cmpMeta.$watchers$ = (_a2 = compactMeta[4]) != null ? _a2 : {};
|
|
3248
3263
|
}
|
|
3249
|
-
if (
|
|
3264
|
+
if (BUILD27.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
3250
3265
|
cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
|
|
3251
3266
|
}
|
|
3252
|
-
const tagName =
|
|
3267
|
+
const tagName = BUILD27.transformTagName && options.transformTagName ? options.transformTagName(cmpMeta.$tagName$) : cmpMeta.$tagName$;
|
|
3253
3268
|
const HostElement = class extends HTMLElement {
|
|
3254
3269
|
// StencilLazyHost
|
|
3255
3270
|
constructor(self) {
|
|
@@ -3257,10 +3272,10 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3257
3272
|
this.hasRegisteredEventListeners = false;
|
|
3258
3273
|
self = this;
|
|
3259
3274
|
registerHost(self, cmpMeta);
|
|
3260
|
-
if (
|
|
3275
|
+
if (BUILD27.shadowDom && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
3261
3276
|
if (supportsShadow) {
|
|
3262
3277
|
if (!self.shadowRoot) {
|
|
3263
|
-
if (
|
|
3278
|
+
if (BUILD27.shadowDelegatesFocus) {
|
|
3264
3279
|
self.attachShadow({
|
|
3265
3280
|
mode: "open",
|
|
3266
3281
|
delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
|
|
@@ -3275,7 +3290,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3275
3290
|
);
|
|
3276
3291
|
}
|
|
3277
3292
|
}
|
|
3278
|
-
} else if (!
|
|
3293
|
+
} else if (!BUILD27.hydrateServerSide && !("shadowRoot" in self)) {
|
|
3279
3294
|
self.shadowRoot = self;
|
|
3280
3295
|
}
|
|
3281
3296
|
}
|
|
@@ -3310,28 +3325,28 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3310
3325
|
return getHostRef(this).$onReadyPromise$;
|
|
3311
3326
|
}
|
|
3312
3327
|
};
|
|
3313
|
-
if (
|
|
3314
|
-
if (
|
|
3328
|
+
if (BUILD27.experimentalSlotFixes) {
|
|
3329
|
+
if (BUILD27.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
3315
3330
|
patchPseudoShadowDom(HostElement.prototype);
|
|
3316
3331
|
}
|
|
3317
3332
|
} else {
|
|
3318
|
-
if (
|
|
3333
|
+
if (BUILD27.slotChildNodesFix) {
|
|
3319
3334
|
patchChildSlotNodes(HostElement.prototype);
|
|
3320
3335
|
}
|
|
3321
|
-
if (
|
|
3336
|
+
if (BUILD27.cloneNodeFix) {
|
|
3322
3337
|
patchCloneNode(HostElement.prototype);
|
|
3323
3338
|
}
|
|
3324
|
-
if (
|
|
3339
|
+
if (BUILD27.appendChildSlotFix) {
|
|
3325
3340
|
patchSlotAppendChild(HostElement.prototype);
|
|
3326
3341
|
}
|
|
3327
|
-
if (
|
|
3342
|
+
if (BUILD27.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
3328
3343
|
patchTextContent(HostElement.prototype);
|
|
3329
3344
|
}
|
|
3330
3345
|
}
|
|
3331
|
-
if (
|
|
3346
|
+
if (BUILD27.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */) {
|
|
3332
3347
|
HostElement.formAssociated = true;
|
|
3333
3348
|
}
|
|
3334
|
-
if (
|
|
3349
|
+
if (BUILD27.hotModuleReplacement) {
|
|
3335
3350
|
HostElement.prototype["s-hmr"] = function(hmrVersionId) {
|
|
3336
3351
|
hmrStart(this, cmpMeta, hmrVersionId);
|
|
3337
3352
|
};
|
|
@@ -3350,7 +3365,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3350
3365
|
if (hasSlotRelocation) {
|
|
3351
3366
|
dataStyles.textContent += SLOT_FB_CSS;
|
|
3352
3367
|
}
|
|
3353
|
-
if (
|
|
3368
|
+
if (BUILD27.invisiblePrehydration && (BUILD27.hydratedClass || BUILD27.hydratedAttribute)) {
|
|
3354
3369
|
dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS;
|
|
3355
3370
|
}
|
|
3356
3371
|
if (dataStyles.innerHTML.length) {
|
|
@@ -3366,7 +3381,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3366
3381
|
if (deferredConnectedCallbacks.length) {
|
|
3367
3382
|
deferredConnectedCallbacks.map((host) => host.connectedCallback());
|
|
3368
3383
|
} else {
|
|
3369
|
-
if (
|
|
3384
|
+
if (BUILD27.profile) {
|
|
3370
3385
|
plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30, "timeout"));
|
|
3371
3386
|
} else {
|
|
3372
3387
|
plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30));
|
|
@@ -3379,10 +3394,10 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3379
3394
|
var Fragment = (_, children) => children;
|
|
3380
3395
|
|
|
3381
3396
|
// src/runtime/host-listener.ts
|
|
3382
|
-
import { BUILD as
|
|
3397
|
+
import { BUILD as BUILD28 } from "@stencil/core/internal/app-data";
|
|
3383
3398
|
var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
3384
|
-
if (
|
|
3385
|
-
if (
|
|
3399
|
+
if (BUILD28.hostListener && listeners) {
|
|
3400
|
+
if (BUILD28.hostListenerTargetParent) {
|
|
3386
3401
|
if (attachParentListeners) {
|
|
3387
3402
|
listeners = listeners.filter(([flags]) => flags & 32 /* TargetParent */);
|
|
3388
3403
|
} else {
|
|
@@ -3390,7 +3405,7 @@ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =>
|
|
|
3390
3405
|
}
|
|
3391
3406
|
}
|
|
3392
3407
|
listeners.map(([flags, name, method]) => {
|
|
3393
|
-
const target =
|
|
3408
|
+
const target = BUILD28.hostListenerTarget ? getHostListenerTarget(elm, flags) : elm;
|
|
3394
3409
|
const handler = hostListenerProxy(hostRef, method);
|
|
3395
3410
|
const opts = hostListenerOpts(flags);
|
|
3396
3411
|
plt.ael(target, name, handler, opts);
|
|
@@ -3401,7 +3416,7 @@ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =>
|
|
|
3401
3416
|
var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
3402
3417
|
var _a;
|
|
3403
3418
|
try {
|
|
3404
|
-
if (
|
|
3419
|
+
if (BUILD28.lazyLoad) {
|
|
3405
3420
|
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
3406
3421
|
(_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev);
|
|
3407
3422
|
} else {
|
|
@@ -3411,14 +3426,14 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
3411
3426
|
hostRef.$hostElement$[methodName](ev);
|
|
3412
3427
|
}
|
|
3413
3428
|
} catch (e) {
|
|
3414
|
-
consoleError(e);
|
|
3429
|
+
consoleError(e, hostRef.$hostElement$);
|
|
3415
3430
|
}
|
|
3416
3431
|
};
|
|
3417
3432
|
var getHostListenerTarget = (elm, flags) => {
|
|
3418
|
-
if (
|
|
3419
|
-
if (
|
|
3420
|
-
if (
|
|
3421
|
-
if (
|
|
3433
|
+
if (BUILD28.hostListenerTargetDocument && flags & 4 /* TargetDocument */) return doc;
|
|
3434
|
+
if (BUILD28.hostListenerTargetWindow && flags & 8 /* TargetWindow */) return win;
|
|
3435
|
+
if (BUILD28.hostListenerTargetBody && flags & 16 /* TargetBody */) return doc.body;
|
|
3436
|
+
if (BUILD28.hostListenerTargetParent && flags & 32 /* TargetParent */ && elm.parentElement)
|
|
3422
3437
|
return elm.parentElement;
|
|
3423
3438
|
return elm;
|
|
3424
3439
|
};
|
|
@@ -3578,7 +3593,7 @@ var insertChildVNodeAnnotations = (doc2, vnodeChild, cmpData, hostId, depth, ind
|
|
|
3578
3593
|
}
|
|
3579
3594
|
};
|
|
3580
3595
|
export {
|
|
3581
|
-
|
|
3596
|
+
BUILD29 as BUILD,
|
|
3582
3597
|
Build,
|
|
3583
3598
|
Env,
|
|
3584
3599
|
Fragment,
|