lwc 2.38.1 → 2.39.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 +203 -122
- package/dist/engine-dom/esm/es2017/engine-dom.js.map +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom.js +203 -122
- package/dist/engine-dom/iife/es2017/engine-dom.js.map +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +154 -40
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js.map +1 -1
- package/dist/engine-dom/iife/es5/engine-dom.js +353 -207
- package/dist/engine-dom/iife/es5/engine-dom.js.map +1 -1
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +305 -153
- package/dist/engine-dom/iife/es5/engine-dom_debug.js.map +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom.js +203 -122
- package/dist/engine-dom/umd/es2017/engine-dom.js.map +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +154 -40
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js.map +1 -1
- package/dist/engine-dom/umd/es5/engine-dom.js +353 -207
- package/dist/engine-dom/umd/es5/engine-dom.js.map +1 -1
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +305 -153
- package/dist/engine-dom/umd/es5/engine-dom_debug.js.map +1 -1
- package/dist/engine-server/commonjs/es2017/engine-server.js +168 -75
- package/dist/engine-server/commonjs/es2017/engine-server.js.map +1 -1
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +168 -75
- package/dist/engine-server/esm/es2017/engine-server.js.map +1 -1
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +3 -3
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js.map +1 -1
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +3 -3
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js.map +1 -1
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +3 -3
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js.map +1 -1
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +3 -3
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js.map +1 -1
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +3 -3
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js.map +1 -1
- package/dist/wire-service/esm/es2017/wire-service.js +2 -2
- package/dist/wire-service/esm/es2017/wire-service.js.map +1 -1
- package/dist/wire-service/iife/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service.js.map +1 -1
- package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service_debug.js.map +1 -1
- package/dist/wire-service/iife/es5/wire-service.js +2 -2
- package/dist/wire-service/iife/es5/wire-service.js.map +1 -1
- package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
- package/dist/wire-service/iife/es5/wire-service_debug.js.map +1 -1
- package/dist/wire-service/umd/es2017/wire-service.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service.js.map +1 -1
- package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service_debug.js.map +1 -1
- package/dist/wire-service/umd/es5/wire-service.js +2 -2
- package/dist/wire-service/umd/es5/wire-service.js.map +1 -1
- package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es5/wire-service_debug.js.map +1 -1
- package/package.json +7 -7
|
@@ -351,9 +351,9 @@
|
|
|
351
351
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
352
352
|
*/
|
|
353
353
|
// Increment whenever the LWC template compiler changes
|
|
354
|
-
var LWC_VERSION = "2.
|
|
354
|
+
var LWC_VERSION = "2.39.0";
|
|
355
355
|
var LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
356
|
-
/** version: 2.
|
|
356
|
+
/** version: 2.39.0 */
|
|
357
357
|
|
|
358
358
|
/**
|
|
359
359
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -434,7 +434,7 @@
|
|
|
434
434
|
setFeatureFlag(name, value);
|
|
435
435
|
}
|
|
436
436
|
}
|
|
437
|
-
/** version: 2.
|
|
437
|
+
/** version: 2.39.0 */
|
|
438
438
|
|
|
439
439
|
/**
|
|
440
440
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -498,7 +498,7 @@
|
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
|
-
/** version: 2.
|
|
501
|
+
/** version: 2.39.0 */
|
|
502
502
|
|
|
503
503
|
/*
|
|
504
504
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -3446,6 +3446,123 @@
|
|
|
3446
3446
|
freeze(BaseBridgeElement);
|
|
3447
3447
|
seal(BaseBridgeElement.prototype);
|
|
3448
3448
|
|
|
3449
|
+
/*
|
|
3450
|
+
* Copyright (c) 2023, salesforce.com, inc.
|
|
3451
|
+
* All rights reserved.
|
|
3452
|
+
* SPDX-License-Identifier: MIT
|
|
3453
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
3454
|
+
*/
|
|
3455
|
+
var supportsWeakRefs = typeof WeakRef === 'function' && typeof FinalizationRegistry === 'function';
|
|
3456
|
+
// In browsers that doesn't support WeakRefs, the values will still leak, but at least the keys won't
|
|
3457
|
+
var LegacyWeakMultiMap = /*#__PURE__*/function () {
|
|
3458
|
+
function LegacyWeakMultiMap() {
|
|
3459
|
+
_classCallCheck(this, LegacyWeakMultiMap);
|
|
3460
|
+
this._map = new WeakMap();
|
|
3461
|
+
}
|
|
3462
|
+
_createClass(LegacyWeakMultiMap, [{
|
|
3463
|
+
key: "_getValues",
|
|
3464
|
+
value: function _getValues(key) {
|
|
3465
|
+
var values = this._map.get(key);
|
|
3466
|
+
if (isUndefined$1(values)) {
|
|
3467
|
+
values = new Set();
|
|
3468
|
+
this._map.set(key, values);
|
|
3469
|
+
}
|
|
3470
|
+
return values;
|
|
3471
|
+
}
|
|
3472
|
+
}, {
|
|
3473
|
+
key: "get",
|
|
3474
|
+
value: function get(key) {
|
|
3475
|
+
return this._getValues(key);
|
|
3476
|
+
}
|
|
3477
|
+
}, {
|
|
3478
|
+
key: "add",
|
|
3479
|
+
value: function add(key, vm) {
|
|
3480
|
+
var set = this._getValues(key);
|
|
3481
|
+
set.add(vm);
|
|
3482
|
+
}
|
|
3483
|
+
}, {
|
|
3484
|
+
key: "delete",
|
|
3485
|
+
value: function _delete(key) {
|
|
3486
|
+
this._map.delete(key);
|
|
3487
|
+
}
|
|
3488
|
+
}]);
|
|
3489
|
+
return LegacyWeakMultiMap;
|
|
3490
|
+
}(); // This implementation relies on the WeakRef/FinalizationRegistry proposal.
|
|
3491
|
+
// For some background, see: https://github.com/tc39/proposal-weakrefs
|
|
3492
|
+
var ModernWeakMultiMap = /*#__PURE__*/function () {
|
|
3493
|
+
function ModernWeakMultiMap() {
|
|
3494
|
+
_classCallCheck(this, ModernWeakMultiMap);
|
|
3495
|
+
this._map = new WeakMap();
|
|
3496
|
+
this._registry = new FinalizationRegistry(function (weakRefs) {
|
|
3497
|
+
// This should be considered an optional cleanup method to remove GC'ed values from their respective arrays.
|
|
3498
|
+
// JS VMs are not obligated to call FinalizationRegistry callbacks.
|
|
3499
|
+
// Work backwards, removing stale VMs
|
|
3500
|
+
for (var _i13 = weakRefs.length - 1; _i13 >= 0; _i13--) {
|
|
3501
|
+
var vm = weakRefs[_i13].deref();
|
|
3502
|
+
if (isUndefined$1(vm)) {
|
|
3503
|
+
ArraySplice.call(weakRefs, _i13, 1); // remove
|
|
3504
|
+
}
|
|
3505
|
+
}
|
|
3506
|
+
});
|
|
3507
|
+
}
|
|
3508
|
+
_createClass(ModernWeakMultiMap, [{
|
|
3509
|
+
key: "_getWeakRefs",
|
|
3510
|
+
value: function _getWeakRefs(key) {
|
|
3511
|
+
var weakRefs = this._map.get(key);
|
|
3512
|
+
if (isUndefined$1(weakRefs)) {
|
|
3513
|
+
weakRefs = [];
|
|
3514
|
+
this._map.set(key, weakRefs);
|
|
3515
|
+
}
|
|
3516
|
+
return weakRefs;
|
|
3517
|
+
}
|
|
3518
|
+
}, {
|
|
3519
|
+
key: "get",
|
|
3520
|
+
value: function get(key) {
|
|
3521
|
+
var weakRefs = this._getWeakRefs(key);
|
|
3522
|
+
var result = new Set();
|
|
3523
|
+
var _iterator5 = _createForOfIteratorHelper(weakRefs),
|
|
3524
|
+
_step5;
|
|
3525
|
+
try {
|
|
3526
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
3527
|
+
var weakRef = _step5.value;
|
|
3528
|
+
var vm = weakRef.deref();
|
|
3529
|
+
if (!isUndefined$1(vm)) {
|
|
3530
|
+
result.add(vm);
|
|
3531
|
+
}
|
|
3532
|
+
}
|
|
3533
|
+
} catch (err) {
|
|
3534
|
+
_iterator5.e(err);
|
|
3535
|
+
} finally {
|
|
3536
|
+
_iterator5.f();
|
|
3537
|
+
}
|
|
3538
|
+
return result;
|
|
3539
|
+
}
|
|
3540
|
+
}, {
|
|
3541
|
+
key: "add",
|
|
3542
|
+
value: function add(key, value) {
|
|
3543
|
+
var weakRefs = this._getWeakRefs(key);
|
|
3544
|
+
// We could check for duplicate values here, but it doesn't seem worth it.
|
|
3545
|
+
// We transform the output into a Set anyway
|
|
3546
|
+
ArrayPush$1.call(weakRefs, new WeakRef(value));
|
|
3547
|
+
// It's important here not to leak the second argument, which is the "held value." The FinalizationRegistry
|
|
3548
|
+
// effectively creates a strong reference between the first argument (the "target") and the held value. When
|
|
3549
|
+
// the target is GC'ed, the callback is called, and then the held value is GC'ed.
|
|
3550
|
+
// Putting the key here would mean the key is not GC'ed until the value is GC'ed, which defeats the purpose
|
|
3551
|
+
// of the WeakMap. Whereas putting the weakRefs array here is fine, because it doesn't have a strong reference
|
|
3552
|
+
// to anything. See also this example:
|
|
3553
|
+
// https://gist.github.com/nolanlawson/79a3d36e8e6cc25c5048bb17c1795aea
|
|
3554
|
+
this._registry.register(value, weakRefs);
|
|
3555
|
+
}
|
|
3556
|
+
}, {
|
|
3557
|
+
key: "delete",
|
|
3558
|
+
value: function _delete(key) {
|
|
3559
|
+
this._map.delete(key);
|
|
3560
|
+
}
|
|
3561
|
+
}]);
|
|
3562
|
+
return ModernWeakMultiMap;
|
|
3563
|
+
}();
|
|
3564
|
+
var WeakMultiMap = supportsWeakRefs ? ModernWeakMultiMap : LegacyWeakMultiMap;
|
|
3565
|
+
|
|
3449
3566
|
/*
|
|
3450
3567
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
3451
3568
|
* All rights reserved.
|
|
@@ -3455,46 +3572,65 @@
|
|
|
3455
3572
|
var swappedTemplateMap = new WeakMap();
|
|
3456
3573
|
var swappedComponentMap = new WeakMap();
|
|
3457
3574
|
var swappedStyleMap = new WeakMap();
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
|
|
3575
|
+
// The important thing here is the weak values – VMs are transient (one per component instance) and should be GC'ed,
|
|
3576
|
+
// so we don't want to create strong references to them.
|
|
3577
|
+
// The weak keys are kind of useless, because Templates, LightningElementConstructors, and StylesheetFactories are
|
|
3578
|
+
// never GC'ed. But maybe they will be someday, so we may as well use weak keys too.
|
|
3579
|
+
var activeTemplates = new WeakMultiMap();
|
|
3580
|
+
var activeComponents = new WeakMultiMap();
|
|
3581
|
+
var activeStyles = new WeakMultiMap();
|
|
3461
3582
|
function rehydrateHotTemplate(tpl) {
|
|
3462
3583
|
var list = activeTemplates.get(tpl);
|
|
3463
|
-
|
|
3464
|
-
|
|
3584
|
+
var _iterator6 = _createForOfIteratorHelper(list),
|
|
3585
|
+
_step6;
|
|
3586
|
+
try {
|
|
3587
|
+
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
3588
|
+
var vm = _step6.value;
|
|
3465
3589
|
if (isFalse(vm.isDirty)) {
|
|
3466
3590
|
// forcing the vm to rehydrate in the micro-task:
|
|
3467
3591
|
markComponentAsDirty(vm);
|
|
3468
3592
|
scheduleRehydration(vm);
|
|
3469
3593
|
}
|
|
3470
|
-
}
|
|
3471
|
-
//
|
|
3472
|
-
// since they are not longer related to this template, instead
|
|
3594
|
+
}
|
|
3595
|
+
// Resetting the Set since these VMs are no longer related to this template, instead
|
|
3473
3596
|
// they will get re-associated once these instances are rehydrated.
|
|
3474
|
-
|
|
3597
|
+
} catch (err) {
|
|
3598
|
+
_iterator6.e(err);
|
|
3599
|
+
} finally {
|
|
3600
|
+
_iterator6.f();
|
|
3475
3601
|
}
|
|
3602
|
+
activeTemplates.delete(tpl);
|
|
3476
3603
|
return true;
|
|
3477
3604
|
}
|
|
3478
3605
|
function rehydrateHotStyle(style) {
|
|
3479
3606
|
var list = activeStyles.get(style);
|
|
3480
|
-
|
|
3481
|
-
|
|
3607
|
+
var _iterator7 = _createForOfIteratorHelper(list),
|
|
3608
|
+
_step7;
|
|
3609
|
+
try {
|
|
3610
|
+
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
3611
|
+
var vm = _step7.value;
|
|
3482
3612
|
// if a style definition is swapped, we must reset
|
|
3483
3613
|
// vm's template content in the next micro-task:
|
|
3484
3614
|
forceRehydration(vm);
|
|
3485
|
-
}
|
|
3486
|
-
//
|
|
3487
|
-
// since they are not longer related to this style, instead
|
|
3615
|
+
}
|
|
3616
|
+
// Resetting the Set since these VMs are no longer related to this style, instead
|
|
3488
3617
|
// they will get re-associated once these instances are rehydrated.
|
|
3489
|
-
|
|
3618
|
+
} catch (err) {
|
|
3619
|
+
_iterator7.e(err);
|
|
3620
|
+
} finally {
|
|
3621
|
+
_iterator7.f();
|
|
3490
3622
|
}
|
|
3623
|
+
activeStyles.delete(style);
|
|
3491
3624
|
return true;
|
|
3492
3625
|
}
|
|
3493
3626
|
function rehydrateHotComponent(Ctor) {
|
|
3494
3627
|
var list = activeComponents.get(Ctor);
|
|
3495
3628
|
var canRefreshAllInstances = true;
|
|
3496
|
-
|
|
3497
|
-
|
|
3629
|
+
var _iterator8 = _createForOfIteratorHelper(list),
|
|
3630
|
+
_step8;
|
|
3631
|
+
try {
|
|
3632
|
+
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
|
3633
|
+
var vm = _step8.value;
|
|
3498
3634
|
var owner = vm.owner;
|
|
3499
3635
|
if (!isNull(owner)) {
|
|
3500
3636
|
// if a component class definition is swapped, we must reset
|
|
@@ -3509,12 +3645,15 @@
|
|
|
3509
3645
|
// for example: reload the entire page.
|
|
3510
3646
|
canRefreshAllInstances = false;
|
|
3511
3647
|
}
|
|
3512
|
-
}
|
|
3513
|
-
// resetting the Set
|
|
3514
|
-
// since they are not longer related to this constructor, instead
|
|
3648
|
+
}
|
|
3649
|
+
// resetting the Set since these VMs are no longer related to this constructor, instead
|
|
3515
3650
|
// they will get re-associated once these instances are rehydrated.
|
|
3516
|
-
|
|
3651
|
+
} catch (err) {
|
|
3652
|
+
_iterator8.e(err);
|
|
3653
|
+
} finally {
|
|
3654
|
+
_iterator8.f();
|
|
3517
3655
|
}
|
|
3656
|
+
activeComponents.delete(Ctor);
|
|
3518
3657
|
return canRefreshAllInstances;
|
|
3519
3658
|
}
|
|
3520
3659
|
function getTemplateOrSwappedTemplate(tpl) {
|
|
@@ -3548,72 +3687,36 @@
|
|
|
3548
3687
|
assertNotProd(); // this method should never leak to prod
|
|
3549
3688
|
// tracking active component
|
|
3550
3689
|
var Ctor = vm.def.ctor;
|
|
3551
|
-
var componentVMs = activeComponents.get(Ctor);
|
|
3552
|
-
if (isUndefined$1(componentVMs)) {
|
|
3553
|
-
componentVMs = new Set();
|
|
3554
|
-
activeComponents.set(Ctor, componentVMs);
|
|
3555
|
-
}
|
|
3556
3690
|
// this will allow us to keep track of the hot components
|
|
3557
|
-
|
|
3691
|
+
activeComponents.add(Ctor, vm);
|
|
3558
3692
|
// tracking active template
|
|
3559
3693
|
var tpl = vm.cmpTemplate;
|
|
3560
3694
|
if (tpl) {
|
|
3561
|
-
var templateVMs = activeTemplates.get(tpl);
|
|
3562
|
-
if (isUndefined$1(templateVMs)) {
|
|
3563
|
-
templateVMs = new Set();
|
|
3564
|
-
activeTemplates.set(tpl, templateVMs);
|
|
3565
|
-
}
|
|
3566
3695
|
// this will allow us to keep track of the templates that are
|
|
3567
3696
|
// being used by a hot component
|
|
3568
|
-
|
|
3697
|
+
activeTemplates.add(tpl, vm);
|
|
3569
3698
|
// tracking active styles associated to template
|
|
3570
3699
|
var stylesheets = tpl.stylesheets;
|
|
3571
3700
|
if (!isUndefined$1(stylesheets)) {
|
|
3572
|
-
flattenStylesheets(stylesheets)
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
stylesheetVMs.add(vm);
|
|
3586
|
-
});
|
|
3587
|
-
}
|
|
3588
|
-
}
|
|
3589
|
-
}
|
|
3590
|
-
function removeActiveVM(vm) {
|
|
3591
|
-
assertNotProd(); // this method should never leak to prod
|
|
3592
|
-
// tracking inactive component
|
|
3593
|
-
var Ctor = vm.def.ctor;
|
|
3594
|
-
var list = activeComponents.get(Ctor);
|
|
3595
|
-
if (!isUndefined$1(list)) {
|
|
3596
|
-
// deleting the vm from the set to avoid leaking memory
|
|
3597
|
-
list.delete(vm);
|
|
3598
|
-
}
|
|
3599
|
-
// removing inactive template
|
|
3600
|
-
var tpl = vm.cmpTemplate;
|
|
3601
|
-
if (tpl) {
|
|
3602
|
-
list = activeTemplates.get(tpl);
|
|
3603
|
-
if (!isUndefined$1(list)) {
|
|
3604
|
-
// deleting the vm from the set to avoid leaking memory
|
|
3605
|
-
list.delete(vm);
|
|
3606
|
-
}
|
|
3607
|
-
// removing active styles associated to template
|
|
3608
|
-
var styles = tpl.stylesheets;
|
|
3609
|
-
if (!isUndefined$1(styles)) {
|
|
3610
|
-
flattenStylesheets(styles).forEach(function (style) {
|
|
3611
|
-
list = activeStyles.get(style);
|
|
3612
|
-
if (!isUndefined$1(list)) {
|
|
3613
|
-
// deleting the vm from the set to avoid leaking memory
|
|
3614
|
-
list.delete(vm);
|
|
3701
|
+
var _iterator9 = _createForOfIteratorHelper(flattenStylesheets(stylesheets)),
|
|
3702
|
+
_step9;
|
|
3703
|
+
try {
|
|
3704
|
+
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
3705
|
+
var stylesheet = _step9.value;
|
|
3706
|
+
// this is necessary because we don't hold the list of styles
|
|
3707
|
+
// in the vm, we only hold the selected (already swapped template)
|
|
3708
|
+
// but the styles attached to the template might not be the actual
|
|
3709
|
+
// active ones, but the swapped versions of those.
|
|
3710
|
+
var swappedStylesheet = getStyleOrSwappedStyle(stylesheet);
|
|
3711
|
+
// this will allow us to keep track of the stylesheet that are
|
|
3712
|
+
// being used by a hot component
|
|
3713
|
+
activeStyles.add(swappedStylesheet, vm);
|
|
3615
3714
|
}
|
|
3616
|
-
})
|
|
3715
|
+
} catch (err) {
|
|
3716
|
+
_iterator9.e(err);
|
|
3717
|
+
} finally {
|
|
3718
|
+
_iterator9.f();
|
|
3719
|
+
}
|
|
3617
3720
|
}
|
|
3618
3721
|
}
|
|
3619
3722
|
}
|
|
@@ -3933,8 +4036,8 @@
|
|
|
3933
4036
|
function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
|
|
3934
4037
|
var content = [];
|
|
3935
4038
|
var root;
|
|
3936
|
-
for (var
|
|
3937
|
-
var stylesheet = stylesheets[
|
|
4039
|
+
for (var _i14 = 0; _i14 < stylesheets.length; _i14++) {
|
|
4040
|
+
var stylesheet = stylesheets[_i14];
|
|
3938
4041
|
if (isArray$1(stylesheet)) {
|
|
3939
4042
|
ArrayPush$1.apply(content, evaluateStylesheetsContent(stylesheet, stylesheetToken, vm));
|
|
3940
4043
|
} else {
|
|
@@ -4040,8 +4143,8 @@
|
|
|
4040
4143
|
shadowMode = vm.shadowMode,
|
|
4041
4144
|
insertStylesheet = vm.renderer.insertStylesheet;
|
|
4042
4145
|
if (renderMode === 1 /* RenderMode.Shadow */ && shadowMode === 1 /* ShadowMode.Synthetic */) {
|
|
4043
|
-
for (var
|
|
4044
|
-
insertStylesheet(stylesheets[
|
|
4146
|
+
for (var _i15 = 0; _i15 < stylesheets.length; _i15++) {
|
|
4147
|
+
insertStylesheet(stylesheets[_i15]);
|
|
4045
4148
|
}
|
|
4046
4149
|
} else if (vm.hydrated) {
|
|
4047
4150
|
// Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
|
|
@@ -4054,8 +4157,8 @@
|
|
|
4054
4157
|
var root = getNearestNativeShadowComponent(vm);
|
|
4055
4158
|
// null root means a global style
|
|
4056
4159
|
var target = isNull(root) ? undefined : root.shadowRoot;
|
|
4057
|
-
for (var
|
|
4058
|
-
insertStylesheet(stylesheets[
|
|
4160
|
+
for (var _i16 = 0; _i16 < stylesheets.length; _i16++) {
|
|
4161
|
+
insertStylesheet(stylesheets[_i16], target);
|
|
4059
4162
|
}
|
|
4060
4163
|
}
|
|
4061
4164
|
return null;
|
|
@@ -4369,8 +4472,8 @@
|
|
|
4369
4472
|
return;
|
|
4370
4473
|
}
|
|
4371
4474
|
var setCSSStyleProperty = renderer.setCSSStyleProperty;
|
|
4372
|
-
for (var
|
|
4373
|
-
var _styleDecls$_i = _slicedToArray(styleDecls[
|
|
4475
|
+
for (var _i17 = 0; _i17 < styleDecls.length; _i17++) {
|
|
4476
|
+
var _styleDecls$_i = _slicedToArray(styleDecls[_i17], 3),
|
|
4374
4477
|
prop = _styleDecls$_i[0],
|
|
4375
4478
|
value = _styleDecls$_i[1],
|
|
4376
4479
|
important = _styleDecls$_i[2];
|
|
@@ -4397,7 +4500,12 @@
|
|
|
4397
4500
|
return;
|
|
4398
4501
|
}
|
|
4399
4502
|
if (process.env.NODE_ENV !== 'production') {
|
|
4400
|
-
if (!isSameVnode(n1, n2)
|
|
4503
|
+
if (!isSameVnode(n1, n2) &&
|
|
4504
|
+
// Currently the only scenario when patch does not receive the same vnodes are for
|
|
4505
|
+
// dynamic components. When a dynamic component's constructor changes, the value of its
|
|
4506
|
+
// tag name (sel) will be different. The engine will unmount the previous element
|
|
4507
|
+
// and mount the new one using the new constructor in patchCustomElement.
|
|
4508
|
+
!(isVCustomElement(n1) && isVCustomElement(n2))) {
|
|
4401
4509
|
throw new Error('Expected these VNodes to be the same: ' + JSON.stringify({
|
|
4402
4510
|
sel: n1.sel,
|
|
4403
4511
|
key: n1.key
|
|
@@ -4598,8 +4706,9 @@
|
|
|
4598
4706
|
}
|
|
4599
4707
|
}
|
|
4600
4708
|
function patchCustomElement(n1, n2, parent, renderer) {
|
|
4709
|
+
// TODO [#3331]: This if branch should be removed in 246 with lwc:dynamic
|
|
4601
4710
|
if (n1.ctor !== n2.ctor) {
|
|
4602
|
-
// If the constructor, unmount the current component and mount a new one using the new
|
|
4711
|
+
// If the constructor differs, unmount the current component and mount a new one using the new
|
|
4603
4712
|
// constructor.
|
|
4604
4713
|
var anchor = renderer.nextSibling(n1.elm);
|
|
4605
4714
|
unmount(n1, parent, renderer, true);
|
|
@@ -4852,8 +4961,8 @@
|
|
|
4852
4961
|
// If no VFragment is found in children, we don't need to traverse anything or mark the children dynamic and can return early.
|
|
4853
4962
|
var nodeStack = [];
|
|
4854
4963
|
var fragmentFound = false;
|
|
4855
|
-
for (var
|
|
4856
|
-
var child = children[
|
|
4964
|
+
for (var _i18 = children.length - 1; _i18 > -1; _i18 -= 1) {
|
|
4965
|
+
var child = children[_i18];
|
|
4857
4966
|
ArrayPush$1.call(nodeStack, child);
|
|
4858
4967
|
fragmentFound = fragmentFound || !!(child && isVFragment(child));
|
|
4859
4968
|
}
|
|
@@ -4865,8 +4974,8 @@
|
|
|
4865
4974
|
if (!isNull(currentNode) && isVFragment(currentNode)) {
|
|
4866
4975
|
var fChildren = currentNode.children;
|
|
4867
4976
|
// Ignore the start and end text node delimiters
|
|
4868
|
-
for (var
|
|
4869
|
-
ArrayPush$1.call(nodeStack, fChildren[
|
|
4977
|
+
for (var _i19 = fChildren.length - 2; _i19 > 0; _i19 -= 1) {
|
|
4978
|
+
ArrayPush$1.call(nodeStack, fChildren[_i19]);
|
|
4870
4979
|
}
|
|
4871
4980
|
} else {
|
|
4872
4981
|
ArrayPush$1.call(flattenedChildren, currentNode);
|
|
@@ -4905,8 +5014,8 @@
|
|
|
4905
5014
|
var oldSlotsMapping = vm.cmpSlots.slotAssignments;
|
|
4906
5015
|
var cmpSlotsMapping = create(null);
|
|
4907
5016
|
// Collect all slots into cmpSlotsMapping
|
|
4908
|
-
for (var
|
|
4909
|
-
var vnode = children[
|
|
5017
|
+
for (var _i20 = 0, len = children.length; _i20 < len; _i20 += 1) {
|
|
5018
|
+
var vnode = children[_i20];
|
|
4910
5019
|
if (isNull(vnode)) {
|
|
4911
5020
|
continue;
|
|
4912
5021
|
}
|
|
@@ -4936,8 +5045,8 @@
|
|
|
4936
5045
|
markComponentAsDirty(vm);
|
|
4937
5046
|
return;
|
|
4938
5047
|
}
|
|
4939
|
-
for (var
|
|
4940
|
-
var key = oldKeys[
|
|
5048
|
+
for (var _i21 = 0, _len2 = oldKeys.length; _i21 < _len2; _i21 += 1) {
|
|
5049
|
+
var key = oldKeys[_i21];
|
|
4941
5050
|
if (isUndefined$1(cmpSlotsMapping[key]) || oldSlotsMapping[key].length !== cmpSlotsMapping[key].length) {
|
|
4942
5051
|
markComponentAsDirty(vm);
|
|
4943
5052
|
return;
|
|
@@ -5060,11 +5169,11 @@
|
|
|
5060
5169
|
if (oldStartIdx > oldEndIdx) {
|
|
5061
5170
|
// There's some cases in which the sub array of vnodes to be inserted is followed by null(s) and an
|
|
5062
5171
|
// already processed vnode, in such cases the vnodes to be inserted should be before that processed vnode.
|
|
5063
|
-
var
|
|
5172
|
+
var _i22 = newEndIdx;
|
|
5064
5173
|
var n;
|
|
5065
5174
|
do {
|
|
5066
|
-
n = newCh[++
|
|
5067
|
-
} while (!isVNode(n) &&
|
|
5175
|
+
n = newCh[++_i22];
|
|
5176
|
+
} while (!isVNode(n) && _i22 < newChEnd);
|
|
5068
5177
|
before = isVNode(n) ? n.elm : null;
|
|
5069
5178
|
mountVNodes(newCh, parent, renderer, before, newStartIdx, newEndIdx + 1);
|
|
5070
5179
|
} else {
|
|
@@ -5089,15 +5198,22 @@
|
|
|
5089
5198
|
// if the old list is not empty, the new list MUST have the same
|
|
5090
5199
|
// amount of nodes, that's why we call this static children
|
|
5091
5200
|
var anchor = null;
|
|
5092
|
-
for (var
|
|
5093
|
-
var n1 = c1[
|
|
5094
|
-
var n2 = c2[
|
|
5201
|
+
for (var _i23 = c2Length - 1; _i23 >= 0; _i23 -= 1) {
|
|
5202
|
+
var n1 = c1[_i23];
|
|
5203
|
+
var n2 = c2[_i23];
|
|
5095
5204
|
if (n2 !== n1) {
|
|
5096
5205
|
if (isVNode(n1)) {
|
|
5097
5206
|
if (isVNode(n2)) {
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5207
|
+
if (isSameVnode(n1, n2)) {
|
|
5208
|
+
// both vnodes are equivalent, and we just need to patch them
|
|
5209
|
+
patch(n1, n2, parent, renderer);
|
|
5210
|
+
anchor = n2.elm;
|
|
5211
|
+
} else {
|
|
5212
|
+
// removing the old vnode since the new one is different
|
|
5213
|
+
unmount(n1, parent, renderer, true);
|
|
5214
|
+
mount(n2, parent, renderer, anchor);
|
|
5215
|
+
anchor = n2.elm;
|
|
5216
|
+
}
|
|
5101
5217
|
} else {
|
|
5102
5218
|
// removing the old vnode since the new one is null
|
|
5103
5219
|
unmount(n1, parent, renderer, true);
|
|
@@ -5216,8 +5332,8 @@
|
|
|
5216
5332
|
if (!isUndefined$1(slotset) && !isUndefined$1(slotset.slotAssignments) && !isUndefined$1(slotset.slotAssignments[slotName]) && slotset.slotAssignments[slotName].length !== 0) {
|
|
5217
5333
|
var newChildren = [];
|
|
5218
5334
|
var slotAssignments = slotset.slotAssignments[slotName];
|
|
5219
|
-
for (var
|
|
5220
|
-
var vnode = slotAssignments[
|
|
5335
|
+
for (var _i24 = 0; _i24 < slotAssignments.length; _i24++) {
|
|
5336
|
+
var vnode = slotAssignments[_i24];
|
|
5221
5337
|
if (!isNull(vnode)) {
|
|
5222
5338
|
var assignedNodeIsScopedSlot = isVScopedSlotFragment(vnode);
|
|
5223
5339
|
// The only sniff test for a scoped <slot> element is the presence of `slotData`
|
|
@@ -5494,9 +5610,11 @@
|
|
|
5494
5610
|
return url;
|
|
5495
5611
|
}
|
|
5496
5612
|
/**
|
|
5497
|
-
* create a dynamic component via `<x-foo lwc:dynamic={Ctor}>`
|
|
5613
|
+
* [ddc] - create a (deprecated) dynamic component via `<x-foo lwc:dynamic={Ctor}>`
|
|
5614
|
+
*
|
|
5615
|
+
* TODO [#3331]: remove usage of lwc:dynamic in 246
|
|
5498
5616
|
*/
|
|
5499
|
-
function
|
|
5617
|
+
function ddc(sel, Ctor, data) {
|
|
5500
5618
|
var children = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : EmptyArray;
|
|
5501
5619
|
if (process.env.NODE_ENV !== 'production') {
|
|
5502
5620
|
assert.isTrue(isString(sel), "dc() 1st argument sel must be a string.");
|
|
@@ -5504,7 +5622,7 @@
|
|
|
5504
5622
|
assert.isTrue(arguments.length === 3 || isArray$1(children), "dc() 4nd argument data must be an array.");
|
|
5505
5623
|
}
|
|
5506
5624
|
// null or undefined values should produce a null value in the VNodes
|
|
5507
|
-
if (Ctor
|
|
5625
|
+
if (isNull(Ctor) || isUndefined$1(Ctor)) {
|
|
5508
5626
|
return null;
|
|
5509
5627
|
}
|
|
5510
5628
|
if (!isComponentConstructor(Ctor)) {
|
|
@@ -5512,6 +5630,31 @@
|
|
|
5512
5630
|
}
|
|
5513
5631
|
return c(sel, Ctor, data, children);
|
|
5514
5632
|
}
|
|
5633
|
+
/**
|
|
5634
|
+
* [dc] - create a dynamic component via `<lwc:component lwc:is={Ctor}>`
|
|
5635
|
+
*/
|
|
5636
|
+
function dc(Ctor, data) {
|
|
5637
|
+
var children = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : EmptyArray;
|
|
5638
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
5639
|
+
assert.isTrue(isObject(data), "dc() 2nd argument data must be an object.");
|
|
5640
|
+
assert.isTrue(arguments.length === 3 || isArray$1(children), "dc() 3rd argument data must be an array.");
|
|
5641
|
+
}
|
|
5642
|
+
// Null or undefined values should produce a null value in the VNodes.
|
|
5643
|
+
// This is the only value at compile time as the constructor will not be known.
|
|
5644
|
+
if (isNull(Ctor) || isUndefined$1(Ctor)) {
|
|
5645
|
+
return null;
|
|
5646
|
+
}
|
|
5647
|
+
if (!isComponentConstructor(Ctor)) {
|
|
5648
|
+
throw new Error("Invalid constructor ".concat(toString$1(Ctor), " is not a LightningElement constructor."));
|
|
5649
|
+
}
|
|
5650
|
+
// Look up the dynamic component's name at runtime once the constructor is available.
|
|
5651
|
+
// This information is only known at runtime and is stored as part of registerComponent.
|
|
5652
|
+
var sel = getComponentRegisteredName(Ctor);
|
|
5653
|
+
if (isUndefined$1(sel) || sel === '') {
|
|
5654
|
+
throw new Error("Invalid LWC constructor ".concat(toString$1(Ctor), " does not have a registered name"));
|
|
5655
|
+
}
|
|
5656
|
+
return c(sel, Ctor, data, children);
|
|
5657
|
+
}
|
|
5515
5658
|
/**
|
|
5516
5659
|
* slow children collection marking mechanism. this API allows the compiler to signal
|
|
5517
5660
|
* to the engine that a particular collection of children must be diffed using the slow
|
|
@@ -5573,7 +5716,8 @@
|
|
|
5573
5716
|
gid: gid,
|
|
5574
5717
|
fid: fid,
|
|
5575
5718
|
shc: shc,
|
|
5576
|
-
ssf: ssf
|
|
5719
|
+
ssf: ssf,
|
|
5720
|
+
ddc: ddc
|
|
5577
5721
|
});
|
|
5578
5722
|
|
|
5579
5723
|
/*
|
|
@@ -5739,23 +5883,23 @@
|
|
|
5739
5883
|
var classAttrToken = hasScopedStyles && hasStyleToken ? " class=\"".concat(stylesheetToken, "\"") : '';
|
|
5740
5884
|
var attrToken = hasStyleToken && isSyntheticShadow ? ' ' + stylesheetToken : '';
|
|
5741
5885
|
var htmlFragment = '';
|
|
5742
|
-
for (var
|
|
5743
|
-
switch (keys[
|
|
5886
|
+
for (var _i25 = 0, n = keys.length; _i25 < n; _i25++) {
|
|
5887
|
+
switch (keys[_i25]) {
|
|
5744
5888
|
case 0:
|
|
5745
5889
|
// styleToken in existing class attr
|
|
5746
|
-
htmlFragment += strings[
|
|
5890
|
+
htmlFragment += strings[_i25] + classToken;
|
|
5747
5891
|
break;
|
|
5748
5892
|
case 1:
|
|
5749
5893
|
// styleToken for added class attr
|
|
5750
|
-
htmlFragment += strings[
|
|
5894
|
+
htmlFragment += strings[_i25] + classAttrToken;
|
|
5751
5895
|
break;
|
|
5752
5896
|
case 2:
|
|
5753
5897
|
// styleToken as attr
|
|
5754
|
-
htmlFragment += strings[
|
|
5898
|
+
htmlFragment += strings[_i25] + attrToken;
|
|
5755
5899
|
break;
|
|
5756
5900
|
case 3:
|
|
5757
5901
|
// ${1}${2}
|
|
5758
|
-
htmlFragment += strings[
|
|
5902
|
+
htmlFragment += strings[_i25] + classAttrToken + attrToken;
|
|
5759
5903
|
break;
|
|
5760
5904
|
}
|
|
5761
5905
|
}
|
|
@@ -5860,8 +6004,8 @@
|
|
|
5860
6004
|
}
|
|
5861
6005
|
function computeHasScopedStylesInStylesheets(stylesheets) {
|
|
5862
6006
|
if (hasStyles(stylesheets)) {
|
|
5863
|
-
for (var
|
|
5864
|
-
if (isTrue(stylesheets[
|
|
6007
|
+
for (var _i26 = 0; _i26 < stylesheets.length; _i26++) {
|
|
6008
|
+
if (isTrue(stylesheets[_i26][KEY__SCOPED_CSS])) {
|
|
5865
6009
|
return true;
|
|
5866
6010
|
}
|
|
5867
6011
|
}
|
|
@@ -5974,29 +6118,34 @@
|
|
|
5974
6118
|
* SPDX-License-Identifier: MIT
|
|
5975
6119
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
5976
6120
|
*/
|
|
5977
|
-
var
|
|
6121
|
+
var registeredComponentMap = new Map();
|
|
5978
6122
|
/**
|
|
5979
6123
|
* INTERNAL: This function can only be invoked by compiled code. The compiler
|
|
5980
6124
|
* will prevent this function from being imported by userland code.
|
|
5981
6125
|
*/
|
|
5982
6126
|
function registerComponent(
|
|
5983
6127
|
// We typically expect a LightningElementConstructor, but technically you can call this with anything
|
|
5984
|
-
Ctor,
|
|
5985
|
-
var tmpl = _ref3.tmpl;
|
|
6128
|
+
Ctor, metadata) {
|
|
5986
6129
|
if (isFunction$1(Ctor)) {
|
|
5987
6130
|
if (process.env.NODE_ENV !== 'production') {
|
|
5988
6131
|
// There is no point in running this in production, because the version mismatch check relies
|
|
5989
6132
|
// on code comments which are stripped out in production by minifiers
|
|
5990
6133
|
checkVersionMismatch(Ctor, 'component');
|
|
5991
6134
|
}
|
|
5992
|
-
|
|
6135
|
+
// TODO [#3331]: add validation to check the value of metadata.sel is not an empty string.
|
|
6136
|
+
registeredComponentMap.set(Ctor, metadata);
|
|
5993
6137
|
}
|
|
5994
6138
|
// chaining this method as a way to wrap existing assignment of component constructor easily,
|
|
5995
6139
|
// without too much transformation
|
|
5996
6140
|
return Ctor;
|
|
5997
6141
|
}
|
|
5998
6142
|
function getComponentRegisteredTemplate(Ctor) {
|
|
5999
|
-
|
|
6143
|
+
var _a;
|
|
6144
|
+
return (_a = registeredComponentMap.get(Ctor)) === null || _a === void 0 ? void 0 : _a.tmpl;
|
|
6145
|
+
}
|
|
6146
|
+
function getComponentRegisteredName(Ctor) {
|
|
6147
|
+
var _a;
|
|
6148
|
+
return (_a = registeredComponentMap.get(Ctor)) === null || _a === void 0 ? void 0 : _a.sel;
|
|
6000
6149
|
}
|
|
6001
6150
|
function getTemplateReactiveObserver(vm) {
|
|
6002
6151
|
return createReactiveObserver(function () {
|
|
@@ -6059,8 +6208,8 @@
|
|
|
6059
6208
|
if (process.env.NODE_ENV !== 'production') {
|
|
6060
6209
|
assert.isTrue(isObject(service), "Invalid service declaration, ".concat(service, ": service must be an object"));
|
|
6061
6210
|
}
|
|
6062
|
-
for (var
|
|
6063
|
-
var hookName = hooks[
|
|
6211
|
+
for (var _i27 = 0; _i27 < hooks.length; ++_i27) {
|
|
6212
|
+
var hookName = hooks[_i27];
|
|
6064
6213
|
if (hookName in service) {
|
|
6065
6214
|
var l = Services[hookName];
|
|
6066
6215
|
if (isUndefined$1(l)) {
|
|
@@ -6077,8 +6226,8 @@
|
|
|
6077
6226
|
var component = vm.component,
|
|
6078
6227
|
def = vm.def,
|
|
6079
6228
|
context = vm.context;
|
|
6080
|
-
for (var
|
|
6081
|
-
cbs[
|
|
6229
|
+
for (var _i28 = 0, len = cbs.length; _i28 < len; ++_i28) {
|
|
6230
|
+
cbs[_i28].call(undefined, component, {}, def, context);
|
|
6082
6231
|
}
|
|
6083
6232
|
}
|
|
6084
6233
|
|
|
@@ -6136,9 +6285,6 @@
|
|
|
6136
6285
|
runChildNodesDisconnectedCallback(vm);
|
|
6137
6286
|
runLightChildNodesDisconnectedCallback(vm);
|
|
6138
6287
|
}
|
|
6139
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
6140
|
-
removeActiveVM(vm);
|
|
6141
|
-
}
|
|
6142
6288
|
}
|
|
6143
6289
|
// this method is triggered by the diffing algo only when a vnode from the
|
|
6144
6290
|
// old vnode.children is removed from the DOM.
|
|
@@ -6232,8 +6378,8 @@
|
|
|
6232
6378
|
var valid = true;
|
|
6233
6379
|
var validate = function validate(arrayOrStylesheet) {
|
|
6234
6380
|
if (isArray$1(arrayOrStylesheet)) {
|
|
6235
|
-
for (var
|
|
6236
|
-
validate(arrayOrStylesheet[
|
|
6381
|
+
for (var _i29 = 0; _i29 < arrayOrStylesheet.length; _i29++) {
|
|
6382
|
+
validate(arrayOrStylesheet[_i29]);
|
|
6237
6383
|
}
|
|
6238
6384
|
} else if (!isFunction$1(arrayOrStylesheet)) {
|
|
6239
6385
|
// function assumed to be a stylesheet factory
|
|
@@ -6401,17 +6547,17 @@
|
|
|
6401
6547
|
return a.idx - b.idx;
|
|
6402
6548
|
});
|
|
6403
6549
|
rehydrateQueue = []; // reset to a new queue
|
|
6404
|
-
for (var
|
|
6405
|
-
var vm = vms[
|
|
6550
|
+
for (var _i30 = 0, len = vms.length; _i30 < len; _i30 += 1) {
|
|
6551
|
+
var vm = vms[_i30];
|
|
6406
6552
|
try {
|
|
6407
6553
|
rehydrate(vm);
|
|
6408
6554
|
} catch (error) {
|
|
6409
|
-
if (
|
|
6555
|
+
if (_i30 + 1 < len) {
|
|
6410
6556
|
// pieces of the queue are still pending to be rehydrated, those should have priority
|
|
6411
6557
|
if (rehydrateQueue.length === 0) {
|
|
6412
6558
|
addCallbackToNextTick(flushRehydrationQueue);
|
|
6413
6559
|
}
|
|
6414
|
-
ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms,
|
|
6560
|
+
ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms, _i30 + 1));
|
|
6415
6561
|
}
|
|
6416
6562
|
// we need to end the measure before throwing.
|
|
6417
6563
|
logGlobalOperationEnd(8 /* OperationId.GlobalRehydrate */);
|
|
@@ -6480,8 +6626,8 @@
|
|
|
6480
6626
|
var vCustomElementCollection = vm.velements;
|
|
6481
6627
|
// Reporting disconnection for every child in inverse order since they are
|
|
6482
6628
|
// inserted in reserved order.
|
|
6483
|
-
for (var
|
|
6484
|
-
var elm = vCustomElementCollection[
|
|
6629
|
+
for (var _i31 = vCustomElementCollection.length - 1; _i31 >= 0; _i31 -= 1) {
|
|
6630
|
+
var elm = vCustomElementCollection[_i31].elm;
|
|
6485
6631
|
// There are two cases where the element could be undefined:
|
|
6486
6632
|
// * when there is an error during the construction phase, and an error
|
|
6487
6633
|
// boundary picks it, there is a possibility that the VCustomElement
|
|
@@ -6512,8 +6658,8 @@
|
|
|
6512
6658
|
* defined on its shadow.
|
|
6513
6659
|
*/
|
|
6514
6660
|
function recursivelyDisconnectChildren(vnodes) {
|
|
6515
|
-
for (var
|
|
6516
|
-
var vnode = vnodes[
|
|
6661
|
+
for (var _i32 = 0, len = vnodes.length; _i32 < len; _i32 += 1) {
|
|
6662
|
+
var vnode = vnodes[_i32];
|
|
6517
6663
|
if (!isNull(vnode) && !isUndefined$1(vnode.elm)) {
|
|
6518
6664
|
switch (vnode.type) {
|
|
6519
6665
|
case 2 /* VNodeType.Element */:
|
|
@@ -6546,8 +6692,8 @@
|
|
|
6546
6692
|
function recursivelyRemoveChildren(vnodes, vm) {
|
|
6547
6693
|
var renderRoot = vm.renderRoot,
|
|
6548
6694
|
remove = vm.renderer.remove;
|
|
6549
|
-
for (var
|
|
6550
|
-
var vnode = vnodes[
|
|
6695
|
+
for (var _i33 = 0, len = vnodes.length; _i33 < len; _i33 += 1) {
|
|
6696
|
+
var vnode = vnodes[_i33];
|
|
6551
6697
|
if (!isNull(vnode)) {
|
|
6552
6698
|
// VFragments are special; their .elm property does not point to the root element since they have no single root.
|
|
6553
6699
|
if (isVFragment(vnode)) {
|
|
@@ -6678,17 +6824,17 @@
|
|
|
6678
6824
|
// if our id is null or empty, nobody can reference us
|
|
6679
6825
|
return;
|
|
6680
6826
|
}
|
|
6681
|
-
var
|
|
6682
|
-
|
|
6827
|
+
var _iterator10 = _createForOfIteratorHelper(ID_REFERENCING_ATTRIBUTES_SET),
|
|
6828
|
+
_step10;
|
|
6683
6829
|
try {
|
|
6684
|
-
for (
|
|
6685
|
-
var idRefAttrName =
|
|
6830
|
+
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
|
6831
|
+
var idRefAttrName = _step10.value;
|
|
6686
6832
|
// Query all global elements with this attribute. The attribute selector syntax `~=` is for values
|
|
6687
6833
|
// that reference multiple IDs, separated by whitespace.
|
|
6688
6834
|
var query = "[".concat(idRefAttrName, "~=\"").concat(CSS.escape(attrValue), "\"]");
|
|
6689
6835
|
var sourceElements = querySelectorAll.call(document, query);
|
|
6690
|
-
for (var
|
|
6691
|
-
var sourceElement = sourceElements[
|
|
6836
|
+
for (var _i34 = 0; _i34 < sourceElements.length; _i34++) {
|
|
6837
|
+
var sourceElement = sourceElements[_i34];
|
|
6692
6838
|
var sourceRoot = sourceElement.getRootNode();
|
|
6693
6839
|
if (sourceRoot !== root) {
|
|
6694
6840
|
reportViolation$1(sourceElement, elm, idRefAttrName);
|
|
@@ -6697,18 +6843,18 @@
|
|
|
6697
6843
|
}
|
|
6698
6844
|
}
|
|
6699
6845
|
} catch (err) {
|
|
6700
|
-
|
|
6846
|
+
_iterator10.e(err);
|
|
6701
6847
|
} finally {
|
|
6702
|
-
|
|
6848
|
+
_iterator10.f();
|
|
6703
6849
|
}
|
|
6704
6850
|
} else {
|
|
6705
6851
|
// elm is the source, find the target
|
|
6706
6852
|
var ids = parseIdRefAttributeValue(attrValue);
|
|
6707
|
-
var
|
|
6708
|
-
|
|
6853
|
+
var _iterator11 = _createForOfIteratorHelper(ids),
|
|
6854
|
+
_step11;
|
|
6709
6855
|
try {
|
|
6710
|
-
for (
|
|
6711
|
-
var id =
|
|
6856
|
+
for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
|
|
6857
|
+
var id = _step11.value;
|
|
6712
6858
|
var target = getElementById.call(document, id);
|
|
6713
6859
|
if (!isNull(target)) {
|
|
6714
6860
|
var targetRoot = target.getRootNode();
|
|
@@ -6719,9 +6865,9 @@
|
|
|
6719
6865
|
}
|
|
6720
6866
|
}
|
|
6721
6867
|
} catch (err) {
|
|
6722
|
-
|
|
6868
|
+
_iterator11.e(err);
|
|
6723
6869
|
} finally {
|
|
6724
|
-
|
|
6870
|
+
_iterator11.f();
|
|
6725
6871
|
}
|
|
6726
6872
|
}
|
|
6727
6873
|
}
|
|
@@ -6851,11 +6997,11 @@
|
|
|
6851
6997
|
function enableDetection() {
|
|
6852
6998
|
var _Element = Element,
|
|
6853
6999
|
prototype = _Element.prototype;
|
|
6854
|
-
var
|
|
6855
|
-
|
|
7000
|
+
var _iterator12 = _createForOfIteratorHelper(NON_STANDARD_ARIA_PROPS),
|
|
7001
|
+
_step12;
|
|
6856
7002
|
try {
|
|
6857
7003
|
var _loop3 = function _loop3() {
|
|
6858
|
-
var prop =
|
|
7004
|
+
var prop = _step12.value;
|
|
6859
7005
|
var descriptor = getOwnPropertyDescriptor$1(prototype, prop);
|
|
6860
7006
|
// The descriptor should exist because the @lwc/aria-reflection polyfill has run by now.
|
|
6861
7007
|
// This happens automatically because of the ordering of imports.
|
|
@@ -6882,13 +7028,13 @@
|
|
|
6882
7028
|
enumerable: true
|
|
6883
7029
|
});
|
|
6884
7030
|
};
|
|
6885
|
-
for (
|
|
7031
|
+
for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
|
|
6886
7032
|
_loop3();
|
|
6887
7033
|
}
|
|
6888
7034
|
} catch (err) {
|
|
6889
|
-
|
|
7035
|
+
_iterator12.e(err);
|
|
6890
7036
|
} finally {
|
|
6891
|
-
|
|
7037
|
+
_iterator12.f();
|
|
6892
7038
|
}
|
|
6893
7039
|
}
|
|
6894
7040
|
// No point in running this code if we're not in a browser, or if the global polyfill is not loaded
|
|
@@ -7104,8 +7250,8 @@
|
|
|
7104
7250
|
var nextNode = node;
|
|
7105
7251
|
var anchor = null;
|
|
7106
7252
|
var renderer = owner.renderer;
|
|
7107
|
-
for (var
|
|
7108
|
-
var childVnode = children[
|
|
7253
|
+
for (var _i35 = 0; _i35 < children.length; _i35++) {
|
|
7254
|
+
var childVnode = children[_i35];
|
|
7109
7255
|
if (!isNull(childVnode)) {
|
|
7110
7256
|
if (nextNode) {
|
|
7111
7257
|
nextNode = hydrateNode(nextNode, childVnode, renderer);
|
|
@@ -7196,8 +7342,8 @@
|
|
|
7196
7342
|
var nodesAreCompatible = true;
|
|
7197
7343
|
// Validate attributes, though we could always recovery from those by running the update mods.
|
|
7198
7344
|
// Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
|
|
7199
|
-
for (var
|
|
7200
|
-
var _Object$entries$_i = _slicedToArray(_Object$entries[
|
|
7345
|
+
for (var _i36 = 0, _Object$entries = Object.entries(attrs); _i36 < _Object$entries.length; _i36++) {
|
|
7346
|
+
var _Object$entries$_i = _slicedToArray(_Object$entries[_i36], 2),
|
|
7201
7347
|
attrName = _Object$entries$_i[0],
|
|
7202
7348
|
attrValue = _Object$entries$_i[1];
|
|
7203
7349
|
var owner = vnode.owner;
|
|
@@ -7298,8 +7444,8 @@
|
|
|
7298
7444
|
var parsedVnodeStyle = parseStyleText(elmStyle);
|
|
7299
7445
|
var expectedStyle = [];
|
|
7300
7446
|
// styleMap is used when style is set to static value.
|
|
7301
|
-
for (var
|
|
7302
|
-
var _styleDecls$_i2 = _slicedToArray(styleDecls[
|
|
7447
|
+
for (var _i37 = 0, n = styleDecls.length; _i37 < n; _i37++) {
|
|
7448
|
+
var _styleDecls$_i2 = _slicedToArray(styleDecls[_i37], 3),
|
|
7303
7449
|
prop = _styleDecls$_i2[0],
|
|
7304
7450
|
value = _styleDecls$_i2[1],
|
|
7305
7451
|
important = _styleDecls$_i2[2];
|
|
@@ -7430,11 +7576,11 @@
|
|
|
7430
7576
|
function warnOnArrayMutation(stylesheets) {
|
|
7431
7577
|
// We can't handle users calling Array.prototype.slice.call(tmpl.stylesheets), but
|
|
7432
7578
|
// we can at least warn when they use the most common mutation methods.
|
|
7433
|
-
var
|
|
7434
|
-
|
|
7579
|
+
var _iterator13 = _createForOfIteratorHelper(ARRAY_MUTATION_METHODS),
|
|
7580
|
+
_step13;
|
|
7435
7581
|
try {
|
|
7436
7582
|
var _loop4 = function _loop4() {
|
|
7437
|
-
var prop =
|
|
7583
|
+
var prop = _step13.value;
|
|
7438
7584
|
var originalArrayMethod = getOriginalArrayMethod(prop);
|
|
7439
7585
|
stylesheets[prop] = function arrayMutationWarningWrapper() {
|
|
7440
7586
|
reportTemplateViolation('stylesheets');
|
|
@@ -7442,23 +7588,23 @@
|
|
|
7442
7588
|
return originalArrayMethod.apply(this, arguments);
|
|
7443
7589
|
};
|
|
7444
7590
|
};
|
|
7445
|
-
for (
|
|
7591
|
+
for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
|
|
7446
7592
|
_loop4();
|
|
7447
7593
|
}
|
|
7448
7594
|
} catch (err) {
|
|
7449
|
-
|
|
7595
|
+
_iterator13.e(err);
|
|
7450
7596
|
} finally {
|
|
7451
|
-
|
|
7597
|
+
_iterator13.f();
|
|
7452
7598
|
}
|
|
7453
7599
|
}
|
|
7454
7600
|
// Warn if the user tries to mutate a stylesheet factory function, e.g.:
|
|
7455
7601
|
// `stylesheet.$scoped$ = true`
|
|
7456
7602
|
function warnOnStylesheetFunctionMutation(stylesheet) {
|
|
7457
|
-
var
|
|
7458
|
-
|
|
7603
|
+
var _iterator14 = _createForOfIteratorHelper(STYLESHEET_PROPS),
|
|
7604
|
+
_step14;
|
|
7459
7605
|
try {
|
|
7460
7606
|
var _loop5 = function _loop5() {
|
|
7461
|
-
var prop =
|
|
7607
|
+
var prop = _step14.value;
|
|
7462
7608
|
var value = stylesheet[prop];
|
|
7463
7609
|
defineProperty(stylesheet, prop, {
|
|
7464
7610
|
enumerable: true,
|
|
@@ -7472,13 +7618,13 @@
|
|
|
7472
7618
|
}
|
|
7473
7619
|
});
|
|
7474
7620
|
};
|
|
7475
|
-
for (
|
|
7621
|
+
for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
|
|
7476
7622
|
_loop5();
|
|
7477
7623
|
}
|
|
7478
7624
|
} catch (err) {
|
|
7479
|
-
|
|
7625
|
+
_iterator14.e(err);
|
|
7480
7626
|
} finally {
|
|
7481
|
-
|
|
7627
|
+
_iterator14.f();
|
|
7482
7628
|
}
|
|
7483
7629
|
}
|
|
7484
7630
|
// Warn on either array or stylesheet (function) mutation, in a deeply-nested array
|
|
@@ -7500,8 +7646,8 @@
|
|
|
7500
7646
|
// Deep-traverse an array (of arrays) of stylesheet factory functions, and call the callback for every array/function
|
|
7501
7647
|
function traverseStylesheets(stylesheets, callback) {
|
|
7502
7648
|
callback(stylesheets);
|
|
7503
|
-
for (var
|
|
7504
|
-
var stylesheet = stylesheets[
|
|
7649
|
+
for (var _i38 = 0; _i38 < stylesheets.length; _i38++) {
|
|
7650
|
+
var stylesheet = stylesheets[_i38];
|
|
7505
7651
|
if (isArray$1(stylesheet)) {
|
|
7506
7652
|
traverseStylesheets(stylesheet, callback);
|
|
7507
7653
|
} else {
|
|
@@ -7513,11 +7659,11 @@
|
|
|
7513
7659
|
if (!isUndefined$1(tmpl.stylesheets)) {
|
|
7514
7660
|
trackStylesheetsMutation(tmpl.stylesheets);
|
|
7515
7661
|
}
|
|
7516
|
-
var
|
|
7517
|
-
|
|
7662
|
+
var _iterator15 = _createForOfIteratorHelper(TEMPLATE_PROPS),
|
|
7663
|
+
_step15;
|
|
7518
7664
|
try {
|
|
7519
7665
|
var _loop6 = function _loop6() {
|
|
7520
|
-
var prop =
|
|
7666
|
+
var prop = _step15.value;
|
|
7521
7667
|
var value = tmpl[prop];
|
|
7522
7668
|
defineProperty(tmpl, prop, {
|
|
7523
7669
|
enumerable: true,
|
|
@@ -7533,13 +7679,13 @@
|
|
|
7533
7679
|
}
|
|
7534
7680
|
});
|
|
7535
7681
|
};
|
|
7536
|
-
for (
|
|
7682
|
+
for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {
|
|
7537
7683
|
_loop6();
|
|
7538
7684
|
}
|
|
7539
7685
|
} catch (err) {
|
|
7540
|
-
|
|
7686
|
+
_iterator15.e(err);
|
|
7541
7687
|
} finally {
|
|
7542
|
-
|
|
7688
|
+
_iterator15.f();
|
|
7543
7689
|
}
|
|
7544
7690
|
var originalDescriptor = getOwnPropertyDescriptor$1(tmpl, 'stylesheetTokens');
|
|
7545
7691
|
defineProperty(tmpl, 'stylesheetTokens', {
|
|
@@ -7648,7 +7794,7 @@
|
|
|
7648
7794
|
}
|
|
7649
7795
|
return getReadOnlyProxy(obj);
|
|
7650
7796
|
}
|
|
7651
|
-
/* version: 2.
|
|
7797
|
+
/* version: 2.39.0 */
|
|
7652
7798
|
|
|
7653
7799
|
/*
|
|
7654
7800
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -8074,7 +8220,7 @@
|
|
|
8074
8220
|
function isNull(obj) {
|
|
8075
8221
|
return obj === null;
|
|
8076
8222
|
}
|
|
8077
|
-
/** version: 2.
|
|
8223
|
+
/** version: 2.39.0 */
|
|
8078
8224
|
|
|
8079
8225
|
/*
|
|
8080
8226
|
* Copyright (c) 2023, salesforce.com, inc.
|
|
@@ -8085,10 +8231,10 @@
|
|
|
8085
8231
|
var WireContextSubscriptionEvent = /*#__PURE__*/function (_CustomEvent) {
|
|
8086
8232
|
_inherits(WireContextSubscriptionEvent, _CustomEvent);
|
|
8087
8233
|
var _super6 = _createSuper(WireContextSubscriptionEvent);
|
|
8088
|
-
function WireContextSubscriptionEvent(adapterToken,
|
|
8234
|
+
function WireContextSubscriptionEvent(adapterToken, _ref5) {
|
|
8089
8235
|
var _this3;
|
|
8090
|
-
var setNewContext =
|
|
8091
|
-
setDisconnectedCallback =
|
|
8236
|
+
var setNewContext = _ref5.setNewContext,
|
|
8237
|
+
setDisconnectedCallback = _ref5.setDisconnectedCallback;
|
|
8092
8238
|
_classCallCheck(this, WireContextSubscriptionEvent);
|
|
8093
8239
|
_this3 = _super6.call(this, adapterToken, {
|
|
8094
8240
|
bubbles: true,
|
|
@@ -8172,17 +8318,17 @@
|
|
|
8172
8318
|
exports.createFragment = function (html) {
|
|
8173
8319
|
var wrapperTags = topLevelWrappingMap[getTagName(html)];
|
|
8174
8320
|
if (!isUndefined(wrapperTags)) {
|
|
8175
|
-
var
|
|
8176
|
-
|
|
8321
|
+
var _iterator16 = _createForOfIteratorHelper(wrapperTags),
|
|
8322
|
+
_step16;
|
|
8177
8323
|
try {
|
|
8178
|
-
for (
|
|
8179
|
-
var wrapperTag =
|
|
8324
|
+
for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
|
|
8325
|
+
var wrapperTag = _step16.value;
|
|
8180
8326
|
html = "<".concat(wrapperTag, ">").concat(html, "</").concat(wrapperTag, ">");
|
|
8181
8327
|
}
|
|
8182
8328
|
} catch (err) {
|
|
8183
|
-
|
|
8329
|
+
_iterator16.e(err);
|
|
8184
8330
|
} finally {
|
|
8185
|
-
|
|
8331
|
+
_iterator16.f();
|
|
8186
8332
|
}
|
|
8187
8333
|
}
|
|
8188
8334
|
// For IE11, the document title must not be undefined, but it can be an empty string
|
|
@@ -8191,7 +8337,7 @@
|
|
|
8191
8337
|
doc.body.innerHTML = html;
|
|
8192
8338
|
var content = doc.body;
|
|
8193
8339
|
if (!isUndefined(wrapperTags)) {
|
|
8194
|
-
for (var
|
|
8340
|
+
for (var _i39 = 0; _i39 < wrapperTags.length; _i39++) {
|
|
8195
8341
|
content = content.firstChild;
|
|
8196
8342
|
}
|
|
8197
8343
|
}
|
|
@@ -8390,8 +8536,8 @@
|
|
|
8390
8536
|
tagName: element.tagName.toLowerCase(),
|
|
8391
8537
|
hydrated: true
|
|
8392
8538
|
});
|
|
8393
|
-
for (var
|
|
8394
|
-
var _Object$entries2$_i = _slicedToArray(_Object$entries2[
|
|
8539
|
+
for (var _i40 = 0, _Object$entries2 = Object.entries(props); _i40 < _Object$entries2.length; _i40++) {
|
|
8540
|
+
var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i40], 2),
|
|
8395
8541
|
key = _Object$entries2$_i[0],
|
|
8396
8542
|
value = _Object$entries2$_i[1];
|
|
8397
8543
|
element[key] = value;
|
|
@@ -8716,7 +8862,7 @@
|
|
|
8716
8862
|
});
|
|
8717
8863
|
});
|
|
8718
8864
|
}
|
|
8719
|
-
/* version: 2.
|
|
8865
|
+
/* version: 2.39.0 */
|
|
8720
8866
|
|
|
8721
8867
|
exports.LightningElement = LightningElement;
|
|
8722
8868
|
exports.__unstable__ProfilerControl = profilerControl;
|