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.
Files changed (39) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +88 -81
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +88 -81
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +2 -2
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +87 -80
  5. package/dist/engine-dom/iife/es5/engine-dom.js +93 -86
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +2 -2
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +92 -85
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +88 -81
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +2 -2
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +87 -80
  11. package/dist/engine-dom/umd/es5/engine-dom.js +93 -86
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +2 -2
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +92 -85
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +88 -81
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +2 -2
  16. package/dist/engine-server/esm/es2017/engine-server.js +88 -81
  17. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +23 -130
  18. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +23 -130
  19. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
  20. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +23 -130
  21. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +23 -124
  22. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
  23. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +23 -124
  24. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +23 -130
  25. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
  26. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +23 -130
  27. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +23 -124
  28. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
  29. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +23 -124
  30. package/dist/wire-service/esm/es2017/wire-service.js +2 -2
  31. package/dist/wire-service/iife/es2017/wire-service.js +2 -2
  32. package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
  33. package/dist/wire-service/iife/es5/wire-service.js +2 -2
  34. package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
  35. package/dist/wire-service/umd/es2017/wire-service.js +2 -2
  36. package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
  37. package/dist/wire-service/umd/es5/wire-service.js +2 -2
  38. package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
  39. package/package.json +8 -8
@@ -15,7 +15,7 @@ var LWC = (function (exports) {
15
15
 
16
16
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
17
17
 
18
- function _get2(target, property, receiver) { 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(receiver); } return desc.value; }; } return _get2(target, property, receiver || target); }
18
+ 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); }
19
19
 
20
20
  function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf2(object); if (object === null) break; } return object; }
21
21
 
