@wordpress/element 5.11.0 → 5.12.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/CHANGELOG.md +2 -0
- package/build/raw-html.js +4 -5
- package/build/raw-html.js.map +1 -1
- package/build/react.js +2 -6
- package/build/react.js.map +1 -1
- package/build/serialize.js +4 -9
- package/build/serialize.js.map +1 -1
- package/build/utils.js +1 -1
- package/build/utils.js.map +1 -1
- package/build-module/raw-html.js +4 -5
- package/build-module/raw-html.js.map +1 -1
- package/build-module/react.js +2 -6
- package/build-module/react.js.map +1 -1
- package/build-module/serialize.js +4 -9
- package/build-module/serialize.js.map +1 -1
- package/build-module/utils.js +1 -1
- package/build-module/utils.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/build/raw-html.js
CHANGED
|
@@ -25,11 +25,10 @@ var _react = require("./react");
|
|
|
25
25
|
*
|
|
26
26
|
* @return {JSX.Element} Dangerously-rendering component.
|
|
27
27
|
*/
|
|
28
|
-
function RawHTML(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
} = _ref;
|
|
28
|
+
function RawHTML({
|
|
29
|
+
children,
|
|
30
|
+
...props
|
|
31
|
+
}) {
|
|
33
32
|
let rawHtml = ''; // Cast children as an array, and concatenate each element if it is a string.
|
|
34
33
|
|
|
35
34
|
_react.Children.toArray(children).forEach(child => {
|
package/build/raw-html.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/element/src/raw-html.js"],"names":["RawHTML","children","props","rawHtml","Children","toArray","forEach","child","trim","dangerouslySetInnerHTML","__html"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,OAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/element/src/raw-html.js"],"names":["RawHTML","children","props","rawHtml","Children","toArray","forEach","child","trim","dangerouslySetInnerHTML","__html"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,OAAT,CAAkB;AAAEC,EAAAA,QAAF;AAAY,KAAGC;AAAf,CAAlB,EAA2C;AACzD,MAAIC,OAAO,GAAG,EAAd,CADyD,CAGzD;;AACAC,kBAASC,OAAT,CAAkBJ,QAAlB,EAA6BK,OAA7B,CAAwCC,KAAF,IAAa;AAClD,QAAK,OAAOA,KAAP,KAAiB,QAAjB,IAA6BA,KAAK,CAACC,IAAN,OAAiB,EAAnD,EAAwD;AACvDL,MAAAA,OAAO,IAAII,KAAX;AACA;AACD,GAJD,EAJyD,CAUzD;AACA;;;AACA,SAAO,0BAAe,KAAf,EAAsB;AAC5BE,IAAAA,uBAAuB,EAAE;AAAEC,MAAAA,MAAM,EAAEP;AAAV,KADG;AAE5B,OAAGD;AAFyB,GAAtB,CAAP;AAIA","sourcesContent":["/**\n * Internal dependencies\n */\nimport { Children, createElement } from './react';\n\n/** @typedef {{children: string} & import('react').ComponentPropsWithoutRef<'div'>} RawHTMLProps */\n\n/**\n * Component used as equivalent of Fragment with unescaped HTML, in cases where\n * it is desirable to render dangerous HTML without needing a wrapper element.\n * To preserve additional props, a `div` wrapper _will_ be created if any props\n * aside from `children` are passed.\n *\n * @param {RawHTMLProps} props Children should be a string of HTML or an array\n * of strings. Other props will be passed through\n * to the div wrapper.\n *\n * @return {JSX.Element} Dangerously-rendering component.\n */\nexport default function RawHTML( { children, ...props } ) {\n\tlet rawHtml = '';\n\n\t// Cast children as an array, and concatenate each element if it is a string.\n\tChildren.toArray( children ).forEach( ( child ) => {\n\t\tif ( typeof child === 'string' && child.trim() !== '' ) {\n\t\t\trawHtml += child;\n\t\t}\n\t} );\n\n\t// The `div` wrapper will be stripped by the `renderElement` serializer in\n\t// `./serialize.js` unless there are non-children props present.\n\treturn createElement( 'div', {\n\t\tdangerouslySetInnerHTML: { __html: rawHtml },\n\t\t...props,\n\t} );\n}\n"]}
|
package/build/react.js
CHANGED
|
@@ -369,11 +369,7 @@ var _react = require("react");
|
|
|
369
369
|
*
|
|
370
370
|
* @return {Array} The concatenated value.
|
|
371
371
|
*/
|
|
372
|
-
function concatChildren() {
|
|
373
|
-
for (var _len = arguments.length, childrenArguments = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
374
|
-
childrenArguments[_key] = arguments[_key];
|
|
375
|
-
}
|
|
376
|
-
|
|
372
|
+
function concatChildren(...childrenArguments) {
|
|
377
373
|
return childrenArguments.reduce((accumulator, children, i) => {
|
|
378
374
|
_react.Children.forEach(children, (child, j) => {
|
|
379
375
|
if (child && 'string' !== typeof child) {
|
|
@@ -400,7 +396,7 @@ function concatChildren() {
|
|
|
400
396
|
|
|
401
397
|
function switchChildrenNodeName(children, nodeName) {
|
|
402
398
|
return children && _react.Children.map(children, (elt, index) => {
|
|
403
|
-
if (typeof
|
|
399
|
+
if (typeof elt?.valueOf() === 'string') {
|
|
404
400
|
return (0, _react.createElement)(nodeName, {
|
|
405
401
|
key: index
|
|
406
402
|
}, elt);
|
package/build/react.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/element/src/react.js"],"names":["concatChildren","childrenArguments","reduce","accumulator","children","i","Children","forEach","child","j","key","join","push","switchChildrenNodeName","nodeName","map","elt","index","valueOf","childrenProp","props"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;;AAJA;AACA;AACA;AACA;;AAiCA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,cAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/element/src/react.js"],"names":["concatChildren","childrenArguments","reduce","accumulator","children","i","Children","forEach","child","j","key","join","push","switchChildrenNodeName","nodeName","map","elt","index","valueOf","childrenProp","props"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;;AAJA;AACA;AACA;AACA;;AAiCA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,cAAT,CAAyB,GAAGC,iBAA5B,EAAgD;AACtD,SAAOA,iBAAiB,CAACC,MAAlB,CAA0B,CAAEC,WAAF,EAAeC,QAAf,EAAyBC,CAAzB,KAAgC;AAChEC,oBAASC,OAAT,CAAkBH,QAAlB,EAA4B,CAAEI,KAAF,EAASC,CAAT,KAAgB;AAC3C,UAAKD,KAAK,IAAI,aAAa,OAAOA,KAAlC,EAA0C;AACzCA,QAAAA,KAAK,GAAG,yBAAcA,KAAd,EAAqB;AAC5BE,UAAAA,GAAG,EAAE,CAAEL,CAAF,EAAKI,CAAL,EAASE,IAAT;AADuB,SAArB,CAAR;AAGA;;AAEDR,MAAAA,WAAW,CAACS,IAAZ,CAAkBJ,KAAlB;AACA,KARD;;AAUA,WAAOL,WAAP;AACA,GAZM,EAYJ,EAZI,CAAP;AAaA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASU,sBAAT,CAAiCT,QAAjC,EAA2CU,QAA3C,EAAsD;AAC5D,SACCV,QAAQ,IACRE,gBAASS,GAAT,CAAcX,QAAd,EAAwB,CAAEY,GAAF,EAAOC,KAAP,KAAkB;AACzC,QAAK,OAAOD,GAAG,EAAEE,OAAL,EAAP,KAA0B,QAA/B,EAA0C;AACzC,aAAO,0BAAeJ,QAAf,EAAyB;AAAEJ,QAAAA,GAAG,EAAEO;AAAP,OAAzB,EAAyCD,GAAzC,CAAP;AACA;;AACD,UAAM;AAAEZ,MAAAA,QAAQ,EAAEe,YAAZ;AAA0B,SAAGC;AAA7B,QAAuCJ,GAAG,CAACI,KAAjD;AACA,WAAO,0BACNN,QADM,EAEN;AAAEJ,MAAAA,GAAG,EAAEO,KAAP;AAAc,SAAGG;AAAjB,KAFM,EAGND,YAHM,CAAP;AAKA,GAVD,CAFD;AAcA","sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line @typescript-eslint/no-restricted-imports\nimport {\n\tChildren,\n\tcloneElement,\n\tComponent,\n\tcreateContext,\n\tcreateElement,\n\tcreateRef,\n\tforwardRef,\n\tFragment,\n\tisValidElement,\n\tmemo,\n\tStrictMode,\n\tuseCallback,\n\tuseContext,\n\tuseDebugValue,\n\tuseDeferredValue,\n\tuseEffect,\n\tuseId,\n\tuseMemo,\n\tuseImperativeHandle,\n\tuseInsertionEffect,\n\tuseLayoutEffect,\n\tuseReducer,\n\tuseRef,\n\tuseState,\n\tuseSyncExternalStore,\n\tuseTransition,\n\tstartTransition,\n\tlazy,\n\tSuspense,\n} from 'react';\n\n/**\n * Object containing a React element.\n *\n * @typedef {import('react').ReactElement} WPElement\n */\n\n/**\n * Object containing a React component.\n *\n * @typedef {import('react').ComponentType} WPComponent\n */\n\n/**\n * Object containing a React synthetic event.\n *\n * @typedef {import('react').SyntheticEvent} WPSyntheticEvent\n */\n\n/**\n * Object containing a React synthetic event.\n *\n * @template T\n * @typedef {import('react').RefObject<T>} RefObject<T>\n */\n\n/**\n * Object that provides utilities for dealing with React children.\n */\nexport { Children };\n\n/**\n * Creates a copy of an element with extended props.\n *\n * @param {WPElement} element Element\n * @param {?Object} props Props to apply to cloned element\n *\n * @return {WPElement} Cloned element.\n */\nexport { cloneElement };\n\n/**\n * A base class to create WordPress Components (Refs, state and lifecycle hooks)\n */\nexport { Component };\n\n/**\n * Creates a context object containing two components: a provider and consumer.\n *\n * @param {Object} defaultValue A default data stored in the context.\n *\n * @return {Object} Context object.\n */\nexport { createContext };\n\n/**\n * Returns a new element of given type. Type can be either a string tag name or\n * another function which itself returns an element.\n *\n * @param {?(string|Function)} type Tag name or element creator\n * @param {Object} props Element properties, either attribute\n * set to apply to DOM node or values to\n * pass through to element creator\n * @param {...WPElement} children Descendant elements\n *\n * @return {WPElement} Element.\n */\nexport { createElement };\n\n/**\n * Returns an object tracking a reference to a rendered element via its\n * `current` property as either a DOMElement or Element, dependent upon the\n * type of element rendered with the ref attribute.\n *\n * @return {Object} Ref object.\n */\nexport { createRef };\n\n/**\n * Component enhancer used to enable passing a ref to its wrapped component.\n * Pass a function argument which receives `props` and `ref` as its arguments,\n * returning an element using the forwarded ref. The return value is a new\n * component which forwards its ref.\n *\n * @param {Function} forwarder Function passed `props` and `ref`, expected to\n * return an element.\n *\n * @return {WPComponent} Enhanced component.\n */\nexport { forwardRef };\n\n/**\n * A component which renders its children without any wrapping element.\n */\nexport { Fragment };\n\n/**\n * Checks if an object is a valid WPElement.\n *\n * @param {Object} objectToCheck The object to be checked.\n *\n * @return {boolean} true if objectToTest is a valid WPElement and false otherwise.\n */\nexport { isValidElement };\n\n/**\n * @see https://reactjs.org/docs/react-api.html#reactmemo\n */\nexport { memo };\n\n/**\n * Component that activates additional checks and warnings for its descendants.\n */\nexport { StrictMode };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usecallback\n */\nexport { useCallback };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usecontext\n */\nexport { useContext };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usedebugvalue\n */\nexport { useDebugValue };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usedeferredvalue\n */\nexport { useDeferredValue };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useeffect\n */\nexport { useEffect };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useid\n */\nexport { useId };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useimperativehandle\n */\nexport { useImperativeHandle };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useinsertioneffect\n */\nexport { useInsertionEffect };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#uselayouteffect\n */\nexport { useLayoutEffect };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usememo\n */\nexport { useMemo };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usereducer\n */\nexport { useReducer };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useref\n */\nexport { useRef };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usestate\n */\nexport { useState };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usesyncexternalstore\n */\nexport { useSyncExternalStore };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usetransition\n */\nexport { useTransition };\n\n/**\n * @see https://reactjs.org/docs/react-api.html#starttransition\n */\nexport { startTransition };\n\n/**\n * @see https://reactjs.org/docs/react-api.html#reactlazy\n */\nexport { lazy };\n\n/**\n * @see https://reactjs.org/docs/react-api.html#reactsuspense\n */\nexport { Suspense };\n\n/**\n * Concatenate two or more React children objects.\n *\n * @param {...?Object} childrenArguments Array of children arguments (array of arrays/strings/objects) to concatenate.\n *\n * @return {Array} The concatenated value.\n */\nexport function concatChildren( ...childrenArguments ) {\n\treturn childrenArguments.reduce( ( accumulator, children, i ) => {\n\t\tChildren.forEach( children, ( child, j ) => {\n\t\t\tif ( child && 'string' !== typeof child ) {\n\t\t\t\tchild = cloneElement( child, {\n\t\t\t\t\tkey: [ i, j ].join(),\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\taccumulator.push( child );\n\t\t} );\n\n\t\treturn accumulator;\n\t}, [] );\n}\n\n/**\n * Switches the nodeName of all the elements in the children object.\n *\n * @param {?Object} children Children object.\n * @param {string} nodeName Node name.\n *\n * @return {?Object} The updated children object.\n */\nexport function switchChildrenNodeName( children, nodeName ) {\n\treturn (\n\t\tchildren &&\n\t\tChildren.map( children, ( elt, index ) => {\n\t\t\tif ( typeof elt?.valueOf() === 'string' ) {\n\t\t\t\treturn createElement( nodeName, { key: index }, elt );\n\t\t\t}\n\t\t\tconst { children: childrenProp, ...props } = elt.props;\n\t\t\treturn createElement(\n\t\t\t\tnodeName,\n\t\t\t\t{ key: index, ...props },\n\t\t\t\tchildrenProp\n\t\t\t);\n\t\t} )\n\t);\n}\n"]}
|
package/build/serialize.js
CHANGED
|
@@ -303,9 +303,7 @@ function getNormalStylePropertyValue(property, value) {
|
|
|
303
303
|
*/
|
|
304
304
|
|
|
305
305
|
|
|
306
|
-
function renderElement(element, context) {
|
|
307
|
-
let legacyContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
308
|
-
|
|
306
|
+
function renderElement(element, context, legacyContext = {}) {
|
|
309
307
|
if (null === element || undefined === element || false === element) {
|
|
310
308
|
return '';
|
|
311
309
|
}
|
|
@@ -384,8 +382,7 @@ function renderElement(element, context) {
|
|
|
384
382
|
*/
|
|
385
383
|
|
|
386
384
|
|
|
387
|
-
function renderNativeComponent(type, props, context) {
|
|
388
|
-
let legacyContext = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
385
|
+
function renderNativeComponent(type, props, context, legacyContext = {}) {
|
|
389
386
|
let content = '';
|
|
390
387
|
|
|
391
388
|
if (type === 'textarea' && props.hasOwnProperty('value')) {
|
|
@@ -431,8 +428,7 @@ function renderNativeComponent(type, props, context) {
|
|
|
431
428
|
*/
|
|
432
429
|
|
|
433
430
|
|
|
434
|
-
function renderComponent(Component, props, context) {
|
|
435
|
-
let legacyContext = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
431
|
+
function renderComponent(Component, props, context, legacyContext = {}) {
|
|
436
432
|
const instance = new
|
|
437
433
|
/** @type {import('react').ComponentClass} */
|
|
438
434
|
Component(props, legacyContext);
|
|
@@ -461,8 +457,7 @@ function renderComponent(Component, props, context) {
|
|
|
461
457
|
*/
|
|
462
458
|
|
|
463
459
|
|
|
464
|
-
function renderChildren(children, context) {
|
|
465
|
-
let legacyContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
460
|
+
function renderChildren(children, context, legacyContext = {}) {
|
|
466
461
|
let result = '';
|
|
467
462
|
children = Array.isArray(children) ? children : [children];
|
|
468
463
|
|
package/build/serialize.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/element/src/serialize.js"],"names":["Provider","Consumer","undefined","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","getNormalStylePropertyName","property","startsWith","getNormalStylePropertyValue","has","renderElement","element","context","legacyContext","Array","isArray","renderChildren","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","isBooleanAttribute","isMeaningfulAttribute","style","normalName","normalValue"],"mappings":";;;;;;;;;;;;;;;AA8BA;;AACA;;AAKA;;AASA;;AACA;;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,MAAM;AAAEA,EAAAA,QAAF;AAAYC,EAAAA;AAAZ,IAAyB,0BAAeC,SAAf,CAA/B;AACA,MAAMC,UAAU,GAAG,uBAAY,MAAM;AACpC,SAAO,IAAP;AACA,CAFkB,CAAnB;AAIA;AACA;AACA;AACA;AACA;;AACA,MAAMC,gBAAgB,GAAG,IAAIC,GAAJ,CAAS,CAAE,QAAF,EAAY,SAAZ,EAAuB,QAAvB,CAAT,CAAzB;AAEA;AACA;AACA;AACA;AACA;;AACA,MAAMC,iBAAiB,GAAG,IAAID,GAAJ,CAAS,CAClC,MADkC,EAElC,MAFkC,EAGlC,IAHkC,EAIlC,KAJkC,EAKlC,SALkC,EAMlC,OANkC,EAOlC,IAPkC,EAQlC,KARkC,EASlC,OATkC,EAUlC,QAVkC,EAWlC,MAXkC,EAYlC,MAZkC,EAalC,OAbkC,EAclC,QAdkC,EAelC,OAfkC,EAgBlC,KAhBkC,CAAT,CAA1B;AAmBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAME,kBAAkB,GAAG,IAAIF,GAAJ,CAAS,CACnC,iBADmC,EAEnC,qBAFmC,EAGnC,gBAHmC,EAInC,OAJmC,EAKnC,WALmC,EAMnC,UANmC,EAOnC,SAPmC,EAQnC,UARmC,EASnC,SATmC,EAUnC,OAVmC,EAWnC,UAXmC,EAYnC,UAZmC,EAanC,gBAbmC,EAcnC,QAdmC,EAenC,OAfmC,EAgBnC,WAhBmC,EAiBnC,MAjBmC,EAkBnC,UAlBmC,EAmBn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ACA;;AAED,QAAKoD,MAAL,EAAc;AACbA,MAAAA,MAAM,IAAI,GAAV;AACA,KAFD,MAEO;AACNA,MAAAA,MAAM,GAAG,EAAT;AACA;;AAED,UAAMO,UAAU,GAAGhD,0BAA0B,CAAEC,QAAF,CAA7C;AACA,UAAMgD,WAAW,GAAG9C,2BAA2B,CAAEF,QAAF,EAAYZ,KAAZ,CAA/C;AACAoD,IAAAA,MAAM,IAAIO,UAAU,GAAG,GAAb,GAAmBC,WAA7B;AACA;;AAED,SAAOR,MAAP;AACA;;eAEcpC,a","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').WPElement} WPElement */\n\nconst { Provider, Consumer } = createContext( undefined );\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! 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').WPComponent} WPComponent */\n\n/**\n * Serializes a non-native component type to string.\n *\n * @param {WPComponent} 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 {import('react').ReactNodeArray} 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 serializeable 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"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/element/src/serialize.js"],"names":["Provider","Consumer","undefined","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","getNormalStylePropertyName","property","startsWith","getNormalStylePropertyValue","has","renderElement","element","context","legacyContext","Array","isArray","renderChildren","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","isBooleanAttribute","isMeaningfulAttribute","style","normalName","normalValue"],"mappings":";;;;;;;;;;;;;;;AA8BA;;AACA;;AAKA;;AASA;;AACA;;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,MAAM;AAAEA,EAAAA,QAAF;AAAYC,EAAAA;AAAZ,IAAyB,0BAAeC,SAAf,CAA/B;AACA,MAAMC,UAAU,GAAG,uBAAY,MAAM;AACpC,SAAO,IAAP;AACA,CAFkB,CAAnB;AAIA;AACA;AACA;AACA;AACA;;AACA,MAAMC,gBAAgB,GAAG,IAAIC,GAAJ,CAAS,CAAE,QAAF,EAAY,SAAZ,EAAuB,QAAvB,CAAT,CAAzB;AAEA;AACA;AACA;AACA;AACA;;AACA,MAAMC,iBAAiB,GAAG,IAAID,GAAJ,CAAS,CAClC,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qC1B;AACA;;AACA,QAAK0D,kBAAL,EAA0B;AACzB;AACA;;AAED,QAAK,OAAOxD,KAAP,KAAiB,QAAtB,EAAiC;AAChCA,MAAAA,KAAK,GAAG,iCAAiBA,KAAjB,CAAR;AACA;;AAEDoD,IAAAA,MAAM,IAAI,OAAOpD,KAAP,GAAe,GAAzB;AACA;;AAED,SAAOoD,MAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASnD,WAAT,CAAsByD,KAAtB,EAA8B;AACpC;AACA,MAAK,CAAE,kCAAeA,KAAf,CAAP,EAAgC;AAC/B,WAAOA,KAAP;AACA;;AAED,MAAIN,MAAJ;;AAEA,OAAM,MAAMxC,QAAZ,IAAwB8C,KAAxB,EAAgC;AAC/B,UAAM1D,KAAK,GAAG0D,KAAK,CAAE9C,QAAF,CAAnB;;AACA,QAAK,SAASZ,KAAT,IAAkBjB,SAAS,KAAKiB,KAArC,EAA6C;AAC5C;AACA;;AAED,QAAKoD,MAAL,EAAc;AACbA,MAAAA,MAAM,IAAI,GAAV;AACA,KAFD,MAEO;AACNA,MAAAA,MAAM,GAAG,EAAT;AACA;;AAED,UAAMO,UAAU,GAAGhD,0BAA0B,CAAEC,QAAF,CAA7C;AACA,UAAMgD,WAAW,GAAG9C,2BAA2B,CAAEF,QAAF,EAAYZ,KAAZ,CAA/C;AACAoD,IAAAA,MAAM,IAAIO,UAAU,GAAG,GAAb,GAAmBC,WAA7B;AACA;;AAED,SAAOR,MAAP;AACA;;eAEcpC,a","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').WPElement} WPElement */\n\nconst { Provider, Consumer } = createContext( undefined );\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! 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').WPComponent} WPComponent */\n\n/**\n * Serializes a non-native component type to string.\n *\n * @param {WPComponent} 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 {import('react').ReactNodeArray} 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 serializeable 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"]}
|
package/build/utils.js
CHANGED
|
@@ -16,7 +16,7 @@ const isEmptyElement = element => {
|
|
|
16
16
|
return false;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
if (typeof
|
|
19
|
+
if (typeof element?.valueOf() === 'string' || Array.isArray(element)) {
|
|
20
20
|
return !element.length;
|
|
21
21
|
}
|
|
22
22
|
|
package/build/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/element/src/utils.js"],"names":["isEmptyElement","element","valueOf","Array","isArray","length"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,cAAc,GAAKC,OAAF,IAAe;AAC5C,MAAK,OAAOA,OAAP,KAAmB,QAAxB,EAAmC;AAClC,WAAO,KAAP;AACA;;AAED,MAAK,
|
|
1
|
+
{"version":3,"sources":["@wordpress/element/src/utils.js"],"names":["isEmptyElement","element","valueOf","Array","isArray","length"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,cAAc,GAAKC,OAAF,IAAe;AAC5C,MAAK,OAAOA,OAAP,KAAmB,QAAxB,EAAmC;AAClC,WAAO,KAAP;AACA;;AAED,MAAK,OAAOA,OAAO,EAAEC,OAAT,EAAP,KAA8B,QAA9B,IAA0CC,KAAK,CAACC,OAAN,CAAeH,OAAf,CAA/C,EAA0E;AACzE,WAAO,CAAEA,OAAO,CAACI,MAAjB;AACA;;AAED,SAAO,CAAEJ,OAAT;AACA,CAVM","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"]}
|
package/build-module/raw-html.js
CHANGED
|
@@ -17,11 +17,10 @@ import { Children, createElement } from './react';
|
|
|
17
17
|
* @return {JSX.Element} Dangerously-rendering component.
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
|
-
export default function RawHTML(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
} = _ref;
|
|
20
|
+
export default function RawHTML({
|
|
21
|
+
children,
|
|
22
|
+
...props
|
|
23
|
+
}) {
|
|
25
24
|
let rawHtml = ''; // Cast children as an array, and concatenate each element if it is a string.
|
|
26
25
|
|
|
27
26
|
Children.toArray(children).forEach(child => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/element/src/raw-html.js"],"names":["Children","createElement","RawHTML","children","props","rawHtml","toArray","forEach","child","trim","dangerouslySetInnerHTML","__html"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAT,EAAmBC,aAAnB,QAAwC,SAAxC;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,OAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/element/src/raw-html.js"],"names":["Children","createElement","RawHTML","children","props","rawHtml","toArray","forEach","child","trim","dangerouslySetInnerHTML","__html"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAT,EAAmBC,aAAnB,QAAwC,SAAxC;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,OAAT,CAAkB;AAAEC,EAAAA,QAAF;AAAY,KAAGC;AAAf,CAAlB,EAA2C;AACzD,MAAIC,OAAO,GAAG,EAAd,CADyD,CAGzD;;AACAL,EAAAA,QAAQ,CAACM,OAAT,CAAkBH,QAAlB,EAA6BI,OAA7B,CAAwCC,KAAF,IAAa;AAClD,QAAK,OAAOA,KAAP,KAAiB,QAAjB,IAA6BA,KAAK,CAACC,IAAN,OAAiB,EAAnD,EAAwD;AACvDJ,MAAAA,OAAO,IAAIG,KAAX;AACA;AACD,GAJD,EAJyD,CAUzD;AACA;;AACA,SAAOP,aAAa,CAAE,KAAF,EAAS;AAC5BS,IAAAA,uBAAuB,EAAE;AAAEC,MAAAA,MAAM,EAAEN;AAAV,KADG;AAE5B,OAAGD;AAFyB,GAAT,CAApB;AAIA","sourcesContent":["/**\n * Internal dependencies\n */\nimport { Children, createElement } from './react';\n\n/** @typedef {{children: string} & import('react').ComponentPropsWithoutRef<'div'>} RawHTMLProps */\n\n/**\n * Component used as equivalent of Fragment with unescaped HTML, in cases where\n * it is desirable to render dangerous HTML without needing a wrapper element.\n * To preserve additional props, a `div` wrapper _will_ be created if any props\n * aside from `children` are passed.\n *\n * @param {RawHTMLProps} props Children should be a string of HTML or an array\n * of strings. Other props will be passed through\n * to the div wrapper.\n *\n * @return {JSX.Element} Dangerously-rendering component.\n */\nexport default function RawHTML( { children, ...props } ) {\n\tlet rawHtml = '';\n\n\t// Cast children as an array, and concatenate each element if it is a string.\n\tChildren.toArray( children ).forEach( ( child ) => {\n\t\tif ( typeof child === 'string' && child.trim() !== '' ) {\n\t\t\trawHtml += child;\n\t\t}\n\t} );\n\n\t// The `div` wrapper will be stripped by the `renderElement` serializer in\n\t// `./serialize.js` unless there are non-children props present.\n\treturn createElement( 'div', {\n\t\tdangerouslySetInnerHTML: { __html: rawHtml },\n\t\t...props,\n\t} );\n}\n"]}
|
package/build-module/react.js
CHANGED
|
@@ -215,11 +215,7 @@ export { Suspense };
|
|
|
215
215
|
* @return {Array} The concatenated value.
|
|
216
216
|
*/
|
|
217
217
|
|
|
218
|
-
export function concatChildren() {
|
|
219
|
-
for (var _len = arguments.length, childrenArguments = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
220
|
-
childrenArguments[_key] = arguments[_key];
|
|
221
|
-
}
|
|
222
|
-
|
|
218
|
+
export function concatChildren(...childrenArguments) {
|
|
223
219
|
return childrenArguments.reduce((accumulator, children, i) => {
|
|
224
220
|
Children.forEach(children, (child, j) => {
|
|
225
221
|
if (child && 'string' !== typeof child) {
|
|
@@ -244,7 +240,7 @@ export function concatChildren() {
|
|
|
244
240
|
|
|
245
241
|
export function switchChildrenNodeName(children, nodeName) {
|
|
246
242
|
return children && Children.map(children, (elt, index) => {
|
|
247
|
-
if (typeof
|
|
243
|
+
if (typeof elt?.valueOf() === 'string') {
|
|
248
244
|
return createElement(nodeName, {
|
|
249
245
|
key: index
|
|
250
246
|
}, elt);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/element/src/react.js"],"names":["Children","cloneElement","Component","createContext","createElement","createRef","forwardRef","Fragment","isValidElement","memo","StrictMode","useCallback","useContext","useDebugValue","useDeferredValue","useEffect","useId","useMemo","useImperativeHandle","useInsertionEffect","useLayoutEffect","useReducer","useRef","useState","useSyncExternalStore","useTransition","startTransition","lazy","Suspense","concatChildren","childrenArguments","reduce","accumulator","children","i","forEach","child","j","key","join","push","switchChildrenNodeName","nodeName","map","elt","index","valueOf","childrenProp","props"],"mappings":"AAAA;AACA;AACA;AACA;AACA,SACCA,QADD,EAECC,YAFD,EAGCC,SAHD,EAICC,aAJD,EAKCC,aALD,EAMCC,SAND,EAOCC,UAPD,EAQCC,QARD,EASCC,cATD,EAUCC,IAVD,EAWCC,UAXD,EAYCC,WAZD,EAaCC,UAbD,EAcCC,aAdD,EAeCC,gBAfD,EAgBCC,SAhBD,EAiBCC,KAjBD,EAkBCC,OAlBD,EAmBCC,mBAnBD,EAoBCC,kBApBD,EAqBCC,eArBD,EAsBCC,UAtBD,EAuBCC,MAvBD,EAwBCC,QAxBD,EAyBCC,oBAzBD,EA0BCC,aA1BD,EA2BCC,eA3BD,EA4BCC,IA5BD,EA6BCC,QA7BD,QA8BO,OA9BP;AAgCA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AACA,SAAS5B,QAAT;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,YAAT;AAEA;AACA;AACA;;AACA,SAASC,SAAT;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,aAAT;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,aAAT;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,SAAT;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,UAAT;AAEA;AACA;AACA;;AACA,SAASC,QAAT;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,cAAT;AAEA;AACA;AACA;;AACA,SAASC,IAAT;AAEA;AACA;AACA;;AACA,SAASC,UAAT;AAEA;AACA;AACA;;AACA,SAASC,WAAT;AAEA;AACA;AACA;;AACA,SAASC,UAAT;AAEA;AACA;AACA;;AACA,SAASC,aAAT;AAEA;AACA;AACA;;AACA,SAASC,gBAAT;AAEA;AACA;AACA;;AACA,SAASC,SAAT;AAEA;AACA;AACA;;AACA,SAASC,KAAT;AAEA;AACA;AACA;;AACA,S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AAP,aAAOA,GAAP,uBAAOA,GAAG,CAAEE,OAAL,EAAP,MAA0B,QAA/B,EAA0C;AACzC,aAAO1C,aAAa,CAAEsC,QAAF,EAAY;AAAEJ,QAAAA,GAAG,EAAEO;AAAP,OAAZ,EAA4BD,GAA5B,CAApB;AACA;;AACD,UAAM;AAAEX,MAAAA,QAAQ,EAAEc,YAAZ;AAA0B,SAAGC;AAA7B,QAAuCJ,GAAG,CAACI,KAAjD;AACA,WAAO5C,aAAa,CACnBsC,QADmB,EAEnB;AAAEJ,MAAAA,GAAG,EAAEO,KAAP;AAAc,SAAGG;AAAjB,KAFmB,EAGnBD,YAHmB,CAApB;AAKA,GAVD,CAFD;AAcA","sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line @typescript-eslint/no-restricted-imports\nimport {\n\tChildren,\n\tcloneElement,\n\tComponent,\n\tcreateContext,\n\tcreateElement,\n\tcreateRef,\n\tforwardRef,\n\tFragment,\n\tisValidElement,\n\tmemo,\n\tStrictMode,\n\tuseCallback,\n\tuseContext,\n\tuseDebugValue,\n\tuseDeferredValue,\n\tuseEffect,\n\tuseId,\n\tuseMemo,\n\tuseImperativeHandle,\n\tuseInsertionEffect,\n\tuseLayoutEffect,\n\tuseReducer,\n\tuseRef,\n\tuseState,\n\tuseSyncExternalStore,\n\tuseTransition,\n\tstartTransition,\n\tlazy,\n\tSuspense,\n} from 'react';\n\n/**\n * Object containing a React element.\n *\n * @typedef {import('react').ReactElement} WPElement\n */\n\n/**\n * Object containing a React component.\n *\n * @typedef {import('react').ComponentType} WPComponent\n */\n\n/**\n * Object containing a React synthetic event.\n *\n * @typedef {import('react').SyntheticEvent} WPSyntheticEvent\n */\n\n/**\n * Object containing a React synthetic event.\n *\n * @template T\n * @typedef {import('react').RefObject<T>} RefObject<T>\n */\n\n/**\n * Object that provides utilities for dealing with React children.\n */\nexport { Children };\n\n/**\n * Creates a copy of an element with extended props.\n *\n * @param {WPElement} element Element\n * @param {?Object} props Props to apply to cloned element\n *\n * @return {WPElement} Cloned element.\n */\nexport { cloneElement };\n\n/**\n * A base class to create WordPress Components (Refs, state and lifecycle hooks)\n */\nexport { Component };\n\n/**\n * Creates a context object containing two components: a provider and consumer.\n *\n * @param {Object} defaultValue A default data stored in the context.\n *\n * @return {Object} Context object.\n */\nexport { createContext };\n\n/**\n * Returns a new element of given type. Type can be either a string tag name or\n * another function which itself returns an element.\n *\n * @param {?(string|Function)} type Tag name or element creator\n * @param {Object} props Element properties, either attribute\n * set to apply to DOM node or values to\n * pass through to element creator\n * @param {...WPElement} children Descendant elements\n *\n * @return {WPElement} Element.\n */\nexport { createElement };\n\n/**\n * Returns an object tracking a reference to a rendered element via its\n * `current` property as either a DOMElement or Element, dependent upon the\n * type of element rendered with the ref attribute.\n *\n * @return {Object} Ref object.\n */\nexport { createRef };\n\n/**\n * Component enhancer used to enable passing a ref to its wrapped component.\n * Pass a function argument which receives `props` and `ref` as its arguments,\n * returning an element using the forwarded ref. The return value is a new\n * component which forwards its ref.\n *\n * @param {Function} forwarder Function passed `props` and `ref`, expected to\n * return an element.\n *\n * @return {WPComponent} Enhanced component.\n */\nexport { forwardRef };\n\n/**\n * A component which renders its children without any wrapping element.\n */\nexport { Fragment };\n\n/**\n * Checks if an object is a valid WPElement.\n *\n * @param {Object} objectToCheck The object to be checked.\n *\n * @return {boolean} true if objectToTest is a valid WPElement and false otherwise.\n */\nexport { isValidElement };\n\n/**\n * @see https://reactjs.org/docs/react-api.html#reactmemo\n */\nexport { memo };\n\n/**\n * Component that activates additional checks and warnings for its descendants.\n */\nexport { StrictMode };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usecallback\n */\nexport { useCallback };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usecontext\n */\nexport { useContext };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usedebugvalue\n */\nexport { useDebugValue };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usedeferredvalue\n */\nexport { useDeferredValue };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useeffect\n */\nexport { useEffect };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useid\n */\nexport { useId };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useimperativehandle\n */\nexport { useImperativeHandle };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useinsertioneffect\n */\nexport { useInsertionEffect };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#uselayouteffect\n */\nexport { useLayoutEffect };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usememo\n */\nexport { useMemo };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usereducer\n */\nexport { useReducer };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useref\n */\nexport { useRef };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usestate\n */\nexport { useState };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usesyncexternalstore\n */\nexport { useSyncExternalStore };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usetransition\n */\nexport { useTransition };\n\n/**\n * @see https://reactjs.org/docs/react-api.html#starttransition\n */\nexport { startTransition };\n\n/**\n * @see https://reactjs.org/docs/react-api.html#reactlazy\n */\nexport { lazy };\n\n/**\n * @see https://reactjs.org/docs/react-api.html#reactsuspense\n */\nexport { Suspense };\n\n/**\n * Concatenate two or more React children objects.\n *\n * @param {...?Object} childrenArguments Array of children arguments (array of arrays/strings/objects) to concatenate.\n *\n * @return {Array} The concatenated value.\n */\nexport function concatChildren( ...childrenArguments ) {\n\treturn childrenArguments.reduce( ( accumulator, children, i ) => {\n\t\tChildren.forEach( children, ( child, j ) => {\n\t\t\tif ( child && 'string' !== typeof child ) {\n\t\t\t\tchild = cloneElement( child, {\n\t\t\t\t\tkey: [ i, j ].join(),\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\taccumulator.push( child );\n\t\t} );\n\n\t\treturn accumulator;\n\t}, [] );\n}\n\n/**\n * Switches the nodeName of all the elements in the children object.\n *\n * @param {?Object} children Children object.\n * @param {string} nodeName Node name.\n *\n * @return {?Object} The updated children object.\n */\nexport function switchChildrenNodeName( children, nodeName ) {\n\treturn (\n\t\tchildren &&\n\t\tChildren.map( children, ( elt, index ) => {\n\t\t\tif ( typeof elt?.valueOf() === 'string' ) {\n\t\t\t\treturn createElement( nodeName, { key: index }, elt );\n\t\t\t}\n\t\t\tconst { children: childrenProp, ...props } = elt.props;\n\t\t\treturn createElement(\n\t\t\t\tnodeName,\n\t\t\t\t{ key: index, ...props },\n\t\t\t\tchildrenProp\n\t\t\t);\n\t\t} )\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/element/src/react.js"],"names":["Children","cloneElement","Component","createContext","createElement","createRef","forwardRef","Fragment","isValidElement","memo","StrictMode","useCallback","useContext","useDebugValue","useDeferredValue","useEffect","useId","useMemo","useImperativeHandle","useInsertionEffect","useLayoutEffect","useReducer","useRef","useState","useSyncExternalStore","useTransition","startTransition","lazy","Suspense","concatChildren","childrenArguments","reduce","accumulator","children","i","forEach","child","j","key","join","push","switchChildrenNodeName","nodeName","map","elt","index","valueOf","childrenProp","props"],"mappings":"AAAA;AACA;AACA;AACA;AACA,SACCA,QADD,EAECC,YAFD,EAGCC,SAHD,EAICC,aAJD,EAKCC,aALD,EAMCC,SAND,EAOCC,UAPD,EAQCC,QARD,EASCC,cATD,EAUCC,IAVD,EAWCC,UAXD,EAYCC,WAZD,EAaCC,UAbD,EAcCC,aAdD,EAeCC,gBAfD,EAgBCC,SAhBD,EAiBCC,KAjBD,EAkBCC,OAlBD,EAmBCC,mBAnBD,EAoBCC,kBApBD,EAqBCC,eArBD,EAsBCC,UAtBD,EAuBCC,MAvBD,EAwBCC,QAxBD,EAyBCC,oBAzBD,EA0BCC,aA1BD,EA2BCC,eA3BD,EA4BCC,IA5BD,EA6BCC,QA7BD,QA8BO,OA9BP;AAgCA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AACA,SAAS5B,QAAT;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,YAAT;AAEA;AACA;AACA;;AACA,SAASC,SAAT;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,aAAT;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,aAAT;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,SAAT;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,UAAT;AAEA;AACA;AACA;;AACA,SAASC,QAAT;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,cAAT;AAEA;AACA;AACA;;AACA,SAASC,IAAT;AAEA;AACA;AACA;;AACA,SAASC,UAAT;AAEA;AACA;AACA;;AACA,SAASC,WAAT;AAEA;AACA;AACA;;AACA,SAASC,UAAT;AAEA;AACA;AACA;;AACA,SAASC,aAAT;AAEA;AACA;AACA;;AACA,SAASC,gBAAT;AAEA;AACA;AACA;;AACA,SAASC,SAAT;AAEA;AACA;AACA;;AACA,SAASC,KAAT;AAEA;AACA;AACA;;AACA,SAASE,mBAAT;AAEA;AACA;AACA;;AACA,SAASC,kBAAT;AAEA;AACA;AACA;;AACA,SAASC,eAAT;AAEA;AACA;AACA;;AACA,SAASH,OAAT;AAEA;AACA;AACA;;AACA,SAASI,UAAT;AAEA;AACA;AACA;;AACA,SAASC,MAAT;AAEA;AACA;AACA;;AACA,SAASC,QAAT;AAEA;AACA;AACA;;AACA,SAASC,oBAAT;AAEA;AACA;AACA;;AACA,SAASC,aAAT;AAEA;AACA;AACA;;AACA,SAASC,eAAT;AAEA;AACA;AACA;;AACA,SAASC,IAAT;AAEA;AACA;AACA;;AACA,SAASC,QAAT;AAEA;AACA;AACA;AACA;A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disable-next-line @typescript-eslint/no-restricted-imports\nimport {\n\tChildren,\n\tcloneElement,\n\tComponent,\n\tcreateContext,\n\tcreateElement,\n\tcreateRef,\n\tforwardRef,\n\tFragment,\n\tisValidElement,\n\tmemo,\n\tStrictMode,\n\tuseCallback,\n\tuseContext,\n\tuseDebugValue,\n\tuseDeferredValue,\n\tuseEffect,\n\tuseId,\n\tuseMemo,\n\tuseImperativeHandle,\n\tuseInsertionEffect,\n\tuseLayoutEffect,\n\tuseReducer,\n\tuseRef,\n\tuseState,\n\tuseSyncExternalStore,\n\tuseTransition,\n\tstartTransition,\n\tlazy,\n\tSuspense,\n} from 'react';\n\n/**\n * Object containing a React element.\n *\n * @typedef {import('react').ReactElement} WPElement\n */\n\n/**\n * Object containing a React component.\n *\n * @typedef {import('react').ComponentType} WPComponent\n */\n\n/**\n * Object containing a React synthetic event.\n *\n * @typedef {import('react').SyntheticEvent} WPSyntheticEvent\n */\n\n/**\n * Object containing a React synthetic event.\n *\n * @template T\n * @typedef {import('react').RefObject<T>} RefObject<T>\n */\n\n/**\n * Object that provides utilities for dealing with React children.\n */\nexport { Children };\n\n/**\n * Creates a copy of an element with extended props.\n *\n * @param {WPElement} element Element\n * @param {?Object} props Props to apply to cloned element\n *\n * @return {WPElement} Cloned element.\n */\nexport { cloneElement };\n\n/**\n * A base class to create WordPress Components (Refs, state and lifecycle hooks)\n */\nexport { Component };\n\n/**\n * Creates a context object containing two components: a provider and consumer.\n *\n * @param {Object} defaultValue A default data stored in the context.\n *\n * @return {Object} Context object.\n */\nexport { createContext };\n\n/**\n * Returns a new element of given type. Type can be either a string tag name or\n * another function which itself returns an element.\n *\n * @param {?(string|Function)} type Tag name or element creator\n * @param {Object} props Element properties, either attribute\n * set to apply to DOM node or values to\n * pass through to element creator\n * @param {...WPElement} children Descendant elements\n *\n * @return {WPElement} Element.\n */\nexport { createElement };\n\n/**\n * Returns an object tracking a reference to a rendered element via its\n * `current` property as either a DOMElement or Element, dependent upon the\n * type of element rendered with the ref attribute.\n *\n * @return {Object} Ref object.\n */\nexport { createRef };\n\n/**\n * Component enhancer used to enable passing a ref to its wrapped component.\n * Pass a function argument which receives `props` and `ref` as its arguments,\n * returning an element using the forwarded ref. The return value is a new\n * component which forwards its ref.\n *\n * @param {Function} forwarder Function passed `props` and `ref`, expected to\n * return an element.\n *\n * @return {WPComponent} Enhanced component.\n */\nexport { forwardRef };\n\n/**\n * A component which renders its children without any wrapping element.\n */\nexport { Fragment };\n\n/**\n * Checks if an object is a valid WPElement.\n *\n * @param {Object} objectToCheck The object to be checked.\n *\n * @return {boolean} true if objectToTest is a valid WPElement and false otherwise.\n */\nexport { isValidElement };\n\n/**\n * @see https://reactjs.org/docs/react-api.html#reactmemo\n */\nexport { memo };\n\n/**\n * Component that activates additional checks and warnings for its descendants.\n */\nexport { StrictMode };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usecallback\n */\nexport { useCallback };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usecontext\n */\nexport { useContext };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usedebugvalue\n */\nexport { useDebugValue };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usedeferredvalue\n */\nexport { useDeferredValue };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useeffect\n */\nexport { useEffect };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useid\n */\nexport { useId };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useimperativehandle\n */\nexport { useImperativeHandle };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useinsertioneffect\n */\nexport { useInsertionEffect };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#uselayouteffect\n */\nexport { useLayoutEffect };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usememo\n */\nexport { useMemo };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usereducer\n */\nexport { useReducer };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useref\n */\nexport { useRef };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usestate\n */\nexport { useState };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usesyncexternalstore\n */\nexport { useSyncExternalStore };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usetransition\n */\nexport { useTransition };\n\n/**\n * @see https://reactjs.org/docs/react-api.html#starttransition\n */\nexport { startTransition };\n\n/**\n * @see https://reactjs.org/docs/react-api.html#reactlazy\n */\nexport { lazy };\n\n/**\n * @see https://reactjs.org/docs/react-api.html#reactsuspense\n */\nexport { Suspense };\n\n/**\n * Concatenate two or more React children objects.\n *\n * @param {...?Object} childrenArguments Array of children arguments (array of arrays/strings/objects) to concatenate.\n *\n * @return {Array} The concatenated value.\n */\nexport function concatChildren( ...childrenArguments ) {\n\treturn childrenArguments.reduce( ( accumulator, children, i ) => {\n\t\tChildren.forEach( children, ( child, j ) => {\n\t\t\tif ( child && 'string' !== typeof child ) {\n\t\t\t\tchild = cloneElement( child, {\n\t\t\t\t\tkey: [ i, j ].join(),\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\taccumulator.push( child );\n\t\t} );\n\n\t\treturn accumulator;\n\t}, [] );\n}\n\n/**\n * Switches the nodeName of all the elements in the children object.\n *\n * @param {?Object} children Children object.\n * @param {string} nodeName Node name.\n *\n * @return {?Object} The updated children object.\n */\nexport function switchChildrenNodeName( children, nodeName ) {\n\treturn (\n\t\tchildren &&\n\t\tChildren.map( children, ( elt, index ) => {\n\t\t\tif ( typeof elt?.valueOf() === 'string' ) {\n\t\t\t\treturn createElement( nodeName, { key: index }, elt );\n\t\t\t}\n\t\t\tconst { children: childrenProp, ...props } = elt.props;\n\t\t\treturn createElement(\n\t\t\t\tnodeName,\n\t\t\t\t{ key: index, ...props },\n\t\t\t\tchildrenProp\n\t\t\t);\n\t\t} )\n\t);\n}\n"]}
|
|
@@ -282,9 +282,7 @@ function getNormalStylePropertyValue(property, value) {
|
|
|
282
282
|
*/
|
|
283
283
|
|
|
284
284
|
|
|
285
|
-
export function renderElement(element, context) {
|
|
286
|
-
let legacyContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
287
|
-
|
|
285
|
+
export function renderElement(element, context, legacyContext = {}) {
|
|
288
286
|
if (null === element || undefined === element || false === element) {
|
|
289
287
|
return '';
|
|
290
288
|
}
|
|
@@ -362,8 +360,7 @@ export function renderElement(element, context) {
|
|
|
362
360
|
* @return {string} Serialized element.
|
|
363
361
|
*/
|
|
364
362
|
|
|
365
|
-
export function renderNativeComponent(type, props, context) {
|
|
366
|
-
let legacyContext = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
363
|
+
export function renderNativeComponent(type, props, context, legacyContext = {}) {
|
|
367
364
|
let content = '';
|
|
368
365
|
|
|
369
366
|
if (type === 'textarea' && props.hasOwnProperty('value')) {
|
|
@@ -408,8 +405,7 @@ export function renderNativeComponent(type, props, context) {
|
|
|
408
405
|
* @return {string} Serialized element
|
|
409
406
|
*/
|
|
410
407
|
|
|
411
|
-
export function renderComponent(Component, props, context) {
|
|
412
|
-
let legacyContext = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
408
|
+
export function renderComponent(Component, props, context, legacyContext = {}) {
|
|
413
409
|
const instance = new
|
|
414
410
|
/** @type {import('react').ComponentClass} */
|
|
415
411
|
Component(props, legacyContext);
|
|
@@ -437,8 +433,7 @@ export function renderComponent(Component, props, context) {
|
|
|
437
433
|
* @return {string} Serialized children.
|
|
438
434
|
*/
|
|
439
435
|
|
|
440
|
-
function renderChildren(children, context) {
|
|
441
|
-
let legacyContext = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
436
|
+
function renderChildren(children, context, legacyContext = {}) {
|
|
442
437
|
let result = '';
|
|
443
438
|
children = Array.isArray(children) ? children : [children];
|
|
444
439
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/element/src/serialize.js"],"names":["isPlainObject","paramCase","kebabCase","escapeHTML","escapeAttribute","isValidAttributeName","createContext","Fragment","StrictMode","forwardRef","RawHTML","Provider","Consumer","undefined","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","getNormalStylePropertyName","property","startsWith","getNormalStylePropertyValue","has","renderElement","element","context","legacyContext","Array","isArray","renderChildren","toString","type","props","children","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","isBooleanAttribute","isMeaningfulAttribute","style","normalName","normalValue"],"mappings":"AAAA;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;AACA,SAASA,aAAT,QAA8B,iBAA9B;AACA,SAASC,SAAS,IAAIC,SAAtB,QAAuC,aAAvC;AAEA;AACA;AACA;;AACA,SACCC,UADD,EAECC,eAFD,EAGCC,oBAHD,QAIO,wBAJP;AAMA;AACA;AACA;;AACA,SAASC,aAAT,EAAwBC,QAAxB,EAAkCC,UAAlC,EAA8CC,UAA9C,QAAgE,SAAhE;AACA,OAAOC,OAAP,MAAoB,YAApB;AAEA;;AAEA,MAAM;AAAEC,EAAAA,QAAF;AAAYC,EAAAA;AAAZ,IAAyBN,aAAa,CAAEO,SAAF,CAA5C;AACA,MAAMC,UAAU,GAA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O,UAAU,GAAG,GAAb,GAAmBC,WAA7B;AACA;;AAED,SAAOR,MAAP;AACA;AAED,eAAejC,aAAf","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').WPElement} WPElement */\n\nconst { Provider, Consumer } = createContext( undefined );\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! 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').WPComponent} WPComponent */\n\n/**\n * Serializes a non-native component type to string.\n *\n * @param {WPComponent} 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 {import('react').ReactNodeArray} 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 serializeable 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"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/element/src/serialize.js"],"names":["isPlainObject","paramCase","kebabCase","escapeHTML","escapeAttribute","isValidAttributeName","createContext","Fragment","StrictMode","forwardRef","RawHTML","Provider","Consumer","undefined","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","getNormalStylePropertyName","property","startsWith","getNormalStylePropertyValue","has","renderElement","element","context","legacyContext","Array","isArray","renderChildren","toString","type","props","children","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","isBooleanAttribute","isMeaningfulAttribute","style","normalName","normalValue"],"mappings":"AAAA;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;AACA,SAASA,aAAT,QAA8B,iBAA9B;AACA,SAASC,SAAS,IAAIC,SAAtB,QAAuC,aAAvC;AAEA;AACA;AACA;;AACA,SACCC,UADD,EAECC,eAFD,EAGCC,oBAHD,QAIO,wBAJP;AAMA;AACA;AACA;;AACA,SAASC,aAAT,EAAwBC,QAAxB,EAAkCC,UAAlC,EAA8CC,UAA9C,QAAgE,SAAhE;AACA,OAAOC,OAAP,MAAoB,YAApB;AAEA;;AAEA,MAAM;AAAEC,EAAAA,QAAF;AAAYC,EAAAA;AAAZ,IAAyBN,aAAa,CAAEO,SAAF,CAA5C;AACA,MAAMC,UAAU,GAAGL,UAAU,CAAE,MAAM;AACpC,SAAO,IAAP;AACA,CAF4B,CAA7B;AAIA;AACA;AACA;AACA;AACA;;AACA,MAAMM,gBAAgB,GAAG,IAAIC,GAAJ,CAAS,CAAE,QAAF,EAAY,SAAZ,EAAuB,QAAvB,CAAT,CAAzB;AAEA;AACA;AACA;AACA;AACA;;AACA,MAAMC,iBAAiB,GAAG,IAAID,GAAJ,CAAS,CA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D;AAC5D;AACA;;AAEDL,IAAAA,MAAM,IAAI,MAAMnD,SAAhB,CAnC0B,CAqC1B;AACA;;AACA,QAAKuD,kBAAL,EAA0B;AACzB;AACA;;AAED,QAAK,OAAOrD,KAAP,KAAiB,QAAtB,EAAiC;AAChCA,MAAAA,KAAK,GAAG1B,eAAe,CAAE0B,KAAF,CAAvB;AACA;;AAEDiD,IAAAA,MAAM,IAAI,OAAOjD,KAAP,GAAe,GAAzB;AACA;;AAED,SAAOiD,MAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAAShD,WAAT,CAAsBsD,KAAtB,EAA8B;AACpC;AACA,MAAK,CAAErF,aAAa,CAAEqF,KAAF,CAApB,EAAgC;AAC/B,WAAOA,KAAP;AACA;;AAED,MAAIN,MAAJ;;AAEA,OAAM,MAAMrC,QAAZ,IAAwB2C,KAAxB,EAAgC;AAC/B,UAAMvD,KAAK,GAAGuD,KAAK,CAAE3C,QAAF,CAAnB;;AACA,QAAK,SAASZ,KAAT,IAAkBjB,SAAS,KAAKiB,KAArC,EAA6C;AAC5C;AACA;;AAED,QAAKiD,MAAL,EAAc;AACbA,MAAAA,MAAM,IAAI,GAAV;AACA,KAFD,MAEO;AACNA,MAAAA,MAAM,GAAG,EAAT;AACA;;AAED,UAAMO,UAAU,GAAG7C,0BAA0B,CAAEC,QAAF,CAA7C;AACA,UAAM6C,WAAW,GAAG3C,2BAA2B,CAAEF,QAAF,EAAYZ,KAAZ,CAA/C;AACAiD,IAAAA,MAAM,IAAIO,UAAU,GAAG,GAAb,GAAmBC,WAA7B;AACA;;AAED,SAAOR,MAAP;AACA;AAED,eAAejC,aAAf","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').WPElement} WPElement */\n\nconst { Provider, Consumer } = createContext( undefined );\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! 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').WPComponent} WPComponent */\n\n/**\n * Serializes a non-native component type to string.\n *\n * @param {WPComponent} 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 {import('react').ReactNodeArray} 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 serializeable 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"]}
|
package/build-module/utils.js
CHANGED
|
@@ -9,7 +9,7 @@ export const isEmptyElement = element => {
|
|
|
9
9
|
return false;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
if (typeof
|
|
12
|
+
if (typeof element?.valueOf() === 'string' || Array.isArray(element)) {
|
|
13
13
|
return !element.length;
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/element/src/utils.js"],"names":["isEmptyElement","element","valueOf","Array","isArray","length"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,cAAc,GAAKC,OAAF,IAAe;AAC5C,MAAK,OAAOA,OAAP,KAAmB,QAAxB,EAAmC;AAClC,WAAO,KAAP;AACA;;AAED,MAAK,
|
|
1
|
+
{"version":3,"sources":["@wordpress/element/src/utils.js"],"names":["isEmptyElement","element","valueOf","Array","isArray","length"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,cAAc,GAAKC,OAAF,IAAe;AAC5C,MAAK,OAAOA,OAAP,KAAmB,QAAxB,EAAmC;AAClC,WAAO,KAAP;AACA;;AAED,MAAK,OAAOA,OAAO,EAAEC,OAAT,EAAP,KAA8B,QAA9B,IAA0CC,KAAK,CAACC,OAAN,CAAeH,OAAf,CAA/C,EAA0E;AACzE,WAAO,CAAEA,OAAO,CAACI,MAAjB;AACA;;AAED,SAAO,CAAEJ,OAAT;AACA,CAVM","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"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/element",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.12.1",
|
|
4
4
|
"description": "Element React module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@babel/runtime": "^7.16.0",
|
|
32
32
|
"@types/react": "^18.0.21",
|
|
33
33
|
"@types/react-dom": "^18.0.6",
|
|
34
|
-
"@wordpress/escape-html": "^2.
|
|
34
|
+
"@wordpress/escape-html": "^2.35.1",
|
|
35
35
|
"change-case": "^4.1.2",
|
|
36
36
|
"is-plain-object": "^5.0.0",
|
|
37
37
|
"react": "^18.2.0",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "ce5639111c30763dbdf07f40eeb136ea6030ecf1"
|
|
44
44
|
}
|