lwc 2.23.0 → 2.23.3
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 +1208 -877
- package/dist/engine-dom/iife/es2017/engine-dom.js +1208 -876
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +1115 -812
- package/dist/engine-dom/iife/es5/engine-dom.js +473 -386
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +424 -344
- package/dist/engine-dom/umd/es2017/engine-dom.js +1208 -876
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +1115 -812
- package/dist/engine-dom/umd/es5/engine-dom.js +473 -386
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +424 -344
- package/dist/engine-server/commonjs/es2017/engine-server.js +803 -537
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +803 -537
- 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 +19 -19
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +20 -20
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +19 -19
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +20 -20
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +19 -19
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +20 -20
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +19 -19
- 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 +2 -2
- package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
- 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 +2 -2
- package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
- package/package.json +17 -9
|
@@ -305,9 +305,13 @@
|
|
|
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.23.
|
|
308
|
+
const LWC_VERSION = "2.23.3";
|
|
309
309
|
const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
310
|
-
/** version: 2.23.
|
|
310
|
+
/** version: 2.23.3 */
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Copyright (C) 2018 salesforce.com, inc.
|
|
314
|
+
*/
|
|
311
315
|
|
|
312
316
|
/*
|
|
313
317
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -316,7 +320,7 @@
|
|
|
316
320
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
317
321
|
*/
|
|
318
322
|
function detect(propName) {
|
|
319
|
-
return
|
|
323
|
+
return getOwnPropertyDescriptor$1(Element.prototype, propName) === undefined;
|
|
320
324
|
}
|
|
321
325
|
|
|
322
326
|
/*
|
|
@@ -385,6 +389,7 @@
|
|
|
385
389
|
patch$1(propName);
|
|
386
390
|
}
|
|
387
391
|
}
|
|
392
|
+
/** version: 2.23.3 */
|
|
388
393
|
|
|
389
394
|
/**
|
|
390
395
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -404,6 +409,7 @@
|
|
|
404
409
|
ENABLE_HTML_COLLECTIONS_PATCH: null,
|
|
405
410
|
ENABLE_INNER_OUTER_TEXT_PATCH: null,
|
|
406
411
|
ENABLE_MIXED_SHADOW_MODE: null,
|
|
412
|
+
ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE: null,
|
|
407
413
|
ENABLE_NODE_LIST_PATCH: null,
|
|
408
414
|
ENABLE_NODE_PATCH: null,
|
|
409
415
|
ENABLE_REACTIVE_SETTER: null,
|
|
@@ -412,7 +418,7 @@
|
|
|
412
418
|
if (!_globalThis.lwcRuntimeFlags) {
|
|
413
419
|
Object.defineProperty(_globalThis, 'lwcRuntimeFlags', { value: create(null) });
|
|
414
420
|
}
|
|
415
|
-
const
|
|
421
|
+
const lwcRuntimeFlags = _globalThis.lwcRuntimeFlags;
|
|
416
422
|
/**
|
|
417
423
|
* Set the value at runtime of a given feature flag. This method only be invoked once per feature
|
|
418
424
|
* flag. It is meant to be used during the app initialization.
|
|
@@ -439,17 +445,17 @@
|
|
|
439
445
|
}
|
|
440
446
|
if (process.env.NODE_ENV !== 'production') {
|
|
441
447
|
// Allow the same flag to be set more than once outside of production to enable testing
|
|
442
|
-
|
|
448
|
+
lwcRuntimeFlags[name] = value;
|
|
443
449
|
}
|
|
444
450
|
else {
|
|
445
451
|
// Disallow the same flag to be set more than once in production
|
|
446
|
-
const runtimeValue =
|
|
452
|
+
const runtimeValue = lwcRuntimeFlags[name];
|
|
447
453
|
if (!isUndefined$1(runtimeValue)) {
|
|
448
454
|
// eslint-disable-next-line no-console
|
|
449
455
|
console.error(`Failed to set the value "${value}" for the runtime feature flag "${name}". "${name}" has already been set with the value "${runtimeValue}".`);
|
|
450
456
|
return;
|
|
451
457
|
}
|
|
452
|
-
defineProperty(
|
|
458
|
+
defineProperty(lwcRuntimeFlags, name, { value });
|
|
453
459
|
}
|
|
454
460
|
}
|
|
455
461
|
/**
|
|
@@ -461,7 +467,7 @@
|
|
|
461
467
|
setFeatureFlag(name, value);
|
|
462
468
|
}
|
|
463
469
|
}
|
|
464
|
-
/** version: 2.23.
|
|
470
|
+
/** version: 2.23.3 */
|
|
465
471
|
|
|
466
472
|
/*
|
|
467
473
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -475,7 +481,7 @@
|
|
|
475
481
|
window.addEventListener('test-dummy-flag', () => {
|
|
476
482
|
let hasFlag = false;
|
|
477
483
|
|
|
478
|
-
if (
|
|
484
|
+
if (lwcRuntimeFlags.DUMMY_TEST_FLAG) {
|
|
479
485
|
hasFlag = true;
|
|
480
486
|
}
|
|
481
487
|
|
|
@@ -502,7 +508,7 @@
|
|
|
502
508
|
window.addEventListener('test-dummy-flag', () => {
|
|
503
509
|
let hasFlag = false;
|
|
504
510
|
|
|
505
|
-
if (
|
|
511
|
+
if (lwcRuntimeFlags.DUMMY_TEST_FLAG) {
|
|
506
512
|
hasFlag = true;
|
|
507
513
|
}
|
|
508
514
|
|
|
@@ -810,8 +816,8 @@
|
|
|
810
816
|
*/
|
|
811
817
|
// This is a temporary workaround to get the @lwc/engine-server to evaluate in node without having
|
|
812
818
|
// to inject at runtime.
|
|
813
|
-
const HTMLElementConstructor
|
|
814
|
-
const HTMLElementPrototype = HTMLElementConstructor
|
|
819
|
+
const HTMLElementConstructor = typeof HTMLElement !== 'undefined' ? HTMLElement : function () { };
|
|
820
|
+
const HTMLElementPrototype = HTMLElementConstructor.prototype;
|
|
815
821
|
|
|
816
822
|
/*
|
|
817
823
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -2330,7 +2336,7 @@
|
|
|
2330
2336
|
}
|
|
2331
2337
|
|
|
2332
2338
|
if (set) {
|
|
2333
|
-
if (
|
|
2339
|
+
if (lwcRuntimeFlags.ENABLE_REACTIVE_SETTER) {
|
|
2334
2340
|
let ro = vm.oar[key];
|
|
2335
2341
|
|
|
2336
2342
|
if (isUndefined$1(ro)) {
|
|
@@ -2888,7 +2894,7 @@
|
|
|
2888
2894
|
defineProperties(HTMLBridgeElement.prototype, descriptors);
|
|
2889
2895
|
return HTMLBridgeElement;
|
|
2890
2896
|
}
|
|
2891
|
-
const BaseBridgeElement = HTMLBridgeElementFactory(HTMLElementConstructor
|
|
2897
|
+
const BaseBridgeElement = HTMLBridgeElementFactory(HTMLElementConstructor, getOwnPropertyNames$1(HTMLElementOriginalDescriptors), []);
|
|
2892
2898
|
freeze(BaseBridgeElement);
|
|
2893
2899
|
seal(BaseBridgeElement.prototype);
|
|
2894
2900
|
|
|
@@ -2982,7 +2988,7 @@
|
|
|
2982
2988
|
throw new ReferenceError();
|
|
2983
2989
|
}
|
|
2984
2990
|
|
|
2985
|
-
if (
|
|
2991
|
+
if (lwcRuntimeFlags.ENABLE_HMR) {
|
|
2986
2992
|
const visited = new Set();
|
|
2987
2993
|
|
|
2988
2994
|
while (swappedTemplateMap.has(tpl) && !visited.has(tpl)) {
|
|
@@ -2999,7 +3005,7 @@
|
|
|
2999
3005
|
throw new ReferenceError();
|
|
3000
3006
|
}
|
|
3001
3007
|
|
|
3002
|
-
if (
|
|
3008
|
+
if (lwcRuntimeFlags.ENABLE_HMR) {
|
|
3003
3009
|
const visited = new Set();
|
|
3004
3010
|
|
|
3005
3011
|
while (swappedComponentMap.has(Ctor) && !visited.has(Ctor)) {
|
|
@@ -3016,7 +3022,7 @@
|
|
|
3016
3022
|
throw new ReferenceError();
|
|
3017
3023
|
}
|
|
3018
3024
|
|
|
3019
|
-
if (
|
|
3025
|
+
if (lwcRuntimeFlags.ENABLE_HMR) {
|
|
3020
3026
|
const visited = new Set();
|
|
3021
3027
|
|
|
3022
3028
|
while (swappedStyleMap.has(style) && !visited.has(style)) {
|
|
@@ -3033,7 +3039,7 @@
|
|
|
3033
3039
|
throw new ReferenceError();
|
|
3034
3040
|
}
|
|
3035
3041
|
|
|
3036
|
-
if (
|
|
3042
|
+
if (lwcRuntimeFlags.ENABLE_HMR) {
|
|
3037
3043
|
// tracking active component
|
|
3038
3044
|
const Ctor = vm.def.ctor;
|
|
3039
3045
|
let componentVMs = activeComponents.get(Ctor);
|
|
@@ -3090,7 +3096,7 @@
|
|
|
3090
3096
|
throw new ReferenceError();
|
|
3091
3097
|
}
|
|
3092
3098
|
|
|
3093
|
-
if (
|
|
3099
|
+
if (lwcRuntimeFlags.ENABLE_HMR) {
|
|
3094
3100
|
// tracking inactive component
|
|
3095
3101
|
const Ctor = vm.def.ctor;
|
|
3096
3102
|
let list = activeComponents.get(Ctor);
|
|
@@ -3137,7 +3143,7 @@
|
|
|
3137
3143
|
}
|
|
3138
3144
|
}
|
|
3139
3145
|
|
|
3140
|
-
if (!
|
|
3146
|
+
if (!lwcRuntimeFlags.ENABLE_HMR) {
|
|
3141
3147
|
throw new Error('HMR is not enabled');
|
|
3142
3148
|
}
|
|
3143
3149
|
|
|
@@ -3153,7 +3159,7 @@
|
|
|
3153
3159
|
}
|
|
3154
3160
|
}
|
|
3155
3161
|
|
|
3156
|
-
if (!
|
|
3162
|
+
if (!lwcRuntimeFlags.ENABLE_HMR) {
|
|
3157
3163
|
throw new Error('HMR is not enabled');
|
|
3158
3164
|
}
|
|
3159
3165
|
|
|
@@ -3167,7 +3173,7 @@
|
|
|
3167
3173
|
return rehydrateHotStyle(oldStyle);
|
|
3168
3174
|
}
|
|
3169
3175
|
|
|
3170
|
-
if (!
|
|
3176
|
+
if (!lwcRuntimeFlags.ENABLE_HMR) {
|
|
3171
3177
|
throw new Error('HMR is not enabled');
|
|
3172
3178
|
}
|
|
3173
3179
|
|
|
@@ -3547,30 +3553,67 @@
|
|
|
3547
3553
|
* SPDX-License-Identifier: MIT
|
|
3548
3554
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
3549
3555
|
*/
|
|
3556
|
+
|
|
3557
|
+
function checkHasVM(elm) {
|
|
3558
|
+
const hasVM = !isUndefined$1(getAssociatedVMIfPresent(elm));
|
|
3559
|
+
|
|
3560
|
+
if (process.env.NODE_ENV !== 'production' && !hasVM) {
|
|
3561
|
+
// Occurs when an element is manually created with the same tag name as an existing LWC component. In that case,
|
|
3562
|
+
// we skip calling the LWC connectedCallback/disconnectedCallback logic and log an error.
|
|
3563
|
+
logError(`VM for tag name "${elm.tagName.toLowerCase()}" is undefined. ` + `This indicates that an element was created with this tag name, ` + `which is already reserved by an LWC component. Use lwc.createElement ` + `instead to create elements.`);
|
|
3564
|
+
}
|
|
3565
|
+
|
|
3566
|
+
return hasVM;
|
|
3567
|
+
}
|
|
3568
|
+
|
|
3550
3569
|
function getUpgradableConstructor(tagName, renderer) {
|
|
3551
|
-
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3558
|
-
|
|
3570
|
+
const {
|
|
3571
|
+
getCustomElement,
|
|
3572
|
+
HTMLElementExported: RendererHTMLElement,
|
|
3573
|
+
defineCustomElement
|
|
3574
|
+
} = renderer; // Should never get a tag with upper case letter at this point, the compiler should
|
|
3575
|
+
// produce only tags with lowercase letters
|
|
3576
|
+
// But, for backwards compatibility, we will lower case the tagName
|
|
3577
|
+
|
|
3578
|
+
tagName = tagName.toLowerCase();
|
|
3579
|
+
let CE = getCustomElement(tagName);
|
|
3580
|
+
|
|
3581
|
+
if (!isUndefined$1(CE)) {
|
|
3582
|
+
return CE;
|
|
3583
|
+
}
|
|
3584
|
+
/**
|
|
3585
|
+
* LWC Upgradable Element reference to an element that was created
|
|
3586
|
+
* via the scoped registry mechanism, and that is ready to be upgraded.
|
|
3587
|
+
*/
|
|
3588
|
+
|
|
3589
|
+
|
|
3590
|
+
CE = class LWCUpgradableElement extends RendererHTMLElement {
|
|
3591
|
+
constructor(upgradeCallback) {
|
|
3592
|
+
super();
|
|
3593
|
+
|
|
3594
|
+
if (isFunction$1(upgradeCallback)) {
|
|
3595
|
+
upgradeCallback(this); // nothing to do with the result for now
|
|
3596
|
+
}
|
|
3559
3597
|
}
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
CE =
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
upgradeCallback(this); // nothing to do with the result for now
|
|
3569
|
-
}
|
|
3570
|
-
}
|
|
3598
|
+
|
|
3599
|
+
};
|
|
3600
|
+
|
|
3601
|
+
if (lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
3602
|
+
CE.prototype.connectedCallback = function () {
|
|
3603
|
+
if (checkHasVM(this)) {
|
|
3604
|
+
connectRootElement(this);
|
|
3605
|
+
}
|
|
3571
3606
|
};
|
|
3572
|
-
|
|
3573
|
-
|
|
3607
|
+
|
|
3608
|
+
CE.prototype.disconnectedCallback = function () {
|
|
3609
|
+
if (checkHasVM(this)) {
|
|
3610
|
+
disconnectRootElement(this);
|
|
3611
|
+
}
|
|
3612
|
+
};
|
|
3613
|
+
}
|
|
3614
|
+
|
|
3615
|
+
defineCustomElement(tagName, CE);
|
|
3616
|
+
return CE;
|
|
3574
3617
|
}
|
|
3575
3618
|
|
|
3576
3619
|
/*
|
|
@@ -3658,6 +3701,14 @@
|
|
|
3658
3701
|
// different than the one previously set.
|
|
3659
3702
|
if (isFirstPatch ||
|
|
3660
3703
|
cur !== (isLiveBindingProp(sel, key) ? getProperty(elm, key) : oldProps[key])) {
|
|
3704
|
+
// Additional verification if properties are supported by the element
|
|
3705
|
+
// Validation relies on html properties and public properties being defined on the element,
|
|
3706
|
+
// SSR has its own custom validation.
|
|
3707
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3708
|
+
if (!(key in elm)) {
|
|
3709
|
+
logWarn(`Unknown public property "${key}" of element <${elm.tagName.toLowerCase()}>. This is either a typo on the corresponding attribute "${htmlPropertyToAttribute(key)}", or the attribute does not exist in this browser or DOM implementation.`);
|
|
3710
|
+
}
|
|
3711
|
+
}
|
|
3661
3712
|
setProperty(elm, key, cur);
|
|
3662
3713
|
}
|
|
3663
3714
|
}
|
|
@@ -3816,579 +3867,798 @@
|
|
|
3816
3867
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
3817
3868
|
*/
|
|
3818
3869
|
function patchChildren(c1, c2, parent, renderer) {
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
}
|
|
3870
|
+
if (hasDynamicChildren(c2)) {
|
|
3871
|
+
updateDynamicChildren(c1, c2, parent, renderer);
|
|
3872
|
+
} else {
|
|
3873
|
+
updateStaticChildren(c1, c2, parent, renderer);
|
|
3874
|
+
}
|
|
3825
3875
|
}
|
|
3876
|
+
|
|
3826
3877
|
function patch(n1, n2, parent, renderer) {
|
|
3827
|
-
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
patchText(n1, n2, renderer);
|
|
3843
|
-
break;
|
|
3844
|
-
case 1 /* VNodeType.Comment */:
|
|
3845
|
-
// VComment has no special capability, fallback to the owner's renderer
|
|
3846
|
-
patchComment(n1, n2, renderer);
|
|
3847
|
-
break;
|
|
3848
|
-
case 4 /* VNodeType.Static */:
|
|
3849
|
-
n2.elm = n1.elm;
|
|
3850
|
-
break;
|
|
3851
|
-
case 2 /* VNodeType.Element */:
|
|
3852
|
-
patchElement(n1, n2, (_a = n2.data.renderer) !== null && _a !== void 0 ? _a : renderer);
|
|
3853
|
-
break;
|
|
3854
|
-
case 3 /* VNodeType.CustomElement */:
|
|
3855
|
-
patchCustomElement(n1, n2, parent, (_b = n2.data.renderer) !== null && _b !== void 0 ? _b : renderer);
|
|
3856
|
-
break;
|
|
3878
|
+
var _a, _b;
|
|
3879
|
+
|
|
3880
|
+
if (n1 === n2) {
|
|
3881
|
+
return;
|
|
3882
|
+
}
|
|
3883
|
+
|
|
3884
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
3885
|
+
if (!isSameVnode(n1, n2)) {
|
|
3886
|
+
throw new Error('Expected these VNodes to be the same: ' + JSON.stringify({
|
|
3887
|
+
sel: n1.sel,
|
|
3888
|
+
key: n1.key
|
|
3889
|
+
}) + ', ' + JSON.stringify({
|
|
3890
|
+
sel: n2.sel,
|
|
3891
|
+
key: n2.key
|
|
3892
|
+
}));
|
|
3857
3893
|
}
|
|
3894
|
+
}
|
|
3895
|
+
|
|
3896
|
+
switch (n2.type) {
|
|
3897
|
+
case 0
|
|
3898
|
+
/* VNodeType.Text */
|
|
3899
|
+
:
|
|
3900
|
+
// VText has no special capability, fallback to the owner's renderer
|
|
3901
|
+
patchText(n1, n2, renderer);
|
|
3902
|
+
break;
|
|
3903
|
+
|
|
3904
|
+
case 1
|
|
3905
|
+
/* VNodeType.Comment */
|
|
3906
|
+
:
|
|
3907
|
+
// VComment has no special capability, fallback to the owner's renderer
|
|
3908
|
+
patchComment(n1, n2, renderer);
|
|
3909
|
+
break;
|
|
3910
|
+
|
|
3911
|
+
case 4
|
|
3912
|
+
/* VNodeType.Static */
|
|
3913
|
+
:
|
|
3914
|
+
n2.elm = n1.elm;
|
|
3915
|
+
break;
|
|
3916
|
+
|
|
3917
|
+
case 2
|
|
3918
|
+
/* VNodeType.Element */
|
|
3919
|
+
:
|
|
3920
|
+
patchElement(n1, n2, (_a = n2.data.renderer) !== null && _a !== void 0 ? _a : renderer);
|
|
3921
|
+
break;
|
|
3922
|
+
|
|
3923
|
+
case 3
|
|
3924
|
+
/* VNodeType.CustomElement */
|
|
3925
|
+
:
|
|
3926
|
+
patchCustomElement(n1, n2, parent, (_b = n2.data.renderer) !== null && _b !== void 0 ? _b : renderer);
|
|
3927
|
+
break;
|
|
3928
|
+
}
|
|
3858
3929
|
}
|
|
3930
|
+
|
|
3859
3931
|
function mount(node, parent, renderer, anchor) {
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3932
|
+
var _a, _b;
|
|
3933
|
+
|
|
3934
|
+
switch (node.type) {
|
|
3935
|
+
case 0
|
|
3936
|
+
/* VNodeType.Text */
|
|
3937
|
+
:
|
|
3938
|
+
// VText has no special capability, fallback to the owner's renderer
|
|
3939
|
+
mountText(node, parent, anchor, renderer);
|
|
3940
|
+
break;
|
|
3941
|
+
|
|
3942
|
+
case 1
|
|
3943
|
+
/* VNodeType.Comment */
|
|
3944
|
+
:
|
|
3945
|
+
// VComment has no special capability, fallback to the owner's renderer
|
|
3946
|
+
mountComment(node, parent, anchor, renderer);
|
|
3947
|
+
break;
|
|
3948
|
+
|
|
3949
|
+
case 4
|
|
3950
|
+
/* VNodeType.Static */
|
|
3951
|
+
:
|
|
3952
|
+
// VStatic cannot have a custom renderer associated to them, using owner's renderer
|
|
3953
|
+
mountStatic(node, parent, anchor, renderer);
|
|
3954
|
+
break;
|
|
3955
|
+
|
|
3956
|
+
case 2
|
|
3957
|
+
/* VNodeType.Element */
|
|
3958
|
+
:
|
|
3959
|
+
// If the vnode data has a renderer override use it, else fallback to owner's renderer
|
|
3960
|
+
mountElement(node, parent, anchor, (_a = node.data.renderer) !== null && _a !== void 0 ? _a : renderer);
|
|
3961
|
+
break;
|
|
3962
|
+
|
|
3963
|
+
case 3
|
|
3964
|
+
/* VNodeType.CustomElement */
|
|
3965
|
+
:
|
|
3966
|
+
// If the vnode data has a renderer override use it, else fallback to owner's renderer
|
|
3967
|
+
mountCustomElement(node, parent, anchor, (_b = node.data.renderer) !== null && _b !== void 0 ? _b : renderer);
|
|
3968
|
+
break;
|
|
3969
|
+
}
|
|
3883
3970
|
}
|
|
3971
|
+
|
|
3884
3972
|
function patchText(n1, n2, renderer) {
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3973
|
+
n2.elm = n1.elm;
|
|
3974
|
+
|
|
3975
|
+
if (n2.text !== n1.text) {
|
|
3976
|
+
updateTextContent(n2, renderer);
|
|
3977
|
+
}
|
|
3889
3978
|
}
|
|
3979
|
+
|
|
3890
3980
|
function mountText(vnode, parent, anchor, renderer) {
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3981
|
+
const {
|
|
3982
|
+
owner
|
|
3983
|
+
} = vnode;
|
|
3984
|
+
const {
|
|
3985
|
+
createText
|
|
3986
|
+
} = renderer;
|
|
3987
|
+
const textNode = vnode.elm = createText(vnode.text);
|
|
3988
|
+
linkNodeToShadow(textNode, owner, renderer);
|
|
3989
|
+
insertNode(textNode, parent, anchor, renderer);
|
|
3896
3990
|
}
|
|
3991
|
+
|
|
3897
3992
|
function patchComment(n1, n2, renderer) {
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3993
|
+
n2.elm = n1.elm; // FIXME: Comment nodes should be static, we shouldn't need to diff them together. However
|
|
3994
|
+
// it is the case today.
|
|
3995
|
+
|
|
3996
|
+
if (n2.text !== n1.text) {
|
|
3997
|
+
updateTextContent(n2, renderer);
|
|
3998
|
+
}
|
|
3904
3999
|
}
|
|
4000
|
+
|
|
3905
4001
|
function mountComment(vnode, parent, anchor, renderer) {
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
4002
|
+
const {
|
|
4003
|
+
owner
|
|
4004
|
+
} = vnode;
|
|
4005
|
+
const {
|
|
4006
|
+
createComment
|
|
4007
|
+
} = renderer;
|
|
4008
|
+
const commentNode = vnode.elm = createComment(vnode.text);
|
|
4009
|
+
linkNodeToShadow(commentNode, owner, renderer);
|
|
4010
|
+
insertNode(commentNode, parent, anchor, renderer);
|
|
3911
4011
|
}
|
|
4012
|
+
|
|
3912
4013
|
function mountElement(vnode, parent, anchor, renderer) {
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
4014
|
+
const {
|
|
4015
|
+
sel,
|
|
4016
|
+
owner,
|
|
4017
|
+
data: {
|
|
4018
|
+
svg
|
|
4019
|
+
}
|
|
4020
|
+
} = vnode;
|
|
4021
|
+
const {
|
|
4022
|
+
createElement
|
|
4023
|
+
} = renderer;
|
|
4024
|
+
const namespace = isTrue(svg) ? SVG_NAMESPACE : undefined;
|
|
4025
|
+
const elm = vnode.elm = createElement(sel, namespace);
|
|
4026
|
+
linkNodeToShadow(elm, owner, renderer);
|
|
4027
|
+
applyStyleScoping(elm, owner, renderer);
|
|
4028
|
+
applyDomManual(elm, vnode);
|
|
4029
|
+
applyElementRestrictions(elm, vnode);
|
|
4030
|
+
patchElementPropsAndAttrs$1(null, vnode, renderer);
|
|
4031
|
+
insertNode(elm, parent, anchor, renderer);
|
|
4032
|
+
mountVNodes(vnode.children, elm, renderer, null);
|
|
3924
4033
|
}
|
|
4034
|
+
|
|
3925
4035
|
function patchElement(n1, n2, renderer) {
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
4036
|
+
const elm = n2.elm = n1.elm;
|
|
4037
|
+
patchElementPropsAndAttrs$1(n1, n2, renderer);
|
|
4038
|
+
patchChildren(n1.children, n2.children, elm, renderer);
|
|
3929
4039
|
}
|
|
4040
|
+
|
|
3930
4041
|
function mountStatic(vnode, parent, anchor, renderer) {
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
4042
|
+
const {
|
|
4043
|
+
owner
|
|
4044
|
+
} = vnode;
|
|
4045
|
+
const {
|
|
4046
|
+
cloneNode,
|
|
4047
|
+
isSyntheticShadowDefined
|
|
4048
|
+
} = renderer;
|
|
4049
|
+
const elm = vnode.elm = cloneNode(vnode.fragment, true);
|
|
4050
|
+
linkNodeToShadow(elm, owner, renderer);
|
|
4051
|
+
applyElementRestrictions(elm, vnode); // Marks this node as Static to propagate the shadow resolver. must happen after elm is assigned to the proper shadow
|
|
4052
|
+
|
|
4053
|
+
const {
|
|
4054
|
+
renderMode,
|
|
4055
|
+
shadowMode
|
|
4056
|
+
} = owner;
|
|
4057
|
+
|
|
4058
|
+
if (isSyntheticShadowDefined) {
|
|
4059
|
+
if (shadowMode === 1
|
|
4060
|
+
/* ShadowMode.Synthetic */
|
|
4061
|
+
|| renderMode === 0
|
|
4062
|
+
/* RenderMode.Light */
|
|
4063
|
+
) {
|
|
4064
|
+
elm[KEY__SHADOW_STATIC] = true;
|
|
3942
4065
|
}
|
|
3943
|
-
|
|
4066
|
+
}
|
|
4067
|
+
|
|
4068
|
+
insertNode(elm, parent, anchor, renderer);
|
|
3944
4069
|
}
|
|
4070
|
+
|
|
3945
4071
|
function mountCustomElement(vnode, parent, anchor, renderer) {
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
4072
|
+
const {
|
|
4073
|
+
sel,
|
|
4074
|
+
owner
|
|
4075
|
+
} = vnode;
|
|
4076
|
+
const UpgradableConstructor = getUpgradableConstructor(sel, renderer);
|
|
4077
|
+
/**
|
|
4078
|
+
* Note: if the upgradable constructor does not expect, or throw when we new it
|
|
4079
|
+
* with a callback as the first argument, we could implement a more advanced
|
|
4080
|
+
* mechanism that only passes that argument if the constructor is known to be
|
|
4081
|
+
* an upgradable custom element.
|
|
4082
|
+
*/
|
|
4083
|
+
|
|
4084
|
+
let vm;
|
|
4085
|
+
const elm = new UpgradableConstructor(elm => {
|
|
4086
|
+
// the custom element from the registry is expecting an upgrade callback
|
|
4087
|
+
vm = createViewModelHook(elm, vnode, renderer);
|
|
4088
|
+
});
|
|
4089
|
+
vnode.elm = elm;
|
|
4090
|
+
vnode.vm = vm;
|
|
4091
|
+
linkNodeToShadow(elm, owner, renderer);
|
|
4092
|
+
applyStyleScoping(elm, owner, renderer);
|
|
4093
|
+
|
|
4094
|
+
if (vm) {
|
|
4095
|
+
allocateChildren(vnode, vm);
|
|
4096
|
+
} else if (vnode.ctor !== UpgradableConstructor) {
|
|
4097
|
+
throw new TypeError(`Incorrect Component Constructor`);
|
|
4098
|
+
}
|
|
4099
|
+
|
|
4100
|
+
patchElementPropsAndAttrs$1(null, vnode, renderer);
|
|
4101
|
+
insertNode(elm, parent, anchor, renderer);
|
|
4102
|
+
|
|
4103
|
+
if (vm) {
|
|
4104
|
+
{
|
|
4105
|
+
if (!lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
3972
4106
|
if (process.env.NODE_ENV !== 'production') {
|
|
3973
|
-
|
|
4107
|
+
// With synthetic lifecycle callbacks, it's possible for elements to be removed without the engine
|
|
4108
|
+
// noticing it (e.g. `appendChild` the same host element twice). This test ensures we don't regress.
|
|
4109
|
+
assert.isTrue(vm.state === 0
|
|
4110
|
+
/* VMState.created */
|
|
4111
|
+
, `${vm} cannot be recycled.`);
|
|
3974
4112
|
}
|
|
4113
|
+
|
|
3975
4114
|
runConnectedCallback(vm);
|
|
4115
|
+
}
|
|
3976
4116
|
}
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
4117
|
+
}
|
|
4118
|
+
|
|
4119
|
+
mountVNodes(vnode.children, elm, renderer, null);
|
|
4120
|
+
|
|
4121
|
+
if (vm) {
|
|
4122
|
+
appendVM(vm);
|
|
4123
|
+
}
|
|
3981
4124
|
}
|
|
4125
|
+
|
|
3982
4126
|
function patchCustomElement(n1, n2, parent, renderer) {
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4127
|
+
if (n1.ctor !== n2.ctor) {
|
|
4128
|
+
// If the constructor, unmount the current component and mount a new one using the new
|
|
4129
|
+
// constructor.
|
|
4130
|
+
const anchor = renderer.nextSibling(n1.elm);
|
|
4131
|
+
unmount(n1, parent, renderer, true);
|
|
4132
|
+
mountCustomElement(n2, parent, anchor, renderer);
|
|
4133
|
+
} else {
|
|
4134
|
+
// Otherwise patch the existing component with new props/attrs/etc.
|
|
4135
|
+
const elm = n2.elm = n1.elm;
|
|
4136
|
+
const vm = n2.vm = n1.vm;
|
|
4137
|
+
patchElementPropsAndAttrs$1(n1, n2, renderer);
|
|
4138
|
+
|
|
4139
|
+
if (!isUndefined$1(vm)) {
|
|
4140
|
+
// in fallback mode, the allocation will always set children to
|
|
4141
|
+
// empty and delegate the real allocation to the slot elements
|
|
4142
|
+
allocateChildren(n2, vm);
|
|
4143
|
+
} // in fallback mode, the children will be always empty, so, nothing
|
|
4144
|
+
// will happen, but in native, it does allocate the light dom
|
|
4145
|
+
|
|
4146
|
+
|
|
4147
|
+
patchChildren(n1.children, n2.children, elm, renderer);
|
|
4148
|
+
|
|
4149
|
+
if (!isUndefined$1(vm)) {
|
|
4150
|
+
// this will probably update the shadowRoot, but only if the vm is in a dirty state
|
|
4151
|
+
// this is important to preserve the top to bottom synchronous rendering phase.
|
|
4152
|
+
rerenderVM(vm);
|
|
4008
4153
|
}
|
|
4154
|
+
}
|
|
4009
4155
|
}
|
|
4156
|
+
|
|
4010
4157
|
function mountVNodes(vnodes, parent, renderer, anchor, start = 0, end = vnodes.length) {
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4158
|
+
for (; start < end; ++start) {
|
|
4159
|
+
const vnode = vnodes[start];
|
|
4160
|
+
|
|
4161
|
+
if (isVNode(vnode)) {
|
|
4162
|
+
mount(vnode, parent, renderer, anchor);
|
|
4016
4163
|
}
|
|
4164
|
+
}
|
|
4017
4165
|
}
|
|
4166
|
+
|
|
4018
4167
|
function unmount(vnode, parent, renderer, doRemove = false) {
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4168
|
+
const {
|
|
4169
|
+
type,
|
|
4170
|
+
elm,
|
|
4171
|
+
sel
|
|
4172
|
+
} = vnode; // When unmounting a VNode subtree not all the elements have to removed from the DOM. The
|
|
4173
|
+
// subtree root, is the only element worth unmounting from the subtree.
|
|
4174
|
+
|
|
4175
|
+
if (doRemove) {
|
|
4176
|
+
// The vnode might or might not have a data.renderer associated to it
|
|
4177
|
+
// but the removal used here is from the owner instead.
|
|
4178
|
+
removeNode(elm, parent, renderer);
|
|
4179
|
+
}
|
|
4180
|
+
|
|
4181
|
+
switch (type) {
|
|
4182
|
+
case 2
|
|
4183
|
+
/* VNodeType.Element */
|
|
4184
|
+
:
|
|
4185
|
+
{
|
|
4186
|
+
// Slot content is removed to trigger slotchange event when removing slot.
|
|
4187
|
+
// Only required for synthetic shadow.
|
|
4188
|
+
const shouldRemoveChildren = sel === 'slot' && vnode.owner.shadowMode === 1
|
|
4189
|
+
/* ShadowMode.Synthetic */
|
|
4190
|
+
;
|
|
4191
|
+
unmountVNodes(vnode.children, elm, renderer, shouldRemoveChildren);
|
|
4192
|
+
break;
|
|
4193
|
+
}
|
|
4194
|
+
|
|
4195
|
+
case 3
|
|
4196
|
+
/* VNodeType.CustomElement */
|
|
4197
|
+
:
|
|
4198
|
+
{
|
|
4199
|
+
const {
|
|
4200
|
+
vm
|
|
4201
|
+
} = vnode; // No need to unmount the children here, `removeVM` will take care of removing the
|
|
4202
|
+
// children.
|
|
4203
|
+
|
|
4204
|
+
if (!isUndefined$1(vm)) {
|
|
4205
|
+
removeVM(vm);
|
|
4042
4206
|
}
|
|
4043
|
-
|
|
4207
|
+
}
|
|
4208
|
+
}
|
|
4044
4209
|
}
|
|
4210
|
+
|
|
4045
4211
|
function unmountVNodes(vnodes, parent, renderer, doRemove = false, start = 0, end = vnodes.length) {
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4212
|
+
for (; start < end; ++start) {
|
|
4213
|
+
const ch = vnodes[start];
|
|
4214
|
+
|
|
4215
|
+
if (isVNode(ch)) {
|
|
4216
|
+
unmount(ch, parent, renderer, doRemove);
|
|
4051
4217
|
}
|
|
4218
|
+
}
|
|
4052
4219
|
}
|
|
4220
|
+
|
|
4053
4221
|
function isVNode(vnode) {
|
|
4054
|
-
|
|
4222
|
+
return vnode != null;
|
|
4055
4223
|
}
|
|
4224
|
+
|
|
4056
4225
|
function linkNodeToShadow(elm, owner, renderer) {
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4226
|
+
const {
|
|
4227
|
+
renderRoot,
|
|
4228
|
+
renderMode,
|
|
4229
|
+
shadowMode
|
|
4230
|
+
} = owner;
|
|
4231
|
+
const {
|
|
4232
|
+
isSyntheticShadowDefined
|
|
4233
|
+
} = renderer; // TODO [#1164]: this should eventually be done by the polyfill directly
|
|
4234
|
+
|
|
4235
|
+
if (isSyntheticShadowDefined) {
|
|
4236
|
+
if (shadowMode === 1
|
|
4237
|
+
/* ShadowMode.Synthetic */
|
|
4238
|
+
|| renderMode === 0
|
|
4239
|
+
/* RenderMode.Light */
|
|
4240
|
+
) {
|
|
4241
|
+
elm[KEY__SHADOW_RESOLVER] = renderRoot[KEY__SHADOW_RESOLVER];
|
|
4064
4242
|
}
|
|
4243
|
+
}
|
|
4065
4244
|
}
|
|
4245
|
+
|
|
4066
4246
|
function updateTextContent(vnode, renderer) {
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
setText
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4247
|
+
const {
|
|
4248
|
+
elm,
|
|
4249
|
+
text
|
|
4250
|
+
} = vnode;
|
|
4251
|
+
const {
|
|
4252
|
+
setText
|
|
4253
|
+
} = renderer;
|
|
4254
|
+
|
|
4255
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4256
|
+
unlockDomMutation();
|
|
4257
|
+
}
|
|
4258
|
+
|
|
4259
|
+
setText(elm, text);
|
|
4260
|
+
|
|
4261
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4262
|
+
lockDomMutation();
|
|
4263
|
+
}
|
|
4076
4264
|
}
|
|
4265
|
+
|
|
4077
4266
|
function insertNode(node, parent, anchor, renderer) {
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4267
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4268
|
+
unlockDomMutation();
|
|
4269
|
+
}
|
|
4270
|
+
|
|
4271
|
+
renderer.insert(node, parent, anchor);
|
|
4272
|
+
|
|
4273
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4274
|
+
lockDomMutation();
|
|
4275
|
+
}
|
|
4085
4276
|
}
|
|
4277
|
+
|
|
4086
4278
|
function removeNode(node, parent, renderer) {
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4279
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4280
|
+
unlockDomMutation();
|
|
4281
|
+
}
|
|
4282
|
+
|
|
4283
|
+
renderer.remove(node, parent);
|
|
4284
|
+
|
|
4285
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4286
|
+
lockDomMutation();
|
|
4287
|
+
}
|
|
4094
4288
|
}
|
|
4289
|
+
|
|
4095
4290
|
function patchElementPropsAndAttrs$1(oldVnode, vnode, renderer) {
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4291
|
+
if (isNull(oldVnode)) {
|
|
4292
|
+
applyEventListeners(vnode, renderer);
|
|
4293
|
+
applyStaticClassAttribute(vnode, renderer);
|
|
4294
|
+
applyStaticStyleAttribute(vnode, renderer);
|
|
4295
|
+
} // Attrs need to be applied to element before props IE11 will wipe out value on radio inputs if
|
|
4296
|
+
// value is set before type=radio.
|
|
4297
|
+
|
|
4298
|
+
|
|
4299
|
+
patchClassAttribute(oldVnode, vnode, renderer);
|
|
4300
|
+
patchStyleAttribute(oldVnode, vnode, renderer);
|
|
4301
|
+
patchAttributes(oldVnode, vnode, renderer);
|
|
4302
|
+
patchProps(oldVnode, vnode, renderer);
|
|
4107
4303
|
}
|
|
4304
|
+
|
|
4108
4305
|
function applyStyleScoping(elm, owner, renderer) {
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4306
|
+
// Set the class name for `*.scoped.css` style scoping.
|
|
4307
|
+
const scopeToken = getScopeTokenClass(owner);
|
|
4308
|
+
|
|
4309
|
+
if (!isNull(scopeToken)) {
|
|
4310
|
+
const {
|
|
4311
|
+
getClassList
|
|
4312
|
+
} = renderer; // TODO [#2762]: this dot notation with add is probably problematic
|
|
4313
|
+
// probably we should have a renderer api for just the add operation
|
|
4314
|
+
|
|
4315
|
+
getClassList(elm).add(scopeToken);
|
|
4316
|
+
} // Set property element for synthetic shadow DOM style scoping.
|
|
4317
|
+
|
|
4318
|
+
|
|
4319
|
+
const {
|
|
4320
|
+
stylesheetToken: syntheticToken
|
|
4321
|
+
} = owner.context;
|
|
4322
|
+
|
|
4323
|
+
if (owner.shadowMode === 1
|
|
4324
|
+
/* ShadowMode.Synthetic */
|
|
4325
|
+
&& !isUndefined$1(syntheticToken)) {
|
|
4326
|
+
elm.$shadowToken$ = syntheticToken;
|
|
4327
|
+
}
|
|
4328
|
+
}
|
|
4329
|
+
|
|
4330
|
+
function applyDomManual(elm, vnode) {
|
|
4331
|
+
var _a;
|
|
4332
|
+
|
|
4333
|
+
const {
|
|
4334
|
+
owner,
|
|
4335
|
+
data: {
|
|
4336
|
+
context
|
|
4139
4337
|
}
|
|
4338
|
+
} = vnode;
|
|
4339
|
+
|
|
4340
|
+
if (owner.shadowMode === 1
|
|
4341
|
+
/* ShadowMode.Synthetic */
|
|
4342
|
+
&& ((_a = context === null || context === void 0 ? void 0 : context.lwc) === null || _a === void 0 ? void 0 : _a.dom) === "manual"
|
|
4343
|
+
/* LwcDomMode.Manual */
|
|
4344
|
+
) {
|
|
4345
|
+
elm.$domManual$ = true;
|
|
4346
|
+
}
|
|
4140
4347
|
}
|
|
4348
|
+
|
|
4349
|
+
function applyElementRestrictions(elm, vnode) {
|
|
4350
|
+
var _a, _b;
|
|
4351
|
+
|
|
4352
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4353
|
+
const isPortal = vnode.type === 2
|
|
4354
|
+
/* VNodeType.Element */
|
|
4355
|
+
&& ((_b = (_a = vnode.data.context) === null || _a === void 0 ? void 0 : _a.lwc) === null || _b === void 0 ? void 0 : _b.dom) === "manual"
|
|
4356
|
+
/* LwcDomMode.Manual */
|
|
4357
|
+
;
|
|
4358
|
+
const isLight = vnode.owner.renderMode === 0
|
|
4359
|
+
/* RenderMode.Light */
|
|
4360
|
+
;
|
|
4361
|
+
patchElementWithRestrictions(elm, {
|
|
4362
|
+
isPortal,
|
|
4363
|
+
isLight
|
|
4364
|
+
});
|
|
4365
|
+
}
|
|
4366
|
+
}
|
|
4367
|
+
|
|
4141
4368
|
function allocateChildren(vnode, vm) {
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4369
|
+
// A component with slots will re-render because:
|
|
4370
|
+
// 1- There is a change of the internal state.
|
|
4371
|
+
// 2- There is a change on the external api (ex: slots)
|
|
4372
|
+
//
|
|
4373
|
+
// In case #1, the vnodes in the cmpSlots will be reused since they didn't changed. This routine emptied the
|
|
4374
|
+
// slotted children when those VCustomElement were rendered and therefore in subsequent calls to allocate children
|
|
4375
|
+
// in a reused VCustomElement, there won't be any slotted children.
|
|
4376
|
+
// For those cases, we will use the reference for allocated children stored when rendering the fresh VCustomElement.
|
|
4377
|
+
//
|
|
4378
|
+
// In case #2, we will always get a fresh VCustomElement.
|
|
4379
|
+
const children = vnode.aChildren || vnode.children;
|
|
4380
|
+
vm.aChildren = children;
|
|
4381
|
+
const {
|
|
4382
|
+
renderMode,
|
|
4383
|
+
shadowMode
|
|
4384
|
+
} = vm;
|
|
4385
|
+
|
|
4386
|
+
if (shadowMode === 1
|
|
4387
|
+
/* ShadowMode.Synthetic */
|
|
4388
|
+
|| renderMode === 0
|
|
4389
|
+
/* RenderMode.Light */
|
|
4390
|
+
) {
|
|
4391
|
+
// slow path
|
|
4392
|
+
allocateInSlot(vm, children); // save the allocated children in case this vnode is reused.
|
|
4393
|
+
|
|
4394
|
+
vnode.aChildren = children; // every child vnode is now allocated, and the host should receive none directly, it receives them via the shadow!
|
|
4395
|
+
|
|
4396
|
+
vnode.children = EmptyArray;
|
|
4397
|
+
}
|
|
4163
4398
|
}
|
|
4399
|
+
|
|
4164
4400
|
function createViewModelHook(elm, vnode, renderer) {
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
return vm;
|
|
4171
|
-
}
|
|
4172
|
-
const { sel, mode, ctor, owner } = vnode;
|
|
4173
|
-
vm = createVM(elm, ctor, renderer, {
|
|
4174
|
-
mode,
|
|
4175
|
-
owner,
|
|
4176
|
-
tagName: sel,
|
|
4177
|
-
});
|
|
4178
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
4179
|
-
assert.isTrue(isArray$1(vnode.children), `Invalid vnode for a custom element, it must have children defined.`);
|
|
4180
|
-
}
|
|
4401
|
+
let vm = getAssociatedVMIfPresent(elm); // There is a possibility that a custom element is registered under tagName, in which case, the
|
|
4402
|
+
// initialization is already carry on, and there is nothing else to do here since this hook is
|
|
4403
|
+
// called right after invoking `document.createElement`.
|
|
4404
|
+
|
|
4405
|
+
if (!isUndefined$1(vm)) {
|
|
4181
4406
|
return vm;
|
|
4407
|
+
}
|
|
4408
|
+
|
|
4409
|
+
const {
|
|
4410
|
+
sel,
|
|
4411
|
+
mode,
|
|
4412
|
+
ctor,
|
|
4413
|
+
owner
|
|
4414
|
+
} = vnode;
|
|
4415
|
+
vm = createVM(elm, ctor, renderer, {
|
|
4416
|
+
mode,
|
|
4417
|
+
owner,
|
|
4418
|
+
tagName: sel
|
|
4419
|
+
});
|
|
4420
|
+
|
|
4421
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4422
|
+
assert.isTrue(isArray$1(vnode.children), `Invalid vnode for a custom element, it must have children defined.`);
|
|
4423
|
+
}
|
|
4424
|
+
|
|
4425
|
+
return vm;
|
|
4182
4426
|
}
|
|
4427
|
+
|
|
4183
4428
|
function allocateInSlot(vm, children) {
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4429
|
+
var _a;
|
|
4430
|
+
|
|
4431
|
+
const {
|
|
4432
|
+
cmpSlots: oldSlots
|
|
4433
|
+
} = vm;
|
|
4434
|
+
const cmpSlots = vm.cmpSlots = create(null);
|
|
4435
|
+
|
|
4436
|
+
for (let i = 0, len = children.length; i < len; i += 1) {
|
|
4437
|
+
const vnode = children[i];
|
|
4438
|
+
|
|
4439
|
+
if (isNull(vnode)) {
|
|
4440
|
+
continue;
|
|
4441
|
+
}
|
|
4442
|
+
|
|
4443
|
+
let slotName = '';
|
|
4444
|
+
|
|
4445
|
+
if (isVBaseElement(vnode)) {
|
|
4446
|
+
slotName = ((_a = vnode.data.attrs) === null || _a === void 0 ? void 0 : _a.slot) || '';
|
|
4447
|
+
}
|
|
4448
|
+
|
|
4449
|
+
const vnodes = cmpSlots[slotName] = cmpSlots[slotName] || [];
|
|
4450
|
+
ArrayPush$1.call(vnodes, vnode);
|
|
4451
|
+
}
|
|
4452
|
+
|
|
4453
|
+
if (isFalse(vm.isDirty)) {
|
|
4454
|
+
// We need to determine if the old allocation is really different from the new one
|
|
4455
|
+
// and mark the vm as dirty
|
|
4456
|
+
const oldKeys = keys(oldSlots);
|
|
4457
|
+
|
|
4458
|
+
if (oldKeys.length !== keys(cmpSlots).length) {
|
|
4459
|
+
markComponentAsDirty(vm);
|
|
4460
|
+
return;
|
|
4461
|
+
}
|
|
4462
|
+
|
|
4463
|
+
for (let i = 0, len = oldKeys.length; i < len; i += 1) {
|
|
4464
|
+
const key = oldKeys[i];
|
|
4465
|
+
|
|
4466
|
+
if (isUndefined$1(cmpSlots[key]) || oldSlots[key].length !== cmpSlots[key].length) {
|
|
4467
|
+
markComponentAsDirty(vm);
|
|
4468
|
+
return;
|
|
4469
|
+
}
|
|
4470
|
+
|
|
4471
|
+
const oldVNodes = oldSlots[key];
|
|
4472
|
+
const vnodes = cmpSlots[key];
|
|
4473
|
+
|
|
4474
|
+
for (let j = 0, a = cmpSlots[key].length; j < a; j += 1) {
|
|
4475
|
+
if (oldVNodes[j] !== vnodes[j]) {
|
|
4476
|
+
markComponentAsDirty(vm);
|
|
4477
|
+
return;
|
|
4221
4478
|
}
|
|
4479
|
+
}
|
|
4222
4480
|
}
|
|
4223
|
-
|
|
4224
|
-
// Using a WeakMap instead of a WeakSet because this one works in IE11 :(
|
|
4225
|
-
|
|
4226
|
-
|
|
4481
|
+
}
|
|
4482
|
+
} // Using a WeakMap instead of a WeakSet because this one works in IE11 :(
|
|
4483
|
+
|
|
4484
|
+
|
|
4485
|
+
const FromIteration = new WeakMap(); // dynamic children means it was generated by an iteration
|
|
4227
4486
|
// in a template, and will require a more complex diffing algo.
|
|
4487
|
+
|
|
4228
4488
|
function markAsDynamicChildren(children) {
|
|
4229
|
-
|
|
4489
|
+
FromIteration.set(children, 1);
|
|
4230
4490
|
}
|
|
4491
|
+
|
|
4231
4492
|
function hasDynamicChildren(children) {
|
|
4232
|
-
|
|
4493
|
+
return FromIteration.has(children);
|
|
4233
4494
|
}
|
|
4495
|
+
|
|
4234
4496
|
function createKeyToOldIdx(children, beginIdx, endIdx) {
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4497
|
+
const map = {}; // TODO [#1637]: simplify this by assuming that all vnodes has keys
|
|
4498
|
+
|
|
4499
|
+
for (let j = beginIdx; j <= endIdx; ++j) {
|
|
4500
|
+
const ch = children[j];
|
|
4501
|
+
|
|
4502
|
+
if (isVNode(ch)) {
|
|
4503
|
+
const {
|
|
4504
|
+
key
|
|
4505
|
+
} = ch;
|
|
4506
|
+
|
|
4507
|
+
if (key !== undefined) {
|
|
4508
|
+
map[key] = j;
|
|
4509
|
+
}
|
|
4245
4510
|
}
|
|
4246
|
-
|
|
4511
|
+
}
|
|
4512
|
+
|
|
4513
|
+
return map;
|
|
4247
4514
|
}
|
|
4515
|
+
|
|
4248
4516
|
function updateDynamicChildren(oldCh, newCh, parent, renderer) {
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
}
|
|
4328
|
-
// We've already cloned at least once, so it's no longer read-only
|
|
4329
|
-
oldCh[idxInOld] = undefined;
|
|
4330
|
-
insertNode(elmToMove.elm, parent, oldStartVnode.elm, renderer);
|
|
4331
|
-
}
|
|
4332
|
-
}
|
|
4333
|
-
newStartVnode = newCh[++newStartIdx];
|
|
4334
|
-
}
|
|
4517
|
+
let oldStartIdx = 0;
|
|
4518
|
+
let newStartIdx = 0;
|
|
4519
|
+
let oldEndIdx = oldCh.length - 1;
|
|
4520
|
+
let oldStartVnode = oldCh[0];
|
|
4521
|
+
let oldEndVnode = oldCh[oldEndIdx];
|
|
4522
|
+
const newChEnd = newCh.length - 1;
|
|
4523
|
+
let newEndIdx = newChEnd;
|
|
4524
|
+
let newStartVnode = newCh[0];
|
|
4525
|
+
let newEndVnode = newCh[newEndIdx];
|
|
4526
|
+
let oldKeyToIdx;
|
|
4527
|
+
let idxInOld;
|
|
4528
|
+
let elmToMove;
|
|
4529
|
+
let before;
|
|
4530
|
+
let clonedOldCh = false;
|
|
4531
|
+
|
|
4532
|
+
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
4533
|
+
if (!isVNode(oldStartVnode)) {
|
|
4534
|
+
oldStartVnode = oldCh[++oldStartIdx]; // Vnode might have been moved left
|
|
4535
|
+
} else if (!isVNode(oldEndVnode)) {
|
|
4536
|
+
oldEndVnode = oldCh[--oldEndIdx];
|
|
4537
|
+
} else if (!isVNode(newStartVnode)) {
|
|
4538
|
+
newStartVnode = newCh[++newStartIdx];
|
|
4539
|
+
} else if (!isVNode(newEndVnode)) {
|
|
4540
|
+
newEndVnode = newCh[--newEndIdx];
|
|
4541
|
+
} else if (isSameVnode(oldStartVnode, newStartVnode)) {
|
|
4542
|
+
patch(oldStartVnode, newStartVnode, parent, renderer);
|
|
4543
|
+
oldStartVnode = oldCh[++oldStartIdx];
|
|
4544
|
+
newStartVnode = newCh[++newStartIdx];
|
|
4545
|
+
} else if (isSameVnode(oldEndVnode, newEndVnode)) {
|
|
4546
|
+
patch(oldEndVnode, newEndVnode, parent, renderer);
|
|
4547
|
+
oldEndVnode = oldCh[--oldEndIdx];
|
|
4548
|
+
newEndVnode = newCh[--newEndIdx];
|
|
4549
|
+
} else if (isSameVnode(oldStartVnode, newEndVnode)) {
|
|
4550
|
+
// Vnode moved right
|
|
4551
|
+
patch(oldStartVnode, newEndVnode, parent, renderer);
|
|
4552
|
+
insertNode(oldStartVnode.elm, parent, renderer.nextSibling(oldEndVnode.elm), renderer);
|
|
4553
|
+
oldStartVnode = oldCh[++oldStartIdx];
|
|
4554
|
+
newEndVnode = newCh[--newEndIdx];
|
|
4555
|
+
} else if (isSameVnode(oldEndVnode, newStartVnode)) {
|
|
4556
|
+
// Vnode moved left
|
|
4557
|
+
patch(oldEndVnode, newStartVnode, parent, renderer);
|
|
4558
|
+
insertNode(newStartVnode.elm, parent, oldStartVnode.elm, renderer);
|
|
4559
|
+
oldEndVnode = oldCh[--oldEndIdx];
|
|
4560
|
+
newStartVnode = newCh[++newStartIdx];
|
|
4561
|
+
} else {
|
|
4562
|
+
if (oldKeyToIdx === undefined) {
|
|
4563
|
+
oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx);
|
|
4564
|
+
}
|
|
4565
|
+
|
|
4566
|
+
idxInOld = oldKeyToIdx[newStartVnode.key];
|
|
4567
|
+
|
|
4568
|
+
if (isUndefined$1(idxInOld)) {
|
|
4569
|
+
// New element
|
|
4570
|
+
mount(newStartVnode, parent, renderer, oldStartVnode.elm);
|
|
4571
|
+
newStartVnode = newCh[++newStartIdx];
|
|
4572
|
+
} else {
|
|
4573
|
+
elmToMove = oldCh[idxInOld];
|
|
4574
|
+
|
|
4575
|
+
if (isVNode(elmToMove)) {
|
|
4576
|
+
if (elmToMove.sel !== newStartVnode.sel) {
|
|
4577
|
+
// New element
|
|
4578
|
+
mount(newStartVnode, parent, renderer, oldStartVnode.elm);
|
|
4579
|
+
} else {
|
|
4580
|
+
patch(elmToMove, newStartVnode, parent, renderer); // Delete the old child, but copy the array since it is read-only.
|
|
4581
|
+
// The `oldCh` will be GC'ed after `updateDynamicChildren` is complete,
|
|
4582
|
+
// so we only care about the `oldCh` object inside this function.
|
|
4583
|
+
// To avoid cloning over and over again, we check `clonedOldCh`
|
|
4584
|
+
// and only clone once.
|
|
4585
|
+
|
|
4586
|
+
if (!clonedOldCh) {
|
|
4587
|
+
clonedOldCh = true;
|
|
4588
|
+
oldCh = [...oldCh];
|
|
4589
|
+
} // We've already cloned at least once, so it's no longer read-only
|
|
4590
|
+
|
|
4591
|
+
|
|
4592
|
+
oldCh[idxInOld] = undefined;
|
|
4593
|
+
insertNode(elmToMove.elm, parent, oldStartVnode.elm, renderer);
|
|
4594
|
+
}
|
|
4335
4595
|
}
|
|
4596
|
+
|
|
4597
|
+
newStartVnode = newCh[++newStartIdx];
|
|
4598
|
+
}
|
|
4336
4599
|
}
|
|
4337
|
-
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
|
|
4347
|
-
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
|
|
4600
|
+
}
|
|
4601
|
+
|
|
4602
|
+
if (oldStartIdx <= oldEndIdx || newStartIdx <= newEndIdx) {
|
|
4603
|
+
if (oldStartIdx > oldEndIdx) {
|
|
4604
|
+
// There's some cases in which the sub array of vnodes to be inserted is followed by null(s) and an
|
|
4605
|
+
// already processed vnode, in such cases the vnodes to be inserted should be before that processed vnode.
|
|
4606
|
+
let i = newEndIdx;
|
|
4607
|
+
let n;
|
|
4608
|
+
|
|
4609
|
+
do {
|
|
4610
|
+
n = newCh[++i];
|
|
4611
|
+
} while (!isVNode(n) && i < newChEnd);
|
|
4612
|
+
|
|
4613
|
+
before = isVNode(n) ? n.elm : null;
|
|
4614
|
+
mountVNodes(newCh, parent, renderer, before, newStartIdx, newEndIdx + 1);
|
|
4615
|
+
} else {
|
|
4616
|
+
unmountVNodes(oldCh, parent, renderer, true, oldStartIdx, oldEndIdx + 1);
|
|
4352
4617
|
}
|
|
4618
|
+
}
|
|
4353
4619
|
}
|
|
4620
|
+
|
|
4354
4621
|
function updateStaticChildren(c1, c2, parent, renderer) {
|
|
4355
|
-
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
anchor = n2.elm;
|
|
4389
|
-
}
|
|
4622
|
+
const c1Length = c1.length;
|
|
4623
|
+
const c2Length = c2.length;
|
|
4624
|
+
|
|
4625
|
+
if (c1Length === 0) {
|
|
4626
|
+
// the old list is empty, we can directly insert anything new
|
|
4627
|
+
mountVNodes(c2, parent, renderer, null);
|
|
4628
|
+
return;
|
|
4629
|
+
}
|
|
4630
|
+
|
|
4631
|
+
if (c2Length === 0) {
|
|
4632
|
+
// the old list is nonempty and the new list is empty so we can directly remove all old nodes
|
|
4633
|
+
// this is the case in which the dynamic children of an if-directive should be removed
|
|
4634
|
+
unmountVNodes(c1, parent, renderer, true);
|
|
4635
|
+
return;
|
|
4636
|
+
} // if the old list is not empty, the new list MUST have the same
|
|
4637
|
+
// amount of nodes, that's why we call this static children
|
|
4638
|
+
|
|
4639
|
+
|
|
4640
|
+
let anchor = null;
|
|
4641
|
+
|
|
4642
|
+
for (let i = c2Length - 1; i >= 0; i -= 1) {
|
|
4643
|
+
const n1 = c1[i];
|
|
4644
|
+
const n2 = c2[i];
|
|
4645
|
+
|
|
4646
|
+
if (n2 !== n1) {
|
|
4647
|
+
if (isVNode(n1)) {
|
|
4648
|
+
if (isVNode(n2)) {
|
|
4649
|
+
// both vnodes are equivalent, and we just need to patch them
|
|
4650
|
+
patch(n1, n2, parent, renderer);
|
|
4651
|
+
anchor = n2.elm;
|
|
4652
|
+
} else {
|
|
4653
|
+
// removing the old vnode since the new one is null
|
|
4654
|
+
unmount(n1, parent, renderer, true);
|
|
4390
4655
|
}
|
|
4656
|
+
} else if (isVNode(n2)) {
|
|
4657
|
+
mount(n2, parent, renderer, anchor);
|
|
4658
|
+
anchor = n2.elm;
|
|
4659
|
+
}
|
|
4391
4660
|
}
|
|
4661
|
+
}
|
|
4392
4662
|
}
|
|
4393
4663
|
|
|
4394
4664
|
/*
|
|
@@ -5451,7 +5721,7 @@
|
|
|
5451
5721
|
return `[object:vm ${def.name} (${vm.idx})]`;
|
|
5452
5722
|
};
|
|
5453
5723
|
|
|
5454
|
-
if (
|
|
5724
|
+
if (lwcRuntimeFlags.ENABLE_FORCE_NATIVE_SHADOW_MODE_FOR_TEST) {
|
|
5455
5725
|
vm.shadowMode = 0
|
|
5456
5726
|
/* ShadowMode.Native */
|
|
5457
5727
|
;
|
|
@@ -5490,7 +5760,7 @@
|
|
|
5490
5760
|
} else if (isNativeShadowDefined) {
|
|
5491
5761
|
// Not combined with above condition because @lwc/features only supports identifiers in
|
|
5492
5762
|
// the if-condition.
|
|
5493
|
-
if (
|
|
5763
|
+
if (lwcRuntimeFlags.ENABLE_MIXED_SHADOW_MODE) {
|
|
5494
5764
|
if (def.shadowSupportMode === "any"
|
|
5495
5765
|
/* ShadowSupportMode.Any */
|
|
5496
5766
|
) {
|
|
@@ -6197,7 +6467,7 @@
|
|
|
6197
6467
|
ArrayPush$1.call(wiredConnecting, () => {
|
|
6198
6468
|
connector.connect();
|
|
6199
6469
|
|
|
6200
|
-
if (!
|
|
6470
|
+
if (!lwcRuntimeFlags.ENABLE_WIRE_SYNC_EMIT) {
|
|
6201
6471
|
if (hasDynamicParams) {
|
|
6202
6472
|
Promise.resolve().then(computeConfigAndUpdate);
|
|
6203
6473
|
return;
|
|
@@ -6343,6 +6613,7 @@
|
|
|
6343
6613
|
}
|
|
6344
6614
|
return renderer.nextSibling(hydratedNode);
|
|
6345
6615
|
}
|
|
6616
|
+
const NODE_VALUE_PROP = 'nodeValue';
|
|
6346
6617
|
function hydrateText(node, vnode, renderer) {
|
|
6347
6618
|
var _a;
|
|
6348
6619
|
if (!hasCorrectNodeType(vnode, node, 3 /* EnvNodeTypes.TEXT */, renderer)) {
|
|
@@ -6350,7 +6621,7 @@
|
|
|
6350
6621
|
}
|
|
6351
6622
|
if (process.env.NODE_ENV !== 'production') {
|
|
6352
6623
|
const { getProperty } = renderer;
|
|
6353
|
-
const nodeValue = getProperty(node,
|
|
6624
|
+
const nodeValue = getProperty(node, NODE_VALUE_PROP);
|
|
6354
6625
|
if (nodeValue !== vnode.text && !(nodeValue === '\u200D' && vnode.text === '')) {
|
|
6355
6626
|
logWarn('Hydration mismatch: text values do not match, will recover from the difference', vnode.owner);
|
|
6356
6627
|
}
|
|
@@ -6367,13 +6638,13 @@
|
|
|
6367
6638
|
}
|
|
6368
6639
|
if (process.env.NODE_ENV !== 'production') {
|
|
6369
6640
|
const { getProperty } = renderer;
|
|
6370
|
-
const nodeValue = getProperty(node,
|
|
6641
|
+
const nodeValue = getProperty(node, NODE_VALUE_PROP);
|
|
6371
6642
|
if (nodeValue !== vnode.text) {
|
|
6372
6643
|
logWarn('Hydration mismatch: comment values do not match, will recover from the difference', vnode.owner);
|
|
6373
6644
|
}
|
|
6374
6645
|
}
|
|
6375
6646
|
const { setProperty } = renderer;
|
|
6376
|
-
setProperty(node,
|
|
6647
|
+
setProperty(node, NODE_VALUE_PROP, (_a = vnode.text) !== null && _a !== void 0 ? _a : null);
|
|
6377
6648
|
vnode.elm = node;
|
|
6378
6649
|
return node;
|
|
6379
6650
|
}
|
|
@@ -6641,13 +6912,13 @@
|
|
|
6641
6912
|
if (!hasCorrectNodeType(vnode, ssr, 3 /* EnvNodeTypes.TEXT */, renderer)) {
|
|
6642
6913
|
return false;
|
|
6643
6914
|
}
|
|
6644
|
-
return getProperty(client,
|
|
6915
|
+
return getProperty(client, NODE_VALUE_PROP) === getProperty(ssr, NODE_VALUE_PROP);
|
|
6645
6916
|
}
|
|
6646
6917
|
if (getProperty(client, 'nodeType') === 8 /* EnvNodeTypes.COMMENT */) {
|
|
6647
6918
|
if (!hasCorrectNodeType(vnode, ssr, 8 /* EnvNodeTypes.COMMENT */, renderer)) {
|
|
6648
6919
|
return false;
|
|
6649
6920
|
}
|
|
6650
|
-
return getProperty(client,
|
|
6921
|
+
return getProperty(client, NODE_VALUE_PROP) === getProperty(ssr, NODE_VALUE_PROP);
|
|
6651
6922
|
}
|
|
6652
6923
|
if (!hasCorrectNodeType(vnode, ssr, 1 /* EnvNodeTypes.ELEMENT */, renderer)) {
|
|
6653
6924
|
return false;
|
|
@@ -6803,7 +7074,7 @@
|
|
|
6803
7074
|
}
|
|
6804
7075
|
return ctor;
|
|
6805
7076
|
}
|
|
6806
|
-
/* version: 2.23.
|
|
7077
|
+
/* version: 2.23.3 */
|
|
6807
7078
|
|
|
6808
7079
|
/*
|
|
6809
7080
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -6953,61 +7224,303 @@
|
|
|
6953
7224
|
* SPDX-License-Identifier: MIT
|
|
6954
7225
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
6955
7226
|
*/
|
|
6956
|
-
|
|
6957
|
-
|
|
6958
|
-
|
|
6959
|
-
|
|
6960
|
-
|
|
6961
|
-
|
|
6962
|
-
|
|
6963
|
-
|
|
6964
|
-
|
|
6965
|
-
|
|
6966
|
-
|
|
6967
|
-
//
|
|
6968
|
-
|
|
6969
|
-
|
|
6970
|
-
|
|
6971
|
-
|
|
6972
|
-
|
|
6973
|
-
|
|
6974
|
-
|
|
6975
|
-
|
|
6976
|
-
|
|
6977
|
-
|
|
6978
|
-
|
|
6979
|
-
|
|
6980
|
-
|
|
6981
|
-
|
|
6982
|
-
|
|
6983
|
-
|
|
6984
|
-
|
|
6985
|
-
|
|
6986
|
-
|
|
6987
|
-
|
|
6988
|
-
|
|
6989
|
-
|
|
6990
|
-
|
|
6991
|
-
|
|
6992
|
-
|
|
6993
|
-
|
|
6994
|
-
|
|
6995
|
-
|
|
6996
|
-
html = `<${wrapperTag}>${html}</${wrapperTag}>`;
|
|
7227
|
+
/**
|
|
7228
|
+
* A factory function that produces a renderer.
|
|
7229
|
+
* Renderer encapsulates operations that are required to render an LWC component into the underlying
|
|
7230
|
+
* runtime environment. In the case of @lwc/enigne-dom, it is meant to be used in a DOM environment.
|
|
7231
|
+
* Example usage:
|
|
7232
|
+
* import { renderer, rendererFactory } from 'lwc';
|
|
7233
|
+
* const customRenderer = rendererFactory(renderer);
|
|
7234
|
+
*
|
|
7235
|
+
* @param baseRenderer Either null or the base renderer imported from 'lwc'.
|
|
7236
|
+
*/
|
|
7237
|
+
function rendererFactory(baseRenderer) {
|
|
7238
|
+
// Util functions
|
|
7239
|
+
function assertInvariant(value, msg) {
|
|
7240
|
+
if (!value) {
|
|
7241
|
+
throw new Error(`Invariant Violation: ${msg}`);
|
|
7242
|
+
}
|
|
7243
|
+
}
|
|
7244
|
+
function isNull(obj) {
|
|
7245
|
+
return obj === null;
|
|
7246
|
+
}
|
|
7247
|
+
function isUndefined(obj) {
|
|
7248
|
+
return obj === undefined;
|
|
7249
|
+
}
|
|
7250
|
+
let getCustomElement;
|
|
7251
|
+
let defineCustomElement;
|
|
7252
|
+
let HTMLElementConstructor;
|
|
7253
|
+
function isCustomElementRegistryAvailable() {
|
|
7254
|
+
if (typeof customElements === 'undefined') {
|
|
7255
|
+
return false;
|
|
7256
|
+
}
|
|
7257
|
+
try {
|
|
7258
|
+
// dereference HTMLElement global because babel wraps globals in compat mode with a
|
|
7259
|
+
// _wrapNativeSuper()
|
|
7260
|
+
// This is a problem because LWCUpgradableElement extends renderer.HTMLElementExported which does not
|
|
7261
|
+
// get wrapped by babel.
|
|
7262
|
+
const HTMLElementAlias = HTMLElement;
|
|
7263
|
+
// In case we use compat mode with a modern browser, the compat mode transformation
|
|
7264
|
+
// invokes the DOM api with an .apply() or .call() to initialize any DOM api sub-classing,
|
|
7265
|
+
// which are not equipped to be initialized that way.
|
|
7266
|
+
class clazz extends HTMLElementAlias {
|
|
6997
7267
|
}
|
|
7268
|
+
customElements.define('lwc-test-' + Math.floor(Math.random() * 1000000), clazz);
|
|
7269
|
+
new clazz();
|
|
7270
|
+
return true;
|
|
7271
|
+
}
|
|
7272
|
+
catch (_a) {
|
|
7273
|
+
return false;
|
|
6998
7274
|
}
|
|
6999
|
-
|
|
7000
|
-
|
|
7001
|
-
|
|
7002
|
-
|
|
7003
|
-
|
|
7004
|
-
|
|
7005
|
-
|
|
7006
|
-
|
|
7275
|
+
}
|
|
7276
|
+
if (isCustomElementRegistryAvailable()) {
|
|
7277
|
+
getCustomElement = customElements.get.bind(customElements);
|
|
7278
|
+
defineCustomElement = customElements.define.bind(customElements);
|
|
7279
|
+
HTMLElementConstructor = HTMLElement;
|
|
7280
|
+
}
|
|
7281
|
+
else {
|
|
7282
|
+
const registry = Object.create(null);
|
|
7283
|
+
const reverseRegistry = new WeakMap();
|
|
7284
|
+
defineCustomElement = function define(name, ctor) {
|
|
7285
|
+
if (name !== String.prototype.toLowerCase.call(name) || registry[name]) {
|
|
7286
|
+
throw new TypeError(`Invalid Registration`);
|
|
7287
|
+
}
|
|
7288
|
+
registry[name] = ctor;
|
|
7289
|
+
reverseRegistry.set(ctor, name);
|
|
7290
|
+
};
|
|
7291
|
+
getCustomElement = function get(name) {
|
|
7292
|
+
return registry[name];
|
|
7293
|
+
};
|
|
7294
|
+
HTMLElementConstructor = function HTMLElement() {
|
|
7295
|
+
if (!(this instanceof HTMLElement)) {
|
|
7296
|
+
throw new TypeError(`Invalid Invocation`);
|
|
7297
|
+
}
|
|
7298
|
+
const { constructor } = this;
|
|
7299
|
+
const name = reverseRegistry.get(constructor);
|
|
7300
|
+
if (!name) {
|
|
7301
|
+
throw new TypeError(`Invalid Construction`);
|
|
7302
|
+
}
|
|
7303
|
+
const elm = document.createElement(name);
|
|
7304
|
+
Object.setPrototypeOf(elm, constructor.prototype);
|
|
7305
|
+
return elm;
|
|
7306
|
+
};
|
|
7307
|
+
HTMLElementConstructor.prototype = HTMLElement.prototype;
|
|
7308
|
+
}
|
|
7309
|
+
function cloneNode(node, deep) {
|
|
7310
|
+
return node.cloneNode(deep);
|
|
7311
|
+
}
|
|
7312
|
+
function createElement(tagName, namespace) {
|
|
7313
|
+
return isUndefined(namespace)
|
|
7314
|
+
? document.createElement(tagName)
|
|
7315
|
+
: document.createElementNS(namespace, tagName);
|
|
7316
|
+
}
|
|
7317
|
+
function createText(content) {
|
|
7318
|
+
return document.createTextNode(content);
|
|
7319
|
+
}
|
|
7320
|
+
function createComment(content) {
|
|
7321
|
+
return document.createComment(content);
|
|
7322
|
+
}
|
|
7323
|
+
let createFragment;
|
|
7324
|
+
// IE11 lacks support for this feature
|
|
7325
|
+
const SUPPORTS_TEMPLATE = typeof HTMLTemplateElement === 'function';
|
|
7326
|
+
if (SUPPORTS_TEMPLATE) {
|
|
7327
|
+
// Parse the fragment HTML string into DOM
|
|
7328
|
+
createFragment = function (html) {
|
|
7329
|
+
const template = document.createElement('template');
|
|
7330
|
+
template.innerHTML = html;
|
|
7331
|
+
return template.content.firstChild;
|
|
7332
|
+
};
|
|
7333
|
+
}
|
|
7334
|
+
else {
|
|
7335
|
+
// In browsers that don't support <template> (e.g. IE11), we need to be careful to wrap elements like
|
|
7336
|
+
// <td> in the proper container elements (e.g. <tbody>), because otherwise they will be parsed as null.
|
|
7337
|
+
// Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L273-L280
|
|
7338
|
+
// With other elements added from:
|
|
7339
|
+
// https://github.com/sindresorhus/html-tags/blob/95dcdd5/index.js
|
|
7340
|
+
// Using the test:
|
|
7341
|
+
// document.createRange().createContextualFragment(`<${tag}></${tag}>`).firstChild === null
|
|
7342
|
+
// And omitting <html>, <head>, and <body> as these are not practical in an LWC component.
|
|
7343
|
+
const topLevelWrappingMap = {
|
|
7344
|
+
caption: ['table'],
|
|
7345
|
+
col: ['colgroup', 'table'],
|
|
7346
|
+
colgroup: ['table'],
|
|
7347
|
+
option: ['select'],
|
|
7348
|
+
tbody: ['table'],
|
|
7349
|
+
td: ['tr', 'tbody', 'table'],
|
|
7350
|
+
th: ['tr', 'tbody', 'table'],
|
|
7351
|
+
thead: ['table'],
|
|
7352
|
+
tfoot: ['table'],
|
|
7353
|
+
tr: ['tbody', 'table'],
|
|
7354
|
+
};
|
|
7355
|
+
// Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L282-L288
|
|
7356
|
+
const getTagName = function (text) {
|
|
7357
|
+
return (/<([a-z][^/\0>\x20\t\r\n\f]+)/i.exec(text) || ['', ''])[1].toLowerCase();
|
|
7358
|
+
};
|
|
7359
|
+
// Via https://github.com/webcomponents/polyfills/blob/ee1db33/packages/template/template.js#L295-L320
|
|
7360
|
+
createFragment = function (html) {
|
|
7361
|
+
const wrapperTags = topLevelWrappingMap[getTagName(html)];
|
|
7362
|
+
if (!isUndefined(wrapperTags)) {
|
|
7363
|
+
for (const wrapperTag of wrapperTags) {
|
|
7364
|
+
html = `<${wrapperTag}>${html}</${wrapperTag}>`;
|
|
7365
|
+
}
|
|
7007
7366
|
}
|
|
7367
|
+
// For IE11, the document title must not be undefined, but it can be an empty string
|
|
7368
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createHTMLDocument#browser_compatibility
|
|
7369
|
+
const doc = document.implementation.createHTMLDocument('');
|
|
7370
|
+
doc.body.innerHTML = html;
|
|
7371
|
+
let content = doc.body;
|
|
7372
|
+
if (!isUndefined(wrapperTags)) {
|
|
7373
|
+
for (let i = 0; i < wrapperTags.length; i++) {
|
|
7374
|
+
content = content.firstChild;
|
|
7375
|
+
}
|
|
7376
|
+
}
|
|
7377
|
+
return content.firstChild;
|
|
7378
|
+
};
|
|
7379
|
+
}
|
|
7380
|
+
function insert(node, parent, anchor) {
|
|
7381
|
+
parent.insertBefore(node, anchor);
|
|
7382
|
+
}
|
|
7383
|
+
function remove(node, parent) {
|
|
7384
|
+
parent.removeChild(node);
|
|
7385
|
+
}
|
|
7386
|
+
function nextSibling(node) {
|
|
7387
|
+
return node.nextSibling;
|
|
7388
|
+
}
|
|
7389
|
+
function attachShadow(element, options) {
|
|
7390
|
+
// `shadowRoot` will be non-null in two cases:
|
|
7391
|
+
// 1. upon initial load with an SSR-generated DOM, while in Shadow render mode
|
|
7392
|
+
// 2. when a webapp author places <c-app> in their static HTML and mounts their
|
|
7393
|
+
// root component with customElement.define('c-app', Ctor)
|
|
7394
|
+
if (!isNull(element.shadowRoot)) {
|
|
7395
|
+
return element.shadowRoot;
|
|
7396
|
+
}
|
|
7397
|
+
return element.attachShadow(options);
|
|
7398
|
+
}
|
|
7399
|
+
function setText(node, content) {
|
|
7400
|
+
node.nodeValue = content;
|
|
7401
|
+
}
|
|
7402
|
+
function getProperty(node, key) {
|
|
7403
|
+
return node[key];
|
|
7404
|
+
}
|
|
7405
|
+
function setProperty(node, key, value) {
|
|
7406
|
+
node[key] = value;
|
|
7407
|
+
}
|
|
7408
|
+
function getAttribute(element, name, namespace) {
|
|
7409
|
+
return isUndefined(namespace)
|
|
7410
|
+
? element.getAttribute(name)
|
|
7411
|
+
: element.getAttributeNS(namespace, name);
|
|
7412
|
+
}
|
|
7413
|
+
function setAttribute(element, name, value, namespace) {
|
|
7414
|
+
return isUndefined(namespace)
|
|
7415
|
+
? element.setAttribute(name, value)
|
|
7416
|
+
: element.setAttributeNS(namespace, name, value);
|
|
7417
|
+
}
|
|
7418
|
+
function removeAttribute(element, name, namespace) {
|
|
7419
|
+
if (isUndefined(namespace)) {
|
|
7420
|
+
element.removeAttribute(name);
|
|
7008
7421
|
}
|
|
7009
|
-
|
|
7422
|
+
else {
|
|
7423
|
+
element.removeAttributeNS(namespace, name);
|
|
7424
|
+
}
|
|
7425
|
+
}
|
|
7426
|
+
function addEventListener(target, type, callback, options) {
|
|
7427
|
+
target.addEventListener(type, callback, options);
|
|
7428
|
+
}
|
|
7429
|
+
function removeEventListener(target, type, callback, options) {
|
|
7430
|
+
target.removeEventListener(type, callback, options);
|
|
7431
|
+
}
|
|
7432
|
+
function dispatchEvent(target, event) {
|
|
7433
|
+
return target.dispatchEvent(event);
|
|
7434
|
+
}
|
|
7435
|
+
function getClassList(element) {
|
|
7436
|
+
return element.classList;
|
|
7437
|
+
}
|
|
7438
|
+
function setCSSStyleProperty(element, name, value, important) {
|
|
7439
|
+
// TODO [#0]: How to avoid this type casting? Shall we use a different type interface to
|
|
7440
|
+
// represent elements in the engine?
|
|
7441
|
+
element.style.setProperty(name, value, important ? 'important' : '');
|
|
7442
|
+
}
|
|
7443
|
+
function getBoundingClientRect(element) {
|
|
7444
|
+
return element.getBoundingClientRect();
|
|
7445
|
+
}
|
|
7446
|
+
function querySelector(element, selectors) {
|
|
7447
|
+
return element.querySelector(selectors);
|
|
7448
|
+
}
|
|
7449
|
+
function querySelectorAll(element, selectors) {
|
|
7450
|
+
return element.querySelectorAll(selectors);
|
|
7451
|
+
}
|
|
7452
|
+
function getElementsByTagName(element, tagNameOrWildCard) {
|
|
7453
|
+
return element.getElementsByTagName(tagNameOrWildCard);
|
|
7454
|
+
}
|
|
7455
|
+
function getElementsByClassName(element, names) {
|
|
7456
|
+
return element.getElementsByClassName(names);
|
|
7457
|
+
}
|
|
7458
|
+
function getChildren(element) {
|
|
7459
|
+
return element.children;
|
|
7460
|
+
}
|
|
7461
|
+
function getChildNodes(element) {
|
|
7462
|
+
return element.childNodes;
|
|
7463
|
+
}
|
|
7464
|
+
function getFirstChild(element) {
|
|
7465
|
+
return element.firstChild;
|
|
7466
|
+
}
|
|
7467
|
+
function getFirstElementChild(element) {
|
|
7468
|
+
return element.firstElementChild;
|
|
7469
|
+
}
|
|
7470
|
+
function getLastChild(element) {
|
|
7471
|
+
return element.lastChild;
|
|
7472
|
+
}
|
|
7473
|
+
function getLastElementChild(element) {
|
|
7474
|
+
return element.lastElementChild;
|
|
7475
|
+
}
|
|
7476
|
+
function isConnected(node) {
|
|
7477
|
+
return node.isConnected;
|
|
7478
|
+
}
|
|
7479
|
+
function assertInstanceOfHTMLElement(elm, msg) {
|
|
7480
|
+
assertInvariant(elm instanceof HTMLElement, msg);
|
|
7481
|
+
}
|
|
7482
|
+
const HTMLElementExported = HTMLElementConstructor;
|
|
7483
|
+
const renderer = {
|
|
7484
|
+
HTMLElementExported,
|
|
7485
|
+
insert,
|
|
7486
|
+
remove,
|
|
7487
|
+
cloneNode,
|
|
7488
|
+
createFragment,
|
|
7489
|
+
createElement,
|
|
7490
|
+
createText,
|
|
7491
|
+
createComment,
|
|
7492
|
+
nextSibling,
|
|
7493
|
+
attachShadow,
|
|
7494
|
+
getProperty,
|
|
7495
|
+
setProperty,
|
|
7496
|
+
setText,
|
|
7497
|
+
getAttribute,
|
|
7498
|
+
setAttribute,
|
|
7499
|
+
removeAttribute,
|
|
7500
|
+
addEventListener,
|
|
7501
|
+
removeEventListener,
|
|
7502
|
+
dispatchEvent,
|
|
7503
|
+
getClassList,
|
|
7504
|
+
setCSSStyleProperty,
|
|
7505
|
+
getBoundingClientRect,
|
|
7506
|
+
querySelector,
|
|
7507
|
+
querySelectorAll,
|
|
7508
|
+
getElementsByTagName,
|
|
7509
|
+
getElementsByClassName,
|
|
7510
|
+
getChildren,
|
|
7511
|
+
getChildNodes,
|
|
7512
|
+
getFirstChild,
|
|
7513
|
+
getFirstElementChild,
|
|
7514
|
+
getLastChild,
|
|
7515
|
+
getLastElementChild,
|
|
7516
|
+
isConnected,
|
|
7517
|
+
assertInstanceOfHTMLElement,
|
|
7518
|
+
defineCustomElement,
|
|
7519
|
+
getCustomElement,
|
|
7010
7520
|
};
|
|
7521
|
+
// Meant to inherit any properties passed via the base renderer as the argument to the factory.
|
|
7522
|
+
Object.setPrototypeOf(renderer, baseRenderer);
|
|
7523
|
+
return renderer;
|
|
7011
7524
|
}
|
|
7012
7525
|
|
|
7013
7526
|
/*
|
|
@@ -7016,231 +7529,21 @@
|
|
|
7016
7529
|
* SPDX-License-Identifier: MIT
|
|
7017
7530
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
7018
7531
|
*/
|
|
7019
|
-
|
|
7020
|
-
|
|
7021
|
-
|
|
7022
|
-
|
|
7023
|
-
|
|
7024
|
-
|
|
7025
|
-
|
|
7026
|
-
|
|
7027
|
-
|
|
7028
|
-
|
|
7029
|
-
|
|
7030
|
-
// get wrapped by babel.
|
|
7031
|
-
const HTMLElementAlias = HTMLElement;
|
|
7032
|
-
// In case we use compat mode with a modern browser, the compat mode transformation
|
|
7033
|
-
// invokes the DOM api with an .apply() or .call() to initialize any DOM api sub-classing,
|
|
7034
|
-
// which are not equipped to be initialized that way.
|
|
7035
|
-
class clazz extends HTMLElementAlias {
|
|
7036
|
-
}
|
|
7037
|
-
customElements.define('lwc-test-' + Math.floor(Math.random() * 1000000), clazz);
|
|
7038
|
-
new clazz();
|
|
7039
|
-
return true;
|
|
7040
|
-
}
|
|
7041
|
-
catch (_a) {
|
|
7042
|
-
return false;
|
|
7043
|
-
}
|
|
7044
|
-
}
|
|
7045
|
-
if (isCustomElementRegistryAvailable()) {
|
|
7046
|
-
getCustomElement = customElements.get.bind(customElements);
|
|
7047
|
-
defineCustomElement = customElements.define.bind(customElements);
|
|
7048
|
-
HTMLElementConstructor = HTMLElement;
|
|
7049
|
-
}
|
|
7050
|
-
else {
|
|
7051
|
-
const registry = create(null);
|
|
7052
|
-
const reverseRegistry = new WeakMap();
|
|
7053
|
-
defineCustomElement = function define(name, ctor) {
|
|
7054
|
-
if (name !== StringToLowerCase.call(name) || registry[name]) {
|
|
7055
|
-
throw new TypeError(`Invalid Registration`);
|
|
7056
|
-
}
|
|
7057
|
-
registry[name] = ctor;
|
|
7058
|
-
reverseRegistry.set(ctor, name);
|
|
7059
|
-
};
|
|
7060
|
-
getCustomElement = function get(name) {
|
|
7061
|
-
return registry[name];
|
|
7062
|
-
};
|
|
7063
|
-
HTMLElementConstructor = function HTMLElement() {
|
|
7064
|
-
if (!(this instanceof HTMLElement)) {
|
|
7065
|
-
throw new TypeError(`Invalid Invocation`);
|
|
7066
|
-
}
|
|
7067
|
-
const { constructor } = this;
|
|
7068
|
-
const name = reverseRegistry.get(constructor);
|
|
7069
|
-
if (!name) {
|
|
7070
|
-
throw new TypeError(`Invalid Construction`);
|
|
7071
|
-
}
|
|
7072
|
-
const elm = document.createElement(name);
|
|
7073
|
-
setPrototypeOf(elm, constructor.prototype);
|
|
7074
|
-
return elm;
|
|
7075
|
-
};
|
|
7076
|
-
HTMLElementConstructor.prototype = HTMLElement.prototype;
|
|
7077
|
-
}
|
|
7078
|
-
const isNativeShadowDefined = _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED];
|
|
7079
|
-
const isSyntheticShadowDefined = hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN);
|
|
7080
|
-
function cloneNode(node, deep) {
|
|
7081
|
-
return node.cloneNode(deep);
|
|
7082
|
-
}
|
|
7083
|
-
function createElement$1(tagName, namespace) {
|
|
7084
|
-
return isUndefined$1(namespace)
|
|
7085
|
-
? document.createElement(tagName)
|
|
7086
|
-
: document.createElementNS(namespace, tagName);
|
|
7087
|
-
}
|
|
7088
|
-
function createText(content) {
|
|
7089
|
-
return document.createTextNode(content);
|
|
7090
|
-
}
|
|
7091
|
-
function createComment(content) {
|
|
7092
|
-
return document.createComment(content);
|
|
7093
|
-
}
|
|
7094
|
-
function insert(node, parent, anchor) {
|
|
7095
|
-
parent.insertBefore(node, anchor);
|
|
7096
|
-
}
|
|
7097
|
-
function remove(node, parent) {
|
|
7098
|
-
parent.removeChild(node);
|
|
7099
|
-
}
|
|
7100
|
-
function nextSibling(node) {
|
|
7101
|
-
return node.nextSibling;
|
|
7102
|
-
}
|
|
7103
|
-
function attachShadow(element, options) {
|
|
7104
|
-
// `shadowRoot` will be non-null in two cases:
|
|
7105
|
-
// 1. upon initial load with an SSR-generated DOM, while in Shadow render mode
|
|
7106
|
-
// 2. when a webapp author places <c-app> in their static HTML and mounts their
|
|
7107
|
-
// root component with customElement.define('c-app', Ctor)
|
|
7108
|
-
if (!isNull(element.shadowRoot)) {
|
|
7109
|
-
return element.shadowRoot;
|
|
7110
|
-
}
|
|
7111
|
-
return element.attachShadow(options);
|
|
7112
|
-
}
|
|
7113
|
-
function setText(node, content) {
|
|
7114
|
-
node.nodeValue = content;
|
|
7115
|
-
}
|
|
7116
|
-
function getProperty(node, key) {
|
|
7117
|
-
return node[key];
|
|
7118
|
-
}
|
|
7119
|
-
function setProperty(node, key, value) {
|
|
7120
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
7121
|
-
if (node instanceof Element && !(key in node)) {
|
|
7122
|
-
// TODO [#1297]: Move this validation to the compiler
|
|
7123
|
-
assert.fail(`Unknown public property "${key}" of element <${node.tagName}>. This is likely a typo on the corresponding attribute "${htmlPropertyToAttribute(key)}".`);
|
|
7124
|
-
}
|
|
7125
|
-
}
|
|
7126
|
-
node[key] = value;
|
|
7127
|
-
}
|
|
7128
|
-
function getAttribute(element, name, namespace) {
|
|
7129
|
-
return isUndefined$1(namespace)
|
|
7130
|
-
? element.getAttribute(name)
|
|
7131
|
-
: element.getAttributeNS(namespace, name);
|
|
7132
|
-
}
|
|
7133
|
-
function setAttribute(element, name, value, namespace) {
|
|
7134
|
-
return isUndefined$1(namespace)
|
|
7135
|
-
? element.setAttribute(name, value)
|
|
7136
|
-
: element.setAttributeNS(namespace, name, value);
|
|
7137
|
-
}
|
|
7138
|
-
function removeAttribute(element, name, namespace) {
|
|
7139
|
-
if (isUndefined$1(namespace)) {
|
|
7140
|
-
element.removeAttribute(name);
|
|
7141
|
-
}
|
|
7142
|
-
else {
|
|
7143
|
-
element.removeAttributeNS(namespace, name);
|
|
7144
|
-
}
|
|
7145
|
-
}
|
|
7146
|
-
function addEventListener(target, type, callback, options) {
|
|
7147
|
-
target.addEventListener(type, callback, options);
|
|
7148
|
-
}
|
|
7149
|
-
function removeEventListener(target, type, callback, options) {
|
|
7150
|
-
target.removeEventListener(type, callback, options);
|
|
7151
|
-
}
|
|
7152
|
-
function dispatchEvent(target, event) {
|
|
7153
|
-
return target.dispatchEvent(event);
|
|
7154
|
-
}
|
|
7155
|
-
function getClassList(element) {
|
|
7156
|
-
return element.classList;
|
|
7157
|
-
}
|
|
7158
|
-
function setCSSStyleProperty(element, name, value, important) {
|
|
7159
|
-
// TODO [#0]: How to avoid this type casting? Shall we use a different type interface to
|
|
7160
|
-
// represent elements in the engine?
|
|
7161
|
-
element.style.setProperty(name, value, important ? 'important' : '');
|
|
7162
|
-
}
|
|
7163
|
-
function getBoundingClientRect(element) {
|
|
7164
|
-
return element.getBoundingClientRect();
|
|
7165
|
-
}
|
|
7166
|
-
function querySelector(element, selectors) {
|
|
7167
|
-
return element.querySelector(selectors);
|
|
7168
|
-
}
|
|
7169
|
-
function querySelectorAll(element, selectors) {
|
|
7170
|
-
return element.querySelectorAll(selectors);
|
|
7171
|
-
}
|
|
7172
|
-
function getElementsByTagName(element, tagNameOrWildCard) {
|
|
7173
|
-
return element.getElementsByTagName(tagNameOrWildCard);
|
|
7174
|
-
}
|
|
7175
|
-
function getElementsByClassName(element, names) {
|
|
7176
|
-
return element.getElementsByClassName(names);
|
|
7177
|
-
}
|
|
7178
|
-
function getChildren(element) {
|
|
7179
|
-
return element.children;
|
|
7180
|
-
}
|
|
7181
|
-
function getChildNodes(element) {
|
|
7182
|
-
return element.childNodes;
|
|
7183
|
-
}
|
|
7184
|
-
function getFirstChild(element) {
|
|
7185
|
-
return element.firstChild;
|
|
7186
|
-
}
|
|
7187
|
-
function getFirstElementChild(element) {
|
|
7188
|
-
return element.firstElementChild;
|
|
7189
|
-
}
|
|
7190
|
-
function getLastChild(element) {
|
|
7191
|
-
return element.lastChild;
|
|
7192
|
-
}
|
|
7193
|
-
function getLastElementChild(element) {
|
|
7194
|
-
return element.lastElementChild;
|
|
7195
|
-
}
|
|
7196
|
-
function isConnected(node) {
|
|
7197
|
-
return node.isConnected;
|
|
7198
|
-
}
|
|
7199
|
-
function assertInstanceOfHTMLElement(elm, msg) {
|
|
7200
|
-
assert.invariant(elm instanceof HTMLElement, msg);
|
|
7201
|
-
}
|
|
7202
|
-
const HTMLElementExported = HTMLElementConstructor;
|
|
7203
|
-
const renderer = {
|
|
7204
|
-
isNativeShadowDefined,
|
|
7205
|
-
isSyntheticShadowDefined,
|
|
7206
|
-
HTMLElementExported,
|
|
7207
|
-
insert,
|
|
7208
|
-
remove,
|
|
7209
|
-
cloneNode,
|
|
7210
|
-
createFragment,
|
|
7211
|
-
createElement: createElement$1,
|
|
7212
|
-
createText,
|
|
7213
|
-
createComment,
|
|
7214
|
-
nextSibling,
|
|
7215
|
-
attachShadow,
|
|
7216
|
-
getProperty,
|
|
7217
|
-
setProperty,
|
|
7218
|
-
setText,
|
|
7219
|
-
getAttribute,
|
|
7220
|
-
setAttribute,
|
|
7221
|
-
removeAttribute,
|
|
7222
|
-
addEventListener,
|
|
7223
|
-
removeEventListener,
|
|
7224
|
-
dispatchEvent,
|
|
7225
|
-
getClassList,
|
|
7226
|
-
setCSSStyleProperty,
|
|
7227
|
-
getBoundingClientRect,
|
|
7228
|
-
querySelector,
|
|
7229
|
-
querySelectorAll,
|
|
7230
|
-
getElementsByTagName,
|
|
7231
|
-
getElementsByClassName,
|
|
7232
|
-
getChildren,
|
|
7233
|
-
getChildNodes,
|
|
7234
|
-
getFirstChild,
|
|
7235
|
-
getFirstElementChild,
|
|
7236
|
-
getLastChild,
|
|
7237
|
-
getLastElementChild,
|
|
7238
|
-
isConnected,
|
|
7532
|
+
/**
|
|
7533
|
+
* The base renderer that will be used by engine-core.
|
|
7534
|
+
* This will be used for DOM operations when lwc is running in a browser environment.
|
|
7535
|
+
*/
|
|
7536
|
+
const renderer = assign(
|
|
7537
|
+
// The base renderer will invoke the factory with null and assign additional properties that are
|
|
7538
|
+
// shared across renderers
|
|
7539
|
+
rendererFactory(null),
|
|
7540
|
+
// Properties that are either not required to be sandboxed or rely on a globally shared information
|
|
7541
|
+
{
|
|
7542
|
+
// insertStyleSheet implementation shares a global cache of stylesheet data
|
|
7239
7543
|
insertStylesheet,
|
|
7240
|
-
|
|
7241
|
-
|
|
7242
|
-
|
|
7243
|
-
};
|
|
7544
|
+
isNativeShadowDefined: _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED],
|
|
7545
|
+
isSyntheticShadowDefined: hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN),
|
|
7546
|
+
});
|
|
7244
7547
|
|
|
7245
7548
|
/*
|
|
7246
7549
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -7376,44 +7679,60 @@
|
|
|
7376
7679
|
* SPDX-License-Identifier: MIT
|
|
7377
7680
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
7378
7681
|
*/
|
|
7379
|
-
// TODO [#2472]: Remove this workaround when appropriate.
|
|
7380
7682
|
// eslint-disable-next-line @lwc/lwc-internal/no-global-node
|
|
7683
|
+
|
|
7381
7684
|
const _Node$1 = Node;
|
|
7382
7685
|
const ConnectingSlot = new WeakMap();
|
|
7383
7686
|
const DisconnectingSlot = new WeakMap();
|
|
7687
|
+
|
|
7384
7688
|
function callNodeSlot(node, slot) {
|
|
7385
|
-
|
|
7386
|
-
|
|
7387
|
-
|
|
7388
|
-
|
|
7389
|
-
|
|
7390
|
-
|
|
7391
|
-
|
|
7392
|
-
|
|
7689
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
7690
|
+
assert.isTrue(node, `callNodeSlot() should not be called for a non-object`);
|
|
7691
|
+
}
|
|
7692
|
+
|
|
7693
|
+
const fn = slot.get(node);
|
|
7694
|
+
|
|
7695
|
+
if (!isUndefined$1(fn)) {
|
|
7696
|
+
fn(node);
|
|
7697
|
+
}
|
|
7698
|
+
|
|
7699
|
+
return node; // for convenience
|
|
7393
7700
|
}
|
|
7394
|
-
|
|
7395
|
-
|
|
7396
|
-
|
|
7397
|
-
|
|
7701
|
+
|
|
7702
|
+
if (!lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
7703
|
+
// Monkey patching Node methods to be able to detect the insertions and removal of root elements
|
|
7704
|
+
// created via createElement.
|
|
7705
|
+
const {
|
|
7706
|
+
appendChild,
|
|
7707
|
+
insertBefore,
|
|
7708
|
+
removeChild,
|
|
7709
|
+
replaceChild
|
|
7710
|
+
} = _Node$1.prototype;
|
|
7711
|
+
assign(_Node$1.prototype, {
|
|
7398
7712
|
appendChild(newChild) {
|
|
7399
|
-
|
|
7400
|
-
|
|
7713
|
+
const appendedNode = appendChild.call(this, newChild);
|
|
7714
|
+
return callNodeSlot(appendedNode, ConnectingSlot);
|
|
7401
7715
|
},
|
|
7716
|
+
|
|
7402
7717
|
insertBefore(newChild, referenceNode) {
|
|
7403
|
-
|
|
7404
|
-
|
|
7718
|
+
const insertedNode = insertBefore.call(this, newChild, referenceNode);
|
|
7719
|
+
return callNodeSlot(insertedNode, ConnectingSlot);
|
|
7405
7720
|
},
|
|
7721
|
+
|
|
7406
7722
|
removeChild(oldChild) {
|
|
7407
|
-
|
|
7408
|
-
|
|
7723
|
+
const removedNode = removeChild.call(this, oldChild);
|
|
7724
|
+
return callNodeSlot(removedNode, DisconnectingSlot);
|
|
7409
7725
|
},
|
|
7726
|
+
|
|
7410
7727
|
replaceChild(newChild, oldChild) {
|
|
7411
|
-
|
|
7412
|
-
|
|
7413
|
-
|
|
7414
|
-
|
|
7415
|
-
}
|
|
7416
|
-
|
|
7728
|
+
const replacedNode = replaceChild.call(this, newChild, oldChild);
|
|
7729
|
+
callNodeSlot(replacedNode, DisconnectingSlot);
|
|
7730
|
+
callNodeSlot(newChild, ConnectingSlot);
|
|
7731
|
+
return replacedNode;
|
|
7732
|
+
}
|
|
7733
|
+
|
|
7734
|
+
});
|
|
7735
|
+
}
|
|
7417
7736
|
/**
|
|
7418
7737
|
* EXPERIMENTAL: This function is almost identical to document.createElement with the slightly
|
|
7419
7738
|
* difference that in the options, you can pass the `is` property set to a Constructor instead of
|
|
@@ -7425,38 +7744,50 @@
|
|
|
7425
7744
|
* const el = createElement('x-foo', { is: FooCtor });
|
|
7426
7745
|
* ```
|
|
7427
7746
|
*/
|
|
7747
|
+
|
|
7748
|
+
|
|
7428
7749
|
function createElement(sel, options) {
|
|
7429
|
-
|
|
7430
|
-
|
|
7431
|
-
|
|
7432
|
-
|
|
7433
|
-
|
|
7434
|
-
|
|
7435
|
-
|
|
7436
|
-
|
|
7437
|
-
|
|
7438
|
-
|
|
7439
|
-
|
|
7440
|
-
|
|
7441
|
-
|
|
7442
|
-
|
|
7443
|
-
|
|
7444
|
-
|
|
7445
|
-
|
|
7446
|
-
|
|
7447
|
-
|
|
7448
|
-
|
|
7449
|
-
|
|
7450
|
-
|
|
7451
|
-
|
|
7452
|
-
|
|
7453
|
-
|
|
7750
|
+
if (!isObject(options) || isNull(options)) {
|
|
7751
|
+
throw new TypeError(`"createElement" function expects an object as second parameter but received "${toString$1(options)}".`);
|
|
7752
|
+
}
|
|
7753
|
+
|
|
7754
|
+
const Ctor = options.is;
|
|
7755
|
+
|
|
7756
|
+
if (!isFunction$1(Ctor)) {
|
|
7757
|
+
throw new TypeError(`"createElement" function expects an "is" option with a valid component constructor.`);
|
|
7758
|
+
}
|
|
7759
|
+
|
|
7760
|
+
const UpgradableConstructor = getUpgradableConstructor(sel, renderer);
|
|
7761
|
+
let wasComponentUpgraded = false; // the custom element from the registry is expecting an upgrade callback
|
|
7762
|
+
|
|
7763
|
+
/**
|
|
7764
|
+
* Note: if the upgradable constructor does not expect, or throw when we new it
|
|
7765
|
+
* with a callback as the first argument, we could implement a more advanced
|
|
7766
|
+
* mechanism that only passes that argument if the constructor is known to be
|
|
7767
|
+
* an upgradable custom element.
|
|
7768
|
+
*/
|
|
7769
|
+
|
|
7770
|
+
const element = new UpgradableConstructor(elm => {
|
|
7771
|
+
createVM(elm, Ctor, renderer, {
|
|
7772
|
+
tagName: sel,
|
|
7773
|
+
mode: options.mode !== 'closed' ? 'open' : 'closed',
|
|
7774
|
+
owner: null
|
|
7454
7775
|
});
|
|
7455
|
-
|
|
7456
|
-
|
|
7457
|
-
|
|
7776
|
+
|
|
7777
|
+
if (!lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
|
|
7778
|
+
ConnectingSlot.set(elm, connectRootElement);
|
|
7779
|
+
DisconnectingSlot.set(elm, disconnectRootElement);
|
|
7458
7780
|
}
|
|
7459
|
-
|
|
7781
|
+
|
|
7782
|
+
wasComponentUpgraded = true;
|
|
7783
|
+
});
|
|
7784
|
+
|
|
7785
|
+
if (!wasComponentUpgraded) {
|
|
7786
|
+
/* eslint-disable-next-line no-console */
|
|
7787
|
+
console.error(`Unexpected tag name "${sel}". This name is a registered custom element, preventing LWC to upgrade the element.`);
|
|
7788
|
+
}
|
|
7789
|
+
|
|
7790
|
+
return element;
|
|
7460
7791
|
}
|
|
7461
7792
|
|
|
7462
7793
|
/*
|
|
@@ -7490,7 +7821,7 @@
|
|
|
7490
7821
|
}
|
|
7491
7822
|
// TODO [#1252]: Old behavior that is still used by some pieces of the platform. Manually
|
|
7492
7823
|
// inserted nodes without the `lwc:dom=manual` directive will be considered as global elements.
|
|
7493
|
-
return isSyntheticShadowDefined && !isUndefined$1(node[KEY__SHADOW_RESOLVER]);
|
|
7824
|
+
return renderer.isSyntheticShadowDefined && !isUndefined$1(node[KEY__SHADOW_RESOLVER]);
|
|
7494
7825
|
}
|
|
7495
7826
|
|
|
7496
7827
|
/*
|
|
@@ -7527,7 +7858,7 @@
|
|
|
7527
7858
|
});
|
|
7528
7859
|
freeze(LightningElement);
|
|
7529
7860
|
seal(LightningElement.prototype);
|
|
7530
|
-
/* version: 2.23.
|
|
7861
|
+
/* version: 2.23.3 */
|
|
7531
7862
|
|
|
7532
7863
|
exports.LightningElement = LightningElement;
|
|
7533
7864
|
exports.__unstable__ProfilerControl = profilerControl;
|
|
@@ -7549,6 +7880,7 @@
|
|
|
7549
7880
|
exports.registerDecorators = registerDecorators;
|
|
7550
7881
|
exports.registerTemplate = registerTemplate;
|
|
7551
7882
|
exports.renderer = renderer;
|
|
7883
|
+
exports.rendererFactory = rendererFactory;
|
|
7552
7884
|
exports.sanitizeAttribute = sanitizeAttribute;
|
|
7553
7885
|
exports.setFeatureFlag = setFeatureFlag;
|
|
7554
7886
|
exports.setFeatureFlagForTest = setFeatureFlagForTest;
|