@lwc/shared 2.23.0 → 2.23.3

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
@@ -266,7 +266,7 @@ const XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
266
266
  // e.g. `</tagName>` or `<tagName />`. For instance, `<meta>` closes on its own; no need for a slash.
267
267
  // These only come from HTML; there are no void elements in the SVG or MathML namespaces.
268
268
  // See: https://html.spec.whatwg.org/multipage/syntax.html#syntax-tags
269
- const VOID_ELEMENTS_SET = new Set([
269
+ const VOID_ELEMENTS = [
270
270
  'area',
271
271
  'base',
272
272
  'br',
@@ -280,7 +280,12 @@ const VOID_ELEMENTS_SET = new Set([
280
280
  'source',
281
281
  'track',
282
282
  'wbr',
283
- ]);
283
+ ];
284
+ // These elements have been deprecated but preserving their usage for backwards compatibility
285
+ // until we can officially deprecate them from LWC.
286
+ // See: https://html.spec.whatwg.org/multipage/obsolete.html#obsolete-but-conforming-features
287
+ const DEPRECATED_VOID_ELEMENTS = ['param', 'keygen', 'menuitem'];
288
+ const VOID_ELEMENTS_SET = new Set([...VOID_ELEMENTS, ...DEPRECATED_VOID_ELEMENTS]);
284
289
  function isVoidElement(name, namespace) {
285
290
  return namespace === HTML_NAMESPACE && VOID_ELEMENTS_SET.has(name.toLowerCase());
286
291
  }
@@ -329,24 +334,36 @@ function isBooleanAttribute(attrName, tagName) {
329
334
  return (allowedTagNames !== undefined &&
330
335
  (allowedTagNames.size === 0 || allowedTagNames.has(tagName)));
331
336
  }
337
+ // This list is based on https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes
332
338
  const GLOBAL_ATTRIBUTE = new Set([
333
- 'role',
334
339
  'accesskey',
340
+ 'autocapitalize',
341
+ 'autofocus',
335
342
  'class',
336
343
  'contenteditable',
337
344
  'contextmenu',
338
345
  'dir',
339
346
  'draggable',
340
- 'dropzone',
347
+ 'enterkeyhint',
348
+ 'exportparts',
341
349
  'hidden',
342
350
  'id',
351
+ 'inputmode',
352
+ 'is',
353
+ 'itemid',
343
354
  'itemprop',
355
+ 'itemref',
356
+ 'itemscope',
357
+ 'itemtype',
344
358
  'lang',
359
+ 'nonce',
360
+ 'part',
345
361
  'slot',
346
362
  'spellcheck',
347
363
  'style',
348
364
  'tabindex',
349
365
  'title',
366
+ 'translate',
350
367
  ]);
351
368
  function isGlobalHtmlAttribute(attrName) {
352
369
  return GLOBAL_ATTRIBUTE.has(attrName);
@@ -441,7 +458,7 @@ const hasNativeSymbolSupport = /*@__PURE__*/ (() => Symbol('x').toString() === '
441
458
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
442
459
  */
443
460
  // Increment whenever the LWC template compiler changes
444
- const LWC_VERSION = "2.23.0";
461
+ const LWC_VERSION = "2.23.3";
445
462
  const LWC_VERSION_COMMENT = `LWC compiler v${LWC_VERSION}`;
446
463
  const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
447
464
 
@@ -521,4 +538,4 @@ exports.noop = noop;
521
538
  exports.seal = seal;
522
539
  exports.setPrototypeOf = setPrototypeOf;
523
540
  exports.toString = toString;
524
- /** version: 2.23.0 */
541
+ /** version: 2.23.3 */
package/dist/index.js CHANGED
@@ -262,7 +262,7 @@ const XLINK_NAMESPACE = 'http://www.w3.org/1999/xlink';
262
262
  // e.g. `</tagName>` or `<tagName />`. For instance, `<meta>` closes on its own; no need for a slash.
263
263
  // These only come from HTML; there are no void elements in the SVG or MathML namespaces.
264
264
  // See: https://html.spec.whatwg.org/multipage/syntax.html#syntax-tags
265
- const VOID_ELEMENTS_SET = new Set([
265
+ const VOID_ELEMENTS = [
266
266
  'area',
267
267
  'base',
268
268
  'br',
@@ -276,7 +276,12 @@ const VOID_ELEMENTS_SET = new Set([
276
276
  'source',
277
277
  'track',
278
278
  'wbr',
279
- ]);
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]);
280
285
  function isVoidElement(name, namespace) {
281
286
  return namespace === HTML_NAMESPACE && VOID_ELEMENTS_SET.has(name.toLowerCase());
282
287
  }
@@ -325,24 +330,36 @@ function isBooleanAttribute(attrName, tagName) {
325
330
  return (allowedTagNames !== undefined &&
326
331
  (allowedTagNames.size === 0 || allowedTagNames.has(tagName)));
327
332
  }
333
+ // This list is based on https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes
328
334
  const GLOBAL_ATTRIBUTE = new Set([
329
- 'role',
330
335
  'accesskey',
336
+ 'autocapitalize',
337
+ 'autofocus',
331
338
  'class',
332
339
  'contenteditable',
333
340
  'contextmenu',
334
341
  'dir',
335
342
  'draggable',
336
- 'dropzone',
343
+ 'enterkeyhint',
344
+ 'exportparts',
337
345
  'hidden',
338
346
  'id',
347
+ 'inputmode',
348
+ 'is',
349
+ 'itemid',
339
350
  'itemprop',
351
+ 'itemref',
352
+ 'itemscope',
353
+ 'itemtype',
340
354
  'lang',
355
+ 'nonce',
356
+ 'part',
341
357
  'slot',
342
358
  'spellcheck',
343
359
  'style',
344
360
  'tabindex',
345
361
  'title',
362
+ 'translate',
346
363
  ]);
347
364
  function isGlobalHtmlAttribute(attrName) {
348
365
  return GLOBAL_ATTRIBUTE.has(attrName);
@@ -437,9 +454,9 @@ const hasNativeSymbolSupport = /*@__PURE__*/ (() => Symbol('x').toString() === '
437
454
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
438
455
  */
439
456
  // Increment whenever the LWC template compiler changes
440
- const LWC_VERSION = "2.23.0";
457
+ const LWC_VERSION = "2.23.3";
441
458
  const LWC_VERSION_COMMENT = `LWC compiler v${LWC_VERSION}`;
442
459
  const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
443
460
 
444
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 };
445
- /** version: 2.23.0 */
462
+ /** version: 2.23.3 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lwc/shared",
3
- "version": "2.23.0",
3
+ "version": "2.23.3",
4
4
  "description": "Utilities and methods that are shared across packages",
5
5
  "homepage": "https://lwc.dev/",
6
6
  "repository": {
@@ -18,8 +18,7 @@
18
18
  "scripts": {
19
19
  "build": "rollup --config ./scripts/rollup/rollup.config.js",
20
20
  "postbuild": "node ../../../scripts/tasks/verify-treeshakable.js ./dist/index.js",
21
- "dev": "rollup --config scripts/rollup/rollup.config.js --watch --no-watch.clearScreen",
22
- "clean": "rm -rf dist/ types/"
21
+ "dev": "rollup --config scripts/rollup/rollup.config.js --watch --no-watch.clearScreen"
23
22
  },
24
23
  "files": [
25
24
  "dist/",
@@ -27,5 +26,15 @@
27
26
  ],
28
27
  "publishConfig": {
29
28
  "access": "public"
29
+ },
30
+ "nx": {
31
+ "targets": {
32
+ "build": {
33
+ "outputs": [
34
+ "./dist",
35
+ "./types"
36
+ ]
37
+ }
38
+ }
30
39
  }
31
- }
40
+ }