lwc 2.38.1 → 2.39.1
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
|
@@ -348,9 +348,9 @@ var LWC = (function (exports) {
|
|
|
348
348
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
349
349
|
*/
|
|
350
350
|
// Increment whenever the LWC template compiler changes
|
|
351
|
-
var LWC_VERSION = "2.
|
|
351
|
+
var LWC_VERSION = "2.39.1";
|
|
352
352
|
var LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
353
|
-
/** version: 2.
|
|
353
|
+
/** version: 2.39.1 */
|
|
354
354
|
|
|
355
355
|
/**
|
|
356
356
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -431,7 +431,7 @@ var LWC = (function (exports) {
|
|
|
431
431
|
setFeatureFlag(name, value);
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
|
-
/** version: 2.
|
|
434
|
+
/** version: 2.39.1 */
|
|
435
435
|
|
|
436
436
|
/**
|
|
437
437
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -495,7 +495,7 @@ var LWC = (function (exports) {
|
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
|
-
/** version: 2.
|
|
498
|
+
/** version: 2.39.1 */
|
|
499
499
|
|
|
500
500
|
/*
|
|
501
501
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -3443,6 +3443,123 @@ var LWC = (function (exports) {
|
|
|
3443
3443
|
freeze(BaseBridgeElement);
|
|
3444
3444
|
seal(BaseBridgeElement.prototype);
|
|
3445
3445
|
|
|
3446
|
+
/*
|
|
3447
|
+
* Copyright (c) 2023, salesforce.com, inc.
|
|
3448
|
+
* All rights reserved.
|
|
3449
|
+
* SPDX-License-Identifier: MIT
|
|
3450
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
3451
|
+
*/
|
|
3452
|
+
var supportsWeakRefs = typeof WeakRef === 'function' && typeof FinalizationRegistry === 'function';
|
|
3453
|
+
// In browsers that doesn't support WeakRefs, the values will still leak, but at least the keys won't
|
|
3454
|
+
var LegacyWeakMultiMap = /*#__PURE__*/function () {
|
|
3455
|
+
function LegacyWeakMultiMap() {
|
|
3456
|
+
_classCallCheck(this, LegacyWeakMultiMap);
|
|
3457
|
+
this._map = new WeakMap();
|
|
3458
|
+
}
|
|
3459
|
+
_createClass(LegacyWeakMultiMap, [{
|
|
3460
|
+
key: "_getValues",
|
|
3461
|
+
value: function _getValues(key) {
|
|
3462
|
+
var values = this._map.get(key);
|
|
3463
|
+
if (isUndefined$1(values)) {
|
|
3464
|
+
values = new Set();
|
|
3465
|
+
this._map.set(key, values);
|
|
3466
|
+
}
|
|
3467
|
+
return values;
|
|
3468
|
+
}
|
|
3469
|
+
}, {
|
|
3470
|
+
key: "get",
|
|
3471
|
+
value: function get(key) {
|
|
3472
|
+
return this._getValues(key);
|
|
3473
|
+
}
|
|
3474
|
+
}, {
|
|
3475
|
+
key: "add",
|
|
3476
|
+
value: function add(key, vm) {
|
|
3477
|
+
var set = this._getValues(key);
|
|
3478
|
+
set.add(vm);
|
|
3479
|
+
}
|
|
3480
|
+
}, {
|
|
3481
|
+
key: "delete",
|
|
3482
|
+
value: function _delete(key) {
|
|
3483
|
+
this._map.delete(key);
|
|
3484
|
+
}
|
|
3485
|
+
}]);
|
|
3486
|
+
return LegacyWeakMultiMap;
|
|
3487
|
+
}(); // This implementation relies on the WeakRef/FinalizationRegistry proposal.
|
|
3488
|
+
// For some background, see: https://github.com/tc39/proposal-weakrefs
|
|
3489
|
+
var ModernWeakMultiMap = /*#__PURE__*/function () {
|
|
3490
|
+
function ModernWeakMultiMap() {
|
|
3491
|
+
_classCallCheck(this, ModernWeakMultiMap);
|
|
3492
|
+
this._map = new WeakMap();
|
|
3493
|
+
this._registry = new FinalizationRegistry(function (weakRefs) {
|
|
3494
|
+
// This should be considered an optional cleanup method to remove GC'ed values from their respective arrays.
|
|
3495
|
+
// JS VMs are not obligated to call FinalizationRegistry callbacks.
|
|
3496
|
+
// Work backwards, removing stale VMs
|
|
3497
|
+
for (var _i13 = weakRefs.length - 1; _i13 >= 0; _i13--) {
|
|
3498
|
+
var vm = weakRefs[_i13].deref();
|
|
3499
|
+
if (isUndefined$1(vm)) {
|
|
3500
|
+
ArraySplice.call(weakRefs, _i13, 1); // remove
|
|
3501
|
+
}
|
|
3502
|
+
}
|
|
3503
|
+
});
|
|
3504
|
+
}
|
|
3505
|
+
_createClass(ModernWeakMultiMap, [{
|
|
3506
|
+
key: "_getWeakRefs",
|
|
3507
|
+
value: function _getWeakRefs(key) {
|
|
3508
|
+
var weakRefs = this._map.get(key);
|
|
3509
|
+
if (isUndefined$1(weakRefs)) {
|
|
3510
|
+
weakRefs = [];
|
|
3511
|
+
this._map.set(key, weakRefs);
|
|
3512
|
+
}
|
|
3513
|
+
return weakRefs;
|
|
3514
|
+
}
|
|
3515
|
+
}, {
|
|
3516
|
+
key: "get",
|
|
3517
|
+
value: function get(key) {
|
|
3518
|
+
var weakRefs = this._getWeakRefs(key);
|
|
3519
|
+
var result = new Set();
|
|
3520
|
+
var _iterator5 = _createForOfIteratorHelper(weakRefs),
|
|
3521
|
+
_step5;
|
|
3522
|
+
try {
|
|
3523
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
3524
|
+
var weakRef = _step5.value;
|
|
3525
|
+
var vm = weakRef.deref();
|
|
3526
|
+
if (!isUndefined$1(vm)) {
|
|
3527
|
+
result.add(vm);
|
|
3528
|
+
}
|
|
3529
|
+
}
|
|
3530
|
+
} catch (err) {
|
|
3531
|
+
_iterator5.e(err);
|
|
3532
|
+
} finally {
|
|
3533
|
+
_iterator5.f();
|
|
3534
|
+
}
|
|
3535
|
+
return result;
|
|
3536
|
+
}
|
|
3537
|
+
}, {
|
|
3538
|
+
key: "add",
|
|
3539
|
+
value: function add(key, value) {
|
|
3540
|
+
var weakRefs = this._getWeakRefs(key);
|
|
3541
|
+
// We could check for duplicate values here, but it doesn't seem worth it.
|
|
3542
|
+
// We transform the output into a Set anyway
|
|
3543
|
+
ArrayPush$1.call(weakRefs, new WeakRef(value));
|
|
3544
|
+
// It's important here not to leak the second argument, which is the "held value." The FinalizationRegistry
|
|
3545
|
+
// effectively creates a strong reference between the first argument (the "target") and the held value. When
|
|
3546
|
+
// the target is GC'ed, the callback is called, and then the held value is GC'ed.
|
|
3547
|
+
// Putting the key here would mean the key is not GC'ed until the value is GC'ed, which defeats the purpose
|
|
3548
|
+
// of the WeakMap. Whereas putting the weakRefs array here is fine, because it doesn't have a strong reference
|
|
3549
|
+
// to anything. See also this example:
|
|
3550
|
+
// https://gist.github.com/nolanlawson/79a3d36e8e6cc25c5048bb17c1795aea
|
|
3551
|
+
this._registry.register(value, weakRefs);
|
|
3552
|
+
}
|
|
3553
|
+
}, {
|
|
3554
|
+
key: "delete",
|
|
3555
|
+
value: function _delete(key) {
|
|
3556
|
+
this._map.delete(key);
|
|
3557
|
+
}
|
|
3558
|
+
}]);
|
|
3559
|
+
return ModernWeakMultiMap;
|
|
3560
|
+
}();
|
|
3561
|
+
var WeakMultiMap = supportsWeakRefs ? ModernWeakMultiMap : LegacyWeakMultiMap;
|
|
3562
|
+
|
|
3446
3563
|
/*
|
|
3447
3564
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
3448
3565
|
* All rights reserved.
|
|
@@ -3452,46 +3569,65 @@ var LWC = (function (exports) {
|
|
|
3452
3569
|
var swappedTemplateMap = new WeakMap();
|
|
3453
3570
|
var swappedComponentMap = new WeakMap();
|
|
3454
3571
|
var swappedStyleMap = new WeakMap();
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3572
|
+
// The important thing here is the weak values – VMs are transient (one per component instance) and should be GC'ed,
|
|
3573
|
+
// so we don't want to create strong references to them.
|
|
3574
|
+
// The weak keys are kind of useless, because Templates, LightningElementConstructors, and StylesheetFactories are
|
|
3575
|
+
// never GC'ed. But maybe they will be someday, so we may as well use weak keys too.
|
|
3576
|
+
var activeTemplates = new WeakMultiMap();
|
|
3577
|
+
var activeComponents = new WeakMultiMap();
|
|
3578
|
+
var activeStyles = new WeakMultiMap();
|
|
3458
3579
|
function rehydrateHotTemplate(tpl) {
|
|
3459
3580
|
var list = activeTemplates.get(tpl);
|
|
3460
|
-
|
|
3461
|
-
|
|
3581
|
+
var _iterator6 = _createForOfIteratorHelper(list),
|
|
3582
|
+
_step6;
|
|
3583
|
+
try {
|
|
3584
|
+
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
3585
|
+
var vm = _step6.value;
|
|
3462
3586
|
if (isFalse(vm.isDirty)) {
|
|
3463
3587
|
// forcing the vm to rehydrate in the micro-task:
|
|
3464
3588
|
markComponentAsDirty(vm);
|
|
3465
3589
|
scheduleRehydration(vm);
|
|
3466
3590
|
}
|
|
3467
|
-
}
|
|
3468
|
-
//
|
|
3469
|
-
// since they are not longer related to this template, instead
|
|
3591
|
+
}
|
|
3592
|
+
// Resetting the Set since these VMs are no longer related to this template, instead
|
|
3470
3593
|
// they will get re-associated once these instances are rehydrated.
|
|
3471
|
-
|
|
3594
|
+
} catch (err) {
|
|
3595
|
+
_iterator6.e(err);
|
|
3596
|
+
} finally {
|
|
3597
|
+
_iterator6.f();
|
|
3472
3598
|
}
|
|
3599
|
+
activeTemplates.delete(tpl);
|
|
3473
3600
|
return true;
|
|
3474
3601
|
}
|
|
3475
3602
|
function rehydrateHotStyle(style) {
|
|
3476
3603
|
var list = activeStyles.get(style);
|
|
3477
|
-
|
|
3478
|
-
|
|
3604
|
+
var _iterator7 = _createForOfIteratorHelper(list),
|
|
3605
|
+
_step7;
|
|
3606
|
+
try {
|
|
3607
|
+
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
3608
|
+
var vm = _step7.value;
|
|
3479
3609
|
// if a style definition is swapped, we must reset
|
|
3480
3610
|
// vm's template content in the next micro-task:
|
|
3481
3611
|
forceRehydration(vm);
|
|
3482
|
-
}
|
|
3483
|
-
//
|
|
3484
|
-
// since they are not longer related to this style, instead
|
|
3612
|
+
}
|
|
3613
|
+
// Resetting the Set since these VMs are no longer related to this style, instead
|
|
3485
3614
|
// they will get re-associated once these instances are rehydrated.
|
|
3486
|
-
|
|
3615
|
+
} catch (err) {
|
|
3616
|
+
_iterator7.e(err);
|
|
3617
|
+
} finally {
|
|
3618
|
+
_iterator7.f();
|
|
3487
3619
|
}
|
|
3620
|
+
activeStyles.delete(style);
|
|
3488
3621
|
return true;
|
|
3489
3622
|
}
|
|
3490
3623
|
function rehydrateHotComponent(Ctor) {
|
|
3491
3624
|
var list = activeComponents.get(Ctor);
|
|
3492
3625
|
var canRefreshAllInstances = true;
|
|
3493
|
-
|
|
3494
|
-
|
|
3626
|
+
var _iterator8 = _createForOfIteratorHelper(list),
|
|
3627
|
+
_step8;
|
|
3628
|
+
try {
|
|
3629
|
+
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
|
3630
|
+
var vm = _step8.value;
|
|
3495
3631
|
var owner = vm.owner;
|
|
3496
3632
|
if (!isNull(owner)) {
|
|
3497
3633
|
// if a component class definition is swapped, we must reset
|
|
@@ -3506,12 +3642,15 @@ var LWC = (function (exports) {
|
|
|
3506
3642
|
// for example: reload the entire page.
|
|
3507
3643
|
canRefreshAllInstances = false;
|
|
3508
3644
|
}
|
|
3509
|
-
}
|
|
3510
|
-
// resetting the Set
|
|
3511
|
-
// since they are not longer related to this constructor, instead
|
|
3645
|
+
}
|
|
3646
|
+
// resetting the Set since these VMs are no longer related to this constructor, instead
|
|
3512
3647
|
// they will get re-associated once these instances are rehydrated.
|
|
3513
|
-
|
|
3648
|
+
} catch (err) {
|
|
3649
|
+
_iterator8.e(err);
|
|
3650
|
+
} finally {
|
|
3651
|
+
_iterator8.f();
|
|
3514
3652
|
}
|
|
3653
|
+
activeComponents.delete(Ctor);
|
|
3515
3654
|
return canRefreshAllInstances;
|
|
3516
3655
|
}
|
|
3517
3656
|
function getTemplateOrSwappedTemplate(tpl) {
|
|
@@ -3545,72 +3684,36 @@ var LWC = (function (exports) {
|
|
|
3545
3684
|
assertNotProd(); // this method should never leak to prod
|
|
3546
3685
|
// tracking active component
|
|
3547
3686
|
var Ctor = vm.def.ctor;
|
|
3548
|
-
var componentVMs = activeComponents.get(Ctor);
|
|
3549
|
-
if (isUndefined$1(componentVMs)) {
|
|
3550
|
-
componentVMs = new Set();
|
|
3551
|
-
activeComponents.set(Ctor, componentVMs);
|
|
3552
|
-
}
|
|
3553
3687
|
// this will allow us to keep track of the hot components
|
|
3554
|
-
|
|
3688
|
+
activeComponents.add(Ctor, vm);
|
|
3555
3689
|
// tracking active template
|
|
3556
3690
|
var tpl = vm.cmpTemplate;
|
|
3557
3691
|
if (tpl) {
|
|
3558
|
-
var templateVMs = activeTemplates.get(tpl);
|
|
3559
|
-
if (isUndefined$1(templateVMs)) {
|
|
3560
|
-
templateVMs = new Set();
|
|
3561
|
-
activeTemplates.set(tpl, templateVMs);
|
|
3562
|
-
}
|
|
3563
3692
|
// this will allow us to keep track of the templates that are
|
|
3564
3693
|
// being used by a hot component
|
|
3565
|
-
|
|
3694
|
+
activeTemplates.add(tpl, vm);
|
|
3566
3695
|
// tracking active styles associated to template
|
|
3567
3696
|
var stylesheets = tpl.stylesheets;
|
|
3568
3697
|
if (!isUndefined$1(stylesheets)) {
|
|
3569
|
-
flattenStylesheets(stylesheets)
|
|
3570
|
-
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
stylesheetVMs.add(vm);
|
|
3583
|
-
});
|
|
3584
|
-
}
|
|
3585
|
-
}
|
|
3586
|
-
}
|
|
3587
|
-
function removeActiveVM(vm) {
|
|
3588
|
-
assertNotProd(); // this method should never leak to prod
|
|
3589
|
-
// tracking inactive component
|
|
3590
|
-
var Ctor = vm.def.ctor;
|
|
3591
|
-
var list = activeComponents.get(Ctor);
|
|
3592
|
-
if (!isUndefined$1(list)) {
|
|
3593
|
-
// deleting the vm from the set to avoid leaking memory
|
|
3594
|
-
list.delete(vm);
|
|
3595
|
-
}
|
|
3596
|
-
// removing inactive template
|
|
3597
|
-
var tpl = vm.cmpTemplate;
|
|
3598
|
-
if (tpl) {
|
|
3599
|
-
list = activeTemplates.get(tpl);
|
|
3600
|
-
if (!isUndefined$1(list)) {
|
|
3601
|
-
// deleting the vm from the set to avoid leaking memory
|
|
3602
|
-
list.delete(vm);
|
|
3603
|
-
}
|
|
3604
|
-
// removing active styles associated to template
|
|
3605
|
-
var styles = tpl.stylesheets;
|
|
3606
|
-
if (!isUndefined$1(styles)) {
|
|
3607
|
-
flattenStylesheets(styles).forEach(function (style) {
|
|
3608
|
-
list = activeStyles.get(style);
|
|
3609
|
-
if (!isUndefined$1(list)) {
|
|
3610
|
-
// deleting the vm from the set to avoid leaking memory
|
|
3611
|
-
list.delete(vm);
|
|
3698
|
+
var _iterator9 = _createForOfIteratorHelper(flattenStylesheets(stylesheets)),
|
|
3699
|
+
_step9;
|
|
3700
|
+
try {
|
|
3701
|
+
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
3702
|
+
var stylesheet = _step9.value;
|
|
3703
|
+
// this is necessary because we don't hold the list of styles
|
|
3704
|
+
// in the vm, we only hold the selected (already swapped template)
|
|
3705
|
+
// but the styles attached to the template might not be the actual
|
|
3706
|
+
// active ones, but the swapped versions of those.
|
|
3707
|
+
var swappedStylesheet = getStyleOrSwappedStyle(stylesheet);
|
|
3708
|
+
// this will allow us to keep track of the stylesheet that are
|
|
3709
|
+
// being used by a hot component
|
|
3710
|
+
activeStyles.add(swappedStylesheet, vm);
|
|
3612
3711
|
}
|
|
3613
|
-
})
|
|
3712
|
+
} catch (err) {
|
|
3713
|
+
_iterator9.e(err);
|
|
3714
|
+
} finally {
|
|
3715
|
+
_iterator9.f();
|
|
3716
|
+
}
|
|
3614
3717
|
}
|
|
3615
3718
|
}
|
|
3616
3719
|
}
|
|
@@ -3930,8 +4033,8 @@ var LWC = (function (exports) {
|
|
|
3930
4033
|
function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
|
|
3931
4034
|
var content = [];
|
|
3932
4035
|
var root;
|
|
3933
|
-
for (var
|
|
3934
|
-
var stylesheet = stylesheets[
|
|
4036
|
+
for (var _i14 = 0; _i14 < stylesheets.length; _i14++) {
|
|
4037
|
+
var stylesheet = stylesheets[_i14];
|
|
3935
4038
|
if (isArray$1(stylesheet)) {
|
|
3936
4039
|
ArrayPush$1.apply(content, evaluateStylesheetsContent(stylesheet, stylesheetToken, vm));
|
|
3937
4040
|
} else {
|
|
@@ -4037,8 +4140,8 @@ var LWC = (function (exports) {
|
|
|
4037
4140
|
shadowMode = vm.shadowMode,
|
|
4038
4141
|
insertStylesheet = vm.renderer.insertStylesheet;
|
|
4039
4142
|
if (renderMode === 1 /* RenderMode.Shadow */ && shadowMode === 1 /* ShadowMode.Synthetic */) {
|
|
4040
|
-
for (var
|
|
4041
|
-
insertStylesheet(stylesheets[
|
|
4143
|
+
for (var _i15 = 0; _i15 < stylesheets.length; _i15++) {
|
|
4144
|
+
insertStylesheet(stylesheets[_i15]);
|
|
4042
4145
|
}
|
|
4043
4146
|
} else if (vm.hydrated) {
|
|
4044
4147
|
// Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
|
|
@@ -4051,8 +4154,8 @@ var LWC = (function (exports) {
|
|
|
4051
4154
|
var root = getNearestNativeShadowComponent(vm);
|
|
4052
4155
|
// null root means a global style
|
|
4053
4156
|
var target = isNull(root) ? undefined : root.shadowRoot;
|
|
4054
|
-
for (var
|
|
4055
|
-
insertStylesheet(stylesheets[
|
|
4157
|
+
for (var _i16 = 0; _i16 < stylesheets.length; _i16++) {
|
|
4158
|
+
insertStylesheet(stylesheets[_i16], target);
|
|
4056
4159
|
}
|
|
4057
4160
|
}
|
|
4058
4161
|
return null;
|
|
@@ -4366,8 +4469,8 @@ var LWC = (function (exports) {
|
|
|
4366
4469
|
return;
|
|
4367
4470
|
}
|
|
4368
4471
|
var setCSSStyleProperty = renderer.setCSSStyleProperty;
|
|
4369
|
-
for (var
|
|
4370
|
-
var _styleDecls$_i = _slicedToArray(styleDecls[
|
|
4472
|
+
for (var _i17 = 0; _i17 < styleDecls.length; _i17++) {
|
|
4473
|
+
var _styleDecls$_i = _slicedToArray(styleDecls[_i17], 3),
|
|
4371
4474
|
prop = _styleDecls$_i[0],
|
|
4372
4475
|
value = _styleDecls$_i[1],
|
|
4373
4476
|
important = _styleDecls$_i[2];
|
|
@@ -4394,7 +4497,12 @@ var LWC = (function (exports) {
|
|
|
4394
4497
|
return;
|
|
4395
4498
|
}
|
|
4396
4499
|
if (process.env.NODE_ENV !== 'production') {
|
|
4397
|
-
if (!isSameVnode(n1, n2)
|
|
4500
|
+
if (!isSameVnode(n1, n2) &&
|
|
4501
|
+
// Currently the only scenario when patch does not receive the same vnodes are for
|
|
4502
|
+
// dynamic components. When a dynamic component's constructor changes, the value of its
|
|
4503
|
+
// tag name (sel) will be different. The engine will unmount the previous element
|
|
4504
|
+
// and mount the new one using the new constructor in patchCustomElement.
|
|
4505
|
+
!(isVCustomElement(n1) && isVCustomElement(n2))) {
|
|
4398
4506
|
throw new Error('Expected these VNodes to be the same: ' + JSON.stringify({
|
|
4399
4507
|
sel: n1.sel,
|
|
4400
4508
|
key: n1.key
|
|
@@ -4595,8 +4703,9 @@ var LWC = (function (exports) {
|
|
|
4595
4703
|
}
|
|
4596
4704
|
}
|
|
4597
4705
|
function patchCustomElement(n1, n2, parent, renderer) {
|
|
4706
|
+
// TODO [#3331]: This if branch should be removed in 246 with lwc:dynamic
|
|
4598
4707
|
if (n1.ctor !== n2.ctor) {
|
|
4599
|
-
// If the constructor, unmount the current component and mount a new one using the new
|
|
4708
|
+
// If the constructor differs, unmount the current component and mount a new one using the new
|
|
4600
4709
|
// constructor.
|
|
4601
4710
|
var anchor = renderer.nextSibling(n1.elm);
|
|
4602
4711
|
unmount(n1, parent, renderer, true);
|
|
@@ -4849,8 +4958,8 @@ var LWC = (function (exports) {
|
|
|
4849
4958
|
// If no VFragment is found in children, we don't need to traverse anything or mark the children dynamic and can return early.
|
|
4850
4959
|
var nodeStack = [];
|
|
4851
4960
|
var fragmentFound = false;
|
|
4852
|
-
for (var
|
|
4853
|
-
var child = children[
|
|
4961
|
+
for (var _i18 = children.length - 1; _i18 > -1; _i18 -= 1) {
|
|
4962
|
+
var child = children[_i18];
|
|
4854
4963
|
ArrayPush$1.call(nodeStack, child);
|
|
4855
4964
|
fragmentFound = fragmentFound || !!(child && isVFragment(child));
|
|
4856
4965
|
}
|
|
@@ -4862,8 +4971,8 @@ var LWC = (function (exports) {
|
|
|
4862
4971
|
if (!isNull(currentNode) && isVFragment(currentNode)) {
|
|
4863
4972
|
var fChildren = currentNode.children;
|
|
4864
4973
|
// Ignore the start and end text node delimiters
|
|
4865
|
-
for (var
|
|
4866
|
-
ArrayPush$1.call(nodeStack, fChildren[
|
|
4974
|
+
for (var _i19 = fChildren.length - 2; _i19 > 0; _i19 -= 1) {
|
|
4975
|
+
ArrayPush$1.call(nodeStack, fChildren[_i19]);
|
|
4867
4976
|
}
|
|
4868
4977
|
} else {
|
|
4869
4978
|
ArrayPush$1.call(flattenedChildren, currentNode);
|
|
@@ -4902,8 +5011,8 @@ var LWC = (function (exports) {
|
|
|
4902
5011
|
var oldSlotsMapping = vm.cmpSlots.slotAssignments;
|
|
4903
5012
|
var cmpSlotsMapping = create(null);
|
|
4904
5013
|
// Collect all slots into cmpSlotsMapping
|
|
4905
|
-
for (var
|
|
4906
|
-
var vnode = children[
|
|
5014
|
+
for (var _i20 = 0, len = children.length; _i20 < len; _i20 += 1) {
|
|
5015
|
+
var vnode = children[_i20];
|
|
4907
5016
|
if (isNull(vnode)) {
|
|
4908
5017
|
continue;
|
|
4909
5018
|
}
|
|
@@ -4933,8 +5042,8 @@ var LWC = (function (exports) {
|
|
|
4933
5042
|
markComponentAsDirty(vm);
|
|
4934
5043
|
return;
|
|
4935
5044
|
}
|
|
4936
|
-
for (var
|
|
4937
|
-
var key = oldKeys[
|
|
5045
|
+
for (var _i21 = 0, _len2 = oldKeys.length; _i21 < _len2; _i21 += 1) {
|
|
5046
|
+
var key = oldKeys[_i21];
|
|
4938
5047
|
if (isUndefined$1(cmpSlotsMapping[key]) || oldSlotsMapping[key].length !== cmpSlotsMapping[key].length) {
|
|
4939
5048
|
markComponentAsDirty(vm);
|
|
4940
5049
|
return;
|
|
@@ -5057,11 +5166,11 @@ var LWC = (function (exports) {
|
|
|
5057
5166
|
if (oldStartIdx > oldEndIdx) {
|
|
5058
5167
|
// There's some cases in which the sub array of vnodes to be inserted is followed by null(s) and an
|
|
5059
5168
|
// already processed vnode, in such cases the vnodes to be inserted should be before that processed vnode.
|
|
5060
|
-
var
|
|
5169
|
+
var _i22 = newEndIdx;
|
|
5061
5170
|
var n;
|
|
5062
5171
|
do {
|
|
5063
|
-
n = newCh[++
|
|
5064
|
-
} while (!isVNode(n) &&
|
|
5172
|
+
n = newCh[++_i22];
|
|
5173
|
+
} while (!isVNode(n) && _i22 < newChEnd);
|
|
5065
5174
|
before = isVNode(n) ? n.elm : null;
|
|
5066
5175
|
mountVNodes(newCh, parent, renderer, before, newStartIdx, newEndIdx + 1);
|
|
5067
5176
|
} else {
|
|
@@ -5086,15 +5195,22 @@ var LWC = (function (exports) {
|
|
|
5086
5195
|
// if the old list is not empty, the new list MUST have the same
|
|
5087
5196
|
// amount of nodes, that's why we call this static children
|
|
5088
5197
|
var anchor = null;
|
|
5089
|
-
for (var
|
|
5090
|
-
var n1 = c1[
|
|
5091
|
-
var n2 = c2[
|
|
5198
|
+
for (var _i23 = c2Length - 1; _i23 >= 0; _i23 -= 1) {
|
|
5199
|
+
var n1 = c1[_i23];
|
|
5200
|
+
var n2 = c2[_i23];
|
|
5092
5201
|
if (n2 !== n1) {
|
|
5093
5202
|
if (isVNode(n1)) {
|
|
5094
5203
|
if (isVNode(n2)) {
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
|
|
5204
|
+
if (isSameVnode(n1, n2)) {
|
|
5205
|
+
// both vnodes are equivalent, and we just need to patch them
|
|
5206
|
+
patch(n1, n2, parent, renderer);
|
|
5207
|
+
anchor = n2.elm;
|
|
5208
|
+
} else {
|
|
5209
|
+
// removing the old vnode since the new one is different
|
|
5210
|
+
unmount(n1, parent, renderer, true);
|
|
5211
|
+
mount(n2, parent, renderer, anchor);
|
|
5212
|
+
anchor = n2.elm;
|
|
5213
|
+
}
|
|
5098
5214
|
} else {
|
|
5099
5215
|
// removing the old vnode since the new one is null
|
|
5100
5216
|
unmount(n1, parent, renderer, true);
|
|
@@ -5213,8 +5329,8 @@ var LWC = (function (exports) {
|
|
|
5213
5329
|
if (!isUndefined$1(slotset) && !isUndefined$1(slotset.slotAssignments) && !isUndefined$1(slotset.slotAssignments[slotName]) && slotset.slotAssignments[slotName].length !== 0) {
|
|
5214
5330
|
var newChildren = [];
|
|
5215
5331
|
var slotAssignments = slotset.slotAssignments[slotName];
|
|
5216
|
-
for (var
|
|
5217
|
-
var vnode = slotAssignments[
|
|
5332
|
+
for (var _i24 = 0; _i24 < slotAssignments.length; _i24++) {
|
|
5333
|
+
var vnode = slotAssignments[_i24];
|
|
5218
5334
|
if (!isNull(vnode)) {
|
|
5219
5335
|
var assignedNodeIsScopedSlot = isVScopedSlotFragment(vnode);
|
|
5220
5336
|
// The only sniff test for a scoped <slot> element is the presence of `slotData`
|
|
@@ -5491,9 +5607,11 @@ var LWC = (function (exports) {
|
|
|
5491
5607
|
return url;
|
|
5492
5608
|
}
|
|
5493
5609
|
/**
|
|
5494
|
-
* create a dynamic component via `<x-foo lwc:dynamic={Ctor}>`
|
|
5610
|
+
* [ddc] - create a (deprecated) dynamic component via `<x-foo lwc:dynamic={Ctor}>`
|
|
5611
|
+
*
|
|
5612
|
+
* TODO [#3331]: remove usage of lwc:dynamic in 246
|
|
5495
5613
|
*/
|
|
5496
|
-
function
|
|
5614
|
+
function ddc(sel, Ctor, data) {
|
|
5497
5615
|
var children = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : EmptyArray;
|
|
5498
5616
|
if (process.env.NODE_ENV !== 'production') {
|
|
5499
5617
|
assert.isTrue(isString(sel), "dc() 1st argument sel must be a string.");
|
|
@@ -5501,7 +5619,7 @@ var LWC = (function (exports) {
|
|
|
5501
5619
|
assert.isTrue(arguments.length === 3 || isArray$1(children), "dc() 4nd argument data must be an array.");
|
|
5502
5620
|
}
|
|
5503
5621
|
// null or undefined values should produce a null value in the VNodes
|
|
5504
|
-
if (Ctor
|
|
5622
|
+
if (isNull(Ctor) || isUndefined$1(Ctor)) {
|
|
5505
5623
|
return null;
|
|
5506
5624
|
}
|
|
5507
5625
|
if (!isComponentConstructor(Ctor)) {
|
|
@@ -5509,6 +5627,31 @@ var LWC = (function (exports) {
|
|
|
5509
5627
|
}
|
|
5510
5628
|
return c(sel, Ctor, data, children);
|
|
5511
5629
|
}
|
|
5630
|
+
/**
|
|
5631
|
+
* [dc] - create a dynamic component via `<lwc:component lwc:is={Ctor}>`
|
|
5632
|
+
*/
|
|
5633
|
+
function dc(Ctor, data) {
|
|
5634
|
+
var children = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : EmptyArray;
|
|
5635
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
5636
|
+
assert.isTrue(isObject(data), "dc() 2nd argument data must be an object.");
|
|
5637
|
+
assert.isTrue(arguments.length === 3 || isArray$1(children), "dc() 3rd argument data must be an array.");
|
|
5638
|
+
}
|
|
5639
|
+
// Null or undefined values should produce a null value in the VNodes.
|
|
5640
|
+
// This is the only value at compile time as the constructor will not be known.
|
|
5641
|
+
if (isNull(Ctor) || isUndefined$1(Ctor)) {
|
|
5642
|
+
return null;
|
|
5643
|
+
}
|
|
5644
|
+
if (!isComponentConstructor(Ctor)) {
|
|
5645
|
+
throw new Error("Invalid constructor ".concat(toString$1(Ctor), " is not a LightningElement constructor."));
|
|
5646
|
+
}
|
|
5647
|
+
// Look up the dynamic component's name at runtime once the constructor is available.
|
|
5648
|
+
// This information is only known at runtime and is stored as part of registerComponent.
|
|
5649
|
+
var sel = getComponentRegisteredName(Ctor);
|
|
5650
|
+
if (isUndefined$1(sel) || sel === '') {
|
|
5651
|
+
throw new Error("Invalid LWC constructor ".concat(toString$1(Ctor), " does not have a registered name"));
|
|
5652
|
+
}
|
|
5653
|
+
return c(sel, Ctor, data, children);
|
|
5654
|
+
}
|
|
5512
5655
|
/**
|
|
5513
5656
|
* slow children collection marking mechanism. this API allows the compiler to signal
|
|
5514
5657
|
* to the engine that a particular collection of children must be diffed using the slow
|
|
@@ -5570,7 +5713,8 @@ var LWC = (function (exports) {
|
|
|
5570
5713
|
gid: gid,
|
|
5571
5714
|
fid: fid,
|
|
5572
5715
|
shc: shc,
|
|
5573
|
-
ssf: ssf
|
|
5716
|
+
ssf: ssf,
|
|
5717
|
+
ddc: ddc
|
|
5574
5718
|
});
|
|
5575
5719
|
|
|
5576
5720
|
/*
|
|
@@ -5736,23 +5880,23 @@ var LWC = (function (exports) {
|
|
|
5736
5880
|
var classAttrToken = hasScopedStyles && hasStyleToken ? " class=\"".concat(stylesheetToken, "\"") : '';
|
|
5737
5881
|
var attrToken = hasStyleToken && isSyntheticShadow ? ' ' + stylesheetToken : '';
|
|
5738
5882
|
var htmlFragment = '';
|
|
5739
|
-
for (var
|
|
5740
|
-
switch (keys[
|
|
5883
|
+
for (var _i25 = 0, n = keys.length; _i25 < n; _i25++) {
|
|
5884
|
+
switch (keys[_i25]) {
|
|
5741
5885
|
case 0:
|
|
5742
5886
|
// styleToken in existing class attr
|
|
5743
|
-
htmlFragment += strings[
|
|
5887
|
+
htmlFragment += strings[_i25] + classToken;
|
|
5744
5888
|
break;
|
|
5745
5889
|
case 1:
|
|
5746
5890
|
// styleToken for added class attr
|
|
5747
|
-
htmlFragment += strings[
|
|
5891
|
+
htmlFragment += strings[_i25] + classAttrToken;
|
|
5748
5892
|
break;
|
|
5749
5893
|
case 2:
|
|
5750
5894
|
// styleToken as attr
|
|
5751
|
-
htmlFragment += strings[
|
|
5895
|
+
htmlFragment += strings[_i25] + attrToken;
|
|
5752
5896
|
break;
|
|
5753
5897
|
case 3:
|
|
5754
5898
|
// ${1}${2}
|
|
5755
|
-
htmlFragment += strings[
|
|
5899
|
+
htmlFragment += strings[_i25] + classAttrToken + attrToken;
|
|
5756
5900
|
break;
|
|
5757
5901
|
}
|
|
5758
5902
|
}
|
|
@@ -5857,8 +6001,8 @@ var LWC = (function (exports) {
|
|
|
5857
6001
|
}
|
|
5858
6002
|
function computeHasScopedStylesInStylesheets(stylesheets) {
|
|
5859
6003
|
if (hasStyles(stylesheets)) {
|
|
5860
|
-
for (var
|
|
5861
|
-
if (isTrue(stylesheets[
|
|
6004
|
+
for (var _i26 = 0; _i26 < stylesheets.length; _i26++) {
|
|
6005
|
+
if (isTrue(stylesheets[_i26][KEY__SCOPED_CSS])) {
|
|
5862
6006
|
return true;
|
|
5863
6007
|
}
|
|
5864
6008
|
}
|
|
@@ -5971,29 +6115,34 @@ var LWC = (function (exports) {
|
|
|
5971
6115
|
* SPDX-License-Identifier: MIT
|
|
5972
6116
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
5973
6117
|
*/
|
|
5974
|
-
var
|
|
6118
|
+
var registeredComponentMap = new Map();
|
|
5975
6119
|
/**
|
|
5976
6120
|
* INTERNAL: This function can only be invoked by compiled code. The compiler
|
|
5977
6121
|
* will prevent this function from being imported by userland code.
|
|
5978
6122
|
*/
|
|
5979
6123
|
function registerComponent(
|
|
5980
6124
|
// We typically expect a LightningElementConstructor, but technically you can call this with anything
|
|
5981
|
-
Ctor,
|
|
5982
|
-
var tmpl = _ref3.tmpl;
|
|
6125
|
+
Ctor, metadata) {
|
|
5983
6126
|
if (isFunction$1(Ctor)) {
|
|
5984
6127
|
if (process.env.NODE_ENV !== 'production') {
|
|
5985
6128
|
// There is no point in running this in production, because the version mismatch check relies
|
|
5986
6129
|
// on code comments which are stripped out in production by minifiers
|
|
5987
6130
|
checkVersionMismatch(Ctor, 'component');
|
|
5988
6131
|
}
|
|
5989
|
-
|
|
6132
|
+
// TODO [#3331]: add validation to check the value of metadata.sel is not an empty string.
|
|
6133
|
+
registeredComponentMap.set(Ctor, metadata);
|
|
5990
6134
|
}
|
|
5991
6135
|
// chaining this method as a way to wrap existing assignment of component constructor easily,
|
|
5992
6136
|
// without too much transformation
|
|
5993
6137
|
return Ctor;
|
|
5994
6138
|
}
|
|
5995
6139
|
function getComponentRegisteredTemplate(Ctor) {
|
|
5996
|
-
|
|
6140
|
+
var _a;
|
|
6141
|
+
return (_a = registeredComponentMap.get(Ctor)) === null || _a === void 0 ? void 0 : _a.tmpl;
|
|
6142
|
+
}
|
|
6143
|
+
function getComponentRegisteredName(Ctor) {
|
|
6144
|
+
var _a;
|
|
6145
|
+
return (_a = registeredComponentMap.get(Ctor)) === null || _a === void 0 ? void 0 : _a.sel;
|
|
5997
6146
|
}
|
|
5998
6147
|
function getTemplateReactiveObserver(vm) {
|
|
5999
6148
|
return createReactiveObserver(function () {
|
|
@@ -6056,8 +6205,8 @@ var LWC = (function (exports) {
|
|
|
6056
6205
|
if (process.env.NODE_ENV !== 'production') {
|
|
6057
6206
|
assert.isTrue(isObject(service), "Invalid service declaration, ".concat(service, ": service must be an object"));
|
|
6058
6207
|
}
|
|
6059
|
-
for (var
|
|
6060
|
-
var hookName = hooks[
|
|
6208
|
+
for (var _i27 = 0; _i27 < hooks.length; ++_i27) {
|
|
6209
|
+
var hookName = hooks[_i27];
|
|
6061
6210
|
if (hookName in service) {
|
|
6062
6211
|
var l = Services[hookName];
|
|
6063
6212
|
if (isUndefined$1(l)) {
|
|
@@ -6074,8 +6223,8 @@ var LWC = (function (exports) {
|
|
|
6074
6223
|
var component = vm.component,
|
|
6075
6224
|
def = vm.def,
|
|
6076
6225
|
context = vm.context;
|
|
6077
|
-
for (var
|
|
6078
|
-
cbs[
|
|
6226
|
+
for (var _i28 = 0, len = cbs.length; _i28 < len; ++_i28) {
|
|
6227
|
+
cbs[_i28].call(undefined, component, {}, def, context);
|
|
6079
6228
|
}
|
|
6080
6229
|
}
|
|
6081
6230
|
|
|
@@ -6133,9 +6282,6 @@ var LWC = (function (exports) {
|
|
|
6133
6282
|
runChildNodesDisconnectedCallback(vm);
|
|
6134
6283
|
runLightChildNodesDisconnectedCallback(vm);
|
|
6135
6284
|
}
|
|
6136
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
6137
|
-
removeActiveVM(vm);
|
|
6138
|
-
}
|
|
6139
6285
|
}
|
|
6140
6286
|
// this method is triggered by the diffing algo only when a vnode from the
|
|
6141
6287
|
// old vnode.children is removed from the DOM.
|
|
@@ -6229,8 +6375,8 @@ var LWC = (function (exports) {
|
|
|
6229
6375
|
var valid = true;
|
|
6230
6376
|
var validate = function validate(arrayOrStylesheet) {
|
|
6231
6377
|
if (isArray$1(arrayOrStylesheet)) {
|
|
6232
|
-
for (var
|
|
6233
|
-
validate(arrayOrStylesheet[
|
|
6378
|
+
for (var _i29 = 0; _i29 < arrayOrStylesheet.length; _i29++) {
|
|
6379
|
+
validate(arrayOrStylesheet[_i29]);
|
|
6234
6380
|
}
|
|
6235
6381
|
} else if (!isFunction$1(arrayOrStylesheet)) {
|
|
6236
6382
|
// function assumed to be a stylesheet factory
|
|
@@ -6398,17 +6544,17 @@ var LWC = (function (exports) {
|
|
|
6398
6544
|
return a.idx - b.idx;
|
|
6399
6545
|
});
|
|
6400
6546
|
rehydrateQueue = []; // reset to a new queue
|
|
6401
|
-
for (var
|
|
6402
|
-
var vm = vms[
|
|
6547
|
+
for (var _i30 = 0, len = vms.length; _i30 < len; _i30 += 1) {
|
|
6548
|
+
var vm = vms[_i30];
|
|
6403
6549
|
try {
|
|
6404
6550
|
rehydrate(vm);
|
|
6405
6551
|
} catch (error) {
|
|
6406
|
-
if (
|
|
6552
|
+
if (_i30 + 1 < len) {
|
|
6407
6553
|
// pieces of the queue are still pending to be rehydrated, those should have priority
|
|
6408
6554
|
if (rehydrateQueue.length === 0) {
|
|
6409
6555
|
addCallbackToNextTick(flushRehydrationQueue);
|
|
6410
6556
|
}
|
|
6411
|
-
ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms,
|
|
6557
|
+
ArrayUnshift.apply(rehydrateQueue, ArraySlice.call(vms, _i30 + 1));
|
|
6412
6558
|
}
|
|
6413
6559
|
// we need to end the measure before throwing.
|
|
6414
6560
|
logGlobalOperationEnd(8 /* OperationId.GlobalRehydrate */);
|
|
@@ -6477,8 +6623,8 @@ var LWC = (function (exports) {
|
|
|
6477
6623
|
var vCustomElementCollection = vm.velements;
|
|
6478
6624
|
// Reporting disconnection for every child in inverse order since they are
|
|
6479
6625
|
// inserted in reserved order.
|
|
6480
|
-
for (var
|
|
6481
|
-
var elm = vCustomElementCollection[
|
|
6626
|
+
for (var _i31 = vCustomElementCollection.length - 1; _i31 >= 0; _i31 -= 1) {
|
|
6627
|
+
var elm = vCustomElementCollection[_i31].elm;
|
|
6482
6628
|
// There are two cases where the element could be undefined:
|
|
6483
6629
|
// * when there is an error during the construction phase, and an error
|
|
6484
6630
|
// boundary picks it, there is a possibility that the VCustomElement
|
|
@@ -6509,8 +6655,8 @@ var LWC = (function (exports) {
|
|
|
6509
6655
|
* defined on its shadow.
|
|
6510
6656
|
*/
|
|
6511
6657
|
function recursivelyDisconnectChildren(vnodes) {
|
|
6512
|
-
for (var
|
|
6513
|
-
var vnode = vnodes[
|
|
6658
|
+
for (var _i32 = 0, len = vnodes.length; _i32 < len; _i32 += 1) {
|
|
6659
|
+
var vnode = vnodes[_i32];
|
|
6514
6660
|
if (!isNull(vnode) && !isUndefined$1(vnode.elm)) {
|
|
6515
6661
|
switch (vnode.type) {
|
|
6516
6662
|
case 2 /* VNodeType.Element */:
|
|
@@ -6543,8 +6689,8 @@ var LWC = (function (exports) {
|
|
|
6543
6689
|
function recursivelyRemoveChildren(vnodes, vm) {
|
|
6544
6690
|
var renderRoot = vm.renderRoot,
|
|
6545
6691
|
remove = vm.renderer.remove;
|
|
6546
|
-
for (var
|
|
6547
|
-
var vnode = vnodes[
|
|
6692
|
+
for (var _i33 = 0, len = vnodes.length; _i33 < len; _i33 += 1) {
|
|
6693
|
+
var vnode = vnodes[_i33];
|
|
6548
6694
|
if (!isNull(vnode)) {
|
|
6549
6695
|
// VFragments are special; their .elm property does not point to the root element since they have no single root.
|
|
6550
6696
|
if (isVFragment(vnode)) {
|
|
@@ -6675,17 +6821,17 @@ var LWC = (function (exports) {
|
|
|
6675
6821
|
// if our id is null or empty, nobody can reference us
|
|
6676
6822
|
return;
|
|
6677
6823
|
}
|
|
6678
|
-
var
|
|
6679
|
-
|
|
6824
|
+
var _iterator10 = _createForOfIteratorHelper(ID_REFERENCING_ATTRIBUTES_SET),
|
|
6825
|
+
_step10;
|
|
6680
6826
|
try {
|
|
6681
|
-
for (
|
|
6682
|
-
var idRefAttrName =
|
|
6827
|
+
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
|
6828
|
+
var idRefAttrName = _step10.value;
|
|
6683
6829
|
// Query all global elements with this attribute. The attribute selector syntax `~=` is for values
|
|
6684
6830
|
// that reference multiple IDs, separated by whitespace.
|
|
6685
6831
|
var query = "[".concat(idRefAttrName, "~=\"").concat(CSS.escape(attrValue), "\"]");
|
|
6686
6832
|
var sourceElements = querySelectorAll.call(document, query);
|
|
6687
|
-
for (var
|
|
6688
|
-
var sourceElement = sourceElements[
|
|
6833
|
+
for (var _i34 = 0; _i34 < sourceElements.length; _i34++) {
|
|
6834
|
+
var sourceElement = sourceElements[_i34];
|
|
6689
6835
|
var sourceRoot = sourceElement.getRootNode();
|
|
6690
6836
|
if (sourceRoot !== root) {
|
|
6691
6837
|
reportViolation$1(sourceElement, elm, idRefAttrName);
|
|
@@ -6694,18 +6840,18 @@ var LWC = (function (exports) {
|
|
|
6694
6840
|
}
|
|
6695
6841
|
}
|
|
6696
6842
|
} catch (err) {
|
|
6697
|
-
|
|
6843
|
+
_iterator10.e(err);
|
|
6698
6844
|
} finally {
|
|
6699
|
-
|
|
6845
|
+
_iterator10.f();
|
|
6700
6846
|
}
|
|
6701
6847
|
} else {
|
|
6702
6848
|
// elm is the source, find the target
|
|
6703
6849
|
var ids = parseIdRefAttributeValue(attrValue);
|
|
6704
|
-
var
|
|
6705
|
-
|
|
6850
|
+
var _iterator11 = _createForOfIteratorHelper(ids),
|
|
6851
|
+
_step11;
|
|
6706
6852
|
try {
|
|
6707
|
-
for (
|
|
6708
|
-
var id =
|
|
6853
|
+
for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
|
|
6854
|
+
var id = _step11.value;
|
|
6709
6855
|
var target = getElementById.call(document, id);
|
|
6710
6856
|
if (!isNull(target)) {
|
|
6711
6857
|
var targetRoot = target.getRootNode();
|
|
@@ -6716,9 +6862,9 @@ var LWC = (function (exports) {
|
|
|
6716
6862
|
}
|
|
6717
6863
|
}
|
|
6718
6864
|
} catch (err) {
|
|
6719
|
-
|
|
6865
|
+
_iterator11.e(err);
|
|
6720
6866
|
} finally {
|
|
6721
|
-
|
|
6867
|
+
_iterator11.f();
|
|
6722
6868
|
}
|
|
6723
6869
|
}
|
|
6724
6870
|
}
|
|
@@ -6848,11 +6994,11 @@ var LWC = (function (exports) {
|
|
|
6848
6994
|
function enableDetection() {
|
|
6849
6995
|
var _Element = Element,
|
|
6850
6996
|
prototype = _Element.prototype;
|
|
6851
|
-
var
|
|
6852
|
-
|
|
6997
|
+
var _iterator12 = _createForOfIteratorHelper(NON_STANDARD_ARIA_PROPS),
|
|
6998
|
+
_step12;
|
|
6853
6999
|
try {
|
|
6854
7000
|
var _loop3 = function _loop3() {
|
|
6855
|
-
var prop =
|
|
7001
|
+
var prop = _step12.value;
|
|
6856
7002
|
var descriptor = getOwnPropertyDescriptor$1(prototype, prop);
|
|
6857
7003
|
// The descriptor should exist because the @lwc/aria-reflection polyfill has run by now.
|
|
6858
7004
|
// This happens automatically because of the ordering of imports.
|
|
@@ -6879,13 +7025,13 @@ var LWC = (function (exports) {
|
|
|
6879
7025
|
enumerable: true
|
|
6880
7026
|
});
|
|
6881
7027
|
};
|
|
6882
|
-
for (
|
|
7028
|
+
for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
|
|
6883
7029
|
_loop3();
|
|
6884
7030
|
}
|
|
6885
7031
|
} catch (err) {
|
|
6886
|
-
|
|
7032
|
+
_iterator12.e(err);
|
|
6887
7033
|
} finally {
|
|
6888
|
-
|
|
7034
|
+
_iterator12.f();
|
|
6889
7035
|
}
|
|
6890
7036
|
}
|
|
6891
7037
|
// No point in running this code if we're not in a browser, or if the global polyfill is not loaded
|
|
@@ -7101,8 +7247,8 @@ var LWC = (function (exports) {
|
|
|
7101
7247
|
var nextNode = node;
|
|
7102
7248
|
var anchor = null;
|
|
7103
7249
|
var renderer = owner.renderer;
|
|
7104
|
-
for (var
|
|
7105
|
-
var childVnode = children[
|
|
7250
|
+
for (var _i35 = 0; _i35 < children.length; _i35++) {
|
|
7251
|
+
var childVnode = children[_i35];
|
|
7106
7252
|
if (!isNull(childVnode)) {
|
|
7107
7253
|
if (nextNode) {
|
|
7108
7254
|
nextNode = hydrateNode(nextNode, childVnode, renderer);
|
|
@@ -7193,8 +7339,8 @@ var LWC = (function (exports) {
|
|
|
7193
7339
|
var nodesAreCompatible = true;
|
|
7194
7340
|
// Validate attributes, though we could always recovery from those by running the update mods.
|
|
7195
7341
|
// Note: intentionally ONLY matching vnodes.attrs to elm.attrs, in case SSR is adding extra attributes.
|
|
7196
|
-
for (var
|
|
7197
|
-
var _Object$entries$_i = _slicedToArray(_Object$entries[
|
|
7342
|
+
for (var _i36 = 0, _Object$entries = Object.entries(attrs); _i36 < _Object$entries.length; _i36++) {
|
|
7343
|
+
var _Object$entries$_i = _slicedToArray(_Object$entries[_i36], 2),
|
|
7198
7344
|
attrName = _Object$entries$_i[0],
|
|
7199
7345
|
attrValue = _Object$entries$_i[1];
|
|
7200
7346
|
var owner = vnode.owner;
|
|
@@ -7295,8 +7441,8 @@ var LWC = (function (exports) {
|
|
|
7295
7441
|
var parsedVnodeStyle = parseStyleText(elmStyle);
|
|
7296
7442
|
var expectedStyle = [];
|
|
7297
7443
|
// styleMap is used when style is set to static value.
|
|
7298
|
-
for (var
|
|
7299
|
-
var _styleDecls$_i2 = _slicedToArray(styleDecls[
|
|
7444
|
+
for (var _i37 = 0, n = styleDecls.length; _i37 < n; _i37++) {
|
|
7445
|
+
var _styleDecls$_i2 = _slicedToArray(styleDecls[_i37], 3),
|
|
7300
7446
|
prop = _styleDecls$_i2[0],
|
|
7301
7447
|
value = _styleDecls$_i2[1],
|
|
7302
7448
|
important = _styleDecls$_i2[2];
|
|
@@ -7427,11 +7573,11 @@ var LWC = (function (exports) {
|
|
|
7427
7573
|
function warnOnArrayMutation(stylesheets) {
|
|
7428
7574
|
// We can't handle users calling Array.prototype.slice.call(tmpl.stylesheets), but
|
|
7429
7575
|
// we can at least warn when they use the most common mutation methods.
|
|
7430
|
-
var
|
|
7431
|
-
|
|
7576
|
+
var _iterator13 = _createForOfIteratorHelper(ARRAY_MUTATION_METHODS),
|
|
7577
|
+
_step13;
|
|
7432
7578
|
try {
|
|
7433
7579
|
var _loop4 = function _loop4() {
|
|
7434
|
-
var prop =
|
|
7580
|
+
var prop = _step13.value;
|
|
7435
7581
|
var originalArrayMethod = getOriginalArrayMethod(prop);
|
|
7436
7582
|
stylesheets[prop] = function arrayMutationWarningWrapper() {
|
|
7437
7583
|
reportTemplateViolation('stylesheets');
|
|
@@ -7439,23 +7585,23 @@ var LWC = (function (exports) {
|
|
|
7439
7585
|
return originalArrayMethod.apply(this, arguments);
|
|
7440
7586
|
};
|
|
7441
7587
|
};
|
|
7442
|
-
for (
|
|
7588
|
+
for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
|
|
7443
7589
|
_loop4();
|
|
7444
7590
|
}
|
|
7445
7591
|
} catch (err) {
|
|
7446
|
-
|
|
7592
|
+
_iterator13.e(err);
|
|
7447
7593
|
} finally {
|
|
7448
|
-
|
|
7594
|
+
_iterator13.f();
|
|
7449
7595
|
}
|
|
7450
7596
|
}
|
|
7451
7597
|
// Warn if the user tries to mutate a stylesheet factory function, e.g.:
|
|
7452
7598
|
// `stylesheet.$scoped$ = true`
|
|
7453
7599
|
function warnOnStylesheetFunctionMutation(stylesheet) {
|
|
7454
|
-
var
|
|
7455
|
-
|
|
7600
|
+
var _iterator14 = _createForOfIteratorHelper(STYLESHEET_PROPS),
|
|
7601
|
+
_step14;
|
|
7456
7602
|
try {
|
|
7457
7603
|
var _loop5 = function _loop5() {
|
|
7458
|
-
var prop =
|
|
7604
|
+
var prop = _step14.value;
|
|
7459
7605
|
var value = stylesheet[prop];
|
|
7460
7606
|
defineProperty(stylesheet, prop, {
|
|
7461
7607
|
enumerable: true,
|
|
@@ -7469,13 +7615,13 @@ var LWC = (function (exports) {
|
|
|
7469
7615
|
}
|
|
7470
7616
|
});
|
|
7471
7617
|
};
|
|
7472
|
-
for (
|
|
7618
|
+
for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
|
|
7473
7619
|
_loop5();
|
|
7474
7620
|
}
|
|
7475
7621
|
} catch (err) {
|
|
7476
|
-
|
|
7622
|
+
_iterator14.e(err);
|
|
7477
7623
|
} finally {
|
|
7478
|
-
|
|
7624
|
+
_iterator14.f();
|
|
7479
7625
|
}
|
|
7480
7626
|
}
|
|
7481
7627
|
// Warn on either array or stylesheet (function) mutation, in a deeply-nested array
|
|
@@ -7497,8 +7643,8 @@ var LWC = (function (exports) {
|
|
|
7497
7643
|
// Deep-traverse an array (of arrays) of stylesheet factory functions, and call the callback for every array/function
|
|
7498
7644
|
function traverseStylesheets(stylesheets, callback) {
|
|
7499
7645
|
callback(stylesheets);
|
|
7500
|
-
for (var
|
|
7501
|
-
var stylesheet = stylesheets[
|
|
7646
|
+
for (var _i38 = 0; _i38 < stylesheets.length; _i38++) {
|
|
7647
|
+
var stylesheet = stylesheets[_i38];
|
|
7502
7648
|
if (isArray$1(stylesheet)) {
|
|
7503
7649
|
traverseStylesheets(stylesheet, callback);
|
|
7504
7650
|
} else {
|
|
@@ -7510,11 +7656,11 @@ var LWC = (function (exports) {
|
|
|
7510
7656
|
if (!isUndefined$1(tmpl.stylesheets)) {
|
|
7511
7657
|
trackStylesheetsMutation(tmpl.stylesheets);
|
|
7512
7658
|
}
|
|
7513
|
-
var
|
|
7514
|
-
|
|
7659
|
+
var _iterator15 = _createForOfIteratorHelper(TEMPLATE_PROPS),
|
|
7660
|
+
_step15;
|
|
7515
7661
|
try {
|
|
7516
7662
|
var _loop6 = function _loop6() {
|
|
7517
|
-
var prop =
|
|
7663
|
+
var prop = _step15.value;
|
|
7518
7664
|
var value = tmpl[prop];
|
|
7519
7665
|
defineProperty(tmpl, prop, {
|
|
7520
7666
|
enumerable: true,
|
|
@@ -7530,13 +7676,13 @@ var LWC = (function (exports) {
|
|
|
7530
7676
|
}
|
|
7531
7677
|
});
|
|
7532
7678
|
};
|
|
7533
|
-
for (
|
|
7679
|
+
for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {
|
|
7534
7680
|
_loop6();
|
|
7535
7681
|
}
|
|
7536
7682
|
} catch (err) {
|
|
7537
|
-
|
|
7683
|
+
_iterator15.e(err);
|
|
7538
7684
|
} finally {
|
|
7539
|
-
|
|
7685
|
+
_iterator15.f();
|
|
7540
7686
|
}
|
|
7541
7687
|
var originalDescriptor = getOwnPropertyDescriptor$1(tmpl, 'stylesheetTokens');
|
|
7542
7688
|
defineProperty(tmpl, 'stylesheetTokens', {
|
|
@@ -7645,7 +7791,7 @@ var LWC = (function (exports) {
|
|
|
7645
7791
|
}
|
|
7646
7792
|
return getReadOnlyProxy(obj);
|
|
7647
7793
|
}
|
|
7648
|
-
/* version: 2.
|
|
7794
|
+
/* version: 2.39.1 */
|
|
7649
7795
|
|
|
7650
7796
|
/*
|
|
7651
7797
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -8071,7 +8217,7 @@ var LWC = (function (exports) {
|
|
|
8071
8217
|
function isNull(obj) {
|
|
8072
8218
|
return obj === null;
|
|
8073
8219
|
}
|
|
8074
|
-
/** version: 2.
|
|
8220
|
+
/** version: 2.39.1 */
|
|
8075
8221
|
|
|
8076
8222
|
/*
|
|
8077
8223
|
* Copyright (c) 2023, salesforce.com, inc.
|
|
@@ -8082,10 +8228,10 @@ var LWC = (function (exports) {
|
|
|
8082
8228
|
var WireContextSubscriptionEvent = /*#__PURE__*/function (_CustomEvent) {
|
|
8083
8229
|
_inherits(WireContextSubscriptionEvent, _CustomEvent);
|
|
8084
8230
|
var _super6 = _createSuper(WireContextSubscriptionEvent);
|
|
8085
|
-
function WireContextSubscriptionEvent(adapterToken,
|
|
8231
|
+
function WireContextSubscriptionEvent(adapterToken, _ref5) {
|
|
8086
8232
|
var _this3;
|
|
8087
|
-
var setNewContext =
|
|
8088
|
-
setDisconnectedCallback =
|
|
8233
|
+
var setNewContext = _ref5.setNewContext,
|
|
8234
|
+
setDisconnectedCallback = _ref5.setDisconnectedCallback;
|
|
8089
8235
|
_classCallCheck(this, WireContextSubscriptionEvent);
|
|
8090
8236
|
_this3 = _super6.call(this, adapterToken, {
|
|
8091
8237
|
bubbles: true,
|
|
@@ -8169,17 +8315,17 @@ var LWC = (function (exports) {
|
|
|
8169
8315
|
exports.createFragment = function (html) {
|
|
8170
8316
|
var wrapperTags = topLevelWrappingMap[getTagName(html)];
|
|
8171
8317
|
if (!isUndefined(wrapperTags)) {
|
|
8172
|
-
var
|
|
8173
|
-
|
|
8318
|
+
var _iterator16 = _createForOfIteratorHelper(wrapperTags),
|
|
8319
|
+
_step16;
|
|
8174
8320
|
try {
|
|
8175
|
-
for (
|
|
8176
|
-
var wrapperTag =
|
|
8321
|
+
for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
|
|
8322
|
+
var wrapperTag = _step16.value;
|
|
8177
8323
|
html = "<".concat(wrapperTag, ">").concat(html, "</").concat(wrapperTag, ">");
|
|
8178
8324
|
}
|
|
8179
8325
|
} catch (err) {
|
|
8180
|
-
|
|
8326
|
+
_iterator16.e(err);
|
|
8181
8327
|
} finally {
|
|
8182
|
-
|
|
8328
|
+
_iterator16.f();
|
|
8183
8329
|
}
|
|
8184
8330
|
}
|
|
8185
8331
|
// For IE11, the document title must not be undefined, but it can be an empty string
|
|
@@ -8188,7 +8334,7 @@ var LWC = (function (exports) {
|
|
|
8188
8334
|
doc.body.innerHTML = html;
|
|
8189
8335
|
var content = doc.body;
|
|
8190
8336
|
if (!isUndefined(wrapperTags)) {
|
|
8191
|
-
for (var
|
|
8337
|
+
for (var _i39 = 0; _i39 < wrapperTags.length; _i39++) {
|
|
8192
8338
|
content = content.firstChild;
|
|
8193
8339
|
}
|
|
8194
8340
|
}
|
|
@@ -8387,8 +8533,8 @@ var LWC = (function (exports) {
|
|
|
8387
8533
|
tagName: element.tagName.toLowerCase(),
|
|
8388
8534
|
hydrated: true
|
|
8389
8535
|
});
|
|
8390
|
-
for (var
|
|
8391
|
-
var _Object$entries2$_i = _slicedToArray(_Object$entries2[
|
|
8536
|
+
for (var _i40 = 0, _Object$entries2 = Object.entries(props); _i40 < _Object$entries2.length; _i40++) {
|
|
8537
|
+
var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i40], 2),
|
|
8392
8538
|
key = _Object$entries2$_i[0],
|
|
8393
8539
|
value = _Object$entries2$_i[1];
|
|
8394
8540
|
element[key] = value;
|
|
@@ -8713,7 +8859,7 @@ var LWC = (function (exports) {
|
|
|
8713
8859
|
});
|
|
8714
8860
|
});
|
|
8715
8861
|
}
|
|
8716
|
-
/* version: 2.
|
|
8862
|
+
/* version: 2.39.1 */
|
|
8717
8863
|
|
|
8718
8864
|
exports.LightningElement = LightningElement;
|
|
8719
8865
|
exports.__unstable__ProfilerControl = profilerControl;
|