PluginProbe
Gutenberg / 23.3.0
Gutenberg v23.3.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 12.6.0 7.4.0 All 402 releases
gutenberg / build / scripts / vendors / react-jsx-runtime.js

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

297 lines 13.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 "use strict";
2 var ReactJSXRuntime = (() => {
3 var __getOwnPropNames = Object.getOwnPropertyNames;
4 var __commonJS = (cb, mod) => function __require() {
5 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
6 };
7
8 // react-external:react
9 var require_react = __commonJS({
10 "react-external:react"(exports, module) {
11 module.exports = globalThis.React;
12 }
13 });
14
15 // node_modules/react/cjs/react-jsx-runtime.development.js
16 var require_react_jsx_runtime_development = __commonJS({
17 "node_modules/react/cjs/react-jsx-runtime.development.js"(exports) {
18 "use strict";
19 (function() {
20 function getComponentNameFromType(type) {
21 if (null == type) return null;
22 if ("function" === typeof type)
23 return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
24 if ("string" === typeof type) return type;
25 switch (type) {
26 case REACT_FRAGMENT_TYPE:
27 return "Fragment";
28 case REACT_PROFILER_TYPE:
29 return "Profiler";
30 case REACT_STRICT_MODE_TYPE:
31 return "StrictMode";
32 case REACT_SUSPENSE_TYPE:
33 return "Suspense";
34 case REACT_SUSPENSE_LIST_TYPE:
35 return "SuspenseList";
36 case REACT_ACTIVITY_TYPE:
37 return "Activity";
38 }
39 if ("object" === typeof type)
40 switch ("number" === typeof type.tag && console.error(
41 "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
42 ), type.$$typeof) {
43 case REACT_PORTAL_TYPE:
44 return "Portal";
45 case REACT_CONTEXT_TYPE:
46 return type.displayName || "Context";
47 case REACT_CONSUMER_TYPE:
48 return (type._context.displayName || "Context") + ".Consumer";
49 case REACT_FORWARD_REF_TYPE:
50 var innerType = type.render;
51 type = type.displayName;
52 type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
53 return type;
54 case REACT_MEMO_TYPE:
55 return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
56 case REACT_LAZY_TYPE:
57 innerType = type._payload;
58 type = type._init;
59 try {
60 return getComponentNameFromType(type(innerType));
61 } catch (x) {
62 }
63 }
64 return null;
65 }
66 function testStringCoercion(value) {
67 return "" + value;
68 }
69 function checkKeyStringCoercion(value) {
70 try {
71 testStringCoercion(value);
72 var JSCompiler_inline_result = false;
73 } catch (e) {
74 JSCompiler_inline_result = true;
75 }
76 if (JSCompiler_inline_result) {
77 JSCompiler_inline_result = console;
78 var JSCompiler_temp_const = JSCompiler_inline_result.error;
79 var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
80 JSCompiler_temp_const.call(
81 JSCompiler_inline_result,
82 "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
83 JSCompiler_inline_result$jscomp$0
84 );
85 return testStringCoercion(value);
86 }
87 }
88 function getTaskName(type) {
89 if (type === REACT_FRAGMENT_TYPE) return "<>";
90 if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
91 return "<...>";
92 try {
93 var name = getComponentNameFromType(type);
94 return name ? "<" + name + ">" : "<...>";
95 } catch (x) {
96 return "<...>";
97 }
98 }
99 function getOwner() {
100 var dispatcher = ReactSharedInternals.A;
101 return null === dispatcher ? null : dispatcher.getOwner();
102 }
103 function UnknownOwner() {
104 return Error("react-stack-top-frame");
105 }
106 function hasValidKey(config) {
107 if (hasOwnProperty.call(config, "key")) {
108 var getter = Object.getOwnPropertyDescriptor(config, "key").get;
109 if (getter && getter.isReactWarning) return false;
110 }
111 return void 0 !== config.key;
112 }
113 function defineKeyPropWarningGetter(props, displayName) {
114 function warnAboutAccessingKey() {
115 specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error(
116 "%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)",
117 displayName
118 ));
119 }
120 warnAboutAccessingKey.isReactWarning = true;
121 Object.defineProperty(props, "key", {
122 get: warnAboutAccessingKey,
123 configurable: true
124 });
125 }
126 function elementRefGetterWithDeprecationWarning() {
127 var componentName = getComponentNameFromType(this.type);
128 didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error(
129 "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."
130 ));
131 componentName = this.props.ref;
132 return void 0 !== componentName ? componentName : null;
133 }
134 function ReactElement(type, key, props, owner, debugStack, debugTask) {
135 var refProp = props.ref;
136 type = {
137 $$typeof: REACT_ELEMENT_TYPE,
138 type,
139 key,
140 props,
141 _owner: owner
142 };
143 null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
144 enumerable: false,
145 get: elementRefGetterWithDeprecationWarning
146 }) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
147 type._store = {};
148 Object.defineProperty(type._store, "validated", {
149 configurable: false,
150 enumerable: false,
151 writable: true,
152 value: 0
153 });
154 Object.defineProperty(type, "_debugInfo", {
155 configurable: false,
156 enumerable: false,
157 writable: true,
158 value: null
159 });
160 Object.defineProperty(type, "_debugStack", {
161 configurable: false,
162 enumerable: false,
163 writable: true,
164 value: debugStack
165 });
166 Object.defineProperty(type, "_debugTask", {
167 configurable: false,
168 enumerable: false,
169 writable: true,
170 value: debugTask
171 });
172 Object.freeze && (Object.freeze(type.props), Object.freeze(type));
173 return type;
174 }
175 function jsxDEVImpl(type, config, maybeKey, isStaticChildren, debugStack, debugTask) {
176 var children = config.children;
177 if (void 0 !== children)
178 if (isStaticChildren)
179 if (isArrayImpl(children)) {
180 for (isStaticChildren = 0; isStaticChildren < children.length; isStaticChildren++)
181 validateChildKeys(children[isStaticChildren]);
182 Object.freeze && Object.freeze(children);
183 } else
184 console.error(
185 "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
186 );
187 else validateChildKeys(children);
188 if (hasOwnProperty.call(config, "key")) {
189 children = getComponentNameFromType(type);
190 var keys = Object.keys(config).filter(function(k) {
191 return "key" !== k;
192 });
193 isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
194 didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error(
195 '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} />',
196 isStaticChildren,
197 children,
198 keys,
199 children
200 ), didWarnAboutKeySpread[children + isStaticChildren] = true);
201 }
202 children = null;
203 void 0 !== maybeKey && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey);
204 hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key);
205 if ("key" in config) {
206 maybeKey = {};
207 for (var propName in config)
208 "key" !== propName && (maybeKey[propName] = config[propName]);
209 } else maybeKey = config;
210 children && defineKeyPropWarningGetter(
211 maybeKey,
212 "function" === typeof type ? type.displayName || type.name || "Unknown" : type
213 );
214 return ReactElement(
215 type,
216 children,
217 maybeKey,
218 getOwner(),
219 debugStack,
220 debugTask
221 );
222 }
223 function validateChildKeys(node) {
224 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));
225 }
226 function isValidElement(object) {
227 return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
228 }
229 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_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() {
230 return null;
231 };
232 React = {
233 react_stack_bottom_frame: function(callStackForError) {
234 return callStackForError();
235 }
236 };
237 var specialPropKeyWarningShown;
238 var didWarnAboutElementRef = {};
239 var unknownOwnerDebugStack = React.react_stack_bottom_frame.bind(
240 React,
241 UnknownOwner
242 )();
243 var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
244 var didWarnAboutKeySpread = {};
245 exports.Fragment = REACT_FRAGMENT_TYPE;
246 exports.jsx = function(type, config, maybeKey) {
247 var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
248 return jsxDEVImpl(
249 type,
250 config,
251 maybeKey,
252 false,
253 trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
254 trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
255 );
256 };
257 exports.jsxs = function(type, config, maybeKey) {
258 var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
259 return jsxDEVImpl(
260 type,
261 config,
262 maybeKey,
263 true,
264 trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
265 trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
266 );
267 };
268 })();
269 }
270 });
271
272 // node_modules/react/jsx-runtime.js
273 var require_jsx_runtime = __commonJS({
274 "node_modules/react/jsx-runtime.js"(exports, module) {
275 if (false) {
276 module.exports = null;
277 } else {
278 module.exports = require_react_jsx_runtime_development();
279 }
280 }
281 });
282 return require_jsx_runtime();
283 })();
284 /*! Bundled license information:
285
286 react/cjs/react-jsx-runtime.development.js:
287 (**
288 * @license React
289 * react-jsx-runtime.development.js
290 *
291 * Copyright (c) Meta Platforms, Inc. and affiliates.
292 *
293 * This source code is licensed under the MIT license found in the
294 * LICENSE file in the root directory of this source tree.
295 *)
296 */
297