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
|
@@ -299,7 +299,7 @@ function htmlPropertyToAttribute(propName) {
|
|
|
299
299
|
CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
|
|
300
300
|
return attributeName;
|
|
301
301
|
}
|
|
302
|
-
/** version: 2.
|
|
302
|
+
/** version: 2.6.1 */
|
|
303
303
|
|
|
304
304
|
/*
|
|
305
305
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -413,7 +413,6 @@ const features = {
|
|
|
413
413
|
ENABLE_NODE_LIST_PATCH: null,
|
|
414
414
|
ENABLE_HTML_COLLECTIONS_PATCH: null,
|
|
415
415
|
ENABLE_NODE_PATCH: null,
|
|
416
|
-
ENABLE_NON_COMPOSED_EVENTS_LEAKAGE: null,
|
|
417
416
|
ENABLE_MIXED_SHADOW_MODE: null,
|
|
418
417
|
ENABLE_WIRE_SYNC_EMIT: null
|
|
419
418
|
};
|
|
@@ -479,7 +478,7 @@ function setFeatureFlagForTest(name, value) {
|
|
|
479
478
|
setFeatureFlag(name, value);
|
|
480
479
|
}
|
|
481
480
|
}
|
|
482
|
-
/** version: 2.
|
|
481
|
+
/** version: 2.6.1 */
|
|
483
482
|
|
|
484
483
|
/* proxy-compat-disable */
|
|
485
484
|
|
|
@@ -1926,6 +1925,7 @@ const {
|
|
|
1926
1925
|
isArray
|
|
1927
1926
|
} = Array;
|
|
1928
1927
|
const {
|
|
1928
|
+
prototype: ObjectDotPrototype,
|
|
1929
1929
|
getPrototypeOf,
|
|
1930
1930
|
create: ObjectCreate,
|
|
1931
1931
|
defineProperty: ObjectDefineProperty,
|
|
@@ -2575,8 +2575,6 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
2575
2575
|
init();
|
|
2576
2576
|
}
|
|
2577
2577
|
|
|
2578
|
-
const ObjectDotPrototype = Object.prototype;
|
|
2579
|
-
|
|
2580
2578
|
function defaultValueIsObservable(value) {
|
|
2581
2579
|
// intentionally checking for null
|
|
2582
2580
|
if (value === null) {
|
|
@@ -2604,99 +2602,85 @@ const defaultValueMutated = (obj, key) => {
|
|
|
2604
2602
|
/* do nothing */
|
|
2605
2603
|
};
|
|
2606
2604
|
|
|
2607
|
-
const defaultValueDistortion = value => value;
|
|
2608
|
-
|
|
2609
2605
|
function createShadowTarget(value) {
|
|
2610
2606
|
return isArray(value) ? [] : {};
|
|
2611
2607
|
}
|
|
2612
2608
|
|
|
2613
|
-
class
|
|
2614
|
-
constructor(options) {
|
|
2615
|
-
this.valueDistortion = defaultValueDistortion;
|
|
2616
|
-
this.valueMutated = defaultValueMutated;
|
|
2617
|
-
this.valueObserved = defaultValueObserved;
|
|
2618
|
-
this.valueIsObservable = defaultValueIsObservable;
|
|
2609
|
+
class ObservableMembrane {
|
|
2610
|
+
constructor(options = {}) {
|
|
2619
2611
|
this.readOnlyObjectGraph = new WeakMap();
|
|
2620
2612
|
this.reactiveObjectGraph = new WeakMap();
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
this.valueMutated = isFunction(valueMutated) ? valueMutated : defaultValueMutated;
|
|
2632
|
-
this.valueObserved = isFunction(valueObserved) ? valueObserved : defaultValueObserved;
|
|
2633
|
-
this.valueIsObservable = isFunction(valueIsObservable) ? valueIsObservable : defaultValueIsObservable;
|
|
2634
|
-
this.tagPropertyKey = tagPropertyKey;
|
|
2635
|
-
}
|
|
2613
|
+
const {
|
|
2614
|
+
valueMutated,
|
|
2615
|
+
valueObserved,
|
|
2616
|
+
valueIsObservable,
|
|
2617
|
+
tagPropertyKey
|
|
2618
|
+
} = options;
|
|
2619
|
+
this.valueMutated = isFunction(valueMutated) ? valueMutated : defaultValueMutated;
|
|
2620
|
+
this.valueObserved = isFunction(valueObserved) ? valueObserved : defaultValueObserved;
|
|
2621
|
+
this.valueIsObservable = isFunction(valueIsObservable) ? valueIsObservable : defaultValueIsObservable;
|
|
2622
|
+
this.tagPropertyKey = tagPropertyKey;
|
|
2636
2623
|
}
|
|
2637
2624
|
|
|
2638
2625
|
getProxy(value) {
|
|
2639
2626
|
const unwrappedValue = unwrap$1(value);
|
|
2640
|
-
const distorted = this.valueDistortion(unwrappedValue);
|
|
2641
2627
|
|
|
2642
|
-
if (this.valueIsObservable(
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
// we return the readonly.
|
|
2628
|
+
if (this.valueIsObservable(unwrappedValue)) {
|
|
2629
|
+
// When trying to extract the writable version of a readonly we return the readonly.
|
|
2630
|
+
if (this.readOnlyObjectGraph.get(unwrappedValue) === value) {
|
|
2646
2631
|
return value;
|
|
2647
2632
|
}
|
|
2648
2633
|
|
|
2649
|
-
return this.getReactiveHandler(unwrappedValue
|
|
2634
|
+
return this.getReactiveHandler(unwrappedValue);
|
|
2650
2635
|
}
|
|
2651
2636
|
|
|
2652
|
-
return
|
|
2637
|
+
return unwrappedValue;
|
|
2653
2638
|
}
|
|
2654
2639
|
|
|
2655
2640
|
getReadOnlyProxy(value) {
|
|
2656
2641
|
value = unwrap$1(value);
|
|
2657
|
-
const distorted = this.valueDistortion(value);
|
|
2658
2642
|
|
|
2659
|
-
if (this.valueIsObservable(
|
|
2660
|
-
return this.getReadOnlyHandler(value
|
|
2643
|
+
if (this.valueIsObservable(value)) {
|
|
2644
|
+
return this.getReadOnlyHandler(value);
|
|
2661
2645
|
}
|
|
2662
2646
|
|
|
2663
|
-
return
|
|
2647
|
+
return value;
|
|
2664
2648
|
}
|
|
2665
2649
|
|
|
2666
2650
|
unwrapProxy(p) {
|
|
2667
2651
|
return unwrap$1(p);
|
|
2668
2652
|
}
|
|
2669
2653
|
|
|
2670
|
-
getReactiveHandler(value
|
|
2671
|
-
let proxy = this.reactiveObjectGraph.get(
|
|
2654
|
+
getReactiveHandler(value) {
|
|
2655
|
+
let proxy = this.reactiveObjectGraph.get(value);
|
|
2672
2656
|
|
|
2673
2657
|
if (isUndefined(proxy)) {
|
|
2674
2658
|
// caching the proxy after the first time it is accessed
|
|
2675
|
-
const handler = new ReactiveProxyHandler(this,
|
|
2676
|
-
proxy = new Proxy(createShadowTarget(
|
|
2659
|
+
const handler = new ReactiveProxyHandler(this, value);
|
|
2660
|
+
proxy = new Proxy(createShadowTarget(value), handler);
|
|
2677
2661
|
registerProxy(proxy, value);
|
|
2678
|
-
this.reactiveObjectGraph.set(
|
|
2662
|
+
this.reactiveObjectGraph.set(value, proxy);
|
|
2679
2663
|
}
|
|
2680
2664
|
|
|
2681
2665
|
return proxy;
|
|
2682
2666
|
}
|
|
2683
2667
|
|
|
2684
|
-
getReadOnlyHandler(value
|
|
2685
|
-
let proxy = this.readOnlyObjectGraph.get(
|
|
2668
|
+
getReadOnlyHandler(value) {
|
|
2669
|
+
let proxy = this.readOnlyObjectGraph.get(value);
|
|
2686
2670
|
|
|
2687
2671
|
if (isUndefined(proxy)) {
|
|
2688
2672
|
// caching the proxy after the first time it is accessed
|
|
2689
|
-
const handler = new ReadOnlyHandler(this,
|
|
2690
|
-
proxy = new Proxy(createShadowTarget(
|
|
2673
|
+
const handler = new ReadOnlyHandler(this, value);
|
|
2674
|
+
proxy = new Proxy(createShadowTarget(value), handler);
|
|
2691
2675
|
registerProxy(proxy, value);
|
|
2692
|
-
this.readOnlyObjectGraph.set(
|
|
2676
|
+
this.readOnlyObjectGraph.set(value, proxy);
|
|
2693
2677
|
}
|
|
2694
2678
|
|
|
2695
2679
|
return proxy;
|
|
2696
2680
|
}
|
|
2697
2681
|
|
|
2698
2682
|
}
|
|
2699
|
-
/** version:
|
|
2683
|
+
/** version: 2.0.0 */
|
|
2700
2684
|
|
|
2701
2685
|
/*
|
|
2702
2686
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -2707,15 +2691,9 @@ class ReactiveMembrane {
|
|
|
2707
2691
|
|
|
2708
2692
|
|
|
2709
2693
|
const lockerLivePropertyKey = Symbol.for('@@lockerLiveValue');
|
|
2710
|
-
|
|
2711
|
-
function valueDistortion(value) {
|
|
2712
|
-
return value;
|
|
2713
|
-
}
|
|
2714
|
-
|
|
2715
|
-
const reactiveMembrane = new ReactiveMembrane({
|
|
2694
|
+
const reactiveMembrane = new ObservableMembrane({
|
|
2716
2695
|
valueObserved,
|
|
2717
2696
|
valueMutated,
|
|
2718
|
-
valueDistortion,
|
|
2719
2697
|
tagPropertyKey: lockerLivePropertyKey
|
|
2720
2698
|
});
|
|
2721
2699
|
/**
|
|
@@ -2724,16 +2702,9 @@ const reactiveMembrane = new ReactiveMembrane({
|
|
|
2724
2702
|
* change or being removed.
|
|
2725
2703
|
*/
|
|
2726
2704
|
|
|
2727
|
-
|
|
2728
|
-
|
|
2729
|
-
|
|
2730
|
-
if (unwrapped !== value) {
|
|
2731
|
-
// if value is a proxy, unwrap to access original value and apply distortion
|
|
2732
|
-
return valueDistortion(unwrapped);
|
|
2733
|
-
}
|
|
2734
|
-
|
|
2735
|
-
return value;
|
|
2736
|
-
};
|
|
2705
|
+
function unwrap(value) {
|
|
2706
|
+
return reactiveMembrane.unwrapProxy(value);
|
|
2707
|
+
}
|
|
2737
2708
|
/*
|
|
2738
2709
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
2739
2710
|
* All rights reserved.
|
|
@@ -5962,6 +5933,7 @@ function updateStylesheetToken(vm, template) {
|
|
|
5962
5933
|
|
|
5963
5934
|
function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
|
|
5964
5935
|
const content = [];
|
|
5936
|
+
let root;
|
|
5965
5937
|
|
|
5966
5938
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
5967
5939
|
let stylesheet = stylesheets[i];
|
|
@@ -5974,23 +5946,46 @@ function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
|
|
|
5974
5946
|
// the component instance might be attempting to use an old version of
|
|
5975
5947
|
// the stylesheet, while internally, we have a replacement for it.
|
|
5976
5948
|
stylesheet = getStyleOrSwappedStyle(stylesheet);
|
|
5977
|
-
}
|
|
5978
|
-
// native shadow DOM. Synthetic shadow DOM never uses `:host`.
|
|
5949
|
+
}
|
|
5979
5950
|
|
|
5951
|
+
const isScopedCss = stylesheet[KEY__SCOPED_CSS]; // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
|
|
5952
|
+
|
|
5953
|
+
const scopeToken = isScopedCss || vm.shadowMode === 1
|
|
5954
|
+
/* Synthetic */
|
|
5955
|
+
&& vm.renderMode === 1
|
|
5956
|
+
/* Shadow */
|
|
5957
|
+
? stylesheetToken : undefined; // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
|
|
5958
|
+
// native shadow DOM. Synthetic shadow DOM never uses `:host`.
|
|
5980
5959
|
|
|
5981
|
-
const isScopedCss = stylesheet[KEY__SCOPED_CSS];
|
|
5982
5960
|
const useActualHostSelector = vm.renderMode === 0
|
|
5983
5961
|
/* Light */
|
|
5984
5962
|
? !isScopedCss : vm.shadowMode === 0
|
|
5985
5963
|
/* Native */
|
|
5986
|
-
; //
|
|
5964
|
+
; // Use the native :dir() pseudoclass only in native shadow DOM. Otherwise, in synthetic shadow,
|
|
5965
|
+
// we use an attribute selector on the host to simulate :dir().
|
|
5987
5966
|
|
|
5988
|
-
|
|
5989
|
-
|
|
5990
|
-
|
|
5967
|
+
let useNativeDirPseudoclass;
|
|
5968
|
+
|
|
5969
|
+
if (vm.renderMode === 1
|
|
5991
5970
|
/* Shadow */
|
|
5992
|
-
|
|
5993
|
-
|
|
5971
|
+
) {
|
|
5972
|
+
useNativeDirPseudoclass = vm.shadowMode === 0
|
|
5973
|
+
/* Native */
|
|
5974
|
+
;
|
|
5975
|
+
} else {
|
|
5976
|
+
// Light DOM components should only render `[dir]` if they're inside of a synthetic shadow root.
|
|
5977
|
+
// At the top level (root is null) or inside of a native shadow root, they should use `:dir()`.
|
|
5978
|
+
if (isUndefined$1(root)) {
|
|
5979
|
+
// Only calculate the root once as necessary
|
|
5980
|
+
root = getNearestShadowComponent(vm);
|
|
5981
|
+
}
|
|
5982
|
+
|
|
5983
|
+
useNativeDirPseudoclass = isNull(root) || root.shadowMode === 0
|
|
5984
|
+
/* Native */
|
|
5985
|
+
;
|
|
5986
|
+
}
|
|
5987
|
+
|
|
5988
|
+
ArrayPush$1.call(content, stylesheet(scopeToken, useActualHostSelector, useNativeDirPseudoclass));
|
|
5994
5989
|
}
|
|
5995
5990
|
}
|
|
5996
5991
|
|
|
@@ -6014,14 +6009,12 @@ function getStylesheetsContent(vm, template) {
|
|
|
6014
6009
|
// https://github.com/salesforce/lwc/pull/2460#discussion_r691208892
|
|
6015
6010
|
|
|
6016
6011
|
|
|
6017
|
-
function
|
|
6012
|
+
function getNearestShadowComponent(vm) {
|
|
6018
6013
|
let owner = vm;
|
|
6019
6014
|
|
|
6020
6015
|
while (!isNull(owner)) {
|
|
6021
6016
|
if (owner.renderMode === 1
|
|
6022
6017
|
/* Shadow */
|
|
6023
|
-
&& owner.shadowMode === 0
|
|
6024
|
-
/* Native */
|
|
6025
6018
|
) {
|
|
6026
6019
|
return owner;
|
|
6027
6020
|
}
|
|
@@ -6032,6 +6025,20 @@ function getNearestNativeShadowComponent(vm) {
|
|
|
6032
6025
|
return owner;
|
|
6033
6026
|
}
|
|
6034
6027
|
|
|
6028
|
+
function getNearestNativeShadowComponent(vm) {
|
|
6029
|
+
const owner = getNearestShadowComponent(vm);
|
|
6030
|
+
|
|
6031
|
+
if (!isNull(owner) && owner.shadowMode === 1
|
|
6032
|
+
/* Synthetic */
|
|
6033
|
+
) {
|
|
6034
|
+
// Synthetic-within-native is impossible. So if the nearest shadow component is
|
|
6035
|
+
// synthetic, we know we won't find a native component if we go any further.
|
|
6036
|
+
return null;
|
|
6037
|
+
}
|
|
6038
|
+
|
|
6039
|
+
return owner;
|
|
6040
|
+
}
|
|
6041
|
+
|
|
6035
6042
|
function createStylesheet(vm, stylesheets) {
|
|
6036
6043
|
const {
|
|
6037
6044
|
renderer,
|
|
@@ -7772,7 +7779,7 @@ function setHooks(hooks) {
|
|
|
7772
7779
|
hooksAreSet = true;
|
|
7773
7780
|
setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
|
|
7774
7781
|
}
|
|
7775
|
-
/* version: 2.
|
|
7782
|
+
/* version: 2.6.1 */
|
|
7776
7783
|
|
|
7777
7784
|
/*
|
|
7778
7785
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -8428,6 +8435,6 @@ defineProperty(LightningElement, 'CustomElementConstructor', {
|
|
|
8428
8435
|
});
|
|
8429
8436
|
freeze(LightningElement);
|
|
8430
8437
|
seal(LightningElement.prototype);
|
|
8431
|
-
/* version: 2.
|
|
8438
|
+
/* version: 2.6.1 */
|
|
8432
8439
|
|
|
8433
8440
|
export { LightningElement, profilerControl as __unstable__ProfilerControl, api$1 as api, deprecatedBuildCustomElementConstructor as buildCustomElementConstructor, createContextProvider, createElement, getComponentConstructor, getComponentDef, hydrateComponent, isComponentConstructor, isNodeFromTemplate, readonly, register, registerComponent, registerDecorators, registerTemplate, sanitizeAttribute, setFeatureFlag, setFeatureFlagForTest, setHooks, swapComponent, swapStyle, swapTemplate, track, unwrap, wire };
|
|
@@ -302,7 +302,7 @@ var LWC = (function (exports) {
|
|
|
302
302
|
CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
|
|
303
303
|
return attributeName;
|
|
304
304
|
}
|
|
305
|
-
/** version: 2.
|
|
305
|
+
/** version: 2.6.1 */
|
|
306
306
|
|
|
307
307
|
/*
|
|
308
308
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -416,7 +416,6 @@ var LWC = (function (exports) {
|
|
|
416
416
|
ENABLE_NODE_LIST_PATCH: null,
|
|
417
417
|
ENABLE_HTML_COLLECTIONS_PATCH: null,
|
|
418
418
|
ENABLE_NODE_PATCH: null,
|
|
419
|
-
ENABLE_NON_COMPOSED_EVENTS_LEAKAGE: null,
|
|
420
419
|
ENABLE_MIXED_SHADOW_MODE: null,
|
|
421
420
|
ENABLE_WIRE_SYNC_EMIT: null
|
|
422
421
|
};
|
|
@@ -482,7 +481,7 @@ var LWC = (function (exports) {
|
|
|
482
481
|
setFeatureFlag(name, value);
|
|
483
482
|
}
|
|
484
483
|
}
|
|
485
|
-
/** version: 2.
|
|
484
|
+
/** version: 2.6.1 */
|
|
486
485
|
|
|
487
486
|
/* proxy-compat-disable */
|
|
488
487
|
|
|
@@ -1929,6 +1928,7 @@ var LWC = (function (exports) {
|
|
|
1929
1928
|
isArray
|
|
1930
1929
|
} = Array;
|
|
1931
1930
|
const {
|
|
1931
|
+
prototype: ObjectDotPrototype,
|
|
1932
1932
|
getPrototypeOf,
|
|
1933
1933
|
create: ObjectCreate,
|
|
1934
1934
|
defineProperty: ObjectDefineProperty,
|
|
@@ -2578,8 +2578,6 @@ var LWC = (function (exports) {
|
|
|
2578
2578
|
init();
|
|
2579
2579
|
}
|
|
2580
2580
|
|
|
2581
|
-
const ObjectDotPrototype = Object.prototype;
|
|
2582
|
-
|
|
2583
2581
|
function defaultValueIsObservable(value) {
|
|
2584
2582
|
// intentionally checking for null
|
|
2585
2583
|
if (value === null) {
|
|
@@ -2607,99 +2605,85 @@ var LWC = (function (exports) {
|
|
|
2607
2605
|
/* do nothing */
|
|
2608
2606
|
};
|
|
2609
2607
|
|
|
2610
|
-
const defaultValueDistortion = value => value;
|
|
2611
|
-
|
|
2612
2608
|
function createShadowTarget(value) {
|
|
2613
2609
|
return isArray(value) ? [] : {};
|
|
2614
2610
|
}
|
|
2615
2611
|
|
|
2616
|
-
class
|
|
2617
|
-
constructor(options) {
|
|
2618
|
-
this.valueDistortion = defaultValueDistortion;
|
|
2619
|
-
this.valueMutated = defaultValueMutated;
|
|
2620
|
-
this.valueObserved = defaultValueObserved;
|
|
2621
|
-
this.valueIsObservable = defaultValueIsObservable;
|
|
2612
|
+
class ObservableMembrane {
|
|
2613
|
+
constructor(options = {}) {
|
|
2622
2614
|
this.readOnlyObjectGraph = new WeakMap();
|
|
2623
2615
|
this.reactiveObjectGraph = new WeakMap();
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
this.valueMutated = isFunction(valueMutated) ? valueMutated : defaultValueMutated;
|
|
2635
|
-
this.valueObserved = isFunction(valueObserved) ? valueObserved : defaultValueObserved;
|
|
2636
|
-
this.valueIsObservable = isFunction(valueIsObservable) ? valueIsObservable : defaultValueIsObservable;
|
|
2637
|
-
this.tagPropertyKey = tagPropertyKey;
|
|
2638
|
-
}
|
|
2616
|
+
const {
|
|
2617
|
+
valueMutated,
|
|
2618
|
+
valueObserved,
|
|
2619
|
+
valueIsObservable,
|
|
2620
|
+
tagPropertyKey
|
|
2621
|
+
} = options;
|
|
2622
|
+
this.valueMutated = isFunction(valueMutated) ? valueMutated : defaultValueMutated;
|
|
2623
|
+
this.valueObserved = isFunction(valueObserved) ? valueObserved : defaultValueObserved;
|
|
2624
|
+
this.valueIsObservable = isFunction(valueIsObservable) ? valueIsObservable : defaultValueIsObservable;
|
|
2625
|
+
this.tagPropertyKey = tagPropertyKey;
|
|
2639
2626
|
}
|
|
2640
2627
|
|
|
2641
2628
|
getProxy(value) {
|
|
2642
2629
|
const unwrappedValue = unwrap$1(value);
|
|
2643
|
-
const distorted = this.valueDistortion(unwrappedValue);
|
|
2644
2630
|
|
|
2645
|
-
if (this.valueIsObservable(
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
// we return the readonly.
|
|
2631
|
+
if (this.valueIsObservable(unwrappedValue)) {
|
|
2632
|
+
// When trying to extract the writable version of a readonly we return the readonly.
|
|
2633
|
+
if (this.readOnlyObjectGraph.get(unwrappedValue) === value) {
|
|
2649
2634
|
return value;
|
|
2650
2635
|
}
|
|
2651
2636
|
|
|
2652
|
-
return this.getReactiveHandler(unwrappedValue
|
|
2637
|
+
return this.getReactiveHandler(unwrappedValue);
|
|
2653
2638
|
}
|
|
2654
2639
|
|
|
2655
|
-
return
|
|
2640
|
+
return unwrappedValue;
|
|
2656
2641
|
}
|
|
2657
2642
|
|
|
2658
2643
|
getReadOnlyProxy(value) {
|
|
2659
2644
|
value = unwrap$1(value);
|
|
2660
|
-
const distorted = this.valueDistortion(value);
|
|
2661
2645
|
|
|
2662
|
-
if (this.valueIsObservable(
|
|
2663
|
-
return this.getReadOnlyHandler(value
|
|
2646
|
+
if (this.valueIsObservable(value)) {
|
|
2647
|
+
return this.getReadOnlyHandler(value);
|
|
2664
2648
|
}
|
|
2665
2649
|
|
|
2666
|
-
return
|
|
2650
|
+
return value;
|
|
2667
2651
|
}
|
|
2668
2652
|
|
|
2669
2653
|
unwrapProxy(p) {
|
|
2670
2654
|
return unwrap$1(p);
|
|
2671
2655
|
}
|
|
2672
2656
|
|
|
2673
|
-
getReactiveHandler(value
|
|
2674
|
-
let proxy = this.reactiveObjectGraph.get(
|
|
2657
|
+
getReactiveHandler(value) {
|
|
2658
|
+
let proxy = this.reactiveObjectGraph.get(value);
|
|
2675
2659
|
|
|
2676
2660
|
if (isUndefined(proxy)) {
|
|
2677
2661
|
// caching the proxy after the first time it is accessed
|
|
2678
|
-
const handler = new ReactiveProxyHandler(this,
|
|
2679
|
-
proxy = new Proxy(createShadowTarget(
|
|
2662
|
+
const handler = new ReactiveProxyHandler(this, value);
|
|
2663
|
+
proxy = new Proxy(createShadowTarget(value), handler);
|
|
2680
2664
|
registerProxy(proxy, value);
|
|
2681
|
-
this.reactiveObjectGraph.set(
|
|
2665
|
+
this.reactiveObjectGraph.set(value, proxy);
|
|
2682
2666
|
}
|
|
2683
2667
|
|
|
2684
2668
|
return proxy;
|
|
2685
2669
|
}
|
|
2686
2670
|
|
|
2687
|
-
getReadOnlyHandler(value
|
|
2688
|
-
let proxy = this.readOnlyObjectGraph.get(
|
|
2671
|
+
getReadOnlyHandler(value) {
|
|
2672
|
+
let proxy = this.readOnlyObjectGraph.get(value);
|
|
2689
2673
|
|
|
2690
2674
|
if (isUndefined(proxy)) {
|
|
2691
2675
|
// caching the proxy after the first time it is accessed
|
|
2692
|
-
const handler = new ReadOnlyHandler(this,
|
|
2693
|
-
proxy = new Proxy(createShadowTarget(
|
|
2676
|
+
const handler = new ReadOnlyHandler(this, value);
|
|
2677
|
+
proxy = new Proxy(createShadowTarget(value), handler);
|
|
2694
2678
|
registerProxy(proxy, value);
|
|
2695
|
-
this.readOnlyObjectGraph.set(
|
|
2679
|
+
this.readOnlyObjectGraph.set(value, proxy);
|
|
2696
2680
|
}
|
|
2697
2681
|
|
|
2698
2682
|
return proxy;
|
|
2699
2683
|
}
|
|
2700
2684
|
|
|
2701
2685
|
}
|
|
2702
|
-
/** version:
|
|
2686
|
+
/** version: 2.0.0 */
|
|
2703
2687
|
|
|
2704
2688
|
/*
|
|
2705
2689
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -2710,15 +2694,9 @@ var LWC = (function (exports) {
|
|
|
2710
2694
|
|
|
2711
2695
|
|
|
2712
2696
|
const lockerLivePropertyKey = Symbol.for('@@lockerLiveValue');
|
|
2713
|
-
|
|
2714
|
-
function valueDistortion(value) {
|
|
2715
|
-
return value;
|
|
2716
|
-
}
|
|
2717
|
-
|
|
2718
|
-
const reactiveMembrane = new ReactiveMembrane({
|
|
2697
|
+
const reactiveMembrane = new ObservableMembrane({
|
|
2719
2698
|
valueObserved,
|
|
2720
2699
|
valueMutated,
|
|
2721
|
-
valueDistortion,
|
|
2722
2700
|
tagPropertyKey: lockerLivePropertyKey
|
|
2723
2701
|
});
|
|
2724
2702
|
/**
|
|
@@ -2727,16 +2705,9 @@ var LWC = (function (exports) {
|
|
|
2727
2705
|
* change or being removed.
|
|
2728
2706
|
*/
|
|
2729
2707
|
|
|
2730
|
-
|
|
2731
|
-
|
|
2732
|
-
|
|
2733
|
-
if (unwrapped !== value) {
|
|
2734
|
-
// if value is a proxy, unwrap to access original value and apply distortion
|
|
2735
|
-
return valueDistortion(unwrapped);
|
|
2736
|
-
}
|
|
2737
|
-
|
|
2738
|
-
return value;
|
|
2739
|
-
};
|
|
2708
|
+
function unwrap(value) {
|
|
2709
|
+
return reactiveMembrane.unwrapProxy(value);
|
|
2710
|
+
}
|
|
2740
2711
|
/*
|
|
2741
2712
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
2742
2713
|
* All rights reserved.
|
|
@@ -5965,6 +5936,7 @@ var LWC = (function (exports) {
|
|
|
5965
5936
|
|
|
5966
5937
|
function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
|
|
5967
5938
|
const content = [];
|
|
5939
|
+
let root;
|
|
5968
5940
|
|
|
5969
5941
|
for (let i = 0; i < stylesheets.length; i++) {
|
|
5970
5942
|
let stylesheet = stylesheets[i];
|
|
@@ -5977,23 +5949,46 @@ var LWC = (function (exports) {
|
|
|
5977
5949
|
// the component instance might be attempting to use an old version of
|
|
5978
5950
|
// the stylesheet, while internally, we have a replacement for it.
|
|
5979
5951
|
stylesheet = getStyleOrSwappedStyle(stylesheet);
|
|
5980
|
-
}
|
|
5981
|
-
// native shadow DOM. Synthetic shadow DOM never uses `:host`.
|
|
5952
|
+
}
|
|
5982
5953
|
|
|
5954
|
+
const isScopedCss = stylesheet[KEY__SCOPED_CSS]; // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
|
|
5955
|
+
|
|
5956
|
+
const scopeToken = isScopedCss || vm.shadowMode === 1
|
|
5957
|
+
/* Synthetic */
|
|
5958
|
+
&& vm.renderMode === 1
|
|
5959
|
+
/* Shadow */
|
|
5960
|
+
? stylesheetToken : undefined; // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
|
|
5961
|
+
// native shadow DOM. Synthetic shadow DOM never uses `:host`.
|
|
5983
5962
|
|
|
5984
|
-
const isScopedCss = stylesheet[KEY__SCOPED_CSS];
|
|
5985
5963
|
const useActualHostSelector = vm.renderMode === 0
|
|
5986
5964
|
/* Light */
|
|
5987
5965
|
? !isScopedCss : vm.shadowMode === 0
|
|
5988
5966
|
/* Native */
|
|
5989
|
-
; //
|
|
5967
|
+
; // Use the native :dir() pseudoclass only in native shadow DOM. Otherwise, in synthetic shadow,
|
|
5968
|
+
// we use an attribute selector on the host to simulate :dir().
|
|
5990
5969
|
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
|
|
5970
|
+
let useNativeDirPseudoclass;
|
|
5971
|
+
|
|
5972
|
+
if (vm.renderMode === 1
|
|
5994
5973
|
/* Shadow */
|
|
5995
|
-
|
|
5996
|
-
|
|
5974
|
+
) {
|
|
5975
|
+
useNativeDirPseudoclass = vm.shadowMode === 0
|
|
5976
|
+
/* Native */
|
|
5977
|
+
;
|
|
5978
|
+
} else {
|
|
5979
|
+
// Light DOM components should only render `[dir]` if they're inside of a synthetic shadow root.
|
|
5980
|
+
// At the top level (root is null) or inside of a native shadow root, they should use `:dir()`.
|
|
5981
|
+
if (isUndefined$1(root)) {
|
|
5982
|
+
// Only calculate the root once as necessary
|
|
5983
|
+
root = getNearestShadowComponent(vm);
|
|
5984
|
+
}
|
|
5985
|
+
|
|
5986
|
+
useNativeDirPseudoclass = isNull(root) || root.shadowMode === 0
|
|
5987
|
+
/* Native */
|
|
5988
|
+
;
|
|
5989
|
+
}
|
|
5990
|
+
|
|
5991
|
+
ArrayPush$1.call(content, stylesheet(scopeToken, useActualHostSelector, useNativeDirPseudoclass));
|
|
5997
5992
|
}
|
|
5998
5993
|
}
|
|
5999
5994
|
|
|
@@ -6017,14 +6012,12 @@ var LWC = (function (exports) {
|
|
|
6017
6012
|
// https://github.com/salesforce/lwc/pull/2460#discussion_r691208892
|
|
6018
6013
|
|
|
6019
6014
|
|
|
6020
|
-
function
|
|
6015
|
+
function getNearestShadowComponent(vm) {
|
|
6021
6016
|
let owner = vm;
|
|
6022
6017
|
|
|
6023
6018
|
while (!isNull(owner)) {
|
|
6024
6019
|
if (owner.renderMode === 1
|
|
6025
6020
|
/* Shadow */
|
|
6026
|
-
&& owner.shadowMode === 0
|
|
6027
|
-
/* Native */
|
|
6028
6021
|
) {
|
|
6029
6022
|
return owner;
|
|
6030
6023
|
}
|
|
@@ -6035,6 +6028,20 @@ var LWC = (function (exports) {
|
|
|
6035
6028
|
return owner;
|
|
6036
6029
|
}
|
|
6037
6030
|
|
|
6031
|
+
function getNearestNativeShadowComponent(vm) {
|
|
6032
|
+
const owner = getNearestShadowComponent(vm);
|
|
6033
|
+
|
|
6034
|
+
if (!isNull(owner) && owner.shadowMode === 1
|
|
6035
|
+
/* Synthetic */
|
|
6036
|
+
) {
|
|
6037
|
+
// Synthetic-within-native is impossible. So if the nearest shadow component is
|
|
6038
|
+
// synthetic, we know we won't find a native component if we go any further.
|
|
6039
|
+
return null;
|
|
6040
|
+
}
|
|
6041
|
+
|
|
6042
|
+
return owner;
|
|
6043
|
+
}
|
|
6044
|
+
|
|
6038
6045
|
function createStylesheet(vm, stylesheets) {
|
|
6039
6046
|
const {
|
|
6040
6047
|
renderer,
|
|
@@ -7775,7 +7782,7 @@ var LWC = (function (exports) {
|
|
|
7775
7782
|
hooksAreSet = true;
|
|
7776
7783
|
setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
|
|
7777
7784
|
}
|
|
7778
|
-
/* version: 2.
|
|
7785
|
+
/* version: 2.6.1 */
|
|
7779
7786
|
|
|
7780
7787
|
/*
|
|
7781
7788
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -8431,7 +8438,7 @@ var LWC = (function (exports) {
|
|
|
8431
8438
|
});
|
|
8432
8439
|
freeze(LightningElement);
|
|
8433
8440
|
seal(LightningElement.prototype);
|
|
8434
|
-
/* version: 2.
|
|
8441
|
+
/* version: 2.6.1 */
|
|
8435
8442
|
|
|
8436
8443
|
exports.LightningElement = LightningElement;
|
|
8437
8444
|
exports.__unstable__ProfilerControl = profilerControl;
|