@orion-studios/payload-studio 0.5.0-beta.114 → 0.5.0-beta.115

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.
@@ -1565,7 +1565,13 @@ var buttonActive = {
1565
1565
  borderColor: "var(--theme-success-500)",
1566
1566
  color: "var(--theme-success-500)"
1567
1567
  };
1568
- function ThemeSwitcher({ defaultTheme = "brand-light" }) {
1568
+ function ThemeSwitcher({
1569
+ allowThemePreference = false,
1570
+ defaultTheme = "brand-light"
1571
+ }) {
1572
+ if (!allowThemePreference) {
1573
+ return null;
1574
+ }
1569
1575
  const { isDark, isBrand, hasMounted, toggleDarkMode, toggleBrandMode } = useTheme(defaultTheme);
1570
1576
  const showDark = hasMounted && isDark;
1571
1577
  const showBrand = hasMounted && isBrand;
@@ -1605,10 +1611,14 @@ function ThemeSwitcher({ defaultTheme = "brand-light" }) {
1605
1611
  }
1606
1612
  );
1607
1613
  }
1608
- function ThemeProvider({ children, defaultTheme = "brand-light" }) {
1609
- (0, import_react3.useEffect)(() => {
1614
+ function ThemeProvider({
1615
+ children,
1616
+ defaultTheme = "brand-light",
1617
+ allowThemePreference = false
1618
+ }) {
1619
+ (0, import_react3.useLayoutEffect)(() => {
1610
1620
  try {
1611
- const stored = localStorage.getItem("orion-admin-theme");
1621
+ const stored = allowThemePreference ? localStorage.getItem("orion-admin-theme") : null;
1612
1622
  const html = document.documentElement;
1613
1623
  const resolvedTheme = stored && ["light", "dark", "brand-light", "brand-dark"].includes(stored) ? stored : defaultTheme;
1614
1624
  const isDark = resolvedTheme === "dark" || resolvedTheme === "brand-dark";
@@ -1626,7 +1636,7 @@ function ThemeProvider({ children, defaultTheme = "brand-light" }) {
1626
1636
  localStorage.setItem("orion-admin-theme", resolvedTheme);
1627
1637
  } catch {
1628
1638
  }
1629
- }, [defaultTheme]);
1639
+ }, [allowThemePreference, defaultTheme]);
1630
1640
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children });
1631
1641
  }
1632
1642
 
@@ -2281,7 +2291,7 @@ function WelcomeHeader({
2281
2291
  }
2282
2292
 
2283
2293
  // src/admin/components/studio/AdminStudioDashboard.tsx
2284
- var import_ui4 = require("@payloadcms/ui");
2294
+ var import_ui3 = require("@payloadcms/ui");
2285
2295
 
2286
2296
  // src/shared/studioSections.ts
2287
2297
  var studioRoles = /* @__PURE__ */ new Set(["admin", "editor", "client"]);
@@ -2434,12 +2444,116 @@ var useAdminBasePath = (fallback = DEFAULT_ADMIN_BASE_PATH) => {
2434
2444
  };
2435
2445
 
2436
2446
  // src/admin/components/studio/StudioSectionLayout.tsx
2437
- var import_react13 = require("react");
2447
+ var import_jsx_runtime14 = require("react/jsx-runtime");
2448
+ function StudioSectionLayout({ children, navProps: _navProps }) {
2449
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_jsx_runtime14.Fragment, { children });
2450
+ }
2451
+
2452
+ // src/admin/components/studio/AdminStudioDashboard.tsx
2453
+ var import_jsx_runtime15 = require("react/jsx-runtime");
2454
+ var cardStyle = {
2455
+ background: "var(--theme-elevation-0)",
2456
+ border: "1px solid var(--theme-elevation-150)",
2457
+ borderRadius: 16,
2458
+ color: "inherit",
2459
+ padding: "1rem",
2460
+ textDecoration: "none"
2461
+ };
2462
+ var getPropString = (props, key, fallback) => {
2463
+ if (!props || typeof props !== "object") return fallback;
2464
+ const direct = props[key];
2465
+ if (typeof direct === "string" && direct.length > 0) return direct;
2466
+ const clientProps = props.clientProps;
2467
+ if (clientProps && typeof clientProps === "object") {
2468
+ const nested = clientProps[key];
2469
+ if (typeof nested === "string" && nested.length > 0) return nested;
2470
+ }
2471
+ return fallback;
2472
+ };
2473
+ var getPropBoolean = (props, key, fallback) => {
2474
+ if (!props || typeof props !== "object") return fallback;
2475
+ const direct = props[key];
2476
+ if (typeof direct === "boolean") return direct;
2477
+ const clientProps = props.clientProps;
2478
+ if (clientProps && typeof clientProps === "object") {
2479
+ const nested = clientProps[key];
2480
+ if (typeof nested === "boolean") return nested;
2481
+ }
2482
+ return fallback;
2483
+ };
2484
+ var getPropSections = (props, key) => {
2485
+ if (!props || typeof props !== "object") return [];
2486
+ const direct = resolveStudioSections(props[key]);
2487
+ if (direct.length > 0) return direct;
2488
+ const clientProps = props.clientProps;
2489
+ if (clientProps && typeof clientProps === "object") {
2490
+ return resolveStudioSections(clientProps[key]);
2491
+ }
2492
+ return [];
2493
+ };
2494
+ function AdminStudioDashboard(props) {
2495
+ const formsEnabled = getPropBoolean(props, "formsEnabled", false);
2496
+ const globalsBasePath = getPropString(props, "globalsBasePath", "/globals");
2497
+ const sections = getPropSections(props, "sections");
2498
+ const adminBasePath = useAdminBasePath();
2499
+ const resolvedGlobalsBasePath = resolveAdminPath(adminBasePath, globalsBasePath);
2500
+ const formsPath = resolveAdminPath(adminBasePath, "/forms");
2501
+ const pagesPath = resolveAdminPath(adminBasePath, "/pages");
2502
+ const mediaPath = resolveAdminPath(adminBasePath, "/media");
2503
+ const toolsPath = resolveAdminPath(adminBasePath, "/tools");
2504
+ const extensionCards = sections.filter((section) => section.card).map((section) => ({
2505
+ href: resolveAdminPath(adminBasePath, section.href),
2506
+ title: section.card?.title || section.label,
2507
+ description: section.card?.description || ""
2508
+ }));
2509
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(StudioSectionLayout, { navProps: props, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { style: { paddingBottom: "1.3rem" }, children: [
2510
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_ui3.SetStepNav, { nav: [{ label: "Dashboard", url: adminBasePath }] }),
2511
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("h1", { style: { fontSize: "1.6rem", margin: 0 }, children: "Studio" }),
2512
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { style: { color: "var(--theme-elevation-600)", marginTop: "0.35rem" }, children: "Pick what you want to edit." }),
2513
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2514
+ "div",
2515
+ {
2516
+ style: {
2517
+ display: "grid",
2518
+ gap: "0.85rem",
2519
+ gridTemplateColumns: "repeat(auto-fit, minmax(240px, 1fr))",
2520
+ marginTop: "1.1rem"
2521
+ },
2522
+ children: [
2523
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("a", { href: pagesPath, style: cardStyle, children: [
2524
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontWeight: 900 }, children: "Pages" }),
2525
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { color: "var(--theme-elevation-600)", marginTop: "0.25rem" }, children: "Edit your site pages with the custom editor." })
2526
+ ] }),
2527
+ formsEnabled ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("a", { href: formsPath, style: cardStyle, children: [
2528
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontWeight: 900 }, children: "Forms" }),
2529
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { color: "var(--theme-elevation-600)", marginTop: "0.25rem" }, children: "Review forms, submissions, and uploaded files." })
2530
+ ] }) : null,
2531
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("a", { href: resolvedGlobalsBasePath, style: cardStyle, children: [
2532
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontWeight: 900 }, children: "Globals" }),
2533
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { color: "var(--theme-elevation-600)", marginTop: "0.25rem" }, children: "Site settings, header, footer." })
2534
+ ] }),
2535
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("a", { href: mediaPath, style: cardStyle, children: [
2536
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontWeight: 900 }, children: "Media" }),
2537
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { color: "var(--theme-elevation-600)", marginTop: "0.25rem" }, children: "Upload and manage images and files." })
2538
+ ] }),
2539
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("a", { href: toolsPath, style: cardStyle, children: [
2540
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontWeight: 900 }, children: "Admin Tools" }),
2541
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { color: "var(--theme-elevation-600)", marginTop: "0.25rem" }, children: "Open admin-only fallback links and user management." })
2542
+ ] }),
2543
+ extensionCards.map((card) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("a", { href: card.href, style: cardStyle, children: [
2544
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontWeight: 900 }, children: card.title }),
2545
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { color: "var(--theme-elevation-600)", marginTop: "0.25rem" }, children: card.description })
2546
+ ] }, card.href))
2547
+ ]
2548
+ }
2549
+ )
2550
+ ] }) });
2551
+ }
2438
2552
 
