lwc 2.5.8 → 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 +161 -129
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +161 -129
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +2 -2
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +144 -125
  5. package/dist/engine-dom/iife/es5/engine-dom.js +174 -138
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +2 -2
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +159 -136
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +161 -129
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +2 -2
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +144 -125
  11. package/dist/engine-dom/umd/es5/engine-dom.js +174 -138
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +2 -2
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +159 -136
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +161 -129
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +2 -2
  16. package/dist/engine-server/esm/es2017/engine-server.js +161 -129
  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
@@ -75,7 +75,7 @@
75
75
  find: ArrayFind,
76
76
  indexOf: ArrayIndexOf,
77
77
  join: ArrayJoin,
78
- map: ArrayMap$1,
78
+ map: ArrayMap,
79
79
  push: ArrayPush$1,
80
80
  reduce: ArrayReduce,
81
81
  reverse: ArrayReverse,
@@ -138,7 +138,7 @@
138
138
  // Array.prototype.toString directly will cause an error Iterate through
139
139
  // all the items and handle individually.
140
140
  if (isArray$1(obj)) {
141
- return ArrayJoin.call(ArrayMap$1.call(obj, toString$1), ',');
141
+ return ArrayJoin.call(ArrayMap.call(obj, toString$1), ',');
142
142
  }
143
143
 
144
144
  return obj.toString();
@@ -301,7 +301,7 @@
301
301
  CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
302
302
  return attributeName;
303
303
  }
304
- /** version: 2.5.8 */
304
+ /** version: 2.6.1 */
305
305
 
306
306
  /*
307
307
  * Copyright (c) 2018, salesforce.com, inc.
@@ -415,7 +415,6 @@
415
415
  ENABLE_NODE_LIST_PATCH: null,
416
416
  ENABLE_HTML_COLLECTIONS_PATCH: null,
417
417
  ENABLE_NODE_PATCH: null,
418
- ENABLE_NON_COMPOSED_EVENTS_LEAKAGE: null,
419
418
  ENABLE_MIXED_SHADOW_MODE: null,
420
419
  ENABLE_WIRE_SYNC_EMIT: null
421
420
  };
@@ -473,7 +472,7 @@
473
472
 
474
473
  function setFeatureFlagForTest(name, value) {
475
474
  }
476
- /** version: 2.5.8 */
475
+ /** version: 2.6.1 */
477
476
 
478
477
  /* proxy-compat-disable */
479
478
 
@@ -1496,10 +1495,10 @@
1496
1495
  isArray
1497
1496
  } = Array;
1498
1497
  const {
1498
+ prototype: ObjectDotPrototype,
1499
1499
  getPrototypeOf,
1500
1500
  create: ObjectCreate,
1501
1501
  defineProperty: ObjectDefineProperty,
1502
- defineProperties: ObjectDefineProperties,
1503
1502
  isExtensible,
1504
1503
  getOwnPropertyDescriptor,
1505
1504
  getOwnPropertyNames,
@@ -1509,8 +1508,7 @@
1509
1508
  } = Object;
1510
1509
  const {
1511
1510
  push: ArrayPush,
1512
- concat: ArrayConcat,
1513
- map: ArrayMap
1511
+ concat: ArrayConcat
1514
1512
  } = Array.prototype;
1515
1513
 
1516
1514
  function isUndefined(obj) {
@@ -1564,7 +1562,9 @@
1564
1562
  // but it will always be compatible with the previous descriptor
1565
1563
  // to preserve the object invariants, which makes these lines safe.
1566
1564
 
1567
- const originalDescriptor = getOwnPropertyDescriptor(originalTarget, key);
1565
+ const originalDescriptor = getOwnPropertyDescriptor(originalTarget, key); // TODO: it should be impossible for the originalDescriptor to ever be undefined, this `if` can be removed
1566
+
1567
+ /* istanbul ignore else */
1568
1568
 
1569
1569
  if (!isUndefined(originalDescriptor)) {
1570
1570
  const wrappedDesc = this.wrapDescriptor(originalDescriptor);
@@ -1592,11 +1592,17 @@
1592
1592
 
1593
1593
  preventExtensions(shadowTarget);
1594
1594
  } // Shared Traps
1595
+ // TODO: apply() is never called
1596
+
1597
+ /* istanbul ignore next */
1595
1598
 
1596
1599
 
1597
1600
  apply(shadowTarget, thisArg, argArray) {
1598
1601
  /* No op */
1599
- }
1602
+ } // TODO: construct() is never called
1603
+
1604
+ /* istanbul ignore next */
1605
+
1600
1606
 
