lwc 2.5.9 → 2.5.10-alpha1

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 (54) hide show
  1. package/dist/engine/esm/es2017/engine.js +7981 -0
  2. package/dist/engine/iife/es2017/engine.js +8013 -0
  3. package/dist/engine/iife/es2017/engine.min.js +9 -0
  4. package/dist/engine/iife/es2017/engine_debug.js +6541 -0
  5. package/dist/engine/iife/es5/engine.js +6060 -0
  6. package/dist/engine/iife/es5/engine.min.js +23 -0
  7. package/dist/engine/iife/es5/engine_debug.js +4856 -0
  8. package/dist/engine/umd/es2017/engine.js +8014 -0
  9. package/dist/engine/umd/es2017/engine.min.js +9 -0
  10. package/dist/engine/umd/es2017/engine_debug.js +6542 -0
  11. package/dist/engine/umd/es5/engine.js +6061 -0
  12. package/dist/engine/umd/es5/engine.min.js +23 -0
  13. package/dist/engine/umd/es5/engine_debug.js +4857 -0
  14. package/dist/engine-dom/esm/es2017/engine-dom.js +75 -136
  15. package/dist/engine-dom/iife/es2017/engine-dom.js +76 -137
  16. package/dist/engine-dom/iife/es2017/engine-dom.min.js +2 -2
  17. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +74 -122
  18. package/dist/engine-dom/iife/es5/engine-dom.js +75 -142
  19. package/dist/engine-dom/iife/es5/engine-dom.min.js +2 -2
  20. package/dist/engine-dom/iife/es5/engine-dom_debug.js +73 -127
  21. package/dist/engine-dom/umd/es2017/engine-dom.js +77 -138
  22. package/dist/engine-dom/umd/es2017/engine-dom.min.js +2 -2
  23. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +75 -123
  24. package/dist/engine-dom/umd/es5/engine-dom.js +76 -143
  25. package/dist/engine-dom/umd/es5/engine-dom.min.js +2 -2
  26. package/dist/engine-dom/umd/es5/engine-dom_debug.js +74 -128
  27. package/dist/engine-server/commonjs/es2017/engine-server.js +75 -136
  28. package/dist/engine-server/commonjs/es2017/engine-server.min.js +2 -2
  29. package/dist/engine-server/esm/es2017/engine-server.js +75 -136
  30. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +3 -3
  31. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +4 -4
  32. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
  33. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +4 -4
  34. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +4 -4
  35. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
  36. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +4 -4
  37. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +5 -5
  38. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
  39. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +5 -5
  40. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +5 -5
  41. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
  42. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +5 -5
  43. package/dist/wire-service/esm/es2017/wire-service.js +2 -2
  44. package/dist/wire-service/iife/es2017/wire-service.js +3 -3
  45. package/dist/wire-service/iife/es2017/wire-service_debug.js +3 -3
  46. package/dist/wire-service/iife/es5/wire-service.js +3 -3
  47. package/dist/wire-service/iife/es5/wire-service.min.js +1 -1
  48. package/dist/wire-service/iife/es5/wire-service_debug.js +3 -3
  49. package/dist/wire-service/umd/es2017/wire-service.js +4 -4
  50. package/dist/wire-service/umd/es2017/wire-service_debug.js +4 -4
  51. package/dist/wire-service/umd/es5/wire-service.js +4 -4
  52. package/dist/wire-service/umd/es5/wire-service.min.js +1 -1
  53. package/dist/wire-service/umd/es5/wire-service_debug.js +4 -4
  54. package/package.json +8 -8