2439
2553
  // src/admin/components/studio/AdminStudioNav.tsx
2440
2554
  var import_react12 = require("react");
2441
- var import_ui3 = require("@payloadcms/ui");
2442
- var import_jsx_runtime14 = require("react/jsx-runtime");
2555
+ var import_ui4 = require("@payloadcms/ui");
2556
+ var import_jsx_runtime16 = require("react/jsx-runtime");
2443
2557
  var iconSize2 = 18;
2444
2558
  function NavIcon({ sectionID }) {
2445
2559
  const props = {
@@ -2454,45 +2568,45 @@ function NavIcon({ sectionID }) {
2454
2568
  };
2455
2569
  switch (sectionID) {
2456
2570
  case "dashboard":
2457
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("svg", { ...props, children: [
2458
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("rect", { x: "3", y: "3", width: "7", height: "9", rx: "1" }),
2459
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("rect", { x: "14", y: "3", width: "7", height: "5", rx: "1" }),
2460
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("rect", { x: "14", y: "12", width: "7", height: "9", rx: "1" }),
2461
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("rect", { x: "3", y: "16", width: "7", height: "5", rx: "1" })
2571
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("svg", { ...props, children: [
2572
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("rect", { x: "3", y: "3", width: "7", height: "9", rx: "1" }),
2573
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("rect", { x: "14", y: "3", width: "7", height: "5", rx: "1" }),
2574
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("rect", { x: "14", y: "12", width: "7", height: "9", rx: "1" }),
2575
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("rect", { x: "3", y: "16", width: "7", height: "5", rx: "1" })
2462
2576
  ] });
2463
2577
  case "pages":
2464
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("svg", { ...props, children: [
2465
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z" }),
2466
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("polyline", { points: "14 2 14 8 20 8" }),
2467
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("line", { x1: "8", y1: "13", x2: "16", y2: "13" }),
2468
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("line", { x1: "8", y1: "17", x2: "12", y2: "17" })
2578
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("svg", { ...props, children: [
2579
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z" }),
2580
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("polyline", { points: "14 2 14 8 20 8" }),
2581
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("line", { x1: "8", y1: "13", x2: "16", y2: "13" }),
2582
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("line", { x1: "8", y1: "17", x2: "12", y2: "17" })
2469
2583
  ] });
2470
2584
  case "forms":
2471
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("svg", { ...props, children: [
2472
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "M9 3h6" }),
2473
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "M12 3v18" }),
2474
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "M5 7h14a2 2 0 0 1 2 2v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a2 2 0 0 1 2-2Z" }),
2475
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "M7 11h10" }),
2476
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "M7 15h6" })
2585
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("svg", { ...props, children: [
2586
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: "M9 3h6" }),
2587
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: "M12 3v18" }),
2588
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: "M5 7h14a2 2 0 0 1 2 2v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a2 2 0 0 1 2-2Z" }),
2589
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: "M7 11h10" }),
2590
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: "M7 15h6" })
2477
2591
  ] });
2478
2592
  case "globals":
2479
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("svg", { ...props, children: [
2480
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("circle", { cx: "12", cy: "12", r: "3" }),
2481
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1Z" })
2593
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("svg", { ...props, children: [
2594
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("circle", { cx: "12", cy: "12", r: "3" }),
2595
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1Z" })
2482
2596
  ] });
2483
2597
  case "media":
2484
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("svg", { ...props, children: [
2485
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }),
2486
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("circle", { cx: "8.5", cy: "8.5", r: "1.5" }),
2487
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("polyline", { points: "21 15 16 10 5 21" })
2598
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("svg", { ...props, children: [
2599
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }),
2600
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("circle", { cx: "8.5", cy: "8.5", r: "1.5" }),
2601
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("polyline", { points: "21 15 16 10 5 21" })
2488
2602
  ] });
2489
2603
  case "admin-tools":
2490
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("svg", { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76Z" }) });
2604
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("svg", { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: "M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76Z" }) });
2491
2605
  default:
2492
2606
  return null;
2493
2607
  }
2494
2608
  }