1601
1607
  construct(shadowTarget, argArray, newTarget) {
1602
1608
  /* No op */
@@ -1709,8 +1715,8 @@
1709
1715
 
1710
1716
  }
1711
1717
 
1712
- const getterMap = new WeakMap();
1713
- const setterMap = new WeakMap();
1718
+ const getterMap$1 = new WeakMap();
1719
+ const setterMap$1 = new WeakMap();
1714
1720
  const reverseGetterMap = new WeakMap();
1715
1721
  const reverseSetterMap = new WeakMap();
1716
1722
 
@@ -1720,7 +1726,7 @@
1720
1726
  }
1721
1727
 
1722
1728
  wrapGetter(originalGet) {
1723
- const wrappedGetter = getterMap.get(originalGet);
1729
+ const wrappedGetter = getterMap$1.get(originalGet);
1724
1730
 
1725
1731
  if (!isUndefined(wrappedGetter)) {
1726
1732
  return wrappedGetter;
@@ -1733,13 +1739,13 @@
1733
1739
  return handler.wrapValue(originalGet.call(unwrap$1(this)));
1734
1740
  };
1735
1741
 
1736
- getterMap.set(originalGet, get);
1742
+ getterMap$1.set(originalGet, get);
1737
1743
  reverseGetterMap.set(get, originalGet);
1738
1744
  return get;
1739
1745
  }
1740
1746
 
1741
1747
  wrapSetter(originalSet) {
1742
- const wrappedSetter = setterMap.get(originalSet);
1748
+ const wrappedSetter = setterMap$1.get(originalSet);
1743
1749
 
1744
1750
  if (!isUndefined(wrappedSetter)) {
1745
1751
  return wrappedSetter;
@@ -1750,7 +1756,7 @@
1750
1756
  originalSet.call(unwrap$1(this), unwrap$1(v));
1751
1757
  };
1752
1758
 
1753
- setterMap.set(originalSet, set);
1759
+ setterMap$1.set(originalSet, set);
1754
1760
  reverseSetterMap.set(set, originalSet);
1755
1761
  return set;
1756
1762
  }
@@ -1791,7 +1797,7 @@
1791
1797
  return unwrap$1(redGet.call(handler.wrapValue(this)));
1792
1798
  };
1793
1799
 
1794
- getterMap.set(get, redGet);
1800
+ getterMap$1.set(get, redGet);
1795
1801
  reverseGetterMap.set(redGet, get);
1796
1802
  return get;
1797
1803
  }
@@ -1810,7 +1816,7 @@
1810
1816
  redSet.call(handler.wrapValue(this), handler.wrapValue(v));
1811
1817
  };
1812
1818
 
1813
- setterMap.set(set, redSet);
1819
+ setterMap$1.set(set, redSet);
1814
1820
  reverseSetterMap.set(redSet, set);
1815
1821
  return set;
1816
1822
  }
@@ -1861,6 +1867,11 @@
1861
1867
  preventExtensions(originalTarget); // if the originalTarget is a proxy itself, it might reject
1862
1868
  // the preventExtension call, in which case we should not attempt to lock down
1863
1869
  // the shadow target.
1870
+ // TODO: It should not actually be possible to reach this `if` statement.
1871
+ // If a proxy rejects extensions, then calling preventExtensions will throw an error:
1872
+ // https://codepen.io/nolanlawson-the-selector/pen/QWMOjbY
1873
+
1874
+ /* istanbul ignore if */
1864
1875
 
1865
1876
  if (isExtensible(originalTarget)) {
1866
1877
  return false;
@@ -1902,8 +1913,8 @@
1902
1913
 
1903
1914
  }
1904
1915
 
1905
- const getterMap$1 = new WeakMap();
1906
- const setterMap$1 = new WeakMap();
1916
+ const getterMap = new WeakMap();
1917
+ const setterMap = new WeakMap();
1907
1918
 