@@ -341,7 +341,7 @@ var LWC = (function (exports) {
341
341
  CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
342
342
  return attributeName;
343
343
  }
344
- /** version: 2.5.10 */
344
+ /** version: 2.6.1 */
345
345
 
346
346
  /*
347
347
  * Copyright (c) 2018, salesforce.com, inc.
@@ -453,7 +453,6 @@ var LWC = (function (exports) {
453
453
  ENABLE_NODE_LIST_PATCH: null,
454
454
  ENABLE_HTML_COLLECTIONS_PATCH: null,
455
455
  ENABLE_NODE_PATCH: null,
456
- ENABLE_NON_COMPOSED_EVENTS_LEAKAGE: null,
457
456
  ENABLE_MIXED_SHADOW_MODE: null,
458
457
  ENABLE_WIRE_SYNC_EMIT: null
459
458
  };
@@ -513,7 +512,7 @@ var LWC = (function (exports) {
513
512
 
514
513
  function setFeatureFlagForTest(name, value) {
515
514
  }
516
- /** version: 2.5.10 */
515
+ /** version: 2.6.1 */
517
516
 
518
517
  /* proxy-compat-disable */
519
518
 
@@ -1494,7 +1493,8 @@ var LWC = (function (exports) {
1494
1493
  */
1495
1494
 
1496
1495
  var isArray = Array.isArray;
1497
- var _getPrototypeOf = Object.getPrototypeOf,
1496
+ var ObjectDotPrototype = Object.prototype,
1497
+ _getPrototypeOf = Object.getPrototypeOf,
1498
1498
  ObjectCreate = Object.create,
1499
1499
  ObjectDefineProperty = Object.defineProperty,
1500
1500
  _isExtensible = Object.isExtensible,
@@ -2008,8 +2008,6 @@ var LWC = (function (exports) {
2008
2008
  return ReadOnlyHandler;
2009
2009
  }(BaseProxyHandler);
2010
2010
 
2011
- var ObjectDotPrototype = Object.prototype;
2012
-
2013
2011
  function defaultValueIsObservable(value) {
2014
2012
  // intentionally checking for null
2015
2013
  if (value === null) {
@@ -2038,68 +2036,54 @@ var LWC = (function (exports) {
2038
2036
  /* do nothing */
2039
2037
  };
2040
2038
 
2041
- var defaultValueDistortion = function defaultValueDistortion(value) {
2042
- return value;
2043
- };
2044
-
2045
2039
  function createShadowTarget(value) {
2046
2040
  return isArray(value) ? [] : {};
2047
2041
  }
2048
2042
 
2049
- var ReactiveMembrane = /*#__PURE__*/function () {
2050
- function ReactiveMembrane(options) {
2051
- _classCallCheck(this, ReactiveMembrane);
2043
+ var ObservableMembrane = /*#__PURE__*/function () {
2044
+ function ObservableMembrane() {
2045
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2046
+
2047
+ _classCallCheck(this, ObservableMembrane);
2052
2048
 
2053
- this.valueDistortion = defaultValueDistortion;
2054
- this.valueMutated = defaultValueMutated;
2055
- this.valueObserved = defaultValueObserved;
2056
- this.valueIsObservable = defaultValueIsObservable;
2057
2049
  this.readOnlyObjectGraph = new WeakMap();
2058
2050
  this.reactiveObjectGraph = new WeakMap();
2059
-
2060
- if (!isUndefined(options)) {
2061
- var _valueDistortion = options.valueDistortion,
2062
- _valueMutated = options.valueMutated,
2063
- _valueObserved = options.valueObserved,
2064
- valueIsObservable = options.valueIsObservable,
2065
- tagPropertyKey = options.tagPropertyKey;
2066
- this.valueDistortion = isFunction(_valueDistortion) ? _valueDistortion : defaultValueDistortion;
2067
- this.valueMutated = isFunction(_valueMutated) ? _valueMutated : defaultValueMutated;
2068
- this.valueObserved = isFunction(_valueObserved) ? _valueObserved : defaultValueObserved;
2069
- this.valueIsObservable = isFunction(valueIsObservable) ? valueIsObservable : defaultValueIsObservable;
2070
- this.tagPropertyKey = tagPropertyKey;
2071
- }
2051
+ var valueMutated = options.valueMutated,
2052
+ valueObserved = options.valueObserved,
2053
+ valueIsObservable = options.valueIsObservable,
2054
+ tagPropertyKey = options.tagPropertyKey;
2055
+ this.valueMutated = isFunction(valueMutated) ? valueMutated : defaultValueMutated;
2056
+ this.valueObserved = isFunction(valueObserved) ? valueObserved : defaultValueObserved;
2057
+ this.valueIsObservable = isFunction(valueIsObservable) ? valueIsObservable : defaultValueIsObservable;
2058
+ this.tagPropertyKey = tagPropertyKey;
2072
2059
  }
2073
2060
 
2074
- _createClass(ReactiveMembrane, [{
2061
+ _createClass(ObservableMembrane, [{
2075
2062
  key: "getProxy",
2076
2063
  value: function getProxy(value) {
2077
2064
  var unwrappedValue = unwrap$1(value);
2078
- var distorted = this.valueDistortion(unwrappedValue);
2079
2065
 
2080
- if (this.valueIsObservable(distorted)) {
2081
- if (this.readOnlyObjectGraph.get(distorted) === value) {
2082
- // when trying to extract the writable version of a readonly
2083
- // we return the readonly.
2066
+ if (this.valueIsObservable(unwrappedValue)) {
2067
+ // When trying to extract the writable version of a readonly we return the readonly.
2068
+ if (this.readOnlyObjectGraph.get(unwrappedValue) === value) {
2084
2069
  return value;
2085
2070
  }
2086
2071
 
2087
- return this.getReactiveHandler(unwrappedValue, distorted);
2072
+ return this.getReactiveHandler(unwrappedValue);
2088
2073
  }
2089
2074
 
2090
- return distorted;
2075
+ return unwrappedValue;
2091
2076
  }
2092
2077
  }, {
2093
2078
  key: "getReadOnlyProxy",
2094
2079
  value: function getReadOnlyProxy(value) {
2095
2080
  value = unwrap$1(value);
2096
- var distorted = this.valueDistortion(value);
2097
2081
 
2098
- if (this.valueIsObservable(distorted)) {
2099
- return this.getReadOnlyHandler(value, distorted);
2082
+ if (this.valueIsObservable(value)) {
2083
+ return this.getReadOnlyHandler(value);
2100
2084
  }
2101
2085
 
2102
- return distorted;
2086
+ return value;
2103
2087
  }
2104
2088
  }, {
2105
2089
  key: "unwrapProxy",
@@ -2108,39 +2092,39 @@ var LWC = (function (exports) {
2108
2092
  }
2109
2093
  }, {
2110
2094
  key: "getReactiveHandler",
2111
- value: function getReactiveHandler(value, distortedValue) {
2112
- var proxy = this.reactiveObjectGraph.get(distortedValue);
2095
+ value: function getReactiveHandler(value) {
2096
+ var proxy = this.reactiveObjectGraph.get(value);
2113
2097
 
2114
2098
  if (isUndefined(proxy)) {
2115
2099
  // caching the proxy after the first time it is accessed
2116
- var handler = new ReactiveProxyHandler(this, distortedValue);
2117
- proxy = new Proxy(createShadowTarget(distortedValue), handler);
2100
+ var handler = new ReactiveProxyHandler(this, value);
2101
+ proxy = new Proxy(createShadowTarget(value), handler);
2118
2102
  registerProxy(proxy, value);
2119
- this.reactiveObjectGraph.set(distortedValue, proxy);
2103
+ this.reactiveObjectGraph.set(value, proxy);
2120
2104
  }
2121
2105
 
2122
2106
  return proxy;
2123
2107
  }
2124
2108
  }, {
2125
2109
  key: "getReadOnlyHandler",
2126
- value: function getReadOnlyHandler(value, distortedValue) {
2127
- var proxy = this.readOnlyObjectGraph.get(distortedValue);
2110
+ value: function getReadOnlyHandler(value) {
2111
+ var proxy = this.readOnlyObjectGraph.get(value);
2128
2112
 
2129
2113
  if (isUndefined(proxy)) {
2130
2114
  // caching the proxy after the first time it is accessed
2131
- var handler = new ReadOnlyHandler(this, distortedValue);
2132
- proxy = new Proxy(createShadowTarget(distortedValue), handler);
2115
+ var handler = new ReadOnlyHandler(this, value);
2116
+ proxy = new Proxy(createShadowTarget(value), handler);
2133
2117
  registerProxy(proxy, value);
2134
- this.readOnlyObjectGraph.set(distortedValue, proxy);
2118
+ this.readOnlyObjectGraph.set(value, proxy);
2135
2119
  }
2136
2120
 
2137
2121
  return proxy;
2138
2122
  }
2139
2123
  }]);
2140
2124
 
2141
- return ReactiveMembrane;
2125
+ return ObservableMembrane;
2142
2126
  }();
2143
- /** version: 1.1.5 */
2127
+ /** version: 2.0.0 */
2144
2128
 
2145
2129
  /*
2146
2130
  * Copyright (c) 2018, salesforce.com, inc.
@@ -2151,15 +2135,9 @@ var LWC = (function (exports) {
2151
2135
 
2152
2136
 
2153
2137
  var lockerLivePropertyKey = Symbol.for('@@lockerLiveValue');
2154
-
2155
- function valueDistortion(value) {
2156
- return value;
2157
- }
2158
-
2159
- var reactiveMembrane = new ReactiveMembrane({
2138
+ var reactiveMembrane = new ObservableMembrane({
2160
2139
  valueObserved: valueObserved,
2161
2140
  valueMutated: valueMutated,
2162
- valueDistortion: valueDistortion,
2163
2141
  tagPropertyKey: lockerLivePropertyKey
2164
2142
  });
2165
2143
  /**
@@ -2168,16 +2146,9 @@ var LWC = (function (exports) {
2168
2146
  * change or being removed.
2169
2147
  */
2170
2148
 
2171
- var unwrap = function unwrap(value) {
2172
- var unwrapped = reactiveMembrane.unwrapProxy(value);
2173
-
2174
- if (unwrapped !== value) {
2175
- // if value is a proxy, unwrap to access original value and apply distortion
2176
- return valueDistortion(unwrapped);
2177
- }
2178
-
2179
- return value;
2180
- };
2149
+ function unwrap(value) {
2150
+ return reactiveMembrane.unwrapProxy(value);
2151
+ }
2181
2152
  /*
2182
2153
  * Copyright (c) 2018, salesforce.com, inc.
2183
2154
  * All rights reserved.
@@ -4362,6 +4333,7 @@ var LWC = (function (exports) {
4362
4333
 
4363
4334
  function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
4364
4335
  var content = [];
4336
+ var root;
4365
4337
 
4366
4338
  for (var _i16 = 0; _i16 < stylesheets.length; _i16++) {
4367
4339
  var stylesheet = stylesheets[_i16];
@@ -4369,22 +4341,45 @@ var LWC = (function (exports) {
4369
4341
  if (isArray$1(stylesheet)) {
4370
4342
  ArrayPush$1.apply(content, evaluateStylesheetsContent(stylesheet, stylesheetToken, vm));
4371
4343
  } else {
4372
- // native shadow DOM. Synthetic shadow DOM never uses `:host`.
4373
4344
 
4345
+ var isScopedCss = stylesheet[KEY__SCOPED_CSS]; // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
4346
+
4347
+ var scopeToken = isScopedCss || vm.shadowMode === 1
4348
+ /* Synthetic */
4349
+ && vm.renderMode === 1
4350
+ /* Shadow */
4351
+ ? stylesheetToken : undefined; // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
4352
+ // native shadow DOM. Synthetic shadow DOM never uses `:host`.
4374
4353
 
4375
- var isScopedCss = stylesheet[KEY__SCOPED_CSS];
4376
4354
  var useActualHostSelector = vm.renderMode === 0
4377
4355
  /* Light */
4378
4356
  ? !isScopedCss : vm.shadowMode === 0
4379
4357
  /* Native */
4380
- ; // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
4358
+ ; // Use the native :dir() pseudoclass only in native shadow DOM. Otherwise, in synthetic shadow,
4359
+ // we use an attribute selector on the host to simulate :dir().
4381
4360
 
4382
- var scopeToken = isScopedCss || vm.shadowMode === 1
4383
- /* Synthetic */
4384
- && vm.renderMode === 1
4361
+ var useNativeDirPseudoclass = void 0;
4362
+
4363
+ if (vm.renderMode === 1
4385
4364
  /* Shadow */
4386
- ? stylesheetToken : undefined;
4387
- ArrayPush$1.call(content, stylesheet(useActualHostSelector, scopeToken));
4365
+ ) {
4366
+ useNativeDirPseudoclass = vm.shadowMode === 0
4367
+ /* Native */
4368
+ ;
4369
+ } else {
4370
+ // Light DOM components should only render `[dir]` if they're inside of a synthetic shadow root.
4371
+ // At the top level (root is null) or inside of a native shadow root, they should use `:dir()`.
4372
+ if (isUndefined$1(root)) {
4373
+ // Only calculate the root once as necessary
4374
+ root = getNearestShadowComponent(vm);
4375
+ }
4376
+
4377
+ useNativeDirPseudoclass = isNull(root) || root.shadowMode === 0
4378
+ /* Native */
4379
+ ;
4380
+ }
4381
+
4382
+ ArrayPush$1.call(content, stylesheet(scopeToken, useActualHostSelector, useNativeDirPseudoclass));
4388
4383
  }
4389
4384
  }
4390
4385
 
@@ -4406,14 +4401,12 @@ var LWC = (function (exports) {
4406
4401
  // https://github.com/salesforce/lwc/pull/2460#discussion_r691208892
4407
4402
 
4408
4403
 
4409
- function getNearestNativeShadowComponent(vm) {
4404
+ function getNearestShadowComponent(vm) {
4410
4405
  var owner = vm;
4411
4406
 
4412
4407
  while (!isNull(owner)) {
4413
4408
  if (owner.renderMode === 1
4414
4409
  /* Shadow */
4415
- && owner.shadowMode === 0
4416
- /* Native */
4417
4410
  ) {
4418
4411
  return owner;
4419
4412
  }
@@ -4424,6 +4417,20 @@ var LWC = (function (exports) {
4424
4417
  return owner;
4425
4418
  }
4426
4419
 
4420
+ function getNearestNativeShadowComponent(vm) {
4421
+ var owner = getNearestShadowComponent(vm);
4422
+
4423
+ if (!isNull(owner) && owner.shadowMode === 1
4424
+ /* Synthetic */
4425
+ ) {
4426
+ // Synthetic-within-native is impossible. So if the nearest shadow component is
4427
+ // synthetic, we know we won't find a native component if we go any further.
4428
+ return null;
4429
+ }
4430
+
4431
+ return owner;
4432
+ }
4433
+
4427
4434
  function createStylesheet(vm, stylesheets) {
4428
4435
  var renderer = vm.renderer,
4429
4436
  renderMode = vm.renderMode,
@@ -5891,7 +5898,7 @@ var LWC = (function (exports) {
5891
5898
  hooksAreSet = true;
5892
5899
  setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
5893
5900
  }
5894
- /* version: 2.5.10 */
5901
+ /* version: 2.6.1 */
5895
5902
 
5896
5903
  /*
5897
5904
  * Copyright (c) 2018, salesforce.com, inc.
@@ -6521,7 +6528,7 @@ var LWC = (function (exports) {
6521
6528
  });
6522
6529
  freeze(LightningElement);
6523
6530
  seal(LightningElement.prototype);
6524
- /* version: 2.5.10 */
6531
+ /* version: 2.6.1 */
6525
6532
 
6526
6533
  exports.LightningElement = LightningElement;
6527
6534
  exports.__unstable__ProfilerControl = profilerControl;
@@ -305,7 +305,7 @@
305
305
  CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
306
306
  return attributeName;
307
307
  }
308
- /** version: 2.5.10 */
308
+ /** version: 2.6.1 */
309
309
 
310
310
  /*
311
311
  * Copyright (c) 2018, salesforce.com, inc.
@@ -419,7 +419,6 @@
419
419
  ENABLE_NODE_LIST_PATCH: null,
420
420
  ENABLE_HTML_COLLECTIONS_PATCH: null,
421
421
  ENABLE_NODE_PATCH: null,
422
- ENABLE_NON_COMPOSED_EVENTS_LEAKAGE: null,
423
422
  ENABLE_MIXED_SHADOW_MODE: null,
424
423
  ENABLE_WIRE_SYNC_EMIT: null
425
424
  };
@@ -485,7 +484,7 @@
485
484
  setFeatureFlag(name, value);
486
485
  }
487
486
  }
488
- /** version: 2.5.10 */
487
+ /** version: 2.6.1 */
489
488
 
490
489
  /* proxy-compat-disable */
491
490
 
@@ -1932,6 +1931,7 @@
1932
1931
  isArray
1933
1932
  } = Array;
1934
1933
  const {
1934
+ prototype: ObjectDotPrototype,
1935
1935
  getPrototypeOf,
1936
1936
  create: ObjectCreate,
1937
1937
  defineProperty: ObjectDefineProperty,
@@ -2581,8 +2581,6 @@
2581
2581
  init();
2582
2582
  }
2583
2583
 
2584
- const ObjectDotPrototype = Object.prototype;
2585
-
2586
2584
  function defaultValueIsObservable(value) {
2587
2585
  // intentionally checking for null
2588
2586
  if (value === null) {
@@ -2610,99 +2608,85 @@
2610
2608
  /* do nothing */
2611
2609
  };
2612
2610
 
2613
- const defaultValueDistortion = value => value;
2614
-
2615
2611
  function createShadowTarget(value) {
2616
2612
  return isArray(value) ? [] : {};
2617
2613
  }
2618
2614
 
2619
- class ReactiveMembrane {
2620
- constructor(options) {
2621
- this.valueDistortion = defaultValueDistortion;
2622
- this.valueMutated = defaultValueMutated;
2623
- this.valueObserved = defaultValueObserved;
2624
- this.valueIsObservable = defaultValueIsObservable;
2615
+ class ObservableMembrane {
2616
+ constructor(options = {}) {
2625
2617
  this.readOnlyObjectGraph = new WeakMap();
2626
2618
  this.reactiveObjectGraph = new WeakMap();
2627
-
2628
- if (!isUndefined(options)) {
2629
- const {
2630
- valueDistortion,
2631
- valueMutated,
2632
- valueObserved,
2633
- valueIsObservable,
2634
- tagPropertyKey
2635
- } = options;
2636
- this.valueDistortion = isFunction(valueDistortion) ? valueDistortion : defaultValueDistortion;
2637
- this.valueMutated = isFunction(valueMutated) ? valueMutated : defaultValueMutated;
2638
- this.valueObserved = isFunction(valueObserved) ? valueObserved : defaultValueObserved;
2639
- this.valueIsObservable = isFunction(valueIsObservable) ? valueIsObservable : defaultValueIsObservable;
2640
- this.tagPropertyKey = tagPropertyKey;
2641
- }
2619
+ const {
2620
+ valueMutated,
2621
+ valueObserved,
2622
+ valueIsObservable,
2623
+ tagPropertyKey
2624
+ } = options;
2625
+ this.valueMutated = isFunction(valueMutated) ? valueMutated : defaultValueMutated;
2626
+ this.valueObserved = isFunction(valueObserved) ? valueObserved : defaultValueObserved;
2627
+ this.valueIsObservable = isFunction(valueIsObservable) ? valueIsObservable : defaultValueIsObservable;
2628
+ this.tagPropertyKey = tagPropertyKey;
2642
2629
  }
2643
2630
 
2644
2631
  getProxy(value) {
2645
2632
  const unwrappedValue = unwrap$1(value);
2646
- const distorted = this.valueDistortion(unwrappedValue);
2647
2633
 
2648
- if (this.valueIsObservable(distorted)) {
2649
- if (this.readOnlyObjectGraph.get(distorted) === value) {
2650
- // when trying to extract the writable version of a readonly
2651
- // we return the readonly.
2634
+ if (this.valueIsObservable(unwrappedValue)) {
2635
+ // When trying to extract the writable version of a readonly we return the readonly.
2636
+ if (this.readOnlyObjectGraph.get(unwrappedValue) === value) {
2652
2637
  return value;
2653
2638
  }
2654
2639
 
2655
- return this.getReactiveHandler(unwrappedValue, distorted);
2640
+ return this.getReactiveHandler(unwrappedValue);
2656
2641
  }
2657
2642
 
2658
- return distorted;
2643
+ return unwrappedValue;
2659
2644
  }
2660
2645
 
2661
2646
  getReadOnlyProxy(value) {
2662
2647
  value = unwrap$1(value);
2663
- const distorted = this.valueDistortion(value);
2664
2648
 
2665
- if (this.valueIsObservable(distorted)) {
2666
- return this.getReadOnlyHandler(value, distorted);
2649
+ if (this.valueIsObservable(value)) {
2650
+ return this.getReadOnlyHandler(value);
2667
2651
  }
2668
2652
 
2669
- return distorted;
2653
+ return value;
2670
2654
  }
2671
2655
 
2672
2656
  unwrapProxy(p) {
2673
2657
  return unwrap$1(p);
2674
2658
  }
2675
2659
 
2676
- getReactiveHandler(value, distortedValue) {
2677
- let proxy = this.reactiveObjectGraph.get(distortedValue);
2660
+ getReactiveHandler(value) {
2661
+ let proxy = this.reactiveObjectGraph.get(value);
2678
2662
 
2679
2663
  if (isUndefined(proxy)) {
2680
2664
  // caching the proxy after the first time it is accessed
2681
- const handler = new ReactiveProxyHandler(this, distortedValue);
2682
- proxy = new Proxy(createShadowTarget(distortedValue), handler);
2665
+ const handler = new ReactiveProxyHandler(this, value);
2666
+ proxy = new Proxy(createShadowTarget(value), handler);
2683
2667
  registerProxy(proxy, value);
2684
- this.reactiveObjectGraph.set(distortedValue, proxy);
2668
+ this.reactiveObjectGraph.set(value, proxy);
2685
2669
  }
2686
2670
 
2687
2671
  return proxy;
2688
2672
  }
2689
2673
 
2690
- getReadOnlyHandler(value, distortedValue) {
2691
- let proxy = this.readOnlyObjectGraph.get(distortedValue);
2674
+ getReadOnlyHandler(value) {
2675
+ let proxy = this.readOnlyObjectGraph.get(value);
2692
2676
 
2693
2677
  if (isUndefined(proxy)) {
2694
2678
  // caching the proxy after the first time it is accessed
2695
- const handler = new ReadOnlyHandler(this, distortedValue);
2696
- proxy = new Proxy(createShadowTarget(distortedValue), handler);
2679
+ const handler = new ReadOnlyHandler(this, value);
2680
+ proxy = new Proxy(createShadowTarget(value), handler);
2697
2681
  registerProxy(proxy, value);
2698
- this.readOnlyObjectGraph.set(distortedValue, proxy);
2682
+ this.readOnlyObjectGraph.set(value, proxy);
2699
2683
  }
2700
2684
 
2701
2685
  return proxy;
2702
2686
  }
2703
2687
 
2704
2688
  }
2705
- /** version: 1.1.5 */
2689
+ /** version: 2.0.0 */
2706
2690
 
2707
2691
  /*
2708
2692
  * Copyright (c) 2018, salesforce.com, inc.
@@ -2713,15 +2697,9 @@
2713
2697
 
2714
2698
 
2715
2699
  const lockerLivePropertyKey = Symbol.for('@@lockerLiveValue');
2716
-
2717
- function valueDistortion(value) {
2718
- return value;
2719
- }
2720
-
2721
- const reactiveMembrane = new ReactiveMembrane({
2700
+ const reactiveMembrane = new ObservableMembrane({
2722
2701
  valueObserved,
2723
2702
  valueMutated,
2724
- valueDistortion,
2725
2703
  tagPropertyKey: lockerLivePropertyKey
2726
2704
  });
2727
2705
  /**
@@ -2730,16 +2708,9 @@
2730
2708
  * change or being removed.
2731
2709
  */
2732
2710
 
2733
- const unwrap = function (value) {
2734
- const unwrapped = reactiveMembrane.unwrapProxy(value);
2735
-
2736
- if (unwrapped !== value) {
2737
- // if value is a proxy, unwrap to access original value and apply distortion
2738
- return valueDistortion(unwrapped);
2739
- }
2740
-
2741
- return value;
2742
- };
2711
+ function unwrap(value) {
2712
+ return reactiveMembrane.unwrapProxy(value);
2713
+ }
2743
2714
  /*
2744
2715
  * Copyright (c) 2018, salesforce.com, inc.
2745
2716
  * All rights reserved.
@@ -5968,6 +5939,7 @@
5968
5939
 
5969
5940
  function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
5970
5941
  const content = [];
5942
+ let root;
5971
5943
 
5972
5944
  for (let i = 0; i < stylesheets.length; i++) {
5973
5945
  let stylesheet = stylesheets[i];
@@ -5980,23 +5952,46 @@
5980
5952
  // the component instance might be attempting to use an old version of
5981
5953
  // the stylesheet, while internally, we have a replacement for it.
5982
5954
  stylesheet = getStyleOrSwappedStyle(stylesheet);
5983
- } // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
5984
- // native shadow DOM. Synthetic shadow DOM never uses `:host`.
5955
+ }
5985
5956
 
5957
+ const isScopedCss = stylesheet[KEY__SCOPED_CSS]; // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
5958
+
5959
+ const scopeToken = isScopedCss || vm.shadowMode === 1
5960
+ /* Synthetic */
5961
+ && vm.renderMode === 1
5962
+ /* Shadow */
5963
+ ? stylesheetToken : undefined; // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
5964
+ // native shadow DOM. Synthetic shadow DOM never uses `:host`.
5986
5965
 
5987
- const isScopedCss = stylesheet[KEY__SCOPED_CSS];
5988
5966
  const useActualHostSelector = vm.renderMode === 0
5989
5967
  /* Light */
5990
5968
  ? !isScopedCss : vm.shadowMode === 0
5991
5969
  /* Native */
5992
- ; // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
5970
+ ; // Use the native :dir() pseudoclass only in native shadow DOM. Otherwise, in synthetic shadow,
5971
+ // we use an attribute selector on the host to simulate :dir().
5993
5972
 
5994
- const scopeToken = isScopedCss || vm.shadowMode === 1
5995
- /* Synthetic */
5996
- && vm.renderMode === 1
5973
+ let useNativeDirPseudoclass;
5974
+
5975
+ if (vm.renderMode === 1
5997
5976
  /* Shadow */
5998
- ? stylesheetToken : undefined;
5999
- ArrayPush$1.call(content, stylesheet(useActualHostSelector, scopeToken));
5977
+ ) {
5978
+ useNativeDirPseudoclass = vm.shadowMode === 0
5979
+ /* Native */
5980
+ ;
5981
+ } else {
5982
+ // Light DOM components should only render `[dir]` if they're inside of a synthetic shadow root.
5983
+ // At the top level (root is null) or inside of a native shadow root, they should use `:dir()`.
5984
+ if (isUndefined$1(root)) {
5985
+ // Only calculate the root once as necessary
5986
+ root = getNearestShadowComponent(vm);
5987
+ }
5988
+
5989
+ useNativeDirPseudoclass = isNull(root) || root.shadowMode === 0
5990
+ /* Native */
5991
+ ;
5992
+ }
5993
+
5994
+ ArrayPush$1.call(content, stylesheet(scopeToken, useActualHostSelector, useNativeDirPseudoclass));
6000
5995
  }
6001
5996
  }
6002
5997
 
@@ -6020,14 +6015,12 @@
6020
6015
  // https://github.com/salesforce/lwc/pull/2460#discussion_r691208892
6021
6016
 
6022
6017
 
6023
- function getNearestNativeShadowComponent(vm) {
6018
+ function getNearestShadowComponent(vm) {
6024
6019
  let owner = vm;
6025
6020
 
6026
6021
  while (!isNull(owner)) {
6027
6022
  if (owner.renderMode === 1
6028
6023
  /* Shadow */
6029
- && owner.shadowMode === 0
6030
- /* Native */
6031
6024
  ) {
6032
6025
  return owner;
6033
6026
  }
@@ -6038,6 +6031,20 @@
6038
6031
  return owner;
6039
6032
  }
6040
6033
 
6034
+ function getNearestNativeShadowComponent(vm) {
6035
+ const owner = getNearestShadowComponent(vm);
6036
+
6037
+ if (!isNull(owner) && owner.shadowMode === 1
6038
+ /* Synthetic */
6039
+ ) {
6040
+ // Synthetic-within-native is impossible. So if the nearest shadow component is
6041
+ // synthetic, we know we won't find a native component if we go any further.
6042
+ return null;
6043
+ }
6044
+
6045
+ return owner;
6046
+ }
6047
+
6041
6048
  function createStylesheet(vm, stylesheets) {
6042
6049
  const {
6043
6050
  renderer,
@@ -7778,7 +7785,7 @@
7778
7785
  hooksAreSet = true;
7779
7786
  setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
7780
7787
  }
7781
- /* version: 2.5.10 */
7788
+ /* version: 2.6.1 */
7782
7789
 
7783
7790
  /*
7784
7791
  * Copyright (c) 2018, salesforce.com, inc.
@@ -8434,7 +8441,7 @@
8434
8441
  });
8435
8442
  freeze(LightningElement);
8436
8443
  seal(LightningElement.prototype);
8437
- /* version: 2.5.10 */
8444
+ /* version: 2.6.1 */
8438
8445
 
8439
8446
  exports.LightningElement = LightningElement;
8440
8447
  exports.__unstable__ProfilerControl = profilerControl;