PluginProbe
Gutenberg / 23.5.2
Gutenberg v23.5.2
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 / widgets / hello-dolly / render.js

render.js in Gutenberg 23.5.2, at build/widgets/hello-dolly/render.js

1,000 lines 38.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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 // package-external:@wordpress/i18n
35 var require_i18n = __commonJS({
36 "package-external:@wordpress/i18n"(exports, module) {
37 module.exports = window.wp.i18n;
38 }
39 });
40
41 // vendor-external:react
42 var require_react = __commonJS({
43 "vendor-external:react"(exports, module) {
44 module.exports = window.React;
45 }
46 });
47
48 // vendor-external:react/jsx-runtime
49 var require_jsx_runtime = __commonJS({
50 "vendor-external:react/jsx-runtime"(exports, module) {
51 module.exports = window.ReactJSXRuntime;
52 }
53 });
54
55 // widgets/hello-dolly/render.tsx
56 var import_element4 = __toESM(require_element());
57 var import_i18n = __toESM(require_i18n());
58
59 // node_modules/clsx/dist/clsx.mjs
60 function r(e) {
61 var t, f, n = "";
62 if ("string" == typeof e || "number" == typeof e) n += e;
63 else if ("object" == typeof e) if (Array.isArray(e)) {
64 var o = e.length;
65 for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
66 } else for (f in e) e[f] && (n && (n += " "), n += f);
67 return n;
68 }
69 function clsx() {
70 for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
71 return n;
72 }
73 var clsx_default = clsx;
74
75 // node_modules/@base-ui/utils/esm/useRefWithInit.js
76 var React = __toESM(require_react(), 1);
77 var UNINITIALIZED = {};
78 function useRefWithInit(init, initArg) {
79 const ref = React.useRef(UNINITIALIZED);
80 if (ref.current === UNINITIALIZED) {
81 ref.current = init(initArg);
82 }
83 return ref;
84 }
85
86 // node_modules/@base-ui/utils/esm/warn.js
87 var set;
88 if (true) {
89 set = /* @__PURE__ */ new Set();
90 }
91 function warn(...messages) {
92 if (true) {
93 const messageKey = messages.join(" ");
94 if (!set.has(messageKey)) {
95 set.add(messageKey);
96 console.warn(`Base UI: ${messageKey}`);
97 }
98 }
99 }
100
101 // node_modules/@base-ui/react/esm/internals/useRenderElement.js
102 var React4 = __toESM(require_react(), 1);
103
104 // node_modules/@base-ui/utils/esm/useMergedRefs.js
105 function useMergedRefs(a, b, c, d) {
106 const forkRef = useRefWithInit(createForkRef).current;
107 if (didChange(forkRef, a, b, c, d)) {
108 update(forkRef, [a, b, c, d]);
109 }
110 return forkRef.callback;
111 }
112 function useMergedRefsN(refs) {
113 const forkRef = useRefWithInit(createForkRef).current;
114 if (didChangeN(forkRef, refs)) {
115 update(forkRef, refs);
116 }
117 return forkRef.callback;
118 }
119 function createForkRef() {
120 return {
121 callback: null,
122 cleanup: null,
123 refs: []
124 };
125 }
126 function didChange(forkRef, a, b, c, d) {
127 return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d;
128 }
129 function didChangeN(forkRef, newRefs) {
130 return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]);
131 }
132 function update(forkRef, refs) {
133 forkRef.refs = refs;
134 if (refs.every((ref) => ref == null)) {
135 forkRef.callback = null;
136 return;
137 }
138 forkRef.callback = (instance) => {
139 if (forkRef.cleanup) {
140 forkRef.cleanup();
141 forkRef.cleanup = null;
142 }
143 if (instance != null) {
144 const cleanupCallbacks = Array(refs.length).fill(null);
145 for (let i = 0; i < refs.length; i += 1) {
146 const ref = refs[i];
147 if (ref == null) {
148 continue;
149 }
150 switch (typeof ref) {
151 case "function": {
152 const refCleanup = ref(instance);
153 if (typeof refCleanup === "function") {
154 cleanupCallbacks[i] = refCleanup;
155 }
156 break;
157 }
158 case "object": {
159 ref.current = instance;
160 break;
161 }
162 default:
163 }
164 }
165 forkRef.cleanup = () => {
166 for (let i = 0; i < refs.length; i += 1) {
167 const ref = refs[i];
168 if (ref == null) {
169 continue;
170 }
171 switch (typeof ref) {
172 case "function": {
173 const cleanupCallback = cleanupCallbacks[i];
174 if (typeof cleanupCallback === "function") {
175 cleanupCallback();
176 } else {
177 ref(null);
178 }
179 break;
180 }
181 case "object": {
182 ref.current = null;
183 break;
184 }
185 default:
186 }
187 }
188 };
189 }
190 };
191 }
192
193 // node_modules/@base-ui/utils/esm/getReactElementRef.js
194 var React3 = __toESM(require_react(), 1);
195
196 // node_modules/@base-ui/utils/esm/reactVersion.js
197 var React2 = __toESM(require_react(), 1);
198 var majorVersion = parseInt(React2.version, 10);
199 function isReactVersionAtLeast(reactVersionToCheck) {
200 return majorVersion >= reactVersionToCheck;
201 }
202
203 // node_modules/@base-ui/utils/esm/getReactElementRef.js
204 function getReactElementRef(element) {
205 if (!/* @__PURE__ */ React3.isValidElement(element)) {
206 return null;
207 }
208 const reactElement = element;
209 const propsWithRef = reactElement.props;
210 return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null;
211 }
212
213 // node_modules/@base-ui/utils/esm/mergeObjects.js
214 function mergeObjects(a, b) {
215 if (a && !b) {
216 return a;
217 }
218 if (!a && b) {
219 return b;
220 }
221 if (a || b) {
222 return {
223 ...a,
224 ...b
225 };
226 }
227 return void 0;
228 }
229
230 // node_modules/@base-ui/utils/esm/empty.js
231 var EMPTY_ARRAY = Object.freeze([]);
232 var EMPTY_OBJECT = Object.freeze({});
233
234 // node_modules/@base-ui/react/esm/internals/getStateAttributesProps.js
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/esm/utils/resolveClassName.js
256 function resolveClassName(className, state) {
257 return typeof className === "function" ? className(state) : className;
258 }
259
260 // node_modules/@base-ui/react/esm/utils/resolveStyle.js
261 function resolveStyle(style, state) {
262 return typeof style === "function" ? style(state) : style;
263 }
264
265 // node_modules/@base-ui/react/esm/merge-props/mergeProps.js
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/esm/internals/useRenderElement.js
421 var import_react = __toESM(require_react(), 1);
422 function useRenderElement(element, componentProps, params = {}) {
423 const renderProp = componentProps.render;
424 const outProps = useRenderElementProps(componentProps, params);
425 if (params.enabled === false) {
426 return null;
427 }
428 const state = params.state ?? EMPTY_OBJECT;
429 return evaluateRenderProp(element, renderProp, outProps, state);
430 }
431 function useRenderElementProps(componentProps, params = {}) {
432 const {
433 className: classNameProp,
434 style: styleProp,
435 render: renderProp
436 } = componentProps;
437 const {
438 state = EMPTY_OBJECT,
439 ref,
440 props,
441 stateAttributesMapping,
442 enabled = true
443 } = params;
444 const className = enabled ? resolveClassName(classNameProp, state) : void 0;
445 const style = enabled ? resolveStyle(styleProp, state) : void 0;
446 const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping) : EMPTY_OBJECT;
447 const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : void 0;
448 const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT;
449 if (typeof document !== "undefined") {
450 if (!enabled) {
451 useMergedRefs(null, null);
452 } else if (Array.isArray(ref)) {
453 outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]);
454 } else {
455 outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref);
456 }
457 }
458 if (!enabled) {
459 return EMPTY_OBJECT;
460 }
461 if (className !== void 0) {
462 outProps.className = mergeClassNames(outProps.className, className);
463 }
464 if (style !== void 0) {
465 outProps.style = mergeObjects(outProps.style, style);
466 }
467 return outProps;
468 }
469 function resolveRenderFunctionProps(props) {
470 if (Array.isArray(props)) {
471 return mergePropsN(props);
472 }
473 return mergeProps(void 0, props);
474 }
475 var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
476 var COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/;
477 var LOWERCASE_CHARACTER_PATTERN = /[a-z]/;
478 function evaluateRenderProp(element, render, props, state) {
479 if (render) {
480 if (typeof render === "function") {
481 if (true) {
482 warnIfRenderPropLooksLikeComponent(render);
483 }
484 return render(props, state);
485 }
486 const mergedProps = mergeProps(props, render.props);
487 mergedProps.ref = props.ref;
488 let newElement = render;
489 if (newElement?.$$typeof === REACT_LAZY_TYPE) {
490 const children = React4.Children.toArray(render);
491 newElement = children[0];
492 }
493 if (true) {
494 if (!/* @__PURE__ */ React4.isValidElement(newElement)) {
495 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"));
496 }
497 }
498 return /* @__PURE__ */ React4.cloneElement(newElement, mergedProps);
499 }
500 if (element) {
501 if (typeof element === "string") {
502 return renderTag(element, props);
503 }
504 }
505 throw new Error(true ? "Base UI: Render element or function are not defined." : formatErrorMessage_default(8));
506 }
507 function warnIfRenderPropLooksLikeComponent(renderFn) {
508 const functionName = renderFn.name;
509 if (functionName.length === 0) {
510 return;
511 }
512 if (!COMPONENT_IDENTIFIER_PATTERN.test(functionName)) {
513 return;
514 }
515 if (!LOWERCASE_CHARACTER_PATTERN.test(functionName)) {
516 return;
517 }
518 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");
519 }
520 function renderTag(Tag, props) {
521 if (Tag === "button") {
522 return /* @__PURE__ */ (0, import_react.createElement)("button", {
523 type: "button",
524 ...props,
525 key: props.key
526 });
527 }
528 if (Tag === "img") {
529 return /* @__PURE__ */ (0, import_react.createElement)("img", {
530 alt: "",
531 ...props,
532 key: props.key
533 });
534 }
535 return /* @__PURE__ */ React4.createElement(Tag, props);
536 }
537
538 // node_modules/@base-ui/react/esm/use-render/useRender.js
539 function useRender(params) {
540 return useRenderElement(params.defaultTagName ?? "div", params, params);
541 }
542
543 // packages/ui/build-module/text/text.mjs
544 var import_element = __toESM(require_element(), 1);
545 var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
546 function getRuntime() {
547 const globalScope = globalThis;
548 if (globalScope.__wpStyleRuntime) {
549 return globalScope.__wpStyleRuntime;
550 }
551 globalScope.__wpStyleRuntime = {
552 documents: /* @__PURE__ */ new Map(),
553 styles: /* @__PURE__ */ new Map(),
554 injectedStyles: /* @__PURE__ */ new WeakMap()
555 };
556 if (typeof document !== "undefined") {
557 registerDocument(document);
558 }
559 return globalScope.__wpStyleRuntime;
560 }
561 function documentContainsStyleHash(targetDocument, hash) {
562 if (!targetDocument.head) {
563 return false;
564 }
565 for (const style of targetDocument.head.querySelectorAll(
566 `style[${STYLE_HASH_ATTRIBUTE}]`
567 )) {
568 if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
569 return true;
570 }
571 }
572 return false;
573 }
574 function injectStyle(targetDocument, hash, css) {
575 if (!targetDocument.head) {
576 return;
577 }
578 const runtime = getRuntime();
579 let injectedStyles = runtime.injectedStyles.get(targetDocument);
580 if (!injectedStyles) {
581 injectedStyles = /* @__PURE__ */ new Set();
582 runtime.injectedStyles.set(targetDocument, injectedStyles);
583 }
584 if (injectedStyles.has(hash)) {
585 return;
586 }
587 if (documentContainsStyleHash(targetDocument, hash)) {
588 injectedStyles.add(hash);
589 return;
590 }
591 const style = targetDocument.createElement("style");
592 style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
593 style.appendChild(targetDocument.createTextNode(css));
594 targetDocument.head.appendChild(style);
595 injectedStyles.add(hash);
596 }
597 function registerDocument(targetDocument) {
598 const runtime = getRuntime();
599 runtime.documents.set(
600 targetDocument,
601 (runtime.documents.get(targetDocument) ?? 0) + 1
602 );
603 for (const [hash, css] of runtime.styles) {
604 injectStyle(targetDocument, hash, css);
605 }
606 return () => {
607 const count = runtime.documents.get(targetDocument);
608 if (count === void 0) {
609 return;
610 }
611 if (count <= 1) {
612 runtime.documents.delete(targetDocument);
613 return;
614 }
615 runtime.documents.set(targetDocument, count - 1);
616 };
617 }
618 function registerStyle(hash, css) {
619 const runtime = getRuntime();
620 runtime.styles.set(hash, css);
621 for (const targetDocument of runtime.documents.keys()) {
622 injectStyle(targetDocument, hash, css);
623 }
624 }
625 if (typeof process === "undefined" || true) {
626 registerStyle("0c5702ddca", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._83ed8a8da5dd50ea__text{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-medium,499);--_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-medium,499)}._3c78b7fa9b4072dd__heading-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_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-medium,499);--_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-medium,499);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-medium,499);--_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-medium,499);--_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-medium,499);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-regular,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-regular,400)}.ca1aa3fc2029e958__body-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,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-regular,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-regular,400)}._0e8d87a42c1f75fa__body-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,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)}}}');
627 }
628 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" };
629 if (typeof process === "undefined" || true) {
630 registerStyle("d390e935a7", "._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);&: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))}&::placeholder{color:var(--_gcd-input-placeholder-color,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-medium,499));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)}");
631 }
632 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" };
633 var Text = (0, import_element.forwardRef)(function Text2({ variant = "body-md", render, className, ...props }, ref) {
634 const element = useRender({
635 render,
636 defaultTagName: "span",
637 ref,
638 props: mergeProps(props, {
639 className: clsx_default(
640 style_default.text,
641 global_css_defense_default.heading,
642 global_css_defense_default.p,
643 style_default[variant],
644 className
645 )
646 })
647 });
648 return element;
649 });
650
651 // packages/ui/build-module/stack/stack.mjs
652 var import_element2 = __toESM(require_element(), 1);
653 var STYLE_HASH_ATTRIBUTE2 = "data-wp-hash";
654 function getRuntime2() {
655 const globalScope = globalThis;
656 if (globalScope.__wpStyleRuntime) {
657 return globalScope.__wpStyleRuntime;
658 }
659 globalScope.__wpStyleRuntime = {
660 documents: /* @__PURE__ */ new Map(),
661 styles: /* @__PURE__ */ new Map(),
662 injectedStyles: /* @__PURE__ */ new WeakMap()
663 };
664 if (typeof document !== "undefined") {
665 registerDocument2(document);
666 }
667 return globalScope.__wpStyleRuntime;
668 }
669 function documentContainsStyleHash2(targetDocument, hash) {
670 if (!targetDocument.head) {
671 return false;
672 }
673 for (const style of targetDocument.head.querySelectorAll(
674 `style[${STYLE_HASH_ATTRIBUTE2}]`
675 )) {
676 if (style.getAttribute(STYLE_HASH_ATTRIBUTE2) === hash) {
677 return true;
678 }
679 }
680 return false;
681 }
682 function injectStyle2(targetDocument, hash, css) {
683 if (!targetDocument.head) {
684 return;
685 }
686 const runtime = getRuntime2();
687 let injectedStyles = runtime.injectedStyles.get(targetDocument);
688 if (!injectedStyles) {
689 injectedStyles = /* @__PURE__ */ new Set();
690 runtime.injectedStyles.set(targetDocument, injectedStyles);
691 }
692 if (injectedStyles.has(hash)) {
693 return;
694 }
695 if (documentContainsStyleHash2(targetDocument, hash)) {
696 injectedStyles.add(hash);
697 return;
698 }
699 const style = targetDocument.createElement("style");
700 style.setAttribute(STYLE_HASH_ATTRIBUTE2, hash);
701 style.appendChild(targetDocument.createTextNode(css));
702 targetDocument.head.appendChild(style);
703 injectedStyles.add(hash);
704 }
705 function registerDocument2(targetDocument) {
706 const runtime = getRuntime2();
707 runtime.documents.set(
708 targetDocument,
709 (runtime.documents.get(targetDocument) ?? 0) + 1
710 );
711 for (const [hash, css] of runtime.styles) {
712 injectStyle2(targetDocument, hash, css);
713 }
714 return () => {
715 const count = runtime.documents.get(targetDocument);
716 if (count === void 0) {
717 return;
718 }
719 if (count <= 1) {
720 runtime.documents.delete(targetDocument);
721 return;
722 }
723 runtime.documents.set(targetDocument, count - 1);
724 };
725 }
726 function registerStyle2(hash, css) {
727 const runtime = getRuntime2();
728 runtime.styles.set(hash, css);
729 for (const targetDocument of runtime.documents.keys()) {
730 injectStyle2(targetDocument, hash, css);
731 }
732 }
733 if (typeof process === "undefined" || true) {
734 registerStyle2("32aba35fe1", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._19ce0419607e1896__stack{display:flex}}}");
735 }
736 var style_default2 = { "stack": "_19ce0419607e1896__stack" };
737 var gapTokens = {
738 xs: "var(--wpds-dimension-gap-xs, 4px)",
739 sm: "var(--wpds-dimension-gap-sm, 8px)",
740 md: "var(--wpds-dimension-gap-md, 12px)",
741 lg: "var(--wpds-dimension-gap-lg, 16px)",
742 xl: "var(--wpds-dimension-gap-xl, 24px)",
743 "2xl": "var(--wpds-dimension-gap-2xl, 32px)",
744 "3xl": "var(--wpds-dimension-gap-3xl, 40px)"
745 };
746 var Stack = (0, import_element2.forwardRef)(function Stack2({ direction, gap, align, justify, wrap, render, ...props }, ref) {
747 const style = {
748 gap: gap && gapTokens[gap],
749 alignItems: align,
750 justifyContent: justify,
751 flexDirection: direction,
752 flexWrap: wrap
753 };
754 const element = useRender({
755 render,
756 ref,
757 props: mergeProps(props, { style, className: style_default2.stack })
758 });
759 return element;
760 });
761
762 // packages/ui/build-module/visually-hidden/visually-hidden.mjs
763 var import_element3 = __toESM(require_element(), 1);
764 var STYLE_HASH_ATTRIBUTE3 = "data-wp-hash";
765 function getRuntime3() {
766 const globalScope = globalThis;
767 if (globalScope.__wpStyleRuntime) {
768 return globalScope.__wpStyleRuntime;
769 }
770 globalScope.__wpStyleRuntime = {
771 documents: /* @__PURE__ */ new Map(),
772 styles: /* @__PURE__ */ new Map(),
773 injectedStyles: /* @__PURE__ */ new WeakMap()
774 };
775 if (typeof document !== "undefined") {
776 registerDocument3(document);
777 }
778 return globalScope.__wpStyleRuntime;
779 }
780 function documentContainsStyleHash3(targetDocument, hash) {
781 if (!targetDocument.head) {
782 return false;
783 }
784 for (const style of targetDocument.head.querySelectorAll(
785 `style[${STYLE_HASH_ATTRIBUTE3}]`
786 )) {
787 if (style.getAttribute(STYLE_HASH_ATTRIBUTE3) === hash) {
788 return true;
789 }
790 }
791 return false;
792 }
793 function injectStyle3(targetDocument, hash, css) {
794 if (!targetDocument.head) {
795 return;
796 }
797 const runtime = getRuntime3();
798 let injectedStyles = runtime.injectedStyles.get(targetDocument);
799 if (!injectedStyles) {
800 injectedStyles = /* @__PURE__ */ new Set();
801 runtime.injectedStyles.set(targetDocument, injectedStyles);
802 }
803 if (injectedStyles.has(hash)) {
804 return;
805 }
806 if (documentContainsStyleHash3(targetDocument, hash)) {
807 injectedStyles.add(hash);
808 return;
809 }
810 const style = targetDocument.createElement("style");
811 style.setAttribute(STYLE_HASH_ATTRIBUTE3, hash);
812 style.appendChild(targetDocument.createTextNode(css));
813 targetDocument.head.appendChild(style);
814 injectedStyles.add(hash);
815 }
816 function registerDocument3(targetDocument) {
817 const runtime = getRuntime3();
818 runtime.documents.set(
819 targetDocument,
820 (runtime.documents.get(targetDocument) ?? 0) + 1
821 );
822 for (const [hash, css] of runtime.styles) {
823 injectStyle3(targetDocument, hash, css);
824 }
825 return () => {
826 const count = runtime.documents.get(targetDocument);
827 if (count === void 0) {
828 return;
829 }
830 if (count <= 1) {
831 runtime.documents.delete(targetDocument);
832 return;
833 }
834 runtime.documents.set(targetDocument, count - 1);
835 };
836 }
837 function registerStyle3(hash, css) {
838 const runtime = getRuntime3();
839 runtime.styles.set(hash, css);
840 for (const targetDocument of runtime.documents.keys()) {
841 injectStyle3(targetDocument, hash, css);
842 }
843 }
844 if (typeof process === "undefined" || true) {
845 registerStyle3("fa606a57ae", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.f37b9e2e191ebd66__visually-hidden{word-wrap:normal;border:0;clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-break:normal}}}");
846 }
847 var style_default3 = { "visually-hidden": "f37b9e2e191ebd66__visually-hidden" };
848 var VisuallyHidden = (0, import_element3.forwardRef)(
849 function VisuallyHidden2({ render, ...restProps }, ref) {
850 const element = useRender({
851 render,
852 ref,
853 props: mergeProps(
854 { className: style_default3["visually-hidden"] },
855 restProps,
856 {
857 // @ts-expect-error Arbitrary data-* attributes aren't indexable on the typed div props. Kept hardcoded so consumers can't change or remove it.
858 "data-visually-hidden": ""
859 }
860 )
861 });
862 return element;
863 }
864 );
865
866 // packages/style-runtime/src/index.ts
867 var STYLE_HASH_ATTRIBUTE4 = "data-wp-hash";
868 function getRuntime4() {
869 const globalScope = globalThis;
870 if (globalScope.__wpStyleRuntime) {
871 return globalScope.__wpStyleRuntime;
872 }
873 globalScope.__wpStyleRuntime = {
874 documents: /* @__PURE__ */ new Map(),
875 styles: /* @__PURE__ */ new Map(),
876 injectedStyles: /* @__PURE__ */ new WeakMap()
877 };
878 if (typeof document !== "undefined") {
879 registerDocument4(document);
880 }
881 return globalScope.__wpStyleRuntime;
882 }
883 function documentContainsStyleHash4(targetDocument, hash) {
884 if (!targetDocument.head) {
885 return false;
886 }
887 for (const style of targetDocument.head.querySelectorAll(
888 `style[${STYLE_HASH_ATTRIBUTE4}]`
889 )) {
890 if (style.getAttribute(STYLE_HASH_ATTRIBUTE4) === hash) {
891 return true;
892 }
893 }
894 return false;
895 }
896 function injectStyle4(targetDocument, hash, css) {
897 if (!targetDocument.head) {
898 return;
899 }
900 const runtime = getRuntime4();
901 let injectedStyles = runtime.injectedStyles.get(targetDocument);
902 if (!injectedStyles) {
903 injectedStyles = /* @__PURE__ */ new Set();
904 runtime.injectedStyles.set(targetDocument, injectedStyles);
905 }
906 if (injectedStyles.has(hash)) {
907 return;
908 }
909 if (documentContainsStyleHash4(targetDocument, hash)) {
910 injectedStyles.add(hash);
911 return;
912 }
913 const style = targetDocument.createElement("style");
914 style.setAttribute(STYLE_HASH_ATTRIBUTE4, hash);
915 style.appendChild(targetDocument.createTextNode(css));
916 targetDocument.head.appendChild(style);
917 injectedStyles.add(hash);
918 }
919 function registerDocument4(targetDocument) {
920 const runtime = getRuntime4();
921 runtime.documents.set(
922 targetDocument,
923 (runtime.documents.get(targetDocument) ?? 0) + 1
924 );
925 for (const [hash, css] of runtime.styles) {
926 injectStyle4(targetDocument, hash, css);
927 }
928 return () => {
929 const count = runtime.documents.get(targetDocument);
930 if (count === void 0) {
931 return;
932 }
933 if (count <= 1) {
934 runtime.documents.delete(targetDocument);
935 return;
936 }
937 runtime.documents.set(targetDocument, count - 1);
938 };
939 }
940 function registerStyle4(hash, css) {
941 const runtime = getRuntime4();
942 runtime.styles.set(hash, css);
943 for (const targetDocument of runtime.documents.keys()) {
944 injectStyle4(targetDocument, hash, css);
945 }
946 }
947
948 // widgets/hello-dolly/style.module.css
949 if (typeof process === "undefined" || true) {
950 registerStyle4("3bce80a8be", "._0a72644d00175b3d__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)}._27db09cc57742421__quote{font-family:Georgia,Times New Roman,Times,serif;font-style:italic;text-align:center}");
951 }
952 var style_default4 = { "root": "_0a72644d00175b3d__root", "quote": "_27db09cc57742421__quote" };
953
954 // widgets/hello-dolly/render.tsx
955 var import_jsx_runtime = __toESM(require_jsx_runtime());
956 var DOLLY_LYRICS = [
957 "Hello, Dolly",
958 "Well, hello, Dolly",
959 "It's so nice to have you back where you belong",
960 "You're lookin' swell, Dolly",
961 "I can tell, Dolly",
962 "You're still glowin', you're still crowin'",
963 "You're still goin' strong",
964 "I feel the room swayin'",
965 "While the band's playin'",
966 "One of our old favorite songs from way back when",
967 "So, take her wrap, fellas",
968 "Dolly, never go away again",
969 "Hello, Dolly",
970 "Well, hello, Dolly",
971 "It's so nice to have you back where you belong",
972 "You're lookin' swell, Dolly",
973 "I can tell, Dolly",
974 "You're still glowin', you're still crowin'",
975 "You're still goin' strong",
976 "I feel the room swayin'",
977 "While the band's playin'",
978 "One of our old favorite songs from way back when",
979 "So, golly, gee, fellas",
980 "Have a little faith in me, fellas",
981 "Dolly, never go away",
982 "Promise, you'll never go away",
983 "Dolly'll never go away again"
984 ];
985 function HelloDolly() {
986 const quote = (0, import_element4.useMemo)(() => {
987 return DOLLY_LYRICS[Math.floor(Math.random() * DOLLY_LYRICS.length)];
988 }, []);
989 return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Stack, { align: "center", justify: "center", className: style_default4.root, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { variant: "body-xl", render: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {}), className: style_default4.quote, children: [
990 /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(VisuallyHidden, { render: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {}), children: [
991 (0, import_i18n.__)("Quote from Hello Dolly song, by Jerry Herman:"),
992 " "
993 ] }),
994 /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { dir: "ltr", lang: "en", children: quote })
995 ] }) });
996 }
997 export {
998 HelloDolly as default
999 };
1000