@orion-studios/payload-studio 0.3.0-beta.7 → 0.3.0-beta.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2276,51 +2276,15 @@ function WelcomeHeader({
2276
2276
  }
2277
2277
 
2278
2278
  // src/admin/components/studio/AdminStudioDashboard.tsx
2279
- var import_jsx_runtime14 = require("react/jsx-runtime");
2280
- var cardStyle = {
2281
- background: "var(--theme-elevation-0)",
2282
- border: "1px solid var(--theme-elevation-150)",
2283
- borderRadius: 16,
2284
- color: "inherit",
2285
- padding: "1rem",
2286
- textDecoration: "none"
2287
- };
2288
- function AdminStudioDashboard() {
2289
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { padding: "1.2rem 1.2rem 2.5rem" }, children: [
2290
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h1", { style: { fontSize: "1.6rem", margin: 0 }, children: "Studio" }),
2291
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { style: { color: "var(--theme-elevation-600)", marginTop: "0.35rem" }, children: "Pick what you want to edit." }),
2292
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
2293
- "div",
2294
- {
2295
- style: {
2296
- display: "grid",
2297
- gap: "0.85rem",
2298
- gridTemplateColumns: "repeat(auto-fit, minmax(240px, 1fr))",
2299
- marginTop: "1.1rem"
2300
- },
2301
- children: [
2302
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("a", { href: "/admin/pages", style: cardStyle, children: [
2303
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { fontWeight: 900 }, children: "Pages" }),
2304
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { color: "var(--theme-elevation-600)", marginTop: "0.25rem" }, children: "Edit your site pages with the custom editor." })
2305
- ] }),
2306
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("a", { href: "/admin/studio-globals", style: cardStyle, children: [
2307
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { fontWeight: 900 }, children: "Globals" }),
2308
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { color: "var(--theme-elevation-600)", marginTop: "0.25rem" }, children: "Site settings, header, footer." })
2309
- ] }),
2310
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("a", { href: "/admin/media", style: cardStyle, children: [
2311
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { fontWeight: 900 }, children: "Media" }),
2312
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { color: "var(--theme-elevation-600)", marginTop: "0.25rem" }, children: "Upload and manage images and files." })
2313
- ] })
2314
- ]
2315
- }
2316
- )
2317
- ] });
2318
- }
2279
+ var import_ui4 = require("@payloadcms/ui");
2280
+
2281
+ // src/admin/components/studio/StudioSectionLayout.tsx
2282
+ var import_react12 = require("react");
2319
2283
 
2320
2284
  // src/admin/components/studio/AdminStudioNav.tsx
2321
2285
  var import_react11 = require("react");
2322
2286
  var import_ui3 = require("@payloadcms/ui");
2323
- var import_jsx_runtime15 = require("react/jsx-runtime");
2287
+ var import_jsx_runtime14 = require("react/jsx-runtime");
2324
2288
  var isAdmin = (user) => {
2325
2289
  if (!user || typeof user !== "object") return false;
2326
2290
  const role = user.role;
@@ -2399,7 +2363,7 @@ function AdminStudioNav(props) {
2399
2363
  padding: compact ? "0.6rem" : "0.6rem 0.75rem",
2400
2364
  textDecoration: "none"
2401
2365
  });
2402
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2366
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
2403
2367
  "div",
2404
2368
  {
2405
2369
  style: {
@@ -2410,8 +2374,8 @@ function AdminStudioNav(props) {
2410
2374
  padding: compact ? "0.8rem 0.5rem" : "1rem 0.85rem"
2411
2375
  },
2412
2376
  children: [
2413
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "admin-studio-brand", style: { padding: compact ? "0" : "0 0.35rem" }, children: [
2414
- branding.logoUrl ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2377
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "admin-studio-brand", style: { padding: compact ? "0" : "0 0.35rem" }, children: [
2378
+ branding.logoUrl ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2415
2379
  "div",
2416
2380
  {
2417
2381
  style: {
@@ -2421,10 +2385,10 @@ function AdminStudioNav(props) {
2421
2385
  overflow: "hidden",
2422
2386
  width: compact ? 34 : 40
2423
2387
  },
2424
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("img", { alt: `${resolvedName} logo`, src: branding.logoUrl, style: { height: "100%", objectFit: "cover", width: "100%" } })
2388
+ children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("img", { alt: `${resolvedName} logo`, src: branding.logoUrl, style: { height: "100%", objectFit: "cover", width: "100%" } })
2425
2389
  }
2426
2390
  ) : null,
2427
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2391
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2428
2392
  "div",
2429
2393
  {
2430
2394
  style: {
@@ -2439,14 +2403,14 @@ function AdminStudioNav(props) {
2439
2403
  children: compact ? resolvedName.slice(0, 1).toUpperCase() : resolvedName
2440
2404
  }
2441
2405
  ),
2442
- !compact ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { color: "var(--theme-elevation-600)", fontSize: "0.85rem" }, children: "Studio" }) : null
2406
+ !compact ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { color: "var(--theme-elevation-600)", fontSize: "0.85rem" }, children: "Studio" }) : null
2443
2407
  ] }),
2444
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("nav", { style: { display: "grid", gap: "0.25rem" }, children: links.filter((link) => !link.adminOnly || isAdmin(user)).map((link) => {
2408
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("nav", { style: { display: "grid", gap: "0.25rem" }, children: links.filter((link) => !link.adminOnly || isAdmin(user)).map((link) => {
2445
2409
  const active = link.href === "/admin" ? pathname === "/admin" : link.matchPrefixes.some((prefix) => pathname.startsWith(prefix));
2446
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("a", { href: link.href, style: linkStyle(active), title: link.label, children: compact ? link.label.slice(0, 1) : link.label }, link.href);
2410
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("a", { href: link.href, style: linkStyle(active), title: link.label, children: compact ? link.label.slice(0, 1) : link.label }, link.href);
2447
2411
  }) }),
2448
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { flex: 1 } }),
2449
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2412
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { flex: 1 } }),
2413
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
2450
2414
  "div",
