@lwc/shared 2.26.0 → 2.26.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.
package/dist/index.cjs.js CHANGED
@@ -458,7 +458,7 @@ const hasNativeSymbolSupport = /*@__PURE__*/ (() => Symbol('x').toString() === '
458
458
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
459
459
  */
460
460
  // Increment whenever the LWC template compiler changes
461
- const LWC_VERSION = "2.26.0";
461
+ const LWC_VERSION = "2.26.1";
462
462
  const LWC_VERSION_COMMENT = `LWC compiler v${LWC_VERSION}`;
463
463
  const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
464
464
 
@@ -538,4 +538,4 @@ exports.noop = noop;
538
538
  exports.seal = seal;
539
539
  exports.setPrototypeOf = setPrototypeOf;
540
540
  exports.toString = toString;
541
- /** version: 2.26.0 */
541
+ /** version: 2.26.1 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lwc/shared",
3
- "version": "2.26.0",
3
+ "version": "2.26.1",
4
4
  "description": "Utilities and methods that are shared across packages",
5
5
  "homepage": "https://lwc.dev/",
6
6
  "repository": {
@@ -37,4 +37,4 @@
37
37
  }
38
38
  }
39
39
  }
40
- }
40
+ }
package/dist/index.js DELETED
@@ -1,462 +0,0 @@
1
- /**
2
- * Copyright (C) 2018 salesforce.com, inc.
3
- */
4
- /*
5
- * Copyright (c) 2018, salesforce.com, inc.
6
- * All rights reserved.
7
- * SPDX-License-Identifier: MIT
8
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
9
- */
10
- function invariant(value, msg) {
11
- if (!value) {
12
- throw new Error(`Invariant Violation: ${msg}`);
13
- }
14
- }
15
- function isTrue$1(value, msg) {
16
- if (!value) {
17
- throw new Error(`Assert Violation: ${msg}`);
18
- }
19
- }
20
- function isFalse$1(value, msg) {
21
- if (value) {
22
- throw new Error(`Assert Violation: ${msg}`);
23
- }
24
- }
25
- function fail(msg) {
26
- throw new Error(msg);
27
- }
28
-
29
- var assert = /*#__PURE__*/Object.freeze({
30
- __proto__: null,
31
- invariant: invariant,
32
- isTrue: isTrue$1,
33
- isFalse: isFalse$1,
34
- fail: fail
35
- });
36
-
37
- /*
38
- * Copyright (c) 2018, salesforce.com, inc.
39
- * All rights reserved.
40
- * SPDX-License-Identifier: MIT
41
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
42
- */
43
- const { assign, create, defineProperties, defineProperty, freeze, getOwnPropertyDescriptor, getOwnPropertyNames, getPrototypeOf, hasOwnProperty, isFrozen, keys, seal, setPrototypeOf, } = Object;
44
- const { isArray } = Array;
45
- const { 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, sort: ArraySort, splice: ArraySplice, unshift: ArrayUnshift, forEach, } = Array.prototype;
46
- const { fromCharCode: StringFromCharCode } = String;
47
- const { charCodeAt: StringCharCodeAt, replace: StringReplace, slice: StringSlice, toLowerCase: StringToLowerCase, } = String.prototype;
48
- function isUndefined(obj) {
49
- return obj === undefined;
50
- }
51
- function isNull(obj) {
52
- return obj === null;
53
- }
54
- function isTrue(obj) {
55
- return obj === true;
56
- }
57
- function isFalse(obj) {
58
- return obj === false;
59
- }
60
- function isBoolean(obj) {
61
- return typeof obj === 'boolean';
62
- }
63
- function isFunction(obj) {
64
- return typeof obj === 'function';
65
- }
66
- function isObject(obj) {
67
- return typeof obj === 'object';
68
- }
69
- function isString(obj) {
70
- return typeof obj === 'string';
71
- }
72
- function isNumber(obj) {
73
- return typeof obj === 'number';
74
- }
75
- function noop() {
76
- /* Do nothing */
77
- }
78
- const OtS = {}.toString;
79
- function toString(obj) {
80
- if (obj && obj.toString) {
81
- // Arrays might hold objects with "null" prototype So using
82
- // Array.prototype.toString directly will cause an error Iterate through
83
- // all the items and handle individually.
84
- if (isArray(obj)) {
85
- return ArrayJoin.call(ArrayMap.call(obj, toString), ',');
86
- }
87
- return obj.toString();
88
- }
89
- else if (typeof obj === 'object') {
90
- return OtS.call(obj);
91
- }
92
- else {
93
- return obj + '';
94
- }
95
- }
96
- function getPropertyDescriptor(o, p) {
97
- do {
98
- const d = getOwnPropertyDescriptor(o, p);
99
- if (!isUndefined(d)) {
100
- return d;
101
- }
102
- o = getPrototypeOf(o);
103
- } while (o !== null);
104
- }
105
-
106
- /*
107
- * Copyright (c) 2018, salesforce.com, inc.
108
- * All rights reserved.
109
- * SPDX-License-Identifier: MIT
110
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
111
- */
112
- /**
113
- * According to the following list, there are 48 aria attributes of which two (ariaDropEffect and
114
- * ariaGrabbed) are deprecated:
115
- * https://www.w3.org/TR/wai-aria-1.1/#x6-6-definitions-of-states-and-properties-all-aria-attributes
116
- *
117
- * The above list of 46 aria attributes is consistent with the following resources:
118
- * https://github.com/w3c/aria/pull/708/files#diff-eacf331f0ffc35d4b482f1d15a887d3bR11060
119
- * https://wicg.github.io/aom/spec/aria-reflection.html
120
- */
121
- const AriaPropertyNames = [
122
- 'ariaActiveDescendant',
123
- 'ariaAtomic',
124
- 'ariaAutoComplete',
125
- 'ariaBusy',
126
- 'ariaChecked',
127
- 'ariaColCount',
128
- 'ariaColIndex',
129
- 'ariaColSpan',
130
- 'ariaControls',
131
- 'ariaCurrent',
132
- 'ariaDescribedBy',
133
- 'ariaDetails',
134
- 'ariaDisabled',
135
- 'ariaErrorMessage',
136
- 'ariaExpanded',
137
- 'ariaFlowTo',
138
- 'ariaHasPopup',
139
- 'ariaHidden',
140
- 'ariaInvalid',
141
- 'ariaKeyShortcuts',
142
- 'ariaLabel',
143
- 'ariaLabelledBy',
144
- 'ariaLevel',
145
- 'ariaLive',
146
- 'ariaModal',
147
- 'ariaMultiLine',
148
- 'ariaMultiSelectable',
149
- 'ariaOrientation',
150
- 'ariaOwns',
151
- 'ariaPlaceholder',
152
- 'ariaPosInSet',
153
- 'ariaPressed',
154
- 'ariaReadOnly',
155
- 'ariaRelevant',
156
- 'ariaRequired',
157
- 'ariaRoleDescription',
158
- 'ariaRowCount',
159
- 'ariaRowIndex',
160
- 'ariaRowSpan',
161
- 'ariaSelected',
162
- 'ariaSetSize',
163
- 'ariaSort',
164
- 'ariaValueMax',
165
- 'ariaValueMin',
166
- 'ariaValueNow',
167
- 'ariaValueText',
168
- 'role',
169
- ];
170
- const { AriaAttrNameToPropNameMap, AriaPropNameToAttrNameMap } = /*@__PURE__*/ (() => {
171
- const AriaAttrNameToPropNameMap = create(null);
172
- const AriaPropNameToAttrNameMap = create(null);
173
- // Synthetic creation of all AOM property descriptors for Custom Elements
174
- forEach.call(AriaPropertyNames, (propName) => {
175
- const attrName = StringToLowerCase.call(StringReplace.call(propName, /^aria/, () => 'aria-'));
176
- AriaAttrNameToPropNameMap[attrName] = propName;
177
- AriaPropNameToAttrNameMap[propName] = attrName;
178
- });
179
- return { AriaAttrNameToPropNameMap, AriaPropNameToAttrNameMap };
180
- })();
181
- function isAriaAttribute(attrName) {
182
- return attrName in AriaAttrNameToPropNameMap;
183
- }
184
-
185
- /*
186
- * Copyright (c) 2018, salesforce.com, inc.
187
- * All rights reserved.
188
- * SPDX-License-Identifier: MIT
189
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
190
- */
191
- // Inspired from: https://mathiasbynens.be/notes/globalthis
192
- const _globalThis = /*@__PURE__*/ (function () {
193
- // On recent browsers, `globalThis` is already defined. In this case return it directly.
194
- if (typeof globalThis === 'object') {
195
- return globalThis;
196
- }
197
- let _globalThis;
198
- try {
199
- // eslint-disable-next-line no-extend-native
200
- Object.defineProperty(Object.prototype, '__magic__', {
201
- get: function () {
202
- return this;
203
- },
204
- configurable: true,
205
- });
206
- // __magic__ is undefined in Safari 10 and IE10 and older.
207
- // @ts-ignore
208
- // eslint-disable-next-line no-undef
209
- _globalThis = __magic__;
210
- // @ts-ignore
211
- delete Object.prototype.__magic__;
212
- }
213
- catch (ex) {
214
- // In IE8, Object.defineProperty only works on DOM objects.
215
- }
216
- finally {
217
- // If the magic above fails for some reason we assume that we are in a legacy browser.
218
- // Assume `window` exists in this case.
219
- if (typeof _globalThis === 'undefined') {
220
- // @ts-ignore
221
- _globalThis = window;
222
- }
223
- }
224
- return _globalThis;
225
- })();
226
-
227
- /*
228
- * Copyright (c) 2018, salesforce.com, inc.
229
- * All rights reserved.
230
- * SPDX-License-Identifier: MIT
231
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
232
- */
233
- const KEY__IS_NATIVE_SHADOW_ROOT_DEFINED = '$isNativeShadowRootDefined$';
234
- const KEY__SHADOW_RESOLVER = '$shadowResolver$';
235
- const KEY__SHADOW_RESOLVER_PRIVATE = '$$ShadowResolverKey$$';
236
- const KEY__SHADOW_STATIC = '$shadowStaticNode$';
237
- const KEY__SHADOW_STATIC_PRIVATE = '$shadowStaticNodeKey$';
238
- const KEY__SHADOW_TOKEN = '$shadowToken$';
239
- const KEY__SHADOW_TOKEN_PRIVATE = '$$ShadowTokenKey$$';
240
- const KEY__SYNTHETIC_MODE = '$$lwc-synthetic-mode';
241
- const KEY__SCOPED_CSS = '$scoped$';
242
-
243
- /*
244
- * Copyright (c) 2022, salesforce.com, inc.
245
- * All rights reserved.
246
- * SPDX-License-Identifier: MIT
247
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
248
- */
249
- const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
250
- const XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';
251
- const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
252
- const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
253
- const XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
254
-
255
- /*
256
- * Copyright (c) 2020, salesforce.com, inc.
257
- * All rights reserved.
258
- * SPDX-License-Identifier: MIT
259
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
260
- */
261
- // Void elements are elements that self-close even without an explicit solidus (slash),
262
- // e.g. `</tagName>` or `<tagName />`. For instance, `<meta>` closes on its own; no need for a slash.
263
- // These only come from HTML; there are no void elements in the SVG or MathML namespaces.
264
- // See: https://html.spec.whatwg.org/multipage/syntax.html#syntax-tags
265
- const VOID_ELEMENTS = [
266
- 'area',
267
- 'base',
268
- 'br',
269
- 'col',
270
- 'embed',
271
- 'hr',
272
- 'img',
273
- 'input',
274
- 'link',
275
- 'meta',
276
- 'source',
277
- 'track',
278
- 'wbr',
279
- ];
280
- // These elements have been deprecated but preserving their usage for backwards compatibility
281
- // until we can officially deprecate them from LWC.
282
- // See: https://html.spec.whatwg.org/multipage/obsolete.html#obsolete-but-conforming-features
283
- const DEPRECATED_VOID_ELEMENTS = ['param', 'keygen', 'menuitem'];
284
- const VOID_ELEMENTS_SET = new Set([...VOID_ELEMENTS, ...DEPRECATED_VOID_ELEMENTS]);
285
- function isVoidElement(name, namespace) {
286
- return namespace === HTML_NAMESPACE && VOID_ELEMENTS_SET.has(name.toLowerCase());
287
- }
288
-
289
- /*
290
- * Copyright (c) 2020, salesforce.com, inc.
291
- * All rights reserved.
292
- * SPDX-License-Identifier: MIT
293
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
294
- */
295
- /**
296
- * Maps boolean attribute name to supported tags: 'boolean attr name' => Set of allowed tag names
297
- * that supports them.
298
- */
299
- const BOOLEAN_ATTRIBUTES = new Map([
300
- ['autofocus', new Set(['button', 'input', 'keygen', 'select', 'textarea'])],
301
- ['autoplay', new Set(['audio', 'video'])],
302
- ['checked', new Set(['command', 'input'])],
303
- [
304
- 'disabled',
305
- new Set([
306
- 'button',
307
- 'command',
308
- 'fieldset',
309
- 'input',
310
- 'keygen',
311
- 'optgroup',
312
- 'select',
313
- 'textarea',
314
- ]),
315
- ],
316
- ['formnovalidate', new Set(['button'])],
317
- ['hidden', new Set()],
318
- ['loop', new Set(['audio', 'bgsound', 'marquee', 'video'])],
319
- ['multiple', new Set(['input', 'select'])],
320
- ['muted', new Set(['audio', 'video'])],
321
- ['novalidate', new Set(['form'])],
322
- ['open', new Set(['details'])],
323
- ['readonly', new Set(['input', 'textarea'])],
324
- ['required', new Set(['input', 'select', 'textarea'])],
325
- ['reversed', new Set(['ol'])],
326
- ['selected', new Set(['option'])],
327
- ]);
328
- function isBooleanAttribute(attrName, tagName) {
329
- const allowedTagNames = BOOLEAN_ATTRIBUTES.get(attrName);
330
- return (allowedTagNames !== undefined &&
331
- (allowedTagNames.size === 0 || allowedTagNames.has(tagName)));
332
- }
333
- // This list is based on https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes
334
- const GLOBAL_ATTRIBUTE = new Set([
335
- 'accesskey',
336
- 'autocapitalize',
337
- 'autofocus',
338
- 'class',
339
- 'contenteditable',
340
- 'contextmenu',
341
- 'dir',
342
- 'draggable',
343
- 'enterkeyhint',
344
- 'exportparts',
345
- 'hidden',
346
- 'id',
347
- 'inputmode',
348
- 'is',
349
- 'itemid',
350
- 'itemprop',
351
- 'itemref',
352
- 'itemscope',
353
- 'itemtype',
354
- 'lang',
355
- 'nonce',
356
- 'part',
357
- 'slot',
358
- 'spellcheck',
359
- 'style',
360
- 'tabindex',
361
- 'title',
362
- 'translate',
363
- ]);
364
- function isGlobalHtmlAttribute(attrName) {
365
- return GLOBAL_ATTRIBUTE.has(attrName);
366
- }
367
- /**
368
- * Map composed of properties to attributes not following the HTML property to attribute mapping
369
- * convention.
370
- */
371
- const NO_STANDARD_PROPERTY_ATTRIBUTE_MAPPING = new Map([
372
- ['accessKey', 'accesskey'],
373
- ['readOnly', 'readonly'],
374
- ['tabIndex', 'tabindex'],
375
- ['bgColor', 'bgcolor'],
376
- ['colSpan', 'colspan'],
377
- ['rowSpan', 'rowspan'],
378
- ['contentEditable', 'contenteditable'],
379
- ['crossOrigin', 'crossorigin'],
380
- ['dateTime', 'datetime'],
381
- ['formAction', 'formaction'],
382
- ['isMap', 'ismap'],
383
- ['maxLength', 'maxlength'],
384
- ['minLength', 'minlength'],
385
- ['noValidate', 'novalidate'],
386
- ['useMap', 'usemap'],
387
- ['htmlFor', 'for'],
388
- ]);
389
- /**
390
- * Map associating previously transformed HTML property into HTML attribute.
391
- */
392
- const CACHED_PROPERTY_ATTRIBUTE_MAPPING = new Map();
393
- function htmlPropertyToAttribute(propName) {
394
- const ariaAttributeName = AriaPropNameToAttrNameMap[propName];
395
- if (!isUndefined(ariaAttributeName)) {
396
- return ariaAttributeName;
397
- }
398
- const specialAttributeName = NO_STANDARD_PROPERTY_ATTRIBUTE_MAPPING.get(propName);
399
- if (!isUndefined(specialAttributeName)) {
400
- return specialAttributeName;
401
- }
402
- const cachedAttributeName = CACHED_PROPERTY_ATTRIBUTE_MAPPING.get(propName);
403
- if (!isUndefined(cachedAttributeName)) {
404
- return cachedAttributeName;
405
- }
406
- let attributeName = '';
407
- for (let i = 0, len = propName.length; i < len; i++) {
408
- const code = StringCharCodeAt.call(propName, i);
409
- if (code >= 65 && // "A"
410
- code <= 90 // "Z"
411
- ) {
412
- attributeName += '-' + StringFromCharCode(code + 32);
413
- }
414
- else {
415
- attributeName += StringFromCharCode(code);
416
- }
417
- }
418
- CACHED_PROPERTY_ATTRIBUTE_MAPPING.set(propName, attributeName);
419
- return attributeName;
420
- }
421
-
422
- /*
423
- * Copyright (c) 2020, salesforce.com, inc.
424
- * All rights reserved.
425
- * SPDX-License-Identifier: MIT
426
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
427
- */
428
- const ESCAPED_CHARS = {
429
- '"': '&quot;',
430
- "'": '&#x27;',
431
- '<': '&lt;',
432
- '>': '&gt;',
433
- '&': '&amp;',
434
- };
435
- function htmlEscape(str, attrMode = false) {
436
- const searchValue = attrMode ? /["&]/g : /["'<>&]/g;
437
- return str.replace(searchValue, (char) => ESCAPED_CHARS[char]);
438
- }
439
-
440
- /*
441
- * Copyright (c) 2018, salesforce.com, inc.
442
- * All rights reserved.
443
- * SPDX-License-Identifier: MIT
444
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
445
- */
446
- // We use this to detect symbol support in order to avoid the expensive symbol polyfill. Note that
447
- // we can't use typeof since it will fail when transpiling.
448
- const hasNativeSymbolSupport = /*@__PURE__*/ (() => Symbol('x').toString() === 'Symbol(x)')();
449
-
450
- /*
451
- * Copyright (c) 2018, salesforce.com, inc.
452
- * All rights reserved.
453
- * SPDX-License-Identifier: MIT
454
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
455
- */
456
- // Increment whenever the LWC template compiler changes
457
- const LWC_VERSION = "2.26.0";
458
- const LWC_VERSION_COMMENT = `LWC compiler v${LWC_VERSION}`;
459
- const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
460
-
461
- export { AriaAttrNameToPropNameMap, AriaPropNameToAttrNameMap, ArrayCopyWithin, ArrayFill, ArrayFilter, ArrayFind, ArrayIndexOf, ArrayJoin, ArrayMap, ArrayPop, ArrayPush, ArrayReduce, ArrayReverse, ArrayShift, ArraySlice, ArraySort, ArraySplice, ArrayUnshift, HTML_NAMESPACE, KEY__IS_NATIVE_SHADOW_ROOT_DEFINED, KEY__SCOPED_CSS, KEY__SHADOW_RESOLVER, KEY__SHADOW_RESOLVER_PRIVATE, KEY__SHADOW_STATIC, KEY__SHADOW_STATIC_PRIVATE, KEY__SHADOW_TOKEN, KEY__SHADOW_TOKEN_PRIVATE, KEY__SYNTHETIC_MODE, LWC_VERSION, LWC_VERSION_COMMENT, LWC_VERSION_COMMENT_REGEX, MATHML_NAMESPACE, SVG_NAMESPACE, StringCharCodeAt, StringFromCharCode, StringReplace, StringSlice, StringToLowerCase, XLINK_NAMESPACE, XML_NAMESPACE, assert, assign, create, defineProperties, defineProperty, forEach, freeze, getOwnPropertyDescriptor, getOwnPropertyNames, getPropertyDescriptor, getPrototypeOf, _globalThis as globalThis, hasNativeSymbolSupport, hasOwnProperty, htmlEscape, htmlPropertyToAttribute, isAriaAttribute, isArray, isBoolean, isBooleanAttribute, isFalse, isFrozen, isFunction, isGlobalHtmlAttribute, isNull, isNumber, isObject, isString, isTrue, isUndefined, isVoidElement, keys, noop, seal, setPrototypeOf, toString };
462
- /** version: 2.26.0 */