@@ -123,7 +123,7 @@ var LWC = (function (exports) {
123
123
  ArrayFilter = _Array$prototype.filter,
124
124
  ArrayIndexOf = _Array$prototype.indexOf,
125
125
  ArrayJoin = _Array$prototype.join,
126
- ArrayMap = _Array$prototype.map,
126
+ ArrayMap$1 = _Array$prototype.map,
127
127
  ArrayPush$1 = _Array$prototype.push,
128
128
  ArraySlice = _Array$prototype.slice,
129
129
  ArraySplice = _Array$prototype.splice,
@@ -184,7 +184,7 @@ var LWC = (function (exports) {
184
184
  // Array.prototype.toString directly will cause an error Iterate through
185
185
  // all the items and handle individually.
186
186
  if (isArray$1(obj)) {
187
- return ArrayJoin.call(ArrayMap.call(obj, toString$1), ',');
187
+ return ArrayJoin.call(ArrayMap$1.call(obj, toString$1), ',');
188
188
  }
189
189
 
190
190
  return obj.toString();
@@ -348,7 +348,7 @@ var LWC = (function (exports) {
348
348
  CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
349
349
  return attributeName;
350
350
  }
351
- /** version: 2.5.9 */
351
+ /** version: 2.5.10-alpha1 */
352
352
 
353
353
  /*
354
354
  * Copyright (c) 2018, salesforce.com, inc.
@@ -528,7 +528,7 @@ var LWC = (function (exports) {
528
528
  setFeatureFlag(name, value);
529
529
  }
530
530
  }
531
- /** version: 2.5.9 */
531
+ /** version: 2.5.10-alpha1 */
532
532
 
533
533
  /* proxy-compat-disable */
534
534
 
@@ -1990,10 +1990,7 @@ var LWC = (function (exports) {
1990
1990
  // but it will always be compatible with the previous descriptor
1991
1991
  // to preserve the object invariants, which makes these lines safe.
1992
1992
 
1993
- var originalDescriptor = _getOwnPropertyDescriptor(originalTarget, key); // TODO: it should be impossible for the originalDescriptor to ever be undefined, this `if` can be removed
1994
-
1995
- /* istanbul ignore else */
1996
-
1993
+ var originalDescriptor = _getOwnPropertyDescriptor(originalTarget, key);
1997
1994
 
1998
1995
  if (!isUndefined(originalDescriptor)) {
1999
1996
  var wrappedDesc = this.wrapDescriptor(originalDescriptor);
@@ -2018,18 +2015,12 @@ var LWC = (function (exports) {
2018
2015
 
2019
2016
  _preventExtensions(shadowTarget);
2020
2017
  } // Shared Traps
2021
- // TODO: apply() is never called
2022
-
2023
- /* istanbul ignore next */
2024
2018
 
2025
2019
  }, {
2026
2020
  key: "apply",
2027
2021
  value: function apply(shadowTarget, thisArg, argArray) {
2028
2022
  /* No op */
2029
- } // TODO: construct() is never called
2030
-
2031
- /* istanbul ignore next */
2032
-
2023
+ }
2033
2024
  }, {
2034
2025
  key: "construct",
2035
2026
  value: function construct(shadowTarget, argArray, newTarget) {
@@ -2134,8 +2125,8 @@ var LWC = (function (exports) {
2134
2125
  return BaseProxyHandler;
2135
2126
  }();
2136
2127
 
2137
- var getterMap$1 = new WeakMap();
2138
- var setterMap$1 = new WeakMap();
2128
+ var getterMap = new WeakMap();
2129
+ var setterMap = new WeakMap();
2139
2130
  var reverseGetterMap = new WeakMap();
2140
2131
  var reverseSetterMap = new WeakMap();
2141
2132
 
@@ -2158,7 +2149,7 @@ var LWC = (function (exports) {
2158
2149
  }, {
2159
2150
  key: "wrapGetter",
2160
2151
  value: function wrapGetter(originalGet) {
2161
- var wrappedGetter = getterMap$1.get(originalGet);
2152
+ var wrappedGetter = getterMap.get(originalGet);
2162
2153
 
2163
2154
  if (!isUndefined(wrappedGetter)) {
2164
2155
  return wrappedGetter;
@@ -2171,14 +2162,14 @@ var LWC = (function (exports) {
2171
2162
  return handler.wrapValue(originalGet.call(unwrap$1(this)));
2172
2163
  };
2173
2164
 
2174
- getterMap$1.set(originalGet, get);
2165
+ getterMap.set(originalGet, get);
2175
2166
  reverseGetterMap.set(get, originalGet);
2176
2167
  return get;
2177
2168
  }
2178
2169
  }, {
2179
2170
  key: "wrapSetter",
2180
2171
  value: function wrapSetter(originalSet) {
2181
- var wrappedSetter = setterMap$1.get(originalSet);
2172
+ var wrappedSetter = setterMap.get(originalSet);
2182
2173
 
2183
2174
  if (!isUndefined(wrappedSetter)) {
2184
2175
  return wrappedSetter;
@@ -2189,7 +2180,7 @@ var LWC = (function (exports) {
2189
2180
  originalSet.call(unwrap$1(this), unwrap$1(v));
2190
2181
  };
2191
2182
 
2192
- setterMap$1.set(originalSet, set);
2183
+ setterMap.set(originalSet, set);
2193
2184
  reverseSetterMap.set(set, originalSet);
2194
2185
  return set;
2195
2186
  }
@@ -2230,7 +2221,7 @@ var LWC = (function (exports) {
2230
2221
  return unwrap$1(redGet.call(handler.wrapValue(this)));
2231
2222
  };
2232
2223
 
2233
- getterMap$1.set(get, redGet);
2224
+ getterMap.set(get, redGet);
2234
2225
  reverseGetterMap.set(redGet, get);
2235
2226
  return get;
2236
2227
  }
@@ -2250,7 +2241,7 @@ var LWC = (function (exports) {
2250
2241
  redSet.call(handler.wrapValue(this), handler.wrapValue(v));
2251
2242
  };
2252
2243
 
2253
- setterMap$1.set(set, redSet);
2244
+ setterMap.set(set, redSet);
2254
2245
  reverseSetterMap.set(redSet, set);
2255
2246
  return set;
2256
2247
  }
@@ -2286,7 +2277,6 @@ var LWC = (function (exports) {
2286
2277
  }, {
2287
2278
  key: "setPrototypeOf",
2288
2279
  value: function setPrototypeOf(shadowTarget, prototype) {
2289
- /* istanbul ignore else */
2290
2280
  if (process.env.NODE_ENV !== 'production') {
2291
2281
  throw new Error("Invalid setPrototypeOf invocation for reactive proxy ".concat(toString(this.originalTarget), ". Prototype of reactive objects cannot be changed."));
2292
2282
  }
@@ -2300,11 +2290,6 @@ var LWC = (function (exports) {
2300
2290
  _preventExtensions(originalTarget); // if the originalTarget is a proxy itself, it might reject
2301
2291
  // the preventExtension call, in which case we should not attempt to lock down
2302
2292
  // the shadow target.
2303
- // TODO: It should not actually be possible to reach this `if` statement.
2304
- // If a proxy rejects extensions, then calling preventExtensions will throw an error:
2305
- // https://codepen.io/nolanlawson-the-selector/pen/QWMOjbY
2306
-
2307
- /* istanbul ignore if */
2308
2293
 
2309
2294
 
2310
2295
  if (_isExtensible(originalTarget)) {
@@ -2347,8 +2332,8 @@ var LWC = (function (exports) {
2347
2332
  return ReactiveProxyHandler;
2348
2333
  }(BaseProxyHandler);
2349
2334
 
2350
- var getterMap = new WeakMap();
2351
- var setterMap = new WeakMap();
2335
+ var getterMap$1 = new WeakMap();
2336
+ var setterMap$1 = new WeakMap();
2352
2337
 
2353
2338
  var ReadOnlyHandler = /*#__PURE__*/function (_BaseProxyHandler2) {
2354
2339
  _inherits(ReadOnlyHandler, _BaseProxyHandler2);
@@ -2369,7 +2354,7 @@ var LWC = (function (exports) {
2369
2354
  }, {
2370
2355
  key: "wrapGetter",
2371
2356
  value: function wrapGetter(originalGet) {
2372
- var wrappedGetter = getterMap.get(originalGet);
2357
+ var wrappedGetter = getterMap$1.get(originalGet);
2373
2358
 
2374
2359
  if (!isUndefined(wrappedGetter)) {
2375
2360
  return wrappedGetter;
@@ -2382,13 +2367,13 @@ var LWC = (function (exports) {
2382
2367
  return handler.wrapValue(originalGet.call(unwrap$1(this)));
2383
2368
  };
2384
2369
 
2385
- getterMap.set(originalGet, get);
2370
+ getterMap$1.set(originalGet, get);
2386
2371
  return get;
2387
2372
  }
2388
2373
  }, {
2389
2374
  key: "wrapSetter",
2390
2375
  value: function wrapSetter(originalSet) {
2391
- var wrappedSetter = setterMap.get(originalSet);
2376
+ var wrappedSetter = setterMap$1.get(originalSet);
2392
2377
 
2393
2378
  if (!isUndefined(wrappedSetter)) {
2394
2379
  return wrappedSetter;
@@ -2397,47 +2382,38 @@ var LWC = (function (exports) {
2397
2382
  var handler = this;
2398
2383
 
2399
2384
  var set = function set(v) {
2400
- /* istanbul ignore else */
2401
2385
  if (process.env.NODE_ENV !== 'production') {
2402
2386
  var originalTarget = handler.originalTarget;
2403
2387
  throw new Error("Invalid mutation: Cannot invoke a setter on \"".concat(originalTarget, "\". \"").concat(originalTarget, "\" is read-only."));
2404
2388
  }
2405
2389
  };
2406
2390
 
2407
- setterMap.set(originalSet, set);
2391
+ setterMap$1.set(originalSet, set);
2408
2392
  return set;
2409
2393
  }
2410
2394
  }, {
2411
2395
  key: "set",
2412
2396
  value: function set(shadowTarget, key, value) {
2413
- /* istanbul ignore else */
2414
2397
  if (process.env.NODE_ENV !== 'production') {
2415
2398
  var originalTarget = this.originalTarget;
2416
- var msg = isArray(originalTarget) ? "Invalid mutation: Cannot mutate array at index ".concat(key.toString(), ". Array is read-only.") : "Invalid mutation: Cannot set \"".concat(key.toString(), "\" on \"").concat(originalTarget, "\". \"").concat(originalTarget, "\" is read-only.");
2417
- throw new Error(msg);
2399
+ throw new Error("Invalid mutation: Cannot set \"".concat(key.toString(), "\" on \"").concat(originalTarget, "\". \"").concat(originalTarget, "\" is read-only."));
2418
2400
  }
2419
- /* istanbul ignore next */
2420
-
2421
2401
 
2422
2402
  return false;
2423
2403
  }
2424
2404
  }, {
2425
2405
  key: "deleteProperty",
2426
2406
  value: function deleteProperty(shadowTarget, key) {
2427
- /* istanbul ignore else */
2428
2407
  if (process.env.NODE_ENV !== 'production') {
2429
2408
  var originalTarget = this.originalTarget;
2430
2409
  throw new Error("Invalid mutation: Cannot delete \"".concat(key.toString(), "\" on \"").concat(originalTarget, "\". \"").concat(originalTarget, "\" is read-only."));
2431
2410
  }
2432
- /* istanbul ignore next */
2433
-
2434
2411
 
2435
2412
  return false;
2436
2413
  }
2437
2414
  }, {
2438
2415
  key: "setPrototypeOf",
2439
2416
  value: function setPrototypeOf(shadowTarget, prototype) {
2440
- /* istanbul ignore else */
2441
2417
  if (process.env.NODE_ENV !== 'production') {
2442
2418
  var originalTarget = this.originalTarget;
2443
2419
  throw new Error("Invalid prototype mutation: Cannot set prototype on \"".concat(originalTarget, "\". \"").concat(originalTarget, "\" prototype is read-only."));
@@ -2446,26 +2422,20 @@ var LWC = (function (exports) {
2446
2422
  }, {
2447
2423
  key: "preventExtensions",
2448
2424
  value: function preventExtensions(shadowTarget) {
2449
- /* istanbul ignore else */
2450
2425
  if (process.env.NODE_ENV !== 'production') {
2451
2426
  var originalTarget = this.originalTarget;
2452
2427
  throw new Error("Invalid mutation: Cannot preventExtensions on ".concat(originalTarget, "\". \"").concat(originalTarget, " is read-only."));
2453
2428
  }
2454
- /* istanbul ignore next */
2455
-
2456
2429
 
2457
2430
  return false;
2458
2431
  }
2459
2432
  }, {
2460
2433
  key: "defineProperty",
2461
2434
  value: function defineProperty(shadowTarget, key, descriptor) {
2462
- /* istanbul ignore else */
2463
2435
  if (process.env.NODE_ENV !== 'production') {
2464
2436
  var originalTarget = this.originalTarget;
2465
2437
  throw new Error("Invalid mutation: Cannot defineProperty \"".concat(key.toString(), "\" on \"").concat(originalTarget, "\". \"").concat(originalTarget, "\" is read-only."));
2466
2438
  }
2467
- /* istanbul ignore next */
2468
-
2469
2439
 
2470
2440
  return false;
2471
2441
  }
@@ -2525,8 +2495,6 @@ var LWC = (function (exports) {
2525
2495
  }; // Inspired from paulmillr/es6-shim
2526
2496
  // https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js#L176-L185
2527
2497
 
2528
- /* istanbul ignore next */
2529
-
2530
2498
  function getGlobal() {
2531
2499
  // the only reliable means to get the global object is `Function('return this')()`
2532
2500
  // However, this causes CSP violations in Chrome apps.
@@ -2551,7 +2519,6 @@ var LWC = (function (exports) {
2551
2519
  }
2552
2520
 
2553
2521
  function init() {
2554
- /* istanbul ignore if */
2555
2522
  if (process.env.NODE_ENV === 'production') {
2556
2523
  // this method should never leak to prod
2557
2524
  throw new ReferenceError();
@@ -2566,8 +2533,6 @@ var LWC = (function (exports) {
2566
2533
  ArrayPush.call(devtoolsFormatters, formatter);
2567
2534
  global.devtoolsFormatters = devtoolsFormatters;
2568
2535
  }
2569
- /* istanbul ignore else */
2570
-
2571
2536
 
2572
2537
  if (process.env.NODE_ENV !== 'production') {
2573
2538
  init();
@@ -2619,8 +2584,7 @@ var LWC = (function (exports) {
2619
2584
  this.valueMutated = defaultValueMutated;
2620
2585
  this.valueObserved = defaultValueObserved;
2621
2586
  this.valueIsObservable = defaultValueIsObservable;
2622
- this.readOnlyObjectGraph = new WeakMap();
2623
- this.reactiveObjectGraph = new WeakMap();
2587
+ this.objectGraph = new WeakMap();
2624
2588
 
2625
2589
  if (!isUndefined(options)) {
2626
2590
  var _valueDistortion = options.valueDistortion,
@@ -2643,13 +2607,10 @@ var LWC = (function (exports) {
2643
2607
  var distorted = this.valueDistortion(unwrappedValue);
2644
2608
 
2645
2609
  if (this.valueIsObservable(distorted)) {
2646
- if (this.readOnlyObjectGraph.get(distorted) === value) {
2647
- // when trying to extract the writable version of a readonly
2648
- // we return the readonly.
2649
- return value;
2650
- }
2610
+ var o = this.getReactiveState(unwrappedValue, distorted); // when trying to extract the writable version of a readonly
2611
+ // we return the readonly.
2651
2612
 
2652
- return this.getReactiveHandler(unwrappedValue, distorted);
2613
+ return o.readOnly === value ? value : o.reactive;
2653
2614
  }
2654
2615
 
2655
2616
  return distorted;
@@ -2661,7 +2622,7 @@ var LWC = (function (exports) {
2661
2622
  var distorted = this.valueDistortion(value);
2662
2623
 
2663
2624
  if (this.valueIsObservable(distorted)) {
2664
- return this.getReadOnlyHandler(value, distorted);
2625
+ return this.getReactiveState(value, distorted).readOnly;
2665
2626
  }
2666
2627
 
2667
2628
  return distorted;
@@ -2672,40 +2633,48 @@ var LWC = (function (exports) {
2672
2633
  return unwrap$1(p);
2673
2634
  }
2674
2635
  }, {
2675
- key: "getReactiveHandler",
2676
- value: function getReactiveHandler(value, distortedValue) {
2677
- var proxy = this.reactiveObjectGraph.get(distortedValue);
2678
-
2679
- if (isUndefined(proxy)) {
2680
- // caching the proxy after the first time it is accessed
2681
- var handler = new ReactiveProxyHandler(this, distortedValue);
2682
- proxy = new Proxy(createShadowTarget(distortedValue), handler);
2683
- registerProxy(proxy, value);
2684
- this.reactiveObjectGraph.set(distortedValue, proxy);
2685
- }
2636
+ key: "getReactiveState",
2637
+ value: function getReactiveState(value, distortedValue) {
2638
+ var objectGraph = this.objectGraph;
2639
+ var reactiveState = objectGraph.get(distortedValue);
2686
2640
 
2687
- return proxy;
2688
- }
2689
- }, {
2690
- key: "getReadOnlyHandler",
2691
- value: function getReadOnlyHandler(value, distortedValue) {
2692
- var proxy = this.readOnlyObjectGraph.get(distortedValue);
2693
-
2694
- if (isUndefined(proxy)) {
2695
- // caching the proxy after the first time it is accessed
2696
- var handler = new ReadOnlyHandler(this, distortedValue);
2697
- proxy = new Proxy(createShadowTarget(distortedValue), handler);
2698
- registerProxy(proxy, value);
2699
- this.readOnlyObjectGraph.set(distortedValue, proxy);
2641
+ if (reactiveState) {
2642
+ return reactiveState;
2700
2643
  }
2701
2644
 
2702
- return proxy;
2645
+ var membrane = this;
2646
+ reactiveState = {
2647
+ get reactive() {
2648
+ var reactiveHandler = new ReactiveProxyHandler(membrane, distortedValue); // caching the reactive proxy after the first time it is accessed
2649
+
2650
+ var proxy = new Proxy(createShadowTarget(distortedValue), reactiveHandler);
2651
+ registerProxy(proxy, value);
2652
+ ObjectDefineProperty(this, 'reactive', {
2653
+ value: proxy
2654
+ });
2655
+ return proxy;
2656
+ },
2657
+
2658
+ get readOnly() {
2659
+ var readOnlyHandler = new ReadOnlyHandler(membrane, distortedValue); // caching the readOnly proxy after the first time it is accessed
2660
+
2661
+ var proxy = new Proxy(createShadowTarget(distortedValue), readOnlyHandler);
2662
+ registerProxy(proxy, value);
2663
+ ObjectDefineProperty(this, 'readOnly', {
2664
+ value: proxy
2665
+ });
2666
+ return proxy;
2667
+ }
2668
+
2669
+ };
2670
+ objectGraph.set(distortedValue, reactiveState);
2671
+ return reactiveState;
2703
2672
  }
2704
2673
  }]);
2705
2674
 
2706
2675
  return ReactiveMembrane;
2707
2676
  }();
2708
- /** version: 1.1.5 */
2677
+ /** version: 1.0.0 */
2709
2678
 
2710
2679
  /*
2711
2680
  * Copyright (c) 2018, salesforce.com, inc.
@@ -5842,7 +5811,6 @@ var LWC = (function (exports) {
5842
5811
 
5843
5812
  function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
5844
5813
  var content = [];
5845
- var root;
5846
5814
 
5847
5815
  for (var _i16 = 0; _i16 < stylesheets.length; _i16++) {
5848
5816
  var stylesheet = stylesheets[_i16];
@@ -5855,46 +5823,23 @@ var LWC = (function (exports) {
5855
5823
  // the component instance might be attempting to use an old version of
5856
5824
  // the stylesheet, while internally, we have a replacement for it.
5857
5825
  stylesheet = getStyleOrSwappedStyle(stylesheet);
5858
- }
5859
-
5860
- var isScopedCss = stylesheet[KEY__SCOPED_CSS]; // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
5861
-
5862
- var scopeToken = isScopedCss || vm.shadowMode === 1
5863
- /* Synthetic */
5864
- && vm.renderMode === 1
5865
- /* Shadow */
5866
- ? stylesheetToken : undefined; // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
5826
+ } // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
5867
5827
  // native shadow DOM. Synthetic shadow DOM never uses `:host`.
5868
5828
 
5829
+
5830
+ var isScopedCss = stylesheet[KEY__SCOPED_CSS];
5869
5831
  var useActualHostSelector = vm.renderMode === 0
5870
5832
  /* Light */
5871
5833
  ? !isScopedCss : vm.shadowMode === 0
5872
5834
  /* Native */
5873
- ; // Use the native :dir() pseudoclass only in native shadow DOM. Otherwise, in synthetic shadow,
5874
- // we use an attribute selector on the host to simulate :dir().
5835
+ ; // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
5875
5836
 
5876
- var useNativeDirPseudoclass = void 0;
5877
-
5878
- if (vm.renderMode === 1
5837
+ var scopeToken = isScopedCss || vm.shadowMode === 1
5838
+ /* Synthetic */
5839
+ && vm.renderMode === 1
5879
5840
  /* Shadow */
5880
- ) {
5881
- useNativeDirPseudoclass = vm.shadowMode === 0
5882
- /* Native */
5883
- ;
5884
- } else {
5885
- // Light DOM components should only render `[dir]` if they're inside of a synthetic shadow root.
5886
- // At the top level (root is null) or inside of a native shadow root, they should use `:dir()`.
5887
- if (isUndefined$1(root)) {
5888
- // Only calculate the root once as necessary
5889
- root = getNearestShadowComponent(vm);
5890
- }
5891
-
5892
- useNativeDirPseudoclass = isNull(root) || root.shadowMode === 0
5893
- /* Native */
5894
- ;
5895
- }
5896
-
5897
- ArrayPush$1.call(content, stylesheet(scopeToken, useActualHostSelector, useNativeDirPseudoclass));
5841
+ ? stylesheetToken : undefined;
5842
+ ArrayPush$1.call(content, stylesheet(useActualHostSelector, scopeToken));
5898
5843
  }
5899
5844
  }
5900
5845
 
@@ -5916,12 +5861,14 @@ var LWC = (function (exports) {
5916
5861
  // https://github.com/salesforce/lwc/pull/2460#discussion_r691208892
5917
5862
 
5918
5863
 
5919
- function getNearestShadowComponent(vm) {
5864
+ function getNearestNativeShadowComponent(vm) {
5920
5865
  var owner = vm;
5921
5866
 
5922
5867
  while (!isNull(owner)) {
5923
5868
  if (owner.renderMode === 1
5924
5869
  /* Shadow */
5870
+ && owner.shadowMode === 0
5871
+ /* Native */
5925
5872
  ) {
5926
5873
  return owner;
5927
5874
  }
@@ -5932,20 +5879,6 @@ var LWC = (function (exports) {
5932
5879
  return owner;
5933
5880
  }
5934
5881
 
5935
- function getNearestNativeShadowComponent(vm) {
5936
- var owner = getNearestShadowComponent(vm);
5937
-
5938
- if (!isNull(owner) && owner.shadowMode === 1
5939
- /* Synthetic */
5940
- ) {
5941
- // Synthetic-within-native is impossible. So if the nearest shadow component is
5942
- // synthetic, we know we won't find a native component if we go any further.
5943
- return null;
5944
- }
5945
-
5946
- return owner;
5947
- }
5948
-
5949
5882
  function createStylesheet(vm, stylesheets) {
5950
5883
  var renderer = vm.renderer,
5951
5884
  renderMode = vm.renderMode,
@@ -7615,7 +7548,7 @@ var LWC = (function (exports) {
7615
7548
  hooksAreSet = true;
7616
7549
  setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
7617
7550
  }
7618
- /* version: 2.5.9 */
7551
+ /* version: 2.5.10-alpha1 */
7619
7552
 
7620
7553
  /*
7621
7554
  * Copyright (c) 2018, salesforce.com, inc.
@@ -8268,7 +8201,7 @@ var LWC = (function (exports) {
8268
8201
  });
8269
8202
  freeze(LightningElement);
8270
8203
  seal(LightningElement.prototype);
8271
- /* version: 2.5.9 */
8204
+ /* version: 2.5.10-alpha1 */
8272
8205
 
8273
8206
  exports.LightningElement = LightningElement;
8274
8207
  exports.__unstable__ProfilerControl = profilerControl;
@@ -8301,4 +8234,4 @@ var LWC = (function (exports) {
8301
8234
 
8302
8235
  return exports;
8303
8236
 
8304
- })({});
8237
+ }({}));