2451
2415
  {
2452
2416
  style: {
@@ -2455,11 +2419,11 @@ function AdminStudioNav(props) {
2455
2419
  textAlign: compact ? "center" : "left"
2456
2420
  },
2457
2421
  children: [
2458
- !compact ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
2459
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { color: "var(--theme-elevation-700)", fontSize: "0.85rem" }, children: "Signed in as" }),
2460
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontWeight: 800, marginBottom: "0.55rem" }, children: typeof user?.email === "string" ? user.email : "User" })
2422
+ !compact ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
2423
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { color: "var(--theme-elevation-700)", fontSize: "0.85rem" }, children: "Signed in as" }),
2424
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { fontWeight: 800, marginBottom: "0.55rem" }, children: typeof user?.email === "string" ? user.email : "User" })
2461
2425
  ] }) : null,
2462
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_ui3.Logout, {})
2426
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_ui3.Logout, {})
2463
2427
  ]
2464
2428
  }
2465
2429
  )
@@ -2468,10 +2432,113 @@ function AdminStudioNav(props) {
2468
2432
  );
2469
2433
  }
2470
2434
 
2471
- // src/admin/components/studio/AdminStudioPagesListView.tsx
2472
- var import_react12 = require("react");
2473
- var import_ui4 = require("@payloadcms/ui");
2435
+ // src/admin/components/studio/StudioSectionLayout.tsx
2436
+ var import_jsx_runtime15 = require("react/jsx-runtime");
2437
+ var STORAGE_KEY2 = "orion-studio-sidebar-collapsed";
2438
+ var ACTIVE_CLASS = "orion-studio-shell-active";
2439
+ function StudioSectionLayout({ children, navProps }) {
2440
+ const [collapsed, setCollapsed] = (0, import_react12.useState)(false);
2441
+ (0, import_react12.useEffect)(() => {
2442
+ try {
2443
+ const stored = window.localStorage.getItem(STORAGE_KEY2);
2444
+ if (stored === "1") {
2445
+ setCollapsed(true);
2446
+ }
2447
+ } catch {
2448
+ }
2449
+ }, []);
2450
+ (0, import_react12.useEffect)(() => {
2451
+ document.body.classList.add(ACTIVE_CLASS);
2452
+ return () => {
2453
+ document.body.classList.remove(ACTIVE_CLASS);
2454
+ };
2455
+ }, []);
2456
+ const toggle = () => {
2457
+ setCollapsed((prev) => {
2458
+ const next = !prev;
2459
+ try {
2460
+ window.localStorage.setItem(STORAGE_KEY2, next ? "1" : "0");
2461
+ } catch {
2462
+ }
2463
+ return next;
2464
+ });
2465
+ };
2466
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2467
+ "div",
2468
+ {
2469
+ className: `orion-studio-shell ${collapsed ? "is-collapsed" : ""}`,
2470
+ style: {
2471
+ display: "grid",
2472
+ gridTemplateColumns: collapsed ? "84px minmax(0, 1fr)" : "260px minmax(0, 1fr)",
2473
+ minHeight: "100vh"
2474
+ },
2475
+ children: [
2476
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("aside", { className: "orion-studio-sidebar", children: [
2477
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2478
+ "button",
2479
+ {
2480
+ "aria-label": collapsed ? "Expand sidebar" : "Collapse sidebar",
2481
+ className: "orion-studio-sidebar-toggle",
2482
+ onClick: toggle,
2483
+ type: "button",
2484
+ children: collapsed ? ">" : "<"
2485
+ }
2486
+ ),
2487
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "orion-studio-sidebar-scroll", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(AdminStudioNav, { ...navProps, compact: collapsed }) })
2488
+ ] }),
2489
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("main", { className: "orion-studio-main", children })
2490
+ ]
2491
+ }
2492
+ );
2493
+ }
2494
+
2495
+ // src/admin/components/studio/AdminStudioDashboard.tsx
2474
2496
  var import_jsx_runtime16 = require("react/jsx-runtime");