1908
1919
  class ReadOnlyHandler extends BaseProxyHandler {
1909
1920
  wrapValue(value) {
@@ -1911,7 +1922,7 @@
1911
1922
  }
1912
1923
 
1913
1924
  wrapGetter(originalGet) {
1914
- const wrappedGetter = getterMap$1.get(originalGet);
1925
+ const wrappedGetter = getterMap.get(originalGet);
1915
1926
 
1916
1927
  if (!isUndefined(wrappedGetter)) {
1917
1928
  return wrappedGetter;
@@ -1924,12 +1935,12 @@
1924
1935
  return handler.wrapValue(originalGet.call(unwrap$1(this)));
1925
1936
  };
1926
1937
 
1927
- getterMap$1.set(originalGet, get);
1938
+ getterMap.set(originalGet, get);
1928
1939
  return get;
1929
1940
  }
1930
1941
 
1931
1942
  wrapSetter(originalSet) {
1932
- const wrappedSetter = setterMap$1.get(originalSet);
1943
+ const wrappedSetter = setterMap.get(originalSet);
1933
1944
 
1934
1945
  if (!isUndefined(wrappedSetter)) {
1935
1946
  return wrappedSetter;
@@ -1938,16 +1949,20 @@
1938
1949
  const set = function (v) {
1939
1950
  };
1940
1951
 
1941
- setterMap$1.set(originalSet, set);
1952
+ setterMap.set(originalSet, set);
1942
1953
  return set;
1943
1954
  }
1944
1955
 
1945
1956
  set(shadowTarget, key, value) {
1957
+ /* istanbul ignore next */
1958
+
1946
1959
 
1947
1960
  return false;
1948
1961
  }
1949
1962
 
1950
1963
  deleteProperty(shadowTarget, key) {
1964
+ /* istanbul ignore next */
1965
+
1951
1966
 
1952
1967
  return false;
1953
1968
  }
@@ -1956,19 +1971,21 @@
1956
1971
  }
1957
1972
 
1958
1973
  preventExtensions(shadowTarget) {
1974
+ /* istanbul ignore next */
1975
+
1959
1976
 
1960
1977
  return false;
1961
1978
  }
1962
1979
 
1963
1980
  defineProperty(shadowTarget, key, descriptor) {
1981
+ /* istanbul ignore next */
1982
+
1964
1983
 
1965
1984
  return false;
1966
1985
  }
1967
1986
 
1968
1987
  }
1969
1988
 