2495
- var getPropString = (props, key, fallback) => {
2609
+ var getPropString2 = (props, key, fallback) => {
2496
2610
  if (!props || typeof props !== "object") return fallback;
2497
2611
  const direct = props[key];
2498
2612
  if (typeof direct === "string" && direct.length > 0) return direct;
@@ -2503,7 +2617,7 @@ var getPropString = (props, key, fallback) => {
2503
2617
  }
2504
2618
  return fallback;
2505
2619
  };
2506
- var getPropBoolean = (props, key, fallback) => {
2620
+ var getPropBoolean2 = (props, key, fallback) => {
2507
2621
  if (!props || typeof props !== "object") return fallback;
2508
2622
  const direct = props[key];
2509
2623
  if (typeof direct === "boolean") return direct;
@@ -2526,7 +2640,7 @@ var getPropStringArray = (props, key, fallback) => {
2526
2640
  }
2527
2641
  return fallback;
2528
2642
  };
2529
- var getPropSections = (props, key) => {
2643
+ var getPropSections2 = (props, key) => {
2530
2644
  if (!props || typeof props !== "object") return [];
2531
2645
  const direct = resolveStudioSections(props[key]);
2532
2646
  if (direct.length > 0) return direct;
@@ -2553,22 +2667,22 @@ var readUserRole = (user) => {
2553
2667
  return typeof role === "string" ? role : void 0;
2554
2668
  };
2555
2669
  function AdminStudioNav(props) {
2556
- const { user } = (0, import_ui3.useAuth)();
2557
- const brandName = getPropString(props, "brandName", "Orion Studio");
2558
- const logoUrl = getPropString(props, "logoUrl", "");
2559
- const formsEnabled = getPropBoolean(props, "formsEnabled", false);
2560
- const formsCollectionSlug = getPropString(props, "formsCollectionSlug", "forms");
2561
- const formSubmissionsCollectionSlug = getPropString(
2670
+ const { user } = (0, import_ui4.useAuth)();
2671
+ const brandName = getPropString2(props, "brandName", "Orion Studio");
2672
+ const logoUrl = getPropString2(props, "logoUrl", "");
2673
+ const formsEnabled = getPropBoolean2(props, "formsEnabled", false);
2674
+ const formsCollectionSlug = getPropString2(props, "formsCollectionSlug", "forms");
2675
+ const formSubmissionsCollectionSlug = getPropString2(
2562
2676
  props,
2563
2677
  "formSubmissionsCollectionSlug",
2564
2678
  "form-submissions"
2565
2679
  );
2566
- const formUploadsCollectionSlug = getPropString(props, "formUploadsCollectionSlug", "form-uploads");
2567
- const mediaCollectionSlug = getPropString(props, "mediaCollectionSlug", "media");
2568
- const globalsBasePath = getPropString(props, "globalsBasePath", "/globals");
2680
+ const formUploadsCollectionSlug = getPropString2(props, "formUploadsCollectionSlug", "form-uploads");
2681
+ const mediaCollectionSlug = getPropString2(props, "mediaCollectionSlug", "media");
2682
+ const globalsBasePath = getPropString2(props, "globalsBasePath", "/globals");
2569
2683
  const globalsExtraMatchPrefixes = getPropStringArray(props, "globalsExtraMatchPrefixes", []);
2570
- const sections = getPropSections(props, "sections");
2571
- const compact = getPropBoolean(props, "compact", false);
2684
+ const sections = getPropSections2(props, "sections");
2685
+ const compact = getPropBoolean2(props, "compact", false);
2572
2686
  const adminBasePath = useAdminBasePath();
2573
2687
  const branding = useSiteBranding(brandName, logoUrl || void 0);
2574
2688
  const resolvedName = branding.siteName || brandName;
@@ -2670,7 +2784,7 @@ function AdminStudioNav(props) {
2670
2784
  padding: compact ? "0.6rem" : "0.6rem 0.75rem",
2671
2785
  textDecoration: "none"
2672
2786
  });
2673
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
2787
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
2674
2788
  "div",
2675
2789
  {
2676
2790
  style: {
@@ -2681,8 +2795,8 @@ function AdminStudioNav(props) {
2681
2795
  padding: compact ? "0.8rem 0.5rem" : "1rem 0.85rem"
2682
2796
  },
2683
2797
  children: [
2684
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "admin-studio-brand", style: { padding: compact ? "0" : "0 0.35rem 0 2.4rem" }, children: [
2685
- branding.logoUrl ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2798
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "admin-studio-brand", style: { padding: compact ? "0" : "0 0.35rem 0 2.4rem" }, children: [
2799
+ branding.logoUrl ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2686
2800
  "div",
2687
2801
  {
2688
2802
  style: {
@@ -2692,10 +2806,10 @@ function AdminStudioNav(props) {
2692
2806
  overflow: "hidden",
2693
2807
  width: compact ? 34 : 40
2694
2808
  },
2695
- children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("img", { alt: `${resolvedName} logo`, src: branding.logoUrl, style: { height: "100%", objectFit: "cover", width: "100%" } })
2809
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("img", { alt: `${resolvedName} logo`, src: branding.logoUrl, style: { height: "100%", objectFit: "cover", width: "100%" } })
2696
2810
  }
2697
2811
  ) : null,
2698
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
2812
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2699
2813
  "div",
2700
2814
  {
2701
2815
  style: {
@@ -2710,23 +2824,23 @@ function AdminStudioNav(props) {
2710
2824
  children: compact ? resolvedName.slice(0, 1).toUpperCase() : resolvedName
2711
2825
  }
2712
2826
  ),
2713
- !compact ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { color: "var(--theme-elevation-600)", fontSize: "0.85rem" }, children: "Studio" }) : null
2827
+ !compact ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { color: "var(--theme-elevation-600)", fontSize: "0.85rem" }, children: "Studio" }) : null
2714
2828
  ] }),
2715
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("nav", { style: { display: "grid", gap: "0.25rem" }, children: links.filter((link) => roleCanAccessSection(userRole, link)).map((link) => {
2829
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("nav", { style: { display: "grid", gap: "0.25rem" }, children: links.filter((link) => roleCanAccessSection(userRole, link)).map((link) => {
2716
2830
  const active = link.href === dashboardPath ? pathname === dashboardPath : link.matchPrefixes.some((prefix) => pathname.startsWith(prefix));
2717
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("a", { href: link.href, style: linkStyle(active), title: link.label, children: (() => {
2718
- const icon = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(NavIcon, { sectionID: link.id });
2831
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("a", { href: link.href, style: linkStyle(active), title: link.label, children: (() => {
2832
+ const icon = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(NavIcon, { sectionID: link.id });
2719
2833
  if (compact) {
2720
2834
  return icon || link.label.slice(0, 1);
2721
2835
  }
2722
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { style: { alignItems: "center", display: "inline-flex", gap: "0.6rem" }, children: [
2836
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("span", { style: { alignItems: "center", display: "inline-flex", gap: "0.6rem" }, children: [
2723
2837
  icon,
2724
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: link.label })
2838
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { children: link.label })
2725
2839
  ] });
2726
2840
  })() }, link.href);
2727
2841
  }) }),
2728
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { flex: 1 } }),
2729
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
2842
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { flex: 1 } }),
2843
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
2730
2844
  "div",
2731
2845
  {
2732
2846
  style: {
@@ -2735,11 +2849,11 @@ function AdminStudioNav(props) {
2735
2849
  textAlign: compact ? "center" : "left"
2736
2850
  },
2737
2851
  children: [
2738
- !compact ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
2739
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { color: "var(--theme-elevation-700)", fontSize: "0.85rem" }, children: "Signed in as" }),
2740
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { fontWeight: 800, marginBottom: "0.55rem" }, children: typeof user?.email === "string" ? user.email : "User" })
2852
+ !compact ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
2853
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { color: "var(--theme-elevation-700)", fontSize: "0.85rem" }, children: "Signed in as" }),
2854
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontWeight: 800, marginBottom: "0.55rem" }, children: typeof user?.email === "string" ? user.email : "User" })
2741
2855
  ] }) : null,
