@wordpress/element 6.32.0 → 6.32.1-next.ff1cebbba.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/build/create-interpolate-element.js +79 -183
  2. package/build/create-interpolate-element.js.map +7 -1
  3. package/build/index.js +52 -74
  4. package/build/index.js.map +7 -1
  5. package/build/platform.android.js +29 -16
  6. package/build/platform.android.js.map +7 -1
  7. package/build/platform.ios.js +29 -16
  8. package/build/platform.ios.js.map +7 -1
  9. package/build/platform.js +25 -40
  10. package/build/platform.js.map +7 -1
  11. package/build/raw-html.js +28 -47
  12. package/build/raw-html.js.map +7 -1
  13. package/build/react-platform.js +43 -55
  14. package/build/react-platform.js.map +7 -1
  15. package/build/react.js +114 -411
  16. package/build/react.js.map +7 -1
  17. package/build/serialize.js +418 -325
  18. package/build/serialize.js.map +7 -1
  19. package/build/utils.js +29 -15
  20. package/build/utils.js.map +7 -1
  21. package/build-module/create-interpolate-element.js +63 -175
  22. package/build-module/create-interpolate-element.js.map +7 -1
  23. package/build-module/index.js +14 -8
  24. package/build-module/index.js.map +7 -1
  25. package/build-module/platform.android.js +10 -10
  26. package/build-module/platform.android.js.map +7 -1
  27. package/build-module/platform.ios.js +10 -10
  28. package/build-module/platform.ios.js.map +7 -1
  29. package/build-module/platform.js +7 -36
  30. package/build-module/platform.js.map +7 -1
  31. package/build-module/raw-html.js +11 -44
  32. package/build-module/raw-html.js.map +7 -1
  33. package/build-module/react-platform.js +20 -71
  34. package/build-module/react-platform.js.map +7 -1
  35. package/build-module/react.js +91 -255
  36. package/build-module/react.js.map +7 -1
  37. package/build-module/serialize.js +382 -311
  38. package/build-module/serialize.js.map +7 -1
  39. package/build-module/utils.js +7 -10
  40. package/build-module/utils.js.map +7 -1
  41. package/package.json +11 -4
  42. package/build/react-platform.native.js +0 -22
  43. package/build/react-platform.native.js.map +0 -1
  44. package/build-module/react-platform.native.js +0 -15
  45. package/build-module/react-platform.native.js.map +0 -1
