@wordpress/element 6.46.0 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +146 -26
  3. package/build/find-dom-node.cjs +99 -0
  4. package/build/find-dom-node.cjs.map +7 -0
  5. package/build/index.cjs +3 -0
  6. package/build/index.cjs.map +2 -2
  7. package/build/react-platform.cjs +14 -8
  8. package/build/react-platform.cjs.map +2 -2
  9. package/build/react.cjs +10 -0
  10. package/build/react.cjs.map +2 -2
  11. package/build/serialize.cjs +3 -1
  12. package/build/serialize.cjs.map +2 -2
  13. package/build-module/find-dom-node.mjs +68 -0
  14. package/build-module/find-dom-node.mjs.map +7 -0
  15. package/build-module/index.mjs +2 -0
  16. package/build-module/index.mjs.map +2 -2
  17. package/build-module/react-platform.mjs +14 -8
  18. package/build-module/react-platform.mjs.map +2 -2
  19. package/build-module/react.mjs +10 -0
  20. package/build-module/react.mjs.map +2 -2
  21. package/build-module/serialize.mjs +3 -1
  22. package/build-module/serialize.mjs.map +2 -2
  23. package/build-types/find-dom-node.d.ts +10 -0
  24. package/build-types/find-dom-node.d.ts.map +1 -0
  25. package/build-types/index.d.ts +1 -0
  26. package/build-types/index.d.ts.map +1 -1
  27. package/build-types/raw-html.d.ts +25 -11
  28. package/build-types/raw-html.d.ts.map +1 -1
  29. package/build-types/react-platform.d.ts +44 -22
  30. package/build-types/react-platform.d.ts.map +1 -1
  31. package/build-types/react.d.ts +36 -1
  32. package/build-types/react.d.ts.map +1 -1
  33. package/build-types/serialize.d.ts.map +1 -1
  34. package/package.json +8 -7
  35. package/src/find-dom-node.ts +92 -0
  36. package/src/index.ts +1 -0
  37. package/src/react-platform.ts +54 -28
  38. package/src/react.ts +48 -1
  39. package/src/serialize.ts +3 -1
  40. package/src/test/find-dom-node.js +109 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 7.0.0 (2026-05-27)
