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
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
3
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.LWC = {}));
5
- })(this, (function (exports) { 'use strict';
5
+ }(this, (function (exports) { 'use strict';
6
6
 
7
7
  /* proxy-compat-disable */
8
8
 
@@ -75,7 +75,7 @@
75
75
  find: ArrayFind,
76
76
  indexOf: ArrayIndexOf,
77
77
  join: ArrayJoin,
78
- map: ArrayMap,
78
+ map: ArrayMap$1,
79
79
  push: ArrayPush$1,
80
80
  reduce: ArrayReduce,
81
81
  reverse: ArrayReverse,
@@ -142,7 +142,7 @@
142
142
  // Array.prototype.toString directly will cause an error Iterate through
143
143
  // all the items and handle individually.
144
144
  if (isArray$1(obj)) {
145
- return ArrayJoin.call(ArrayMap.call(obj, toString$1), ',');
145
+ return ArrayJoin.call(ArrayMap$1.call(obj, toString$1), ',');
146
146
  }
147
147
 
148
148
  return obj.toString();
@@ -305,7 +305,7 @@
305
305
  CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
306
306
  return attributeName;
307
307
  }
308
- /** version: 2.5.9 */
308
+ /** version: 2.5.10-alpha1 */
309
309
 
310
310
  /*
311
311
  * Copyright (c) 2018, salesforce.com, inc.
@@ -485,7 +485,7 @@
485
485
  setFeatureFlag(name, value);
486
486
  }
487
487
  }
488
- /** version: 2.5.9 */
488
+ /** version: 2.5.10-alpha1 */
489
489
 
490
490
  /* proxy-compat-disable */
491
491
 
@@ -1935,6 +1935,7 @@
1935
1935
  getPrototypeOf,
1936
1936
  create: ObjectCreate,
1937
1937
  defineProperty: ObjectDefineProperty,
1938
+ defineProperties: ObjectDefineProperties,
1938
1939
  isExtensible,
1939
1940
  getOwnPropertyDescriptor,
1940
1941
  getOwnPropertyNames,
@@ -1944,7 +1945,8 @@
1944
1945
  } = Object;
1945
1946
  const {
1946
1947
  push: ArrayPush,
1947
- concat: ArrayConcat
1948
+ concat: ArrayConcat,
1949
+ map: ArrayMap
1948
1950
  } = Array.prototype;
1949
1951
  const OtS = {}.toString;
1950
1952
 
@@ -2009,9 +2011,7 @@
2009
2011
  // but it will always be compatible with the previous descriptor
2010
2012
  // to preserve the object invariants, which makes these lines safe.
2011
2013
 
2012
- const originalDescriptor = getOwnPropertyDescriptor(originalTarget, key); // TODO: it should be impossible for the originalDescriptor to ever be undefined, this `if` can be removed
2013
-
2014
- /* istanbul ignore else */
2014
+ const originalDescriptor = getOwnPropertyDescriptor(originalTarget, key);
2015
2015
 
2016
2016
  if (!isUndefined(originalDescriptor)) {
2017
2017
  const wrappedDesc = this.wrapDescriptor(originalDescriptor);
@@ -2039,17 +2039,11 @@
2039
2039
 
2040
2040
  preventExtensions(shadowTarget);
2041
2041
  } // Shared Traps
2042
- // TODO: apply() is never called
2043
-
2044
- /* istanbul ignore next */
2045
2042
 
2046
2043
 
2047
2044
  apply(shadowTarget, thisArg, argArray) {
2048
2045
  /* No op */
2049
- } // TODO: construct() is never called
2050
-
2051
- /* istanbul ignore next */
2052
-
2046
+ }
2053
2047
 
2054
2048
  construct(shadowTarget, argArray, newTarget) {
2055
2049
  /* No op */
@@ -2162,8 +2156,8 @@
2162
2156
 
2163
2157
  }
2164
2158
 
2165
- const getterMap$1 = new WeakMap();
2166
- const setterMap$1 = new WeakMap();
2159
+ const getterMap = new WeakMap();
2160
+ const setterMap = new WeakMap();
2167
2161
  const reverseGetterMap = new WeakMap();
2168
2162
  const reverseSetterMap = new WeakMap();
2169
2163
 
@@ -2173,7 +2167,7 @@
2173
2167
  }
2174
2168
 
2175
2169
  wrapGetter(originalGet) {
2176
- const wrappedGetter = getterMap$1.get(originalGet);
2170
+ const wrappedGetter = getterMap.get(originalGet);
2177
2171
 
2178
2172
  if (!isUndefined(wrappedGetter)) {
2179
2173
  return wrappedGetter;
@@ -2186,13 +2180,13 @@
2186
2180
  return handler.wrapValue(originalGet.call(unwrap$1(this)));
2187
2181
  };
2188
2182
 
2189
- getterMap$1.set(originalGet, get);
2183
+ getterMap.set(originalGet, get);
2190
2184
  reverseGetterMap.set(get, originalGet);
2191
2185
  return get;
2192
2186
  }
2193
2187
 
2194
2188
  wrapSetter(originalSet) {
2195
- const wrappedSetter = setterMap$1.get(originalSet);
2189
+ const wrappedSetter = setterMap.get(originalSet);
2196
2190
 
2197
2191
  if (!isUndefined(wrappedSetter)) {
2198
2192
  return wrappedSetter;
@@ -2203,7 +2197,7 @@
2203
2197
  originalSet.call(unwrap$1(this), unwrap$1(v));
2204
2198
  };
2205
2199
 
2206
- setterMap$1.set(originalSet, set);
2200
+ setterMap.set(originalSet, set);
2207
2201
  reverseSetterMap.set(set, originalSet);
2208
2202
  return set;
2209
2203
  }
@@ -2244,7 +2238,7 @@
2244
2238
  return unwrap$1(redGet.call(handler.wrapValue(this)));
2245
2239
  };
