lwc 2.5.10 → 2.6.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 +88 -81
- package/dist/engine-dom/iife/es2017/engine-dom.js +88 -81
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +2 -2
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +87 -80
- package/dist/engine-dom/iife/es5/engine-dom.js +93 -86
- package/dist/engine-dom/iife/es5/engine-dom.min.js +2 -2
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +92 -85
- package/dist/engine-dom/umd/es2017/engine-dom.js +88 -81
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +2 -2
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +87 -80
- package/dist/engine-dom/umd/es5/engine-dom.js +93 -86
- package/dist/engine-dom/umd/es5/engine-dom.min.js +2 -2
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +92 -85
- package/dist/engine-server/commonjs/es2017/engine-server.js +88 -81
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +2 -2
- package/dist/engine-server/esm/es2017/engine-server.js +88 -81
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +23 -130
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +23 -130
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +23 -130
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +23 -124
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +23 -124
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +23 -130
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +23 -130
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +23 -124
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +23 -124
- 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 +8 -8
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
20
20
|
|
|
21
|
-
function _get2(
|
|
21
|
+
function _get2() { if (typeof Reflect !== "undefined" && Reflect.get) { _get2 = Reflect.get; } else { _get2 = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get2.apply(this, arguments); }
|
|
22
22
|
|
|
23
23
|
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf2(object); if (object === null) break; } return object; }
|
|
24
24
|
|
|
@@ -344,7 +344,7 @@
|
|
|
344
344
|
CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
|
|
345
345
|
return attributeName;
|
|
346
346
|
}
|
|
347
|
-
/** version: 2.
|
|
347
|
+
/** version: 2.6.1 */
|
|
348
348
|
|
|
349
349
|
/*
|
|
350
350
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -456,7 +456,6 @@
|
|
|
456
456
|
ENABLE_NODE_LIST_PATCH: null,
|
|
457
457
|
ENABLE_HTML_COLLECTIONS_PATCH: null,
|
|
458
458
|
ENABLE_NODE_PATCH: null,
|
|
459
|
-
ENABLE_NON_COMPOSED_EVENTS_LEAKAGE: null,
|
|
460
459
|
ENABLE_MIXED_SHADOW_MODE: null,
|
|
461
460
|
ENABLE_WIRE_SYNC_EMIT: null
|
|
462
461
|
};
|
|
@@ -516,7 +515,7 @@
|
|
|
516
515
|
|
|
517
516
|
function setFeatureFlagForTest(name, value) {
|
|
518
517
|
}
|
|
519
|
-
/** version: 2.
|
|
518
|
+
/** version: 2.6.1 */
|
|
520
519
|
|
|
521
520
|
/* proxy-compat-disable */
|
|
522
521
|
|
|
@@ -1497,7 +1496,8 @@
|
|
|
1497
1496
|
*/
|
|
1498
1497
|
|
|
1499
1498
|
var isArray = Array.isArray;
|
|
1500
|
-
var
|
|
1499
|
+
var ObjectDotPrototype = Object.prototype,
|
|
1500
|
+
_getPrototypeOf = Object.getPrototypeOf,
|
|
1501
1501
|
ObjectCreate = Object.create,
|
|
1502
1502
|
ObjectDefineProperty = Object.defineProperty,
|
|
1503
1503
|
_isExtensible = Object.isExtensible,
|
|
@@ -2011,8 +2011,6 @@
|
|
|
2011
2011
|
return ReadOnlyHandler;
|
|
2012
2012
|
}(BaseProxyHandler);
|
|
2013
2013
|
|
|
2014
|
-
var ObjectDotPrototype = Object.prototype;
|
|
2015
|
-
|
|
2016
2014
|
function defaultValueIsObservable(value) {
|
|
2017
2015
|
// intentionally checking for null
|
|
2018
2016
|
if (value === null) {
|
|
@@ -2041,68 +2039,54 @@
|
|
|
2041
2039
|
/* do nothing */
|
|
2042
2040
|
};
|
|
2043
2041
|
|
|
2044
|
-
var defaultValueDistortion = function defaultValueDistortion(value) {
|
|
2045
|
-
return value;
|
|
2046
|
-
};
|
|
2047
|
-
|
|
2048
2042
|
function createShadowTarget(value) {
|
|
2049
2043
|
return isArray(value) ? [] : {};
|
|
2050
2044
|
}
|
|
2051
2045
|
|
|
2052
|
-
var
|
|
2053
|
-
function
|
|
2054
|
-
|
|
2046
|
+
var ObservableMembrane = /*#__PURE__*/function () {
|
|
2047
|
+
function ObservableMembrane() {
|
|
2048
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2049
|
+
|
|
2050
|
+
_classCallCheck(this, ObservableMembrane);
|
|
2055
2051
|
|
|
2056
|
-
this.valueDistortion = defaultValueDistortion;
|
|
2057
|
-
this.valueMutated = defaultValueMutated;
|
|
2058
|
-
this.valueObserved = defaultValueObserved;
|
|
2059
|
-
this.valueIsObservable = defaultValueIsObservable;
|
|
2060
2052
|
this.readOnlyObjectGraph = new WeakMap();
|
|
2061
2053
|
this.reactiveObjectGraph = new WeakMap();
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
this.valueMutated = isFunction(_valueMutated) ? _valueMutated : defaultValueMutated;
|
|
2071
|
-
this.valueObserved = isFunction(_valueObserved) ? _valueObserved : defaultValueObserved;
|
|
2072
|
-
this.valueIsObservable = isFunction(valueIsObservable) ? valueIsObservable : defaultValueIsObservable;
|
|
2073
|
-
this.tagPropertyKey = tagPropertyKey;
|
|
2074
|
-
}
|
|
2054
|
+
var valueMutated = options.valueMutated,
|
|
2055
|
+
valueObserved = options.valueObserved,
|
|
2056
|
+
valueIsObservable = options.valueIsObservable,
|
|
2057
|
+
tagPropertyKey = options.tagPropertyKey;
|
|
2058
|
+
this.valueMutated = isFunction(valueMutated) ? valueMutated : defaultValueMutated;
|
|
2059
|
+
this.valueObserved = isFunction(valueObserved) ? valueObserved : defaultValueObserved;
|
|
2060
|
+
this.valueIsObservable = isFunction(valueIsObservable) ? valueIsObservable : defaultValueIsObservable;
|
|
2061
|
+
this.tagPropertyKey = tagPropertyKey;
|
|
2075
2062
|
}
|
|
2076
2063
|
|
|
2077
|
-
_createClass(
|
|
2064
|
+
_createClass(ObservableMembrane, [{
|
|
2078
2065
|
key: "getProxy",
|
|
2079
2066
|
value: function getProxy(value) {
|
|
2080
2067
|
var unwrappedValue = unwrap$1(value);
|
|
2081
|
-
var distorted = this.valueDistortion(unwrappedValue);
|
|
2082
2068
|
|
|
2083
|
-
if (this.valueIsObservable(
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
// we return the readonly.
|
|
2069
|
+
if (this.valueIsObservable(unwrappedValue)) {
|
|
2070
|
+
// When trying to extract the writable version of a readonly we return the readonly.
|
|
2071
|
+
if (this.readOnlyObjectGraph.get(unwrappedValue) === value) {
|
|
2087
2072
|
return value;
|
|
2088
2073
|
}
|
|
2089
2074
|
|
|
2090
|
-
return this.getReactiveHandler(unwrappedValue
|
|
2075
|
+
return this.getReactiveHandler(unwrappedValue);
|
|
2091
2076
|
}
|
|
2092
2077
|
|
|
2093
|
-
return
|
|
2078
|
+
return unwrappedValue;
|
|
2094
2079
|
}
|
|
2095
2080
|
}, {
|
|
2096
2081
|
key: "getReadOnlyProxy",
|
|
2097
2082
|
value: function getReadOnlyProxy(value) {
|
|
2098
2083
|
value = unwrap$1(value);
|
|
2099
|
-
var distorted = this.valueDistortion(value);
|
|
2100
2084
|
|
|
2101
|
-
if (this.valueIsObservable(
|
|
2102
|
-
return this.getReadOnlyHandler(value
|
|
2085
|
+
if (this.valueIsObservable(value)) {
|
|
2086
|
+
return this.getReadOnlyHandler(value);
|
|
2103
2087
|
}
|
|
2104
2088
|
|
|
2105
|
-
return
|
|
2089
|
+
return value;
|
|
2106
2090
|
}
|
|
2107
2091
|
}, {
|
|
2108
2092
|
key: "unwrapProxy",
|
|
@@ -2111,39 +2095,39 @@
|
|
|
2111
2095
|
}
|
|
2112
2096
|
}, {
|
|
2113
2097
|
key: "getReactiveHandler",
|
|
2114
|
-
value: function getReactiveHandler(value
|
|
2115
|
-
var proxy = this.reactiveObjectGraph.get(
|
|
2098
|
+
value: function getReactiveHandler(value) {
|
|
2099
|
+
var proxy = this.reactiveObjectGraph.get(value);
|
|
2116
2100
|
|
|
2117
2101
|
if (isUndefined(proxy)) {
|
|
2118
2102
|
// caching the proxy after the first time it is accessed
|
|
2119
|
-
var handler = new ReactiveProxyHandler(this,
|
|
2120
|
-
proxy = new Proxy(createShadowTarget(
|
|
2103
|
+
var handler = new ReactiveProxyHandler(this, value);
|
|
2104
|
+
proxy = new Proxy(createShadowTarget(value), handler);
|
|
2121
2105
|
registerProxy(proxy, value);
|
|
2122
|
-
this.reactiveObjectGraph.set(
|
|
2106
|
+
this.reactiveObjectGraph.set(value, proxy);
|
|
2123
2107
|
}
|
|
2124
2108
|
|
|
2125
2109
|
return proxy;
|
|
2126
2110
|
}
|
|
2127
2111
|
}, {
|
|
2128
2112
|
key: "getReadOnlyHandler",
|
|
2129
|
-
value: function getReadOnlyHandler(value
|
|
2130
|
-
var proxy = this.readOnlyObjectGraph.get(
|
|
2113
|
+
value: function getReadOnlyHandler(value) {
|
|
2114
|
+
var proxy = this.readOnlyObjectGraph.get(value);
|
|
2131
2115
|
|
|
2132
2116
|
if (isUndefined(proxy)) {
|
|
2133
2117
|
// caching the proxy after the first time it is accessed
|
|
2134
|
-
var handler = new ReadOnlyHandler(this,
|
|
2135
|
-
proxy = new Proxy(createShadowTarget(
|
|
2118
|
+
var handler = new ReadOnlyHandler(this, value);
|
|
2119
|
+
proxy = new Proxy(createShadowTarget(value), handler);
|
|
2136
2120
|
registerProxy(proxy, value);
|
|
2137
|
-
this.readOnlyObjectGraph.set(
|
|
2121
|
+
this.readOnlyObjectGraph.set(value, proxy);
|
|
2138
2122
|
}
|
|
2139
2123
|
|
|
2140
2124
|
return proxy;
|
|
2141
2125
|
}
|
|
2142
2126
|
}]);
|
|
2143
2127
|
|
|
2144
|
-
return
|
|
2128
|
+
return ObservableMembrane;
|
|
2145
2129
|
}();
|
|
2146
|
-
/** version:
|
|
2130
|
+
/** version: 2.0.0 */
|
|
2147
2131
|
|
|
2148
2132
|
/*
|
|
2149
2133
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -2154,15 +2138,9 @@
|
|
|
2154
2138
|
|
|
2155
2139
|
|
|
2156
2140
|
var lockerLivePropertyKey = Symbol.for('@@lockerLiveValue');
|
|
2157
|
-
|
|
2158
|
-
function valueDistortion(value) {
|
|
2159
|
-
return value;
|
|
2160
|
-
}
|
|
2161
|
-
|
|
2162
|
-
var reactiveMembrane = new ReactiveMembrane({
|
|
2141
|
+
var reactiveMembrane = new ObservableMembrane({
|
|
2163
2142
|
valueObserved: valueObserved,
|
|
2164
2143
|
valueMutated: valueMutated,
|
|
2165
|
-
valueDistortion: valueDistortion,
|
|
2166
2144
|
tagPropertyKey: lockerLivePropertyKey
|
|
2167
2145
|
});
|
|
2168
2146
|
/**
|
|
@@ -2171,16 +2149,9 @@
|
|
|
2171
2149
|
* change or being removed.
|
|
2172
2150
|
*/
|
|
2173
2151
|
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
if (unwrapped !== value) {
|
|
2178
|
-
// if value is a proxy, unwrap to access original value and apply distortion
|
|
2179
|
-
return valueDistortion(unwrapped);
|
|
2180
|
-
}
|
|
2181
|
-
|
|
2182
|
-
return value;
|
|
2183
|
-
};
|
|
2152
|
+
function unwrap(value) {
|
|
2153
|
+
return reactiveMembrane.unwrapProxy(value);
|
|
2154
|
+
}
|
|
2184
2155
|
/*
|
|
2185
2156
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
2186
2157
|
* All rights reserved.
|
|
@@ -4365,6 +4336,7 @@
|
|
|
4365
4336
|
|
|
4366
4337
|
function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
|
|
4367
4338
|
var content = [];
|
|
4339
|
+
var root;
|
|
4368
4340
|
|
|
4369
4341
|
for (var _i16 = 0; _i16 < stylesheets.length; _i16++) {
|
|
4370
4342
|
var stylesheet = stylesheets[_i16];
|
|
@@ -4372,22 +4344,45 @@
|
|
|
4372
4344
|
if (isArray$1(stylesheet)) {
|
|
4373
4345
|
ArrayPush$1.apply(content, evaluateStylesheetsContent(stylesheet, stylesheetToken, vm));
|
|
4374
4346
|
} else {
|
|
4375
|
-
// native shadow DOM. Synthetic shadow DOM never uses `:host`.
|
|
4376
4347
|
|
|
4348
|
+
var isScopedCss = stylesheet[KEY__SCOPED_CSS]; // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
|
|
4349
|
+
|
|
4350
|
+
var scopeToken = isScopedCss || vm.shadowMode === 1
|
|
4351
|
+
/* Synthetic */
|
|
4352
|
+
&& vm.renderMode === 1
|
|
4353
|
+
/* Shadow */
|
|
4354
|
+
? stylesheetToken : undefined; // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
|
|
4355
|
+
// native shadow DOM. Synthetic shadow DOM never uses `:host`.
|
|
4377
4356
|
|
|
4378
|
-
var isScopedCss = stylesheet[KEY__SCOPED_CSS];
|
|
4379
4357
|
var useActualHostSelector = vm.renderMode === 0
|
|
4380
4358
|
/* Light */
|
|
4381
4359
|
? !isScopedCss : vm.shadowMode === 0
|
|
4382
4360
|
/* Native */
|
|
4383
|
-
; //
|
|
4361
|
+
; // Use the native :dir() pseudoclass only in native shadow DOM. Otherwise, in synthetic shadow,
|
|
4362
|
+
// we use an attribute selector on the host to simulate :dir().
|
|
4384
4363
|
|
|
4385
|
-
var
|
|
4386
|
-
|
|
4387
|
-
|
|
4364
|
+
var useNativeDirPseudoclass = void 0;
|
|
4365
|
+
|
|
4366
|
+
if (vm.renderMode === 1
|
|
4388
4367
|
/* Shadow */
|
|
4389
|
-
|
|
4390
|
-
|
|
4368
|
+
) {
|
|
4369
|
+
useNativeDirPseudoclass = vm.shadowMode === 0
|
|
4370
|
+
/* Native */
|
|
4371
|
+
;
|
|
4372
|
+
} else {
|
|
4373
|
+
// Light DOM components should only render `[dir]` if they're inside of a synthetic shadow root.
|
|
4374
|
+
// At the top level (root is null) or inside of a native shadow root, they should use `:dir()`.
|
|
4375
|
+
if (isUndefined$1(root)) {
|
|
4376
|
+
// Only calculate the root once as necessary
|
|
4377
|
+
root = getNearestShadowComponent(vm);
|
|
4378
|
+
}
|
|
4379
|
+
|
|
4380
|
+
useNativeDirPseudoclass = isNull(root) || root.shadowMode === 0
|
|
4381
|
+
/* Native */
|
|
4382
|
+
;
|
|
4383
|
+
}
|
|
4384
|
+
|
|
4385
|
+
ArrayPush$1.call(content, stylesheet(scopeToken, useActualHostSelector, useNativeDirPseudoclass));
|
|
4391
4386
|
}
|
|
4392
4387
|
}
|
|
4393
4388
|
|
|
@@ -4409,14 +4404,12 @@
|
|
|
4409
4404
|
// https://github.com/salesforce/lwc/pull/2460#discussion_r691208892
|
|
4410
4405
|
|
|
4411
4406
|
|
|
4412
|
-
function
|
|
4407
|
+
function getNearestShadowComponent(vm) {
|
|
4413
4408
|
var owner = vm;
|
|
4414
4409
|
|
|
4415
4410
|
while (!isNull(owner)) {
|
|
4416
4411
|
if (owner.renderMode === 1
|
|
4417
4412
|
/* Shadow */
|
|
4418
|
-
&& owner.shadowMode === 0
|
|
4419
|
-
/* Native */
|
|
4420
4413
|
) {
|
|
4421
4414
|
return owner;
|
|
4422
4415
|
}
|
|
@@ -4427,6 +4420,20 @@
|
|
|
4427
4420
|
return owner;
|
|
4428
4421
|
}
|
|
4429
4422
|
|
|
4423
|
+
function getNearestNativeShadowComponent(vm) {
|
|
4424
|
+
var owner = getNearestShadowComponent(vm);
|
|
4425
|
+
|
|
4426
|
+
if (!isNull(owner) && owner.shadowMode === 1
|
|
4427
|
+
/* Synthetic */
|
|
4428
|
+
) {
|
|
4429
|
+
// Synthetic-within-native is impossible. So if the nearest shadow component is
|
|
4430
|
+
// synthetic, we know we won't find a native component if we go any further.
|
|
4431
|
+
return null;
|
|
4432
|
+
}
|
|
4433
|
+
|
|
4434
|
+
return owner;
|
|
4435
|
+
}
|
|
4436
|
+
|
|
4430
4437
|
function createStylesheet(vm, stylesheets) {
|
|
4431
4438
|
var renderer = vm.renderer,
|
|
4432
4439
|
renderMode = vm.renderMode,
|
|
@@ -5894,7 +5901,7 @@
|
|
|
5894
5901
|
hooksAreSet = true;
|
|
5895
5902
|
setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
|
|
5896
5903
|
}
|
|
5897
|
-
/* version: 2.
|
|
5904
|
+
/* version: 2.6.1 */
|
|
5898
5905
|
|
|
5899
5906
|
/*
|
|
5900
5907
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -6524,7 +6531,7 @@
|
|
|
6524
6531
|
});
|
|
6525
6532
|
freeze(LightningElement);
|
|
6526
6533
|
seal(LightningElement.prototype);
|
|
6527
|
-
/* version: 2.
|
|
6534
|
+
/* version: 2.6.1 */
|
|
6528
6535
|
|
|
6529
6536
|
exports.LightningElement = LightningElement;
|
|
6530
6537
|
exports.__unstable__ProfilerControl = profilerControl;
|
|
@@ -339,7 +339,7 @@ function htmlPropertyToAttribute(propName) {
|
|
|
339
339
|
CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
|
|
340
340
|
return attributeName;
|
|
341
341
|
}
|
|
342
|
-
/** version: 2.
|
|
342
|
+
/** version: 2.6.1 */
|
|
343
343
|
|
|
344
344
|
/*
|
|
345
345
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
@@ -394,7 +394,6 @@ const features = {
|
|
|
394
394
|
ENABLE_NODE_LIST_PATCH: null,
|
|
395
395
|
ENABLE_HTML_COLLECTIONS_PATCH: null,
|
|
396
396
|
ENABLE_NODE_PATCH: null,
|
|
397
|
-
ENABLE_NON_COMPOSED_EVENTS_LEAKAGE: null,
|
|
398
397
|
ENABLE_MIXED_SHADOW_MODE: null,
|
|
399
398
|
ENABLE_WIRE_SYNC_EMIT: null
|
|
400
399
|
};
|
|
@@ -460,7 +459,7 @@ function setFeatureFlagForTest(name, value) {
|
|
|
460
459
|
setFeatureFlag(name, value);
|
|
461
460
|
}
|
|
462
461
|
}
|
|
463
|
-
/** version: 2.
|
|
462
|
+
/** version: 2.6.1 */
|
|
464
463
|
|
|
465
464
|
/* proxy-compat-disable */
|
|
466
465
|
|
|
@@ -1907,6 +1906,7 @@ const {
|
|
|
1907
1906
|
isArray
|
|
1908
1907
|
} = Array;
|
|
1909
1908
|
const {
|
|
1909
|
+
prototype: ObjectDotPrototype,
|
|
1910
1910
|
getPrototypeOf,
|
|
1911
1911
|
create: ObjectCreate,
|
|
1912
1912
|
defineProperty: ObjectDefineProperty,
|
|
@@ -2556,8 +2556,6 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
2556
2556
|
init();
|
|
2557
2557
|
}
|
|
2558
2558
|
|
|
2559
|
-
const ObjectDotPrototype = Object.prototype;
|
|
2560
|
-
|
|
2561
2559
|
function defaultValueIsObservable(value) {
|
|
2562
2560
|
// intentionally checking for null
|
|
2563
2561
|
if (value === null) {
|
|
@@ -2585,99 +2583,85 @@ const defaultValueMutated = (obj, key) => {
|
|
|
2585
2583
|
/* do nothing */
|
|
2586
2584
|
};
|
|
2587
2585
|
|
|
2588
|
-
const defaultValueDistortion = value => value;
|
|
2589
|
-
|
|
2590
2586
|
function createShadowTarget(value) {
|
|
2591
2587
|
return isArray(value) ? [] : {};
|
|
2592
2588
|
}
|
|
2593
2589
|
|
|
2594
|
-
class
|
|
2595
|
-
constructor(options) {
|
|
2596
|
-
this.valueDistortion = defaultValueDistortion;
|
|
2597
|
-
this.valueMutated = defaultValueMutated;
|
|
2598
|
-
this.valueObserved = defaultValueObserved;
|
|
2599
|
-
this.valueIsObservable = defaultValueIsObservable;
|
|
2590
|
+
class ObservableMembrane {
|
|
2591
|
+
constructor(options = {}) {
|
|
2600
2592
|
this.readOnlyObjectGraph = new WeakMap();
|
|
2601
2593
|
this.reactiveObjectGraph = new WeakMap();
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
this.valueMutated = isFunction(valueMutated) ? valueMutated : defaultValueMutated;
|
|
2613
|
-
this.valueObserved = isFunction(valueObserved) ? valueObserved : defaultValueObserved;
|
|
2614
|
-
this.valueIsObservable = isFunction(valueIsObservable) ? valueIsObservable : defaultValueIsObservable;
|
|
2615
|
-
this.tagPropertyKey = tagPropertyKey;
|
|
2616
|
-
}
|
|
2594
|
+
const {
|
|
2595
|
+
valueMutated,
|
|
2596
|
+
valueObserved,
|
|
2597
|
+
valueIsObservable,
|
|
2598
|
+
tagPropertyKey
|
|
2599
|
+
} = options;
|
|
2600
|
+
this.valueMutated = isFunction(valueMutated) ? valueMutated : defaultValueMutated;
|
|
2601
|
+
this.valueObserved = isFunction(valueObserved) ? valueObserved : defaultValueObserved;
|
|
2602
|
+
this.valueIsObservable = isFunction(valueIsObservable) ? valueIsObservable : defaultValueIsObservable;
|
|
2603
|
+
this.tagPropertyKey = tagPropertyKey;
|
|
2617
2604
|
}
|
|
2618
2605
|
|
|
2619
2606
|
getProxy(value) {
|
|
2620
2607
|
const unwrappedValue = unwrap$1(value);
|
|
2621
|
-
const distorted = this.valueDistortion(unwrappedValue);
|
|
2622
2608
|
|
|
2623
|
-
if (this.valueIsObservable(
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
// we return the readonly.
|
|
2609
|
+
if (this.valueIsObservable(unwrappedValue)) {
|
|
2610
|
+
// When trying to extract the writable version of a readonly we return the readonly.
|
|
2611
|
+
if (this.readOnlyObjectGraph.get(unwrappedValue) === value) {
|
|
2627
2612
|
return value;
|
|
2628
2613
|
}
|
|
2629
2614
|
|
|
2630
|
-
return this.getReactiveHandler(unwrappedValue
|
|
2615
|
+
return this.getReactiveHandler(unwrappedValue);
|
|
2631
2616
|
}
|
|
2632
2617
|
|
|
2633
|
-
return
|
|
2618
|
+
return unwrappedValue;
|
|
2634
2619
|
}
|
|
2635
2620
|
|
|
2636
2621
|
getReadOnlyProxy(value) {
|
|
2637
2622
|
value = unwrap$1(value);
|
|
2638
|
-
const distorted = this.valueDistortion(value);
|
|
2639
2623
|
|
|
2640
|
-
if (this.valueIsObservable(
|
|
2641
|
-
return this.getReadOnlyHandler(value
|
|
2624
|
+
if (this.valueIsObservable(value)) {
|
|
2625
|
+
return this.getReadOnlyHandler(value);
|
|
2642
2626
|
}
|
|
2643
2627
|
|
|
2644
|
-
return
|
|
2628
|
+
return value;
|
|
2645
2629
|
}
|
|
2646
2630
|
|
|
2647
2631
|
unwrapProxy(p) {
|
|
2648
2632
|
return unwrap$1(p);
|
|
2649
2633
|
}
|
|
2650
2634
|
|
|
2651
|
-
getReactiveHandler(value
|
|
2652
|
-
let proxy = this.reactiveObjectGraph.get(
|
|
2635
|
+
getReactiveHandler(value) {
|
|
2636
|
+
let proxy = this.reactiveObjectGraph.get(value);
|
|
2653
2637
|
|
|
2654
2638
|
if (isUndefined(proxy)) {
|
|
2655
2639
|
// caching the proxy after the first time it is accessed
|
|
2656
|
-
const handler = new ReactiveProxyHandler(this,
|
|
2657
|
-
proxy = new Proxy(createShadowTarget(
|
|
2640
|
+
const handler = new ReactiveProxyHandler(this, value);
|
|
2641
|
+
proxy = new Proxy(createShadowTarget(value), handler);
|
|
2658
2642
|
registerProxy(proxy, value);
|
|
2659
|
-
this.reactiveObjectGraph.set(
|
|
2643
|
+
this.reactiveObjectGraph.set(value, proxy);
|
|
2660
2644
|
}
|
|
2661
2645
|
|
|
2662
2646
|
return proxy;
|
|
2663
2647
|
}
|
|
2664
2648
|
|
|
2665
|
-
getReadOnlyHandler(value
|
|
2666
|
-
let proxy = this.readOnlyObjectGraph.get(
|
|
2649
|
+
getReadOnlyHandler(value) {
|
|
2650
|
+
let proxy = this.readOnlyObjectGraph.get(value);
|
|
2667
2651
|
|
|
2668
2652
|
if (isUndefined(proxy)) {
|
|
2669
2653
|
// caching the proxy after the first time it is accessed
|
|
2670
|
-
const handler = new ReadOnlyHandler(this,
|
|
2671
|
-
proxy = new Proxy(createShadowTarget(
|
|
2654
|
+
const handler = new ReadOnlyHandler(this, value);
|
|
2655
|
+
proxy = new Proxy(createShadowTarget(value), handler);
|
|
2672
2656
|
registerProxy(proxy, value);
|
|
2673
|
-
this.readOnlyObjectGraph.set(
|
|
2657
|
+
this.readOnlyObjectGraph.set(value, proxy);
|
|
2674
2658
|
}
|
|
2675
2659
|
|
|
2676
2660
|
return proxy;
|
|
2677
2661
|
}
|
|
2678
2662
|
|
|
2679
2663
|
}
|
|
2680
|
-
/** version:
|
|
2664
|
+
/** version: 2.0.0 */
|
|
2681
2665
|
|
|
2682
2666
|
/*
|
|
2683
2667
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -2688,15 +2672,9 @@ class ReactiveMembrane {
|
|
|
2688
2672
|
|
|
2689
2673
|
|
|
2690
2674
|
const lockerLivePropertyKey = Symbol.for('@@lockerLiveValue');
|
|
2691
|
-
|
|
2692
|
-
function valueDistortion(value) {
|
|
2693
|
-
return value;
|
|
2694
|
-
}
|
|
2695
|
-
|
|
2696
|
-
const reactiveMembrane = new ReactiveMembrane({
|
|
2675
|
+
const reactiveMembrane = new ObservableMembrane({
|
|
2697
2676
|
valueObserved,
|
|
2698
2677
|
valueMutated,
|
|
2699
|
-
valueDistortion,
|
|
2700
2678
|
tagPropertyKey: lockerLivePropertyKey
|
|
2701
2679
|
});
|
|
2702
2680
|
/**
|
|
@@ -2705,16 +2683,9 @@ const reactiveMembrane = new ReactiveMembrane({
|
|
|
2705
2683
|
* change or being removed.
|
|
2706
2684
|
*/
|
|
2707
2685
|
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
if (unwrapped !== value) {
|
|
2712
|
-
// if value is a proxy, unwrap to access original value and apply distortion
|
|
2713
|
-
return valueDistortion(unwrapped);
|
|
2714
|
-
}
|
|
2715
|
-
|
|
2716
|
-
return value;
|
|
2717
|
-
};
|
|
2686
|
+
function unwrap(value) {
|
|
2687
|
+
return reactiveMembrane.unwrapProxy(value);
|
|
2688
|
+
}
|
|
2718
2689
|
/*
|
|
2719
2690
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
2720
2691
|
* All rights reserved.
|
|
@@ -5823,6 +5794,7 @@ function updateStylesheetToken(vm, template) {
|
|
|
5823
5794
|
|
|
5824
5795
|
function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
|
|
5825
5796
|
const content = [];
|
|
5797
|
+
let root;
|
|
5826
5798
|
|
|
5827
5799
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
5828
5800
|
let stylesheet = stylesheets[i];
|
|
@@ -5835,23 +5807,46 @@ function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
|
|
|
5835
5807
|
// the component instance might be attempting to use an old version of
|
|
5836
5808
|
// the stylesheet, while internally, we have a replacement for it.
|
|
5837
5809
|
stylesheet = getStyleOrSwappedStyle(stylesheet);
|
|
5838
|
-
}
|
|
5839
|
-
// native shadow DOM. Synthetic shadow DOM never uses `:host`.
|
|
5810
|
+
}
|
|
5840
5811
|
|
|
5812
|
+
const isScopedCss = stylesheet[KEY__SCOPED_CSS]; // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
|
|
5813
|
+
|
|
5814
|
+
const scopeToken = isScopedCss || vm.shadowMode === 1
|
|
5815
|
+
/* Synthetic */
|
|
5816
|
+
&& vm.renderMode === 1
|
|
5817
|
+
/* Shadow */
|
|
5818
|
+
? stylesheetToken : undefined; // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
|
|
5819
|
+
// native shadow DOM. Synthetic shadow DOM never uses `:host`.
|
|
5841
5820
|
|
|
5842
|
-
const isScopedCss = stylesheet[KEY__SCOPED_CSS];
|
|
5843
5821
|
const useActualHostSelector = vm.renderMode === 0
|
|
5844
5822
|
/* Light */
|
|
5845
5823
|
? !isScopedCss : vm.shadowMode === 0
|
|
5846
5824
|
/* Native */
|
|
5847
|
-
; //
|
|
5825
|
+
; // Use the native :dir() pseudoclass only in native shadow DOM. Otherwise, in synthetic shadow,
|
|
5826
|
+
// we use an attribute selector on the host to simulate :dir().
|
|
5848
5827
|
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
|
-
|
|
5828
|
+
let useNativeDirPseudoclass;
|
|
5829
|
+
|
|
5830
|
+
if (vm.renderMode === 1
|
|
5852
5831
|
/* Shadow */
|
|
5853
|
-
|
|
5854
|
-
|
|
5832
|
+
) {
|
|
5833
|
+
useNativeDirPseudoclass = vm.shadowMode === 0
|
|
5834
|
+
/* Native */
|
|
5835
|
+
;
|
|
5836
|
+
} else {
|
|
5837
|
+
// Light DOM components should only render `[dir]` if they're inside of a synthetic shadow root.
|
|
5838
|
+
// At the top level (root is null) or inside of a native shadow root, they should use `:dir()`.
|
|
5839
|
+
if (isUndefined$1(root)) {
|
|
5840
|
+
// Only calculate the root once as necessary
|
|
5841
|
+
root = getNearestShadowComponent(vm);
|
|
5842
|
+
}
|
|
5843
|
+
|
|
5844
|
+
useNativeDirPseudoclass = isNull(root) || root.shadowMode === 0
|
|
5845
|
+
/* Native */
|
|
5846
|
+
;
|
|
5847
|
+
}
|
|
5848
|
+
|
|
5849
|
+
ArrayPush$1.call(content, stylesheet(scopeToken, useActualHostSelector, useNativeDirPseudoclass));
|
|
5855
5850
|
}
|
|
5856
5851
|
}
|
|
5857
5852
|
|
|
@@ -5875,14 +5870,12 @@ function getStylesheetsContent(vm, template) {
|
|
|
5875
5870
|
// https://github.com/salesforce/lwc/pull/2460#discussion_r691208892
|
|
5876
5871
|
|
|
5877
5872
|
|
|
5878
|
-
function
|
|
5873
|
+
function getNearestShadowComponent(vm) {
|
|
5879
5874
|
let owner = vm;
|
|
5880
5875
|
|
|
5881
5876
|
while (!isNull(owner)) {
|
|
5882
5877
|
if (owner.renderMode === 1
|
|
5883
5878
|
/* Shadow */
|
|
5884
|
-
&& owner.shadowMode === 0
|
|
5885
|
-
/* Native */
|
|
5886
5879
|
) {
|
|
5887
5880
|
return owner;
|
|
5888
5881
|
}
|
|
@@ -5893,6 +5886,20 @@ function getNearestNativeShadowComponent(vm) {
|
|
|
5893
5886
|
return owner;
|
|
5894
5887
|
}
|
|
5895
5888
|
|
|
5889
|
+
function getNearestNativeShadowComponent(vm) {
|
|
5890
|
+
const owner = getNearestShadowComponent(vm);
|
|
5891
|
+
|
|
5892
|
+
if (!isNull(owner) && owner.shadowMode === 1
|
|
5893
|
+
/* Synthetic */
|
|
5894
|
+
) {
|
|
5895
|
+
// Synthetic-within-native is impossible. So if the nearest shadow component is
|
|
5896
|
+
// synthetic, we know we won't find a native component if we go any further.
|
|
5897
|
+
return null;
|
|
5898
|
+
}
|
|
5899
|
+
|
|
5900
|
+
return owner;
|
|
5901
|
+
}
|
|
5902
|
+
|
|
5896
5903
|
function createStylesheet(vm, stylesheets) {
|
|
5897
5904
|
const {
|
|
5898
5905
|
renderer,
|
|
@@ -7557,7 +7564,7 @@ function setHooks(hooks) {
|
|
|
7557
7564
|
hooksAreSet = true;
|
|
7558
7565
|
setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
|
|
7559
7566
|
}
|
|
7560
|
-
/* version: 2.
|
|
7567
|
+
/* version: 2.6.1 */
|
|
7561
7568
|
|
|
7562
7569
|
/*
|
|
7563
7570
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
@@ -8053,7 +8060,7 @@ function renderComponent(tagName, Ctor, props = {}) {
|
|
|
8053
8060
|
|
|
8054
8061
|
freeze(LightningElement);
|
|
8055
8062
|
seal(LightningElement.prototype);
|
|
8056
|
-
/* version: 2.
|
|
8063
|
+
/* version: 2.6.1 */
|
|
8057
8064
|
|
|
8058
8065
|
exports.LightningElement = LightningElement;
|
|
8059
8066
|
exports.api = api$1;
|