lwc 2.35.1 → 2.36.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 +258 -102
- package/dist/engine-dom/iife/es2017/engine-dom.js +258 -102
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +286 -58
- package/dist/engine-dom/iife/es5/engine-dom.js +365 -202
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +412 -131
- package/dist/engine-dom/umd/es2017/engine-dom.js +258 -102
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +286 -58
- package/dist/engine-dom/umd/es5/engine-dom.js +365 -202
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +412 -131
- package/dist/engine-server/commonjs/es2017/engine-server.js +126 -79
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +126 -79
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +5 -5
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +5 -5
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +3 -3
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +9 -9
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +7 -7
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +5 -5
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +3 -3
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +9 -9
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +7 -7
- package/dist/wire-service/esm/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/iife/es5/wire-service.js +2 -2
- package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es5/wire-service.js +2 -2
- package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
- package/package.json +7 -7
|
@@ -21,16 +21,16 @@
|
|
|
21
21
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
22
22
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
23
23
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
24
|
-
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0)
|
|
24
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
25
25
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
26
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
27
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
28
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
26
29
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
27
30
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
28
31
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
29
32
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
30
33
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
31
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
32
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
33
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
34
34
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
35
35
|
/* proxy-compat-disable */
|
|
36
36
|
/**
|
|
@@ -62,10 +62,10 @@
|
|
|
62
62
|
}
|
|
63
63
|
var assert = /*#__PURE__*/Object.freeze({
|
|
64
64
|
__proto__: null,
|
|
65
|
+
fail: fail,
|
|
65
66
|
invariant: invariant,
|
|
66
|
-
isTrue: isTrue$1,
|
|
67
67
|
isFalse: isFalse$1,
|
|
68
|
-
|
|
68
|
+
isTrue: isTrue$1
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
/*
|
|
@@ -89,13 +89,18 @@
|
|
|
89
89
|
setPrototypeOf = Object.setPrototypeOf;
|
|
90
90
|
var isArray$1 = Array.isArray;
|
|
91
91
|
var _Array$prototype = Array.prototype,
|
|
92
|
+
ArrayCopyWithin = _Array$prototype.copyWithin,
|
|
93
|
+
ArrayFill = _Array$prototype.fill,
|
|
92
94
|
ArrayFilter = _Array$prototype.filter,
|
|
93
95
|
ArrayIndexOf = _Array$prototype.indexOf,
|
|
94
96
|
ArrayJoin = _Array$prototype.join,
|
|
95
97
|
ArrayMap = _Array$prototype.map,
|
|
96
98
|
ArrayPop = _Array$prototype.pop,
|
|
97
99
|
ArrayPush$1 = _Array$prototype.push,
|
|
100
|
+
ArrayReverse = _Array$prototype.reverse,
|
|
101
|
+
ArrayShift = _Array$prototype.shift,
|
|
98
102
|
ArraySlice = _Array$prototype.slice,
|
|
103
|
+
ArraySort = _Array$prototype.sort,
|
|
99
104
|
ArraySplice = _Array$prototype.splice,
|
|
100
105
|
ArrayUnshift = _Array$prototype.unshift,
|
|
101
106
|
forEach = _Array$prototype.forEach;
|
|
@@ -313,7 +318,7 @@
|
|
|
313
318
|
CACHED_ATTRIBUTE_PROPERTY_MAPPING.set(attrName, propertyName);
|
|
314
319
|
return propertyName;
|
|
315
320
|
}
|
|
316
|
-
/** version: 2.
|
|
321
|
+
/** version: 2.36.0 */
|
|
317
322
|
|
|
318
323
|
/**
|
|
319
324
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -385,7 +390,7 @@
|
|
|
385
390
|
*/
|
|
386
391
|
function setFeatureFlagForTest(name, value) {
|
|
387
392
|
}
|
|
388
|
-
/** version: 2.
|
|
393
|
+
/** version: 2.36.0 */
|
|
389
394
|
|
|
390
395
|
/**
|
|
391
396
|
* Copyright (C) 2018 salesforce.com, inc.
|
|
@@ -449,7 +454,7 @@
|
|
|
449
454
|
}
|
|
450
455
|
}
|
|
451
456
|
}
|
|
452
|
-
/** version: 2.
|
|
457
|
+
/** version: 2.36.0 */
|
|
453
458
|
|
|
454
459
|
/*
|
|
455
460
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -469,7 +474,6 @@
|
|
|
469
474
|
* SPDX-License-Identifier: MIT
|
|
470
475
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
471
476
|
*/
|
|
472
|
-
/** Callbacks to invoke when reporting is enabled **/
|
|
473
477
|
var onReportingEnabledCallbacks = [];
|
|
474
478
|
/** The currently assigned reporting dispatcher. */
|
|
475
479
|
var currentDispatcher$1 = noop;
|
|
@@ -489,23 +493,15 @@
|
|
|
489
493
|
attachDispatcher: function attachDispatcher(dispatcher) {
|
|
490
494
|
enabled$1 = true;
|
|
491
495
|
currentDispatcher$1 = dispatcher;
|
|
492
|
-
var
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
// This should never happen. But if it does, we don't want one callback to cause another to fail
|
|
501
|
-
// eslint-disable-next-line no-console
|
|
502
|
-
console.error('Could not invoke callback', err);
|
|
503
|
-
}
|
|
496
|
+
for (var _i3 = 0, _onReportingEnabledCa = onReportingEnabledCallbacks; _i3 < _onReportingEnabledCa.length; _i3++) {
|
|
497
|
+
var callback = _onReportingEnabledCa[_i3];
|
|
498
|
+
try {
|
|
499
|
+
callback();
|
|
500
|
+
} catch (err) {
|
|
501
|
+
// This should never happen. But if it does, we don't want one callback to cause another to fail
|
|
502
|
+
// eslint-disable-next-line no-console
|
|
503
|
+
console.error('Could not invoke callback', err);
|
|
504
504
|
}
|
|
505
|
-
} catch (err) {
|
|
506
|
-
_iterator.e(err);
|
|
507
|
-
} finally {
|
|
508
|
-
_iterator.f();
|
|
509
505
|
}
|
|
510
506
|
onReportingEnabledCallbacks.length = 0; // clear the array
|
|
511
507
|
},
|
|
@@ -534,11 +530,11 @@
|
|
|
534
530
|
/**
|
|
535
531
|
* Report to the current dispatcher, if there is one.
|
|
536
532
|
* @param reportingEventId
|
|
537
|
-
* @param
|
|
533
|
+
* @param payload - data to report
|
|
538
534
|
*/
|
|
539
|
-
function report(reportingEventId,
|
|
535
|
+
function report(reportingEventId, payload) {
|
|
540
536
|
if (enabled$1) {
|
|
541
|
-
currentDispatcher$1(reportingEventId,
|
|
537
|
+
currentDispatcher$1(reportingEventId, payload);
|
|
542
538
|
}
|
|
543
539
|
}
|
|
544
540
|
|
|
@@ -640,8 +636,8 @@
|
|
|
640
636
|
if (!isUndefined$1(reactiveRecord)) {
|
|
641
637
|
var reactiveObservers = reactiveRecord[key];
|
|
642
638
|
if (!isUndefined$1(reactiveObservers)) {
|
|
643
|
-
for (var
|
|
644
|
-
var ro = reactiveObservers[
|
|
639
|
+
for (var _i4 = 0, len = reactiveObservers.length; _i4 < len; _i4 += 1) {
|
|
640
|
+
var ro = reactiveObservers[_i4];
|
|
645
641
|
ro.notify();
|
|
646
642
|
}
|
|
647
643
|
}
|
|
@@ -700,9 +696,9 @@
|
|
|
700
696
|
var listeners = this.listeners;
|
|
701
697
|
var len = listeners.length;
|
|
702
698
|
if (len > 0) {
|
|
703
|
-
for (var
|
|
704
|
-
var set = listeners[
|
|
705
|
-
var pos = ArrayIndexOf.call(listeners[
|
|
699
|
+
for (var _i5 = 0; _i5 < len; _i5 += 1) {
|
|
700
|
+
var set = listeners[_i5];
|
|
701
|
+
var pos = ArrayIndexOf.call(listeners[_i5], this);
|
|
706
702
|
ArraySplice.call(set, pos, 1);
|
|
707
703
|
}
|
|
708
704
|
listeners.length = 0;
|
|
@@ -754,8 +750,8 @@
|
|
|
754
750
|
function flushCallbackQueue() {
|
|
755
751
|
var callbacks = nextTickCallbackQueue;
|
|
756
752
|
nextTickCallbackQueue = []; // reset to a new queue
|
|
757
|
-
for (var
|
|
758
|
-
callbacks[
|
|
753
|
+
for (var _i6 = 0, len = callbacks.length; _i6 < len; _i6 += 1) {
|
|
754
|
+
callbacks[_i6]();
|
|
759
755
|
}
|
|
760
756
|
}
|
|
761
757
|
function addCallbackToNextTick(callback) {
|
|
@@ -777,11 +773,11 @@
|
|
|
777
773
|
function parseStyleText(cssText) {
|
|
778
774
|
var styleMap = {};
|
|
779
775
|
var declarations = cssText.split(DECLARATION_DELIMITER);
|
|
780
|
-
var
|
|
781
|
-
|
|
776
|
+
var _iterator = _createForOfIteratorHelper(declarations),
|
|
777
|
+
_step;
|
|
782
778
|
try {
|
|
783
|
-
for (
|
|
784
|
-
var declaration =
|
|
779
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
780
|
+
var declaration = _step.value;
|
|
785
781
|
if (declaration) {
|
|
786
782
|
var _declaration$split = declaration.split(PROPERTY_DELIMITER),
|
|
787
783
|
_declaration$split2 = _slicedToArray(_declaration$split, 2),
|
|
@@ -793,20 +789,28 @@
|
|
|
793
789
|
}
|
|
794
790
|
}
|
|
795
791
|
} catch (err) {
|
|
796
|
-
|
|
792
|
+
_iterator.e(err);
|
|
797
793
|
} finally {
|
|
798
|
-
|
|
794
|
+
_iterator.f();
|
|
799
795
|
}
|
|
800
796
|
return styleMap;
|
|
801
797
|
}
|
|
802
798
|
// Make a shallow copy of an object but omit the given key
|
|
803
799
|
function cloneAndOmitKey(object, keyToOmit) {
|
|
804
800
|
var result = {};
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
801
|
+
var _iterator2 = _createForOfIteratorHelper(keys(object)),
|
|
802
|
+
_step2;
|
|
803
|
+
try {
|
|
804
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
805
|
+
var key = _step2.value;
|
|
806
|
+
if (key !== keyToOmit) {
|
|
807
|
+
result[key] = object[key];
|
|
808
|
+
}
|
|
809
809
|
}
|
|
810
|
+
} catch (err) {
|
|
811
|
+
_iterator2.e(err);
|
|
812
|
+
} finally {
|
|
813
|
+
_iterator2.f();
|
|
810
814
|
}
|
|
811
815
|
return result;
|
|
812
816
|
}
|
|
@@ -817,7 +821,7 @@
|
|
|
817
821
|
try {
|
|
818
822
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
819
823
|
var stylesheet = _step3.value;
|
|
820
|
-
if (!
|
|
824
|
+
if (!isArray$1(stylesheet)) {
|
|
821
825
|
list.push(stylesheet);
|
|
822
826
|
} else {
|
|
823
827
|
list.push.apply(list, _toConsumableArray(flattenStylesheets(stylesheet)));
|
|
@@ -2070,32 +2074,33 @@
|
|
|
2070
2074
|
wire = vm.def.wire;
|
|
2071
2075
|
var wiredConnecting = context.wiredConnecting = [];
|
|
2072
2076
|
var wiredDisconnecting = context.wiredDisconnecting = [];
|
|
2073
|
-
|
|
2077
|
+
var _loop2 = function _loop2() {
|
|
2074
2078
|
var descriptor = wire[fieldNameOrMethod];
|
|
2075
2079
|
var wireDef = WireMetaMap.get(descriptor);
|
|
2076
2080
|
if (!isUndefined$1(wireDef)) {
|
|
2077
|
-
(
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
if (
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
return;
|
|
2089
|
-
}
|
|
2081
|
+
var _createConnector = createConnector(vm, fieldNameOrMethod, wireDef),
|
|
2082
|
+
connector = _createConnector.connector,
|
|
2083
|
+
computeConfigAndUpdate = _createConnector.computeConfigAndUpdate,
|
|
2084
|
+
resetConfigWatcher = _createConnector.resetConfigWatcher;
|
|
2085
|
+
var hasDynamicParams = wireDef.dynamic.length > 0;
|
|
2086
|
+
ArrayPush$1.call(wiredConnecting, function () {
|
|
2087
|
+
connector.connect();
|
|
2088
|
+
if (!lwcRuntimeFlags.ENABLE_WIRE_SYNC_EMIT) {
|
|
2089
|
+
if (hasDynamicParams) {
|
|
2090
|
+
Promise.resolve().then(computeConfigAndUpdate);
|
|
2091
|
+
return;
|
|
2090
2092
|
}
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
})
|
|
2093
|
+
}
|
|
2094
|
+
computeConfigAndUpdate();
|
|
2095
|
+
});
|
|
2096
|
+
ArrayPush$1.call(wiredDisconnecting, function () {
|
|
2097
|
+
connector.disconnect();
|
|
2098
|
+
resetConfigWatcher();
|
|
2099
|
+
});
|
|
2098
2100
|
}
|
|
2101
|
+
};
|
|
2102
|
+
for (var fieldNameOrMethod in wire) {
|
|
2103
|
+
_loop2();
|
|
2099
2104
|
}
|
|
2100
2105
|
}
|
|
2101
2106
|
function connectWireAdapters(vm) {
|
|
@@ -3776,7 +3781,12 @@
|
|
|
3776
3781
|
} else if (isVScopedSlotFragment(vnode)) {
|
|
3777
3782
|
slotName = vnode.slotName;
|
|
3778
3783
|
}
|
|
3779
|
-
|
|
3784
|
+
// Can't use toString here because Symbol(1).toString() is 'Symbol(1)'
|
|
3785
|
+
// but elm.setAttribute('slot', Symbol(1)) is an error.
|
|
3786
|
+
// the following line also throws same error for symbols
|
|
3787
|
+
// Similar for Object.create(null)
|
|
3788
|
+
var normalizedSlotName = '' + slotName;
|
|
3789
|
+
var vnodes = cmpSlotsMapping[normalizedSlotName] = cmpSlotsMapping[normalizedSlotName] || [];
|
|
3780
3790
|
ArrayPush$1.call(vnodes, vnode);
|
|
3781
3791
|
}
|
|
3782
3792
|
vm.cmpSlots = {
|
|
@@ -5198,7 +5208,7 @@
|
|
|
5198
5208
|
function isSyntheticShadowRootInstance(rootNode) {
|
|
5199
5209
|
return rootNode !== document && isTrue(rootNode.synthetic);
|
|
5200
5210
|
}
|
|
5201
|
-
function reportViolation(source, target, attrName) {
|
|
5211
|
+
function reportViolation$1(source, target, attrName) {
|
|
5202
5212
|
// The vm is either for the source, the target, or both. Either one or both must be using synthetic
|
|
5203
5213
|
// shadow for a violation to be detected.
|
|
5204
5214
|
var vm = getAssociatedVMIfPresent(source.getRootNode().host);
|
|
@@ -5209,7 +5219,10 @@
|
|
|
5209
5219
|
// vm should never be undefined here, but just to be safe, bail out and don't report
|
|
5210
5220
|
return;
|
|
5211
5221
|
}
|
|
5212
|
-
report(0 /* ReportingEventId.CrossRootAriaInSyntheticShadow */,
|
|
5222
|
+
report(0 /* ReportingEventId.CrossRootAriaInSyntheticShadow */, {
|
|
5223
|
+
tagName: vm.tagName,
|
|
5224
|
+
attributeName: attrName
|
|
5225
|
+
});
|
|
5213
5226
|
}
|
|
5214
5227
|
function parseIdRefAttributeValue(attrValue) {
|
|
5215
5228
|
// split on whitespace and skip empty strings after splitting
|
|
@@ -5239,7 +5252,7 @@
|
|
|
5239
5252
|
var sourceElement = sourceElements[_i33];
|
|
5240
5253
|
var sourceRoot = sourceElement.getRootNode();
|
|
5241
5254
|
if (sourceRoot !== root) {
|
|
5242
|
-
reportViolation(sourceElement, elm, idRefAttrName);
|
|
5255
|
+
reportViolation$1(sourceElement, elm, idRefAttrName);
|
|
5243
5256
|
break;
|
|
5244
5257
|
}
|
|
5245
5258
|
}
|
|
@@ -5262,7 +5275,7 @@
|
|
|
5262
5275
|
var targetRoot = target.getRootNode();
|
|
5263
5276
|
if (targetRoot !== root) {
|
|
5264
5277
|
// target element's shadow root is not the same as ours
|
|
5265
|
-
reportViolation(elm, target, attrName);
|
|
5278
|
+
reportViolation$1(elm, target, attrName);
|
|
5266
5279
|
}
|
|
5267
5280
|
}
|
|
5268
5281
|
}
|
|
@@ -5276,7 +5289,7 @@
|
|
|
5276
5289
|
var enabled = false;
|
|
5277
5290
|
// We want to avoid patching globals whenever possible, so this should be tree-shaken out in prod-mode and if
|
|
5278
5291
|
// reporting is not enabled. It should also only run once
|
|
5279
|
-
function enableDetection() {
|
|
5292
|
+
function enableDetection$1() {
|
|
5280
5293
|
if (enabled) {
|
|
5281
5294
|
return; // don't double-apply the patches
|
|
5282
5295
|
}
|
|
@@ -5331,7 +5344,102 @@
|
|
|
5331
5344
|
// Always run detection in dev mode, so we can at least print to the console
|
|
5332
5345
|
{
|
|
5333
5346
|
// In prod mode, only enable detection if reporting is enabled
|
|
5334
|
-
onReportingEnabled(enableDetection);
|
|
5347
|
+
onReportingEnabled(enableDetection$1);
|
|
5348
|
+
}
|
|
5349
|
+
}
|
|
5350
|
+
|
|
5351
|
+
/*
|
|
5352
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
5353
|
+
* All rights reserved.
|
|
5354
|
+
* SPDX-License-Identifier: MIT
|
|
5355
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
5356
|
+
*/
|
|
5357
|
+
//
|
|
5358
|
+
// The goal of this code is to detect usages of non-standard reflected ARIA properties. These are caused by
|
|
5359
|
+
// legacy non-standard Element.prototype extensions added by the @lwc/aria-reflection package.
|
|
5360
|
+
//
|
|
5361
|
+
// See the README for @lwc/aria-reflection
|
|
5362
|
+
var NON_STANDARD_ARIA_PROPS = ['ariaActiveDescendant', 'ariaControls', 'ariaDescribedBy', 'ariaDetails', 'ariaErrorMessage', 'ariaFlowTo', 'ariaLabelledBy', 'ariaOwns'];
|
|
5363
|
+
function isLightningElement(elm) {
|
|
5364
|
+
// The former case is for `this.prop` (inside component) and the latter is for `element.prop` (outside component).
|
|
5365
|
+
// In both cases, we apply the non-standard prop even when the global polyfill is disabled, so this is kosher.
|
|
5366
|
+
return elm instanceof LightningElement || elm instanceof BaseBridgeElement;
|
|
5367
|
+
}
|
|
5368
|
+
function findVM(elm) {
|
|
5369
|
+
// If it's a shadow DOM component, then it has a host
|
|
5370
|
+
var _elm$getRootNode = elm.getRootNode(),
|
|
5371
|
+
host = _elm$getRootNode.host;
|
|
5372
|
+
var vm = isUndefined$1(host) ? undefined : getAssociatedVMIfPresent(host);
|
|
5373
|
+
if (!isUndefined$1(vm)) {
|
|
5374
|
+
return vm;
|
|
5375
|
+
}
|
|
5376
|
+
// Else it might be a light DOM component. Walk up the tree trying to find the owner
|
|
5377
|
+
var parentElement = elm;
|
|
5378
|
+
while (!isNull(parentElement = parentElement.parentElement)) {
|
|
5379
|
+
if (isLightningElement(parentElement)) {
|
|
5380
|
+
var _vm = getAssociatedVMIfPresent(parentElement);
|
|
5381
|
+
if (!isUndefined$1(_vm)) {
|
|
5382
|
+
return _vm;
|
|
5383
|
+
}
|
|
5384
|
+
}
|
|
5385
|
+
}
|
|
5386
|
+
// If we return undefined, it's because the element was rendered wholly outside a LightningElement
|
|
5387
|
+
}
|
|
5388
|
+
|
|
5389
|
+
function checkAndReportViolation(elm, prop) {
|
|
5390
|
+
if (!isLightningElement(elm)) {
|
|
5391
|
+
var vm = findVM(elm);
|
|
5392
|
+
report(2 /* ReportingEventId.NonStandardAriaReflection */, {
|
|
5393
|
+
tagName: vm === null || vm === void 0 ? void 0 : vm.tagName,
|
|
5394
|
+
propertyName: prop
|
|
5395
|
+
});
|
|
5396
|
+
}
|
|
5397
|
+
}
|
|
5398
|
+
function enableDetection() {
|
|
5399
|
+
var _Element = Element,
|
|
5400
|
+
prototype = _Element.prototype;
|
|
5401
|
+
var _iterator7 = _createForOfIteratorHelper(NON_STANDARD_ARIA_PROPS),
|
|
5402
|
+
_step7;
|
|
5403
|
+
try {
|
|
5404
|
+
var _loop3 = function _loop3() {
|
|
5405
|
+
var prop = _step7.value;
|
|
5406
|
+
var descriptor = getOwnPropertyDescriptor$1(prototype, prop);
|
|
5407
|
+
// The descriptor should exist because the @lwc/aria-reflection polyfill has run by now.
|
|
5408
|
+
// This happens automatically because of the ordering of imports.
|
|
5409
|
+
if ("production" !== 'production') ;
|
|
5410
|
+
// @ts-ignore
|
|
5411
|
+
var _get4 = descriptor.get,
|
|
5412
|
+
_set4 = descriptor.set;
|
|
5413
|
+
defineProperty(prototype, prop, {
|
|
5414
|
+
get: function get() {
|
|
5415
|
+
checkAndReportViolation(this, prop);
|
|
5416
|
+
return _get4.call(this);
|
|
5417
|
+
},
|
|
5418
|
+
set: function set(val) {
|
|
5419
|
+
checkAndReportViolation(this, prop);
|
|
5420
|
+
return _set4.call(this, val);
|
|
5421
|
+
},
|
|
5422
|
+
configurable: true,
|
|
5423
|
+
enumerable: true
|
|
5424
|
+
});
|
|
5425
|
+
};
|
|
5426
|
+
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
5427
|
+
_loop3();
|
|
5428
|
+
}
|
|
5429
|
+
} catch (err) {
|
|
5430
|
+
_iterator7.e(err);
|
|
5431
|
+
} finally {
|
|
5432
|
+
_iterator7.f();
|
|
5433
|
+
}
|
|
5434
|
+
}
|
|
5435
|
+
// No point in running this code if we're not in a browser, or if the global polyfill is not loaded
|
|
5436
|
+
{
|
|
5437
|
+
if (!lwcRuntimeFlags.DISABLE_ARIA_REFLECTION_POLYFILL) {
|
|
5438
|
+
// Always run detection in dev mode, so we can at least print to the console
|
|
5439
|
+
{
|
|
5440
|
+
// In prod mode, only enable detection if reporting is enabled
|
|
5441
|
+
onReportingEnabled(enableDetection);
|
|
5442
|
+
}
|
|
5335
5443
|
}
|
|
5336
5444
|
}
|
|
5337
5445
|
|
|
@@ -5756,6 +5864,121 @@
|
|
|
5756
5864
|
hooksAreSet = true;
|
|
5757
5865
|
setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
|
|
5758
5866
|
}
|
|
5867
|
+
|
|
5868
|
+
/*
|
|
5869
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
5870
|
+
* All rights reserved.
|
|
5871
|
+
* SPDX-License-Identifier: MIT
|
|
5872
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
5873
|
+
*/
|
|
5874
|
+
// See @lwc/engine-core/src/framework/template.ts
|
|
5875
|
+
var TEMPLATE_PROPS = ['slots', 'stylesheetToken', 'stylesheets', 'renderMode'];
|
|
5876
|
+
// Expandos that may be placed on a stylesheet factory function, and which are meaningful to LWC at runtime
|
|
5877
|
+
var STYLESHEET_PROPS = [
|
|
5878
|
+
// SEE `KEY__SCOPED_CSS` in @lwc/style-compiler
|
|
5879
|
+
'$scoped$'];
|
|
5880
|
+
// Via https://www.npmjs.com/package/object-observer
|
|
5881
|
+
var ARRAY_MUTATION_METHODS = ['pop', 'push', 'shift', 'unshift', 'reverse', 'sort', 'fill', 'splice', 'copyWithin'];
|
|
5882
|
+
var mutationTrackingDisabled = false;
|
|
5883
|
+
function getOriginalArrayMethod(prop) {
|
|
5884
|
+
switch (prop) {
|
|
5885
|
+
case 'pop':
|
|
5886
|
+
return ArrayPop;
|
|
5887
|
+
case 'push':
|
|
5888
|
+
return ArrayPush$1;
|
|
5889
|
+
case 'shift':
|
|
5890
|
+
return ArrayShift;
|
|
5891
|
+
case 'unshift':
|
|
5892
|
+
return ArrayUnshift;
|
|
5893
|
+
case 'reverse':
|
|
5894
|
+
return ArrayReverse;
|
|
5895
|
+
case 'sort':
|
|
5896
|
+
return ArraySort;
|
|
5897
|
+
case 'fill':
|
|
5898
|
+
return ArrayFill;
|
|
5899
|
+
case 'splice':
|
|
5900
|
+
return ArraySplice;
|
|
5901
|
+
case 'copyWithin':
|
|
5902
|
+
return ArrayCopyWithin;
|
|
5903
|
+
}
|
|
5904
|
+
}
|
|
5905
|
+
function reportViolation(type, eventId, prop) {
|
|
5906
|
+
report(eventId, {
|
|
5907
|
+
propertyName: prop
|
|
5908
|
+
});
|
|
5909
|
+
}
|
|
5910
|
+
function reportTemplateViolation(prop) {
|
|
5911
|
+
reportViolation('template', 3 /* ReportingEventId.TemplateMutation */, prop);
|
|
5912
|
+
}
|
|
5913
|
+
function reportStylesheetViolation(prop) {
|
|
5914
|
+
reportViolation('stylesheet', 4 /* ReportingEventId.StylesheetMutation */, prop);
|
|
5915
|
+
}
|
|
5916
|
+
// Warn if the user tries to mutate a stylesheets array, e.g.:
|
|
5917
|
+
// `tmpl.stylesheets.push(someStylesheetFunction)`
|
|
5918
|
+
function warnOnArrayMutation(stylesheets) {
|
|
5919
|
+
// We can't handle users calling Array.prototype.slice.call(tmpl.stylesheets), but
|
|
5920
|
+
// we can at least warn when they use the most common mutation methods.
|
|
5921
|
+
var _iterator8 = _createForOfIteratorHelper(ARRAY_MUTATION_METHODS),
|
|
5922
|
+
_step8;
|
|
5923
|
+
try {
|
|
5924
|
+
var _loop4 = function _loop4() {
|
|
5925
|
+
var prop = _step8.value;
|
|
5926
|
+
var originalArrayMethod = getOriginalArrayMethod(prop);
|
|
5927
|
+
stylesheets[prop] = function arrayMutationWarningWrapper() {
|
|
5928
|
+
reportTemplateViolation('stylesheets');
|
|
5929
|
+
// @ts-ignore
|
|
5930
|
+
return originalArrayMethod.apply(this, arguments);
|
|
5931
|
+
};
|
|
5932
|
+
};
|
|
5933
|
+
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
|
5934
|
+
_loop4();
|
|
5935
|
+
}
|
|
5936
|
+
} catch (err) {
|
|
5937
|
+
_iterator8.e(err);
|
|
5938
|
+
} finally {
|
|
5939
|
+
_iterator8.f();
|
|
5940
|
+
}
|
|
5941
|
+
}
|
|
5942
|
+
// Warn if the user tries to mutate a stylesheet factory function, e.g.:
|
|
5943
|
+
// `stylesheet.$scoped$ = true`
|
|
5944
|
+
function warnOnStylesheetFunctionMutation(stylesheet) {
|
|
5945
|
+
var _iterator9 = _createForOfIteratorHelper(STYLESHEET_PROPS),
|
|
5946
|
+
_step9;
|
|
5947
|
+
try {
|
|
5948
|
+
var _loop5 = function _loop5() {
|
|
5949
|
+
var prop = _step9.value;
|
|
5950
|
+
var value = stylesheet[prop];
|
|
5951
|
+
defineProperty(stylesheet, prop, {
|
|
5952
|
+
enumerable: true,
|
|
5953
|
+
configurable: true,
|
|
5954
|
+
get: function get() {
|
|
5955
|
+
return value;
|
|
5956
|
+
},
|
|
5957
|
+
set: function set(newValue) {
|
|
5958
|
+
reportStylesheetViolation(prop);
|
|
5959
|
+
value = newValue;
|
|
5960
|
+
}
|
|
5961
|
+
});
|
|
5962
|
+
};
|
|
5963
|
+
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
5964
|
+
_loop5();
|
|
5965
|
+
}
|
|
5966
|
+
} catch (err) {
|
|
5967
|
+
_iterator9.e(err);
|
|
5968
|
+
} finally {
|
|
5969
|
+
_iterator9.f();
|
|
5970
|
+
}
|
|
5971
|
+
}
|
|
5972
|
+
// Warn on either array or stylesheet (function) mutation, in a deeply-nested array
|
|
5973
|
+
function trackStylesheetsMutation(stylesheets) {
|
|
5974
|
+
traverseStylesheets(stylesheets, function (subStylesheets) {
|
|
5975
|
+
if (isArray$1(subStylesheets)) {
|
|
5976
|
+
warnOnArrayMutation(subStylesheets);
|
|
5977
|
+
} else {
|
|
5978
|
+
warnOnStylesheetFunctionMutation(subStylesheets);
|
|
5979
|
+
}
|
|
5980
|
+
});
|
|
5981
|
+
}
|
|
5759
5982
|
// Deeply freeze the entire array (of arrays) of stylesheet factory functions
|
|
5760
5983
|
function deepFreeze(stylesheets) {
|
|
5761
5984
|
traverseStylesheets(stylesheets, function (subStylesheets) {
|
|
@@ -5774,7 +5997,80 @@
|
|
|
5774
5997
|
}
|
|
5775
5998
|
}
|
|
5776
5999
|
}
|
|
6000
|
+
function trackMutations(tmpl) {
|
|
6001
|
+
if (!isUndefined$1(tmpl.stylesheets)) {
|
|
6002
|
+
trackStylesheetsMutation(tmpl.stylesheets);
|
|
6003
|
+
}
|
|
6004
|
+
var _iterator10 = _createForOfIteratorHelper(TEMPLATE_PROPS),
|
|
6005
|
+
_step10;
|
|
6006
|
+
try {
|
|
6007
|
+
var _loop6 = function _loop6() {
|
|
6008
|
+
var prop = _step10.value;
|
|
6009
|
+
var value = tmpl[prop];
|
|
6010
|
+
defineProperty(tmpl, prop, {
|
|
6011
|
+
enumerable: true,
|
|
6012
|
+
configurable: true,
|
|
6013
|
+
get: function get() {
|
|
6014
|
+
return value;
|
|
6015
|
+
},
|
|
6016
|
+
set: function set(newValue) {
|
|
6017
|
+
if (!mutationTrackingDisabled) {
|
|
6018
|
+
reportTemplateViolation(prop);
|
|
6019
|
+
}
|
|
6020
|
+
value = newValue;
|
|
6021
|
+
}
|
|
6022
|
+
});
|
|
6023
|
+
};
|
|
6024
|
+
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
|
6025
|
+
_loop6();
|
|
6026
|
+
}
|
|
6027
|
+
} catch (err) {
|
|
6028
|
+
_iterator10.e(err);
|
|
6029
|
+
} finally {
|
|
6030
|
+
_iterator10.f();
|
|
6031
|
+
}
|
|
6032
|
+
var originalDescriptor = getOwnPropertyDescriptor$1(tmpl, 'stylesheetTokens');
|
|
6033
|
+
defineProperty(tmpl, 'stylesheetTokens', {
|
|
6034
|
+
enumerable: true,
|
|
6035
|
+
configurable: true,
|
|
6036
|
+
get: originalDescriptor.get,
|
|
6037
|
+
set: function set(value) {
|
|
6038
|
+
reportTemplateViolation('stylesheetTokens');
|
|
6039
|
+
// Avoid logging/reporting twice (for both stylesheetToken and stylesheetTokens)
|
|
6040
|
+
mutationTrackingDisabled = true;
|
|
6041
|
+
originalDescriptor.set.call(this, value);
|
|
6042
|
+
mutationTrackingDisabled = false;
|
|
6043
|
+
}
|
|
6044
|
+
});
|
|
6045
|
+
}
|
|
6046
|
+
function addLegacyStylesheetTokensShim(tmpl) {
|
|
6047
|
+
// When ENABLE_FROZEN_TEMPLATE is false, then we shim stylesheetTokens on top of stylesheetToken for anyone who
|
|
6048
|
+
// is accessing the old internal API (backwards compat). Details: https://salesforce.quip.com/v1rmAFu2cKAr
|
|
6049
|
+
defineProperty(tmpl, 'stylesheetTokens', {
|
|
6050
|
+
enumerable: true,
|
|
6051
|
+
configurable: true,
|
|
6052
|
+
get: function get() {
|
|
6053
|
+
var stylesheetToken = this.stylesheetToken;
|
|
6054
|
+
if (isUndefined$1(stylesheetToken)) {
|
|
6055
|
+
return stylesheetToken;
|
|
6056
|
+
}
|
|
6057
|
+
// Shim for the old `stylesheetTokens` property
|
|
6058
|
+
// See https://github.com/salesforce/lwc/pull/2332/files#diff-7901555acef29969adaa6583185b3e9bce475cdc6f23e799a54e0018cb18abaa
|
|
6059
|
+
return {
|
|
6060
|
+
hostAttribute: "".concat(stylesheetToken, "-host"),
|
|
6061
|
+
shadowAttribute: stylesheetToken
|
|
6062
|
+
};
|
|
6063
|
+
},
|
|
6064
|
+
set: function set(value) {
|
|
6065
|
+
// If the value is null or some other exotic object, you would be broken anyway in the past
|
|
6066
|
+
// because the engine would try to access hostAttribute/shadowAttribute, which would throw an error.
|
|
6067
|
+
// However it may be undefined in newer versions of LWC, so we need to guard against that case.
|
|
6068
|
+
this.stylesheetToken = isUndefined$1(value) ? undefined : value.shadowAttribute;
|
|
6069
|
+
}
|
|
6070
|
+
});
|
|
6071
|
+
}
|
|
5777
6072
|
function freezeTemplate(tmpl) {
|
|
6073
|
+
// TODO [#2782]: remove this flag and delete the legacy behavior
|
|
5778
6074
|
if (lwcRuntimeFlags.ENABLE_FROZEN_TEMPLATE) {
|
|
5779
6075
|
// Deep freeze the template
|
|
5780
6076
|
freeze(tmpl);
|
|
@@ -5782,31 +6078,16 @@
|
|
|
5782
6078
|
deepFreeze(tmpl.stylesheets);
|
|
5783
6079
|
}
|
|
5784
6080
|
} else {
|
|
5785
|
-
//
|
|
5786
|
-
//
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5795
|
-
}
|
|
5796
|
-
// Shim for the old `stylesheetTokens` property
|
|
5797
|
-
// See https://github.com/salesforce/lwc/pull/2332/files#diff-7901555acef29969adaa6583185b3e9bce475cdc6f23e799a54e0018cb18abaa
|
|
5798
|
-
return {
|
|
5799
|
-
hostAttribute: "".concat(stylesheetToken, "-host"),
|
|
5800
|
-
shadowAttribute: stylesheetToken
|
|
5801
|
-
};
|
|
5802
|
-
},
|
|
5803
|
-
set: function set(value) {
|
|
5804
|
-
// If the value is null or some other exotic object, you would be broken anyway in the past
|
|
5805
|
-
// because the engine would try to access hostAttribute/shadowAttribute, which would throw an error.
|
|
5806
|
-
// However it may be undefined in newer versions of LWC, so we need to guard against that case.
|
|
5807
|
-
this.stylesheetToken = isUndefined$1(value) ? undefined : value.shadowAttribute;
|
|
5808
|
-
}
|
|
5809
|
-
});
|
|
6081
|
+
// template is not frozen - shim, report, and warn
|
|
6082
|
+
// this shim should be applied in both dev and prod
|
|
6083
|
+
addLegacyStylesheetTokensShim(tmpl);
|
|
6084
|
+
// When ENABLE_FROZEN_TEMPLATE is false, we want to warn in dev mode whenever someone is mutating the template
|
|
6085
|
+
{
|
|
6086
|
+
// In prod mode, we only track mutations if reporting is enabled
|
|
6087
|
+
onReportingEnabled(function () {
|
|
6088
|
+
trackMutations(tmpl);
|
|
6089
|
+
});
|
|
6090
|
+
}
|
|
5810
6091
|
}
|
|
5811
6092
|
}
|
|
5812
6093
|
|
|
@@ -6020,7 +6301,7 @@
|
|
|
6020
6301
|
var cachedConstructors = new Map();
|
|
6021
6302
|
var elementsUpgradedOutsideLWC = new WeakSet();
|
|
6022
6303
|
var elementBeingUpgradedByLWC = false;
|
|
6023
|
-
// Creates a constructor that is intended to be used as a
|
|
6304
|
+
// Creates a constructor that is intended to be used directly as a custom element, except that the upgradeCallback is
|
|
6024
6305
|
// passed in to the constructor so LWC can reuse the same custom element constructor for multiple components.
|
|
6025
6306
|
// Another benefit is that only LWC can create components that actually do anything – if you do
|
|
6026
6307
|
// `customElements.define('x-foo')`, then you don't have access to the upgradeCallback, so it's a dummy custom element.
|
|
@@ -6069,7 +6350,7 @@
|
|
|
6069
6350
|
}
|
|
6070
6351
|
return UpgradableConstructor;
|
|
6071
6352
|
};
|
|
6072
|
-
var
|
|
6353
|
+
var createCustomElementUsingUpgradableConstructor = function createCustomElementUsingUpgradableConstructor(tagName, upgradeCallback, connectedCallback, disconnectedCallback) {
|
|
6073
6354
|
// use global custom elements registry
|
|
6074
6355
|
var UpgradableConstructor = cachedConstructors.get(tagName);
|
|
6075
6356
|
if (isUndefined$1(UpgradableConstructor)) {
|
|
@@ -6096,7 +6377,7 @@
|
|
|
6096
6377
|
*/
|
|
6097
6378
|
/**
|
|
6098
6379
|
* Create a scoped registry, i.e. a function that can create custom elements whose tag names
|
|
6099
|
-
* do not conflict with
|
|
6380
|
+
* do not conflict with third-party custom elements having the same tag name.
|
|
6100
6381
|
*/
|
|
6101
6382
|
function createScopedRegistry() {
|
|
6102
6383
|
if (!hasCustomElements) {
|
|
@@ -6427,17 +6708,17 @@
|
|
|
6427
6708
|
function flushPendingWhenDefinedCallbacks(tagName, ctor) {
|
|
6428
6709
|
var resolvers = pendingWhenDefinedCallbacks.get(tagName);
|
|
6429
6710
|
if (!isUndefined$1(resolvers)) {
|
|
6430
|
-
var
|
|
6431
|
-
|
|
6711
|
+
var _iterator11 = _createForOfIteratorHelper(resolvers),
|
|
6712
|
+
_step11;
|
|
6432
6713
|
try {
|
|
6433
|
-
for (
|
|
6434
|
-
var resolver =
|
|
6714
|
+
for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
|
|
6715
|
+
var resolver = _step11.value;
|
|
6435
6716
|
resolver(ctor);
|
|
6436
6717
|
}
|
|
6437
6718
|
} catch (err) {
|
|
6438
|
-
|
|
6719
|
+
_iterator11.e(err);
|
|
6439
6720
|
} finally {
|
|
6440
|
-
|
|
6721
|
+
_iterator11.f();
|
|
6441
6722
|
}
|
|
6442
6723
|
}
|
|
6443
6724
|
pendingWhenDefinedCallbacks.delete(tagName);
|
|
@@ -6487,11 +6768,11 @@
|
|
|
6487
6768
|
var awaiting = awaitingUpgrade.get(tagName);
|
|
6488
6769
|
if (!isUndefined$1(awaiting)) {
|
|
6489
6770
|
awaitingUpgrade.delete(tagName);
|
|
6490
|
-
var
|
|
6491
|
-
|
|
6771
|
+
var _iterator12 = _createForOfIteratorHelper(awaiting),
|
|
6772
|
+
_step12;
|
|
6492
6773
|
try {
|
|
6493
|
-
for (
|
|
6494
|
-
var element =
|
|
6774
|
+
for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
|
|
6775
|
+
var element = _step12.value;
|
|
6495
6776
|
var registeredDefinition = pendingRegistryForElement.get(element);
|
|
6496
6777
|
// At this point, registeredDefinition should never be undefined because awaitingUpgrade
|
|
6497
6778
|
// is only populated when we haven't run internalUpgrade yet, and we only populate
|
|
@@ -6503,9 +6784,9 @@
|
|
|
6503
6784
|
}
|
|
6504
6785
|
}
|
|
6505
6786
|
} catch (err) {
|
|
6506
|
-
|
|
6787
|
+
_iterator12.e(err);
|
|
6507
6788
|
} finally {
|
|
6508
|
-
|
|
6789
|
+
_iterator12.f();
|
|
6509
6790
|
}
|
|
6510
6791
|
}
|
|
6511
6792
|
// If anyone called customElements.whenDefined() and is still waiting for a promise resolution, resolve now
|
|
@@ -6702,10 +6983,10 @@
|
|
|
6702
6983
|
* We have three modes for creating custom elements:
|
|
6703
6984
|
*
|
|
6704
6985
|
* 1. Compat (legacy) browser support (e.g. IE11). Totally custom, doesn't rely on native browser APIs.
|
|
6705
|
-
* 2. "
|
|
6706
|
-
*
|
|
6707
|
-
*
|
|
6708
|
-
* constructor, which allows us to have completely customized functionality for different components.
|
|
6986
|
+
* 2. "Upgradable constructor" custom element. This allows us to have two LWC components with the same tag name,
|
|
6987
|
+
* via a trick: every custom element constructor we define in the registry is basically the same. It's essentially
|
|
6988
|
+
* a dummy `class extends HTMLElement` that accepts an `upgradeCallback` in its constructor ("upgradable
|
|
6989
|
+
* constructor"), which allows us to have completely customized functionality for different components.
|
|
6709
6990
|
* 3. "Scoped" (or "pivot") custom elements. This relies on a sophisticated system that emulates the "scoped custom
|
|
6710
6991
|
* elements registry" proposal, with support for avoiding conflicts in tag names both between LWC components and
|
|
6711
6992
|
* between LWC components and third-party elements. This uses a similar trick to #2, but is much more complex
|
|
@@ -6716,8 +6997,8 @@
|
|
|
6716
6997
|
if (lwcRuntimeFlags.ENABLE_SCOPED_CUSTOM_ELEMENT_REGISTRY) {
|
|
6717
6998
|
createCustomElement = createCustomElementScoped;
|
|
6718
6999
|
} else {
|
|
6719
|
-
// use global
|
|
6720
|
-
createCustomElement =
|
|
7000
|
+
// use the global registry, with an upgradable constructor for the defined custom element
|
|
7001
|
+
createCustomElement = createCustomElementUsingUpgradableConstructor;
|
|
6721
7002
|
}
|
|
6722
7003
|
} else {
|
|
6723
7004
|
// no registry available here
|
|
@@ -6771,10 +7052,10 @@
|
|
|
6771
7052
|
}
|
|
6772
7053
|
var assert = /*#__PURE__*/Object.freeze({
|
|
6773
7054
|
__proto__: null,
|
|
7055
|
+
fail: fail,
|
|
6774
7056
|
invariant: invariant,
|
|
6775
|
-
isTrue: isTrue$1,
|
|
6776
7057
|
isFalse: isFalse$1,
|
|
6777
|
-
|
|
7058
|
+
isTrue: isTrue$1
|
|
6778
7059
|
});
|
|
6779
7060
|
function isUndefined(obj) {
|
|
6780
7061
|
return obj === undefined;
|
|
@@ -6782,7 +7063,7 @@
|
|
|
6782
7063
|
function isNull(obj) {
|
|
6783
7064
|
return obj === null;
|
|
6784
7065
|
}
|
|
6785
|
-
/** version: 2.
|
|
7066
|
+
/** version: 2.36.0 */
|
|
6786
7067
|
|
|
6787
7068
|
/*
|
|
6788
7069
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -6841,17 +7122,17 @@
|
|
|
6841
7122
|
exports.createFragment = function (html) {
|
|
6842
7123
|
var wrapperTags = topLevelWrappingMap[getTagName(html)];
|
|
6843
7124
|
if (!isUndefined(wrapperTags)) {
|
|
6844
|
-
var
|
|
6845
|
-
|
|
7125
|
+
var _iterator13 = _createForOfIteratorHelper(wrapperTags),
|
|
7126
|
+
_step13;
|
|
6846
7127
|
try {
|
|
6847
|
-
for (
|
|
6848
|
-
var wrapperTag =
|
|
7128
|
+
for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
|
|
7129
|
+
var wrapperTag = _step13.value;
|
|
6849
7130
|
html = "<".concat(wrapperTag, ">").concat(html, "</").concat(wrapperTag, ">");
|
|
6850
7131
|
}
|
|
6851
7132
|
} catch (err) {
|
|
6852
|
-
|
|
7133
|
+
_iterator13.e(err);
|
|
6853
7134
|
} finally {
|
|
6854
|
-
|
|
7135
|
+
_iterator13.f();
|
|
6855
7136
|
}
|
|
6856
7137
|
}
|
|
6857
7138
|
// For IE11, the document title must not be undefined, but it can be an empty string
|
|
@@ -7341,7 +7622,7 @@
|
|
|
7341
7622
|
});
|
|
7342
7623
|
freeze(LightningElement);
|
|
7343
7624
|
seal(LightningElement.prototype);
|
|
7344
|
-
/* version: 2.
|
|
7625
|
+
/* version: 2.36.0 */
|
|
7345
7626
|
|
|
7346
7627
|
exports.LightningElement = LightningElement;
|
|
7347
7628
|
exports.__unstable__ProfilerControl = profilerControl;
|