@@ -1,21 +1,34 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
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.default = void 0;
7
- var _reactNative = require("react-native");
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
- ..._reactNative.Platform,
14
- OS: 'native',
15
- select: spec => {
16
- if ('ios' in spec) {
26
+ ...import_react_native.Platform,
27
+ OS: "native",
28
+ select: (spec) => {
29
+ if ("ios" in spec) {
17
30
  return spec.ios;
18
- } else if ('native' in spec) {
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 _default = exports.default = Platform;
27
- //# sourceMappingURL=platform.ios.js.map
39
+ var platform_ios_default = Platform;
40
+ //# sourceMappingURL=platform.ios.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["_reactNative","require","Platform","OriginalPlatform","OS","select","spec","ios","native","default","isNative","isIOS","_default","exports"],"sources":["@wordpress/element/src/platform.ios.js"],"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"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,MAAMC,QAAQ,GAAG;EAChB,GAAGC,qBAAgB;EACnBC,EAAE,EAAE,QAAQ;EACZC,MAAM,EAAIC,IAAI,IAAM;IACnB,IAAK,KAAK,IAAIA,IAAI,EAAG;MACpB,OAAOA,IAAI,CAACC,GAAG;IAChB,CAAC,MAAM,IAAK,QAAQ,IAAID,IAAI,EAAG;MAC9B,OAAOA,IAAI,CAACE,MAAM;IACnB;IACA,OAAOF,IAAI,CAACG,OAAO;EACpB,CAAC;EACDC,QAAQ,EAAE,IAAI;EACdC,KAAK,EAAE;AACR,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAJ,OAAA,GAEaP,QAAQ","ignoreList":[]}
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.defineProperty(exports, "__esModule", {
4
- value: true
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.default = void 0;
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: 'web',
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 'web' in spec ? spec.web : spec.default;
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 _default = exports.default = Platform;
56
- //# sourceMappingURL=platform.js.map
40
+ var platform_default = Platform;
41
+ //# sourceMappingURL=platform.js.map
@@ -1 +1,7 @@
1
- {"version":3,"names":["Platform","OS","select","spec","web","default","isWeb","_default","exports"],"sources":["@wordpress/element/src/platform.ts"],"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"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,QAAQ,GAAG;EAChB;EACAC,EAAE,EAAE,KAAc;EAElB;AACD;AACA;AACA;AACA;AACA;AACA;EACCC,MAAMA,CAAOC,IAA6B,EAAkB;IAC3D,OAAO,KAAK,IAAIA,IAAI,GAAGA,IAAI,CAACC,GAAG,GAAGD,IAAI,CAACE,OAAO;EAC/C,CAAC;EAED;EACAC,KAAK,EAAE;AACR,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAH,OAAA,GAEaL,QAAQ","ignoreList":[]}
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.defineProperty(exports, "__esModule", {
4
- value: true
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.default = RawHTML;
7
- var _react = require("./react");
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
- // Cast children as an array, and concatenate each element if it is a string.
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
- // The `div` wrapper will be stripped by the `renderElement` serializer in
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
@@ -1 +1,7 @@
1
- {"version":3,"names":["_react","require","RawHTML","children","props","rawHtml","Children","toArray","forEach","child","trim","createElement","dangerouslySetInnerHTML","__html"],"sources":["@wordpress/element/src/raw-html.ts"],"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"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,OAAOA,CAAE;EAChCC,QAAQ;EACR,GAAGC;AACU,CAAC,EAAgB;EAC9B,IAAIC,OAAO,GAAG,EAAE;;EAEhB;EACAC,eAAQ,CAACC,OAAO,CAAEJ,QAAS,CAAC,CAACK,OAAO,CAAIC,KAAK,IAAM;IAClD,IAAK,OAAOA,KAAK,KAAK,QAAQ,IAAIA,KAAK,CAACC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAG;MACvDL,OAAO,IAAII,KAAK;IACjB;EACD,CAAE,CAAC;;EAEH;EACA;EACA,OAAO,IAAAE,oBAAa,EAAE,KAAK,EAAE;IAC5BC,uBAAuB,EAAE;MAAEC,MAAM,EAAER;IAAQ,CAAC;IAC5C,GAAGD;EACJ,CAAE,CAAC;AACJ","ignoreList":[]}
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
+ }
@@ -1,56 +1,44 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "createPortal", {
7
- enumerable: true,
8
- get: function () {
9
- return _reactDom.createPortal;
10
- }
11
- });
12
- Object.defineProperty(exports, "createRoot", {
13
- enumerable: true,
14
- get: function () {
15
- return _client.createRoot;
16
- }
17
- });
18
- Object.defineProperty(exports, "findDOMNode", {
19
- enumerable: true,
20
- get: function () {
21
- return _reactDom.findDOMNode;
22
- }
23
- });
24
- Object.defineProperty(exports, "flushSync", {
25
- enumerable: true,
26
- get: function () {
27
- return _reactDom.flushSync;
28
- }
29
- });
30
- Object.defineProperty(exports, "hydrate", {
31
- enumerable: true,
32
- get: function () {
33
- return _reactDom.hydrate;
34
- }
35
- });
36
- Object.defineProperty(exports, "hydrateRoot", {
37
- enumerable: true,
38
- get: function () {
39
- return _client.hydrateRoot;
40
- }
41
- });
42
- Object.defineProperty(exports, "render", {
43
- enumerable: true,
44
- get: function () {
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
- {"version":3,"names":["_reactDom","require","_client"],"sources":["@wordpress/element/src/react-platform.ts"],"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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AAQA,IAAAC,OAAA,GAAAD,OAAA","ignoreList":[]}
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
+ }