@lwc/shared 2.18.0 → 2.20.0
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 +22 -52
- package/dist/index.js +23 -52
- package/package.json +1 -1
- package/types/language.d.ts +7 -4
- package/types/void-elements.d.ts +1 -2
package/dist/index.cjs.js
CHANGED
|
@@ -244,62 +244,45 @@ const KEY__SHADOW_TOKEN_PRIVATE = '$$ShadowTokenKey$$';
|
|
|
244
244
|
const KEY__SYNTHETIC_MODE = '$$lwc-synthetic-mode';
|
|
245
245
|
const KEY__SCOPED_CSS = '$scoped$';
|
|
246
246
|
|
|
247
|
+
/*
|
|
248
|
+
* Copyright (c) 2022, salesforce.com, inc.
|
|
249
|
+
* All rights reserved.
|
|
250
|
+
* SPDX-License-Identifier: MIT
|
|
251
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
252
|
+
*/
|
|
253
|
+
const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
|
|
254
|
+
const XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';
|
|
255
|
+
const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
|
|
256
|
+
const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
|
|
257
|
+
const XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
|
|
258
|
+
|
|
247
259
|
/*
|
|
248
260
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
249
261
|
* All rights reserved.
|
|
250
262
|
* SPDX-License-Identifier: MIT
|
|
251
263
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
252
264
|
*/
|
|
253
|
-
//
|
|
254
|
-
//
|
|
255
|
-
|
|
265
|
+
// Void elements are elements that self-close even without an explicit solidus (slash),
|
|
266
|
+
// e.g. `</tagName>` or `<tagName />`. For instance, `<meta>` closes on its own; no need for a slash.
|
|
267
|
+
// These only come from HTML; there are no void elements in the SVG or MathML namespaces.
|
|
268
|
+
// See: https://html.spec.whatwg.org/multipage/syntax.html#syntax-tags
|
|
269
|
+
const VOID_ELEMENTS_SET = new Set([
|
|
256
270
|
'area',
|
|
257
271
|
'base',
|
|
258
272
|
'br',
|
|
259
|
-
'circle',
|
|
260
273
|
'col',
|
|
261
|
-
'ellipse',
|
|
262
|
-
'feBlend',
|
|
263
|
-
'feColorMatrix',
|
|
264
|
-
'feFuncR',
|
|
265
|
-
'feFuncG',
|
|
266
|
-
'feFuncB',
|
|
267
|
-
'feFuncA',
|
|
268
|
-
'feImage',
|
|
269
|
-
'feComposite',
|
|
270
|
-
'feConvolveMatrix',
|
|
271
|
-
'feDiffuseLighting',
|
|
272
|
-
'feDisplacementMap',
|
|
273
|
-
'feDropShadow',
|
|
274
|
-
'feFlood',
|
|
275
|
-
'feGaussianBlur',
|
|
276
|
-
'feMerge',
|
|
277
|
-
'feMergeNode',
|
|
278
|
-
'feMorphology',
|
|
279
|
-
'feOffset',
|
|
280
|
-
'feSpecularLighting',
|
|
281
|
-
'feTile',
|
|
282
|
-
'feTurbulence',
|
|
283
|
-
'fePointLight',
|
|
284
274
|
'embed',
|
|
285
275
|
'hr',
|
|
286
276
|
'img',
|
|
287
277
|
'input',
|
|
288
|
-
'keygen',
|
|
289
|
-
'line',
|
|
290
278
|
'link',
|
|
291
|
-
'menuitem',
|
|
292
279
|
'meta',
|
|
293
|
-
'param',
|
|
294
|
-
'path',
|
|
295
|
-
'rect',
|
|
296
280
|
'source',
|
|
297
281
|
'track',
|
|
298
282
|
'wbr',
|
|
299
|
-
];
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
return VOID_ELEMENTS_SET.has(name);
|
|
283
|
+
]);
|
|
284
|
+
function isVoidElement(name, namespace) {
|
|
285
|
+
return namespace === HTML_NAMESPACE && VOID_ELEMENTS_SET.has(name.toLowerCase());
|
|
303
286
|
}
|
|
304
287
|
|
|
305
288
|
/*
|
|
@@ -451,18 +434,6 @@ function htmlEscape(str, attrMode = false) {
|
|
|
451
434
|
// we can't use typeof since it will fail when transpiling.
|
|
452
435
|
const hasNativeSymbolSupport = /*@__PURE__*/ (() => Symbol('x').toString() === 'Symbol(x)')();
|
|
453
436
|
|
|
454
|
-
/*
|
|
455
|
-
* Copyright (c) 2022, salesforce.com, inc.
|
|
456
|
-
* All rights reserved.
|
|
457
|
-
* SPDX-License-Identifier: MIT
|
|
458
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
459
|
-
*/
|
|
460
|
-
const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
|
|
461
|
-
const XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';
|
|
462
|
-
const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
|
|
463
|
-
const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
|
|
464
|
-
const XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
|
|
465
|
-
|
|
466
437
|
/*
|
|
467
438
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
468
439
|
* All rights reserved.
|
|
@@ -470,7 +441,7 @@ const XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
|
|
|
470
441
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
471
442
|
*/
|
|
472
443
|
// Increment whenever the LWC template compiler changes
|
|
473
|
-
const LWC_VERSION = "2.
|
|
444
|
+
const LWC_VERSION = "2.20.0";
|
|
474
445
|
const LWC_VERSION_COMMENT = `LWC compiler v${LWC_VERSION}`;
|
|
475
446
|
const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
476
447
|
|
|
@@ -512,7 +483,6 @@ exports.StringFromCharCode = StringFromCharCode;
|
|
|
512
483
|
exports.StringReplace = StringReplace;
|
|
513
484
|
exports.StringSlice = StringSlice;
|
|
514
485
|
exports.StringToLowerCase = StringToLowerCase;
|
|
515
|
-
exports.VOID_ELEMENTS = VOID_ELEMENTS;
|
|
516
486
|
exports.XLINK_NAMESPACE = XLINK_NAMESPACE;
|
|
517
487
|
exports.XML_NAMESPACE = XML_NAMESPACE;
|
|
518
488
|
exports.assert = assert;
|
|
@@ -551,4 +521,4 @@ exports.noop = noop;
|
|
|
551
521
|
exports.seal = seal;
|
|
552
522
|
exports.setPrototypeOf = setPrototypeOf;
|
|
553
523
|
exports.toString = toString;
|
|
554
|
-
/** version: 2.
|
|
524
|
+
/** version: 2.20.0 */
|
package/dist/index.js
CHANGED
|
@@ -240,62 +240,45 @@ const KEY__SHADOW_TOKEN_PRIVATE = '$$ShadowTokenKey$$';
|
|
|
240
240
|
const KEY__SYNTHETIC_MODE = '$$lwc-synthetic-mode';
|
|
241
241
|
const KEY__SCOPED_CSS = '$scoped$';
|
|
242
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
|
+
|
|
243
255
|
/*
|
|
244
256
|
* Copyright (c) 2020, salesforce.com, inc.
|
|
245
257
|
* All rights reserved.
|
|
246
258
|
* SPDX-License-Identifier: MIT
|
|
247
259
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
248
260
|
*/
|
|
249
|
-
//
|
|
250
|
-
//
|
|
251
|
-
|
|
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_SET = new Set([
|
|
252
266
|
'area',
|
|
253
267
|
'base',
|
|
254
268
|
'br',
|
|
255
|
-
'circle',
|
|
256
269
|
'col',
|
|
257
|
-
'ellipse',
|
|
258
|
-
'feBlend',
|
|
259
|
-
'feColorMatrix',
|
|
260
|
-
'feFuncR',
|
|
261
|
-
'feFuncG',
|
|
262
|
-
'feFuncB',
|
|
263
|
-
'feFuncA',
|
|
264
|
-
'feImage',
|
|
265
|
-
'feComposite',
|
|
266
|
-
'feConvolveMatrix',
|
|
267
|
-
'feDiffuseLighting',
|
|
268
|
-
'feDisplacementMap',
|
|
269
|
-
'feDropShadow',
|
|
270
|
-
'feFlood',
|
|
271
|
-
'feGaussianBlur',
|
|
272
|
-
'feMerge',
|
|
273
|
-
'feMergeNode',
|
|
274
|
-
'feMorphology',
|
|
275
|
-
'feOffset',
|
|
276
|
-
'feSpecularLighting',
|
|
277
|
-
'feTile',
|
|
278
|
-
'feTurbulence',
|
|
279
|
-
'fePointLight',
|
|
280
270
|
'embed',
|
|
281
271
|
'hr',
|
|
282
272
|
'img',
|
|
283
273
|
'input',
|
|
284
|
-
'keygen',
|
|
285
|
-
'line',
|
|
286
274
|
'link',
|
|
287
|
-
'menuitem',
|
|
288
275
|
'meta',
|
|
289
|
-
'param',
|
|
290
|
-
'path',
|
|
291
|
-
'rect',
|
|
292
276
|
'source',
|
|
293
277
|
'track',
|
|
294
278
|
'wbr',
|
|
295
|
-
];
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
return VOID_ELEMENTS_SET.has(name);
|
|
279
|
+
]);
|
|
280
|
+
function isVoidElement(name, namespace) {
|
|
281
|
+
return namespace === HTML_NAMESPACE && VOID_ELEMENTS_SET.has(name.toLowerCase());
|
|
299
282
|
}
|
|
300
283
|
|
|
301
284
|
/*
|
|
@@ -447,18 +430,6 @@ function htmlEscape(str, attrMode = false) {
|
|
|
447
430
|
// we can't use typeof since it will fail when transpiling.
|
|
448
431
|
const hasNativeSymbolSupport = /*@__PURE__*/ (() => Symbol('x').toString() === 'Symbol(x)')();
|
|
449
432
|
|
|
450
|
-
/*
|
|
451
|
-
* Copyright (c) 2022, 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
|
-
const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
|
|
457
|
-
const XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace';
|
|
458
|
-
const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
|
|
459
|
-
const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
|
|
460
|
-
const XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
|
|
461
|
-
|
|
462
433
|
/*
|
|
463
434
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
464
435
|
* All rights reserved.
|
|
@@ -466,9 +437,9 @@ const XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
|
|
|
466
437
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
467
438
|
*/
|
|
468
439
|
// Increment whenever the LWC template compiler changes
|
|
469
|
-
const LWC_VERSION = "2.
|
|
440
|
+
const LWC_VERSION = "2.20.0";
|
|
470
441
|
const LWC_VERSION_COMMENT = `LWC compiler v${LWC_VERSION}`;
|
|
471
442
|
const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
|
|
472
443
|
|
|
473
|
-
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,
|
|
474
|
-
/** version: 2.
|
|
444
|
+
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 };
|
|
445
|
+
/** version: 2.20.0 */
|
package/package.json
CHANGED
package/types/language.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare const assign: {
|
|
2
|
-
<T, U>(target: T, source: U): T & U;
|
|
3
|
-
<T_1, U_1, V>(target: T_1, source1: U_1, source2: V): T_1 & U_1 & V;
|
|
4
|
-
<T_2, U_2, V_1, W>(target: T_2, source1: U_2, source2: V_1, source3: W): T_2 & U_2 & V_1 & W;
|
|
2
|
+
<T extends {}, U>(target: T, source: U): T & U;
|
|
3
|
+
<T_1 extends {}, U_1, V>(target: T_1, source1: U_1, source2: V): T_1 & U_1 & V;
|
|
4
|
+
<T_2 extends {}, U_2, V_1, W>(target: T_2, source1: U_2, source2: V_1, source3: W): T_2 & U_2 & V_1 & W;
|
|
5
5
|
(target: object, ...sources: any[]): any;
|
|
6
6
|
}, create: {
|
|
7
7
|
(o: object | null): any;
|
|
@@ -9,7 +9,10 @@ declare const assign: {
|
|
|
9
9
|
}, defineProperties: <T>(o: T, properties: PropertyDescriptorMap & ThisType<any>) => T, defineProperty: <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T, freeze: {
|
|
10
10
|
<T>(a: T[]): readonly T[];
|
|
11
11
|
<T_1 extends Function>(f: T_1): T_1;
|
|
12
|
-
<T_2
|
|
12
|
+
<T_2 extends {
|
|
13
|
+
[idx: string]: object | U | null | undefined;
|
|
14
|
+
}, U extends string | number | bigint | boolean | symbol>(o: T_2): Readonly<T_2>;
|
|
15
|
+
<T_3>(o: T_3): Readonly<T_3>;
|
|
13
16
|
}, getOwnPropertyDescriptor: (o: any, p: PropertyKey) => PropertyDescriptor | undefined, getOwnPropertyNames: (o: any) => string[], getPrototypeOf: (o: any) => any, hasOwnProperty: (v: PropertyKey) => boolean, isFrozen: (o: any) => boolean, keys: {
|
|
14
17
|
(o: object): string[];
|
|
15
18
|
(o: {}): string[];
|
package/types/void-elements.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
export declare function isVoidElement(name: string): boolean;
|
|
1
|
+
export declare function isVoidElement(name: string, namespace: string): boolean;
|