| 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 |
// package-external:@wordpress/core-data |
| 67 |
var require_core_data = __commonJS({ |
| 68 |
"package-external:@wordpress/core-data"(exports, module) { |
| 69 |
module.exports = window.wp.coreData; |
| 70 |
} |
| 71 |
}); |
| 72 |
|
| 73 |
// package-external:@wordpress/editor |
| 74 |
var require_editor = __commonJS({ |
| 75 |
"package-external:@wordpress/editor"(exports, module) { |
| 76 |
module.exports = window.wp.editor; |
| 77 |
} |
| 78 |
}); |
| 79 |
|
| 80 |
// package-external:@wordpress/compose |
| 81 |
var require_compose = __commonJS({ |
| 82 |
"package-external:@wordpress/compose"(exports, module) { |
| 83 |
module.exports = window.wp.compose; |
| 84 |
} |
| 85 |
}); |
| 86 |
|
| 87 |
// package-external:@wordpress/primitives |
| 88 |
var require_primitives = __commonJS({ |
| 89 |
"package-external:@wordpress/primitives"(exports, module) { |
| 90 |
module.exports = window.wp.primitives; |
| 91 |
} |
| 92 |
}); |
| 93 |
|
| 94 |
// package-external:@wordpress/html-entities |
| 95 |
var require_html_entities = __commonJS({ |
| 96 |
"package-external:@wordpress/html-entities"(exports, module) { |
| 97 |
module.exports = window.wp.htmlEntities; |
| 98 |
} |
| 99 |
}); |
| 100 |
|
| 101 |
// package-external:@wordpress/keycodes |
| 102 |
var require_keycodes = __commonJS({ |
| 103 |
"package-external:@wordpress/keycodes"(exports, module) { |
| 104 |
module.exports = window.wp.keycodes; |
| 105 |
} |
| 106 |
}); |
| 107 |
|
| 108 |
// package-external:@wordpress/commands |
| 109 |
var require_commands = __commonJS({ |
| 110 |
"package-external:@wordpress/commands"(exports, module) { |
| 111 |
module.exports = window.wp.commands; |
| 112 |
} |
| 113 |
}); |
| 114 |
|
| 115 |
// package-external:@wordpress/url |
| 116 |
var require_url = __commonJS({ |
| 117 |
"package-external:@wordpress/url"(exports, module) { |
| 118 |
module.exports = window.wp.url; |
| 119 |
} |
| 120 |
}); |
| 121 |
|
| 122 |
// package-external:@wordpress/private-apis |
| 123 |
var require_private_apis = __commonJS({ |
| 124 |
"package-external:@wordpress/private-apis"(exports, module) { |
| 125 |
module.exports = window.wp.privateApis; |
| 126 |
} |
| 127 |
}); |
| 128 |
|
| 129 |
// package-external:@wordpress/keyboard-shortcuts |
| 130 |
var require_keyboard_shortcuts = __commonJS({ |
| 131 |
"package-external:@wordpress/keyboard-shortcuts"(exports, module) { |
| 132 |
module.exports = window.wp.keyboardShortcuts; |
| 133 |
} |
| 134 |
}); |
| 135 |
|
| 136 |
// package-external:@wordpress/theme |
| 137 |
var require_theme = __commonJS({ |
| 138 |
"package-external:@wordpress/theme"(exports, module) { |
| 139 |
module.exports = window.wp.theme; |
| 140 |
} |
| 141 |
}); |
| 142 |
|
| 143 |
// packages/boot/build-module/components/app/index.mjs |
| 144 |
var import_element15 = __toESM(require_element(), 1); |
| 145 |
var import_data11 = __toESM(require_data(), 1); |
| 146 |
|
| 147 |
// packages/boot/build-module/components/app/router.mjs |
| 148 |
var import_i18n11 = __toESM(require_i18n(), 1); |
| 149 |
var import_element14 = __toESM(require_element(), 1); |
| 150 |
|
| 151 |
// node_modules/clsx/dist/clsx.mjs |
| 152 |
function r(e) { |
| 153 |
var t, f, n = ""; |
| 154 |
if ("string" == typeof e || "number" == typeof e) n += e; |
| 155 |
else if ("object" == typeof e) if (Array.isArray(e)) { |
| 156 |
var o = e.length; |
| 157 |
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f); |
| 158 |
} else for (f in e) e[f] && (n && (n += " "), n += f); |
| 159 |
return n; |
| 160 |
} |
| 161 |
function clsx() { |
| 162 |
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t); |
| 163 |
return n; |
| 164 |
} |
| 165 |
var clsx_default = clsx; |
| 166 |
|
| 167 |
// packages/admin-ui/build-module/navigable-region/index.mjs |
| 168 |
var import_element = __toESM(require_element(), 1); |
| 169 |
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); |
| 170 |
var NavigableRegion = (0, import_element.forwardRef)( |
| 171 |
({ children, className, ariaLabel, as: Tag = "div", ...props }, ref) => { |
| 172 |
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( |
| 173 |
Tag, |
| 174 |
{ |
| 175 |
ref, |
| 176 |
className: clsx_default("admin-ui-navigable-region", className), |
| 177 |
"aria-label": ariaLabel, |
| 178 |
role: "region", |
| 179 |
tabIndex: "-1", |
| 180 |
...props, |
| 181 |
children |
| 182 |
} |
| 183 |
); |
| 184 |
} |
| 185 |
); |
| 186 |
NavigableRegion.displayName = "NavigableRegion"; |
| 187 |
var navigable_region_default = NavigableRegion; |
| 188 |
|
| 189 |
// packages/admin-ui/build-module/page/header.mjs |
| 190 |
var import_components2 = __toESM(require_components(), 1); |
| 191 |
|
| 192 |
// packages/admin-ui/build-module/page/sidebar-toggle-slot.mjs |
| 193 |
var import_components = __toESM(require_components(), 1); |
| 194 |
var { Fill: SidebarToggleFill, Slot: SidebarToggleSlot } = (0, import_components.createSlotFill)("SidebarToggle"); |
| 195 |
|
| 196 |
// packages/admin-ui/build-module/page/header.mjs |
| 197 |
var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); |
| 198 |
function Header({ |
| 199 |
breadcrumbs, |
| 200 |
badges, |
| 201 |
title, |
| 202 |
subTitle, |
| 203 |
actions, |
| 204 |
showSidebarToggle = true |
| 205 |
}) { |
| 206 |
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_components2.__experimentalVStack, { className: "admin-ui-page__header", as: "header", children: [ |
| 207 |
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_components2.__experimentalHStack, { justify: "space-between", spacing: 2, children: [ |
| 208 |
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_components2.__experimentalHStack, { spacing: 2, justify: "left", children: [ |
| 209 |
showSidebarToggle && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)( |
| 210 |
SidebarToggleSlot, |
| 211 |
{ |
| 212 |
bubblesVirtually: true, |
| 213 |
className: "admin-ui-page__sidebar-toggle-slot" |
| 214 |
} |
| 215 |
), |
| 216 |
title && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_components2.__experimentalHeading, { as: "h2", level: 3, weight: 500, truncate: true, children: title }), |
| 217 |
breadcrumbs, |
| 218 |
badges |
| 219 |
] }), |
| 220 |
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)( |
| 221 |
import_components2.__experimentalHStack, |
| 222 |
{ |
| 223 |
style: { width: "auto", flexShrink: 0 }, |
| 224 |
spacing: 2, |
| 225 |
className: "admin-ui-page__header-actions", |
| 226 |
children: actions |
| 227 |
} |
| 228 |
) |
| 229 |
] }), |
| 230 |
subTitle && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "admin-ui-page__header-subtitle", children: subTitle }) |
| 231 |
] }); |
| 232 |
} |
| 233 |
|
| 234 |
// packages/admin-ui/build-module/page/index.mjs |
| 235 |
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1); |
| 236 |
function Page({ |
| 237 |
breadcrumbs, |
| 238 |
badges, |
| 239 |
title, |
| 240 |
subTitle, |
| 241 |
children, |
| 242 |
className, |
| 243 |
actions, |
| 244 |
hasPadding = false, |
| 245 |
showSidebarToggle = true |
| 246 |
}) { |
| 247 |
const classes = clsx_default("admin-ui-page", className); |
| 248 |
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(navigable_region_default, { className: classes, ariaLabel: title, children: [ |
| 249 |
(title || breadcrumbs || badges) && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)( |
| 250 |
Header, |
| 251 |
{ |
| 252 |
breadcrumbs, |
| 253 |
badges, |
| 254 |
title, |
| 255 |
subTitle, |
| 256 |
actions, |
| 257 |
showSidebarToggle |
| 258 |
} |
| 259 |
), |
| 260 |
hasPadding ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "admin-ui-page__content has-padding", children }) : children |
| 261 |
] }); |
| 262 |
} |
| 263 |
Page.SidebarToggleFill = SidebarToggleFill; |
| 264 |
var page_default = Page; |
| 265 |
|
| 266 |
// packages/boot/build-module/components/app/router.mjs |
| 267 |
var import_data10 = __toESM(require_data(), 1); |
| 268 |
var import_core_data6 = __toESM(require_core_data(), 1); |
| 269 |
import { |
| 270 |
privateApis as routePrivateApis6 |
| 271 |
} from "@wordpress/route"; |
| 272 |
|
| 273 |
// packages/boot/build-module/components/root/index.mjs |
| 274 |
var import_editor4 = __toESM(require_editor(), 1); |
| 275 |
var import_compose4 = __toESM(require_compose(), 1); |
| 276 |
var import_components15 = __toESM(require_components(), 1); |
| 277 |
import { privateApis as routePrivateApis5 } from "@wordpress/route"; |
| 278 |
|
| 279 |
// packages/icons/build-module/icon/index.mjs |
| 280 |
var import_element2 = __toESM(require_element(), 1); |
| 281 |
var icon_default = (0, import_element2.forwardRef)( |
| 282 |
({ icon, size = 24, ...props }, ref) => { |
| 283 |
return (0, import_element2.cloneElement)(icon, { |
| 284 |
width: size, |
| 285 |
height: size, |
| 286 |
...props, |
| 287 |
ref |
| 288 |
}); |
| 289 |
} |
| 290 |
); |
| 291 |
|
| 292 |
// packages/icons/build-module/library/arrow-up-left.mjs |
| 293 |
var import_primitives = __toESM(require_primitives(), 1); |
| 294 |
var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1); |
| 295 |
var arrow_up_left_default = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives.Path, { d: "M14 6H6v8h1.5V8.5L17 18l1-1-9.5-9.5H14V6Z" }) }); |
| 296 |
|
| 297 |
// packages/icons/build-module/library/check.mjs |
| 298 |
var import_primitives2 = __toESM(require_primitives(), 1); |
| 299 |
var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1); |
| 300 |
var check_default = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime5.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" }) }); |
| 301 |
|
| 302 |
// packages/icons/build-module/library/chevron-down-small.mjs |
| 303 |
var import_primitives3 = __toESM(require_primitives(), 1); |
| 304 |
var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1); |
| 305 |
var chevron_down_small_default = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives3.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime6.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" }) }); |
| 306 |
|
| 307 |
// packages/icons/build-module/library/chevron-left-small.mjs |
| 308 |
var import_primitives4 = __toESM(require_primitives(), 1); |
| 309 |
var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1); |
| 310 |
var chevron_left_small_default = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime7.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" }) }); |
| 311 |
|
| 312 |
// packages/icons/build-module/library/chevron-left.mjs |
| 313 |
var import_primitives5 = __toESM(require_primitives(), 1); |
| 314 |
var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1); |
| 315 |
var chevron_left_default = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives5.Path, { d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" }) }); |
| 316 |
|
| 317 |
// packages/icons/build-module/library/chevron-right-small.mjs |
| 318 |
var import_primitives6 = __toESM(require_primitives(), 1); |
| 319 |
var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1); |
| 320 |
var chevron_right_small_default = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives6.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime9.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" }) }); |
| 321 |
|
| 322 |
// packages/icons/build-module/library/chevron-right.mjs |
| 323 |
var import_primitives7 = __toESM(require_primitives(), 1); |
| 324 |
var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1); |
| 325 |
var chevron_right_default = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives7.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives7.Path, { d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" }) }); |
| 326 |
|
| 327 |
// packages/icons/build-module/library/menu.mjs |
| 328 |
var import_primitives8 = __toESM(require_primitives(), 1); |
| 329 |
var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1); |
| 330 |
var menu_default = /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives8.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives8.Path, { d: "M5 5v1.5h14V5H5zm0 7.8h14v-1.5H5v1.5zM5 19h14v-1.5H5V19z" }) }); |
| 331 |
|
| 332 |
// packages/icons/build-module/library/search.mjs |
| 333 |
var import_primitives9 = __toESM(require_primitives(), 1); |
| 334 |
var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1); |
| 335 |
var search_default = /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives9.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime12.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" }) }); |
| 336 |
|
| 337 |
// packages/icons/build-module/library/wordpress.mjs |
| 338 |
var import_primitives10 = __toESM(require_primitives(), 1); |
| 339 |
var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1); |
| 340 |
var wordpress_default = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives10.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "-2 -2 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime13.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" }) }); |
| 341 |
|
| 342 |
// packages/boot/build-module/components/root/index.mjs |
| 343 |
var import_element13 = __toESM(require_element(), 1); |
| 344 |
var import_i18n10 = __toESM(require_i18n(), 1); |
| 345 |
|
| 346 |
// packages/boot/build-module/components/site-hub/index.mjs |
| 347 |
var import_data3 = __toESM(require_data(), 1); |
| 348 |
var import_components4 = __toESM(require_components(), 1); |
| 349 |
var import_i18n2 = __toESM(require_i18n(), 1); |
| 350 |
var import_core_data2 = __toESM(require_core_data(), 1); |
| 351 |
var import_html_entities = __toESM(require_html_entities(), 1); |
| 352 |
var import_keycodes = __toESM(require_keycodes(), 1); |
| 353 |
var import_commands = __toESM(require_commands(), 1); |
| 354 |
var import_url = __toESM(require_url(), 1); |
| 355 |
|
| 356 |
// packages/boot/build-module/components/site-icon-link/index.mjs |
| 357 |
var import_components3 = __toESM(require_components(), 1); |
| 358 |
import { Link, privateApis as routePrivateApis } from "@wordpress/route"; |
| 359 |
|
| 360 |
// packages/boot/build-module/lock-unlock.mjs |
| 361 |
var import_private_apis = __toESM(require_private_apis(), 1); |
| 362 |
var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)( |
| 363 |
"I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.", |
| 364 |
"@wordpress/boot" |
| 365 |
); |
| 366 |
|
| 367 |
// packages/boot/build-module/components/site-icon/index.mjs |
| 368 |
var import_data = __toESM(require_data(), 1); |
| 369 |
var import_i18n = __toESM(require_i18n(), 1); |
| 370 |
var import_core_data = __toESM(require_core_data(), 1); |
| 371 |
var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1); |
| 372 |
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='376fa74cd0']")) { |
| 373 |
const style = document.createElement("style"); |
| 374 |
style.setAttribute("data-wp-hash", "376fa74cd0"); |
| 375 |
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}")); |
| 376 |
document.head.appendChild(style); |
| 377 |
} |
| 378 |
function SiteIcon({ className }) { |
| 379 |
const { isRequestingSite, siteIconUrl } = (0, import_data.useSelect)((select) => { |
| 380 |
const { getEntityRecord } = select(import_core_data.store); |
| 381 |
const siteData = getEntityRecord( |
| 382 |
"root", |
| 383 |
"__unstableBase", |
| 384 |
void 0 |
| 385 |
); |
| 386 |
return { |
| 387 |
isRequestingSite: !siteData, |
| 388 |
siteIconUrl: siteData?.site_icon_url |
| 389 |
}; |
| 390 |
}, []); |
| 391 |
let icon = null; |
| 392 |
if (isRequestingSite && !siteIconUrl) { |
| 393 |
icon = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "boot-site-icon__image" }); |
| 394 |
} else { |
| 395 |
icon = siteIconUrl ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)( |
| 396 |
"img", |
| 397 |
{ |
| 398 |
className: "boot-site-icon__image", |
| 399 |
alt: (0, import_i18n.__)("Site Icon"), |
| 400 |
src: siteIconUrl |
| 401 |
} |
| 402 |
) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)( |
| 403 |
icon_default, |
| 404 |
{ |
| 405 |
className: "boot-site-icon__icon", |
| 406 |
icon: wordpress_default, |
| 407 |
size: 48 |
| 408 |
} |
| 409 |
); |
| 410 |
} |
| 411 |
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: clsx_default(className, "boot-site-icon"), children: icon }); |
| 412 |
} |
| 413 |
var site_icon_default = SiteIcon; |
| 414 |
|
| 415 |
// packages/boot/build-module/components/site-icon-link/index.mjs |
| 416 |
var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1); |
| 417 |
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='31ab300853']")) { |
| 418 |
const style = document.createElement("style"); |
| 419 |
style.setAttribute("data-wp-hash", "31ab300853"); |
| 420 |
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,2px) solid var(--wpds-color-stroke-focus-brand,#0073aa);outline-offset:calc(var(--wpds-border-width-focus, 2px)*-1)}")); |
| 421 |
document.head.appendChild(style); |
| 422 |
} |
| 423 |
var { useCanGoBack, useRouter } = unlock(routePrivateApis); |
| 424 |
function SiteIconLink({ |
| 425 |
to, |
| 426 |
isBackButton, |
| 427 |
...props |
| 428 |
}) { |
| 429 |
const router = useRouter(); |
| 430 |
const canGoBack = useCanGoBack(); |
| 431 |
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_components3.Tooltip, { text: props["aria-label"], placement: "right", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)( |
| 432 |
Link, |
| 433 |
{ |
| 434 |
to, |
| 435 |
"aria-label": props["aria-label"], |
| 436 |
className: "boot-site-icon-link", |
| 437 |
onClick: (event) => { |
| 438 |
if (canGoBack && isBackButton) { |
| 439 |
event.preventDefault(); |
| 440 |
router.history.back(); |
| 441 |
} |
| 442 |
}, |
| 443 |
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(site_icon_default, {}) |
| 444 |
} |
| 445 |
) }); |
| 446 |
} |
| 447 |
var site_icon_link_default = SiteIconLink; |
| 448 |
|
| 449 |
// packages/boot/build-module/store/index.mjs |
| 450 |
var import_data2 = __toESM(require_data(), 1); |
| 451 |
|
| 452 |
// packages/boot/build-module/store/reducer.mjs |
| 453 |
var initialState = { |
| 454 |
menuItems: {}, |
| 455 |
routes: [], |
| 456 |
dashboardLink: void 0 |
| 457 |
}; |
| 458 |
function reducer(state = initialState, action) { |
| 459 |
switch (action.type) { |
| 460 |
case "REGISTER_MENU_ITEM": |
| 461 |
return { |
| 462 |
...state, |
| 463 |
menuItems: { |
| 464 |
...state.menuItems, |
| 465 |
[action.id]: action.menuItem |
| 466 |
} |
| 467 |
}; |
| 468 |
case "UPDATE_MENU_ITEM": |
| 469 |
return { |
| 470 |
...state, |
| 471 |
menuItems: { |
| 472 |
...state.menuItems, |
| 473 |
[action.id]: { |
| 474 |
...state.menuItems[action.id], |
| 475 |
...action.updates |
| 476 |
} |
| 477 |
} |
| 478 |
}; |
| 479 |
case "REGISTER_ROUTE": |
| 480 |
return { |
| 481 |
...state, |
| 482 |
routes: [...state.routes, action.route] |
| 483 |
}; |
| 484 |
case "SET_DASHBOARD_LINK": |
| 485 |
return { |
| 486 |
...state, |
| 487 |
dashboardLink: action.dashboardLink |
| 488 |
}; |
| 489 |
} |
| 490 |
return state; |
| 491 |
} |
| 492 |
|
| 493 |
// packages/boot/build-module/store/actions.mjs |
| 494 |
var actions_exports = {}; |
| 495 |
__export(actions_exports, { |
| 496 |
registerMenuItem: () => registerMenuItem, |
| 497 |
registerRoute: () => registerRoute, |
| 498 |
setDashboardLink: () => setDashboardLink, |
| 499 |
updateMenuItem: () => updateMenuItem |
| 500 |
}); |
| 501 |
function registerMenuItem(id, menuItem) { |
| 502 |
return { |
| 503 |
type: "REGISTER_MENU_ITEM", |
| 504 |
id, |
| 505 |
menuItem |
| 506 |
}; |
| 507 |
} |
| 508 |
function updateMenuItem(id, updates) { |
| 509 |
return { |
| 510 |
type: "UPDATE_MENU_ITEM", |
| 511 |
id, |
| 512 |
updates |
| 513 |
}; |
| 514 |
} |
| 515 |
function registerRoute(route) { |
| 516 |
return { |
| 517 |
type: "REGISTER_ROUTE", |
| 518 |
route |
| 519 |
}; |
| 520 |
} |
| 521 |
function setDashboardLink(dashboardLink) { |
| 522 |
return { |
| 523 |
type: "SET_DASHBOARD_LINK", |
| 524 |
dashboardLink |
| 525 |
}; |
| 526 |
} |
| 527 |
|
| 528 |
// packages/boot/build-module/store/selectors.mjs |
| 529 |
var selectors_exports = {}; |
| 530 |
__export(selectors_exports, { |
| 531 |
getDashboardLink: () => getDashboardLink, |
| 532 |
getMenuItems: () => getMenuItems, |
| 533 |
getRoutes: () => getRoutes |
| 534 |
}); |
| 535 |
function getMenuItems(state) { |
| 536 |
return Object.values(state.menuItems); |
| 537 |
} |
| 538 |
function getRoutes(state) { |
| 539 |
return state.routes; |
| 540 |
} |
| 541 |
function getDashboardLink(state) { |
| 542 |
return state.dashboardLink; |
| 543 |
} |
| 544 |
|
| 545 |
// packages/boot/build-module/store/index.mjs |
| 546 |
var STORE_NAME = "wordpress/boot"; |
| 547 |
var store = (0, import_data2.createReduxStore)(STORE_NAME, { |
| 548 |
reducer, |
| 549 |
actions: actions_exports, |
| 550 |
selectors: selectors_exports |
| 551 |
}); |
| 552 |
(0, import_data2.register)(store); |
| 553 |
|
| 554 |
// packages/boot/build-module/components/site-hub/index.mjs |
| 555 |
var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1); |
| 556 |
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='4bf1d1aa8a']")) { |
| 557 |
const style = document.createElement("style"); |
| 558 |
style.setAttribute("data-wp-hash", "4bf1d1aa8a"); |
| 559 |
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,2px) solid var(--wpds-color-stroke-focus-brand,#0073aa);outline-offset:calc(var(--wpds-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,#757575);font-size:12px}")); |
| 560 |
document.head.appendChild(style); |
| 561 |
} |
| 562 |
function SiteHub() { |
| 563 |
const { dashboardLink, homeUrl, siteTitle } = (0, import_data3.useSelect)((select) => { |
| 564 |
const { getEntityRecord } = select(import_core_data2.store); |
| 565 |
const _base = getEntityRecord( |
| 566 |
"root", |
| 567 |
"__unstableBase" |
| 568 |
); |
| 569 |
return { |
| 570 |
dashboardLink: select(store).getDashboardLink(), |
| 571 |
homeUrl: _base?.home, |
| 572 |
siteTitle: !_base?.name && !!_base?.url ? (0, import_url.filterURLForDisplay)(_base?.url) : _base?.name |
| 573 |
}; |
| 574 |
}, []); |
| 575 |
const { open: openCommandCenter } = (0, import_data3.useDispatch)(import_commands.store); |
| 576 |
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "boot-site-hub", children: [ |
| 577 |
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)( |
| 578 |
site_icon_link_default, |
| 579 |
{ |
| 580 |
to: dashboardLink || "/", |
| 581 |
"aria-label": (0, import_i18n2.__)("Go to the Dashboard") |
| 582 |
} |
| 583 |
), |
| 584 |
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)( |
| 585 |
import_components4.ExternalLink, |
| 586 |
{ |
| 587 |
href: homeUrl ?? "/", |
| 588 |
className: "boot-site-hub__title", |
| 589 |
children: [ |
| 590 |
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "boot-site-hub__title-text", children: siteTitle && (0, import_html_entities.decodeEntities)(siteTitle) }), |
| 591 |
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "boot-site-hub__url", children: (0, import_url.filterURLForDisplay)(homeUrl ?? "") }) |
| 592 |
] |
| 593 |
} |
| 594 |
), |
| 595 |
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_components4.__experimentalHStack, { className: "boot-site-hub__actions", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)( |
| 596 |
import_components4.Button, |
| 597 |
{ |
| 598 |
variant: "tertiary", |
| 599 |
icon: search_default, |
| 600 |
onClick: () => openCommandCenter(), |
| 601 |
size: "compact", |
| 602 |
label: (0, import_i18n2.__)("Open command palette"), |
| 603 |
shortcut: import_keycodes.displayShortcut.primary("k") |
| 604 |
} |
| 605 |
) }) |
| 606 |
] }); |
| 607 |
} |
| 608 |
var site_hub_default = SiteHub; |
| 609 |
|
| 610 |
// packages/boot/build-module/components/navigation/index.mjs |
| 611 |
var import_element6 = __toESM(require_element(), 1); |
| 612 |
var import_data6 = __toESM(require_data(), 1); |
| 613 |
|
| 614 |
// packages/boot/build-module/components/navigation/navigation-item/index.mjs |
| 615 |
var import_components7 = __toESM(require_components(), 1); |
| 616 |
|
| 617 |
// packages/boot/build-module/components/navigation/router-link-item.mjs |
| 618 |
var import_element3 = __toESM(require_element(), 1); |
| 619 |
var import_components5 = __toESM(require_components(), 1); |
| 620 |
import { privateApis as routePrivateApis2 } from "@wordpress/route"; |
| 621 |
var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1); |
| 622 |
var { createLink } = unlock(routePrivateApis2); |
| 623 |
function AnchorOnlyItem(props, forwardedRef) { |
| 624 |
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_components5.__experimentalItem, { as: "a", ref: forwardedRef, ...props }); |
| 625 |
} |
| 626 |
var RouterLinkItem = createLink((0, import_element3.forwardRef)(AnchorOnlyItem)); |
| 627 |
var router_link_item_default = RouterLinkItem; |
| 628 |
|
| 629 |
// packages/boot/build-module/components/navigation/items.mjs |
| 630 |
var import_element4 = __toESM(require_element(), 1); |
| 631 |
var import_components6 = __toESM(require_components(), 1); |
| 632 |
var import_primitives11 = __toESM(require_primitives(), 1); |
| 633 |
var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1); |
| 634 |
function isSvg(element) { |
| 635 |
return (0, import_element4.isValidElement)(element) && (element.type === import_primitives11.SVG || element.type === "svg"); |
| 636 |
} |
| 637 |
function wrapIcon(icon, shouldShowPlaceholder = true) { |
| 638 |
if (isSvg(icon)) { |
| 639 |
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_components6.Icon, { icon }); |
| 640 |
} |
| 641 |
if (typeof icon === "string" && icon.startsWith("dashicons-")) { |
| 642 |
const iconKey = icon.replace( |
| 643 |
/^dashicons-/, |
| 644 |
"" |
| 645 |
); |
| 646 |
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)( |
| 647 |
import_components6.Dashicon, |
| 648 |
{ |
| 649 |
style: { padding: "2px" }, |
| 650 |
icon: iconKey, |
| 651 |
"aria-hidden": "true" |
| 652 |
} |
| 653 |
); |
| 654 |
} |
| 655 |
if (typeof icon === "string" && icon.startsWith("data:")) { |
| 656 |
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)( |
| 657 |
"img", |
| 658 |
{ |
| 659 |
src: icon, |
| 660 |
alt: "", |
| 661 |
"aria-hidden": "true", |
| 662 |
style: { |
| 663 |
width: "20px", |
| 664 |
height: "20px", |
| 665 |
display: "block", |
| 666 |
padding: "2px" |
| 667 |
} |
| 668 |
} |
| 669 |
); |
| 670 |
} |
| 671 |
if (icon) { |
| 672 |
return icon; |
| 673 |
} |
| 674 |
if (shouldShowPlaceholder) { |
| 675 |
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)( |
| 676 |
"div", |
| 677 |
{ |
| 678 |
style: { width: "24px", height: "24px" }, |
| 679 |
"aria-hidden": "true" |
| 680 |
} |
| 681 |
); |
| 682 |
} |
| 683 |
return null; |
| 684 |
} |
| 685 |
|
| 686 |
// packages/boot/build-module/components/navigation/navigation-item/index.mjs |
| 687 |
var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1); |
| 688 |
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='bd4708cfa8']")) { |
| 689 |
const style = document.createElement("style"); |
| 690 |
style.setAttribute("data-wp-hash", "bd4708cfa8"); |
| 691 |
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,#0073aa)}.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,#0073aa);font-weight:499}.boot-navigation-item.components-item:focus-visible{transform:translateZ(0)}.boot-navigation-item.components-item.with-suffix{padding-right:16px}')); |
| 692 |
document.head.appendChild(style); |
| 693 |
} |
| 694 |
function NavigationItem({ |
| 695 |
className, |
| 696 |
icon, |
| 697 |
shouldShowPlaceholder = true, |
| 698 |
children, |
| 699 |
to |
| 700 |
}) { |
| 701 |
const isExternal = !String( |
| 702 |
new URL(to, window.location.origin) |
| 703 |
).startsWith(window.location.origin); |
| 704 |
const content = /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_components7.__experimentalHStack, { justify: "flex-start", spacing: 2, style: { flexGrow: "1" }, children: [ |
| 705 |
wrapIcon(icon, shouldShowPlaceholder), |
| 706 |
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_components7.FlexBlock, { children }) |
| 707 |
] }); |
| 708 |
if (isExternal) { |
| 709 |
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)( |
| 710 |
import_components7.__experimentalItem, |
| 711 |
{ |
| 712 |
as: "a", |
| 713 |
href: to, |
| 714 |
className: clsx_default("boot-navigation-item", className), |
| 715 |
children: content |
| 716 |
} |
| 717 |
); |
| 718 |
} |
| 719 |
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)( |
| 720 |
router_link_item_default, |
| 721 |
{ |
| 722 |
to, |
| 723 |
className: clsx_default("boot-navigation-item", className), |
| 724 |
children: content |
| 725 |
} |
| 726 |
); |
| 727 |
} |
| 728 |
|
| 729 |
// packages/boot/build-module/components/navigation/drilldown-item/index.mjs |
| 730 |
var import_components8 = __toESM(require_components(), 1); |
| 731 |
var import_i18n3 = __toESM(require_i18n(), 1); |
| 732 |
var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1); |
| 733 |
function DrilldownItem({ |
| 734 |
className, |
| 735 |
id, |
| 736 |
icon, |
| 737 |
shouldShowPlaceholder = true, |
| 738 |
children, |
| 739 |
onNavigate |
| 740 |
}) { |
| 741 |
const handleClick = (e) => { |
| 742 |
e.preventDefault(); |
| 743 |
onNavigate({ id, direction: "forward" }); |
| 744 |
}; |
| 745 |
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)( |
| 746 |
import_components8.__experimentalItem, |
| 747 |
{ |
| 748 |
className: clsx_default("boot-navigation-item", className), |
| 749 |
onClick: handleClick, |
| 750 |
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)( |
| 751 |
import_components8.__experimentalHStack, |
| 752 |
{ |
| 753 |
justify: "flex-start", |
| 754 |
spacing: 2, |
| 755 |
style: { flexGrow: "1" }, |
| 756 |
children: [ |
| 757 |
wrapIcon(icon, shouldShowPlaceholder), |
| 758 |
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_components8.FlexBlock, { children }), |
| 759 |
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_components8.Icon, { icon: (0, import_i18n3.isRTL)() ? chevron_left_small_default : chevron_right_small_default }) |
| 760 |
] |
| 761 |
} |
| 762 |
) |
| 763 |
} |
| 764 |
); |
| 765 |
} |
| 766 |
|
| 767 |
// packages/boot/build-module/components/navigation/dropdown-item/index.mjs |
| 768 |
var import_components9 = __toESM(require_components(), 1); |
| 769 |
var import_compose = __toESM(require_compose(), 1); |
| 770 |
var import_data4 = __toESM(require_data(), 1); |
| 771 |
var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1); |
| 772 |
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='1d12353983']")) { |
| 773 |
const style = document.createElement("style"); |
| 774 |
style.setAttribute("data-wp-hash", "1d12353983"); |
| 775 |
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)}")); |
| 776 |
document.head.appendChild(style); |
| 777 |
} |
| 778 |
var ANIMATION_DURATION = 0.2; |
| 779 |
function DropdownItem({ |
| 780 |
className, |
| 781 |
id, |
| 782 |
icon, |
| 783 |
children, |
| 784 |
isExpanded, |
| 785 |
onToggle |
| 786 |
}) { |
| 787 |
const menuItems = (0, import_data4.useSelect)( |
| 788 |
(select) => ( |
| 789 |
// @ts-ignore |
| 790 |
select(STORE_NAME).getMenuItems() |
| 791 |
), |
| 792 |
[] |
| 793 |
); |
| 794 |
const items = menuItems.filter((item) => item.parent === id); |
| 795 |
const disableMotion = (0, import_compose.useReducedMotion)(); |
| 796 |
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "boot-dropdown-item", children: [ |
| 797 |
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)( |
| 798 |
import_components9.__experimentalItem, |
| 799 |
{ |
| 800 |
className: clsx_default("boot-navigation-item", className), |
| 801 |
onClick: (e) => { |
| 802 |
e.preventDefault(); |
| 803 |
e.stopPropagation(); |
| 804 |
onToggle(); |
| 805 |
}, |
| 806 |
onMouseDown: (e) => e.preventDefault(), |
| 807 |
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)( |
| 808 |
import_components9.__experimentalHStack, |
| 809 |
{ |
| 810 |
justify: "flex-start", |
| 811 |
spacing: 2, |
| 812 |
style: { flexGrow: "1" }, |
| 813 |
children: [ |
| 814 |
wrapIcon(icon, false), |
| 815 |
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_components9.FlexBlock, { children }), |
| 816 |
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)( |
| 817 |
import_components9.Icon, |
| 818 |
{ |
| 819 |
icon: chevron_down_small_default, |
| 820 |
className: clsx_default("boot-dropdown-item__chevron", { |
| 821 |
"is-up": isExpanded |
| 822 |
}) |
| 823 |
} |
| 824 |
) |
| 825 |
] |
| 826 |
} |
| 827 |
) |
| 828 |
} |
| 829 |
), |
| 830 |
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_components9.__unstableAnimatePresence, { initial: false, children: isExpanded && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)( |
| 831 |
import_components9.__unstableMotion.div, |
| 832 |
{ |
| 833 |
initial: { height: 0 }, |
| 834 |
animate: { height: "auto" }, |
| 835 |
exit: { height: 0 }, |
| 836 |
transition: { |
| 837 |
type: "tween", |
| 838 |
duration: disableMotion ? 0 : ANIMATION_DURATION, |
| 839 |
ease: "easeOut" |
| 840 |
}, |
| 841 |
className: "boot-dropdown-item__children", |
| 842 |
children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)( |
| 843 |
NavigationItem, |
| 844 |
{ |
| 845 |
to: item.to, |
| 846 |
shouldShowPlaceholder: false, |
| 847 |
children: item.label |
| 848 |
}, |
| 849 |
index |
| 850 |
)) |
| 851 |
} |
| 852 |
) }) |
| 853 |
] }); |
| 854 |
} |
| 855 |
|
| 856 |
// packages/boot/build-module/components/navigation/navigation-screen/index.mjs |
| 857 |
var import_components10 = __toESM(require_components(), 1); |
| 858 |
var import_i18n4 = __toESM(require_i18n(), 1); |
| 859 |
var import_compose2 = __toESM(require_compose(), 1); |
| 860 |
var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1); |
| 861 |
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='5b2dba18c8']")) { |
| 862 |
const style = document.createElement("style"); |
| 863 |
style.setAttribute("data-wp-hash", "5b2dba18c8"); |
| 864 |
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}")); |
| 865 |
document.head.appendChild(style); |
| 866 |
} |
| 867 |
var ANIMATION_DURATION2 = 0.3; |
| 868 |
var slideVariants = { |
| 869 |
initial: (direction) => ({ |
| 870 |
x: direction === "forward" ? 100 : -100, |
| 871 |
opacity: 0 |
| 872 |
}), |
| 873 |
animate: { |
| 874 |
x: 0, |
| 875 |
opacity: 1 |
| 876 |
}, |
| 877 |
exit: (direction) => ({ |
| 878 |
x: direction === "forward" ? 100 : -100, |
| 879 |
opacity: 0 |
| 880 |
}) |
| 881 |
}; |
| 882 |
function NavigationScreen({ |
| 883 |
isRoot, |
| 884 |
title, |
| 885 |
actions, |
| 886 |
content, |
| 887 |
description, |
| 888 |
animationDirection, |
| 889 |
backMenuItem, |
| 890 |
backButtonRef, |
| 891 |
navigationKey, |
| 892 |
onNavigate |
| 893 |
}) { |
| 894 |
const icon = (0, import_i18n4.isRTL)() ? chevron_right_default : chevron_left_default; |
| 895 |
const disableMotion = (0, import_compose2.useReducedMotion)(); |
| 896 |
const handleBackClick = (e) => { |
| 897 |
e.preventDefault(); |
| 898 |
onNavigate({ id: backMenuItem, direction: "backward" }); |
| 899 |
}; |
| 900 |
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)( |
| 901 |
"div", |
| 902 |
{ |
| 903 |
className: "boot-navigation-screen", |
| 904 |
style: { |
| 905 |
overflow: "hidden", |
| 906 |
position: "relative", |
| 907 |
display: "grid", |
| 908 |
gridTemplateColumns: "1fr", |
| 909 |
gridTemplateRows: "1fr" |
| 910 |
}, |
| 911 |
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_components10.__unstableAnimatePresence, { initial: false, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)( |
| 912 |
import_components10.__unstableMotion.div, |
| 913 |
{ |
| 914 |
custom: animationDirection, |
| 915 |
variants: slideVariants, |
| 916 |
initial: "initial", |
| 917 |
animate: "animate", |
| 918 |
exit: "exit", |
| 919 |
transition: { |
| 920 |
type: "tween", |
| 921 |
duration: disableMotion ? 0 : ANIMATION_DURATION2, |
| 922 |
ease: [0.33, 0, 0, 1] |
| 923 |
}, |
| 924 |
style: { |
| 925 |
width: "100%", |
| 926 |
gridColumn: "1", |
| 927 |
gridRow: "1" |
| 928 |
}, |
| 929 |
children: [ |
| 930 |
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)( |
| 931 |
import_components10.__experimentalHStack, |
| 932 |
{ |
| 933 |
spacing: 2, |
| 934 |
className: "boot-navigation-screen__title-icon", |
| 935 |
children: [ |
| 936 |
!isRoot && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)( |
| 937 |
import_components10.Button, |
| 938 |
{ |
| 939 |
ref: backButtonRef, |
| 940 |
icon, |
| 941 |
onClick: handleBackClick, |
| 942 |
label: (0, import_i18n4.__)("Back"), |
| 943 |
size: "small", |
| 944 |
variant: "tertiary" |
| 945 |
} |
| 946 |
), |
| 947 |
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)( |
| 948 |
import_components10.__experimentalHeading, |
| 949 |
{ |
| 950 |
className: "boot-navigation-screen__title", |
| 951 |
level: 1, |
| 952 |
size: "15px", |
| 953 |
children: title |
| 954 |
} |
| 955 |
), |
| 956 |
actions && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "boot-navigation-screen__actions", children: actions }) |
| 957 |
] |
| 958 |
} |
| 959 |
), |
| 960 |
description && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "boot-navigation-screen__description", children: description }), |
| 961 |
content |
| 962 |
] |
| 963 |
}, |
| 964 |
navigationKey |
| 965 |
) }) |
| 966 |
} |
| 967 |
); |
| 968 |
} |
| 969 |
|
| 970 |
// packages/boot/build-module/components/navigation/use-sidebar-parent.mjs |
| 971 |
var import_element5 = __toESM(require_element(), 1); |
| 972 |
var import_data5 = __toESM(require_data(), 1); |
| 973 |
import { privateApis as routePrivateApis3 } from "@wordpress/route"; |
| 974 |
|
| 975 |
// packages/boot/build-module/components/navigation/path-matching.mjs |
| 976 |
var isValidParentPath = (currentPath, menuPath) => { |
| 977 |
if (!menuPath || menuPath === currentPath) { |
| 978 |
return false; |
| 979 |
} |
| 980 |
const normalizePath = (path) => { |
| 981 |
const normalized = path.startsWith("/") ? path : "/" + path; |
| 982 |
return normalized.endsWith("/") && normalized.length > 1 ? normalized.slice(0, -1) : normalized; |
| 983 |
}; |
| 984 |
const normalizedCurrent = normalizePath(currentPath); |
| 985 |
const normalizedMenu = normalizePath(menuPath); |
| 986 |
return normalizedCurrent.startsWith(normalizedMenu) && (normalizedCurrent[normalizedMenu.length] === "/" || normalizedMenu === "/"); |
| 987 |
}; |
| 988 |
var findClosestMenuItem = (currentPath, menuItems) => { |
| 989 |
const exactMatch = menuItems.find((item) => item.to === currentPath); |
| 990 |
if (exactMatch) { |
| 991 |
return exactMatch; |
| 992 |
} |
| 993 |
let bestMatch = null; |
| 994 |
let bestPathLength = 0; |
| 995 |
for (const item of menuItems) { |
| 996 |
if (!item.to) { |
| 997 |
continue; |
| 998 |
} |
| 999 |
if (isValidParentPath(currentPath, item.to)) { |
| 1000 |
if (item.to.length > bestPathLength) { |
| 1001 |
bestMatch = item; |
| 1002 |
bestPathLength = item.to.length; |
| 1003 |
} |
| 1004 |
} |
| 1005 |
} |
| 1006 |
return bestMatch; |
| 1007 |
}; |
| 1008 |
var findDrilldownParent = (id, menuItems) => { |
| 1009 |
if (!id) { |
| 1010 |
return void 0; |
| 1011 |
} |
| 1012 |
const currentItem = menuItems.find((item) => item.id === id); |
| 1013 |
if (!currentItem) { |
| 1014 |
return void 0; |
| 1015 |
} |
| 1016 |
if (currentItem.parent) { |
| 1017 |
const parentItem = menuItems.find( |
| 1018 |
(item) => item.id === currentItem.parent |
| 1019 |
); |
| 1020 |
if (parentItem?.parent_type === "drilldown") { |
| 1021 |
return parentItem.id; |
| 1022 |
} |
| 1023 |
if (parentItem) { |
| 1024 |
return findDrilldownParent(parentItem.id, menuItems); |
| 1025 |
} |
| 1026 |
} |
| 1027 |
return void 0; |
| 1028 |
}; |
| 1029 |
var findDropdownParent = (id, menuItems) => { |
| 1030 |
if (!id) { |
| 1031 |
return void 0; |
| 1032 |
} |
| 1033 |
const currentItem = menuItems.find((item) => item.id === id); |
| 1034 |
if (!currentItem) { |
| 1035 |
return void 0; |
| 1036 |
} |
| 1037 |
if (currentItem.parent) { |
| 1038 |
const parentItem = menuItems.find( |
| 1039 |
(item) => item.id === currentItem.parent |
| 1040 |
); |
| 1041 |
if (parentItem?.parent_type === "dropdown") { |
| 1042 |
return parentItem.id; |
| 1043 |
} |
| 1044 |
} |
| 1045 |
return void 0; |
| 1046 |
}; |
| 1047 |
|
| 1048 |
// packages/boot/build-module/components/navigation/use-sidebar-parent.mjs |
| 1049 |
var { useRouter: useRouter2, useMatches } = unlock(routePrivateApis3); |
| 1050 |
function useSidebarParent() { |
| 1051 |
const matches = useMatches(); |
| 1052 |
const router = useRouter2(); |
| 1053 |
const menuItems = (0, import_data5.useSelect)( |
| 1054 |
(select) => ( |
| 1055 |
// @ts-ignore |
| 1056 |
select(STORE_NAME).getMenuItems() |
| 1057 |
), |
| 1058 |
[] |
| 1059 |
); |
| 1060 |
const currentPath = matches[matches.length - 1].pathname.slice( |
| 1061 |
router.options.basepath?.length ?? 0 |
| 1062 |
); |
| 1063 |
const currentMenuItem = findClosestMenuItem(currentPath, menuItems); |
| 1064 |
const [parentId, setParentId] = (0, import_element5.useState)( |
| 1065 |
findDrilldownParent(currentMenuItem?.id, menuItems) |
| 1066 |
); |
| 1067 |
const [parentDropdownId, setParentDropdownId] = (0, import_element5.useState)(findDropdownParent(currentMenuItem?.id, menuItems)); |
| 1068 |
(0, import_element5.useEffect)(() => { |
| 1069 |
const matchedMenuItem = findClosestMenuItem(currentPath, menuItems); |
| 1070 |
const updatedParentId = findDrilldownParent( |
| 1071 |
matchedMenuItem?.id, |
| 1072 |
menuItems |
| 1073 |
); |
| 1074 |
const updatedDropdownParent = findDropdownParent( |
| 1075 |
matchedMenuItem?.id, |
| 1076 |
menuItems |
| 1077 |
); |
| 1078 |
setParentId(updatedParentId); |
| 1079 |
setParentDropdownId(updatedDropdownParent); |
| 1080 |
}, [currentPath, menuItems]); |
| 1081 |
return [ |
| 1082 |
parentId, |
| 1083 |
setParentId, |
| 1084 |
parentDropdownId, |
| 1085 |
setParentDropdownId |
| 1086 |
]; |
| 1087 |
} |
| 1088 |
|
| 1089 |
// packages/boot/build-module/components/navigation/index.mjs |
| 1090 |
var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1); |
| 1091 |
function Navigation() { |
| 1092 |
const backButtonRef = (0, import_element6.useRef)(null); |
| 1093 |
const [animationDirection, setAnimationDirection] = (0, import_element6.useState)(null); |
| 1094 |
const [parentId, setParentId, parentDropdownId, setParentDropdownId] = useSidebarParent(); |
| 1095 |
const menuItems = (0, import_data6.useSelect)( |
| 1096 |
(select) => ( |
| 1097 |
// @ts-ignore |
| 1098 |
select(STORE_NAME).getMenuItems() |
| 1099 |
), |
| 1100 |
[] |
| 1101 |
); |
| 1102 |
const parent = (0, import_element6.useMemo)( |
| 1103 |
() => menuItems.find((item) => item.id === parentId), |
| 1104 |
[menuItems, parentId] |
| 1105 |
); |
| 1106 |
const navigationKey = parent ? `drilldown-${parent.id}` : "root"; |
| 1107 |
const handleNavigate = ({ |
| 1108 |
id, |
| 1109 |
direction |
| 1110 |
}) => { |
| 1111 |
setAnimationDirection(direction); |
| 1112 |
setParentId(id); |
| 1113 |
}; |
| 1114 |
const handleDropdownToggle = (dropdownId) => { |
| 1115 |
setParentDropdownId( |
| 1116 |
parentDropdownId === dropdownId ? void 0 : dropdownId |
| 1117 |
); |
| 1118 |
}; |
| 1119 |
const items = (0, import_element6.useMemo)( |
| 1120 |
() => menuItems.filter((item) => item.parent === parentId), |
| 1121 |
[menuItems, parentId] |
| 1122 |
); |
| 1123 |
const hasRealIcons = items.some((item) => !!item.icon); |
| 1124 |
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)( |
| 1125 |
NavigationScreen, |
| 1126 |
{ |
| 1127 |
isRoot: !parent, |
| 1128 |
title: parent ? parent.label : "", |
| 1129 |
backMenuItem: parent?.parent, |
| 1130 |
backButtonRef, |
| 1131 |
animationDirection: animationDirection || void 0, |
| 1132 |
navigationKey, |
| 1133 |
onNavigate: handleNavigate, |
| 1134 |
content: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_jsx_runtime23.Fragment, { children: items.map((item) => { |
| 1135 |
if (item.parent_type === "dropdown") { |
| 1136 |
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)( |
| 1137 |
DropdownItem, |
| 1138 |
{ |
| 1139 |
id: item.id, |
| 1140 |
className: "boot-navigation-item", |
| 1141 |
icon: item.icon, |
| 1142 |
shouldShowPlaceholder: hasRealIcons, |
| 1143 |
isExpanded: parentDropdownId === item.id, |
| 1144 |
onToggle: () => handleDropdownToggle(item.id), |
| 1145 |
children: item.label |
| 1146 |
}, |
| 1147 |
item.id |
| 1148 |
); |
| 1149 |
} |
| 1150 |
if (item.parent_type === "drilldown") { |
| 1151 |
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)( |
| 1152 |
DrilldownItem, |
| 1153 |
{ |
| 1154 |
id: item.id, |
| 1155 |
icon: item.icon, |
| 1156 |
shouldShowPlaceholder: hasRealIcons, |
| 1157 |
onNavigate: handleNavigate, |
| 1158 |
children: item.label |
| 1159 |
}, |
| 1160 |
item.id |
| 1161 |
); |
| 1162 |
} |
| 1163 |
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)( |
| 1164 |
NavigationItem, |
| 1165 |
{ |
| 1166 |
to: item.to, |
| 1167 |
icon: item.icon, |
| 1168 |
shouldShowPlaceholder: hasRealIcons, |
| 1169 |
children: item.label |
| 1170 |
}, |
| 1171 |
item.id |
| 1172 |
); |
| 1173 |
}) }) |
| 1174 |
} |
| 1175 |
); |
| 1176 |
} |
| 1177 |
var navigation_default = Navigation; |
| 1178 |
|
| 1179 |
// packages/boot/build-module/components/save-button/index.mjs |
| 1180 |
var import_element8 = __toESM(require_element(), 1); |
| 1181 |
var import_data8 = __toESM(require_data(), 1); |
| 1182 |
var import_i18n6 = __toESM(require_i18n(), 1); |
| 1183 |
var import_core_data4 = __toESM(require_core_data(), 1); |
| 1184 |
var import_keycodes2 = __toESM(require_keycodes(), 1); |
| 1185 |
var import_editor2 = __toESM(require_editor(), 1); |
| 1186 |
var import_components11 = __toESM(require_components(), 1); |
| 1187 |
|
| 1188 |
// packages/boot/build-module/components/save-panel/use-save-shortcut.mjs |
| 1189 |
var import_element7 = __toESM(require_element(), 1); |
| 1190 |
var import_keyboard_shortcuts = __toESM(require_keyboard_shortcuts(), 1); |
| 1191 |
var import_i18n5 = __toESM(require_i18n(), 1); |
| 1192 |
var import_data7 = __toESM(require_data(), 1); |
| 1193 |
var import_core_data3 = __toESM(require_core_data(), 1); |
| 1194 |
var import_editor = __toESM(require_editor(), 1); |
| 1195 |
var shortcutName = "core/boot/save"; |
| 1196 |
function useSaveShortcut({ |
| 1197 |
openSavePanel |
| 1198 |
}) { |
| 1199 |
const { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } = (0, import_data7.useSelect)(import_core_data3.store); |
| 1200 |
const { hasNonPostEntityChanges, isPostSavingLocked } = (0, import_data7.useSelect)(import_editor.store); |
| 1201 |
const { savePost } = (0, import_data7.useDispatch)(import_editor.store); |
| 1202 |
const { registerShortcut, unregisterShortcut } = (0, import_data7.useDispatch)( |
| 1203 |
import_keyboard_shortcuts.store |
| 1204 |
); |
| 1205 |
(0, import_element7.useEffect)(() => { |
| 1206 |
registerShortcut({ |
| 1207 |
name: shortcutName, |
| 1208 |
category: "global", |
| 1209 |
description: (0, import_i18n5.__)("Save your changes."), |
| 1210 |
keyCombination: { |
| 1211 |
modifier: "primary", |
| 1212 |
character: "s" |
| 1213 |
} |
| 1214 |
}); |
| 1215 |
return () => { |
| 1216 |
unregisterShortcut(shortcutName); |
| 1217 |
}; |
| 1218 |
}, [registerShortcut, unregisterShortcut]); |
| 1219 |
(0, import_keyboard_shortcuts.useShortcut)(shortcutName, (event) => { |
| 1220 |
event.preventDefault(); |
| 1221 |
const dirtyEntityRecords = __experimentalGetDirtyEntityRecords(); |
| 1222 |
const hasDirtyEntities = !!dirtyEntityRecords.length; |
| 1223 |
const isSaving = dirtyEntityRecords.some( |
| 1224 |
(record) => isSavingEntityRecord(record.kind, record.name, record.key) |
| 1225 |
); |
| 1226 |
if (!hasDirtyEntities || isSaving) { |
| 1227 |
return; |
| 1228 |
} |
| 1229 |
if (hasNonPostEntityChanges()) { |
| 1230 |
openSavePanel(); |
| 1231 |
} else if (!isPostSavingLocked()) { |
| 1232 |
savePost(); |
| 1233 |
} |
| 1234 |
}); |
| 1235 |
} |
| 1236 |
|
| 1237 |
// packages/boot/build-module/components/save-button/index.mjs |
| 1238 |
var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1); |
| 1239 |
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='fe01a7e62f']")) { |
| 1240 |
const style = document.createElement("style"); |
| 1241 |
style.setAttribute("data-wp-hash", "fe01a7e62f"); |
| 1242 |
style.appendChild(document.createTextNode(".boot-save-button{width:100%}")); |
| 1243 |
document.head.appendChild(style); |
| 1244 |
} |
| 1245 |
function SaveButton() { |
| 1246 |
const [isSaveViewOpen, setIsSaveViewOpened] = (0, import_element8.useState)(false); |
| 1247 |
const { isSaving, dirtyEntityRecordsCount } = (0, import_data8.useSelect)((select) => { |
| 1248 |
const { isSavingEntityRecord, __experimentalGetDirtyEntityRecords } = select(import_core_data4.store); |
| 1249 |
const dirtyEntityRecords = __experimentalGetDirtyEntityRecords(); |
| 1250 |
return { |
| 1251 |
isSaving: dirtyEntityRecords.some( |
| 1252 |
(record) => isSavingEntityRecord(record.kind, record.name, record.key) |
| 1253 |
), |
| 1254 |
dirtyEntityRecordsCount: dirtyEntityRecords.length |
| 1255 |
}; |
| 1256 |
}, []); |
| 1257 |
const [showSavedState, setShowSavedState] = (0, import_element8.useState)(false); |
| 1258 |
(0, import_element8.useEffect)(() => { |
| 1259 |
if (isSaving) { |
| 1260 |
setShowSavedState(true); |
| 1261 |
} |
| 1262 |
}, [isSaving]); |
| 1263 |
const hasChanges = dirtyEntityRecordsCount > 0; |
| 1264 |
(0, import_element8.useEffect)(() => { |
| 1265 |
if (!isSaving && hasChanges) { |
| 1266 |
setShowSavedState(false); |
| 1267 |
} |
| 1268 |
}, [isSaving, hasChanges]); |
| 1269 |
function hideSavedState() { |
| 1270 |
if (showSavedState) { |
| 1271 |
setShowSavedState(false); |
| 1272 |
} |
| 1273 |
} |
| 1274 |
const shouldShowButton = hasChanges || showSavedState; |
| 1275 |
useSaveShortcut({ openSavePanel: () => setIsSaveViewOpened(true) }); |
| 1276 |
if (!shouldShowButton) { |
| 1277 |
return null; |
| 1278 |
} |
| 1279 |
const isInSavedState = showSavedState && !hasChanges; |
| 1280 |
const disabled = isSaving || isInSavedState; |
| 1281 |
const getLabel = () => { |
| 1282 |
if (isInSavedState) { |
| 1283 |
return (0, import_i18n6.__)("Saved"); |
| 1284 |
} |
| 1285 |
return (0, import_i18n6.sprintf)( |
| 1286 |
// translators: %d: number of unsaved changes (number). |
| 1287 |
(0, import_i18n6._n)( |
| 1288 |
"Review %d change\u2026", |
| 1289 |
"Review %d changes\u2026", |
| 1290 |
dirtyEntityRecordsCount |
| 1291 |
), |
| 1292 |
dirtyEntityRecordsCount |
| 1293 |
); |
| 1294 |
}; |
| 1295 |
const label = getLabel(); |
| 1296 |
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [ |
| 1297 |
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)( |
| 1298 |
import_components11.Tooltip, |
| 1299 |
{ |
| 1300 |
text: hasChanges ? label : void 0, |
| 1301 |
shortcut: import_keycodes2.displayShortcut.primary("s"), |
| 1302 |
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)( |
| 1303 |
import_components11.Button, |
| 1304 |
{ |
| 1305 |
variant: "primary", |
| 1306 |
size: "compact", |
| 1307 |
onClick: () => setIsSaveViewOpened(true), |
| 1308 |
onBlur: hideSavedState, |
| 1309 |
disabled, |
| 1310 |
accessibleWhenDisabled: true, |
| 1311 |
isBusy: isSaving, |
| 1312 |
"aria-keyshortcuts": import_keycodes2.rawShortcut.primary("s"), |
| 1313 |
className: "boot-save-button", |
| 1314 |
icon: isInSavedState ? check_default : void 0, |
| 1315 |
children: label |
| 1316 |
} |
| 1317 |
) |
| 1318 |
} |
| 1319 |
), |
| 1320 |
isSaveViewOpen && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)( |
| 1321 |
import_components11.Modal, |
| 1322 |
{ |
| 1323 |
title: (0, import_i18n6.__)("Review changes"), |
| 1324 |
onRequestClose: () => setIsSaveViewOpened(false), |
| 1325 |
size: "small", |
| 1326 |
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)( |
| 1327 |
import_editor2.EntitiesSavedStates, |
| 1328 |
{ |
| 1329 |
close: () => setIsSaveViewOpened(false), |
| 1330 |
variant: "inline" |
| 1331 |
} |
| 1332 |
) |
| 1333 |
} |
| 1334 |
) |
| 1335 |
] }); |
| 1336 |
} |
| 1337 |
|
| 1338 |
// packages/boot/build-module/components/sidebar/index.mjs |
| 1339 |
var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1); |
| 1340 |
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='31b5f06a24']")) { |
| 1341 |
const style = document.createElement("style"); |
| 1342 |
style.setAttribute("data-wp-hash", "31b5f06a24"); |
| 1343 |
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}")); |
| 1344 |
document.head.appendChild(style); |
| 1345 |
} |
| 1346 |
function Sidebar() { |
| 1347 |
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "boot-sidebar__scrollable", children: [ |
| 1348 |
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(site_hub_default, {}), |
| 1349 |
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "boot-sidebar__content", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(navigation_default, {}) }), |
| 1350 |
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "boot-sidebar__footer", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SaveButton, {}) }) |
| 1351 |
] }); |
| 1352 |
} |
| 1353 |
|
| 1354 |
// packages/boot/build-module/components/save-panel/index.mjs |
| 1355 |
var import_element9 = __toESM(require_element(), 1); |
| 1356 |
var import_components12 = __toESM(require_components(), 1); |
| 1357 |
var import_editor3 = __toESM(require_editor(), 1); |
| 1358 |
var import_i18n7 = __toESM(require_i18n(), 1); |
| 1359 |
var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1); |
| 1360 |
function SavePanel() { |
| 1361 |
const [isOpen, setIsOpen] = (0, import_element9.useState)(false); |
| 1362 |
useSaveShortcut({ |
| 1363 |
openSavePanel: () => setIsOpen(true) |
| 1364 |
}); |
| 1365 |
if (!isOpen) { |
| 1366 |
return false; |
| 1367 |
} |
| 1368 |
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)( |
| 1369 |
import_components12.Modal, |
| 1370 |
{ |
| 1371 |
className: "edit-site-save-panel__modal", |
| 1372 |
onRequestClose: () => setIsOpen(false), |
| 1373 |
title: (0, import_i18n7.__)("Review changes"), |
| 1374 |
size: "small", |
| 1375 |
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)( |
| 1376 |
import_editor3.EntitiesSavedStates, |
| 1377 |
{ |
| 1378 |
close: () => setIsOpen(false), |
| 1379 |
variant: "inline" |
| 1380 |
} |
| 1381 |
) |
| 1382 |
} |
| 1383 |
); |
| 1384 |
} |
| 1385 |
|
| 1386 |
// packages/boot/build-module/components/canvas-renderer/index.mjs |
| 1387 |
var import_element11 = __toESM(require_element(), 1); |
| 1388 |
|
| 1389 |
// packages/boot/build-module/components/canvas/index.mjs |
| 1390 |
var import_element10 = __toESM(require_element(), 1); |
| 1391 |
var import_components14 = __toESM(require_components(), 1); |
| 1392 |
import { useNavigate } from "@wordpress/route"; |
| 1393 |
|
| 1394 |
// packages/boot/build-module/components/canvas/back-button.mjs |
| 1395 |
var import_components13 = __toESM(require_components(), 1); |
| 1396 |
var import_compose3 = __toESM(require_compose(), 1); |
| 1397 |
var import_i18n8 = __toESM(require_i18n(), 1); |
| 1398 |
var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1); |
| 1399 |
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='54be940d3d']")) { |
| 1400 |
const style = document.createElement("style"); |
| 1401 |
style.setAttribute("data-wp-hash", "54be940d3d"); |
| 1402 |
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);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) solid var(--wpds-color-stroke-focus-brand);outline-offset:calc(var(--wpds-border-width-focus)*-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}")); |
| 1403 |
document.head.appendChild(style); |
| 1404 |
} |
| 1405 |
var toggleHomeIconVariants = { |
| 1406 |
edit: { |
| 1407 |
opacity: 0, |
| 1408 |
scale: 0.2 |
| 1409 |
}, |
| 1410 |
hover: { |
| 1411 |
opacity: 1, |
| 1412 |
scale: 1, |
| 1413 |
clipPath: "inset( 22% round 2px )" |
| 1414 |
} |
| 1415 |
}; |
| 1416 |
function BootBackButton({ length }) { |
| 1417 |
const disableMotion = (0, import_compose3.useReducedMotion)(); |
| 1418 |
const handleBack = () => { |
| 1419 |
window.history.back(); |
| 1420 |
}; |
| 1421 |
if (length > 1) { |
| 1422 |
return null; |
| 1423 |
} |
| 1424 |
const transition = { |
| 1425 |
duration: disableMotion ? 0 : 0.3 |
| 1426 |
}; |
| 1427 |
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)( |
| 1428 |
import_components13.__unstableMotion.div, |
| 1429 |
{ |
| 1430 |
className: "boot-canvas-back-button", |
| 1431 |
animate: "edit", |
| 1432 |
initial: "edit", |
| 1433 |
whileHover: "hover", |
| 1434 |
whileTap: "tap", |
| 1435 |
transition, |
| 1436 |
children: [ |
| 1437 |
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)( |
| 1438 |
import_components13.Button, |
| 1439 |
{ |
| 1440 |
className: "boot-canvas-back-button__link", |
| 1441 |
onClick: handleBack, |
| 1442 |
"aria-label": (0, import_i18n8.__)("Go back"), |
| 1443 |
__next40pxDefaultSize: true, |
| 1444 |
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(site_icon_default, {}) |
| 1445 |
} |
| 1446 |
), |
| 1447 |
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)( |
| 1448 |
import_components13.__unstableMotion.div, |
| 1449 |
{ |
| 1450 |
className: "boot-canvas-back-button__icon", |
| 1451 |
variants: toggleHomeIconVariants, |
| 1452 |
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_components13.Icon, { icon: arrow_up_left_default }) |
| 1453 |
} |
| 1454 |
) |
| 1455 |
] |
| 1456 |
} |
| 1457 |
); |
| 1458 |
} |
| 1459 |
|
| 1460 |
// packages/boot/build-module/components/canvas/index.mjs |
| 1461 |
var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1); |
| 1462 |
function Canvas({ canvas }) { |
| 1463 |
const [Editor, setEditor] = (0, import_element10.useState)(null); |
| 1464 |
const navigate = useNavigate(); |
| 1465 |
(0, import_element10.useEffect)(() => { |
| 1466 |
import("@wordpress/lazy-editor").then((module) => { |
| 1467 |
setEditor(() => module.Editor); |
| 1468 |
}).catch((error) => { |
| 1469 |
console.error("Failed to load lazy editor:", error); |
| 1470 |
}); |
| 1471 |
}, []); |
| 1472 |
if (!Editor) { |
| 1473 |
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)( |
| 1474 |
"div", |
| 1475 |
{ |
| 1476 |
style: { |
| 1477 |
display: "flex", |
| 1478 |
justifyContent: "center", |
| 1479 |
alignItems: "center", |
| 1480 |
height: "100%", |
| 1481 |
padding: "2rem" |
| 1482 |
}, |
| 1483 |
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_components14.Spinner, {}) |
| 1484 |
} |
| 1485 |
); |
| 1486 |
} |
| 1487 |
const backButton = !canvas.isPreview ? ({ length }) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(BootBackButton, { length }) : void 0; |
| 1488 |
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { style: { height: "100%", position: "relative" }, children: [ |
| 1489 |
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)( |
| 1490 |
"div", |
| 1491 |
{ |
| 1492 |
style: { height: "100%" }, |
| 1493 |
inert: canvas.isPreview ? "true" : void 0, |
| 1494 |
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)( |
| 1495 |
Editor, |
| 1496 |
{ |
| 1497 |
postType: canvas.postType, |
| 1498 |
postId: canvas.postId, |
| 1499 |
settings: { isPreviewMode: canvas.isPreview }, |
| 1500 |
backButton |
| 1501 |
} |
| 1502 |
) |
| 1503 |
} |
| 1504 |
), |
| 1505 |
canvas.isPreview && canvas.editLink && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)( |
| 1506 |
"div", |
| 1507 |
{ |
| 1508 |
onClick: () => navigate({ to: canvas.editLink }), |
| 1509 |
onKeyDown: (e) => { |
| 1510 |
if (e.key === "Enter" || e.key === " ") { |
| 1511 |
e.preventDefault(); |
| 1512 |
navigate({ to: canvas.editLink }); |
| 1513 |
} |
| 1514 |
}, |
| 1515 |
style: { |
| 1516 |
position: "absolute", |
| 1517 |
inset: 0, |
| 1518 |
cursor: "pointer", |
| 1519 |
zIndex: 1 |
| 1520 |
}, |
| 1521 |
role: "button", |
| 1522 |
tabIndex: 0, |
| 1523 |
"aria-label": "Click to edit" |
| 1524 |
} |
| 1525 |
) |
| 1526 |
] }); |
| 1527 |
} |
| 1528 |
|
| 1529 |
// packages/boot/build-module/components/canvas-renderer/index.mjs |
| 1530 |
var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1); |
| 1531 |
function CanvasRenderer({ |
| 1532 |
canvas, |
| 1533 |
routeContentModule |
| 1534 |
}) { |
| 1535 |
const [CustomCanvas, setCustomCanvas] = (0, import_element11.useState)(null); |
| 1536 |
(0, import_element11.useEffect)(() => { |
| 1537 |
if (canvas === null && routeContentModule) { |
| 1538 |
import(routeContentModule).then((module) => { |
| 1539 |
setCustomCanvas(() => module.canvas); |
| 1540 |
}).catch((error) => { |
| 1541 |
console.error("Failed to load custom canvas:", error); |
| 1542 |
}); |
| 1543 |
} else { |
| 1544 |
setCustomCanvas(null); |
| 1545 |
} |
| 1546 |
}, [canvas, routeContentModule]); |
| 1547 |
if (canvas === void 0) { |
| 1548 |
return null; |
| 1549 |
} |
| 1550 |
if (canvas === null) { |
| 1551 |
if (!CustomCanvas) { |
| 1552 |
return null; |
| 1553 |
} |
| 1554 |
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(CustomCanvas, {}); |
| 1555 |
} |
| 1556 |
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Canvas, { canvas }); |
| 1557 |
} |
| 1558 |
|
| 1559 |
// packages/boot/build-module/components/app/use-route-title.mjs |
| 1560 |
var import_element12 = __toESM(require_element(), 1); |
| 1561 |
var import_data9 = __toESM(require_data(), 1); |
| 1562 |
var import_core_data5 = __toESM(require_core_data(), 1); |
| 1563 |
var import_i18n9 = __toESM(require_i18n(), 1); |
| 1564 |
var import_html_entities2 = __toESM(require_html_entities(), 1); |
| 1565 |
import { speak } from "@wordpress/a11y"; |
| 1566 |
import { privateApis as routePrivateApis4 } from "@wordpress/route"; |
| 1567 |
var { useLocation, useMatches: useMatches2 } = unlock(routePrivateApis4); |
| 1568 |
function useRouteTitle() { |
| 1569 |
const location = useLocation(); |
| 1570 |
const matches = useMatches2(); |
| 1571 |
const currentMatch = matches[matches.length - 1]; |
| 1572 |
const routeTitle = currentMatch?.loaderData?.title; |
| 1573 |
const siteTitle = (0, import_data9.useSelect)( |
| 1574 |
(select) => select(import_core_data5.store).getEntityRecord( |
| 1575 |
"root", |
| 1576 |
"__unstableBase" |
| 1577 |
)?.name, |
| 1578 |
[] |
| 1579 |
); |
| 1580 |
const isInitialLocationRef = (0, import_element12.useRef)(true); |
| 1581 |
(0, import_element12.useEffect)(() => { |
| 1582 |
isInitialLocationRef.current = false; |
| 1583 |
}, [location]); |
| 1584 |
(0, import_element12.useEffect)(() => { |
| 1585 |
if (isInitialLocationRef.current) { |
| 1586 |
return; |
| 1587 |
} |
| 1588 |
if (routeTitle && typeof routeTitle === "string" && siteTitle && typeof siteTitle === "string") { |
| 1589 |
const decodedRouteTitle = (0, import_html_entities2.decodeEntities)(routeTitle); |
| 1590 |
const decodedSiteTitle = (0, import_html_entities2.decodeEntities)(siteTitle); |
| 1591 |
const formattedTitle = (0, import_i18n9.sprintf)( |
| 1592 |
/* translators: Admin document title. 1: Admin screen name, 2: Site name. */ |
| 1593 |
(0, import_i18n9.__)("%1$s \u2039 %2$s \u2014 WordPress"), |
| 1594 |
decodedRouteTitle, |
| 1595 |
decodedSiteTitle |
| 1596 |
); |
| 1597 |
document.title = formattedTitle; |
| 1598 |
if (decodedRouteTitle) { |
| 1599 |
speak(decodedRouteTitle, "assertive"); |
| 1600 |
} |
| 1601 |
} |
| 1602 |
}, [routeTitle, siteTitle, location]); |
| 1603 |
} |
| 1604 |
|
| 1605 |
// packages/boot/build-module/components/user-theme-provider/index.mjs |
| 1606 |
var import_theme = __toESM(require_theme(), 1); |
| 1607 |
var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1); |
| 1608 |
var ThemeProvider = unlock(import_theme.privateApis).ThemeProvider; |
| 1609 |
var THEME_PRIMARY_COLORS = /* @__PURE__ */ new Map([ |
| 1610 |
["light", "#0085ba"], |
| 1611 |
["modern", "#3858e9"], |
| 1612 |
["blue", "#096484"], |
| 1613 |
["coffee", "#46403c"], |
| 1614 |
["ectoplasm", "#523f6d"], |
| 1615 |
["midnight", "#e14d43"], |
| 1616 |
["ocean", "#627c83"], |
| 1617 |
["sunrise", "#dd823b"] |
| 1618 |
]); |
| 1619 |
function getAdminThemePrimaryColor() { |
| 1620 |
const theme = document.body.className.match(/admin-color-([a-z]+)/)?.[1]; |
| 1621 |
return theme && THEME_PRIMARY_COLORS.get(theme); |
| 1622 |
} |
| 1623 |
function UserThemeProvider({ |
| 1624 |
color, |
| 1625 |
...restProps |
| 1626 |
}) { |
| 1627 |
const primary = getAdminThemePrimaryColor(); |
| 1628 |
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ThemeProvider, { ...restProps, color: { primary, ...color } }); |
| 1629 |
} |
| 1630 |
|
| 1631 |
// packages/boot/build-module/components/root/index.mjs |
| 1632 |
var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1); |
| 1633 |
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='e7410e6f72']")) { |
| 1634 |
const style = document.createElement("style"); |
| 1635 |
style.setAttribute("data-wp-hash", "e7410e6f72"); |
| 1636 |
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;left:0;max-width:85vw;position:fixed;top:0;width:300px;z-index:100003}.boot-layout__mobile-sidebar-drawer{align-items:center;background:var(--wpds-color-bg-surface-neutral,#fff);border-bottom:1px solid var(--wpds-color-stroke-surface-neutral-weak,#ddd);display:flex;justify-content:flex-start;left:0;padding:16px;position:fixed;right:0;top:0;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-left:0;margin-top:0}}.boot-layout__inspector,.boot-layout__stage{background:var(--wpds-color-bg-surface-neutral,#fff);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#ddd);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}@media (min-width:782px){.boot-layout__inspector,.boot-layout__stage{border-radius:8px;height:auto;margin:0;position:static;width: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,#fff);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#ddd);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}@media (min-width:782px){.boot-layout__canvas{border-radius:8px;height:auto;position:static;width:auto;z-index: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}")); |
| 1637 |
document.head.appendChild(style); |
| 1638 |
} |
| 1639 |
var { useLocation: useLocation2, useMatches: useMatches3, Outlet } = unlock(routePrivateApis5); |
| 1640 |
function Root() { |
| 1641 |
const matches = useMatches3(); |
| 1642 |
const location = useLocation2(); |
| 1643 |
const currentMatch = matches[matches.length - 1]; |
| 1644 |
const canvas = currentMatch?.loaderData?.canvas; |
| 1645 |
const routeContentModule = currentMatch?.loaderData?.routeContentModule; |
| 1646 |
const isFullScreen = canvas && !canvas.isPreview; |
| 1647 |
useRouteTitle(); |
| 1648 |
const isMobileViewport = (0, import_compose4.useViewportMatch)("medium", "<"); |
| 1649 |
const [isMobileSidebarOpen, setIsMobileSidebarOpen] = (0, import_element13.useState)(false); |
| 1650 |
const disableMotion = (0, import_compose4.useReducedMotion)(); |
| 1651 |
(0, import_element13.useEffect)(() => { |
| 1652 |
setIsMobileSidebarOpen(false); |
| 1653 |
}, [location.pathname, isMobileViewport]); |
| 1654 |
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_components15.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)( |
| 1655 |
"div", |
| 1656 |
{ |
| 1657 |
className: clsx_default("boot-layout", { |
| 1658 |
"has-canvas": !!canvas || canvas === null, |
| 1659 |
"has-full-canvas": isFullScreen |
| 1660 |
}), |
| 1661 |
children: [ |
| 1662 |
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(SavePanel, {}), |
| 1663 |
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_editor4.EditorSnackbars, {}), |
| 1664 |
isMobileViewport && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(page_default.SidebarToggleFill, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)( |
| 1665 |
import_components15.Button, |
| 1666 |
{ |
| 1667 |
icon: menu_default, |
| 1668 |
onClick: () => setIsMobileSidebarOpen(true), |
| 1669 |
label: (0, import_i18n10.__)("Open navigation panel"), |
| 1670 |
size: "compact" |
| 1671 |
} |
| 1672 |
) }), |
| 1673 |
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_components15.__unstableAnimatePresence, { children: isMobileViewport && isMobileSidebarOpen && !isFullScreen && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)( |
| 1674 |
import_components15.__unstableMotion.div, |
| 1675 |
{ |
| 1676 |
initial: { opacity: 0 }, |
| 1677 |
animate: { opacity: 1 }, |
| 1678 |
exit: { opacity: 0 }, |
| 1679 |
transition: { |
| 1680 |
type: "tween", |
| 1681 |
duration: disableMotion ? 0 : 0.2, |
| 1682 |
ease: "easeOut" |
| 1683 |
}, |
| 1684 |
className: "boot-layout__sidebar-backdrop", |
| 1685 |
onClick: () => setIsMobileSidebarOpen(false), |
| 1686 |
onKeyDown: (event) => { |
| 1687 |
if (event.key === "Escape") { |
| 1688 |
setIsMobileSidebarOpen(false); |
| 1689 |
} |
| 1690 |
}, |
| 1691 |
role: "button", |
| 1692 |
tabIndex: -1, |
| 1693 |
"aria-label": (0, import_i18n10.__)( |
| 1694 |
"Close navigation panel" |
| 1695 |
) |
| 1696 |
} |
| 1697 |
) }), |
| 1698 |
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_components15.__unstableAnimatePresence, { children: isMobileViewport && isMobileSidebarOpen && !isFullScreen && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)( |
| 1699 |
import_components15.__unstableMotion.div, |
| 1700 |
{ |
| 1701 |
initial: { x: "-100%" }, |
| 1702 |
animate: { x: 0 }, |
| 1703 |
exit: { x: "-100%" }, |
| 1704 |
transition: { |
| 1705 |
type: "tween", |
| 1706 |
duration: disableMotion ? 0 : 0.2, |
| 1707 |
ease: "easeOut" |
| 1708 |
}, |
| 1709 |
className: "boot-layout__sidebar is-mobile", |
| 1710 |
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Sidebar, {}) |
| 1711 |
} |
| 1712 |
) }), |
| 1713 |
!isMobileViewport && !isFullScreen && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "boot-layout__sidebar", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Sidebar, {}) }), |
| 1714 |
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "boot-layout__surfaces", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(UserThemeProvider, { color: { bg: "#ffffff" }, children: [ |
| 1715 |
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Outlet, {}), |
| 1716 |
(canvas || canvas === null) && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)( |
| 1717 |
"div", |
| 1718 |
{ |
| 1719 |
className: clsx_default( |
| 1720 |
"boot-layout__canvas", |
| 1721 |
{ |
| 1722 |
"has-mobile-drawer": canvas?.isPreview && isMobileViewport |
| 1723 |
} |
| 1724 |
), |
| 1725 |
children: [ |
| 1726 |
canvas?.isPreview && isMobileViewport && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "boot-layout__mobile-sidebar-drawer", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)( |
| 1727 |
import_components15.Button, |
| 1728 |
{ |
| 1729 |
icon: menu_default, |
| 1730 |
onClick: () => setIsMobileSidebarOpen( |
| 1731 |
true |
| 1732 |
), |
| 1733 |
label: (0, import_i18n10.__)( |
| 1734 |
"Open navigation panel" |
| 1735 |
), |
| 1736 |
size: "compact" |
| 1737 |
} |
| 1738 |
) }), |
| 1739 |
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)( |
| 1740 |
CanvasRenderer, |
| 1741 |
{ |
| 1742 |
canvas, |
| 1743 |
routeContentModule |
| 1744 |
} |
| 1745 |
) |
| 1746 |
] |
| 1747 |
} |
| 1748 |
) |
| 1749 |
] }) }) |
| 1750 |
] |
| 1751 |
} |
| 1752 |
) }) }) }); |
| 1753 |
} |
| 1754 |
|
| 1755 |
// packages/boot/build-module/components/app/router.mjs |
| 1756 |
var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1); |
| 1757 |
var { |
| 1758 |
createLazyRoute, |
| 1759 |
createRouter, |
| 1760 |
createRootRoute, |
| 1761 |
createRoute, |
| 1762 |
RouterProvider, |
| 1763 |
createBrowserHistory, |
| 1764 |
parseHref, |
| 1765 |
useLoaderData |
| 1766 |
} = unlock(routePrivateApis6); |
| 1767 |
function NotFoundComponent() { |
| 1768 |
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") }) }); |
| 1769 |
} |
| 1770 |
function createRouteFromDefinition(route, parentRoute) { |
| 1771 |
let tanstackRoute = createRoute({ |
| 1772 |
getParentRoute: () => parentRoute, |
| 1773 |
path: route.path, |
| 1774 |
beforeLoad: async (opts) => { |
| 1775 |
if (route.route_module) { |
| 1776 |
const module = await import(route.route_module); |
| 1777 |
const routeConfig = module.route || {}; |
| 1778 |
if (routeConfig.beforeLoad) { |
| 1779 |
return routeConfig.beforeLoad({ |
| 1780 |
params: opts.params || {}, |
| 1781 |
search: opts.search || {} |
| 1782 |
}); |
| 1783 |
} |
| 1784 |
} |
| 1785 |
}, |
| 1786 |
loader: async (opts) => { |
| 1787 |
let routeConfig = {}; |
| 1788 |
if (route.route_module) { |
| 1789 |
const module = await import(route.route_module); |
| 1790 |
routeConfig = module.route || {}; |
| 1791 |
} |
| 1792 |
const context = { |
| 1793 |
params: opts.params || {}, |
| 1794 |
search: opts.deps || {} |
| 1795 |
}; |
| 1796 |
const [, loaderData, canvasData, titleData] = await Promise.all([ |
| 1797 |
(0, import_data10.resolveSelect)(import_core_data6.store).getEntityRecord( |
| 1798 |
"root", |
| 1799 |
"__unstableBase" |
| 1800 |
), |
| 1801 |
routeConfig.loader ? routeConfig.loader(context) : Promise.resolve(void 0), |
| 1802 |
routeConfig.canvas ? routeConfig.canvas(context) : Promise.resolve(void 0), |
| 1803 |
routeConfig.title ? routeConfig.title(context) : Promise.resolve(void 0) |
| 1804 |
]); |
| 1805 |
let inspector = true; |
| 1806 |
if (routeConfig.inspector) { |
| 1807 |
inspector = await routeConfig.inspector(context); |
| 1808 |
} |
| 1809 |
return { |
| 1810 |
...loaderData, |
| 1811 |
canvas: canvasData, |
| 1812 |
inspector, |
| 1813 |
title: titleData, |
| 1814 |
routeContentModule: route.content_module |
| 1815 |
}; |
| 1816 |
}, |
| 1817 |
loaderDeps: (opts) => opts.search |
| 1818 |
}); |
| 1819 |
tanstackRoute = tanstackRoute.lazy(async () => { |
| 1820 |
const module = route.content_module ? await import(route.content_module) : {}; |
| 1821 |
const Stage = module.stage; |
| 1822 |
const Inspector = module.inspector; |
| 1823 |
return createLazyRoute(route.path)({ |
| 1824 |
component: function RouteComponent() { |
| 1825 |
const { inspector: showInspector } = useLoaderData({ from: route.path }) ?? {}; |
| 1826 |
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [ |
| 1827 |
Stage && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "boot-layout__stage", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Stage, {}) }), |
| 1828 |
Inspector && showInspector && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "boot-layout__inspector", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Inspector, {}) }) |
| 1829 |
] }); |
| 1830 |
} |
| 1831 |
}); |
| 1832 |
}); |
| 1833 |
return tanstackRoute; |
| 1834 |
} |
| 1835 |
function createRouteTree(routes, rootComponent = Root) { |
| 1836 |
const rootRoute = createRootRoute({ |
| 1837 |
component: rootComponent, |
| 1838 |
context: () => ({}) |
| 1839 |
}); |
| 1840 |
const dynamicRoutes = routes.map( |
| 1841 |
(route) => createRouteFromDefinition(route, rootRoute) |
| 1842 |
); |
| 1843 |
return rootRoute.addChildren(dynamicRoutes); |
| 1844 |
} |
| 1845 |
function createPathHistory() { |
| 1846 |
return createBrowserHistory({ |
| 1847 |
parseLocation: () => { |
| 1848 |
const url = new URL(window.location.href); |
| 1849 |
const path = url.searchParams.get("p") || "/"; |
| 1850 |
const pathHref = `${path}${url.hash}`; |
| 1851 |
return parseHref(pathHref, window.history.state); |
| 1852 |
}, |
| 1853 |
createHref: (href) => { |
| 1854 |
const searchParams = new URLSearchParams(window.location.search); |
| 1855 |
searchParams.set("p", href); |
| 1856 |
return `${window.location.pathname}?${searchParams}`; |
| 1857 |
} |
| 1858 |
}); |
| 1859 |
} |
| 1860 |
function Router({ |
| 1861 |
routes, |
| 1862 |
rootComponent = Root |
| 1863 |
}) { |
| 1864 |
const router = (0, import_element14.useMemo)(() => { |
| 1865 |
const history = createPathHistory(); |
| 1866 |
const routeTree = createRouteTree(routes, rootComponent); |
| 1867 |
return createRouter({ |
| 1868 |
history, |
| 1869 |
routeTree, |
| 1870 |
defaultPreload: "intent", |
| 1871 |
defaultNotFoundComponent: NotFoundComponent, |
| 1872 |
defaultViewTransition: { |
| 1873 |
types: ({ |
| 1874 |
fromLocation |
| 1875 |
}) => { |
| 1876 |
if (!fromLocation) { |
| 1877 |
return false; |
| 1878 |
} |
| 1879 |
return ["navigate"]; |
| 1880 |
} |
| 1881 |
} |
| 1882 |
}); |
| 1883 |
}, [routes, rootComponent]); |
| 1884 |
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(RouterProvider, { router }); |
| 1885 |
} |
| 1886 |
|
| 1887 |
// packages/boot/build-module/components/root/single-page.mjs |
| 1888 |
var import_editor5 = __toESM(require_editor(), 1); |
| 1889 |
var import_components16 = __toESM(require_components(), 1); |
| 1890 |
import { privateApis as routePrivateApis7 } from "@wordpress/route"; |
| 1891 |
var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1); |
| 1892 |
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='e7410e6f72']")) { |
| 1893 |
const style = document.createElement("style"); |
| 1894 |
style.setAttribute("data-wp-hash", "e7410e6f72"); |
| 1895 |
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;left:0;max-width:85vw;position:fixed;top:0;width:300px;z-index:100003}.boot-layout__mobile-sidebar-drawer{align-items:center;background:var(--wpds-color-bg-surface-neutral,#fff);border-bottom:1px solid var(--wpds-color-stroke-surface-neutral-weak,#ddd);display:flex;justify-content:flex-start;left:0;padding:16px;position:fixed;right:0;top:0;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-left:0;margin-top:0}}.boot-layout__inspector,.boot-layout__stage{background:var(--wpds-color-bg-surface-neutral,#fff);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#ddd);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}@media (min-width:782px){.boot-layout__inspector,.boot-layout__stage{border-radius:8px;height:auto;margin:0;position:static;width: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,#fff);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#ddd);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}@media (min-width:782px){.boot-layout__canvas{border-radius:8px;height:auto;position:static;width:auto;z-index: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}")); |
| 1896 |
document.head.appendChild(style); |
| 1897 |
} |
| 1898 |
var { useMatches: useMatches4, Outlet: Outlet2 } = unlock(routePrivateApis7); |
| 1899 |
function RootSinglePage() { |
| 1900 |
const matches = useMatches4(); |
| 1901 |
const currentMatch = matches[matches.length - 1]; |
| 1902 |
const canvas = currentMatch?.loaderData?.canvas; |
| 1903 |
const routeContentModule = currentMatch?.loaderData?.routeContentModule; |
| 1904 |
const isFullScreen = canvas && !canvas.isPreview; |
| 1905 |
useRouteTitle(); |
| 1906 |
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_components16.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)( |
| 1907 |
"div", |
| 1908 |
{ |
| 1909 |
className: clsx_default( |
| 1910 |
"boot-layout boot-layout--single-page", |
| 1911 |
{ |
| 1912 |
"has-canvas": !!canvas || canvas === null, |
| 1913 |
"has-full-canvas": isFullScreen |
| 1914 |
} |
| 1915 |
), |
| 1916 |
children: [ |
| 1917 |
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(SavePanel, {}), |
| 1918 |
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_editor5.EditorSnackbars, {}), |
| 1919 |
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "boot-layout__surfaces", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(UserThemeProvider, { color: { bg: "#ffffff" }, children: [ |
| 1920 |
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Outlet2, {}), |
| 1921 |
(canvas || canvas === null) && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "boot-layout__canvas", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)( |
| 1922 |
CanvasRenderer, |
| 1923 |
{ |
| 1924 |
canvas, |
| 1925 |
routeContentModule |
| 1926 |
} |
| 1927 |
) }) |
| 1928 |
] }) }) |
| 1929 |
] |
| 1930 |
} |
| 1931 |
) }) }) }); |
| 1932 |
} |
| 1933 |
|
| 1934 |
// packages/boot/build-module/components/app/index.mjs |
| 1935 |
var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1); |
| 1936 |
function App({ rootComponent }) { |
| 1937 |
const routes = (0, import_data11.useSelect)((select) => select(store).getRoutes(), []); |
| 1938 |
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Router, { routes, rootComponent }); |
| 1939 |
} |
| 1940 |
async function init({ |
| 1941 |
mountId, |
| 1942 |
menuItems, |
| 1943 |
routes, |
| 1944 |
initModules, |
| 1945 |
dashboardLink |
| 1946 |
}) { |
| 1947 |
(menuItems ?? []).forEach((menuItem) => { |
| 1948 |
(0, import_data11.dispatch)(store).registerMenuItem(menuItem.id, menuItem); |
| 1949 |
}); |
| 1950 |
(routes ?? []).forEach((route) => { |
| 1951 |
(0, import_data11.dispatch)(store).registerRoute(route); |
| 1952 |
}); |
| 1953 |
if (dashboardLink) { |
| 1954 |
(0, import_data11.dispatch)(store).setDashboardLink(dashboardLink); |
| 1955 |
} |
| 1956 |
for (const moduleId of initModules ?? []) { |
| 1957 |
const module = await import(moduleId); |
| 1958 |
await module.init(); |
| 1959 |
} |
| 1960 |
const rootElement = document.getElementById(mountId); |
| 1961 |
if (rootElement) { |
| 1962 |
const root = (0, import_element15.createRoot)(rootElement); |
| 1963 |
root.render( |
| 1964 |
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_element15.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(App, {}) }) |
| 1965 |
); |
| 1966 |
} |
| 1967 |
} |
| 1968 |
async function initSinglePage({ |
| 1969 |
mountId, |
| 1970 |
routes |
| 1971 |
}) { |
| 1972 |
(routes ?? []).forEach((route) => { |
| 1973 |
(0, import_data11.dispatch)(store).registerRoute(route); |
| 1974 |
}); |
| 1975 |
const rootElement = document.getElementById(mountId); |
| 1976 |
if (rootElement) { |
| 1977 |
const root = (0, import_element15.createRoot)(rootElement); |
| 1978 |
root.render( |
| 1979 |
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_element15.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(App, { rootComponent: RootSinglePage }) }) |
| 1980 |
); |
| 1981 |
} |
| 1982 |
} |
| 1983 |
|
| 1984 |
// packages/boot/build-module/index.mjs |
| 1985 |
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='657af5698c']")) { |
| 1986 |
const style = document.createElement("style"); |
| 1987 |
style.setAttribute("data-wp-hash", "657af5698c"); |
| 1988 |
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-dimension-base:4px;--wpds-dimension-gap-2xs:4px;--wpds-dimension-gap-lg:24px;--wpds-dimension-gap-md:16px;--wpds-dimension-gap-sm:12px;--wpds-dimension-gap-xl:40px;--wpds-dimension-gap-xs:8px;--wpds-dimension-padding-surface-2xs:4px;--wpds-dimension-padding-surface-lg:32px;--wpds-dimension-padding-surface-md:24px;--wpds-dimension-padding-surface-sm:16px;--wpds-dimension-padding-surface-xs:8px;--wpds-elevation-large:0 5px 15px 0 #00000014,0 15px 27px 0 #00000012,0 30px 36px 0 #0000000a,0 50px 43px 0 #00000005;--wpds-elevation-medium:0 2px 3px 0 #0000000d,0 4px 5px 0 #0000000a,0 12px 12px 0 #00000008,0 16px 16px 0 #00000005;--wpds-elevation-small:0 1px 2px 0 #0000000d,0 2px 3px 0 #0000000a,0 6px 6px 0 #00000008,0 8px 8px 0 #00000005;--wpds-elevation-x-small: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=default]{--wpds-dimension-base:4px;--wpds-dimension-gap-2xs:4px;--wpds-dimension-gap-lg:24px;--wpds-dimension-gap-md:16px;--wpds-dimension-gap-sm:12px;--wpds-dimension-gap-xl:40px;--wpds-dimension-gap-xs:8px;--wpds-dimension-padding-surface-2xs:4px;--wpds-dimension-padding-surface-lg:32px;--wpds-dimension-padding-surface-md:24px;--wpds-dimension-padding-surface-sm:16px;--wpds-dimension-padding-surface-xs:8px}[data-wpds-theme-provider-id][data-wpds-density=compact]{--wpds-dimension-gap-2xs:4px;--wpds-dimension-gap-lg:20px;--wpds-dimension-gap-md:12px;--wpds-dimension-gap-sm:8px;--wpds-dimension-gap-xl:32px;--wpds-dimension-gap-xs:4px;--wpds-dimension-padding-surface-2xs:4px;--wpds-dimension-padding-surface-lg:24px;--wpds-dimension-padding-surface-md:20px;--wpds-dimension-padding-surface-sm:12px;--wpds-dimension-padding-surface-xs:4px}[data-wpds-theme-provider-id][data-wpds-density=comfortable]{--wpds-dimension-gap-2xs:8px;--wpds-dimension-gap-lg:32px;--wpds-dimension-gap-md:20px;--wpds-dimension-gap-sm:16px;--wpds-dimension-gap-xl:48px;--wpds-dimension-gap-xs:12px;--wpds-dimension-padding-surface-2xs:8px;--wpds-dimension-padding-surface-lg:40px;--wpds-dimension-padding-surface-md:32px;--wpds-dimension-padding-surface-sm:20px;--wpds-dimension-padding-surface-xs:12px}@media (-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){:root{--wpds-border-width-focus:1.5px}}.admin-ui-page{background-color:#fff;color:#2f2f2f;display:flex;flex-flow:column;height:100%;position:relative;z-index:1}.admin-ui-page__header{background:#fff;border-bottom:1px solid #f0f0f0;padding:16px 24px;position:sticky;top:0;z-index:1}.admin-ui-page__sidebar-toggle-slot:empty{display:none}.admin-ui-page__header-subtitle{color:#757575;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:0;padding-block-end:8px}.admin-ui-page__content{display:flex;flex-direction:column;flex-grow:1;overflow:auto}.admin-ui-page__content.has-padding{padding:16px 24px}.show-icon-labels .admin-ui-page__header-actions .components-button.has-icon{padding:0 8px;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:12px}.admin-ui-breadcrumbs__list{font-size:15px;font-weight:500;gap:0;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 .components-editor-notices__snackbar{bottom:16px;padding-left:16px;padding-right:16px;position:fixed;right:0}')); |
| 1989 |
document.head.appendChild(style); |
| 1990 |
} |
| 1991 |
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='19054e9f1d']")) { |
| 1992 |
const style = document.createElement("style"); |
| 1993 |
style.setAttribute("data-wp-hash", "19054e9f1d"); |
| 1994 |
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%)}}")); |
| 1995 |
document.head.appendChild(style); |
| 1996 |
} |
| 1997 |
export { |
| 1998 |
init, |
| 1999 |
initSinglePage, |
| 2000 |
store |
| 2001 |
}; |
| 2002 |
//# sourceMappingURL=index.js.map |
| 2003 |
|