lwc 2.13.1 → 2.13.4
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 +376 -170
- package/dist/engine-dom/iife/es2017/engine-dom.js +376 -169
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -2
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +222 -164
- package/dist/engine-dom/iife/es5/engine-dom.js +7562 -5758
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +5947 -4586
- package/dist/engine-dom/umd/es2017/engine-dom.js +376 -169
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -2
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +222 -164
- package/dist/engine-dom/umd/es5/engine-dom.js +7562 -5758
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +5947 -4586
- package/dist/engine-server/commonjs/es2017/engine-server.js +190 -72
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +190 -73
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +29 -4
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +29 -4
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +10 -13
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +4 -4
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +4601 -3603
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +10 -1
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +4424 -3481
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +29 -4
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +10 -13
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +4 -4
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +4601 -3603
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +10 -1
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +4424 -3481
- 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.min.js +1 -1
- package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/iife/es5/wire-service.js +243 -258
- package/dist/wire-service/iife/es5/wire-service.min.js +1 -1
- package/dist/wire-service/iife/es5/wire-service_debug.js +243 -258
- package/dist/wire-service/umd/es2017/wire-service.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service.min.js +1 -1
- package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es5/wire-service.js +243 -258
- package/dist/wire-service/umd/es5/wire-service.min.js +1 -1
- package/dist/wire-service/umd/es5/wire-service_debug.js +243 -258
- package/package.json +7 -7
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
*/
|
|
50
50
|
const { assign, create, defineProperties, defineProperty, freeze, getOwnPropertyDescriptor: getOwnPropertyDescriptor$1, getOwnPropertyNames: getOwnPropertyNames$1, getPrototypeOf: getPrototypeOf$1, hasOwnProperty: hasOwnProperty$1, isFrozen, keys, seal, setPrototypeOf, } = Object;
|
|
51
51
|
const { isArray: isArray$1 } = Array;
|
|
52
|
-
const { filter: ArrayFilter, find: ArrayFind, indexOf: ArrayIndexOf, join: ArrayJoin, map: ArrayMap, push: ArrayPush$1, reduce: ArrayReduce, reverse: ArrayReverse, slice: ArraySlice, splice: ArraySplice, unshift: ArrayUnshift, forEach, } = Array.prototype;
|
|
52
|
+
const { copyWithin: ArrayCopyWithin, fill: ArrayFill, filter: ArrayFilter, find: ArrayFind, indexOf: ArrayIndexOf, join: ArrayJoin, map: ArrayMap, pop: ArrayPop, push: ArrayPush$1, reduce: ArrayReduce, reverse: ArrayReverse, shift: ArrayShift, slice: ArraySlice, sort: ArraySort, splice: ArraySplice, unshift: ArrayUnshift, forEach, } = Array.prototype;
|
|
53
53
|
const { fromCharCode: StringFromCharCode } = String;
|
|
54
54
|
const { charCodeAt: StringCharCodeAt, replace: StringReplace, slice: StringSlice, toLowerCase: StringToLowerCase, } = String.prototype;
|
|
55
55
|
function isUndefined$1(obj) {
|
|
@@ -293,7 +293,7 @@
|
|
|
293
293
|
const XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';
|
|
294
294
|
const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
|
|
295
295
|
const XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
|
|
296
|
-
/** version: 2.13.
|
|
296
|
+
/** version: 2.13.4 */
|
|
297
297
|
|
|
298
298
|
/*
|
|
299
299
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -383,6 +383,7 @@
|
|
|
383
383
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
384
384
|
*/
|
|
385
385
|
const features = {
|
|
386
|
+
DUMMY_TEST_FLAG: null,
|
|
386
387
|
ENABLE_ELEMENT_PATCH: null,
|
|
387
388
|
ENABLE_FORCE_NATIVE_SHADOW_MODE_FOR_TEST: null,
|
|
388
389
|
ENABLE_HMR: null,
|
|
@@ -436,9 +437,6 @@
|
|
|
436
437
|
*/
|
|
437
438
|
function setFeatureFlagForTest(name, value) {
|
|
438
439
|
}
|
|
439
|
-
/** version: 2.13.1 */
|
|
440
|
-
|
|
441
|
-
/* proxy-compat-disable */
|
|
442
440
|
|
|
443
441
|
/*
|
|
444
442
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -518,10 +516,6 @@
|
|
|
518
516
|
function setHTMLElement(HTMLElementImpl) {
|
|
519
517
|
HTMLElementExported$1 = HTMLElementImpl;
|
|
520
518
|
}
|
|
521
|
-
let isHydrating$1;
|
|
522
|
-
function setIsHydrating$1(isHydratingImpl) {
|
|
523
|
-
isHydrating$1 = isHydratingImpl;
|
|
524
|
-
}
|
|
525
519
|
let insert$1;
|
|
526
520
|
function setInsert(insertImpl) {
|
|
527
521
|
insert$1 = insertImpl;
|
|
@@ -642,10 +636,6 @@
|
|
|
642
636
|
function setIsConnected(isConnectedImpl) {
|
|
643
637
|
isConnected$1 = isConnectedImpl;
|
|
644
638
|
}
|
|
645
|
-
let insertGlobalStylesheet$1;
|
|
646
|
-
function setInsertGlobalStylesheet(insertGlobalStylesheetImpl) {
|
|
647
|
-
insertGlobalStylesheet$1 = insertGlobalStylesheetImpl;
|
|
648
|
-
}
|
|
649
639
|
let insertStylesheet$1;
|
|
650
640
|
function setInsertStylesheet(insertStylesheetImpl) {
|
|
651
641
|
insertStylesheet$1 = insertStylesheetImpl;
|
|
@@ -2054,6 +2044,12 @@
|
|
|
2054
2044
|
return isUndefined$1(meta) ? defaultMeta : meta;
|
|
2055
2045
|
}
|
|
2056
2046
|
|
|
2047
|
+
/*
|
|
2048
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
2049
|
+
* All rights reserved.
|
|
2050
|
+
* SPDX-License-Identifier: MIT
|
|
2051
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
2052
|
+
*/
|
|
2057
2053
|
const signedTemplateSet = new Set();
|
|
2058
2054
|
function defaultEmptyTemplate() {
|
|
2059
2055
|
return [];
|
|
@@ -2068,6 +2064,32 @@
|
|
|
2068
2064
|
*/
|
|
2069
2065
|
function registerTemplate(tpl) {
|
|
2070
2066
|
signedTemplateSet.add(tpl);
|
|
2067
|
+
// FIXME[@W-10950976]: the template object should be frozen, and it should not be possible to set
|
|
2068
|
+
// the stylesheets or stylesheetToken(s). For backwards compat, though, we shim stylesheetTokens
|
|
2069
|
+
// on top of stylesheetToken for anyone who is accessing the old internal API.
|
|
2070
|
+
// Details: https://salesforce.quip.com/v1rmAFu2cKAr
|
|
2071
|
+
defineProperty(tpl, 'stylesheetTokens', {
|
|
2072
|
+
enumerable: true,
|
|
2073
|
+
configurable: true,
|
|
2074
|
+
get() {
|
|
2075
|
+
const { stylesheetToken } = this;
|
|
2076
|
+
if (isUndefined$1(stylesheetToken)) {
|
|
2077
|
+
return stylesheetToken;
|
|
2078
|
+
}
|
|
2079
|
+
// Shim for the old `stylesheetTokens` property
|
|
2080
|
+
// See https://github.com/salesforce/lwc/pull/2332/files#diff-7901555acef29969adaa6583185b3e9bce475cdc6f23e799a54e0018cb18abaa
|
|
2081
|
+
return {
|
|
2082
|
+
hostAttribute: `${stylesheetToken}-host`,
|
|
2083
|
+
shadowAttribute: stylesheetToken,
|
|
2084
|
+
};
|
|
2085
|
+
},
|
|
2086
|
+
set(value) {
|
|
2087
|
+
// If the value is null or some other exotic object, you would be broken anyway in the past
|
|
2088
|
+
// because the engine would try to access hostAttribute/shadowAttribute, which would throw an error.
|
|
2089
|
+
// However it may be undefined in newer versions of LWC, so we need to guard against that case.
|
|
2090
|
+
this.stylesheetToken = isUndefined$1(value) ? undefined : value.shadowAttribute;
|
|
2091
|
+
},
|
|
2092
|
+
});
|
|
2071
2093
|
// chaining this method as a way to wrap existing
|
|
2072
2094
|
// assignment of templates easily, without too much transformation
|
|
2073
2095
|
return tpl;
|
|
@@ -2841,15 +2863,16 @@
|
|
|
2841
2863
|
}
|
|
2842
2864
|
}
|
|
2843
2865
|
function unmount(vnode, parent, doRemove = false) {
|
|
2844
|
-
const { type, elm } = vnode;
|
|
2866
|
+
const { type, elm, sel } = vnode;
|
|
2845
2867
|
// When unmounting a VNode subtree not all the elements have to removed from the DOM. The
|
|
2846
2868
|
// subtree root, is the only element worth unmounting from the subtree.
|
|
2847
2869
|
if (doRemove) {
|
|
2848
2870
|
removeNode(elm, parent);
|
|
2849
2871
|
}
|
|
2872
|
+
const removeChildren = sel === 'slot'; // slot content is removed to trigger slotchange event when removing slot
|
|
2850
2873
|
switch (type) {
|
|
2851
2874
|
case 2 /* Element */:
|
|
2852
|
-
unmountVNodes(vnode.children, elm);
|
|
2875
|
+
unmountVNodes(vnode.children, elm, removeChildren);
|
|
2853
2876
|
break;
|
|
2854
2877
|
case 3 /* CustomElement */: {
|
|
2855
2878
|
const { vm } = vnode;
|
|
@@ -3617,10 +3640,10 @@
|
|
|
3617
3640
|
const { renderMode, shadowMode } = vm;
|
|
3618
3641
|
if (renderMode === 1 /* Shadow */ && shadowMode === 1 /* Synthetic */) {
|
|
3619
3642
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
3620
|
-
|
|
3643
|
+
insertStylesheet$1(stylesheets[i]);
|
|
3621
3644
|
}
|
|
3622
3645
|
}
|
|
3623
|
-
else if (ssr$1 ||
|
|
3646
|
+
else if (ssr$1 || vm.hydrated) {
|
|
3624
3647
|
// Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
|
|
3625
3648
|
// This works in the client, because the stylesheets are created, and cached in the VM
|
|
3626
3649
|
// the first time the VM renders.
|
|
@@ -3631,15 +3654,10 @@
|
|
|
3631
3654
|
else {
|
|
3632
3655
|
// native shadow or light DOM, DOM renderer
|
|
3633
3656
|
const root = getNearestNativeShadowComponent(vm);
|
|
3634
|
-
|
|
3657
|
+
// null root means a global style
|
|
3658
|
+
const target = isNull(root) ? undefined : root.shadowRoot;
|
|
3635
3659
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
3636
|
-
|
|
3637
|
-
insertGlobalStylesheet$1(stylesheets[i]);
|
|
3638
|
-
}
|
|
3639
|
-
else {
|
|
3640
|
-
// local level
|
|
3641
|
-
insertStylesheet$1(stylesheets[i], root.shadowRoot);
|
|
3642
|
-
}
|
|
3660
|
+
insertStylesheet$1(stylesheets[i], target);
|
|
3643
3661
|
}
|
|
3644
3662
|
}
|
|
3645
3663
|
return null;
|
|
@@ -4038,24 +4056,14 @@
|
|
|
4038
4056
|
|
|
4039
4057
|
resetComponentStateWhenRemoved(vm);
|
|
4040
4058
|
}
|
|
4041
|
-
|
|
4042
|
-
function getNearestShadowAncestor(vm) {
|
|
4043
|
-
let ancestor = vm.owner;
|
|
4044
|
-
|
|
4045
|
-
while (!isNull(ancestor) && ancestor.renderMode === 0
|
|
4046
|
-
/* Light */
|
|
4047
|
-
) {
|
|
4048
|
-
ancestor = ancestor.owner;
|
|
4049
|
-
}
|
|
4050
|
-
|
|
4051
|
-
return ancestor;
|
|
4052
|
-
}
|
|
4053
|
-
|
|
4054
4059
|
function createVM(elm, ctor, options) {
|
|
4060
|
+
var _a;
|
|
4061
|
+
|
|
4055
4062
|
const {
|
|
4056
4063
|
mode,
|
|
4057
4064
|
owner,
|
|
4058
|
-
tagName
|
|
4065
|
+
tagName,
|
|
4066
|
+
hydrated
|
|
4059
4067
|
} = options;
|
|
4060
4068
|
const def = getComponentInternalDef(ctor);
|
|
4061
4069
|
const vm = {
|
|
@@ -4078,7 +4086,10 @@
|
|
|
4078
4086
|
cmpSlots: create(null),
|
|
4079
4087
|
oar: create(null),
|
|
4080
4088
|
cmpTemplate: null,
|
|
4089
|
+
hydrated: Boolean(hydrated),
|
|
4081
4090
|
renderMode: def.renderMode,
|
|
4091
|
+
shadowMode: computeShadowMode(def, owner),
|
|
4092
|
+
nearestShadowMode: (owner === null || owner === void 0 ? void 0 : owner.shadowRoot) ? owner.shadowMode : (_a = owner === null || owner === void 0 ? void 0 : owner.nearestShadowMode) !== null && _a !== void 0 ? _a : null,
|
|
4082
4093
|
context: {
|
|
4083
4094
|
stylesheetToken: undefined,
|
|
4084
4095
|
hasTokenInClass: undefined,
|
|
@@ -4091,7 +4102,6 @@
|
|
|
4091
4102
|
},
|
|
4092
4103
|
// Properties set right after VM creation.
|
|
4093
4104
|
tro: null,
|
|
4094
|
-
shadowMode: null,
|
|
4095
4105
|
// Properties set by the LightningElement constructor.
|
|
4096
4106
|
component: null,
|
|
4097
4107
|
shadowRoot: null,
|
|
@@ -4100,7 +4110,6 @@
|
|
|
4100
4110
|
setHook,
|
|
4101
4111
|
getHook
|
|
4102
4112
|
};
|
|
4103
|
-
vm.shadowMode = computeShadowMode(vm);
|
|
4104
4113
|
vm.tro = getTemplateReactiveObserver(vm);
|
|
4105
4114
|
|
|
4106
4115
|
|
|
@@ -4113,10 +4122,9 @@
|
|
|
4113
4122
|
return vm;
|
|
4114
4123
|
}
|
|
4115
4124
|
|
|
4116
|
-
function computeShadowMode(
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
} = vm;
|
|
4125
|
+
function computeShadowMode(def, owner) {
|
|
4126
|
+
var _a;
|
|
4127
|
+
|
|
4120
4128
|
let shadowMode;
|
|
4121
4129
|
|
|
4122
4130
|
if (isSyntheticShadowDefined$1) {
|
|
@@ -4139,23 +4147,13 @@
|
|
|
4139
4147
|
/* Native */
|
|
4140
4148
|
;
|
|
4141
4149
|
} else {
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
if
|
|
4145
|
-
|
|
4146
|
-
)
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
shadowMode = 0
|
|
4150
|
-
/* Native */
|
|
4151
|
-
;
|
|
4152
|
-
} else {
|
|
4153
|
-
// Synthetic if neither this component nor any of its ancestors are configured
|
|
4154
|
-
// to be native.
|
|
4155
|
-
shadowMode = 1
|
|
4156
|
-
/* Synthetic */
|
|
4157
|
-
;
|
|
4158
|
-
}
|
|
4150
|
+
// Transitive support for native Shadow DOM. A component in native mode
|
|
4151
|
+
// transitively opts all of its descendants into native.
|
|
4152
|
+
// Synthetic if neither this component nor any of its ancestors are configured
|
|
4153
|
+
// to be native.
|
|
4154
|
+
shadowMode = (_a = owner === null || owner === void 0 ? void 0 : owner.nearestShadowMode) !== null && _a !== void 0 ? _a : 1
|
|
4155
|
+
/* Synthetic */
|
|
4156
|
+
;
|
|
4159
4157
|
}
|
|
4160
4158
|
} else {
|
|
4161
4159
|
shadowMode = 1
|
|
@@ -4982,6 +4980,7 @@
|
|
|
4982
4980
|
mode,
|
|
4983
4981
|
owner,
|
|
4984
4982
|
tagName: sel,
|
|
4983
|
+
hydrated: true,
|
|
4985
4984
|
});
|
|
4986
4985
|
vnode.elm = elm;
|
|
4987
4986
|
vnode.vm = vm;
|
|
@@ -5131,7 +5130,10 @@
|
|
|
5131
5130
|
hooksAreSet = true;
|
|
5132
5131
|
setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
|
|
5133
5132
|
}
|
|
5134
|
-
|
|
5133
|
+
// TODO [#2782]: eventually freezeTemplate() will _actually_ freeze the tmpl object. Today it
|
|
5134
|
+
// just warns on mutation.
|
|
5135
|
+
function freezeTemplate(tmpl) {
|
|
5136
|
+
}
|
|
5135
5137
|
|
|
5136
5138
|
/*
|
|
5137
5139
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -5139,17 +5141,162 @@
|
|
|
5139
5141
|
* SPDX-License-Identifier: MIT
|
|
5140
5142
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
5141
5143
|
*/
|
|
5142
|
-
|
|
5143
|
-
|
|
5144
|
-
|
|
5144
|
+
/**
|
|
5145
|
+
* EXPERIMENTAL: This function provides access to the component constructor, given an HTMLElement.
|
|
5146
|
+
* This API is subject to change or being removed.
|
|
5147
|
+
*/
|
|
5148
|
+
function getComponentConstructor(elm) {
|
|
5149
|
+
let ctor = null;
|
|
5150
|
+
// intentionally checking for undefined due to some funky libraries patching weakmap.get
|
|
5151
|
+
// to throw when undefined.
|
|
5152
|
+
if (!isUndefined$1(elm)) {
|
|
5153
|
+
const vm = getAssociatedVMIfPresent(elm);
|
|
5154
|
+
if (!isUndefined$1(vm)) {
|
|
5155
|
+
ctor = vm.def.ctor;
|
|
5156
|
+
}
|
|
5157
|
+
}
|
|
5158
|
+
return ctor;
|
|
5159
|
+
}
|
|
5160
|
+
/* version: 2.13.4 */
|
|
5161
|
+
|
|
5162
|
+
/*
|
|
5163
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
5164
|
+
* All rights reserved.
|
|
5165
|
+
* SPDX-License-Identifier: MIT
|
|
5166
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
5167
|
+
*/
|
|
5168
|
+
//
|
|
5169
|
+
// Feature detection
|
|
5170
|
+
//
|
|
5171
|
+
// This check for constructable style sheets is similar to Fast's:
|
|
5145
5172
|
// https://github.com/microsoft/fast/blob/d49d1ec/packages/web-components/fast-element/src/dom.ts#L51-L53
|
|
5146
5173
|
// See also: https://github.com/whatwg/webidl/issues/1027#issuecomment-934510070
|
|
5147
|
-
const
|
|
5148
|
-
|
|
5174
|
+
const supportsConstructableStylesheets = isFunction$1(CSSStyleSheet.prototype.replaceSync) && isArray$1(document.adoptedStyleSheets);
|
|
5175
|
+
// The original adoptedStylesheet proposal used a frozen array. A follow-up proposal made the array mutable.
|
|
5176
|
+
// Chromium 99+ and Firefox 101+ support mutable arrays. We check if the array is mutable, to ensure backward compat.
|
|
5177
|
+
// (If the length is writable, then the array is mutable.) See: https://chromestatus.com/feature/5638996492288000
|
|
5178
|
+
// TODO [#2828]: Re-evaluate this in the future once we drop support for older browser versions.
|
|
5179
|
+
const supportsMutableAdoptedStyleSheets = supportsConstructableStylesheets &&
|
|
5149
5180
|
getOwnPropertyDescriptor$1(document.adoptedStyleSheets, 'length').writable;
|
|
5150
|
-
|
|
5151
|
-
const
|
|
5152
|
-
const
|
|
5181
|
+
// Detect IE, via https://stackoverflow.com/a/9851769
|
|
5182
|
+
const isIE11 = !isUndefined$1(document.documentMode);
|
|
5183
|
+
const stylesheetCache = new Map();
|
|
5184
|
+
function isDocument(target) {
|
|
5185
|
+
return !isUndefined$1(target.head);
|
|
5186
|
+
}
|
|
5187
|
+
function createFreshStyleElement(content) {
|
|
5188
|
+
const elm = document.createElement('style');
|
|
5189
|
+
elm.type = 'text/css';
|
|
5190
|
+
elm.textContent = content;
|
|
5191
|
+
return elm;
|
|
5192
|
+
}
|
|
5193
|
+
function createStyleElement(content, cacheData) {
|
|
5194
|
+
const { stylesheet, used } = cacheData;
|
|
5195
|
+
// If the <style> was already used, then we should clone it. We cannot insert
|
|
5196
|
+
// the same <style> in two places in the DOM.
|
|
5197
|
+
if (used) {
|
|
5198
|
+
// For a mysterious reason, IE11 doesn't like the way we clone <style> nodes
|
|
5199
|
+
// and will render the incorrect styles if we do things that way. It's just
|
|
5200
|
+
// a perf optimization, so we can skip it for IE11.
|
|
5201
|
+
if (isIE11) {
|
|
5202
|
+
return createFreshStyleElement(content);
|
|
5203
|
+
}
|
|
5204
|
+
// This `<style>` may be repeated multiple times in the DOM, so cache it. It's a bit
|
|
5205
|
+
// faster to call `cloneNode()` on an existing node than to recreate it every time.
|
|
5206
|
+
return stylesheet.cloneNode(true);
|
|
5207
|
+
}
|
|
5208
|
+
// We don't clone every time, because that would be a perf tax on the first time
|
|
5209
|
+
cacheData.used = true;
|
|
5210
|
+
return stylesheet;
|
|
5211
|
+
}
|
|
5212
|
+
function createConstructableStylesheet(content) {
|
|
5213
|
+
const stylesheet = new CSSStyleSheet();
|
|
5214
|
+
stylesheet.replaceSync(content);
|
|
5215
|
+
return stylesheet;
|
|
5216
|
+
}
|
|
5217
|
+
function insertConstructableStylesheet(content, target, cacheData) {
|
|
5218
|
+
const { adoptedStyleSheets } = target;
|
|
5219
|
+
const { stylesheet } = cacheData;
|
|
5220
|
+
// Mutable adopted stylesheets are only supported in certain browsers.
|
|
5221
|
+
// The reason we use it is for perf: https://github.com/salesforce/lwc/pull/2683
|
|
5222
|
+
if (supportsMutableAdoptedStyleSheets) {
|
|
5223
|
+
adoptedStyleSheets.push(stylesheet);
|
|
5224
|
+
}
|
|
5225
|
+
else {
|
|
5226
|
+
target.adoptedStyleSheets = [...adoptedStyleSheets, stylesheet];
|
|
5227
|
+
}
|
|
5228
|
+
}
|
|
5229
|
+
function insertStyleElement(content, target, cacheData) {
|
|
5230
|
+
const elm = createStyleElement(content, cacheData);
|
|
5231
|
+
const targetAnchorPoint = isDocument(target) ? target.head : target;
|
|
5232
|
+
targetAnchorPoint.appendChild(elm);
|
|
5233
|
+
}
|
|
5234
|
+
function doInsertStylesheet(content, target, cacheData) {
|
|
5235
|
+
// Constructable stylesheets are only supported in certain browsers:
|
|
5236
|
+
// https://caniuse.com/mdn-api_document_adoptedstylesheets
|
|
5237
|
+
// The reason we use it is for perf: https://github.com/salesforce/lwc/pull/2460
|
|
5238
|
+
if (supportsConstructableStylesheets) {
|
|
5239
|
+
insertConstructableStylesheet(content, target, cacheData);
|
|
5240
|
+
}
|
|
5241
|
+
else {
|
|
5242
|
+
// Fall back to <style> element
|
|
5243
|
+
insertStyleElement(content, target, cacheData);
|
|
5244
|
+
}
|
|
5245
|
+
}
|
|
5246
|
+
function getCacheData(content) {
|
|
5247
|
+
let cacheData = stylesheetCache.get(content);
|
|
5248
|
+
if (isUndefined$1(cacheData)) {
|
|
5249
|
+
cacheData = {
|
|
5250
|
+
stylesheet: supportsConstructableStylesheets
|
|
5251
|
+
? createConstructableStylesheet(content)
|
|
5252
|
+
: createFreshStyleElement(content),
|
|
5253
|
+
roots: undefined,
|
|
5254
|
+
global: false,
|
|
5255
|
+
used: false,
|
|
5256
|
+
};
|
|
5257
|
+
stylesheetCache.set(content, cacheData);
|
|
5258
|
+
}
|
|
5259
|
+
return cacheData;
|
|
5260
|
+
}
|
|
5261
|
+
function insertGlobalStylesheet(content) {
|
|
5262
|
+
const cacheData = getCacheData(content);
|
|
5263
|
+
if (cacheData.global) {
|
|
5264
|
+
// already inserted
|
|
5265
|
+
return;
|
|
5266
|
+
}
|
|
5267
|
+
cacheData.global = true; // mark inserted
|
|
5268
|
+
doInsertStylesheet(content, document, cacheData);
|
|
5269
|
+
}
|
|
5270
|
+
function insertLocalStylesheet(content, target) {
|
|
5271
|
+
const cacheData = getCacheData(content);
|
|
5272
|
+
let { roots } = cacheData;
|
|
5273
|
+
if (isUndefined$1(roots)) {
|
|
5274
|
+
roots = cacheData.roots = new WeakSet(); // lazily initialize (not needed for global styles)
|
|
5275
|
+
}
|
|
5276
|
+
else if (roots.has(target)) {
|
|
5277
|
+
// already inserted
|
|
5278
|
+
return;
|
|
5279
|
+
}
|
|
5280
|
+
roots.add(target); // mark inserted
|
|
5281
|
+
doInsertStylesheet(content, target, cacheData);
|
|
5282
|
+
}
|
|
5283
|
+
function insertStylesheet(content, target) {
|
|
5284
|
+
if (isUndefined$1(target)) {
|
|
5285
|
+
// global
|
|
5286
|
+
insertGlobalStylesheet(content);
|
|
5287
|
+
}
|
|
5288
|
+
else {
|
|
5289
|
+
// local
|
|
5290
|
+
insertLocalStylesheet(content, target);
|
|
5291
|
+
}
|
|
5292
|
+
}
|
|
5293
|
+
|
|
5294
|
+
/*
|
|
5295
|
+
* Copyright (c) 2018, salesforce.com, inc.
|
|
5296
|
+
* All rights reserved.
|
|
5297
|
+
* SPDX-License-Identifier: MIT
|
|
5298
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
5299
|
+
*/
|
|
5153
5300
|
let getCustomElement;
|
|
5154
5301
|
let defineCustomElement;
|
|
5155
5302
|
let HTMLElementConstructor;
|
|
@@ -5176,52 +5323,6 @@
|
|
|
5176
5323
|
return false;
|
|
5177
5324
|
}
|
|
5178
5325
|
}
|
|
5179
|
-
function insertConstructableStyleSheet(content, target) {
|
|
5180
|
-
// It's important for CSSStyleSheets to be unique based on their content, so that
|
|
5181
|
-
// `shadowRoot.adoptedStyleSheets.includes(sheet)` works.
|
|
5182
|
-
let styleSheet = styleSheets[content];
|
|
5183
|
-
if (isUndefined$1(styleSheet)) {
|
|
5184
|
-
styleSheet = new CSSStyleSheet();
|
|
5185
|
-
styleSheet.replaceSync(content);
|
|
5186
|
-
styleSheets[content] = styleSheet;
|
|
5187
|
-
}
|
|
5188
|
-
const { adoptedStyleSheets } = target;
|
|
5189
|
-
if (!adoptedStyleSheets.includes(styleSheet)) {
|
|
5190
|
-
if (supportsMutableAdoptedStyleSheets) {
|
|
5191
|
-
// This is only supported in later versions of Chromium:
|
|
5192
|
-
// https://chromestatus.com/feature/5638996492288000
|
|
5193
|
-
adoptedStyleSheets.push(styleSheet);
|
|
5194
|
-
}
|
|
5195
|
-
else {
|
|
5196
|
-
target.adoptedStyleSheets = [...adoptedStyleSheets, styleSheet];
|
|
5197
|
-
}
|
|
5198
|
-
}
|
|
5199
|
-
}
|
|
5200
|
-
function insertStyleElement(content, target) {
|
|
5201
|
-
// Avoid inserting duplicate `<style>`s
|
|
5202
|
-
let sheets = shadowRootsToStyleSheets.get(target);
|
|
5203
|
-
if (isUndefined$1(sheets)) {
|
|
5204
|
-
sheets = create(null);
|
|
5205
|
-
shadowRootsToStyleSheets.set(target, sheets);
|
|
5206
|
-
}
|
|
5207
|
-
if (sheets[content]) {
|
|
5208
|
-
return;
|
|
5209
|
-
}
|
|
5210
|
-
sheets[content] = true;
|
|
5211
|
-
// This `<style>` may be repeated multiple times in the DOM, so cache it. It's a bit
|
|
5212
|
-
// faster to call `cloneNode()` on an existing node than to recreate it every time.
|
|
5213
|
-
let elm = styleElements[content];
|
|
5214
|
-
if (isUndefined$1(elm)) {
|
|
5215
|
-
elm = document.createElement('style');
|
|
5216
|
-
elm.type = 'text/css';
|
|
5217
|
-
elm.textContent = content;
|
|
5218
|
-
styleElements[content] = elm;
|
|
5219
|
-
}
|
|
5220
|
-
else {
|
|
5221
|
-
elm = elm.cloneNode(true);
|
|
5222
|
-
}
|
|
5223
|
-
target.appendChild(elm);
|
|
5224
|
-
}
|
|
5225
5326
|
if (isCustomElementRegistryAvailable()) {
|
|
5226
5327
|
getCustomElement = customElements.get.bind(customElements);
|
|
5227
5328
|
defineCustomElement = customElements.define.bind(customElements);
|
|
@@ -5260,9 +5361,6 @@
|
|
|
5260
5361
|
hydrating = value;
|
|
5261
5362
|
}
|
|
5262
5363
|
const ssr = false;
|
|
5263
|
-
function isHydrating() {
|
|
5264
|
-
return hydrating;
|
|
5265
|
-
}
|
|
5266
5364
|
const isNativeShadowDefined = _globalThis[KEY__IS_NATIVE_SHADOW_ROOT_DEFINED];
|
|
5267
5365
|
const isSyntheticShadowDefined = hasOwnProperty$1.call(Element.prototype, KEY__SHADOW_TOKEN);
|
|
5268
5366
|
function createElement$1(tagName, namespace) {
|
|
@@ -5371,25 +5469,6 @@
|
|
|
5371
5469
|
function isConnected(node) {
|
|
5372
5470
|
return node.isConnected;
|
|
5373
5471
|
}
|
|
5374
|
-
function insertGlobalStylesheet(content) {
|
|
5375
|
-
if (!isUndefined$1(globalStylesheets[content])) {
|
|
5376
|
-
return;
|
|
5377
|
-
}
|
|
5378
|
-
globalStylesheets[content] = true;
|
|
5379
|
-
const elm = document.createElement('style');
|
|
5380
|
-
elm.type = 'text/css';
|
|
5381
|
-
elm.textContent = content;
|
|
5382
|
-
globalStylesheetsParentElement.appendChild(elm);
|
|
5383
|
-
}
|
|
5384
|
-
function insertStylesheet(content, target) {
|
|
5385
|
-
if (supportsConstructableStyleSheets) {
|
|
5386
|
-
insertConstructableStyleSheet(content, target);
|
|
5387
|
-
}
|
|
5388
|
-
else {
|
|
5389
|
-
// Fall back to <style> element
|
|
5390
|
-
insertStyleElement(content, target);
|
|
5391
|
-
}
|
|
5392
|
-
}
|
|
5393
5472
|
const HTMLElementExported = HTMLElementConstructor;
|
|
5394
5473
|
setAttachShadow(attachShadow);
|
|
5395
5474
|
setCreateComment(createComment);
|
|
@@ -5412,10 +5491,7 @@
|
|
|
5412
5491
|
setGetProperty(getProperty);
|
|
5413
5492
|
setHTMLElement(HTMLElementExported);
|
|
5414
5493
|
setInsert(insert);
|
|
5415
|
-
setInsertGlobalStylesheet(insertGlobalStylesheet);
|
|
5416
|
-
setInsertStylesheet(insertStylesheet);
|
|
5417
5494
|
setIsConnected(isConnected);
|
|
5418
|
-
setIsHydrating$1(isHydrating);
|
|
5419
5495
|
setIsNativeShadowDefined(isNativeShadowDefined);
|
|
5420
5496
|
setIsSyntheticShadowDefined(isSyntheticShadowDefined);
|
|
5421
5497
|
setNextSibling(nextSibling);
|
|
@@ -5430,6 +5506,7 @@
|
|
|
5430
5506
|
setSetText(setText);
|
|
5431
5507
|
setSsr(ssr);
|
|
5432
5508
|
setAddEventListener(addEventListener);
|
|
5509
|
+
setInsertStylesheet(insertStylesheet);
|
|
5433
5510
|
|
|
5434
5511
|
/*
|
|
5435
5512
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -5455,6 +5532,7 @@
|
|
|
5455
5532
|
mode: 'open',
|
|
5456
5533
|
owner: null,
|
|
5457
5534
|
tagName: element.tagName.toLowerCase(),
|
|
5535
|
+
hydrated: true,
|
|
5458
5536
|
});
|
|
5459
5537
|
for (const [key, value] of Object.entries(props)) {
|
|
5460
5538
|
element[key] = value;
|
|
@@ -5649,27 +5727,6 @@
|
|
|
5649
5727
|
return element;
|
|
5650
5728
|
}
|
|
5651
5729
|
|
|
5652
|
-
/*
|
|
5653
|
-
* Copyright (c) 2018, salesforce.com, inc.
|
|
5654
|
-
* All rights reserved.
|
|
5655
|
-
* SPDX-License-Identifier: MIT
|
|
5656
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
5657
|
-
*/
|
|
5658
|
-
/**
|
|
5659
|
-
* EXPERIMENTAL: This function provides access to the component constructor, given an HTMLElement.
|
|
5660
|
-
* This API is subject to change or being removed.
|
|
5661
|
-
*/
|
|
5662
|
-
function getComponentConstructor(elm) {
|
|
5663
|
-
let ctor = null;
|
|
5664
|
-
if (elm instanceof HTMLElement) {
|
|
5665
|
-
const vm = getAssociatedVMIfPresent(elm);
|
|
5666
|
-
if (!isUndefined$1(vm)) {
|
|
5667
|
-
ctor = vm.def.ctor;
|
|
5668
|
-
}
|
|
5669
|
-
}
|
|
5670
|
-
return ctor;
|
|
5671
|
-
}
|
|
5672
|
-
|
|
5673
5730
|
/*
|
|
5674
5731
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
5675
5732
|
* All rights reserved.
|
|
@@ -5738,7 +5795,7 @@
|
|
|
5738
5795
|
});
|
|
5739
5796
|
freeze(LightningElement);
|
|
5740
5797
|
seal(LightningElement.prototype);
|
|
5741
|
-
/* version: 2.13.
|
|
5798
|
+
/* version: 2.13.4 */
|
|
5742
5799
|
|
|
5743
5800
|
exports.LightningElement = LightningElement;
|
|
5744
5801
|
exports.__unstable__ProfilerControl = profilerControl;
|
|
@@ -5746,6 +5803,7 @@
|
|
|
5746
5803
|
exports.buildCustomElementConstructor = deprecatedBuildCustomElementConstructor;
|
|
5747
5804
|
exports.createContextProvider = createContextProvider;
|
|
5748
5805
|
exports.createElement = createElement;
|
|
5806
|
+
exports.freezeTemplate = freezeTemplate;
|
|
5749
5807
|
exports.getComponentConstructor = getComponentConstructor;
|
|
5750
5808
|
exports.getComponentDef = getComponentDef;
|
|
5751
5809
|
exports.hydrateComponent = hydrateComponent;
|