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
|
@@ -240,6 +240,9 @@
|
|
|
240
240
|
const KEY__SHADOW_TOKEN = '$shadowToken$';
|
|
241
241
|
const KEY__SYNTHETIC_MODE = '$$lwc-synthetic-mode';
|
|
242
242
|
const KEY__SCOPED_CSS = '$scoped$';
|
|
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';
|
|
243
246
|
/**
|
|
244
247
|
* Map composed of properties to attributes not following the HTML property to attribute mapping
|
|
245
248
|
* convention.
|
|
@@ -294,9 +297,6 @@
|
|
|
294
297
|
CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
|
|
295
298
|
return attributeName;
|
|
296
299
|
}
|
|
297
|
-
const XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';
|
|
298
|
-
const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
|
|
299
|
-
const XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
|
|
300
300
|
|
|
301
301
|
/*
|
|
302
302
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -305,9 +305,9 @@
|
|
|
305
305
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
306
306
|
*/
|
|
307
307
|
// Increment whenever the LWC template compiler changes
|
|
308
|
-
const LWC_VERSION = "2.
|
|
308
|
+
const LWC_VERSION = "2.20.0";
|
|
309
309
|
const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
310
|
-
/** version: 2.
|
|
310
|
+
/** version: 2.20.0 */
|
|
311
311
|
|
|
312
312
|
/*
|
|
313
313
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -461,7 +461,7 @@
|
|
|
461
461
|
setFeatureFlag(name, value);
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
|
-
/** version: 2.
|
|
464
|
+
/** version: 2.20.0 */
|
|
465
465
|
|
|
466
466
|
/*
|
|
467
467
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -1921,7 +1921,7 @@
|
|
|
1921
1921
|
// Linking elm, shadow root and component with the VM.
|
|
1922
1922
|
associateVM(component, vm);
|
|
1923
1923
|
associateVM(elm, vm);
|
|
1924
|
-
if (vm.renderMode === 1 /* Shadow */) {
|
|
1924
|
+
if (vm.renderMode === 1 /* RenderMode.Shadow */) {
|
|
1925
1925
|
vm.renderRoot = doAttachShadow(vm);
|
|
1926
1926
|
}
|
|
1927
1927
|
else {
|
|
@@ -1937,7 +1937,7 @@
|
|
|
1937
1937
|
function doAttachShadow(vm) {
|
|
1938
1938
|
const { elm, mode, shadowMode, def: { ctor }, renderer: { attachShadow }, } = vm;
|
|
1939
1939
|
const shadowRoot = attachShadow(elm, {
|
|
1940
|
-
[KEY__SYNTHETIC_MODE]: shadowMode === 1 /* Synthetic */,
|
|
1940
|
+
[KEY__SYNTHETIC_MODE]: shadowMode === 1 /* ShadowMode.Synthetic */,
|
|
1941
1941
|
delegatesFocus: Boolean(ctor.delegatesFocus),
|
|
1942
1942
|
mode,
|
|
1943
1943
|
});
|
|
@@ -2060,7 +2060,7 @@
|
|
|
2060
2060
|
get template() {
|
|
2061
2061
|
const vm = getAssociatedVM(this);
|
|
2062
2062
|
if (process.env.NODE_ENV !== 'production') {
|
|
2063
|
-
if (vm.renderMode === 0 /* Light */) {
|
|
2063
|
+
if (vm.renderMode === 0 /* RenderMode.Light */) {
|
|
2064
2064
|
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`.');
|
|
2065
2065
|
}
|
|
2066
2066
|
}
|
|
@@ -2432,13 +2432,13 @@
|
|
|
2432
2432
|
*/
|
|
2433
2433
|
function getClassDescriptorType(descriptor) {
|
|
2434
2434
|
if (isFunction$1(descriptor.value)) {
|
|
2435
|
-
return "method" /* Method */;
|
|
2435
|
+
return "method" /* DescriptorType.Method */;
|
|
2436
2436
|
}
|
|
2437
2437
|
else if (isFunction$1(descriptor.set) || isFunction$1(descriptor.get)) {
|
|
2438
|
-
return "accessor" /* Accessor */;
|
|
2438
|
+
return "accessor" /* DescriptorType.Accessor */;
|
|
2439
2439
|
}
|
|
2440
2440
|
else {
|
|
2441
|
-
return "field" /* Field */;
|
|
2441
|
+
return "field" /* DescriptorType.Field */;
|
|
2442
2442
|
}
|
|
2443
2443
|
}
|
|
2444
2444
|
function validateObservedField(Ctor, fieldName, descriptor) {
|
|
@@ -2447,7 +2447,7 @@
|
|
|
2447
2447
|
const message = `Invalid observed ${fieldName} field. Found a duplicate ${type} with the same name.`;
|
|
2448
2448
|
// [W-9927596] Ideally we always throw an error when detecting duplicate observed field.
|
|
2449
2449
|
// This branch is only here for backward compatibility reasons.
|
|
2450
|
-
if (type === "accessor" /* Accessor */) {
|
|
2450
|
+
if (type === "accessor" /* DescriptorType.Accessor */) {
|
|
2451
2451
|
logError(message);
|
|
2452
2452
|
}
|
|
2453
2453
|
else {
|
|
@@ -2478,7 +2478,7 @@
|
|
|
2478
2478
|
const message = `Invalid @api ${fieldName} field. Found a duplicate ${type} with the same name.`;
|
|
2479
2479
|
// [W-9927596] Ideally we always throw an error when detecting duplicate public properties.
|
|
2480
2480
|
// This branch is only here for backward compatibility reasons.
|
|
2481
|
-
if (type === "accessor" /* Accessor */) {
|
|
2481
|
+
if (type === "accessor" /* DescriptorType.Accessor */) {
|
|
2482
2482
|
logError(message);
|
|
2483
2483
|
}
|
|
2484
2484
|
else {
|
|
@@ -3200,8 +3200,8 @@
|
|
|
3200
3200
|
// assert.isTrue(ctorName && isString(ctorName), `${toString(Ctor)} should have a "name" property with string value, but found ${ctorName}.`);
|
|
3201
3201
|
assert.isTrue(Ctor.constructor, `Missing ${ctorName}.constructor, ${ctorName} should have a "constructor" property.`);
|
|
3202
3202
|
if (!isUndefined$1(ctorShadowSupportMode)) {
|
|
3203
|
-
assert.invariant(ctorShadowSupportMode === "any" /* Any */ ||
|
|
3204
|
-
ctorShadowSupportMode === "reset" /* Default */, `Invalid value for static property shadowSupportMode: '${ctorShadowSupportMode}'`);
|
|
3203
|
+
assert.invariant(ctorShadowSupportMode === "any" /* ShadowSupportMode.Any */ ||
|
|
3204
|
+
ctorShadowSupportMode === "reset" /* ShadowSupportMode.Default */, `Invalid value for static property shadowSupportMode: '${ctorShadowSupportMode}'`);
|
|
3205
3205
|
}
|
|
3206
3206
|
if (!isUndefined$1(ctorRenderMode)) {
|
|
3207
3207
|
assert.invariant(ctorRenderMode === 'light' || ctorRenderMode === 'shadow', `Invalid value for static property renderMode: '${ctorRenderMode}'. renderMode must be either 'light' or 'shadow'.`);
|
|
@@ -3229,7 +3229,7 @@
|
|
|
3229
3229
|
}
|
|
3230
3230
|
let renderMode = superDef.renderMode;
|
|
3231
3231
|
if (!isUndefined$1(ctorRenderMode)) {
|
|
3232
|
-
renderMode = ctorRenderMode === 'light' ? 0 /* Light */ : 1 /* Shadow */;
|
|
3232
|
+
renderMode = ctorRenderMode === 'light' ? 0 /* RenderMode.Light */ : 1 /* RenderMode.Shadow */;
|
|
3233
3233
|
}
|
|
3234
3234
|
const template = getComponentRegisteredTemplate(Ctor) || superDef.template;
|
|
3235
3235
|
const name = Ctor.name || superDef.name;
|
|
@@ -3322,8 +3322,8 @@
|
|
|
3322
3322
|
props: lightningBasedDescriptors,
|
|
3323
3323
|
propsConfig: EmptyObject,
|
|
3324
3324
|
methods: EmptyObject,
|
|
3325
|
-
renderMode: 1 /* Shadow */,
|
|
3326
|
-
shadowSupportMode: "reset" /* Default */,
|
|
3325
|
+
renderMode: 1 /* RenderMode.Shadow */,
|
|
3326
|
+
shadowSupportMode: "reset" /* ShadowSupportMode.Default */,
|
|
3327
3327
|
wire: EmptyObject,
|
|
3328
3328
|
bridge: BaseBridgeElement,
|
|
3329
3329
|
template: defaultEmptyTemplate,
|
|
@@ -3345,7 +3345,7 @@
|
|
|
3345
3345
|
// avoid leaking the reference to the public props descriptors
|
|
3346
3346
|
publicProps[key] = {
|
|
3347
3347
|
config: propsConfig[key] || 0,
|
|
3348
|
-
type: "any" /* any */,
|
|
3348
|
+
type: "any" /* PropDefType.any */,
|
|
3349
3349
|
attr: htmlPropertyToAttribute(key),
|
|
3350
3350
|
};
|
|
3351
3351
|
}
|
|
@@ -3402,7 +3402,7 @@
|
|
|
3402
3402
|
*/
|
|
3403
3403
|
function isVBaseElement(vnode) {
|
|
3404
3404
|
const { type } = vnode;
|
|
3405
|
-
return type === 2 /* Element */ || type === 3 /* CustomElement */;
|
|
3405
|
+
return type === 2 /* VNodeType.Element */ || type === 3 /* VNodeType.CustomElement */;
|
|
3406
3406
|
}
|
|
3407
3407
|
function isSameVnode(vnode1, vnode2) {
|
|
3408
3408
|
return vnode1.key === vnode2.key && vnode1.sel === vnode2.sel;
|
|
@@ -3658,21 +3658,21 @@
|
|
|
3658
3658
|
}
|
|
3659
3659
|
}
|
|
3660
3660
|
switch (n2.type) {
|
|
3661
|
-
case 0 /* Text */:
|
|
3661
|
+
case 0 /* VNodeType.Text */:
|
|
3662
3662
|
// VText has no special capability, fallback to the owner's renderer
|
|
3663
3663
|
patchText(n1, n2, renderer);
|
|
3664
3664
|
break;
|
|
3665
|
-
case 1 /* Comment */:
|
|
3665
|
+
case 1 /* VNodeType.Comment */:
|
|
3666
3666
|
// VComment has no special capability, fallback to the owner's renderer
|
|
3667
3667
|
patchComment(n1, n2, renderer);
|
|
3668
3668
|
break;
|
|
3669
|
-
case 4 /* Static */:
|
|
3669
|
+
case 4 /* VNodeType.Static */:
|
|
3670
3670
|
n2.elm = n1.elm;
|
|
3671
3671
|
break;
|
|
3672
|
-
case 2 /* Element */:
|
|
3672
|
+
case 2 /* VNodeType.Element */:
|
|
3673
3673
|
patchElement(n1, n2, (_a = n2.data.renderer) !== null && _a !== void 0 ? _a : renderer);
|
|
3674
3674
|
break;
|
|
3675
|
-
case 3 /* CustomElement */:
|
|
3675
|
+
case 3 /* VNodeType.CustomElement */:
|
|
3676
3676
|
patchCustomElement(n1, n2, (_b = n2.data.renderer) !== null && _b !== void 0 ? _b : renderer);
|
|
3677
3677
|
break;
|
|
3678
3678
|
}
|
|
@@ -3680,23 +3680,23 @@
|
|
|
3680
3680
|
function mount(node, parent, renderer, anchor) {
|
|
3681
3681
|
var _a, _b;
|
|
3682
3682
|
switch (node.type) {
|
|
3683
|
-
case 0 /* Text */:
|
|
3683
|
+
case 0 /* VNodeType.Text */:
|
|
3684
3684
|
// VText has no special capability, fallback to the owner's renderer
|
|
3685
3685
|
mountText(node, parent, anchor, renderer);
|
|
3686
3686
|
break;
|
|
3687
|
-
case 1 /* Comment */:
|
|
3687
|
+
case 1 /* VNodeType.Comment */:
|
|
3688
3688
|
// VComment has no special capability, fallback to the owner's renderer
|
|
3689
3689
|
mountComment(node, parent, anchor, renderer);
|
|
3690
3690
|
break;
|
|
3691
|
-
case 4 /* Static */:
|
|
3691
|
+
case 4 /* VNodeType.Static */:
|
|
3692
3692
|
// VStatic cannot have a custom renderer associated to them, using owner's renderer
|
|
3693
3693
|
mountStatic(node, parent, anchor, renderer);
|
|
3694
3694
|
break;
|
|
3695
|
-
case 2 /* Element */:
|
|
3695
|
+
case 2 /* VNodeType.Element */:
|
|
3696
3696
|
// If the vnode data has a renderer override use it, else fallback to owner's renderer
|
|
3697
3697
|
mountElement(node, parent, anchor, (_a = node.data.renderer) !== null && _a !== void 0 ? _a : renderer);
|
|
3698
3698
|
break;
|
|
3699
|
-
case 3 /* CustomElement */:
|
|
3699
|
+
case 3 /* VNodeType.CustomElement */:
|
|
3700
3700
|
// If the vnode data has a renderer override use it, else fallback to owner's renderer
|
|
3701
3701
|
mountCustomElement(node, parent, anchor, (_b = node.data.renderer) !== null && _b !== void 0 ? _b : renderer);
|
|
3702
3702
|
break;
|
|
@@ -3755,12 +3755,12 @@
|
|
|
3755
3755
|
// Marks this node as Static to propagate the shadow resolver. must happen after elm is assigned to the proper shadow
|
|
3756
3756
|
const { renderMode, shadowMode } = owner;
|
|
3757
3757
|
if (isSyntheticShadowDefined) {
|
|
3758
|
-
if (shadowMode === 1 /* Synthetic */ || renderMode === 0 /* Light */) {
|
|
3758
|
+
if (shadowMode === 1 /* ShadowMode.Synthetic */ || renderMode === 0 /* RenderMode.Light */) {
|
|
3759
3759
|
elm[KEY__SHADOW_STATIC] = true;
|
|
3760
3760
|
}
|
|
3761
3761
|
}
|
|
3762
3762
|
if (process.env.NODE_ENV !== 'production') {
|
|
3763
|
-
const isLight = renderMode === 0 /* Light */;
|
|
3763
|
+
const isLight = renderMode === 0 /* RenderMode.Light */;
|
|
3764
3764
|
patchElementWithRestrictions(elm, { isPortal: false, isLight });
|
|
3765
3765
|
}
|
|
3766
3766
|
insertNode(elm, parent, anchor, renderer);
|
|
@@ -3792,7 +3792,7 @@
|
|
|
3792
3792
|
insertNode(elm, parent, anchor, renderer);
|
|
3793
3793
|
if (vm) {
|
|
3794
3794
|
if (process.env.NODE_ENV !== 'production') {
|
|
3795
|
-
assert.isTrue(vm.state === 0 /* created */, `${vm} cannot be recycled.`);
|
|
3795
|
+
assert.isTrue(vm.state === 0 /* VMState.created */, `${vm} cannot be recycled.`);
|
|
3796
3796
|
}
|
|
3797
3797
|
runConnectedCallback(vm);
|
|
3798
3798
|
}
|
|
@@ -3837,14 +3837,14 @@
|
|
|
3837
3837
|
removeNode(elm, parent, renderer);
|
|
3838
3838
|
}
|
|
3839
3839
|
switch (type) {
|
|
3840
|
-
case 2 /* Element */: {
|
|
3840
|
+
case 2 /* VNodeType.Element */: {
|
|
3841
3841
|
// Slot content is removed to trigger slotchange event when removing slot.
|
|
3842
3842
|
// Only required for synthetic shadow.
|
|
3843
|
-
const shouldRemoveChildren = sel === 'slot' && vnode.owner.shadowMode === 1 /* Synthetic */;
|
|
3843
|
+
const shouldRemoveChildren = sel === 'slot' && vnode.owner.shadowMode === 1 /* ShadowMode.Synthetic */;
|
|
3844
3844
|
unmountVNodes(vnode.children, elm, renderer, shouldRemoveChildren);
|
|
3845
3845
|
break;
|
|
3846
3846
|
}
|
|
3847
|
-
case 3 /* CustomElement */: {
|
|
3847
|
+
case 3 /* VNodeType.CustomElement */: {
|
|
3848
3848
|
const { vm } = vnode;
|
|
3849
3849
|
// No need to unmount the children here, `removeVM` will take care of removing the
|
|
3850
3850
|
// children.
|
|
@@ -3887,7 +3887,7 @@
|
|
|
3887
3887
|
const { isSyntheticShadowDefined } = renderer;
|
|
3888
3888
|
// TODO [#1164]: this should eventually be done by the polyfill directly
|
|
3889
3889
|
if (isSyntheticShadowDefined) {
|
|
3890
|
-
if (shadowMode === 1 /* Synthetic */ || renderMode === 0 /* Light */) {
|
|
3890
|
+
if (shadowMode === 1 /* ShadowMode.Synthetic */ || renderMode === 0 /* RenderMode.Light */) {
|
|
3891
3891
|
elm[KEY__SHADOW_RESOLVER] = renderRoot[KEY__SHADOW_RESOLVER];
|
|
3892
3892
|
}
|
|
3893
3893
|
}
|
|
@@ -3937,12 +3937,12 @@
|
|
|
3937
3937
|
function fallbackElmHook(elm, vnode, renderer) {
|
|
3938
3938
|
const { owner } = vnode;
|
|
3939
3939
|
setScopeTokenClassIfNecessary(elm, owner, renderer);
|
|
3940
|
-
if (owner.shadowMode === 1 /* Synthetic */) {
|
|
3940
|
+
if (owner.shadowMode === 1 /* ShadowMode.Synthetic */) {
|
|
3941
3941
|
const { data: { context }, } = vnode;
|
|
3942
3942
|
const { stylesheetToken } = owner.context;
|
|
3943
3943
|
if (!isUndefined$1(context) &&
|
|
3944
3944
|
!isUndefined$1(context.lwc) &&
|
|
3945
|
-
context.lwc.dom === "manual" /* Manual */) {
|
|
3945
|
+
context.lwc.dom === "manual" /* LwcDomMode.Manual */) {
|
|
3946
3946
|
// this element will now accept any manual content inserted into it
|
|
3947
3947
|
observeElementChildNodes(elm);
|
|
3948
3948
|
}
|
|
@@ -3956,8 +3956,8 @@
|
|
|
3956
3956
|
const { data: { context }, } = vnode;
|
|
3957
3957
|
const isPortal = !isUndefined$1(context) &&
|
|
3958
3958
|
!isUndefined$1(context.lwc) &&
|
|
3959
|
-
context.lwc.dom === "manual" /* Manual */;
|
|
3960
|
-
const isLight = owner.renderMode === 0 /* Light */;
|
|
3959
|
+
context.lwc.dom === "manual" /* LwcDomMode.Manual */;
|
|
3960
|
+
const isLight = owner.renderMode === 0 /* RenderMode.Light */;
|
|
3961
3961
|
patchElementWithRestrictions(elm, { isPortal, isLight });
|
|
3962
3962
|
}
|
|
3963
3963
|
}
|
|
@@ -3975,7 +3975,7 @@
|
|
|
3975
3975
|
const children = vnode.aChildren || vnode.children;
|
|
3976
3976
|
vm.aChildren = children;
|
|
3977
3977
|
const { renderMode, shadowMode } = vm;
|
|
3978
|
-
if (shadowMode === 1 /* Synthetic */ || renderMode === 0 /* Light */) {
|
|
3978
|
+
if (shadowMode === 1 /* ShadowMode.Synthetic */ || renderMode === 0 /* RenderMode.Light */) {
|
|
3979
3979
|
// slow path
|
|
3980
3980
|
allocateInSlot(vm, children);
|
|
3981
3981
|
// save the allocated children in case this vnode is reused.
|
|
@@ -3994,7 +3994,7 @@
|
|
|
3994
3994
|
}
|
|
3995
3995
|
const { sel, mode, ctor, owner } = vnode;
|
|
3996
3996
|
setScopeTokenClassIfNecessary(elm, owner, renderer);
|
|
3997
|
-
if (owner.shadowMode === 1 /* Synthetic */) {
|
|
3997
|
+
if (owner.shadowMode === 1 /* ShadowMode.Synthetic */) {
|
|
3998
3998
|
const { stylesheetToken } = owner.context;
|
|
3999
3999
|
// when running in synthetic shadow mode, we need to set the shadowToken value
|
|
4000
4000
|
// into each element from the template, so they can be styled accordingly.
|
|
@@ -4236,7 +4236,7 @@
|
|
|
4236
4236
|
// [st]atic node
|
|
4237
4237
|
function st(fragment, key) {
|
|
4238
4238
|
return {
|
|
4239
|
-
type: 4 /* Static */,
|
|
4239
|
+
type: 4 /* VNodeType.Static */,
|
|
4240
4240
|
sel: undefined,
|
|
4241
4241
|
key,
|
|
4242
4242
|
elm: undefined,
|
|
@@ -4270,7 +4270,7 @@
|
|
|
4270
4270
|
let elm;
|
|
4271
4271
|
const { key } = data;
|
|
4272
4272
|
return {
|
|
4273
|
-
type: 2 /* Element */,
|
|
4273
|
+
type: 2 /* VNodeType.Element */,
|
|
4274
4274
|
sel,
|
|
4275
4275
|
data,
|
|
4276
4276
|
children,
|
|
@@ -4307,11 +4307,11 @@
|
|
|
4307
4307
|
}
|
|
4308
4308
|
const vmBeingRendered = getVMBeingRendered();
|
|
4309
4309
|
const { renderMode, shadowMode } = vmBeingRendered;
|
|
4310
|
-
if (renderMode === 0 /* Light */) {
|
|
4310
|
+
if (renderMode === 0 /* RenderMode.Light */) {
|
|
4311
4311
|
sc(children);
|
|
4312
4312
|
return children;
|
|
4313
4313
|
}
|
|
4314
|
-
if (shadowMode === 1 /* Synthetic */) {
|
|
4314
|
+
if (shadowMode === 1 /* ShadowMode.Synthetic */) {
|
|
4315
4315
|
// TODO [#1276]: compiler should give us some sort of indicator when a vnodes collection is dynamic
|
|
4316
4316
|
sc(children);
|
|
4317
4317
|
}
|
|
@@ -4345,7 +4345,7 @@
|
|
|
4345
4345
|
const { key } = data;
|
|
4346
4346
|
let elm, aChildren, vm;
|
|
4347
4347
|
const vnode = {
|
|
4348
|
-
type: 3 /* CustomElement */,
|
|
4348
|
+
type: 3 /* VNodeType.CustomElement */,
|
|
4349
4349
|
sel,
|
|
4350
4350
|
data,
|
|
4351
4351
|
children,
|
|
@@ -4453,7 +4453,7 @@
|
|
|
4453
4453
|
function t(text) {
|
|
4454
4454
|
let sel, key, elm;
|
|
4455
4455
|
return {
|
|
4456
|
-
type: 0 /* Text */,
|
|
4456
|
+
type: 0 /* VNodeType.Text */,
|
|
4457
4457
|
sel,
|
|
4458
4458
|
text,
|
|
4459
4459
|
elm,
|
|
@@ -4465,7 +4465,7 @@
|
|
|
4465
4465
|
function co(text) {
|
|
4466
4466
|
let sel, key, elm;
|
|
4467
4467
|
return {
|
|
4468
|
-
type: 1 /* Comment */,
|
|
4468
|
+
type: 1 /* VNodeType.Comment */,
|
|
4469
4469
|
sel,
|
|
4470
4470
|
text,
|
|
4471
4471
|
elm,
|
|
@@ -4514,7 +4514,7 @@
|
|
|
4514
4514
|
return null;
|
|
4515
4515
|
}
|
|
4516
4516
|
const { idx, shadowMode } = vmBeingRendered;
|
|
4517
|
-
if (shadowMode === 1 /* Synthetic */) {
|
|
4517
|
+
if (shadowMode === 1 /* ShadowMode.Synthetic */) {
|
|
4518
4518
|
return StringReplace.call(id, /\S+/g, (id) => `${id}-${idx}`);
|
|
4519
4519
|
}
|
|
4520
4520
|
return id;
|
|
@@ -4536,7 +4536,7 @@
|
|
|
4536
4536
|
}
|
|
4537
4537
|
const { idx, shadowMode } = vmBeingRendered;
|
|
4538
4538
|
// Apply transformation only for fragment-only-urls, and only in shadow DOM
|
|
4539
|
-
if (shadowMode === 1 /* Synthetic */ && /^#/.test(url)) {
|
|
4539
|
+
if (shadowMode === 1 /* ShadowMode.Synthetic */ && /^#/.test(url)) {
|
|
4540
4540
|
return `${url}-${idx}`;
|
|
4541
4541
|
}
|
|
4542
4542
|
return url;
|
|
@@ -4659,7 +4659,7 @@
|
|
|
4659
4659
|
function updateStylesheetToken(vm, template) {
|
|
4660
4660
|
const { elm, context, renderMode, shadowMode, renderer: { getClassList, removeAttribute, setAttribute }, } = vm;
|
|
4661
4661
|
const { stylesheets: newStylesheets, stylesheetToken: newStylesheetToken } = template;
|
|
4662
|
-
const isSyntheticShadow = renderMode === 1 /* Shadow */ && shadowMode === 1 /* Synthetic */;
|
|
4662
|
+
const isSyntheticShadow = renderMode === 1 /* RenderMode.Shadow */ && shadowMode === 1 /* ShadowMode.Synthetic */;
|
|
4663
4663
|
const { hasScopedStyles } = context;
|
|
4664
4664
|
let newToken;
|
|
4665
4665
|
let newHasTokenInClass;
|
|
@@ -4715,19 +4715,19 @@
|
|
|
4715
4715
|
const isScopedCss = stylesheet[KEY__SCOPED_CSS];
|
|
4716
4716
|
// Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
|
|
4717
4717
|
const scopeToken = isScopedCss ||
|
|
4718
|
-
(vm.shadowMode === 1 /* Synthetic */ && vm.renderMode === 1 /* Shadow */)
|
|
4718
|
+
(vm.shadowMode === 1 /* ShadowMode.Synthetic */ && vm.renderMode === 1 /* RenderMode.Shadow */)
|
|
4719
4719
|
? stylesheetToken
|
|
4720
4720
|
: undefined;
|
|
4721
4721
|
// Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
|
|
4722
4722
|
// native shadow DOM. Synthetic shadow DOM never uses `:host`.
|
|
4723
|
-
const useActualHostSelector = vm.renderMode === 0 /* Light */
|
|
4723
|
+
const useActualHostSelector = vm.renderMode === 0 /* RenderMode.Light */
|
|
4724
4724
|
? !isScopedCss
|
|
4725
|
-
: vm.shadowMode === 0 /* Native */;
|
|
4725
|
+
: vm.shadowMode === 0 /* ShadowMode.Native */;
|
|
4726
4726
|
// Use the native :dir() pseudoclass only in native shadow DOM. Otherwise, in synthetic shadow,
|
|
4727
4727
|
// we use an attribute selector on the host to simulate :dir().
|
|
4728
4728
|
let useNativeDirPseudoclass;
|
|
4729
|
-
if (vm.renderMode === 1 /* Shadow */) {
|
|
4730
|
-
useNativeDirPseudoclass = vm.shadowMode === 0 /* Native */;
|
|
4729
|
+
if (vm.renderMode === 1 /* RenderMode.Shadow */) {
|
|
4730
|
+
useNativeDirPseudoclass = vm.shadowMode === 0 /* ShadowMode.Native */;
|
|
4731
4731
|
}
|
|
4732
4732
|
else {
|
|
4733
4733
|
// Light DOM components should only render `[dir]` if they're inside of a synthetic shadow root.
|
|
@@ -4736,7 +4736,7 @@
|
|
|
4736
4736
|
// Only calculate the root once as necessary
|
|
4737
4737
|
root = getNearestShadowComponent(vm);
|
|
4738
4738
|
}
|
|
4739
|
-
useNativeDirPseudoclass = isNull(root) || root.shadowMode === 0 /* Native */;
|
|
4739
|
+
useNativeDirPseudoclass = isNull(root) || root.shadowMode === 0 /* ShadowMode.Native */;
|
|
4740
4740
|
}
|
|
4741
4741
|
ArrayPush$1.call(content, stylesheet(scopeToken, useActualHostSelector, useNativeDirPseudoclass));
|
|
4742
4742
|
}
|
|
@@ -4757,7 +4757,7 @@
|
|
|
4757
4757
|
function getNearestShadowComponent(vm) {
|
|
4758
4758
|
let owner = vm;
|
|
4759
4759
|
while (!isNull(owner)) {
|
|
4760
|
-
if (owner.renderMode === 1 /* Shadow */) {
|
|
4760
|
+
if (owner.renderMode === 1 /* RenderMode.Shadow */) {
|
|
4761
4761
|
return owner;
|
|
4762
4762
|
}
|
|
4763
4763
|
owner = owner.owner;
|
|
@@ -4766,7 +4766,7 @@
|
|
|
4766
4766
|
}
|
|
4767
4767
|
function getNearestNativeShadowComponent(vm) {
|
|
4768
4768
|
const owner = getNearestShadowComponent(vm);
|
|
4769
|
-
if (!isNull(owner) && owner.shadowMode === 1 /* Synthetic */) {
|
|
4769
|
+
if (!isNull(owner) && owner.shadowMode === 1 /* ShadowMode.Synthetic */) {
|
|
4770
4770
|
// Synthetic-within-native is impossible. So if the nearest shadow component is
|
|
4771
4771
|
// synthetic, we know we won't find a native component if we go any further.
|
|
4772
4772
|
return null;
|
|
@@ -4775,7 +4775,7 @@
|
|
|
4775
4775
|
}
|
|
4776
4776
|
function createStylesheet(vm, stylesheets) {
|
|
4777
4777
|
const { renderMode, shadowMode, renderer: { ssr, insertStylesheet }, } = vm;
|
|
4778
|
-
if (renderMode === 1 /* Shadow */ && shadowMode === 1 /* Synthetic */) {
|
|
4778
|
+
if (renderMode === 1 /* RenderMode.Shadow */ && shadowMode === 1 /* ShadowMode.Synthetic */) {
|
|
4779
4779
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
4780
4780
|
insertStylesheet(stylesheets[i]);
|
|
4781
4781
|
}
|
|
@@ -4878,7 +4878,7 @@
|
|
|
4878
4878
|
start(markName);
|
|
4879
4879
|
}
|
|
4880
4880
|
if (isProfilerEnabled) {
|
|
4881
|
-
currentDispatcher(opId, 0 /* Start */, vm.tagName, vm.idx, vm.renderMode, vm.shadowMode);
|
|
4881
|
+
currentDispatcher(opId, 0 /* Phase.Start */, vm.tagName, vm.idx, vm.renderMode, vm.shadowMode);
|
|
4882
4882
|
}
|
|
4883
4883
|
}
|
|
4884
4884
|
function logOperationEnd(opId, vm) {
|
|
@@ -4888,7 +4888,7 @@
|
|
|
4888
4888
|
end(measureName, markName);
|
|
4889
4889
|
}
|
|
4890
4890
|
if (isProfilerEnabled) {
|
|
4891
|
-
currentDispatcher(opId, 1 /* Stop */, vm.tagName, vm.idx, vm.renderMode, vm.shadowMode);
|
|
4891
|
+
currentDispatcher(opId, 1 /* Phase.Stop */, vm.tagName, vm.idx, vm.renderMode, vm.shadowMode);
|
|
4892
4892
|
}
|
|
4893
4893
|
}
|
|
4894
4894
|
function logGlobalOperationStart(opId, vm) {
|
|
@@ -4898,7 +4898,7 @@
|
|
|
4898
4898
|
start(markName);
|
|
4899
4899
|
}
|
|
4900
4900
|
if (isProfilerEnabled) {
|
|
4901
|
-
currentDispatcher(opId, 0 /* Start */, vm === null || vm === void 0 ? void 0 : vm.tagName, vm === null || vm === void 0 ? void 0 : vm.idx, vm === null || vm === void 0 ? void 0 : vm.renderMode, vm === null || vm === void 0 ? void 0 : vm.shadowMode);
|
|
4901
|
+
currentDispatcher(opId, 0 /* Phase.Start */, vm === null || vm === void 0 ? void 0 : vm.tagName, vm === null || vm === void 0 ? void 0 : vm.idx, vm === null || vm === void 0 ? void 0 : vm.renderMode, vm === null || vm === void 0 ? void 0 : vm.shadowMode);
|
|
4902
4902
|
}
|
|
4903
4903
|
}
|
|
4904
4904
|
function logGlobalOperationEnd(opId, vm) {
|
|
@@ -4908,7 +4908,7 @@
|
|
|
4908
4908
|
end(opName, markName);
|
|
4909
4909
|
}
|
|
4910
4910
|
if (isProfilerEnabled) {
|
|
4911
|
-
currentDispatcher(opId, 1 /* Stop */, vm === null || vm === void 0 ? void 0 : vm.tagName, vm === null || vm === void 0 ? void 0 : vm.idx, vm === null || vm === void 0 ? void 0 : vm.renderMode, vm === null || vm === void 0 ? void 0 : vm.shadowMode);
|
|
4911
|
+
currentDispatcher(opId, 1 /* Phase.Stop */, vm === null || vm === void 0 ? void 0 : vm.tagName, vm === null || vm === void 0 ? void 0 : vm.idx, vm === null || vm === void 0 ? void 0 : vm.renderMode, vm === null || vm === void 0 ? void 0 : vm.shadowMode);
|
|
4912
4912
|
}
|
|
4913
4913
|
}
|
|
4914
4914
|
|
|
@@ -4934,11 +4934,11 @@
|
|
|
4934
4934
|
const { cmpSlots } = vm;
|
|
4935
4935
|
const { slots = EmptyArray } = html;
|
|
4936
4936
|
for (const slotName in cmpSlots) {
|
|
4937
|
-
// eslint-disable-next-line lwc-internal/no-production-assert
|
|
4937
|
+
// eslint-disable-next-line @lwc/lwc-internal/no-production-assert
|
|
4938
4938
|
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}.`);
|
|
4939
4939
|
if (slotName !== '' && ArrayIndexOf.call(slots, slotName) === -1) {
|
|
4940
4940
|
// TODO [#1297]: this should never really happen because the compiler should always validate
|
|
4941
|
-
// eslint-disable-next-line lwc-internal/no-production-assert
|
|
4941
|
+
// eslint-disable-next-line @lwc/lwc-internal/no-production-assert
|
|
4942
4942
|
logError(`Ignoring unknown provided slot name "${slotName}" in ${vm}. Check for a typo on the slot attribute.`, vm);
|
|
4943
4943
|
}
|
|
4944
4944
|
}
|
|
@@ -4946,7 +4946,7 @@
|
|
|
4946
4946
|
function validateLightDomTemplate(template, vm) {
|
|
4947
4947
|
if (template === defaultEmptyTemplate)
|
|
4948
4948
|
return;
|
|
4949
|
-
if (vm.renderMode === 0 /* Light */) {
|
|
4949
|
+
if (vm.renderMode === 0 /* RenderMode.Light */) {
|
|
4950
4950
|
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)}.`);
|
|
4951
4951
|
}
|
|
4952
4952
|
else {
|
|
@@ -4959,13 +4959,13 @@
|
|
|
4959
4959
|
return function () {
|
|
4960
4960
|
const { context: { hasScopedStyles, stylesheetToken }, shadowMode, renderer, } = getVMBeingRendered();
|
|
4961
4961
|
const hasStyleToken = !isUndefined$1(stylesheetToken);
|
|
4962
|
-
const isSyntheticShadow = shadowMode === 1 /* Synthetic */;
|
|
4962
|
+
const isSyntheticShadow = shadowMode === 1 /* ShadowMode.Synthetic */;
|
|
4963
4963
|
let cacheKey = 0;
|
|
4964
4964
|
if (hasStyleToken && hasScopedStyles) {
|
|
4965
|
-
cacheKey |= 1 /* HAS_SCOPED_STYLE */;
|
|
4965
|
+
cacheKey |= 1 /* FragmentCache.HAS_SCOPED_STYLE */;
|
|
4966
4966
|
}
|
|
4967
4967
|
if (hasStyleToken && isSyntheticShadow) {
|
|
4968
|
-
cacheKey |= 2 /* SHADOW_MODE_SYNTHETIC */;
|
|
4968
|
+
cacheKey |= 2 /* FragmentCache.SHADOW_MODE_SYNTHETIC */;
|
|
4969
4969
|
}
|
|
4970
4970
|
if (!isUndefined$1(cache[cacheKey])) {
|
|
4971
4971
|
return cache[cacheKey];
|
|
@@ -5020,7 +5020,7 @@
|
|
|
5020
5020
|
runWithBoundaryProtection(vm, vm.owner, () => {
|
|
5021
5021
|
// pre
|
|
5022
5022
|
vmBeingRendered = vm;
|
|
5023
|
-
logOperationStart(1 /* Render */, vm);
|
|
5023
|
+
logOperationStart(1 /* OperationId.Render */, vm);
|
|
5024
5024
|
}, () => {
|
|
5025
5025
|
// job
|
|
5026
5026
|
const { component, context, cmpSlots, cmpTemplate, tro } = vm;
|
|
@@ -5078,7 +5078,7 @@
|
|
|
5078
5078
|
// post
|
|
5079
5079
|
isUpdatingTemplate = isUpdatingTemplateInception;
|
|
5080
5080
|
vmBeingRendered = vmOfTemplateBeingUpdatedInception;
|
|
5081
|
-
logOperationEnd(1 /* Render */, vm);
|
|
5081
|
+
logOperationEnd(1 /* OperationId.Render */, vm);
|
|
5082
5082
|
});
|
|
5083
5083
|
if (process.env.NODE_ENV !== 'production') {
|
|
5084
5084
|
assert.invariant(isArray$1(vnodes), `Compiler should produce html functions that always return an array.`);
|
|
@@ -5117,7 +5117,7 @@
|
|
|
5117
5117
|
function invokeComponentConstructor(vm, Ctor) {
|
|
5118
5118
|
const vmBeingConstructedInception = vmBeingConstructed;
|
|
5119
5119
|
let error;
|
|
5120
|
-
logOperationStart(0 /* Constructor */, vm);
|
|
5120
|
+
logOperationStart(0 /* OperationId.Constructor */, vm);
|
|
5121
5121
|
vmBeingConstructed = vm;
|
|
5122
5122
|
/**
|
|
5123
5123
|
* Constructors don't need to be wrapped with a boundary because for root elements
|
|
@@ -5139,7 +5139,7 @@
|
|
|
5139
5139
|
error = Object(e);
|
|
5140
5140
|
}
|
|
5141
5141
|
finally {
|
|
5142
|
-
logOperationEnd(0 /* Constructor */, vm);
|
|
5142
|
+
logOperationEnd(0 /* OperationId.Constructor */, vm);
|
|
5143
5143
|
vmBeingConstructed = vmBeingConstructedInception;
|
|
5144
5144
|
if (!isUndefined$1(error)) {
|
|
5145
5145
|
addErrorComponentStack(vm, error);
|
|
@@ -5320,12 +5320,12 @@
|
|
|
5320
5320
|
function connectRootElement(elm) {
|
|
5321
5321
|
const vm = getAssociatedVM(elm);
|
|
5322
5322
|
logGlobalOperationStart(7
|
|
5323
|
-
/* GlobalHydrate */
|
|
5323
|
+
/* OperationId.GlobalHydrate */
|
|
5324
5324
|
, vm); // Usually means moving the element from one place to another, which is observable via
|
|
5325
5325
|
// life-cycle hooks.
|
|
5326
5326
|
|
|
5327
5327
|
if (vm.state === 1
|
|
5328
|
-
/* connected */
|
|
5328
|
+
/* VMState.connected */
|
|
5329
5329
|
) {
|
|
5330
5330
|
disconnectRootElement(elm);
|
|
5331
5331
|
}
|
|
@@ -5333,7 +5333,7 @@
|
|
|
5333
5333
|
runConnectedCallback(vm);
|
|
5334
5334
|
rehydrate(vm);
|
|
5335
5335
|
logGlobalOperationEnd(7
|
|
5336
|
-
/* GlobalHydrate */
|
|
5336
|
+
/* OperationId.GlobalHydrate */
|
|
5337
5337
|
, vm);
|
|
5338
5338
|
}
|
|
5339
5339
|
function disconnectRootElement(elm) {
|
|
@@ -5351,7 +5351,7 @@
|
|
|
5351
5351
|
} = vm;
|
|
5352
5352
|
|
|
5353
5353
|
if (state !== 2
|
|
5354
|
-
/* disconnected */
|
|
5354
|
+
/* VMState.disconnected */
|
|
5355
5355
|
) {
|
|
5356
5356
|
const {
|
|
5357
5357
|
oar,
|
|
@@ -5380,9 +5380,9 @@
|
|
|
5380
5380
|
function removeVM(vm) {
|
|
5381
5381
|
if (process.env.NODE_ENV !== 'production') {
|
|
5382
5382
|
assert.isTrue(vm.state === 1
|
|
5383
|
-
/* connected */
|
|
5383
|
+
/* VMState.connected */
|
|
5384
5384
|
|| vm.state === 2
|
|
5385
|
-
/* disconnected */
|
|
5385
|
+
/* VMState.disconnected */
|
|
5386
5386
|
, `${vm} must have been connected.`);
|
|
5387
5387
|
}
|
|
5388
5388
|
|
|
@@ -5393,7 +5393,7 @@
|
|
|
5393
5393
|
let ancestor = vm.owner;
|
|
5394
5394
|
|
|
5395
5395
|
while (!isNull(ancestor) && ancestor.renderMode === 0
|
|
5396
|
-
/* Light */
|
|
5396
|
+
/* RenderMode.Light */
|
|
5397
5397
|
) {
|
|
5398
5398
|
ancestor = ancestor.owner;
|
|
5399
5399
|
}
|
|
@@ -5414,7 +5414,7 @@
|
|
|
5414
5414
|
def,
|
|
5415
5415
|
idx: idx++,
|
|
5416
5416
|
state: 0
|
|
5417
|
-
/* created */
|
|
5417
|
+
/* VMState.created */
|
|
5418
5418
|
,
|
|
5419
5419
|
isScheduled: false,
|
|
5420
5420
|
isDirty: true,
|
|
@@ -5463,7 +5463,7 @@
|
|
|
5463
5463
|
|
|
5464
5464
|
if (runtimeFlags.ENABLE_FORCE_NATIVE_SHADOW_MODE_FOR_TEST) {
|
|
5465
5465
|
vm.shadowMode = 0
|
|
5466
|
-
/* Native */
|
|
5466
|
+
/* ShadowMode.Native */
|
|
5467
5467
|
;
|
|
5468
5468
|
}
|
|
5469
5469
|
} // Create component instance associated to the vm and the element.
|
|
@@ -5490,57 +5490,57 @@
|
|
|
5490
5490
|
|
|
5491
5491
|
if (isSyntheticShadowDefined) {
|
|
5492
5492
|
if (def.renderMode === 0
|
|
5493
|
-
/* Light */
|
|
5493
|
+
/* RenderMode.Light */
|
|
5494
5494
|
) {
|
|
5495
5495
|
// ShadowMode.Native implies "not synthetic shadow" which is consistent with how
|
|
5496
5496
|
// everything defaults to native when the synthetic shadow polyfill is unavailable.
|
|
5497
5497
|
shadowMode = 0
|
|
5498
|
-
/* Native */
|
|
5498
|
+
/* ShadowMode.Native */
|
|
5499
5499
|
;
|
|
5500
5500
|
} else if (isNativeShadowDefined) {
|
|
5501
5501
|
// Not combined with above condition because @lwc/features only supports identifiers in
|
|
5502
5502
|
// the if-condition.
|
|
5503
5503
|
if (runtimeFlags.ENABLE_MIXED_SHADOW_MODE) {
|
|
5504
5504
|
if (def.shadowSupportMode === "any"
|
|
5505
|
-
/* Any */
|
|
5505
|
+
/* ShadowSupportMode.Any */
|
|
5506
5506
|
) {
|
|
5507
5507
|
shadowMode = 0
|
|
5508
|
-
/* Native */
|
|
5508
|
+
/* ShadowMode.Native */
|
|
5509
5509
|
;
|
|
5510
5510
|
} else {
|
|
5511
5511
|
const shadowAncestor = getNearestShadowAncestor(vm);
|
|
5512
5512
|
|
|
5513
5513
|
if (!isNull(shadowAncestor) && shadowAncestor.shadowMode === 0
|
|
5514
|
-
/* Native */
|
|
5514
|
+
/* ShadowMode.Native */
|
|
5515
5515
|
) {
|
|
5516
5516
|
// Transitive support for native Shadow DOM. A component in native mode
|
|
5517
5517
|
// transitively opts all of its descendants into native.
|
|
5518
5518
|
shadowMode = 0
|
|
5519
|
-
/* Native */
|
|
5519
|
+
/* ShadowMode.Native */
|
|
5520
5520
|
;
|
|
5521
5521
|
} else {
|
|
5522
5522
|
// Synthetic if neither this component nor any of its ancestors are configured
|
|
5523
5523
|
// to be native.
|
|
5524
5524
|
shadowMode = 1
|
|
5525
|
-
/* Synthetic */
|
|
5525
|
+
/* ShadowMode.Synthetic */
|
|
5526
5526
|
;
|
|
5527
5527
|
}
|
|
5528
5528
|
}
|
|
5529
5529
|
} else {
|
|
5530
5530
|
shadowMode = 1
|
|
5531
|
-
/* Synthetic */
|
|
5531
|
+
/* ShadowMode.Synthetic */
|
|
5532
5532
|
;
|
|
5533
5533
|
}
|
|
5534
5534
|
} else {
|
|
5535
5535
|
// Synthetic if there is no native Shadow DOM support.
|
|
5536
5536
|
shadowMode = 1
|
|
5537
|
-
/* Synthetic */
|
|
5537
|
+
/* ShadowMode.Synthetic */
|
|
5538
5538
|
;
|
|
5539
5539
|
}
|
|
5540
5540
|
} else {
|
|
5541
5541
|
// Native if the synthetic shadow polyfill is unavailable.
|
|
5542
5542
|
shadowMode = 0
|
|
5543
|
-
/* Native */
|
|
5543
|
+
/* ShadowMode.Native */
|
|
5544
5544
|
;
|
|
5545
5545
|
}
|
|
5546
5546
|
|
|
@@ -5600,7 +5600,7 @@
|
|
|
5600
5600
|
runWithBoundaryProtection(vm, vm, () => {
|
|
5601
5601
|
// pre
|
|
5602
5602
|
logOperationStart(2
|
|
5603
|
-
/* Patch */
|
|
5603
|
+
/* OperationId.Patch */
|
|
5604
5604
|
, vm);
|
|
5605
5605
|
}, () => {
|
|
5606
5606
|
// job
|
|
@@ -5608,14 +5608,14 @@
|
|
|
5608
5608
|
}, () => {
|
|
5609
5609
|
// post
|
|
5610
5610
|
logOperationEnd(2
|
|
5611
|
-
/* Patch */
|
|
5611
|
+
/* OperationId.Patch */
|
|
5612
5612
|
, vm);
|
|
5613
5613
|
});
|
|
5614
5614
|
}
|
|
5615
5615
|
}
|
|
5616
5616
|
|
|
5617
5617
|
if (vm.state === 1
|
|
5618
|
-
/* connected */
|
|
5618
|
+
/* VMState.connected */
|
|
5619
5619
|
) {
|
|
5620
5620
|
// If the element is connected, that means connectedCallback was already issued, and
|
|
5621
5621
|
// any successive rendering should finish with the call to renderedCallback, otherwise
|
|
@@ -5649,11 +5649,11 @@
|
|
|
5649
5649
|
|
|
5650
5650
|
if (!isUndefined$1(renderedCallback)) {
|
|
5651
5651
|
logOperationStart(4
|
|
5652
|
-
/* RenderedCallback */
|
|
5652
|
+
/* OperationId.RenderedCallback */
|
|
5653
5653
|
, vm);
|
|
5654
5654
|
invokeComponentCallback(vm, renderedCallback);
|
|
5655
5655
|
logOperationEnd(4
|
|
5656
|
-
/* RenderedCallback */
|
|
5656
|
+
/* OperationId.RenderedCallback */
|
|
5657
5657
|
, vm);
|
|
5658
5658
|
}
|
|
5659
5659
|
}
|
|
@@ -5661,7 +5661,7 @@
|
|
|
5661
5661
|
|
|
5662
5662
|
function flushRehydrationQueue() {
|
|
5663
5663
|
logGlobalOperationStart(8
|
|
5664
|
-
/* GlobalRehydrate */
|
|
5664
|
+
/* OperationId.GlobalRehydrate */
|
|
5665
5665
|
);
|
|
5666
5666
|
|
|
5667
5667
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -5688,7 +5688,7 @@
|
|
|
5688
5688
|
|
|
5689
5689
|
|
|
5690
5690
|
logGlobalOperationEnd(8
|
|
5691
|
-
/* GlobalRehydrate */
|
|
5691
|
+
/* OperationId.GlobalRehydrate */
|
|
5692
5692
|
); // re-throwing the original error will break the current tick, but since the next tick is
|
|
5693
5693
|
// already scheduled, it should continue patching the rest.
|
|
5694
5694
|
|
|
@@ -5697,7 +5697,7 @@
|
|
|
5697
5697
|
}
|
|
5698
5698
|
|
|
5699
5699
|
logGlobalOperationEnd(8
|
|
5700
|
-
/* GlobalRehydrate */
|
|
5700
|
+
/* OperationId.GlobalRehydrate */
|
|
5701
5701
|
);
|
|
5702
5702
|
}
|
|
5703
5703
|
|
|
@@ -5707,13 +5707,13 @@
|
|
|
5707
5707
|
} = vm;
|
|
5708
5708
|
|
|
5709
5709
|
if (state === 1
|
|
5710
|
-
/* connected */
|
|
5710
|
+
/* VMState.connected */
|
|
5711
5711
|
) {
|
|
5712
5712
|
return; // nothing to do since it was already connected
|
|
5713
5713
|
}
|
|
5714
5714
|
|
|
5715
5715
|
vm.state = 1
|
|
5716
|
-
/* connected */
|
|
5716
|
+
/* VMState.connected */
|
|
5717
5717
|
; // reporting connection
|
|
5718
5718
|
|
|
5719
5719
|
const {
|
|
@@ -5734,11 +5734,11 @@
|
|
|
5734
5734
|
|
|
5735
5735
|
if (!isUndefined$1(connectedCallback)) {
|
|
5736
5736
|
logOperationStart(3
|
|
5737
|
-
/* ConnectedCallback */
|
|
5737
|
+
/* OperationId.ConnectedCallback */
|
|
5738
5738
|
, vm);
|
|
5739
5739
|
invokeComponentCallback(vm, connectedCallback);
|
|
5740
5740
|
logOperationEnd(3
|
|
5741
|
-
/* ConnectedCallback */
|
|
5741
|
+
/* OperationId.ConnectedCallback */
|
|
5742
5742
|
, vm);
|
|
5743
5743
|
}
|
|
5744
5744
|
}
|
|
@@ -5750,7 +5750,7 @@
|
|
|
5750
5750
|
function runDisconnectedCallback(vm) {
|
|
5751
5751
|
if (process.env.NODE_ENV !== 'production') {
|
|
5752
5752
|
assert.isTrue(vm.state !== 2
|
|
5753
|
-
/* disconnected */
|
|
5753
|
+
/* VMState.disconnected */
|
|
5754
5754
|
, `${vm} must be inserted.`);
|
|
5755
5755
|
}
|
|
5756
5756
|
|
|
@@ -5763,7 +5763,7 @@
|
|
|
5763
5763
|
}
|
|
5764
5764
|
|
|
5765
5765
|
vm.state = 2
|
|
5766
|
-
/* disconnected */
|
|
5766
|
+
/* VMState.disconnected */
|
|
5767
5767
|
; // reporting disconnection
|
|
5768
5768
|
|
|
5769
5769
|
const {
|
|
@@ -5784,11 +5784,11 @@
|
|
|
5784
5784
|
|
|
5785
5785
|
if (!isUndefined$1(disconnectedCallback)) {
|
|
5786
5786
|
logOperationStart(5
|
|
5787
|
-
/* DisconnectedCallback */
|
|
5787
|
+
/* OperationId.DisconnectedCallback */
|
|
5788
5788
|
, vm);
|
|
5789
5789
|
invokeComponentCallback(vm, disconnectedCallback);
|
|
5790
5790
|
logOperationEnd(5
|
|
5791
|
-
/* DisconnectedCallback */
|
|
5791
|
+
/* OperationId.DisconnectedCallback */
|
|
5792
5792
|
, vm);
|
|
5793
5793
|
}
|
|
5794
5794
|
}
|
|
@@ -5844,13 +5844,13 @@
|
|
|
5844
5844
|
if (!isNull(vnode) && !isUndefined$1(vnode.elm)) {
|
|
5845
5845
|
switch (vnode.type) {
|
|
5846
5846
|
case 2
|
|
5847
|
-
/* Element */
|
|
5847
|
+
/* VNodeType.Element */
|
|
5848
5848
|
:
|
|
5849
5849
|
recursivelyDisconnectChildren(vnode.children);
|
|
5850
5850
|
break;
|
|
5851
5851
|
|
|
5852
5852
|
case 3
|
|
5853
|
-
/* CustomElement */
|
|
5853
|
+
/* VNodeType.CustomElement */
|
|
5854
5854
|
:
|
|
5855
5855
|
{
|
|
5856
5856
|
const vm = getAssociatedVM(vnode.elm);
|
|
@@ -5941,13 +5941,13 @@
|
|
|
5941
5941
|
resetComponentRoot(vm); // remove offenders
|
|
5942
5942
|
|
|
5943
5943
|
logOperationStart(6
|
|
5944
|
-
/* ErrorCallback */
|
|
5944
|
+
/* OperationId.ErrorCallback */
|
|
5945
5945
|
, vm); // error boundaries must have an ErrorCallback
|
|
5946
5946
|
|
|
5947
5947
|
const errorCallback = errorBoundaryVm.def.errorCallback;
|
|
5948
5948
|
invokeComponentCallback(errorBoundaryVm, errorCallback, [error, error.wcStack]);
|
|
5949
5949
|
logOperationEnd(6
|
|
5950
|
-
/* ErrorCallback */
|
|
5950
|
+
/* OperationId.ErrorCallback */
|
|
5951
5951
|
, vm);
|
|
5952
5952
|
}
|
|
5953
5953
|
}
|
|
@@ -6042,7 +6042,7 @@
|
|
|
6042
6042
|
|
|
6043
6043
|
const computeConfigAndUpdate = () => {
|
|
6044
6044
|
let config;
|
|
6045
|
-
ro.observe(() => config = configCallback(component)); // eslint-disable-next-line lwc-internal/no-invalid-todo
|
|
6045
|
+
ro.observe(() => config = configCallback(component)); // eslint-disable-next-line @lwc/lwc-internal/no-invalid-todo
|
|
6046
6046
|
// TODO: dev-mode validation of config based on the adapter.configSchema
|
|
6047
6047
|
// @ts-ignore it is assigned in the observe() callback
|
|
6048
6048
|
|
|
@@ -6084,7 +6084,7 @@
|
|
|
6084
6084
|
// guarantee that the linkage can be forged.
|
|
6085
6085
|
const contextRegistrationEvent = new WireContextRegistrationEvent(adapterContextToken, {
|
|
6086
6086
|
setNewContext(newContext) {
|
|
6087
|
-
// eslint-disable-next-line lwc-internal/no-invalid-todo
|
|
6087
|
+
// eslint-disable-next-line @lwc/lwc-internal/no-invalid-todo
|
|
6088
6088
|
// TODO: dev-mode validation of config based on the adapter.contextSchema
|
|
6089
6089
|
callbackWhenContextIsReady(newContext);
|
|
6090
6090
|
},
|
|
@@ -6148,7 +6148,7 @@
|
|
|
6148
6148
|
// (ever), while context can have identity
|
|
6149
6149
|
|
|
6150
6150
|
if (vm.state === 1
|
|
6151
|
-
/* connected */
|
|
6151
|
+
/* VMState.connected */
|
|
6152
6152
|
) {
|
|
6153
6153
|
computeConfigAndUpdate();
|
|
6154
6154
|
}
|
|
@@ -6352,22 +6352,22 @@
|
|
|
6352
6352
|
var _a, _b;
|
|
6353
6353
|
let hydratedNode;
|
|
6354
6354
|
switch (vnode.type) {
|
|
6355
|
-
case 0 /* Text */:
|
|
6355
|
+
case 0 /* VNodeType.Text */:
|
|
6356
6356
|
// VText has no special capability, fallback to the owner's renderer
|
|
6357
6357
|
hydratedNode = hydrateText(node, vnode, renderer);
|
|
6358
6358
|
break;
|
|
6359
|
-
case 1 /* Comment */:
|
|
6359
|
+
case 1 /* VNodeType.Comment */:
|
|
6360
6360
|
// VComment has no special capability, fallback to the owner's renderer
|
|
6361
6361
|
hydratedNode = hydrateComment(node, vnode, renderer);
|
|
6362
6362
|
break;
|
|
6363
|
-
case 4 /* Static */:
|
|
6363
|
+
case 4 /* VNodeType.Static */:
|
|
6364
6364
|
// VStatic are cacheable and cannot have custom renderer associated to them
|
|
6365
6365
|
hydratedNode = hydrateStaticElement(node, vnode, renderer);
|
|
6366
6366
|
break;
|
|
6367
|
-
case 2 /* Element */:
|
|
6367
|
+
case 2 /* VNodeType.Element */:
|
|
6368
6368
|
hydratedNode = hydrateElement(node, vnode, (_a = vnode.data.renderer) !== null && _a !== void 0 ? _a : renderer);
|
|
6369
6369
|
break;
|
|
6370
|
-
case 3 /* CustomElement */:
|
|
6370
|
+
case 3 /* VNodeType.CustomElement */:
|
|
6371
6371
|
hydratedNode = hydrateCustomElement(node, vnode, (_b = vnode.data.renderer) !== null && _b !== void 0 ? _b : renderer);
|
|
6372
6372
|
break;
|
|
6373
6373
|
}
|
|
@@ -6375,7 +6375,7 @@
|
|
|
6375
6375
|
}
|
|
6376
6376
|
function hydrateText(node, vnode, renderer) {
|
|
6377
6377
|
var _a;
|
|
6378
|
-
if (!hasCorrectNodeType(vnode, node, 3 /* TEXT */, renderer)) {
|
|
6378
|
+
if (!hasCorrectNodeType(vnode, node, 3 /* EnvNodeTypes.TEXT */, renderer)) {
|
|
6379
6379
|
return handleMismatch(node, vnode, renderer);
|
|
6380
6380
|
}
|
|
6381
6381
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -6392,7 +6392,7 @@
|
|
|
6392
6392
|
}
|
|
6393
6393
|
function hydrateComment(node, vnode, renderer) {
|
|
6394
6394
|
var _a;
|
|
6395
|
-
if (!hasCorrectNodeType(vnode, node, 8 /* COMMENT */, renderer)) {
|
|
6395
|
+
if (!hasCorrectNodeType(vnode, node, 8 /* EnvNodeTypes.COMMENT */, renderer)) {
|
|
6396
6396
|
return handleMismatch(node, vnode, renderer);
|
|
6397
6397
|
}
|
|
6398
6398
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -6415,14 +6415,14 @@
|
|
|
6415
6415
|
return elm;
|
|
6416
6416
|
}
|
|
6417
6417
|
function hydrateElement(elm, vnode, renderer) {
|
|
6418
|
-
if (!hasCorrectNodeType(vnode, elm, 1 /* ELEMENT */, renderer) ||
|
|
6418
|
+
if (!hasCorrectNodeType(vnode, elm, 1 /* EnvNodeTypes.ELEMENT */, renderer) ||
|
|
6419
6419
|
!isMatchingElement(vnode, elm, renderer)) {
|
|
6420
6420
|
return handleMismatch(elm, vnode, renderer);
|
|
6421
6421
|
}
|
|
6422
6422
|
vnode.elm = elm;
|
|
6423
6423
|
const { owner } = vnode;
|
|
6424
6424
|
const { context } = vnode.data;
|
|
6425
|
-
const isDomManual = Boolean(!isUndefined$1(context) && !isUndefined$1(context.lwc) && context.lwc.dom === "manual" /* Manual */);
|
|
6425
|
+
const isDomManual = Boolean(!isUndefined$1(context) && !isUndefined$1(context.lwc) && context.lwc.dom === "manual" /* LwcDomMode.Manual */);
|
|
6426
6426
|
if (isDomManual) {
|
|
6427
6427
|
// it may be that this element has lwc:inner-html, we need to diff and in case are the same,
|
|
6428
6428
|
// remove the innerHTML from props so it reuses the existing dom elements.
|
|
@@ -6448,7 +6448,7 @@
|
|
|
6448
6448
|
return elm;
|
|
6449
6449
|
}
|
|
6450
6450
|
function hydrateCustomElement(elm, vnode, renderer) {
|
|
6451
|
-
if (!hasCorrectNodeType(vnode, elm, 1 /* ELEMENT */, renderer) ||
|
|
6451
|
+
if (!hasCorrectNodeType(vnode, elm, 1 /* EnvNodeTypes.ELEMENT */, renderer) ||
|
|
6452
6452
|
!isMatchingElement(vnode, elm, renderer)) {
|
|
6453
6453
|
return handleMismatch(elm, vnode, renderer);
|
|
6454
6454
|
}
|
|
@@ -6465,10 +6465,10 @@
|
|
|
6465
6465
|
patchElementPropsAndAttrs(vnode, renderer);
|
|
6466
6466
|
// Insert hook section:
|
|
6467
6467
|
if (process.env.NODE_ENV !== 'production') {
|
|
6468
|
-
assert.isTrue(vm.state === 0 /* created */, `${vm} cannot be recycled.`);
|
|
6468
|
+
assert.isTrue(vm.state === 0 /* VMState.created */, `${vm} cannot be recycled.`);
|
|
6469
6469
|
}
|
|
6470
6470
|
runConnectedCallback(vm);
|
|
6471
|
-
if (vm.renderMode !== 0 /* Light */) {
|
|
6471
|
+
if (vm.renderMode !== 0 /* RenderMode.Light */) {
|
|
6472
6472
|
const { getFirstChild } = renderer;
|
|
6473
6473
|
// VM is not rendering in Light DOM, we can proceed and hydrate the slotted content.
|
|
6474
6474
|
// Note: for Light DOM, this is handled while hydrating the VM
|
|
@@ -6651,19 +6651,19 @@
|
|
|
6651
6651
|
}
|
|
6652
6652
|
function areCompatibleNodes(client, ssr, vnode, renderer) {
|
|
6653
6653
|
const { getProperty, getAttribute } = renderer;
|
|
6654
|
-
if (getProperty(client, 'nodeType') === 3 /* TEXT */) {
|
|
6655
|
-
if (!hasCorrectNodeType(vnode, ssr, 3 /* TEXT */, renderer)) {
|
|
6654
|
+
if (getProperty(client, 'nodeType') === 3 /* EnvNodeTypes.TEXT */) {
|
|
6655
|
+
if (!hasCorrectNodeType(vnode, ssr, 3 /* EnvNodeTypes.TEXT */, renderer)) {
|
|
6656
6656
|
return false;
|
|
6657
6657
|
}
|
|
6658
6658
|
return getProperty(client, 'nodeValue') === getProperty(ssr, 'nodeValue');
|
|
6659
6659
|
}
|
|
6660
|
-
if (getProperty(client, 'nodeType') === 8 /* COMMENT */) {
|
|
6661
|
-
if (!hasCorrectNodeType(vnode, ssr, 8 /* COMMENT */, renderer)) {
|
|
6660
|
+
if (getProperty(client, 'nodeType') === 8 /* EnvNodeTypes.COMMENT */) {
|
|
6661
|
+
if (!hasCorrectNodeType(vnode, ssr, 8 /* EnvNodeTypes.COMMENT */, renderer)) {
|
|
6662
6662
|
return false;
|
|
6663
6663
|
}
|
|
6664
6664
|
return getProperty(client, 'nodeValue') === getProperty(ssr, 'nodeValue');
|
|
6665
6665
|
}
|
|
6666
|
-
if (!hasCorrectNodeType(vnode, ssr, 1 /* ELEMENT */, renderer)) {
|
|
6666
|
+
if (!hasCorrectNodeType(vnode, ssr, 1 /* EnvNodeTypes.ELEMENT */, renderer)) {
|
|
6667
6667
|
return false;
|
|
6668
6668
|
}
|
|
6669
6669
|
let isCompatibleElements = true;
|
|
@@ -6817,7 +6817,7 @@
|
|
|
6817
6817
|
}
|
|
6818
6818
|
return ctor;
|
|
6819
6819
|
}
|
|
6820
|
-
/* version: 2.
|
|
6820
|
+
/* version: 2.20.0 */
|
|
6821
6821
|
|
|
6822
6822
|
/*
|
|
6823
6823
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -7346,7 +7346,7 @@
|
|
|
7346
7346
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
7347
7347
|
*/
|
|
7348
7348
|
// TODO [#2472]: Remove this workaround when appropriate.
|
|
7349
|
-
// eslint-disable-next-line lwc-internal/no-global-node
|
|
7349
|
+
// eslint-disable-next-line @lwc/lwc-internal/no-global-node
|
|
7350
7350
|
const _Node$1 = Node;
|
|
7351
7351
|
const ConnectingSlot = new WeakMap();
|
|
7352
7352
|
const DisconnectingSlot = new WeakMap();
|
|
@@ -7435,7 +7435,7 @@
|
|
|
7435
7435
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
7436
7436
|
*/
|
|
7437
7437
|
// TODO [#2472]: Remove this workaround when appropriate.
|
|
7438
|
-
// eslint-disable-next-line lwc-internal/no-global-node
|
|
7438
|
+
// eslint-disable-next-line @lwc/lwc-internal/no-global-node
|
|
7439
7439
|
const _Node = Node;
|
|
7440
7440
|
/**
|
|
7441
7441
|
* EXPERIMENTAL: The purpose of this function is to detect shadowed nodes. THIS API WILL BE REMOVED
|
|
@@ -7496,7 +7496,7 @@
|
|
|
7496
7496
|
});
|
|
7497
7497
|
freeze(LightningElement);
|
|
7498
7498
|
seal(LightningElement.prototype);
|
|
7499
|
-
/* version: 2.
|
|
7499
|
+
/* version: 2.20.0 */
|
|
7500
7500
|
|
|
7501
7501
|
exports.LightningElement = LightningElement;
|
|
7502
7502
|
exports.__unstable__ProfilerControl = profilerControl;
|