@wordpress/element 6.30.0 → 6.30.1-next.6870dfe5b.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.
Files changed (55) hide show
  1. package/README.md +10 -14
  2. package/build/create-interpolate-element.js +28 -53
  3. package/build/create-interpolate-element.js.map +1 -1
  4. package/build/index.js.map +1 -1
  5. package/build/platform.js +21 -5
  6. package/build/platform.js.map +1 -1
  7. package/build/raw-html.js +4 -2
  8. package/build/raw-html.js.map +1 -1
  9. package/build/react-platform.js.map +1 -1
  10. package/build/react.js +9 -22
  11. package/build/react.js.map +1 -1
  12. package/build/serialize.js +36 -89
  13. package/build/serialize.js.map +1 -1
  14. package/build/utils.js +2 -2
  15. package/build/utils.js.map +1 -1
  16. package/build-module/create-interpolate-element.js +28 -54
  17. package/build-module/create-interpolate-element.js.map +1 -1
  18. package/build-module/index.js.map +1 -1
  19. package/build-module/platform.js +21 -5
  20. package/build-module/platform.js.map +1 -1
  21. package/build-module/raw-html.js +4 -2
  22. package/build-module/raw-html.js.map +1 -1
  23. package/build-module/react-platform.js.map +1 -1
  24. package/build-module/react.js +9 -22
  25. package/build-module/react.js.map +1 -1
  26. package/build-module/serialize.js +36 -89
  27. package/build-module/serialize.js.map +1 -1
  28. package/build-module/utils.js +2 -2
  29. package/build-module/utils.js.map +1 -1
  30. package/build-types/create-interpolate-element.d.ts +8 -42
  31. package/build-types/create-interpolate-element.d.ts.map +1 -1
  32. package/build-types/index.d.ts +7 -7
  33. package/build-types/index.d.ts.map +1 -1
  34. package/build-types/platform.d.ts +48 -5
  35. package/build-types/platform.d.ts.map +1 -1
  36. package/build-types/raw-html.d.ts +7 -5
  37. package/build-types/raw-html.d.ts.map +1 -1
  38. package/build-types/react-platform.d.ts +62 -9
  39. package/build-types/react-platform.d.ts.map +1 -1
  40. package/build-types/react.d.ts +185 -58
  41. package/build-types/react.d.ts.map +1 -1
  42. package/build-types/serialize.d.ts +61 -43
  43. package/build-types/serialize.d.ts.map +1 -1
  44. package/build-types/utils.d.ts +7 -1
  45. package/build-types/utils.d.ts.map +1 -1
  46. package/package.json +3 -3
  47. package/src/{create-interpolate-element.js → create-interpolate-element.ts} +95 -64
  48. package/src/{platform.js → platform.ts} +27 -4
  49. package/src/{raw-html.js → raw-html.ts} +11 -3
  50. package/src/{react.js → react.ts} +40 -37
  51. package/src/{serialize.js → serialize.ts} +131 -144
  52. package/src/{utils.js → utils.ts} +4 -4
  53. package/tsconfig.tsbuildinfo +1 -1
  54. /package/src/{index.js → index.ts} +0 -0
  55. /package/src/{react-platform.js → react-platform.ts} +0 -0
