lwc 2.18.0 → 2.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/engine-dom/esm/es2017/engine-dom.js +140 -140
- package/dist/engine-dom/iife/es2017/engine-dom.js +140 -140
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +119 -119
- package/dist/engine-dom/iife/es5/engine-dom.js +152 -153
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +130 -132
- package/dist/engine-dom/umd/es2017/engine-dom.js +140 -140
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +119 -119
- package/dist/engine-dom/umd/es5/engine-dom.js +152 -153
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +130 -132
- package/dist/engine-server/commonjs/es2017/engine-server.js +148 -160
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +148 -160
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +20 -20
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +20 -20
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +20 -20
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +20 -20
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +20 -20
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +20 -20
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +20 -20
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +20 -20
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +20 -20
- package/dist/wire-service/esm/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/iife/es5/wire-service.js +4 -4
- package/dist/wire-service/iife/es5/wire-service.min.js +1 -1
- package/dist/wire-service/iife/es5/wire-service_debug.js +4 -4
- package/dist/wire-service/umd/es2017/wire-service.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es5/wire-service.js +4 -4
- package/dist/wire-service/umd/es5/wire-service.min.js +1 -1
- package/dist/wire-service/umd/es5/wire-service_debug.js +4 -4
- package/package.json +7 -7
|
@@ -233,62 +233,44 @@ const KEY__SHADOW_STATIC = '$shadowStaticNode$';
|
|
|
233
233
|
const KEY__SYNTHETIC_MODE = '$$lwc-synthetic-mode';
|
|
234
234
|
const KEY__SCOPED_CSS = '$scoped$';
|
|
235
235
|
|
|
236
|
+
/*
|
|
237
|
+
* Copyright (c) 2022, salesforce.com, inc.
|
|
238
|
+
* All rights reserved.
|
|
239
|
+
* SPDX-License-Identifier: MIT
|
|
240
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
241
|
+
*/
|
|
242
|
+
const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
|
|
243
|
+
const XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';
|
|
244
|
+
const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
|
|
245
|
+
const XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
|
|
246
|
+
|
|
236
247
|
/*
|
|
237
248
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
238
249
|
* All rights reserved.
|
|
239
250
|
* SPDX-License-Identifier: MIT
|
|
240
251
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
241
252
|
*/
|
|
242
|
-
//
|
|
243
|
-
//
|
|
244
|
-
|
|
253
|
+
// Void elements are elements that self-close even without an explicit solidus (slash),
|
|
254
|
+
// e.g. `</tagName>` or `<tagName />`. For instance, `<meta>` closes on its own; no need for a slash.
|
|
255
|
+
// These only come from HTML; there are no void elements in the SVG or MathML namespaces.
|
|
256
|
+
// See: https://html.spec.whatwg.org/multipage/syntax.html#syntax-tags
|
|
257
|
+
const VOID_ELEMENTS_SET = new Set([
|
|
245
258
|
'area',
|
|
246
259
|
'base',
|
|
247
260
|
'br',
|
|
248
|
-
'circle',
|
|
249
261
|
'col',
|
|
250
|
-
'ellipse',
|
|
251
|
-
'feBlend',
|
|
252
|
-
'feColorMatrix',
|
|
253
|
-
'feFuncR',
|
|
254
|
-
'feFuncG',
|
|
255
|
-
'feFuncB',
|
|
256
|
-
'feFuncA',
|
|
257
|
-
'feImage',
|
|
258
|
-
'feComposite',
|
|
259
|
-
'feConvolveMatrix',
|
|
260
|
-
'feDiffuseLighting',
|
|
261
|
-
'feDisplacementMap',
|
|
262
|
-
'feDropShadow',
|
|
263
|
-
'feFlood',
|
|
264
|
-
'feGaussianBlur',
|
|
265
|
-
'feMerge',
|
|
266
|
-
'feMergeNode',
|
|
267
|
-
'feMorphology',
|
|
268
|
-
'feOffset',
|
|
269
|
-
'feSpecularLighting',
|
|
270
|
-
'feTile',
|
|
271
|
-
'feTurbulence',
|
|
272
|
-
'fePointLight',
|
|
273
262
|
'embed',
|
|
274
263
|
'hr',
|
|
275
264
|
'img',
|
|
276
265
|
'input',
|
|
277
|
-
'keygen',
|
|
278
|
-
'line',
|
|
279
266
|
'link',
|
|
280
|
-
'menuitem',
|
|
281
267
|
'meta',
|
|
282
|
-
'param',
|
|
283
|
-
'path',
|
|
284
|
-
'rect',
|
|
285
268
|
'source',
|
|
286
269
|
'track',
|
|
287
270
|
'wbr',
|
|
288
|
-
];
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
return VOID_ELEMENTS_SET.has(name);
|
|
271
|
+
]);
|
|
272
|
+
function isVoidElement(name, namespace) {
|
|
273
|
+
return namespace === HTML_NAMESPACE && VOID_ELEMENTS_SET.has(name.toLowerCase());
|
|
292
274
|
}
|
|
293
275
|
|
|
294
276
|
/*
|
|
@@ -429,9 +411,6 @@ function htmlEscape(str, attrMode = false) {
|
|
|
429
411
|
const searchValue = attrMode ? /["&]/g : /["'<>&]/g;
|
|
430
412
|
return str.replace(searchValue, (char) => ESCAPED_CHARS[char]);
|
|
431
413
|
}
|
|
432
|
-
const XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';
|
|
433
|
-
const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
|
|
434
|
-
const XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
|
|
435
414
|
|
|
436
415
|
/*
|
|
437
416
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -440,9 +419,9 @@ const XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
|
|
|
440
419
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
441
420
|
*/
|
|
442
421
|
// Increment whenever the LWC template compiler changes
|
|
443
|
-
const LWC_VERSION = "2.
|
|
422
|
+
const LWC_VERSION = "2.20.0";
|
|
444
423
|
const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
445
|
-
/** version: 2.
|
|
424
|
+
/** version: 2.20.0 */
|
|
446
425
|
|
|
447
426
|
/*
|
|
448
427
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
@@ -551,7 +530,7 @@ function setFeatureFlagForTest(name, value) {
|
|
|
551
530
|
setFeatureFlag(name, value);
|
|
552
531
|
}
|
|
553
532
|
}
|
|
554
|
-
/** version: 2.
|
|
533
|
+
/** version: 2.20.0 */
|
|
555
534
|
|
|
556
535
|
/* proxy-compat-disable */
|
|
557
536
|
|
|
@@ -1956,7 +1935,7 @@ const LightningElement = function () {
|
|
|
1956
1935
|
// Linking elm, shadow root and component with the VM.
|
|
1957
1936
|
associateVM(component, vm);
|
|
1958
1937
|
associateVM(elm, vm);
|
|
1959
|
-
if (vm.renderMode === 1 /* Shadow */) {
|
|
1938
|
+
if (vm.renderMode === 1 /* RenderMode.Shadow */) {
|
|
1960
1939
|
vm.renderRoot = doAttachShadow(vm);
|
|
1961
1940
|
}
|
|
1962
1941
|
else {
|
|
@@ -1972,7 +1951,7 @@ const LightningElement = function () {
|
|
|
1972
1951
|
function doAttachShadow(vm) {
|
|
1973
1952
|
const { elm, mode, shadowMode, def: { ctor }, renderer: { attachShadow }, } = vm;
|
|
1974
1953
|
const shadowRoot = attachShadow(elm, {
|
|
1975
|
-
[KEY__SYNTHETIC_MODE]: shadowMode === 1 /* Synthetic */,
|
|
1954
|
+
[KEY__SYNTHETIC_MODE]: shadowMode === 1 /* ShadowMode.Synthetic */,
|
|
1976
1955
|
delegatesFocus: Boolean(ctor.delegatesFocus),
|
|
1977
1956
|
mode,
|
|
1978
1957
|
});
|
|
@@ -2095,7 +2074,7 @@ LightningElement.prototype = {
|
|
|
2095
2074
|
get template() {
|
|
2096
2075
|
const vm = getAssociatedVM(this);
|
|
2097
2076
|
if (process.env.NODE_ENV !== 'production') {
|
|
2098
|
-
if (vm.renderMode === 0 /* Light */) {
|
|
2077
|
+
if (vm.renderMode === 0 /* RenderMode.Light */) {
|
|
2099
2078
|
logError('`this.template` returns null for light DOM components. Since there is no shadow, the rendered content can be accessed via `this` itself. e.g. instead of `this.template.querySelector`, use `this.querySelector`.');
|
|
2100
2079
|
}
|
|
2101
2080
|
}
|
|
@@ -2467,13 +2446,13 @@ function internalWireFieldDecorator(key) {
|
|
|
2467
2446
|
*/
|
|
2468
2447
|
function getClassDescriptorType(descriptor) {
|
|
2469
2448
|
if (isFunction$1(descriptor.value)) {
|
|
2470
|
-
return "method" /* Method */;
|
|
2449
|
+
return "method" /* DescriptorType.Method */;
|
|
2471
2450
|
}
|
|
2472
2451
|
else if (isFunction$1(descriptor.set) || isFunction$1(descriptor.get)) {
|
|
2473
|
-
return "accessor" /* Accessor */;
|
|
2452
|
+
return "accessor" /* DescriptorType.Accessor */;
|
|
2474
2453
|
}
|
|
2475
2454
|
else {
|
|
2476
|
-
return "field" /* Field */;
|
|
2455
|
+
return "field" /* DescriptorType.Field */;
|
|
2477
2456
|
}
|
|
2478
2457
|
}
|
|
2479
2458
|
function validateObservedField(Ctor, fieldName, descriptor) {
|
|
@@ -2482,7 +2461,7 @@ function validateObservedField(Ctor, fieldName, descriptor) {
|
|
|
2482
2461
|
const message = `Invalid observed ${fieldName} field. Found a duplicate ${type} with the same name.`;
|
|
2483
2462
|
// [W-9927596] Ideally we always throw an error when detecting duplicate observed field.
|
|
2484
2463
|
// This branch is only here for backward compatibility reasons.
|
|
2485
|
-
if (type === "accessor" /* Accessor */) {
|
|
2464
|
+
if (type === "accessor" /* DescriptorType.Accessor */) {
|
|
2486
2465
|
logError(message);
|
|
2487
2466
|
}
|
|
2488
2467
|
else {
|
|
@@ -2513,7 +2492,7 @@ function validateFieldDecoratedWithApi(Ctor, fieldName, descriptor) {
|
|
|
2513
2492
|
const message = `Invalid @api ${fieldName} field. Found a duplicate ${type} with the same name.`;
|
|
2514
2493
|
// [W-9927596] Ideally we always throw an error when detecting duplicate public properties.
|
|
2515
2494
|
// This branch is only here for backward compatibility reasons.
|
|
2516
|
-
if (type === "accessor" /* Accessor */) {
|
|
2495
|
+
if (type === "accessor" /* DescriptorType.Accessor */) {
|
|
2517
2496
|
logError(message);
|
|
2518
2497
|
}
|
|
2519
2498
|
else {
|
|
@@ -3118,8 +3097,8 @@ function createComponentDef(Ctor) {
|
|
|
3118
3097
|
// assert.isTrue(ctorName && isString(ctorName), `${toString(Ctor)} should have a "name" property with string value, but found ${ctorName}.`);
|
|
3119
3098
|
assert.isTrue(Ctor.constructor, `Missing ${ctorName}.constructor, ${ctorName} should have a "constructor" property.`);
|
|
3120
3099
|
if (!isUndefined$1(ctorShadowSupportMode)) {
|
|
3121
|
-
assert.invariant(ctorShadowSupportMode === "any" /* Any */ ||
|
|
3122
|
-
ctorShadowSupportMode === "reset" /* Default */, `Invalid value for static property shadowSupportMode: '${ctorShadowSupportMode}'`);
|
|
3100
|
+
assert.invariant(ctorShadowSupportMode === "any" /* ShadowSupportMode.Any */ ||
|
|
3101
|
+
ctorShadowSupportMode === "reset" /* ShadowSupportMode.Default */, `Invalid value for static property shadowSupportMode: '${ctorShadowSupportMode}'`);
|
|
3123
3102
|
}
|
|
3124
3103
|
if (!isUndefined$1(ctorRenderMode)) {
|
|
3125
3104
|
assert.invariant(ctorRenderMode === 'light' || ctorRenderMode === 'shadow', `Invalid value for static property renderMode: '${ctorRenderMode}'. renderMode must be either 'light' or 'shadow'.`);
|
|
@@ -3147,7 +3126,7 @@ function createComponentDef(Ctor) {
|
|
|
3147
3126
|
}
|
|
3148
3127
|
let renderMode = superDef.renderMode;
|
|
3149
3128
|
if (!isUndefined$1(ctorRenderMode)) {
|
|
3150
|
-
renderMode = ctorRenderMode === 'light' ? 0 /* Light */ : 1 /* Shadow */;
|
|
3129
|
+
renderMode = ctorRenderMode === 'light' ? 0 /* RenderMode.Light */ : 1 /* RenderMode.Shadow */;
|
|
3151
3130
|
}
|
|
3152
3131
|
const template = getComponentRegisteredTemplate(Ctor) || superDef.template;
|
|
3153
3132
|
const name = Ctor.name || superDef.name;
|
|
@@ -3236,8 +3215,8 @@ const lightingElementDef = {
|
|
|
3236
3215
|
props: lightningBasedDescriptors,
|
|
3237
3216
|
propsConfig: EmptyObject,
|
|
3238
3217
|
methods: EmptyObject,
|
|
3239
|
-
renderMode: 1 /* Shadow */,
|
|
3240
|
-
shadowSupportMode: "reset" /* Default */,
|
|
3218
|
+
renderMode: 1 /* RenderMode.Shadow */,
|
|
3219
|
+
shadowSupportMode: "reset" /* ShadowSupportMode.Default */,
|
|
3241
3220
|
wire: EmptyObject,
|
|
3242
3221
|
bridge: BaseBridgeElement,
|
|
3243
3222
|
template: defaultEmptyTemplate,
|
|
@@ -3259,7 +3238,7 @@ function getComponentDef(Ctor) {
|
|
|
3259
3238
|
// avoid leaking the reference to the public props descriptors
|
|
3260
3239
|
publicProps[key] = {
|
|
3261
3240
|
config: propsConfig[key] || 0,
|
|
3262
|
-
type: "any" /* any */,
|
|
3241
|
+
type: "any" /* PropDefType.any */,
|
|
3263
3242
|
attr: htmlPropertyToAttribute(key),
|
|
3264
3243
|
};
|
|
3265
3244
|
}
|
|
@@ -3316,7 +3295,7 @@ function getUpgradableConstructor(tagName, renderer) {
|
|
|
3316
3295
|
*/
|
|
3317
3296
|
function isVBaseElement(vnode) {
|
|
3318
3297
|
const { type } = vnode;
|
|
3319
|
-
return type === 2 /* Element */ || type === 3 /* CustomElement */;
|
|
3298
|
+
return type === 2 /* VNodeType.Element */ || type === 3 /* VNodeType.CustomElement */;
|
|
3320
3299
|
}
|
|
3321
3300
|
function isSameVnode(vnode1, vnode2) {
|
|
3322
3301
|
return vnode1.key === vnode2.key && vnode1.sel === vnode2.sel;
|
|
@@ -3572,21 +3551,21 @@ function patch(n1, n2, renderer) {
|
|
|
3572
3551
|
}
|
|
3573
3552
|
}
|
|
3574
3553
|
switch (n2.type) {
|
|
3575
|
-
case 0 /* Text */:
|
|
3554
|
+
case 0 /* VNodeType.Text */:
|
|
3576
3555
|
// VText has no special capability, fallback to the owner's renderer
|
|
3577
3556
|
patchText(n1, n2, renderer);
|
|
3578
3557
|
break;
|
|
3579
|
-
case 1 /* Comment */:
|
|
3558
|
+
case 1 /* VNodeType.Comment */:
|
|
3580
3559
|
// VComment has no special capability, fallback to the owner's renderer
|
|
3581
3560
|
patchComment(n1, n2, renderer);
|
|
3582
3561
|
break;
|
|
3583
|
-
case 4 /* Static */:
|
|
3562
|
+
case 4 /* VNodeType.Static */:
|
|
3584
3563
|
n2.elm = n1.elm;
|
|
3585
3564
|
break;
|
|
3586
|
-
case 2 /* Element */:
|
|
3565
|
+
case 2 /* VNodeType.Element */:
|
|
3587
3566
|
patchElement(n1, n2, (_a = n2.data.renderer) !== null && _a !== void 0 ? _a : renderer);
|
|
3588
3567
|
break;
|
|
3589
|
-
case 3 /* CustomElement */:
|
|
3568
|
+
case 3 /* VNodeType.CustomElement */:
|
|
3590
3569
|
patchCustomElement(n1, n2, (_b = n2.data.renderer) !== null && _b !== void 0 ? _b : renderer);
|
|
3591
3570
|
break;
|
|
3592
3571
|
}
|
|
@@ -3594,23 +3573,23 @@ function patch(n1, n2, renderer) {
|
|
|
3594
3573
|
function mount(node, parent, renderer, anchor) {
|
|
3595
3574
|
var _a, _b;
|
|
3596
3575
|
switch (node.type) {
|
|
3597
|
-
case 0 /* Text */:
|
|
3576
|
+
case 0 /* VNodeType.Text */:
|
|
3598
3577
|
// VText has no special capability, fallback to the owner's renderer
|
|
3599
3578
|
mountText(node, parent, anchor, renderer);
|
|
3600
3579
|
break;
|
|
3601
|
-
case 1 /* Comment */:
|
|
3580
|
+
case 1 /* VNodeType.Comment */:
|
|
3602
3581
|
// VComment has no special capability, fallback to the owner's renderer
|
|
3603
3582
|
mountComment(node, parent, anchor, renderer);
|
|
3604
3583
|
break;
|
|
3605
|
-
case 4 /* Static */:
|
|
3584
|
+
case 4 /* VNodeType.Static */:
|
|
3606
3585
|
// VStatic cannot have a custom renderer associated to them, using owner's renderer
|
|
3607
3586
|
mountStatic(node, parent, anchor, renderer);
|
|
3608
3587
|
break;
|
|
3609
|
-
case 2 /* Element */:
|
|
3588
|
+
case 2 /* VNodeType.Element */:
|
|
3610
3589
|
// If the vnode data has a renderer override use it, else fallback to owner's renderer
|
|
3611
3590
|
mountElement(node, parent, anchor, (_a = node.data.renderer) !== null && _a !== void 0 ? _a : renderer);
|
|
3612
3591
|
break;
|
|
3613
|
-
case 3 /* CustomElement */:
|
|
3592
|
+
case 3 /* VNodeType.CustomElement */:
|
|
3614
3593
|
// If the vnode data has a renderer override use it, else fallback to owner's renderer
|
|
3615
3594
|
mountCustomElement(node, parent, anchor, (_b = node.data.renderer) !== null && _b !== void 0 ? _b : renderer);
|
|
3616
3595
|
break;
|
|
@@ -3669,12 +3648,12 @@ function mountStatic(vnode, parent, anchor, renderer) {
|
|
|
3669
3648
|
// Marks this node as Static to propagate the shadow resolver. must happen after elm is assigned to the proper shadow
|
|
3670
3649
|
const { renderMode, shadowMode } = owner;
|
|
3671
3650
|
if (isSyntheticShadowDefined) {
|
|
3672
|
-
if (shadowMode === 1 /* Synthetic */ || renderMode === 0 /* Light */) {
|
|
3651
|
+
if (shadowMode === 1 /* ShadowMode.Synthetic */ || renderMode === 0 /* RenderMode.Light */) {
|
|
3673
3652
|
elm[KEY__SHADOW_STATIC] = true;
|
|
3674
3653
|
}
|
|
3675
3654
|
}
|
|
3676
3655
|
if (process.env.NODE_ENV !== 'production') {
|
|
3677
|
-
const isLight = renderMode === 0 /* Light */;
|
|
3656
|
+
const isLight = renderMode === 0 /* RenderMode.Light */;
|
|
3678
3657
|
patchElementWithRestrictions(elm, { isPortal: false, isLight });
|
|
3679
3658
|
}
|
|
3680
3659
|
insertNode(elm, parent, anchor, renderer);
|
|
@@ -3706,7 +3685,7 @@ function mountCustomElement(vnode, parent, anchor, renderer) {
|
|
|
3706
3685
|
insertNode(elm, parent, anchor, renderer);
|
|
3707
3686
|
if (vm) {
|
|
3708
3687
|
if (process.env.NODE_ENV !== 'production') {
|
|
3709
|
-
assert.isTrue(vm.state === 0 /* created */, `${vm} cannot be recycled.`);
|
|
3688
|
+
assert.isTrue(vm.state === 0 /* VMState.created */, `${vm} cannot be recycled.`);
|
|
3710
3689
|
}
|
|
3711
3690
|
runConnectedCallback(vm);
|
|
3712
3691
|
}
|
|
@@ -3751,14 +3730,14 @@ function unmount(vnode, parent, renderer, doRemove = false) {
|
|
|
3751
3730
|
removeNode(elm, parent, renderer);
|
|
3752
3731
|
}
|
|
3753
3732
|
switch (type) {
|
|
3754
|
-
case 2 /* Element */: {
|
|
3733
|
+
case 2 /* VNodeType.Element */: {
|
|
3755
3734
|
// Slot content is removed to trigger slotchange event when removing slot.
|
|
3756
3735
|
// Only required for synthetic shadow.
|
|
3757
|
-
const shouldRemoveChildren = sel === 'slot' && vnode.owner.shadowMode === 1 /* Synthetic */;
|
|
3736
|
+
const shouldRemoveChildren = sel === 'slot' && vnode.owner.shadowMode === 1 /* ShadowMode.Synthetic */;
|
|
3758
3737
|
unmountVNodes(vnode.children, elm, renderer, shouldRemoveChildren);
|
|
3759
3738
|
break;
|
|
3760
3739
|
}
|
|
3761
|
-
case 3 /* CustomElement */: {
|
|
3740
|
+
case 3 /* VNodeType.CustomElement */: {
|
|
3762
3741
|
const { vm } = vnode;
|
|
3763
3742
|
// No need to unmount the children here, `removeVM` will take care of removing the
|
|
3764
3743
|
// children.
|
|
@@ -3801,7 +3780,7 @@ function linkNodeToShadow(elm, owner, renderer) {
|
|
|
3801
3780
|
const { isSyntheticShadowDefined } = renderer;
|
|
3802
3781
|
// TODO [#1164]: this should eventually be done by the polyfill directly
|
|
3803
3782
|
if (isSyntheticShadowDefined) {
|
|
3804
|
-
if (shadowMode === 1 /* Synthetic */ || renderMode === 0 /* Light */) {
|
|
3783
|
+
if (shadowMode === 1 /* ShadowMode.Synthetic */ || renderMode === 0 /* RenderMode.Light */) {
|
|
3805
3784
|
elm[KEY__SHADOW_RESOLVER] = renderRoot[KEY__SHADOW_RESOLVER];
|
|
3806
3785
|
}
|
|
3807
3786
|
}
|
|
@@ -3851,12 +3830,12 @@ function patchElementPropsAndAttrs$1(oldVnode, vnode, renderer) {
|
|
|
3851
3830
|
function fallbackElmHook(elm, vnode, renderer) {
|
|
3852
3831
|
const { owner } = vnode;
|
|
3853
3832
|
setScopeTokenClassIfNecessary(elm, owner, renderer);
|
|
3854
|
-
if (owner.shadowMode === 1 /* Synthetic */) {
|
|
3833
|
+
if (owner.shadowMode === 1 /* ShadowMode.Synthetic */) {
|
|
3855
3834
|
const { data: { context }, } = vnode;
|
|
3856
3835
|
const { stylesheetToken } = owner.context;
|
|
3857
3836
|
if (!isUndefined$1(context) &&
|
|
3858
3837
|
!isUndefined$1(context.lwc) &&
|
|
3859
|
-
context.lwc.dom === "manual" /* Manual */) {
|
|
3838
|
+
context.lwc.dom === "manual" /* LwcDomMode.Manual */) {
|
|
3860
3839
|
// this element will now accept any manual content inserted into it
|
|
3861
3840
|
observeElementChildNodes(elm);
|
|
3862
3841
|
}
|
|
@@ -3870,8 +3849,8 @@ function fallbackElmHook(elm, vnode, renderer) {
|
|
|
3870
3849
|
const { data: { context }, } = vnode;
|
|
3871
3850
|
const isPortal = !isUndefined$1(context) &&
|
|
3872
3851
|
!isUndefined$1(context.lwc) &&
|
|
3873
|
-
context.lwc.dom === "manual" /* Manual */;
|
|
3874
|
-
const isLight = owner.renderMode === 0 /* Light */;
|
|
3852
|
+
context.lwc.dom === "manual" /* LwcDomMode.Manual */;
|
|
3853
|
+
const isLight = owner.renderMode === 0 /* RenderMode.Light */;
|
|
3875
3854
|
patchElementWithRestrictions(elm, { isPortal, isLight });
|
|
3876
3855
|
}
|
|
3877
3856
|
}
|
|
@@ -3889,7 +3868,7 @@ function allocateChildren(vnode, vm) {
|
|
|
3889
3868
|
const children = vnode.aChildren || vnode.children;
|
|
3890
3869
|
vm.aChildren = children;
|
|
3891
3870
|
const { renderMode, shadowMode } = vm;
|
|
3892
|
-
if (shadowMode === 1 /* Synthetic */ || renderMode === 0 /* Light */) {
|
|
3871
|
+
if (shadowMode === 1 /* ShadowMode.Synthetic */ || renderMode === 0 /* RenderMode.Light */) {
|
|
3893
3872
|
// slow path
|
|
3894
3873
|
allocateInSlot(vm, children);
|
|
3895
3874
|
// save the allocated children in case this vnode is reused.
|
|
@@ -3908,7 +3887,7 @@ function createViewModelHook(elm, vnode, renderer) {
|
|
|
3908
3887
|
}
|
|
3909
3888
|
const { sel, mode, ctor, owner } = vnode;
|
|
3910
3889
|
setScopeTokenClassIfNecessary(elm, owner, renderer);
|
|
3911
|
-
if (owner.shadowMode === 1 /* Synthetic */) {
|
|
3890
|
+
if (owner.shadowMode === 1 /* ShadowMode.Synthetic */) {
|
|
3912
3891
|
const { stylesheetToken } = owner.context;
|
|
3913
3892
|
// when running in synthetic shadow mode, we need to set the shadowToken value
|
|
3914
3893
|
// into each element from the template, so they can be styled accordingly.
|
|
@@ -4150,7 +4129,7 @@ function addVNodeToChildLWC(vnode) {
|
|
|
4150
4129
|
// [st]atic node
|
|
4151
4130
|
function st(fragment, key) {
|
|
4152
4131
|
return {
|
|
4153
|
-
type: 4 /* Static */,
|
|
4132
|
+
type: 4 /* VNodeType.Static */,
|
|
4154
4133
|
sel: undefined,
|
|
4155
4134
|
key,
|
|
4156
4135
|
elm: undefined,
|
|
@@ -4184,7 +4163,7 @@ function h(sel, data, children = EmptyArray) {
|
|
|
4184
4163
|
let elm;
|
|
4185
4164
|
const { key } = data;
|
|
4186
4165
|
return {
|
|
4187
|
-
type: 2 /* Element */,
|
|
4166
|
+
type: 2 /* VNodeType.Element */,
|
|
4188
4167
|
sel,
|
|
4189
4168
|
data,
|
|
4190
4169
|
children,
|
|
@@ -4221,11 +4200,11 @@ function s(slotName, data, children, slotset) {
|
|
|
4221
4200
|
}
|
|
4222
4201
|
const vmBeingRendered = getVMBeingRendered();
|
|
4223
4202
|
const { renderMode, shadowMode } = vmBeingRendered;
|
|
4224
|
-
if (renderMode === 0 /* Light */) {
|
|
4203
|
+
if (renderMode === 0 /* RenderMode.Light */) {
|
|
4225
4204
|
sc(children);
|
|
4226
4205
|
return children;
|
|
4227
4206
|
}
|
|
4228
|
-
if (shadowMode === 1 /* Synthetic */) {
|
|
4207
|
+
if (shadowMode === 1 /* ShadowMode.Synthetic */) {
|
|
4229
4208
|
// TODO [#1276]: compiler should give us some sort of indicator when a vnodes collection is dynamic
|
|
4230
4209
|
sc(children);
|
|
4231
4210
|
}
|
|
@@ -4259,7 +4238,7 @@ function c(sel, Ctor, data, children = EmptyArray) {
|
|
|
4259
4238
|
const { key } = data;
|
|
4260
4239
|
let elm, aChildren, vm;
|
|
4261
4240
|
const vnode = {
|
|
4262
|
-
type: 3 /* CustomElement */,
|
|
4241
|
+
type: 3 /* VNodeType.CustomElement */,
|
|
4263
4242
|
sel,
|
|
4264
4243
|
data,
|
|
4265
4244
|
children,
|
|
@@ -4367,7 +4346,7 @@ function f(items) {
|
|
|
4367
4346
|
function t(text) {
|
|
4368
4347
|
let sel, key, elm;
|
|
4369
4348
|
return {
|
|
4370
|
-
type: 0 /* Text */,
|
|
4349
|
+
type: 0 /* VNodeType.Text */,
|
|
4371
4350
|
sel,
|
|
4372
4351
|
text,
|
|
4373
4352
|
elm,
|
|
@@ -4379,7 +4358,7 @@ function t(text) {
|
|
|
4379
4358
|
function co(text) {
|
|
4380
4359
|
let sel, key, elm;
|
|
4381
4360
|
return {
|
|
4382
|
-
type: 1 /* Comment */,
|
|
4361
|
+
type: 1 /* VNodeType.Comment */,
|
|
4383
4362
|
sel,
|
|
4384
4363
|
text,
|
|
4385
4364
|
elm,
|
|
@@ -4428,7 +4407,7 @@ function gid(id) {
|
|
|
4428
4407
|
return null;
|
|
4429
4408
|
}
|
|
4430
4409
|
const { idx, shadowMode } = vmBeingRendered;
|
|
4431
|
-
if (shadowMode === 1 /* Synthetic */) {
|
|
4410
|
+
if (shadowMode === 1 /* ShadowMode.Synthetic */) {
|
|
4432
4411
|
return StringReplace.call(id, /\S+/g, (id) => `${id}-${idx}`);
|
|
4433
4412
|
}
|
|
4434
4413
|
return id;
|
|
@@ -4450,7 +4429,7 @@ function fid(url) {
|
|
|
4450
4429
|
}
|
|
4451
4430
|
const { idx, shadowMode } = vmBeingRendered;
|
|
4452
4431
|
// Apply transformation only for fragment-only-urls, and only in shadow DOM
|
|
4453
|
-
if (shadowMode === 1 /* Synthetic */ && /^#/.test(url)) {
|
|
4432
|
+
if (shadowMode === 1 /* ShadowMode.Synthetic */ && /^#/.test(url)) {
|
|
4454
4433
|
return `${url}-${idx}`;
|
|
4455
4434
|
}
|
|
4456
4435
|
return url;
|
|
@@ -4573,7 +4552,7 @@ function createInlineStyleVNode(content) {
|
|
|
4573
4552
|
function updateStylesheetToken(vm, template) {
|
|
4574
4553
|
const { elm, context, renderMode, shadowMode, renderer: { getClassList, removeAttribute, setAttribute }, } = vm;
|
|
4575
4554
|
const { stylesheets: newStylesheets, stylesheetToken: newStylesheetToken } = template;
|
|
4576
|
-
const isSyntheticShadow = renderMode === 1 /* Shadow */ && shadowMode === 1 /* Synthetic */;
|
|
4555
|
+
const isSyntheticShadow = renderMode === 1 /* RenderMode.Shadow */ && shadowMode === 1 /* ShadowMode.Synthetic */;
|
|
4577
4556
|
const { hasScopedStyles } = context;
|
|
4578
4557
|
let newToken;
|
|
4579
4558
|
let newHasTokenInClass;
|
|
@@ -4629,19 +4608,19 @@ function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
|
|
|
4629
4608
|
const isScopedCss = stylesheet[KEY__SCOPED_CSS];
|
|
4630
4609
|
// Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
|
|
4631
4610
|
const scopeToken = isScopedCss ||
|
|
4632
|
-
(vm.shadowMode === 1 /* Synthetic */ && vm.renderMode === 1 /* Shadow */)
|
|
4611
|
+
(vm.shadowMode === 1 /* ShadowMode.Synthetic */ && vm.renderMode === 1 /* RenderMode.Shadow */)
|
|
4633
4612
|
? stylesheetToken
|
|
4634
4613
|
: undefined;
|
|
4635
4614
|
// Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
|
|
4636
4615
|
// native shadow DOM. Synthetic shadow DOM never uses `:host`.
|
|
4637
|
-
const useActualHostSelector = vm.renderMode === 0 /* Light */
|
|
4616
|
+
const useActualHostSelector = vm.renderMode === 0 /* RenderMode.Light */
|
|
4638
4617
|
? !isScopedCss
|
|
4639
|
-
: vm.shadowMode === 0 /* Native */;
|
|
4618
|
+
: vm.shadowMode === 0 /* ShadowMode.Native */;
|
|
4640
4619
|
// Use the native :dir() pseudoclass only in native shadow DOM. Otherwise, in synthetic shadow,
|
|
4641
4620
|
// we use an attribute selector on the host to simulate :dir().
|
|
4642
4621
|
let useNativeDirPseudoclass;
|
|
4643
|
-
if (vm.renderMode === 1 /* Shadow */) {
|
|
4644
|
-
useNativeDirPseudoclass = vm.shadowMode === 0 /* Native */;
|
|
4622
|
+
if (vm.renderMode === 1 /* RenderMode.Shadow */) {
|
|
4623
|
+
useNativeDirPseudoclass = vm.shadowMode === 0 /* ShadowMode.Native */;
|
|
4645
4624
|
}
|
|
4646
4625
|
else {
|
|
4647
4626
|
// Light DOM components should only render `[dir]` if they're inside of a synthetic shadow root.
|
|
@@ -4650,7 +4629,7 @@ function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
|
|
|
4650
4629
|
// Only calculate the root once as necessary
|
|
4651
4630
|
root = getNearestShadowComponent(vm);
|
|
4652
4631
|
}
|
|
4653
|
-
useNativeDirPseudoclass = isNull(root) || root.shadowMode === 0 /* Native */;
|
|
4632
|
+
useNativeDirPseudoclass = isNull(root) || root.shadowMode === 0 /* ShadowMode.Native */;
|
|
4654
4633
|
}
|
|
4655
4634
|
ArrayPush$1.call(content, stylesheet(scopeToken, useActualHostSelector, useNativeDirPseudoclass));
|
|
4656
4635
|
}
|
|
@@ -4671,7 +4650,7 @@ function getStylesheetsContent(vm, template) {
|
|
|
4671
4650
|
function getNearestShadowComponent(vm) {
|
|
4672
4651
|
let owner = vm;
|
|
4673
4652
|
while (!isNull(owner)) {
|
|
4674
|
-
if (owner.renderMode === 1 /* Shadow */) {
|
|
4653
|
+
if (owner.renderMode === 1 /* RenderMode.Shadow */) {
|
|
4675
4654
|
return owner;
|
|
4676
4655
|
}
|
|
4677
4656
|
owner = owner.owner;
|
|
@@ -4680,7 +4659,7 @@ function getNearestShadowComponent(vm) {
|
|
|
4680
4659
|
}
|
|
4681
4660
|
function getNearestNativeShadowComponent(vm) {
|
|
4682
4661
|
const owner = getNearestShadowComponent(vm);
|
|
4683
|
-
if (!isNull(owner) && owner.shadowMode === 1 /* Synthetic */) {
|
|
4662
|
+
if (!isNull(owner) && owner.shadowMode === 1 /* ShadowMode.Synthetic */) {
|
|
4684
4663
|
// Synthetic-within-native is impossible. So if the nearest shadow component is
|
|
4685
4664
|
// synthetic, we know we won't find a native component if we go any further.
|
|
4686
4665
|
return null;
|
|
@@ -4689,7 +4668,7 @@ function getNearestNativeShadowComponent(vm) {
|
|
|
4689
4668
|
}
|
|
4690
4669
|
function createStylesheet(vm, stylesheets) {
|
|
4691
4670
|
const { renderMode, shadowMode, renderer: { ssr, insertStylesheet }, } = vm;
|
|
4692
|
-
if (renderMode === 1 /* Shadow */ && shadowMode === 1 /* Synthetic */) {
|
|
4671
|
+
if (renderMode === 1 /* RenderMode.Shadow */ && shadowMode === 1 /* ShadowMode.Synthetic */) {
|
|
4693
4672
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
4694
4673
|
insertStylesheet(stylesheets[i]);
|
|
4695
4674
|
}
|
|
@@ -4814,11 +4793,11 @@ function validateSlots(vm, html) {
|
|
|
4814
4793
|
const { cmpSlots } = vm;
|
|
4815
4794
|
const { slots = EmptyArray } = html;
|
|
4816
4795
|
for (const slotName in cmpSlots) {
|
|
4817
|
-
// eslint-disable-next-line lwc-internal/no-production-assert
|
|
4796
|
+
// eslint-disable-next-line @lwc/lwc-internal/no-production-assert
|
|
4818
4797
|
assert.isTrue(isArray$1(cmpSlots[slotName]), `Slots can only be set to an array, instead received ${toString$1(cmpSlots[slotName])} for slot "${slotName}" in ${vm}.`);
|
|
4819
4798
|
if (slotName !== '' && ArrayIndexOf.call(slots, slotName) === -1) {
|
|
4820
4799
|
// TODO [#1297]: this should never really happen because the compiler should always validate
|
|
4821
|
-
// eslint-disable-next-line lwc-internal/no-production-assert
|
|
4800
|
+
// eslint-disable-next-line @lwc/lwc-internal/no-production-assert
|
|
4822
4801
|
logError(`Ignoring unknown provided slot name "${slotName}" in ${vm}. Check for a typo on the slot attribute.`, vm);
|
|
4823
4802
|
}
|
|
4824
4803
|
}
|
|
@@ -4826,7 +4805,7 @@ function validateSlots(vm, html) {
|
|
|
4826
4805
|
function validateLightDomTemplate(template, vm) {
|
|
4827
4806
|
if (template === defaultEmptyTemplate)
|
|
4828
4807
|
return;
|
|
4829
|
-
if (vm.renderMode === 0 /* Light */) {
|
|
4808
|
+
if (vm.renderMode === 0 /* RenderMode.Light */) {
|
|
4830
4809
|
assert.isTrue(template.renderMode === 'light', `Light DOM components can't render shadow DOM templates. Add an 'lwc:render-mode="light"' directive to the root template tag of ${getComponentTag(vm)}.`);
|
|
4831
4810
|
}
|
|
4832
4811
|
else {
|
|
@@ -4839,13 +4818,13 @@ function buildParseFragmentFn(createFragmentFn) {
|
|
|
4839
4818
|
return function () {
|
|
4840
4819
|
const { context: { hasScopedStyles, stylesheetToken }, shadowMode, renderer, } = getVMBeingRendered();
|
|
4841
4820
|
const hasStyleToken = !isUndefined$1(stylesheetToken);
|
|
4842
|
-
const isSyntheticShadow = shadowMode === 1 /* Synthetic */;
|
|
4821
|
+
const isSyntheticShadow = shadowMode === 1 /* ShadowMode.Synthetic */;
|
|
4843
4822
|
let cacheKey = 0;
|
|
4844
4823
|
if (hasStyleToken && hasScopedStyles) {
|
|
4845
|
-
cacheKey |= 1 /* HAS_SCOPED_STYLE */;
|
|
4824
|
+
cacheKey |= 1 /* FragmentCache.HAS_SCOPED_STYLE */;
|
|
4846
4825
|
}
|
|
4847
4826
|
if (hasStyleToken && isSyntheticShadow) {
|
|
4848
|
-
cacheKey |= 2 /* SHADOW_MODE_SYNTHETIC */;
|
|
4827
|
+
cacheKey |= 2 /* FragmentCache.SHADOW_MODE_SYNTHETIC */;
|
|
4849
4828
|
}
|
|
4850
4829
|
if (!isUndefined$1(cache[cacheKey])) {
|
|
4851
4830
|
return cache[cacheKey];
|
|
@@ -4895,7 +4874,7 @@ function evaluateTemplate(vm, html) {
|
|
|
4895
4874
|
runWithBoundaryProtection(vm, vm.owner, () => {
|
|
4896
4875
|
// pre
|
|
4897
4876
|
vmBeingRendered = vm;
|
|
4898
|
-
logOperationStart(1 /* Render */, vm);
|
|
4877
|
+
logOperationStart(1 /* OperationId.Render */, vm);
|
|
4899
4878
|
}, () => {
|
|
4900
4879
|
// job
|
|
4901
4880
|
const { component, context, cmpSlots, cmpTemplate, tro } = vm;
|
|
@@ -4953,7 +4932,7 @@ function evaluateTemplate(vm, html) {
|
|
|
4953
4932
|
// post
|
|
4954
4933
|
isUpdatingTemplate = isUpdatingTemplateInception;
|
|
4955
4934
|
vmBeingRendered = vmOfTemplateBeingUpdatedInception;
|
|
4956
|
-
logOperationEnd(1 /* Render */, vm);
|
|
4935
|
+
logOperationEnd(1 /* OperationId.Render */, vm);
|
|
4957
4936
|
});
|
|
4958
4937
|
if (process.env.NODE_ENV !== 'production') {
|
|
4959
4938
|
assert.invariant(isArray$1(vnodes), `Compiler should produce html functions that always return an array.`);
|
|
@@ -4992,7 +4971,7 @@ function invokeComponentCallback(vm, fn, args) {
|
|
|
4992
4971
|
function invokeComponentConstructor(vm, Ctor) {
|
|
4993
4972
|
const vmBeingConstructedInception = vmBeingConstructed;
|
|
4994
4973
|
let error;
|
|
4995
|
-
logOperationStart(0 /* Constructor */, vm);
|
|
4974
|
+
logOperationStart(0 /* OperationId.Constructor */, vm);
|
|
4996
4975
|
vmBeingConstructed = vm;
|
|
4997
4976
|
/**
|
|
4998
4977
|
* Constructors don't need to be wrapped with a boundary because for root elements
|
|
@@ -5014,7 +4993,7 @@ function invokeComponentConstructor(vm, Ctor) {
|
|
|
5014
4993
|
error = Object(e);
|
|
5015
4994
|
}
|
|
5016
4995
|
finally {
|
|
5017
|
-
logOperationEnd(0 /* Constructor */, vm);
|
|
4996
|
+
logOperationEnd(0 /* OperationId.Constructor */, vm);
|
|
5018
4997
|
vmBeingConstructed = vmBeingConstructedInception;
|
|
5019
4998
|
if (!isUndefined$1(error)) {
|
|
5020
4999
|
addErrorComponentStack(vm, error);
|
|
@@ -5195,12 +5174,12 @@ function rerenderVM(vm) {
|
|
|
5195
5174
|
function connectRootElement(elm) {
|
|
5196
5175
|
const vm = getAssociatedVM(elm);
|
|
5197
5176
|
logGlobalOperationStart(7
|
|
5198
|
-
/* GlobalHydrate */
|
|
5177
|
+
/* OperationId.GlobalHydrate */
|
|
5199
5178
|
, vm); // Usually means moving the element from one place to another, which is observable via
|
|
5200
5179
|
// life-cycle hooks.
|
|
5201
5180
|
|
|
5202
5181
|
if (vm.state === 1
|
|
5203
|
-
/* connected */
|
|
5182
|
+
/* VMState.connected */
|
|
5204
5183
|
) {
|
|
5205
5184
|
disconnectRootElement(elm);
|
|
5206
5185
|
}
|
|
@@ -5208,7 +5187,7 @@ function connectRootElement(elm) {
|
|
|
5208
5187
|
runConnectedCallback(vm);
|
|
5209
5188
|
rehydrate(vm);
|
|
5210
5189
|
logGlobalOperationEnd(7
|
|
5211
|
-
/* GlobalHydrate */
|
|
5190
|
+
/* OperationId.GlobalHydrate */
|
|
5212
5191
|
, vm);
|
|
5213
5192
|
}
|
|
5214
5193
|
function disconnectRootElement(elm) {
|
|
@@ -5226,7 +5205,7 @@ function resetComponentStateWhenRemoved(vm) {
|
|
|
5226
5205
|
} = vm;
|
|
5227
5206
|
|
|
5228
5207
|
if (state !== 2
|
|
5229
|
-
/* disconnected */
|
|
5208
|
+
/* VMState.disconnected */
|
|
5230
5209
|
) {
|
|
5231
5210
|
const {
|
|
5232
5211
|
oar,
|
|
@@ -5255,9 +5234,9 @@ function resetComponentStateWhenRemoved(vm) {
|
|
|
5255
5234
|
function removeVM(vm) {
|
|
5256
5235
|
if (process.env.NODE_ENV !== 'production') {
|
|
5257
5236
|
assert.isTrue(vm.state === 1
|
|
5258
|
-
/* connected */
|
|
5237
|
+
/* VMState.connected */
|
|
5259
5238
|
|| vm.state === 2
|
|
5260
|
-
/* disconnected */
|
|
5239
|
+
/* VMState.disconnected */
|
|
5261
5240
|
, `${vm} must have been connected.`);
|
|
5262
5241
|
}
|
|
5263
5242
|
|
|
@@ -5268,7 +5247,7 @@ function getNearestShadowAncestor(vm) {
|
|
|
5268
5247
|
let ancestor = vm.owner;
|
|
5269
5248
|
|
|
5270
5249
|
while (!isNull(ancestor) && ancestor.renderMode === 0
|
|
5271
|
-
/* Light */
|
|
5250
|
+
/* RenderMode.Light */
|
|
5272
5251
|
) {
|
|
5273
5252
|
ancestor = ancestor.owner;
|
|
5274
5253
|
}
|
|
@@ -5289,7 +5268,7 @@ function createVM(elm, ctor, renderer, options) {
|
|
|
5289
5268
|
def,
|
|
5290
5269
|
idx: idx++,
|
|
5291
5270
|
state: 0
|
|
5292
|
-
/* created */
|
|
5271
|
+
/* VMState.created */
|
|
5293
5272
|
,
|
|
5294
5273
|
isScheduled: false,
|
|
5295
5274
|
isDirty: true,
|
|
@@ -5338,7 +5317,7 @@ function createVM(elm, ctor, renderer, options) {
|
|
|
5338
5317
|
|
|
5339
5318
|
if (runtimeFlags.ENABLE_FORCE_NATIVE_SHADOW_MODE_FOR_TEST) {
|
|
5340
5319
|
vm.shadowMode = 0
|
|
5341
|
-
/* Native */
|
|
5320
|
+
/* ShadowMode.Native */
|
|
5342
5321
|
;
|
|
5343
5322
|
}
|
|
5344
5323
|
} // Create component instance associated to the vm and the element.
|
|
@@ -5365,57 +5344,57 @@ function computeShadowMode(vm, renderer) {
|
|
|
5365
5344
|
|
|
5366
5345
|
if (isSyntheticShadowDefined) {
|
|
5367
5346
|
if (def.renderMode === 0
|
|
5368
|
-
/* Light */
|
|
5347
|
+
/* RenderMode.Light */
|
|
5369
5348
|
) {
|
|
5370
5349
|
// ShadowMode.Native implies "not synthetic shadow" which is consistent with how
|
|
5371
5350
|
// everything defaults to native when the synthetic shadow polyfill is unavailable.
|
|
5372
5351
|
shadowMode = 0
|
|
5373
|
-
/* Native */
|
|
5352
|
+
/* ShadowMode.Native */
|
|
5374
5353
|
;
|
|
5375
5354
|
} else if (isNativeShadowDefined) {
|
|
5376
5355
|
// Not combined with above condition because @lwc/features only supports identifiers in
|
|
5377
5356
|
// the if-condition.
|
|
5378
5357
|
if (runtimeFlags.ENABLE_MIXED_SHADOW_MODE) {
|
|
5379
5358
|
if (def.shadowSupportMode === "any"
|
|
5380
|
-
/* Any */
|
|
5359
|
+
/* ShadowSupportMode.Any */
|
|
5381
5360
|
) {
|
|
5382
5361
|
shadowMode = 0
|
|
5383
|
-
/* Native */
|
|
5362
|
+
/* ShadowMode.Native */
|
|
5384
5363
|
;
|
|
5385
5364
|
} else {
|
|
5386
5365
|
const shadowAncestor = getNearestShadowAncestor(vm);
|
|
5387
5366
|
|
|
5388
5367
|
if (!isNull(shadowAncestor) && shadowAncestor.shadowMode === 0
|
|
5389
|
-
/* Native */
|
|
5368
|
+
/* ShadowMode.Native */
|
|
5390
5369
|
) {
|
|
5391
5370
|
// Transitive support for native Shadow DOM. A component in native mode
|
|
5392
5371
|
// transitively opts all of its descendants into native.
|
|
5393
5372
|
shadowMode = 0
|
|
5394
|
-
/* Native */
|
|
5373
|
+
/* ShadowMode.Native */
|
|
5395
5374
|
;
|
|
5396
5375
|
} else {
|
|
5397
5376
|
// Synthetic if neither this component nor any of its ancestors are configured
|
|
5398
5377
|
// to be native.
|
|
5399
5378
|
shadowMode = 1
|
|
5400
|
-
/* Synthetic */
|
|
5379
|
+
/* ShadowMode.Synthetic */
|
|
5401
5380
|
;
|
|
5402
5381
|
}
|
|
5403
5382
|
}
|
|
5404
5383
|
} else {
|
|
5405
5384
|
shadowMode = 1
|
|
5406
|
-
/* Synthetic */
|
|
5385
|
+
/* ShadowMode.Synthetic */
|
|
5407
5386
|
;
|
|
5408
5387
|
}
|
|
5409
5388
|
} else {
|
|
5410
5389
|
// Synthetic if there is no native Shadow DOM support.
|
|
5411
5390
|
shadowMode = 1
|
|
5412
|
-
/* Synthetic */
|
|
5391
|
+
/* ShadowMode.Synthetic */
|
|
5413
5392
|
;
|
|
5414
5393
|
}
|
|
5415
5394
|
} else {
|
|
5416
5395
|
// Native if the synthetic shadow polyfill is unavailable.
|
|
5417
5396
|
shadowMode = 0
|
|
5418
|
-
/* Native */
|
|
5397
|
+
/* ShadowMode.Native */
|
|
5419
5398
|
;
|
|
5420
5399
|
}
|
|
5421
5400
|
|
|
@@ -5475,7 +5454,7 @@ function patchShadowRoot(vm, newCh) {
|
|
|
5475
5454
|
runWithBoundaryProtection(vm, vm, () => {
|
|
5476
5455
|
// pre
|
|
5477
5456
|
logOperationStart(2
|
|
5478
|
-
/* Patch */
|
|
5457
|
+
/* OperationId.Patch */
|
|
5479
5458
|
, vm);
|
|
5480
5459
|
}, () => {
|
|
5481
5460
|
// job
|
|
@@ -5483,14 +5462,14 @@ function patchShadowRoot(vm, newCh) {
|
|
|
5483
5462
|
}, () => {
|
|
5484
5463
|
// post
|
|
5485
5464
|
logOperationEnd(2
|
|
5486
|
-
/* Patch */
|
|
5465
|
+
/* OperationId.Patch */
|
|
5487
5466
|
, vm);
|
|
5488
5467
|
});
|
|
5489
5468
|
}
|
|
5490
5469
|
}
|
|
5491
5470
|
|
|
5492
5471
|
if (vm.state === 1
|
|
5493
|
-
/* connected */
|
|
5472
|
+
/* VMState.connected */
|
|
5494
5473
|
) {
|
|
5495
5474
|
// If the element is connected, that means connectedCallback was already issued, and
|
|
5496
5475
|
// any successive rendering should finish with the call to renderedCallback, otherwise
|
|
@@ -5524,11 +5503,11 @@ function runRenderedCallback(vm) {
|
|
|
5524
5503
|
|
|
5525
5504
|
if (!isUndefined$1(renderedCallback)) {
|
|
5526
5505
|
logOperationStart(4
|
|
5527
|
-
/* RenderedCallback */
|
|
5506
|
+
/* OperationId.RenderedCallback */
|
|
5528
5507
|
, vm);
|
|
5529
5508
|
invokeComponentCallback(vm, renderedCallback);
|
|
5530
5509
|
logOperationEnd(4
|
|
5531
|
-
/* RenderedCallback */
|
|
5510
|
+
/* OperationId.RenderedCallback */
|
|
5532
5511
|
, vm);
|
|
5533
5512
|
}
|
|
5534
5513
|
}
|
|
@@ -5536,7 +5515,7 @@ let rehydrateQueue = [];
|
|
|
5536
5515
|
|
|
5537
5516
|
function flushRehydrationQueue() {
|
|
5538
5517
|
logGlobalOperationStart(8
|
|
5539
|
-
/* GlobalRehydrate */
|
|
5518
|
+
/* OperationId.GlobalRehydrate */
|
|
5540
5519
|
);
|
|
5541
5520
|
|
|
5542
5521
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -5563,7 +5542,7 @@ function flushRehydrationQueue() {
|
|
|
5563
5542
|
|
|
5564
5543
|
|
|
5565
5544
|
logGlobalOperationEnd(8
|
|
5566
|
-
/* GlobalRehydrate */
|
|
5545
|
+
/* OperationId.GlobalRehydrate */
|
|
5567
5546
|
); // re-throwing the original error will break the current tick, but since the next tick is
|
|
5568
5547
|
// already scheduled, it should continue patching the rest.
|
|
5569
5548
|
|
|
@@ -5572,7 +5551,7 @@ function flushRehydrationQueue() {
|
|
|
5572
5551
|
}
|
|
5573
5552
|
|
|
5574
5553
|
logGlobalOperationEnd(8
|
|
5575
|
-
/* GlobalRehydrate */
|
|
5554
|
+
/* OperationId.GlobalRehydrate */
|
|
5576
5555
|
);
|
|
5577
5556
|
}
|
|
5578
5557
|
|
|
@@ -5582,13 +5561,13 @@ function runConnectedCallback(vm) {
|
|
|
5582
5561
|
} = vm;
|
|
5583
5562
|
|
|
5584
5563
|
if (state === 1
|
|
5585
|
-
/* connected */
|
|
5564
|
+
/* VMState.connected */
|
|
5586
5565
|
) {
|
|
5587
5566
|
return; // nothing to do since it was already connected
|
|
5588
5567
|
}
|
|
5589
5568
|
|
|
5590
5569
|
vm.state = 1
|
|
5591
|
-
/* connected */
|
|
5570
|
+
/* VMState.connected */
|
|
5592
5571
|
; // reporting connection
|
|
5593
5572
|
|
|
5594
5573
|
const {
|
|
@@ -5609,11 +5588,11 @@ function runConnectedCallback(vm) {
|
|
|
5609
5588
|
|
|
5610
5589
|
if (!isUndefined$1(connectedCallback)) {
|
|
5611
5590
|
logOperationStart(3
|
|
5612
|
-
/* ConnectedCallback */
|
|
5591
|
+
/* OperationId.ConnectedCallback */
|
|
5613
5592
|
, vm);
|
|
5614
5593
|
invokeComponentCallback(vm, connectedCallback);
|
|
5615
5594
|
logOperationEnd(3
|
|
5616
|
-
/* ConnectedCallback */
|
|
5595
|
+
/* OperationId.ConnectedCallback */
|
|
5617
5596
|
, vm);
|
|
5618
5597
|
}
|
|
5619
5598
|
}
|
|
@@ -5625,7 +5604,7 @@ function hasWireAdapters(vm) {
|
|
|
5625
5604
|
function runDisconnectedCallback(vm) {
|
|
5626
5605
|
if (process.env.NODE_ENV !== 'production') {
|
|
5627
5606
|
assert.isTrue(vm.state !== 2
|
|
5628
|
-
/* disconnected */
|
|
5607
|
+
/* VMState.disconnected */
|
|
5629
5608
|
, `${vm} must be inserted.`);
|
|
5630
5609
|
}
|
|
5631
5610
|
|
|
@@ -5638,7 +5617,7 @@ function runDisconnectedCallback(vm) {
|
|
|
5638
5617
|
}
|
|
5639
5618
|
|
|
5640
5619
|
vm.state = 2
|
|
5641
|
-
/* disconnected */
|
|
5620
|
+
/* VMState.disconnected */
|
|
5642
5621
|
; // reporting disconnection
|
|
5643
5622
|
|
|
5644
5623
|
const {
|
|
@@ -5659,11 +5638,11 @@ function runDisconnectedCallback(vm) {
|
|
|
5659
5638
|
|
|
5660
5639
|
if (!isUndefined$1(disconnectedCallback)) {
|
|
5661
5640
|
logOperationStart(5
|
|
5662
|
-
/* DisconnectedCallback */
|
|
5641
|
+
/* OperationId.DisconnectedCallback */
|
|
5663
5642
|
, vm);
|
|
5664
5643
|
invokeComponentCallback(vm, disconnectedCallback);
|
|
5665
5644
|
logOperationEnd(5
|
|
5666
|
-
/* DisconnectedCallback */
|
|
5645
|
+
/* OperationId.DisconnectedCallback */
|
|
5667
5646
|
, vm);
|
|
5668
5647
|
}
|
|
5669
5648
|
}
|
|
@@ -5719,13 +5698,13 @@ function recursivelyDisconnectChildren(vnodes) {
|
|
|
5719
5698
|
if (!isNull(vnode) && !isUndefined$1(vnode.elm)) {
|
|
5720
5699
|
switch (vnode.type) {
|
|
5721
5700
|
case 2
|
|
5722
|
-
/* Element */
|
|
5701
|
+
/* VNodeType.Element */
|
|
5723
5702
|
:
|
|
5724
5703
|
recursivelyDisconnectChildren(vnode.children);
|
|
5725
5704
|
break;
|
|
5726
5705
|
|
|
5727
5706
|
case 3
|
|
5728
|
-
/* CustomElement */
|
|
5707
|
+
/* VNodeType.CustomElement */
|
|
5729
5708
|
:
|
|
5730
5709
|
{
|
|
5731
5710
|
const vm = getAssociatedVM(vnode.elm);
|
|
@@ -5816,13 +5795,13 @@ function runWithBoundaryProtection(vm, owner, pre, job, post) {
|
|
|
5816
5795
|
resetComponentRoot(vm); // remove offenders
|
|
5817
5796
|
|
|
5818
5797
|
logOperationStart(6
|
|
5819
|
-
/* ErrorCallback */
|
|
5798
|
+
/* OperationId.ErrorCallback */
|
|
5820
5799
|
, vm); // error boundaries must have an ErrorCallback
|
|
5821
5800
|
|
|
5822
5801
|
const errorCallback = errorBoundaryVm.def.errorCallback;
|
|
5823
5802
|
invokeComponentCallback(errorBoundaryVm, errorCallback, [error, error.wcStack]);
|
|
5824
5803
|
logOperationEnd(6
|
|
5825
|
-
/* ErrorCallback */
|
|
5804
|
+
/* OperationId.ErrorCallback */
|
|
5826
5805
|
, vm);
|
|
5827
5806
|
}
|
|
5828
5807
|
}
|
|
@@ -5900,7 +5879,7 @@ function createConfigWatcher(component, configCallback, callbackWhenConfigIsRead
|
|
|
5900
5879
|
|
|
5901
5880
|
const computeConfigAndUpdate = () => {
|
|
5902
5881
|
let config;
|
|
5903
|
-
ro.observe(() => config = configCallback(component)); // eslint-disable-next-line lwc-internal/no-invalid-todo
|
|
5882
|
+
ro.observe(() => config = configCallback(component)); // eslint-disable-next-line @lwc/lwc-internal/no-invalid-todo
|
|
5904
5883
|
// TODO: dev-mode validation of config based on the adapter.configSchema
|
|
5905
5884
|
// @ts-ignore it is assigned in the observe() callback
|
|
5906
5885
|
|
|
@@ -5942,7 +5921,7 @@ function createContextWatcher(vm, wireDef, callbackWhenContextIsReady) {
|
|
|
5942
5921
|
// guarantee that the linkage can be forged.
|
|
5943
5922
|
const contextRegistrationEvent = new WireContextRegistrationEvent(adapterContextToken, {
|
|
5944
5923
|
setNewContext(newContext) {
|
|
5945
|
-
// eslint-disable-next-line lwc-internal/no-invalid-todo
|
|
5924
|
+
// eslint-disable-next-line @lwc/lwc-internal/no-invalid-todo
|
|
5946
5925
|
// TODO: dev-mode validation of config based on the adapter.contextSchema
|
|
5947
5926
|
callbackWhenContextIsReady(newContext);
|
|
5948
5927
|
},
|
|
@@ -6006,7 +5985,7 @@ function createConnector(vm, name, wireDef) {
|
|
|
6006
5985
|
// (ever), while context can have identity
|
|
6007
5986
|
|
|
6008
5987
|
if (vm.state === 1
|
|
6009
|
-
/* connected */
|
|
5988
|
+
/* VMState.connected */
|
|
6010
5989
|
) {
|
|
6011
5990
|
computeConfigAndUpdate();
|
|
6012
5991
|
}
|
|
@@ -6294,7 +6273,7 @@ function freezeTemplate(tmpl) {
|
|
|
6294
6273
|
});
|
|
6295
6274
|
}
|
|
6296
6275
|
}
|
|
6297
|
-
/* version: 2.
|
|
6276
|
+
/* version: 2.20.0 */
|
|
6298
6277
|
|
|
6299
6278
|
/*
|
|
6300
6279
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
@@ -6336,10 +6315,11 @@ function unsupportedMethod(name) {
|
|
|
6336
6315
|
throw new TypeError(`"${name}" is not supported in this environment`);
|
|
6337
6316
|
};
|
|
6338
6317
|
}
|
|
6339
|
-
function createElement(name) {
|
|
6318
|
+
function createElement(name, namespace) {
|
|
6340
6319
|
return {
|
|
6341
6320
|
type: HostNodeType.Element,
|
|
6342
6321
|
name,
|
|
6322
|
+
namespace: namespace !== null && namespace !== void 0 ? namespace : HTML_NAMESPACE,
|
|
6343
6323
|
parent: null,
|
|
6344
6324
|
shadowRoot: null,
|
|
6345
6325
|
children: [],
|
|
@@ -6686,15 +6666,22 @@ function serializeShadowRoot(shadowRoot) {
|
|
|
6686
6666
|
}
|
|
6687
6667
|
function serializeElement(element) {
|
|
6688
6668
|
let output = '';
|
|
6689
|
-
const { name } = element;
|
|
6669
|
+
const { name, namespace } = element;
|
|
6670
|
+
const isForeignElement = namespace !== HTML_NAMESPACE;
|
|
6671
|
+
const hasChildren = element.children.length > 0;
|
|
6690
6672
|
const attrs = element.attributes.length ? ` ${serializeAttributes(element.attributes)}` : '';
|
|
6691
|
-
|
|
6692
|
-
|
|
6673
|
+
output += `<${name}${attrs}`;
|
|
6674
|
+
// Note that foreign elements can have children but not shadow roots
|
|
6675
|
+
if (isForeignElement && !hasChildren) {
|
|
6676
|
+
output += '/>';
|
|
6677
|
+
return output;
|
|
6678
|
+
}
|
|
6679
|
+
output += '>';
|
|
6693
6680
|
if (element.shadowRoot) {
|
|
6694
6681
|
output += serializeShadowRoot(element.shadowRoot);
|
|
6695
6682
|
}
|
|
6696
|
-
output += children;
|
|
6697
|
-
if (!isVoidElement(name)) {
|
|
6683
|
+
output += serializeChildNodes(element.children);
|
|
6684
|
+
if (!isVoidElement(name, namespace) || hasChildren) {
|
|
6698
6685
|
output += `</${name}>`;
|
|
6699
6686
|
}
|
|
6700
6687
|
return output;
|
|
@@ -6709,6 +6696,7 @@ function serializeElement(element) {
|
|
|
6709
6696
|
const FakeRootElement = {
|
|
6710
6697
|
type: HostNodeType.Element,
|
|
6711
6698
|
name: 'fake-root-element',
|
|
6699
|
+
namespace: HTML_NAMESPACE,
|
|
6712
6700
|
parent: null,
|
|
6713
6701
|
shadowRoot: null,
|
|
6714
6702
|
children: [],
|
|
@@ -6747,7 +6735,7 @@ function renderComponent(tagName, Ctor, props = {}) {
|
|
|
6747
6735
|
*/
|
|
6748
6736
|
freeze(LightningElement);
|
|
6749
6737
|
seal(LightningElement.prototype);
|
|
6750
|
-
/* version: 2.
|
|
6738
|
+
/* version: 2.20.0 */
|
|
6751
6739
|
|
|
6752
6740
|
exports.LightningElement = LightningElement;
|
|
6753
6741
|
exports.api = api$1;
|