@lwc/synthetic-shadow 2.33.0 → 2.35.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -44,7 +44,7 @@ var assert = /*#__PURE__*/Object.freeze({
44
44
  const { assign, create, defineProperties, defineProperty, freeze, getOwnPropertyDescriptor, getOwnPropertyNames, getPrototypeOf, hasOwnProperty, isFrozen, keys, seal, setPrototypeOf, } = Object;
45
45
  const { isArray } = Array;
46
46
  const { concat: ArrayConcat, copyWithin: ArrayCopyWithin, fill: ArrayFill, filter: ArrayFilter, find: ArrayFind, indexOf: ArrayIndexOf, join: ArrayJoin, map: ArrayMap, pop: ArrayPop, push: ArrayPush, reduce: ArrayReduce, reverse: ArrayReverse, shift: ArrayShift, slice: ArraySlice, some: ArraySome, sort: ArraySort, splice: ArraySplice, unshift: ArrayUnshift, forEach, } = Array.prototype;
47
- const { charCodeAt: StringCharCodeAt, replace: StringReplace, slice: StringSlice, toLowerCase: StringToLowerCase, } = String.prototype;
47
+ const { charCodeAt: StringCharCodeAt, replace: StringReplace, split: StringSplit, slice: StringSlice, toLowerCase: StringToLowerCase, } = String.prototype;
48
48
  function isUndefined(obj) {
49
49
  return obj === undefined;
50
50
  }
@@ -138,6 +138,8 @@ const KEY__SHADOW_STATIC_PRIVATE = '$shadowStaticNodeKey$';
138
138
  const KEY__SHADOW_TOKEN = '$shadowToken$';
139
139
  const KEY__SHADOW_TOKEN_PRIVATE = '$$ShadowTokenKey$$';
140
140
  const KEY__SYNTHETIC_MODE = '$$lwc-synthetic-mode';
141
+ const KEY__NATIVE_GET_ELEMENT_BY_ID = '$nativeGetElementById$';
142
+ const KEY__NATIVE_QUERY_SELECTOR_ALL = '$nativeQuerySelectorAll$';
141
143
 
142
144
  /*
143
145
  * Copyright (c) 2018, salesforce.com, inc.
@@ -148,7 +150,7 @@ const KEY__SYNTHETIC_MODE = '$$lwc-synthetic-mode';
148
150
  // We use this to detect symbol support in order to avoid the expensive symbol polyfill. Note that
149
151
  // we can't use typeof since it will fail when transpiling.
150
152
  const hasNativeSymbolSupport = /*@__PURE__*/ (() => Symbol('x').toString() === 'Symbol(x)')();
151
- /** version: 2.33.0 */
153
+ /** version: 2.35.0 */
152
154
 
153
155
  /*
154
156
  * Copyright (c) 2018, salesforce.com, inc.
@@ -463,7 +465,7 @@ if (!_globalThis.lwcRuntimeFlags) {
463
465
  Object.defineProperty(_globalThis, 'lwcRuntimeFlags', { value: create(null) });
464
466
  }
465
467
  const lwcRuntimeFlags = _globalThis.lwcRuntimeFlags;
466
- /** version: 2.33.0 */
468
+ /** version: 2.35.0 */
467
469
 
468
470
  /*
469
471
  * Copyright (c) 2018, salesforce.com, inc.
@@ -1805,6 +1807,15 @@ defineProperty(_Node.prototype, KEY__SHADOW_RESOLVER, {
1805
1807
  defineProperty(_globalThis, KEY__IS_NATIVE_SHADOW_ROOT_DEFINED, {
1806
1808
  value: isNativeShadowRootDefined,
1807
1809
  });
1810
+ // The isUndefined check is because two copies of synthetic shadow may be loaded on the same page, and this
1811
+ // would throw an error if we tried to redefine it. Plus the whole point is to expose the native method.
1812
+ if (isUndefined(_globalThis[KEY__NATIVE_GET_ELEMENT_BY_ID])) {
1813
+ defineProperty(_globalThis, KEY__NATIVE_GET_ELEMENT_BY_ID, { value: getElementById });
1814
+ }
1815
+ // See note above.
1816
+ if (isUndefined(_globalThis[KEY__NATIVE_QUERY_SELECTOR_ALL])) {
1817
+ defineProperty(_globalThis, KEY__NATIVE_QUERY_SELECTOR_ALL, { value: querySelectorAll });
1818
+ }
1808
1819
  function getShadowRootResolver(node) {
1809
1820
  return node[KEY__SHADOW_RESOLVER];
1810
1821
  }
@@ -4716,4 +4727,4 @@ if (process.env.NODE_ENV !== 'production' && typeof __karma__ !== 'undefined') {
4716
4727
  }));
4717
4728
  });
4718
4729
  }
4719
- /** version: 2.33.0 */
4730
+ /** version: 2.35.0 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lwc/synthetic-shadow",
3
- "version": "2.33.0",
3
+ "version": "2.35.0",
4
4
  "description": "Synthetic Shadow Root for LWC",
5
5
  "homepage": "https://lwc.dev/",
6
6
  "repository": {
@@ -36,8 +36,8 @@
36
36
  "access": "public"
37
37
  },
38
38
  "devDependencies": {
39
- "@lwc/features": "2.33.0",
40
- "@lwc/shared": "2.33.0"
39
+ "@lwc/features": "2.35.0",
40
+ "@lwc/shared": "2.35.0"
41
41
  },
42
42
  "nx": {
43
43
  "targets": {