@wordpress/element 6.32.0 → 6.32.1-next.47f435fc9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/create-interpolate-element.js +79 -183
- package/build/create-interpolate-element.js.map +7 -1
- package/build/index.js +52 -74
- package/build/index.js.map +7 -1
- package/build/platform.android.js +29 -16
- package/build/platform.android.js.map +7 -1
- package/build/platform.ios.js +29 -16
- package/build/platform.ios.js.map +7 -1
- package/build/platform.js +25 -40
- package/build/platform.js.map +7 -1
- package/build/raw-html.js +28 -47
- package/build/raw-html.js.map +7 -1
- package/build/react-platform.js +43 -55
- package/build/react-platform.js.map +7 -1
- package/build/react.js +114 -411
- package/build/react.js.map +7 -1
- package/build/serialize.js +418 -325
- package/build/serialize.js.map +7 -1
- package/build/utils.js +29 -15
- package/build/utils.js.map +7 -1
- package/build-module/create-interpolate-element.js +63 -175
- package/build-module/create-interpolate-element.js.map +7 -1
- package/build-module/index.js +14 -8
- package/build-module/index.js.map +7 -1
- package/build-module/platform.android.js +10 -10
- package/build-module/platform.android.js.map +7 -1
- package/build-module/platform.ios.js +10 -10
- package/build-module/platform.ios.js.map +7 -1
- package/build-module/platform.js +7 -36
- package/build-module/platform.js.map +7 -1
- package/build-module/raw-html.js +11 -44
- package/build-module/raw-html.js.map +7 -1
- package/build-module/react-platform.js +20 -71
- package/build-module/react-platform.js.map +7 -1
- package/build-module/react.js +91 -255
- package/build-module/react.js.map +7 -1
- package/build-module/serialize.js +382 -311
- package/build-module/serialize.js.map +7 -1
- package/build-module/utils.js +7 -10
- package/build-module/utils.js.map +7 -1
- package/package.json +11 -4
- package/build/react-platform.native.js +0 -22
- package/build/react-platform.native.js.map +0 -1
- package/build-module/react-platform.native.js +0 -15
- package/build-module/react-platform.native.js.map +0 -1
package/build/react.js
CHANGED
|
@@ -1,420 +1,123 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
enumerable: true,
|
|
57
|
-
get: function () {
|
|
58
|
-
return _react.createElement;
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
Object.defineProperty(exports, "createRef", {
|
|
62
|
-
enumerable: true,
|
|
63
|
-
get: function () {
|
|
64
|
-
return _react.createRef;
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
Object.defineProperty(exports, "forwardRef", {
|
|
68
|
-
enumerable: true,
|
|
69
|
-
get: function () {
|
|
70
|
-
return _react.forwardRef;
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
Object.defineProperty(exports, "isValidElement", {
|
|
74
|
-
enumerable: true,
|
|
75
|
-
get: function () {
|
|
76
|
-
return _react.isValidElement;
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
Object.defineProperty(exports, "lazy", {
|
|
80
|
-
enumerable: true,
|
|
81
|
-
get: function () {
|
|
82
|
-
return _react.lazy;
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
Object.defineProperty(exports, "memo", {
|
|
86
|
-
enumerable: true,
|
|
87
|
-
get: function () {
|
|
88
|
-
return _react.memo;
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
Object.defineProperty(exports, "startTransition", {
|
|
92
|
-
enumerable: true,
|
|
93
|
-
get: function () {
|
|
94
|
-
return _react.startTransition;
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
exports.switchChildrenNodeName = switchChildrenNodeName;
|
|
98
|
-
Object.defineProperty(exports, "useCallback", {
|
|
99
|
-
enumerable: true,
|
|
100
|
-
get: function () {
|
|
101
|
-
return _react.useCallback;
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
Object.defineProperty(exports, "useContext", {
|
|
105
|
-
enumerable: true,
|
|
106
|
-
get: function () {
|
|
107
|
-
return _react.useContext;
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
Object.defineProperty(exports, "useDebugValue", {
|
|
111
|
-
enumerable: true,
|
|
112
|
-
get: function () {
|
|
113
|
-
return _react.useDebugValue;
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
Object.defineProperty(exports, "useDeferredValue", {
|
|
117
|
-
enumerable: true,
|
|
118
|
-
get: function () {
|
|
119
|
-
return _react.useDeferredValue;
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
Object.defineProperty(exports, "useEffect", {
|
|
123
|
-
enumerable: true,
|
|
124
|
-
get: function () {
|
|
125
|
-
return _react.useEffect;
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
Object.defineProperty(exports, "useId", {
|
|
129
|
-
enumerable: true,
|
|
130
|
-
get: function () {
|
|
131
|
-
return _react.useId;
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
Object.defineProperty(exports, "useImperativeHandle", {
|
|
135
|
-
enumerable: true,
|
|
136
|
-
get: function () {
|
|
137
|
-
return _react.useImperativeHandle;
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
Object.defineProperty(exports, "useInsertionEffect", {
|
|
141
|
-
enumerable: true,
|
|
142
|
-
get: function () {
|
|
143
|
-
return _react.useInsertionEffect;
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
Object.defineProperty(exports, "useLayoutEffect", {
|
|
147
|
-
enumerable: true,
|
|
148
|
-
get: function () {
|
|
149
|
-
return _react.useLayoutEffect;
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
Object.defineProperty(exports, "useMemo", {
|
|
153
|
-
enumerable: true,
|
|
154
|
-
get: function () {
|
|
155
|
-
return _react.useMemo;
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
Object.defineProperty(exports, "useReducer", {
|
|
159
|
-
enumerable: true,
|
|
160
|
-
get: function () {
|
|
161
|
-
return _react.useReducer;
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
Object.defineProperty(exports, "useRef", {
|
|
165
|
-
enumerable: true,
|
|
166
|
-
get: function () {
|
|
167
|
-
return _react.useRef;
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
Object.defineProperty(exports, "useState", {
|
|
171
|
-
enumerable: true,
|
|
172
|
-
get: function () {
|
|
173
|
-
return _react.useState;
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
Object.defineProperty(exports, "useSyncExternalStore", {
|
|
177
|
-
enumerable: true,
|
|
178
|
-
get: function () {
|
|
179
|
-
return _react.useSyncExternalStore;
|
|
180
|
-
}
|
|
181
|
-
});
|
|
182
|
-
Object.defineProperty(exports, "useTransition", {
|
|
183
|
-
enumerable: true,
|
|
184
|
-
get: function () {
|
|
185
|
-
return _react.useTransition;
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
var _react = require("react");
|
|
189
|
-
/**
|
|
190
|
-
* External dependencies
|
|
191
|
-
*/
|
|
192
|
-
// eslint-disable-next-line @typescript-eslint/no-restricted-imports
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
* Object containing a React element.
|
|
196
|
-
*/
|
|
197
|
-
|
|
198
|
-
/**
|
|
199
|
-
* Object containing a React component.
|
|
200
|
-
*/
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* Object containing a React synthetic event.
|
|
204
|
-
*/
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* Object containing a React ref object.
|
|
208
|
-
*/
|
|
209
|
-
|
|
210
|
-
/**
|
|
211
|
-
* Object containing a React ref callback.
|
|
212
|
-
*/
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
* Object containing a React ref.
|
|
216
|
-
*/
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* Object that provides utilities for dealing with React children.
|
|
220
|
-
*/
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* Creates a copy of an element with extended props.
|
|
224
|
-
*
|
|
225
|
-
* @param {Element} element Element
|
|
226
|
-
* @param {?Object} props Props to apply to cloned element
|
|
227
|
-
*
|
|
228
|
-
* @return {Element} Cloned element.
|
|
229
|
-
*/
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* A base class to create WordPress Components (Refs, state and lifecycle hooks)
|
|
233
|
-
*/
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
* Creates a context object containing two components: a provider and consumer.
|
|
237
|
-
*
|
|
238
|
-
* @param {Object} defaultValue A default data stored in the context.
|
|
239
|
-
*
|
|
240
|
-
* @return {Object} Context object.
|
|
241
|
-
*/
|
|
242
|
-
|
|
243
|
-
/**
|
|
244
|
-
* Returns a new element of given type. Type can be either a string tag name or
|
|
245
|
-
* another function which itself returns an element.
|
|
246
|
-
*
|
|
247
|
-
* @param {?(string|Function)} type Tag name or element creator
|
|
248
|
-
* @param {Object} props Element properties, either attribute
|
|
249
|
-
* set to apply to DOM node or values to
|
|
250
|
-
* pass through to element creator
|
|
251
|
-
* @param {...Element} children Descendant elements
|
|
252
|
-
*
|
|
253
|
-
* @return {Element} Element.
|
|
254
|
-
*/
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
* Returns an object tracking a reference to a rendered element via its
|
|
258
|
-
* `current` property as either a DOMElement or Element, dependent upon the
|
|
259
|
-
* type of element rendered with the ref attribute.
|
|
260
|
-
*
|
|
261
|
-
* @return {Object} Ref object.
|
|
262
|
-
*/
|
|
263
|
-
|
|
264
|
-
/**
|
|
265
|
-
* Component enhancer used to enable passing a ref to its wrapped component.
|
|
266
|
-
* Pass a function argument which receives `props` and `ref` as its arguments,
|
|
267
|
-
* returning an element using the forwarded ref. The return value is a new
|
|
268
|
-
* component which forwards its ref.
|
|
269
|
-
*
|
|
270
|
-
* @param {Function} forwarder Function passed `props` and `ref`, expected to
|
|
271
|
-
* return an element.
|
|
272
|
-
*
|
|
273
|
-
* @return {Component} Enhanced component.
|
|
274
|
-
*/
|
|
275
|
-
|
|
276
|
-
/**
|
|
277
|
-
* A component which renders its children without any wrapping element.
|
|
278
|
-
*/
|
|
279
|
-
|
|
280
|
-
/**
|
|
281
|
-
* Checks if an object is a valid React Element.
|
|
282
|
-
*
|
|
283
|
-
* @param {Object} objectToCheck The object to be checked.
|
|
284
|
-
*
|
|
285
|
-
* @return {boolean} true if objectToTest is a valid React Element and false otherwise.
|
|
286
|
-
*/
|
|
287
|
-
|
|
288
|
-
/**
|
|
289
|
-
* @see https://react.dev/reference/react/memo
|
|
290
|
-
*/
|
|
291
|
-
|
|
292
|
-
/**
|
|
293
|
-
* Component that activates additional checks and warnings for its descendants.
|
|
294
|
-
*/
|
|
295
|
-
|
|
296
|
-
/**
|
|
297
|
-
* @see https://react.dev/reference/react/useCallback
|
|
298
|
-
*/
|
|
299
|
-
|
|
300
|
-
/**
|
|
301
|
-
* @see https://react.dev/reference/react/useContext
|
|
302
|
-
*/
|
|
303
|
-
|
|
304
|
-
/**
|
|
305
|
-
* @see https://react.dev/reference/react/useDebugValue
|
|
306
|
-
*/
|
|
307
|
-
|
|
308
|
-
/**
|
|
309
|
-
* @see https://react.dev/reference/react/useDeferredValue
|
|
310
|
-
*/
|
|
311
|
-
|
|
312
|
-
/**
|
|
313
|
-
* @see https://react.dev/reference/react/useEffect
|
|
314
|
-
*/
|
|
315
|
-
|
|
316
|
-
/**
|
|
317
|
-
* @see https://react.dev/reference/react/useId
|
|
318
|
-
*/
|
|
319
|
-
|
|
320
|
-
/**
|
|
321
|
-
* @see https://react.dev/reference/react/useImperativeHandle
|
|
322
|
-
*/
|
|
323
|
-
|
|
324
|
-
/**
|
|
325
|
-
* @see https://react.dev/reference/react/useInsertionEffect
|
|
326
|
-
*/
|
|
327
|
-
|
|
328
|
-
/**
|
|
329
|
-
* @see https://react.dev/reference/react/useLayoutEffect
|
|
330
|
-
*/
|
|
331
|
-
|
|
332
|
-
/**
|
|
333
|
-
* @see https://react.dev/reference/react/useMemo
|
|
334
|
-
*/
|
|
335
|
-
|
|
336
|
-
/**
|
|
337
|
-
* @see https://react.dev/reference/react/useReducer
|
|
338
|
-
*/
|
|
339
|
-
|
|
340
|
-
/**
|
|
341
|
-
* @see https://react.dev/reference/react/useRef
|
|
342
|
-
*/
|
|
343
|
-
|
|
344
|
-
/**
|
|
345
|
-
* @see https://react.dev/reference/react/useState
|
|
346
|
-
*/
|
|
347
|
-
|
|
348
|
-
/**
|
|
349
|
-
* @see https://react.dev/reference/react/useSyncExternalStore
|
|
350
|
-
*/
|
|
351
|
-
|
|
352
|
-
/**
|
|
353
|
-
* @see https://react.dev/reference/react/useTransition
|
|
354
|
-
*/
|
|
355
|
-
|
|
356
|
-
/**
|
|
357
|
-
* @see https://react.dev/reference/react/startTransition
|
|
358
|
-
*/
|
|
359
|
-
|
|
360
|
-
/**
|
|
361
|
-
* @see https://react.dev/reference/react/lazy
|
|
362
|
-
*/
|
|
363
|
-
|
|
364
|
-
/**
|
|
365
|
-
* @see https://react.dev/reference/react/Suspense
|
|
366
|
-
*/
|
|
367
|
-
|
|
368
|
-
/**
|
|
369
|
-
* @see https://react.dev/reference/react/PureComponent
|
|
370
|
-
*/
|
|
371
|
-
|
|
372
|
-
/**
|
|
373
|
-
* Concatenate two or more React children objects.
|
|
374
|
-
*
|
|
375
|
-
* @param childrenArguments - Array of children arguments (array of arrays/strings/objects) to concatenate.
|
|
376
|
-
* @return The concatenated value.
|
|
377
|
-
*/
|
|
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_exports = {};
|
|
20
|
+
__export(react_exports, {
|
|
21
|
+
Children: () => import_react.Children,
|
|
22
|
+
Component: () => import_react.Component,
|
|
23
|
+
Fragment: () => import_react.Fragment,
|
|
24
|
+
PureComponent: () => import_react.PureComponent,
|
|
25
|
+
StrictMode: () => import_react.StrictMode,
|
|
26
|
+
Suspense: () => import_react.Suspense,
|
|
27
|
+
cloneElement: () => import_react.cloneElement,
|
|
28
|
+
concatChildren: () => concatChildren,
|
|
29
|
+
createContext: () => import_react.createContext,
|
|
30
|
+
createElement: () => import_react.createElement,
|
|
31
|
+
createRef: () => import_react.createRef,
|
|
32
|
+
forwardRef: () => import_react.forwardRef,
|
|
33
|
+
isValidElement: () => import_react.isValidElement,
|
|
34
|
+
lazy: () => import_react.lazy,
|
|
35
|
+
memo: () => import_react.memo,
|
|
36
|
+
startTransition: () => import_react.startTransition,
|
|
37
|
+
switchChildrenNodeName: () => switchChildrenNodeName,
|
|
38
|
+
useCallback: () => import_react.useCallback,
|
|
39
|
+
useContext: () => import_react.useContext,
|
|
40
|
+
useDebugValue: () => import_react.useDebugValue,
|
|
41
|
+
useDeferredValue: () => import_react.useDeferredValue,
|
|
42
|
+
useEffect: () => import_react.useEffect,
|
|
43
|
+
useId: () => import_react.useId,
|
|
44
|
+
useImperativeHandle: () => import_react.useImperativeHandle,
|
|
45
|
+
useInsertionEffect: () => import_react.useInsertionEffect,
|
|
46
|
+
useLayoutEffect: () => import_react.useLayoutEffect,
|
|
47
|
+
useMemo: () => import_react.useMemo,
|
|
48
|
+
useReducer: () => import_react.useReducer,
|
|
49
|
+
useRef: () => import_react.useRef,
|
|
50
|
+
useState: () => import_react.useState,
|
|
51
|
+
useSyncExternalStore: () => import_react.useSyncExternalStore,
|
|
52
|
+
useTransition: () => import_react.useTransition
|
|
53
|
+
});
|
|
54
|
+
module.exports = __toCommonJS(react_exports);
|
|
55
|
+
var import_react = require("react");
|
|
378
56
|
function concatChildren(...childrenArguments) {
|
|
379
|
-
return childrenArguments.reduce(
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
57
|
+
return childrenArguments.reduce(
|
|
58
|
+
(accumulator, children, i) => {
|
|
59
|
+
import_react.Children.forEach(children, (child, j) => {
|
|
60
|
+
if ((0, import_react.isValidElement)(child) && typeof child !== "string") {
|
|
61
|
+
child = (0, import_react.cloneElement)(child, {
|
|
62
|
+
key: [i, j].join()
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
accumulator.push(child);
|
|
66
|
+
});
|
|
67
|
+
return accumulator;
|
|
68
|
+
},
|
|
69
|
+
[]
|
|
70
|
+
);
|
|
390
71
|
}
|
|
391
|
-
|
|
392
|
-
/**
|
|
393
|
-
* Switches the nodeName of all the elements in the children object.
|
|
394
|
-
*
|
|
395
|
-
* @param children Children object.
|
|
396
|
-
* @param nodeName Node name.
|
|
397
|
-
*
|
|
398
|
-
* @return The updated children object.
|
|
399
|
-
*/
|
|
400
72
|
function switchChildrenNodeName(children, nodeName) {
|
|
401
|
-
return children &&
|
|
402
|
-
if (typeof elt?.valueOf() ===
|
|
403
|
-
return (0,
|
|
404
|
-
key: index
|
|
405
|
-
}, elt);
|
|
73
|
+
return children && import_react.Children.map(children, (elt, index) => {
|
|
74
|
+
if (typeof elt?.valueOf() === "string") {
|
|
75
|
+
return (0, import_react.createElement)(nodeName, { key: index }, elt);
|
|
406
76
|
}
|
|
407
|
-
if (!(0,
|
|
77
|
+
if (!(0, import_react.isValidElement)(elt)) {
|
|
408
78
|
return elt;
|
|
409
79
|
}
|
|
410
|
-
const {
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
...props
|
|
417
|
-
}, childrenProp);
|
|
80
|
+
const { children: childrenProp, ...props } = elt.props;
|
|
81
|
+
return (0, import_react.createElement)(
|
|
82
|
+
nodeName,
|
|
83
|
+
{ key: index, ...props },
|
|
84
|
+
childrenProp
|
|
85
|
+
);
|
|
418
86
|
});
|
|
419
87
|
}
|
|
420
|
-
|
|
88
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
89
|
+
0 && (module.exports = {
|
|
90
|
+
Children,
|
|
91
|
+
Component,
|
|
92
|
+
Fragment,
|
|
93
|
+
PureComponent,
|
|
94
|
+
StrictMode,
|
|
95
|
+
Suspense,
|
|
96
|
+
cloneElement,
|
|
97
|
+
concatChildren,
|
|
98
|
+
createContext,
|
|
99
|
+
createElement,
|
|
100
|
+
createRef,
|
|
101
|
+
forwardRef,
|
|
102
|
+
isValidElement,
|
|
103
|
+
lazy,
|
|
104
|
+
memo,
|
|
105
|
+
startTransition,
|
|
106
|
+
switchChildrenNodeName,
|
|
107
|
+
useCallback,
|
|
108
|
+
useContext,
|
|
109
|
+
useDebugValue,
|
|
110
|
+
useDeferredValue,
|
|
111
|
+
useEffect,
|
|
112
|
+
useId,
|
|
113
|
+
useImperativeHandle,
|
|
114
|
+
useInsertionEffect,
|
|
115
|
+
useLayoutEffect,
|
|
116
|
+
useMemo,
|
|
117
|
+
useReducer,
|
|
118
|
+
useRef,
|
|
119
|
+
useState,
|
|
120
|
+
useSyncExternalStore,
|
|
121
|
+
useTransition
|
|
122
|
+
});
|
|
123
|
+
//# sourceMappingURL=react.js.map
|
package/build/react.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 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;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|