PluginProbe
Gutenberg / trunk
Gutenberg vtrunk
24.1.0 24.0.0 23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 All 404 releases
gutenberg / build / scripts / vendors / react-jsx-runtime-19.js

react-jsx-runtime-19.js in Gutenberg trunk, at build/scripts/vendors/react-jsx-runtime-19.js

391 lines 16.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 var ReactJSXRuntime = (() => {
2 var __defProp = Object.defineProperty;
3 var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4 var __getOwnPropNames = Object.getOwnPropertyNames;
5 var __hasOwnProp = Object.prototype.hasOwnProperty;
6 var __esm = (fn, res) => function __init() {
7 return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
8 };
9 var __commonJS = (cb, mod) => function __require() {
10 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
11 };
12 var __export = (target, all) => {
13 for (var name in all)
14 __defProp(target, name, { get: all[name], enumerable: true });
15 };
16 var __copyProps = (to, from, except, desc) => {
17 if (from && typeof from === "object" || typeof from === "function") {
18 for (let key of __getOwnPropNames(from))
19 if (!__hasOwnProp.call(to, key) && key !== except)
20 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
21 }
22 return to;
23 };
24 var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
26 // react-external:react
27 var require_react = __commonJS({
28 "react-external:react"(exports, module) {
29 module.exports = globalThis.React;
30 }
31 });
32
33 // ../react-19/node_modules/react/cjs/react-jsx-runtime.development.js
34 var require_react_jsx_runtime_development = __commonJS({
35 "../react-19/node_modules/react/cjs/react-jsx-runtime.development.js"(exports) {
36 "use strict";
37 (function() {
38 function getComponentNameFromType(type) {
39 if (null == type) return null;
40 if ("function" === typeof type)
41 return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
42 if ("string" === typeof type) return type;
43 switch (type) {
44 case REACT_FRAGMENT_TYPE:
45 return "Fragment";
46 case REACT_PROFILER_TYPE:
47 return "Profiler";
48 case REACT_STRICT_MODE_TYPE:
49 return "StrictMode";
50 case REACT_SUSPENSE_TYPE:
51 return "Suspense";
52 case REACT_SUSPENSE_LIST_TYPE:
53 return "SuspenseList";
54 case REACT_ACTIVITY_TYPE:
55 return "Activity";
56 case REACT_VIEW_TRANSITION_TYPE:
57 return "ViewTransition";
58 }
59 if ("object" === typeof type)
60 switch ("number" === typeof type.tag && console.error(
61 "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
62 ), type.$$typeof) {
63 case REACT_PORTAL_TYPE:
64 return "Portal";
65 case REACT_CONTEXT_TYPE:
66 return type.displayName || "Context";
67 case REACT_CONSUMER_TYPE:
68 return (type._context.displayName || "Context") + ".Consumer";
69 case REACT_FORWARD_REF_TYPE:
70 var innerType = type.render;
71 type = type.displayName;
72 type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
73 return type;
74 case REACT_MEMO_TYPE:
75 return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
76 case REACT_LAZY_TYPE:
77 innerType = type._payload;
78 type = type._init;
79 try {
80 return getComponentNameFromType(type(innerType));
81 } catch (x) {
82 }
83 }
84 return null;
85 }
86 function testStringCoercion(value) {
87 return "" + value;
88 }
89 function checkKeyStringCoercion(value) {
90 try {
91 testStringCoercion(value);
92 var JSCompiler_inline_result = false;
93 } catch (e) {
94 JSCompiler_inline_result = true;
95 }
96 if (JSCompiler_inline_result) {
97 JSCompiler_inline_result = console;
98 var JSCompiler_temp_const = JSCompiler_inline_result.error;
99 var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
100 JSCompiler_temp_const.call(
101 JSCompiler_inline_result,
102 "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
103 JSCompiler_inline_result$jscomp$0
104 );
105 return testStringCoercion(value);
106 }
107 }
108 function getTaskName(type) {
109 if (type === REACT_FRAGMENT_TYPE) return "<>";
110 if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
111 return "<...>";
112 try {
113 var name = getComponentNameFromType(type);
114 return name ? "<" + name + ">" : "<...>";
115 } catch (x) {
116 return "<...>";
117 }
118 }
119 function getOwner() {
120 var dispatcher = ReactSharedInternals.A;
121 return null === dispatcher ? null : dispatcher.getOwner();
122 }
123 function UnknownOwner() {
124 return Error("react-stack-top-frame");
125 }
126 function hasValidKey(config) {
127 if (hasOwnProperty.call(config, "key")) {
128 var getter = Object.getOwnPropertyDescriptor(config, "key").get;
129 if (getter && getter.isReactWarning) return false;
130 }
131 return void 0 !== config.key;
132 }
133 function defineKeyPropWarningGetter(props, displayName) {
134 function warnAboutAccessingKey() {
135 specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error(
136 "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
137 displayName
138 ));
139 }
140 warnAboutAccessingKey.isReactWarning = true;
141 Object.defineProperty(props, "key", {
142 get: warnAboutAccessingKey,
143 configurable: true
144 });
145 }
146 function elementRefGetterWithDeprecationWarning() {
147 var componentName = getComponentNameFromType(this.type);
148 didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error(
149 "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
150 ));
151 componentName = this.props.ref;
152 return void 0 !== componentName ? componentName : null;
153 }
154 function ReactElement(type, key, props, owner, debugStack, debugTask) {
155 var refProp = props.ref;
156 type = {
157 $$typeof: REACT_ELEMENT_TYPE,
158 type,
159 key,
160 props,
161 _owner: owner
162 };
163 null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
164 enumerable: false,
165 get: elementRefGetterWithDeprecationWarning
166 }) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
167 type._store = {};
168 Object.defineProperty(type._store, "validated", {
169 configurable: false,
170 enumerable: false,
171 writable: true,
172 value: 0
173 });
174 Object.defineProperty(type, "_debugInfo", {
175 configurable: false,
176 enumerable: false,
177 writable: true,
178 value: null
179 });
180 Object.defineProperty(type, "_debugStack", {
181 configurable: false,
182 enumerable: false,
183 writable: true,
184 value: debugStack
185 });
186 Object.defineProperty(type, "_debugTask", {
187 configurable: false,
188 enumerable: false,
189 writable: true,
190 value: debugTask
191 });
192 Object.freeze && (Object.freeze(type.props), Object.freeze(type));
193 return type;
194 }
195 function jsxDEVImpl(type, config, maybeKey, isStaticChildren, debugStack, debugTask) {
196 var children = config.children;
197 if (void 0 !== children)
198 if (isStaticChildren)
199 if (isArrayImpl(children)) {
200 for (isStaticChildren = 0; isStaticChildren < children.length; isStaticChildren++)
201 validateChildKeys(children[isStaticChildren]);
202 Object.freeze && Object.freeze(children);
203 } else
204 console.error(
205 "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
206 );
207 else validateChildKeys(children);
208 if (hasOwnProperty.call(config, "key")) {
209 children = getComponentNameFromType(type);
210 var keys = Object.keys(config).filter(function(k) {
211 return "key" !== k;
212 });
213 isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
214 didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error(
215 'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
216 isStaticChildren,
217 children,
218 keys,
219 children
220 ), didWarnAboutKeySpread[children + isStaticChildren] = true);
221 }
222 children = null;
223 void 0 !== maybeKey && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey);
224 hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key);
225 if ("key" in config) {
226 maybeKey = {};
227 for (var propName in config)
228 "key" !== propName && (maybeKey[propName] = config[propName]);
229 } else maybeKey = config;
230 children && defineKeyPropWarningGetter(
231 maybeKey,
232 "function" === typeof type ? type.displayName || type.name || "Unknown" : type
233 );
234 return ReactElement(
235 type,
236 children,
237 maybeKey,
238 getOwner(),
239 debugStack,
240 debugTask
241 );
242 }
243 function validateChildKeys(node) {
244 isValidElement(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
245 }
246 function isValidElement(object) {
247 return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
248 }
249 var React = require_react(), REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"), REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity"), REACT_VIEW_TRANSITION_TYPE = /* @__PURE__ */ Symbol.for("react.view_transition"), REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for("react.client.reference"), ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
250 return null;
251 };
252 React = {
253 react_stack_bottom_frame: function(callStackForError) {
254 return callStackForError();
255 }
256 };
257 var specialPropKeyWarningShown;
258 var didWarnAboutElementRef = {};
259 var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(
260 React,
261 UnknownOwner
262 )();
263 var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
264 var didWarnAboutKeySpread = {};
265 exports.Fragment = REACT_FRAGMENT_TYPE;
266 exports.jsx = function(type, config, maybeKey) {
267 var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
268 if (trackActualOwner) {
269 var previousStackTraceLimit = Error.stackTraceLimit;
270 Error.stackTraceLimit = 10;
271 var debugStackDEV = Error("react-stack-top-frame");
272 Error.stackTraceLimit = previousStackTraceLimit;
273 } else debugStackDEV = unknownOwnerDebugStack;
274 return jsxDEVImpl(
275 type,
276 config,
277 maybeKey,
278 false,
279 debugStackDEV,
280 trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
281 );
282 };
283 exports.jsxs = function(type, config, maybeKey) {
284 var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
285 if (trackActualOwner) {
286 var previousStackTraceLimit = Error.stackTraceLimit;
287 Error.stackTraceLimit = 10;
288 var debugStackDEV = Error("react-stack-top-frame");
289 Error.stackTraceLimit = previousStackTraceLimit;
290 } else debugStackDEV = unknownOwnerDebugStack;
291 return jsxDEVImpl(
292 type,
293 config,
294 maybeKey,
295 true,
296 debugStackDEV,
297 trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
298 );
299 };
300 })();
301 }
302 });
303
304 // ../react-19/node_modules/react/jsx-runtime.js
305 var require_jsx_runtime = __commonJS({
306 "../react-19/node_modules/react/jsx-runtime.js"(exports, module) {
307 "use strict";
308 if (false) {
309 module.exports = null;
310 } else {
311 module.exports = require_react_jsx_runtime_development();
312 }
313 }
314 });
315
316 // ../react-19/warn-compat.js
317 var warn_compat_exports = {};
318 __export(warn_compat_exports, {
319 warnCompat: () => warnCompat
320 });
321 function warnCompat(key, message) {
322 if (warned.has(key)) {
323 return;
324 }
325 warned.add(key);
326 if (typeof console !== "undefined" && console.warn) {
327 console.warn(`${PREFIX} ${message}`);
328 }
329 }
330 var PREFIX, warned;
331 var init_warn_compat = __esm({
332 "../react-19/warn-compat.js"() {
333 PREFIX = "[wordpress-react-19]";
334 warned = /* @__PURE__ */ new Set();
335 }
336 });
337
338 // ../react-19/react-jsx-runtime.js
339 var require_react_jsx_runtime = __commonJS({
340 "../react-19/react-jsx-runtime.js"(exports, module) {
341 var jsxRuntime = require_jsx_runtime();
342 var { warnCompat: warnCompat2 } = (init_warn_compat(), __toCommonJS(warn_compat_exports));
343 function applyDefaultProps(type, config) {
344 if (!type || !type.defaultProps) {
345 return config;
346 }
347 warnCompat2(
348 "jsx-default-props",
349 "`defaultProps` on function components was removed in React 19 and is emulated by a compatibility polyfill. Use default parameters instead."
350 );
351 const defaultProps = type.defaultProps;
352 let props = config;
353 for (const propName in defaultProps) {
354 if (props[propName] === void 0) {
355 if (props === config) {
356 props = { ...config };
357 }
358 props[propName] = defaultProps[propName];
359 }
360 }
361 return props;
362 }
363 function jsx(type, config, maybeKey) {
364 return jsxRuntime.jsx(type, applyDefaultProps(type, config), maybeKey);
365 }
366 function jsxs(type, config, maybeKey) {
367 return jsxRuntime.jsxs(type, applyDefaultProps(type, config), maybeKey);
368 }
369 module.exports = {
370 ...jsxRuntime,
371 jsx,
372 jsxs
373 };
374 }
375 });
376 return require_react_jsx_runtime();
377 })();
378 /*! Bundled license information:
379
380 react/cjs/react-jsx-runtime.development.js:
381 (**
382 * @license React
383 * react-jsx-runtime.development.js
384 *
385 * Copyright (c) Meta Platforms, Inc. and affiliates.
386 *
387 * This source code is licensed under the MIT license found in the
388 * LICENSE file in the root directory of this source tree.
389 *)
390 */
391