@stencil/core 4.18.3-dev.1718859699.dac3e33 → 4.18.3-dev.1719000800.2790882
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 +53 -48
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +3 -3
- package/dev-server/index.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +2 -2
- package/dev-server/ws.js +1 -1
- package/internal/app-data/package.json +1 -1
- package/internal/client/index.js +515 -497
- package/internal/client/package.json +3 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/hydrate/index.js +82 -33
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.d.ts +29 -11
- package/internal/hydrate/runner.js +235 -258
- package/internal/package.json +1 -1
- package/internal/stencil-private.d.ts +21 -11
- package/internal/stencil-public-compiler.d.ts +13 -0
- package/internal/stencil-public-runtime.d.ts +0 -1
- package/internal/testing/index.js +416 -393
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +133 -129
- package/mock-doc/index.d.ts +18 -4
- package/mock-doc/index.js +133 -129
- package/mock-doc/package.json +1 -1
- package/package.json +30 -2
- package/screenshot/index.js +1 -1
- package/screenshot/package.json +1 -1
- package/screenshot/pixel-match.js +1 -1
- package/sys/node/index.js +10 -10
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +64 -1
- package/testing/jest/jest-27-and-under/matchers/events.d.ts +4 -0
- package/testing/jest/jest-27-and-under/matchers/index.d.ts +2 -1
- package/testing/jest/jest-28/matchers/events.d.ts +4 -0
- package/testing/jest/jest-28/matchers/index.d.ts +2 -1
- package/testing/jest/jest-29/matchers/events.d.ts +4 -0
- package/testing/jest/jest-29/matchers/index.d.ts +2 -1
- package/testing/package.json +1 -1
package/internal/client/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Stencil Client Platform v4.18.3-dev.
|
|
2
|
+
Stencil Client Platform v4.18.3-dev.1719000800.2790882 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __export = (target, all) => {
|
|
@@ -17,7 +17,225 @@ var Build = {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
// src/client/client-host-ref.ts
|
|
20
|
-
import { BUILD as
|
|
20
|
+
import { BUILD as BUILD2 } from "@stencil/core/internal/app-data";
|
|
21
|
+
var hostRefs = BUILD2.hotModuleReplacement ? window.__STENCIL_HOSTREFS__ || (window.__STENCIL_HOSTREFS__ = /* @__PURE__ */ new WeakMap()) : /* @__PURE__ */ new WeakMap();
|
|
22
|
+
var getHostRef = (ref) => hostRefs.get(ref);
|
|
23
|
+
var registerInstance = (lazyInstance, hostRef) => hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
|
|
24
|
+
var registerHost = (hostElement, cmpMeta) => {
|
|
25
|
+
const hostRef = {
|
|
26
|
+
$flags$: 0,
|
|
27
|
+
$hostElement$: hostElement,
|
|
28
|
+
$cmpMeta$: cmpMeta,
|
|
29
|
+
$instanceValues$: /* @__PURE__ */ new Map()
|
|
30
|
+
};
|
|
31
|
+
if (BUILD2.isDev) {
|
|
32
|
+
hostRef.$renderCount$ = 0;
|
|
33
|
+
}
|
|
34
|
+
if (BUILD2.method && BUILD2.lazyLoad) {
|
|
35
|
+
hostRef.$onInstancePromise$ = new Promise((r) => hostRef.$onInstanceResolve$ = r);
|
|
36
|
+
}
|
|
37
|
+
if (BUILD2.asyncLoading) {
|
|
38
|
+
hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r);
|
|
39
|
+
hostElement["s-p"] = [];
|
|
40
|
+
hostElement["s-rc"] = [];
|
|
41
|
+
}
|
|
42
|
+
return hostRefs.set(hostElement, hostRef);
|
|
43
|
+
};
|
|
44
|
+
var isMemberInElement = (elm, memberName) => memberName in elm;
|
|
45
|
+
|
|
46
|
+
// src/client/client-load-module.ts
|
|
47
|
+
import { BUILD as BUILD4 } from "@stencil/core/internal/app-data";
|
|
48
|
+
|
|
49
|
+
// src/client/client-log.ts
|
|
50
|
+
import { BUILD as BUILD3 } from "@stencil/core/internal/app-data";
|
|
51
|
+
var customError;
|
|
52
|
+
var consoleError = (e, el) => (customError || console.error)(e, el);
|
|
53
|
+
var STENCIL_DEV_MODE = BUILD3.isTesting ? ["STENCIL:"] : [
|
|
54
|
+
"%cstencil",
|
|
55
|
+
"color: white;background:#4c47ff;font-weight: bold; font-size:10px; padding:2px 6px; border-radius: 5px"
|
|
56
|
+
];
|
|
57
|
+
var consoleDevError = (...m) => console.error(...STENCIL_DEV_MODE, ...m);
|
|
58
|
+
var consoleDevWarn = (...m) => console.warn(...STENCIL_DEV_MODE, ...m);
|
|
59
|
+
var consoleDevInfo = (...m) => console.info(...STENCIL_DEV_MODE, ...m);
|
|
60
|
+
var setErrorHandler = (handler) => customError = handler;
|
|
61
|
+
|
|
62
|
+
// src/client/client-load-module.ts
|
|
63
|
+
var cmpModules = /* @__PURE__ */ new Map();
|
|
64
|
+
var MODULE_IMPORT_PREFIX = "./";
|
|
65
|
+
var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
66
|
+
const exportName = cmpMeta.$tagName$.replace(/-/g, "_");
|
|
67
|
+
const bundleId = cmpMeta.$lazyBundleId$;
|
|
68
|
+
if (BUILD4.isDev && typeof bundleId !== "string") {
|
|
69
|
+
consoleDevError(
|
|
70
|
+
`Trying to lazily load component <${cmpMeta.$tagName$}> with style mode "${hostRef.$modeName$}", but it does not exist.`
|
|
71
|
+
);
|
|
72
|
+
return void 0;
|
|
73
|
+
} else if (!bundleId) {
|
|
74
|
+
return void 0;
|
|
75
|
+
}
|
|
76
|
+
const module = !BUILD4.hotModuleReplacement ? cmpModules.get(bundleId) : false;
|
|
77
|
+
if (module) {
|
|
78
|
+
return module[exportName];
|
|
79
|
+
}
|
|
80
|
+
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/
|
|
81
|
+
return import(
|
|
82
|
+
/* @vite-ignore */
|
|
83
|
+
/* webpackInclude: /\.entry\.js$/ */
|
|
84
|
+
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
85
|
+
/* webpackMode: "lazy" */
|
|
86
|
+
`./${bundleId}.entry.js${BUILD4.hotModuleReplacement && hmrVersionId ? "?s-hmr=" + hmrVersionId : ""}`
|
|
87
|
+
).then((importedModule) => {
|
|
88
|
+
if (!BUILD4.hotModuleReplacement) {
|
|
89
|
+
cmpModules.set(bundleId, importedModule);
|
|
90
|
+
}
|
|
91
|
+
return importedModule[exportName];
|
|
92
|
+
}, consoleError);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
// src/client/client-style.ts
|
|
96
|
+
var styles = /* @__PURE__ */ new Map();
|
|
97
|
+
var modeResolutionChain = [];
|
|
98
|
+
|
|
99
|
+
// src/client/client-task-queue.ts
|
|
100
|
+
import { BUILD as BUILD6 } from "@stencil/core/internal/app-data";
|
|
101
|
+
|
|
102
|
+
// src/runtime/runtime-constants.ts
|
|
103
|
+
var CONTENT_REF_ID = "r";
|
|
104
|
+
var ORG_LOCATION_ID = "o";
|
|
105
|
+
var SLOT_NODE_ID = "s";
|
|
106
|
+
var TEXT_NODE_ID = "t";
|
|
107
|
+
var HYDRATE_ID = "s-id";
|
|
108
|
+
var HYDRATED_STYLE_ID = "sty-id";
|
|
109
|
+
var HYDRATE_CHILD_ID = "c-id";
|
|
110
|
+
var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
|
|
111
|
+
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
|
112
|
+
var XLINK_NS = "http://www.w3.org/1999/xlink";
|
|
113
|
+
var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
|
|
114
|
+
"formAssociatedCallback",
|
|
115
|
+
"formResetCallback",
|
|
116
|
+
"formDisabledCallback",
|
|
117
|
+
"formStateRestoreCallback"
|
|
118
|
+
];
|
|
119
|
+
|
|
120
|
+
// src/client/client-window.ts
|
|
121
|
+
import { BUILD as BUILD5 } from "@stencil/core/internal/app-data";
|
|
122
|
+
var win = typeof window !== "undefined" ? window : {};
|
|
123
|
+
var doc = win.document || { head: {} };
|
|
124
|
+
var H = win.HTMLElement || class {
|
|
125
|
+
};
|
|
126
|
+
var plt = {
|
|
127
|
+
$flags$: 0,
|
|
128
|
+
$resourcesUrl$: "",
|
|
129
|
+
jmp: (h2) => h2(),
|
|
130
|
+
raf: (h2) => requestAnimationFrame(h2),
|
|
131
|
+
ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
|
|
132
|
+
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
133
|
+
ce: (eventName, opts) => new CustomEvent(eventName, opts)
|
|
134
|
+
};
|
|
135
|
+
var setPlatformHelpers = (helpers) => {
|
|
136
|
+
Object.assign(plt, helpers);
|
|
137
|
+
};
|
|
138
|
+
var supportsShadow = BUILD5.shadowDom;
|
|
139
|
+
var supportsListenerOptions = /* @__PURE__ */ (() => {
|
|
140
|
+
let supportsListenerOptions2 = false;
|
|
141
|
+
try {
|
|
142
|
+
doc.addEventListener(
|
|
143
|
+
"e",
|
|
144
|
+
null,
|
|
145
|
+
Object.defineProperty({}, "passive", {
|
|
146
|
+
get() {
|
|
147
|
+
supportsListenerOptions2 = true;
|
|
148
|
+
}
|
|
149
|
+
})
|
|
150
|
+
);
|
|
151
|
+
} catch (e) {
|
|
152
|
+
}
|
|
153
|
+
return supportsListenerOptions2;
|
|
154
|
+
})();
|
|
155
|
+
var promiseResolve = (v) => Promise.resolve(v);
|
|
156
|
+
var supportsConstructableStylesheets = BUILD5.constructableCSS ? /* @__PURE__ */ (() => {
|
|
157
|
+
try {
|
|
158
|
+
new CSSStyleSheet();
|
|
159
|
+
return typeof new CSSStyleSheet().replaceSync === "function";
|
|
160
|
+
} catch (e) {
|
|
161
|
+
}
|
|
162
|
+
return false;
|
|
163
|
+
})() : false;
|
|
164
|
+
|
|
165
|
+
// src/client/client-task-queue.ts
|
|
166
|
+
var queueCongestion = 0;
|
|
167
|
+
var queuePending = false;
|
|
168
|
+
var queueDomReads = [];
|
|
169
|
+
var queueDomWrites = [];
|
|
170
|
+
var queueDomWritesLow = [];
|
|
171
|
+
var queueTask = (queue, write) => (cb) => {
|
|
172
|
+
queue.push(cb);
|
|
173
|
+
if (!queuePending) {
|
|
174
|
+
queuePending = true;
|
|
175
|
+
if (write && plt.$flags$ & 4 /* queueSync */) {
|
|
176
|
+
nextTick(flush);
|
|
177
|
+
} else {
|
|
178
|
+
plt.raf(flush);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
var consume = (queue) => {
|
|
183
|
+
for (let i2 = 0; i2 < queue.length; i2++) {
|
|
184
|
+
try {
|
|
185
|
+
queue[i2](performance.now());
|
|
186
|
+
} catch (e) {
|
|
187
|
+
consoleError(e);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
queue.length = 0;
|
|
191
|
+
};
|
|
192
|
+
var consumeTimeout = (queue, timeout) => {
|
|
193
|
+
let i2 = 0;
|
|
194
|
+
let ts = 0;
|
|
195
|
+
while (i2 < queue.length && (ts = performance.now()) < timeout) {
|
|
196
|
+
try {
|
|
197
|
+
queue[i2++](ts);
|
|
198
|
+
} catch (e) {
|
|
199
|
+
consoleError(e);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
if (i2 === queue.length) {
|
|
203
|
+
queue.length = 0;
|
|
204
|
+
} else if (i2 !== 0) {
|
|
205
|
+
queue.splice(0, i2);
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
var flush = () => {
|
|
209
|
+
if (BUILD6.asyncQueue) {
|
|
210
|
+
queueCongestion++;
|
|
211
|
+
}
|
|
212
|
+
consume(queueDomReads);
|
|
213
|
+
if (BUILD6.asyncQueue) {
|
|
214
|
+
const timeout = (plt.$flags$ & 6 /* queueMask */) === 2 /* appLoaded */ ? performance.now() + 14 * Math.ceil(queueCongestion * (1 / 10)) : Infinity;
|
|
215
|
+
consumeTimeout(queueDomWrites, timeout);
|
|
216
|
+
consumeTimeout(queueDomWritesLow, timeout);
|
|
217
|
+
if (queueDomWrites.length > 0) {
|
|
218
|
+
queueDomWritesLow.push(...queueDomWrites);
|
|
219
|
+
queueDomWrites.length = 0;
|
|
220
|
+
}
|
|
221
|
+
if (queuePending = queueDomReads.length + queueDomWrites.length + queueDomWritesLow.length > 0) {
|
|
222
|
+
plt.raf(flush);
|
|
223
|
+
} else {
|
|
224
|
+
queueCongestion = 0;
|
|
225
|
+
}
|
|
226
|
+
} else {
|
|
227
|
+
consume(queueDomWrites);
|
|
228
|
+
if (queuePending = queueDomReads.length > 0) {
|
|
229
|
+
plt.raf(flush);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
var nextTick = (cb) => promiseResolve().then(cb);
|
|
234
|
+
var readTask = /* @__PURE__ */ queueTask(queueDomReads, false);
|
|
235
|
+
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
|
|
236
|
+
|
|
237
|
+
// src/client/index.ts
|
|
238
|
+
import { BUILD as BUILD27, Env, NAMESPACE as NAMESPACE2 } from "@stencil/core/internal/app-data";
|
|
21
239
|
|
|
22
240
|
// src/runtime/asset-path.ts
|
|
23
241
|
var getAssetPath = (path) => {
|
|
@@ -27,7 +245,7 @@ var getAssetPath = (path) => {
|
|
|
27
245
|
var setAssetPath = (path) => plt.$resourcesUrl$ = path;
|
|
28
246
|
|
|
29
247
|
// src/runtime/bootstrap-custom-element.ts
|
|
30
|
-
import { BUILD as
|
|
248
|
+
import { BUILD as BUILD24 } from "@stencil/core/internal/app-data";
|
|
31
249
|
|
|
32
250
|
// src/utils/constants.ts
|
|
33
251
|
var EMPTY_OBJ = {};
|
|
@@ -97,16 +315,16 @@ var unwrapErr = (result) => {
|
|
|
97
315
|
};
|
|
98
316
|
|
|
99
317
|
// src/runtime/connected-callback.ts
|
|
100
|
-
import { BUILD as
|
|
318
|
+
import { BUILD as BUILD21 } from "@stencil/core/internal/app-data";
|
|
101
319
|
|
|
102
320
|
// src/runtime/client-hydrate.ts
|
|
103
|
-
import { BUILD as
|
|
321
|
+
import { BUILD as BUILD9 } from "@stencil/core/internal/app-data";
|
|
104
322
|
|
|
105
323
|
// src/runtime/profile.ts
|
|
106
|
-
import { BUILD as
|
|
324
|
+
import { BUILD as BUILD7 } from "@stencil/core/internal/app-data";
|
|
107
325
|
var i = 0;
|
|
108
326
|
var createTime = (fnName, tagName = "") => {
|
|
109
|
-
if (
|
|
327
|
+
if (BUILD7.profile && performance.mark) {
|
|
110
328
|
const key = `st:${fnName}:${tagName}:${i++}`;
|
|
111
329
|
performance.mark(key);
|
|
112
330
|
return () => performance.measure(`[Stencil] ${fnName}() <${tagName}>`, key);
|
|
@@ -117,7 +335,7 @@ var createTime = (fnName, tagName = "") => {
|
|
|
117
335
|
}
|
|
118
336
|
};
|
|
119
337
|
var uniqueTime = (key, measureText) => {
|
|
120
|
-
if (
|
|
338
|
+
if (BUILD7.profile && performance.mark) {
|
|
121
339
|
if (performance.getEntriesByName(key, "mark").length === 0) {
|
|
122
340
|
performance.mark(key);
|
|
123
341
|
}
|
|
@@ -175,7 +393,7 @@ var inspect = (ref) => {
|
|
|
175
393
|
};
|
|
176
394
|
};
|
|
177
395
|
var installDevTools = () => {
|
|
178
|
-
if (
|
|
396
|
+
if (BUILD7.devTools) {
|
|
179
397
|
const stencil = win.stencil = win.stencil || {};
|
|
180
398
|
const originalInspect = stencil.inspect;
|
|
181
399
|
stencil.inspect = (ref) => {
|
|
@@ -188,26 +406,8 @@ var installDevTools = () => {
|
|
|
188
406
|
}
|
|
189
407
|
};
|
|
190
408
|
|
|
191
|
-
// src/runtime/runtime-constants.ts
|
|
192
|
-
var CONTENT_REF_ID = "r";
|
|
193
|
-
var ORG_LOCATION_ID = "o";
|
|
194
|
-
var SLOT_NODE_ID = "s";
|
|
195
|
-
var TEXT_NODE_ID = "t";
|
|
196
|
-
var HYDRATE_ID = "s-id";
|
|
197
|
-
var HYDRATED_STYLE_ID = "sty-id";
|
|
198
|
-
var HYDRATE_CHILD_ID = "c-id";
|
|
199
|
-
var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
|
|
200
|
-
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
|
201
|
-
var XLINK_NS = "http://www.w3.org/1999/xlink";
|
|
202
|
-
var FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
|
|
203
|
-
"formAssociatedCallback",
|
|
204
|
-
"formResetCallback",
|
|
205
|
-
"formDisabledCallback",
|
|
206
|
-
"formStateRestoreCallback"
|
|
207
|
-
];
|
|
208
|
-
|
|
209
409
|
// src/runtime/vdom/h.ts
|
|
210
|
-
import { BUILD as
|
|
410
|
+
import { BUILD as BUILD8 } from "@stencil/core/internal/app-data";
|
|
211
411
|
var h = (nodeName, vnodeData, ...children) => {
|
|
212
412
|
let child = null;
|
|
213
413
|
let key = null;
|
|
@@ -223,7 +423,7 @@ var h = (nodeName, vnodeData, ...children) => {
|
|
|
223
423
|
} else if (child != null && typeof child !== "boolean") {
|
|
224
424
|
if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
|
|
225
425
|
child = String(child);
|
|
226
|
-
} else if (
|
|
426
|
+
} else if (BUILD8.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
|
|
227
427
|
consoleDevError(`vNode passed as children has unexpected type.
|
|
228
428
|
Make sure it's using the correct h() function.
|
|
229
429
|
Empty objects can also be the cause, look for JSX comments that became objects.`);
|
|
@@ -239,28 +439,28 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
|
|
|
239
439
|
};
|
|
240
440
|
walk(children);
|
|
241
441
|
if (vnodeData) {
|
|
242
|
-
if (
|
|
442
|
+
if (BUILD8.isDev && nodeName === "input") {
|
|
243
443
|
validateInputProperties(vnodeData);
|
|
244
444
|
}
|
|
245
|
-
if (
|
|
445
|
+
if (BUILD8.vdomKey && vnodeData.key) {
|
|
246
446
|
key = vnodeData.key;
|
|
247
447
|
}
|
|
248
|
-
if (
|
|
448
|
+
if (BUILD8.slotRelocation && vnodeData.name) {
|
|
249
449
|
slotName = vnodeData.name;
|
|
250
450
|
}
|
|
251
|
-
if (
|
|
451
|
+
if (BUILD8.vdomClass) {
|
|
252
452
|
const classData = vnodeData.className || vnodeData.class;
|
|
253
453
|
if (classData) {
|
|
254
454
|
vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
|
|
255
455
|
}
|
|
256
456
|
}
|
|
257
457
|
}
|
|
258
|
-
if (
|
|
458
|
+
if (BUILD8.isDev && vNodeChildren.some(isHost)) {
|
|
259
459
|
consoleDevError(`The <Host> must be the single root component. Make sure:
|
|
260
460
|
- You are NOT using hostData() and <Host> in the same component.
|
|
261
461
|
- <Host> is used once, and it's the single root component of the render() function.`);
|
|
262
462
|
}
|
|
263
|
-
if (
|
|
463
|
+
if (BUILD8.vdomFunctional && typeof nodeName === "function") {
|
|
264
464
|
return nodeName(
|
|
265
465
|
vnodeData === null ? {} : vnodeData,
|
|
266
466
|
vNodeChildren,
|
|
@@ -272,10 +472,10 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
|
|
|
272
472
|
if (vNodeChildren.length > 0) {
|
|
273
473
|
vnode.$children$ = vNodeChildren;
|
|
274
474
|
}
|
|
275
|
-
if (
|
|
475
|
+
if (BUILD8.vdomKey) {
|
|
276
476
|
vnode.$key$ = key;
|
|
277
477
|
}
|
|
278
|
-
if (
|
|
478
|
+
if (BUILD8.slotRelocation) {
|
|
279
479
|
vnode.$name$ = slotName;
|
|
280
480
|
}
|
|
281
481
|
return vnode;
|
|
@@ -288,13 +488,13 @@ var newVNode = (tag, text) => {
|
|
|
288
488
|
$elm$: null,
|
|
289
489
|
$children$: null
|
|
290
490
|
};
|
|
291
|
-
if (
|
|
491
|
+
if (BUILD8.vdomAttribute) {
|
|
292
492
|
vnode.$attrs$ = null;
|
|
293
493
|
}
|
|
294
|
-
if (
|
|
494
|
+
if (BUILD8.vdomKey) {
|
|
295
495
|
vnode.$key$ = null;
|
|
296
496
|
}
|
|
297
|
-
if (
|
|
497
|
+
if (BUILD8.slotRelocation) {
|
|
298
498
|
vnode.$name$ = null;
|
|
299
499
|
}
|
|
300
500
|
return vnode;
|
|
@@ -352,7 +552,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
352
552
|
const shadowRoot = hostElm.shadowRoot;
|
|
353
553
|
const childRenderNodes = [];
|
|
354
554
|
const slotNodes = [];
|
|
355
|
-
const shadowRootNodes =
|
|
555
|
+
const shadowRootNodes = BUILD9.shadowDom && shadowRoot ? [] : null;
|
|
356
556
|
const vnode = hostRef.$vnode$ = newVNode(tagName, null);
|
|
357
557
|
if (!plt.$orgLocNodes$) {
|
|
358
558
|
initializeDocumentHydrate(doc.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
|
|
@@ -376,7 +576,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
376
576
|
}
|
|
377
577
|
plt.$orgLocNodes$.delete(orgLocationId);
|
|
378
578
|
});
|
|
379
|
-
if (
|
|
579
|
+
if (BUILD9.shadowDom && shadowRoot) {
|
|
380
580
|
shadowRootNodes.map((shadowRootNode) => {
|
|
381
581
|
if (shadowRootNode) {
|
|
382
582
|
shadowRoot.appendChild(shadowRootNode);
|
|
@@ -486,7 +686,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
486
686
|
node["s-sn"] = "";
|
|
487
687
|
}
|
|
488
688
|
node["s-sr"] = true;
|
|
489
|
-
if (
|
|
689
|
+
if (BUILD9.shadowDom && shadowRootNodes) {
|
|
490
690
|
childVNode.$elm$ = doc.createElement(childVNode.$tag$);
|
|
491
691
|
if (childVNode.$name$) {
|
|
492
692
|
childVNode.$elm$.setAttribute("name", childVNode.$name$);
|
|
@@ -503,9 +703,9 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
503
703
|
}
|
|
504
704
|
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
505
705
|
} else if (childNodeType === CONTENT_REF_ID) {
|
|
506
|
-
if (
|
|
706
|
+
if (BUILD9.shadowDom && shadowRootNodes) {
|
|
507
707
|
node.remove();
|
|
508
|
-
} else if (
|
|
708
|
+
} else if (BUILD9.slotRelocation) {
|
|
509
709
|
hostElm["s-cr"] = node;
|
|
510
710
|
node["s-cn"] = true;
|
|
511
711
|
}
|
|
@@ -541,7 +741,7 @@ var initializeDocumentHydrate = (node, orgLocNodes) => {
|
|
|
541
741
|
};
|
|
542
742
|
|
|
543
743
|
// src/runtime/initialize-component.ts
|
|
544
|
-
import { BUILD as
|
|
744
|
+
import { BUILD as BUILD20 } from "@stencil/core/internal/app-data";
|
|
545
745
|
|
|
546
746
|
// src/runtime/mode.ts
|
|
547
747
|
var computeMode = (elm) => modeResolutionChain.map((h2) => h2(elm)).find((m) => !!m);
|
|
@@ -549,22 +749,22 @@ var setMode = (handler) => modeResolutionChain.push(handler);
|
|
|
549
749
|
var getMode = (ref) => getHostRef(ref).$modeName$;
|
|
550
750
|
|
|
551
751
|
// src/runtime/proxy-component.ts
|
|
552
|
-
import { BUILD as
|
|
752
|
+
import { BUILD as BUILD19 } from "@stencil/core/internal/app-data";
|
|
553
753
|
|
|
554
754
|
// src/runtime/set-value.ts
|
|
555
|
-
import { BUILD as
|
|
755
|
+
import { BUILD as BUILD18 } from "@stencil/core/internal/app-data";
|
|
556
756
|
|
|
557
757
|
// src/runtime/parse-property-value.ts
|
|
558
|
-
import { BUILD as
|
|
758
|
+
import { BUILD as BUILD10 } from "@stencil/core/internal/app-data";
|
|
559
759
|
var parsePropertyValue = (propValue, propType) => {
|
|
560
760
|
if (propValue != null && !isComplexType(propValue)) {
|
|
561
|
-
if (
|
|
761
|
+
if (BUILD10.propBoolean && propType & 4 /* Boolean */) {
|
|
562
762
|
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
563
763
|
}
|
|
564
|
-
if (
|
|
764
|
+
if (BUILD10.propNumber && propType & 2 /* Number */) {
|
|
565
765
|
return parseFloat(propValue);
|
|
566
766
|
}
|
|
567
|
-
if (
|
|
767
|
+
if (BUILD10.propString && propType & 1 /* String */) {
|
|
568
768
|
return String(propValue);
|
|
569
769
|
}
|
|
570
770
|
return propValue;
|
|
@@ -573,21 +773,21 @@ var parsePropertyValue = (propValue, propType) => {
|
|
|
573
773
|
};
|
|
574
774
|
|
|
575
775
|
// src/runtime/update-component.ts
|
|
576
|
-
import { BUILD as
|
|
776
|
+
import { BUILD as BUILD17, NAMESPACE } from "@stencil/core/internal/app-data";
|
|
577
777
|
|
|
578
778
|
// src/runtime/event-emitter.ts
|
|
579
|
-
import { BUILD as
|
|
779
|
+
import { BUILD as BUILD12 } from "@stencil/core/internal/app-data";
|
|
580
780
|
|
|
581
781
|
// src/runtime/element.ts
|
|
582
|
-
import { BUILD as
|
|
583
|
-
var getElement = (ref) =>
|
|
782
|
+
import { BUILD as BUILD11 } from "@stencil/core/internal/app-data";
|
|
783
|
+
var getElement = (ref) => BUILD11.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
|
|
584
784
|
|
|
585
785
|
// src/runtime/event-emitter.ts
|
|
586
786
|
var createEvent = (ref, name, flags) => {
|
|
587
787
|
const elm = getElement(ref);
|
|
588
788
|
return {
|
|
589
789
|
emit: (detail) => {
|
|
590
|
-
if (
|
|
790
|
+
if (BUILD12.isDev && !elm.isConnected) {
|
|
591
791
|
consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
|
|
592
792
|
}
|
|
593
793
|
return emitEvent(elm, name, {
|
|
@@ -606,7 +806,7 @@ var emitEvent = (elm, name, opts) => {
|
|
|
606
806
|
};
|
|
607
807
|
|
|
608
808
|
// src/runtime/styles.ts
|
|
609
|
-
import { BUILD as
|
|
809
|
+
import { BUILD as BUILD13 } from "@stencil/core/internal/app-data";
|
|
610
810
|
var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
|
|
611
811
|
var registerStyle = (scopeId2, cssText, allowCS) => {
|
|
612
812
|
let style = styles.get(scopeId2);
|
|
@@ -628,7 +828,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
628
828
|
const styleContainerShadowRoot = styleContainerNode;
|
|
629
829
|
const scopeId2 = getScopeId(cmpMeta, mode);
|
|
630
830
|
const style = styles.get(scopeId2);
|
|
631
|
-
if (!
|
|
831
|
+
if (!BUILD13.attachStyles) {
|
|
632
832
|
return scopeId2;
|
|
633
833
|
}
|
|
634
834
|
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
|
@@ -641,7 +841,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
641
841
|
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
642
842
|
}
|
|
643
843
|
if (!appliedStyles.has(scopeId2)) {
|
|
644
|
-
if (
|
|
844
|
+
if (BUILD13.hydrateClientSide && styleContainerShadowRoot.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
|
|
645
845
|
styleElm.innerHTML = style;
|
|
646
846
|
} else {
|
|
647
847
|
styleElm = doc.createElement("style");
|
|
@@ -650,7 +850,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
650
850
|
if (nonce != null) {
|
|
651
851
|
styleElm.setAttribute("nonce", nonce);
|
|
652
852
|
}
|
|
653
|
-
if (
|
|
853
|
+
if (BUILD13.hydrateServerSide || BUILD13.hotModuleReplacement) {
|
|
654
854
|
styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
|
|
655
855
|
}
|
|
656
856
|
styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector("link"));
|
|
@@ -662,7 +862,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
662
862
|
appliedStyles.add(scopeId2);
|
|
663
863
|
}
|
|
664
864
|
}
|
|
665
|
-
} else if (
|
|
865
|
+
} else if (BUILD13.constructableCSS && !styleContainerDocument.adoptedStyleSheets.includes(style)) {
|
|
666
866
|
styleContainerDocument.adoptedStyleSheets = [...styleContainerDocument.adoptedStyleSheets, style];
|
|
667
867
|
}
|
|
668
868
|
}
|
|
@@ -674,45 +874,45 @@ var attachStyles = (hostRef) => {
|
|
|
674
874
|
const flags = cmpMeta.$flags$;
|
|
675
875
|
const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
|
|
676
876
|
const scopeId2 = addStyle(
|
|
677
|
-
|
|
877
|
+
BUILD13.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
678
878
|
cmpMeta,
|
|
679
879
|
hostRef.$modeName$
|
|
680
880
|
);
|
|
681
|
-
if ((
|
|
881
|
+
if ((BUILD13.shadowDom || BUILD13.scoped) && BUILD13.cssAnnotations && flags & 10 /* needsScopedEncapsulation */) {
|
|
682
882
|
elm["s-sc"] = scopeId2;
|
|
683
883
|
elm.classList.add(scopeId2 + "-h");
|
|
684
|
-
if (
|
|
884
|
+
if (BUILD13.scoped && flags & 2 /* scopedCssEncapsulation */) {
|
|
685
885
|
elm.classList.add(scopeId2 + "-s");
|
|
686
886
|
}
|
|
687
887
|
}
|
|
688
888
|
endAttachStyles();
|
|
689
889
|
};
|
|
690
|
-
var getScopeId = (cmp, mode) => "sc-" + (
|
|
890
|
+
var getScopeId = (cmp, mode) => "sc-" + (BUILD13.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
|
|
691
891
|
var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
|
|
692
892
|
|
|
693
893
|
// src/runtime/vdom/vdom-render.ts
|
|
694
|
-
import { BUILD as
|
|
894
|
+
import { BUILD as BUILD16 } from "@stencil/core/internal/app-data";
|
|
695
895
|
|
|
696
896
|
// src/runtime/vdom/update-element.ts
|
|
697
|
-
import { BUILD as
|
|
897
|
+
import { BUILD as BUILD15 } from "@stencil/core/internal/app-data";
|
|
698
898
|
|
|
699
899
|
// src/runtime/vdom/set-accessor.ts
|
|
700
|
-
import { BUILD as
|
|
900
|
+
import { BUILD as BUILD14 } from "@stencil/core/internal/app-data";
|
|
701
901
|
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
702
902
|
if (oldValue !== newValue) {
|
|
703
903
|
let isProp = isMemberInElement(elm, memberName);
|
|
704
904
|
let ln = memberName.toLowerCase();
|
|
705
|
-
if (
|
|
905
|
+
if (BUILD14.vdomClass && memberName === "class") {
|
|
706
906
|
const classList = elm.classList;
|
|
707
907
|
const oldClasses = parseClassList(oldValue);
|
|
708
908
|
const newClasses = parseClassList(newValue);
|
|
709
909
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
710
910
|
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
711
|
-
} else if (
|
|
712
|
-
if (
|
|
911
|
+
} else if (BUILD14.vdomStyle && memberName === "style") {
|
|
912
|
+
if (BUILD14.updatable) {
|
|
713
913
|
for (const prop in oldValue) {
|
|
714
914
|
if (!newValue || newValue[prop] == null) {
|
|
715
|
-
if (!
|
|
915
|
+
if (!BUILD14.hydrateServerSide && prop.includes("-")) {
|
|
716
916
|
elm.style.removeProperty(prop);
|
|
717
917
|
} else {
|
|
718
918
|
elm.style[prop] = "";
|
|
@@ -722,19 +922,19 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
722
922
|
}
|
|
723
923
|
for (const prop in newValue) {
|
|
724
924
|
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
725
|
-
if (!
|
|
925
|
+
if (!BUILD14.hydrateServerSide && prop.includes("-")) {
|
|
726
926
|
elm.style.setProperty(prop, newValue[prop]);
|
|
727
927
|
} else {
|
|
728
928
|
elm.style[prop] = newValue[prop];
|
|
729
929
|
}
|
|
730
930
|
}
|
|
731
931
|
}
|
|
732
|
-
} else if (
|
|
733
|
-
} else if (
|
|
932
|
+
} else if (BUILD14.vdomKey && memberName === "key") {
|
|
933
|
+
} else if (BUILD14.vdomRef && memberName === "ref") {
|
|
734
934
|
if (newValue) {
|
|
735
935
|
newValue(elm);
|
|
736
936
|
}
|
|
737
|
-
} else if (
|
|
937
|
+
} else if (BUILD14.vdomListener && (BUILD14.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
|
|
738
938
|
if (memberName[2] === "-") {
|
|
739
939
|
memberName = memberName.slice(3);
|
|
740
940
|
} else if (isMemberInElement(win, ln)) {
|
|
@@ -752,7 +952,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
752
952
|
plt.ael(elm, memberName, newValue, capture);
|
|
753
953
|
}
|
|
754
954
|
}
|
|
755
|
-
} else if (
|
|
955
|
+
} else if (BUILD14.vdomPropOrAttr) {
|
|
756
956
|
const isComplex = isComplexType(newValue);
|
|
757
957
|
if ((isProp || isComplex && newValue !== null) && !isSvg) {
|
|
758
958
|
try {
|
|
@@ -770,7 +970,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
770
970
|
}
|
|
771
971
|
}
|
|
772
972
|
let xlink = false;
|
|
773
|
-
if (
|
|
973
|
+
if (BUILD14.vdomXlink) {
|
|
774
974
|
if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) {
|
|
775
975
|
memberName = ln;
|
|
776
976
|
xlink = true;
|
|
@@ -778,7 +978,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
778
978
|
}
|
|
779
979
|
if (newValue == null || newValue === false) {
|
|
780
980
|
if (newValue !== false || elm.getAttribute(memberName) === "") {
|
|
781
|
-
if (
|
|
981
|
+
if (BUILD14.vdomXlink && xlink) {
|
|
782
982
|
elm.removeAttributeNS(XLINK_NS, memberName);
|
|
783
983
|
} else {
|
|
784
984
|
elm.removeAttribute(memberName);
|
|
@@ -786,7 +986,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
786
986
|
}
|
|
787
987
|
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
788
988
|
newValue = newValue === true ? "" : newValue;
|
|
789
|
-
if (
|
|
989
|
+
if (BUILD14.vdomXlink && xlink) {
|
|
790
990
|
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
|
791
991
|
} else {
|
|
792
992
|
elm.setAttribute(memberName, newValue);
|
|
@@ -805,7 +1005,7 @@ var updateElement = (oldVnode, newVnode, isSvgMode2) => {
|
|
|
805
1005
|
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
806
1006
|
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || EMPTY_OBJ;
|
|
807
1007
|
const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
|
|
808
|
-
if (
|
|
1008
|
+
if (BUILD15.updatable) {
|
|
809
1009
|
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
810
1010
|
if (!(memberName in newVnodeAttrs)) {
|
|
811
1011
|
setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
|
|
@@ -841,7 +1041,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
841
1041
|
let elm;
|
|
842
1042
|
let childNode;
|
|
843
1043
|
let oldVNode;
|
|
844
|
-
if (
|
|
1044
|
+
if (BUILD16.slotRelocation && !useNativeShadowDom) {
|
|
845
1045
|
checkSlotRelocate = true;
|
|
846
1046
|
if (newVNode2.$tag$ === "slot") {
|
|
847
1047
|
if (scopeId) {
|
|
@@ -859,35 +1059,35 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
859
1059
|
);
|
|
860
1060
|
}
|
|
861
1061
|
}
|
|
862
|
-
if (
|
|
1062
|
+
if (BUILD16.isDev && newVNode2.$elm$) {
|
|
863
1063
|
consoleDevError(
|
|
864
1064
|
`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`
|
|
865
1065
|
);
|
|
866
1066
|
}
|
|
867
|
-
if (
|
|
1067
|
+
if (BUILD16.vdomText && newVNode2.$text$ !== null) {
|
|
868
1068
|
elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
|
|
869
|
-
} else if (
|
|
870
|
-
elm = newVNode2.$elm$ =
|
|
1069
|
+
} else if (BUILD16.slotRelocation && newVNode2.$flags$ & 1 /* isSlotReference */) {
|
|
1070
|
+
elm = newVNode2.$elm$ = BUILD16.isDebug || BUILD16.hydrateServerSide ? slotReferenceDebugNode(newVNode2) : doc.createTextNode("");
|
|
871
1071
|
} else {
|
|
872
|
-
if (
|
|
1072
|
+
if (BUILD16.svg && !isSvgMode) {
|
|
873
1073
|
isSvgMode = newVNode2.$tag$ === "svg";
|
|
874
1074
|
}
|
|
875
|
-
elm = newVNode2.$elm$ =
|
|
1075
|
+
elm = newVNode2.$elm$ = BUILD16.svg ? doc.createElementNS(
|
|
876
1076
|
isSvgMode ? SVG_NS : HTML_NS,
|
|
877
|
-
|
|
1077
|
+
!useNativeShadowDom && BUILD16.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
878
1078
|
) : doc.createElement(
|
|
879
|
-
|
|
1079
|
+
!useNativeShadowDom && BUILD16.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
880
1080
|
);
|
|
881
|
-
if (
|
|
1081
|
+
if (BUILD16.svg && isSvgMode && newVNode2.$tag$ === "foreignObject") {
|
|
882
1082
|
isSvgMode = false;
|
|
883
1083
|
}
|
|
884
|
-
if (
|
|
1084
|
+
if (BUILD16.vdomAttribute) {
|
|
885
1085
|
updateElement(null, newVNode2, isSvgMode);
|
|
886
1086
|
}
|
|
887
|
-
if ((
|
|
1087
|
+
if ((BUILD16.shadowDom || BUILD16.scoped) && isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
888
1088
|
elm.classList.add(elm["s-si"] = scopeId);
|
|
889
1089
|
}
|
|
890
|
-
if (
|
|
1090
|
+
if (BUILD16.scoped) {
|
|
891
1091
|
updateElementScopeIds(elm, parentElm);
|
|
892
1092
|
}
|
|
893
1093
|
if (newVNode2.$children$) {
|
|
@@ -898,7 +1098,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
898
1098
|
}
|
|
899
1099
|
}
|
|
900
1100
|
}
|
|
901
|
-
if (
|
|
1101
|
+
if (BUILD16.svg) {
|
|
902
1102
|
if (newVNode2.$tag$ === "svg") {
|
|
903
1103
|
isSvgMode = false;
|
|
904
1104
|
} else if (elm.tagName === "foreignObject") {
|
|
@@ -907,7 +1107,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
907
1107
|
}
|
|
908
1108
|
}
|
|
909
1109
|
elm["s-hn"] = hostTagName;
|
|
910
|
-
if (
|
|
1110
|
+
if (BUILD16.slotRelocation) {
|
|
911
1111
|
if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
|
|
912
1112
|
elm["s-sr"] = true;
|
|
913
1113
|
elm["s-cr"] = contentRef;
|
|
@@ -915,7 +1115,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
915
1115
|
elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
|
|
916
1116
|
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
|
917
1117
|
if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
|
|
918
|
-
if (
|
|
1118
|
+
if (BUILD16.experimentalSlotFixes) {
|
|
919
1119
|
relocateToHostRoot(oldParentVNode.$elm$);
|
|
920
1120
|
} else {
|
|
921
1121
|
putBackInOriginalLocation(oldParentVNode.$elm$, false);
|
|
@@ -944,7 +1144,7 @@ var relocateToHostRoot = (parentElm) => {
|
|
|
944
1144
|
var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
945
1145
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
946
1146
|
const oldSlotChildNodes = Array.from(parentElm.childNodes);
|
|
947
|
-
if (parentElm["s-sr"] &&
|
|
1147
|
+
if (parentElm["s-sr"] && BUILD16.experimentalSlotFixes) {
|
|
948
1148
|
let node = parentElm;
|
|
949
1149
|
while (node = node.nextSibling) {
|
|
950
1150
|
if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
|
|
@@ -968,9 +1168,9 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
968
1168
|
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
969
1169
|
};
|
|
970
1170
|
var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
971
|
-
let containerElm =
|
|
1171
|
+
let containerElm = BUILD16.slotRelocation && parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
|
|
972
1172
|
let childNode;
|
|
973
|
-
if (
|
|
1173
|
+
if (BUILD16.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
974
1174
|
containerElm = containerElm.shadowRoot;
|
|
975
1175
|
}
|
|
976
1176
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
@@ -978,7 +1178,7 @@ var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
|
978
1178
|
childNode = createElm(null, parentVNode, startIdx, parentElm);
|
|
979
1179
|
if (childNode) {
|
|
980
1180
|
vnodes[startIdx].$elm$ = childNode;
|
|
981
|
-
insertBefore(containerElm, childNode,
|
|
1181
|
+
insertBefore(containerElm, childNode, BUILD16.slotRelocation ? referenceNode(before) : before);
|
|
982
1182
|
}
|
|
983
1183
|
}
|
|
984
1184
|
}
|
|
@@ -990,7 +1190,7 @@ var removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
|
990
1190
|
const elm = vnode.$elm$;
|
|
991
1191
|
nullifyVNodeRefs(vnode);
|
|
992
1192
|
if (elm) {
|
|
993
|
-
if (
|
|
1193
|
+
if (BUILD16.slotRelocation) {
|
|
994
1194
|
checkSlotFallbackVisibility = true;
|
|
995
1195
|
if (elm["s-ol"]) {
|
|
996
1196
|
elm["s-ol"].remove();
|
|
@@ -1034,7 +1234,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1034
1234
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
1035
1235
|
newEndVnode = newCh[--newEndIdx];
|
|
1036
1236
|
} else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
|
|
1037
|
-
if (
|
|
1237
|
+
if (BUILD16.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
1038
1238
|
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
1039
1239
|
}
|
|
1040
1240
|
patch(oldStartVnode, newEndVnode, isInitialRender);
|
|
@@ -1042,7 +1242,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1042
1242
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
1043
1243
|
newEndVnode = newCh[--newEndIdx];
|
|
1044
1244
|
} else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
|
|
1045
|
-
if (
|
|
1245
|
+
if (BUILD16.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
1046
1246
|
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
1047
1247
|
}
|
|
1048
1248
|
patch(oldEndVnode, newStartVnode, isInitialRender);
|
|
@@ -1051,7 +1251,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1051
1251
|
newStartVnode = newCh[++newStartIdx];
|
|
1052
1252
|
} else {
|
|
1053
1253
|
idxInOld = -1;
|
|
1054
|
-
if (
|
|
1254
|
+
if (BUILD16.vdomKey) {
|
|
1055
1255
|
for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
|
|
1056
1256
|
if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
|
|
1057
1257
|
idxInOld = i2;
|
|
@@ -1059,7 +1259,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1059
1259
|
}
|
|
1060
1260
|
}
|
|
1061
1261
|
}
|
|
1062
|
-
if (
|
|
1262
|
+
if (BUILD16.vdomKey && idxInOld >= 0) {
|
|
1063
1263
|
elmToMove = oldCh[idxInOld];
|
|
1064
1264
|
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
1065
1265
|
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld, parentElm);
|
|
@@ -1074,7 +1274,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1074
1274
|
newStartVnode = newCh[++newStartIdx];
|
|
1075
1275
|
}
|
|
1076
1276
|
if (node) {
|
|
1077
|
-
if (
|
|
1277
|
+
if (BUILD16.slotRelocation) {
|
|
1078
1278
|
insertBefore(parentReferenceNode(oldStartVnode.$elm$), node, referenceNode(oldStartVnode.$elm$));
|
|
1079
1279
|
} else {
|
|
1080
1280
|
insertBefore(oldStartVnode.$elm$.parentNode, node, oldStartVnode.$elm$);
|
|
@@ -1091,16 +1291,16 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1091
1291
|
newStartIdx,
|
|
1092
1292
|
newEndIdx
|
|
1093
1293
|
);
|
|
1094
|
-
} else if (
|
|
1294
|
+
} else if (BUILD16.updatable && newStartIdx > newEndIdx) {
|
|
1095
1295
|
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
|
1096
1296
|
}
|
|
1097
1297
|
};
|
|
1098
1298
|
var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
1099
1299
|
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
1100
|
-
if (
|
|
1300
|
+
if (BUILD16.slotRelocation && leftVNode.$tag$ === "slot") {
|
|
1101
1301
|
return leftVNode.$name$ === rightVNode.$name$;
|
|
1102
1302
|
}
|
|
1103
|
-
if (
|
|
1303
|
+
if (BUILD16.vdomKey && !isInitialRender) {
|
|
1104
1304
|
return leftVNode.$key$ === rightVNode.$key$;
|
|
1105
1305
|
}
|
|
1106
1306
|
return true;
|
|
@@ -1118,13 +1318,13 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
1118
1318
|
const tag = newVNode2.$tag$;
|
|
1119
1319
|
const text = newVNode2.$text$;
|
|
1120
1320
|
let defaultHolder;
|
|
1121
|
-
if (!
|
|
1122
|
-
if (
|
|
1321
|
+
if (!BUILD16.vdomText || text === null) {
|
|
1322
|
+
if (BUILD16.svg) {
|
|
1123
1323
|
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
|
1124
1324
|
}
|
|
1125
|
-
if (
|
|
1126
|
-
if (
|
|
1127
|
-
if (
|
|
1325
|
+
if (BUILD16.vdomAttribute || BUILD16.reflect) {
|
|
1326
|
+
if (BUILD16.slot && tag === "slot" && !useNativeShadowDom) {
|
|
1327
|
+
if (BUILD16.experimentalSlotFixes && oldVNode.$name$ !== newVNode2.$name$) {
|
|
1128
1328
|
newVNode2.$elm$["s-sn"] = newVNode2.$name$ || "";
|
|
1129
1329
|
relocateToHostRoot(newVNode2.$elm$.parentElement);
|
|
1130
1330
|
}
|
|
@@ -1132,22 +1332,22 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
1132
1332
|
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
1133
1333
|
}
|
|
1134
1334
|
}
|
|
1135
|
-
if (
|
|
1335
|
+
if (BUILD16.updatable && oldChildren !== null && newChildren !== null) {
|
|
1136
1336
|
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
|
|
1137
1337
|
} else if (newChildren !== null) {
|
|
1138
|
-
if (
|
|
1338
|
+
if (BUILD16.updatable && BUILD16.vdomText && oldVNode.$text$ !== null) {
|
|
1139
1339
|
elm.textContent = "";
|
|
1140
1340
|
}
|
|
1141
1341
|
addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
|
|
1142
|
-
} else if (
|
|
1342
|
+
} else if (BUILD16.updatable && oldChildren !== null) {
|
|
1143
1343
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
1144
1344
|
}
|
|
1145
|
-
if (
|
|
1345
|
+
if (BUILD16.svg && isSvgMode && tag === "svg") {
|
|
1146
1346
|
isSvgMode = false;
|
|
1147
1347
|
}
|
|
1148
|
-
} else if (
|
|
1348
|
+
} else if (BUILD16.vdomText && BUILD16.slotRelocation && (defaultHolder = elm["s-cr"])) {
|
|
1149
1349
|
defaultHolder.parentNode.textContent = text;
|
|
1150
|
-
} else if (
|
|
1350
|
+
} else if (BUILD16.vdomText && oldVNode.$text$ !== text) {
|
|
1151
1351
|
elm.data = text;
|
|
1152
1352
|
}
|
|
1153
1353
|
};
|
|
@@ -1189,7 +1389,7 @@ var markSlotContentForRelocation = (elm) => {
|
|
|
1189
1389
|
const slotName = childNode["s-sn"];
|
|
1190
1390
|
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
|
1191
1391
|
node = hostContentNodes[j];
|
|
1192
|
-
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!
|
|
1392
|
+
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!BUILD16.experimentalSlotFixes || !node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
|
|
1193
1393
|
if (isNodeLocatedInSlot(node, slotName)) {
|
|
1194
1394
|
let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1195
1395
|
checkSlotFallbackVisibility = true;
|
|
@@ -1243,14 +1443,14 @@ var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
|
|
|
1243
1443
|
return slotName === "";
|
|
1244
1444
|
};
|
|
1245
1445
|
var nullifyVNodeRefs = (vNode) => {
|
|
1246
|
-
if (
|
|
1446
|
+
if (BUILD16.vdomRef) {
|
|
1247
1447
|
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
1248
1448
|
vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
|
|
1249
1449
|
}
|
|
1250
1450
|
};
|
|
1251
1451
|
var insertBefore = (parent, newNode, reference) => {
|
|
1252
1452
|
const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
1253
|
-
if (
|
|
1453
|
+
if (BUILD16.scoped) {
|
|
1254
1454
|
updateElementScopeIds(newNode, parent);
|
|
1255
1455
|
}
|
|
1256
1456
|
return inserted;
|
|
@@ -1288,7 +1488,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1288
1488
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
1289
1489
|
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
1290
1490
|
hostTagName = hostElm.tagName;
|
|
1291
|
-
if (
|
|
1491
|
+
if (BUILD16.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
|
|
1292
1492
|
throw new Error(`The <Host> must be the single root component.
|
|
1293
1493
|
Looks like the render() function of "${hostTagName.toLowerCase()}" is returning an array that contains the <Host>.
|
|
1294
1494
|
|
|
@@ -1302,7 +1502,7 @@ render() {
|
|
|
1302
1502
|
}
|
|
1303
1503
|
`);
|
|
1304
1504
|
}
|
|
1305
|
-
if (
|
|
1505
|
+
if (BUILD16.reflect && cmpMeta.$attrsToReflect$) {
|
|
1306
1506
|
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
1307
1507
|
cmpMeta.$attrsToReflect$.map(
|
|
1308
1508
|
([propName, attribute]) => rootVnode.$attrs$[attribute] = hostElm[propName]
|
|
@@ -1318,24 +1518,24 @@ render() {
|
|
|
1318
1518
|
rootVnode.$tag$ = null;
|
|
1319
1519
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
1320
1520
|
hostRef.$vnode$ = rootVnode;
|
|
1321
|
-
rootVnode.$elm$ = oldVNode.$elm$ =
|
|
1322
|
-
if (
|
|
1521
|
+
rootVnode.$elm$ = oldVNode.$elm$ = BUILD16.shadowDom ? hostElm.shadowRoot || hostElm : hostElm;
|
|
1522
|
+
if (BUILD16.scoped || BUILD16.shadowDom) {
|
|
1323
1523
|
scopeId = hostElm["s-sc"];
|
|
1324
1524
|
}
|
|
1325
1525
|
useNativeShadowDom = supportsShadow && (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
1326
|
-
if (
|
|
1526
|
+
if (BUILD16.slotRelocation) {
|
|
1327
1527
|
contentRef = hostElm["s-cr"];
|
|
1328
1528
|
checkSlotFallbackVisibility = false;
|
|
1329
1529
|
}
|
|
1330
1530
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
1331
|
-
if (
|
|
1531
|
+
if (BUILD16.slotRelocation) {
|
|
1332
1532
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1333
1533
|
if (checkSlotRelocate) {
|
|
1334
1534
|
markSlotContentForRelocation(rootVnode.$elm$);
|
|
1335
1535
|
for (const relocateData of relocateNodes) {
|
|
1336
1536
|
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1337
1537
|
if (!nodeToRelocate["s-ol"]) {
|
|
1338
|
-
const orgLocationNode =
|
|
1538
|
+
const orgLocationNode = BUILD16.isDebug || BUILD16.hydrateServerSide ? originalLocationDebugNode(nodeToRelocate) : doc.createTextNode("");
|
|
1339
1539
|
orgLocationNode["s-nr"] = nodeToRelocate;
|
|
1340
1540
|
insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
|
|
1341
1541
|
}
|
|
@@ -1346,7 +1546,7 @@ render() {
|
|
|
1346
1546
|
if (slotRefNode) {
|
|
1347
1547
|
const parentNodeRef = slotRefNode.parentNode;
|
|
1348
1548
|
let insertBeforeNode = slotRefNode.nextSibling;
|
|
1349
|
-
if (!
|
|
1549
|
+
if (!BUILD16.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */) {
|
|
1350
1550
|
let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
|
|
1351
1551
|
while (orgLocationNode) {
|
|
1352
1552
|
let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
|
|
@@ -1365,7 +1565,7 @@ render() {
|
|
|
1365
1565
|
}
|
|
1366
1566
|
if (!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode || nodeToRelocate.nextSibling !== insertBeforeNode) {
|
|
1367
1567
|
if (nodeToRelocate !== insertBeforeNode) {
|
|
1368
|
-
if (!
|
|
1568
|
+
if (!BUILD16.experimentalSlotFixes && !nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
|
|
1369
1569
|
nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
|
|
1370
1570
|
}
|
|
1371
1571
|
insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
|
|
@@ -1391,7 +1591,7 @@ render() {
|
|
|
1391
1591
|
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
1392
1592
|
relocateNodes.length = 0;
|
|
1393
1593
|
}
|
|
1394
|
-
if (
|
|
1594
|
+
if (BUILD16.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
1395
1595
|
for (const childNode of rootVnode.$elm$.childNodes) {
|
|
1396
1596
|
if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
|
|
1397
1597
|
if (isInitialLoad && childNode["s-ih"] == null) {
|
|
@@ -1412,26 +1612,26 @@ var originalLocationDebugNode = (nodeToRelocate) => doc.createComment(
|
|
|
1412
1612
|
|
|
1413
1613
|
// src/runtime/update-component.ts
|
|
1414
1614
|
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
1415
|
-
if (
|
|
1615
|
+
if (BUILD17.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
1416
1616
|
ancestorComponent["s-p"].push(new Promise((r) => hostRef.$onRenderResolve$ = r));
|
|
1417
1617
|
}
|
|
1418
1618
|
};
|
|
1419
1619
|
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
1420
|
-
if (
|
|
1620
|
+
if (BUILD17.taskQueue && BUILD17.updatable) {
|
|
1421
1621
|
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
|
|
1422
1622
|
}
|
|
1423
|
-
if (
|
|
1623
|
+
if (BUILD17.asyncLoading && hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
|
1424
1624
|
hostRef.$flags$ |= 512 /* needsRerender */;
|
|
1425
1625
|
return;
|
|
1426
1626
|
}
|
|
1427
1627
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
1428
1628
|
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
|
|
1429
|
-
return
|
|
1629
|
+
return BUILD17.taskQueue ? writeTask(dispatch) : dispatch();
|
|
1430
1630
|
};
|
|
1431
1631
|
var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
1432
1632
|
const elm = hostRef.$hostElement$;
|
|
1433
1633
|
const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
|
|
1434
|
-
const instance =
|
|
1634
|
+
const instance = BUILD17.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
1435
1635
|
if (!instance) {
|
|
1436
1636
|
throw new Error(
|
|
1437
1637
|
`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`
|
|
@@ -1439,7 +1639,7 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
1439
1639
|
}
|
|
1440
1640
|
let maybePromise;
|
|
1441
1641
|
if (isInitialLoad) {
|
|
1442
|
-
if (
|
|
1642
|
+
if (BUILD17.lazyLoad && BUILD17.hostListener) {
|
|
1443
1643
|
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
1444
1644
|
if (hostRef.$queuedListeners$) {
|
|
1445
1645
|
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
@@ -1447,17 +1647,17 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
1447
1647
|
}
|
|
1448
1648
|
}
|
|
1449
1649
|
emitLifecycleEvent(elm, "componentWillLoad");
|
|
1450
|
-
if (
|
|
1650
|
+
if (BUILD17.cmpWillLoad) {
|
|
1451
1651
|
maybePromise = safeCall(instance, "componentWillLoad");
|
|
1452
1652
|
}
|
|
1453
1653
|
} else {
|
|
1454
1654
|
emitLifecycleEvent(elm, "componentWillUpdate");
|
|
1455
|
-
if (
|
|
1655
|
+
if (BUILD17.cmpWillUpdate) {
|
|
1456
1656
|
maybePromise = safeCall(instance, "componentWillUpdate");
|
|
1457
1657
|
}
|
|
1458
1658
|
}
|
|
1459
1659
|
emitLifecycleEvent(elm, "componentWillRender");
|
|
1460
|
-
if (
|
|
1660
|
+
if (BUILD17.cmpWillRender) {
|
|
1461
1661
|
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender"));
|
|
1462
1662
|
}
|
|
1463
1663
|
endSchedule();
|
|
@@ -1473,23 +1673,23 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1473
1673
|
const elm = hostRef.$hostElement$;
|
|
1474
1674
|
const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
|
|
1475
1675
|
const rc = elm["s-rc"];
|
|
1476
|
-
if (
|
|
1676
|
+
if (BUILD17.style && isInitialLoad) {
|
|
1477
1677
|
attachStyles(hostRef);
|
|
1478
1678
|
}
|
|
1479
1679
|
const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
|
|
1480
|
-
if (
|
|
1680
|
+
if (BUILD17.isDev) {
|
|
1481
1681
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
1482
1682
|
}
|
|
1483
|
-
if (
|
|
1683
|
+
if (BUILD17.hydrateServerSide) {
|
|
1484
1684
|
await callRender(hostRef, instance, elm, isInitialLoad);
|
|
1485
1685
|
} else {
|
|
1486
1686
|
callRender(hostRef, instance, elm, isInitialLoad);
|
|
1487
1687
|
}
|
|
1488
|
-
if (
|
|
1688
|
+
if (BUILD17.isDev) {
|
|
1489
1689
|
hostRef.$renderCount$ = hostRef.$renderCount$ === void 0 ? 1 : hostRef.$renderCount$ + 1;
|
|
1490
1690
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
1491
1691
|
}
|
|
1492
|
-
if (
|
|
1692
|
+
if (BUILD17.hydrateServerSide) {
|
|
1493
1693
|
try {
|
|
1494
1694
|
serverSideConnected(elm);
|
|
1495
1695
|
if (isInitialLoad) {
|
|
@@ -1503,13 +1703,13 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1503
1703
|
consoleError(e, elm);
|
|
1504
1704
|
}
|
|
1505
1705
|
}
|
|
1506
|
-
if (
|
|
1706
|
+
if (BUILD17.asyncLoading && rc) {
|
|
1507
1707
|
rc.map((cb) => cb());
|
|
1508
1708
|
elm["s-rc"] = void 0;
|
|
1509
1709
|
}
|
|
1510
1710
|
endRender();
|
|
1511
1711
|
endUpdate();
|
|
1512
|
-
if (
|
|
1712
|
+
if (BUILD17.asyncLoading) {
|
|
1513
1713
|
const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
|
|
1514
1714
|
const postUpdate = () => postUpdateComponent(hostRef);
|
|
1515
1715
|
if (childrenPromises.length === 0) {
|
|
@@ -1525,10 +1725,10 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1525
1725
|
};
|
|
1526
1726
|
var renderingRef = null;
|
|
1527
1727
|
var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
1528
|
-
const allRenderFn =
|
|
1529
|
-
const lazyLoad =
|
|
1530
|
-
const taskQueue =
|
|
1531
|
-
const updatable =
|
|
1728
|
+
const allRenderFn = BUILD17.allRenderFn ? true : false;
|
|
1729
|
+
const lazyLoad = BUILD17.lazyLoad ? true : false;
|
|
1730
|
+
const taskQueue = BUILD17.taskQueue ? true : false;
|
|
1731
|
+
const updatable = BUILD17.updatable ? true : false;
|
|
1532
1732
|
try {
|
|
1533
1733
|
renderingRef = instance;
|
|
1534
1734
|
instance = allRenderFn ? instance.render() : instance.render && instance.render();
|
|
@@ -1538,9 +1738,9 @@ var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
|
1538
1738
|
if (updatable || lazyLoad) {
|
|
1539
1739
|
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
1540
1740
|
}
|
|
1541
|
-
if (
|
|
1542
|
-
if (
|
|
1543
|
-
if (
|
|
1741
|
+
if (BUILD17.hasRenderFn || BUILD17.reflect) {
|
|
1742
|
+
if (BUILD17.vdomRender || BUILD17.reflect) {
|
|
1743
|
+
if (BUILD17.hydrateServerSide) {
|
|
1544
1744
|
return Promise.resolve(instance).then((value) => renderVdom(hostRef, value, isInitialLoad));
|
|
1545
1745
|
} else {
|
|
1546
1746
|
renderVdom(hostRef, instance, isInitialLoad);
|
|
@@ -1565,57 +1765,57 @@ var postUpdateComponent = (hostRef) => {
|
|
|
1565
1765
|
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
1566
1766
|
const elm = hostRef.$hostElement$;
|
|
1567
1767
|
const endPostUpdate = createTime("postUpdate", tagName);
|
|
1568
|
-
const instance =
|
|
1768
|
+
const instance = BUILD17.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
1569
1769
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1570
|
-
if (
|
|
1571
|
-
if (
|
|
1770
|
+
if (BUILD17.cmpDidRender) {
|
|
1771
|
+
if (BUILD17.isDev) {
|
|
1572
1772
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
1573
1773
|
}
|
|
1574
1774
|
safeCall(instance, "componentDidRender");
|
|
1575
|
-
if (
|
|
1775
|
+
if (BUILD17.isDev) {
|
|
1576
1776
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
1577
1777
|
}
|
|
1578
1778
|
}
|
|
1579
1779
|
emitLifecycleEvent(elm, "componentDidRender");
|
|
1580
1780
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
1581
1781
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
1582
|
-
if (
|
|
1782
|
+
if (BUILD17.asyncLoading && BUILD17.cssAnnotations) {
|
|
1583
1783
|
addHydratedFlag(elm);
|
|
1584
1784
|
}
|
|
1585
|
-
if (
|
|
1586
|
-
if (
|
|
1785
|
+
if (BUILD17.cmpDidLoad) {
|
|
1786
|
+
if (BUILD17.isDev) {
|
|
1587
1787
|
hostRef.$flags$ |= 2048 /* devOnDidLoad */;
|
|
1588
1788
|
}
|
|
1589
1789
|
safeCall(instance, "componentDidLoad");
|
|
1590
|
-
if (
|
|
1790
|
+
if (BUILD17.isDev) {
|
|
1591
1791
|
hostRef.$flags$ &= ~2048 /* devOnDidLoad */;
|
|
1592
1792
|
}
|
|
1593
1793
|
}
|
|
1594
1794
|
emitLifecycleEvent(elm, "componentDidLoad");
|
|
1595
1795
|
endPostUpdate();
|
|
1596
|
-
if (
|
|
1796
|
+
if (BUILD17.asyncLoading) {
|
|
1597
1797
|
hostRef.$onReadyResolve$(elm);
|
|
1598
1798
|
if (!ancestorComponent) {
|
|
1599
1799
|
appDidLoad(tagName);
|
|
1600
1800
|
}
|
|
1601
1801
|
}
|
|
1602
1802
|
} else {
|
|
1603
|
-
if (
|
|
1604
|
-
if (
|
|
1803
|
+
if (BUILD17.cmpDidUpdate) {
|
|
1804
|
+
if (BUILD17.isDev) {
|
|
1605
1805
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
1606
1806
|
}
|
|
1607
1807
|
safeCall(instance, "componentDidUpdate");
|
|
1608
|
-
if (
|
|
1808
|
+
if (BUILD17.isDev) {
|
|
1609
1809
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
1610
1810
|
}
|
|
1611
1811
|
}
|
|
1612
1812
|
emitLifecycleEvent(elm, "componentDidUpdate");
|
|
1613
1813
|
endPostUpdate();
|
|
1614
1814
|
}
|
|
1615
|
-
if (
|
|
1815
|
+
if (BUILD17.method && BUILD17.lazyLoad) {
|
|
1616
1816
|
hostRef.$onInstanceResolve$(elm);
|
|
1617
1817
|
}
|
|
1618
|
-
if (
|
|
1818
|
+
if (BUILD17.asyncLoading) {
|
|
1619
1819
|
if (hostRef.$onRenderResolve$) {
|
|
1620
1820
|
hostRef.$onRenderResolve$();
|
|
1621
1821
|
hostRef.$onRenderResolve$ = void 0;
|
|
@@ -1627,7 +1827,7 @@ var postUpdateComponent = (hostRef) => {
|
|
|
1627
1827
|
}
|
|
1628
1828
|
};
|
|
1629
1829
|
var forceUpdate = (ref) => {
|
|
1630
|
-
if (
|
|
1830
|
+
if (BUILD17.updatable && (Build.isBrowser || Build.isTesting)) {
|
|
1631
1831
|
const hostRef = getHostRef(ref);
|
|
1632
1832
|
const isConnected = hostRef.$hostElement$.isConnected;
|
|
1633
1833
|
if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
@@ -1638,14 +1838,14 @@ var forceUpdate = (ref) => {
|
|
|
1638
1838
|
return false;
|
|
1639
1839
|
};
|
|
1640
1840
|
var appDidLoad = (who) => {
|
|
1641
|
-
if (
|
|
1841
|
+
if (BUILD17.cssAnnotations) {
|
|
1642
1842
|
addHydratedFlag(doc.documentElement);
|
|
1643
1843
|
}
|
|
1644
|
-
if (
|
|
1844
|
+
if (BUILD17.asyncQueue) {
|
|
1645
1845
|
plt.$flags$ |= 2 /* appLoaded */;
|
|
1646
1846
|
}
|
|
1647
1847
|
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
1648
|
-
if (
|
|
1848
|
+
if (BUILD17.profile && performance.measure) {
|
|
1649
1849
|
performance.measure(`[Stencil] ${NAMESPACE} initial load (by ${who})`, "st:app:start");
|
|
1650
1850
|
}
|
|
1651
1851
|
};
|
|
@@ -1660,7 +1860,7 @@ var safeCall = (instance, method, arg) => {
|
|
|
1660
1860
|
return void 0;
|
|
1661
1861
|
};
|
|
1662
1862
|
var emitLifecycleEvent = (elm, lifecycleName) => {
|
|
1663
|
-
if (
|
|
1863
|
+
if (BUILD17.lifecycleDOMEvents) {
|
|
1664
1864
|
emitEvent(elm, "stencil_" + lifecycleName, {
|
|
1665
1865
|
bubbles: true,
|
|
1666
1866
|
composed: true,
|
|
@@ -1672,7 +1872,7 @@ var emitLifecycleEvent = (elm, lifecycleName) => {
|
|
|
1672
1872
|
};
|
|
1673
1873
|
var addHydratedFlag = (elm) => {
|
|
1674
1874
|
var _a, _b;
|
|
1675
|
-
return
|
|
1875
|
+
return BUILD17.hydratedClass ? elm.classList.add((_a = BUILD17.hydratedSelectorName) != null ? _a : "hydrated") : BUILD17.hydratedAttribute ? elm.setAttribute((_b = BUILD17.hydratedSelectorName) != null ? _b : "hydrated", "") : void 0;
|
|
1676
1876
|
};
|
|
1677
1877
|
var serverSideConnected = (elm) => {
|
|
1678
1878
|
const children = elm.children;
|
|
@@ -1691,21 +1891,21 @@ var serverSideConnected = (elm) => {
|
|
|
1691
1891
|
var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
1692
1892
|
var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
1693
1893
|
const hostRef = getHostRef(ref);
|
|
1694
|
-
if (
|
|
1894
|
+
if (BUILD18.lazyLoad && !hostRef) {
|
|
1695
1895
|
throw new Error(
|
|
1696
1896
|
`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).`
|
|
1697
1897
|
);
|
|
1698
1898
|
}
|
|
1699
|
-
const elm =
|
|
1899
|
+
const elm = BUILD18.lazyLoad ? hostRef.$hostElement$ : ref;
|
|
1700
1900
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
1701
1901
|
const flags = hostRef.$flags$;
|
|
1702
|
-
const instance =
|
|
1902
|
+
const instance = BUILD18.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
1703
1903
|
newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
|
|
1704
1904
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
1705
1905
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
1706
|
-
if ((!
|
|
1906
|
+
if ((!BUILD18.lazyLoad || !(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
|
|
1707
1907
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
1708
|
-
if (
|
|
1908
|
+
if (BUILD18.isDev) {
|
|
1709
1909
|
if (hostRef.$flags$ & 1024 /* devOnRender */) {
|
|
1710
1910
|
consoleDevWarn(
|
|
1711
1911
|
`The state/prop "${propName}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`,
|
|
@@ -1728,8 +1928,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1728
1928
|
);
|
|
1729
1929
|
}
|
|
1730
1930
|
}
|
|
1731
|
-
if (!
|
|
1732
|
-
if (
|
|
1931
|
+
if (!BUILD18.lazyLoad || instance) {
|
|
1932
|
+
if (BUILD18.watchCallback && cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
|
|
1733
1933
|
const watchMethods = cmpMeta.$watchers$[propName];
|
|
1734
1934
|
if (watchMethods) {
|
|
1735
1935
|
watchMethods.map((watchMethodName) => {
|
|
@@ -1741,8 +1941,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1741
1941
|
});
|
|
1742
1942
|
}
|
|
1743
1943
|
}
|
|
1744
|
-
if (
|
|
1745
|
-
if (
|
|
1944
|
+
if (BUILD18.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
1945
|
+
if (BUILD18.cmpShouldUpdate && instance.componentShouldUpdate) {
|
|
1746
1946
|
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
|
1747
1947
|
return;
|
|
1748
1948
|
}
|
|
@@ -1757,13 +1957,13 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1757
1957
|
var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1758
1958
|
var _a;
|
|
1759
1959
|
const prototype = Cstr.prototype;
|
|
1760
|
-
if (
|
|
1960
|
+
if (BUILD19.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
|
|
1761
1961
|
FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach(
|
|
1762
1962
|
(cbName) => Object.defineProperty(prototype, cbName, {
|
|
1763
1963
|
value(...args) {
|
|
1764
1964
|
const hostRef = getHostRef(this);
|
|
1765
|
-
const elm =
|
|
1766
|
-
const instance =
|
|
1965
|
+
const elm = BUILD19.lazyLoad ? hostRef.$hostElement$ : this;
|
|
1966
|
+
const instance = BUILD19.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
1767
1967
|
if (!instance) {
|
|
1768
1968
|
hostRef.$onReadyPromise$.then((instance2) => {
|
|
1769
1969
|
const cb = instance2[cbName];
|
|
@@ -1777,19 +1977,19 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1777
1977
|
})
|
|
1778
1978
|
);
|
|
1779
1979
|
}
|
|
1780
|
-
if (
|
|
1781
|
-
if (
|
|
1980
|
+
if (BUILD19.member && cmpMeta.$members$) {
|
|
1981
|
+
if (BUILD19.watchCallback && Cstr.watchers) {
|
|
1782
1982
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1783
1983
|
}
|
|
1784
1984
|
const members = Object.entries(cmpMeta.$members$);
|
|
1785
1985
|
members.map(([memberName, [memberFlags]]) => {
|
|
1786
|
-
if ((
|
|
1986
|
+
if ((BUILD19.prop || BUILD19.state) && (memberFlags & 31 /* Prop */ || (!BUILD19.lazyLoad || flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
1787
1987
|
Object.defineProperty(prototype, memberName, {
|
|
1788
1988
|
get() {
|
|
1789
1989
|
return getValue(this, memberName);
|
|
1790
1990
|
},
|
|
1791
1991
|
set(newValue) {
|
|
1792
|
-
if (
|
|
1992
|
+
if (BUILD19.isDev) {
|
|
1793
1993
|
const ref = getHostRef(this);
|
|
1794
1994
|
if (
|
|
1795
1995
|
// we are proxying the instance (not element)
|
|
@@ -1809,7 +2009,7 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
1809
2009
|
configurable: true,
|
|
1810
2010
|
enumerable: true
|
|
1811
2011
|
});
|
|
1812
|
-
} else if (
|
|
2012
|
+
} else if (BUILD19.lazyLoad && BUILD19.method && flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
|
|
1813
2013
|
Object.defineProperty(prototype, memberName, {
|
|
1814
2014
|
value(...args) {
|
|
1815
2015
|
var _a2;
|
|
@@ -1822,7 +2022,7 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
1822
2022
|
});
|
|
1823
2023
|
}
|
|
1824
2024
|
});
|
|
1825
|
-
if (
|
|
2025
|
+
if (BUILD19.observeAttribute && (!BUILD19.lazyLoad || flags & 1 /* isElementConstructor */)) {
|
|
1826
2026
|
const attrNameToPropName = /* @__PURE__ */ new Map();
|
|
1827
2027
|
prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
|
|
1828
2028
|
plt.jmp(() => {
|
|
@@ -1837,8 +2037,8 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
1837
2037
|
const hostRef = getHostRef(this);
|
|
1838
2038
|
const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
|
|
1839
2039
|
if (flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
|
|
1840
|
-
const elm =
|
|
1841
|
-
const instance =
|
|
2040
|
+
const elm = BUILD19.lazyLoad ? hostRef.$hostElement$ : this;
|
|
2041
|
+
const instance = BUILD19.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
1842
2042
|
const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
|
|
1843
2043
|
entry == null ? void 0 : entry.forEach((callbackName) => {
|
|
1844
2044
|
if (instance[callbackName] != null) {
|
|
@@ -1858,7 +2058,7 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
1858
2058
|
var _a2;
|
|
1859
2059
|
const attrName = m[1] || propName;
|
|
1860
2060
|
attrNameToPropName.set(attrName, propName);
|
|
1861
|
-
if (
|
|
2061
|
+
if (BUILD19.reflect && m[0] & 512 /* ReflectAttr */) {
|
|
1862
2062
|
(_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);
|
|
1863
2063
|
}
|
|
1864
2064
|
return attrName;
|
|
@@ -1876,7 +2076,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1876
2076
|
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
1877
2077
|
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
1878
2078
|
const bundleId = cmpMeta.$lazyBundleId$;
|
|
1879
|
-
if ((
|
|
2079
|
+
if ((BUILD20.lazyLoad || BUILD20.hydrateClientSide) && bundleId) {
|
|
1880
2080
|
const CstrImport = loadModule(cmpMeta, hostRef, hmrVersionId);
|
|
1881
2081
|
if (CstrImport && "then" in CstrImport) {
|
|
1882
2082
|
const endLoad = uniqueTime(
|
|
@@ -1891,15 +2091,15 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1891
2091
|
if (!Cstr) {
|
|
1892
2092
|
throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
|
|
1893
2093
|
}
|
|
1894
|
-
if (
|
|
1895
|
-
if (
|
|
2094
|
+
if (BUILD20.member && !Cstr.isProxied) {
|
|
2095
|
+
if (BUILD20.watchCallback) {
|
|
1896
2096
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
1897
2097
|
}
|
|
1898
2098
|
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
1899
2099
|
Cstr.isProxied = true;
|
|
1900
2100
|
}
|
|
1901
2101
|
const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
|
|
1902
|
-
if (
|
|
2102
|
+
if (BUILD20.member) {
|
|
1903
2103
|
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
|
1904
2104
|
}
|
|
1905
2105
|
try {
|
|
@@ -1907,10 +2107,10 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1907
2107
|
} catch (e) {
|
|
1908
2108
|
consoleError(e);
|
|
1909
2109
|
}
|
|
1910
|
-
if (
|
|
2110
|
+
if (BUILD20.member) {
|
|
1911
2111
|
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
1912
2112
|
}
|
|
1913
|
-
if (
|
|
2113
|
+
if (BUILD20.watchCallback) {
|
|
1914
2114
|
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
1915
2115
|
}
|
|
1916
2116
|
endNewInstance();
|
|
@@ -1920,24 +2120,24 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1920
2120
|
const cmpTag = elm.localName;
|
|
1921
2121
|
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
|
|
1922
2122
|
}
|
|
1923
|
-
if (
|
|
2123
|
+
if (BUILD20.style && Cstr && Cstr.style) {
|
|
1924
2124
|
let style;
|
|
1925
2125
|
if (typeof Cstr.style === "string") {
|
|
1926
2126
|
style = Cstr.style;
|
|
1927
|
-
} else if (
|
|
2127
|
+
} else if (BUILD20.mode && typeof Cstr.style !== "string") {
|
|
1928
2128
|
hostRef.$modeName$ = computeMode(elm);
|
|
1929
2129
|
if (hostRef.$modeName$) {
|
|
1930
2130
|
style = Cstr.style[hostRef.$modeName$];
|
|
1931
2131
|
}
|
|
1932
|
-
if (
|
|
2132
|
+
if (BUILD20.hydrateServerSide && hostRef.$modeName$) {
|
|
1933
2133
|
elm.setAttribute("s-mode", hostRef.$modeName$);
|
|
1934
2134
|
}
|
|
1935
2135
|
}
|
|
1936
2136
|
const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
|
|
1937
2137
|
if (!styles.has(scopeId2)) {
|
|
1938
2138
|
const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
|
|
1939
|
-
if (!
|
|
1940
|
-
|
|
2139
|
+
if (!BUILD20.hydrateServerSide && BUILD20.shadowDom && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
2140
|
+
BUILD20.shadowDomShim && cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
|
|
1941
2141
|
style = await import("./shadow-css.js").then((m) => m.scopeCss(style, scopeId2, false));
|
|
1942
2142
|
}
|
|
1943
2143
|
registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
@@ -1947,14 +2147,14 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1947
2147
|
}
|
|
1948
2148
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1949
2149
|
const schedule = () => scheduleUpdate(hostRef, true);
|
|
1950
|
-
if (
|
|
2150
|
+
if (BUILD20.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
|
|
1951
2151
|
ancestorComponent["s-rc"].push(schedule);
|
|
1952
2152
|
} else {
|
|
1953
2153
|
schedule();
|
|
1954
2154
|
}
|
|
1955
2155
|
};
|
|
1956
2156
|
var fireConnectedCallback = (instance) => {
|
|
1957
|
-
if (
|
|
2157
|
+
if (BUILD20.lazyLoad && BUILD20.connectedCallback) {
|
|
1958
2158
|
safeCall(instance, "connectedCallback");
|
|
1959
2159
|
}
|
|
1960
2160
|
};
|
|
@@ -1965,38 +2165,38 @@ var connectedCallback = (elm) => {
|
|
|
1965
2165
|
const hostRef = getHostRef(elm);
|
|
1966
2166
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
1967
2167
|
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
|
|
1968
|
-
if (
|
|
2168
|
+
if (BUILD21.hostListenerTargetParent) {
|
|
1969
2169
|
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);
|
|
1970
2170
|
}
|
|
1971
2171
|
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
1972
2172
|
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
1973
2173
|
let hostId;
|
|
1974
|
-
if (
|
|
2174
|
+
if (BUILD21.hydrateClientSide) {
|
|
1975
2175
|
hostId = elm.getAttribute(HYDRATE_ID);
|
|
1976
2176
|
if (hostId) {
|
|
1977
|
-
if (
|
|
1978
|
-
const scopeId2 =
|
|
2177
|
+
if (BUILD21.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2178
|
+
const scopeId2 = BUILD21.mode ? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute("s-mode")) : addStyle(elm.shadowRoot, cmpMeta);
|
|
1979
2179
|
elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
|
|
1980
2180
|
}
|
|
1981
2181
|
initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
|
|
1982
2182
|
}
|
|
1983
2183
|
}
|
|
1984
|
-
if (
|
|
1985
|
-
if (
|
|
2184
|
+
if (BUILD21.slotRelocation && !hostId) {
|
|
2185
|
+
if (BUILD21.hydrateServerSide || (BUILD21.slot || BUILD21.shadowDom) && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
1986
2186
|
cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
|
|
1987
2187
|
setContentReference(elm);
|
|
1988
2188
|
}
|
|
1989
2189
|
}
|
|
1990
|
-
if (
|
|
2190
|
+
if (BUILD21.asyncLoading) {
|
|
1991
2191
|
let ancestorComponent = elm;
|
|
1992
2192
|
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
|
|
1993
|
-
if (
|
|
2193
|
+
if (BUILD21.hydrateClientSide && ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
|
|
1994
2194
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
|
|
1995
2195
|
break;
|
|
1996
2196
|
}
|
|
1997
2197
|
}
|
|
1998
2198
|
}
|
|
1999
|
-
if (
|
|
2199
|
+
if (BUILD21.prop && !BUILD21.hydrateServerSide && cmpMeta.$members$) {
|
|
2000
2200
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
2001
2201
|
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
|
2002
2202
|
const value = elm[memberName];
|
|
@@ -2005,7 +2205,7 @@ var connectedCallback = (elm) => {
|
|
|
2005
2205
|
}
|
|
2006
2206
|
});
|
|
2007
2207
|
}
|
|
2008
|
-
if (
|
|
2208
|
+
if (BUILD21.initializeNextTick) {
|
|
2009
2209
|
nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
|
|
2010
2210
|
} else {
|
|
2011
2211
|
initializeComponent(elm, hostRef, cmpMeta);
|
|
@@ -2023,32 +2223,32 @@ var connectedCallback = (elm) => {
|
|
|
2023
2223
|
};
|
|
2024
2224
|
var setContentReference = (elm) => {
|
|
2025
2225
|
const contentRefElm = elm["s-cr"] = doc.createComment(
|
|
2026
|
-
|
|
2226
|
+
BUILD21.isDebug ? `content-ref (host=${elm.localName})` : ""
|
|
2027
2227
|
);
|
|
2028
2228
|
contentRefElm["s-cn"] = true;
|
|
2029
2229
|
insertBefore(elm, contentRefElm, elm.firstChild);
|
|
2030
2230
|
};
|
|
2031
2231
|
|
|
2032
2232
|
// src/runtime/disconnected-callback.ts
|
|
2033
|
-
import { BUILD as
|
|
2233
|
+
import { BUILD as BUILD22 } from "@stencil/core/internal/app-data";
|
|
2034
2234
|
var disconnectInstance = (instance) => {
|
|
2035
|
-
if (
|
|
2235
|
+
if (BUILD22.lazyLoad && BUILD22.disconnectedCallback) {
|
|
2036
2236
|
safeCall(instance, "disconnectedCallback");
|
|
2037
2237
|
}
|
|
2038
|
-
if (
|
|
2238
|
+
if (BUILD22.cmpDidUnload) {
|
|
2039
2239
|
safeCall(instance, "componentDidUnload");
|
|
2040
2240
|
}
|
|
2041
2241
|
};
|
|
2042
2242
|
var disconnectedCallback = async (elm) => {
|
|
2043
2243
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
2044
2244
|
const hostRef = getHostRef(elm);
|
|
2045
|
-
if (
|
|
2245
|
+
if (BUILD22.hostListener) {
|
|
2046
2246
|
if (hostRef.$rmListeners$) {
|
|
2047
2247
|
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
2048
2248
|
hostRef.$rmListeners$ = void 0;
|
|
2049
2249
|
}
|
|
2050
2250
|
}
|
|
2051
|
-
if (!
|
|
2251
|
+
if (!BUILD22.lazyLoad) {
|
|
2052
2252
|
disconnectInstance(elm);
|
|
2053
2253
|
} else if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
2054
2254
|
disconnectInstance(hostRef.$lazyInstance$);
|
|
@@ -2059,7 +2259,7 @@ var disconnectedCallback = async (elm) => {
|
|
|
2059
2259
|
};
|
|
2060
2260
|
|
|
2061
2261
|
// src/runtime/dom-extras.ts
|
|
2062
|
-
import { BUILD as
|
|
2262
|
+
import { BUILD as BUILD23 } from "@stencil/core/internal/app-data";
|
|
2063
2263
|
var patchPseudoShadowDom = (hostElementPrototype, descriptorPrototype) => {
|
|
2064
2264
|
patchCloneNode(hostElementPrototype);
|
|
2065
2265
|
patchSlotAppendChild(hostElementPrototype);
|
|
@@ -2076,9 +2276,9 @@ var patchCloneNode = (HostElementPrototype) => {
|
|
|
2076
2276
|
const orgCloneNode = HostElementPrototype.cloneNode;
|
|
2077
2277
|
HostElementPrototype.cloneNode = function(deep) {
|
|
2078
2278
|
const srcNode = this;
|
|
2079
|
-
const isShadowDom =
|
|
2279
|
+
const isShadowDom = BUILD23.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
|
|
2080
2280
|
const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);
|
|
2081
|
-
if (
|
|
2281
|
+
if (BUILD23.slot && !isShadowDom && deep) {
|
|
2082
2282
|
let i2 = 0;
|
|
2083
2283
|
let slotted, nonStencilNode;
|
|
2084
2284
|
const stencilPrivates = [
|
|
@@ -2102,7 +2302,7 @@ var patchCloneNode = (HostElementPrototype) => {
|
|
|
2102
2302
|
slotted = srcNode.childNodes[i2]["s-nr"];
|
|
2103
2303
|
nonStencilNode = stencilPrivates.every((privateField) => !srcNode.childNodes[i2][privateField]);
|
|
2104
2304
|
if (slotted) {
|
|
2105
|
-
if (
|
|
2305
|
+
if (BUILD23.appendChildSlotFix && clonedNode.__appendChild) {
|
|
2106
2306
|
clonedNode.__appendChild(slotted.cloneNode(true));
|
|
2107
2307
|
} else {
|
|
2108
2308
|
clonedNode.appendChild(slotted.cloneNode(true));
|
|
@@ -2228,7 +2428,7 @@ var patchSlotInsertAdjacentElement = (HostElementPrototype) => {
|
|
|
2228
2428
|
var patchTextContent = (hostElementPrototype) => {
|
|
2229
2429
|
const descriptor = Object.getOwnPropertyDescriptor(Node.prototype, "textContent");
|
|
2230
2430
|
Object.defineProperty(hostElementPrototype, "__textContent", descriptor);
|
|
2231
|
-
if (
|
|
2431
|
+
if (BUILD23.experimentalScopedSlotChanges) {
|
|
2232
2432
|
Object.defineProperty(hostElementPrototype, "textContent", {
|
|
2233
2433
|
// To mimic shadow root behavior, we need to return the text content of all
|
|
2234
2434
|
// nodes in a slot reference node
|
|
@@ -2380,36 +2580,36 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
2380
2580
|
$flags$: compactMeta[0],
|
|
2381
2581
|
$tagName$: compactMeta[1]
|
|
2382
2582
|
};
|
|
2383
|
-
if (
|
|
2583
|
+
if (BUILD24.member) {
|
|
2384
2584
|
cmpMeta.$members$ = compactMeta[2];
|
|
2385
2585
|
}
|
|
2386
|
-
if (
|
|
2586
|
+
if (BUILD24.hostListener) {
|
|
2387
2587
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
2388
2588
|
}
|
|
2389
|
-
if (
|
|
2589
|
+
if (BUILD24.watchCallback) {
|
|
2390
2590
|
cmpMeta.$watchers$ = Cstr.$watchers$;
|
|
2391
2591
|
}
|
|
2392
|
-
if (
|
|
2592
|
+
if (BUILD24.reflect) {
|
|
2393
2593
|
cmpMeta.$attrsToReflect$ = [];
|
|
2394
2594
|
}
|
|
2395
|
-
if (
|
|
2595
|
+
if (BUILD24.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2396
2596
|
cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
|
|
2397
2597
|
}
|
|
2398
|
-
if (
|
|
2399
|
-
if (
|
|
2598
|
+
if (BUILD24.experimentalSlotFixes) {
|
|
2599
|
+
if (BUILD24.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2400
2600
|
patchPseudoShadowDom(Cstr.prototype, cmpMeta);
|
|
2401
2601
|
}
|
|
2402
2602
|
} else {
|
|
2403
|
-
if (
|
|
2603
|
+
if (BUILD24.slotChildNodesFix) {
|
|
2404
2604
|
patchChildSlotNodes(Cstr.prototype, cmpMeta);
|
|
2405
2605
|
}
|
|
2406
|
-
if (
|
|
2606
|
+
if (BUILD24.cloneNodeFix) {
|
|
2407
2607
|
patchCloneNode(Cstr.prototype);
|
|
2408
2608
|
}
|
|
2409
|
-
if (
|
|
2609
|
+
if (BUILD24.appendChildSlotFix) {
|
|
2410
2610
|
patchSlotAppendChild(Cstr.prototype);
|
|
2411
2611
|
}
|
|
2412
|
-
if (
|
|
2612
|
+
if (BUILD24.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2413
2613
|
patchTextContent(Cstr.prototype);
|
|
2414
2614
|
}
|
|
2415
2615
|
}
|
|
@@ -2420,26 +2620,36 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
2420
2620
|
registerHost(this, cmpMeta);
|
|
2421
2621
|
},
|
|
2422
2622
|
connectedCallback() {
|
|
2623
|
+
const hostRef = getHostRef(this);
|
|
2624
|
+
addHostEventListeners(this, hostRef, cmpMeta.$listeners$, false);
|
|
2423
2625
|
connectedCallback(this);
|
|
2424
|
-
if (
|
|
2626
|
+
if (BUILD24.connectedCallback && originalConnectedCallback) {
|
|
2425
2627
|
originalConnectedCallback.call(this);
|
|
2426
2628
|
}
|
|
2427
2629
|
},
|
|
2428
2630
|
disconnectedCallback() {
|
|
2429
2631
|
disconnectedCallback(this);
|
|
2430
|
-
if (
|
|
2632
|
+
if (BUILD24.disconnectedCallback && originalDisconnectedCallback) {
|
|
2431
2633
|
originalDisconnectedCallback.call(this);
|
|
2432
2634
|
}
|
|
2433
2635
|
},
|
|
2434
2636
|
__attachShadow() {
|
|
2435
2637
|
if (supportsShadow) {
|
|
2436
|
-
if (
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2638
|
+
if (!this.shadowRoot) {
|
|
2639
|
+
if (BUILD24.shadowDelegatesFocus) {
|
|
2640
|
+
this.attachShadow({
|
|
2641
|
+
mode: "open",
|
|
2642
|
+
delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
|
|
2643
|
+
});
|
|
2644
|
+
} else {
|
|
2645
|
+
this.attachShadow({ mode: "open" });
|
|
2646
|
+
}
|
|
2441
2647
|
} else {
|
|
2442
|
-
this.
|
|
2648
|
+
if (this.shadowRoot.mode !== "open") {
|
|
2649
|
+
throw new Error(
|
|
2650
|
+
`Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`
|
|
2651
|
+
);
|
|
2652
|
+
}
|
|
2443
2653
|
}
|
|
2444
2654
|
} else {
|
|
2445
2655
|
this.shadowRoot = this;
|
|
@@ -2450,7 +2660,7 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
2450
2660
|
return proxyComponent(Cstr, cmpMeta, 1 /* isElementConstructor */ | 2 /* proxyState */);
|
|
2451
2661
|
};
|
|
2452
2662
|
var forceModeUpdate = (elm) => {
|
|
2453
|
-
if (
|
|
2663
|
+
if (BUILD24.style && BUILD24.mode && !BUILD24.lazyLoad) {
|
|
2454
2664
|
const mode = computeMode(elm);
|
|
2455
2665
|
const hostRef = getHostRef(elm);
|
|
2456
2666
|
if (hostRef.$modeName$ !== mode) {
|
|
@@ -2473,7 +2683,7 @@ var forceModeUpdate = (elm) => {
|
|
|
2473
2683
|
};
|
|
2474
2684
|
|
|
2475
2685
|
// src/runtime/bootstrap-lazy.ts
|
|
2476
|
-
import { BUILD as
|
|
2686
|
+
import { BUILD as BUILD25 } from "@stencil/core/internal/app-data";
|
|
2477
2687
|
|
|
2478
2688
|
// src/runtime/hmr-component.ts
|
|
2479
2689
|
var hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
|
|
@@ -2485,7 +2695,7 @@ var hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
|
|
|
2485
2695
|
// src/runtime/bootstrap-lazy.ts
|
|
2486
2696
|
var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
2487
2697
|
var _a;
|
|
2488
|
-
if (
|
|
2698
|
+
if (BUILD25.profile && performance.mark) {
|
|
2489
2699
|
performance.mark("st:app:start");
|
|
2490
2700
|
}
|
|
2491
2701
|
installDevTools();
|
|
@@ -2503,15 +2713,15 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2503
2713
|
let i2 = 0;
|
|
2504
2714
|
Object.assign(plt, options);
|
|
2505
2715
|
plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", doc.baseURI).href;
|
|
2506
|
-
if (
|
|
2716
|
+
if (BUILD25.asyncQueue) {
|
|
2507
2717
|
if (options.syncQueue) {
|
|
2508
2718
|
plt.$flags$ |= 4 /* queueSync */;
|
|
2509
2719
|
}
|
|
2510
2720
|
}
|
|
2511
|
-
if (
|
|
2721
|
+
if (BUILD25.hydrateClientSide) {
|
|
2512
2722
|
plt.$flags$ |= 2 /* appLoaded */;
|
|
2513
2723
|
}
|
|
2514
|
-
if (
|
|
2724
|
+
if (BUILD25.hydrateClientSide && BUILD25.shadowDom) {
|
|
2515
2725
|
for (; i2 < styles2.length; i2++) {
|
|
2516
2726
|
registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
|
|
2517
2727
|
}
|
|
@@ -2529,44 +2739,58 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2529
2739
|
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
2530
2740
|
hasSlotRelocation = true;
|
|
2531
2741
|
}
|
|
2532
|
-
if (
|
|
2742
|
+
if (BUILD25.member) {
|
|
2533
2743
|
cmpMeta.$members$ = compactMeta[2];
|
|
2534
2744
|
}
|
|
2535
|
-
if (
|
|
2745
|
+
if (BUILD25.hostListener) {
|
|
2536
2746
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
2537
2747
|
}
|
|
2538
|
-
if (
|
|
2748
|
+
if (BUILD25.reflect) {
|
|
2539
2749
|
cmpMeta.$attrsToReflect$ = [];
|
|
2540
2750
|
}
|
|
2541
|
-
if (
|
|
2751
|
+
if (BUILD25.watchCallback) {
|
|
2542
2752
|
cmpMeta.$watchers$ = (_a2 = compactMeta[4]) != null ? _a2 : {};
|
|
2543
2753
|
}
|
|
2544
|
-
if (
|
|
2754
|
+
if (BUILD25.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2545
2755
|
cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
|
|
2546
2756
|
}
|
|
2547
|
-
const tagName =
|
|
2757
|
+
const tagName = BUILD25.transformTagName && options.transformTagName ? options.transformTagName(cmpMeta.$tagName$) : cmpMeta.$tagName$;
|
|
2548
2758
|
const HostElement = class extends HTMLElement {
|
|
2549
2759
|
// StencilLazyHost
|
|
2550
2760
|
constructor(self) {
|
|
2551
2761
|
super(self);
|
|
2762
|
+
this.hasRegisteredEventListeners = false;
|
|
2552
2763
|
self = this;
|
|
2553
2764
|
registerHost(self, cmpMeta);
|
|
2554
|
-
if (
|
|
2765
|
+
if (BUILD25.shadowDom && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2555
2766
|
if (supportsShadow) {
|
|
2556
|
-
if (
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2767
|
+
if (!self.shadowRoot) {
|
|
2768
|
+
if (BUILD25.shadowDelegatesFocus) {
|
|
2769
|
+
self.attachShadow({
|
|
2770
|
+
mode: "open",
|
|
2771
|
+
delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
|
|
2772
|
+
});
|
|
2773
|
+
} else {
|
|
2774
|
+
self.attachShadow({ mode: "open" });
|
|
2775
|
+
}
|
|
2561
2776
|
} else {
|
|
2562
|
-
self.
|
|
2777
|
+
if (self.shadowRoot.mode !== "open") {
|
|
2778
|
+
throw new Error(
|
|
2779
|
+
`Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${self.shadowRoot.mode} but Stencil only supports open shadow roots.`
|
|
2780
|
+
);
|
|
2781
|
+
}
|
|
2563
2782
|
}
|
|
2564
|
-
} else if (!
|
|
2783
|
+
} else if (!BUILD25.hydrateServerSide && !("shadowRoot" in self)) {
|
|
2565
2784
|
self.shadowRoot = self;
|
|
2566
2785
|
}
|
|
2567
2786
|
}
|
|
2568
2787
|
}
|
|
2569
2788
|
connectedCallback() {
|
|
2789
|
+
const hostRef = getHostRef(this);
|
|
2790
|
+
if (!this.hasRegisteredEventListeners) {
|
|
2791
|
+
this.hasRegisteredEventListeners = true;
|
|
2792
|
+
addHostEventListeners(this, hostRef, cmpMeta.$listeners$, false);
|
|
2793
|
+
}
|
|
2570
2794
|
if (appLoadFallback) {
|
|
2571
2795
|
clearTimeout(appLoadFallback);
|
|
2572
2796
|
appLoadFallback = null;
|
|
@@ -2584,28 +2808,28 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2584
2808
|
return getHostRef(this).$onReadyPromise$;
|
|
2585
2809
|
}
|
|
2586
2810
|
};
|
|
2587
|
-
if (
|
|
2588
|
-
if (
|
|
2811
|
+
if (BUILD25.experimentalSlotFixes) {
|
|
2812
|
+
if (BUILD25.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2589
2813
|
patchPseudoShadowDom(HostElement.prototype, cmpMeta);
|
|
2590
2814
|
}
|
|
2591
2815
|
} else {
|
|
2592
|
-
if (
|
|
2816
|
+
if (BUILD25.slotChildNodesFix) {
|
|
2593
2817
|
patchChildSlotNodes(HostElement.prototype, cmpMeta);
|
|
2594
2818
|
}
|
|
2595
|
-
if (
|
|
2819
|
+
if (BUILD25.cloneNodeFix) {
|
|
2596
2820
|
patchCloneNode(HostElement.prototype);
|
|
2597
2821
|
}
|
|
2598
|
-
if (
|
|
2822
|
+
if (BUILD25.appendChildSlotFix) {
|
|
2599
2823
|
patchSlotAppendChild(HostElement.prototype);
|
|
2600
2824
|
}
|
|
2601
|
-
if (
|
|
2825
|
+
if (BUILD25.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2602
2826
|
patchTextContent(HostElement.prototype);
|
|
2603
2827
|
}
|
|
2604
2828
|
}
|
|
2605
|
-
if (
|
|
2829
|
+
if (BUILD25.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */) {
|
|
2606
2830
|
HostElement.formAssociated = true;
|
|
2607
2831
|
}
|
|
2608
|
-
if (
|
|
2832
|
+
if (BUILD25.hotModuleReplacement) {
|
|
2609
2833
|
HostElement.prototype["s-hmr"] = function(hmrVersionId) {
|
|
2610
2834
|
hmrStart(this, cmpMeta, hmrVersionId);
|
|
2611
2835
|
};
|
|
@@ -2624,7 +2848,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2624
2848
|
if (hasSlotRelocation) {
|
|
2625
2849
|
dataStyles.textContent += SLOT_FB_CSS;
|
|
2626
2850
|
}
|
|
2627
|
-
if (
|
|
2851
|
+
if (BUILD25.invisiblePrehydration && (BUILD25.hydratedClass || BUILD25.hydratedAttribute)) {
|
|
2628
2852
|
dataStyles.textContent += cmpTags + HYDRATED_CSS;
|
|
2629
2853
|
}
|
|
2630
2854
|
if (dataStyles.innerHTML.length) {
|
|
@@ -2640,7 +2864,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2640
2864
|
if (deferredConnectedCallbacks.length) {
|
|
2641
2865
|
deferredConnectedCallbacks.map((host) => host.connectedCallback());
|
|
2642
2866
|
} else {
|
|
2643
|
-
if (
|
|
2867
|
+
if (BUILD25.profile) {
|
|
2644
2868
|
plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30, "timeout"));
|
|
2645
2869
|
} else {
|
|
2646
2870
|
plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30));
|
|
@@ -2653,10 +2877,10 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2653
2877
|
var Fragment = (_, children) => children;
|
|
2654
2878
|
|
|
2655
2879
|
// src/runtime/host-listener.ts
|
|
2656
|
-
import { BUILD as
|
|
2880
|
+
import { BUILD as BUILD26 } from "@stencil/core/internal/app-data";
|
|
2657
2881
|
var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
2658
|
-
if (
|
|
2659
|
-
if (
|
|
2882
|
+
if (BUILD26.hostListener && listeners) {
|
|
2883
|
+
if (BUILD26.hostListenerTargetParent) {
|
|
2660
2884
|
if (attachParentListeners) {
|
|
2661
2885
|
listeners = listeners.filter(([flags]) => flags & 32 /* TargetParent */);
|
|
2662
2886
|
} else {
|
|
@@ -2664,7 +2888,7 @@ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =>
|
|
|
2664
2888
|
}
|
|
2665
2889
|
}
|
|
2666
2890
|
listeners.map(([flags, name, method]) => {
|
|
2667
|
-
const target =
|
|
2891
|
+
const target = BUILD26.hostListenerTarget ? getHostListenerTarget(elm, flags) : elm;
|
|
2668
2892
|
const handler = hostListenerProxy(hostRef, method);
|
|
2669
2893
|
const opts = hostListenerOpts(flags);
|
|
2670
2894
|
plt.ael(target, name, handler, opts);
|
|
@@ -2675,7 +2899,7 @@ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =>
|
|
|
2675
2899
|
var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
2676
2900
|
var _a;
|
|
2677
2901
|
try {
|
|
2678
|
-
if (
|
|
2902
|
+
if (BUILD26.lazyLoad) {
|
|
2679
2903
|
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
2680
2904
|
(_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev);
|
|
2681
2905
|
} else {
|
|
@@ -2689,10 +2913,10 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
2689
2913
|
}
|
|
2690
2914
|
};
|
|
2691
2915
|
var getHostListenerTarget = (elm, flags) => {
|
|
2692
|
-
if (
|
|
2693
|
-
if (
|
|
2694
|
-
if (
|
|
2695
|
-
if (
|
|
2916
|
+
if (BUILD26.hostListenerTargetDocument && flags & 4 /* TargetDocument */) return doc;
|
|
2917
|
+
if (BUILD26.hostListenerTargetWindow && flags & 8 /* TargetWindow */) return win;
|
|
2918
|
+
if (BUILD26.hostListenerTargetBody && flags & 16 /* TargetBody */) return doc.body;
|
|
2919
|
+
if (BUILD26.hostListenerTargetParent && flags & 32 /* TargetParent */ && elm.parentElement)
|
|
2696
2920
|
return elm.parentElement;
|
|
2697
2921
|
return elm;
|
|
2698
2922
|
};
|
|
@@ -2842,212 +3066,6 @@ var insertChildVNodeAnnotations = (doc2, vnodeChild, cmpData, hostId, depth, ind
|
|
|
2842
3066
|
});
|
|
2843
3067
|
}
|
|
2844
3068
|
};
|
|
2845
|
-
|
|
2846
|
-
// src/client/client-host-ref.ts
|
|
2847
|
-
var hostRefs = BUILD22.hotModuleReplacement ? window.__STENCIL_HOSTREFS__ || (window.__STENCIL_HOSTREFS__ = /* @__PURE__ */ new WeakMap()) : /* @__PURE__ */ new WeakMap();
|
|
2848
|
-
var getHostRef = (ref) => hostRefs.get(ref);
|
|
2849
|
-
var registerInstance = (lazyInstance, hostRef) => hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
|
|
2850
|
-
var registerHost = (hostElement, cmpMeta) => {
|
|
2851
|
-
const hostRef = {
|
|
2852
|
-
$flags$: 0,
|
|
2853
|
-
$hostElement$: hostElement,
|
|
2854
|
-
$cmpMeta$: cmpMeta,
|
|
2855
|
-
$instanceValues$: /* @__PURE__ */ new Map()
|
|
2856
|
-
};
|
|
2857
|
-
if (BUILD22.isDev) {
|
|
2858
|
-
hostRef.$renderCount$ = 0;
|
|
2859
|
-
}
|
|
2860
|
-
if (BUILD22.method && BUILD22.lazyLoad) {
|
|
2861
|
-
hostRef.$onInstancePromise$ = new Promise((r) => hostRef.$onInstanceResolve$ = r);
|
|
2862
|
-
}
|
|
2863
|
-
if (BUILD22.asyncLoading) {
|
|
2864
|
-
hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r);
|
|
2865
|
-
hostElement["s-p"] = [];
|
|
2866
|
-
hostElement["s-rc"] = [];
|
|
2867
|
-
}
|
|
2868
|
-
addHostEventListeners(hostElement, hostRef, cmpMeta.$listeners$, false);
|
|
2869
|
-
return hostRefs.set(hostElement, hostRef);
|
|
2870
|
-
};
|
|
2871
|
-
var isMemberInElement = (elm, memberName) => memberName in elm;
|
|
2872
|
-
|
|
2873
|
-
// src/client/client-load-module.ts
|
|
2874
|
-
import { BUILD as BUILD24 } from "@stencil/core/internal/app-data";
|
|
2875
|
-
|
|
2876
|
-
// src/client/client-log.ts
|
|
2877
|
-
import { BUILD as BUILD23 } from "@stencil/core/internal/app-data";
|
|
2878
|
-
var customError;
|
|
2879
|
-
var consoleError = (e, el) => (customError || console.error)(e, el);
|
|
2880
|
-
var STENCIL_DEV_MODE = BUILD23.isTesting ? ["STENCIL:"] : [
|
|
2881
|
-
"%cstencil",
|
|
2882
|
-
"color: white;background:#4c47ff;font-weight: bold; font-size:10px; padding:2px 6px; border-radius: 5px"
|
|
2883
|
-
];
|
|
2884
|
-
var consoleDevError = (...m) => console.error(...STENCIL_DEV_MODE, ...m);
|
|
2885
|
-
var consoleDevWarn = (...m) => console.warn(...STENCIL_DEV_MODE, ...m);
|
|
2886
|
-
var consoleDevInfo = (...m) => console.info(...STENCIL_DEV_MODE, ...m);
|
|
2887
|
-
var setErrorHandler = (handler) => customError = handler;
|
|
2888
|
-
|
|
2889
|
-
// src/client/client-load-module.ts
|
|
2890
|
-
var cmpModules = /* @__PURE__ */ new Map();
|
|
2891
|
-
var MODULE_IMPORT_PREFIX = "./";
|
|
2892
|
-
var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
2893
|
-
const exportName = cmpMeta.$tagName$.replace(/-/g, "_");
|
|
2894
|
-
const bundleId = cmpMeta.$lazyBundleId$;
|
|
2895
|
-
if (BUILD24.isDev && typeof bundleId !== "string") {
|
|
2896
|
-
consoleDevError(
|
|
2897
|
-
`Trying to lazily load component <${cmpMeta.$tagName$}> with style mode "${hostRef.$modeName$}", but it does not exist.`
|
|
2898
|
-
);
|
|
2899
|
-
return void 0;
|
|
2900
|
-
} else if (!bundleId) {
|
|
2901
|
-
return void 0;
|
|
2902
|
-
}
|
|
2903
|
-
const module = !BUILD24.hotModuleReplacement ? cmpModules.get(bundleId) : false;
|
|
2904
|
-
if (module) {
|
|
2905
|
-
return module[exportName];
|
|
2906
|
-
}
|
|
2907
|
-
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/
|
|
2908
|
-
return import(
|
|
2909
|
-
/* @vite-ignore */
|
|
2910
|
-
/* webpackInclude: /\.entry\.js$/ */
|
|
2911
|
-
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
2912
|
-
/* webpackMode: "lazy" */
|
|
2913
|
-
`./${bundleId}.entry.js${BUILD24.hotModuleReplacement && hmrVersionId ? "?s-hmr=" + hmrVersionId : ""}`
|
|
2914
|
-
).then((importedModule) => {
|
|
2915
|
-
if (!BUILD24.hotModuleReplacement) {
|
|
2916
|
-
cmpModules.set(bundleId, importedModule);
|
|
2917
|
-
}
|
|
2918
|
-
return importedModule[exportName];
|
|
2919
|
-
}, consoleError);
|
|
2920
|
-
};
|
|
2921
|
-
|
|
2922
|
-
// src/client/client-style.ts
|
|
2923
|
-
var styles = /* @__PURE__ */ new Map();
|
|
2924
|
-
var modeResolutionChain = [];
|
|
2925
|
-
|
|
2926
|
-
// src/client/client-task-queue.ts
|
|
2927
|
-
import { BUILD as BUILD26 } from "@stencil/core/internal/app-data";
|
|
2928
|
-
|
|
2929
|
-
// src/client/client-window.ts
|
|
2930
|
-
import { BUILD as BUILD25 } from "@stencil/core/internal/app-data";
|
|
2931
|
-
var win = typeof window !== "undefined" ? window : {};
|
|
2932
|
-
var doc = win.document || { head: {} };
|
|
2933
|
-
var H = win.HTMLElement || class {
|
|
2934
|
-
};
|
|
2935
|
-
var plt = {
|
|
2936
|
-
$flags$: 0,
|
|
2937
|
-
$resourcesUrl$: "",
|
|
2938
|
-
jmp: (h2) => h2(),
|
|
2939
|
-
raf: (h2) => requestAnimationFrame(h2),
|
|
2940
|
-
ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
|
|
2941
|
-
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
2942
|
-
ce: (eventName, opts) => new CustomEvent(eventName, opts)
|
|
2943
|
-
};
|
|
2944
|
-
var setPlatformHelpers = (helpers) => {
|
|
2945
|
-
Object.assign(plt, helpers);
|
|
2946
|
-
};
|
|
2947
|
-
var supportsShadow = (
|
|
2948
|
-
// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
2949
|
-
BUILD25.shadowDomShim && BUILD25.shadowDom ? /* @__PURE__ */ (() => (doc.head.attachShadow + "").indexOf("[native") > -1)() : true
|
|
2950
|
-
);
|
|
2951
|
-
var supportsListenerOptions = /* @__PURE__ */ (() => {
|
|
2952
|
-
let supportsListenerOptions2 = false;
|
|
2953
|
-
try {
|
|
2954
|
-
doc.addEventListener(
|
|
2955
|
-
"e",
|
|
2956
|
-
null,
|
|
2957
|
-
Object.defineProperty({}, "passive", {
|
|
2958
|
-
get() {
|
|
2959
|
-
supportsListenerOptions2 = true;
|
|
2960
|
-
}
|
|
2961
|
-
})
|
|
2962
|
-
);
|
|
2963
|
-
} catch (e) {
|
|
2964
|
-
}
|
|
2965
|
-
return supportsListenerOptions2;
|
|
2966
|
-
})();
|
|
2967
|
-
var promiseResolve = (v) => Promise.resolve(v);
|
|
2968
|
-
var supportsConstructableStylesheets = BUILD25.constructableCSS ? /* @__PURE__ */ (() => {
|
|
2969
|
-
try {
|
|
2970
|
-
new CSSStyleSheet();
|
|
2971
|
-
return typeof new CSSStyleSheet().replaceSync === "function";
|
|
2972
|
-
} catch (e) {
|
|
2973
|
-
}
|
|
2974
|
-
return false;
|
|
2975
|
-
})() : false;
|
|
2976
|
-
|
|
2977
|
-
// src/client/client-task-queue.ts
|
|
2978
|
-
var queueCongestion = 0;
|
|
2979
|
-
var queuePending = false;
|
|
2980
|
-
var queueDomReads = [];
|
|
2981
|
-
var queueDomWrites = [];
|
|
2982
|
-
var queueDomWritesLow = [];
|
|
2983
|
-
var queueTask = (queue, write) => (cb) => {
|
|
2984
|
-
queue.push(cb);
|
|
2985
|
-
if (!queuePending) {
|
|
2986
|
-
queuePending = true;
|
|
2987
|
-
if (write && plt.$flags$ & 4 /* queueSync */) {
|
|
2988
|
-
nextTick(flush);
|
|
2989
|
-
} else {
|
|
2990
|
-
plt.raf(flush);
|
|
2991
|
-
}
|
|
2992
|
-
}
|
|
2993
|
-
};
|
|
2994
|
-
var consume = (queue) => {
|
|
2995
|
-
for (let i2 = 0; i2 < queue.length; i2++) {
|
|
2996
|
-
try {
|
|
2997
|
-
queue[i2](performance.now());
|
|
2998
|
-
} catch (e) {
|
|
2999
|
-
consoleError(e);
|
|
3000
|
-
}
|
|
3001
|
-
}
|
|
3002
|
-
queue.length = 0;
|
|
3003
|
-
};
|
|
3004
|
-
var consumeTimeout = (queue, timeout) => {
|
|
3005
|
-
let i2 = 0;
|
|
3006
|
-
let ts = 0;
|
|
3007
|
-
while (i2 < queue.length && (ts = performance.now()) < timeout) {
|
|
3008
|
-
try {
|
|
3009
|
-
queue[i2++](ts);
|
|
3010
|
-
} catch (e) {
|
|
3011
|
-
consoleError(e);
|
|
3012
|
-
}
|
|
3013
|
-
}
|
|
3014
|
-
if (i2 === queue.length) {
|
|
3015
|
-
queue.length = 0;
|
|
3016
|
-
} else if (i2 !== 0) {
|
|
3017
|
-
queue.splice(0, i2);
|
|
3018
|
-
}
|
|
3019
|
-
};
|
|
3020
|
-
var flush = () => {
|
|
3021
|
-
if (BUILD26.asyncQueue) {
|
|
3022
|
-
queueCongestion++;
|
|
3023
|
-
}
|
|
3024
|
-
consume(queueDomReads);
|
|
3025
|
-
if (BUILD26.asyncQueue) {
|
|
3026
|
-
const timeout = (plt.$flags$ & 6 /* queueMask */) === 2 /* appLoaded */ ? performance.now() + 14 * Math.ceil(queueCongestion * (1 / 10)) : Infinity;
|
|
3027
|
-
consumeTimeout(queueDomWrites, timeout);
|
|
3028
|
-
consumeTimeout(queueDomWritesLow, timeout);
|
|
3029
|
-
if (queueDomWrites.length > 0) {
|
|
3030
|
-
queueDomWritesLow.push(...queueDomWrites);
|
|
3031
|
-
queueDomWrites.length = 0;
|
|
3032
|
-
}
|
|
3033
|
-
if (queuePending = queueDomReads.length + queueDomWrites.length + queueDomWritesLow.length > 0) {
|
|
3034
|
-
plt.raf(flush);
|
|
3035
|
-
} else {
|
|
3036
|
-
queueCongestion = 0;
|
|
3037
|
-
}
|
|
3038
|
-
} else {
|
|
3039
|
-
consume(queueDomWrites);
|
|
3040
|
-
if (queuePending = queueDomReads.length > 0) {
|
|
3041
|
-
plt.raf(flush);
|
|
3042
|
-
}
|
|
3043
|
-
}
|
|
3044
|
-
};
|
|
3045
|
-
var nextTick = (cb) => promiseResolve().then(cb);
|
|
3046
|
-
var readTask = /* @__PURE__ */ queueTask(queueDomReads, false);
|
|
3047
|
-
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
|
|
3048
|
-
|
|
3049
|
-
// src/client/index.ts
|
|
3050
|
-
import { BUILD as BUILD27, Env, NAMESPACE as NAMESPACE2 } from "@stencil/core/internal/app-data";
|
|
3051
3069
|
export {
|
|
3052
3070
|
BUILD27 as BUILD,
|
|
3053
3071
|
Build,
|