2246
2240
 
2247
- getterMap$1.set(get, redGet);
2241
+ getterMap.set(get, redGet);
2248
2242
  reverseGetterMap.set(redGet, get);
2249
2243
  return get;
2250
2244
  }
@@ -2263,7 +2257,7 @@
2263
2257
  redSet.call(handler.wrapValue(this), handler.wrapValue(v));
2264
2258
  };
2265
2259
 
2266
- setterMap$1.set(set, redSet);
2260
+ setterMap.set(set, redSet);
2267
2261
  reverseSetterMap.set(redSet, set);
2268
2262
  return set;
2269
2263
  }
@@ -2304,7 +2298,6 @@
2304
2298
  }
2305
2299
 
2306
2300
  setPrototypeOf(shadowTarget, prototype) {
2307
- /* istanbul ignore else */
2308
2301
  if (process.env.NODE_ENV !== 'production') {
2309
2302
  throw new Error(`Invalid setPrototypeOf invocation for reactive proxy ${toString(this.originalTarget)}. Prototype of reactive objects cannot be changed.`);
2310
2303
  }
@@ -2318,11 +2311,6 @@
2318
2311
  preventExtensions(originalTarget); // if the originalTarget is a proxy itself, it might reject
2319
2312
  // the preventExtension call, in which case we should not attempt to lock down
2320
2313
  // the shadow target.
2321
- // TODO: It should not actually be possible to reach this `if` statement.
2322
- // If a proxy rejects extensions, then calling preventExtensions will throw an error:
2323
- // https://codepen.io/nolanlawson-the-selector/pen/QWMOjbY
2324
-
2325
- /* istanbul ignore if */
2326
2314
 
2327
2315
  if (isExtensible(originalTarget)) {
2328
2316
  return false;
@@ -2364,8 +2352,8 @@
2364
2352
 
2365
2353
  }
2366
2354
 
2367
- const getterMap = new WeakMap();
2368
- const setterMap = new WeakMap();
2355
+ const getterMap$1 = new WeakMap();
2356
+ const setterMap$1 = new WeakMap();
2369
2357
 
2370
2358
  class ReadOnlyHandler extends BaseProxyHandler {
2371
2359
  wrapValue(value) {
@@ -2373,7 +2361,7 @@
2373
2361
  }
2374
2362
 
2375
2363
  wrapGetter(originalGet) {
2376
- const wrappedGetter = getterMap.get(originalGet);
2364
+ const wrappedGetter = getterMap$1.get(originalGet);
2377
2365
 
2378
2366
  if (!isUndefined(wrappedGetter)) {
2379
2367
  return wrappedGetter;
@@ -2386,12 +2374,12 @@
2386
2374
  return handler.wrapValue(originalGet.call(unwrap$1(this)));
2387
2375
  };
2388
2376
 
2389
- getterMap.set(originalGet, get);
2377
+ getterMap$1.set(originalGet, get);
2390
2378
  return get;
2391
2379
  }
2392
2380
 
2393
2381
  wrapSetter(originalSet) {
2394
- const wrappedSetter = setterMap.get(originalSet);
2382
+ const wrappedSetter = setterMap$1.get(originalSet);
2395
2383
 
2396
2384
  if (!isUndefined(wrappedSetter)) {
2397
2385
  return wrappedSetter;
@@ -2400,7 +2388,6 @@
2400
2388
  const handler = this;
2401
2389
 
2402
2390
  const set = function (v) {
2403
- /* istanbul ignore else */
2404
2391
  if (process.env.NODE_ENV !== 'production') {
2405
2392
  const {
2406
2393
  originalTarget
@@ -2409,41 +2396,33 @@
2409
2396
  }
2410
2397
  };
2411
2398
 
2412
- setterMap.set(originalSet, set);
2399
+ setterMap$1.set(originalSet, set);
2413
2400
  return set;
2414
2401
  }
2415
2402
 
2416
2403
  set(shadowTarget, key, value) {
2417
- /* istanbul ignore else */
2418
2404
  if (process.env.NODE_ENV !== 'production') {
2419
2405
  const {
2420
2406
  originalTarget
2421
2407
  } = this;
2422
- const msg = isArray(originalTarget) ? `Invalid mutation: Cannot mutate array at index ${key.toString()}. Array is read-only.` : `Invalid mutation: Cannot set "${key.toString()}" on "${originalTarget}". "${originalTarget}" is read-only.`;
2423
- throw new Error(msg);
2408
+ throw new Error(`Invalid mutation: Cannot set "${key.toString()}" on "${originalTarget}". "${originalTarget}" is read-only.`);
2424
2409
  }
2425
- /* istanbul ignore next */
2426
-
2427
2410
 
2428
2411
  return false;
2429
2412
  }
2430
2413
 
2431
2414
  deleteProperty(shadowTarget, key) {
2432
- /* istanbul ignore else */
2433
2415
  if (process.env.NODE_ENV !== 'production') {
2434
2416
  const {
2435
2417
  originalTarget
2436
2418
  } = this;
2437
2419
  throw new Error(`Invalid mutation: Cannot delete "${key.toString()}" on "${originalTarget}". "${originalTarget}" is read-only.`);
2438
2420
  }
2439
- /* istanbul ignore next */
2440
-
2441
2421
 
2442
2422
  return false;
2443
2423
  }
2444
2424
 
2445
2425
  setPrototypeOf(shadowTarget, prototype) {
2446
- /* istanbul ignore else */
2447
2426
  if (process.env.NODE_ENV !== 'production') {
2448
2427
  const {
2449
2428
  originalTarget
@@ -2453,29 +2432,23 @@
2453
2432
  }
2454
2433
 
2455
2434
  preventExtensions(shadowTarget) {
2456
- /* istanbul ignore else */
2457
2435
  if (process.env.NODE_ENV !== 'production') {
2458
2436
  const {
2459
2437
  originalTarget
2460
2438
  } = this;
2461
2439
  throw new Error(`Invalid mutation: Cannot preventExtensions on ${originalTarget}". "${originalTarget} is read-only.`);
2462
2440
  }
2463
- /* istanbul ignore next */
2464
-
2465
2441
 
2466
2442
  return false;
2467
2443
  }
2468
2444
 
2469
2445
  defineProperty(shadowTarget, key, descriptor) {
2470
- /* istanbul ignore else */
2471
2446
  if (process.env.NODE_ENV !== 'production') {
2472
2447
  const {
2473
2448
  originalTarget
2474
2449
  } = this;
2475
2450
  throw new Error(`Invalid mutation: Cannot defineProperty "${key.toString()}" on "${originalTarget}". "${originalTarget}" is read-only.`);
2476
2451
  }
2477
- /* istanbul ignore next */
2478
-
2479
2452
 
2480
2453
  return false;
2481
2454
  }
@@ -2533,8 +2506,6 @@
2533
2506
  }; // Inspired from paulmillr/es6-shim
2534
2507
  // https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js#L176-L185
2535
2508
 
2536
- /* istanbul ignore next */
2537
-
2538
2509
  function getGlobal() {
2539
2510
  // the only reliable means to get the global object is `Function('return this')()`
2540
2511
  // However, this causes CSP violations in Chrome apps.
@@ -2559,7 +2530,6 @@
2559
2530
  }
2560
2531
 
2561
2532
  function init() {
2562
- /* istanbul ignore if */
2563
2533
  if (process.env.NODE_ENV === 'production') {
2564
2534
  // this method should never leak to prod
2565
2535
  throw new ReferenceError();
@@ -2574,8 +2544,6 @@
2574
2544
  ArrayPush.call(devtoolsFormatters, formatter);
2575
2545
  global.devtoolsFormatters = devtoolsFormatters;
2576
2546
  }
2577
- /* istanbul ignore else */
2578
-
2579
2547
 
2580
2548
  if (process.env.NODE_ENV !== 'production') {
2581
2549
  init();
@@ -2622,8 +2590,7 @@
2622
2590
  this.valueMutated = defaultValueMutated;
2623
2591
  this.valueObserved = defaultValueObserved;
2624
2592
  this.valueIsObservable = defaultValueIsObservable;
2625
- this.readOnlyObjectGraph = new WeakMap();
2626
- this.reactiveObjectGraph = new WeakMap();
2593
+ this.objectGraph = new WeakMap();
2627
2594
 
2628
2595
  if (!isUndefined(options)) {
2629
2596
  const {
@@ -2646,13 +2613,10 @@
2646
2613
  const distorted = this.valueDistortion(unwrappedValue);
2647
2614
 
2648
2615
  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.
2652
- return value;
2653
- }
2616
+ const o = this.getReactiveState(unwrappedValue, distorted); // when trying to extract the writable version of a readonly
2617
+ // we return the readonly.
2654
2618
 
2655
- return this.getReactiveHandler(unwrappedValue, distorted);
2619
+ return o.readOnly === value ? value : o.reactive;
2656
2620
  }
2657
2621
 
2658
2622
  return distorted;
@@ -2663,7 +2627,7 @@
2663
2627
  const distorted = this.valueDistortion(value);
2664
2628
 
2665
2629
  if (this.valueIsObservable(distorted)) {
2666
- return this.getReadOnlyHandler(value, distorted);
2630
+ return this.getReactiveState(value, distorted).readOnly;
2667
2631
  }
2668
2632
 
2669
2633
  return distorted;
@@ -2673,36 +2637,47 @@
2673
2637
  return unwrap$1(p);
2674
2638
  }
2675
2639
 
2676
- getReactiveHandler(value, distortedValue) {
2677
- let proxy = this.reactiveObjectGraph.get(distortedValue);
2640
+ getReactiveState(value, distortedValue) {
2641
+ const {
2642
+ objectGraph
2643
+ } = this;
2644
+ let reactiveState = objectGraph.get(distortedValue);
2678
2645
 
2679
- if (isUndefined(proxy)) {
2680
- // caching the proxy after the first time it is accessed
2681
- const handler = new ReactiveProxyHandler(this, distortedValue);
2682
- proxy = new Proxy(createShadowTarget(distortedValue), handler);
2683
- registerProxy(proxy, value);
2684
- this.reactiveObjectGraph.set(distortedValue, proxy);
2646
+ if (reactiveState) {
2647
+ return reactiveState;
2685
2648
  }
2686
2649
 
2687
- return proxy;
2688
- }
2650
+ const membrane = this;
2651
+ reactiveState = {
2652
+ get reactive() {
2653
+ const reactiveHandler = new ReactiveProxyHandler(membrane, distortedValue); // caching the reactive proxy after the first time it is accessed
2689
2654
 
2690
- getReadOnlyHandler(value, distortedValue) {
2691
- let proxy = this.readOnlyObjectGraph.get(distortedValue);
2655
+ const proxy = new Proxy(createShadowTarget(distortedValue), reactiveHandler);
2656
+ registerProxy(proxy, value);
2657
+ ObjectDefineProperty(this, 'reactive', {
2658
+ value: proxy
2659
+ });
2660
+ return proxy;
2661
+ },
2692
2662
 
2693
- if (isUndefined(proxy)) {
2694
- // caching the proxy after the first time it is accessed
2695
- const handler = new ReadOnlyHandler(this, distortedValue);
2696
- proxy = new Proxy(createShadowTarget(distortedValue), handler);
2697
- registerProxy(proxy, value);
2698
- this.readOnlyObjectGraph.set(distortedValue, proxy);
2699
- }
2663
+ get readOnly() {
2664
+ const readOnlyHandler = new ReadOnlyHandler(membrane, distortedValue); // caching the readOnly proxy after the first time it is accessed
2665
+
2666
+ const proxy = new Proxy(createShadowTarget(distortedValue), readOnlyHandler);
2667
+ registerProxy(proxy, value);
2668
+ ObjectDefineProperty(this, 'readOnly', {
2669
+ value: proxy
2670
+ });
2671
+ return proxy;
2672
+ }
2700
2673
 
2701
- return proxy;
2674
+ };
2675
+ objectGraph.set(distortedValue, reactiveState);
2676
+ return reactiveState;
2702
2677
  }
2703
2678
 
2704
2679
  }
2705
- /** version: 1.1.5 */
2680
+ /** version: 1.0.0 */
2706
2681
 
2707
2682
  /*
2708
2683
  * Copyright (c) 2018, salesforce.com, inc.
@@ -5968,7 +5943,6 @@
5968
5943
 
5969
5944
  function evaluateStylesheetsContent(stylesheets, stylesheetToken, vm) {
5970
5945
  const content = [];
5971
- let root;
5972
5946
 
5973
5947
  for (let i = 0; i < stylesheets.length; i++) {
5974
5948
  let stylesheet = stylesheets[i];
@@ -5981,46 +5955,23 @@
5981
5955
  // the component instance might be attempting to use an old version of
5982
5956
  // the stylesheet, while internally, we have a replacement for it.
5983
5957
  stylesheet = getStyleOrSwappedStyle(stylesheet);
5984
- }
5985
-
5986
- const isScopedCss = stylesheet[KEY__SCOPED_CSS]; // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
5987
-
5988
- const scopeToken = isScopedCss || vm.shadowMode === 1
5989
- /* Synthetic */
5990
- && vm.renderMode === 1
5991
- /* Shadow */
5992
- ? stylesheetToken : undefined; // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
5958
+ } // Use the actual `:host` selector if we're rendering global CSS for light DOM, or if we're rendering
5993
5959
  // native shadow DOM. Synthetic shadow DOM never uses `:host`.
5994
5960
 
5961
+
5962
+ const isScopedCss = stylesheet[KEY__SCOPED_CSS];
5995
5963
  const useActualHostSelector = vm.renderMode === 0
5996
5964
  /* Light */
5997
5965
  ? !isScopedCss : vm.shadowMode === 0
5998
5966
  /* Native */
5999
- ; // Use the native :dir() pseudoclass only in native shadow DOM. Otherwise, in synthetic shadow,
6000
- // we use an attribute selector on the host to simulate :dir().
6001
-
6002
- let useNativeDirPseudoclass;
5967
+ ; // Apply the scope token only if the stylesheet itself is scoped, or if we're rendering synthetic shadow.
6003
5968
 
6004
- if (vm.renderMode === 1
5969
+ const scopeToken = isScopedCss || vm.shadowMode === 1
5970
+ /* Synthetic */
5971
+ && vm.renderMode === 1
6005
5972
  /* Shadow */
6006
- ) {
6007
- useNativeDirPseudoclass = vm.shadowMode === 0
6008
- /* Native */
6009
- ;
6010
- } else {
6011
- // Light DOM components should only render `[dir]` if they're inside of a synthetic shadow root.
6012
- // At the top level (root is null) or inside of a native shadow root, they should use `:dir()`.
6013
- if (isUndefined$1(root)) {
6014
- // Only calculate the root once as necessary
6015
- root = getNearestShadowComponent(vm);
6016
- }
6017
-
6018
- useNativeDirPseudoclass = isNull(root) || root.shadowMode === 0
6019
- /* Native */
6020
- ;
6021
- }
6022
-
6023
- ArrayPush$1.call(content, stylesheet(scopeToken, useActualHostSelector, useNativeDirPseudoclass));
5973
+ ? stylesheetToken : undefined;
5974
+ ArrayPush$1.call(content, stylesheet(useActualHostSelector, scopeToken));
6024
5975
  }
6025
5976
  }
6026
5977
 
@@ -6044,12 +5995,14 @@
6044
5995
  // https://github.com/salesforce/lwc/pull/2460#discussion_r691208892
6045
5996
 
6046
5997
 
6047
- function getNearestShadowComponent(vm) {
5998
+ function getNearestNativeShadowComponent(vm) {
6048
5999
  let owner = vm;
6049
6000
 
6050
6001
  while (!isNull(owner)) {
6051
6002
  if (owner.renderMode === 1
6052
6003
  /* Shadow */
6004
+ && owner.shadowMode === 0
6005
+ /* Native */
6053
6006
  ) {
6054
6007
  return owner;
6055
6008
  }
@@ -6060,20 +6013,6 @@
6060
6013
  return owner;
6061
6014
  }
6062
6015
 
6063
- function getNearestNativeShadowComponent(vm) {
6064
- const owner = getNearestShadowComponent(vm);
6065
-
6066
- if (!isNull(owner) && owner.shadowMode === 1
6067
- /* Synthetic */
6068
- ) {
6069
- // Synthetic-within-native is impossible. So if the nearest shadow component is
6070
- // synthetic, we know we won't find a native component if we go any further.
6071
- return null;
6072
- }
6073
-
6074
- return owner;
6075
- }
6076
-
6077
6016
  function createStylesheet(vm, stylesheets) {
6078
6017
  const {
6079
6018
  renderer,
@@ -7814,7 +7753,7 @@
7814
7753
  hooksAreSet = true;
7815
7754
  setSanitizeHtmlContentHook(hooks.sanitizeHtmlContent);
7816
7755
  }
7817
- /* version: 2.5.9 */
7756
+ /* version: 2.5.10-alpha1 */
7818
7757
 
7819
7758
  /*
7820
7759
  * Copyright (c) 2018, salesforce.com, inc.
@@ -8470,7 +8409,7 @@
8470
8409
  });
8471
8410
  freeze(LightningElement);
8472
8411
  seal(LightningElement.prototype);
8473
- /* version: 2.5.9 */
8412
+ /* version: 2.5.10-alpha1 */
8474
8413
 
8475
8414
  exports.LightningElement = LightningElement;
8476
8415
  exports.__unstable__ProfilerControl = profilerControl;
@@ -8501,4 +8440,4 @@
8501
8440
 
8502
8441
  Object.defineProperty(exports, '__esModule', { value: true });
8503
8442
 
8504
- }));
8443
+ })));