@wordpress/element 7.0.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +29 -154
- package/build/index.cjs +0 -3
- package/build/index.cjs.map +2 -2
- package/build/react-platform.cjs +8 -14
- package/build/react-platform.cjs.map +2 -2
- package/build/{find-dom-node.cjs → react-polyfill-base.cjs} +55 -22
- package/build/react-polyfill-base.cjs.map +7 -0
- package/build/react-polyfill.cjs +80 -0
- package/build/react-polyfill.cjs.map +7 -0
- package/build/react.cjs +0 -10
- package/build/react.cjs.map +2 -2
- package/build/serialize.cjs +1 -3
- package/build/serialize.cjs.map +2 -2
- package/build-module/index.mjs +0 -2
- package/build-module/index.mjs.map +2 -2
- package/build-module/react-platform.mjs +8 -14
- package/build-module/react-platform.mjs.map +2 -2
- package/build-module/{find-dom-node.mjs → react-polyfill-base.mjs} +45 -9
- package/build-module/react-polyfill-base.mjs.map +7 -0
- package/build-module/react-polyfill.mjs +47 -0
- package/build-module/react-polyfill.mjs.map +7 -0
- package/build-module/react.mjs +0 -10
- package/build-module/react.mjs.map +2 -2
- package/build-module/serialize.mjs +1 -3
- package/build-module/serialize.mjs.map +2 -2
- package/build-types/index.d.ts +0 -1
- package/build-types/index.d.ts.map +1 -1
- package/build-types/raw-html.d.ts +11 -25
- package/build-types/raw-html.d.ts.map +1 -1
- package/build-types/react-platform.d.ts +23 -49
- package/build-types/react-platform.d.ts.map +1 -1
- package/build-types/react-polyfill-base.d.ts +5 -0
- package/build-types/react-polyfill-base.d.ts.map +1 -0
- package/build-types/react-polyfill.d.ts +42 -0
- package/build-types/react-polyfill.d.ts.map +1 -0
- package/build-types/react.d.ts +1 -36
- package/build-types/react.d.ts.map +1 -1
- package/build-types/serialize.d.ts.map +1 -1
- package/package.json +9 -8
- package/src/index.ts +6 -1
- package/src/react-platform.ts +29 -59
- package/src/{find-dom-node.ts → react-polyfill-base.ts} +57 -16
- package/src/react-polyfill.ts +99 -0
- package/src/react.ts +1 -48
- package/src/serialize.ts +1 -3
- package/src/test/find-dom-node.js +2 -2
- package/src/test/react-polyfill.js +77 -0
- package/build/find-dom-node.cjs.map +0 -7
- package/build-module/find-dom-node.mjs.map +0 -7
- package/build-types/find-dom-node.d.ts +0 -10
- package/build-types/find-dom-node.d.ts.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/serialize.ts"],
|
|
4
|
-
"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 {React.ReactElement} ReactElement */\n\nconst Context = createContext( undefined );\nContext.displayName = 'ElementContext';\n\ninterface ComponentInstance {\n\trender: () => React.ReactNode;\n\tgetChildContext?: () => Record< string, any >;\n}\n\ninterface RawHTMLProps {\n\tchildren: string;\n\t[ key: string ]: any;\n}\n\ninterface StyleObject {\n\t[ property: string ]: string | number | null | undefined;\n}\n\ninterface HTMLProps {\n\tdangerouslySetInnerHTML?: {\n\t\t__html: string;\n\t};\n\tchildren?: React.ReactNode;\n\tvalue?: React.ReactNode;\n\tstyle?: StyleObject | string;\n\tclassName?: string;\n\thtmlFor?: string;\n\t[ key: string ]: any;\n}\n\nconst { Provider, Consumer } = Context;\n\nconst ForwardRef = forwardRef( () => {\n\treturn null;\n} );\n\n/**\n * Valid attribute types.\n */\nconst ATTRIBUTES_TYPES = new Set< string >( [ 'string', 'boolean', 'number' ] );\n\n/**\n * Element tags which can be self-closing.\n */\nconst SELF_CLOSING_TAGS = new Set< string >( [\n\t'area',\n\t'base',\n\t'br',\n\t'col',\n\t'command',\n\t'embed',\n\t'hr',\n\t'img',\n\t'input',\n\t'keygen',\n\t'link',\n\t'meta',\n\t'param',\n\t'source',\n\t'track',\n\t'wbr',\n] );\n\n/**\n * Boolean attributes are attributes whose presence as being assigned is\n * meaningful, even if only empty.\n *\n * See: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attributes\n * Extracted from: https://html.spec.whatwg.org/multipage/indices.html#attributes-3\n *\n * Object.keys( [ ...document.querySelectorAll( '#attributes-1 > tbody > tr' ) ]\n * .filter( ( tr ) => tr.lastChild.textContent.indexOf( 'Boolean attribute' ) !== -1 )\n * .reduce( ( result, tr ) => Object.assign( result, {\n * [ tr.firstChild.textContent.trim() ]: true\n * } ), {} ) ).sort();\n */\nconst BOOLEAN_ATTRIBUTES = new Set< string >( [\n\t'allowfullscreen',\n\t'allowpaymentrequest',\n\t'allowusermedia',\n\t'async',\n\t'autofocus',\n\t'autoplay',\n\t'checked',\n\t'controls',\n\t'default',\n\t'defer',\n\t'disabled',\n\t'download',\n\t'formnovalidate',\n\t'hidden',\n\t'ismap',\n\t'itemscope',\n\t'loop',\n\t'multiple',\n\t'muted',\n\t'nomodule',\n\t'novalidate',\n\t'open',\n\t'playsinline',\n\t'readonly',\n\t'required',\n\t'reversed',\n\t'selected',\n\t'typemustmatch',\n] );\n\n/**\n * Enumerated attributes are attributes which must be of a specific value form.\n * Like boolean attributes, these are meaningful if specified, even if not of a\n * valid enumerated value.\n *\n * See: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#enumerated-attribute\n * Extracted from: https://html.spec.whatwg.org/multipage/indices.html#attributes-3\n *\n * Object.keys( [ ...document.querySelectorAll( '#attributes-1 > tbody > tr' ) ]\n * .filter( ( tr ) => /^(\"(.+?)\";?\\s*)+/.test( tr.lastChild.textContent.trim() ) )\n * .reduce( ( result, tr ) => Object.assign( result, {\n * [ tr.firstChild.textContent.trim() ]: true\n * } ), {} ) ).sort();\n *\n * Some notable omissions:\n *\n * - `alt`: https://blog.whatwg.org/omit-alt\n */\nconst ENUMERATED_ATTRIBUTES = new Set< string >( [\n\t'autocapitalize',\n\t'autocomplete',\n\t'charset',\n\t'contenteditable',\n\t'crossorigin',\n\t'decoding',\n\t'dir',\n\t'draggable',\n\t'enctype',\n\t'formenctype',\n\t'formmethod',\n\t'http-equiv',\n\t'inputmode',\n\t'kind',\n\t'method',\n\t'preload',\n\t'scope',\n\t'shape',\n\t'spellcheck',\n\t'translate',\n\t'type',\n\t'wrap',\n] );\n\n/**\n * Set of CSS style properties which support assignment of unitless numbers.\n * Used in rendering of style properties, where `px` unit is assumed unless\n * property is included in this set or value is zero.\n *\n * Generated via:\n *\n * Object.entries( document.createElement( 'div' ).style )\n * .filter( ( [ key ] ) => (\n * ! /^(webkit|ms|moz)/.test( key ) &&\n * ( e.style[ key ] = 10 ) &&\n * e.style[ key ] === '10'\n * ) )\n * .map( ( [ key ] ) => key )\n * .sort();\n */\nconst CSS_PROPERTIES_SUPPORTS_UNITLESS = new Set< string >( [\n\t'animation',\n\t'animationIterationCount',\n\t'baselineShift',\n\t'borderImageOutset',\n\t'borderImageSlice',\n\t'borderImageWidth',\n\t'columnCount',\n\t'cx',\n\t'cy',\n\t'fillOpacity',\n\t'flexGrow',\n\t'flexShrink',\n\t'floodOpacity',\n\t'fontWeight',\n\t'gridColumnEnd',\n\t'gridColumnStart',\n\t'gridRowEnd',\n\t'gridRowStart',\n\t'lineHeight',\n\t'opacity',\n\t'order',\n\t'orphans',\n\t'r',\n\t'rx',\n\t'ry',\n\t'shapeImageThreshold',\n\t'stopOpacity',\n\t'strokeDasharray',\n\t'strokeDashoffset',\n\t'strokeMiterlimit',\n\t'strokeOpacity',\n\t'strokeWidth',\n\t'tabSize',\n\t'widows',\n\t'x',\n\t'y',\n\t'zIndex',\n\t'zoom',\n] );\n\n/**\n * Returns true if the specified string is prefixed by one of an array of\n * possible prefixes.\n * @param string\n * @param prefixes\n */\nexport function hasPrefix( string: string, prefixes: string[] ): boolean {\n\treturn prefixes.some( ( prefix ) => string.indexOf( prefix ) === 0 );\n}\n\n/**\n * Returns true if the given prop name should be ignored in attributes\n * serialization, or false otherwise.\n * @param attribute\n */\nfunction isInternalAttribute( attribute: string ): boolean {\n\treturn 'key' === attribute || 'children' === attribute;\n}\n\n/**\n * Returns the normal form of the element's attribute value for HTML.\n * @param attribute\n * @param value\n */\nfunction getNormalAttributeValue( attribute: string, value: any ): any {\n\tswitch ( attribute ) {\n\t\tcase 'style':\n\t\t\treturn renderStyle( value );\n\t}\n\n\treturn value;\n}\n\n/**\n * This is a map of all SVG attributes that have dashes. Map(lower case prop => dashed lower case attribute).\n * We need this to render e.g strokeWidth as stroke-width.\n *\n * List from: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute.\n */\nconst SVG_ATTRIBUTE_WITH_DASHES_LIST: Record< string, string > = [\n\t'accentHeight',\n\t'alignmentBaseline',\n\t'arabicForm',\n\t'baselineShift',\n\t'capHeight',\n\t'clipPath',\n\t'clipRule',\n\t'colorInterpolation',\n\t'colorInterpolationFilters',\n\t'colorProfile',\n\t'colorRendering',\n\t'dominantBaseline',\n\t'enableBackground',\n\t'fillOpacity',\n\t'fillRule',\n\t'floodColor',\n\t'floodOpacity',\n\t'fontFamily',\n\t'fontSize',\n\t'fontSizeAdjust',\n\t'fontStretch',\n\t'fontStyle',\n\t'fontVariant',\n\t'fontWeight',\n\t'glyphName',\n\t'glyphOrientationHorizontal',\n\t'glyphOrientationVertical',\n\t'horizAdvX',\n\t'horizOriginX',\n\t'imageRendering',\n\t'letterSpacing',\n\t'lightingColor',\n\t'markerEnd',\n\t'markerMid',\n\t'markerStart',\n\t'overlinePosition',\n\t'overlineThickness',\n\t'paintOrder',\n\t'panose1',\n\t'pointerEvents',\n\t'renderingIntent',\n\t'shapeRendering',\n\t'stopColor',\n\t'stopOpacity',\n\t'strikethroughPosition',\n\t'strikethroughThickness',\n\t'strokeDasharray',\n\t'strokeDashoffset',\n\t'strokeLinecap',\n\t'strokeLinejoin',\n\t'strokeMiterlimit',\n\t'strokeOpacity',\n\t'strokeWidth',\n\t'textAnchor',\n\t'textDecoration',\n\t'textRendering',\n\t'underlinePosition',\n\t'underlineThickness',\n\t'unicodeBidi',\n\t'unicodeRange',\n\t'unitsPerEm',\n\t'vAlphabetic',\n\t'vHanging',\n\t'vIdeographic',\n\t'vMathematical',\n\t'vectorEffect',\n\t'vertAdvY',\n\t'vertOriginX',\n\t'vertOriginY',\n\t'wordSpacing',\n\t'writingMode',\n\t'xmlnsXlink',\n\t'xHeight',\n].reduce(\n\t( map, attribute ) => {\n\t\t// The keys are lower-cased for more robust lookup.\n\t\tmap[ attribute.toLowerCase() ] = attribute;\n\t\treturn map;\n\t},\n\t{} as Record< string, string >\n);\n\n/**\n * This is a map of all case-sensitive SVG attributes. Map(lowercase key => proper case attribute).\n * The keys are lower-cased for more robust lookup.\n * Note that this list only contains attributes that contain at least one capital letter.\n * Lowercase attributes don't need mapping, since we lowercase all attributes by default.\n */\nconst CASE_SENSITIVE_SVG_ATTRIBUTES: Record< string, string > = [\n\t'allowReorder',\n\t'attributeName',\n\t'attributeType',\n\t'autoReverse',\n\t'baseFrequency',\n\t'baseProfile',\n\t'calcMode',\n\t'clipPathUnits',\n\t'contentScriptType',\n\t'contentStyleType',\n\t'diffuseConstant',\n\t'edgeMode',\n\t'externalResourcesRequired',\n\t'filterRes',\n\t'filterUnits',\n\t'glyphRef',\n\t'gradientTransform',\n\t'gradientUnits',\n\t'kernelMatrix',\n\t'kernelUnitLength',\n\t'keyPoints',\n\t'keySplines',\n\t'keyTimes',\n\t'lengthAdjust',\n\t'limitingConeAngle',\n\t'markerHeight',\n\t'markerUnits',\n\t'markerWidth',\n\t'maskContentUnits',\n\t'maskUnits',\n\t'numOctaves',\n\t'pathLength',\n\t'patternContentUnits',\n\t'patternTransform',\n\t'patternUnits',\n\t'pointsAtX',\n\t'pointsAtY',\n\t'pointsAtZ',\n\t'preserveAlpha',\n\t'preserveAspectRatio',\n\t'primitiveUnits',\n\t'refX',\n\t'refY',\n\t'repeatCount',\n\t'repeatDur',\n\t'requiredExtensions',\n\t'requiredFeatures',\n\t'specularConstant',\n\t'specularExponent',\n\t'spreadMethod',\n\t'startOffset',\n\t'stdDeviation',\n\t'stitchTiles',\n\t'suppressContentEditableWarning',\n\t'suppressHydrationWarning',\n\t'surfaceScale',\n\t'systemLanguage',\n\t'tableValues',\n\t'targetX',\n\t'targetY',\n\t'textLength',\n\t'viewBox',\n\t'viewTarget',\n\t'xChannelSelector',\n\t'yChannelSelector',\n].reduce(\n\t( map, attribute ) => {\n\t\t// The keys are lower-cased for more robust lookup.\n\t\tmap[ attribute.toLowerCase() ] = attribute;\n\t\treturn map;\n\t},\n\t{} as Record< string, string >\n);\n\n/**\n * This is a map of all SVG attributes that have colons.\n * Keys are lower-cased and stripped of their colons for more robust lookup.\n */\nconst SVG_ATTRIBUTES_WITH_COLONS: Record< string, string > = [\n\t'xlink:actuate',\n\t'xlink:arcrole',\n\t'xlink:href',\n\t'xlink:role',\n\t'xlink:show',\n\t'xlink:title',\n\t'xlink:type',\n\t'xml:base',\n\t'xml:lang',\n\t'xml:space',\n\t'xmlns:xlink',\n].reduce(\n\t( map, attribute ) => {\n\t\tmap[ attribute.replace( ':', '' ).toLowerCase() ] = attribute;\n\t\treturn map;\n\t},\n\t{} as Record< string, string >\n);\n\n/**\n * Returns the normal form of the element's attribute name for HTML.\n * @param attribute\n */\nfunction getNormalAttributeName( attribute: string ): string {\n\tswitch ( attribute ) {\n\t\tcase 'htmlFor':\n\t\t\treturn 'for';\n\n\t\tcase 'className':\n\t\t\treturn 'class';\n\t}\n\tconst attributeLowerCase = attribute.toLowerCase();\n\n\tif ( CASE_SENSITIVE_SVG_ATTRIBUTES[ attributeLowerCase ] ) {\n\t\treturn CASE_SENSITIVE_SVG_ATTRIBUTES[ attributeLowerCase ];\n\t} else if ( SVG_ATTRIBUTE_WITH_DASHES_LIST[ attributeLowerCase ] ) {\n\t\treturn kebabCase(\n\t\t\tSVG_ATTRIBUTE_WITH_DASHES_LIST[ attributeLowerCase ]\n\t\t);\n\t} else if ( SVG_ATTRIBUTES_WITH_COLONS[ attributeLowerCase ] ) {\n\t\treturn SVG_ATTRIBUTES_WITH_COLONS[ attributeLowerCase ];\n\t}\n\n\treturn attributeLowerCase;\n}\n\n/**\n * Returns the normal form of the style property name for HTML.\n *\n * - Converts property names to kebab-case, e.g. 'backgroundColor' \u2192 'background-color'\n * - Leaves custom attributes alone, e.g. '--myBackgroundColor' \u2192 '--myBackgroundColor'\n * - Converts vendor-prefixed property names to -kebab-case, e.g. 'MozTransform' \u2192 '-moz-transform'\n * @param property\n */\nfunction getNormalStylePropertyName( property: string ): string {\n\tif ( property.startsWith( '--' ) ) {\n\t\treturn property;\n\t}\n\n\tif ( hasPrefix( property, [ 'ms', 'O', 'Moz', 'Webkit' ] ) ) {\n\t\treturn '-' + kebabCase( property );\n\t}\n\n\treturn kebabCase( property );\n}\n\n/**\n * Returns the normal form of the style property value for HTML. Appends a\n * default pixel unit if numeric, not a unitless property, and not zero.\n * @param property\n * @param value\n */\nfunction getNormalStylePropertyValue(\n\tproperty: string,\n\tvalue: any\n): string | number {\n\tif (\n\t\ttypeof value === 'number' &&\n\t\t0 !== value &&\n\t\t! hasPrefix( property, [ '--' ] ) &&\n\t\t! CSS_PROPERTIES_SUPPORTS_UNITLESS.has( property )\n\t) {\n\t\treturn value + 'px';\n\t}\n\n\treturn value;\n}\n\n/**\n * Serializes a React element to string.\n * @param element\n * @param context\n * @param legacyContext\n */\nexport function renderElement(\n\telement: React.ReactNode,\n\tcontext?: any,\n\tlegacyContext: Record< string, any > = {}\n): string {\n\tif ( null === element || undefined === element || false === element ) {\n\t\treturn '';\n\t}\n\n\tif ( Array.isArray( element ) ) {\n\t\treturn renderChildren( element, context, legacyContext );\n\t}\n\n\tswitch ( typeof element ) {\n\t\tcase 'string':\n\t\t\treturn escapeHTML( element );\n\n\t\tcase 'number':\n\t\t\treturn element.toString();\n\t}\n\n\tconst { type, props } = element as {\n\t\ttype?: any;\n\t\tprops?: any;\n\t};\n\n\tswitch ( type ) {\n\t\tcase StrictMode:\n\t\tcase Fragment:\n\t\t\treturn renderChildren( props.children, context, legacyContext );\n\n\t\tcase RawHTML:\n\t\t\tconst { children, ...wrapperProps } = props as RawHTMLProps;\n\n\t\t\treturn renderNativeComponent(\n\t\t\t\t! Object.keys( wrapperProps ).length ? null : 'div',\n\t\t\t\t{\n\t\t\t\t\t...wrapperProps,\n\t\t\t\t\tdangerouslySetInnerHTML: { __html: children },\n\t\t\t\t},\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\t}\n\n\tswitch ( typeof type ) {\n\t\tcase 'string':\n\t\t\treturn renderNativeComponent( type, props, context, legacyContext );\n\n\t\tcase 'function':\n\t\t\tif (\n\t\t\t\ttype.prototype &&\n\t\t\t\ttypeof type.prototype.render === 'function'\n\t\t\t) {\n\t\t\t\treturn renderComponent( type, props, context, legacyContext );\n\t\t\t}\n\n\t\t\treturn renderElement(\n\t\t\t\ttype( props, legacyContext ),\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\t}\n\n\tswitch ( type && type.$$typeof ) {\n\t\tcase Provider.$$typeof:\n\t\t\treturn renderChildren( props.children, props.value, legacyContext );\n\n\t\tcase Consumer.$$typeof:\n\t\t\treturn renderElement(\n\t\t\t\tprops.children(\n\t\t\t\t\tcontext || type._currentValue || type._context._currentValue\n\t\t\t\t),\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\n\t\tcase ForwardRef.$$typeof:\n\t\t\treturn renderElement(\n\t\t\t\ttype.render( props ),\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\t}\n\n\treturn '';\n}\n\n/**\n * Serializes a native component type to string.\n * @param type\n * @param props\n * @param context\n * @param legacyContext\n */\nexport function renderNativeComponent(\n\ttype: string | null,\n\tprops: HTMLProps,\n\tcontext?: any,\n\tlegacyContext: Record< string, any > = {}\n): string {\n\tlet content = '';\n\tif ( type === 'textarea' && props.hasOwnProperty( 'value' ) ) {\n\t\t// Textarea children can be assigned as value prop. If it is, render in\n\t\t// place of children. Ensure to omit so it is not assigned as attribute\n\t\t// as well.\n\t\tcontent = renderChildren( props.value, context, legacyContext );\n\t\tconst { value, ...restProps } = props;\n\t\tprops = restProps;\n\t} else if (\n\t\tprops.dangerouslySetInnerHTML &&\n\t\ttypeof props.dangerouslySetInnerHTML.__html === 'string'\n\t) {\n\t\t// Dangerous content is left unescaped.\n\t\tcontent = props.dangerouslySetInnerHTML.__html;\n\t} else if ( typeof props.children !== 'undefined' ) {\n\t\tcontent = renderChildren( props.children, context, legacyContext );\n\t}\n\n\tif ( ! type ) {\n\t\treturn content;\n\t}\n\n\tconst attributes = renderAttributes( props );\n\n\tif ( SELF_CLOSING_TAGS.has( type ) ) {\n\t\treturn '<' + type + attributes + '/>';\n\t}\n\n\treturn '<' + type + attributes + '>' + content + '</' + type + '>';\n}\n\n/**\n * Serializes a non-native component type to string.\n * @param Component\n * @param props\n * @param context\n * @param legacyContext\n */\nexport function renderComponent(\n\tComponent: React.ComponentClass,\n\tprops: Record< string, any >,\n\tcontext?: any,\n\tlegacyContext: Record< string, any > = {}\n): string {\n\tconst instance = new Component( props, legacyContext ) as ComponentInstance;\n\n\tif ( typeof instance.getChildContext === 'function' ) {\n\t\tObject.assign( legacyContext, instance.getChildContext() );\n\t}\n\n\tconst html = renderElement( instance.render(), context, legacyContext );\n\n\treturn html;\n}\n\n/**\n * Serializes an array of children to string.\n * @param children\n * @param context\n * @param legacyContext\n */\nfunction renderChildren(\n\tchildren: React.ReactNode,\n\tcontext?: any,\n\tlegacyContext: Record< string, any > = {}\n): string {\n\tlet result = '';\n\n\tconst childrenArray = Array.isArray( children ) ? children : [ children ];\n\n\tfor ( let i = 0; i < childrenArray.length; i++ ) {\n\t\tconst child = childrenArray[ i ];\n\n\t\tresult += renderElement( child, context, legacyContext );\n\t}\n\n\treturn result;\n}\n\n/**\n * Renders a props object as a string of HTML attributes.\n * @param props\n */\nexport function renderAttributes( props: Record< string, any > ): string {\n\tlet result = '';\n\n\tfor ( const key in props ) {\n\t\tconst attribute = getNormalAttributeName( key );\n\t\tif ( ! isValidAttributeName( attribute ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet value = getNormalAttributeValue( key, props[ key ] );\n\n\t\t// If value is not of serializable type, skip.\n\t\tif ( ! ATTRIBUTES_TYPES.has( typeof value ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Don't render internal attribute names.\n\t\tif ( isInternalAttribute( key ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst isBooleanAttribute = BOOLEAN_ATTRIBUTES.has( attribute );\n\n\t\t// Boolean attribute should be omitted outright if its value is false.\n\t\tif ( isBooleanAttribute && value === false ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst isMeaningfulAttribute =\n\t\t\tisBooleanAttribute ||\n\t\t\thasPrefix( key, [ 'data-', 'aria-' ] ) ||\n\t\t\tENUMERATED_ATTRIBUTES.has( attribute );\n\n\t\t// Only write boolean value as attribute if meaningful.\n\t\tif ( typeof value === 'boolean' && ! isMeaningfulAttribute ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tresult += ' ' + attribute;\n\n\t\t// Boolean attributes should write attribute name, but without value.\n\t\t// Mere presence of attribute name is effective truthiness.\n\t\tif ( isBooleanAttribute ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( typeof value === 'string' ) {\n\t\t\tvalue = escapeAttribute( value );\n\t\t}\n\n\t\tresult += '=\"' + value + '\"';\n\t}\n\n\treturn result;\n}\n\n/**\n * Renders a style object as a string attribute value.\n * @param style\n */\nexport function renderStyle( style: StyleObject | string ): string | undefined {\n\t// Only generate from object, e.g. tolerate string value.\n\tif ( ! isPlainObject( style ) ) {\n\t\treturn style as string;\n\t}\n\n\tlet result: string | undefined;\n\n\tconst styleObj = style as StyleObject;\n\tfor ( const property in styleObj ) {\n\t\tconst value = styleObj[ property ];\n\t\tif ( null === value || undefined === value ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( result ) {\n\t\t\tresult += ';';\n\t\t} else {\n\t\t\tresult = '';\n\t\t}\n\n\t\tconst normalName = getNormalStylePropertyName( property );\n\t\tconst normalValue = getNormalStylePropertyValue( property, value );\n\t\tresult += normalName + ':' + normalValue;\n\t}\n\n\treturn result;\n}\n\nexport default renderElement;\n"],
|
|
5
|
-
"mappings": ";AA8BA,SAAS,qBAAqB;AAC9B,SAAS,aAAa,iBAAiB;AAKvC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAKP,SAAS,eAAe,UAAU,YAAY,kBAAkB;AAChE,OAAO,aAAa;AAIpB,IAAM,UAAU,c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zB,KAAK;AACJ,aAAO,WAAY,OAAQ;AAAA,IAE5B,KAAK;AACJ,aAAO,QAAQ,SAAS;AAAA,EAC1B;AAEA,QAAM,EAAE,MAAM,MAAM,IAAI;AAKxB,UAAS,MAAO;AAAA,IACf,KAAK;AAAA,IACL,KAAK;AACJ,aAAO,eAAgB,MAAM,UAAU,SAAS,aAAc;AAAA,IAE/D,KAAK;AACJ,YAAM,EAAE,UAAU,GAAG,aAAa,IAAI;AAEtC,aAAO;AAAA,QACN,CAAE,OAAO,KAAM,YAAa,EAAE,SAAS,OAAO;AAAA,QAC9C;AAAA,UACC,GAAG;AAAA,UACH,yBAAyB,EAAE,QAAQ,SAAS;AAAA,QAC7C;AAAA,QACA;AAAA,QACA;AAAA,MACD;AAAA,EACF;AAEA,UAAS,OAAO,MAAO;AAAA,IACtB,KAAK;AACJ,aAAO,sBAAuB,MAAM,OAAO,SAAS,aAAc;AAAA,IAEnE,KAAK;AACJ,UACC,KAAK,aACL,OAAO,KAAK,UAAU,WAAW,YAChC;AACD,eAAO,gBAAiB,MAAM,OAAO,SAAS,aAAc;AAAA,MAC7D;AAEA,aAAO;AAAA,QACN,KAAM,OAAO,aAAc;AAAA,QAC3B;AAAA,QACA;AAAA,MACD;AAAA,EACF;AAEA,UAAS,QAAQ,KAAK,UAAW;AAAA,IAChC,KAAK,SAAS;AACb,aAAO,eAAgB,MAAM,UAAU,MAAM,OAAO,aAAc;AAAA,IAEnE,KAAK,SAAS;AACb,aAAO;AAAA,QACN,MAAM
|
|
4
|
+
"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 {React.ReactElement} ReactElement */\n\nconst Context = createContext( undefined );\nContext.displayName = 'ElementContext';\n\ninterface ComponentInstance {\n\trender: () => React.ReactNode;\n\tgetChildContext?: () => Record< string, any >;\n}\n\ninterface RawHTMLProps {\n\tchildren: string;\n\t[ key: string ]: any;\n}\n\ninterface StyleObject {\n\t[ property: string ]: string | number | null | undefined;\n}\n\ninterface HTMLProps {\n\tdangerouslySetInnerHTML?: {\n\t\t__html: string;\n\t};\n\tchildren?: React.ReactNode;\n\tvalue?: React.ReactNode;\n\tstyle?: StyleObject | string;\n\tclassName?: string;\n\thtmlFor?: string;\n\t[ key: string ]: any;\n}\n\nconst { Provider, Consumer } = Context;\n\nconst ForwardRef = forwardRef( () => {\n\treturn null;\n} );\n\n/**\n * Valid attribute types.\n */\nconst ATTRIBUTES_TYPES = new Set< string >( [ 'string', 'boolean', 'number' ] );\n\n/**\n * Element tags which can be self-closing.\n */\nconst SELF_CLOSING_TAGS = new Set< string >( [\n\t'area',\n\t'base',\n\t'br',\n\t'col',\n\t'command',\n\t'embed',\n\t'hr',\n\t'img',\n\t'input',\n\t'keygen',\n\t'link',\n\t'meta',\n\t'param',\n\t'source',\n\t'track',\n\t'wbr',\n] );\n\n/**\n * Boolean attributes are attributes whose presence as being assigned is\n * meaningful, even if only empty.\n *\n * See: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attributes\n * Extracted from: https://html.spec.whatwg.org/multipage/indices.html#attributes-3\n *\n * Object.keys( [ ...document.querySelectorAll( '#attributes-1 > tbody > tr' ) ]\n * .filter( ( tr ) => tr.lastChild.textContent.indexOf( 'Boolean attribute' ) !== -1 )\n * .reduce( ( result, tr ) => Object.assign( result, {\n * [ tr.firstChild.textContent.trim() ]: true\n * } ), {} ) ).sort();\n */\nconst BOOLEAN_ATTRIBUTES = new Set< string >( [\n\t'allowfullscreen',\n\t'allowpaymentrequest',\n\t'allowusermedia',\n\t'async',\n\t'autofocus',\n\t'autoplay',\n\t'checked',\n\t'controls',\n\t'default',\n\t'defer',\n\t'disabled',\n\t'download',\n\t'formnovalidate',\n\t'hidden',\n\t'ismap',\n\t'itemscope',\n\t'loop',\n\t'multiple',\n\t'muted',\n\t'nomodule',\n\t'novalidate',\n\t'open',\n\t'playsinline',\n\t'readonly',\n\t'required',\n\t'reversed',\n\t'selected',\n\t'typemustmatch',\n] );\n\n/**\n * Enumerated attributes are attributes which must be of a specific value form.\n * Like boolean attributes, these are meaningful if specified, even if not of a\n * valid enumerated value.\n *\n * See: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#enumerated-attribute\n * Extracted from: https://html.spec.whatwg.org/multipage/indices.html#attributes-3\n *\n * Object.keys( [ ...document.querySelectorAll( '#attributes-1 > tbody > tr' ) ]\n * .filter( ( tr ) => /^(\"(.+?)\";?\\s*)+/.test( tr.lastChild.textContent.trim() ) )\n * .reduce( ( result, tr ) => Object.assign( result, {\n * [ tr.firstChild.textContent.trim() ]: true\n * } ), {} ) ).sort();\n *\n * Some notable omissions:\n *\n * - `alt`: https://blog.whatwg.org/omit-alt\n */\nconst ENUMERATED_ATTRIBUTES = new Set< string >( [\n\t'autocapitalize',\n\t'autocomplete',\n\t'charset',\n\t'contenteditable',\n\t'crossorigin',\n\t'decoding',\n\t'dir',\n\t'draggable',\n\t'enctype',\n\t'formenctype',\n\t'formmethod',\n\t'http-equiv',\n\t'inputmode',\n\t'kind',\n\t'method',\n\t'preload',\n\t'scope',\n\t'shape',\n\t'spellcheck',\n\t'translate',\n\t'type',\n\t'wrap',\n] );\n\n/**\n * Set of CSS style properties which support assignment of unitless numbers.\n * Used in rendering of style properties, where `px` unit is assumed unless\n * property is included in this set or value is zero.\n *\n * Generated via:\n *\n * Object.entries( document.createElement( 'div' ).style )\n * .filter( ( [ key ] ) => (\n * ! /^(webkit|ms|moz)/.test( key ) &&\n * ( e.style[ key ] = 10 ) &&\n * e.style[ key ] === '10'\n * ) )\n * .map( ( [ key ] ) => key )\n * .sort();\n */\nconst CSS_PROPERTIES_SUPPORTS_UNITLESS = new Set< string >( [\n\t'animation',\n\t'animationIterationCount',\n\t'baselineShift',\n\t'borderImageOutset',\n\t'borderImageSlice',\n\t'borderImageWidth',\n\t'columnCount',\n\t'cx',\n\t'cy',\n\t'fillOpacity',\n\t'flexGrow',\n\t'flexShrink',\n\t'floodOpacity',\n\t'fontWeight',\n\t'gridColumnEnd',\n\t'gridColumnStart',\n\t'gridRowEnd',\n\t'gridRowStart',\n\t'lineHeight',\n\t'opacity',\n\t'order',\n\t'orphans',\n\t'r',\n\t'rx',\n\t'ry',\n\t'shapeImageThreshold',\n\t'stopOpacity',\n\t'strokeDasharray',\n\t'strokeDashoffset',\n\t'strokeMiterlimit',\n\t'strokeOpacity',\n\t'strokeWidth',\n\t'tabSize',\n\t'widows',\n\t'x',\n\t'y',\n\t'zIndex',\n\t'zoom',\n] );\n\n/**\n * Returns true if the specified string is prefixed by one of an array of\n * possible prefixes.\n * @param string\n * @param prefixes\n */\nexport function hasPrefix( string: string, prefixes: string[] ): boolean {\n\treturn prefixes.some( ( prefix ) => string.indexOf( prefix ) === 0 );\n}\n\n/**\n * Returns true if the given prop name should be ignored in attributes\n * serialization, or false otherwise.\n * @param attribute\n */\nfunction isInternalAttribute( attribute: string ): boolean {\n\treturn 'key' === attribute || 'children' === attribute;\n}\n\n/**\n * Returns the normal form of the element's attribute value for HTML.\n * @param attribute\n * @param value\n */\nfunction getNormalAttributeValue( attribute: string, value: any ): any {\n\tswitch ( attribute ) {\n\t\tcase 'style':\n\t\t\treturn renderStyle( value );\n\t}\n\n\treturn value;\n}\n\n/**\n * This is a map of all SVG attributes that have dashes. Map(lower case prop => dashed lower case attribute).\n * We need this to render e.g strokeWidth as stroke-width.\n *\n * List from: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute.\n */\nconst SVG_ATTRIBUTE_WITH_DASHES_LIST: Record< string, string > = [\n\t'accentHeight',\n\t'alignmentBaseline',\n\t'arabicForm',\n\t'baselineShift',\n\t'capHeight',\n\t'clipPath',\n\t'clipRule',\n\t'colorInterpolation',\n\t'colorInterpolationFilters',\n\t'colorProfile',\n\t'colorRendering',\n\t'dominantBaseline',\n\t'enableBackground',\n\t'fillOpacity',\n\t'fillRule',\n\t'floodColor',\n\t'floodOpacity',\n\t'fontFamily',\n\t'fontSize',\n\t'fontSizeAdjust',\n\t'fontStretch',\n\t'fontStyle',\n\t'fontVariant',\n\t'fontWeight',\n\t'glyphName',\n\t'glyphOrientationHorizontal',\n\t'glyphOrientationVertical',\n\t'horizAdvX',\n\t'horizOriginX',\n\t'imageRendering',\n\t'letterSpacing',\n\t'lightingColor',\n\t'markerEnd',\n\t'markerMid',\n\t'markerStart',\n\t'overlinePosition',\n\t'overlineThickness',\n\t'paintOrder',\n\t'panose1',\n\t'pointerEvents',\n\t'renderingIntent',\n\t'shapeRendering',\n\t'stopColor',\n\t'stopOpacity',\n\t'strikethroughPosition',\n\t'strikethroughThickness',\n\t'strokeDasharray',\n\t'strokeDashoffset',\n\t'strokeLinecap',\n\t'strokeLinejoin',\n\t'strokeMiterlimit',\n\t'strokeOpacity',\n\t'strokeWidth',\n\t'textAnchor',\n\t'textDecoration',\n\t'textRendering',\n\t'underlinePosition',\n\t'underlineThickness',\n\t'unicodeBidi',\n\t'unicodeRange',\n\t'unitsPerEm',\n\t'vAlphabetic',\n\t'vHanging',\n\t'vIdeographic',\n\t'vMathematical',\n\t'vectorEffect',\n\t'vertAdvY',\n\t'vertOriginX',\n\t'vertOriginY',\n\t'wordSpacing',\n\t'writingMode',\n\t'xmlnsXlink',\n\t'xHeight',\n].reduce(\n\t( map, attribute ) => {\n\t\t// The keys are lower-cased for more robust lookup.\n\t\tmap[ attribute.toLowerCase() ] = attribute;\n\t\treturn map;\n\t},\n\t{} as Record< string, string >\n);\n\n/**\n * This is a map of all case-sensitive SVG attributes. Map(lowercase key => proper case attribute).\n * The keys are lower-cased for more robust lookup.\n * Note that this list only contains attributes that contain at least one capital letter.\n * Lowercase attributes don't need mapping, since we lowercase all attributes by default.\n */\nconst CASE_SENSITIVE_SVG_ATTRIBUTES: Record< string, string > = [\n\t'allowReorder',\n\t'attributeName',\n\t'attributeType',\n\t'autoReverse',\n\t'baseFrequency',\n\t'baseProfile',\n\t'calcMode',\n\t'clipPathUnits',\n\t'contentScriptType',\n\t'contentStyleType',\n\t'diffuseConstant',\n\t'edgeMode',\n\t'externalResourcesRequired',\n\t'filterRes',\n\t'filterUnits',\n\t'glyphRef',\n\t'gradientTransform',\n\t'gradientUnits',\n\t'kernelMatrix',\n\t'kernelUnitLength',\n\t'keyPoints',\n\t'keySplines',\n\t'keyTimes',\n\t'lengthAdjust',\n\t'limitingConeAngle',\n\t'markerHeight',\n\t'markerUnits',\n\t'markerWidth',\n\t'maskContentUnits',\n\t'maskUnits',\n\t'numOctaves',\n\t'pathLength',\n\t'patternContentUnits',\n\t'patternTransform',\n\t'patternUnits',\n\t'pointsAtX',\n\t'pointsAtY',\n\t'pointsAtZ',\n\t'preserveAlpha',\n\t'preserveAspectRatio',\n\t'primitiveUnits',\n\t'refX',\n\t'refY',\n\t'repeatCount',\n\t'repeatDur',\n\t'requiredExtensions',\n\t'requiredFeatures',\n\t'specularConstant',\n\t'specularExponent',\n\t'spreadMethod',\n\t'startOffset',\n\t'stdDeviation',\n\t'stitchTiles',\n\t'suppressContentEditableWarning',\n\t'suppressHydrationWarning',\n\t'surfaceScale',\n\t'systemLanguage',\n\t'tableValues',\n\t'targetX',\n\t'targetY',\n\t'textLength',\n\t'viewBox',\n\t'viewTarget',\n\t'xChannelSelector',\n\t'yChannelSelector',\n].reduce(\n\t( map, attribute ) => {\n\t\t// The keys are lower-cased for more robust lookup.\n\t\tmap[ attribute.toLowerCase() ] = attribute;\n\t\treturn map;\n\t},\n\t{} as Record< string, string >\n);\n\n/**\n * This is a map of all SVG attributes that have colons.\n * Keys are lower-cased and stripped of their colons for more robust lookup.\n */\nconst SVG_ATTRIBUTES_WITH_COLONS: Record< string, string > = [\n\t'xlink:actuate',\n\t'xlink:arcrole',\n\t'xlink:href',\n\t'xlink:role',\n\t'xlink:show',\n\t'xlink:title',\n\t'xlink:type',\n\t'xml:base',\n\t'xml:lang',\n\t'xml:space',\n\t'xmlns:xlink',\n].reduce(\n\t( map, attribute ) => {\n\t\tmap[ attribute.replace( ':', '' ).toLowerCase() ] = attribute;\n\t\treturn map;\n\t},\n\t{} as Record< string, string >\n);\n\n/**\n * Returns the normal form of the element's attribute name for HTML.\n * @param attribute\n */\nfunction getNormalAttributeName( attribute: string ): string {\n\tswitch ( attribute ) {\n\t\tcase 'htmlFor':\n\t\t\treturn 'for';\n\n\t\tcase 'className':\n\t\t\treturn 'class';\n\t}\n\tconst attributeLowerCase = attribute.toLowerCase();\n\n\tif ( CASE_SENSITIVE_SVG_ATTRIBUTES[ attributeLowerCase ] ) {\n\t\treturn CASE_SENSITIVE_SVG_ATTRIBUTES[ attributeLowerCase ];\n\t} else if ( SVG_ATTRIBUTE_WITH_DASHES_LIST[ attributeLowerCase ] ) {\n\t\treturn kebabCase(\n\t\t\tSVG_ATTRIBUTE_WITH_DASHES_LIST[ attributeLowerCase ]\n\t\t);\n\t} else if ( SVG_ATTRIBUTES_WITH_COLONS[ attributeLowerCase ] ) {\n\t\treturn SVG_ATTRIBUTES_WITH_COLONS[ attributeLowerCase ];\n\t}\n\n\treturn attributeLowerCase;\n}\n\n/**\n * Returns the normal form of the style property name for HTML.\n *\n * - Converts property names to kebab-case, e.g. 'backgroundColor' \u2192 'background-color'\n * - Leaves custom attributes alone, e.g. '--myBackgroundColor' \u2192 '--myBackgroundColor'\n * - Converts vendor-prefixed property names to -kebab-case, e.g. 'MozTransform' \u2192 '-moz-transform'\n * @param property\n */\nfunction getNormalStylePropertyName( property: string ): string {\n\tif ( property.startsWith( '--' ) ) {\n\t\treturn property;\n\t}\n\n\tif ( hasPrefix( property, [ 'ms', 'O', 'Moz', 'Webkit' ] ) ) {\n\t\treturn '-' + kebabCase( property );\n\t}\n\n\treturn kebabCase( property );\n}\n\n/**\n * Returns the normal form of the style property value for HTML. Appends a\n * default pixel unit if numeric, not a unitless property, and not zero.\n * @param property\n * @param value\n */\nfunction getNormalStylePropertyValue(\n\tproperty: string,\n\tvalue: any\n): string | number {\n\tif (\n\t\ttypeof value === 'number' &&\n\t\t0 !== value &&\n\t\t! hasPrefix( property, [ '--' ] ) &&\n\t\t! CSS_PROPERTIES_SUPPORTS_UNITLESS.has( property )\n\t) {\n\t\treturn value + 'px';\n\t}\n\n\treturn value;\n}\n\n/**\n * Serializes a React element to string.\n * @param element\n * @param context\n * @param legacyContext\n */\nexport function renderElement(\n\telement: React.ReactNode,\n\tcontext?: any,\n\tlegacyContext: Record< string, any > = {}\n): string {\n\tif ( null === element || undefined === element || false === element ) {\n\t\treturn '';\n\t}\n\n\tif ( Array.isArray( element ) ) {\n\t\treturn renderChildren( element, context, legacyContext );\n\t}\n\n\tswitch ( typeof element ) {\n\t\tcase 'string':\n\t\t\treturn escapeHTML( element );\n\n\t\tcase 'number':\n\t\t\treturn element.toString();\n\t}\n\n\tconst { type, props } = element as {\n\t\ttype?: any;\n\t\tprops?: any;\n\t};\n\n\tswitch ( type ) {\n\t\tcase StrictMode:\n\t\tcase Fragment:\n\t\t\treturn renderChildren( props.children, context, legacyContext );\n\n\t\tcase RawHTML:\n\t\t\tconst { children, ...wrapperProps } = props as RawHTMLProps;\n\n\t\t\treturn renderNativeComponent(\n\t\t\t\t! Object.keys( wrapperProps ).length ? null : 'div',\n\t\t\t\t{\n\t\t\t\t\t...wrapperProps,\n\t\t\t\t\tdangerouslySetInnerHTML: { __html: children },\n\t\t\t\t},\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\t}\n\n\tswitch ( typeof type ) {\n\t\tcase 'string':\n\t\t\treturn renderNativeComponent( type, props, context, legacyContext );\n\n\t\tcase 'function':\n\t\t\tif (\n\t\t\t\ttype.prototype &&\n\t\t\t\ttypeof type.prototype.render === 'function'\n\t\t\t) {\n\t\t\t\treturn renderComponent( type, props, context, legacyContext );\n\t\t\t}\n\n\t\t\treturn renderElement(\n\t\t\t\ttype( props, legacyContext ),\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\t}\n\n\tswitch ( type && type.$$typeof ) {\n\t\tcase Provider.$$typeof:\n\t\t\treturn renderChildren( props.children, props.value, legacyContext );\n\n\t\tcase Consumer.$$typeof:\n\t\t\treturn renderElement(\n\t\t\t\tprops.children( context || type._currentValue ),\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\n\t\tcase ForwardRef.$$typeof:\n\t\t\treturn renderElement(\n\t\t\t\ttype.render( props ),\n\t\t\t\tcontext,\n\t\t\t\tlegacyContext\n\t\t\t);\n\t}\n\n\treturn '';\n}\n\n/**\n * Serializes a native component type to string.\n * @param type\n * @param props\n * @param context\n * @param legacyContext\n */\nexport function renderNativeComponent(\n\ttype: string | null,\n\tprops: HTMLProps,\n\tcontext?: any,\n\tlegacyContext: Record< string, any > = {}\n): string {\n\tlet content = '';\n\tif ( type === 'textarea' && props.hasOwnProperty( 'value' ) ) {\n\t\t// Textarea children can be assigned as value prop. If it is, render in\n\t\t// place of children. Ensure to omit so it is not assigned as attribute\n\t\t// as well.\n\t\tcontent = renderChildren( props.value, context, legacyContext );\n\t\tconst { value, ...restProps } = props;\n\t\tprops = restProps;\n\t} else if (\n\t\tprops.dangerouslySetInnerHTML &&\n\t\ttypeof props.dangerouslySetInnerHTML.__html === 'string'\n\t) {\n\t\t// Dangerous content is left unescaped.\n\t\tcontent = props.dangerouslySetInnerHTML.__html;\n\t} else if ( typeof props.children !== 'undefined' ) {\n\t\tcontent = renderChildren( props.children, context, legacyContext );\n\t}\n\n\tif ( ! type ) {\n\t\treturn content;\n\t}\n\n\tconst attributes = renderAttributes( props );\n\n\tif ( SELF_CLOSING_TAGS.has( type ) ) {\n\t\treturn '<' + type + attributes + '/>';\n\t}\n\n\treturn '<' + type + attributes + '>' + content + '</' + type + '>';\n}\n\n/**\n * Serializes a non-native component type to string.\n * @param Component\n * @param props\n * @param context\n * @param legacyContext\n */\nexport function renderComponent(\n\tComponent: React.ComponentClass,\n\tprops: Record< string, any >,\n\tcontext?: any,\n\tlegacyContext: Record< string, any > = {}\n): string {\n\tconst instance = new Component( props, legacyContext ) as ComponentInstance;\n\n\tif ( typeof instance.getChildContext === 'function' ) {\n\t\tObject.assign( legacyContext, instance.getChildContext() );\n\t}\n\n\tconst html = renderElement( instance.render(), context, legacyContext );\n\n\treturn html;\n}\n\n/**\n * Serializes an array of children to string.\n * @param children\n * @param context\n * @param legacyContext\n */\nfunction renderChildren(\n\tchildren: React.ReactNode,\n\tcontext?: any,\n\tlegacyContext: Record< string, any > = {}\n): string {\n\tlet result = '';\n\n\tconst childrenArray = Array.isArray( children ) ? children : [ children ];\n\n\tfor ( let i = 0; i < childrenArray.length; i++ ) {\n\t\tconst child = childrenArray[ i ];\n\n\t\tresult += renderElement( child, context, legacyContext );\n\t}\n\n\treturn result;\n}\n\n/**\n * Renders a props object as a string of HTML attributes.\n * @param props\n */\nexport function renderAttributes( props: Record< string, any > ): string {\n\tlet result = '';\n\n\tfor ( const key in props ) {\n\t\tconst attribute = getNormalAttributeName( key );\n\t\tif ( ! isValidAttributeName( attribute ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet value = getNormalAttributeValue( key, props[ key ] );\n\n\t\t// If value is not of serializable type, skip.\n\t\tif ( ! ATTRIBUTES_TYPES.has( typeof value ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Don't render internal attribute names.\n\t\tif ( isInternalAttribute( key ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst isBooleanAttribute = BOOLEAN_ATTRIBUTES.has( attribute );\n\n\t\t// Boolean attribute should be omitted outright if its value is false.\n\t\tif ( isBooleanAttribute && value === false ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst isMeaningfulAttribute =\n\t\t\tisBooleanAttribute ||\n\t\t\thasPrefix( key, [ 'data-', 'aria-' ] ) ||\n\t\t\tENUMERATED_ATTRIBUTES.has( attribute );\n\n\t\t// Only write boolean value as attribute if meaningful.\n\t\tif ( typeof value === 'boolean' && ! isMeaningfulAttribute ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tresult += ' ' + attribute;\n\n\t\t// Boolean attributes should write attribute name, but without value.\n\t\t// Mere presence of attribute name is effective truthiness.\n\t\tif ( isBooleanAttribute ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( typeof value === 'string' ) {\n\t\t\tvalue = escapeAttribute( value );\n\t\t}\n\n\t\tresult += '=\"' + value + '\"';\n\t}\n\n\treturn result;\n}\n\n/**\n * Renders a style object as a string attribute value.\n * @param style\n */\nexport function renderStyle( style: StyleObject | string ): string | undefined {\n\t// Only generate from object, e.g. tolerate string value.\n\tif ( ! isPlainObject( style ) ) {\n\t\treturn style as string;\n\t}\n\n\tlet result: string | undefined;\n\n\tconst styleObj = style as StyleObject;\n\tfor ( const property in styleObj ) {\n\t\tconst value = styleObj[ property ];\n\t\tif ( null === value || undefined === value ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif ( result ) {\n\t\t\tresult += ';';\n\t\t} else {\n\t\t\tresult = '';\n\t\t}\n\n\t\tconst normalName = getNormalStylePropertyName( property );\n\t\tconst normalValue = getNormalStylePropertyValue( property, value );\n\t\tresult += normalName + ':' + normalValue;\n\t}\n\n\treturn result;\n}\n\nexport default renderElement;\n"],
|
|
5
|
+
"mappings": ";AA8BA,SAAS,qBAAqB;AAC9B,SAAS,aAAa,iBAAiB;AAKvC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAKP,SAAS,eAAe,UAAU,YAAY,kBAAkB;AAChE,OAAO,aAAa;AAIpB,IAAM,UAAU,cAAe,MAAU;AACzC,QAAQ,cAAc;AA4BtB,IAAM,EAAE,UAAU,SAAS,IAAI;AAE/B,IAAM,aAAa,WAAY,MAAM;AACpC,SAAO;AACR,CAAE;AAKF,IAAM,mBAAmB,oBAAI,IAAe,CAAE,UAAU,WAAW,QAAS,CAAE;AAK9E,IAAM,oBAAoB,oBAAI,IAAe;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,CAAE;AAeF,IAAM,qBAAqB,oBAAI,IAAe;AAAA,EAC7C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;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ACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,EAAE;AAAA,EACD,CAAE,KAAK,cAAe;AAErB,QAAK,UAAU,YAAY,CAAE,IAAI;AACjC,WAAO;AAAA,EACR;AAAA,EACA,CAAC;AACF;AAQA,IAAM,gCAA0D;AAAA,EAC/D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AA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ACR;AAEA,MAAI;AAEJ,QAAM,WAAW;AACjB,aAAY,YAAY,UAAW;AAClC,UAAM,QAAQ,SAAU,QAAS;AACjC,QAAK,SAAS,SAAS,WAAc,OAAQ;AAC5C;AAAA,IACD;AAEA,QAAK,QAAS;AACb,gBAAU;AAAA,IACX,OAAO;AACN,eAAS;AAAA,IACV;AAEA,UAAM,aAAa,2BAA4B,QAAS;AACxD,UAAM,cAAc,4BAA6B,UAAU,KAAM;AACjE,cAAU,aAAa,MAAM;AAAA,EAC9B;AAEA,SAAO;AACR;AAEA,IAAO,oBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/build-types/index.d.ts
CHANGED
|
@@ -5,5 +5,4 @@ export * from './utils';
|
|
|
5
5
|
export { default as Platform } from './platform';
|
|
6
6
|
export { default as renderToString } from './serialize';
|
|
7
7
|
export { default as RawHTML } from './raw-html';
|
|
8
|
-
export { default as findDOMNode } from './find-dom-node';
|
|
9
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACnF,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,YAAY,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACnF,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -43,18 +43,18 @@ export default function RawHTML({ children, ...props }: RawHTMLProps): import("r
|
|
|
43
43
|
onFocusCapture?: import("react").FocusEventHandler<HTMLDivElement>;
|
|
44
44
|
onBlur?: import("react").FocusEventHandler<HTMLDivElement>;
|
|
45
45
|
onBlurCapture?: import("react").FocusEventHandler<HTMLDivElement>;
|
|
46
|
-
onChange?: import("react").
|
|
47
|
-
onChangeCapture?: import("react").
|
|
46
|
+
onChange?: import("react").FormEventHandler<HTMLDivElement>;
|
|
47
|
+
onChangeCapture?: import("react").FormEventHandler<HTMLDivElement>;
|
|
48
48
|
onBeforeInput?: import("react").InputEventHandler<HTMLDivElement>;
|
|
49
|
-
onBeforeInputCapture?: import("react").
|
|
50
|
-
onInput?: import("react").
|
|
51
|
-
onInputCapture?: import("react").
|
|
52
|
-
onReset?: import("react").
|
|
53
|
-
onResetCapture?: import("react").
|
|
54
|
-
onSubmit?: import("react").
|
|
55
|
-
onSubmitCapture?: import("react").
|
|
56
|
-
onInvalid?: import("react").
|
|
57
|
-
onInvalidCapture?: import("react").
|
|
49
|
+
onBeforeInputCapture?: import("react").FormEventHandler<HTMLDivElement>;
|
|
50
|
+
onInput?: import("react").FormEventHandler<HTMLDivElement>;
|
|
51
|
+
onInputCapture?: import("react").FormEventHandler<HTMLDivElement>;
|
|
52
|
+
onReset?: import("react").FormEventHandler<HTMLDivElement>;
|
|
53
|
+
onResetCapture?: import("react").FormEventHandler<HTMLDivElement>;
|
|
54
|
+
onSubmit?: import("react").FormEventHandler<HTMLDivElement>;
|
|
55
|
+
onSubmitCapture?: import("react").FormEventHandler<HTMLDivElement>;
|
|
56
|
+
onInvalid?: import("react").FormEventHandler<HTMLDivElement>;
|
|
57
|
+
onInvalidCapture?: import("react").FormEventHandler<HTMLDivElement>;
|
|
58
58
|
onLoad?: import("react").ReactEventHandler<HTMLDivElement>;
|
|
59
59
|
onLoadCapture?: import("react").ReactEventHandler<HTMLDivElement>;
|
|
60
60
|
onError?: import("react").ReactEventHandler<HTMLDivElement>;
|
|
@@ -175,8 +175,6 @@ export default function RawHTML({ children, ...props }: RawHTMLProps): import("r
|
|
|
175
175
|
onLostPointerCaptureCapture?: import("react").PointerEventHandler<HTMLDivElement>;
|
|
176
176
|
onScroll?: import("react").UIEventHandler<HTMLDivElement>;
|
|
177
177
|
onScrollCapture?: import("react").UIEventHandler<HTMLDivElement>;
|
|
178
|
-
onScrollEnd?: import("react").UIEventHandler<HTMLDivElement>;
|
|
179
|
-
onScrollEndCapture?: import("react").UIEventHandler<HTMLDivElement>;
|
|
180
178
|
onWheel?: import("react").WheelEventHandler<HTMLDivElement>;
|
|
181
179
|
onWheelCapture?: import("react").WheelEventHandler<HTMLDivElement>;
|
|
182
180
|
onAnimationStart?: import("react").AnimationEventHandler<HTMLDivElement>;
|
|
@@ -185,16 +183,8 @@ export default function RawHTML({ children, ...props }: RawHTMLProps): import("r
|
|
|
185
183
|
onAnimationEndCapture?: import("react").AnimationEventHandler<HTMLDivElement>;
|
|
186
184
|
onAnimationIteration?: import("react").AnimationEventHandler<HTMLDivElement>;
|
|
187
185
|
onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLDivElement>;
|
|
188
|
-
onToggle?: import("react").ToggleEventHandler<HTMLDivElement>;
|
|
189
|
-
onBeforeToggle?: import("react").ToggleEventHandler<HTMLDivElement>;
|
|
190
|
-
onTransitionCancel?: import("react").TransitionEventHandler<HTMLDivElement>;
|
|
191
|
-
onTransitionCancelCapture?: import("react").TransitionEventHandler<HTMLDivElement>;
|
|
192
186
|
onTransitionEnd?: import("react").TransitionEventHandler<HTMLDivElement>;
|
|
193
187
|
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLDivElement>;
|
|
194
|
-
onTransitionRun?: import("react").TransitionEventHandler<HTMLDivElement>;
|
|
195
|
-
onTransitionRunCapture?: import("react").TransitionEventHandler<HTMLDivElement>;
|
|
196
|
-
onTransitionStart?: import("react").TransitionEventHandler<HTMLDivElement>;
|
|
197
|
-
onTransitionStartCapture?: import("react").TransitionEventHandler<HTMLDivElement>;
|
|
198
188
|
"aria-activedescendant"?: string | undefined;
|
|
199
189
|
"aria-atomic"?: ("false" | "true" | boolean) | undefined;
|
|
200
190
|
"aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined;
|
|
@@ -295,10 +285,6 @@ export default function RawHTML({ children, ...props }: RawHTMLProps): import("r
|
|
|
295
285
|
results?: number | undefined;
|
|
296
286
|
security?: string | undefined;
|
|
297
287
|
unselectable?: "on" | "off" | undefined;
|
|
298
|
-
popover?: "" | "auto" | "manual" | "hint" | undefined;
|
|
299
|
-
popoverTargetAction?: "toggle" | "show" | "hide" | undefined;
|
|
300
|
-
popoverTarget?: string | undefined;
|
|
301
|
-
inert?: boolean | undefined;
|
|
302
288
|
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
|
|
303
289
|
is?: string | undefined;
|
|
304
290
|
exportparts?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"raw-html.d.ts","sourceRoot":"","sources":["../src/raw-html.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IAC1B,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC5B,GAAG,KAAK,CAAC,wBAAwB,CAAE,KAAK,CAAE,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAE,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY
|
|
1
|
+
{"version":3,"file":"raw-html.d.ts","sourceRoot":"","sources":["../src/raw-html.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IAC1B,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC5B,GAAG,KAAK,CAAC,wBAAwB,CAAE,KAAK,CAAE,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAE,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAgBpE"}
|
|
@@ -1,73 +1,40 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { createPortal,
|
|
4
|
+
import { createPortal, findDOMNode, flushSync, render, hydrate, unmountComponentAtNode } from 'react-dom';
|
|
5
5
|
import { createRoot, hydrateRoot } from 'react-dom/client';
|
|
6
6
|
/**
|
|
7
7
|
* Creates a portal into which a component can be rendered.
|
|
8
8
|
*
|
|
9
|
-
* @see https://
|
|
10
|
-
*
|
|
11
|
-
* @param {React.ReactElement} child Any renderable child, such as an element,
|
|
12
|
-
* string, or fragment.
|
|
13
|
-
* @param {HTMLElement} container DOM node into which element should be rendered.
|
|
9
|
+
* @see https://react.dev/reference/react-dom/createPortal
|
|
14
10
|
*/
|
|
15
11
|
export { createPortal };
|
|
16
12
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* @param {Function} callback Callback to run synchronously.
|
|
20
|
-
*/
|
|
21
|
-
export { flushSync };
|
|
22
|
-
/**
|
|
23
|
-
* Eagerly connect to a server that you expect to load resources from.
|
|
24
|
-
*
|
|
25
|
-
* @since 7.1.0
|
|
26
|
-
* @see https://react.dev/reference/react-dom/preconnect
|
|
27
|
-
*/
|
|
28
|
-
export { preconnect };
|
|
29
|
-
/**
|
|
30
|
-
* Eagerly look up the IP of a server that you expect to load resources from.
|
|
31
|
-
*
|
|
32
|
-
* @since 7.1.0
|
|
33
|
-
* @see https://react.dev/reference/react-dom/prefetchDNS
|
|
34
|
-
*/
|
|
35
|
-
export { prefetchDNS };
|
|
36
|
-
/**
|
|
37
|
-
* Eagerly fetch and evaluate a stylesheet or external script.
|
|
38
|
-
*
|
|
39
|
-
* @since 7.1.0
|
|
40
|
-
* @see https://react.dev/reference/react-dom/preinit
|
|
41
|
-
*/
|
|
42
|
-
export { preinit };
|
|
43
|
-
/**
|
|
44
|
-
* Eagerly fetch and evaluate an ESM module.
|
|
13
|
+
* Finds the dom node of a React component.
|
|
45
14
|
*
|
|
46
|
-
* @
|
|
47
|
-
* @see https://react.dev/reference/react-dom/preinitModule
|
|
15
|
+
* @param {React.ComponentType} component Component's instance.
|
|
48
16
|
*/
|
|
49
|
-
export {
|
|
17
|
+
export { findDOMNode };
|
|
50
18
|
/**
|
|
51
|
-
*
|
|
19
|
+
* Forces React to flush any updates inside the provided callback synchronously.
|
|
52
20
|
*
|
|
53
|
-
* @
|
|
54
|
-
* @see https://react.dev/reference/react-dom/preload
|
|
21
|
+
* @see https://react.dev/reference/react-dom/flushSync
|
|
55
22
|
*/
|
|
56
|
-
export {
|
|
23
|
+
export { flushSync };
|
|
57
24
|
/**
|
|
58
|
-
*
|
|
25
|
+
* Renders a given element into the target DOM node.
|
|
59
26
|
*
|
|
60
|
-
* @since
|
|
61
|
-
* @see https://react.dev/reference/react-dom/
|
|
27
|
+
* @deprecated since WordPress 6.2.0. Use `createRoot` instead.
|
|
28
|
+
* @see https://react.dev/reference/react-dom/render
|
|
62
29
|
*/
|
|
63
|
-
export {
|
|
30
|
+
export { render };
|
|
64
31
|
/**
|
|
65
|
-
*
|
|
32
|
+
* Hydrates a given element into the target DOM node.
|
|
66
33
|
*
|
|
67
|
-
* @since
|
|
68
|
-
* @see https://react.dev/reference/react-dom/
|
|
34
|
+
* @deprecated since WordPress 6.2.0. Use `hydrateRoot` instead.
|
|
35
|
+
* @see https://react.dev/reference/react-dom/hydrate
|
|
69
36
|
*/
|
|
70
|
-
export {
|
|
37
|
+
export { hydrate };
|
|
71
38
|
/**
|
|
72
39
|
* Creates a new React root for the target DOM node.
|
|
73
40
|
*
|
|
@@ -82,4 +49,11 @@ export { createRoot };
|
|
|
82
49
|
* @see https://react.dev/reference/react-dom/client/hydrateRoot
|
|
83
50
|
*/
|
|
84
51
|
export { hydrateRoot };
|
|
52
|
+
/**
|
|
53
|
+
* Removes any mounted element from the target DOM node.
|
|
54
|
+
*
|
|
55
|
+
* @deprecated since WordPress 6.2.0. Use `root.unmount()` instead.
|
|
56
|
+
* @see https://react.dev/reference/react-dom/unmountComponentAtNode
|
|
57
|
+
*/
|
|
58
|
+
export { unmountComponentAtNode };
|
|
85
59
|
//# sourceMappingURL=react-platform.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-platform.d.ts","sourceRoot":"","sources":["../src/react-platform.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACN,YAAY,EACZ,
|
|
1
|
+
{"version":3,"file":"react-platform.d.ts","sourceRoot":"","sources":["../src/react-platform.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACN,YAAY,EACZ,WAAW,EACX,SAAS,EAET,MAAM,EACN,OAAO,EACP,sBAAsB,EAEtB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE3D;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,CAAC;AAExB;;;;GAIG;AACH,OAAO,EAAE,WAAW,EAAE,CAAC;AAEvB;;;;GAIG;AACH,OAAO,EAAE,SAAS,EAAE,CAAC;AAErB;;;;;GAKG;AACH,OAAO,EAAE,MAAM,EAAE,CAAC;AAElB;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,CAAC;AAEnB;;;;;GAKG;AACH,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB;;;;;GAKG;AACH,OAAO,EAAE,WAAW,EAAE,CAAC;AAEvB;;;;;GAKG;AACH,OAAO,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function findDOMNode(instance: any): Element | Text | null;
|
|
2
|
+
export declare function render(element: React.ReactNode, container: Element, callback?: () => void): void;
|
|
3
|
+
export declare function hydrate(element: React.ReactNode, container: Element, callback?: () => void): void;
|
|
4
|
+
export declare function unmountComponentAtNode(container: Element): boolean;
|
|
5
|
+
//# sourceMappingURL=react-polyfill-base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-polyfill-base.d.ts","sourceRoot":"","sources":["../src/react-polyfill-base.ts"],"names":[],"mappings":"AAyDA,wBAAgB,WAAW,CAAE,QAAQ,EAAE,GAAG,GAAI,OAAO,GAAG,IAAI,GAAG,IAAI,CAsBlE;AAID,wBAAgB,MAAM,CACrB,OAAO,EAAE,KAAK,CAAC,SAAS,EACxB,SAAS,EAAE,OAAO,EAClB,QAAQ,CAAC,EAAE,MAAM,IAAI,GACnB,IAAI,CAcN;AAED,wBAAgB,OAAO,CACtB,OAAO,EAAE,KAAK,CAAC,SAAS,EACxB,SAAS,EAAE,OAAO,EAClB,QAAQ,CAAC,EAAE,MAAM,IAAI,GACnB,IAAI,CAYN;AAED,wBAAgB,sBAAsB,CAAE,SAAS,EAAE,OAAO,GAAI,OAAO,CAWpE"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finds the DOM node of a React component instance.
|
|
3
|
+
*
|
|
4
|
+
* @deprecated since WordPress 7.1.0. Use DOM refs instead.
|
|
5
|
+
* @see https://react.dev/reference/react-dom/findDOMNode
|
|
6
|
+
*
|
|
7
|
+
* @param instance Component's instance.
|
|
8
|
+
*/
|
|
9
|
+
export declare function findDOMNode(instance: any): Element | Text | null;
|
|
10
|
+
/**
|
|
11
|
+
* Renders a given element into the target DOM node.
|
|
12
|
+
*
|
|
13
|
+
* @deprecated since WordPress 6.2.0. Use `createRoot` instead.
|
|
14
|
+
* @see https://react.dev/reference/react-dom/render
|
|
15
|
+
*
|
|
16
|
+
* @param element Element to render.
|
|
17
|
+
* @param container DOM node into which to render.
|
|
18
|
+
* @param callback Optional callback called after render.
|
|
19
|
+
*/
|
|
20
|
+
export declare function render(element: React.ReactNode, container: Element, callback?: () => void): void;
|
|
21
|
+
/**
|
|
22
|
+
* Hydrates a given element into the target DOM node.
|
|
23
|
+
*
|
|
24
|
+
* @deprecated since WordPress 6.2.0. Use `hydrateRoot` instead.
|
|
25
|
+
* @see https://react.dev/reference/react-dom/hydrate
|
|
26
|
+
*
|
|
27
|
+
* @param element Element to hydrate.
|
|
28
|
+
* @param container DOM node to hydrate.
|
|
29
|
+
* @param callback Optional callback called after hydration.
|
|
30
|
+
*/
|
|
31
|
+
export declare function hydrate(element: React.ReactNode, container: Element, callback?: () => void): void;
|
|
32
|
+
/**
|
|
33
|
+
* Removes any mounted element from the target DOM node.
|
|
34
|
+
*
|
|
35
|
+
* @deprecated since WordPress 6.2.0. Use `root.unmount()` instead.
|
|
36
|
+
* @see https://react.dev/reference/react-dom/unmountComponentAtNode
|
|
37
|
+
*
|
|
38
|
+
* @param container DOM node in which to unmount.
|
|
39
|
+
* @return Whether the node was unmounted.
|
|
40
|
+
*/
|
|
41
|
+
export declare function unmountComponentAtNode(container: Element): boolean;
|
|
42
|
+
//# sourceMappingURL=react-polyfill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-polyfill.d.ts","sourceRoot":"","sources":["../src/react-polyfill.ts"],"names":[],"mappings":"AAeA;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAE,QAAQ,EAAE,GAAG,GAAI,OAAO,GAAG,IAAI,GAAG,IAAI,CAQlE;AAED;;;;;;;;;GASG;AACH,wBAAgB,MAAM,CACrB,OAAO,EAAE,KAAK,CAAC,SAAS,EACxB,SAAS,EAAE,OAAO,EAClB,QAAQ,CAAC,EAAE,MAAM,IAAI,GACnB,IAAI,CAQN;AAED;;;;;;;;;GASG;AACH,wBAAgB,OAAO,CACtB,OAAO,EAAE,KAAK,CAAC,SAAS,EACxB,SAAS,EAAE,OAAO,EAClB,QAAQ,CAAC,EAAE,MAAM,IAAI,GACnB,IAAI,CAQN;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAE,SAAS,EAAE,OAAO,GAAI,OAAO,CAQpE"}
|
package/build-types/react.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { Children, cloneElement, Component, createContext, createElement, createRef, forwardRef, Fragment, isValidElement, memo, PureComponent, StrictMode, useCallback, useContext, useDebugValue, useDeferredValue, useEffect, useId, useMemo, useImperativeHandle, useInsertionEffect, useLayoutEffect, useReducer, useRef, useState, useSyncExternalStore, useTransition, startTransition, lazy, Suspense } from 'react';
|
|
5
5
|
import type { ReactNode } from 'react';
|
|
6
6
|
/**
|
|
7
7
|
* Object containing a React element.
|
|
@@ -27,13 +27,6 @@ export type RefCallback<T> = React.RefCallback<T>;
|
|
|
27
27
|
* Object containing a React ref.
|
|
28
28
|
*/
|
|
29
29
|
export type Ref<T> = React.Ref<T>;
|
|
30
|
-
/**
|
|
31
|
-
* Hide and show parts of the UI while preserving state.
|
|
32
|
-
*
|
|
33
|
-
* @since 7.1.0
|
|
34
|
-
* @see https://react.dev/reference/react/Activity
|
|
35
|
-
*/
|
|
36
|
-
export { Activity };
|
|
37
30
|
/**
|
|
38
31
|
* Object that provides utilities for dealing with React children.
|
|
39
32
|
*/
|
|
@@ -112,20 +105,6 @@ export { memo };
|
|
|
112
105
|
* Component that activates additional checks and warnings for its descendants.
|
|
113
106
|
*/
|
|
114
107
|
export { StrictMode };
|
|
115
|
-
/**
|
|
116
|
-
* Read the value of a resource like a Promise or context.
|
|
117
|
-
*
|
|
118
|
-
* @since 7.1.0
|
|
119
|
-
* @see https://react.dev/reference/react/use
|
|
120
|
-
*/
|
|
121
|
-
export { use };
|
|
122
|
-
/**
|
|
123
|
-
* Manage state based on the result of a form action.
|
|
124
|
-
*
|
|
125
|
-
* @since 7.1.0
|
|
126
|
-
* @see https://react.dev/reference/react/useActionState
|
|
127
|
-
*/
|
|
128
|
-
export { useActionState };
|
|
129
108
|
/**
|
|
130
109
|
* @see https://react.dev/reference/react/useCallback
|
|
131
110
|
*/
|
|
@@ -146,13 +125,6 @@ export { useDeferredValue };
|
|
|
146
125
|
* @see https://react.dev/reference/react/useEffect
|
|
147
126
|
*/
|
|
148
127
|
export { useEffect };
|
|
149
|
-
/**
|
|
150
|
-
* Extract non-reactive logic from an Effect into an Effect Event.
|
|
151
|
-
*
|
|
152
|
-
* @since 7.1.0
|
|
153
|
-
* @see https://react.dev/reference/react/useEffectEvent
|
|
154
|
-
*/
|
|
155
|
-
export { useEffectEvent };
|
|
156
128
|
/**
|
|
157
129
|
* @see https://react.dev/reference/react/useId
|
|
158
130
|
*/
|
|
@@ -173,13 +145,6 @@ export { useLayoutEffect };
|
|
|
173
145
|
* @see https://react.dev/reference/react/useMemo
|
|
174
146
|
*/
|
|
175
147
|
export { useMemo };
|
|
176
|
-
/**
|
|
177
|
-
* Show a different state while an async action is underway.
|
|
178
|
-
*
|
|
179
|
-
* @since 7.1.0
|
|
180
|
-
* @see https://react.dev/reference/react/useOptimistic
|
|
181
|
-
*/
|
|
182
|
-
export { useOptimistic };
|
|
183
148
|
/**
|
|
184
149
|
* @see https://react.dev/reference/react/useReducer
|
|
185
150
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACN,QAAQ,EACR,
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACN,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,aAAa,EACb,aAAa,EACb,SAAS,EACT,UAAU,EACV,QAAQ,EACR,cAAc,EACd,IAAI,EACJ,aAAa,EACb,UAAU,EACV,WAAW,EACX,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,OAAO,EACP,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,UAAU,EACV,MAAM,EACN,QAAQ,EACR,oBAAoB,EACpB,aAAa,EACb,eAAe,EACf,IAAI,EACJ,QAAQ,EACR,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,KAAK,CAAC,YAAY,CAAC;AAEzC;;GAEG;AACH,MAAM,MAAM,aAAa,CAAE,CAAC,GAAG,GAAG,IAAK,KAAK,CAAC,aAAa,CAAE,CAAC,CAAE,CAAC;AAEhE;;GAEG;AACH,MAAM,MAAM,cAAc,CAAE,CAAC,GAAG,OAAO,IAAK,KAAK,CAAC,cAAc,CAAE,CAAC,CAAE,CAAC;AAEtE;;GAEG;AACH,MAAM,MAAM,SAAS,CAAE,CAAC,IAAK,KAAK,CAAC,SAAS,CAAE,CAAC,CAAE,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,WAAW,CAAE,CAAC,IAAK,KAAK,CAAC,WAAW,CAAE,CAAC,CAAE,CAAC;AAEtD;;GAEG;AACH,MAAM,MAAM,GAAG,CAAE,CAAC,IAAK,KAAK,CAAC,GAAG,CAAE,CAA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AE,GAAG,CAAO,GACvC,MAAM,CA8BR;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC9B,SAAS,EAAE,KAAK,CAAC,cAAc,EAC/B,KAAK,EAAE,MAAM,CAAE,MAAM,EAAE,GAAG,CAAE,EAC5B,OAAO,CAAC,EAAE,GAAG,EACb,aAAa,GAAE,MAAM,CAAE,MAAM,EAAE,GAAG,CAAO,GACvC,MAAM,CAUR;AA0BD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAE,KAAK,EAAE,MAAM,CAAE,MAAM,EAAE,GAAG,CAAE,GAAI,MAAM,CAsDvE;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAE,KAAK,EAAE,WAAW,GAAG,MAAM,GAAI,MAAM,GAAG,SAAS,CA2B7E;eAEc,aAAa"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/element",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"description": "Element React module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"import": "./build-module/index.mjs",
|
|
39
39
|
"require": "./build/index.cjs"
|
|
40
40
|
},
|
|
41
|
+
"./react-polyfill": "./src/react-polyfill-base.ts",
|
|
41
42
|
"./package.json": "./package.json"
|
|
42
43
|
},
|
|
43
44
|
"react-native": "src/index",
|
|
@@ -45,17 +46,17 @@
|
|
|
45
46
|
"types": "build-types",
|
|
46
47
|
"sideEffects": false,
|
|
47
48
|
"dependencies": {
|
|
48
|
-
"@types/react": "^
|
|
49
|
-
"@types/react-dom": "^
|
|
50
|
-
"@wordpress/deprecated": "^4.
|
|
51
|
-
"@wordpress/escape-html": "^3.
|
|
49
|
+
"@types/react": "^18.3.27",
|
|
50
|
+
"@types/react-dom": "^18.3.1",
|
|
51
|
+
"@wordpress/deprecated": "^4.48.0",
|
|
52
|
+
"@wordpress/escape-html": "^3.48.0",
|
|
52
53
|
"change-case": "^4.1.2",
|
|
53
54
|
"is-plain-object": "^5.0.0",
|
|
54
|
-
"react": "^
|
|
55
|
-
"react-dom": "^
|
|
55
|
+
"react": "^18.3.0",
|
|
56
|
+
"react-dom": "^18.3.0"
|
|
56
57
|
},
|
|
57
58
|
"publishConfig": {
|
|
58
59
|
"access": "public"
|
|
59
60
|
},
|
|
60
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "e7856693aeb4e2522d13608cd32c994e4a97cb9c"
|
|
61
62
|
}
|
package/src/index.ts
CHANGED
|
@@ -5,4 +5,9 @@ export * from './utils';
|
|
|
5
5
|
export { default as Platform } from './platform';
|
|
6
6
|
export { default as renderToString } from './serialize';
|
|
7
7
|
export { default as RawHTML } from './raw-html';
|
|
8
|
-
export {
|
|
8
|
+
// export {
|
|
9
|
+
// findDOMNode,
|
|
10
|
+
// render,
|
|
11
|
+
// hydrate,
|
|
12
|
+
// unmountComponentAtNode,
|
|
13
|
+
// } from './react-polyfill';
|