6
+
7
+ ### Breaking Changes
8
+
9
+ - Updated dependencies to React 19.2.4 ([#61521](https://github.com/WordPress/gutenberg/pull/61521)).
10
+ - Removed the `render`, `hydrate` and `unmountComponentAtNode` exports that have been deprecated since WordPress 6.2 after upgrade to React 18 ([#61521](https://github.com/WordPress/gutenberg/pull/61521)).
11
+
12
+ ### New Features
13
+
14
+ - Added new `react` exports: `Activity`, `use`, `useActionState`, `useEffectEvent`, and `useOptimistic` ([#61521](https://github.com/WordPress/gutenberg/pull/61521)).
15
+ - Added new `react-dom` exports: `useFormStatus`, `preconnect`, `prefetchDNS`, `preinit`, `preinitModule`, `preload`, and `preloadModule` ([#61521](https://github.com/WordPress/gutenberg/pull/61521)).
16
+
5
17
  ## 6.46.0 (2026-05-14)
6
18
 
7
19
  ## 6.45.0 (2026-04-29)
package/README.md CHANGED
@@ -27,6 +27,18 @@ The offerings of any framework necessarily become more complex as these requirem
27
27
 
28
28
  <!-- START TOKEN(Autogenerated API docs) -->
29
29
 
30
+ ### Activity
31
+
32
+ Hide and show parts of the UI while preserving state.
33
+
34
+ _Related_
35
+
36
+ - <https://react.dev/reference/react/Activity>
37
+
38
+ _Changelog_
39
+
40
+ `7.1.0`
41
+
30
42
  ### Children
31
43
 
32
44
  Object that provides utilities for dealing with React children.
@@ -151,11 +163,17 @@ _Changelog_
151
163
 
152
164
  ### findDOMNode
153
165
 
154
- Finds the dom node of a React component.
166
+ > **Deprecated** since WordPress 7.1.0. Use DOM refs instead.
167
+
168
+ Finds the DOM node of a React component instance.
169
+
170
+ _Related_
171
+
172
+ - <https://react.dev/reference/react-dom/findDOMNode>
155
173
 
156
174
  _Parameters_
157
175
 
158
- - _component_ `React.ComponentType`: Component's instance.
176
+ - _instance_ `any`: Component's instance.
159
177
 
160
178
  ### flushSync
161
179
 
@@ -181,16 +199,6 @@ _Returns_
181
199
 
182
200
  A component which renders its children without any wrapping element.
183
201
 
184
- ### hydrate
185
-
186
- > **Deprecated** since WordPress 6.2.0. Use `hydrateRoot` instead.
187
-
188
- Hydrates a given element into the target DOM node.
189
-
190
- _Related_
191
-
192
- - <https://react.dev/reference/react-dom/hydrate>
193
-
194
202
  ### hydrateRoot
195
203
 
196
204
  Creates a new React root for the target DOM node and hydrates it with a pre-generated markup.
@@ -262,6 +270,78 @@ const placeholderLabel = Platform.select( {
262
270
  } );
263
271
  ```
264
272
 
273
+ ### preconnect
274
+
275
+ Eagerly connect to a server that you expect to load resources from.
276
+
277
+ _Related_
278
+
279
+ - <https://react.dev/reference/react-dom/preconnect>
280
+
281
+ _Changelog_
282
+
283
+ `7.1.0`
284
+
285
+ ### prefetchDNS
286
+
287
+ Eagerly look up the IP of a server that you expect to load resources from.
288
+
289
+ _Related_
290
+
291
+ - <https://react.dev/reference/react-dom/prefetchDNS>
292
+
293
+ _Changelog_
294
+
295
+ `7.1.0`
296
+
297
+ ### preinit
298
+
299
+ Eagerly fetch and evaluate a stylesheet or external script.
300
+
301
+ _Related_
302
+
303
+ - <https://react.dev/reference/react-dom/preinit>
304
+
305
+ _Changelog_
306
+
307
+ `7.1.0`
308
+
309
+ ### preinitModule
310
+
311
+ Eagerly fetch and evaluate an ESM module.
312
+
313
+ _Related_
314
+
315
+ - <https://react.dev/reference/react-dom/preinitModule>
316
+
317
+ _Changelog_
318
+
319
+ `7.1.0`
320
+
321
+ ### preload
322
+
323
+ Eagerly fetch a resource such as a stylesheet, font, or external script.
324
+
325
+ _Related_
326
+
327
+ - <https://react.dev/reference/react-dom/preload>
328
+
329
+ _Changelog_
330
+
331
+ `7.1.0`
332
+
333
+ ### preloadModule
334
+
335
+ Eagerly fetch an ESM module that you expect to use.
336
+
337
+ _Related_
338
+
339
+ - <https://react.dev/reference/react-dom/preloadModule>
340
+
341
+ _Changelog_
342
+
343
+ `7.1.0`
344
+
265
345
  ### PureComponent
266
346
 
267
347
  _Related_
@@ -296,16 +376,6 @@ _Returns_
296
376
 
297
377
  - Dangerously-rendering component.
298
378
 
299
- ### render
300
-
301
- > **Deprecated** since WordPress 6.2.0. Use `createRoot` instead.
302
-
303
- Renders a given element into the target DOM node.
304
-
305
- _Related_
306
-
307
- - <https://react.dev/reference/react-dom/render>
308
-
309
379
  ### renderToString
310
380
 
311
381
  Serializes a React element to string.
@@ -345,15 +415,29 @@ _Returns_
345
415
 
346
416
  - `ReactNode`: The updated children object.
347
417
 
348
- ### unmountComponentAtNode
418
+ ### use
419
+
420
+ Read the value of a resource like a Promise or context.
349
421
 
350
- > **Deprecated** since WordPress 6.2.0. Use `root.unmount()` instead.
422
+ _Related_
351
423
 
352
- Removes any mounted element from the target DOM node.
424
+ - <https://react.dev/reference/react/use>
425
+
426
+ _Changelog_
427
+
428
+ `7.1.0`
429
+
430
+ ### useActionState
431
+
432
+ Manage state based on the result of a form action.
353
433
 
354
434
  _Related_
355
435
 
356
- - <https://react.dev/reference/react-dom/unmountComponentAtNode>
436
+ - <https://react.dev/reference/react/useActionState>
437
+
438
+ _Changelog_
439
+
440
+ `7.1.0`
357
441
 
358
442
  ### useCallback
359
443
 
@@ -385,6 +469,30 @@ _Related_
385
469
 
386
470
  - <https://react.dev/reference/react/useEffect>
387
471
 
472
+ ### useEffectEvent
473
+
474
+ Extract non-reactive logic from an Effect into an Effect Event.
475
+
476
+ _Related_
477
+
478
+ - <https://react.dev/reference/react/useEffectEvent>
479
+
480
+ _Changelog_
481
+
482
+ `7.1.0`
483
+
484
+ ### useFormStatus
485
+
486
+ Read the status information of the parent form.
487
+
488
+ _Related_
489
+
490
+ - <https://react.dev/reference/react-dom/hooks/useFormStatus>
491
+
492
+ _Changelog_
493
+
494
+ `7.1.0`
495
+
388
496
  ### useId
389
497
 
390
498
  _Related_
@@ -415,6 +523,18 @@ _Related_
415
523
 
416
524
  - <https://react.dev/reference/react/useMemo>
417
525
 
526
+ ### useOptimistic
527
+
528
+ Show a different state while an async action is underway.
529
+
530
+ _Related_
531
+
532
+ - <https://react.dev/reference/react/useOptimistic>
533
+
534
+ _Changelog_
535
+
536
+ `7.1.0`
537
+
418
538
  ### useReducer
419
539
 
420
540
  _Related_
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // packages/element/src/find-dom-node.ts
31
+ var find_dom_node_exports = {};
32
+ __export(find_dom_node_exports, {
33
+ default: () => findDOMNode
34
+ });
35
+ module.exports = __toCommonJS(find_dom_node_exports);
36
+ var import_deprecated = __toESM(require("@wordpress/deprecated"));
37
+ var internalsKey = "_reactInternals";
38
+ var HostComponent = 5;
39
+ var HostText = 6;
40
+ function findCurrentFiber(fiber) {
41
+ if (!fiber.alternate) {
42
+ return fiber;
43
+ }
44
+ let node = fiber;
45
+ while (node.return) {
46
+ node = node.return;
47
+ }
48
+ if (node.stateNode.current === node) {
49
+ return fiber;
50
+ }
51
+ return fiber.alternate;
52
+ }
53
+ function findHostFiber(fiber) {
54
+ const current = findCurrentFiber(fiber);
55
+ if (!current) {
56
+ return null;
57
+ }
58
+ return findHostFiberImpl(current);
59
+ }
60
+ function findHostFiberImpl(fiber) {
61
+ if (fiber.tag === HostComponent || fiber.tag === HostText) {
62
+ return fiber;
63
+ }
64
+ let child = fiber.child;
65
+ while (child) {
66
+ const hostFiber = findHostFiberImpl(child);
67
+ if (hostFiber) {
68
+ return hostFiber;
69
+ }
70
+ child = child.sibling;
71
+ }
72
+ return null;
73
+ }
74
+ function findDOMNode(instance) {
75
+ (0, import_deprecated.default)("wp.element.findDOMNode", {
76
+ since: "7.1",
77
+ alternative: "DOM refs",
78
+ link: "https://react.dev/reference/react-dom/findDOMNode"
79
+ });
80
+ if (instance === null || instance === void 0) {
81
+ return null;
82
+ }
83
+ if (instance.nodeType !== void 0) {
84
+ return instance;
85
+ }
86
+ const fiber = instance[internalsKey];
87
+ if (fiber === void 0) {
88
+ if (typeof instance.render === "function") {
89
+ throw new Error("Unable to find node on an unmounted component.");
90
+ }
91
+ const keys = Object.keys(instance).join(",");
92
+ throw new Error(
93
+ `Argument appears to not be a ReactComponent. Keys: ${keys}`
94
+ );
95
+ }
96
+ const hostFiber = findHostFiber(fiber);
97
+ return hostFiber?.stateNode ?? null;
98
+ }
99
+ //# sourceMappingURL=find-dom-node.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/find-dom-node.ts"],
4
+ "sourcesContent": ["import deprecated from '@wordpress/deprecated';\n\nconst internalsKey = '_reactInternals';\n\n// HostComponent fiber tag, represents a DOM element like <div>.\nconst HostComponent = 5;\nconst HostText = 6;\n\nfunction findCurrentFiber( fiber: any ): any {\n\tif ( ! fiber.alternate ) {\n\t\t// First mount \u2014 only one version exists, and it's current.\n\t\treturn fiber;\n\t}\n\n\t// Walk up to the HostRoot to figure out which tree this fiber is on.\n\tlet node = fiber;\n\twhile ( node.return ) {\n\t\tnode = node.return;\n\t}\n\n\t// The root's stateNode.current points to the current tree's root fiber.\n\tif ( node.stateNode.current === node ) {\n\t\t// We walked up the current tree, so `fiber` is already current.\n\t\treturn fiber;\n\t}\n\n\t// We walked up the alternate tree \u2014 switch to the current version.\n\treturn fiber.alternate;\n}\n\nfunction findHostFiber( fiber: any ): any {\n\tconst current = findCurrentFiber( fiber );\n\tif ( ! current ) {\n\t\treturn null;\n\t}\n\treturn findHostFiberImpl( current );\n}\n\nfunction findHostFiberImpl( fiber: any ): any {\n\tif ( fiber.tag === HostComponent || fiber.tag === HostText ) {\n\t\treturn fiber;\n\t}\n\n\tlet child = fiber.child;\n\twhile ( child ) {\n\t\tconst hostFiber = findHostFiberImpl( child );\n\t\tif ( hostFiber ) {\n\t\t\treturn hostFiber;\n\t\t}\n\t\tchild = child.sibling;\n\t}\n\n\treturn null;\n}\n\n/**\n * Finds the DOM node of a React component instance.\n *\n * @deprecated since WordPress 7.1.0. Use DOM refs instead.\n * @see https://react.dev/reference/react-dom/findDOMNode\n *\n * @param instance Component's instance.\n */\nexport default function findDOMNode( instance: any ): Element | Text | null {\n\tdeprecated( 'wp.element.findDOMNode', {\n\t\tsince: '7.1',\n\t\talternative: 'DOM refs',\n\t\tlink: 'https://react.dev/reference/react-dom/findDOMNode',\n\t} );\n\n\tif ( instance === null || instance === undefined ) {\n\t\treturn null;\n\t}\n\n\tif ( instance.nodeType !== undefined ) {\n\t\treturn instance as Element | Text;\n\t}\n\n\tconst fiber = instance[ internalsKey ];\n\tif ( fiber === undefined ) {\n\t\tif ( typeof instance.render === 'function' ) {\n\t\t\tthrow new Error( 'Unable to find node on an unmounted component.' );\n\t\t}\n\t\tconst keys = Object.keys( instance ).join( ',' );\n\t\tthrow new Error(\n\t\t\t`Argument appears to not be a ReactComponent. Keys: ${ keys }`\n\t\t);\n\t}\n\n\tconst hostFiber = findHostFiber( fiber );\n\treturn hostFiber?.stateNode ?? null;\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAuB;AAEvB,IAAM,eAAe;AAGrB,IAAM,gBAAgB;AACtB,IAAM,WAAW;AAEjB,SAAS,iBAAkB,OAAkB;AAC5C,MAAK,CAAE,MAAM,WAAY;AAExB,WAAO;AAAA,EACR;AAGA,MAAI,OAAO;AACX,SAAQ,KAAK,QAAS;AACrB,WAAO,KAAK;AAAA,EACb;AAGA,MAAK,KAAK,UAAU,YAAY,MAAO;AAEtC,WAAO;AAAA,EACR;AAGA,SAAO,MAAM;AACd;AAEA,SAAS,cAAe,OAAkB;AACzC,QAAM,UAAU,iBAAkB,KAAM;AACxC,MAAK,CAAE,SAAU;AAChB,WAAO;AAAA,EACR;AACA,SAAO,kBAAmB,OAAQ;AACnC;AAEA,SAAS,kBAAmB,OAAkB;AAC7C,MAAK,MAAM,QAAQ,iBAAiB,MAAM,QAAQ,UAAW;AAC5D,WAAO;AAAA,EACR;AAEA,MAAI,QAAQ,MAAM;AAClB,SAAQ,OAAQ;AACf,UAAM,YAAY,kBAAmB,KAAM;AAC3C,QAAK,WAAY;AAChB,aAAO;AAAA,IACR;AACA,YAAQ,MAAM;AAAA,EACf;AAEA,SAAO;AACR;AAUe,SAAR,YAA8B,UAAuC;AAC3E,wBAAAA,SAAY,0BAA0B;AAAA,IACrC,OAAO;AAAA,IACP,aAAa;AAAA,IACb,MAAM;AAAA,EACP,CAAE;AAEF,MAAK,aAAa,QAAQ,aAAa,QAAY;AAClD,WAAO;AAAA,EACR;AAEA,MAAK,SAAS,aAAa,QAAY;AACtC,WAAO;AAAA,EACR;AAEA,QAAM,QAAQ,SAAU,YAAa;AACrC,MAAK,UAAU,QAAY;AAC1B,QAAK,OAAO,SAAS,WAAW,YAAa;AAC5C,YAAM,IAAI,MAAO,gDAAiD;AAAA,IACnE;AACA,UAAM,OAAO,OAAO,KAAM,QAAS,EAAE,KAAM,GAAI;AAC/C,UAAM,IAAI;AAAA,MACT,sDAAuD,IAAK;AAAA,IAC7D;AAAA,EACD;AAEA,QAAM,YAAY,cAAe,KAAM;AACvC,SAAO,WAAW,aAAa;AAChC;",
6
+ "names": ["deprecated"]
7
+ }
package/build/index.cjs CHANGED
@@ -34,6 +34,7 @@ __export(index_exports, {
34
34
  Platform: () => import_platform.default,
35
35
  RawHTML: () => import_raw_html.default,
36
36
  createInterpolateElement: () => import_create_interpolate_element.default,
37
+ findDOMNode: () => import_find_dom_node.default,
37
38
  renderToString: () => import_serialize.default
38
39
  });
39
40
  module.exports = __toCommonJS(index_exports);
@@ -44,11 +45,13 @@ __reExport(index_exports, require("./utils.cjs"), module.exports);
44
45
  var import_platform = __toESM(require("./platform.cjs"));
45
46
  var import_serialize = __toESM(require("./serialize.cjs"));
46
47
  var import_raw_html = __toESM(require("./raw-html.cjs"));
48
+ var import_find_dom_node = __toESM(require("./find-dom-node.cjs"));
47
49
  // Annotate the CommonJS export names for ESM import in node:
48
50
  0 && (module.exports = {
49
51
  Platform,
50
52
  RawHTML,
51
53
  createInterpolateElement,
54
+ findDOMNode,
52
55
  renderToString,
53
56
  ...require("./react.cjs"),
54
57
  ...require("./react-platform.cjs"),
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
- "sourcesContent": ["export { default as createInterpolateElement } from './create-interpolate-element';\nexport * from './react';\nexport * from './react-platform';\nexport * from './utils';\nexport { default as Platform } from './platform';\nexport { default as renderToString } from './serialize';\nexport { default as RawHTML } from './raw-html';\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wCAAoD;AACpD,0BAAc,wBADd;AAEA,0BAAc,iCAFd;AAGA,0BAAc,wBAHd;AAIA,sBAAoC;AACpC,uBAA0C;AAC1C,sBAAmC;",
4
+ "sourcesContent": ["export { default as createInterpolateElement } from './create-interpolate-element';\nexport * from './react';\nexport * from './react-platform';\nexport * from './utils';\nexport { default as Platform } from './platform';\nexport { default as renderToString } from './serialize';\nexport { default as RawHTML } from './raw-html';\nexport { default as findDOMNode } from './find-dom-node';\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wCAAoD;AACpD,0BAAc,wBADd;AAEA,0BAAc,iCAFd;AAGA,0BAAc,wBAHd;AAIA,sBAAoC;AACpC,uBAA0C;AAC1C,sBAAmC;AACnC,2BAAuC;",
6
6
  "names": []
7
7
  }
@@ -22,12 +22,15 @@ var react_platform_exports = {};
22
22
  __export(react_platform_exports, {
23
23
  createPortal: () => import_react_dom.createPortal,
24
24
  createRoot: () => import_client.createRoot,
25
- findDOMNode: () => import_react_dom.findDOMNode,
26
25
  flushSync: () => import_react_dom.flushSync,
27
- hydrate: () => import_react_dom.hydrate,
28
26
  hydrateRoot: () => import_client.hydrateRoot,
29
- render: () => import_react_dom.render,
30
- unmountComponentAtNode: () => import_react_dom.unmountComponentAtNode
27
+ preconnect: () => import_react_dom.preconnect,
28
+ prefetchDNS: () => import_react_dom.prefetchDNS,
29
+ preinit: () => import_react_dom.preinit,
30
+ preinitModule: () => import_react_dom.preinitModule,
31
+ preload: () => import_react_dom.preload,
32
+ preloadModule: () => import_react_dom.preloadModule,
33
+ useFormStatus: () => import_react_dom.useFormStatus
31
34
  });
32
35
  module.exports = __toCommonJS(react_platform_exports);
33
36
  var import_react_dom = require("react-dom");
@@ -36,11 +39,14 @@ var import_client = require("react-dom/client");
36
39
  0 && (module.exports = {
37
40
  createPortal,
38
41
  createRoot,
39
- findDOMNode,
40
42
  flushSync,
41
- hydrate,
42
43
  hydrateRoot,
43
- render,
44
- unmountComponentAtNode
44
+ preconnect,
45
+ prefetchDNS,
46
+ preinit,
47
+ preinitModule,
48
+ preload,
49
+ preloadModule,
50
+ useFormStatus
45
51
  });
46
52
  //# sourceMappingURL=react-platform.cjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/react-platform.ts"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport {\n\tcreatePortal,\n\tfindDOMNode,\n\tflushSync,\n\t/* eslint-disable react/no-deprecated */\n\trender,\n\thydrate,\n\tunmountComponentAtNode,\n\t/* eslint-enable react/no-deprecated */\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 {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 {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,uBASO;AACP,oBAAwC;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport {\n\tcreatePortal,\n\tflushSync,\n\tpreconnect,\n\tprefetchDNS,\n\tpreinit,\n\tpreinitModule,\n\tpreload,\n\tpreloadModule,\n\tuseFormStatus,\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 {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 * 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 * Eagerly connect to a server that you expect to load resources from.\n *\n * @since 7.1.0\n * @see https://react.dev/reference/react-dom/preconnect\n */\nexport { preconnect };\n\n/**\n * Eagerly look up the IP of a server that you expect to load resources from.\n *\n * @since 7.1.0\n * @see https://react.dev/reference/react-dom/prefetchDNS\n */\nexport { prefetchDNS };\n\n/**\n * Eagerly fetch and evaluate a stylesheet or external script.\n *\n * @since 7.1.0\n * @see https://react.dev/reference/react-dom/preinit\n */\nexport { preinit };\n\n/**\n * Eagerly fetch and evaluate an ESM module.\n *\n * @since 7.1.0\n * @see https://react.dev/reference/react-dom/preinitModule\n */\nexport { preinitModule };\n\n/**\n * Eagerly fetch a resource such as a stylesheet, font, or external script.\n *\n * @since 7.1.0\n * @see https://react.dev/reference/react-dom/preload\n */\nexport { preload };\n\n/**\n * Eagerly fetch an ESM module that you expect to use.\n *\n * @since 7.1.0\n * @see https://react.dev/reference/react-dom/preloadModule\n */\nexport { preloadModule };\n\n/**\n * Read the status information of the parent form.\n *\n * @since 7.1.0\n * @see https://react.dev/reference/react-dom/hooks/useFormStatus\n */\nexport { useFormStatus };\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"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,uBAUO;AACP,oBAAwC;",
6
6
  "names": []
7
7
  }
package/build/react.cjs CHANGED
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // packages/element/src/react.ts
21
21
  var react_exports = {};
22
22
  __export(react_exports, {
23
+ Activity: () => import_react.Activity,
23
24
  Children: () => import_react.Children,
24
25
  Component: () => import_react.Component,
25
26
  Fragment: () => import_react.Fragment,
@@ -37,16 +38,20 @@ __export(react_exports, {
37
38
  memo: () => import_react.memo,
38
39
  startTransition: () => import_react.startTransition,
39
40
  switchChildrenNodeName: () => switchChildrenNodeName,
41
+ use: () => import_react.use,
42
+ useActionState: () => import_react.useActionState,
40
43
  useCallback: () => import_react.useCallback,
41
44
  useContext: () => import_react.useContext,
42
45
  useDebugValue: () => import_react.useDebugValue,
43
46
  useDeferredValue: () => import_react.useDeferredValue,
44
47
  useEffect: () => import_react.useEffect,
48
+ useEffectEvent: () => import_react.useEffectEvent,
45
49
  useId: () => import_react.useId,
46
50
  useImperativeHandle: () => import_react.useImperativeHandle,
47
51
  useInsertionEffect: () => import_react.useInsertionEffect,
48
52
  useLayoutEffect: () => import_react.useLayoutEffect,
49
53
  useMemo: () => import_react.useMemo,
54
+ useOptimistic: () => import_react.useOptimistic,
50
55
  useReducer: () => import_react.useReducer,
51
56
  useRef: () => import_react.useRef,
52
57
  useState: () => import_react.useState,
@@ -89,6 +94,7 @@ function switchChildrenNodeName(children, nodeName) {
89
94
  }
90
95
  // Annotate the CommonJS export names for ESM import in node:
91
96
  0 && (module.exports = {
97
+ Activity,
92
98
  Children,
93
99
  Component,
94
100
  Fragment,
@@ -106,16 +112,20 @@ function switchChildrenNodeName(children, nodeName) {
106
112
  memo,
107
113
  startTransition,
108
114
  switchChildrenNodeName,
115
+ use,
116
+ useActionState,
109
117
  useCallback,
110
118
  useContext,
111
119
  useDebugValue,
112
120
  useDeferredValue,
113
121
  useEffect,
122
+ useEffectEvent,
114
123
  useId,
115
124
  useImperativeHandle,
116
125
  useInsertionEffect,
117
126
  useLayoutEffect,
118
127
  useMemo,
128
+ useOptimistic,
119
129
  useReducer,
120
130
  useRef,
121
131
  useState,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/react.ts"],
4
- "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\tPureComponent,\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';\nimport type { ReactNode } from 'react';\n\n/**\n * Object containing a React element.\n */\nexport type Element = React.ReactElement;\n\n/**\n * Object containing a React component.\n */\nexport type ComponentType< T = any > = React.ComponentType< T >;\n\n/**\n * Object containing a React synthetic event.\n */\nexport type SyntheticEvent< T = Element > = React.SyntheticEvent< T >;\n\n/**\n * Object containing a React ref object.\n */\nexport type RefObject< T > = React.RefObject< T >;\n\n/**\n * Object containing a React ref callback.\n */\nexport type RefCallback< T > = React.RefCallback< T >;\n\n/**\n * Object containing a React ref.\n */\nexport type Ref< T > = React.Ref< T >;\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 {Element} element Element\n * @param {?Object} props Props to apply to cloned element\n *\n * @return {Element} 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 {...Element} children Descendant elements\n *\n * @return {Element} 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 {Component} 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 React Element.\n *\n * @param {Object} objectToCheck The object to be checked.\n *\n * @return {boolean} true if objectToTest is a valid React Element and false otherwise.\n */\nexport { isValidElement };\n\n/**\n * @see https://react.dev/reference/react/memo\n */\nexport { memo };\n\n/**\n * Component that activates additional checks and warnings for its descendants.\n */\nexport { StrictMode };\n\n/**\n * @see https://react.dev/reference/react/useCallback\n */\nexport { useCallback };\n\n/**\n * @see https://react.dev/reference/react/useContext\n */\nexport { useContext };\n\n/**\n * @see https://react.dev/reference/react/useDebugValue\n */\nexport { useDebugValue };\n\n/**\n * @see https://react.dev/reference/react/useDeferredValue\n */\nexport { useDeferredValue };\n\n/**\n * @see https://react.dev/reference/react/useEffect\n */\nexport { useEffect };\n\n/**\n * @see https://react.dev/reference/react/useId\n */\nexport { useId };\n\n/**\n * @see https://react.dev/reference/react/useImperativeHandle\n */\nexport { useImperativeHandle };\n\n/**\n * @see https://react.dev/reference/react/useInsertionEffect\n */\nexport { useInsertionEffect };\n\n/**\n * @see https://react.dev/reference/react/useLayoutEffect\n */\nexport { useLayoutEffect };\n\n/**\n * @see https://react.dev/reference/react/useMemo\n */\nexport { useMemo };\n\n/**\n * @see https://react.dev/reference/react/useReducer\n */\nexport { useReducer };\n\n/**\n * @see https://react.dev/reference/react/useRef\n */\nexport { useRef };\n\n/**\n * @see https://react.dev/reference/react/useState\n */\nexport { useState };\n\n/**\n * @see https://react.dev/reference/react/useSyncExternalStore\n */\nexport { useSyncExternalStore };\n\n/**\n * @see https://react.dev/reference/react/useTransition\n */\nexport { useTransition };\n\n/**\n * @see https://react.dev/reference/react/startTransition\n */\nexport { startTransition };\n\n/**\n * @see https://react.dev/reference/react/lazy\n */\nexport { lazy };\n\n/**\n * @see https://react.dev/reference/react/Suspense\n */\nexport { Suspense };\n\n/**\n * @see https://react.dev/reference/react/PureComponent\n */\nexport { PureComponent };\n\n/**\n * Concatenate two or more React children objects.\n *\n * @param childrenArguments - Array of children arguments (array of arrays/strings/objects) to concatenate.\n * @return The concatenated value.\n */\nexport function concatChildren(\n\t...childrenArguments: ReactNode[][]\n): ReactNode[] {\n\treturn childrenArguments.reduce< ReactNode[] >(\n\t\t( accumulator, children, i ) => {\n\t\t\tChildren.forEach( children, ( child, j ) => {\n\t\t\t\tif ( isValidElement( child ) && typeof child !== 'string' ) {\n\t\t\t\t\tchild = cloneElement( child, {\n\t\t\t\t\t\tkey: [ i, j ].join(),\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\taccumulator.push( child );\n\t\t\t} );\n\n\t\t\treturn accumulator;\n\t\t},\n\t\t[]\n\t);\n}\n\n/**\n * Switches the nodeName of all the elements in the children object.\n *\n * @param children Children object.\n * @param nodeName Node name.\n *\n * @return The updated children object.\n */\nexport function switchChildrenNodeName(\n\tchildren: ReactNode,\n\tnodeName: string\n): ReactNode {\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\tif ( ! isValidElement( elt ) ) {\n\t\t\t\treturn elt;\n\t\t\t}\n\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"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,mBA+BO;AA+NA,SAAS,kBACZ,mBACW;AACd,SAAO,kBAAkB;AAAA,IACxB,CAAE,aAAa,UAAU,MAAO;AAC/B,4BAAS,QAAS,UAAU,CAAE,OAAO,MAAO;AAC3C,gBAAK,6BAAgB,KAAM,KAAK,OAAO,UAAU,UAAW;AAC3D,sBAAQ,2BAAc,OAAO;AAAA,YAC5B,KAAK,CAAE,GAAG,CAAE,EAAE,KAAK;AAAA,UACpB,CAAE;AAAA,QACH;AAEA,oBAAY,KAAM,KAAM;AAAA,MACzB,CAAE;AAEF,aAAO;AAAA,IACR;AAAA,IACA,CAAC;AAAA,EACF;AACD;AAUO,SAAS,uBACf,UACA,UACY;AACZ,SACC,YACA,sBAAS,IAAK,UAAU,CAAE,KAAK,UAAW;AACzC,QAAK,OAAO,KAAK,QAAQ,MAAM,UAAW;AACzC,iBAAO,4BAAe,UAAU,EAAE,KAAK,MAAM,GAAG,GAAI;AAAA,IACrD;AACA,QAAK,KAAE,6BAAgB,GAAI,GAAI;AAC9B,aAAO;AAAA,IACR;AAEA,UAAM,EAAE,UAAU,cAAc,GAAG,MAAM,IAAI,IAAI;AACjD,eAAO;AAAA,MACN;AAAA,MACA,EAAE,KAAK,OAAO,GAAG,MAAM;AAAA,MACvB;AAAA,IACD;AAAA,EACD,CAAE;AAEJ;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\n// eslint-disable-next-line @typescript-eslint/no-restricted-imports\nimport {\n\tActivity,\n\tChildren,\n\tcloneElement,\n\tComponent,\n\tcreateContext,\n\tcreateElement,\n\tcreateRef,\n\tforwardRef,\n\tFragment,\n\tisValidElement,\n\tmemo,\n\tPureComponent,\n\tStrictMode,\n\tuse,\n\tuseActionState,\n\tuseCallback,\n\tuseContext,\n\tuseDebugValue,\n\tuseDeferredValue,\n\tuseEffect,\n\tuseEffectEvent,\n\tuseId,\n\tuseMemo,\n\tuseImperativeHandle,\n\tuseInsertionEffect,\n\tuseLayoutEffect,\n\tuseOptimistic,\n\tuseReducer,\n\tuseRef,\n\tuseState,\n\tuseSyncExternalStore,\n\tuseTransition,\n\tstartTransition,\n\tlazy,\n\tSuspense,\n} from 'react';\nimport type { ReactNode } from 'react';\n\n/**\n * Object containing a React element.\n */\nexport type Element = React.ReactElement;\n\n/**\n * Object containing a React component.\n */\nexport type ComponentType< T = any > = React.ComponentType< T >;\n\n/**\n * Object containing a React synthetic event.\n */\nexport type SyntheticEvent< T = Element > = React.SyntheticEvent< T >;\n\n/**\n * Object containing a React ref object.\n */\nexport type RefObject< T > = React.RefObject< T >;\n\n/**\n * Object containing a React ref callback.\n */\nexport type RefCallback< T > = React.RefCallback< T >;\n\n/**\n * Object containing a React ref.\n */\nexport type Ref< T > = React.Ref< T >;\n\n/**\n * Hide and show parts of the UI while preserving state.\n *\n * @since 7.1.0\n * @see https://react.dev/reference/react/Activity\n */\nexport { Activity };\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 {Element} element Element\n * @param {?Object} props Props to apply to cloned element\n *\n * @return {Element} 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 {...Element} children Descendant elements\n *\n * @return {Element} 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 {Component} 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 React Element.\n *\n * @param {Object} objectToCheck The object to be checked.\n *\n * @return {boolean} true if objectToTest is a valid React Element and false otherwise.\n */\nexport { isValidElement };\n\n/**\n * @see https://react.dev/reference/react/memo\n */\nexport { memo };\n\n/**\n * Component that activates additional checks and warnings for its descendants.\n */\nexport { StrictMode };\n\n/**\n * Read the value of a resource like a Promise or context.\n *\n * @since 7.1.0\n * @see https://react.dev/reference/react/use\n */\nexport { use };\n\n/**\n * Manage state based on the result of a form action.\n *\n * @since 7.1.0\n * @see https://react.dev/reference/react/useActionState\n */\nexport { useActionState };\n\n/**\n * @see https://react.dev/reference/react/useCallback\n */\nexport { useCallback };\n\n/**\n * @see https://react.dev/reference/react/useContext\n */\nexport { useContext };\n\n/**\n * @see https://react.dev/reference/react/useDebugValue\n */\nexport { useDebugValue };\n\n/**\n * @see https://react.dev/reference/react/useDeferredValue\n */\nexport { useDeferredValue };\n\n/**\n * @see https://react.dev/reference/react/useEffect\n */\nexport { useEffect };\n\n/**\n * Extract non-reactive logic from an Effect into an Effect Event.\n *\n * @since 7.1.0\n * @see https://react.dev/reference/react/useEffectEvent\n */\nexport { useEffectEvent };\n\n/**\n * @see https://react.dev/reference/react/useId\n */\nexport { useId };\n\n/**\n * @see https://react.dev/reference/react/useImperativeHandle\n */\nexport { useImperativeHandle };\n\n/**\n * @see https://react.dev/reference/react/useInsertionEffect\n */\nexport { useInsertionEffect };\n\n/**\n * @see https://react.dev/reference/react/useLayoutEffect\n */\nexport { useLayoutEffect };\n\n/**\n * @see https://react.dev/reference/react/useMemo\n */\nexport { useMemo };\n\n/**\n * Show a different state while an async action is underway.\n *\n * @since 7.1.0\n * @see https://react.dev/reference/react/useOptimistic\n */\nexport { useOptimistic };\n\n/**\n * @see https://react.dev/reference/react/useReducer\n */\nexport { useReducer };\n\n/**\n * @see https://react.dev/reference/react/useRef\n */\nexport { useRef };\n\n/**\n * @see https://react.dev/reference/react/useState\n */\nexport { useState };\n\n/**\n * @see https://react.dev/reference/react/useSyncExternalStore\n */\nexport { useSyncExternalStore };\n\n/**\n * @see https://react.dev/reference/react/useTransition\n */\nexport { useTransition };\n\n/**\n * @see https://react.dev/reference/react/startTransition\n */\nexport { startTransition };\n\n/**\n * @see https://react.dev/reference/react/lazy\n */\nexport { lazy };\n\n/**\n * @see https://react.dev/reference/react/Suspense\n */\nexport { Suspense };\n\n/**\n * @see https://react.dev/reference/react/PureComponent\n */\nexport { PureComponent };\n\n/**\n * Concatenate two or more React children objects.\n *\n * @param childrenArguments - Array of children arguments (array of arrays/strings/objects) to concatenate.\n * @return The concatenated value.\n */\nexport function concatChildren(\n\t...childrenArguments: ReactNode[][]\n): ReactNode[] {\n\treturn childrenArguments.reduce< ReactNode[] >(\n\t\t( accumulator, children, i ) => {\n\t\t\tChildren.forEach( children, ( child, j ) => {\n\t\t\t\tif ( isValidElement( child ) && typeof child !== 'string' ) {\n\t\t\t\t\tchild = cloneElement( child, {\n\t\t\t\t\t\tkey: [ i, j ].join(),\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\taccumulator.push( child );\n\t\t\t} );\n\n\t\t\treturn accumulator;\n\t\t},\n\t\t[]\n\t);\n}\n\n/**\n * Switches the nodeName of all the elements in the children object.\n *\n * @param children Children object.\n * @param nodeName Node name.\n *\n * @return The updated children object.\n */\nexport function switchChildrenNodeName(\n\tchildren: ReactNode,\n\tnodeName: string\n): ReactNode {\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\tif ( ! isValidElement( elt ) ) {\n\t\t\t\treturn elt;\n\t\t\t}\n\n\t\t\tconst { children: childrenProp, ...props } = (\n\t\t\t\telt as React.ReactElement< React.PropsWithChildren< unknown > >\n\t\t\t ).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"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,mBAoCO;AAuQA,SAAS,kBACZ,mBACW;AACd,SAAO,kBAAkB;AAAA,IACxB,CAAE,aAAa,UAAU,MAAO;AAC/B,4BAAS,QAAS,UAAU,CAAE,OAAO,MAAO;AAC3C,gBAAK,6BAAgB,KAAM,KAAK,OAAO,UAAU,UAAW;AAC3D,sBAAQ,2BAAc,OAAO;AAAA,YAC5B,KAAK,CAAE,GAAG,CAAE,EAAE,KAAK;AAAA,UACpB,CAAE;AAAA,QACH;AAEA,oBAAY,KAAM,KAAM;AAAA,MACzB,CAAE;AAEF,aAAO;AAAA,IACR;AAAA,IACA,CAAC;AAAA,EACF;AACD;AAUO,SAAS,uBACf,UACA,UACY;AACZ,SACC,YACA,sBAAS,IAAK,UAAU,CAAE,KAAK,UAAW;AACzC,QAAK,OAAO,KAAK,QAAQ,MAAM,UAAW;AACzC,iBAAO,4BAAe,UAAU,EAAE,KAAK,MAAM,GAAG,GAAI;AAAA,IACrD;AACA,QAAK,KAAE,6BAAgB,GAAI,GAAI;AAC9B,aAAO;AAAA,IACR;AAEA,UAAM,EAAE,UAAU,cAAc,GAAG,MAAM,IACxC,IACE;AACH,eAAO;AAAA,MACN;AAAA,MACA,EAAE,KAAK,OAAO,GAAG,MAAM;AAAA,MACvB;AAAA,IACD;AAAA,EACD,CAAE;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -431,7 +431,9 @@ function renderElement(element, context, legacyContext = {}) {
431
431
  return renderChildren(props.children, props.value, legacyContext);
432
432
  case Consumer.$$typeof:
433
433
  return renderElement(
434
- props.children(context || type._currentValue),
434
+ props.children(
435
+ context || type._currentValue || type._context._currentValue
436
+ ),
435
437
  context,
436
438
  legacyContext
437
439
  );