2497
+ var cardStyle = {
2498
+ background: "var(--theme-elevation-0)",
2499
+ border: "1px solid var(--theme-elevation-150)",
2500
+ borderRadius: 16,
2501
+ color: "inherit",
2502
+ padding: "1rem",
2503
+ textDecoration: "none"
2504
+ };
2505
+ function AdminStudioDashboard(props) {
2506
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(StudioSectionLayout, { navProps: props, children: [
2507
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_ui4.SetStepNav, { nav: [{ label: "Dashboard", url: "/admin" }] }),
2508
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h1", { style: { fontSize: "1.6rem", margin: 0 }, children: "Studio" }),
2509
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { style: { color: "var(--theme-elevation-600)", marginTop: "0.35rem" }, children: "Pick what you want to edit." }),
2510
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
2511
+ "div",
2512
+ {
2513
+ style: {
2514
+ display: "grid",
2515
+ gap: "0.85rem",
2516
+ gridTemplateColumns: "repeat(auto-fit, minmax(240px, 1fr))",
2517
+ marginTop: "1.1rem"
2518
+ },
2519
+ children: [
2520
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("a", { href: "/admin/pages", style: cardStyle, children: [
2521
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontWeight: 900 }, children: "Pages" }),
2522
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { color: "var(--theme-elevation-600)", marginTop: "0.25rem" }, children: "Edit your site pages with the custom editor." })
2523
+ ] }),
2524
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("a", { href: "/admin/studio-globals", style: cardStyle, children: [
2525
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontWeight: 900 }, children: "Globals" }),
2526
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { color: "var(--theme-elevation-600)", marginTop: "0.25rem" }, children: "Site settings, header, footer." })
2527
+ ] }),
2528
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("a", { href: "/admin/media", style: cardStyle, children: [
2529
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontWeight: 900 }, children: "Media" }),
2530
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { color: "var(--theme-elevation-600)", marginTop: "0.25rem" }, children: "Upload and manage images and files." })
2531
+ ] })
2532
+ ]
2533
+ }
2534
+ )
2535
+ ] });
2536
+ }
2537
+
2538
+ // src/admin/components/studio/AdminStudioPagesListView.tsx
2539
+ var import_react13 = require("react");
2540
+ var import_ui5 = require("@payloadcms/ui");
2541
+ var import_jsx_runtime17 = require("react/jsx-runtime");
2475
2542
  var isAdmin2 = (user) => {
2476
2543
  if (!user || typeof user !== "object") return false;
2477
2544
  const role = user.role;
@@ -2489,12 +2556,12 @@ var getPropString2 = (props, key, fallback) => {
2489
2556
  return fallback;
2490
2557
  };
2491
2558
  function AdminStudioPagesListView(props) {
2492
- const { user } = (0, import_ui4.useAuth)();
2559
+ const { user } = (0, import_ui5.useAuth)();
2493
2560
  const pagesCollectionSlug = getPropString2(props, "pagesCollectionSlug", "pages");
2494
- const [loading, setLoading] = (0, import_react12.useState)(true);
2495
- const [error, setError] = (0, import_react12.useState)(null);
2496
- const [docs, setDocs] = (0, import_react12.useState)([]);
2497
- const apiURL = (0, import_react12.useMemo)(() => {
2561
+ const [loading, setLoading] = (0, import_react13.useState)(true);
2562
+ const [error, setError] = (0, import_react13.useState)(null);
2563
+ const [docs, setDocs] = (0, import_react13.useState)([]);
2564
+ const apiURL = (0, import_react13.useMemo)(() => {
2498
2565
  const params = new URLSearchParams({
2499
2566
  depth: "0",
2500
2567
  limit: "100",
@@ -2503,7 +2570,7 @@ function AdminStudioPagesListView(props) {
2503
2570
  });
2504
2571
  return `/api/${pagesCollectionSlug}?${params.toString()}`;
2505
2572
  }, [pagesCollectionSlug]);
2506
- (0, import_react12.useEffect)(() => {
2573
+ (0, import_react13.useEffect)(() => {
2507
2574
  let cancelled = false;
2508
2575
  const run = async () => {
2509
2576
  setLoading(true);
@@ -2528,14 +2595,14 @@ function AdminStudioPagesListView(props) {
2528
2595
  cancelled = true;
2529
2596
  };
2530
2597
  }, [apiURL]);
2531
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
2532
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_ui4.SetStepNav, { nav: [{ label: "Pages", url: "/admin/pages" }] }),
2533
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { alignItems: "flex-end", display: "flex", gap: "0.75rem" }, children: [
2534
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { flex: 1 }, children: [
2535
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h1", { style: { margin: 0 }, children: "Pages" }),
2536
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { style: { color: "var(--theme-elevation-600)", marginTop: "0.35rem" }, children: "Open a page to edit it in the custom editor." })
2598
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(StudioSectionLayout, { navProps: props, children: [
2599
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_ui5.SetStepNav, { nav: [{ label: "Pages", url: "/admin/pages" }] }),
2600
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { alignItems: "flex-end", display: "flex", gap: "0.75rem" }, children: [
2601
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { flex: 1 }, children: [
2602
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("h1", { style: { margin: 0 }, children: "Pages" }),
2603
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { style: { color: "var(--theme-elevation-600)", marginTop: "0.35rem" }, children: "Open a page to edit it in the custom editor." })
2537
2604
  ] }),
2538
- isAdmin2(user) ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2605
+ isAdmin2(user) ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
2539
2606
  "a",
2540
2607
  {
2541
2608
  href: `/admin/collections/${pagesCollectionSlug}/create`,
@@ -2551,10 +2618,10 @@ function AdminStudioPagesListView(props) {
2551
2618
  }
2552
2619
  ) : null
2553
2620
  ] }),
2554
- loading ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { color: "var(--theme-elevation-600)", marginTop: "1rem" }, children: "Loading..." }) : null,
2555
- error ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { color: "crimson", marginTop: "1rem" }, children: error }) : null,
2556
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { display: "grid", gap: "0.6rem", marginTop: "1rem" }, children: [
2557
- !loading && !error && docs.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2621
+ loading ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { color: "var(--theme-elevation-600)", marginTop: "1rem" }, children: "Loading..." }) : null,
2622
+ error ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { color: "crimson", marginTop: "1rem" }, children: error }) : null,
2623
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { display: "grid", gap: "0.6rem", marginTop: "1rem" }, children: [
2624
+ !loading && !error && docs.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
2558
2625
  "div",
2559
2626
  {
2560
2627
  style: {
@@ -2572,7 +2639,7 @@ function AdminStudioPagesListView(props) {
2572
2639
  const path = typeof doc.path === "string" ? doc.path : "/";
2573
2640
  const status = typeof doc._status === "string" ? doc._status : "";
2574
2641
  if (!id) return null;
2575
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
2642
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
2576
2643
  "a",
2577
2644
  {
2578
2645
  href: `/admin/pages/${id}`,
@@ -2588,9 +2655,9 @@ function AdminStudioPagesListView(props) {
2588
2655
  textDecoration: "none"
2589
2656
  },
2590
2657
  children: [
2591
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { minWidth: 0 }, children: [
2592
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontWeight: 900, overflow: "hidden", textOverflow: "ellipsis" }, children: title }),
2593
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2658
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { minWidth: 0 }, children: [
2659
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { fontWeight: 900, overflow: "hidden", textOverflow: "ellipsis" }, children: title }),
2660
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
2594
2661
  "div",
2595
2662
  {
2596
2663
  style: {
@@ -2603,7 +2670,7 @@ function AdminStudioPagesListView(props) {
2603
2670
  }
2604
2671
  )
2605
2672
  ] }),
2606
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
2673
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
2607
2674
  "div",
2608
2675
  {
2609
2676
  style: {
@@ -2613,7 +2680,7 @@ function AdminStudioPagesListView(props) {
2613
2680
  gap: "0.5rem"
2614
2681
  },
2615
2682
  children: [
2616
- status ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2683
+ status ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
2617
2684
  "span",
2618
2685
  {
2619
2686
  style: {
@@ -2628,7 +2695,7 @@ function AdminStudioPagesListView(props) {
2628
2695
  children: status
2629
2696
  }
2630
2697
  ) : null,
2631
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { color: "var(--theme-elevation-600)", fontWeight: 800 }, children: "Open" })
2698
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { style: { color: "var(--theme-elevation-600)", fontWeight: 800 }, children: "Open" })
2632
2699
  ]
2633
2700
  }
