@wordpress/element 6.32.0 → 6.32.1-next.b8c8708f3.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/build/create-interpolate-element.js +79 -183
- package/build/create-interpolate-element.js.map +7 -1
- package/build/index.js +52 -74
- package/build/index.js.map +7 -1
- package/build/platform.android.js +29 -16
- package/build/platform.android.js.map +7 -1
- package/build/platform.ios.js +29 -16
- package/build/platform.ios.js.map +7 -1
- package/build/platform.js +25 -40
- package/build/platform.js.map +7 -1
- package/build/raw-html.js +28 -47
- package/build/raw-html.js.map +7 -1
- package/build/react-platform.js +43 -55
- package/build/react-platform.js.map +7 -1
- package/build/react.js +114 -411
- package/build/react.js.map +7 -1
- package/build/serialize.js +418 -325
- package/build/serialize.js.map +7 -1
- package/build/utils.js +29 -15
- package/build/utils.js.map +7 -1
- package/build-module/create-interpolate-element.js +63 -175
- package/build-module/create-interpolate-element.js.map +7 -1
- package/build-module/index.js +14 -8
- package/build-module/index.js.map +7 -1
- package/build-module/platform.android.js +10 -10
- package/build-module/platform.android.js.map +7 -1
- package/build-module/platform.ios.js +10 -10
- package/build-module/platform.ios.js.map +7 -1
- package/build-module/platform.js +7 -36
- package/build-module/platform.js.map +7 -1
- package/build-module/raw-html.js +11 -44
- package/build-module/raw-html.js.map +7 -1
- package/build-module/react-platform.js +20 -71
- package/build-module/react-platform.js.map +7 -1
- package/build-module/react.js +91 -255
- package/build-module/react.js.map +7 -1
- package/build-module/serialize.js +382 -311
- package/build-module/serialize.js.map +7 -1
- package/build-module/utils.js +7 -10
- package/build-module/utils.js.map +7 -1
- package/package.json +11 -4
- package/build/react-platform.native.js +0 -22
- package/build/react-platform.native.js.map +0 -1
- package/build-module/react-platform.native.js +0 -15
- package/build-module/react-platform.native.js.map +0 -1
package/build/platform.ios.js
CHANGED
|
@@ -1,21 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var platform_ios_exports = {};
|
|
20
|
+
__export(platform_ios_exports, {
|
|
21
|
+
default: () => platform_ios_default
|
|
5
22
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
/**
|
|
9
|
-
* External dependencies
|
|
10
|
-
*/
|
|
11
|
-
|
|
23
|
+
module.exports = __toCommonJS(platform_ios_exports);
|
|
24
|
+
var import_react_native = require("react-native");
|
|
12
25
|
const Platform = {
|
|
13
|
-
...
|
|
14
|
-
OS:
|
|
15
|
-
select: spec => {
|
|
16
|
-
if (
|
|
26
|
+
...import_react_native.Platform,
|
|
27
|
+
OS: "native",
|
|
28
|
+
select: (spec) => {
|
|
29
|
+
if ("ios" in spec) {
|
|
17
30
|
return spec.ios;
|
|
18
|
-
} else if (
|
|
31
|
+
} else if ("native" in spec) {
|
|
19
32
|
return spec.native;
|
|
20
33
|
}
|
|
21
34
|
return spec.default;
|
|
@@ -23,5 +36,5 @@ const Platform = {
|
|
|
23
36
|
isNative: true,
|
|
24
37
|
isIOS: true
|
|
25
38
|
};
|
|
26
|
-
var
|
|
27
|
-
//# sourceMappingURL=platform.ios.js.map
|
|
39
|
+
var platform_ios_default = Platform;
|
|
40
|
+
//# sourceMappingURL=platform.ios.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/platform.ios.js"],
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport { Platform as OriginalPlatform } from 'react-native';\n\nconst Platform = {\n\t...OriginalPlatform,\n\tOS: 'native',\n\tselect: ( spec ) => {\n\t\tif ( 'ios' in spec ) {\n\t\t\treturn spec.ios;\n\t\t} else if ( 'native' in spec ) {\n\t\t\treturn spec.native;\n\t\t}\n\t\treturn spec.default;\n\t},\n\tisNative: true,\n\tisIOS: true,\n};\n\nexport default Platform;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAA6C;AAE7C,MAAM,WAAW;AAAA,EAChB,GAAG,oBAAAA;AAAA,EACH,IAAI;AAAA,EACJ,QAAQ,CAAE,SAAU;AACnB,QAAK,SAAS,MAAO;AACpB,aAAO,KAAK;AAAA,IACb,WAAY,YAAY,MAAO;AAC9B,aAAO,KAAK;AAAA,IACb;AACA,WAAO,KAAK;AAAA,EACb;AAAA,EACA,UAAU;AAAA,EACV,OAAO;AACR;AAEA,IAAO,uBAAQ;",
|
|
6
|
+
"names": ["OriginalPlatform"]
|
|
7
|
+
}
|
package/build/platform.js
CHANGED
|
@@ -1,44 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var platform_exports = {};
|
|
20
|
+
__export(platform_exports, {
|
|
21
|
+
default: () => platform_default
|
|
5
22
|
});
|
|
6
|
-
exports
|
|
7
|
-
/**
|
|
8
|
-
* Parts of this source were derived and modified from react-native-web,
|
|
9
|
-
* released under the MIT license.
|
|
10
|
-
*
|
|
11
|
-
* Copyright (c) 2016-present, Nicolas Gallagher.
|
|
12
|
-
* Copyright (c) 2015-present, Facebook, Inc.
|
|
13
|
-
*
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Specification for platform-specific value selection.
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Component used to detect the current Platform being used.
|
|
22
|
-
* Use Platform.OS === 'web' to detect if running on web environment.
|
|
23
|
-
*
|
|
24
|
-
* This is the same concept as the React Native implementation.
|
|
25
|
-
*
|
|
26
|
-
* @see https://reactnative.dev/docs/platform-specific-code#platform-module
|
|
27
|
-
*
|
|
28
|
-
* Here is an example of how to use the select method:
|
|
29
|
-
* @example
|
|
30
|
-
* ```js
|
|
31
|
-
* import { Platform } from '@wordpress/element';
|
|
32
|
-
*
|
|
33
|
-
* const placeholderLabel = Platform.select( {
|
|
34
|
-
* native: __( 'Add media' ),
|
|
35
|
-
* web: __( 'Drag images, upload new ones or select files from your library.' ),
|
|
36
|
-
* } );
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
23
|
+
module.exports = __toCommonJS(platform_exports);
|
|
39
24
|
const Platform = {
|
|
40
25
|
/** Platform identifier. Will always be `'web'` in this module. */
|
|
41
|
-
OS:
|
|
26
|
+
OS: "web",
|
|
42
27
|
/**
|
|
43
28
|
* Select a value based on the platform.
|
|
44
29
|
*
|
|
@@ -47,10 +32,10 @@ const Platform = {
|
|
|
47
32
|
* @return The selected value.
|
|
48
33
|
*/
|
|
49
34
|
select(spec) {
|
|
50
|
-
return
|
|
35
|
+
return "web" in spec ? spec.web : spec.default;
|
|
51
36
|
},
|
|
52
37
|
/** Whether the platform is web */
|
|
53
38
|
isWeb: true
|
|
54
39
|
};
|
|
55
|
-
var
|
|
56
|
-
//# sourceMappingURL=platform.js.map
|
|
40
|
+
var platform_default = Platform;
|
|
41
|
+
//# sourceMappingURL=platform.js.map
|
package/build/platform.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/platform.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Parts of this source were derived and modified from react-native-web,\n * released under the MIT license.\n *\n * Copyright (c) 2016-present, Nicolas Gallagher.\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n */\n\n/**\n * Specification for platform-specific value selection.\n */\ntype PlatformSelectSpec< T > = {\n\tweb?: T;\n\tdefault?: T;\n};\n\n/**\n * Component used to detect the current Platform being used.\n * Use Platform.OS === 'web' to detect if running on web environment.\n *\n * This is the same concept as the React Native implementation.\n *\n * @see https://reactnative.dev/docs/platform-specific-code#platform-module\n *\n * Here is an example of how to use the select method:\n * @example\n * ```js\n * import { Platform } from '@wordpress/element';\n *\n * const placeholderLabel = Platform.select( {\n * native: __( 'Add media' ),\n * web: __( 'Drag images, upload new ones or select files from your library.' ),\n * } );\n * ```\n */\nconst Platform = {\n\t/** Platform identifier. Will always be `'web'` in this module. */\n\tOS: 'web' as const,\n\n\t/**\n\t * Select a value based on the platform.\n\t *\n\t * @template T\n\t * @param spec - Object with optional platform-specific values.\n\t * @return The selected value.\n\t */\n\tselect< T >( spec: PlatformSelectSpec< T > ): T | undefined {\n\t\treturn 'web' in spec ? spec.web : spec.default;\n\t},\n\n\t/** Whether the platform is web */\n\tisWeb: true,\n};\n\nexport default Platform;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoCA,MAAM,WAAW;AAAA;AAAA,EAEhB,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASJ,OAAa,MAA+C;AAC3D,WAAO,SAAS,OAAO,KAAK,MAAM,KAAK;AAAA,EACxC;AAAA;AAAA,EAGA,OAAO;AACR;AAEA,IAAO,mBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/build/raw-html.js
CHANGED
|
@@ -1,59 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var raw_html_exports = {};
|
|
20
|
+
__export(raw_html_exports, {
|
|
21
|
+
default: () => RawHTML
|
|
5
22
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
/**
|
|
9
|
-
* Internal dependencies
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Props for the RawHTML component.
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Component used to render unescaped HTML.
|
|
18
|
-
*
|
|
19
|
-
* Note: The `renderElement` serializer will remove the `div` wrapper
|
|
20
|
-
* unless non-children props are present; typically when preparing a block for saving.
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```jsx
|
|
24
|
-
* import { RawHTML } from '@wordpress/element';
|
|
25
|
-
*
|
|
26
|
-
* const Component = () => <RawHTML><h3>Hello world</h3></RawHTML>;
|
|
27
|
-
* // Edit: <div><h3>Hello world</h3></div>
|
|
28
|
-
* // save: <h3>Hello world</h3>
|
|
29
|
-
* ```
|
|
30
|
-
*
|
|
31
|
-
* @param {RawHTMLProps} props Children should be a string of HTML or an array
|
|
32
|
-
* of strings. Other props will be passed through
|
|
33
|
-
* to the div wrapper.
|
|
34
|
-
*
|
|
35
|
-
* @return Dangerously-rendering component.
|
|
36
|
-
*/
|
|
23
|
+
module.exports = __toCommonJS(raw_html_exports);
|
|
24
|
+
var import_react = require("./react");
|
|
37
25
|
function RawHTML({
|
|
38
26
|
children,
|
|
39
27
|
...props
|
|
40
28
|
}) {
|
|
41
|
-
let rawHtml =
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
_react.Children.toArray(children).forEach(child => {
|
|
45
|
-
if (typeof child === 'string' && child.trim() !== '') {
|
|
29
|
+
let rawHtml = "";
|
|
30
|
+
import_react.Children.toArray(children).forEach((child) => {
|
|
31
|
+
if (typeof child === "string" && child.trim() !== "") {
|
|
46
32
|
rawHtml += child;
|
|
47
33
|
}
|
|
48
34
|
});
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
// `./serialize.js` unless there are non-children props present.
|
|
52
|
-
return (0, _react.createElement)('div', {
|
|
53
|
-
dangerouslySetInnerHTML: {
|
|
54
|
-
__html: rawHtml
|
|
55
|
-
},
|
|
35
|
+
return (0, import_react.createElement)("div", {
|
|
36
|
+
dangerouslySetInnerHTML: { __html: rawHtml },
|
|
56
37
|
...props
|
|
57
38
|
});
|
|
58
39
|
}
|
|
59
|
-
//# sourceMappingURL=raw-html.js.map
|
|
40
|
+
//# sourceMappingURL=raw-html.js.map
|
package/build/raw-html.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/raw-html.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport { Children, createElement } from './react';\n\n/**\n * Props for the RawHTML component.\n */\nexport type RawHTMLProps = {\n\tchildren: string | string[];\n} & React.ComponentPropsWithoutRef< 'div' >;\n\n/**\n * Component used to render unescaped HTML.\n *\n * Note: The `renderElement` serializer will remove the `div` wrapper\n * unless non-children props are present; typically when preparing a block for saving.\n *\n * @example\n * ```jsx\n * import { RawHTML } from '@wordpress/element';\n *\n * const Component = () => <RawHTML><h3>Hello world</h3></RawHTML>;\n * // Edit: <div><h3>Hello world</h3></div>\n * // save: <h3>Hello world</h3>\n * ```\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 Dangerously-rendering component.\n */\nexport default function RawHTML( {\n\tchildren,\n\t...props\n}: RawHTMLProps ): JSX.Element {\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"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,mBAAwC;AA8BzB,SAAR,QAA0B;AAAA,EAChC;AAAA,EACA,GAAG;AACJ,GAA+B;AAC9B,MAAI,UAAU;AAGd,wBAAS,QAAS,QAAS,EAAE,QAAS,CAAE,UAAW;AAClD,QAAK,OAAO,UAAU,YAAY,MAAM,KAAK,MAAM,IAAK;AACvD,iBAAW;AAAA,IACZ;AAAA,EACD,CAAE;AAIF,aAAO,4BAAe,OAAO;AAAA,IAC5B,yBAAyB,EAAE,QAAQ,QAAQ;AAAA,IAC3C,GAAG;AAAA,EACJ,CAAE;AACH;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/build/react-platform.js
CHANGED
|
@@ -1,56 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return _reactDom.render;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
Object.defineProperty(exports, "unmountComponentAtNode", {
|
|
49
|
-
enumerable: true,
|
|
50
|
-
get: function () {
|
|
51
|
-
return _reactDom.unmountComponentAtNode;
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
var _reactDom = require("react-dom");
|
|
55
|
-
var _client = require("react-dom/client");
|
|
56
|
-
//# sourceMappingURL=react-platform.js.map
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var react_platform_exports = {};
|
|
20
|
+
__export(react_platform_exports, {
|
|
21
|
+
createPortal: () => import_react_dom.createPortal,
|
|
22
|
+
createRoot: () => import_client.createRoot,
|
|
23
|
+
findDOMNode: () => import_react_dom.findDOMNode,
|
|
24
|
+
flushSync: () => import_react_dom.flushSync,
|
|
25
|
+
hydrate: () => import_react_dom.hydrate,
|
|
26
|
+
hydrateRoot: () => import_client.hydrateRoot,
|
|
27
|
+
render: () => import_react_dom.render,
|
|
28
|
+
unmountComponentAtNode: () => import_react_dom.unmountComponentAtNode
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(react_platform_exports);
|
|
31
|
+
var import_react_dom = require("react-dom");
|
|
32
|
+
var import_client = require("react-dom/client");
|
|
33
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
+
0 && (module.exports = {
|
|
35
|
+
createPortal,
|
|
36
|
+
createRoot,
|
|
37
|
+
findDOMNode,
|
|
38
|
+
flushSync,
|
|
39
|
+
hydrate,
|
|
40
|
+
hydrateRoot,
|
|
41
|
+
render,
|
|
42
|
+
unmountComponentAtNode
|
|
43
|
+
});
|
|
44
|
+
//# sourceMappingURL=react-platform.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/react-platform.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport {\n\tcreatePortal,\n\tfindDOMNode,\n\tflushSync,\n\trender,\n\thydrate,\n\tunmountComponentAtNode,\n} from 'react-dom';\nimport { createRoot, hydrateRoot } from 'react-dom/client';\n\n/**\n * Creates a portal into which a component can be rendered.\n *\n * @see https://github.com/facebook/react/issues/10309#issuecomment-318433235\n *\n * @param {import('react').ReactElement} child Any renderable child, such as an element,\n * string, or fragment.\n * @param {HTMLElement} container DOM node into which element should be rendered.\n */\nexport { createPortal };\n\n/**\n * Finds the dom node of a React component.\n *\n * @param {import('react').ComponentType} component Component's instance.\n */\nexport { findDOMNode };\n\n/**\n * Forces React to flush any updates inside the provided callback synchronously.\n *\n * @param {Function} callback Callback to run synchronously.\n */\nexport { flushSync };\n\n/**\n * Renders a given element into the target DOM node.\n *\n * @deprecated since WordPress 6.2.0. Use `createRoot` instead.\n * @see https://react.dev/reference/react-dom/render\n */\nexport { render };\n\n/**\n * Hydrates a given element into the target DOM node.\n *\n * @deprecated since WordPress 6.2.0. Use `hydrateRoot` instead.\n * @see https://react.dev/reference/react-dom/hydrate\n */\nexport { hydrate };\n\n/**\n * Creates a new React root for the target DOM node.\n *\n * @since 6.2.0 Introduced in WordPress core.\n * @see https://react.dev/reference/react-dom/client/createRoot\n */\nexport { createRoot };\n\n/**\n * Creates a new React root for the target DOM node and hydrates it with a pre-generated markup.\n *\n * @since 6.2.0 Introduced in WordPress core.\n * @see https://react.dev/reference/react-dom/client/hydrateRoot\n */\nexport { hydrateRoot };\n\n/**\n * Removes any mounted element from the target DOM node.\n *\n * @deprecated since WordPress 6.2.0. Use `root.unmount()` instead.\n * @see https://react.dev/reference/react-dom/unmountComponentAtNode\n */\nexport { unmountComponentAtNode };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,uBAOO;AACP,oBAAwC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|