1970
- const ObjectDotPrototype = Object.prototype;
1971
-
1972
1989
  function defaultValueIsObservable(value) {
1973
1990
  // intentionally checking for null
1974
1991
  if (value === null) {
@@ -1996,106 +2013,85 @@
1996
2013
  /* do nothing */
1997
2014
  };
1998
2015
 
1999
- const defaultValueDistortion = value => value;
2000
-
2001
2016
  function createShadowTarget(value) {
2002
2017
  return isArray(value) ? [] : {};
2003
2018
  }
2004
2019
 
2005
- class ReactiveMembrane {
2006
- constructor(options) {
2007
- this.valueDistortion = defaultValueDistortion;
2008
- this.valueMutated = defaultValueMutated;
2009
- this.valueObserved = defaultValueObserved;
2010
- this.valueIsObservable = defaultValueIsObservable;
2011
- this.objectGraph = new WeakMap();
2012
-
2013
- if (!isUndefined(options)) {
2014
- const {
2015
- valueDistortion,
2016
- valueMutated,
2017
- valueObserved,
2018
- valueIsObservable,
2019
- tagPropertyKey
2020
- } = options;
2021
- this.valueDistortion = isFunction(valueDistortion) ? valueDistortion : defaultValueDistortion;
2022
- this.valueMutated = isFunction(valueMutated) ? valueMutated : defaultValueMutated;
2023
- this.valueObserved = isFunction(valueObserved) ? valueObserved : defaultValueObserved;
2024
- this.valueIsObservable = isFunction(valueIsObservable) ? valueIsObservable : defaultValueIsObservable;
2025
- this.tagPropertyKey = tagPropertyKey;
2026
- }
2020
+ class ObservableMembrane {
2021
+ constructor(options = {}) {
2022
+ this.readOnlyObjectGraph = new WeakMap();
2023
+ this.reactiveObjectGraph = new WeakMap();
2024
+ const {
2025
+ valueMutated,
2026
+ valueObserved,
2027
+ valueIsObservable,
2028
+ tagPropertyKey
2029
+ } = options;
2030
+ this.valueMutated = isFunction(valueMutated) ? valueMutated : defaultValueMutated;
2031
+ this.valueObserved = isFunction(valueObserved) ? valueObserved : defaultValueObserved;
2032
+ this.valueIsObservable = isFunction(valueIsObservable) ? valueIsObservable : defaultValueIsObservable;
2033
+ this.tagPropertyKey = tagPropertyKey;
2027
2034
  }
2028
2035
 
2029
2036
  getProxy(value) {
2030
2037
  const unwrappedValue = unwrap$1(value);
2031
- const distorted = this.valueDistortion(unwrappedValue);
2032
2038
 
2033
- if (this.valueIsObservable(distorted)) {
2034
- const o = this.getReactiveState(unwrappedValue, distorted); // when trying to extract the writable version of a readonly
2035
- // we return the readonly.
2039
+ if (this.valueIsObservable(unwrappedValue)) {
2040
+ // When trying to extract the writable version of a readonly we return the readonly.
2041
+ if (this.readOnlyObjectGraph.get(unwrappedValue) === value) {
2042
+ return value;
2043
+ }
2036
2044
 
2037
- return o.readOnly === value ? value : o.reactive;
2045
+ return this.getReactiveHandler(unwrappedValue);
2038
2046
  }
2039
2047
 
2040
- return distorted;
2048
+ return unwrappedValue;
2041
2049
  }
2042
2050
 
2043
2051
  getReadOnlyProxy(value) {
2044
2052
  value = unwrap$1(value);
2045
- const distorted = this.valueDistortion(value);
2046
2053
 
2047
- if (this.valueIsObservable(distorted)) {
2048
- return this.getReactiveState(value, distorted).readOnly;
2054
+ if (this.valueIsObservable(value)) {
2055
+ return this.getReadOnlyHandler(value);
2049
2056
  }
2050
2057
 
2051
- return distorted;
2058
+ return value;
2052
2059
  }
2053
2060
 
2054
2061
  unwrapProxy(p) {
2055
2062
  return unwrap$1(p);
2056
2063
  }
2057
2064
 
2058
- getReactiveState(value, distortedValue) {
2059
- const {
2060
- objectGraph
2061
- } = this;
2062
- let reactiveState = objectGraph.get(distortedValue);
2065
+ getReactiveHandler(value) {
2066
+ let proxy = this.reactiveObjectGraph.get(value);
2063
2067
 
2064
- if (reactiveState) {
2065
- return reactiveState;
2068
+ if (isUndefined(proxy)) {
2069
+ // caching the proxy after the first time it is accessed
2070
+ const handler = new ReactiveProxyHandler(this, value);
2071
+ proxy = new Proxy(createShadowTarget(value), handler);
2072
+ registerProxy(proxy, value);
2073
+ this.reactiveObjectGraph.set(value, proxy);
2066
2074
  }
2067
2075
 
2068
- const membrane = this;
2069
- reactiveState = {
2070
- get reactive() {
2071
- const reactiveHandler = new ReactiveProxyHandler(membrane, distortedValue); // caching the reactive proxy after the first time it is accessed
2072
-
2073
- const proxy = new Proxy(createShadowTarget(distortedValue), reactiveHandler);
2074
- registerProxy(proxy, value);
2075
- ObjectDefineProperty(this, 'reactive', {
2076
- value: proxy
2077
- });
2078
- return proxy;
2079
- },
2076
+ return proxy;
2077
+ }
2080
2078
 
2081
- get readOnly() {
2082
- const readOnlyHandler = new ReadOnlyHandler(membrane, distortedValue); // caching the readOnly proxy after the first time it is accessed
2079
+ getReadOnlyHandler(value) {
2080
+ let proxy = this.readOnlyObjectGraph.get(value);
2083
2081
 
2084
- const proxy = new Proxy(createShadowTarget(distortedValue), readOnlyHandler);
2085
- registerProxy(proxy, value);
2086
- ObjectDefineProperty(this, 'readOnly', {
2087
- value: proxy
2088
- });
2089
- return proxy;
2090
- }
2082
+ if (isUndefined(proxy)) {
2083
+ // caching the proxy after the first time it is accessed
2084
+ const handler = new ReadOnlyHandler(this, value);
2085
+ proxy = new Proxy(createShadowTarget(value), handler);
2086
+ registerProxy(proxy, value);
2087
+ this.readOnlyObjectGraph.set(value, proxy);
2088
+ }
2091
2089
 
2092
- };
2093
- objectGraph.set(distortedValue, reactiveState);
2094
- return reactiveState;
2090
+ return proxy;
2095
2091
  }
2096
2092
 
2097
2093
  }
2098
- /** version: 1.0.0 */
2094
+ /** version: 2.0.0 */
2099
2095
 
2100
2096
  /*
2101
2097
  * Copyright (c) 2018, salesforce.com, inc.
@@ -2106,15 +2102,9 @@
2106
2102
 
2107
2103
 
2108
2104
  const lockerLivePropertyKey = Symbol.for('@@lockerLiveValue');
2109
-
2110
- function valueDistortion(value) {
2111
- return value;
2112
- }
2113
-
2114
- const reactiveMembrane = new ReactiveMembrane({
2105
+ const reactiveMembrane = new ObservableMembrane({
2115
2106
  valueObserved,
2116
2107
  valueMutated,
2117
- valueDistortion,
2118
2108
  tagPropertyKey: lockerLivePropertyKey
2119
2109
  });
2120
2110
  /**
@@ -2123,16 +2113,9 @@
2123
2113
  * change or being removed.
2124
2114
  */
2125
2115
 
2126
- const unwrap = function (value) {
2127
- const unwrapped = reactiveMembrane.unwrapProxy(value);
2128
-
2129
- if (unwrapped !== value) {
2130
- // if value is a proxy, unwrap to access original value and apply distortion
2131
- return valueDistortion(unwrapped);
2132
- }
2133
-
2134
- return value;
2135
- };
2116
+ function unwrap(value) {
2117
+ return reactiveMembrane.unwrapProxy(value);
2118
+ }
2136
2119
  /*
2137
2120
  * Copyright (c) 2018, salesforce.com, inc.
2138
2121
  * All rights reserved.
@@ -4179,7 +4162,7 @@
4179
4162
 
4180
4163
 
4181
4164
  function d(value) {
4182
- return value == null ? '' : value;
4165
+ return value == null ? '' : String(value);
4183
4166
  } // [b]ind function
4184
4167
 
4185
4168
 
@@ -4449,6 +4432,7 @@
4449
4432
 
4450
4433
  function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
4451
4434
  const content = [];
4435
+ let root;
4452
4436
 
4453
4437
  for (let i = 0; i < stylesheets.length; i++) {
4454
4438
  let stylesheet = stylesheets[i];
@@ -4456,22 +4440,45 @@
4456
4440
  if (isArray$1(stylesheet)) {
4457
4441
  ArrayPush$1.apply(content, evaluateStylesheetsContent(stylesheet, stylesheetToken, vm));
4458
4442
  } else {
4459
- // native shadow DOM. Synthetic shadow DOM never uses `:host`.
4460
4443
 
4444
+ const isScopedCss = stylesheet[KEY__SCOPED_CSS]; // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
4445
+
4446
+ const scopeToken = isScopedCss || vm.shadowMode === 1
4447
+ /* Synthetic */
4448
+ && vm.renderMode === 1
4449
+ /* Shadow */
4450
+ ? stylesheetToken : undefined; // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
4451
+ // native shadow DOM. Synthetic shadow DOM never uses `:host`.
4461
4452
 
4462
- const isScopedCss = stylesheet[KEY__SCOPED_CSS];
4463
4453
  const useActualHostSelector = vm.renderMode === 0
4464
4454
  /* Light */
4465
4455
  ? !isScopedCss : vm.shadowMode === 0
4466
4456
  /* Native */
4467
- ; // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
4457
+ ; // Use the native :dir() pseudoclass only in native shadow DOM. Otherwise, in synthetic shadow,
4458
+ // we use an attribute selector on the host to simulate :dir().
4468
4459
 
4469
- const scopeToken = isScopedCss || vm.shadowMode === 1
4470
- /* Synthetic */
4471
- && vm.renderMode === 1
4460
+ let useNativeDirPseudoclass;
4461
+
4462
+ if (vm.renderMode === 1
4472
4463
  /* Shadow */
4473
- ? stylesheetToken : undefined;
4474
- ArrayPush$1.call(content, stylesheet(useActualHostSelector, scopeToken));
4464
+ ) {
4465
+ useNativeDirPseudoclass = vm.shadowMode === 0
4466
+ /* Native */
4467
+ ;
4468
+ } else {
4469
+ // Light DOM components should only render `[dir]` if they're inside of a synthetic shadow root.
4470
+ // At the top level (root is null) or inside of a native shadow root, they should use `:dir()`.
4471
+ if (isUndefined$1(root)) {
4472
+ // Only calculate the root once as necessary
4473
+ root = getNearestShadowComponent(vm);
4474
+ }
4475
+
4476
+ useNativeDirPseudoclass = isNull(root) || root.shadowMode === 0
4477
+ /* Native */
4478
+ ;
4479
+ }
4480
+
4481
+ ArrayPush$1.call(content, stylesheet(scopeToken, useActualHostSelector, useNativeDirPseudoclass));
4475
4482
  }
4476
4483
  }
4477
4484
 
@@ -4495,14 +4502,12 @@
4495
4502
  // https://github.com/salesforce/lwc/pull/2460#discussion_r691208892
4496
4503
 
4497
4504
 
4498
- function getNearestNativeShadowComponent(vm) {
4505
+ function getNearestShadowComponent(vm) {
4499
4506
  let owner = vm;
4500
4507
 
4501
4508
  while (!isNull(owner)) {
4502
4509
  if (owner.renderMode === 1
4503
4510
  /* Shadow */
4504
- && owner.shadowMode === 0
4505
- /* Native */
4506
4511
  ) {
4507
4512
  return owner;
4508
4513
  }
@@ -4513,6 +4518,20 @@
4513
4518
  return owner;
4514
4519
  }
4515
4520
 
4521
+ function getNearestNativeShadowComponent(vm) {
4522
+ const owner = getNearestShadowComponent(vm);
4523
+
4524
+ if (!isNull(owner) && owner.shadowMode === 1
4525
+ /* Synthetic */
4526
+ ) {
4527
+ // Synthetic-within-native is impossible. So if the nearest shadow component is
4528
+ // synthetic, we know we won't find a native component if we go any further.
4529
+ return null;
4530
+ }
4531
+
4532
+ return owner;
4533
+ }
4534
+
4516
4535
  function createStylesheet(vm, stylesheets) {
4517
4536
  const {
4518
4537
  renderer,
@@ -4528,7 +4547,7 @@
4528
4547
  for (let i = 0; i < stylesheets.length; i++) {
4529
4548
  renderer.insertGlobalStylesheet(stylesheets[i]);
4530
4549
  }
4531
- } else if (renderer.ssr || renderer.isHydrating) {
4550
+ } else if (renderer.ssr || renderer.isHydrating()) {
4532
4551
  // Note: We need to ensure that during hydration, the stylesheets method is the same as those in ssr.
4533
4552
  // This works in the client, because the stylesheets are created, and cached in the VM
4534
4553
  // the first time the VM renders.
@@ -6051,7 +6070,7 @@
6051
6070
  hooksAreSet = true;
6052
6071
  setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
6053
6072
  }
6054
- /* version: 2.5.8 */
6073
+ /* version: 2.6.1 */
6055
6074
 
6056
6075
  /*
6057
6076
  * Copyright (c) 2018, salesforce.com, inc.
@@ -6195,7 +6214,7 @@
6195
6214
  const renderer = {
6196
6215
  ssr: false,
6197
6216
 
6198
- get isHydrating() {
6217
+ isHydrating() {
6199
6218
  return isHydrating;
6200
6219
  },
6201
6220
 
@@ -6685,7 +6704,7 @@
6685
6704
  });
6686
6705
  freeze(LightningElement);
6687
6706
  seal(LightningElement.prototype);
6688
- /* version: 2.5.8 */
6707
+ /* version: 2.6.1 */
6689
6708
 
6690
6709
  exports.LightningElement = LightningElement;
6691
6710
  exports.__unstable__ProfilerControl = profilerControl;