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