2634
2701
  )
@@ -2642,9 +2709,9 @@ function AdminStudioPagesListView(props) {
2642
2709
  }
2643
2710
 
2644
2711
  // src/admin/components/studio/AdminStudioPageEditView.tsx
2645
- var import_react13 = require("react");
2646
- var import_ui5 = require("@payloadcms/ui");
2647
- var import_jsx_runtime17 = require("react/jsx-runtime");
2712
+ var import_react14 = require("react");
2713
+ var import_ui6 = require("@payloadcms/ui");
2714
+ var import_jsx_runtime18 = require("react/jsx-runtime");
2648
2715
  var isAdmin3 = (user) => {
2649
2716
  if (!user || typeof user !== "object") return false;
2650
2717
  const role = user.role;
@@ -2679,14 +2746,14 @@ var getPageIDFromPathname = (pathname) => {
2679
2746
  return match?.[1] ? decodeURIComponent(match[1]) : null;
2680
2747
  };
2681
2748
  function AdminStudioPageEditView(props) {
2682
- const { user } = (0, import_ui5.useAuth)();
2683
- const iframeRef = (0, import_react13.useRef)(null);
2684
- const [saving, setSaving] = (0, import_react13.useState)(null);
2749
+ const { user } = (0, import_ui6.useAuth)();
2750
+ const iframeRef = (0, import_react14.useRef)(null);
2751
+ const [saving, setSaving] = (0, import_react14.useState)(null);
2685
2752
  const builderBasePath = getPropString3(props, "builderBasePath", "/builder");
2686
- const pageIDFromParams = (0, import_react13.useMemo)(() => getParam(props.params, "id"), [props.params]);
2687
- const [pageID, setPageID] = (0, import_react13.useState)(pageIDFromParams);
2688
- const [didResolvePathFallback, setDidResolvePathFallback] = (0, import_react13.useState)(false);
2689
- (0, import_react13.useEffect)(() => {
2753
+ const pageIDFromParams = (0, import_react14.useMemo)(() => getParam(props.params, "id"), [props.params]);
2754
+ const [pageID, setPageID] = (0, import_react14.useState)(pageIDFromParams);
2755
+ const [didResolvePathFallback, setDidResolvePathFallback] = (0, import_react14.useState)(false);
2756
+ (0, import_react14.useEffect)(() => {
2690
2757
  if (pageIDFromParams) {
2691
2758
  setPageID(pageIDFromParams);
2692
2759
  setDidResolvePathFallback(true);
@@ -2701,13 +2768,13 @@ function AdminStudioPageEditView(props) {
2701
2768
  const requestSave = (status) => {
2702
2769
  const iframe = iframeRef.current;
2703
2770
  if (!iframe?.contentWindow) {
2704
- import_ui5.toast.error("Editor is not ready yet. Please try again.");
2771
+ import_ui6.toast.error("Editor is not ready yet. Please try again.");
2705
2772
  return;
2706
2773
  }
2707
2774
  setSaving(status);
2708
2775
  iframe.contentWindow.postMessage({ source: "payload-visual-builder-parent", type: "save", status }, "*");
2709
2776
  };
2710
- (0, import_react13.useEffect)(() => {
2777
+ (0, import_react14.useEffect)(() => {
2711
2778
  const onMessage = (event) => {
2712
2779
  const data = event.data;
2713
2780
  if (!data || data.source !== "payload-visual-builder-child" || data.type !== "save-result") {
@@ -2715,116 +2782,145 @@ function AdminStudioPageEditView(props) {
2715
2782
  }
2716
2783
  setSaving(null);
2717
2784
  if (data.ok) {
2718
- import_ui5.toast.success(typeof data.message === "string" ? data.message : "Saved.");
2785
+ import_ui6.toast.success(typeof data.message === "string" ? data.message : "Saved.");
2719
2786
  } else {
2720
- import_ui5.toast.error(typeof data.message === "string" ? data.message : "Save failed.");
2787
+ import_ui6.toast.error(typeof data.message === "string" ? data.message : "Save failed.");
2721
2788
  }
2722
2789
  };
2723
2790
  window.addEventListener("message", onMessage);
2724
2791
  return () => window.removeEventListener("message", onMessage);
2725
2792
  }, []);
2726
2793
  if (!pageID && !didResolvePathFallback) {
2727
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { padding: "1.2rem" }, children: [
2728
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("h1", { style: { margin: 0 }, children: "Page Editor" }),
2729
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { style: { color: "var(--theme-elevation-600)" }, children: "Loading page editor..." })
2794
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(StudioSectionLayout, { navProps: props, children: [
2795
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2796
+ import_ui6.SetStepNav,
2797
+ {
2798
+ nav: [
2799
+ { label: "Pages", url: "/admin/pages" },
2800
+ { label: "Page Editor", url: "/admin/pages" }
2801
+ ]
2802
+ }
2803
+ ),
2804
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("h1", { style: { margin: 0 }, children: "Page Editor" }),
2805
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { style: { color: "var(--theme-elevation-600)" }, children: "Loading page editor..." })
2730
2806
  ] });
2731
2807
  }
2732
2808
  if (!pageID) {
2733
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { padding: "1.2rem" }, children: [
2734
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("h1", { style: { margin: 0 }, children: "Page Editor" }),
2735
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { style: { color: "var(--theme-elevation-600)" }, children: "Missing page ID." })
2809
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(StudioSectionLayout, { navProps: props, children: [
2810
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2811
+ import_ui6.SetStepNav,
2812
+ {
2813
+ nav: [
2814
+ { label: "Pages", url: "/admin/pages" },
2815
+ { label: "Page Editor", url: "/admin/pages" }
2816
+ ]
2817
+ }
2818
+ ),
2819
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("h1", { style: { margin: 0 }, children: "Page Editor" }),
2820
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { style: { color: "var(--theme-elevation-600)" }, children: "Missing page ID." })
2736
2821
  ] });
2737
2822
  }
2738
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { display: "grid", gridTemplateRows: "auto 1fr", height: "calc(100vh - 0px)" }, children: [
2739
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
2740
- "div",
2823
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(StudioSectionLayout, { navProps: props, children: [
2824
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2825
+ import_ui6.SetStepNav,
2741
2826
  {
2742
- style: {
2743
- alignItems: "center",
2744
- background: "var(--theme-elevation-0)",
2745
- borderBottom: "1px solid var(--theme-elevation-150)",
2746
- display: "flex",
2747
- gap: "0.6rem",
2748
- justifyContent: "space-between",
2749
- padding: "0.65rem 0.9rem",
2750
- position: "sticky",
2751
- top: 0,
2752
- zIndex: 20
2753
- },
2754
- children: [
2755
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { minWidth: 0 }, children: [
2756
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { fontWeight: 900 }, children: "Page Editor" }),
2757
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
2758
- "div",
2759
- {
2760
- style: {
2761
- color: "var(--theme-elevation-600)",
2762
- fontSize: "0.85rem",
2763
- overflow: "hidden",
2764
- textOverflow: "ellipsis"
2765
- },
2766
- children: [
2767
- "Editing: ",
2768
- pageID
2769
- ]
2770
- }
2771
- )
2772
- ] }),
2773
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { alignItems: "center", display: "flex", gap: "0.5rem" }, children: [
2774
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
2775
- "button",
2776
- {
2777
- disabled: saving !== null,
2778
- onClick: () => requestSave("draft"),
2779
- style: {
2780
- border: "1px solid var(--theme-elevation-300)",
2781
- borderRadius: 12,
2782
- cursor: saving ? "not-allowed" : "pointer",
2783
- fontWeight: 800,
2784
- padding: "0.5rem 0.75rem"
2785
- },
2786
- type: "button",
2787
- children: saving === "draft" ? "Saving\u2026" : "Save Draft"
2788
- }
2789
- ),
2790
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
2791
- "button",
2792
- {
2793
- disabled: !canPublish || saving !== null,
2794
- onClick: () => requestSave("published"),
2795
- style: {
2796
- background: canPublish ? "var(--theme-elevation-900)" : "var(--theme-elevation-300)",
2797
- border: "none",
2798
- borderRadius: 12,
2799
- color: canPublish ? "var(--theme-elevation-0)" : "var(--theme-elevation-700)",
2800
- cursor: !canPublish || saving ? "not-allowed" : "pointer",
2801
- fontWeight: 900,
2802
- padding: "0.5rem 0.75rem"
2803
- },
2804
- type: "button",
2805
- title: !canPublish ? "You do not have publish permissions." : void 0,
2806
- children: saving === "published" ? "Publishing\u2026" : "Publish"
2807
- }
2808
- )
2809
- ] })
2827
+ nav: [
2828
+ { label: "Pages", url: "/admin/pages" },
2829
+ { label: `Page ${pageID}`, url: `/admin/pages/${pageID}` }
2810
2830
  ]
2811
2831
  }
2812
2832
  ),
2813
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
2814
- "iframe",
2815
- {
2816
- ref: iframeRef,
2817
- src: `${builderBasePath.replace(/\/$/, "")}/${pageID}`,
2818
- style: { border: "none", height: "100%", width: "100%" },
2819
- title: "Page Builder"
2820
- }
2821
- )
2833
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { style: { display: "grid", gridTemplateRows: "auto 1fr", height: "calc(100vh - 120px)" }, children: [
2834
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
2835
+ "div",
2836
+ {
2837
+ style: {
2838
+ alignItems: "center",
2839
+ background: "var(--theme-elevation-0)",
2840
+ borderBottom: "1px solid var(--theme-elevation-150)",
2841
+ display: "flex",
2842
+ gap: "0.6rem",
2843
+ justifyContent: "space-between",
2844
+ padding: "0.65rem 0.9rem",
2845
+ position: "sticky",
2846
+ top: 0,
2847
+ zIndex: 20
2848
+ },
2849
+ children: [
2850
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { style: { minWidth: 0 }, children: [
2851
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { fontWeight: 900 }, children: "Page Editor" }),
2852
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
2853
+ "div",
2854
+ {
2855
+ style: {
2856
+ color: "var(--theme-elevation-600)",
2857
+ fontSize: "0.85rem",
2858
+ overflow: "hidden",
2859
+ textOverflow: "ellipsis"
2860
+ },
2861
+ children: [
2862
+ "Editing: ",
2863
+ pageID
2864
+ ]
2865
+ }
2866
+ )
2867
+ ] }),
2868
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { style: { alignItems: "center", display: "flex", gap: "0.5rem" }, children: [
2869
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2870
+ "button",
2871
+ {
2872
+ disabled: saving !== null,
2873
+ onClick: () => requestSave("draft"),
2874
+ style: {
2875
+ border: "1px solid var(--theme-elevation-300)",
2876
+ borderRadius: 12,
2877
+ cursor: saving ? "not-allowed" : "pointer",
2878
+ fontWeight: 800,
2879
+ padding: "0.5rem 0.75rem"
2880
+ },
2881
+ type: "button",
2882
+ children: saving === "draft" ? "Saving\u2026" : "Save Draft"
2883
+ }
2884
+ ),
2885
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2886
+ "button",
2887
+ {
2888
+ disabled: !canPublish || saving !== null,
2889
+ onClick: () => requestSave("published"),
2890
+ style: {
2891
+ background: canPublish ? "var(--theme-elevation-900)" : "var(--theme-elevation-300)",
2892
+ border: "none",
2893
+ borderRadius: 12,
2894
+ color: canPublish ? "var(--theme-elevation-0)" : "var(--theme-elevation-700)",
2895
+ cursor: !canPublish || saving ? "not-allowed" : "pointer",
2896
+ fontWeight: 900,
2897
+ padding: "0.5rem 0.75rem"
2898
+ },
2899
+ type: "button",
2900
+ title: !canPublish ? "You do not have publish permissions." : void 0,
2901
+ children: saving === "published" ? "Publishing\u2026" : "Publish"
2902
+ }
2903
+ )
2904
+ ] })
2905
+ ]
2906
+ }
2907
+ ),
2908
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2909
+ "iframe",
2910
+ {
2911
+ ref: iframeRef,
2912
+ src: `${builderBasePath.replace(/\/$/, "")}/${pageID}`,
2913
+ style: { border: "none", height: "100%", width: "100%" },
2914
+ title: "Page Builder"
2915
+ }
2916
+ )
2917
+ ] })
2822
2918
  ] });
