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
← All changes | build/widgets/hello-world/render.js +864 -2 23.2.2 → trunk View file →
@@ -1,7 +1,869 @@
1 +var __create = Object.create;
2 +var __defProp = Object.defineProperty;
3 +var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4 +var __getOwnPropNames = Object.getOwnPropertyNames;
5 +var __getProtoOf = Object.getPrototypeOf;
6 +var __hasOwnProp = Object.prototype.hasOwnProperty;
7 +var __commonJS = (cb, mod) => function __require() {
8 + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
19 + // If the importer is in node compatibility mode or this is not an ESM
20 + // file that has been converted to a CommonJS file using a Babel-
21 + // compatible transform (i.e. "__esModule" has not been set), then set
22 + // "default" to the CommonJS "module.exports" for node compatibility.
23 + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
24 + mod
25 +));
26 +
27 +// package-external:@wordpress/element
28 +var require_element = __commonJS({
29 + "package-external:@wordpress/element"(exports, module) {
30 + module.exports = window.wp.element;
31 + }
32 +});
33 +
34 +// vendor-external:react
35 +var require_react = __commonJS({
36 + "vendor-external:react"(exports, module) {
37 + module.exports = window.React;
38 + }
39 +});
40 +
41 +// vendor-external:react/jsx-runtime
42 +var require_jsx_runtime = __commonJS({
43 + "vendor-external:react/jsx-runtime"(exports, module) {
44 + module.exports = window.ReactJSXRuntime;
45 + }
46 +});
47 +
48 +// node_modules/clsx/dist/clsx.mjs
49 +function r(e) {
50 + var t, f, n = "";
51 + if ("string" == typeof e || "number" == typeof e) n += e;
52 + else if ("object" == typeof e) if (Array.isArray(e)) {
53 + var o = e.length;
54 + for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
55 + } else for (f in e) e[f] && (n && (n += " "), n += f);
56 + return n;
57 +}
58 +function clsx() {
59 + for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
60 + return n;
61 +}
62 +var clsx_default = clsx;
63 +
64 +// node_modules/@base-ui/utils/createLogOnce.mjs
65 +var loggedMessages;
66 +if (true) {
67 + loggedMessages = /* @__PURE__ */ new Set();
68 +}
69 +function createLogOnce(severity, prefix) {
70 + return function logOnce(...messages) {
71 + if (true) {
72 + const message = messages.join(" ");
73 + const output = prefix ? `${prefix}: ${message}` : message;
74 + const key = `${severity}:${output}`;
75 + if (!loggedMessages.has(key)) {
76 + loggedMessages.add(key);
77 + if (severity === "warn") {
78 + console.warn(output);
79 + } else {
80 + console.error(output);
81 + }
82 + }
83 + }
84 + };
85 +}
86 +
87 +// node_modules/@base-ui/utils/useRefWithInit.mjs
88 +var React = __toESM(require_react(), 1);
89 +var UNINITIALIZED = {};
90 +function useRefWithInit(init, initArg) {
91 + const ref = React.useRef(UNINITIALIZED);
92 + if (ref.current === UNINITIALIZED) {
93 + ref.current = init(initArg);
94 + }
95 + return ref;
96 +}
97 +
98 +// node_modules/@base-ui/utils/warn.mjs
99 +var warn = createLogOnce("warn", "Base UI");
100 +
101 +// node_modules/@base-ui/utils/empty.mjs
102 +var EMPTY_ARRAY = Object.freeze([]);
103 +var EMPTY_OBJECT = Object.freeze({});
104 +
105 +// node_modules/@base-ui/react/internals/useRenderElement.mjs
106 +var React4 = __toESM(require_react(), 1);
107 +
108 +// node_modules/@base-ui/utils/useMergedRefs.mjs
109 +function useMergedRefs(a, b, c, d) {
110 + const forkRef = useRefWithInit(createForkRef).current;
111 + if (didChange(forkRef, a, b, c, d)) {
112 + update(forkRef, [a, b, c, d]);
113 + }
114 + return forkRef.callback;
115 +}
116 +function useMergedRefsN(refs) {
117 + const forkRef = useRefWithInit(createForkRef).current;
118 + if (didChangeN(forkRef, refs)) {
119 + update(forkRef, refs);
120 + }
121 + return forkRef.callback;
122 +}
123 +function createForkRef() {
124 + return {
125 + callback: null,
126 + cleanup: null,
127 + refs: []
128 + };
129 +}
130 +function didChange(forkRef, a, b, c, d) {
131 + return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d;
132 +}
133 +function didChangeN(forkRef, newRefs) {
134 + return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]);
135 +}
136 +function update(forkRef, refs) {
137 + forkRef.refs = refs;
138 + if (refs.every((ref) => ref == null)) {
139 + forkRef.callback = null;
140 + return;
141 + }
142 + forkRef.callback = (instance) => {
143 + if (forkRef.cleanup) {
144 + forkRef.cleanup();
145 + forkRef.cleanup = null;
146 + }
147 + if (instance != null) {
148 + const cleanupCallbacks = Array(refs.length).fill(null);
149 + for (let i = 0; i < refs.length; i += 1) {
150 + const ref = refs[i];
151 + if (ref == null) {
152 + continue;
153 + }
154 + switch (typeof ref) {
155 + case "function": {
156 + const refCleanup = ref(instance);
157 + if (typeof refCleanup === "function") {
158 + cleanupCallbacks[i] = refCleanup;
159 + }
160 + break;
161 + }
162 + case "object": {
163 + ref.current = instance;
164 + break;
165 + }
166 + default:
167 + }
168 + }
169 + forkRef.cleanup = () => {
170 + for (let i = 0; i < refs.length; i += 1) {
171 + const ref = refs[i];
172 + if (ref == null) {
173 + continue;
174 + }
175 + switch (typeof ref) {
176 + case "function": {
177 + const cleanupCallback = cleanupCallbacks[i];
178 + if (typeof cleanupCallback === "function") {
179 + cleanupCallback();
180 + } else {
181 + void ref(null);
182 + }
183 + break;
184 + }
185 + case "object": {
186 + ref.current = null;
187 + break;
188 + }
189 + default:
190 + }
191 + }
192 + };
193 + }
194 + };
195 +}
196 +
197 +// node_modules/@base-ui/utils/getReactElementRef.mjs
198 +var React3 = __toESM(require_react(), 1);
199 +
200 +// node_modules/@base-ui/utils/reactVersion.mjs
201 +var React2 = __toESM(require_react(), 1);
202 +var majorVersion = parseInt(React2.version, 10);
203 +function isReactVersionAtLeast(reactVersionToCheck) {
204 + return majorVersion >= reactVersionToCheck;
205 +}
206 +
207 +// node_modules/@base-ui/utils/getReactElementRef.mjs
208 +function getReactElementRef(element) {
209 + if (!/* @__PURE__ */ React3.isValidElement(element)) {
210 + return null;
211 + }
212 + const reactElement = element;
213 + const propsWithRef = reactElement.props;
214 + return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null;
215 +}
216 +
217 +// node_modules/@base-ui/utils/mergeObjects.mjs
218 +function mergeObjects(a, b) {
219 + if (a && !b) {
220 + return a;
221 + }
222 + if (!a && b) {
223 + return b;
224 + }
225 + if (a || b) {
226 + return {
227 + ...a,
228 + ...b
229 + };
230 + }
231 + return void 0;
232 +}
233 +
234 +// node_modules/@base-ui/react/internals/getStateAttributesProps.mjs
235 +function getStateAttributesProps(state, customMapping) {
236 + const props = {};
237 + for (const key in state) {
238 + const value = state[key];
239 + if (customMapping?.hasOwnProperty(key)) {
240 + const customProps = customMapping[key](value);
241 + if (customProps != null) {
242 + Object.assign(props, customProps);
243 + }
244 + continue;
245 + }
246 + if (value === true) {
247 + props[`data-${key.toLowerCase()}`] = "";
248 + } else if (value) {
249 + props[`data-${key.toLowerCase()}`] = value.toString();
250 + }
251 + }
252 + return props;
253 +}
254 +
255 +// node_modules/@base-ui/react/utils/resolveClassName.mjs
256 +function resolveClassName(className, state) {
257 + return typeof className === "function" ? className(state) : className;
258 +}
259 +
260 +// node_modules/@base-ui/react/utils/resolveStyle.mjs
261 +function resolveStyle(style, state) {
262 + return typeof style === "function" ? style(state) : style;
263 +}
264 +
265 +// node_modules/@base-ui/react/merge-props/mergeProps.mjs
266 +var EMPTY_PROPS = {};
267 +function mergeProps(a, b, c, d, e) {
268 + if (!c && !d && !e && !a) {
269 + return createInitialMergedProps(b);
270 + }
271 + let merged = createInitialMergedProps(a);
272 + if (b) {
273 + merged = mergeInto(merged, b);
274 + }
275 + if (c) {
276 + merged = mergeInto(merged, c);
277 + }
278 + if (d) {
279 + merged = mergeInto(merged, d);
280 + }
281 + if (e) {
282 + merged = mergeInto(merged, e);
283 + }
284 + return merged;
285 +}
286 +function mergePropsN(props) {
287 + if (props.length === 0) {
288 + return EMPTY_PROPS;
289 + }
290 + if (props.length === 1) {
291 + return createInitialMergedProps(props[0]);
292 + }
293 + let merged = createInitialMergedProps(props[0]);
294 + for (let i = 1; i < props.length; i += 1) {
295 + merged = mergeInto(merged, props[i]);
296 + }
297 + return merged;
298 +}
299 +function createInitialMergedProps(inputProps) {
300 + if (isPropsGetter(inputProps)) {
301 + return {
302 + ...resolvePropsGetter(inputProps, EMPTY_PROPS)
303 + };
304 + }
305 + return copyInitialProps(inputProps);
306 +}
307 +function mergeInto(merged, inputProps) {
308 + if (isPropsGetter(inputProps)) {
309 + return resolvePropsGetter(inputProps, merged);
310 + }
311 + return mutablyMergeInto(merged, inputProps);
312 +}
313 +function copyInitialProps(inputProps) {
314 + const copiedProps = {
315 + ...inputProps
316 + };
317 + for (const propName in copiedProps) {
318 + const propValue = copiedProps[propName];
319 + if (isEventHandler(propName, propValue)) {
320 + copiedProps[propName] = wrapEventHandler(propValue);
321 + }
322 + }
323 + return copiedProps;
324 +}
325 +function mutablyMergeInto(mergedProps, externalProps) {
326 + if (!externalProps) {
327 + return mergedProps;
328 + }
329 + for (const propName in externalProps) {
330 + const externalPropValue = externalProps[propName];
331 + switch (propName) {
332 + case "style": {
333 + mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue);
334 + break;
335 + }
336 + case "className": {
337 + mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue);
338 + break;
339 + }
340 + default: {
341 + if (isEventHandler(propName, externalPropValue)) {
342 + mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue);
343 + } else {
344 + mergedProps[propName] = externalPropValue;
345 + }
346 + }
347 + }
348 + }
349 + return mergedProps;
350 +}
351 +function isEventHandler(key, value) {
352 + const code0 = key.charCodeAt(0);
353 + const code1 = key.charCodeAt(1);
354 + const code2 = key.charCodeAt(2);
355 + return code0 === 111 && code1 === 110 && code2 >= 65 && code2 <= 90 && (typeof value === "function" || typeof value === "undefined");
356 +}
357 +function isPropsGetter(inputProps) {
358 + return typeof inputProps === "function";
359 +}
360 +function resolvePropsGetter(inputProps, previousProps) {
361 + if (isPropsGetter(inputProps)) {
362 + return inputProps(previousProps);
363 + }
364 + return inputProps ?? EMPTY_PROPS;
365 +}
366 +function mergeEventHandlers(ourHandler, theirHandler) {
367 + if (!theirHandler) {
368 + return ourHandler;
369 + }
370 + if (!ourHandler) {
371 + return wrapEventHandler(theirHandler);
372 + }
373 + return (...args) => {
374 + const event = args[0];
375 + if (isSyntheticEvent(event)) {
376 + const baseUIEvent = event;
377 + makeEventPreventable(baseUIEvent);
378 + const result2 = theirHandler(...args);
379 + if (!baseUIEvent.baseUIHandlerPrevented) {
380 + ourHandler?.(...args);
381 + }
382 + return result2;
383 + }
384 + const result = theirHandler(...args);
385 + ourHandler?.(...args);
386 + return result;
387 + };
388 +}
389 +function wrapEventHandler(handler) {
390 + if (!handler) {
391 + return handler;
392 + }
393 + return (...args) => {
394 + const event = args[0];
395 + if (isSyntheticEvent(event)) {
396 + makeEventPreventable(event);
397 + }
398 + return handler(...args);
399 + };
400 +}
401 +function makeEventPreventable(event) {
402 + event.preventBaseUIHandler = () => {
403 + event.baseUIHandlerPrevented = true;
404 + };
405 + return event;
406 +}
407 +function mergeClassNames(ourClassName, theirClassName) {
408 + if (theirClassName) {
409 + if (ourClassName) {
410 + return theirClassName + " " + ourClassName;
411 + }
412 + return theirClassName;
413 + }
414 + return ourClassName;
415 +}
416 +function isSyntheticEvent(event) {
417 + return event != null && typeof event === "object" && "nativeEvent" in event;
418 +}
419 +
420 +// node_modules/@base-ui/react/internals/useRenderElement.mjs
421 +var import_react = __toESM(require_react(), 1);
422 +function useRenderElement(element, componentProps, params = {}) {
423 + let renderProp = componentProps.render;
424 + if (params.enabled !== false) {
425 + renderProp = unwrapLazyRenderProp(renderProp);
426 + }
427 + const outProps = useRenderElementProps(componentProps, params, renderProp);
428 + if (params.enabled === false) {
429 + return null;
430 + }
431 + const state = params.state ?? EMPTY_OBJECT;
432 + return evaluateRenderProp(element, renderProp, outProps, state);
433 +}
434 +function useRenderElementProps(componentProps, params, renderProp) {
435 + const {
436 + className: classNameProp,
437 + style: styleProp
438 + } = componentProps;
439 + const {
440 + state = EMPTY_OBJECT,
441 + ref,
442 + props,
443 + stateAttributesMapping,
444 + enabled = true
445 + } = params;
446 + const className = enabled ? resolveClassName(classNameProp, state) : void 0;
447 + const style = enabled ? resolveStyle(styleProp, state) : void 0;
448 + const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping) : EMPTY_OBJECT;
449 + const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : void 0;
450 + const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT;
451 + if (typeof document !== "undefined") {
452 + if (!enabled) {
453 + void useMergedRefs(null, null);
454 + } else if (Array.isArray(ref)) {
455 + outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]);
456 + } else {
457 + outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref);
458 + }
459 + }
460 + if (!enabled) {
461 + return EMPTY_OBJECT;
462 + }
463 + if (className !== void 0) {
464 + outProps.className = mergeClassNames(outProps.className, className);
465 + }
466 + if (style !== void 0) {
467 + outProps.style = mergeObjects(outProps.style, style);
468 + }
469 + return outProps;
470 +}
471 +function resolveRenderFunctionProps(props) {
472 + if (Array.isArray(props)) {
473 + return mergePropsN(props);
474 + }
475 + return mergeProps(void 0, props);
476 +}
477 +var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
478 +var COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/;
479 +var LOWERCASE_CHARACTER_PATTERN = /[a-z]/;
480 +function unwrapLazyRenderProp(render) {
481 + if (render?.$$typeof !== REACT_LAZY_TYPE) {
482 + return render;
483 + }
484 + const unwrapped = React4.Children.toArray(render)[0];
485 + return /* @__PURE__ */ React4.isValidElement(unwrapped) ? unwrapped : render;
486 +}
487 +function evaluateRenderProp(element, render, props, state) {
488 + if (render) {
489 + if (typeof render === "function") {
490 + if (true) {
491 + warnIfRenderPropLooksLikeComponent(render);
492 + }
493 + return render(props, state);
494 + }
495 + const mergedProps = mergeProps(props, render.props);
496 + mergedProps.ref = props.ref;
497 + if (true) {
498 + if (!/* @__PURE__ */ React4.isValidElement(render)) {
499 + throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.", "A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.", "https://base-ui.com/r/invalid-render-prop"].join("\n"));
500 + }
501 + }
502 + return /* @__PURE__ */ React4.cloneElement(render, mergedProps);
503 + }
504 + if (element) {
505 + if (typeof element === "string") {
506 + return renderTag(element, props);
507 + }
508 + }
509 + throw new Error(true ? "Base UI: Render element or function are not defined." : formatErrorMessage_default(8));
510 +}
511 +function warnIfRenderPropLooksLikeComponent(renderFn) {
512 + const functionName = renderFn.name;
513 + if (functionName.length === 0) {
514 + return;
515 + }
516 + if (!COMPONENT_IDENTIFIER_PATTERN.test(functionName)) {
517 + return;
518 + }
519 + if (!LOWERCASE_CHARACTER_PATTERN.test(functionName)) {
520 + return;
521 + }
522 + warn(`The \`render\` prop received a function named \`${functionName}\` that starts with an uppercase letter.`, "This usually means a React component was passed directly as `render={Component}`.", "Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.", "If this is an intentional render callback, rename it to start with a lowercase letter.", "Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.", "https://base-ui.com/r/invalid-render-prop");
523 +}
524 +function renderTag(Tag, props) {
525 + if (Tag === "button") {
526 + return /* @__PURE__ */ (0, import_react.createElement)("button", {
527 + type: "button",
528 + ...props,
529 + key: props.key
530 + });
531 + }
532 + if (Tag === "img") {
533 + return /* @__PURE__ */ (0, import_react.createElement)("img", {
534 + alt: "",
535 + ...props,
536 + key: props.key
537 + });
538 + }
539 + return /* @__PURE__ */ React4.createElement(Tag, props);
540 +}
541 +
542 +// node_modules/@base-ui/react/use-render/useRender.mjs
543 +function useRender(params) {
544 + return useRenderElement(params.defaultTagName ?? "div", params, params);
545 +}
546 +
547 +// packages/ui/build-module/text/text.mjs
548 +var import_element = __toESM(require_element(), 1);
549 +var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
550 +function getRuntime() {
551 + const globalScope = globalThis;
552 + if (globalScope.__wpStyleRuntime) {
553 + return globalScope.__wpStyleRuntime;
554 + }
555 + globalScope.__wpStyleRuntime = {
556 + documents: /* @__PURE__ */ new Map(),
557 + styles: /* @__PURE__ */ new Map(),
558 + injectedStyles: /* @__PURE__ */ new WeakMap()
559 + };
560 + if (typeof document !== "undefined") {
561 + registerDocument(document);
562 + }
563 + return globalScope.__wpStyleRuntime;
564 +}
565 +function documentContainsStyleHash(targetDocument, hash) {
566 + if (!targetDocument.head) {
567 + return false;
568 + }
569 + for (const style of targetDocument.head.querySelectorAll(
570 + `style[${STYLE_HASH_ATTRIBUTE}]`
571 + )) {
572 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
573 + return true;
574 + }
575 + }
576 + return false;
577 +}
578 +function injectStyle(targetDocument, hash, css) {
579 + if (!targetDocument.head) {
580 + return;
581 + }
582 + const runtime = getRuntime();
583 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
584 + if (!injectedStyles) {
585 + injectedStyles = /* @__PURE__ */ new Set();
586 + runtime.injectedStyles.set(targetDocument, injectedStyles);
587 + }
588 + if (injectedStyles.has(hash)) {
589 + return;
590 + }
591 + if (documentContainsStyleHash(targetDocument, hash)) {
592 + injectedStyles.add(hash);
593 + return;
594 + }
595 + const style = targetDocument.createElement("style");
596 + style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
597 + style.appendChild(targetDocument.createTextNode(css));
598 + targetDocument.head.appendChild(style);
599 + injectedStyles.add(hash);
600 +}
601 +function registerDocument(targetDocument) {
602 + const runtime = getRuntime();
603 + runtime.documents.set(
604 + targetDocument,
605 + (runtime.documents.get(targetDocument) ?? 0) + 1
606 + );
607 + for (const [hash, css] of runtime.styles) {
608 + injectStyle(targetDocument, hash, css);
609 + }
610 + return () => {
611 + const count = runtime.documents.get(targetDocument);
612 + if (count === void 0) {
613 + return;
614 + }
615 + if (count <= 1) {
616 + runtime.documents.delete(targetDocument);
617 + return;
618 + }
619 + runtime.documents.set(targetDocument, count - 1);
620 + };
621 +}
622 +function registerStyle(hash, css) {
623 + const runtime = getRuntime();
624 + runtime.styles.set(hash, css);
625 + for (const targetDocument of runtime.documents.keys()) {
626 + injectStyle(targetDocument, hash, css);
627 + }
628 +}
629 +if (typeof process === "undefined" || true) {
630 + registerStyle("3167e7d116", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._83ed8a8da5dd50ea__text{text-wrap:pretty;margin:0}._14437cfb77831647__heading-2xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-p-line-height:var(--wpds-typography-line-height-2xl,40px);font-size:var(--wpds-typography-font-size-2xl,32px);line-height:var(--wpds-typography-line-height-2xl,40px)}._14437cfb77831647__heading-2xl,._3c78b7fa9b4072dd__heading-xl{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-emphasis,600)}._3c78b7fa9b4072dd__heading-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-md,24px)}.aa58f227716bcde2__heading-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-lg,15px)}.aa58f227716bcde2__heading-lg,.fc4da56d8dfe52c4__heading-md{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wpds-typography-line-height-sm,20px)}.fc4da56d8dfe52c4__heading-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px)}.a9b78c7c82e8dff7__heading-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wpds-typography-line-height-xs,16px);text-transform:uppercase}._305ff559e52180d5__body-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-xl,32px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-xl,32px)}._305ff559e52180d5__body-xl,.ca1aa3fc2029e958__body-lg{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-default,400)}.ca1aa3fc2029e958__body-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-lg,15px);line-height:var(--wpds-typography-line-height-md,24px)}._131101940be12424__body-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-sm,20px)}._0e8d87a42c1f75fa__body-sm,._131101940be12424__body-md{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-default,400)}._0e8d87a42c1f75fa__body-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}');
631 +}
632 +var style_default = { "text": "_83ed8a8da5dd50ea__text", "heading-2xl": "_14437cfb77831647__heading-2xl", "heading-xl": "_3c78b7fa9b4072dd__heading-xl", "heading-lg": "aa58f227716bcde2__heading-lg", "heading-md": "fc4da56d8dfe52c4__heading-md", "heading-sm": "a9b78c7c82e8dff7__heading-sm", "body-xl": "_305ff559e52180d5__body-xl", "body-lg": "ca1aa3fc2029e958__body-lg", "body-md": "_131101940be12424__body-md", "body-sm": "_0e8d87a42c1f75fa__body-sm" };
633 +if (typeof process === "undefined" || true) {
634 + registerStyle("e8e31009f5", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}");
635 +}
636 +var global_css_defense_default = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" };
637 +var Text = (0, import_element.forwardRef)(function Text2({ variant = "body-md", render, className, ...props }, ref) {
638 + const element = useRender({
639 + render,
640 + defaultTagName: "span",
641 + ref,
642 + props: mergeProps(props, {
643 + className: clsx_default(
644 + style_default.text,
645 + global_css_defense_default.heading,
646 + global_css_defense_default.p,
647 + style_default[variant],
648 + className
649 + )
650 + })
651 + });
652 + return element;
653 +});
654 +
655 +// packages/ui/build-module/stack/stack.mjs
656 +var import_element2 = __toESM(require_element(), 1);
657 +var STYLE_HASH_ATTRIBUTE2 = "data-wp-hash";
658 +function getRuntime2() {
659 + const globalScope = globalThis;
660 + if (globalScope.__wpStyleRuntime) {
661 + return globalScope.__wpStyleRuntime;
662 + }
663 + globalScope.__wpStyleRuntime = {
664 + documents: /* @__PURE__ */ new Map(),
665 + styles: /* @__PURE__ */ new Map(),
666 + injectedStyles: /* @__PURE__ */ new WeakMap()
667 + };
668 + if (typeof document !== "undefined") {
669 + registerDocument2(document);
670 + }
671 + return globalScope.__wpStyleRuntime;
672 +}
673 +function documentContainsStyleHash2(targetDocument, hash) {
674 + if (!targetDocument.head) {
675 + return false;
676 + }
677 + for (const style of targetDocument.head.querySelectorAll(
678 + `style[${STYLE_HASH_ATTRIBUTE2}]`
679 + )) {
680 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE2) === hash) {
681 + return true;
682 + }
683 + }
684 + return false;
685 +}
686 +function injectStyle2(targetDocument, hash, css) {
687 + if (!targetDocument.head) {
688 + return;
689 + }
690 + const runtime = getRuntime2();
691 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
692 + if (!injectedStyles) {
693 + injectedStyles = /* @__PURE__ */ new Set();
694 + runtime.injectedStyles.set(targetDocument, injectedStyles);
695 + }
696 + if (injectedStyles.has(hash)) {
697 + return;
698 + }
699 + if (documentContainsStyleHash2(targetDocument, hash)) {
700 + injectedStyles.add(hash);
701 + return;
702 + }
703 + const style = targetDocument.createElement("style");
704 + style.setAttribute(STYLE_HASH_ATTRIBUTE2, hash);
705 + style.appendChild(targetDocument.createTextNode(css));
706 + targetDocument.head.appendChild(style);
707 + injectedStyles.add(hash);
708 +}
709 +function registerDocument2(targetDocument) {
710 + const runtime = getRuntime2();
711 + runtime.documents.set(
712 + targetDocument,
713 + (runtime.documents.get(targetDocument) ?? 0) + 1
714 + );
715 + for (const [hash, css] of runtime.styles) {
716 + injectStyle2(targetDocument, hash, css);
717 + }
718 + return () => {
719 + const count = runtime.documents.get(targetDocument);
720 + if (count === void 0) {
721 + return;
722 + }
723 + if (count <= 1) {
724 + runtime.documents.delete(targetDocument);
725 + return;
726 + }
727 + runtime.documents.set(targetDocument, count - 1);
728 + };
729 +}
730 +function registerStyle2(hash, css) {
731 + const runtime = getRuntime2();
732 + runtime.styles.set(hash, css);
733 + for (const targetDocument of runtime.documents.keys()) {
734 + injectStyle2(targetDocument, hash, css);
735 + }
736 +}
737 +if (typeof process === "undefined" || true) {
738 + registerStyle2("32aba35fe1", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._19ce0419607e1896__stack{display:flex}}}");
739 +}
740 +var style_default2 = { "stack": "_19ce0419607e1896__stack" };
741 +var gapTokens = {
742 + xs: "var(--wpds-dimension-gap-xs, 4px)",
743 + sm: "var(--wpds-dimension-gap-sm, 8px)",
744 + md: "var(--wpds-dimension-gap-md, 12px)",
745 + lg: "var(--wpds-dimension-gap-lg, 16px)",
746 + xl: "var(--wpds-dimension-gap-xl, 24px)",
747 + "2xl": "var(--wpds-dimension-gap-2xl, 32px)",
748 + "3xl": "var(--wpds-dimension-gap-3xl, 40px)"
749 +};
750 +var Stack = (0, import_element2.forwardRef)(function Stack2({ direction, gap, align, justify, wrap, render, ...props }, ref) {
751 + const style = {
752 + gap: gap && gapTokens[gap],
753 + alignItems: align,
754 + justifyContent: justify,
755 + flexDirection: direction,
756 + flexWrap: wrap
757 + };
758 + const element = useRender({
759 + render,
760 + ref,
761 + props: mergeProps(props, { style, className: style_default2.stack })
762 + });
763 + return element;
764 +});
765 +
766 +// packages/style-runtime/src/index.ts
767 +var STYLE_HASH_ATTRIBUTE3 = "data-wp-hash";
768 +function getRuntime3() {
769 + const globalScope = globalThis;
770 + if (globalScope.__wpStyleRuntime) {
771 + return globalScope.__wpStyleRuntime;
772 + }
773 + globalScope.__wpStyleRuntime = {
774 + documents: /* @__PURE__ */ new Map(),
775 + styles: /* @__PURE__ */ new Map(),
776 + injectedStyles: /* @__PURE__ */ new WeakMap()
777 + };
778 + if (typeof document !== "undefined") {
779 + registerDocument3(document);
780 + }
781 + return globalScope.__wpStyleRuntime;
782 +}
783 +function documentContainsStyleHash3(targetDocument, hash) {
784 + if (!targetDocument.head) {
785 + return false;
786 + }
787 + for (const style of targetDocument.head.querySelectorAll(
788 + `style[${STYLE_HASH_ATTRIBUTE3}]`
789 + )) {
790 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE3) === hash) {
791 + return true;
792 + }
793 + }
794 + return false;
795 +}
796 +function injectStyle3(targetDocument, hash, css) {
797 + if (!targetDocument.head) {
798 + return;
799 + }
800 + const runtime = getRuntime3();
801 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
802 + if (!injectedStyles) {
803 + injectedStyles = /* @__PURE__ */ new Set();
804 + runtime.injectedStyles.set(targetDocument, injectedStyles);
805 + }
806 + if (injectedStyles.has(hash)) {
807 + return;
808 + }
809 + if (documentContainsStyleHash3(targetDocument, hash)) {
810 + injectedStyles.add(hash);
811 + return;
812 + }
813 + const style = targetDocument.createElement("style");
814 + style.setAttribute(STYLE_HASH_ATTRIBUTE3, hash);
815 + style.appendChild(targetDocument.createTextNode(css));
816 + targetDocument.head.appendChild(style);
817 + injectedStyles.add(hash);
818 +}
819 +function registerDocument3(targetDocument) {
820 + const runtime = getRuntime3();
821 + runtime.documents.set(
822 + targetDocument,
823 + (runtime.documents.get(targetDocument) ?? 0) + 1
824 + );
825 + for (const [hash, css] of runtime.styles) {
826 + injectStyle3(targetDocument, hash, css);
827 + }
828 + return () => {
829 + const count = runtime.documents.get(targetDocument);
830 + if (count === void 0) {
831 + return;
832 + }
833 + if (count <= 1) {
834 + runtime.documents.delete(targetDocument);
835 + return;
836 + }
837 + runtime.documents.set(targetDocument, count - 1);
838 + };
839 +}
840 +function registerStyle3(hash, css) {
841 + const runtime = getRuntime3();
842 + runtime.styles.set(hash, css);
843 + for (const targetDocument of runtime.documents.keys()) {
844 + injectStyle3(targetDocument, hash, css);
845 + }
846 +}
847 +
848 +// widgets/hello-world/style.module.css
849 +if (typeof process === "undefined" || true) {
850 + registerStyle3("8573d4c9f9", "._6e9c47f7f67ffa0d__root{background-color:var(--wpds-color-background-surface-brand,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 9%,#fff));color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9));height:100%;padding:var(--wpds-dimension-padding-2xl,24px)}");
851 +}
852 +var style_default3 = { "root": "_6e9c47f7f67ffa0d__root" };
853 +
1 854 // widgets/hello-world/render.tsx
2 -function HelloWorld() {
3 - return /* @__PURE__ */ React.createElement("div", null, "Hello World");
855 +var import_jsx_runtime = __toESM(require_jsx_runtime());
856 +function HelloWorld({ attributes }) {
857 + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
858 + Stack,
859 + {
860 + align: "center",
861 + justify: "center",
862 + className: clsx_default(style_default3.root),
863 + children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { variant: "heading-2xl", children: attributes?.message || "Hello World" })
864 + }
865 + );
4 866 }
5 867 export {
6 868 HelloWorld as default
7 869 };