2742
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_ui3.Logout, {})
2856
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_ui4.Logout, {})
2743
2857
  ]
2744
2858
  }
2745
2859
  )
@@ -2748,169 +2862,8 @@ function AdminStudioNav(props) {
2748
2862
  );
2749
2863
  }
2750
2864
 
2751
- // src/admin/components/studio/StudioSectionLayout.tsx
2752
- var import_jsx_runtime15 = require("react/jsx-runtime");
2753
- var STORAGE_KEY2 = "orion-studio-sidebar-collapsed";
2754
- var ACTIVE_CLASS = "orion-studio-shell-active";
2755
- function StudioSectionLayout({ children, navProps }) {
2756
- const [collapsed, setCollapsed] = (0, import_react13.useState)(false);
2757
- (0, import_react13.useEffect)(() => {
2758
- try {
2759
- const stored = window.localStorage.getItem(STORAGE_KEY2);
2760
- if (stored === "1") {
2761
- setCollapsed(true);
2762
- }
2763
- } catch {
2764
- }
2765
- }, []);
2766
- (0, import_react13.useEffect)(() => {
2767
- document.body.classList.add(ACTIVE_CLASS);
2768
- return () => {
2769
- document.body.classList.remove(ACTIVE_CLASS);
2770
- };
2771
- }, []);
2772
- const toggle = () => {
2773
- setCollapsed((prev) => {
2774
- const next = !prev;
2775
- try {
2776
- window.localStorage.setItem(STORAGE_KEY2, next ? "1" : "0");
2777
- } catch {
2778
- }
2779
- return next;
2780
- });
2781
- };
2782
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2783
- "div",
2784
- {
2785
- className: `orion-studio-shell ${collapsed ? "is-collapsed" : ""}`,
2786
- style: {
2787
- display: "grid",
2788
- gridTemplateColumns: collapsed ? "84px minmax(0, 1fr)" : "260px minmax(0, 1fr)",
2789
- minHeight: "100vh"
2790
- },
2791
- children: [
2792
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("aside", { className: "orion-studio-sidebar", children: [
2793
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2794
- "button",
2795
- {
2796
- "aria-label": collapsed ? "Expand sidebar" : "Collapse sidebar",
2797
- className: "orion-studio-sidebar-toggle",
2798
- onClick: toggle,
2799
- type: "button",
2800
- children: collapsed ? ">" : "<"
2801
- }
2802
- ),
2803
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "orion-studio-sidebar-scroll", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(AdminStudioNav, { ...navProps, compact: collapsed }) })
2804
- ] }),
2805
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("main", { className: "orion-studio-main", children })
2806
- ]
2807
- }
2808
- );
2809
- }
2810
-
2811
- // src/admin/components/studio/AdminStudioDashboard.tsx
2812
- var import_jsx_runtime16 = require("react/jsx-runtime");
2813
- var cardStyle = {
2814
- background: "var(--theme-elevation-0)",
2815
- border: "1px solid var(--theme-elevation-150)",
2816
- borderRadius: 16,
2817
- color: "inherit",
2818
- padding: "1rem",
2819
- textDecoration: "none"
2820
- };
2821
- var getPropString2 = (props, key, fallback) => {
2822
- if (!props || typeof props !== "object") return fallback;
2823
- const direct = props[key];
2824
- if (typeof direct === "string" && direct.length > 0) return direct;
2825
- const clientProps = props.clientProps;
2826
- if (clientProps && typeof clientProps === "object") {
2827
- const nested = clientProps[key];
2828
- if (typeof nested === "string" && nested.length > 0) return nested;
2829
- }
2830
- return fallback;
2831
- };
2832
- var getPropBoolean2 = (props, key, fallback) => {
2833
- if (!props || typeof props !== "object") return fallback;
2834
- const direct = props[key];
2835
- if (typeof direct === "boolean") return direct;
2836
- const clientProps = props.clientProps;
2837
- if (clientProps && typeof clientProps === "object") {
2838
- const nested = clientProps[key];
2839
- if (typeof nested === "boolean") return nested;
2840
- }
2841
- return fallback;
2842
- };
2843
- var getPropSections2 = (props, key) => {
2844
- if (!props || typeof props !== "object") return [];
2845
- const direct = resolveStudioSections(props[key]);
2846
- if (direct.length > 0) return direct;
2847
- const clientProps = props.clientProps;
2848
- if (clientProps && typeof clientProps === "object") {
2849
- return resolveStudioSections(clientProps[key]);
2850
- }
2851
- return [];
2852
- };
2853
- function AdminStudioDashboard(props) {
2854
- const formsEnabled = getPropBoolean2(props, "formsEnabled", false);
2855
- const globalsBasePath = getPropString2(props, "globalsBasePath", "/globals");
2856
- const sections = getPropSections2(props, "sections");
2857
- const adminBasePath = useAdminBasePath();
2858
- const resolvedGlobalsBasePath = resolveAdminPath(adminBasePath, globalsBasePath);
2859
- const formsPath = resolveAdminPath(adminBasePath, "/forms");
2860
- const pagesPath = resolveAdminPath(adminBasePath, "/pages");
2861
- const mediaPath = resolveAdminPath(adminBasePath, "/media");
2862
- const toolsPath = resolveAdminPath(adminBasePath, "/tools");
2863
- const extensionCards = sections.filter((section) => section.card).map((section) => ({
2864
- href: resolveAdminPath(adminBasePath, section.href),
2865
- title: section.card?.title || section.label,
2866
- description: section.card?.description || ""
2867
- }));
2868
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(StudioSectionLayout, { navProps: props, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { paddingBottom: "1.3rem" }, children: [
2869
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_ui4.SetStepNav, { nav: [{ label: "Dashboard", url: adminBasePath }] }),
2870
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h1", { style: { fontSize: "1.6rem", margin: 0 }, children: "Studio" }),
2871
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { style: { color: "var(--theme-elevation-600)", marginTop: "0.35rem" }, children: "Pick what you want to edit." }),
2872
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
2873
- "div",
2874
- {
2875
- style: {
2876
- display: "grid",
2877
- gap: "0.85rem",
2878
- gridTemplateColumns: "repeat(auto-fit, minmax(240px, 1fr))",
2879
- marginTop: "1.1rem"
2880
- },
2881
- children: [
2882
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("a", { href: pagesPath, style: cardStyle, children: [
2883
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontWeight: 900 }, children: "Pages" }),
2884
- /* @__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." })
2885
- ] }),
2886
- formsEnabled ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("a", { href: formsPath, style: cardStyle, children: [
2887
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontWeight: 900 }, children: "Forms" }),
2888
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { color: "var(--theme-elevation-600)", marginTop: "0.25rem" }, children: "Review forms, submissions, and uploaded files." })
2889
- ] }) : null,
2890
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("a", { href: resolvedGlobalsBasePath, style: cardStyle, children: [
2891
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontWeight: 900 }, children: "Globals" }),
2892
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { color: "var(--theme-elevation-600)", marginTop: "0.25rem" }, children: "Site settings, header, footer." })
2893
- ] }),
2894
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("a", { href: mediaPath, style: cardStyle, children: [
2895
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontWeight: 900 }, children: "Media" }),
2896
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { color: "var(--theme-elevation-600)", marginTop: "0.25rem" }, children: "Upload and manage images and files." })
2897
- ] }),
2898
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("a", { href: toolsPath, style: cardStyle, children: [
2899
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontWeight: 900 }, children: "Admin Tools" }),
2900
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { color: "var(--theme-elevation-600)", marginTop: "0.25rem" }, children: "Open admin-only fallback links and user management." })
2901
- ] }),
2902
- extensionCards.map((card) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("a", { href: card.href, style: cardStyle, children: [
2903
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontWeight: 900 }, children: card.title }),
2904
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { color: "var(--theme-elevation-600)", marginTop: "0.25rem" }, children: card.description })
2905
- ] }, card.href))
2906
- ]
2907
- }
2908
- )
2909
- ] }) });
2910
- }
2911
-
2912
2865
  // src/admin/components/studio/AdminStudioPagesListView.tsx
2913
- var import_react14 = require("react");
2866
+ var import_react13 = require("react");
2914
2867
  var import_ui5 = require("@payloadcms/ui");
2915
2868
  var import_jsx_runtime17 = require("react/jsx-runtime");
2916
2869
  var isAdmin = (user) => {
@@ -2935,10 +2888,10 @@ function AdminStudioPagesListView(props) {
2935
2888
  const adminBasePath = useAdminBasePath();
2936
2889
  const pagesPath = resolveAdminPath(adminBasePath, "/pages");
2937
2890
  const rawPagesCollectionPath = resolveAdminPath(adminBasePath, `/collections/${pagesCollectionSlug}`);
2938
- const [loading, setLoading] = (0, import_react14.useState)(true);
2939
- const [error, setError] = (0, import_react14.useState)(null);
2940
- const [docs, setDocs] = (0, import_react14.useState)([]);
2941
- const apiURL = (0, import_react14.useMemo)(() => {
2891
+ const [loading, setLoading] = (0, import_react13.useState)(true);
2892
+ const [error, setError] = (0, import_react13.useState)(null);
2893
+ const [docs, setDocs] = (0, import_react13.useState)([]);
2894
+ const apiURL = (0, import_react13.useMemo)(() => {
2942
2895
  const params = new URLSearchParams({
2943
2896
  depth: "0",
2944
2897
  limit: "100",
@@ -2947,7 +2900,7 @@ function AdminStudioPagesListView(props) {
2947
2900
  });
2948
2901
  return `/api/${pagesCollectionSlug}?${params.toString()}`;
2949
2902
  }, [pagesCollectionSlug]);
2950
- (0, import_react14.useEffect)(() => {
2903
+ (0, import_react13.useEffect)(() => {
2951
2904
  let cancelled = false;
2952
2905
  const run = async () => {
2953
2906
  setLoading(true);
@@ -3086,7 +3039,7 @@ function AdminStudioPagesListView(props) {
3086
3039
  }
3087
3040
 
3088
3041
  // src/admin/components/studio/AdminStudioPageEditView.tsx
3089
- var import_react15 = require("react");
3042
+ var import_react14 = require("react");
3090
3043
  var import_ui6 = require("@payloadcms/ui");
3091
3044
  var import_jsx_runtime18 = require("react/jsx-runtime");
3092
3045
  var isAdmin2 = (user) => {
@@ -3128,18 +3081,18 @@ var getPageIDFromPathname = (pathname) => {
3128
3081
  function AdminStudioPageEditView(props) {
3129
3082
  const { user } = (0, import_ui6.useAuth)();
3130
3083
  const adminBasePath = useAdminBasePath();
3131
- const iframeRef = (0, import_react15.useRef)(null);
3132
- const [saving, setSaving] = (0, import_react15.useState)(null);
3133
- const [dirty, setDirty] = (0, import_react15.useState)(false);
3134
- const [hasUnpublishedChanges, setHasUnpublishedChanges] = (0, import_react15.useState)(false);
3135
- const [canUndo, setCanUndo] = (0, import_react15.useState)(false);
3136
- const [canRedo, setCanRedo] = (0, import_react15.useState)(false);
3084
+ const iframeRef = (0, import_react14.useRef)(null);
3085
+ const [saving, setSaving] = (0, import_react14.useState)(null);
3086
+ const [dirty, setDirty] = (0, import_react14.useState)(false);
3087
+ const [hasUnpublishedChanges, setHasUnpublishedChanges] = (0, import_react14.useState)(false);
3088
+ const [canUndo, setCanUndo] = (0, import_react14.useState)(false);
3089
+ const [canRedo, setCanRedo] = (0, import_react14.useState)(false);
3137
3090
  const builderBasePath = getPropString4(props, "builderBasePath", "/builder");
3138
3091
  const pagesPath = resolveAdminPath(adminBasePath, "/pages");
3139
- const pageIDFromParams = (0, import_react15.useMemo)(() => getParam(props.params, "id"), [props.params]);
3140
- const [pageID, setPageID] = (0, import_react15.useState)(pageIDFromParams);
3141
- const [didResolvePathFallback, setDidResolvePathFallback] = (0, import_react15.useState)(false);
3142
- (0, import_react15.useEffect)(() => {
3092
+ const pageIDFromParams = (0, import_react14.useMemo)(() => getParam(props.params, "id"), [props.params]);
3093
+ const [pageID, setPageID] = (0, import_react14.useState)(pageIDFromParams);
3094
+ const [didResolvePathFallback, setDidResolvePathFallback] = (0, import_react14.useState)(false);
3095
+ (0, import_react14.useEffect)(() => {
3143
3096
  if (pageIDFromParams) {
3144
3097
  setPageID(pageIDFromParams);
3145
3098
  setDidResolvePathFallback(true);
@@ -3183,7 +3136,7 @@ function AdminStudioPageEditView(props) {
3183
3136
  } catch {
3184
3137
  }
3185
3138
  };
3186
- (0, import_react15.useEffect)(() => {
3139
+ (0, import_react14.useEffect)(() => {
3187
3140
  if (!pageID) {
3188
3141
  return;
3189
3142
  }
@@ -3206,7 +3159,7 @@ function AdminStudioPageEditView(props) {
3206
3159
  }
3207
3160
  iframe.contentWindow.postMessage({ source: "payload-visual-builder-parent", type }, "*");
3208
3161
  };
3209
- (0, import_react15.useEffect)(() => {
3162
+ (0, import_react14.useEffect)(() => {
3210
3163
  const onMessage = (event) => {
3211
3164
  const data = event.data;
3212
3165
  if (!data || data.source !== "payload-visual-builder-child" || typeof data.type !== "string") {
@@ -3500,11 +3453,11 @@ function AdminStudioGlobalsView(props) {
3500
3453
  }
3501
3454
 
3502
3455
  // src/admin/components/studio/AdminStudioHeaderGlobalView.tsx
3503
- var import_react18 = require("react");
3456
+ var import_react17 = require("react");
3504
3457
  var import_ui8 = require("@payloadcms/ui");
3505
3458
 
3506
3459
  // src/admin-app/components/HeaderNavEditorWithPreview.tsx
3507
- var import_react17 = require("react");
3460
+ var import_react16 = require("react");
3508
3461
 
3509
3462
  // src/admin-app/nestedNavigation.ts
3510
3463
  var normalizeNestedNavItems = (items) => {
@@ -3553,7 +3506,7 @@ var buildNestedNavTree = (items) => {
3553
3506
  };
3554
3507
 
3555
3508
  // src/admin-app/components/HeaderNavItemsEditor.tsx
3556
- var import_react16 = require("react");
3509
+ var import_react15 = require("react");
3557
3510
 
3558
3511
  // src/admin-app/navigationLinks.ts
3559
3512
  var fallbackHomeOption = {
@@ -3652,12 +3605,12 @@ var moveRow = (rows, fromIndex, toIndex) => {
3652
3605
  return next;
3653
3606
  };
3654
3607
  function HeaderNavItemsEditor({ initialItems, pageOptions, onItemsChange }) {
3655
- const [rows, setRows] = (0, import_react16.useState)(() => initialItems.map(toRow));
3656
- const [nextRowID, setNextRowID] = (0, import_react16.useState)(initialItems.length);
3657
- const [draggingRowID, setDraggingRowID] = (0, import_react16.useState)(null);
3658
- const [dragOverRowID, setDragOverRowID] = (0, import_react16.useState)(null);
3659
- const pageOptionByHref = (0, import_react16.useMemo)(() => new Map(pageOptions.map((option) => [option.href, option])), [pageOptions]);
3660
- const serializedState = (0, import_react16.useMemo)(
3608
+ const [rows, setRows] = (0, import_react15.useState)(() => initialItems.map(toRow));
3609
+ const [nextRowID, setNextRowID] = (0, import_react15.useState)(initialItems.length);
3610
+ const [draggingRowID, setDraggingRowID] = (0, import_react15.useState)(null);
3611
+ const [dragOverRowID, setDragOverRowID] = (0, import_react15.useState)(null);
3612
+ const pageOptionByHref = (0, import_react15.useMemo)(() => new Map(pageOptions.map((option) => [option.href, option])), [pageOptions]);
3613
+ const serializedState = (0, import_react15.useMemo)(
3661
3614
  () => JSON.stringify(
3662
3615
  rows.map((row) => ({
3663
3616
  href: row.href.trim(),
@@ -3667,7 +3620,7 @@ function HeaderNavItemsEditor({ initialItems, pageOptions, onItemsChange }) {
3667
3620
  ),
3668
3621
  [rows]
3669
3622
  );
3670
- const normalizedItems = (0, import_react16.useMemo)(() => {
3623
+ const normalizedItems = (0, import_react15.useMemo)(() => {
3671
3624
  const inputs = rows.map((row) => ({
3672
3625
  href: row.href,
3673
3626
  label: row.label,
@@ -3675,7 +3628,7 @@ function HeaderNavItemsEditor({ initialItems, pageOptions, onItemsChange }) {
3675
3628
  }));
3676
3629
  return normalizeAdminNavInputs(inputs, pageOptions);
3677
3630
  }, [rows, pageOptions]);
3678
- (0, import_react16.useEffect)(() => {
3631
+ (0, import_react15.useEffect)(() => {
3679
3632
  onItemsChange?.(normalizedItems);
3680
3633
  }, [normalizedItems, onItemsChange]);
3681
3634
  const setRowValue = (rowID, changes) => {
@@ -4008,8 +3961,8 @@ function HeaderNavEditorWithPreview({
4008
3961
  socialLinks,
4009
3962
  tagline = ""
4010
3963
  }) {
4011
- const [liveItems, setLiveItems] = (0, import_react17.useState)(initialItems);
4012
- const previewItems = (0, import_react17.useMemo)(() => {
3964
+ const [liveItems, setLiveItems] = (0, import_react16.useState)(initialItems);
3965
+ const previewItems = (0, import_react16.useMemo)(() => {
4013
3966
  const normalized = normalizeNestedNavItems(liveItems);
4014
3967
  const tree = buildNestedNavTree(normalized);
4015
3968
  return tree.topLevel.length > 0 ? tree : buildNestedNavTree(fallbackNav);
@@ -4221,16 +4174,16 @@ function AdminStudioHeaderGlobalView(props) {
4221
4174
  const adminBasePath = useAdminBasePath();
4222
4175
  const resolvedGlobalsBasePath = resolveAdminPath(adminBasePath, globalsBasePath);
4223
4176
  const rawGlobalPath = resolveAdminPath(adminBasePath, `/globals/${globalSlug}`);
4224
- const [loading, setLoading] = (0, import_react18.useState)(true);
4225
- const [saving, setSaving] = (0, import_react18.useState)(false);
4226
- const [error, setError] = (0, import_react18.useState)(null);
4227
- const [savedMessage, setSavedMessage] = (0, import_react18.useState)(null);
4228
- const [initialItems, setInitialItems] = (0, import_react18.useState)([]);
4229
- const [liveItems, setLiveItems] = (0, import_react18.useState)([]);
4230
- const [pages, setPages] = (0, import_react18.useState)([]);
4231
- const [siteSettings, setSiteSettings] = (0, import_react18.useState)({});
4232
- const [socialMedia, setSocialMedia] = (0, import_react18.useState)({});
4233
- (0, import_react18.useEffect)(() => {
4177
+ const [loading, setLoading] = (0, import_react17.useState)(true);
4178
+ const [saving, setSaving] = (0, import_react17.useState)(false);
4179
+ const [error, setError] = (0, import_react17.useState)(null);
4180
+ const [savedMessage, setSavedMessage] = (0, import_react17.useState)(null);
4181
+ const [initialItems, setInitialItems] = (0, import_react17.useState)([]);
4182
+ const [liveItems, setLiveItems] = (0, import_react17.useState)([]);
4183
+ const [pages, setPages] = (0, import_react17.useState)([]);
4184
+ const [siteSettings, setSiteSettings] = (0, import_react17.useState)({});
4185
+ const [socialMedia, setSocialMedia] = (0, import_react17.useState)({});
4186
+ (0, import_react17.useEffect)(() => {
4234
4187
  let cancelled = false;
4235
4188
  const run = async () => {
4236
4189
  setLoading(true);
@@ -4293,8 +4246,8 @@ function AdminStudioHeaderGlobalView(props) {
4293
4246
  cancelled = true;
4294
4247
  };
4295
4248
  }, [globalSlug, pagesCollectionSlug]);
4296
- const pageOptions = (0, import_react18.useMemo)(() => buildAdminPageLinkOptions(pages), [pages]);
4297
- const previewSocialLinks = (0, import_react18.useMemo)(
4249
+ const pageOptions = (0, import_react17.useMemo)(() => buildAdminPageLinkOptions(pages), [pages]);
4250
+ const previewSocialLinks = (0, import_react17.useMemo)(
4298
4251
  () => resolveSocialMediaLinks(socialMedia).map((item) => ({
4299
4252
  label: item.label,
4300
4253
  platform: item.platform,
@@ -4305,7 +4258,7 @@ function AdminStudioHeaderGlobalView(props) {
4305
4258
  const previewSiteName = typeof siteSettings.siteName === "string" && siteSettings.siteName.trim().length > 0 ? siteSettings.siteName.trim() : "Orion Studio";
4306
4259
  const previewTagline = typeof siteSettings.tagline === "string" ? siteSettings.tagline.trim() : "";
4307
4260
  const previewLogoUrl = resolveMediaURL(siteSettings.logo);
4308
- const editorKey = (0, import_react18.useMemo)(() => JSON.stringify(initialItems), [initialItems]);
4261
+ const editorKey = (0, import_react17.useMemo)(() => JSON.stringify(initialItems), [initialItems]);
4309
4262
  const save = async () => {
4310
4263
  setSaving(true);
4311
4264
  setError(null);
@@ -4396,7 +4349,7 @@ function AdminStudioHeaderGlobalView(props) {
4396
4349
  }
4397
4350
 
4398
4351
  // src/admin/components/studio/AdminStudioFooterGlobalView.tsx
4399
- var import_react19 = require("react");
4352
+ var import_react18 = require("react");
4400
4353
  var import_ui9 = require("@payloadcms/ui");
4401
4354
  var import_jsx_runtime24 = require("react/jsx-runtime");
4402
4355
  var getPropString7 = (props, key, fallback) => {
@@ -4504,18 +4457,18 @@ function AdminStudioFooterGlobalView(props) {
4504
4457
  const adminBasePath = useAdminBasePath();
4505
4458
  const resolvedGlobalsBasePath = resolveAdminPath(adminBasePath, globalsBasePath);
4506
4459
  const rawGlobalPath = resolveAdminPath(adminBasePath, `/globals/${globalSlug}`);
4507
- const [loading, setLoading] = (0, import_react19.useState)(true);
4508
- const [saving, setSaving] = (0, import_react19.useState)(false);
4509
- const [error, setError] = (0, import_react19.useState)(null);
4510
- const [savedMessage, setSavedMessage] = (0, import_react19.useState)(null);
4511
- const [doc, setDoc] = (0, import_react19.useState)({
4460
+ const [loading, setLoading] = (0, import_react18.useState)(true);
4461
+ const [saving, setSaving] = (0, import_react18.useState)(false);
4462
+ const [error, setError] = (0, import_react18.useState)(null);
4463
+ const [savedMessage, setSavedMessage] = (0, import_react18.useState)(null);
4464
+ const [doc, setDoc] = (0, import_react18.useState)({
4512
4465
  contactEmail: "",
4513
4466
  contactPhone: "",
4514
4467
  copyright: ""
4515
4468
  });
4516
- const [siteSettings, setSiteSettings] = (0, import_react19.useState)({});
4517
- const [socialMedia, setSocialMedia] = (0, import_react19.useState)({});
4518
- (0, import_react19.useEffect)(() => {
4469
+ const [siteSettings, setSiteSettings] = (0, import_react18.useState)({});
4470
+ const [socialMedia, setSocialMedia] = (0, import_react18.useState)({});
4471
+ (0, import_react18.useEffect)(() => {
4519
4472
  let cancelled = false;
4520
4473
  const run = async () => {
4521
4474
  setLoading(true);
@@ -4567,7 +4520,7 @@ function AdminStudioFooterGlobalView(props) {
4567
4520
  cancelled = true;
4568
4521
  };
4569
4522
  }, [globalSlug]);
4570
- const previewSocialLinks = (0, import_react19.useMemo)(
4523
+ const previewSocialLinks = (0, import_react18.useMemo)(
4571
4524
  () => resolveSocialMediaLinks(socialMedia).map((item) => ({
4572
4525
  label: item.label,
4573
4526
  platform: item.platform,
@@ -4771,7 +4724,7 @@ function AdminStudioFooterGlobalView(props) {
4771
4724
  }
4772
4725
 
4773
4726
  // src/admin/components/studio/AdminStudioContactFormView.tsx
4774
- var import_react20 = require("react");
4727
+ var import_react19 = require("react");
4775
4728
  var import_ui10 = require("@payloadcms/ui");
4776
4729
  var import_jsx_runtime25 = require("react/jsx-runtime");
4777
4730
  var defaultDoc = {
@@ -4862,12 +4815,12 @@ function AdminStudioContactFormView(props) {
4862
4815
  const adminBasePath = useAdminBasePath();
4863
4816
  const resolvedGlobalsBasePath = resolveAdminPath(adminBasePath, globalsBasePath);
4864
4817
  const rawGlobalPath = resolveAdminPath(adminBasePath, `/globals/${globalSlug}`);
4865
- const [doc, setDoc] = (0, import_react20.useState)(defaultDoc);
4866
- const [error, setError] = (0, import_react20.useState)(null);
4867
- const [isLoading, setIsLoading] = (0, import_react20.useState)(true);
4868
- const [isSaving, setIsSaving] = (0, import_react20.useState)(false);
4869
- const [savedMessage, setSavedMessage] = (0, import_react20.useState)(null);
4870
- (0, import_react20.useEffect)(() => {
4818
+ const [doc, setDoc] = (0, import_react19.useState)(defaultDoc);
4819
+ const [error, setError] = (0, import_react19.useState)(null);
4820
+ const [isLoading, setIsLoading] = (0, import_react19.useState)(true);
4821
+ const [isSaving, setIsSaving] = (0, import_react19.useState)(false);
4822
+ const [savedMessage, setSavedMessage] = (0, import_react19.useState)(null);
4823
+ (0, import_react19.useEffect)(() => {
4871
4824
  let mounted = true;
4872
4825
  const load = async () => {
4873
4826
  setIsLoading(true);
@@ -4897,7 +4850,7 @@ function AdminStudioContactFormView(props) {
4897
4850
  mounted = false;
4898
4851
  };
4899
4852
  }, [globalSlug]);
4900
- const payload = (0, import_react20.useMemo)(
4853
+ const payload = (0, import_react19.useMemo)(
4901
4854
  () => ({
4902
4855
  disabledMessage: doc.disabledMessage,
4903
4856
  enabled: doc.enabled,
@@ -5141,7 +5094,7 @@ function AdminStudioMediaView(props) {
5141
5094
  }
5142
5095
 
5143
5096
  // src/admin/components/studio/AdminStudioFormsView.tsx
5144
- var import_react21 = require("react");
5097
+ var import_react20 = require("react");
5145
5098
  var import_ui12 = require("@payloadcms/ui");
5146
5099
  var import_jsx_runtime27 = require("react/jsx-runtime");
5147
5100
  var isAdmin3 = (user) => {
@@ -5297,21 +5250,21 @@ function AdminStudioFormsView(props) {
5297
5250
  `/collections/${formSubmissionsCollectionSlug}`
5298
5251
  );
5299
5252
  const rawUploadsPath = resolveAdminPath(adminBasePath, `/collections/${formUploadsCollectionSlug}`);
5300
- const [selectedFormID, setSelectedFormID] = (0, import_react21.useState)("");
5301
- const [forms, setForms] = (0, import_react21.useState)([]);
5302
- const [submissions, setSubmissions] = (0, import_react21.useState)([]);
5303
- const [formsLoading, setFormsLoading] = (0, import_react21.useState)(true);
5304
- const [submissionsLoading, setSubmissionsLoading] = (0, import_react21.useState)(false);
5305
- const [formsError, setFormsError] = (0, import_react21.useState)(null);
5306
- const [submissionsError, setSubmissionsError] = (0, import_react21.useState)(null);
5307
- const selectedForm = (0, import_react21.useMemo)(
5253
+ const [selectedFormID, setSelectedFormID] = (0, import_react20.useState)("");
5254
+ const [forms, setForms] = (0, import_react20.useState)([]);
5255
+ const [submissions, setSubmissions] = (0, import_react20.useState)([]);
5256
+ const [formsLoading, setFormsLoading] = (0, import_react20.useState)(true);
5257
+ const [submissionsLoading, setSubmissionsLoading] = (0, import_react20.useState)(false);
5258
+ const [formsError, setFormsError] = (0, import_react20.useState)(null);
5259
+ const [submissionsError, setSubmissionsError] = (0, import_react20.useState)(null);
5260
+ const selectedForm = (0, import_react20.useMemo)(
5308
5261
  () => forms.find((form) => {
5309
5262
  const id = typeof form.id === "string" || typeof form.id === "number" ? String(form.id) : "";
5310
5263
  return selectedFormID.length > 0 && id === selectedFormID;
5311
5264
  }) || null,
5312
5265
  [forms, selectedFormID]
5313
5266
  );
5314
- (0, import_react21.useEffect)(() => {
5267
+ (0, import_react20.useEffect)(() => {
5315
5268
  if (typeof window === "undefined") {
5316
5269
  return;
5317
5270
  }
@@ -5321,7 +5274,7 @@ function AdminStudioFormsView(props) {
5321
5274
  setSelectedFormID(formID);
5322
5275
  }
5323
5276
  }, []);
5324
- (0, import_react21.useEffect)(() => {
5277
+ (0, import_react20.useEffect)(() => {
5325
5278
  if (!canReviewForms(user)) {
5326
5279
  return;
5327
5280
  }
@@ -5375,7 +5328,7 @@ function AdminStudioFormsView(props) {
5375
5328
  cancelled = true;
5376
5329
  };
5377
5330
  }, [formsCollectionSlug, user]);
5378
- (0, import_react21.useEffect)(() => {
5331
+ (0, import_react20.useEffect)(() => {
5379
5332
  if (!selectedFormID || !canReviewForms(user)) {
5380
5333
  setSubmissions([]);
5381
5334
  return;
@@ -5419,7 +5372,7 @@ function AdminStudioFormsView(props) {
5419
5372
  cancelled = true;
5420
5373
  };
5421
5374
  }, [formSubmissionsCollectionSlug, selectedFormID, user]);
5422
- (0, import_react21.useEffect)(() => {
5375
+ (0, import_react20.useEffect)(() => {
5423
5376
  if (typeof window === "undefined" || !selectedFormID) {
5424
5377
  return;
5425
5378
  }
@@ -5980,13 +5933,13 @@ function OpenInStudioMenuItem({ pagesPathBase = "/pages" }) {
5980
5933
  }
5981
5934
 
5982
5935
  // src/admin/components/studio/PageEditRedirectToStudio.tsx
5983
- var import_react22 = require("react");
5936
+ var import_react21 = require("react");
5984
5937
  var import_ui15 = require("@payloadcms/ui");
5985
5938
  var import_jsx_runtime30 = require("react/jsx-runtime");
5986
5939
  function PageEditRedirectToStudio({ pagesPathBase = "/pages" }) {
5987
5940
  const documentInfo = (0, import_ui15.useDocumentInfo)();
5988
5941
  const id = documentInfo?.id;
5989
- (0, import_react22.useEffect)(() => {
5942
+ (0, import_react21.useEffect)(() => {
5990
5943
  if (!id) {
5991
5944
  return;
5992
5945
  }
@@ -6013,7 +5966,7 @@ function PageEditRedirectToStudio({ pagesPathBase = "/pages" }) {
6013
5966
  }
6014
5967
 
6015
5968
  // src/admin/components/studio/StudioBackBreadcrumb.tsx
6016
- var import_react23 = require("react");
5969
+ var import_react22 = require("react");
6017
5970
  var import_ui16 = require("@payloadcms/ui");
6018
5971
  var import_jsx_runtime31 = require("react/jsx-runtime");
6019
5972
  var toTitle = (slug) => slug.split("-").filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
@@ -6060,8 +6013,8 @@ var buildNav = (pathname, adminBasePath) => {
6060
6013
  };
6061
6014
  function StudioBackBreadcrumb() {
6062
6015
  const adminBasePath = useAdminBasePath();
6063
- const [pathname, setPathname] = (0, import_react23.useState)("");
6064
- (0, import_react23.useEffect)(() => {
6016
+ const [pathname, setPathname] = (0, import_react22.useState)("");
6017
+ (0, import_react22.useEffect)(() => {
6065
6018
  const update = () => setPathname(window.location.pathname);
6066
6019
  update();
6067
6020
  window.addEventListener("popstate", update);
@@ -6073,7 +6026,7 @@ function StudioBackBreadcrumb() {
6073
6026
  }
6074
6027
 
6075
6028
  // src/admin/components/studio/StudioContactFormRedirect.tsx
6076
- var import_react24 = require("react");
6029
+ var import_react23 = require("react");
6077
6030
  var import_jsx_runtime32 = require("react/jsx-runtime");
6078
6031
  var getPropString12 = (props, key, fallback) => {
6079
6032
  if (!props || typeof props !== "object") return fallback;
@@ -6090,7 +6043,7 @@ function StudioContactFormRedirect(props) {
6090
6043
  const adminBasePath = useAdminBasePath();
6091
6044
  const studioContactFormPath = getPropString12(props, "studioContactFormPath", "/contact-form");
6092
6045
  const targetPath = resolveAdminPath(adminBasePath, studioContactFormPath);
6093
- (0, import_react24.useEffect)(() => {
6046
+ (0, import_react23.useEffect)(() => {
6094
6047
  if (window.location.pathname === targetPath) return;
6095
6048
  window.location.replace(targetPath);
6096
6049
  }, [targetPath]);