@wordpress/element 5.16.0 → 5.17.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 +2 -0
- package/build/create-interpolate-element.js +19 -49
- package/build/create-interpolate-element.js.map +1 -1
- package/build/index.js +0 -11
- package/build/index.js.map +1 -1
- package/build/platform.android.js +3 -4
- package/build/platform.android.js.map +1 -1
- package/build/platform.ios.js +3 -4
- package/build/platform.ios.js.map +1 -1
- package/build/platform.js +0 -2
- package/build/platform.js.map +1 -1
- package/build/raw-html.js +5 -6
- package/build/raw-html.js.map +1 -1
- package/build/react-platform.js +0 -2
- package/build/react-platform.js.map +1 -1
- package/build/react-platform.native.js +0 -3
- package/build/react-platform.native.js.map +1 -1
- package/build/react.js +1 -7
- package/build/react.js.map +1 -1
- package/build/serialize.js +37 -100
- package/build/serialize.js.map +1 -1
- package/build/utils.js +0 -4
- package/build/utils.js.map +1 -1
- package/build-module/create-interpolate-element.js +19 -47
- package/build-module/create-interpolate-element.js.map +1 -1
- package/build-module/index.js.map +1 -1
- package/build-module/platform.android.js +2 -2
- package/build-module/platform.android.js.map +1 -1
- package/build-module/platform.ios.js +2 -2
- package/build-module/platform.ios.js.map +1 -1
- package/build-module/platform.js +0 -1
- package/build-module/platform.js.map +1 -1
- package/build-module/raw-html.js +6 -4
- package/build-module/raw-html.js.map +1 -1
- package/build-module/react-platform.js +8 -8
- package/build-module/react-platform.js.map +1 -1
- package/build-module/react-platform.native.js +1 -1
- package/build-module/react-platform.native.js.map +1 -1
- package/build-module/react.js +31 -33
- package/build-module/react.js.map +1 -1
- package/build-module/serialize.js +39 -89
- package/build-module/serialize.js.map +1 -1
- package/build-module/utils.js +0 -2
- package/build-module/utils.js.map +1 -1
- package/build-types/platform.d.ts +2 -2
- package/build-types/react-platform.d.ts +8 -8
- package/build-types/react-platform.d.ts.map +1 -1
- package/build-types/react.d.ts +29 -29
- package/build-types/react.d.ts.map +1 -1
- package/package.json +3 -3
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["Platform","OS","select","spec","web","default","isWeb"],"sources":["@wordpress/element/src/platform.js"],"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 */\nconst Platform = {\n\tOS: 'web',\n\tselect: ( spec ) => ( 'web' in spec ? spec.web : spec.default ),\n\tisWeb: true,\n};\n/**\n * Component used to detect the current Platform being used.\n * Use Platform.OS === 'web' to detect if running on web enviroment.\n *\n * This is the same concept as the React Native implementation.\n *\n * @see https://facebook.github.io/react-native/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 */\nexport default Platform;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,QAAQ,GAAG;EAChBC,EAAE,EAAE,KAAK;EACTC,MAAM,EAAIC,IAAI,IAAQ,KAAK,IAAIA,IAAI,GAAGA,IAAI,CAACC,GAAG,GAAGD,IAAI,CAACE,OAAS;EAC/DC,KAAK,EAAE;AACR,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeN,QAAQ"}
|
package/build-module/raw-html.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { Children, createElement } from './react';
|
|
5
|
+
|
|
5
6
|
/** @typedef {{children: string} & import('react').ComponentPropsWithoutRef<'div'>} RawHTMLProps */
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -16,20 +17,21 @@ import { Children, createElement } from './react';
|
|
|
16
17
|
*
|
|
17
18
|
* @return {JSX.Element} Dangerously-rendering component.
|
|
18
19
|
*/
|
|
19
|
-
|
|
20
20
|
export default function RawHTML({
|
|
21
21
|
children,
|
|
22
22
|
...props
|
|
23
23
|
}) {
|
|
24
|
-
let rawHtml = '';
|
|
24
|
+
let rawHtml = '';
|
|
25
25
|
|
|
26
|
+
// Cast children as an array, and concatenate each element if it is a string.
|
|
26
27
|
Children.toArray(children).forEach(child => {
|
|
27
28
|
if (typeof child === 'string' && child.trim() !== '') {
|
|
28
29
|
rawHtml += child;
|
|
29
30
|
}
|
|
30
|
-
});
|
|
31
|
-
// `./serialize.js` unless there are non-children props present.
|
|
31
|
+
});
|
|
32
32
|
|
|
33
|
+
// The `div` wrapper will be stripped by the `renderElement` serializer in
|
|
34
|
+
// `./serialize.js` unless there are non-children props present.
|
|
33
35
|
return createElement('div', {
|
|
34
36
|
dangerouslySetInnerHTML: {
|
|
35
37
|
__html: rawHtml
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["Children","createElement","RawHTML","children","props","rawHtml","toArray","forEach","child","trim","dangerouslySetInnerHTML","__html"],"sources":["@wordpress/element/src/raw-html.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { Children, createElement } from './react';\n\n/** @typedef {{children: string} & import('react').ComponentPropsWithoutRef<'div'>} RawHTMLProps */\n\n/**\n * Component used as equivalent of Fragment with unescaped HTML, in cases where\n * it is desirable to render dangerous HTML without needing a wrapper element.\n * To preserve additional props, a `div` wrapper _will_ be created if any props\n * aside from `children` are passed.\n *\n * @param {RawHTMLProps} props Children should be a string of HTML or an array\n * of strings. Other props will be passed through\n * to the div wrapper.\n *\n * @return {JSX.Element} Dangerously-rendering component.\n */\nexport default function RawHTML( { children, ...props } ) {\n\tlet rawHtml = '';\n\n\t// Cast children as an array, and concatenate each element if it is a string.\n\tChildren.toArray( children ).forEach( ( child ) => {\n\t\tif ( typeof child === 'string' && child.trim() !== '' ) {\n\t\t\trawHtml += child;\n\t\t}\n\t} );\n\n\t// The `div` wrapper will be stripped by the `renderElement` serializer in\n\t// `./serialize.js` unless there are non-children props present.\n\treturn createElement( 'div', {\n\t\tdangerouslySetInnerHTML: { __html: rawHtml },\n\t\t...props,\n\t} );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,aAAa,QAAQ,SAAS;;AAEjD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,OAAOA,CAAE;EAAEC,QAAQ;EAAE,GAAGC;AAAM,CAAC,EAAG;EACzD,IAAIC,OAAO,GAAG,EAAE;;EAEhB;EACAL,QAAQ,CAACM,OAAO,CAAEH,QAAS,CAAC,CAACI,OAAO,CAAIC,KAAK,IAAM;IAClD,IAAK,OAAOA,KAAK,KAAK,QAAQ,IAAIA,KAAK,CAACC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAG;MACvDJ,OAAO,IAAIG,KAAK;IACjB;EACD,CAAE,CAAC;;EAEH;EACA;EACA,OAAOP,aAAa,CAAE,KAAK,EAAE;IAC5BS,uBAAuB,EAAE;MAAEC,MAAM,EAAEN;IAAQ,CAAC;IAC5C,GAAGD;EACJ,CAAE,CAAC;AACJ"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { createPortal, findDOMNode, flushSync, render, hydrate, unmountComponentAtNode } from 'react-dom';
|
|
5
5
|
import { createRoot, hydrateRoot } from 'react-dom/client';
|
|
6
|
+
|
|
6
7
|
/**
|
|
7
8
|
* Creates a portal into which a component can be rendered.
|
|
8
9
|
*
|
|
@@ -12,60 +13,59 @@ import { createRoot, hydrateRoot } from 'react-dom/client';
|
|
|
12
13
|
* string, or fragment.
|
|
13
14
|
* @param {HTMLElement} container DOM node into which element should be rendered.
|
|
14
15
|
*/
|
|
15
|
-
|
|
16
16
|
export { createPortal };
|
|
17
|
+
|
|
17
18
|
/**
|
|
18
19
|
* Finds the dom node of a React component.
|
|
19
20
|
*
|
|
20
21
|
* @param {import('./react').WPComponent} component Component's instance.
|
|
21
22
|
*/
|
|
22
|
-
|
|
23
23
|
export { findDOMNode };
|
|
24
|
+
|
|
24
25
|
/**
|
|
25
26
|
* Forces React to flush any updates inside the provided callback synchronously.
|
|
26
27
|
*
|
|
27
28
|
* @param {Function} callback Callback to run synchronously.
|
|
28
29
|
*/
|
|
29
|
-
|
|
30
30
|
export { flushSync };
|
|
31
|
+
|
|
31
32
|
/**
|
|
32
33
|
* Renders a given element into the target DOM node.
|
|
33
34
|
*
|
|
34
35
|
* @deprecated since WordPress 6.2.0. Use `createRoot` instead.
|
|
35
36
|
* @see https://react.dev/reference/react-dom/render
|
|
36
37
|
*/
|
|
37
|
-
|
|
38
38
|
export { render };
|
|
39
|
+
|
|
39
40
|
/**
|
|
40
41
|
* Hydrates a given element into the target DOM node.
|
|
41
42
|
*
|
|
42
43
|
* @deprecated since WordPress 6.2.0. Use `hydrateRoot` instead.
|
|
43
44
|
* @see https://react.dev/reference/react-dom/hydrate
|
|
44
45
|
*/
|
|
45
|
-
|
|
46
46
|
export { hydrate };
|
|
47
|
+
|
|
47
48
|
/**
|
|
48
49
|
* Creates a new React root for the target DOM node.
|
|
49
50
|
*
|
|
50
51
|
* @since 6.2.0 Introduced in WordPress core.
|
|
51
52
|
* @see https://react.dev/reference/react-dom/client/createRoot
|
|
52
53
|
*/
|
|
53
|
-
|
|
54
54
|
export { createRoot };
|
|
55
|
+
|
|
55
56
|
/**
|
|
56
57
|
* Creates a new React root for the target DOM node and hydrates it with a pre-generated markup.
|
|
57
58
|
*
|
|
58
59
|
* @since 6.2.0 Introduced in WordPress core.
|
|
59
60
|
* @see https://react.dev/reference/react-dom/client/hydrateRoot
|
|
60
61
|
*/
|
|
61
|
-
|
|
62
62
|
export { hydrateRoot };
|
|
63
|
+
|
|
63
64
|
/**
|
|
64
65
|
* Removes any mounted element from the target DOM node.
|
|
65
66
|
*
|
|
66
67
|
* @deprecated since WordPress 6.2.0. Use `root.unmount()` instead.
|
|
67
68
|
* @see https://react.dev/reference/react-dom/unmountComponentAtNode
|
|
68
69
|
*/
|
|
69
|
-
|
|
70
70
|
export { unmountComponentAtNode };
|
|
71
71
|
//# sourceMappingURL=react-platform.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["createPortal","findDOMNode","flushSync","render","hydrate","unmountComponentAtNode","createRoot","hydrateRoot"],"sources":["@wordpress/element/src/react-platform.js"],"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').WPElement} 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').WPComponent} 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":"AAAA;AACA;AACA;AACA,SACCA,YAAY,EACZC,WAAW,EACXC,SAAS,EACTC,MAAM,EACNC,OAAO,EACPC,sBAAsB,QAChB,WAAW;AAClB,SAASC,UAAU,EAAEC,WAAW,QAAQ,kBAAkB;;AAE1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASP,YAAY;;AAErB;AACA;AACA;AACA;AACA;AACA,SAASC,WAAW;;AAEpB;AACA;AACA;AACA;AACA;AACA,SAASC,SAAS;;AAElB;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,MAAM;;AAEf;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,OAAO;;AAEhB;AACA;AACA;AACA;AACA;AACA;AACA,SAASE,UAAU;;AAEnB;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,WAAW;;AAEpB;AACA;AACA;AACA;AACA;AACA;AACA,SAASF,sBAAsB"}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { AppRegistry } from 'react-native';
|
|
5
|
+
|
|
5
6
|
/**
|
|
6
7
|
* Registers an app root component allowing the native system to run the app.
|
|
7
8
|
*
|
|
8
9
|
* @param {string} appKey Unique app name identifier.
|
|
9
10
|
* @param {Function} componentProvider Function returning the app root React component.
|
|
10
11
|
*/
|
|
11
|
-
|
|
12
12
|
export const registerComponent = (appKey, componentProvider) => {
|
|
13
13
|
AppRegistry.registerComponent(appKey, componentProvider);
|
|
14
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"names":["AppRegistry","registerComponent","appKey","componentProvider"],"sources":["@wordpress/element/src/react-platform.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { AppRegistry } from 'react-native';\n\n/**\n * Registers an app root component allowing the native system to run the app.\n *\n * @param {string} appKey Unique app name identifier.\n * @param {Function} componentProvider Function returning the app root React component.\n */\nexport const registerComponent = ( appKey, componentProvider ) => {\n\tAppRegistry.registerComponent( appKey, componentProvider );\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,cAAc;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,iBAAiB,GAAGA,CAAEC,MAAM,EAAEC,iBAAiB,KAAM;EACjEH,WAAW,CAACC,iBAAiB,CAAEC,MAAM,EAAEC,iBAAkB,CAAC;AAC3D,CAAC"}
|
package/build-module/react.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
|
|
5
5
|
import { Children, cloneElement, Component, createContext, createElement, createRef, forwardRef, Fragment, isValidElement, memo, StrictMode, useCallback, useContext, useDebugValue, useDeferredValue, useEffect, useId, useMemo, useImperativeHandle, useInsertionEffect, useLayoutEffect, useReducer, useRef, useState, useSyncExternalStore, useTransition, startTransition, lazy, Suspense } from 'react';
|
|
6
|
+
|
|
6
7
|
/**
|
|
7
8
|
* Object containing a React element.
|
|
8
9
|
*
|
|
@@ -31,8 +32,8 @@ import { Children, cloneElement, Component, createContext, createElement, create
|
|
|
31
32
|
/**
|
|
32
33
|
* Object that provides utilities for dealing with React children.
|
|
33
34
|
*/
|
|
34
|
-
|
|
35
35
|
export { Children };
|
|
36
|
+
|
|
36
37
|
/**
|
|
37
38
|
* Creates a copy of an element with extended props.
|
|
38
39
|
*
|
|
@@ -41,13 +42,13 @@ export { Children };
|
|
|
41
42
|
*
|
|
42
43
|
* @return {WPElement} Cloned element.
|
|
43
44
|
*/
|
|
44
|
-
|
|
45
45
|
export { cloneElement };
|
|
46
|
+
|
|
46
47
|
/**
|
|
47
48
|
* A base class to create WordPress Components (Refs, state and lifecycle hooks)
|
|
48
49
|
*/
|
|
49
|
-
|
|
50
50
|
export { Component };
|
|
51
|
+
|
|
51
52
|
/**
|
|
52
53
|
* Creates a context object containing two components: a provider and consumer.
|
|
53
54
|
*
|
|
@@ -55,8 +56,8 @@ export { Component };
|
|
|
55
56
|
*
|
|
56
57
|
* @return {Object} Context object.
|
|
57
58
|
*/
|
|
58
|
-
|
|
59
59
|
export { createContext };
|
|
60
|
+
|
|
60
61
|
/**
|
|
61
62
|
* Returns a new element of given type. Type can be either a string tag name or
|
|
62
63
|
* another function which itself returns an element.
|
|
@@ -69,8 +70,8 @@ export { createContext };
|
|
|
69
70
|
*
|
|
70
71
|
* @return {WPElement} Element.
|
|
71
72
|
*/
|
|
72
|
-
|
|
73
73
|
export { createElement };
|
|
74
|
+
|
|
74
75
|
/**
|
|
75
76
|
* Returns an object tracking a reference to a rendered element via its
|
|
76
77
|
* `current` property as either a DOMElement or Element, dependent upon the
|
|
@@ -78,8 +79,8 @@ export { createElement };
|
|
|
78
79
|
*
|
|
79
80
|
* @return {Object} Ref object.
|
|
80
81
|
*/
|
|
81
|
-
|
|
82
82
|
export { createRef };
|
|
83
|
+
|
|
83
84
|
/**
|
|
84
85
|
* Component enhancer used to enable passing a ref to its wrapped component.
|
|
85
86
|
* Pass a function argument which receives `props` and `ref` as its arguments,
|
|
@@ -91,13 +92,13 @@ export { createRef };
|
|
|
91
92
|
*
|
|
92
93
|
* @return {WPComponent} Enhanced component.
|
|
93
94
|
*/
|
|
94
|
-
|
|
95
95
|
export { forwardRef };
|
|
96
|
+
|
|
96
97
|
/**
|
|
97
98
|
* A component which renders its children without any wrapping element.
|
|
98
99
|
*/
|
|
99
|
-
|
|
100
100
|
export { Fragment };
|
|
101
|
+
|
|
101
102
|
/**
|
|
102
103
|
* Checks if an object is a valid WPElement.
|
|
103
104
|
*
|
|
@@ -105,108 +106,108 @@ export { Fragment };
|
|
|
105
106
|
*
|
|
106
107
|
* @return {boolean} true if objectToTest is a valid WPElement and false otherwise.
|
|
107
108
|
*/
|
|
108
|
-
|
|
109
109
|
export { isValidElement };
|
|
110
|
+
|
|
110
111
|
/**
|
|
111
112
|
* @see https://reactjs.org/docs/react-api.html#reactmemo
|
|
112
113
|
*/
|
|
113
|
-
|
|
114
114
|
export { memo };
|
|
115
|
+
|
|
115
116
|
/**
|
|
116
117
|
* Component that activates additional checks and warnings for its descendants.
|
|
117
118
|
*/
|
|
118
|
-
|
|
119
119
|
export { StrictMode };
|
|
120
|
+
|
|
120
121
|
/**
|
|
121
122
|
* @see https://reactjs.org/docs/hooks-reference.html#usecallback
|
|
122
123
|
*/
|
|
123
|
-
|
|
124
124
|
export { useCallback };
|
|
125
|
+
|
|
125
126
|
/**
|
|
126
127
|
* @see https://reactjs.org/docs/hooks-reference.html#usecontext
|
|
127
128
|
*/
|
|
128
|
-
|
|
129
129
|
export { useContext };
|
|
130
|
+
|
|
130
131
|
/**
|
|
131
132
|
* @see https://reactjs.org/docs/hooks-reference.html#usedebugvalue
|
|
132
133
|
*/
|
|
133
|
-
|
|
134
134
|
export { useDebugValue };
|
|
135
|
+
|
|
135
136
|
/**
|
|
136
137
|
* @see https://reactjs.org/docs/hooks-reference.html#usedeferredvalue
|
|
137
138
|
*/
|
|
138
|
-
|
|
139
139
|
export { useDeferredValue };
|
|
140
|
+
|
|
140
141
|
/**
|
|
141
142
|
* @see https://reactjs.org/docs/hooks-reference.html#useeffect
|
|
142
143
|
*/
|
|
143
|
-
|
|
144
144
|
export { useEffect };
|
|
145
|
+
|
|
145
146
|
/**
|
|
146
147
|
* @see https://reactjs.org/docs/hooks-reference.html#useid
|
|
147
148
|
*/
|
|
148
|
-
|
|
149
149
|
export { useId };
|
|
150
|
+
|
|
150
151
|
/**
|
|
151
152
|
* @see https://reactjs.org/docs/hooks-reference.html#useimperativehandle
|
|
152
153
|
*/
|
|
153
|
-
|
|
154
154
|
export { useImperativeHandle };
|
|
155
|
+
|
|
155
156
|
/**
|
|
156
157
|
* @see https://reactjs.org/docs/hooks-reference.html#useinsertioneffect
|
|
157
158
|
*/
|
|
158
|
-
|
|
159
159
|
export { useInsertionEffect };
|
|
160
|
+
|
|
160
161
|
/**
|
|
161
162
|
* @see https://reactjs.org/docs/hooks-reference.html#uselayouteffect
|
|
162
163
|
*/
|
|
163
|
-
|
|
164
164
|
export { useLayoutEffect };
|
|
165
|
+
|
|
165
166
|
/**
|
|
166
167
|
* @see https://reactjs.org/docs/hooks-reference.html#usememo
|
|
167
168
|
*/
|
|
168
|
-
|
|
169
169
|
export { useMemo };
|
|
170
|
+
|
|
170
171
|
/**
|
|
171
172
|
* @see https://reactjs.org/docs/hooks-reference.html#usereducer
|
|
172
173
|
*/
|
|
173
|
-
|
|
174
174
|
export { useReducer };
|
|
175
|
+
|
|
175
176
|
/**
|
|
176
177
|
* @see https://reactjs.org/docs/hooks-reference.html#useref
|
|
177
178
|
*/
|
|
178
|
-
|
|
179
179
|
export { useRef };
|
|
180
|
+
|
|
180
181
|
/**
|
|
181
182
|
* @see https://reactjs.org/docs/hooks-reference.html#usestate
|
|
182
183
|
*/
|
|
183
|
-
|
|
184
184
|
export { useState };
|
|
185
|
+
|
|
185
186
|
/**
|
|
186
187
|
* @see https://reactjs.org/docs/hooks-reference.html#usesyncexternalstore
|
|
187
188
|
*/
|
|
188
|
-
|
|
189
189
|
export { useSyncExternalStore };
|
|
190
|
+
|
|
190
191
|
/**
|
|
191
192
|
* @see https://reactjs.org/docs/hooks-reference.html#usetransition
|
|
192
193
|
*/
|
|
193
|
-
|
|
194
194
|
export { useTransition };
|
|
195
|
+
|
|
195
196
|
/**
|
|
196
197
|
* @see https://reactjs.org/docs/react-api.html#starttransition
|
|
197
198
|
*/
|
|
198
|
-
|
|
199
199
|
export { startTransition };
|
|
200
|
+
|
|
200
201
|
/**
|
|
201
202
|
* @see https://reactjs.org/docs/react-api.html#reactlazy
|
|
202
203
|
*/
|
|
203
|
-
|
|
204
204
|
export { lazy };
|
|
205
|
+
|
|
205
206
|
/**
|
|
206
207
|
* @see https://reactjs.org/docs/react-api.html#reactsuspense
|
|
207
208
|
*/
|
|
208
|
-
|
|
209
209
|
export { Suspense };
|
|
210
|
+
|
|
210
211
|
/**
|
|
211
212
|
* Concatenate two or more React children objects.
|
|
212
213
|
*
|
|
@@ -214,7 +215,6 @@ export { Suspense };
|
|
|
214
215
|
*
|
|
215
216
|
* @return {Array} The concatenated value.
|
|
216
217
|
*/
|
|
217
|
-
|
|
218
218
|
export function concatChildren(...childrenArguments) {
|
|
219
219
|
return childrenArguments.reduce((accumulator, children, i) => {
|
|
220
220
|
Children.forEach(children, (child, j) => {
|
|
@@ -223,12 +223,12 @@ export function concatChildren(...childrenArguments) {
|
|
|
223
223
|
key: [i, j].join()
|
|
224
224
|
});
|
|
225
225
|
}
|
|
226
|
-
|
|
227
226
|
accumulator.push(child);
|
|
228
227
|
});
|
|
229
228
|
return accumulator;
|
|
230
229
|
}, []);
|
|
231
230
|
}
|
|
231
|
+
|
|
232
232
|
/**
|
|
233
233
|
* Switches the nodeName of all the elements in the children object.
|
|
234
234
|
*
|
|
@@ -237,7 +237,6 @@ export function concatChildren(...childrenArguments) {
|
|
|
237
237
|
*
|
|
238
238
|
* @return {?Object} The updated children object.
|
|
239
239
|
*/
|
|
240
|
-
|
|
241
240
|
export function switchChildrenNodeName(children, nodeName) {
|
|
242
241
|
return children && Children.map(children, (elt, index) => {
|
|
243
242
|
if (typeof elt?.valueOf() === 'string') {
|
|
@@ -245,7 +244,6 @@ export function switchChildrenNodeName(children, nodeName) {
|
|
|
245
244
|
key: index
|
|
246
245
|
}, elt);
|
|
247
246
|
}
|
|
248
|
-
|
|
249
247
|
const {
|
|
250
248
|
children: childrenProp,
|
|
251
249
|
...props
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/element/src/react.js"],"names":["Children","cloneElement","Component","createContext","createElement","createRef","forwardRef","Fragment","isValidElement","memo","StrictMode","useCallback","useContext","useDebugValue","useDeferredValue","useEffect","useId","useMemo","useImperativeHandle","useInsertionEffect","useLayoutEffect","useReducer","useRef","useState","useSyncExternalStore","useTransition","startTransition","lazy","Suspense","concatChildren","childrenArguments","reduce","accumulator","children","i","forEach","child","j","key","join","push","switchChildrenNodeName","nodeName","map","elt","index","valueOf","childrenProp","props"],"mappings":"AAAA;AACA;AACA;AACA;AACA,SACCA,QADD,EAECC,YAFD,EAGCC,SAHD,EAICC,aAJD,EAKCC,aALD,EAMCC,SAND,EAOCC,UAPD,EAQCC,QARD,EASCC,cATD,EAUCC,IAVD,EAWCC,UAXD,EAYCC,WAZD,EAaCC,UAbD,EAcCC,aAdD,EAeCC,gBAfD,EAgBCC,SAhBD,EAiBCC,KAjBD,EAkBCC,OAlBD,EAmBCC,mBAnBD,EAoBCC,kBApBD,EAqBCC,eArBD,EAsBCC,UAtBD,EAuBCC,MAvBD,EAwBCC,QAxBD,EAyBCC,oBAzBD,EA0BCC,aA1BD,EA2BCC,eA3BD,EA4BCC,IA5BD,EA6BCC,QA7BD,QA8BO,OA9BP;AAgCA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AACA,SAAS5B,QAAT;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,YAAT;AAEA;AACA;AACA;;AACA,SAASC,SAAT;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,aAAT;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,aAAT;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,SAAT;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,UAAT;AAEA;AACA;AACA;;AACA,SAASC,QAAT;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,cAAT;AAEA;AACA;AACA;;AACA,SAASC,IAAT;AAEA;AACA;AACA;;AACA,SAASC,UAAT;AAEA;AACA;AACA;;AACA,SAASC,WAAT;AAEA;AACA;AACA;;AACA,SAASC,UAAT;AAEA;AACA;AACA;;AACA,SAASC,aAAT;AAEA;AACA;AACA;;AACA,SAASC,gBAAT;AAEA;AACA;AACA;;AACA,SAASC,SAAT;AAEA;AACA;AACA;;AACA,SAASC,KAAT;AAEA;AACA;AACA;;AACA,SAASE,mBAAT;AAEA;AACA;AACA;;AACA,SAASC,kBAAT;AAEA;AACA;AACA;;AACA,SAASC,eAAT;AAEA;AACA;AACA;;AACA,SAASH,OAAT;AAEA;AACA;AACA;;AACA,SAASI,UAAT;AAEA;AACA;AACA;;AACA,SAASC,MAAT;AAEA;AACA;AACA;;AACA,SAASC,QAAT;AAEA;AACA;AACA;;AACA,SAASC,oBAAT;AAEA;AACA;AACA;;AACA,SAASC,aAAT;AAEA;AACA;AACA;;AACA,SAASC,eAAT;AAEA;AACA;AACA;;AACA,SAASC,IAAT;AAEA;AACA;AACA;;AACA,SAASC,QAAT;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,cAAT,CAAyB,GAAGC,iBAA5B,EAAgD;AACtD,SAAOA,iBAAiB,CAACC,MAAlB,CAA0B,CAAEC,WAAF,EAAeC,QAAf,EAAyBC,CAAzB,KAAgC;AAChElC,IAAAA,QAAQ,CAACmC,OAAT,CAAkBF,QAAlB,EAA4B,CAAEG,KAAF,EAASC,CAAT,KAAgB;AAC3C,UAAKD,KAAK,IAAI,aAAa,OAAOA,KAAlC,EAA0C;AACzCA,QAAAA,KAAK,GAAGnC,YAAY,CAAEmC,KAAF,EAAS;AAC5BE,UAAAA,GAAG,EAAE,CAAEJ,CAAF,EAAKG,CAAL,EAASE,IAAT;AADuB,SAAT,CAApB;AAGA;;AAEDP,MAAAA,WAAW,CAACQ,IAAZ,CAAkBJ,KAAlB;AACA,KARD;AAUA,WAAOJ,WAAP;AACA,GAZM,EAYJ,EAZI,CAAP;AAaA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASS,sBAAT,CAAiCR,QAAjC,EAA2CS,QAA3C,EAAsD;AAC5D,SACCT,QAAQ,IACRjC,QAAQ,CAAC2C,GAAT,CAAcV,QAAd,EAAwB,CAAEW,GAAF,EAAOC,KAAP,KAAkB;AACzC,QAAK,OAAOD,GAAG,EAAEE,OAAL,EAAP,KAA0B,QAA/B,EAA0C;AACzC,aAAO1C,aAAa,CAAEsC,QAAF,EAAY;AAAEJ,QAAAA,GAAG,EAAEO;AAAP,OAAZ,EAA4BD,GAA5B,CAApB;AACA;;AACD,UAAM;AAAEX,MAAAA,QAAQ,EAAEc,YAAZ;AAA0B,SAAGC;AAA7B,QAAuCJ,GAAG,CAACI,KAAjD;AACA,WAAO5C,aAAa,CACnBsC,QADmB,EAEnB;AAAEJ,MAAAA,GAAG,EAAEO,KAAP;AAAc,SAAGG;AAAjB,KAFmB,EAGnBD,YAHmB,CAApB;AAKA,GAVD,CAFD;AAcA","sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line @typescript-eslint/no-restricted-imports\nimport {\n\tChildren,\n\tcloneElement,\n\tComponent,\n\tcreateContext,\n\tcreateElement,\n\tcreateRef,\n\tforwardRef,\n\tFragment,\n\tisValidElement,\n\tmemo,\n\tStrictMode,\n\tuseCallback,\n\tuseContext,\n\tuseDebugValue,\n\tuseDeferredValue,\n\tuseEffect,\n\tuseId,\n\tuseMemo,\n\tuseImperativeHandle,\n\tuseInsertionEffect,\n\tuseLayoutEffect,\n\tuseReducer,\n\tuseRef,\n\tuseState,\n\tuseSyncExternalStore,\n\tuseTransition,\n\tstartTransition,\n\tlazy,\n\tSuspense,\n} from 'react';\n\n/**\n * Object containing a React element.\n *\n * @typedef {import('react').ReactElement} WPElement\n */\n\n/**\n * Object containing a React component.\n *\n * @typedef {import('react').ComponentType} WPComponent\n */\n\n/**\n * Object containing a React synthetic event.\n *\n * @typedef {import('react').SyntheticEvent} WPSyntheticEvent\n */\n\n/**\n * Object containing a React synthetic event.\n *\n * @template T\n * @typedef {import('react').RefObject<T>} RefObject<T>\n */\n\n/**\n * Object that provides utilities for dealing with React children.\n */\nexport { Children };\n\n/**\n * Creates a copy of an element with extended props.\n *\n * @param {WPElement} element Element\n * @param {?Object} props Props to apply to cloned element\n *\n * @return {WPElement} Cloned element.\n */\nexport { cloneElement };\n\n/**\n * A base class to create WordPress Components (Refs, state and lifecycle hooks)\n */\nexport { Component };\n\n/**\n * Creates a context object containing two components: a provider and consumer.\n *\n * @param {Object} defaultValue A default data stored in the context.\n *\n * @return {Object} Context object.\n */\nexport { createContext };\n\n/**\n * Returns a new element of given type. Type can be either a string tag name or\n * another function which itself returns an element.\n *\n * @param {?(string|Function)} type Tag name or element creator\n * @param {Object} props Element properties, either attribute\n * set to apply to DOM node or values to\n * pass through to element creator\n * @param {...WPElement} children Descendant elements\n *\n * @return {WPElement} Element.\n */\nexport { createElement };\n\n/**\n * Returns an object tracking a reference to a rendered element via its\n * `current` property as either a DOMElement or Element, dependent upon the\n * type of element rendered with the ref attribute.\n *\n * @return {Object} Ref object.\n */\nexport { createRef };\n\n/**\n * Component enhancer used to enable passing a ref to its wrapped component.\n * Pass a function argument which receives `props` and `ref` as its arguments,\n * returning an element using the forwarded ref. The return value is a new\n * component which forwards its ref.\n *\n * @param {Function} forwarder Function passed `props` and `ref`, expected to\n * return an element.\n *\n * @return {WPComponent} Enhanced component.\n */\nexport { forwardRef };\n\n/**\n * A component which renders its children without any wrapping element.\n */\nexport { Fragment };\n\n/**\n * Checks if an object is a valid WPElement.\n *\n * @param {Object} objectToCheck The object to be checked.\n *\n * @return {boolean} true if objectToTest is a valid WPElement and false otherwise.\n */\nexport { isValidElement };\n\n/**\n * @see https://reactjs.org/docs/react-api.html#reactmemo\n */\nexport { memo };\n\n/**\n * Component that activates additional checks and warnings for its descendants.\n */\nexport { StrictMode };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usecallback\n */\nexport { useCallback };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usecontext\n */\nexport { useContext };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usedebugvalue\n */\nexport { useDebugValue };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usedeferredvalue\n */\nexport { useDeferredValue };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useeffect\n */\nexport { useEffect };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useid\n */\nexport { useId };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useimperativehandle\n */\nexport { useImperativeHandle };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useinsertioneffect\n */\nexport { useInsertionEffect };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#uselayouteffect\n */\nexport { useLayoutEffect };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usememo\n */\nexport { useMemo };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usereducer\n */\nexport { useReducer };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useref\n */\nexport { useRef };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usestate\n */\nexport { useState };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usesyncexternalstore\n */\nexport { useSyncExternalStore };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usetransition\n */\nexport { useTransition };\n\n/**\n * @see https://reactjs.org/docs/react-api.html#starttransition\n */\nexport { startTransition };\n\n/**\n * @see https://reactjs.org/docs/react-api.html#reactlazy\n */\nexport { lazy };\n\n/**\n * @see https://reactjs.org/docs/react-api.html#reactsuspense\n */\nexport { Suspense };\n\n/**\n * Concatenate two or more React children objects.\n *\n * @param {...?Object} childrenArguments Array of children arguments (array of arrays/strings/objects) to concatenate.\n *\n * @return {Array} The concatenated value.\n */\nexport function concatChildren( ...childrenArguments ) {\n\treturn childrenArguments.reduce( ( accumulator, children, i ) => {\n\t\tChildren.forEach( children, ( child, j ) => {\n\t\t\tif ( child && 'string' !== typeof child ) {\n\t\t\t\tchild = cloneElement( child, {\n\t\t\t\t\tkey: [ i, j ].join(),\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\taccumulator.push( child );\n\t\t} );\n\n\t\treturn accumulator;\n\t}, [] );\n}\n\n/**\n * Switches the nodeName of all the elements in the children object.\n *\n * @param {?Object} children Children object.\n * @param {string} nodeName Node name.\n *\n * @return {?Object} The updated children object.\n */\nexport function switchChildrenNodeName( children, nodeName ) {\n\treturn (\n\t\tchildren &&\n\t\tChildren.map( children, ( elt, index ) => {\n\t\t\tif ( typeof elt?.valueOf() === 'string' ) {\n\t\t\t\treturn createElement( nodeName, { key: index }, elt );\n\t\t\t}\n\t\t\tconst { children: childrenProp, ...props } = elt.props;\n\t\t\treturn createElement(\n\t\t\t\tnodeName,\n\t\t\t\t{ key: index, ...props },\n\t\t\t\tchildrenProp\n\t\t\t);\n\t\t} )\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"names":["Children","cloneElement","Component","createContext","createElement","createRef","forwardRef","Fragment","isValidElement","memo","StrictMode","useCallback","useContext","useDebugValue","useDeferredValue","useEffect","useId","useMemo","useImperativeHandle","useInsertionEffect","useLayoutEffect","useReducer","useRef","useState","useSyncExternalStore","useTransition","startTransition","lazy","Suspense","concatChildren","childrenArguments","reduce","accumulator","children","i","forEach","child","j","key","join","push","switchChildrenNodeName","nodeName","map","elt","index","valueOf","childrenProp","props"],"sources":["@wordpress/element/src/react.js"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line @typescript-eslint/no-restricted-imports\nimport {\n\tChildren,\n\tcloneElement,\n\tComponent,\n\tcreateContext,\n\tcreateElement,\n\tcreateRef,\n\tforwardRef,\n\tFragment,\n\tisValidElement,\n\tmemo,\n\tStrictMode,\n\tuseCallback,\n\tuseContext,\n\tuseDebugValue,\n\tuseDeferredValue,\n\tuseEffect,\n\tuseId,\n\tuseMemo,\n\tuseImperativeHandle,\n\tuseInsertionEffect,\n\tuseLayoutEffect,\n\tuseReducer,\n\tuseRef,\n\tuseState,\n\tuseSyncExternalStore,\n\tuseTransition,\n\tstartTransition,\n\tlazy,\n\tSuspense,\n} from 'react';\n\n/**\n * Object containing a React element.\n *\n * @typedef {import('react').ReactElement} WPElement\n */\n\n/**\n * Object containing a React component.\n *\n * @typedef {import('react').ComponentType} WPComponent\n */\n\n/**\n * Object containing a React synthetic event.\n *\n * @typedef {import('react').SyntheticEvent} WPSyntheticEvent\n */\n\n/**\n * Object containing a React synthetic event.\n *\n * @template T\n * @typedef {import('react').RefObject<T>} RefObject<T>\n */\n\n/**\n * Object that provides utilities for dealing with React children.\n */\nexport { Children };\n\n/**\n * Creates a copy of an element with extended props.\n *\n * @param {WPElement} element Element\n * @param {?Object} props Props to apply to cloned element\n *\n * @return {WPElement} Cloned element.\n */\nexport { cloneElement };\n\n/**\n * A base class to create WordPress Components (Refs, state and lifecycle hooks)\n */\nexport { Component };\n\n/**\n * Creates a context object containing two components: a provider and consumer.\n *\n * @param {Object} defaultValue A default data stored in the context.\n *\n * @return {Object} Context object.\n */\nexport { createContext };\n\n/**\n * Returns a new element of given type. Type can be either a string tag name or\n * another function which itself returns an element.\n *\n * @param {?(string|Function)} type Tag name or element creator\n * @param {Object} props Element properties, either attribute\n * set to apply to DOM node or values to\n * pass through to element creator\n * @param {...WPElement} children Descendant elements\n *\n * @return {WPElement} Element.\n */\nexport { createElement };\n\n/**\n * Returns an object tracking a reference to a rendered element via its\n * `current` property as either a DOMElement or Element, dependent upon the\n * type of element rendered with the ref attribute.\n *\n * @return {Object} Ref object.\n */\nexport { createRef };\n\n/**\n * Component enhancer used to enable passing a ref to its wrapped component.\n * Pass a function argument which receives `props` and `ref` as its arguments,\n * returning an element using the forwarded ref. The return value is a new\n * component which forwards its ref.\n *\n * @param {Function} forwarder Function passed `props` and `ref`, expected to\n * return an element.\n *\n * @return {WPComponent} Enhanced component.\n */\nexport { forwardRef };\n\n/**\n * A component which renders its children without any wrapping element.\n */\nexport { Fragment };\n\n/**\n * Checks if an object is a valid WPElement.\n *\n * @param {Object} objectToCheck The object to be checked.\n *\n * @return {boolean} true if objectToTest is a valid WPElement and false otherwise.\n */\nexport { isValidElement };\n\n/**\n * @see https://reactjs.org/docs/react-api.html#reactmemo\n */\nexport { memo };\n\n/**\n * Component that activates additional checks and warnings for its descendants.\n */\nexport { StrictMode };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usecallback\n */\nexport { useCallback };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usecontext\n */\nexport { useContext };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usedebugvalue\n */\nexport { useDebugValue };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usedeferredvalue\n */\nexport { useDeferredValue };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useeffect\n */\nexport { useEffect };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useid\n */\nexport { useId };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useimperativehandle\n */\nexport { useImperativeHandle };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useinsertioneffect\n */\nexport { useInsertionEffect };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#uselayouteffect\n */\nexport { useLayoutEffect };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usememo\n */\nexport { useMemo };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usereducer\n */\nexport { useReducer };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#useref\n */\nexport { useRef };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usestate\n */\nexport { useState };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usesyncexternalstore\n */\nexport { useSyncExternalStore };\n\n/**\n * @see https://reactjs.org/docs/hooks-reference.html#usetransition\n */\nexport { useTransition };\n\n/**\n * @see https://reactjs.org/docs/react-api.html#starttransition\n */\nexport { startTransition };\n\n/**\n * @see https://reactjs.org/docs/react-api.html#reactlazy\n */\nexport { lazy };\n\n/**\n * @see https://reactjs.org/docs/react-api.html#reactsuspense\n */\nexport { Suspense };\n\n/**\n * Concatenate two or more React children objects.\n *\n * @param {...?Object} childrenArguments Array of children arguments (array of arrays/strings/objects) to concatenate.\n *\n * @return {Array} The concatenated value.\n */\nexport function concatChildren( ...childrenArguments ) {\n\treturn childrenArguments.reduce( ( accumulator, children, i ) => {\n\t\tChildren.forEach( children, ( child, j ) => {\n\t\t\tif ( child && 'string' !== typeof child ) {\n\t\t\t\tchild = cloneElement( child, {\n\t\t\t\t\tkey: [ i, j ].join(),\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\taccumulator.push( child );\n\t\t} );\n\n\t\treturn accumulator;\n\t}, [] );\n}\n\n/**\n * Switches the nodeName of all the elements in the children object.\n *\n * @param {?Object} children Children object.\n * @param {string} nodeName Node name.\n *\n * @return {?Object} The updated children object.\n */\nexport function switchChildrenNodeName( children, nodeName ) {\n\treturn (\n\t\tchildren &&\n\t\tChildren.map( children, ( elt, index ) => {\n\t\t\tif ( typeof elt?.valueOf() === 'string' ) {\n\t\t\t\treturn createElement( nodeName, { key: index }, elt );\n\t\t\t}\n\t\t\tconst { children: childrenProp, ...props } = elt.props;\n\t\t\treturn createElement(\n\t\t\t\tnodeName,\n\t\t\t\t{ key: index, ...props },\n\t\t\t\tchildrenProp\n\t\t\t);\n\t\t} )\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA,SACCA,QAAQ,EACRC,YAAY,EACZC,SAAS,EACTC,aAAa,EACbC,aAAa,EACbC,SAAS,EACTC,UAAU,EACVC,QAAQ,EACRC,cAAc,EACdC,IAAI,EACJC,UAAU,EACVC,WAAW,EACXC,UAAU,EACVC,aAAa,EACbC,gBAAgB,EAChBC,SAAS,EACTC,KAAK,EACLC,OAAO,EACPC,mBAAmB,EACnBC,kBAAkB,EAClBC,eAAe,EACfC,UAAU,EACVC,MAAM,EACNC,QAAQ,EACRC,oBAAoB,EACpBC,aAAa,EACbC,eAAe,EACfC,IAAI,EACJC,QAAQ,QACF,OAAO;;AAEd;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS5B,QAAQ;;AAEjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,YAAY;;AAErB;AACA;AACA;AACA,SAASC,SAAS;;AAElB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,aAAa;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,aAAa;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,SAAS;;AAElB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,UAAU;;AAEnB;AACA;AACA;AACA,SAASC,QAAQ;;AAEjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,cAAc;;AAEvB;AACA;AACA;AACA,SAASC,IAAI;;AAEb;AACA;AACA;AACA,SAASC,UAAU;;AAEnB;AACA;AACA;AACA,SAASC,WAAW;;AAEpB;AACA;AACA;AACA,SAASC,UAAU;;AAEnB;AACA;AACA;AACA,SAASC,aAAa;;AAEtB;AACA;AACA;AACA,SAASC,gBAAgB;;AAEzB;AACA;AACA;AACA,SAASC,SAAS;;AAElB;AACA;AACA;AACA,SAASC,KAAK;;AAEd;AACA;AACA;AACA,SAASE,mBAAmB;;AAE5B;AACA;AACA;AACA,SAASC,kBAAkB;;AAE3B;AACA;AACA;AACA,SAASC,eAAe;;AAExB;AACA;AACA;AACA,SAASH,OAAO;;AAEhB;AACA;AACA;AACA,SAASI,UAAU;;AAEnB;AACA;AACA;AACA,SAASC,MAAM;;AAEf;AACA;AACA;AACA,SAASC,QAAQ;;AAEjB;AACA;AACA;AACA,SAASC,oBAAoB;;AAE7B;AACA;AACA;AACA,SAASC,aAAa;;AAEtB;AACA;AACA;AACA,SAASC,eAAe;;AAExB;AACA;AACA;AACA,SAASC,IAAI;;AAEb;AACA;AACA;AACA,SAASC,QAAQ;;AAEjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAAE,GAAGC,iBAAiB,EAAG;EACtD,OAAOA,iBAAiB,CAACC,MAAM,CAAE,CAAEC,WAAW,EAAEC,QAAQ,EAAEC,CAAC,KAAM;IAChElC,QAAQ,CAACmC,OAAO,CAAEF,QAAQ,EAAE,CAAEG,KAAK,EAAEC,CAAC,KAAM;MAC3C,IAAKD,KAAK,IAAI,QAAQ,KAAK,OAAOA,KAAK,EAAG;QACzCA,KAAK,GAAGnC,YAAY,CAAEmC,KAAK,EAAE;UAC5BE,GAAG,EAAE,CAAEJ,CAAC,EAAEG,CAAC,CAAE,CAACE,IAAI,CAAC;QACpB,CAAE,CAAC;MACJ;MAEAP,WAAW,CAACQ,IAAI,CAAEJ,KAAM,CAAC;IAC1B,CAAE,CAAC;IAEH,OAAOJ,WAAW;EACnB,CAAC,EAAE,EAAG,CAAC;AACR;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASS,sBAAsBA,CAAER,QAAQ,EAAES,QAAQ,EAAG;EAC5D,OACCT,QAAQ,IACRjC,QAAQ,CAAC2C,GAAG,CAAEV,QAAQ,EAAE,CAAEW,GAAG,EAAEC,KAAK,KAAM;IACzC,IAAK,OAAOD,GAAG,EAAEE,OAAO,CAAC,CAAC,KAAK,QAAQ,EAAG;MACzC,OAAO1C,aAAa,CAAEsC,QAAQ,EAAE;QAAEJ,GAAG,EAAEO;MAAM,CAAC,EAAED,GAAI,CAAC;IACtD;IACA,MAAM;MAAEX,QAAQ,EAAEc,YAAY;MAAE,GAAGC;IAAM,CAAC,GAAGJ,GAAG,CAACI,KAAK;IACtD,OAAO5C,aAAa,CACnBsC,QAAQ,EACR;MAAEJ,GAAG,EAAEO,KAAK;MAAE,GAAGG;IAAM,CAAC,EACxBD,YACD,CAAC;EACF,CAAE,CAAC;AAEL"}
|