| 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 __export = (target, all) => { |
| 11 |
for (var name in all) |
| 12 |
__defProp(target, name, { get: all[name], enumerable: true }); |
| 13 |
}; |
| 14 |
var __copyProps = (to, from, except, desc) => { |
| 15 |
if (from && typeof from === "object" || typeof from === "function") { |
| 16 |
for (let key of __getOwnPropNames(from)) |
| 17 |
if (!__hasOwnProp.call(to, key) && key !== except) |
| 18 |
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); |
| 19 |
} |
| 20 |
return to; |
| 21 |
}; |
| 22 |
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( |
| 23 |
// If the importer is in node compatibility mode or this is not an ESM |
| 24 |
// file that has been converted to a CommonJS file using a Babel- |
| 25 |
// compatible transform (i.e. "__esModule" has not been set), then set |
| 26 |
// "default" to the CommonJS "module.exports" for node compatibility. |
| 27 |
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, |
| 28 |
mod |
| 29 |
)); |
| 30 |
|
| 31 |
// package-external:@wordpress/element |
| 32 |
var require_element = __commonJS({ |
| 33 |
"package-external:@wordpress/element"(exports, module) { |
| 34 |
module.exports = window.wp.element; |
| 35 |
} |
| 36 |
}); |
| 37 |
|
| 38 |
// package-external:@wordpress/data |
| 39 |
var require_data = __commonJS({ |
| 40 |
"package-external:@wordpress/data"(exports, module) { |
| 41 |
module.exports = window.wp.data; |
| 42 |
} |
| 43 |
}); |
| 44 |
|
| 45 |
// package-external:@wordpress/i18n |
| 46 |
var require_i18n = __commonJS({ |
| 47 |
"package-external:@wordpress/i18n"(exports, module) { |
| 48 |
module.exports = window.wp.i18n; |
| 49 |
} |
| 50 |
}); |
| 51 |
|
| 52 |
// package-external:@wordpress/components |
| 53 |
var require_components = __commonJS({ |
| 54 |
"package-external:@wordpress/components"(exports, module) { |
| 55 |
module.exports = window.wp.components; |
| 56 |
} |
| 57 |
}); |
| 58 |
|
| 59 |
// vendor-external:react/jsx-runtime |
| 60 |
var require_jsx_runtime = __commonJS({ |
| 61 |
"vendor-external:react/jsx-runtime"(exports, module) { |
| 62 |
module.exports = window.ReactJSXRuntime; |
| 63 |
} |
| 64 |
}); |
| 65 |
|
| 66 |
// vendor-external:react |
| 67 |
var require_react = __commonJS({ |
| 68 |
"vendor-external:react"(exports, module) { |
| 69 |
module.exports = window.React; |
| 70 |
} |
| 71 |
}); |
| 72 |
|
| 73 |
// package-external:@wordpress/primitives |
| 74 |
var require_primitives = __commonJS({ |
| 75 |
"package-external:@wordpress/primitives"(exports, module) { |
| 76 |
module.exports = window.wp.primitives; |
| 77 |
} |
| 78 |
}); |
| 79 |
|
| 80 |
// package-external:@wordpress/theme |
| 81 |
var require_theme = __commonJS({ |
| 82 |
"package-external:@wordpress/theme"(exports, module) { |
| 83 |
module.exports = window.wp.theme; |
| 84 |
} |
| 85 |
}); |
| 86 |
|
| 87 |
// package-external:@wordpress/private-apis |
| 88 |
var require_private_apis = __commonJS({ |
| 89 |
"package-external:@wordpress/private-apis"(exports, module) { |
| 90 |
module.exports = window.wp.privateApis; |
| 91 |
} |
| 92 |
}); |
| 93 |
|
| 94 |
// package-external:@wordpress/compose |
| 95 |
var require_compose = __commonJS({ |
| 96 |
"package-external:@wordpress/compose"(exports, module) { |
| 97 |
module.exports = window.wp.compose; |
| 98 |
} |
| 99 |
}); |
| 100 |
|
| 101 |
// package-external:@wordpress/core-data |
| 102 |
var require_core_data = __commonJS({ |
| 103 |
"package-external:@wordpress/core-data"(exports, module) { |
| 104 |
module.exports = window.wp.coreData; |
| 105 |
} |
| 106 |
}); |
| 107 |
|
| 108 |
// package-external:@wordpress/notices |
| 109 |
var require_notices = __commonJS({ |
| 110 |
"package-external:@wordpress/notices"(exports, module) { |
| 111 |
module.exports = window.wp.notices; |
| 112 |
} |
| 113 |
}); |
| 114 |
|
| 115 |
// package-external:@wordpress/html-entities |
| 116 |
var require_html_entities = __commonJS({ |
| 117 |
"package-external:@wordpress/html-entities"(exports, module) { |
| 118 |
module.exports = window.wp.htmlEntities; |
| 119 |
} |
| 120 |
}); |
| 121 |
|
| 122 |
// package-external:@wordpress/keycodes |
| 123 |
var require_keycodes = __commonJS({ |
| 124 |
"package-external:@wordpress/keycodes"(exports, module) { |
| 125 |
module.exports = window.wp.keycodes; |
| 126 |
} |
| 127 |
}); |
| 128 |
|
| 129 |
// package-external:@wordpress/commands |
| 130 |
var require_commands = __commonJS({ |
| 131 |
"package-external:@wordpress/commands"(exports, module) { |
| 132 |
module.exports = window.wp.commands; |
| 133 |
} |
| 134 |
}); |
| 135 |
|
| 136 |
// package-external:@wordpress/url |
| 137 |
var require_url = __commonJS({ |
| 138 |
"package-external:@wordpress/url"(exports, module) { |
| 139 |
module.exports = window.wp.url; |
| 140 |
} |
| 141 |
}); |
| 142 |
|
| 143 |
// package-external:@wordpress/editor |
| 144 |
var require_editor = __commonJS({ |
| 145 |
"package-external:@wordpress/editor"(exports, module) { |
| 146 |
module.exports = window.wp.editor; |
| 147 |
} |
| 148 |
}); |
| 149 |
|
| 150 |
// package-external:@wordpress/keyboard-shortcuts |
| 151 |
var require_keyboard_shortcuts = __commonJS({ |
| 152 |
"package-external:@wordpress/keyboard-shortcuts"(exports, module) { |
| 153 |
module.exports = window.wp.keyboardShortcuts; |
| 154 |
} |
| 155 |
}); |
| 156 |
|
| 157 |
// packages/boot/build-module/components/app/index.mjs |
| 158 |
var import_element16 = __toESM(require_element(), 1); |
| 159 |
var import_data11 = __toESM(require_data(), 1); |
| 160 |
|
| 161 |
// packages/boot/build-module/components/app/router.mjs |
| 162 |
var import_i18n11 = __toESM(require_i18n(), 1); |
| 163 |
var import_element15 = __toESM(require_element(), 1); |
| 164 |
|
| 165 |
// node_modules/clsx/dist/clsx.mjs |
| 166 |
function r(e) { |
| 167 |
var t, f, n = ""; |
| 168 |
if ("string" == typeof e || "number" == typeof e) n += e; |
| 169 |
else if ("object" == typeof e) if (Array.isArray(e)) { |
| 170 |
var o = e.length; |
| 171 |
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f); |
| 172 |
} else for (f in e) e[f] && (n && (n += " "), n += f); |
| 173 |
return n; |
| 174 |
} |
| 175 |
function clsx() { |
| 176 |
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t); |
| 177 |
return n; |
| 178 |
} |
| 179 |
var clsx_default = clsx; |
| 180 |
|
| 181 |
// packages/admin-ui/build-module/navigable-region/index.mjs |
| 182 |
var import_element = __toESM(require_element(), 1); |
| 183 |
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); |
| 184 |
var NavigableRegion = (0, import_element.forwardRef)( |
| 185 |
({ children, className, ariaLabel, as: Tag = "div", ...props }, ref) => { |
| 186 |
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( |
| 187 |
Tag, |
| 188 |
{ |
| 189 |
ref, |
| 190 |
className: clsx_default("admin-ui-navigable-region", className), |
| 191 |
"aria-label": ariaLabel, |
| 192 |
role: "region", |
| 193 |
tabIndex: "-1", |
| 194 |
...props, |
| 195 |
children |
| 196 |
} |
| 197 |
); |
| 198 |
} |
| 199 |
); |
| 200 |
NavigableRegion.displayName = "NavigableRegion"; |
| 201 |
var navigable_region_default = NavigableRegion; |
| 202 |
|
| 203 |
// node_modules/@base-ui/utils/esm/useRefWithInit.js |
| 204 |
var React = __toESM(require_react(), 1); |
| 205 |
var UNINITIALIZED = {}; |
| 206 |
function useRefWithInit(init2, initArg) { |
| 207 |
const ref = React.useRef(UNINITIALIZED); |
| 208 |
if (ref.current === UNINITIALIZED) { |
| 209 |
ref.current = init2(initArg); |
| 210 |
} |
| 211 |
return ref; |
| 212 |
} |
| 213 |
|
| 214 |
// node_modules/@base-ui/utils/esm/warn.js |
| 215 |
var set; |
| 216 |
if (true) { |
| 217 |
set = /* @__PURE__ */ new Set(); |
| 218 |
} |
| 219 |
function warn(...messages) { |
| 220 |
if (true) { |
| 221 |
const messageKey = messages.join(" "); |
| 222 |
if (!set.has(messageKey)) { |
| 223 |
set.add(messageKey); |
| 224 |
console.warn(`Base UI: ${messageKey}`); |
| 225 |
} |
| 226 |
} |
| 227 |
} |
| 228 |
|
| 229 |
// node_modules/@base-ui/react/esm/utils/useRenderElement.js |
| 230 |
var React4 = __toESM(require_react(), 1); |
| 231 |
|
| 232 |
// node_modules/@base-ui/utils/esm/useMergedRefs.js |
| 233 |
function useMergedRefs(a, b, c, d) { |
| 234 |
const forkRef = useRefWithInit(createForkRef).current; |
| 235 |
if (didChange(forkRef, a, b, c, d)) { |
| 236 |
update(forkRef, [a, b, c, d]); |
| 237 |
} |
| 238 |
return forkRef.callback; |
| 239 |
} |
| 240 |
function useMergedRefsN(refs) { |
| 241 |
const forkRef = useRefWithInit(createForkRef).current; |
| 242 |
if (didChangeN(forkRef, refs)) { |
| 243 |
update(forkRef, refs); |
| 244 |
} |
| 245 |
return forkRef.callback; |
| 246 |
} |
| 247 |
function createForkRef() { |
| 248 |
return { |
| 249 |
callback: null, |
| 250 |
cleanup: null, |
| 251 |
refs: [] |
| 252 |
}; |
| 253 |
} |
| 254 |
function didChange(forkRef, a, b, c, d) { |
| 255 |
return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d; |
| 256 |
} |
| 257 |
function didChangeN(forkRef, newRefs) { |
| 258 |
return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]); |
| 259 |
} |
| 260 |
function update(forkRef, refs) { |
| 261 |
forkRef.refs = refs; |
| 262 |
if (refs.every((ref) => ref == null)) { |
| 263 |
forkRef.callback = null; |
| 264 |
return; |
| 265 |
} |
| 266 |
forkRef.callback = (instance) => { |
| 267 |
if (forkRef.cleanup) { |
| 268 |
forkRef.cleanup(); |
| 269 |
forkRef.cleanup = null; |
| 270 |
} |
| 271 |
if (instance != null) { |
| 272 |
const cleanupCallbacks = Array(refs.length).fill(null); |
| 273 |
for (let i = 0; i < refs.length; i += 1) { |
| 274 |
const ref = refs[i]; |
| 275 |
if (ref == null) { |
| 276 |
continue; |
| 277 |
} |
| 278 |
switch (typeof ref) { |
| 279 |
case "function": { |
| 280 |
const refCleanup = ref(instance); |
| 281 |
if (typeof refCleanup === "function") { |
| 282 |
cleanupCallbacks[i] = refCleanup; |
| 283 |
} |
| 284 |
break; |
| 285 |
} |
| 286 |
case "object": { |
| 287 |
ref.current = instance; |
| 288 |
break; |
| 289 |
} |
| 290 |
default: |
| 291 |
} |
| 292 |
} |
| 293 |
forkRef.cleanup = () => { |
| 294 |
for (let i = 0; i < refs.length; i += 1) { |
| 295 |
const ref = refs[i]; |
| 296 |
if (ref == null) { |
| 297 |
continue; |
| 298 |
} |
| 299 |
switch (typeof ref) { |
| 300 |
case "function": { |
| 301 |
const cleanupCallback = cleanupCallbacks[i]; |
| 302 |
if (typeof cleanupCallback === "function") { |
| 303 |
cleanupCallback(); |
| 304 |
} else { |
| 305 |
ref(null); |
| 306 |
} |
| 307 |
break; |
| 308 |
} |
| 309 |
case "object": { |
| 310 |
ref.current = null; |
| 311 |
break; |
| 312 |
} |
| 313 |
default: |
| 314 |
} |
| 315 |
} |
| 316 |
}; |
| 317 |
} |
| 318 |
}; |
| 319 |
} |
| 320 |
|
| 321 |
// node_modules/@base-ui/utils/esm/getReactElementRef.js |
| 322 |
var React3 = __toESM(require_react(), 1); |
| 323 |
|
| 324 |
// node_modules/@base-ui/utils/esm/reactVersion.js |
| 325 |
var React2 = __toESM(require_react(), 1); |
| 326 |
var majorVersion = parseInt(React2.version, 10); |
| 327 |
function isReactVersionAtLeast(reactVersionToCheck) { |
| 328 |
return majorVersion >= reactVersionToCheck; |
| 329 |
} |
| 330 |
|
| 331 |
// node_modules/@base-ui/utils/esm/getReactElementRef.js |
| 332 |
function getReactElementRef(element) { |
| 333 |
if (!/* @__PURE__ */ React3.isValidElement(element)) { |
| 334 |
return null; |
| 335 |
} |
| 336 |
const reactElement = element; |
| 337 |
const propsWithRef = reactElement.props; |
| 338 |
return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null; |
| 339 |
} |
| 340 |
|
| 341 |
// node_modules/@base-ui/utils/esm/mergeObjects.js |
| 342 |
function mergeObjects(a, b) { |
| 343 |
if (a && !b) { |
| 344 |
return a; |
| 345 |
} |
| 346 |
if (!a && b) { |
| 347 |
return b; |
| 348 |
} |
| 349 |
if (a || b) { |
| 350 |
return { |
| 351 |
...a, |
| 352 |
...b |
| 353 |
}; |
| 354 |
} |
| 355 |
return void 0; |
| 356 |
} |
| 357 |
|
| 358 |
// node_modules/@base-ui/react/esm/utils/getStateAttributesProps.js |
| 359 |
function getStateAttributesProps(state, customMapping) { |
| 360 |
const props = {}; |
| 361 |
for (const key in state) { |
| 362 |
const value = state[key]; |
| 363 |
if (customMapping?.hasOwnProperty(key)) { |
| 364 |
const customProps = customMapping[key](value); |
| 365 |
if (customProps != null) { |
| 366 |
Object.assign(props, customProps); |
| 367 |
} |
| 368 |
continue; |
| 369 |
} |
| 370 |
if (value === true) { |
| 371 |
props[`data-${key.toLowerCase()}`] = ""; |
| 372 |
} else if (value) { |
| 373 |
props[`data-${key.toLowerCase()}`] = value.toString(); |
| 374 |
} |
| 375 |
} |
| 376 |
return props; |
| 377 |
} |
| 378 |
|
| 379 |
// node_modules/@base-ui/react/esm/utils/resolveClassName.js |
| 380 |
function resolveClassName(className, state) { |
| 381 |
return typeof className === "function" ? className(state) : className; |
| 382 |
} |
| 383 |
|
| 384 |
// node_modules/@base-ui/react/esm/utils/resolveStyle.js |
| 385 |
function resolveStyle(style, state) { |
| 386 |
return typeof style === "function" ? style(state) : style; |
| 387 |
} |
| 388 |
|
| 389 |
// node_modules/@base-ui/react/esm/merge-props/mergeProps.js |
| 390 |
var EMPTY_PROPS = {}; |
| 391 |
function mergeProps(a, b, c, d, e) { |
| 392 |
let merged = { |
| 393 |
...resolvePropsGetter(a, EMPTY_PROPS) |
| 394 |
}; |
| 395 |
if (b) { |
| 396 |
merged = mergeOne(merged, b); |
| 397 |
} |
| 398 |
if (c) { |
| 399 |
merged = mergeOne(merged, c); |
| 400 |
} |
| 401 |
if (d) { |
| 402 |
merged = mergeOne(merged, d); |
| 403 |
} |
| 404 |
if (e) { |
| 405 |
merged = mergeOne(merged, e); |
| 406 |
} |
| 407 |
return merged; |
| 408 |
} |
| 409 |
function mergePropsN(props) { |
| 410 |
if (props.length === 0) { |
| 411 |
return EMPTY_PROPS; |
| 412 |
} |
| 413 |
if (props.length === 1) { |
| 414 |
return resolvePropsGetter(props[0], EMPTY_PROPS); |
| 415 |
} |
| 416 |
let merged = { |
| 417 |
...resolvePropsGetter(props[0], EMPTY_PROPS) |
| 418 |
}; |
| 419 |
for (let i = 1; i < props.length; i += 1) { |
| 420 |
merged = mergeOne(merged, props[i]); |
| 421 |
} |
| 422 |
return merged; |
| 423 |
} |
| 424 |
function mergeOne(merged, inputProps) { |
| 425 |
if (isPropsGetter(inputProps)) { |
| 426 |
return inputProps(merged); |
| 427 |
} |
| 428 |
return mutablyMergeInto(merged, inputProps); |
| 429 |
} |
| 430 |
function mutablyMergeInto(mergedProps, externalProps) { |
| 431 |
if (!externalProps) { |
| 432 |
return mergedProps; |
| 433 |
} |
| 434 |
for (const propName in externalProps) { |
| 435 |
const externalPropValue = externalProps[propName]; |
| 436 |
switch (propName) { |
| 437 |
case "style": { |
| 438 |
mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue); |
| 439 |
break; |
| 440 |
} |
| 441 |
case "className": { |
| 442 |
mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue); |
| 443 |
break; |
| 444 |
} |
| 445 |
default: { |
| 446 |
if (isEventHandler(propName, externalPropValue)) { |
| 447 |
mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue); |
| 448 |
} else { |
| 449 |
mergedProps[propName] = externalPropValue; |
| 450 |
} |
| 451 |
} |
| 452 |
} |
| 453 |
} |
| 454 |
return mergedProps; |
| 455 |
} |
| 456 |
function isEventHandler(key, value) { |
| 457 |
const code0 = key.charCodeAt(0); |
| 458 |
const code1 = key.charCodeAt(1); |
| 459 |
const code2 = key.charCodeAt(2); |
| 460 |
return code0 === 111 && code1 === 110 && code2 >= 65 && code2 <= 90 && (typeof value === "function" || typeof value === "undefined"); |
| 461 |
} |
| 462 |
function isPropsGetter(inputProps) { |
| 463 |
return typeof inputProps === "function"; |
| 464 |
} |
| 465 |
function resolvePropsGetter(inputProps, previousProps) { |
| 466 |
if (isPropsGetter(inputProps)) { |
| 467 |
return inputProps(previousProps); |
| 468 |
} |
| 469 |
return inputProps ?? EMPTY_PROPS; |
| 470 |
} |
| 471 |
function mergeEventHandlers(ourHandler, theirHandler) { |
| 472 |
if (!theirHandler) { |
| 473 |
return ourHandler; |
| 474 |
} |
| 475 |
if (!ourHandler) { |
| 476 |
return theirHandler; |
| 477 |
} |
| 478 |
return (event) => { |
| 479 |
if (isSyntheticEvent(event)) { |
| 480 |
const baseUIEvent = event; |
| 481 |
makeEventPreventable(baseUIEvent); |
| 482 |
const result2 = theirHandler(baseUIEvent); |
| 483 |
if (!baseUIEvent.baseUIHandlerPrevented) { |
| 484 |
ourHandler?.(baseUIEvent); |
| 485 |
} |
| 486 |
return result2; |
| 487 |
} |
| 488 |
const result = theirHandler(event); |
| 489 |
ourHandler?.(event); |
| 490 |
return result; |
| 491 |
}; |
| 492 |
} |
| 493 |
function makeEventPreventable(event) { |
| 494 |
event.preventBaseUIHandler = () => { |
| 495 |
event.baseUIHandlerPrevented = true; |
| 496 |
}; |
| 497 |
return event; |
| 498 |
} |
| 499 |
function mergeClassNames(ourClassName, theirClassName) { |
| 500 |
if (theirClassName) { |
| 501 |
if (ourClassName) { |
| 502 |
return theirClassName + " " + ourClassName; |
| 503 |
} |
| 504 |
return theirClassName; |
| 505 |
} |
| 506 |
return ourClassName; |
| 507 |
} |
| 508 |
function isSyntheticEvent(event) { |
| 509 |
return event != null && typeof event === "object" && "nativeEvent" in event; |
| 510 |
} |
| 511 |
|
| 512 |
// node_modules/@base-ui/utils/esm/empty.js |
| 513 |
var EMPTY_ARRAY = Object.freeze([]); |
| 514 |
var EMPTY_OBJECT = Object.freeze({}); |
| 515 |
|
| 516 |
// node_modules/@base-ui/react/esm/utils/constants.js |
| 517 |
var BASE_UI_SWIPE_IGNORE_ATTRIBUTE = "data-base-ui-swipe-ignore"; |
| 518 |
var LEGACY_SWIPE_IGNORE_ATTRIBUTE = "data-swipe-ignore"; |
| 519 |
var BASE_UI_SWIPE_IGNORE_SELECTOR = `[${BASE_UI_SWIPE_IGNORE_ATTRIBUTE}]`; |
| 520 |
var LEGACY_SWIPE_IGNORE_SELECTOR = `[${LEGACY_SWIPE_IGNORE_ATTRIBUTE}]`; |
| 521 |
|
| 522 |
// node_modules/@base-ui/react/esm/utils/useRenderElement.js |
| 523 |
var import_react = __toESM(require_react(), 1); |
| 524 |
function useRenderElement(element, componentProps, params = {}) { |
| 525 |
const renderProp = componentProps.render; |
| 526 |
const outProps = useRenderElementProps(componentProps, params); |
| 527 |
if (params.enabled === false) { |
| 528 |
return null; |
| 529 |
} |
| 530 |
const state = params.state ?? EMPTY_OBJECT; |
| 531 |
return evaluateRenderProp(element, renderProp, outProps, state); |
| 532 |
} |
| 533 |
function useRenderElementProps(componentProps, params = {}) { |
| 534 |
const { |
| 535 |
className: classNameProp, |
| 536 |
style: styleProp, |
| 537 |
render: renderProp |
| 538 |
} = componentProps; |
| 539 |
const { |
| 540 |
state = EMPTY_OBJECT, |
| 541 |
ref, |
| 542 |
props, |
| 543 |
stateAttributesMapping, |
| 544 |
enabled = true |
| 545 |
} = params; |
| 546 |
const className = enabled ? resolveClassName(classNameProp, state) : void 0; |
| 547 |
const style = enabled ? resolveStyle(styleProp, state) : void 0; |
| 548 |
const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping) : EMPTY_OBJECT; |
| 549 |
const outProps = enabled ? mergeObjects(stateProps, Array.isArray(props) ? mergePropsN(props) : props) ?? EMPTY_OBJECT : EMPTY_OBJECT; |
| 550 |
if (typeof document !== "undefined") { |
| 551 |
if (!enabled) { |
| 552 |
useMergedRefs(null, null); |
| 553 |
} else if (Array.isArray(ref)) { |
| 554 |
outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]); |
| 555 |
} else { |
| 556 |
outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref); |
| 557 |
} |
| 558 |
} |
| 559 |
if (!enabled) { |
| 560 |
return EMPTY_OBJECT; |
| 561 |
} |
| 562 |
if (className !== void 0) { |
| 563 |
outProps.className = mergeClassNames(outProps.className, className); |
| 564 |
} |
| 565 |
if (style !== void 0) { |
| 566 |
outProps.style = mergeObjects(outProps.style, style); |
| 567 |
} |
| 568 |
return outProps; |
| 569 |
} |
| 570 |
var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"); |
| 571 |
function evaluateRenderProp(element, render, props, state) { |
| 572 |
if (render) { |
| 573 |
if (typeof render === "function") { |
| 574 |
if (true) { |
| 575 |
warnIfRenderPropLooksLikeComponent(render); |
| 576 |
} |
| 577 |
return render(props, state); |
| 578 |
} |
| 579 |
const mergedProps = mergeProps(props, render.props); |
| 580 |
mergedProps.ref = props.ref; |
| 581 |
let newElement = render; |
| 582 |
if (newElement?.$$typeof === REACT_LAZY_TYPE) { |
| 583 |
const children = React4.Children.toArray(render); |
| 584 |
newElement = children[0]; |
| 585 |
} |
| 586 |
if (true) { |
| 587 |
if (!/* @__PURE__ */ React4.isValidElement(newElement)) { |
| 588 |
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")); |
| 589 |
} |
| 590 |
} |
| 591 |
return /* @__PURE__ */ React4.cloneElement(newElement, mergedProps); |
| 592 |
} |
| 593 |
if (element) { |
| 594 |
if (typeof element === "string") { |
| 595 |
return renderTag(element, props); |
| 596 |
} |
| 597 |
} |
| 598 |
throw new Error(true ? "Base UI: Render element or function are not defined." : formatErrorMessage_default(8)); |
| 599 |
} |
| 600 |
function warnIfRenderPropLooksLikeComponent(renderFn) { |
| 601 |
const functionName = renderFn.name; |
| 602 |
if (functionName.length === 0) { |
| 603 |
return; |
| 604 |
} |
| 605 |
const firstCharacterCode = functionName.charCodeAt(0); |
| 606 |
if (firstCharacterCode < 65 || firstCharacterCode > 90) { |
| 607 |
return; |
| 608 |
} |
| 609 |
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"); |
| 610 |
} |
| 611 |
function renderTag(Tag, props) { |
| 612 |
if (Tag === "button") { |
| 613 |
return /* @__PURE__ */ (0, import_react.createElement)("button", { |
| 614 |
type: "button", |
| 615 |
...props, |
| 616 |
key: props.key |
| 617 |
}); |
| 618 |
} |
| 619 |
if (Tag === "img") { |
| 620 |
return /* @__PURE__ */ (0, import_react.createElement)("img", { |
| 621 |
alt: "", |
| 622 |
...props, |
| 623 |
key: props.key |
| 624 |
}); |
| 625 |
} |
| 626 |
return /* @__PURE__ */ React4.createElement(Tag, props); |
| 627 |
} |
| 628 |
|
| 629 |
// node_modules/@base-ui/react/esm/use-render/useRender.js |
| 630 |
function useRender(params) { |
| 631 |
return useRenderElement(params.defaultTagName ?? "div", params, params); |
| 632 |
} |
| 633 |
|
| 634 |
// packages/icons/build-module/icon/index.mjs |
| 635 |
var import_element2 = __toESM(require_element(), 1); |
| 636 |
var icon_default = (0, import_element2.forwardRef)( |
| 637 |
({ icon, size = 24, ...props }, ref) => { |
| 638 |
return (0, import_element2.cloneElement)(icon, { |
| 639 |
width: size, |
| 640 |
height: size, |
| 641 |
...props, |
| 642 |
ref |
| 643 |
}); |
| 644 |
} |
| 645 |
); |
| 646 |
|
| 647 |
// packages/icons/build-module/library/arrow-up-left.mjs |
| 648 |
var import_primitives = __toESM(require_primitives(), 1); |
| 649 |
var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); |
| 650 |
var arrow_up_left_default = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives.Path, { d: "M14 6H6v8h1.5V8.5L17 18l1-1-9.5-9.5H14V6Z" }) }); |
| 651 |
|
| 652 |
// packages/icons/build-module/library/check.mjs |
| 653 |
var import_primitives2 = __toESM(require_primitives(), 1); |
| 654 |
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1); |
| 655 |
var check_default = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives2.Path, { d: "M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z" }) }); |
| 656 |
|
| 657 |
// packages/icons/build-module/library/chevron-down-small.mjs |
| 658 |
var import_primitives3 = __toESM(require_primitives(), 1); |
| 659 |
var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1); |
| 660 |
var chevron_down_small_default = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives3.Path, { d: "m15.99 10.889-3.988 3.418-3.988-3.418.976-1.14 3.012 2.582 3.012-2.581.976 1.139Z" }) }); |
| 661 |
|
| 662 |
// packages/icons/build-module/library/chevron-left-small.mjs |
| 663 |
var import_primitives4 = __toESM(require_primitives(), 1); |
| 664 |
var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1); |
| 665 |
var chevron_left_small_default = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives4.Path, { d: "m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z" }) }); |
| 666 |
|
| 667 |
// packages/icons/build-module/library/chevron-left.mjs |
| 668 |
var import_primitives5 = __toESM(require_primitives(), 1); |
| 669 |
var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1); |
| 670 |
var chevron_left_default = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives5.Path, { d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" }) }); |
| 671 |
|
| 672 |
// packages/icons/build-module/library/chevron-right-small.mjs |
| 673 |
var import_primitives6 = __toESM(require_primitives(), 1); |
| 674 |
var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1); |
| 675 |
var chevron_right_small_default = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives6.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives6.Path, { d: "M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z" }) }); |
| 676 |
|
| 677 |
// packages/icons/build-module/library/chevron-right.mjs |
| 678 |
var import_primitives7 = __toESM(require_primitives(), 1); |
| 679 |
var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1); |
| 680 |
var chevron_right_default = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives7.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives7.Path, { d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" }) }); |
| 681 |
|
| 682 |
// packages/icons/build-module/library/menu.mjs |
| 683 |
var import_primitives8 = __toESM(require_primitives(), 1); |
| 684 |
var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1); |
| 685 |
var menu_default = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives8.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives8.Path, { d: "M5 5v1.5h14V5H5zm0 7.8h14v-1.5H5v1.5zM5 19h14v-1.5H5V19z" }) }); |
| 686 |
|
| 687 |
// packages/icons/build-module/library/search.mjs |
| 688 |
var import_primitives9 = __toESM(require_primitives(), 1); |
| 689 |
var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1); |
| 690 |
var search_default = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives9.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives9.Path, { d: "M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z" }) }); |
| 691 |
|
| 692 |
// packages/icons/build-module/library/wordpress.mjs |
| 693 |
var import_primitives10 = __toESM(require_primitives(), 1); |
| 694 |
var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1); |
| 695 |
var wordpress_default = /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives10.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "-2 -2 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives10.Path, { d: "M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z" }) }); |
| 696 |
|
| 697 |
// packages/ui/build-module/stack/stack.mjs |
| 698 |
var import_element3 = __toESM(require_element(), 1); |
| 699 |
if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='b51ff41489']")) { |
| 700 |
const style = document.createElement("style"); |
| 701 |
style.setAttribute("data-wp-hash", "b51ff41489"); |
| 702 |
style.appendChild(document.createTextNode("@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._19ce0419607e1896__stack{display:flex}}")); |
| 703 |
document.head.appendChild(style); |
| 704 |
} |
| 705 |
var style_default = { "stack": "_19ce0419607e1896__stack" }; |
| 706 |
var gapTokens = { |
| 707 |
xs: "var(--wpds-dimension-gap-xs, 4px)", |
| 708 |
sm: "var(--wpds-dimension-gap-sm, 8px)", |
| 709 |
md: "var(--wpds-dimension-gap-md, 12px)", |
| 710 |
lg: "var(--wpds-dimension-gap-lg, 16px)", |
| 711 |
xl: "var(--wpds-dimension-gap-xl, 24px)", |
| 712 |
"2xl": "var(--wpds-dimension-gap-2xl, 32px)", |
| 713 |
"3xl": "var(--wpds-dimension-gap-3xl, 40px)" |
| 714 |
}; |
| 715 |
var Stack = (0, import_element3.forwardRef)(function Stack2({ direction, gap, align, justify, wrap, render, ...props }, ref) { |
| 716 |
const style = { |
| 717 |
gap: gap && gapTokens[gap], |
| 718 |
alignItems: align, |
| 719 |
justifyContent: justify, |
| 720 |
flexDirection: direction, |
| 721 |
flexWrap: wrap |
| 722 |
}; |
| 723 |
const element = useRender({ |
| 724 |
render, |
| 725 |
ref, |
| 726 |
props: mergeProps(props, { style, className: style_default.stack }) |
| 727 |
}); |
| 728 |
return element; |
| 729 |
}); |
| 730 |
|
| 731 |
// packages/admin-ui/build-module/page/sidebar-toggle-slot.mjs |
| 732 |
var import_components = __toESM(require_components(), 1); |
| 733 |
var { Fill: SidebarToggleFill, Slot: SidebarToggleSlot } = (0, import_components.createSlotFill)("SidebarToggle"); |
| 734 |
|
| 735 |
// packages/admin-ui/build-module/page/header.mjs |
| 736 |
var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1); |
| 737 |
function Header({ |
| 738 |
headingLevel = 2, |
| 739 |
breadcrumbs, |
| 740 |
badges, |
| 741 |
title, |
| 742 |
subTitle, |
| 743 |
actions, |
| 744 |
showSidebarToggle = true |
| 745 |
}) { |
| 746 |
const HeadingTag = `h${headingLevel}`; |
| 747 |
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)( |
| 748 |
Stack, |
| 749 |
{ |
| 750 |
direction: "column", |
| 751 |
className: "admin-ui-page__header", |
| 752 |
render: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("header", {}), |
| 753 |
children: [ |
| 754 |
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Stack, { direction: "row", justify: "space-between", gap: "sm", children: [ |
| 755 |
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Stack, { direction: "row", gap: "sm", align: "center", justify: "start", children: [ |
| 756 |
showSidebarToggle && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)( |
| 757 |
SidebarToggleSlot, |
| 758 |
{ |
| 759 |
bubblesVirtually: true, |
| 760 |
className: "admin-ui-page__sidebar-toggle-slot" |
| 761 |
} |
| 762 |
), |
| 763 |
title && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(HeadingTag, { className: "admin-ui-page__header-title", children: title }), |
| 764 |
breadcrumbs, |
| 765 |
badges |
| 766 |
] }), |
| 767 |
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)( |
| 768 |
Stack, |
| 769 |
{ |
| 770 |
direction: "row", |
| 771 |
gap: "sm", |
| 772 |
style: { width: "auto", flexShrink: 0 }, |
| 773 |
className: "admin-ui-page__header-actions", |
| 774 |
align: "center", |
| 775 |
children: actions |
| 776 |
} |
| 777 |
) |
| 778 |
] }), |
| 779 |
subTitle && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "admin-ui-page__header-subtitle", children: subTitle }) |
| 780 |
] |
| 781 |
} |
| 782 |
); |
| 783 |
} |
| 784 |
|
| 785 |
// packages/admin-ui/build-module/page/index.mjs |
| 786 |
var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1); |
| 787 |
function Page({ |
| 788 |
headingLevel, |
| 789 |
breadcrumbs, |
| 790 |
badges, |
| 791 |
title, |
| 792 |
subTitle, |
| 793 |
children, |
| 794 |
className, |
| 795 |
actions, |
| 796 |
ariaLabel, |
| 797 |
hasPadding = false, |
| 798 |
showSidebarToggle = true |
| 799 |
}) { |
| 800 |
const classes = clsx_default("admin-ui-page", className); |
| 801 |
const effectiveAriaLabel = ariaLabel ?? (typeof title === "string" ? title : ""); |
| 802 |
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(navigable_region_default, { className: classes, ariaLabel: effectiveAriaLabel, children: [ |
| 803 |
(title || breadcrumbs || badges || actions) && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)( |
| 804 |
Header, |
| 805 |
{ |
| 806 |
headingLevel, |
| 807 |
breadcrumbs, |
| 808 |
badges, |
| 809 |
title, |
| 810 |
subTitle, |
| 811 |
actions, |
| 812 |
showSidebarToggle |
| 813 |
} |
| 814 |
), |
| 815 |
hasPadding ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "admin-ui-page__content has-padding", children }) : children |
| 816 |
] }); |
| 817 |
} |
| 818 |
Page.SidebarToggleFill = SidebarToggleFill; |
| 819 |
var page_default = Page; |
| 820 |
|
| 821 |
// packages/boot/build-module/components/app/router.mjs |
| 822 |
var import_data10 = __toESM(require_data(), 1); |
| 823 |
var import_core_data6 = __toESM(require_core_data(), 1); |
| 824 |
import { |
| 825 |
privateApis as routePrivateApis6 |
| 826 |
} from "@wordpress/route"; |
| 827 |
|
| 828 |
// packages/boot/build-module/components/root/index.mjs |
| 829 |
var import_notices = __toESM(require_notices(), 1); |
| 830 |
var import_compose4 = __toESM(require_compose(), 1); |
| 831 |
var import_components14 = __toESM(require_components(), 1); |
| 832 |
import { privateApis as routePrivateApis5 } from "@wordpress/route"; |
| 833 |
var import_element14 = __toESM(require_element(), 1); |
| 834 |
var import_i18n10 = __toESM(require_i18n(), 1); |
| 835 |
|
| 836 |
// packages/boot/build-module/components/site-hub/index.mjs |
| 837 |
var import_data3 = __toESM(require_data(), 1); |
| 838 |
var import_components3 = __toESM(require_components(), 1); |
| 839 |
var import_i18n2 = __toESM(require_i18n(), 1); |
| 840 |
var import_core_data2 = __toESM(require_core_data(), 1); |
| 841 |
var import_html_entities = __toESM(require_html_entities(), 1); |
| 842 |
var import_keycodes = __toESM(require_keycodes(), 1); |
| 843 |
var import_commands = __toESM(require_commands(), 1); |
| 844 |
var import_url = __toESM(require_url(), 1); |
| 845 |
|
| 846 |
// packages/boot/build-module/components/site-icon-link/index.mjs |
| 847 |
var import_components2 = __toESM(require_components(), 1); |
| 848 |
import { Link, privateApis as routePrivateApis } from "@wordpress/route"; |
| 849 |
|
| 850 |
// packages/boot/build-module/lock-unlock.mjs |
| 851 |
var import_private_apis = __toESM(require_private_apis(), 1); |
| 852 |
var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)( |
| 853 |
"I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.", |
| 854 |
"@wordpress/boot" |
| 855 |
); |
| 856 |
|
| 857 |
// packages/boot/build-module/components/site-icon/index.mjs |
| 858 |
var import_data = __toESM(require_data(), 1); |
| 859 |
var import_i18n = __toESM(require_i18n(), 1); |
| 860 |
var import_core_data = __toESM(require_core_data(), 1); |
| 861 |
var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1); |
| 862 |
if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='3ada0e3b8a']")) { |
| 863 |
const style = document.createElement("style"); |
| 864 |
style.setAttribute("data-wp-hash", "3ada0e3b8a"); |
| 865 |
style.appendChild(document.createTextNode(".boot-site-icon{display:flex}.boot-site-icon__icon{fill:var(--wpds-color-fg-content-neutral,#1e1e1e);height:32px;width:32px}.boot-site-icon__image{aspect-ratio:1/1;border-radius:var(--wpds-border-radius-md,4px);height:32px;object-fit:cover;width:32px}")); |
| 866 |
document.head.appendChild(style); |
| 867 |
} |
| 868 |
function SiteIcon({ className }) { |
| 869 |
const { isRequestingSite, siteIconUrl } = (0, import_data.useSelect)((select) => { |
| 870 |
const { getEntityRecord } = select(import_core_data.store); |
| 871 |
const siteData = getEntityRecord( |
| 872 |
"root", |
| 873 |
"__unstableBase", |
| 874 |
void 0 |
| 875 |
); |
| 876 |
return { |
| 877 |
isRequestingSite: !siteData, |
| 878 |
siteIconUrl: siteData?.site_icon_url |
| 879 |
}; |
| 880 |
}, []); |
| 881 |
let icon = null; |
| 882 |
if (isRequestingSite && !siteIconUrl) { |
| 883 |
icon = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "boot-site-icon__image" }); |
| 884 |
} else { |
| 885 |
icon = siteIconUrl ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)( |
| 886 |
"img", |
| 887 |
{ |
| 888 |
className: "boot-site-icon__image", |
| 889 |
alt: (0, import_i18n.__)("Site Icon"), |
| 890 |
src: siteIconUrl |
| 891 |
} |
| 892 |
) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)( |
| 893 |
icon_default, |
| 894 |
{ |
| 895 |
className: "boot-site-icon__icon", |
| 896 |
icon: wordpress_default, |
| 897 |
size: 48 |
| 898 |
} |
| 899 |
); |
| 900 |
} |
| 901 |
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: clsx_default(className, "boot-site-icon"), children: icon }); |
| 902 |
} |
| 903 |
var site_icon_default = SiteIcon; |
| 904 |
|
| 905 |
// packages/boot/build-module/components/site-icon-link/index.mjs |
| 906 |
var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1); |
| 907 |
if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='7697c18deb']")) { |
| 908 |
const style = document.createElement("style"); |
| 909 |
style.setAttribute("data-wp-hash", "7697c18deb"); |
| 910 |
style.appendChild(document.createTextNode(".boot-site-icon-link{align-items:center;background:var(--wpds-color-bg-surface-neutral-weak,#f0f0f0);display:inline-flex;height:64px;justify-content:center;text-decoration:none;width:64px}@media not (prefers-reduced-motion){.boot-site-icon-link{transition:outline .1s ease-out}}.boot-site-icon-link:focus:not(:active){outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));outline-offset:calc(var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px))*-1)}")); |
| 911 |
document.head.appendChild(style); |
| 912 |
} |
| 913 |
var { useCanGoBack, useRouter } = unlock(routePrivateApis); |
| 914 |
function SiteIconLink({ |
| 915 |
to, |
| 916 |
isBackButton, |
| 917 |
...props |
| 918 |
}) { |
| 919 |
const router = useRouter(); |
| 920 |
const canGoBack = useCanGoBack(); |
| 921 |
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_components2.Tooltip, { text: props["aria-label"], placement: "right", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)( |
| 922 |
Link, |
| 923 |
{ |
| 924 |
to, |
| 925 |
"aria-label": props["aria-label"], |
| 926 |
className: "boot-site-icon-link", |
| 927 |
onClick: (event) => { |
| 928 |
if (canGoBack && isBackButton) { |
| 929 |
event.preventDefault(); |
| 930 |
router.history.back(); |
| 931 |
} |
| 932 |
}, |
| 933 |
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(site_icon_default, {}) |
| 934 |
} |
| 935 |
) }); |
| 936 |
} |
| 937 |
var site_icon_link_default = SiteIconLink; |
| 938 |
|
| 939 |
// packages/boot/build-module/store/index.mjs |
| 940 |
var import_data2 = __toESM(require_data(), 1); |
| 941 |
|
| 942 |
// packages/boot/build-module/store/reducer.mjs |
| 943 |
var initialState = { |
| 944 |
menuItems: {}, |
| 945 |
routes: [], |
| 946 |
dashboardLink: void 0 |
| 947 |
}; |
| 948 |
function reducer(state = initialState, action) { |
| 949 |
switch (action.type) { |
| 950 |
case "REGISTER_MENU_ITEM": |
| 951 |
return { |
| 952 |
...state, |
| 953 |
menuItems: { |
| 954 |
...state.menuItems, |
| 955 |
[action.id]: action.menuItem |
| 956 |
} |
| 957 |
}; |
| 958 |
case "UPDATE_MENU_ITEM": |
| 959 |
return { |
| 960 |
...state, |
| 961 |
menuItems: { |
| 962 |
...state.menuItems, |
| 963 |
[action.id]: { |
| 964 |
...state.menuItems[action.id], |
| 965 |
...action.updates |
| 966 |
} |
| 967 |
} |
| 968 |
}; |
| 969 |
case "REGISTER_ROUTE": |
| 970 |
return { |
| 971 |
...state, |
| 972 |
routes: [...state.routes, action.route] |
| 973 |
}; |
| 974 |
case "SET_DASHBOARD_LINK": |
| 975 |
return { |
| 976 |
...state, |
| 977 |
dashboardLink: action.dashboardLink |
| 978 |
}; |
| 979 |
} |
| 980 |
return state; |
| 981 |
} |
| 982 |
|
| 983 |
// packages/boot/build-module/store/actions.mjs |
| 984 |
var actions_exports = {}; |
| 985 |
__export(actions_exports, { |
| 986 |
registerMenuItem: () => registerMenuItem, |
| 987 |
registerRoute: () => registerRoute, |
| 988 |
setDashboardLink: () => setDashboardLink, |
| 989 |
updateMenuItem: () => updateMenuItem |
| 990 |
}); |
| 991 |
function registerMenuItem(id, menuItem) { |
| 992 |
return { |
| 993 |
type: "REGISTER_MENU_ITEM", |
| 994 |
id, |
| 995 |
menuItem |
| 996 |
}; |
| 997 |
} |
| 998 |
function updateMenuItem(id, updates) { |
| 999 |
return { |
| 1000 |
type: "UPDATE_MENU_ITEM", |
| 1001 |
id, |
| 1002 |
updates |
| 1003 |
}; |
| 1004 |
} |
| 1005 |
function registerRoute(route) { |
| 1006 |
return { |
| 1007 |
type: "REGISTER_ROUTE", |
| 1008 |
route |
| 1009 |
}; |
| 1010 |
} |
| 1011 |
function setDashboardLink(dashboardLink) { |
| 1012 |
return { |
| 1013 |
type: "SET_DASHBOARD_LINK", |
| 1014 |
dashboardLink |
| 1015 |
}; |
| 1016 |
} |
| 1017 |
|
| 1018 |
// packages/boot/build-module/store/selectors.mjs |
| 1019 |
var selectors_exports = {}; |
| 1020 |
__export(selectors_exports, { |
| 1021 |
getDashboardLink: () => getDashboardLink, |
| 1022 |
getMenuItems: () => getMenuItems, |
| 1023 |
getRoutes: () => getRoutes |
| 1024 |
}); |
| 1025 |
function getMenuItems(state) { |
| 1026 |
return Object.values(state.menuItems); |
| 1027 |
} |
| 1028 |
function getRoutes(state) { |
| 1029 |
return state.routes; |
| 1030 |
} |
| 1031 |
function getDashboardLink(state) { |
| 1032 |
return state.dashboardLink; |
| 1033 |
} |
| 1034 |
|
| 1035 |
// packages/boot/build-module/store/index.mjs |
| 1036 |
var STORE_NAME = "wordpress/boot"; |
| 1037 |
var store = (0, import_data2.createReduxStore)(STORE_NAME, { |
| 1038 |
reducer, |
| 1039 |
actions: actions_exports, |
| 1040 |
selectors: selectors_exports |
| 1041 |
}); |
| 1042 |
(0, import_data2.register)(store); |
| 1043 |
|
| 1044 |
// packages/boot/build-module/components/site-hub/index.mjs |
| 1045 |
var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1); |
| 1046 |
if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='0b29dc2c5c']")) { |
| 1047 |
const style = document.createElement("style"); |
| 1048 |
style.setAttribute("data-wp-hash", "0b29dc2c5c"); |
| 1049 |
style.appendChild(document.createTextNode(".boot-site-hub{align-items:center;background-color:var(--wpds-color-bg-surface-neutral-weak,#f0f0f0);display:grid;flex-shrink:0;grid-template-columns:60px 1fr auto;padding-right:16px;position:sticky;top:0;z-index:1}.boot-site-hub__actions{flex-shrink:0}.boot-site-hub__title{align-items:center;display:flex;text-decoration:none}.boot-site-hub__title .components-external-link__contents{margin-inline-start:4px;max-width:140px;overflow:hidden;text-decoration:none}.boot-site-hub__title .components-external-link__icon{opacity:0;transition:opacity .1s ease-out}.boot-site-hub__title:hover .components-external-link__icon{opacity:1}@media not (prefers-reduced-motion){.boot-site-hub__title{transition:outline .1s ease-out}}.boot-site-hub__title:focus:not(:active){outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));outline-offset:calc(var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px))*-1)}.boot-site-hub__title-text{color:var(--wpds-color-fg-content-neutral,#1e1e1e);font-size:13px;font-weight:499}.boot-site-hub__title-text,.boot-site-hub__url{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.boot-site-hub__url{color:var(--wpds-color-fg-content-neutral-weak,#6d6d6d);font-size:12px}")); |
| 1050 |
document.head.appendChild(style); |
| 1051 |
} |
| 1052 |
function SiteHub() { |
| 1053 |
const { dashboardLink, homeUrl, siteTitle } = (0, import_data3.useSelect)((select) => { |
| 1054 |
const { getEntityRecord } = select(import_core_data2.store); |
| 1055 |
const _base = getEntityRecord( |
| 1056 |
"root", |
| 1057 |
"__unstableBase" |
| 1058 |
); |
| 1059 |
return { |
| 1060 |
dashboardLink: select(store).getDashboardLink(), |
| 1061 |
homeUrl: _base?.home, |
| 1062 |
siteTitle: !_base?.name && !!_base?.url ? (0, import_url.filterURLForDisplay)(_base?.url) : _base?.name |
| 1063 |
}; |
| 1064 |
}, []); |
| 1065 |
const { open: openCommandCenter } = (0, import_data3.useDispatch)(import_commands.store); |
| 1066 |
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "boot-site-hub", children: [ |
| 1067 |
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)( |
| 1068 |
site_icon_link_default, |
| 1069 |
{ |
| 1070 |
to: dashboardLink || "/", |
| 1071 |
"aria-label": (0, import_i18n2.__)("Go to the Dashboard") |
| 1072 |
} |
| 1073 |
), |
| 1074 |
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)( |
| 1075 |
import_components3.ExternalLink, |
| 1076 |
{ |
| 1077 |
href: homeUrl ?? "/", |
| 1078 |
className: "boot-site-hub__title", |
| 1079 |
children: [ |
| 1080 |
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "boot-site-hub__title-text", children: siteTitle && (0, import_html_entities.decodeEntities)(siteTitle) }), |
| 1081 |
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "boot-site-hub__url", children: (0, import_url.filterURLForDisplay)(homeUrl ?? "") }) |
| 1082 |
] |
| 1083 |
} |
| 1084 |
), |
| 1085 |
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_components3.__experimentalHStack, { className: "boot-site-hub__actions", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)( |
| 1086 |
import_components3.Button, |
| 1087 |
{ |
| 1088 |
variant: "tertiary", |
| 1089 |
icon: search_default, |
| 1090 |
onClick: () => openCommandCenter(), |
| 1091 |
size: "compact", |
| 1092 |
label: (0, import_i18n2.__)("Open command palette"), |
| 1093 |
shortcut: import_keycodes.displayShortcut.primary("k") |
| 1094 |
} |
| 1095 |
) }) |
| 1096 |
] }); |
| 1097 |
} |
| 1098 |
var site_hub_default = SiteHub; |
| 1099 |
|
| 1100 |
// packages/boot/build-module/components/navigation/index.mjs |
| 1101 |
var import_element7 = __toESM(require_element(), 1); |
| 1102 |
var import_data6 = __toESM(require_data(), 1); |
| 1103 |
|
| 1104 |
// packages/boot/build-module/components/navigation/navigation-item/index.mjs |
| 1105 |
var import_components6 = __toESM(require_components(), 1); |
| 1106 |
|
| 1107 |
// packages/boot/build-module/components/navigation/router-link-item.mjs |
| 1108 |
var import_element4 = __toESM(require_element(), 1); |
| 1109 |
var import_components4 = __toESM(require_components(), 1); |
| 1110 |
import { privateApis as routePrivateApis2 } from "@wordpress/route"; |
| 1111 |
var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1); |
| 1112 |
var { createLink } = unlock(routePrivateApis2); |
| 1113 |
function AnchorOnlyItem(props, forwardedRef) { |
| 1114 |
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_components4.__experimentalItem, { as: "a", ref: forwardedRef, ...props }); |
| 1115 |
} |
| 1116 |
var RouterLinkItem = createLink((0, import_element4.forwardRef)(AnchorOnlyItem)); |
| 1117 |
var router_link_item_default = RouterLinkItem; |
| 1118 |
|
| 1119 |
// packages/boot/build-module/components/navigation/items.mjs |
| 1120 |
var import_element5 = __toESM(require_element(), 1); |
| 1121 |
var import_components5 = __toESM(require_components(), 1); |
| 1122 |
var import_primitives11 = __toESM(require_primitives(), 1); |
| 1123 |
var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1); |
| 1124 |
function isSvg(element) { |
| 1125 |
return (0, import_element5.isValidElement)(element) && (element.type === import_primitives11.SVG || element.type === "svg"); |
| 1126 |
} |
| 1127 |
function wrapIcon(icon, shouldShowPlaceholder = true) { |
| 1128 |
if (isSvg(icon)) { |
| 1129 |
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_components5.Icon, { icon }); |
| 1130 |
} |
| 1131 |
if (typeof icon === "string" && icon.startsWith("dashicons-")) { |
| 1132 |
const iconKey = icon.replace( |
| 1133 |
/^dashicons-/, |
| 1134 |
"" |
| 1135 |
); |
| 1136 |
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)( |
| 1137 |
import_components5.Dashicon, |
| 1138 |
{ |
| 1139 |
style: { padding: "2px" }, |
| 1140 |
icon: iconKey, |
| 1141 |
"aria-hidden": "true" |
| 1142 |
} |
| 1143 |
); |
| 1144 |
} |
| 1145 |
if (typeof icon === "string" && icon.startsWith("data:")) { |
| 1146 |
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)( |
| 1147 |
"img", |
| 1148 |
{ |
| 1149 |
src: icon, |
| 1150 |
alt: "", |
| 1151 |
"aria-hidden": "true", |
| 1152 |
style: { |
| 1153 |
width: "20px", |
| 1154 |
height: "20px", |
| 1155 |
display: "block", |
| 1156 |
padding: "2px" |
| 1157 |
} |
| 1158 |
} |
| 1159 |
); |
| 1160 |
} |
| 1161 |
if (icon) { |
| 1162 |
return icon; |
| 1163 |
} |
| 1164 |
if (shouldShowPlaceholder) { |
| 1165 |
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)( |
| 1166 |
"div", |
| 1167 |
{ |
| 1168 |
style: { width: "24px", height: "24px" }, |
| 1169 |
"aria-hidden": "true" |
| 1170 |
} |
| 1171 |
); |
| 1172 |
} |
| 1173 |
return null; |
| 1174 |
} |
| 1175 |
|
| 1176 |
// packages/boot/build-module/components/navigation/navigation-item/index.mjs |
| 1177 |
var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1); |
| 1178 |
if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='26b8e27d3f']")) { |
| 1179 |
const style = document.createElement("style"); |
| 1180 |
style.setAttribute("data-wp-hash", "26b8e27d3f"); |
| 1181 |
style.appendChild(document.createTextNode('.boot-navigation-item.components-item{align-items:center;border:none;color:var(--wpds-color-fg-interactive-neutral,#1e1e1e);display:flex;font-family:-apple-system,"system-ui",Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:400;line-height:20px;margin-block-end:4px;margin-inline:12px;min-height:32px;padding-block:0;padding-inline:4px;width:calc(100% - 24px)}.boot-dropdown-item__children .boot-navigation-item.components-item{min-height:24px}.boot-navigation-item.components-item{border-radius:var(--wpds-border-radius-sm,2px)}.boot-navigation-item.components-item.active,.boot-navigation-item.components-item:focus,.boot-navigation-item.components-item:hover,.boot-navigation-item.components-item[aria-current=true]{color:var(--wpds-color-fg-interactive-brand-active,var(--wp-admin-theme-color,#3858e9))}.boot-navigation-item.components-item.active{font-weight:499}.boot-navigation-item.components-item svg:last-child{padding:4px}.boot-navigation-item.components-item[aria-current=true]{color:var(--wpds-color-fg-interactive-brand-active,var(--wp-admin-theme-color,#3858e9));font-weight:499}.boot-navigation-item.components-item:focus-visible{transform:translateZ(0)}.boot-navigation-item.components-item.with-suffix{padding-right:16px}')); |
| 1182 |
document.head.appendChild(style); |
| 1183 |
} |
| 1184 |
function NavigationItem({ |
| 1185 |
className, |
| 1186 |
icon, |
| 1187 |
shouldShowPlaceholder = true, |
| 1188 |
children, |
| 1189 |
to |
| 1190 |
}) { |
| 1191 |
const isExternal = !String( |
| 1192 |
new URL(to, window.location.origin) |
| 1193 |
).startsWith(window.location.origin); |
| 1194 |
const content = /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_components6.__experimentalHStack, { justify: "flex-start", spacing: 2, style: { flexGrow: "1" }, children: [ |
| 1195 |
wrapIcon(icon, shouldShowPlaceholder), |
| 1196 |
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_components6.FlexBlock, { children }) |
| 1197 |
] }); |
| 1198 |
if (isExternal) { |
| 1199 |
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)( |
| 1200 |
import_components6.__experimentalItem, |
| 1201 |
{ |
| 1202 |
as: "a", |
| 1203 |
href: to, |
| 1204 |
className: clsx_default("boot-navigation-item", className), |
| 1205 |
children: content |
| 1206 |
} |
| 1207 |
); |
| 1208 |
} |
| 1209 |
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)( |
| 1210 |
router_link_item_default, |
| 1211 |
{ |
| 1212 |
to, |
| 1213 |
className: clsx_default("boot-navigation-item", className), |
| 1214 |
children: content |
| 1215 |
} |
| 1216 |
); |
| 1217 |
} |
| 1218 |
|
| 1219 |
// packages/boot/build-module/components/navigation/drilldown-item/index.mjs |
| 1220 |
var import_components7 = __toESM(require_components(), 1); |
| 1221 |
var import_i18n3 = __toESM(require_i18n(), 1); |
| 1222 |
var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1); |
| 1223 |
function DrilldownItem({ |
| 1224 |
className, |
| 1225 |
id, |
| 1226 |
icon, |
| 1227 |
shouldShowPlaceholder = true, |
| 1228 |
children, |
| 1229 |
onNavigate |
| 1230 |
}) { |
| 1231 |
const handleClick = (e) => { |
| 1232 |
e.preventDefault(); |
| 1233 |
onNavigate({ id, direction: "forward" }); |
| 1234 |
}; |
| 1235 |
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)( |
| 1236 |
import_components7.__experimentalItem, |
| 1237 |
{ |
| 1238 |
className: clsx_default("boot-navigation-item", className), |
| 1239 |
onClick: handleClick, |
| 1240 |
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)( |
| 1241 |
import_components7.__experimentalHStack, |
| 1242 |
{ |
| 1243 |
justify: "flex-start", |
| 1244 |
spacing: 2, |
| 1245 |
style: { flexGrow: "1" }, |
| 1246 |
children: [ |
| 1247 |
wrapIcon(icon, shouldShowPlaceholder), |
| 1248 |
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_components7.FlexBlock, { children }), |
| 1249 |
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_components7.Icon, { icon: (0, import_i18n3.isRTL)() ? chevron_left_small_default : chevron_right_small_default }) |
| 1250 |
] |
| 1251 |
} |
| 1252 |
) |
| 1253 |
} |
| 1254 |
); |
| 1255 |
} |
| 1256 |
|
| 1257 |
// packages/boot/build-module/components/navigation/dropdown-item/index.mjs |
| 1258 |
var import_components8 = __toESM(require_components(), 1); |
| 1259 |
var import_compose = __toESM(require_compose(), 1); |
| 1260 |
var import_data4 = __toESM(require_data(), 1); |
| 1261 |
var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1); |
| 1262 |
if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='608eff82f3']")) { |
| 1263 |
const style = document.createElement("style"); |
| 1264 |
style.setAttribute("data-wp-hash", "608eff82f3"); |
| 1265 |
style.appendChild(document.createTextNode(".boot-dropdown-item__children{display:flex;flex-direction:column;margin-block-end:2px;margin-block-start:-2px;margin-inline-start:30px;overflow:hidden;padding:2px}.boot-dropdown-item__chevron.is-up{transform:rotate(180deg)}")); |
| 1266 |
document.head.appendChild(style); |
| 1267 |
} |
| 1268 |
var ANIMATION_DURATION = 0.2; |
| 1269 |
function DropdownItem({ |
| 1270 |
className, |
| 1271 |
id, |
| 1272 |
icon, |
| 1273 |
children, |
| 1274 |
isExpanded, |
| 1275 |
onToggle |
| 1276 |
}) { |
| 1277 |
const menuItems = (0, import_data4.useSelect)( |
| 1278 |
(select) => ( |
| 1279 |
// @ts-ignore |
| 1280 |
select(STORE_NAME).getMenuItems() |
| 1281 |
), |
| 1282 |
[] |
| 1283 |
); |
| 1284 |
const items = menuItems.filter((item) => item.parent === id); |
| 1285 |
const disableMotion = (0, import_compose.useReducedMotion)(); |
| 1286 |
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "boot-dropdown-item", children: [ |
| 1287 |
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)( |
| 1288 |
import_components8.__experimentalItem, |
| 1289 |
{ |
| 1290 |
className: clsx_default("boot-navigation-item", className), |
| 1291 |
onClick: (e) => { |
| 1292 |
e.preventDefault(); |
| 1293 |
e.stopPropagation(); |
| 1294 |
onToggle(); |
| 1295 |
}, |
| 1296 |
onMouseDown: (e) => e.preventDefault(), |
| 1297 |
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)( |
| 1298 |
import_components8.__experimentalHStack, |
| 1299 |
{ |
| 1300 |
justify: "flex-start", |
| 1301 |
spacing: 2, |
| 1302 |
style: { flexGrow: "1" }, |
| 1303 |
children: [ |
| 1304 |
wrapIcon(icon, false), |
| 1305 |
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_components8.FlexBlock, { children }), |
| 1306 |
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)( |
| 1307 |
import_components8.Icon, |
| 1308 |
{ |
| 1309 |
icon: chevron_down_small_default, |
| 1310 |
className: clsx_default("boot-dropdown-item__chevron", { |
| 1311 |
"is-up": isExpanded |
| 1312 |
}) |
| 1313 |
} |
| 1314 |
) |
| 1315 |
] |
| 1316 |
} |
| 1317 |
) |
| 1318 |
} |
| 1319 |
), |
| 1320 |
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_components8.__unstableAnimatePresence, { initial: false, children: isExpanded && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)( |
| 1321 |
import_components8.__unstableMotion.div, |
| 1322 |
{ |
| 1323 |
initial: { height: 0 }, |
| 1324 |
animate: { height: "auto" }, |
| 1325 |
exit: { height: 0 }, |
| 1326 |
transition: { |
| 1327 |
type: "tween", |
| 1328 |
duration: disableMotion ? 0 : ANIMATION_DURATION, |
| 1329 |
ease: "easeOut" |
| 1330 |
}, |
| 1331 |
className: "boot-dropdown-item__children", |
| 1332 |
children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)( |
| 1333 |
NavigationItem, |
| 1334 |
{ |
| 1335 |
to: item.to, |
| 1336 |
shouldShowPlaceholder: false, |
| 1337 |
children: item.label |
| 1338 |
}, |
| 1339 |
index |
| 1340 |
)) |
| 1341 |
} |
| 1342 |
) }) |
| 1343 |
] }); |
| 1344 |
} |
| 1345 |
|
| 1346 |
// packages/boot/build-module/components/navigation/navigation-screen/index.mjs |
| 1347 |
var import_components9 = __toESM(require_components(), 1); |
| 1348 |
var import_i18n4 = __toESM(require_i18n(), 1); |
| 1349 |
var import_compose2 = __toESM(require_compose(), 1); |
| 1350 |
var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1); |
| 1351 |
if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='c5e42e1495']")) { |
| 1352 |
const style = document.createElement("style"); |
| 1353 |
style.setAttribute("data-wp-hash", "c5e42e1495"); |
| 1354 |
style.appendChild(document.createTextNode(".boot-navigation-screen{padding-block-end:4px}.boot-navigation-screen .components-text{color:var(--wpds-color-fg-content-neutral,#1e1e1e)}.boot-navigation-screen__title-icon{padding:12px 16px 8px;position:sticky;top:0}.boot-navigation-screen__title{flex-grow:1;overflow-wrap:break-word}.boot-navigation-screen__title.boot-navigation-screen__title,.boot-navigation-screen__title.boot-navigation-screen__title .boot-navigation-screen__title{color:var(--wpds-color-fg-content-neutral,#1e1e1e);line-height:32px}.boot-navigation-screen__actions{display:flex;flex-shrink:0}")); |
| 1355 |
document.head.appendChild(style); |
| 1356 |
} |
| 1357 |
var ANIMATION_DURATION2 = 0.3; |
| 1358 |
var slideVariants = { |
| 1359 |
initial: (direction) => ({ |
| 1360 |
x: direction === "forward" ? 100 : -100, |
| 1361 |
opacity: 0 |
| 1362 |
}), |
| 1363 |
animate: { |
| 1364 |
x: 0, |
| 1365 |
opacity: 1 |
| 1366 |
}, |
| 1367 |
exit: (direction) => ({ |
| 1368 |
x: direction === "forward" ? 100 : -100, |
| 1369 |
opacity: 0 |
| 1370 |
}) |
| 1371 |
}; |
| 1372 |
function NavigationScreen({ |
| 1373 |
isRoot, |
| 1374 |
title, |
| 1375 |
actions, |
| 1376 |
content, |
| 1377 |
description, |
| 1378 |
animationDirection, |
| 1379 |
backMenuItem, |
| 1380 |
backButtonRef, |
| 1381 |
navigationKey, |
| 1382 |
onNavigate |
| 1383 |
}) { |
| 1384 |
const icon = (0, import_i18n4.isRTL)() ? chevron_right_default : chevron_left_default; |
| 1385 |
const disableMotion = (0, import_compose2.useReducedMotion)(); |
| 1386 |
const handleBackClick = (e) => { |
| 1387 |
e.preventDefault(); |
| 1388 |
onNavigate({ id: backMenuItem, direction: "backward" }); |
| 1389 |
}; |
| 1390 |
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)( |
| 1391 |
"div", |
| 1392 |
{ |
| 1393 |
className: "boot-navigation-screen", |
| 1394 |
style: { |
| 1395 |
overflow: "hidden", |
| 1396 |
position: "relative", |
| 1397 |
display: "grid", |
| 1398 |
gridTemplateColumns: "1fr", |
| 1399 |
gridTemplateRows: "1fr" |
| 1400 |
}, |
| 1401 |
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_components9.__unstableAnimatePresence, { initial: false, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)( |
| 1402 |
import_components9.__unstableMotion.div, |
| 1403 |
{ |
| 1404 |
custom: animationDirection, |
| 1405 |
variants: slideVariants, |
| 1406 |
initial: "initial", |
| 1407 |
animate: "animate", |
| 1408 |
exit: "exit", |
| 1409 |
transition: { |
| 1410 |
type: "tween", |
| 1411 |
duration: disableMotion ? 0 : ANIMATION_DURATION2, |
| 1412 |
ease: [0.33, 0, 0, 1] |
| 1413 |
}, |
| 1414 |
style: { |
| 1415 |
width: "100%", |
| 1416 |
gridColumn: "1", |
| 1417 |
gridRow: "1" |
| 1418 |
}, |
| 1419 |
children: [ |
| 1420 |
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)( |
| 1421 |
import_components9.__experimentalHStack, |
| 1422 |
{ |
| 1423 |
spacing: 2, |
| 1424 |
className: "boot-navigation-screen__title-icon", |
| 1425 |
children: [ |
| 1426 |
!isRoot && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)( |
| 1427 |
import_components9.Button, |
| 1428 |
{ |
| 1429 |
ref: backButtonRef, |
| 1430 |
icon, |
| 1431 |
onClick: handleBackClick, |
| 1432 |
label: (0, import_i18n4.__)("Back"), |
| 1433 |
size: "small", |
| 1434 |
variant: "tertiary" |
| 1435 |
} |
| 1436 |
), |
| 1437 |
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)( |
| 1438 |
import_components9.__experimentalHeading, |
| 1439 |
{ |
| 1440 |
className: "boot-navigation-screen__title", |
| 1441 |
level: 1, |
| 1442 |
size: "15px", |
| 1443 |
children: title |
| 1444 |
} |
| 1445 |
), |
| 1446 |
actions && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "boot-navigation-screen__actions", children: actions }) |
| 1447 |
] |
| 1448 |
} |
| 1449 |
), |
| 1450 |
description && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "boot-navigation-screen__description", children: description }), |
| 1451 |
content |
| 1452 |
] |
| 1453 |
}, |
| 1454 |
navigationKey |
| 1455 |
) }) |
| 1456 |
} |
| 1457 |
); |
| 1458 |
} |
| 1459 |
|
| 1460 |
// packages/boot/build-module/components/navigation/use-sidebar-parent.mjs |
| 1461 |
var import_element6 = __toESM(require_element(), 1); |
| 1462 |
var import_data5 = __toESM(require_data(), 1); |
| 1463 |
import { privateApis as routePrivateApis3 } from "@wordpress/route"; |
| 1464 |
|
| 1465 |
// packages/boot/build-module/components/navigation/path-matching.mjs |
| 1466 |
var isValidParentPath = (currentPath, menuPath) => { |
| 1467 |
if (!menuPath || menuPath === currentPath) { |
| 1468 |
return false; |
| 1469 |
} |
| 1470 |
const normalizePath = (path) => { |
| 1471 |
const normalized = path.startsWith("/") ? path : "/" + path; |
| 1472 |
return normalized.endsWith("/") && normalized.length > 1 ? normalized.slice(0, -1) : normalized; |
| 1473 |
}; |
| 1474 |
const normalizedCurrent = normalizePath(currentPath); |
| 1475 |
const normalizedMenu = normalizePath(menuPath); |
| 1476 |
return normalizedCurrent.startsWith(normalizedMenu) && (normalizedCurrent[normalizedMenu.length] === "/" || normalizedMenu === "/"); |
| 1477 |
}; |
| 1478 |
var findClosestMenuItem = (currentPath, menuItems) => { |
| 1479 |
const exactMatch = menuItems.find((item) => item.to === currentPath); |
| 1480 |
if (exactMatch) { |
| 1481 |
return exactMatch; |
| 1482 |
} |
| 1483 |
let bestMatch = null; |
| 1484 |
let bestPathLength = 0; |
| 1485 |
for (const item of menuItems) { |
| 1486 |
if (!item.to) { |
| 1487 |
continue; |
| 1488 |
} |
| 1489 |
if (isValidParentPath(currentPath, item.to)) { |
| 1490 |
if (item.to.length > bestPathLength) { |
| 1491 |
bestMatch = item; |
| 1492 |
bestPathLength = item.to.length; |
| 1493 |
} |
| 1494 |
} |
| 1495 |
} |
| 1496 |
return bestMatch; |
| 1497 |
}; |
| 1498 |
var findDrilldownParent = (id, menuItems) => { |
| 1499 |
if (!id) { |
| 1500 |
return void 0; |
| 1501 |
} |
| 1502 |
const currentItem = menuItems.find((item) => item.id === id); |
| 1503 |
if (!currentItem) { |
| 1504 |
return void 0; |
| 1505 |
} |
| 1506 |
if (currentItem.parent) { |
| 1507 |
const parentItem = menuItems.find( |
| 1508 |
(item) => item.id === currentItem.parent |
| 1509 |
); |
| 1510 |
if (parentItem?.parent_type === "drilldown") { |
| 1511 |
return parentItem.id; |
| 1512 |
} |
| 1513 |
if (parentItem) { |
| 1514 |
return findDrilldownParent(parentItem.id, menuItems); |
| 1515 |
} |
| 1516 |
} |
| 1517 |
return void 0; |
| 1518 |
}; |
| 1519 |
var findDropdownParent = (id, menuItems) => { |
| 1520 |
if (!id) { |
| 1521 |
return void 0; |
| 1522 |
} |
| 1523 |
const currentItem = menuItems.find((item) => item.id === id); |
| 1524 |
if (!currentItem) { |
| 1525 |
return void 0; |
| 1526 |
} |
| 1527 |
if (currentItem.parent) { |
| 1528 |
const parentItem = menuItems.find( |
| 1529 |
(item) => item.id === currentItem.parent |
| 1530 |
); |
| 1531 |
if (parentItem?.parent_type === "dropdown") { |
| 1532 |
return parentItem.id; |
| 1533 |
} |
| 1534 |
} |
| 1535 |
return void 0; |
| 1536 |
}; |
| 1537 |
|
| 1538 |
// packages/boot/build-module/components/navigation/use-sidebar-parent.mjs |
| 1539 |
var { useRouter: useRouter2, useMatches } = unlock(routePrivateApis3); |
| 1540 |
function useSidebarParent() { |
| 1541 |
const matches = useMatches(); |
| 1542 |
const router = useRouter2(); |
| 1543 |
const menuItems = (0, import_data5.useSelect)( |
| 1544 |
(select) => ( |
| 1545 |
// @ts-ignore |
| 1546 |
select(STORE_NAME).getMenuItems() |
| 1547 |
), |
| 1548 |
[] |
| 1549 |
); |
| 1550 |
const currentPath = matches[matches.length - 1].pathname.slice( |
| 1551 |
router.options.basepath?.length ?? 0 |
| 1552 |
); |
| 1553 |
const currentMenuItem = findClosestMenuItem(currentPath, menuItems); |
| 1554 |
const [parentId, setParentId] = (0, import_element6.useState)( |
| 1555 |
findDrilldownParent(currentMenuItem?.id, menuItems) |
| 1556 |
); |
| 1557 |
const [parentDropdownId, setParentDropdownId] = (0, import_element6.useState)(findDropdownParent(currentMenuItem?.id, menuItems)); |
| 1558 |
(0, import_element6.useEffect)(() => { |
| 1559 |
const matchedMenuItem = findClosestMenuItem(currentPath, menuItems); |
| 1560 |
const updatedParentId = findDrilldownParent( |
| 1561 |
matchedMenuItem?.id, |
| 1562 |
menuItems |
| 1563 |
); |
| 1564 |
const updatedDropdownParent = findDropdownParent( |
| 1565 |
matchedMenuItem?.id, |
| 1566 |
menuItems |
| 1567 |
); |
| 1568 |
setParentId(updatedParentId); |
| 1569 |
setParentDropdownId(updatedDropdownParent); |
| 1570 |
}, [currentPath, menuItems]); |
| 1571 |
return [ |
| 1572 |
parentId, |
| 1573 |
setParentId, |
| 1574 |
parentDropdownId, |
| 1575 |
setParentDropdownId |
| 1576 |
]; |
| 1577 |
} |
| 1578 |
|
| 1579 |
// packages/boot/build-module/components/navigation/index.mjs |
| 1580 |
var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1); |
| 1581 |
function Navigation() { |
| 1582 |
const backButtonRef = (0, import_element7.useRef)(null); |
| 1583 |
const [animationDirection, setAnimationDirection] = (0, import_element7.useState)(null); |
| 1584 |
const [parentId, setParentId, parentDropdownId, setParentDropdownId] = useSidebarParent(); |
| 1585 |
const menuItems = (0, import_data6.useSelect)( |
| 1586 |
(select) => ( |
| 1587 |
// @ts-ignore |
| 1588 |
select(STORE_NAME).getMenuItems() |
| 1589 |
), |
| 1590 |
[] |
| 1591 |
); |
| 1592 |
const parent = (0, import_element7.useMemo)( |
| 1593 |
() => menuItems.find((item) => item.id === parentId), |
| 1594 |
[menuItems, parentId] |
| 1595 |
); |
| 1596 |
const navigationKey = parent ? `drilldown-${parent.id}` : "root"; |
| 1597 |
const handleNavigate = ({ |
| 1598 |
id, |
| 1599 |
direction |
| 1600 |
}) => { |
| 1601 |
setAnimationDirection(direction); |
| 1602 |
setParentId(id); |
| 1603 |
}; |
| 1604 |
const handleDropdownToggle = (dropdownId) => { |
| 1605 |
setParentDropdownId( |
| 1606 |
parentDropdownId === dropdownId ? void 0 : dropdownId |
| 1607 |
); |
| 1608 |
}; |
| 1609 |
const items = (0, import_element7.useMemo)( |
| 1610 |
() => menuItems.filter((item) => item.parent === parentId), |
| 1611 |
[menuItems, parentId] |
| 1612 |
); |
| 1613 |
const hasRealIcons = items.some((item) => !!item.icon); |
| 1614 |
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)( |
| 1615 |
NavigationScreen, |
| 1616 |
{ |
| 1617 |
isRoot: !parent, |
| 1618 |
title: parent ? parent.label : "", |
| 1619 |
backMenuItem: parent?.parent, |
| 1620 |
backButtonRef, |
| 1621 |
animationDirection: animationDirection || void 0, |
| 1622 |
navigationKey, |
| 1623 |
onNavigate: handleNavigate, |
| 1624 |
content: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_jsx_runtime23.Fragment, { children: items.map((item) => { |
| 1625 |
if (item.parent_type === "dropdown") { |
| 1626 |
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)( |
| 1627 |
DropdownItem, |
| 1628 |
{ |
| 1629 |
id: item.id, |
| 1630 |
className: "boot-navigation-item", |
| 1631 |
icon: item.icon, |
| 1632 |
shouldShowPlaceholder: hasRealIcons, |
| 1633 |
isExpanded: parentDropdownId === item.id, |
| 1634 |
onToggle: () => handleDropdownToggle(item.id), |
| 1635 |
children: item.label |
| 1636 |
}, |
| 1637 |
item.id |
| 1638 |
); |
| 1639 |
} |
| 1640 |
if (item.parent_type === "drilldown") { |
| 1641 |
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)( |
| 1642 |
DrilldownItem, |
| 1643 |
{ |
| 1644 |
id: item.id, |
| 1645 |
icon: item.icon, |
| 1646 |
shouldShowPlaceholder: hasRealIcons, |
| 1647 |
onNavigate: handleNavigate, |
| 1648 |
children: item.label |
| 1649 |
}, |
| 1650 |
item.id |
| 1651 |
); |
| 1652 |
} |
| 1653 |
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)( |
| 1654 |
NavigationItem, |
| 1655 |
{ |
| 1656 |
to: item.to, |
| 1657 |
icon: item.icon, |
| 1658 |
shouldShowPlaceholder: hasRealIcons, |
| 1659 |
children: item.label |
| 1660 |
}, |
| 1661 |
item.id |
| 1662 |
); |
| 1663 |
}) }) |
| 1664 |
} |
| 1665 |
); |
| 1666 |
} |
| 1667 |
var navigation_default = Navigation; |
| 1668 |
|
| 1669 |
// packages/boot/build-module/components/save-button/index.mjs |
| 1670 |
var import_element9 = __toESM(require_element(), 1); |
| 1671 |
var import_data8 = __toESM(require_data(), 1); |
| 1672 |
var import_i18n6 = __toESM(require_i18n(), 1); |
| 1673 |
var import_core_data4 = __toESM(require_core_data(), 1); |
| 1674 |
var import_keycodes2 = __toESM(require_keycodes(), 1); |
| 1675 |
var import_editor2 = __toESM(require_editor(), 1); |
| 1676 |
var import_components10 = __toESM(require_components(), 1); |
| 1677 |
|
| 1678 |
// packages/boot/build-module/components/save-panel/use-save-shortcut.mjs |
| 1679 |
var import_element8 = __toESM(require_element(), 1); |
| 1680 |
var import_keyboard_shortcuts = __toESM(require_keyboard_shortcuts(), 1); |
| 1681 |
var import_i18n5 = __toESM(require_i18n(), 1); |
| 1682 |
var import_data7 = __toESM(require_data(), 1); |
| 1683 |
var import_core_data3 = __toESM(require_core_data(), 1); |
| 1684 |
var import_editor = __toESM(require_editor(), 1); |
| 1685 |
var shortcutName = "core/boot/save"; |
| 1686 |
function useSaveShortcut({ |
| 1687 |
openSavePanel |
| 1688 |
}) { |
| 1689 |
const { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } = (0, import_data7.useSelect)(import_core_data3.store); |
| 1690 |
const { hasNonPostEntityChanges, isPostSavingLocked } = (0, import_data7.useSelect)(import_editor.store); |
| 1691 |
const { savePost } = (0, import_data7.useDispatch)(import_editor.store); |
| 1692 |
const { registerShortcut, unregisterShortcut } = (0, import_data7.useDispatch)( |
| 1693 |
import_keyboard_shortcuts.store |
| 1694 |
); |
| 1695 |
(0, import_element8.useEffect)(() => { |
| 1696 |
registerShortcut({ |
| 1697 |
name: shortcutName, |
| 1698 |
category: "global", |
| 1699 |
description: (0, import_i18n5.__)("Save your changes."), |
| 1700 |
keyCombination: { |
| 1701 |
modifier: "primary", |
| 1702 |
character: "s" |
| 1703 |
} |
| 1704 |
}); |
| 1705 |
return () => { |
| 1706 |
unregisterShortcut(shortcutName); |
| 1707 |
}; |
| 1708 |
}, [registerShortcut, unregisterShortcut]); |
| 1709 |
(0, import_keyboard_shortcuts.useShortcut)(shortcutName, (event) => { |
| 1710 |
event.preventDefault(); |
| 1711 |
const dirtyEntityRecords = __experimentalGetDirtyEntityRecords(); |
| 1712 |
const hasDirtyEntities = !!dirtyEntityRecords.length; |
| 1713 |
const isSaving = dirtyEntityRecords.some( |
| 1714 |
(record) => isSavingEntityRecord(record.kind, record.name, record.key) |
| 1715 |
); |
| 1716 |
if (!hasDirtyEntities || isSaving) { |
| 1717 |
return; |
| 1718 |
} |
| 1719 |
if (hasNonPostEntityChanges()) { |
| 1720 |
openSavePanel(); |
| 1721 |
} else if (!isPostSavingLocked()) { |
| 1722 |
savePost(); |
| 1723 |
} |
| 1724 |
}); |
| 1725 |
} |
| 1726 |
|
| 1727 |
// packages/boot/build-module/components/save-button/index.mjs |
| 1728 |
var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1); |
| 1729 |
if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='294e36b777']")) { |
| 1730 |
const style = document.createElement("style"); |
| 1731 |
style.setAttribute("data-wp-hash", "294e36b777"); |
| 1732 |
style.appendChild(document.createTextNode(".boot-save-button{width:100%}")); |
| 1733 |
document.head.appendChild(style); |
| 1734 |
} |
| 1735 |
function SaveButton() { |
| 1736 |
const [isSaveViewOpen, setIsSaveViewOpened] = (0, import_element9.useState)(false); |
| 1737 |
const { isSaving, dirtyEntityRecordsCount } = (0, import_data8.useSelect)((select) => { |
| 1738 |
const { isSavingEntityRecord, __experimentalGetDirtyEntityRecords } = select(import_core_data4.store); |
| 1739 |
const dirtyEntityRecords = __experimentalGetDirtyEntityRecords(); |
| 1740 |
return { |
| 1741 |
isSaving: dirtyEntityRecords.some( |
| 1742 |
(record) => isSavingEntityRecord(record.kind, record.name, record.key) |
| 1743 |
), |
| 1744 |
dirtyEntityRecordsCount: dirtyEntityRecords.length |
| 1745 |
}; |
| 1746 |
}, []); |
| 1747 |
const [showSavedState, setShowSavedState] = (0, import_element9.useState)(false); |
| 1748 |
(0, import_element9.useEffect)(() => { |
| 1749 |
if (isSaving) { |
| 1750 |
setShowSavedState(true); |
| 1751 |
} |
| 1752 |
}, [isSaving]); |
| 1753 |
const hasChanges = dirtyEntityRecordsCount > 0; |
| 1754 |
(0, import_element9.useEffect)(() => { |
| 1755 |
if (!isSaving && hasChanges) { |
| 1756 |
setShowSavedState(false); |
| 1757 |
} |
| 1758 |
}, [isSaving, hasChanges]); |
| 1759 |
function hideSavedState() { |
| 1760 |
if (showSavedState) { |
| 1761 |
setShowSavedState(false); |
| 1762 |
} |
| 1763 |
} |
| 1764 |
const shouldShowButton = hasChanges || showSavedState; |
| 1765 |
useSaveShortcut({ openSavePanel: () => setIsSaveViewOpened(true) }); |
| 1766 |
if (!shouldShowButton) { |
| 1767 |
return null; |
| 1768 |
} |
| 1769 |
const isInSavedState = showSavedState && !hasChanges; |
| 1770 |
const disabled = isSaving || isInSavedState; |
| 1771 |
const getLabel = () => { |
| 1772 |
if (isInSavedState) { |
| 1773 |
return (0, import_i18n6.__)("Saved"); |
| 1774 |
} |
| 1775 |
return (0, import_i18n6.sprintf)( |
| 1776 |
// translators: %d: number of unsaved changes (number). |
| 1777 |
(0, import_i18n6._n)( |
| 1778 |
"Review %d change\u2026", |
| 1779 |
"Review %d changes\u2026", |
| 1780 |
dirtyEntityRecordsCount |
| 1781 |
), |
| 1782 |
dirtyEntityRecordsCount |
| 1783 |
); |
| 1784 |
}; |
| 1785 |
const label = getLabel(); |
| 1786 |
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [ |
| 1787 |
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)( |
| 1788 |
import_components10.Tooltip, |
| 1789 |
{ |
| 1790 |
text: hasChanges ? label : void 0, |
| 1791 |
shortcut: import_keycodes2.displayShortcut.primary("s"), |
| 1792 |
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)( |
| 1793 |
import_components10.Button, |
| 1794 |
{ |
| 1795 |
variant: "primary", |
| 1796 |
size: "compact", |
| 1797 |
onClick: () => setIsSaveViewOpened(true), |
| 1798 |
onBlur: hideSavedState, |
| 1799 |
disabled, |
| 1800 |
accessibleWhenDisabled: true, |
| 1801 |
isBusy: isSaving, |
| 1802 |
"aria-keyshortcuts": import_keycodes2.rawShortcut.primary("s"), |
| 1803 |
className: "boot-save-button", |
| 1804 |
icon: isInSavedState ? check_default : void 0, |
| 1805 |
children: label |
| 1806 |
} |
| 1807 |
) |
| 1808 |
} |
| 1809 |
), |
| 1810 |
isSaveViewOpen && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)( |
| 1811 |
import_components10.Modal, |
| 1812 |
{ |
| 1813 |
title: (0, import_i18n6.__)("Review changes"), |
| 1814 |
onRequestClose: () => setIsSaveViewOpened(false), |
| 1815 |
size: "small", |
| 1816 |
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)( |
| 1817 |
import_editor2.EntitiesSavedStates, |
| 1818 |
{ |
| 1819 |
close: () => setIsSaveViewOpened(false), |
| 1820 |
variant: "inline" |
| 1821 |
} |
| 1822 |
) |
| 1823 |
} |
| 1824 |
) |
| 1825 |
] }); |
| 1826 |
} |
| 1827 |
|
| 1828 |
// packages/boot/build-module/components/sidebar/index.mjs |
| 1829 |
var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1); |
| 1830 |
if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='6064f6f183']")) { |
| 1831 |
const style = document.createElement("style"); |
| 1832 |
style.setAttribute("data-wp-hash", "6064f6f183"); |
| 1833 |
style.appendChild(document.createTextNode(".boot-sidebar__scrollable{display:flex;flex-direction:column;height:100%;overflow:auto;position:relative}.boot-sidebar__content{contain:content;flex-grow:1;position:relative}.boot-sidebar__footer{padding:16px 8px 8px 16px}")); |
| 1834 |
document.head.appendChild(style); |
| 1835 |
} |
| 1836 |
function Sidebar() { |
| 1837 |
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "boot-sidebar__scrollable", children: [ |
| 1838 |
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(site_hub_default, {}), |
| 1839 |
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "boot-sidebar__content", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(navigation_default, {}) }), |
| 1840 |
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "boot-sidebar__footer", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SaveButton, {}) }) |
| 1841 |
] }); |
| 1842 |
} |
| 1843 |
|
| 1844 |
// packages/boot/build-module/components/save-panel/index.mjs |
| 1845 |
var import_element10 = __toESM(require_element(), 1); |
| 1846 |
var import_components11 = __toESM(require_components(), 1); |
| 1847 |
var import_editor3 = __toESM(require_editor(), 1); |
| 1848 |
var import_i18n7 = __toESM(require_i18n(), 1); |
| 1849 |
var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1); |
| 1850 |
function SavePanel() { |
| 1851 |
const [isOpen, setIsOpen] = (0, import_element10.useState)(false); |
| 1852 |
useSaveShortcut({ |
| 1853 |
openSavePanel: () => setIsOpen(true) |
| 1854 |
}); |
| 1855 |
if (!isOpen) { |
| 1856 |
return false; |
| 1857 |
} |
| 1858 |
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)( |
| 1859 |
import_components11.Modal, |
| 1860 |
{ |
| 1861 |
className: "edit-site-save-panel__modal", |
| 1862 |
onRequestClose: () => setIsOpen(false), |
| 1863 |
title: (0, import_i18n7.__)("Review changes"), |
| 1864 |
size: "small", |
| 1865 |
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)( |
| 1866 |
import_editor3.EntitiesSavedStates, |
| 1867 |
{ |
| 1868 |
close: () => setIsOpen(false), |
| 1869 |
variant: "inline" |
| 1870 |
} |
| 1871 |
) |
| 1872 |
} |
| 1873 |
); |
| 1874 |
} |
| 1875 |
|
| 1876 |
// packages/boot/build-module/components/canvas-renderer/index.mjs |
| 1877 |
var import_element12 = __toESM(require_element(), 1); |
| 1878 |
|
| 1879 |
// packages/boot/build-module/components/canvas/index.mjs |
| 1880 |
var import_element11 = __toESM(require_element(), 1); |
| 1881 |
var import_components13 = __toESM(require_components(), 1); |
| 1882 |
import { useNavigate } from "@wordpress/route"; |
| 1883 |
|
| 1884 |
// packages/boot/build-module/components/canvas/back-button.mjs |
| 1885 |
var import_components12 = __toESM(require_components(), 1); |
| 1886 |
var import_compose3 = __toESM(require_compose(), 1); |
| 1887 |
var import_i18n8 = __toESM(require_i18n(), 1); |
| 1888 |
var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1); |
| 1889 |
if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='539cf65f0d']")) { |
| 1890 |
const style = document.createElement("style"); |
| 1891 |
style.setAttribute("data-wp-hash", "539cf65f0d"); |
| 1892 |
style.appendChild(document.createTextNode(".boot-canvas-back-button{height:64px;left:0;position:absolute;top:0;width:64px;z-index:100}.boot-canvas-back-button__container{height:100%;position:relative;width:100%}.boot-canvas-back-button__link.components-button{align-items:center;background:var(--wpds-color-bg-surface-neutral-weak,#f0f0f0);border-radius:0;display:inline-flex;height:64px;justify-content:center;padding:0;text-decoration:none;width:64px}@media not (prefers-reduced-motion){.boot-canvas-back-button__link.components-button{transition:outline .1s ease-out}}.boot-canvas-back-button__link.components-button:focus:not(:active){outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));outline-offset:calc(var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px))*-1)}.boot-canvas-back-button__icon{align-items:center;background-color:#ccc;display:flex;height:64px;justify-content:center;left:0;pointer-events:none;position:absolute;top:0;width:64px}.boot-canvas-back-button__icon svg{fill:currentColor}.boot-canvas-back-button__icon.has-site-icon{-webkit-backdrop-filter:saturate(180%) blur(15px);backdrop-filter:saturate(180%) blur(15px);background-color:#fff9}.interface-interface-skeleton__header{margin-top:0!important}")); |
| 1893 |
document.head.appendChild(style); |
| 1894 |
} |
| 1895 |
var toggleHomeIconVariants = { |
| 1896 |
edit: { |
| 1897 |
opacity: 0, |
| 1898 |
scale: 0.2 |
| 1899 |
}, |
| 1900 |
hover: { |
| 1901 |
opacity: 1, |
| 1902 |
scale: 1, |
| 1903 |
clipPath: "inset( 22% round 2px )" |
| 1904 |
} |
| 1905 |
}; |
| 1906 |
function BootBackButton({ length }) { |
| 1907 |
const disableMotion = (0, import_compose3.useReducedMotion)(); |
| 1908 |
const handleBack = () => { |
| 1909 |
window.history.back(); |
| 1910 |
}; |
| 1911 |
if (length > 1) { |
| 1912 |
return null; |
| 1913 |
} |
| 1914 |
const transition = { |
| 1915 |
duration: disableMotion ? 0 : 0.3 |
| 1916 |
}; |
| 1917 |
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)( |
| 1918 |
import_components12.__unstableMotion.div, |
| 1919 |
{ |
| 1920 |
className: "boot-canvas-back-button", |
| 1921 |
animate: "edit", |
| 1922 |
initial: "edit", |
| 1923 |
whileHover: "hover", |
| 1924 |
whileTap: "tap", |
| 1925 |
transition, |
| 1926 |
children: [ |
| 1927 |
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)( |
| 1928 |
import_components12.Button, |
| 1929 |
{ |
| 1930 |
className: "boot-canvas-back-button__link", |
| 1931 |
onClick: handleBack, |
| 1932 |
"aria-label": (0, import_i18n8.__)("Go back"), |
| 1933 |
__next40pxDefaultSize: true, |
| 1934 |
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(site_icon_default, {}) |
| 1935 |
} |
| 1936 |
), |
| 1937 |
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)( |
| 1938 |
import_components12.__unstableMotion.div, |
| 1939 |
{ |
| 1940 |
className: "boot-canvas-back-button__icon", |
| 1941 |
variants: toggleHomeIconVariants, |
| 1942 |
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_components12.Icon, { icon: arrow_up_left_default }) |
| 1943 |
} |
| 1944 |
) |
| 1945 |
] |
| 1946 |
} |
| 1947 |
); |
| 1948 |
} |
| 1949 |
|
| 1950 |
// packages/boot/build-module/components/canvas/index.mjs |
| 1951 |
var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1); |
| 1952 |
function Canvas({ canvas }) { |
| 1953 |
const [Editor, setEditor] = (0, import_element11.useState)(null); |
| 1954 |
const navigate = useNavigate(); |
| 1955 |
(0, import_element11.useEffect)(() => { |
| 1956 |
import("@wordpress/lazy-editor").then((module) => { |
| 1957 |
setEditor(() => module.Editor); |
| 1958 |
}).catch((error) => { |
| 1959 |
console.error("Failed to load lazy editor:", error); |
| 1960 |
}); |
| 1961 |
}, []); |
| 1962 |
if (!Editor) { |
| 1963 |
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)( |
| 1964 |
"div", |
| 1965 |
{ |
| 1966 |
style: { |
| 1967 |
display: "flex", |
| 1968 |
justifyContent: "center", |
| 1969 |
alignItems: "center", |
| 1970 |
height: "100%", |
| 1971 |
padding: "2rem" |
| 1972 |
}, |
| 1973 |
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_components13.Spinner, {}) |
| 1974 |
} |
| 1975 |
); |
| 1976 |
} |
| 1977 |
const backButton = !canvas.isPreview ? ({ length }) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(BootBackButton, { length }) : void 0; |
| 1978 |
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { style: { height: "100%", position: "relative" }, children: [ |
| 1979 |
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)( |
| 1980 |
"div", |
| 1981 |
{ |
| 1982 |
style: { height: "100%" }, |
| 1983 |
inert: canvas.isPreview ? "true" : void 0, |
| 1984 |
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)( |
| 1985 |
Editor, |
| 1986 |
{ |
| 1987 |
postType: canvas.postType, |
| 1988 |
postId: canvas.postId, |
| 1989 |
settings: { |
| 1990 |
isPreviewMode: canvas.isPreview, |
| 1991 |
styles: canvas.isPreview ? [{ css: "body{min-height:100vh;}" }] : [] |
| 1992 |
}, |
| 1993 |
backButton |
| 1994 |
} |
| 1995 |
) |
| 1996 |
} |
| 1997 |
), |
| 1998 |
canvas.isPreview && canvas.editLink && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)( |
| 1999 |
"div", |
| 2000 |
{ |
| 2001 |
onClick: () => navigate({ to: canvas.editLink }), |
| 2002 |
onKeyDown: (e) => { |
| 2003 |
if (e.key === "Enter" || e.key === " ") { |
| 2004 |
e.preventDefault(); |
| 2005 |
navigate({ to: canvas.editLink }); |
| 2006 |
} |
| 2007 |
}, |
| 2008 |
style: { |
| 2009 |
position: "absolute", |
| 2010 |
inset: 0, |
| 2011 |
cursor: "pointer", |
| 2012 |
zIndex: 1 |
| 2013 |
}, |
| 2014 |
role: "button", |
| 2015 |
tabIndex: 0, |
| 2016 |
"aria-label": "Click to edit" |
| 2017 |
} |
| 2018 |
) |
| 2019 |
] }); |
| 2020 |
} |
| 2021 |
|
| 2022 |
// packages/boot/build-module/components/canvas-renderer/index.mjs |
| 2023 |
var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1); |
| 2024 |
function CanvasRenderer({ |
| 2025 |
canvas, |
| 2026 |
routeContentModule |
| 2027 |
}) { |
| 2028 |
const [CustomCanvas, setCustomCanvas] = (0, import_element12.useState)(null); |
| 2029 |
(0, import_element12.useEffect)(() => { |
| 2030 |
if (canvas === null && routeContentModule) { |
| 2031 |
import(routeContentModule).then((module) => { |
| 2032 |
setCustomCanvas(() => module.canvas); |
| 2033 |
}).catch((error) => { |
| 2034 |
console.error("Failed to load custom canvas:", error); |
| 2035 |
}); |
| 2036 |
} else { |
| 2037 |
setCustomCanvas(null); |
| 2038 |
} |
| 2039 |
}, [canvas, routeContentModule]); |
| 2040 |
if (canvas === void 0) { |
| 2041 |
return null; |
| 2042 |
} |
| 2043 |
if (canvas === null) { |
| 2044 |
if (!CustomCanvas) { |
| 2045 |
return null; |
| 2046 |
} |
| 2047 |
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(CustomCanvas, {}); |
| 2048 |
} |
| 2049 |
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Canvas, { canvas }); |
| 2050 |
} |
| 2051 |
|
| 2052 |
// packages/boot/build-module/components/app/use-route-title.mjs |
| 2053 |
var import_element13 = __toESM(require_element(), 1); |
| 2054 |
var import_data9 = __toESM(require_data(), 1); |
| 2055 |
var import_core_data5 = __toESM(require_core_data(), 1); |
| 2056 |
var import_i18n9 = __toESM(require_i18n(), 1); |
| 2057 |
var import_html_entities2 = __toESM(require_html_entities(), 1); |
| 2058 |
import { speak } from "@wordpress/a11y"; |
| 2059 |
import { privateApis as routePrivateApis4 } from "@wordpress/route"; |
| 2060 |
var { useLocation, useMatches: useMatches2 } = unlock(routePrivateApis4); |
| 2061 |
function useRouteTitle() { |
| 2062 |
const location = useLocation(); |
| 2063 |
const matches = useMatches2(); |
| 2064 |
const currentMatch = matches[matches.length - 1]; |
| 2065 |
const routeTitle = currentMatch?.loaderData?.title; |
| 2066 |
const siteTitle = (0, import_data9.useSelect)( |
| 2067 |
(select) => select(import_core_data5.store).getEntityRecord( |
| 2068 |
"root", |
| 2069 |
"__unstableBase" |
| 2070 |
)?.name, |
| 2071 |
[] |
| 2072 |
); |
| 2073 |
const isInitialLocationRef = (0, import_element13.useRef)(true); |
| 2074 |
(0, import_element13.useEffect)(() => { |
| 2075 |
isInitialLocationRef.current = false; |
| 2076 |
}, [location]); |
| 2077 |
(0, import_element13.useEffect)(() => { |
| 2078 |
if (isInitialLocationRef.current) { |
| 2079 |
return; |
| 2080 |
} |
| 2081 |
if (routeTitle && typeof routeTitle === "string" && siteTitle && typeof siteTitle === "string") { |
| 2082 |
const decodedRouteTitle = (0, import_html_entities2.decodeEntities)(routeTitle); |
| 2083 |
const decodedSiteTitle = (0, import_html_entities2.decodeEntities)(siteTitle); |
| 2084 |
const formattedTitle = (0, import_i18n9.sprintf)( |
| 2085 |
/* translators: Admin document title. 1: Admin screen name, 2: Site name. */ |
| 2086 |
(0, import_i18n9.__)("%1$s \u2039 %2$s \u2014 WordPress"), |
| 2087 |
decodedRouteTitle, |
| 2088 |
decodedSiteTitle |
| 2089 |
); |
| 2090 |
document.title = formattedTitle; |
| 2091 |
if (decodedRouteTitle) { |
| 2092 |
speak(decodedRouteTitle, "assertive"); |
| 2093 |
} |
| 2094 |
} |
| 2095 |
}, [routeTitle, siteTitle, location]); |
| 2096 |
} |
| 2097 |
|
| 2098 |
// packages/boot/build-module/components/user-theme-provider/index.mjs |
| 2099 |
var import_theme = __toESM(require_theme(), 1); |
| 2100 |
var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1); |
| 2101 |
var ThemeProvider = unlock(import_theme.privateApis).ThemeProvider; |
| 2102 |
var THEME_PRIMARY_COLORS = /* @__PURE__ */ new Map([ |
| 2103 |
["light", "#0085ba"], |
| 2104 |
["modern", "#3858e9"], |
| 2105 |
["blue", "#096484"], |
| 2106 |
["coffee", "#46403c"], |
| 2107 |
["ectoplasm", "#523f6d"], |
| 2108 |
["midnight", "#e14d43"], |
| 2109 |
["ocean", "#627c83"], |
| 2110 |
["sunrise", "#dd823b"] |
| 2111 |
]); |
| 2112 |
function getAdminThemePrimaryColor() { |
| 2113 |
const theme = document.body.className.match(/admin-color-([a-z]+)/)?.[1]; |
| 2114 |
return theme && THEME_PRIMARY_COLORS.get(theme); |
| 2115 |
} |
| 2116 |
function UserThemeProvider({ |
| 2117 |
color, |
| 2118 |
...restProps |
| 2119 |
}) { |
| 2120 |
const primary = getAdminThemePrimaryColor(); |
| 2121 |
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ThemeProvider, { ...restProps, color: { primary, ...color } }); |
| 2122 |
} |
| 2123 |
|
| 2124 |
// packages/boot/build-module/components/root/index.mjs |
| 2125 |
var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1); |
| 2126 |
if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='516e599613']")) { |
| 2127 |
const style = document.createElement("style"); |
| 2128 |
style.setAttribute("data-wp-hash", "516e599613"); |
| 2129 |
style.appendChild(document.createTextNode(".boot-layout{background:var(--wpds-color-bg-surface-neutral-weak,#f0f0f0);color:var(--wpds-color-fg-content-neutral,#1e1e1e);display:flex;flex-direction:row;height:100%;isolation:isolate;width:100%}.boot-layout__sidebar-backdrop{background-color:#00000080;bottom:0;cursor:pointer;left:0;position:fixed;right:0;top:0;z-index:100002}.boot-layout__sidebar{flex-shrink:0;height:100%;overflow:hidden;position:relative;width:240px}.boot-layout__sidebar.is-mobile{background:var(--wpds-color-bg-surface-neutral-weak,#f0f0f0);bottom:0;box-shadow:2px 0 8px #0003;inset-inline-start:0;max-width:85vw;position:fixed;top:0;width:300px;z-index:100003}.boot-layout__mobile-sidebar-drawer{left:0;position:fixed;right:0;top:0}.boot-layout--single-page .boot-layout__mobile-sidebar-drawer{top:46px}.boot-layout__mobile-sidebar-drawer{align-items:center;background:var(--wpds-color-bg-surface-neutral,#f8f8f8);border-bottom:1px solid var(--wpds-color-stroke-surface-neutral-weak,#e0e0e0);display:flex;justify-content:flex-start;padding:16px;z-index:3}.boot-layout__canvas.has-mobile-drawer{padding-top:65px;position:relative}.boot-layout__surfaces{display:flex;flex-grow:1;gap:8px;margin:0}@media (min-width:782px){.boot-layout__surfaces{margin:8px}.boot-layout--single-page .boot-layout__surfaces{margin-top:0;margin-inline-start:0}}.boot-layout__inspector,.boot-layout__stage{background:var(--wpds-color-bg-surface-neutral,#f8f8f8);border-radius:0;bottom:0;color:var(--wpds-color-fg-content-neutral,#1e1e1e);flex:1;height:100vh;left:0;margin:0;overflow-y:auto;position:relative;position:fixed;right:0;top:0;width:100vw}.boot-layout--single-page .boot-layout__inspector,.boot-layout--single-page .boot-layout__stage{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.boot-layout__inspector,.boot-layout__stage{border-radius:8px;height:auto;margin:0;position:static;width:auto}.boot-layout--single-page .boot-layout__inspector,.boot-layout--single-page .boot-layout__stage{height:auto}}.boot-layout__stage{z-index:2}@media (min-width:782px){.boot-layout__stage{z-index:auto}}.boot-layout__inspector{z-index:3}@media (min-width:782px){.boot-layout__inspector{z-index:auto}}.boot-layout__canvas{background:var(--wpds-color-bg-surface-neutral,#f8f8f8);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#e0e0e0);border-radius:0;bottom:0;box-shadow:0 1px 3px #0000001a;color:var(--wpds-color-fg-content-neutral,#1e1e1e);flex:1;height:100vh;left:0;margin:0;overflow-y:auto;position:relative;position:fixed;right:0;top:0;width:100vw;z-index:1}.boot-layout--single-page .boot-layout__canvas{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.boot-layout__canvas{border-radius:8px;height:auto;position:static;width:auto;z-index:auto}.boot-layout--single-page .boot-layout__canvas{height:auto}.boot-layout.has-canvas .boot-layout__stage,.boot-layout__inspector{max-width:400px}}.boot-layout__canvas .interface-interface-skeleton{height:100%;left:0!important;position:relative;top:0!important}.boot-layout.has-full-canvas .boot-layout__surfaces{gap:0;margin:0}.boot-layout.has-full-canvas .boot-layout__inspector,.boot-layout.has-full-canvas .boot-layout__stage{display:none}.boot-layout.has-full-canvas .boot-layout__canvas{border:none;border-radius:0;bottom:0;box-shadow:none;left:0;margin:0;max-width:none;overflow:hidden;position:fixed;right:0;top:0}.boot-layout--single-page .boot-layout.has-full-canvas .boot-layout__canvas{top:46px}@media (min-width:782px){.boot-layout--single-page .boot-layout.has-full-canvas .boot-layout__canvas{top:32px}}")); |
| 2130 |
document.head.appendChild(style); |
| 2131 |
} |
| 2132 |
var { useLocation: useLocation2, useMatches: useMatches3, Outlet } = unlock(routePrivateApis5); |
| 2133 |
function Root() { |
| 2134 |
const matches = useMatches3(); |
| 2135 |
const location = useLocation2(); |
| 2136 |
const currentMatch = matches[matches.length - 1]; |
| 2137 |
const canvas = currentMatch?.loaderData?.canvas; |
| 2138 |
const routeContentModule = currentMatch?.loaderData?.routeContentModule; |
| 2139 |
const isFullScreen = canvas && !canvas.isPreview; |
| 2140 |
useRouteTitle(); |
| 2141 |
const isMobileViewport = (0, import_compose4.useViewportMatch)("medium", "<"); |
| 2142 |
const [isMobileSidebarOpen, setIsMobileSidebarOpen] = (0, import_element14.useState)(false); |
| 2143 |
const disableMotion = (0, import_compose4.useReducedMotion)(); |
| 2144 |
(0, import_element14.useEffect)(() => { |
| 2145 |
setIsMobileSidebarOpen(false); |
| 2146 |
}, [location.pathname, isMobileViewport]); |
| 2147 |
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_components14.SlotFillProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(UserThemeProvider, { isRoot: true, color: { bg: "#f8f8f8" }, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(UserThemeProvider, { color: { bg: "#1d2327" }, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)( |
| 2148 |
"div", |
| 2149 |
{ |
| 2150 |
className: clsx_default("boot-layout", { |
| 2151 |
"has-canvas": !!canvas || canvas === null, |
| 2152 |
"has-full-canvas": isFullScreen |
| 2153 |
}), |
| 2154 |
children: [ |
| 2155 |
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(SavePanel, {}), |
| 2156 |
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_notices.SnackbarNotices, { className: "boot-notices__snackbar" }), |
| 2157 |
isMobileViewport && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(page_default.SidebarToggleFill, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)( |
| 2158 |
import_components14.Button, |
| 2159 |
{ |
| 2160 |
icon: menu_default, |
| 2161 |
onClick: () => setIsMobileSidebarOpen(true), |
| 2162 |
label: (0, import_i18n10.__)("Open navigation panel"), |
| 2163 |
size: "compact" |
| 2164 |
} |
| 2165 |
) }), |
| 2166 |
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_components14.__unstableAnimatePresence, { children: isMobileViewport && isMobileSidebarOpen && !isFullScreen && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)( |
| 2167 |
import_components14.__unstableMotion.div, |
| 2168 |
{ |
| 2169 |
initial: { opacity: 0 }, |
| 2170 |
animate: { opacity: 1 }, |
| 2171 |
exit: { opacity: 0 }, |
| 2172 |
transition: { |
| 2173 |
type: "tween", |
| 2174 |
duration: disableMotion ? 0 : 0.2, |
| 2175 |
ease: "easeOut" |
| 2176 |
}, |
| 2177 |
className: "boot-layout__sidebar-backdrop", |
| 2178 |
onClick: () => setIsMobileSidebarOpen(false), |
| 2179 |
onKeyDown: (event) => { |
| 2180 |
if (event.key === "Escape") { |
| 2181 |
setIsMobileSidebarOpen(false); |
| 2182 |
} |
| 2183 |
}, |
| 2184 |
role: "button", |
| 2185 |
tabIndex: -1, |
| 2186 |
"aria-label": (0, import_i18n10.__)( |
| 2187 |
"Close navigation panel" |
| 2188 |
) |
| 2189 |
} |
| 2190 |
) }), |
| 2191 |
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_components14.__unstableAnimatePresence, { children: isMobileViewport && isMobileSidebarOpen && !isFullScreen && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)( |
| 2192 |
import_components14.__unstableMotion.div, |
| 2193 |
{ |
| 2194 |
initial: { x: "-100%" }, |
| 2195 |
animate: { x: 0 }, |
| 2196 |
exit: { x: "-100%" }, |
| 2197 |
transition: { |
| 2198 |
type: "tween", |
| 2199 |
duration: disableMotion ? 0 : 0.2, |
| 2200 |
ease: "easeOut" |
| 2201 |
}, |
| 2202 |
className: "boot-layout__sidebar is-mobile", |
| 2203 |
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Sidebar, {}) |
| 2204 |
} |
| 2205 |
) }), |
| 2206 |
!isMobileViewport && !isFullScreen && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "boot-layout__sidebar", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Sidebar, {}) }), |
| 2207 |
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "boot-layout__surfaces", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(UserThemeProvider, { color: { bg: "#ffffff" }, children: [ |
| 2208 |
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Outlet, {}), |
| 2209 |
(canvas || canvas === null) && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)( |
| 2210 |
"div", |
| 2211 |
{ |
| 2212 |
className: clsx_default( |
| 2213 |
"boot-layout__canvas", |
| 2214 |
{ |
| 2215 |
"has-mobile-drawer": canvas?.isPreview && isMobileViewport |
| 2216 |
} |
| 2217 |
), |
| 2218 |
children: [ |
| 2219 |
canvas?.isPreview && isMobileViewport && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "boot-layout__mobile-sidebar-drawer", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)( |
| 2220 |
import_components14.Button, |
| 2221 |
{ |
| 2222 |
icon: menu_default, |
| 2223 |
onClick: () => setIsMobileSidebarOpen( |
| 2224 |
true |
| 2225 |
), |
| 2226 |
label: (0, import_i18n10.__)( |
| 2227 |
"Open navigation panel" |
| 2228 |
), |
| 2229 |
size: "compact" |
| 2230 |
} |
| 2231 |
) }), |
| 2232 |
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)( |
| 2233 |
CanvasRenderer, |
| 2234 |
{ |
| 2235 |
canvas, |
| 2236 |
routeContentModule |
| 2237 |
} |
| 2238 |
) |
| 2239 |
] |
| 2240 |
} |
| 2241 |
) |
| 2242 |
] }) }) |
| 2243 |
] |
| 2244 |
} |
| 2245 |
) }) }) }); |
| 2246 |
} |
| 2247 |
|
| 2248 |
// packages/boot/build-module/components/app/router.mjs |
| 2249 |
var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1); |
| 2250 |
var { |
| 2251 |
createLazyRoute, |
| 2252 |
createRouter, |
| 2253 |
createRootRoute, |
| 2254 |
createRoute, |
| 2255 |
RouterProvider, |
| 2256 |
createBrowserHistory, |
| 2257 |
parseHref, |
| 2258 |
useLoaderData |
| 2259 |
} = unlock(routePrivateApis6); |
| 2260 |
function NotFoundComponent() { |
| 2261 |
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "boot-layout__stage", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(page_default, { title: (0, import_i18n11.__)("Route not found"), hasPadding: true, children: (0, import_i18n11.__)("The page you're looking for does not exist") }) }); |
| 2262 |
} |
| 2263 |
function createRouteFromDefinition(route, parentRoute) { |
| 2264 |
let tanstackRoute = createRoute({ |
| 2265 |
getParentRoute: () => parentRoute, |
| 2266 |
path: route.path, |
| 2267 |
beforeLoad: async (opts) => { |
| 2268 |
if (route.route_module) { |
| 2269 |
const module = await import(route.route_module); |
| 2270 |
const routeConfig = module.route || {}; |
| 2271 |
if (routeConfig.beforeLoad) { |
| 2272 |
return routeConfig.beforeLoad({ |
| 2273 |
params: opts.params || {}, |
| 2274 |
search: opts.search || {} |
| 2275 |
}); |
| 2276 |
} |
| 2277 |
} |
| 2278 |
}, |
| 2279 |
loader: async (opts) => { |
| 2280 |
let routeConfig = {}; |
| 2281 |
if (route.route_module) { |
| 2282 |
const module = await import(route.route_module); |
| 2283 |
routeConfig = module.route || {}; |
| 2284 |
} |
| 2285 |
const context = { |
| 2286 |
params: opts.params || {}, |
| 2287 |
search: opts.deps || {} |
| 2288 |
}; |
| 2289 |
const [, loaderData, canvasData, titleData] = await Promise.all([ |
| 2290 |
(0, import_data10.resolveSelect)(import_core_data6.store).getEntityRecord( |
| 2291 |
"root", |
| 2292 |
"__unstableBase" |
| 2293 |
), |
| 2294 |
routeConfig.loader ? routeConfig.loader(context) : Promise.resolve(void 0), |
| 2295 |
routeConfig.canvas ? routeConfig.canvas(context) : Promise.resolve(void 0), |
| 2296 |
routeConfig.title ? routeConfig.title(context) : Promise.resolve(void 0) |
| 2297 |
]); |
| 2298 |
let inspector = true; |
| 2299 |
if (routeConfig.inspector) { |
| 2300 |
inspector = await routeConfig.inspector(context); |
| 2301 |
} |
| 2302 |
return { |
| 2303 |
...loaderData, |
| 2304 |
canvas: canvasData, |
| 2305 |
inspector, |
| 2306 |
title: titleData, |
| 2307 |
routeContentModule: route.content_module |
| 2308 |
}; |
| 2309 |
}, |
| 2310 |
loaderDeps: (opts) => opts.search |
| 2311 |
}); |
| 2312 |
tanstackRoute = tanstackRoute.lazy(async () => { |
| 2313 |
const module = route.content_module ? await import(route.content_module) : {}; |
| 2314 |
const Stage = module.stage; |
| 2315 |
const Inspector = module.inspector; |
| 2316 |
return createLazyRoute(route.path)({ |
| 2317 |
component: function RouteComponent() { |
| 2318 |
const { inspector: showInspector } = useLoaderData({ from: route.path }) ?? {}; |
| 2319 |
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [ |
| 2320 |
Stage && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "boot-layout__stage", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Stage, {}) }), |
| 2321 |
Inspector && showInspector && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "boot-layout__inspector", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Inspector, {}) }) |
| 2322 |
] }); |
| 2323 |
} |
| 2324 |
}); |
| 2325 |
}); |
| 2326 |
return tanstackRoute; |
| 2327 |
} |
| 2328 |
function createRouteTree(routes, rootComponent = Root) { |
| 2329 |
const rootRoute = createRootRoute({ |
| 2330 |
component: rootComponent, |
| 2331 |
context: () => ({}) |
| 2332 |
}); |
| 2333 |
const dynamicRoutes = routes.map( |
| 2334 |
(route) => createRouteFromDefinition(route, rootRoute) |
| 2335 |
); |
| 2336 |
return rootRoute.addChildren(dynamicRoutes); |
| 2337 |
} |
| 2338 |
function createPathHistory() { |
| 2339 |
return createBrowserHistory({ |
| 2340 |
parseLocation: () => { |
| 2341 |
const url = new URL(window.location.href); |
| 2342 |
const path = url.searchParams.get("p") || "/"; |
| 2343 |
const pathHref = `${path}${url.hash}`; |
| 2344 |
return parseHref(pathHref, window.history.state); |
| 2345 |
}, |
| 2346 |
createHref: (href) => { |
| 2347 |
const searchParams = new URLSearchParams(window.location.search); |
| 2348 |
searchParams.set("p", href); |
| 2349 |
return `${window.location.pathname}?${searchParams}`; |
| 2350 |
} |
| 2351 |
}); |
| 2352 |
} |
| 2353 |
function Router({ |
| 2354 |
routes, |
| 2355 |
rootComponent = Root |
| 2356 |
}) { |
| 2357 |
const router = (0, import_element15.useMemo)(() => { |
| 2358 |
const history = createPathHistory(); |
| 2359 |
const routeTree = createRouteTree(routes, rootComponent); |
| 2360 |
return createRouter({ |
| 2361 |
history, |
| 2362 |
routeTree, |
| 2363 |
defaultPreload: "intent", |
| 2364 |
defaultNotFoundComponent: NotFoundComponent, |
| 2365 |
defaultViewTransition: { |
| 2366 |
types: ({ |
| 2367 |
fromLocation |
| 2368 |
}) => { |
| 2369 |
if (!fromLocation) { |
| 2370 |
return false; |
| 2371 |
} |
| 2372 |
return ["navigate"]; |
| 2373 |
} |
| 2374 |
} |
| 2375 |
}); |
| 2376 |
}, [routes, rootComponent]); |
| 2377 |
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(RouterProvider, { router }); |
| 2378 |
} |
| 2379 |
|
| 2380 |
// packages/boot/build-module/components/root/single-page.mjs |
| 2381 |
var import_notices2 = __toESM(require_notices(), 1); |
| 2382 |
var import_components15 = __toESM(require_components(), 1); |
| 2383 |
import { privateApis as routePrivateApis7 } from "@wordpress/route"; |
| 2384 |
var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1); |
| 2385 |
if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='516e599613']")) { |
| 2386 |
const style = document.createElement("style"); |
| 2387 |
style.setAttribute("data-wp-hash", "516e599613"); |
| 2388 |
style.appendChild(document.createTextNode(".boot-layout{background:var(--wpds-color-bg-surface-neutral-weak,#f0f0f0);color:var(--wpds-color-fg-content-neutral,#1e1e1e);display:flex;flex-direction:row;height:100%;isolation:isolate;width:100%}.boot-layout__sidebar-backdrop{background-color:#00000080;bottom:0;cursor:pointer;left:0;position:fixed;right:0;top:0;z-index:100002}.boot-layout__sidebar{flex-shrink:0;height:100%;overflow:hidden;position:relative;width:240px}.boot-layout__sidebar.is-mobile{background:var(--wpds-color-bg-surface-neutral-weak,#f0f0f0);bottom:0;box-shadow:2px 0 8px #0003;inset-inline-start:0;max-width:85vw;position:fixed;top:0;width:300px;z-index:100003}.boot-layout__mobile-sidebar-drawer{left:0;position:fixed;right:0;top:0}.boot-layout--single-page .boot-layout__mobile-sidebar-drawer{top:46px}.boot-layout__mobile-sidebar-drawer{align-items:center;background:var(--wpds-color-bg-surface-neutral,#f8f8f8);border-bottom:1px solid var(--wpds-color-stroke-surface-neutral-weak,#e0e0e0);display:flex;justify-content:flex-start;padding:16px;z-index:3}.boot-layout__canvas.has-mobile-drawer{padding-top:65px;position:relative}.boot-layout__surfaces{display:flex;flex-grow:1;gap:8px;margin:0}@media (min-width:782px){.boot-layout__surfaces{margin:8px}.boot-layout--single-page .boot-layout__surfaces{margin-top:0;margin-inline-start:0}}.boot-layout__inspector,.boot-layout__stage{background:var(--wpds-color-bg-surface-neutral,#f8f8f8);border-radius:0;bottom:0;color:var(--wpds-color-fg-content-neutral,#1e1e1e);flex:1;height:100vh;left:0;margin:0;overflow-y:auto;position:relative;position:fixed;right:0;top:0;width:100vw}.boot-layout--single-page .boot-layout__inspector,.boot-layout--single-page .boot-layout__stage{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.boot-layout__inspector,.boot-layout__stage{border-radius:8px;height:auto;margin:0;position:static;width:auto}.boot-layout--single-page .boot-layout__inspector,.boot-layout--single-page .boot-layout__stage{height:auto}}.boot-layout__stage{z-index:2}@media (min-width:782px){.boot-layout__stage{z-index:auto}}.boot-layout__inspector{z-index:3}@media (min-width:782px){.boot-layout__inspector{z-index:auto}}.boot-layout__canvas{background:var(--wpds-color-bg-surface-neutral,#f8f8f8);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#e0e0e0);border-radius:0;bottom:0;box-shadow:0 1px 3px #0000001a;color:var(--wpds-color-fg-content-neutral,#1e1e1e);flex:1;height:100vh;left:0;margin:0;overflow-y:auto;position:relative;position:fixed;right:0;top:0;width:100vw;z-index:1}.boot-layout--single-page .boot-layout__canvas{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.boot-layout__canvas{border-radius:8px;height:auto;position:static;width:auto;z-index:auto}.boot-layout--single-page .boot-layout__canvas{height:auto}.boot-layout.has-canvas .boot-layout__stage,.boot-layout__inspector{max-width:400px}}.boot-layout__canvas .interface-interface-skeleton{height:100%;left:0!important;position:relative;top:0!important}.boot-layout.has-full-canvas .boot-layout__surfaces{gap:0;margin:0}.boot-layout.has-full-canvas .boot-layout__inspector,.boot-layout.has-full-canvas .boot-layout__stage{display:none}.boot-layout.has-full-canvas .boot-layout__canvas{border:none;border-radius:0;bottom:0;box-shadow:none;left:0;margin:0;max-width:none;overflow:hidden;position:fixed;right:0;top:0}.boot-layout--single-page .boot-layout.has-full-canvas .boot-layout__canvas{top:46px}@media (min-width:782px){.boot-layout--single-page .boot-layout.has-full-canvas .boot-layout__canvas{top:32px}}")); |
| 2389 |
document.head.appendChild(style); |
| 2390 |
} |
| 2391 |
var { useMatches: useMatches4, Outlet: Outlet2 } = unlock(routePrivateApis7); |
| 2392 |
function RootSinglePage() { |
| 2393 |
const matches = useMatches4(); |
| 2394 |
const currentMatch = matches[matches.length - 1]; |
| 2395 |
const canvas = currentMatch?.loaderData?.canvas; |
| 2396 |
const routeContentModule = currentMatch?.loaderData?.routeContentModule; |
| 2397 |
const isFullScreen = canvas && !canvas.isPreview; |
| 2398 |
useRouteTitle(); |
| 2399 |
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_components15.SlotFillProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(UserThemeProvider, { isRoot: true, color: { bg: "#f8f8f8" }, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(UserThemeProvider, { color: { bg: "#1d2327" }, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)( |
| 2400 |
"div", |
| 2401 |
{ |
| 2402 |
className: clsx_default( |
| 2403 |
"boot-layout boot-layout--single-page", |
| 2404 |
{ |
| 2405 |
"has-canvas": !!canvas || canvas === null, |
| 2406 |
"has-full-canvas": isFullScreen |
| 2407 |
} |
| 2408 |
), |
| 2409 |
children: [ |
| 2410 |
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(SavePanel, {}), |
| 2411 |
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_notices2.SnackbarNotices, { className: "boot-notices__snackbar" }), |
| 2412 |
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "boot-layout__surfaces", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(UserThemeProvider, { color: { bg: "#ffffff" }, children: [ |
| 2413 |
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Outlet2, {}), |
| 2414 |
(canvas || canvas === null) && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "boot-layout__canvas", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)( |
| 2415 |
CanvasRenderer, |
| 2416 |
{ |
| 2417 |
canvas, |
| 2418 |
routeContentModule |
| 2419 |
} |
| 2420 |
) }) |
| 2421 |
] }) }) |
| 2422 |
] |
| 2423 |
} |
| 2424 |
) }) }) }); |
| 2425 |
} |
| 2426 |
|
| 2427 |
// packages/boot/build-module/components/app/index.mjs |
| 2428 |
var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1); |
| 2429 |
function App({ rootComponent }) { |
| 2430 |
const routes = (0, import_data11.useSelect)((select) => select(store).getRoutes(), []); |
| 2431 |
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Router, { routes, rootComponent }); |
| 2432 |
} |
| 2433 |
async function init({ |
| 2434 |
mountId, |
| 2435 |
menuItems, |
| 2436 |
routes, |
| 2437 |
initModules, |
| 2438 |
dashboardLink |
| 2439 |
}) { |
| 2440 |
(menuItems ?? []).forEach((menuItem) => { |
| 2441 |
(0, import_data11.dispatch)(store).registerMenuItem(menuItem.id, menuItem); |
| 2442 |
}); |
| 2443 |
(routes ?? []).forEach((route) => { |
| 2444 |
(0, import_data11.dispatch)(store).registerRoute(route); |
| 2445 |
}); |
| 2446 |
if (dashboardLink) { |
| 2447 |
(0, import_data11.dispatch)(store).setDashboardLink(dashboardLink); |
| 2448 |
} |
| 2449 |
for (const moduleId of initModules ?? []) { |
| 2450 |
const module = await import(moduleId); |
| 2451 |
await module.init(); |
| 2452 |
} |
| 2453 |
const rootElement = document.getElementById(mountId); |
| 2454 |
if (rootElement) { |
| 2455 |
const root = (0, import_element16.createRoot)(rootElement); |
| 2456 |
root.render( |
| 2457 |
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_element16.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(App, {}) }) |
| 2458 |
); |
| 2459 |
} |
| 2460 |
} |
| 2461 |
async function initSinglePage({ |
| 2462 |
mountId, |
| 2463 |
routes |
| 2464 |
}) { |
| 2465 |
(routes ?? []).forEach((route) => { |
| 2466 |
(0, import_data11.dispatch)(store).registerRoute(route); |
| 2467 |
}); |
| 2468 |
const rootElement = document.getElementById(mountId); |
| 2469 |
if (rootElement) { |
| 2470 |
const root = (0, import_element16.createRoot)(rootElement); |
| 2471 |
root.render( |
| 2472 |
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_element16.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(App, { rootComponent: RootSinglePage }) }) |
| 2473 |
); |
| 2474 |
} |
| 2475 |
} |
| 2476 |
|
| 2477 |
// packages/boot/build-module/index.mjs |
| 2478 |
if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='8ff03df9ec']")) { |
| 2479 |
const style = document.createElement("style"); |
| 2480 |
style.setAttribute("data-wp-hash", "8ff03df9ec"); |
| 2481 |
style.appendChild(document.createTextNode(':root{--wpds-border-radius-lg:8px;--wpds-border-radius-md:4px;--wpds-border-radius-sm:2px;--wpds-border-radius-xs:1px;--wpds-border-width-focus:2px;--wpds-border-width-lg:8px;--wpds-border-width-md:4px;--wpds-border-width-sm:2px;--wpds-border-width-xs:1px;--wpds-color-bg-interactive-brand-strong:#3858e9;--wpds-color-bg-interactive-brand-strong-active:#2e49d9;--wpds-color-bg-interactive-brand-weak:#0000;--wpds-color-bg-interactive-brand-weak-active:#e6eaf4;--wpds-color-bg-interactive-error:#0000;--wpds-color-bg-interactive-error-active:#fff6f4;--wpds-color-bg-interactive-error-strong:#cc1818;--wpds-color-bg-interactive-error-strong-active:#b90000;--wpds-color-bg-interactive-error-weak:#0000;--wpds-color-bg-interactive-error-weak-active:#f6e6e3;--wpds-color-bg-interactive-neutral-strong:#2d2d2d;--wpds-color-bg-interactive-neutral-strong-active:#1e1e1e;--wpds-color-bg-interactive-neutral-strong-disabled:#e2e2e2;--wpds-color-bg-interactive-neutral-weak:#0000;--wpds-color-bg-interactive-neutral-weak-active:#eaeaea;--wpds-color-bg-interactive-neutral-weak-disabled:#0000;--wpds-color-bg-surface-brand:#ecf0f9;--wpds-color-bg-surface-caution:#fee994;--wpds-color-bg-surface-caution-weak:#fff9c9;--wpds-color-bg-surface-error:#f6e6e3;--wpds-color-bg-surface-error-weak:#fff6f4;--wpds-color-bg-surface-info:#deebfa;--wpds-color-bg-surface-info-weak:#f2f9ff;--wpds-color-bg-surface-neutral:#f8f8f8;--wpds-color-bg-surface-neutral-strong:#fff;--wpds-color-bg-surface-neutral-weak:#f0f0f0;--wpds-color-bg-surface-success:#c5f7cc;--wpds-color-bg-surface-success-weak:#eaffed;--wpds-color-bg-surface-warning:#fde6bd;--wpds-color-bg-surface-warning-weak:#fff7e0;--wpds-color-bg-thumb-brand:#3858e9;--wpds-color-bg-thumb-brand-active:#3858e9;--wpds-color-bg-thumb-neutral-disabled:#d8d8d8;--wpds-color-bg-thumb-neutral-weak:#8a8a8a;--wpds-color-bg-thumb-neutral-weak-active:#6c6c6c;--wpds-color-bg-track-neutral:#d8d8d8;--wpds-color-bg-track-neutral-weak:#e0e0e0;--wpds-color-fg-content-caution:#281d00;--wpds-color-fg-content-caution-weak:#826a00;--wpds-color-fg-content-error:#470000;--wpds-color-fg-content-error-weak:#cc1818;--wpds-color-fg-content-info:#001b4f;--wpds-color-fg-content-info-weak:#006bd7;--wpds-color-fg-content-neutral:#1e1e1e;--wpds-color-fg-content-neutral-weak:#6d6d6d;--wpds-color-fg-content-success:#002900;--wpds-color-fg-content-success-weak:#007f30;--wpds-color-fg-content-warning:#2e1900;--wpds-color-fg-content-warning-weak:#926300;--wpds-color-fg-interactive-brand:#3858e9;--wpds-color-fg-interactive-brand-active:#3858e9;--wpds-color-fg-interactive-brand-strong:#eff0f2;--wpds-color-fg-interactive-brand-strong-active:#eff0f2;--wpds-color-fg-interactive-error:#cc1818;--wpds-color-fg-interactive-error-active:#cc1818;--wpds-color-fg-interactive-error-strong:#f2efef;--wpds-color-fg-interactive-error-strong-active:#f2efef;--wpds-color-fg-interactive-neutral:#1e1e1e;--wpds-color-fg-interactive-neutral-active:#1e1e1e;--wpds-color-fg-interactive-neutral-disabled:#8a8a8a;--wpds-color-fg-interactive-neutral-strong:#f0f0f0;--wpds-color-fg-interactive-neutral-strong-active:#f0f0f0;--wpds-color-fg-interactive-neutral-strong-disabled:#8a8a8a;--wpds-color-fg-interactive-neutral-weak:#6d6d6d;--wpds-color-fg-interactive-neutral-weak-disabled:#8a8a8a;--wpds-color-stroke-focus-brand:#3858e9;--wpds-color-stroke-interactive-brand:#3858e9;--wpds-color-stroke-interactive-brand-active:#2337c8;--wpds-color-stroke-interactive-error:#cc1818;--wpds-color-stroke-interactive-error-active:#9d0000;--wpds-color-stroke-interactive-error-strong:#cc1818;--wpds-color-stroke-interactive-neutral:#8a8a8a;--wpds-color-stroke-interactive-neutral-active:#6c6c6c;--wpds-color-stroke-interactive-neutral-disabled:#d8d8d8;--wpds-color-stroke-interactive-neutral-strong:#6c6c6c;--wpds-color-stroke-surface-brand:#a3b1d4;--wpds-color-stroke-surface-brand-strong:#3858e9;--wpds-color-stroke-surface-error:#daa39b;--wpds-color-stroke-surface-error-strong:#cc1818;--wpds-color-stroke-surface-info:#9fbcdc;--wpds-color-stroke-surface-info-strong:#006bd7;--wpds-color-stroke-surface-neutral:#d8d8d8;--wpds-color-stroke-surface-neutral-strong:#8a8a8a;--wpds-color-stroke-surface-neutral-weak:#e0e0e0;--wpds-color-stroke-surface-success:#8ac894;--wpds-color-stroke-surface-success-strong:#007f30;--wpds-color-stroke-surface-warning:#d0b381;--wpds-color-stroke-surface-warning-strong:#926300;--wpds-cursor-control:pointer;--wpds-dimension-base:4px;--wpds-dimension-gap-2xl:32px;--wpds-dimension-gap-3xl:40px;--wpds-dimension-gap-lg:16px;--wpds-dimension-gap-md:12px;--wpds-dimension-gap-sm:8px;--wpds-dimension-gap-xl:24px;--wpds-dimension-gap-xs:4px;--wpds-dimension-padding-2xl:24px;--wpds-dimension-padding-3xl:32px;--wpds-dimension-padding-lg:16px;--wpds-dimension-padding-md:12px;--wpds-dimension-padding-sm:8px;--wpds-dimension-padding-xl:20px;--wpds-dimension-padding-xs:4px;--wpds-dimension-surface-width-2xl:960px;--wpds-dimension-surface-width-lg:560px;--wpds-dimension-surface-width-md:400px;--wpds-dimension-surface-width-sm:320px;--wpds-dimension-surface-width-xl:720px;--wpds-dimension-surface-width-xs:240px;--wpds-elevation-lg:0 5px 15px 0 #00000014,0 15px 27px 0 #00000012,0 30px 36px 0 #0000000a,0 50px 43px 0 #00000005;--wpds-elevation-md:0 2px 3px 0 #0000000d,0 4px 5px 0 #0000000a,0 12px 12px 0 #00000008,0 16px 16px 0 #00000005;--wpds-elevation-sm:0 1px 2px 0 #0000000d,0 2px 3px 0 #0000000a,0 6px 6px 0 #00000008,0 8px 8px 0 #00000005;--wpds-elevation-xs:0 1px 1px 0 #00000008,0 1px 2px 0 #00000005,0 3px 3px 0 #00000005,0 4px 4px 0 #00000003;--wpds-font-family-body:-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif;--wpds-font-family-heading:-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif;--wpds-font-family-mono:"Menlo","Consolas",monaco,monospace;--wpds-font-line-height-2xl:40px;--wpds-font-line-height-lg:28px;--wpds-font-line-height-md:24px;--wpds-font-line-height-sm:20px;--wpds-font-line-height-xl:32px;--wpds-font-line-height-xs:16px;--wpds-font-size-2xl:32px;--wpds-font-size-lg:15px;--wpds-font-size-md:13px;--wpds-font-size-sm:12px;--wpds-font-size-xl:20px;--wpds-font-size-xs:11px;--wpds-font-weight-medium:499;--wpds-font-weight-regular:400}[data-wpds-theme-provider-id][data-wpds-density=compact]{--wpds-dimension-gap-2xl:24px;--wpds-dimension-gap-3xl:32px;--wpds-dimension-gap-lg:12px;--wpds-dimension-gap-md:8px;--wpds-dimension-gap-sm:4px;--wpds-dimension-gap-xl:20px;--wpds-dimension-gap-xs:4px;--wpds-dimension-padding-2xl:20px;--wpds-dimension-padding-3xl:24px;--wpds-dimension-padding-lg:12px;--wpds-dimension-padding-md:8px;--wpds-dimension-padding-sm:4px;--wpds-dimension-padding-xl:16px;--wpds-dimension-padding-xs:4px}[data-wpds-theme-provider-id][data-wpds-density=comfortable]{--wpds-dimension-gap-2xl:40px;--wpds-dimension-gap-3xl:48px;--wpds-dimension-gap-lg:20px;--wpds-dimension-gap-md:16px;--wpds-dimension-gap-sm:12px;--wpds-dimension-gap-xl:32px;--wpds-dimension-gap-xs:8px;--wpds-dimension-padding-2xl:32px;--wpds-dimension-padding-3xl:40px;--wpds-dimension-padding-lg:20px;--wpds-dimension-padding-md:16px;--wpds-dimension-padding-sm:12px;--wpds-dimension-padding-xl:24px;--wpds-dimension-padding-xs:8px}[data-wpds-theme-provider-id][data-wpds-density=default]{--wpds-dimension-base:4px;--wpds-dimension-gap-2xl:32px;--wpds-dimension-gap-3xl:40px;--wpds-dimension-gap-lg:16px;--wpds-dimension-gap-md:12px;--wpds-dimension-gap-sm:8px;--wpds-dimension-gap-xl:24px;--wpds-dimension-gap-xs:4px;--wpds-dimension-padding-2xl:24px;--wpds-dimension-padding-3xl:32px;--wpds-dimension-padding-lg:16px;--wpds-dimension-padding-md:12px;--wpds-dimension-padding-sm:8px;--wpds-dimension-padding-xl:20px;--wpds-dimension-padding-xs:4px;--wpds-dimension-surface-width-2xl:960px;--wpds-dimension-surface-width-lg:560px;--wpds-dimension-surface-width-md:400px;--wpds-dimension-surface-width-sm:320px;--wpds-dimension-surface-width-xl:720px;--wpds-dimension-surface-width-xs:240px}@media (-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){:root{--wpds-border-width-focus:1.5px}}.admin-ui-page{text-wrap:pretty;background-color:var(--wpds-color-bg-surface-neutral-strong,#fff);color:var(--wpds-color-fg-content-neutral,#1e1e1e);display:flex;flex-flow:column;height:100%;position:relative;z-index:1}.admin-ui-page__header{background:var(--wpds-color-bg-surface-neutral-strong,#fff);border-bottom:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral-weak,#e0e0e0);padding:var(--wpds-dimension-padding-md,12px) var(--wpds-dimension-padding-2xl,24px);position:sticky;top:0;z-index:1}.admin-ui-page__header-title{font-family:var(--wpds-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-font-size-lg,15px);font-weight:var(--wpds-font-weight-medium,499);line-height:var(--wpds-font-line-height-lg,28px);margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.admin-ui-page__sidebar-toggle-slot:empty{display:none}.admin-ui-page__header-subtitle{color:var(--wpds-color-fg-content-neutral-weak,#6d6d6d);font-size:var(--wpds-font-size-md,13px);line-height:var(--wpds-font-line-height-md,24px);margin:0;padding-block-end:var(--wpds-dimension-padding-xs,4px)}.admin-ui-page__content{display:flex;flex-direction:column;flex-grow:1;overflow:auto}.admin-ui-page__content.has-padding{padding:var(--wpds-dimension-padding-lg,16px) var(--wpds-dimension-padding-2xl,24px)}.show-icon-labels .admin-ui-page__header-actions .components-button.has-icon{padding:0 var(--wpds-dimension-padding-xs,4px);width:auto}.show-icon-labels .admin-ui-page__header-actions .components-button.has-icon svg{display:none}.show-icon-labels .admin-ui-page__header-actions .components-button.has-icon:after{content:attr(aria-label);font-size:var(--wpds-font-size-sm,12px)}.admin-ui-breadcrumbs__list{font-family:var(--wpds-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-font-size-lg,15px);font-weight:var(--wpds-font-weight-medium,499);gap:0;line-height:var(--wpds-font-line-height-lg,28px);list-style:none;margin:0;min-height:32px;padding:0}.admin-ui-breadcrumbs__list li:not(:last-child):after{content:"/";margin:0 8px}.admin-ui-breadcrumbs__list h1{font-size:inherit;line-height:inherit}@media (min-width:600px){.boot-layout-container .boot-layout{bottom:0;left:0;min-height:calc(100vh - 46px);position:absolute;right:0;top:0}}@media (min-width:782px){.boot-layout-container .boot-layout{min-height:calc(100vh - 32px)}body:has(.boot-layout.has-full-canvas) .boot-layout-container .boot-layout{min-height:100vh}}.boot-layout-container .boot-layout img{height:auto;max-width:100%}.boot-layout .boot-notices__snackbar{bottom:24px;box-sizing:border-box;display:flex;flex-direction:column;left:0;padding-inline:16px;pointer-events:none;position:fixed;right:0}.boot-layout .boot-notices__snackbar .components-snackbar{margin-inline:auto}')); |
| 2482 |
document.head.appendChild(style); |
| 2483 |
} |
| 2484 |
if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='cc217bc358']")) { |
| 2485 |
const style = document.createElement("style"); |
| 2486 |
style.setAttribute("data-wp-hash", "cc217bc358"); |
| 2487 |
style.appendChild(document.createTextNode("@media (max-width:782px){*{view-transition-name:none!important}}::view-transition-new(root),::view-transition-old(root){animation-duration:.25s}@media not (prefers-reduced-motion:reduce){.boot-layout__canvas .interface-interface-skeleton__header{view-transition-name:boot--canvas-header}.boot-layout__canvas .interface-interface-skeleton__sidebar{view-transition-name:boot--canvas-sidebar}.boot-layout.has-full-canvas .boot-layout__canvas .boot-site-icon-link,.boot-layout:not(.has-full-canvas) .boot-site-hub .boot-site-icon-link{view-transition-name:boot--site-icon-link}.boot-layout__stage{view-transition-name:boot--stage}.boot-layout__inspector{view-transition-name:boot--inspector}.boot-layout__canvas.is-full-canvas .interface-interface-skeleton__content,.boot-layout__canvas:not(.is-full-canvas){view-transition-name:boot--canvas}@supports (-webkit-hyphens:none) and (not (-moz-appearance:none)){.boot-layout__stage{view-transition-name:boot-safari--stage}.boot-layout__inspector{view-transition-name:boot-safari--inspector}.boot-layout__canvas.is-full-canvas .interface-interface-skeleton__content,.boot-layout__canvas:not(.is-full-canvas){view-transition-name:boot-safari--canvas}}.components-popover:first-of-type{view-transition-name:boot--components-popover}}::view-transition-group(boot--canvas),::view-transition-group(boot--canvas-header),::view-transition-group(boot--canvas-sidebar),::view-transition-group(boot-safari--canvas){z-index:1}::view-transition-group(boot--site-icon-link){z-index:2}::view-transition-new(boot--site-icon-link),::view-transition-old(boot--site-icon-link){animation:none}::view-transition-new(boot-safari--canvas),::view-transition-new(boot-safari--inspector),::view-transition-new(boot-safari--stage),::view-transition-old(boot-safari--canvas),::view-transition-old(boot-safari--inspector),::view-transition-old(boot-safari--stage){width:auto}::view-transition-new(boot--canvas),::view-transition-new(boot--inspector),::view-transition-new(boot--stage),::view-transition-old(boot--canvas),::view-transition-old(boot--inspector),::view-transition-old(boot--stage){background:#fff;border-radius:8px;height:100%;object-fit:none;object-position:left top;overflow:hidden;width:100%}::view-transition-new(boot--canvas),::view-transition-old(boot--canvas){object-position:center top}::view-transition-old(boot--inspector):only-child,::view-transition-old(boot--stage):only-child,::view-transition-old(boot-safari--inspector):only-child,::view-transition-old(boot-safari--stage):only-child{animation-name:zoomOut;will-change:transform,opacity}::view-transition-new(boot--inspector):only-child,::view-transition-new(boot--stage):only-child,::view-transition-new(boot-safari--inspector):only-child,::view-transition-new(boot-safari--stage):only-child{animation-name:zoomIn;will-change:transform,opacity}@keyframes zoomOut{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@keyframes zoomIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}::view-transition-new(boot--canvas):only-child,::view-transition-new(boot-safari--canvas):only-child{animation-name:slideFromRight;will-change:transform}::view-transition-old(boot--canvas):only-child,::view-transition-old(boot-safari--canvas):only-child{animation-name:slideToRight;will-change:transform}@keyframes slideFromRight{0%{transform:translateX(100vw)}to{transform:translateX(0)}}@keyframes slideToRight{0%{transform:translateX(0)}to{transform:translateX(100vw)}}::view-transition-new(boot--canvas-header):only-child{animation-name:slideHeaderFromTop;will-change:transform}::view-transition-old(boot--canvas-header):only-child{animation-name:slideHeaderToTop;will-change:transform}@keyframes slideHeaderFromTop{0%{transform:translateY(-100%)}}@keyframes slideHeaderToTop{to{transform:translateY(-100%)}}::view-transition-new(boot--canvas-sidebar):only-child{animation-name:slideSidebarFromRight;will-change:transform}::view-transition-old(boot--canvas-sidebar):only-child{animation-name:slideSidebarToRight;will-change:transform}@keyframes slideSidebarFromRight{0%{transform:translateX(100%)}}@keyframes slideSidebarToRight{to{transform:translateX(100%)}}")); |
| 2488 |
document.head.appendChild(style); |
| 2489 |
} |
| 2490 |
export { |
| 2491 |
init, |
| 2492 |
initSinglePage, |
| 2493 |
store |
| 2494 |
}; |
| 2495 |
//# sourceMappingURL=index.js.map |
| 2496 |
|