2823
2919
  }
2824
2920
 
2825
2921
  // src/admin/components/studio/AdminStudioGlobalsView.tsx
2826
- var import_ui6 = require("@payloadcms/ui");
2827
- var import_jsx_runtime18 = require("react/jsx-runtime");
2922
+ var import_ui7 = require("@payloadcms/ui");
2923
+ var import_jsx_runtime19 = require("react/jsx-runtime");
2828
2924
  var getPropGlobals = (props) => {
2829
2925
  if (!props || typeof props !== "object") return null;
2830
2926
  const direct = props.globals;
@@ -2854,11 +2950,11 @@ function AdminStudioGlobalsView(props) {
2854
2950
  { slug: "header", label: "Header & Navigation" },
2855
2951
  { slug: "footer", label: "Footer" }
2856
2952
  ];
2857
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
2858
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_ui6.SetStepNav, { nav: [{ label: "Globals", url: globalsBasePath }] }),
2859
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("h1", { style: { margin: 0 }, children: "Globals" }),
2860
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { style: { color: "var(--theme-elevation-600)", marginTop: "0.35rem" }, children: "Site-wide settings." }),
2861
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { display: "grid", gap: "0.6rem", marginTop: "1rem" }, children: globals.map((global) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
2953
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(StudioSectionLayout, { navProps: props, children: [
2954
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_ui7.SetStepNav, { nav: [{ label: "Globals", url: globalsBasePath }] }),
2955
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("h1", { style: { margin: 0 }, children: "Globals" }),
2956
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { style: { color: "var(--theme-elevation-600)", marginTop: "0.35rem" }, children: "Site-wide settings." }),
2957
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { style: { display: "grid", gap: "0.6rem", marginTop: "1rem" }, children: globals.map((global) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
2862
2958
  "a",
2863
2959
  {
2864
2960
  href: `/admin/globals/${global.slug}`,
@@ -2871,8 +2967,8 @@ function AdminStudioGlobalsView(props) {
2871
2967
  textDecoration: "none"
2872
2968
  },
2873
2969
  children: [
2874
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { fontWeight: 900 }, children: global.label }),
2875
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { style: { color: "var(--theme-elevation-600)", fontSize: "0.9rem" }, children: [
2970
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { style: { fontWeight: 900 }, children: global.label }),
2971
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { style: { color: "var(--theme-elevation-600)", fontSize: "0.9rem" }, children: [
2876
2972
  "/admin/globals/",
2877
2973
  global.slug
2878
2974
  ] })
@@ -2880,7 +2976,7 @@ function AdminStudioGlobalsView(props) {
2880
2976
  },
2881
2977
  global.slug
2882
2978
  )) }),