@@ -69,15 +69,11 @@ const ForwardRef = (0, _react.forwardRef)(() => {
69
69
 
70
70
  /**
71
71
  * Valid attribute types.
72
- *
73
- * @type {Set<string>}
74
72
  */
75
73
  const ATTRIBUTES_TYPES = new Set(['string', 'boolean', 'number']);
76
74
 
77
75
  /**
78
76
  * Element tags which can be self-closing.
79
- *
80
- * @type {Set<string>}
81
77
  */
82
78
  const SELF_CLOSING_TAGS = new Set(['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr']);
83
79
 
@@ -93,8 +89,6 @@ const SELF_CLOSING_TAGS = new Set(['area', 'base', 'br', 'col', 'command', 'embe
93
89
  * .reduce( ( result, tr ) => Object.assign( result, {
94
90
  * [ tr.firstChild.textContent.trim() ]: true
95
91
  * } ), {} ) ).sort();
96
- *
97
- * @type {Set<string>}
98
92
  */
99
93
  const BOOLEAN_ATTRIBUTES = new Set(['allowfullscreen', 'allowpaymentrequest', 'allowusermedia', 'async', 'autofocus', 'autoplay', 'checked', 'controls', 'default', 'defer', 'disabled', 'download', 'formnovalidate', 'hidden', 'ismap', 'itemscope', 'loop', 'multiple', 'muted', 'nomodule', 'novalidate', 'open', 'playsinline', 'readonly', 'required', 'reversed', 'selected', 'typemustmatch']);
100
94
 
@@ -115,8 +109,6 @@ const BOOLEAN_ATTRIBUTES = new Set(['allowfullscreen', 'allowpaymentrequest', 'a
115
109
  * Some notable omissions:
116
110
  *
117
111
  * - `alt`: https://blog.whatwg.org/omit-alt
118
- *
119
- * @type {Set<string>}
120
112
  */
121
113
  const ENUMERATED_ATTRIBUTES = new Set(['autocapitalize', 'autocomplete', 'charset', 'contenteditable', 'crossorigin', 'decoding', 'dir', 'draggable', 'enctype', 'formenctype', 'formmethod', 'http-equiv', 'inputmode', 'kind', 'method', 'preload', 'scope', 'shape', 'spellcheck', 'translate', 'type', 'wrap']);
122
114
 
@@ -135,19 +127,14 @@ const ENUMERATED_ATTRIBUTES = new Set(['autocapitalize', 'autocomplete', 'charse
135
127
  * ) )
136
128
  * .map( ( [ key ] ) => key )
137
129
  * .sort();
138
- *
139
- * @type {Set<string>}
140
130
  */
141
131
  const CSS_PROPERTIES_SUPPORTS_UNITLESS = new Set(['animation', 'animationIterationCount', 'baselineShift', 'borderImageOutset', 'borderImageSlice', 'borderImageWidth', 'columnCount', 'cx', 'cy', 'fillOpacity', 'flexGrow', 'flexShrink', 'floodOpacity', 'fontWeight', 'gridColumnEnd', 'gridColumnStart', 'gridRowEnd', 'gridRowStart', 'lineHeight', 'opacity', 'order', 'orphans', 'r', 'rx', 'ry', 'shapeImageThreshold', 'stopOpacity', 'strokeDasharray', 'strokeDashoffset', 'strokeMiterlimit', 'strokeOpacity', 'strokeWidth', 'tabSize', 'widows', 'x', 'y', 'zIndex', 'zoom']);
142
132
 
143
133
  /**
144
134
  * Returns true if the specified string is prefixed by one of an array of
145
135
  * possible prefixes.
146
- *
147
- * @param {string} string String to check.
148
- * @param {string[]} prefixes Possible prefixes.
149
- *
150
- * @return {boolean} Whether string has prefix.
136
+ * @param string
137
+ * @param prefixes
151
138
  */
152
139
  function hasPrefix(string, prefixes) {
153
140
  return prefixes.some(prefix => string.indexOf(prefix) === 0);
@@ -156,10 +143,7 @@ function hasPrefix(string, prefixes) {
156
143
  /**
157
144
  * Returns true if the given prop name should be ignored in attributes
158
145
  * serialization, or false otherwise.
159
- *
160
- * @param {string} attribute Attribute to check.
161
- *
162
- * @return {boolean} Whether attribute should be ignored.
146
+ * @param attribute
163
147
  */
164
148
  function isInternalAttribute(attribute) {
165
149
  return 'key' === attribute || 'children' === attribute;
@@ -167,11 +151,8 @@ function isInternalAttribute(attribute) {
167
151
 
168
152
  /**
169
153
  * Returns the normal form of the element's attribute value for HTML.
170
- *
171
- * @param {string} attribute Attribute name.
172
- * @param {*} value Non-normalized attribute value.
173
- *
174
- * @return {*} Normalized attribute value.
154
+ * @param attribute
155
+ * @param value
175
156
  */
176
157
  function getNormalAttributeValue(attribute, value) {
177
158
  switch (attribute) {
@@ -180,6 +161,7 @@ function getNormalAttributeValue(attribute, value) {
180
161
  }
181
162
  return value;
182
163
  }
164
+
183
165
  /**
184
166
  * This is a map of all SVG attributes that have dashes. Map(lower case prop => dashed lower case attribute).
185
167
  * We need this to render e.g strokeWidth as stroke-width.
@@ -215,10 +197,7 @@ const SVG_ATTRIBUTES_WITH_COLONS = ['xlink:actuate', 'xlink:arcrole', 'xlink:hre
215
197
 
216
198
  /**
217
199
  * Returns the normal form of the element's attribute name for HTML.
218
- *
219
- * @param {string} attribute Non-normalized attribute name.
220
- *
221
- * @return {string} Normalized attribute name.
200
+ * @param attribute
222
201
  */
223
202
  function getNormalAttributeName(attribute) {
224
203
  switch (attribute) {
@@ -244,10 +223,7 @@ function getNormalAttributeName(attribute) {
244
223
  * - Converts property names to kebab-case, e.g. 'backgroundColor' → 'background-color'
245
224
  * - Leaves custom attributes alone, e.g. '--myBackgroundColor' → '--myBackgroundColor'
246
225
  * - Converts vendor-prefixed property names to -kebab-case, e.g. 'MozTransform' → '-moz-transform'
247
- *
248
- * @param {string} property Property name.
249
- *
250
- * @return {string} Normalized property name.
226
+ * @param property
251
227
  */
252
228
  function getNormalStylePropertyName(property) {
253
229
  if (property.startsWith('--')) {
@@ -262,11 +238,8 @@ function getNormalStylePropertyName(property) {
262
238
  /**
263
239
  * Returns the normal form of the style property value for HTML. Appends a
264
240
  * default pixel unit if numeric, not a unitless property, and not zero.
265
- *
266
- * @param {string} property Property name.
267
- * @param {*} value Non-normalized property value.
268
- *
269
- * @return {*} Normalized property value.
241
+ * @param property
242
+ * @param value
270
243
  */
271
244
  function getNormalStylePropertyValue(property, value) {
272
245
  if (typeof value === 'number' && 0 !== value && !hasPrefix(property, ['--']) && !CSS_PROPERTIES_SUPPORTS_UNITLESS.has(property)) {
@@ -277,12 +250,9 @@ function getNormalStylePropertyValue(property, value) {
277
250
 
278
251
  /**
279
252
  * Serializes a React element to string.
280
- *
281
- * @param {import('react').ReactNode} element Element to serialize.
282
- * @param {Object} [context] Context object.
283
- * @param {Object} [legacyContext] Legacy context object.
284
- *
285
- * @return {string} Serialized element.
253
+ * @param element
254
+ * @param context
255
+ * @param legacyContext
286
256
  */
287
257
  function renderElement(element, context, legacyContext = {}) {
288
258
  if (null === element || undefined === element || false === element) {
@@ -300,8 +270,7 @@ function renderElement(element, context, legacyContext = {}) {
300
270
  const {
301
271
  type,
302
272
  props
303
- } = /** @type {{type?: any, props?: any}} */
304
- element;
273
+ } = element;
305
274
  switch (type) {
306
275
  case _react.StrictMode:
307
276
  case _react.Fragment:
@@ -340,14 +309,10 @@ function renderElement(element, context, legacyContext = {}) {
340
309
 
341
310
  /**
342
311
  * Serializes a native component type to string.
343
- *
344
- * @param {?string} type Native component type to serialize, or null if
345
- * rendering as fragment of children content.
346
- * @param {Object} props Props object.
347
- * @param {Object} [context] Context object.
348
- * @param {Object} [legacyContext] Legacy context object.
349
- *
350
- * @return {string} Serialized element.
312
+ * @param type
313
+ * @param props
314
+ * @param context
315
+ * @param legacyContext
351
316
  */
352
317
  function renderNativeComponent(type, props, context, legacyContext = {}) {
353
318
  let content = '';
@@ -377,27 +342,17 @@ function renderNativeComponent(type, props, context, legacyContext = {}) {
377
342
  return '<' + type + attributes + '>' + content + '</' + type + '>';
378
343
  }
379
344
 
380
- /** @typedef {import('react').ComponentType} ComponentType */
381
-
382
345
  /**
383
346
  * Serializes a non-native component type to string.
384
- *
385
- * @param {ComponentType} Component Component type to serialize.
386
- * @param {Object} props Props object.
387
- * @param {Object} [context] Context object.
388
- * @param {Object} [legacyContext] Legacy context object.
389
- *
390
- * @return {string} Serialized element
347
+ * @param Component
348
+ * @param props
349
+ * @param context
350
+ * @param legacyContext
391
351
  */
392
352
  function renderComponent(Component, props, context, legacyContext = {}) {
393
- const instance = new (/** @type {import('react').ComponentClass} */
394
- Component)(props, legacyContext);
395
- if (typeof
396
- // Ignore reason: Current prettier reformats parens and mangles type assertion
397
- // prettier-ignore
398
- /** @type {{getChildContext?: () => unknown}} */
399
- instance.getChildContext === 'function') {
400
- Object.assign(legacyContext, /** @type {{getChildContext?: () => unknown}} */instance.getChildContext());
353
+ const instance = new Component(props, legacyContext);
354
+ if (typeof instance.getChildContext === 'function') {
355
+ Object.assign(legacyContext, instance.getChildContext());
401
356
  }
402
357
  const html = renderElement(instance.render(), context, legacyContext);
403
358
  return html;
@@ -405,18 +360,15 @@ function renderComponent(Component, props, context, legacyContext = {}) {
405
360
 
406
361
  /**
407
362
  * Serializes an array of children to string.
408
- *
409
- * @param {ReadonlyArray<import('react').ReactNode>} children Children to serialize.
410
- * @param {Object} [context] Context object.
411
- * @param {Object} [legacyContext] Legacy context object.
412
- *
413
- * @return {string} Serialized children.
363
+ * @param children
364
+ * @param context
365
+ * @param legacyContext
414
366
  */
415
367
  function renderChildren(children, context, legacyContext = {}) {
416
368
  let result = '';
417
- children = Array.isArray(children) ? children : [children];
418
- for (let i = 0; i < children.length; i++) {
419
- const child = children[i];
369
+ const childrenArray = Array.isArray(children) ? children : [children];
370
+ for (let i = 0; i < childrenArray.length; i++) {
371
+ const child = childrenArray[i];
420
372
  result += renderElement(child, context, legacyContext);
421
373
  }
422
374
  return result;
@@ -424,10 +376,7 @@ function renderChildren(children, context, legacyContext = {}) {
424
376
 
425
377
  /**
426
378
  * Renders a props object as a string of HTML attributes.
427
- *
428
- * @param {Object} props Props object.
429
- *
430
- * @return {string} Attributes string.
379
+ * @param props
431
380
  */
432
381
  function renderAttributes(props) {
433
382
  let result = '';
@@ -476,10 +425,7 @@ function renderAttributes(props) {
476
425
 
477
426
  /**
478
427
  * Renders a style object as a string attribute value.
479
- *
480
- * @param {Object} style Style object.
481
- *
482
- * @return {string} Style attribute value.
428
+ * @param style
483
429
  */
484
430
  function renderStyle(style) {
485
431
  // Only generate from object, e.g. tolerate string value.
@@ -487,8 +433,9 @@ function renderStyle(style) {
487
433
  return style;
488
434
  }
489
435
  let result;
490
- for (const property in style) {
491
- const value = style[property];
436
+ const styleObj = style;
437
+ for (const property in styleObj) {
438
+ const value = styleObj[property];
492
439
  if (null === value || undefined === value) {
493
440
  continue;
494
441
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_isPlainObject","require","_changeCase","_escapeHtml","_react","_rawHtml","_interopRequireDefault","Context","createContext","undefined","displayName","Provider","Consumer","ForwardRef","forwardRef","ATTRIBUTES_TYPES","Set","SELF_CLOSING_TAGS","BOOLEAN_ATTRIBUTES","ENUMERATED_ATTRIBUTES","CSS_PROPERTIES_SUPPORTS_UNITLESS","hasPrefix","string","prefixes","some","prefix","indexOf","isInternalAttribute","attribute","getNormalAttributeValue","value","renderStyle","SVG_ATTRIBUTE_WITH_DASHES_LIST","reduce","map","toLowerCase","CASE_SENSITIVE_SVG_ATTRIBUTES","SVG_ATTRIBUTES_WITH_COLONS","replace","getNormalAttributeName","attributeLowerCase","kebabCase","getNormalStylePropertyName","property","startsWith","getNormalStylePropertyValue","has","renderElement","element","context","legacyContext","Array","isArray","renderChildren","escapeHTML","toString","type","props","StrictMode","Fragment","children","RawHTML","wrapperProps","renderNativeComponent","Object","keys","length","dangerouslySetInnerHTML","__html","prototype","render","renderComponent","$$typeof","_currentValue","content","hasOwnProperty","restProps","attributes","renderAttributes","Component","instance","getChildContext","assign","html","result","i","child","key","isValidAttributeName","isBooleanAttribute","isMeaningfulAttribute","escapeAttribute","style","isPlainObject","normalName","normalValue","_default","exports","default"],"sources":["@wordpress/element/src/serialize.js"],"sourcesContent":["/**\n * Parts of this source were derived and modified from fast-react-render,\n * released under the MIT license.\n *\n * https://github.com/alt-j/fast-react-render\n *\n * Copyright (c) 2016 Andrey Morozov\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * External dependencies\n */\nimport { isPlainObject } from 'is-plain-object';\nimport { paramCase as kebabCase } from 'change-case';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tescapeHTML,\n\tescapeAttribute,\n\tisValidAttributeName,\n} from '@wordpress/escape-html';\n\n/**\n * Internal dependencies\n */\nimport { createContext, Fragment, StrictMode, forwardRef } from './react';\nimport RawHTML from './raw-html';\n\n/** @typedef {import('react').ReactElement} ReactElement */\n\nconst Context = createContext( undefined );\nContext.displayName = 'ElementContext';\n\nconst { Provider, Consumer } = Context;\n\nconst ForwardRef = forwardRef( () => {\n\treturn null;\n} );\n\n/**\n * Valid attribute types.\n *\n * @type {Set<string>}\n */\nconst ATTRIBUTES_TYPES = new Set( [ 'string', 'boolean', 'number' ] );\n\n/**\n * Element tags which can be self-closing.\n *\n * @type {Set<string>}\n */\nconst SELF_CLOSING_TAGS = new Set( [\n\t'area',\n\t'base',\n\t'br',\n\t'col',\n\t'command',\n\t'embed',\n\t'hr',\n\t'img',\n\t'input',\n\t'keygen',\n\t'link',\n\t'meta',\n\t'param',\n\t'source',\n\t'track',\n\t'wbr',\n] );\n\n/**\n * Boolean attributes are attributes whose presence as being assigned is\n * meaningful, even if only empty.\n *\n * See: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attributes\n * Extracted from: https://html.spec.whatwg.org/multipage/indices.html#attributes-3\n *\n * Object.keys( [ ...document.querySelectorAll( '#attributes-1 > tbody > tr' ) ]\n * .filter( ( tr ) => tr.lastChild.textContent.indexOf( 'Boolean attribute' ) !== -1 )\n * .reduce( ( result, tr ) => Object.assign( result, {\n * [ tr.firstChild.textContent.trim() ]: true\n * } ), {} ) ).sort();\n *\n * @type {Set<string>}\n */\nconst BOOLEAN_ATTRIBUTES = new Set( [\n\t'allowfullscreen',\n\t'allowpaymentrequest',\n\t'allowusermedia',\n\t'async',\n\t'autofocus',\n\t'autoplay',\n\t'checked',\n\t'controls',\n\t'default',\n\t'defer',\n\t'disabled',\n\t'download',\n\t'formnovalidate',\n\t'hidden',\n\t'ismap',\n\t'itemscope',\n\t'loop',\n\t'multiple',\n\t'muted',\n\t'nomodule',\n\t'novalidate',\n\t'open',\n\t'playsinline',\n\t'readonly',\n\t'required',\n\t'reversed',\n\t'selected',\n\t'typemustmatch',\n] );\n\n/**\n * Enumerated attributes are attributes which must be of a specific value form.\n * Like boolean attributes, these are meaningful if specified, even if not of a\n * valid enumerated value.\n *\n * See: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#enumerated-attribute\n * Extracted from: https://html.spec.whatwg.org/multipage/indices.html#attributes-3\n *\n * Object.keys( [ ...document.querySelectorAll( '#attributes-1 > tbody > tr' ) ]\n * .filter( ( tr ) => /^(\"(.+?)\";?\\s*)+/.test( tr.lastChild.textContent.trim() ) )\n * .reduce( ( result, tr ) => Object.assign( result, {\n * [ tr.firstChild.textContent.trim() ]: true\n * } ), {} ) ).sort();\n *\n * Some notable omissions:\n *\n * - `alt`: https://blog.whatwg.org/omit-alt\n *\n * @type {Set<string>}\n */\nconst ENUMERATED_ATTRIBUTES = new Set( [\n\t'autocapitalize',\n\t'autocomplete',\n\t'charset',\n\t'contenteditable',\n\t'crossorigin',\n\t'decoding',\n\t'dir',\n\t'draggable',\n\t'enctype',\n\t'formenctype',\n\t'formmethod',\n\t'http-equiv',\n\t'inputmode',\n\t'kind',\n\t'method',\n\t'preload',\n\t'scope',\n\t'shape',\n\t'spellcheck',\n\t'translate',\n\t'type',\n\t'wrap',\n] );\n\n/**\n * Set of CSS style properties which support assignment of unitless numbers.\n * Used in rendering of style properties, where `px` unit is assumed unless\n * property is included in this set or value is zero.\n *\n * Generated via:\n *\n * Object.entries( document.createElement( 'div' ).style )\n * .filter( ( [ key ] ) => (\n * ! /^(webkit|ms|moz)/.test( key ) &&\n * ( e.style[ key ] = 10 ) &&\n * e.style[ key ] === '10'\n * ) )\n * .map( ( [ key ] ) => key )\n * .sort();\n *\n * @type {Set<string>}\n */\nconst CSS_PROPERTIES_SUPPORTS_UNITLESS = new Set( [\n\t'animation',\n\t'animationIterationCount',\n\t'baselineShift',\n\t'borderImageOutset',\n\t'borderImageSlice',\n\t'borderImageWidth',\n\t'columnCount',\n\t'cx',\n\t'cy',\n\t'fillOpacity',\n\t'flexGrow',\n\t'flexShrink',\n\t'floodOpacity',\n\t'fontWeight',\n\t'gridColumnEnd',\n\t'gridColumnStart',\n\t'gridRowEnd',\n\t'gridRowStart',\n\t'lineHeight',\n\t'opacity',\n\t'order',\n\t'orphans',\n\t'r',\n\t'rx',\n\t'ry',\n\t'shapeImageThreshold',\n\t'stopOpacity',\n\t'strokeDasharray',\n\t'strokeDashoffset',\n\t'strokeMiterlimit',\n\t'strokeOpacity',\n\t'strokeWidth',\n\t'tabSize',\n\t'widows',\n\t'x',\n\t'y',\n\t'zIndex',\n\t'zoom',\n] );\n\n/**\n * Returns true if the specified string is prefixed by one of an array of\n * possible prefixes.\n *\n * @param {string} string String to check.\n * @param {string[]} prefixes Possible prefixes.\n *\n * @return {boolean} Whether string has prefix.\n */\nexport function hasPrefix( string, prefixes ) {\n\treturn prefixes.some( ( prefix ) => string.indexOf( prefix ) === 0 );\n}\n\n/**\n * Returns true if the given prop name should be ignored in attributes\n * serialization, or false otherwise.\n *\n * @param {string} attribute Attribute to check.\n *\n * @return {boolean} Whether attribute should be ignored.\n */\nfunction isInternalAttribute( attribute ) {\n\treturn 'key' === attribute || 'children' === attribute;\n}\n\n/**\n * Returns the normal form of the element's attribute value for HTML.\n *\n * @param {string} attribute Attribute name.\n * @param {*} value Non-normalized attribute value.\n *\n * @return {*} Normalized attribute value.\n */\nfunction getNormalAttributeValue( attribute, value ) {\n\tswitch ( attribute ) {\n\t\tcase 'style':\n\t\t\treturn renderStyle( value );\n\t}\n\n\treturn value;\n}\n/**\n * This is a map of all SVG attributes that have dashes. Map(lower case prop => dashed lower case attribute).\n * We need this to render e.g strokeWidth as stroke-width.\n *\n * List from: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute.\n */\nconst SVG_ATTRIBUTE_WITH_DASHES_LIST = [\n\t'accentHeight',\n\t'alignmentBaseline',\n\t'arabicForm',\n\t'baselineShift',\n\t'capHeight',\n\t'clipPath',\n\t'clipRule',\n\t'colorInterpolation',\n\t'colorInterpolationFilters',\n\t'colorProfile',\n\t'colorRendering',\n\t'dominantBaseline',\n\t'enableBackground',\n\t'fillOpacity',\n\t'fillRule',\n\t'floodColor',\n\t'floodOpacity',\n\t'fontFamily',\n\t'fontSize',\n\t'fontSizeAdjust',\n\t'fontStretch',\n\t'fontStyle',\n\t'fontVariant',\n\t'fontWeight',\n\t'glyphName',\n\t'glyphOrientationHorizontal',\n\t'glyphOrientationVertical',\n\t'horizAdvX',\n\t'horizOriginX',\n\t'imageRendering',\n\t'letterSpacing',\n\t'lightingColor',\n\t'markerEnd',\n\t'markerMid',\n\t'markerStart',\n\t'overlinePosition',\n\t'overlineThickness',\n\t'paintOrder',\n\t'panose1',\n\t'pointerEvents',\n\t'renderingIntent',\n\t'shapeRendering',\n\t'stopColor',\n\t'stopOpacity',\n\t'strikethroughPosition',\n\t'strikethroughThickness',\n\t'strokeDasharray',\n\t'strokeDashoffset',\n\t'strokeLinecap',\n\t'strokeLinejoin',\n\t'strokeMiterlimit',\n\t'strokeOpacity',\n\t'strokeWidth',\n\t'textAnchor',\n\t'textDecoration',\n\t'textRendering',\n\t'underlinePosition',\n\t'underlineThickness',\n\t'unicodeBidi',\n\t'unicodeRange',\n\t'unitsPerEm',\n\t'vAlphabetic',\n\t'vHanging',\n\t'vIdeographic',\n\t'vMathematical',\n\t'vectorEffect',\n\t'vertAdvY',\n\t'vertOriginX',\n\t'vertOriginY',\n\t'wordSpacing',\n\t'writingMode',\n\t'xmlnsXlink',\n\t'xHeight',\n].reduce( ( map, attribute ) => {\n\t// The keys are lower-cased for more robust lookup.\n\tmap[ attribute.toLowerCase() ] = attribute;\n\treturn map;\n}, {} );\n\n/**\n * This is a map of all case-sensitive SVG attributes. Map(lowercase key => proper case attribute).\n * The keys are lower-cased for more robust lookup.\n * Note that this list only contains attributes that contain at least one capital letter.\n * Lowercase attributes don't need mapping, since we lowercase all attributes by default.\n */\nconst CASE_SENSITIVE_SVG_ATTRIBUTES = [\n\t'allowReorder',\n\t'attributeName',\n\t'attributeType',\n\t'autoReverse',\n\t'baseFrequency',\n\t'baseProfile',\n\t'calcMode',\n\t'clipPathUnits',\n\t'contentScriptType',\n\t'contentStyleType',\n\t'diffuseConstant',\n\t'edgeMode',\n\t'externalResourcesRequired',\n\t'filterRes',\n\t'filterUnits',\n\t'glyphRef',\n\t'gradientTransform',\n\t'gradientUnits',\n\t'kernelMatrix',\n\t'kernelUnitLength',\n\t'keyPoints',\n\t'keySplines',\n\t'keyTimes',\n\t'lengthAdjust',\n\t'limitingConeAngle',\n\t'markerHeight',\n\t'markerUnits',\n\t'markerWidth',\n\t'maskContentUnits',\n\t'maskUnits',\n\t'numOctaves',\n\t'pathLength',\n\t'patternContentUnits',\n\t'patternTransform',\n\t'patternUnits',\n\t'pointsAtX',\n\t'pointsAtY',\n\t'pointsAtZ',\n\t'preserveAlpha',\n\t'preserveAspectRatio',\n\t'primitiveUnits',\n\t'refX',\n\t'refY',\n\t'repeatCount',\n\t'repeatDur',\n\t'requiredExtensions',\n\t'requiredFeatures',\n\t'specularConstant',\n\t'specularExponent',\n\t'spreadMethod',\n\t'startOffset',\n\t'stdDeviation',\n\t'stitchTiles',\n\t'suppressContentEditableWarning',\n\t'suppressHydrationWarning',\n\t'surfaceScale',\n\t'systemLanguage',\n\t'tableValues',\n\t'targetX',\n\t'targetY',\n\t'textLength',\n\t'viewBox',\n\t'viewTarget',\n\t'xChannelSelector',\n\t'yChannelSelector',\n].reduce( ( map, attribute ) => {\n\t// The keys are lower-cased for more robust lookup.\n\tmap[ attribute.toLowerCase() ] = attribute;\n\treturn map;\n}, {} );\n\n/**\n * This is a map of all SVG attributes that have colons.\n * Keys are lower-cased and stripped of their colons for more robust lookup.\n */\nconst SVG_ATTRIBUTES_WITH_COLONS = [\n\t'xlink:actuate',\n\t'xlink:arcrole',\n\t'xlink:href',\n\t'xlink:role',\n\t'xlink:show',\n\t'xlink:title',\n\t'xlink:type',\n\t'xml:base',\n\t'xml:lang',\n\t'xml:space',\n\t'xmlns:xlink',\n].reduce( ( map, attribute ) => {\n\tmap[ attribute.replace( ':', '' ).toLowerCase() ] = attribute;\n\treturn map;\n}, {} );\n\n/**\n * Returns the normal form of the element's attribute name for HTML.\n *\n * @param {string} attribute Non-normalized attribute name.\n *\n * @return {string} Normalized attribute name.\n */\nfunction getNormalAttributeName( attribute ) {\n\tswitch ( attribute ) {\n\t\tcase 'htmlFor':\n\t\t\treturn 'for';\n\n\t\tcase 'className':\n\t\t\treturn 'class';\n\t}\n\tconst attributeLowerCase = attribute.toLowerCase();\n\n\tif ( CASE_SENSITIVE_SVG_ATTRIBUTES[ attributeLowerCase ] ) {\n\t\treturn CASE_SENSITIVE_SVG_ATTRIBUTES[ attributeLowerCase ];\n\t} else if ( SVG_ATTRIBUTE_WITH_DASHES_LIST[ attributeLowerCase ] ) {\n\t\treturn kebabCase(\n\t\t\tSVG_ATTRIBUTE_WITH_DASHES_LIST[ attributeLowerCase ]\n\t\t);\n\t} else if ( SVG_ATTRIBUTES_WITH_COLONS[ attributeLowerCase ] ) {\n\t\treturn SVG_ATTRIBUTES_WITH_COLONS[ attributeLowerCase ];\n\t}\n\n\treturn attributeLowerCase;\n}\n\n/**\n * Returns the normal form of the style property name for HTML.\n *\n * - Converts property names to kebab-case, e.g. 'backgroundColor' → 'background-color'\n * - Leaves custom attributes alone, e.g. '--myBackgroundColor' → '--myBackgroundColor'\n * - Converts vendor-prefixed property names to -kebab-case, e.g. 'MozTransform' → '-moz-transform'\n *\n * @param {string} property Property name.\n *\n * @return {string} Normalized property name.\n */\nfunction getNormalStylePropertyName( property ) {\n\tif ( property.startsWith( '--' ) ) {\n\t\treturn property;\n\t}\n\n\tif ( hasPrefix( property, [ 'ms', 'O', 'Moz', 'Webkit' ] ) ) {\n\t\treturn '-' + kebabCase( property );\n\t}\n\n\treturn kebabCase( property );\n}\n\n/**\n * Returns the normal form of the style property value for HTML. Appends a\n * default pixel unit if numeric, not a unitless property, and not zero.\n *\n * @param {string} property Property name.\n * @param {*} value Non-normalized property value.\n *\n * @return {*} Normalized property value.\n */\nfunction getNormalStylePropertyValue( property, value ) {\n\tif (\n\t\ttypeof value === 'number' &&\n\t\t0 !== value &&\n\t\t! hasPrefix( property, [ '--' ] ) &&\n\t\t! CSS_PROPERTIES_SUPPORTS_UNITLESS.has( property )\n\t) {\n\t\treturn value + 'px';\n\t}\n\n\treturn value;\n}\n\n/**\n * Serializes a React element to string.\n *\n * @param {import('react').ReactNode} element Element to serialize.\n * @param {Object} [context] Context object.\n * @param {Object} [legacyContext] Legacy context object.\n *\n * @return {string} Serialized element.\n */\nexport function renderElement( element, context, legacyContext = {} ) {\n\tif ( null === element || undefined === element || false === element ) {\n\t\treturn '';\n\t}\n\n\tif ( Array.isArray( element ) ) {\n\t\treturn renderChildren( element, context, legacyContext );\n\t}\n\n\tswitch ( typeof element ) {\n\t\tcase 'string':\n\t\t\treturn escapeHTML( element );\n\n\t\tcase 'number':\n\t\t\treturn element.toString();\n\t}\n\n\tconst { type, props } = /** @type {{type?: any, props?: any}} */ (\n\t\telement\n\t);\n\n\tswitch ( type ) {\n\t\tcase StrictMode:\n\t\tcase Fragment:\n\t\t\treturn renderChildren( props.children, context, legacyContext );\n\n\t\tcase RawHTML:\n\t\t\tconst { children, ...wrapperProps } = props;\n\n\t\t\treturn renderNativeComponent(\n\t\t\t\t! Object.keys( wrapperProps ).length ? null : 'div',\n\t\t\t\t{\n\t\t\t\t\t...wrapperProps,\n\t\t\t\t\tdangerouslySetInnerHTML: { __html: children },\n\t\t\t\t},\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\t}\n\n\tswitch ( typeof type ) {\n\t\tcase 'string':\n\t\t\treturn renderNativeComponent( type, props, context, legacyContext );\n\n\t\tcase 'function':\n\t\t\tif (\n\t\t\t\ttype.prototype &&\n\t\t\t\ttypeof type.prototype.render === 'function'\n\t\t\t) {\n\t\t\t\treturn renderComponent( type, props, context, legacyContext );\n\t\t\t}\n\n\t\t\treturn renderElement(\n\t\t\t\ttype( props, legacyContext ),\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\t}\n\n\tswitch ( type && type.$$typeof ) {\n\t\tcase Provider.$$typeof:\n\t\t\treturn renderChildren( props.children, props.value, legacyContext );\n\n\t\tcase Consumer.$$typeof:\n\t\t\treturn renderElement(\n\t\t\t\tprops.children( context || type._currentValue ),\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\n\t\tcase ForwardRef.$$typeof:\n\t\t\treturn renderElement(\n\t\t\t\ttype.render( props ),\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\t}\n\n\treturn '';\n}\n\n/**\n * Serializes a native component type to string.\n *\n * @param {?string} type Native component type to serialize, or null if\n * rendering as fragment of children content.\n * @param {Object} props Props object.\n * @param {Object} [context] Context object.\n * @param {Object} [legacyContext] Legacy context object.\n *\n * @return {string} Serialized element.\n */\nexport function renderNativeComponent(\n\ttype,\n\tprops,\n\tcontext,\n\tlegacyContext = {}\n) {\n\tlet content = '';\n\tif ( type === 'textarea' && props.hasOwnProperty( 'value' ) ) {\n\t\t// Textarea children can be assigned as value prop. If it is, render in\n\t\t// place of children. Ensure to omit so it is not assigned as attribute\n\t\t// as well.\n\t\tcontent = renderChildren( props.value, context, legacyContext );\n\t\tconst { value, ...restProps } = props;\n\t\tprops = restProps;\n\t} else if (\n\t\tprops.dangerouslySetInnerHTML &&\n\t\ttypeof props.dangerouslySetInnerHTML.__html === 'string'\n\t) {\n\t\t// Dangerous content is left unescaped.\n\t\tcontent = props.dangerouslySetInnerHTML.__html;\n\t} else if ( typeof props.children !== 'undefined' ) {\n\t\tcontent = renderChildren( props.children, context, legacyContext );\n\t}\n\n\tif ( ! type ) {\n\t\treturn content;\n\t}\n\n\tconst attributes = renderAttributes( props );\n\n\tif ( SELF_CLOSING_TAGS.has( type ) ) {\n\t\treturn '<' + type + attributes + '/>';\n\t}\n\n\treturn '<' + type + attributes + '>' + content + '</' + type + '>';\n}\n\n/** @typedef {import('react').ComponentType} ComponentType */\n\n/**\n * Serializes a non-native component type to string.\n *\n * @param {ComponentType} Component Component type to serialize.\n * @param {Object} props Props object.\n * @param {Object} [context] Context object.\n * @param {Object} [legacyContext] Legacy context object.\n *\n * @return {string} Serialized element\n */\nexport function renderComponent(\n\tComponent,\n\tprops,\n\tcontext,\n\tlegacyContext = {}\n) {\n\tconst instance = new /** @type {import('react').ComponentClass} */ (\n\t\tComponent\n\t)( props, legacyContext );\n\n\tif (\n\t\ttypeof (\n\t\t\t// Ignore reason: Current prettier reformats parens and mangles type assertion\n\t\t\t// prettier-ignore\n\t\t\t/** @type {{getChildContext?: () => unknown}} */ ( instance ).getChildContext\n\t\t) === 'function'\n\t) {\n\t\tObject.assign(\n\t\t\tlegacyContext,\n\t\t\t/** @type {{getChildContext?: () => unknown}} */ (\n\t\t\t\tinstance\n\t\t\t).getChildContext()\n\t\t);\n\t}\n\n\tconst html = renderElement( instance.render(), context, legacyContext );\n\n\treturn html;\n}\n\n/**\n * Serializes an array of children to string.\n *\n * @param {ReadonlyArray<import('react').ReactNode>} children Children to serialize.\n * @param {Object} [context] Context object.\n * @param {Object} [legacyContext] Legacy context object.\n *\n * @return {string} Serialized children.\n */\nfunction renderChildren( children, context, legacyContext = {} ) {\n\tlet result = '';\n\n\tchildren = Array.isArray( children ) ? children : [ children ];\n\n\tfor ( let i = 0; i < children.length; i++ ) {\n\t\tconst child = children[ i ];\n\n\t\tresult += renderElement( child, context, legacyContext );\n\t}\n\n\treturn result;\n}\n\n/**\n * Renders a props object as a string of HTML attributes.\n *\n * @param {Object} props Props object.\n *\n * @return {string} Attributes string.\n */\nexport function renderAttributes( props ) {\n\tlet result = '';\n\n\tfor ( const key in props ) {\n\t\tconst attribute = getNormalAttributeName( key );\n\t\tif ( ! isValidAttributeName( attribute ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet value = getNormalAttributeValue( key, props[ key ] );\n\n\t\t// If value is not of serializable type, skip.\n\t\tif ( ! ATTRIBUTES_TYPES.has( typeof value ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Don't render internal attribute names.\n\t\tif ( isInternalAttribute( key ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst isBooleanAttribute = BOOLEAN_ATTRIBUTES.has( attribute );\n\n\t\t// Boolean attribute should be omitted outright if its value is false.\n\t\tif ( isBooleanAttribute && value === false ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst isMeaningfulAttribute =\n\t\t\tisBooleanAttribute ||\n\t\t\thasPrefix( key, [ 'data-', 'aria-' ] ) ||\n\t\t\tENUMERATED_ATTRIBUTES.has( attribute );\n\n\t\t// Only write boolean value as attribute if meaningful.\n\t\tif ( typeof value === 'boolean' && ! isMeaningfulAttribute ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tresult += ' ' + attribute;\n\n\t\t// Boolean attributes should write attribute name, but without value.\n\t\t// Mere presence of attribute name is effective truthiness.\n\t\tif ( isBooleanAttribute ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( typeof value === 'string' ) {\n\t\t\tvalue = escapeAttribute( value );\n\t\t}\n\n\t\tresult += '=\"' + value + '\"';\n\t}\n\n\treturn result;\n}\n\n/**\n * Renders a style object as a string attribute value.\n *\n * @param {Object} style Style object.\n *\n * @return {string} Style attribute value.\n */\nexport function renderStyle( style ) {\n\t// Only generate from object, e.g. tolerate string value.\n\tif ( ! isPlainObject( style ) ) {\n\t\treturn style;\n\t}\n\n\tlet result;\n\n\tfor ( const property in style ) {\n\t\tconst value = style[ property ];\n\t\tif ( null === value || undefined === value ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( result ) {\n\t\t\tresult += ';';\n\t\t} else {\n\t\t\tresult = '';\n\t\t}\n\n\t\tconst normalName = getNormalStylePropertyName( property );\n\t\tconst normalValue = getNormalStylePropertyValue( property, value );\n\t\tresult += normalName + ':' + normalValue;\n\t}\n\n\treturn result;\n}\n\nexport default renderElement;\n"],"mappings":";;;;;;;;;;;;;AA8BA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,WAAA,GAAAF,OAAA;AASA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAC,sBAAA,CAAAL,OAAA;AA9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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G8D,KAAK,CAAEjD,QAAQ,CAAE;IAC/B,IAAK,IAAI,KAAKb,KAAK,IAAIrB,SAAS,KAAKqB,KAAK,EAAG;MAC5C;IACD;IAEA,IAAKsD,MAAM,EAAG;MACbA,MAAM,IAAI,GAAG;IACd,CAAC,MAAM;MACNA,MAAM,GAAG,EAAE;IACZ;IAEA,MAAMU,UAAU,GAAGpD,0BAA0B,CAAEC,QAAS,CAAC;IACzD,MAAMoD,WAAW,GAAGlD,2BAA2B,CAAEF,QAAQ,EAAEb,KAAM,CAAC;IAClEsD,MAAM,IAAIU,UAAU,GAAG,GAAG,GAAGC,WAAW;EACzC;EAEA,OAAOX,MAAM;AACd;AAAC,IAAAY,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcnD,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["_isPlainObject","require","_changeCase","_escapeHtml","_react","_rawHtml","_interopRequireDefault","Context","createContext","undefined","displayName","Provider","Consumer","ForwardRef","forwardRef","ATTRIBUTES_TYPES","Set","SELF_CLOSING_TAGS","BOOLEAN_ATTRIBUTES","ENUMERATED_ATTRIBUTES","CSS_PROPERTIES_SUPPORTS_UNITLESS","hasPrefix","string","prefixes","some","prefix","indexOf","isInternalAttribute","attribute","getNormalAttributeValue","value","renderStyle","SVG_ATTRIBUTE_WITH_DASHES_LIST","reduce","map","toLowerCase","CASE_SENSITIVE_SVG_ATTRIBUTES","SVG_ATTRIBUTES_WITH_COLONS","replace","getNormalAttributeName","attributeLowerCase","kebabCase","getNormalStylePropertyName","property","startsWith","getNormalStylePropertyValue","has","renderElement","element","context","legacyContext","Array","isArray","renderChildren","escapeHTML","toString","type","props","StrictMode","Fragment","children","RawHTML","wrapperProps","renderNativeComponent","Object","keys","length","dangerouslySetInnerHTML","__html","prototype","render","renderComponent","$$typeof","_currentValue","content","hasOwnProperty","restProps","attributes","renderAttributes","Component","instance","getChildContext","assign","html","result","childrenArray","i","child","key","isValidAttributeName","isBooleanAttribute","isMeaningfulAttribute","escapeAttribute","style","isPlainObject","styleObj","normalName","normalValue","_default","exports","default"],"sources":["@wordpress/element/src/serialize.ts"],"sourcesContent":["/**\n * Parts of this source were derived and modified from fast-react-render,\n * released under the MIT license.\n *\n * https://github.com/alt-j/fast-react-render\n *\n * Copyright (c) 2016 Andrey Morozov\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * External dependencies\n */\nimport { isPlainObject } from 'is-plain-object';\nimport { paramCase as kebabCase } from 'change-case';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tescapeHTML,\n\tescapeAttribute,\n\tisValidAttributeName,\n} from '@wordpress/escape-html';\n\n/**\n * Internal dependencies\n */\nimport { createContext, Fragment, StrictMode, forwardRef } from './react';\nimport RawHTML from './raw-html';\n\n/** @typedef {import('react').ReactElement} ReactElement */\n\nconst Context = createContext( undefined );\nContext.displayName = 'ElementContext';\n\ninterface ComponentInstance {\n\trender: () => React.ReactNode;\n\tgetChildContext?: () => Record< string, any >;\n}\n\ninterface RawHTMLProps {\n\tchildren: string;\n\t[ key: string ]: any;\n}\n\ninterface StyleObject {\n\t[ property: string ]: string | number | null | undefined;\n}\n\ninterface HTMLProps {\n\tdangerouslySetInnerHTML?: {\n\t\t__html: string;\n\t};\n\tchildren?: React.ReactNode;\n\tvalue?: React.ReactNode;\n\tstyle?: StyleObject | string;\n\tclassName?: string;\n\thtmlFor?: string;\n\t[ key: string ]: any;\n}\n\nconst { Provider, Consumer } = Context;\n\nconst ForwardRef = forwardRef( () => {\n\treturn null;\n} );\n\n/**\n * Valid attribute types.\n */\nconst ATTRIBUTES_TYPES = new Set< string >( [ 'string', 'boolean', 'number' ] );\n\n/**\n * Element tags which can be self-closing.\n */\nconst SELF_CLOSING_TAGS = new Set< string >( [\n\t'area',\n\t'base',\n\t'br',\n\t'col',\n\t'command',\n\t'embed',\n\t'hr',\n\t'img',\n\t'input',\n\t'keygen',\n\t'link',\n\t'meta',\n\t'param',\n\t'source',\n\t'track',\n\t'wbr',\n] );\n\n/**\n * Boolean attributes are attributes whose presence as being assigned is\n * meaningful, even if only empty.\n *\n * See: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attributes\n * Extracted from: https://html.spec.whatwg.org/multipage/indices.html#attributes-3\n *\n * Object.keys( [ ...document.querySelectorAll( '#attributes-1 > tbody > tr' ) ]\n * .filter( ( tr ) => tr.lastChild.textContent.indexOf( 'Boolean attribute' ) !== -1 )\n * .reduce( ( result, tr ) => Object.assign( result, {\n * [ tr.firstChild.textContent.trim() ]: true\n * } ), {} ) ).sort();\n */\nconst BOOLEAN_ATTRIBUTES = new Set< string >( [\n\t'allowfullscreen',\n\t'allowpaymentrequest',\n\t'allowusermedia',\n\t'async',\n\t'autofocus',\n\t'autoplay',\n\t'checked',\n\t'controls',\n\t'default',\n\t'defer',\n\t'disabled',\n\t'download',\n\t'formnovalidate',\n\t'hidden',\n\t'ismap',\n\t'itemscope',\n\t'loop',\n\t'multiple',\n\t'muted',\n\t'nomodule',\n\t'novalidate',\n\t'open',\n\t'playsinline',\n\t'readonly',\n\t'required',\n\t'reversed',\n\t'selected',\n\t'typemustmatch',\n] );\n\n/**\n * Enumerated attributes are attributes which must be of a specific value form.\n * Like boolean attributes, these are meaningful if specified, even if not of a\n * valid enumerated value.\n *\n * See: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#enumerated-attribute\n * Extracted from: https://html.spec.whatwg.org/multipage/indices.html#attributes-3\n *\n * Object.keys( [ ...document.querySelectorAll( '#attributes-1 > tbody > tr' ) ]\n * .filter( ( tr ) => /^(\"(.+?)\";?\\s*)+/.test( tr.lastChild.textContent.trim() ) )\n * .reduce( ( result, tr ) => Object.assign( result, {\n * [ tr.firstChild.textContent.trim() ]: true\n * } ), {} ) ).sort();\n *\n * Some notable omissions:\n *\n * - `alt`: https://blog.whatwg.org/omit-alt\n */\nconst ENUMERATED_ATTRIBUTES = new Set< string >( [\n\t'autocapitalize',\n\t'autocomplete',\n\t'charset',\n\t'contenteditable',\n\t'crossorigin',\n\t'decoding',\n\t'dir',\n\t'draggable',\n\t'enctype',\n\t'formenctype',\n\t'formmethod',\n\t'http-equiv',\n\t'inputmode',\n\t'kind',\n\t'method',\n\t'preload',\n\t'scope',\n\t'shape',\n\t'spellcheck',\n\t'translate',\n\t'type',\n\t'wrap',\n] );\n\n/**\n * Set of CSS style properties which support assignment of unitless numbers.\n * Used in rendering of style properties, where `px` unit is assumed unless\n * property is included in this set or value is zero.\n *\n * Generated via:\n *\n * Object.entries( document.createElement( 'div' ).style )\n * .filter( ( [ key ] ) => (\n * ! /^(webkit|ms|moz)/.test( key ) &&\n * ( e.style[ key ] = 10 ) &&\n * e.style[ key ] === '10'\n * ) )\n * .map( ( [ key ] ) => key )\n * .sort();\n */\nconst CSS_PROPERTIES_SUPPORTS_UNITLESS = new Set< string >( [\n\t'animation',\n\t'animationIterationCount',\n\t'baselineShift',\n\t'borderImageOutset',\n\t'borderImageSlice',\n\t'borderImageWidth',\n\t'columnCount',\n\t'cx',\n\t'cy',\n\t'fillOpacity',\n\t'flexGrow',\n\t'flexShrink',\n\t'floodOpacity',\n\t'fontWeight',\n\t'gridColumnEnd',\n\t'gridColumnStart',\n\t'gridRowEnd',\n\t'gridRowStart',\n\t'lineHeight',\n\t'opacity',\n\t'order',\n\t'orphans',\n\t'r',\n\t'rx',\n\t'ry',\n\t'shapeImageThreshold',\n\t'stopOpacity',\n\t'strokeDasharray',\n\t'strokeDashoffset',\n\t'strokeMiterlimit',\n\t'strokeOpacity',\n\t'strokeWidth',\n\t'tabSize',\n\t'widows',\n\t'x',\n\t'y',\n\t'zIndex',\n\t'zoom',\n] );\n\n/**\n * Returns true if the specified string is prefixed by one of an array of\n * possible prefixes.\n * @param string\n * @param prefixes\n */\nexport function hasPrefix( string: string, prefixes: string[] ): boolean {\n\treturn prefixes.some( ( prefix ) => string.indexOf( prefix ) === 0 );\n}\n\n/**\n * Returns true if the given prop name should be ignored in attributes\n * serialization, or false otherwise.\n * @param attribute\n */\nfunction isInternalAttribute( attribute: string ): boolean {\n\treturn 'key' === attribute || 'children' === attribute;\n}\n\n/**\n * Returns the normal form of the element's attribute value for HTML.\n * @param attribute\n * @param value\n */\nfunction getNormalAttributeValue( attribute: string, value: any ): any {\n\tswitch ( attribute ) {\n\t\tcase 'style':\n\t\t\treturn renderStyle( value );\n\t}\n\n\treturn value;\n}\n\n/**\n * This is a map of all SVG attributes that have dashes. Map(lower case prop => dashed lower case attribute).\n * We need this to render e.g strokeWidth as stroke-width.\n *\n * List from: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute.\n */\nconst SVG_ATTRIBUTE_WITH_DASHES_LIST: Record< string, string > = [\n\t'accentHeight',\n\t'alignmentBaseline',\n\t'arabicForm',\n\t'baselineShift',\n\t'capHeight',\n\t'clipPath',\n\t'clipRule',\n\t'colorInterpolation',\n\t'colorInterpolationFilters',\n\t'colorProfile',\n\t'colorRendering',\n\t'dominantBaseline',\n\t'enableBackground',\n\t'fillOpacity',\n\t'fillRule',\n\t'floodColor',\n\t'floodOpacity',\n\t'fontFamily',\n\t'fontSize',\n\t'fontSizeAdjust',\n\t'fontStretch',\n\t'fontStyle',\n\t'fontVariant',\n\t'fontWeight',\n\t'glyphName',\n\t'glyphOrientationHorizontal',\n\t'glyphOrientationVertical',\n\t'horizAdvX',\n\t'horizOriginX',\n\t'imageRendering',\n\t'letterSpacing',\n\t'lightingColor',\n\t'markerEnd',\n\t'markerMid',\n\t'markerStart',\n\t'overlinePosition',\n\t'overlineThickness',\n\t'paintOrder',\n\t'panose1',\n\t'pointerEvents',\n\t'renderingIntent',\n\t'shapeRendering',\n\t'stopColor',\n\t'stopOpacity',\n\t'strikethroughPosition',\n\t'strikethroughThickness',\n\t'strokeDasharray',\n\t'strokeDashoffset',\n\t'strokeLinecap',\n\t'strokeLinejoin',\n\t'strokeMiterlimit',\n\t'strokeOpacity',\n\t'strokeWidth',\n\t'textAnchor',\n\t'textDecoration',\n\t'textRendering',\n\t'underlinePosition',\n\t'underlineThickness',\n\t'unicodeBidi',\n\t'unicodeRange',\n\t'unitsPerEm',\n\t'vAlphabetic',\n\t'vHanging',\n\t'vIdeographic',\n\t'vMathematical',\n\t'vectorEffect',\n\t'vertAdvY',\n\t'vertOriginX',\n\t'vertOriginY',\n\t'wordSpacing',\n\t'writingMode',\n\t'xmlnsXlink',\n\t'xHeight',\n].reduce(\n\t( map, attribute ) => {\n\t\t// The keys are lower-cased for more robust lookup.\n\t\tmap[ attribute.toLowerCase() ] = attribute;\n\t\treturn map;\n\t},\n\t{} as Record< string, string >\n);\n\n/**\n * This is a map of all case-sensitive SVG attributes. Map(lowercase key => proper case attribute).\n * The keys are lower-cased for more robust lookup.\n * Note that this list only contains attributes that contain at least one capital letter.\n * Lowercase attributes don't need mapping, since we lowercase all attributes by default.\n */\nconst CASE_SENSITIVE_SVG_ATTRIBUTES: Record< string, string > = [\n\t'allowReorder',\n\t'attributeName',\n\t'attributeType',\n\t'autoReverse',\n\t'baseFrequency',\n\t'baseProfile',\n\t'calcMode',\n\t'clipPathUnits',\n\t'contentScriptType',\n\t'contentStyleType',\n\t'diffuseConstant',\n\t'edgeMode',\n\t'externalResourcesRequired',\n\t'filterRes',\n\t'filterUnits',\n\t'glyphRef',\n\t'gradientTransform',\n\t'gradientUnits',\n\t'kernelMatrix',\n\t'kernelUnitLength',\n\t'keyPoints',\n\t'keySplines',\n\t'keyTimes',\n\t'lengthAdjust',\n\t'limitingConeAngle',\n\t'markerHeight',\n\t'markerUnits',\n\t'markerWidth',\n\t'maskContentUnits',\n\t'maskUnits',\n\t'numOctaves',\n\t'pathLength',\n\t'patternContentUnits',\n\t'patternTransform',\n\t'patternUnits',\n\t'pointsAtX',\n\t'pointsAtY',\n\t'pointsAtZ',\n\t'preserveAlpha',\n\t'preserveAspectRatio',\n\t'primitiveUnits',\n\t'refX',\n\t'refY',\n\t'repeatCount',\n\t'repeatDur',\n\t'requiredExtensions',\n\t'requiredFeatures',\n\t'specularConstant',\n\t'specularExponent',\n\t'spreadMethod',\n\t'startOffset',\n\t'stdDeviation',\n\t'stitchTiles',\n\t'suppressContentEditableWarning',\n\t'suppressHydrationWarning',\n\t'surfaceScale',\n\t'systemLanguage',\n\t'tableValues',\n\t'targetX',\n\t'targetY',\n\t'textLength',\n\t'viewBox',\n\t'viewTarget',\n\t'xChannelSelector',\n\t'yChannelSelector',\n].reduce(\n\t( map, attribute ) => {\n\t\t// The keys are lower-cased for more robust lookup.\n\t\tmap[ attribute.toLowerCase() ] = attribute;\n\t\treturn map;\n\t},\n\t{} as Record< string, string >\n);\n\n/**\n * This is a map of all SVG attributes that have colons.\n * Keys are lower-cased and stripped of their colons for more robust lookup.\n */\nconst SVG_ATTRIBUTES_WITH_COLONS: Record< string, string > = [\n\t'xlink:actuate',\n\t'xlink:arcrole',\n\t'xlink:href',\n\t'xlink:role',\n\t'xlink:show',\n\t'xlink:title',\n\t'xlink:type',\n\t'xml:base',\n\t'xml:lang',\n\t'xml:space',\n\t'xmlns:xlink',\n].reduce(\n\t( map, attribute ) => {\n\t\tmap[ attribute.replace( ':', '' ).toLowerCase() ] = attribute;\n\t\treturn map;\n\t},\n\t{} as Record< string, string >\n);\n\n/**\n * Returns the normal form of the element's attribute name for HTML.\n * @param attribute\n */\nfunction getNormalAttributeName( attribute: string ): string {\n\tswitch ( attribute ) {\n\t\tcase 'htmlFor':\n\t\t\treturn 'for';\n\n\t\tcase 'className':\n\t\t\treturn 'class';\n\t}\n\tconst attributeLowerCase = attribute.toLowerCase();\n\n\tif ( CASE_SENSITIVE_SVG_ATTRIBUTES[ attributeLowerCase ] ) {\n\t\treturn CASE_SENSITIVE_SVG_ATTRIBUTES[ attributeLowerCase ];\n\t} else if ( SVG_ATTRIBUTE_WITH_DASHES_LIST[ attributeLowerCase ] ) {\n\t\treturn kebabCase(\n\t\t\tSVG_ATTRIBUTE_WITH_DASHES_LIST[ attributeLowerCase ]\n\t\t);\n\t} else if ( SVG_ATTRIBUTES_WITH_COLONS[ attributeLowerCase ] ) {\n\t\treturn SVG_ATTRIBUTES_WITH_COLONS[ attributeLowerCase ];\n\t}\n\n\treturn attributeLowerCase;\n}\n\n/**\n * Returns the normal form of the style property name for HTML.\n *\n * - Converts property names to kebab-case, e.g. 'backgroundColor' → 'background-color'\n * - Leaves custom attributes alone, e.g. '--myBackgroundColor' → '--myBackgroundColor'\n * - Converts vendor-prefixed property names to -kebab-case, e.g. 'MozTransform' → '-moz-transform'\n * @param property\n */\nfunction getNormalStylePropertyName( property: string ): string {\n\tif ( property.startsWith( '--' ) ) {\n\t\treturn property;\n\t}\n\n\tif ( hasPrefix( property, [ 'ms', 'O', 'Moz', 'Webkit' ] ) ) {\n\t\treturn '-' + kebabCase( property );\n\t}\n\n\treturn kebabCase( property );\n}\n\n/**\n * Returns the normal form of the style property value for HTML. Appends a\n * default pixel unit if numeric, not a unitless property, and not zero.\n * @param property\n * @param value\n */\nfunction getNormalStylePropertyValue(\n\tproperty: string,\n\tvalue: any\n): string | number {\n\tif (\n\t\ttypeof value === 'number' &&\n\t\t0 !== value &&\n\t\t! hasPrefix( property, [ '--' ] ) &&\n\t\t! CSS_PROPERTIES_SUPPORTS_UNITLESS.has( property )\n\t) {\n\t\treturn value + 'px';\n\t}\n\n\treturn value;\n}\n\n/**\n * Serializes a React element to string.\n * @param element\n * @param context\n * @param legacyContext\n */\nexport function renderElement(\n\telement: React.ReactNode,\n\tcontext?: any,\n\tlegacyContext: Record< string, any > = {}\n): string {\n\tif ( null === element || undefined === element || false === element ) {\n\t\treturn '';\n\t}\n\n\tif ( Array.isArray( element ) ) {\n\t\treturn renderChildren( element, context, legacyContext );\n\t}\n\n\tswitch ( typeof element ) {\n\t\tcase 'string':\n\t\t\treturn escapeHTML( element );\n\n\t\tcase 'number':\n\t\t\treturn element.toString();\n\t}\n\n\tconst { type, props } = element as {\n\t\ttype?: any;\n\t\tprops?: any;\n\t};\n\n\tswitch ( type ) {\n\t\tcase StrictMode:\n\t\tcase Fragment:\n\t\t\treturn renderChildren( props.children, context, legacyContext );\n\n\t\tcase RawHTML:\n\t\t\tconst { children, ...wrapperProps } = props as RawHTMLProps;\n\n\t\t\treturn renderNativeComponent(\n\t\t\t\t! Object.keys( wrapperProps ).length ? null : 'div',\n\t\t\t\t{\n\t\t\t\t\t...wrapperProps,\n\t\t\t\t\tdangerouslySetInnerHTML: { __html: children },\n\t\t\t\t},\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\t}\n\n\tswitch ( typeof type ) {\n\t\tcase 'string':\n\t\t\treturn renderNativeComponent( type, props, context, legacyContext );\n\n\t\tcase 'function':\n\t\t\tif (\n\t\t\t\ttype.prototype &&\n\t\t\t\ttypeof type.prototype.render === 'function'\n\t\t\t) {\n\t\t\t\treturn renderComponent( type, props, context, legacyContext );\n\t\t\t}\n\n\t\t\treturn renderElement(\n\t\t\t\ttype( props, legacyContext ),\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\t}\n\n\tswitch ( type && type.$$typeof ) {\n\t\tcase Provider.$$typeof:\n\t\t\treturn renderChildren( props.children, props.value, legacyContext );\n\n\t\tcase Consumer.$$typeof:\n\t\t\treturn renderElement(\n\t\t\t\tprops.children( context || type._currentValue ),\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\n\t\tcase ForwardRef.$$typeof:\n\t\t\treturn renderElement(\n\t\t\t\ttype.render( props ),\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\t}\n\n\treturn '';\n}\n\n/**\n * Serializes a native component type to string.\n * @param type\n * @param props\n * @param context\n * @param legacyContext\n */\nexport function renderNativeComponent(\n\ttype: string | null,\n\tprops: HTMLProps,\n\tcontext?: any,\n\tlegacyContext: Record< string, any > = {}\n): string {\n\tlet content = '';\n\tif ( type === 'textarea' && props.hasOwnProperty( 'value' ) ) {\n\t\t// Textarea children can be assigned as value prop. If it is, render in\n\t\t// place of children. Ensure to omit so it is not assigned as attribute\n\t\t// as well.\n\t\tcontent = renderChildren( props.value, context, legacyContext );\n\t\tconst { value, ...restProps } = props;\n\t\tprops = restProps;\n\t} else if (\n\t\tprops.dangerouslySetInnerHTML &&\n\t\ttypeof props.dangerouslySetInnerHTML.__html === 'string'\n\t) {\n\t\t// Dangerous content is left unescaped.\n\t\tcontent = props.dangerouslySetInnerHTML.__html;\n\t} else if ( typeof props.children !== 'undefined' ) {\n\t\tcontent = renderChildren( props.children, context, legacyContext );\n\t}\n\n\tif ( ! type ) {\n\t\treturn content;\n\t}\n\n\tconst attributes = renderAttributes( props );\n\n\tif ( SELF_CLOSING_TAGS.has( type ) ) {\n\t\treturn '<' + type + attributes + '/>';\n\t}\n\n\treturn '<' + type + attributes + '>' + content + '</' + type + '>';\n}\n\n/**\n * Serializes a non-native component type to string.\n * @param Component\n * @param props\n * @param context\n * @param legacyContext\n */\nexport function renderComponent(\n\tComponent: React.ComponentClass,\n\tprops: Record< string, any >,\n\tcontext?: any,\n\tlegacyContext: Record< string, any > = {}\n): string {\n\tconst instance = new Component( props, legacyContext ) as ComponentInstance;\n\n\tif ( typeof instance.getChildContext === 'function' ) {\n\t\tObject.assign( legacyContext, instance.getChildContext() );\n\t}\n\n\tconst html = renderElement( instance.render(), context, legacyContext );\n\n\treturn html;\n}\n\n/**\n * Serializes an array of children to string.\n * @param children\n * @param context\n * @param legacyContext\n */\nfunction renderChildren(\n\tchildren: React.ReactNode,\n\tcontext?: any,\n\tlegacyContext: Record< string, any > = {}\n): string {\n\tlet result = '';\n\n\tconst childrenArray = Array.isArray( children ) ? children : [ children ];\n\n\tfor ( let i = 0; i < childrenArray.length; i++ ) {\n\t\tconst child = childrenArray[ i ];\n\n\t\tresult += renderElement( child, context, legacyContext );\n\t}\n\n\treturn result;\n}\n\n/**\n * Renders a props object as a string of HTML attributes.\n * @param props\n */\nexport function renderAttributes( props: Record< string, any > ): string {\n\tlet result = '';\n\n\tfor ( const key in props ) {\n\t\tconst attribute = getNormalAttributeName( key );\n\t\tif ( ! isValidAttributeName( attribute ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet value = getNormalAttributeValue( key, props[ key ] );\n\n\t\t// If value is not of serializable type, skip.\n\t\tif ( ! ATTRIBUTES_TYPES.has( typeof value ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Don't render internal attribute names.\n\t\tif ( isInternalAttribute( key ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst isBooleanAttribute = BOOLEAN_ATTRIBUTES.has( attribute );\n\n\t\t// Boolean attribute should be omitted outright if its value is false.\n\t\tif ( isBooleanAttribute && value === false ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst isMeaningfulAttribute =\n\t\t\tisBooleanAttribute ||\n\t\t\thasPrefix( key, [ 'data-', 'aria-' ] ) ||\n\t\t\tENUMERATED_ATTRIBUTES.has( attribute );\n\n\t\t// Only write boolean value as attribute if meaningful.\n\t\tif ( typeof value === 'boolean' && ! isMeaningfulAttribute ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tresult += ' ' + attribute;\n\n\t\t// Boolean attributes should write attribute name, but without value.\n\t\t// Mere presence of attribute name is effective truthiness.\n\t\tif ( isBooleanAttribute ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( typeof value === 'string' ) {\n\t\t\tvalue = escapeAttribute( value );\n\t\t}\n\n\t\tresult += '=\"' + value + '\"';\n\t}\n\n\treturn result;\n}\n\n/**\n * Renders a style object as a string attribute value.\n * @param style\n */\nexport function renderStyle( style: StyleObject | string ): string | undefined {\n\t// Only generate from object, e.g. tolerate string value.\n\tif ( ! isPlainObject( style ) ) {\n\t\treturn style as string;\n\t}\n\n\tlet result: string | undefined;\n\n\tconst styleObj = style as StyleObject;\n\tfor ( const property in styleObj ) {\n\t\tconst value = styleObj[ property ];\n\t\tif ( null === value || undefined === value ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( result ) {\n\t\t\tresult += ';';\n\t\t} else {\n\t\t\tresult = '';\n\t\t}\n\n\t\tconst normalName = getNormalStylePropertyName( property );\n\t\tconst normalValue = getNormalStylePropertyValue( property, value );\n\t\tresult += normalName + ':' + normalValue;\n\t}\n\n\treturn result;\n}\n\nexport default renderElement;\n"],"mappings":";;;;;;;;;;;;;AA8BA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,WAAA,GAAAF,OAAA;AASA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAC,sBAAA,CAAAL,OAAA;AA9CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAIA;AACA;AACA;;AAOA;AACA;AACA;;AAIA;;AAEA,MAAMM,OAAO,GAAG,IAAAC,oBAAa,EAAEC,SAAU,CAAC;AAC1CF,OAAO,CAACG,WAAW,GAAG,gBAAgB;AA4BtC,MAAM;EAAEC,QAAQ;EA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AC,OAAA,CAAAC,OAAA,GAEcrD,aAAa","ignoreList":[]}
package/build/utils.js CHANGED
@@ -7,8 +7,8 @@ exports.isEmptyElement = void 0;
7
7
  /**
8
8
  * Checks if the provided WP element is empty.
9
9
  *
10
- * @param {*} element WP element to check.
11
- * @return {boolean} True when an element is considered empty.
10
+ * @param element WP element to check.
11
+ * @return True when an element is considered empty.
12
12
  */
13
13
  const isEmptyElement = element => {
14
14
  if (typeof element === 'number') {
@@ -1 +1 @@
1
- {"version":3,"names":["isEmptyElement","element","valueOf","Array","isArray","length","exports"],"sources":["@wordpress/element/src/utils.js"],"sourcesContent":["/**\n * Checks if the provided WP element is empty.\n *\n * @param {*} element WP element to check.\n * @return {boolean} True when an element is considered empty.\n */\nexport const isEmptyElement = ( element ) => {\n\tif ( typeof element === 'number' ) {\n\t\treturn false;\n\t}\n\n\tif ( typeof element?.valueOf() === 'string' || Array.isArray( element ) ) {\n\t\treturn ! element.length;\n\t}\n\n\treturn ! element;\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,cAAc,GAAKC,OAAO,IAAM;EAC5C,IAAK,OAAOA,OAAO,KAAK,QAAQ,EAAG;IAClC,OAAO,KAAK;EACb;EAEA,IAAK,OAAOA,OAAO,EAAEC,OAAO,CAAC,CAAC,KAAK,QAAQ,IAAIC,KAAK,CAACC,OAAO,CAAEH,OAAQ,CAAC,EAAG;IACzE,OAAO,CAAEA,OAAO,CAACI,MAAM;EACxB;EAEA,OAAO,CAAEJ,OAAO;AACjB,CAAC;AAACK,OAAA,CAAAN,cAAA,GAAAA,cAAA","ignoreList":[]}
1
+ {"version":3,"names":["isEmptyElement","element","valueOf","Array","isArray","length","exports"],"sources":["@wordpress/element/src/utils.ts"],"sourcesContent":["/**\n * Checks if the provided WP element is empty.\n *\n * @param element WP element to check.\n * @return True when an element is considered empty.\n */\nexport const isEmptyElement = ( element: unknown ): boolean => {\n\tif ( typeof element === 'number' ) {\n\t\treturn false;\n\t}\n\n\tif ( typeof element?.valueOf() === 'string' || Array.isArray( element ) ) {\n\t\treturn ! ( element as { length: number } ).length;\n\t}\n\n\treturn ! element;\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,cAAc,GAAKC,OAAgB,IAAe;EAC9D,IAAK,OAAOA,OAAO,KAAK,QAAQ,EAAG;IAClC,OAAO,KAAK;EACb;EAEA,IAAK,OAAOA,OAAO,EAAEC,OAAO,CAAC,CAAC,KAAK,QAAQ,IAAIC,KAAK,CAACC,OAAO,CAAEH,OAAQ,CAAC,EAAG;IACzE,OAAO,CAAIA,OAAO,CAAyBI,MAAM;EAClD;EAEA,OAAO,CAAEJ,OAAO;AACjB,CAAC;AAACK,OAAA,CAAAN,cAAA,GAAAA,cAAA","ignoreList":[]}
@@ -2,14 +2,10 @@
2
2
  * Internal dependencies
3
3
  */
4
4
  import { createElement, cloneElement, Fragment, isValidElement } from './react';
5
-
6
- /**
7
- * Object containing a React element.
8
- *
9
- * @typedef {import('react').ReactElement} Element
10
- */
11
-
12
- let indoc, offset, output, stack;
5
+ let indoc;
6
+ let offset;
7
+ let output;
8
+ let stack;
13
9
 
14
10
  /**
15
11
  * Matches tags in the localized string
@@ -23,29 +19,8 @@ let indoc, offset, output, stack;
23
19
  * isClosing: The closing slash, if it exists.
24
20
  * name: The name portion of the tag (strong, br) (if )
25
21
  * isSelfClosed: The slash on a self closing tag, if it exists.
26
- *
27
- * @type {RegExp}
28
22
  */
29
23
  const tokenizer = /<(\/)?(\w+)\s*(\/)?>/g;
30
-
31
- /**
32
- * The stack frame tracking parse progress.
33
- *
34
- * @typedef Frame
35
- *
36
- * @property {Element} element A parent element which may still have
37
- * @property {number} tokenStart Offset at which parent element first
38
- * appears.
39
- * @property {number} tokenLength Length of string marking start of parent
40
- * element.
41
- * @property {number} [prevOffset] Running offset at which parsing should
42
- * continue.
43
- * @property {number} [leadingTextStart] Offset at which last closing element
44
- * finished, used for finding text between
45
- * elements.
46
- * @property {Element[]} children Children.
47
- */
48
-
49
24
  /**
50
25
  * Tracks recursive-descent parse state.
51
26
  *
@@ -53,19 +28,19 @@ const tokenizer = /<(\/)?(\w+)\s*(\/)?>/g;
53
28
  * parsed.
54
29
  *
55
30
  * @private
56
- * @param {Element} element A parent element which may still have
57
- * nested children not yet parsed.
58
- * @param {number} tokenStart Offset at which parent element first
59
- * appears.
60
- * @param {number} tokenLength Length of string marking start of parent
61
- * element.
62
- * @param {number} [prevOffset] Running offset at which parsing should
63
- * continue.
64
- * @param {number} [leadingTextStart] Offset at which last closing element
65
- * finished, used for finding text between
66
- * elements.
31
+ * @param element A parent element which may still have
32
+ * nested children not yet parsed.
33
+ * @param tokenStart Offset at which parent element first
34
+ * appears.
35
+ * @param tokenLength Length of string marking start of parent
36
+ * element.
37
+ * @param prevOffset Running offset at which parsing should
38
+ * continue.
39
+ * @param leadingTextStart Offset at which last closing element
40
+ * finished, used for finding text between
41
+ * elements.
67
42
  *
68
- * @return {Frame} The stack frame tracking parse progress.
43
+ * @return The stack frame tracking parse progress.
69
44
  */
70
45
  function createFrame(element, tokenStart, tokenLength, prevOffset, leadingTextStart) {
71
46
  return {
@@ -99,11 +74,11 @@ function createFrame(element, tokenStart, tokenLength, prevOffset, leadingTextSt
99
74
  * }
100
75
  * ```
101
76
  *
102
- * @param {string} interpolatedString The interpolation string to be parsed.
103
- * @param {Record<string, Element>} conversionMap The map used to convert the string to
104
- * a react element.
77
+ * @param interpolatedString The interpolation string to be parsed.
78
+ * @param conversionMap The map used to convert the string to
79
+ * a react element.
105
80
  * @throws {TypeError}
106
- * @return {Element} A wp element.
81
+ * @return A wp element.
107
82
  */
108
83
  const createInterpolateElement = (interpolatedString, conversionMap) => {
109
84
  indoc = interpolatedString;
@@ -128,31 +103,30 @@ const createInterpolateElement = (interpolatedString, conversionMap) => {
128
103
  *
129
104
  * @private
130
105
  *
131
- * @param {Object} conversionMap The map being validated.
106
+ * @param conversionMap The map being validated.
132
107
  *
133
- * @return {boolean} True means the map is valid.
108
+ * @return True means the map is valid.
134
109
  */
135
110
  const isValidConversionMap = conversionMap => {
136
- const isObject = typeof conversionMap === 'object';
111
+ const isObject = typeof conversionMap === 'object' && conversionMap !== null;
137
112
  const values = isObject && Object.values(conversionMap);
138
- return isObject && values.length && values.every(element => isValidElement(element));
113
+ return isObject && values.length > 0 && values.every(element => isValidElement(element));
139
114
  };
140
-
141
115
  /**
142
116
  * This is the iterator over the matches in the string.
143
117
  *
144
118
  * @private
145
119
  *
146
- * @param {Object} conversionMap The conversion map for the string.
120
+ * @param conversionMap The conversion map for the string.
147
121
  *
148
- * @return {boolean} true for continuing to iterate, false for finished.
122
+ * @return true for continuing to iterate, false for finished.
149
123
  */
150
124
  function proceed(conversionMap) {
151
125
  const next = nextToken();
152
126
  const [tokenType, name, startOffset, tokenLength] = next;
153
127
  const stackDepth = stack.length;
154
128
  const leadingTextStart = startOffset > offset ? offset : null;
155
- if (!conversionMap[name]) {
129
+ if (name && !conversionMap[name]) {
156
130
  addText();
157
131
  return false;
158
132
  }
@@ -215,7 +189,7 @@ function proceed(conversionMap) {
215
189
  *
216
190
  * @private
217
191
  *
218
- * @return {Array} An array of details for the token matched.
192
+ * @return An array of details for the token matched.
219
193
  */
220
194
  function nextToken() {
221
195
  const matches = tokenizer.exec(indoc);