2883
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { marginTop: "1rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
2979
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { style: { marginTop: "1rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
2884
2980
  "a",
2885
2981
  {
2886
2982
  href: globalsBasePath,
@@ -2892,8 +2988,8 @@ function AdminStudioGlobalsView(props) {
2892
2988
  }
2893
2989
 
2894
2990
  // src/admin/components/studio/AdminStudioMediaView.tsx
2895
- var import_ui7 = require("@payloadcms/ui");
2896
- var import_jsx_runtime19 = require("react/jsx-runtime");
2991
+ var import_ui8 = require("@payloadcms/ui");
2992
+ var import_jsx_runtime20 = require("react/jsx-runtime");
2897
2993
  var getPropString5 = (props, key, fallback) => {
2898
2994
  if (!props || typeof props !== "object") return fallback;
2899
2995
  const direct = props[key];
@@ -2907,11 +3003,11 @@ var getPropString5 = (props, key, fallback) => {
2907
3003
  };
2908
3004
  function AdminStudioMediaView(props) {
2909
3005
  const mediaCollectionSlug = getPropString5(props, "mediaCollectionSlug", "media");
2910
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
2911
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_ui7.SetStepNav, { nav: [{ label: "Media", url: "/admin/media" }] }),
2912
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("h1", { style: { margin: 0 }, children: "Media" }),
2913
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { style: { color: "var(--theme-elevation-600)", marginTop: "0.35rem" }, children: "Media management is currently using Payload's library." }),
2914
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { style: { display: "grid", gap: "0.6rem", marginTop: "1rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
3006
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(StudioSectionLayout, { navProps: props, children: [
3007
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_ui8.SetStepNav, { nav: [{ label: "Media", url: "/admin/media" }] }),
3008
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h1", { style: { margin: 0 }, children: "Media" }),
3009
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { style: { color: "var(--theme-elevation-600)", marginTop: "0.35rem" }, children: "Media management is currently using Payload's library." }),
3010
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { display: "grid", gap: "0.6rem", marginTop: "1rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
2915
3011
  "a",
2916
3012
  {
2917
3013
  href: `/admin/collections/${mediaCollectionSlug}`,
@@ -2924,8 +3020,8 @@ function AdminStudioMediaView(props) {
2924
3020
  textDecoration: "none"
2925
3021
  },
2926
3022
  children: [
2927
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { style: { fontWeight: 900 }, children: "Open Media Library" }),
2928
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { style: { color: "var(--theme-elevation-600)", fontSize: "0.9rem" }, children: [
3023
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { fontWeight: 900 }, children: "Open Media Library" }),
3024
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { style: { color: "var(--theme-elevation-600)", fontSize: "0.9rem" }, children: [
2929
3025
  "/admin/collections/",
2930
3026
  mediaCollectionSlug
2931
3027
  ] })
@@ -2936,8 +3032,8 @@ function AdminStudioMediaView(props) {
2936
3032
  }
2937
3033
 
2938
3034
  // src/admin/components/studio/AdminStudioToolsView.tsx
2939
- var import_ui8 = require("@payloadcms/ui");
2940
- var import_jsx_runtime20 = require("react/jsx-runtime");
3035
+ var import_ui9 = require("@payloadcms/ui");
3036
+ var import_jsx_runtime21 = require("react/jsx-runtime");
2941
3037
  var isAdmin4 = (user) => {
2942
3038
  if (!user || typeof user !== "object") return false;
2943
3039
  const role = user.role;
@@ -2955,12 +3051,12 @@ var getPropString6 = (props, key, fallback) => {
2955
3051
  return fallback;
2956
3052
  };
2957
3053
  function AdminStudioToolsView(props) {
2958
- const { user } = (0, import_ui8.useAuth)();
3054
+ const { user } = (0, import_ui9.useAuth)();
2959
3055
  if (!isAdmin4(user)) {
2960
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
2961
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_ui8.SetStepNav, { nav: [{ label: "Admin Tools", url: "/admin/tools" }] }),
2962
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h1", { style: { margin: 0 }, children: "Admin Tools" }),
2963
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { style: { color: "var(--theme-elevation-600)" }, children: "You do not have access to this page." })
3056
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(StudioSectionLayout, { navProps: props, children: [
3057
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_ui9.SetStepNav, { nav: [{ label: "Admin Tools", url: "/admin/tools" }] }),
3058
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h1", { style: { margin: 0 }, children: "Admin Tools" }),
3059
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { style: { color: "var(--theme-elevation-600)" }, children: "You do not have access to this page." })
2964
3060
  ] });
2965
3061
  }
2966
3062
  const pagesCollectionSlug = getPropString6(props, "pagesCollectionSlug", "pages");
@@ -2973,11 +3069,11 @@ function AdminStudioToolsView(props) {
2973
3069
  { href: "/admin/globals/footer", label: "Raw Footer Global" },
2974
3070
  { href: "/admin/collections/users", label: "Users / Roles" }
2975
3071
  ];
2976
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
2977
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_ui8.SetStepNav, { nav: [{ label: "Admin Tools", url: "/admin/tools" }] }),
2978
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h1", { style: { margin: 0 }, children: "Admin Tools" }),
2979
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { style: { color: "var(--theme-elevation-600)", marginTop: "0.35rem" }, children: "Hidden fallback links for administrators." }),
2980
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { display: "grid", gap: "0.6rem", marginTop: "1rem" }, children: links.map((link) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
3072
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(StudioSectionLayout, { navProps: props, children: [
3073
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_ui9.SetStepNav, { nav: [{ label: "Admin Tools", url: "/admin/tools" }] }),
3074
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("h1", { style: { margin: 0 }, children: "Admin Tools" }),
3075
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { style: { color: "var(--theme-elevation-600)", marginTop: "0.35rem" }, children: "Hidden fallback links for administrators." }),
3076
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { style: { display: "grid", gap: "0.6rem", marginTop: "1rem" }, children: links.map((link) => /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
2981
3077
  "a",
2982
3078
  {
2983
3079
  href: link.href,
@@ -2990,8 +3086,8 @@ function AdminStudioToolsView(props) {
2990
3086
  textDecoration: "none"
2991
3087
  },
2992
3088
  children: [
2993
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { fontWeight: 900 }, children: link.label }),
2994
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { color: "var(--theme-elevation-600)", fontSize: "0.9rem" }, children: link.href })
3089
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { style: { fontWeight: 900 }, children: link.label }),
3090
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { style: { color: "var(--theme-elevation-600)", fontSize: "0.9rem" }, children: link.href })
2995
3091
  ]
2996
3092
  },
2997
3093
  link.href
@@ -3000,15 +3096,15 @@ function AdminStudioToolsView(props) {
3000
3096
  }
3001
3097
 
3002
3098
  // src/admin/components/studio/OpenInStudioMenuItem.tsx
3003
- var import_ui9 = require("@payloadcms/ui");
3004
- var import_jsx_runtime21 = require("react/jsx-runtime");
3099
+ var import_ui10 = require("@payloadcms/ui");
3100
+ var import_jsx_runtime22 = require("react/jsx-runtime");
3005
3101
  function OpenInStudioMenuItem({ pagesPathBase = "/admin/pages" }) {
3006
- const documentInfo = (0, import_ui9.useDocumentInfo)();
3102
+ const documentInfo = (0, import_ui10.useDocumentInfo)();
3007
3103
  const id = documentInfo?.id;
3008
3104
  if (!id) {
3009
3105
  return null;
3010
3106
  }
3011
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
3107
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
3012
3108
  "a",
3013
3109
  {
3014
3110
  href: `${pagesPathBase}/${id}`,
@@ -3027,19 +3123,19 @@ function OpenInStudioMenuItem({ pagesPathBase = "/admin/pages" }) {
3027
3123
  }
3028
3124
 
3029
3125
  // src/admin/components/studio/PageEditRedirectToStudio.tsx
3030
- var import_react14 = require("react");
3031
- var import_ui10 = require("@payloadcms/ui");
3032
- var import_jsx_runtime22 = require("react/jsx-runtime");
3126
+ var import_react15 = require("react");
3127
+ var import_ui11 = require("@payloadcms/ui");
3128
+ var import_jsx_runtime23 = require("react/jsx-runtime");
3033
3129
  function PageEditRedirectToStudio({ pagesPathBase = "/admin/pages" }) {
3034
- const documentInfo = (0, import_ui10.useDocumentInfo)();
3130
+ const documentInfo = (0, import_ui11.useDocumentInfo)();
3035
3131
  const id = documentInfo?.id;
3036
- (0, import_react14.useEffect)(() => {
3132
+ (0, import_react15.useEffect)(() => {
3037
3133
  if (!id) {
3038
3134
  return;
3039
3135
  }
3040
3136
  window.location.replace(`${pagesPathBase}/${id}`);
3041
3137
  }, [id, pagesPathBase]);
3042
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
3138
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
3043
3139
  "div",
3044
3140
  {
3045
3141
  style: {
@@ -3051,47 +3147,53 @@ function PageEditRedirectToStudio({ pagesPathBase = "/admin/pages" }) {
3051
3147
  minHeight: "50vh"
3052
3148
  },
3053
3149
  children: [
3054
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h2", { style: { margin: 0 }, children: "Opening Editor..." }),
3055
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { style: { color: "var(--theme-elevation-600)", margin: 0 }, children: "Redirecting to the custom page editor." }),
3056
- id ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("a", { href: `${pagesPathBase}/${id}`, children: "Continue to Editor" }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("a", { href: pagesPathBase, children: "Open Pages" })
3150
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("h2", { style: { margin: 0 }, children: "Opening Editor..." }),
3151
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { style: { color: "var(--theme-elevation-600)", margin: 0 }, children: "Redirecting to the custom page editor." }),
3152
+ id ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("a", { href: `${pagesPathBase}/${id}`, children: "Continue to Editor" }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("a", { href: pagesPathBase, children: "Open Pages" })
3057
3153
  ]
3058
3154
  }
3059
3155
  );
3060
3156
  }
3061
3157
 
3062
3158
  // src/admin/components/studio/StudioBackBreadcrumb.tsx
3063
- var import_ui11 = require("@payloadcms/ui");
3159
+ var import_ui12 = require("@payloadcms/ui");
3064
3160
  var import_navigation = require("next/navigation");
3065
- var import_react15 = require("react");
3066
- var import_jsx_runtime23 = require("react/jsx-runtime");
3067
- var resolveSectionLink = (pathname) => {
3161
+ var import_jsx_runtime24 = require("react/jsx-runtime");
3162
+ var toTitle = (slug) => slug.split("-").filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
3163
+ var buildNav = (pathname) => {
3068
3164
  if (pathname.includes("/globals/")) {
3069
- return { href: "/admin/studio-globals", label: "Globals" };
3165
+ const slug = pathname.split("/globals/")[1]?.split("/")[0] || "";
3166
+ const currentLabel = slug === "site-settings" ? "Website Settings" : toTitle(slug) || "Global";
3167
+ return [
3168
+ { label: "Globals", url: "/admin/studio-globals" },
3169
+ { label: currentLabel }
3170
+ ];
3070
3171
  }
3071
3172
  if (pathname.includes("/collections/pages") || pathname.startsWith("/admin/pages/")) {
3072
- return { href: "/admin/pages", label: "Pages" };
3173
+ return [
3174
+ { label: "Pages", url: "/admin/pages" },
3175
+ { label: "Page" }
3176
+ ];
3073
3177
  }
3074
3178
  if (pathname.includes("/collections/media")) {
3075
- return { href: "/admin/media", label: "Media" };
3179
+ return [
3180
+ { label: "Media", url: "/admin/media" },
3181
+ { label: "Media Item" }
3182
+ ];
3076
3183
  }
3077
3184
  if (pathname.startsWith("/admin/tools")) {
3078
- return { href: "/admin/tools", label: "Admin Tools" };
3185
+ return [
3186
+ { label: "Admin Tools", url: "/admin/tools" },
3187
+ { label: "Tool" }
3188
+ ];
3079
3189
  }
3080
3190
  return null;
3081
3191
  };
3082
3192
  function StudioBackBreadcrumb() {
3083
3193
  const pathname = (0, import_navigation.usePathname)();
3084
- const { stepNav } = (0, import_ui11.useStepNav)();
3085
- const section = resolveSectionLink(pathname);
3086
- const mergedNav = (0, import_react15.useMemo)(() => {
3087
- if (!section) return stepNav;
3088
- const rest = stepNav.filter((item) => {
3089
- return !(typeof item.label === "string" && item.label.toLowerCase() === section.label.toLowerCase());
3090
- });
3091
- return [{ label: section.label, url: section.href }, ...rest];
3092
- }, [section, stepNav]);
3093
- if (!section) return null;
3094
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_ui11.SetStepNav, { nav: mergedNav });
3194
+ const nav = buildNav(pathname);
3195
+ if (!nav) return null;
3196
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_ui12.SetStepNav, { nav });
3095
3197
  }
3096
3198
  // Annotate the CommonJS export names for ESM import in node:
3097
3199
  0 && (module.exports = {