@orion-studios/payload-studio 0.5.0-beta.115 → 0.5.0-beta.116
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.
- package/dist/admin/client.js +302 -246
- package/dist/admin/client.mjs +348 -292
- package/dist/admin.css +8 -0
- package/package.json +1 -1
package/dist/admin/client.js
CHANGED
|
@@ -2291,7 +2291,7 @@ function WelcomeHeader({
|
|
|
2291
2291
|
}
|
|
2292
2292
|
|
|
2293
2293
|
// src/admin/components/studio/AdminStudioDashboard.tsx
|
|
2294
|
-
var
|
|
2294
|
+
var import_ui4 = require("@payloadcms/ui");
|
|
2295
2295
|
|
|
2296
2296
|
// src/shared/studioSections.ts
|
|
2297
2297
|
var studioRoles = /* @__PURE__ */ new Set(["admin", "editor", "client"]);
|
|
@@ -2444,116 +2444,12 @@ var useAdminBasePath = (fallback = DEFAULT_ADMIN_BASE_PATH) => {
|
|
|
2444
2444
|
};
|
|
2445
2445
|
|
|
2446
2446
|
// src/admin/components/studio/StudioSectionLayout.tsx
|
|
2447
|
-
var
|
|
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
|
-
}
|
|
2447
|
+
var import_react13 = require("react");
|
|
2552
2448
|
|
|
2553
2449
|
// src/admin/components/studio/AdminStudioNav.tsx
|
|
2554
2450
|
var import_react12 = require("react");
|
|
2555
|
-
var
|
|
2556
|
-
var
|
|
2451
|
+
var import_ui3 = require("@payloadcms/ui");
|
|
2452
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2557
2453
|
var iconSize2 = 18;
|
|
2558
2454
|
function NavIcon({ sectionID }) {
|
|
2559
2455
|
const props = {
|
|
@@ -2568,45 +2464,45 @@ function NavIcon({ sectionID }) {
|
|
|
2568
2464
|
};
|
|
2569
2465
|
switch (sectionID) {
|
|
2570
2466
|
case "dashboard":
|
|
2571
|
-
return /* @__PURE__ */ (0,
|
|
2572
|
-
/* @__PURE__ */ (0,
|
|
2573
|
-
/* @__PURE__ */ (0,
|
|
2574
|
-
/* @__PURE__ */ (0,
|
|
2575
|
-
/* @__PURE__ */ (0,
|
|
2467
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("svg", { ...props, children: [
|
|
2468
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("rect", { x: "3", y: "3", width: "7", height: "9", rx: "1" }),
|
|
2469
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("rect", { x: "14", y: "3", width: "7", height: "5", rx: "1" }),
|
|
2470
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("rect", { x: "14", y: "12", width: "7", height: "9", rx: "1" }),
|
|
2471
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("rect", { x: "3", y: "16", width: "7", height: "5", rx: "1" })
|
|
2576
2472
|
] });
|
|
2577
2473
|
case "pages":
|
|
2578
|
-
return /* @__PURE__ */ (0,
|
|
2579
|
-
/* @__PURE__ */ (0,
|
|
2580
|
-
/* @__PURE__ */ (0,
|
|
2581
|
-
/* @__PURE__ */ (0,
|
|
2582
|
-
/* @__PURE__ */ (0,
|
|
2474
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("svg", { ...props, children: [
|
|
2475
|
+
/* @__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" }),
|
|
2476
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("polyline", { points: "14 2 14 8 20 8" }),
|
|
2477
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("line", { x1: "8", y1: "13", x2: "16", y2: "13" }),
|
|
2478
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("line", { x1: "8", y1: "17", x2: "12", y2: "17" })
|
|
2583
2479
|
] });
|
|
2584
2480
|
case "forms":
|
|
2585
|
-
return /* @__PURE__ */ (0,
|
|
2586
|
-
/* @__PURE__ */ (0,
|
|
2587
|
-
/* @__PURE__ */ (0,
|
|
2588
|
-
/* @__PURE__ */ (0,
|
|
2589
|
-
/* @__PURE__ */ (0,
|
|
2590
|
-
/* @__PURE__ */ (0,
|
|
2481
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("svg", { ...props, children: [
|
|
2482
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "M9 3h6" }),
|
|
2483
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "M12 3v18" }),
|
|
2484
|
+
/* @__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" }),
|
|
2485
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "M7 11h10" }),
|
|
2486
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("path", { d: "M7 15h6" })
|
|
2591
2487
|
] });
|
|
2592
2488
|
case "globals":
|
|
2593
|
-
return /* @__PURE__ */ (0,
|
|
2594
|
-
/* @__PURE__ */ (0,
|
|
2595
|
-
/* @__PURE__ */ (0,
|
|
2489
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("svg", { ...props, children: [
|
|
2490
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("circle", { cx: "12", cy: "12", r: "3" }),
|
|
2491
|
+
/* @__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" })
|
|
2596
2492
|
] });
|
|
2597
2493
|
case "media":
|
|
2598
|
-
return /* @__PURE__ */ (0,
|
|
2599
|
-
/* @__PURE__ */ (0,
|
|
2600
|
-
/* @__PURE__ */ (0,
|
|
2601
|
-
/* @__PURE__ */ (0,
|
|
2494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("svg", { ...props, children: [
|
|
2495
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }),
|
|
2496
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("circle", { cx: "8.5", cy: "8.5", r: "1.5" }),
|
|
2497
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("polyline", { points: "21 15 16 10 5 21" })
|
|
2602
2498
|
] });
|
|
2603
2499
|
case "admin-tools":
|
|
2604
|
-
return /* @__PURE__ */ (0,
|
|
2500
|
+
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" }) });
|
|
2605
2501
|
default:
|
|
2606
2502
|
return null;
|
|
2607
2503
|
}
|
|
2608
2504
|
}
|
|
2609
|
-
var
|
|
2505
|
+
var getPropString = (props, key, fallback) => {
|
|
2610
2506
|
if (!props || typeof props !== "object") return fallback;
|
|
2611
2507
|
const direct = props[key];
|
|
2612
2508
|
if (typeof direct === "string" && direct.length > 0) return direct;
|
|
@@ -2617,7 +2513,7 @@ var getPropString2 = (props, key, fallback) => {
|
|
|
2617
2513
|
}
|
|
2618
2514
|
return fallback;
|
|
2619
2515
|
};
|
|
2620
|
-
var
|
|
2516
|
+
var getPropBoolean = (props, key, fallback) => {
|
|
2621
2517
|
if (!props || typeof props !== "object") return fallback;
|
|
2622
2518
|
const direct = props[key];
|
|
2623
2519
|
if (typeof direct === "boolean") return direct;
|
|
@@ -2640,7 +2536,7 @@ var getPropStringArray = (props, key, fallback) => {
|
|
|
2640
2536
|
}
|
|
2641
2537
|
return fallback;
|
|
2642
2538
|
};
|
|
2643
|
-
var
|
|
2539
|
+
var getPropSections = (props, key) => {
|
|
2644
2540
|
if (!props || typeof props !== "object") return [];
|
|
2645
2541
|
const direct = resolveStudioSections(props[key]);
|
|
2646
2542
|
if (direct.length > 0) return direct;
|
|
@@ -2667,22 +2563,22 @@ var readUserRole = (user) => {
|
|
|
2667
2563
|
return typeof role === "string" ? role : void 0;
|
|
2668
2564
|
};
|
|
2669
2565
|
function AdminStudioNav(props) {
|
|
2670
|
-
const { user } = (0,
|
|
2671
|
-
const brandName =
|
|
2672
|
-
const logoUrl =
|
|
2673
|
-
const formsEnabled =
|
|
2674
|
-
const formsCollectionSlug =
|
|
2675
|
-
const formSubmissionsCollectionSlug =
|
|
2566
|
+
const { user } = (0, import_ui3.useAuth)();
|
|
2567
|
+
const brandName = getPropString(props, "brandName", "Orion Studio");
|
|
2568
|
+
const logoUrl = getPropString(props, "logoUrl", "");
|
|
2569
|
+
const formsEnabled = getPropBoolean(props, "formsEnabled", false);
|
|
2570
|
+
const formsCollectionSlug = getPropString(props, "formsCollectionSlug", "forms");
|
|
2571
|
+
const formSubmissionsCollectionSlug = getPropString(
|
|
2676
2572
|
props,
|
|
2677
2573
|
"formSubmissionsCollectionSlug",
|
|
2678
2574
|
"form-submissions"
|
|
2679
2575
|
);
|
|
2680
|
-
const formUploadsCollectionSlug =
|
|
2681
|
-
const mediaCollectionSlug =
|
|
2682
|
-
const globalsBasePath =
|
|
2576
|
+
const formUploadsCollectionSlug = getPropString(props, "formUploadsCollectionSlug", "form-uploads");
|
|
2577
|
+
const mediaCollectionSlug = getPropString(props, "mediaCollectionSlug", "media");
|
|
2578
|
+
const globalsBasePath = getPropString(props, "globalsBasePath", "/globals");
|
|
2683
2579
|
const globalsExtraMatchPrefixes = getPropStringArray(props, "globalsExtraMatchPrefixes", []);
|
|
2684
|
-
const sections =
|
|
2685
|
-
const compact =
|
|
2580
|
+
const sections = getPropSections(props, "sections");
|
|
2581
|
+
const compact = getPropBoolean(props, "compact", false);
|
|
2686
2582
|
const adminBasePath = useAdminBasePath();
|
|
2687
2583
|
const branding = useSiteBranding(brandName, logoUrl || void 0);
|
|
2688
2584
|
const resolvedName = branding.siteName || brandName;
|
|
@@ -2784,7 +2680,7 @@ function AdminStudioNav(props) {
|
|
|
2784
2680
|
padding: compact ? "0.6rem" : "0.6rem 0.75rem",
|
|
2785
2681
|
textDecoration: "none"
|
|
2786
2682
|
});
|
|
2787
|
-
return /* @__PURE__ */ (0,
|
|
2683
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2788
2684
|
"div",
|
|
2789
2685
|
{
|
|
2790
2686
|
style: {
|
|
@@ -2795,8 +2691,8 @@ function AdminStudioNav(props) {
|
|
|
2795
2691
|
padding: compact ? "0.8rem 0.5rem" : "1rem 0.85rem"
|
|
2796
2692
|
},
|
|
2797
2693
|
children: [
|
|
2798
|
-
/* @__PURE__ */ (0,
|
|
2799
|
-
branding.logoUrl ? /* @__PURE__ */ (0,
|
|
2694
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "admin-studio-brand", style: { padding: compact ? "0" : "0 0.35rem 0 2.4rem" }, children: [
|
|
2695
|
+
branding.logoUrl ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2800
2696
|
"div",
|
|
2801
2697
|
{
|
|
2802
2698
|
style: {
|
|
@@ -2806,10 +2702,10 @@ function AdminStudioNav(props) {
|
|
|
2806
2702
|
overflow: "hidden",
|
|
2807
2703
|
width: compact ? 34 : 40
|
|
2808
2704
|
},
|
|
2809
|
-
children: /* @__PURE__ */ (0,
|
|
2705
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("img", { alt: `${resolvedName} logo`, src: branding.logoUrl, style: { height: "100%", objectFit: "cover", width: "100%" } })
|
|
2810
2706
|
}
|
|
2811
2707
|
) : null,
|
|
2812
|
-
/* @__PURE__ */ (0,
|
|
2708
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2813
2709
|
"div",
|
|
2814
2710
|
{
|
|
2815
2711
|
style: {
|
|
@@ -2824,23 +2720,23 @@ function AdminStudioNav(props) {
|
|
|
2824
2720
|
children: compact ? resolvedName.slice(0, 1).toUpperCase() : resolvedName
|
|
2825
2721
|
}
|
|
2826
2722
|
),
|
|
2827
|
-
!compact ? /* @__PURE__ */ (0,
|
|
2723
|
+
!compact ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { color: "var(--theme-elevation-600)", fontSize: "0.85rem" }, children: "Studio" }) : null
|
|
2828
2724
|
] }),
|
|
2829
|
-
/* @__PURE__ */ (0,
|
|
2725
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("nav", { style: { display: "grid", gap: "0.25rem" }, children: links.filter((link) => roleCanAccessSection(userRole, link)).map((link) => {
|
|
2830
2726
|
const active = link.href === dashboardPath ? pathname === dashboardPath : link.matchPrefixes.some((prefix) => pathname.startsWith(prefix));
|
|
2831
|
-
return /* @__PURE__ */ (0,
|
|
2832
|
-
const icon = /* @__PURE__ */ (0,
|
|
2727
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("a", { href: link.href, style: linkStyle(active), title: link.label, children: (() => {
|
|
2728
|
+
const icon = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(NavIcon, { sectionID: link.id });
|
|
2833
2729
|
if (compact) {
|
|
2834
2730
|
return icon || link.label.slice(0, 1);
|
|
2835
2731
|
}
|
|
2836
|
-
return /* @__PURE__ */ (0,
|
|
2732
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { style: { alignItems: "center", display: "inline-flex", gap: "0.6rem" }, children: [
|
|
2837
2733
|
icon,
|
|
2838
|
-
/* @__PURE__ */ (0,
|
|
2734
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: link.label })
|
|
2839
2735
|
] });
|
|
2840
2736
|
})() }, link.href);
|
|
2841
2737
|
}) }),
|
|
2842
|
-
/* @__PURE__ */ (0,
|
|
2843
|
-
/* @__PURE__ */ (0,
|
|
2738
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { flex: 1 } }),
|
|
2739
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2844
2740
|
"div",
|
|
2845
2741
|
{
|
|
2846
2742
|
style: {
|
|
@@ -2849,11 +2745,11 @@ function AdminStudioNav(props) {
|
|
|
2849
2745
|
textAlign: compact ? "center" : "left"
|
|
2850
2746
|
},
|
|
2851
2747
|
children: [
|
|
2852
|
-
!compact ? /* @__PURE__ */ (0,
|
|
2853
|
-
/* @__PURE__ */ (0,
|
|
2854
|
-
/* @__PURE__ */ (0,
|
|
2748
|
+
!compact ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
2749
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { color: "var(--theme-elevation-700)", fontSize: "0.85rem" }, children: "Signed in as" }),
|
|
2750
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { fontWeight: 800, marginBottom: "0.55rem" }, children: typeof user?.email === "string" ? user.email : "User" })
|
|
2855
2751
|
] }) : null,
|
|
2856
|
-
/* @__PURE__ */ (0,
|
|
2752
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_ui3.Logout, {})
|
|
2857
2753
|
]
|
|
2858
2754
|
}
|
|
2859
2755
|
)
|
|
@@ -2862,8 +2758,168 @@ function AdminStudioNav(props) {
|
|
|
2862
2758
|
);
|
|
2863
2759
|
}
|
|
2864
2760
|
|
|
2761
|
+
// src/admin/components/studio/StudioSectionLayout.tsx
|
|
2762
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2763
|
+
var STORAGE_KEY2 = "orion-studio-shell-collapsed";
|
|
2764
|
+
var readStoredCollapsed = () => {
|
|
2765
|
+
try {
|
|
2766
|
+
return window.localStorage.getItem(STORAGE_KEY2) === "1";
|
|
2767
|
+
} catch {
|
|
2768
|
+
return false;
|
|
2769
|
+
}
|
|
2770
|
+
};
|
|
2771
|
+
function StudioSectionLayout({ children, navProps }) {
|
|
2772
|
+
const [collapsed, setCollapsed] = (0, import_react13.useState)(false);
|
|
2773
|
+
(0, import_react13.useLayoutEffect)(() => {
|
|
2774
|
+
document.body.classList.add("orion-studio-shell-active");
|
|
2775
|
+
setCollapsed(readStoredCollapsed());
|
|
2776
|
+
return () => {
|
|
2777
|
+
document.body.classList.remove("orion-studio-shell-active");
|
|
2778
|
+
};
|
|
2779
|
+
}, []);
|
|
2780
|
+
const toggleSidebar = () => {
|
|
2781
|
+
setCollapsed((current) => {
|
|
2782
|
+
const next = !current;
|
|
2783
|
+
try {
|
|
2784
|
+
window.localStorage.setItem(STORAGE_KEY2, next ? "1" : "0");
|
|
2785
|
+
} catch {
|
|
2786
|
+
}
|
|
2787
|
+
return next;
|
|
2788
|
+
});
|
|
2789
|
+
};
|
|
2790
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
2791
|
+
"div",
|
|
2792
|
+
{
|
|
2793
|
+
className: `orion-studio-shell${collapsed ? " is-collapsed" : ""}`,
|
|
2794
|
+
style: {
|
|
2795
|
+
display: "grid",
|
|
2796
|
+
gap: 0,
|
|
2797
|
+
gridTemplateColumns: collapsed ? "92px minmax(0, 1fr)" : "280px minmax(0, 1fr)",
|
|
2798
|
+
minHeight: "100vh"
|
|
2799
|
+
},
|
|
2800
|
+
children: [
|
|
2801
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("aside", { className: "orion-studio-sidebar", children: [
|
|
2802
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2803
|
+
"button",
|
|
2804
|
+
{
|
|
2805
|
+
"aria-label": collapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
2806
|
+
className: "orion-studio-sidebar-toggle",
|
|
2807
|
+
onClick: toggleSidebar,
|
|
2808
|
+
type: "button",
|
|
2809
|
+
children: collapsed ? ">" : "<"
|
|
2810
|
+
}
|
|
2811
|
+
),
|
|
2812
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "orion-studio-sidebar-scroll", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(AdminStudioNav, { ...navProps, compact: collapsed }) })
|
|
2813
|
+
] }),
|
|
2814
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("main", { className: "orion-studio-main", children })
|
|
2815
|
+
]
|
|
2816
|
+
}
|
|
2817
|
+
);
|
|
2818
|
+
}
|
|
2819
|
+
|
|
2820
|
+
// src/admin/components/studio/AdminStudioDashboard.tsx
|
|
2821
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2822
|
+
var cardStyle = {
|
|
2823
|
+
background: "var(--theme-elevation-0)",
|
|
2824
|
+
border: "1px solid var(--theme-elevation-150)",
|
|
2825
|
+
borderRadius: 16,
|
|
2826
|
+
color: "inherit",
|
|
2827
|
+
padding: "1rem",
|
|
2828
|
+
textDecoration: "none"
|
|
2829
|
+
};
|
|
2830
|
+
var getPropString2 = (props, key, fallback) => {
|
|
2831
|
+
if (!props || typeof props !== "object") return fallback;
|
|
2832
|
+
const direct = props[key];
|
|
2833
|
+
if (typeof direct === "string" && direct.length > 0) return direct;
|
|
2834
|
+
const clientProps = props.clientProps;
|
|
2835
|
+
if (clientProps && typeof clientProps === "object") {
|
|
2836
|
+
const nested = clientProps[key];
|
|
2837
|
+
if (typeof nested === "string" && nested.length > 0) return nested;
|
|
2838
|
+
}
|
|
2839
|
+
return fallback;
|
|
2840
|
+
};
|
|
2841
|
+
var getPropBoolean2 = (props, key, fallback) => {
|
|
2842
|
+
if (!props || typeof props !== "object") return fallback;
|
|
2843
|
+
const direct = props[key];
|
|
2844
|
+
if (typeof direct === "boolean") return direct;
|
|
2845
|
+
const clientProps = props.clientProps;
|
|
2846
|
+
if (clientProps && typeof clientProps === "object") {
|
|
2847
|
+
const nested = clientProps[key];
|
|
2848
|
+
if (typeof nested === "boolean") return nested;
|
|
2849
|
+
}
|
|
2850
|
+
return fallback;
|
|
2851
|
+
};
|
|
2852
|
+
var getPropSections2 = (props, key) => {
|
|
2853
|
+
if (!props || typeof props !== "object") return [];
|
|
2854
|
+
const direct = resolveStudioSections(props[key]);
|
|
2855
|
+
if (direct.length > 0) return direct;
|
|
2856
|
+
const clientProps = props.clientProps;
|
|
2857
|
+
if (clientProps && typeof clientProps === "object") {
|
|
2858
|
+
return resolveStudioSections(clientProps[key]);
|
|
2859
|
+
}
|
|
2860
|
+
return [];
|
|
2861
|
+
};
|
|
2862
|
+
function AdminStudioDashboard(props) {
|
|
2863
|
+
const formsEnabled = getPropBoolean2(props, "formsEnabled", false);
|
|
2864
|
+
const globalsBasePath = getPropString2(props, "globalsBasePath", "/globals");
|
|
2865
|
+
const sections = getPropSections2(props, "sections");
|
|
2866
|
+
const adminBasePath = useAdminBasePath();
|
|
2867
|
+
const resolvedGlobalsBasePath = resolveAdminPath(adminBasePath, globalsBasePath);
|
|
2868
|
+
const formsPath = resolveAdminPath(adminBasePath, "/forms");
|
|
2869
|
+
const pagesPath = resolveAdminPath(adminBasePath, "/pages");
|
|
2870
|
+
const mediaPath = resolveAdminPath(adminBasePath, "/media");
|
|
2871
|
+
const toolsPath = resolveAdminPath(adminBasePath, "/tools");
|
|
2872
|
+
const extensionCards = sections.filter((section) => section.card).map((section) => ({
|
|
2873
|
+
href: resolveAdminPath(adminBasePath, section.href),
|
|
2874
|
+
title: section.card?.title || section.label,
|
|
2875
|
+
description: section.card?.description || ""
|
|
2876
|
+
}));
|
|
2877
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(StudioSectionLayout, { navProps: props, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { paddingBottom: "1.3rem" }, children: [
|
|
2878
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_ui4.SetStepNav, { nav: [{ label: "Dashboard", url: adminBasePath }] }),
|
|
2879
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h1", { style: { fontSize: "1.6rem", margin: 0 }, children: "Studio" }),
|
|
2880
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { style: { color: "var(--theme-elevation-600)", marginTop: "0.35rem" }, children: "Pick what you want to edit." }),
|
|
2881
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2882
|
+
"div",
|
|
2883
|
+
{
|
|
2884
|
+
style: {
|
|
2885
|
+
display: "grid",
|
|
2886
|
+
gap: "0.85rem",
|
|
2887
|
+
gridTemplateColumns: "repeat(auto-fit, minmax(240px, 1fr))",
|
|
2888
|
+
marginTop: "1.1rem"
|
|
2889
|
+
},
|
|
2890
|
+
children: [
|
|
2891
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("a", { href: pagesPath, style: cardStyle, children: [
|
|
2892
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontWeight: 900 }, children: "Pages" }),
|
|
2893
|
+
/* @__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." })
|
|
2894
|
+
] }),
|
|
2895
|
+
formsEnabled ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("a", { href: formsPath, style: cardStyle, children: [
|
|
2896
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontWeight: 900 }, children: "Forms" }),
|
|
2897
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { color: "var(--theme-elevation-600)", marginTop: "0.25rem" }, children: "Review forms, submissions, and uploaded files." })
|
|
2898
|
+
] }) : null,
|
|
2899
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("a", { href: resolvedGlobalsBasePath, style: cardStyle, children: [
|
|
2900
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontWeight: 900 }, children: "Globals" }),
|
|
2901
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { color: "var(--theme-elevation-600)", marginTop: "0.25rem" }, children: "Site settings, header, footer." })
|
|
2902
|
+
] }),
|
|
2903
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("a", { href: mediaPath, style: cardStyle, children: [
|
|
2904
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontWeight: 900 }, children: "Media" }),
|
|
2905
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { color: "var(--theme-elevation-600)", marginTop: "0.25rem" }, children: "Upload and manage images and files." })
|
|
2906
|
+
] }),
|
|
2907
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("a", { href: toolsPath, style: cardStyle, children: [
|
|
2908
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontWeight: 900 }, children: "Admin Tools" }),
|
|
2909
|
+
/* @__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." })
|
|
2910
|
+
] }),
|
|
2911
|
+
extensionCards.map((card) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("a", { href: card.href, style: cardStyle, children: [
|
|
2912
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontWeight: 900 }, children: card.title }),
|
|
2913
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { color: "var(--theme-elevation-600)", marginTop: "0.25rem" }, children: card.description })
|
|
2914
|
+
] }, card.href))
|
|
2915
|
+
]
|
|
2916
|
+
}
|
|
2917
|
+
)
|
|
2918
|
+
] }) });
|
|
2919
|
+
}
|
|
2920
|
+
|
|
2865
2921
|
// src/admin/components/studio/AdminStudioPagesListView.tsx
|
|
2866
|
-
var
|
|
2922
|
+
var import_react14 = require("react");
|
|
2867
2923
|
var import_ui5 = require("@payloadcms/ui");
|
|
2868
2924
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2869
2925
|
var isAdmin = (user) => {
|
|
@@ -2888,10 +2944,10 @@ function AdminStudioPagesListView(props) {
|
|
|
2888
2944
|
const adminBasePath = useAdminBasePath();
|
|
2889
2945
|
const pagesPath = resolveAdminPath(adminBasePath, "/pages");
|
|
2890
2946
|
const rawPagesCollectionPath = resolveAdminPath(adminBasePath, `/collections/${pagesCollectionSlug}`);
|
|
2891
|
-
const [loading, setLoading] = (0,
|
|
2892
|
-
const [error, setError] = (0,
|
|
2893
|
-
const [docs, setDocs] = (0,
|
|
2894
|
-
const apiURL = (0,
|
|
2947
|
+
const [loading, setLoading] = (0, import_react14.useState)(true);
|
|
2948
|
+
const [error, setError] = (0, import_react14.useState)(null);
|
|
2949
|
+
const [docs, setDocs] = (0, import_react14.useState)([]);
|
|
2950
|
+
const apiURL = (0, import_react14.useMemo)(() => {
|
|
2895
2951
|
const params = new URLSearchParams({
|
|
2896
2952
|
depth: "0",
|
|
2897
2953
|
limit: "100",
|
|
@@ -2900,7 +2956,7 @@ function AdminStudioPagesListView(props) {
|
|
|
2900
2956
|
});
|
|
2901
2957
|
return `/api/${pagesCollectionSlug}?${params.toString()}`;
|
|
2902
2958
|
}, [pagesCollectionSlug]);
|
|
2903
|
-
(0,
|
|
2959
|
+
(0, import_react14.useEffect)(() => {
|
|
2904
2960
|
let cancelled = false;
|
|
2905
2961
|
const run = async () => {
|
|
2906
2962
|
setLoading(true);
|
|
@@ -3039,7 +3095,7 @@ function AdminStudioPagesListView(props) {
|
|
|
3039
3095
|
}
|
|
3040
3096
|
|
|
3041
3097
|
// src/admin/components/studio/AdminStudioPageEditView.tsx
|
|
3042
|
-
var
|
|
3098
|
+
var import_react15 = require("react");
|
|
3043
3099
|
var import_ui6 = require("@payloadcms/ui");
|
|
3044
3100
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
3045
3101
|
var isAdmin2 = (user) => {
|
|
@@ -3081,18 +3137,18 @@ var getPageIDFromPathname = (pathname) => {
|
|
|
3081
3137
|
function AdminStudioPageEditView(props) {
|
|
3082
3138
|
const { user } = (0, import_ui6.useAuth)();
|
|
3083
3139
|
const adminBasePath = useAdminBasePath();
|
|
3084
|
-
const iframeRef = (0,
|
|
3085
|
-
const [saving, setSaving] = (0,
|
|
3086
|
-
const [dirty, setDirty] = (0,
|
|
3087
|
-
const [hasUnpublishedChanges, setHasUnpublishedChanges] = (0,
|
|
3088
|
-
const [canUndo, setCanUndo] = (0,
|
|
3089
|
-
const [canRedo, setCanRedo] = (0,
|
|
3140
|
+
const iframeRef = (0, import_react15.useRef)(null);
|
|
3141
|
+
const [saving, setSaving] = (0, import_react15.useState)(null);
|
|
3142
|
+
const [dirty, setDirty] = (0, import_react15.useState)(false);
|
|
3143
|
+
const [hasUnpublishedChanges, setHasUnpublishedChanges] = (0, import_react15.useState)(false);
|
|
3144
|
+
const [canUndo, setCanUndo] = (0, import_react15.useState)(false);
|
|
3145
|
+
const [canRedo, setCanRedo] = (0, import_react15.useState)(false);
|
|
3090
3146
|
const builderBasePath = getPropString4(props, "builderBasePath", "/builder");
|
|
3091
3147
|
const pagesPath = resolveAdminPath(adminBasePath, "/pages");
|
|
3092
|
-
const pageIDFromParams = (0,
|
|
3093
|
-
const [pageID, setPageID] = (0,
|
|
3094
|
-
const [didResolvePathFallback, setDidResolvePathFallback] = (0,
|
|
3095
|
-
(0,
|
|
3148
|
+
const pageIDFromParams = (0, import_react15.useMemo)(() => getParam(props.params, "id"), [props.params]);
|
|
3149
|
+
const [pageID, setPageID] = (0, import_react15.useState)(pageIDFromParams);
|
|
3150
|
+
const [didResolvePathFallback, setDidResolvePathFallback] = (0, import_react15.useState)(false);
|
|
3151
|
+
(0, import_react15.useEffect)(() => {
|
|
3096
3152
|
if (pageIDFromParams) {
|
|
3097
3153
|
setPageID(pageIDFromParams);
|
|
3098
3154
|
setDidResolvePathFallback(true);
|
|
@@ -3136,7 +3192,7 @@ function AdminStudioPageEditView(props) {
|
|
|
3136
3192
|
} catch {
|
|
3137
3193
|
}
|
|
3138
3194
|
};
|
|
3139
|
-
(0,
|
|
3195
|
+
(0, import_react15.useEffect)(() => {
|
|
3140
3196
|
if (!pageID) {
|
|
3141
3197
|
return;
|
|
3142
3198
|
}
|
|
@@ -3159,7 +3215,7 @@ function AdminStudioPageEditView(props) {
|
|
|
3159
3215
|
}
|
|
3160
3216
|
iframe.contentWindow.postMessage({ source: "payload-visual-builder-parent", type }, "*");
|
|
3161
3217
|
};
|
|
3162
|
-
(0,
|
|
3218
|
+
(0, import_react15.useEffect)(() => {
|
|
3163
3219
|
const onMessage = (event) => {
|
|
3164
3220
|
const data = event.data;
|
|
3165
3221
|
if (!data || data.source !== "payload-visual-builder-child" || typeof data.type !== "string") {
|
|
@@ -3453,11 +3509,11 @@ function AdminStudioGlobalsView(props) {
|
|
|
3453
3509
|
}
|
|
3454
3510
|
|
|
3455
3511
|
// src/admin/components/studio/AdminStudioHeaderGlobalView.tsx
|
|
3456
|
-
var
|
|
3512
|
+
var import_react18 = require("react");
|
|
3457
3513
|
var import_ui8 = require("@payloadcms/ui");
|
|
3458
3514
|
|
|
3459
3515
|
// src/admin-app/components/HeaderNavEditorWithPreview.tsx
|
|
3460
|
-
var
|
|
3516
|
+
var import_react17 = require("react");
|
|
3461
3517
|
|
|
3462
3518
|
// src/admin-app/nestedNavigation.ts
|
|
3463
3519
|
var normalizeNestedNavItems = (items) => {
|
|
@@ -3506,7 +3562,7 @@ var buildNestedNavTree = (items) => {
|
|
|
3506
3562
|
};
|
|
3507
3563
|
|
|
3508
3564
|
// src/admin-app/components/HeaderNavItemsEditor.tsx
|
|
3509
|
-
var
|
|
3565
|
+
var import_react16 = require("react");
|
|
3510
3566
|
|
|
3511
3567
|
// src/admin-app/navigationLinks.ts
|
|
3512
3568
|
var fallbackHomeOption = {
|
|
@@ -3605,12 +3661,12 @@ var moveRow = (rows, fromIndex, toIndex) => {
|
|
|
3605
3661
|
return next;
|
|
3606
3662
|
};
|
|
3607
3663
|
function HeaderNavItemsEditor({ initialItems, pageOptions, onItemsChange }) {
|
|
3608
|
-
const [rows, setRows] = (0,
|
|
3609
|
-
const [nextRowID, setNextRowID] = (0,
|
|
3610
|
-
const [draggingRowID, setDraggingRowID] = (0,
|
|
3611
|
-
const [dragOverRowID, setDragOverRowID] = (0,
|
|
3612
|
-
const pageOptionByHref = (0,
|
|
3613
|
-
const serializedState = (0,
|
|
3664
|
+
const [rows, setRows] = (0, import_react16.useState)(() => initialItems.map(toRow));
|
|
3665
|
+
const [nextRowID, setNextRowID] = (0, import_react16.useState)(initialItems.length);
|
|
3666
|
+
const [draggingRowID, setDraggingRowID] = (0, import_react16.useState)(null);
|
|
3667
|
+
const [dragOverRowID, setDragOverRowID] = (0, import_react16.useState)(null);
|
|
3668
|
+
const pageOptionByHref = (0, import_react16.useMemo)(() => new Map(pageOptions.map((option) => [option.href, option])), [pageOptions]);
|
|
3669
|
+
const serializedState = (0, import_react16.useMemo)(
|
|
3614
3670
|
() => JSON.stringify(
|
|
3615
3671
|
rows.map((row) => ({
|
|
3616
3672
|
href: row.href.trim(),
|
|
@@ -3620,7 +3676,7 @@ function HeaderNavItemsEditor({ initialItems, pageOptions, onItemsChange }) {
|
|
|
3620
3676
|
),
|
|
3621
3677
|
[rows]
|
|
3622
3678
|
);
|
|
3623
|
-
const normalizedItems = (0,
|
|
3679
|
+
const normalizedItems = (0, import_react16.useMemo)(() => {
|
|
3624
3680
|
const inputs = rows.map((row) => ({
|
|
3625
3681
|
href: row.href,
|
|
3626
3682
|
label: row.label,
|
|
@@ -3628,7 +3684,7 @@ function HeaderNavItemsEditor({ initialItems, pageOptions, onItemsChange }) {
|
|
|
3628
3684
|
}));
|
|
3629
3685
|
return normalizeAdminNavInputs(inputs, pageOptions);
|
|
3630
3686
|
}, [rows, pageOptions]);
|
|
3631
|
-
(0,
|
|
3687
|
+
(0, import_react16.useEffect)(() => {
|
|
3632
3688
|
onItemsChange?.(normalizedItems);
|
|
3633
3689
|
}, [normalizedItems, onItemsChange]);
|
|
3634
3690
|
const setRowValue = (rowID, changes) => {
|
|
@@ -3961,8 +4017,8 @@ function HeaderNavEditorWithPreview({
|
|
|
3961
4017
|
socialLinks,
|
|
3962
4018
|
tagline = ""
|
|
3963
4019
|
}) {
|
|
3964
|
-
const [liveItems, setLiveItems] = (0,
|
|
3965
|
-
const previewItems = (0,
|
|
4020
|
+
const [liveItems, setLiveItems] = (0, import_react17.useState)(initialItems);
|
|
4021
|
+
const previewItems = (0, import_react17.useMemo)(() => {
|
|
3966
4022
|
const normalized = normalizeNestedNavItems(liveItems);
|
|
3967
4023
|
const tree = buildNestedNavTree(normalized);
|
|
3968
4024
|
return tree.topLevel.length > 0 ? tree : buildNestedNavTree(fallbackNav);
|
|
@@ -4174,16 +4230,16 @@ function AdminStudioHeaderGlobalView(props) {
|
|
|
4174
4230
|
const adminBasePath = useAdminBasePath();
|
|
4175
4231
|
const resolvedGlobalsBasePath = resolveAdminPath(adminBasePath, globalsBasePath);
|
|
4176
4232
|
const rawGlobalPath = resolveAdminPath(adminBasePath, `/globals/${globalSlug}`);
|
|
4177
|
-
const [loading, setLoading] = (0,
|
|
4178
|
-
const [saving, setSaving] = (0,
|
|
4179
|
-
const [error, setError] = (0,
|
|
4180
|
-
const [savedMessage, setSavedMessage] = (0,
|
|
4181
|
-
const [initialItems, setInitialItems] = (0,
|
|
4182
|
-
const [liveItems, setLiveItems] = (0,
|
|
4183
|
-
const [pages, setPages] = (0,
|
|
4184
|
-
const [siteSettings, setSiteSettings] = (0,
|
|
4185
|
-
const [socialMedia, setSocialMedia] = (0,
|
|
4186
|
-
(0,
|
|
4233
|
+
const [loading, setLoading] = (0, import_react18.useState)(true);
|
|
4234
|
+
const [saving, setSaving] = (0, import_react18.useState)(false);
|
|
4235
|
+
const [error, setError] = (0, import_react18.useState)(null);
|
|
4236
|
+
const [savedMessage, setSavedMessage] = (0, import_react18.useState)(null);
|
|
4237
|
+
const [initialItems, setInitialItems] = (0, import_react18.useState)([]);
|
|
4238
|
+
const [liveItems, setLiveItems] = (0, import_react18.useState)([]);
|
|
4239
|
+
const [pages, setPages] = (0, import_react18.useState)([]);
|
|
4240
|
+
const [siteSettings, setSiteSettings] = (0, import_react18.useState)({});
|
|
4241
|
+
const [socialMedia, setSocialMedia] = (0, import_react18.useState)({});
|
|
4242
|
+
(0, import_react18.useEffect)(() => {
|
|
4187
4243
|
let cancelled = false;
|
|
4188
4244
|
const run = async () => {
|
|
4189
4245
|
setLoading(true);
|
|
@@ -4246,8 +4302,8 @@ function AdminStudioHeaderGlobalView(props) {
|
|
|
4246
4302
|
cancelled = true;
|
|
4247
4303
|
};
|
|
4248
4304
|
}, [globalSlug, pagesCollectionSlug]);
|
|
4249
|
-
const pageOptions = (0,
|
|
4250
|
-
const previewSocialLinks = (0,
|
|
4305
|
+
const pageOptions = (0, import_react18.useMemo)(() => buildAdminPageLinkOptions(pages), [pages]);
|
|
4306
|
+
const previewSocialLinks = (0, import_react18.useMemo)(
|
|
4251
4307
|
() => resolveSocialMediaLinks(socialMedia).map((item) => ({
|
|
4252
4308
|
label: item.label,
|
|
4253
4309
|
platform: item.platform,
|
|
@@ -4258,7 +4314,7 @@ function AdminStudioHeaderGlobalView(props) {
|
|
|
4258
4314
|
const previewSiteName = typeof siteSettings.siteName === "string" && siteSettings.siteName.trim().length > 0 ? siteSettings.siteName.trim() : "Orion Studio";
|
|
4259
4315
|
const previewTagline = typeof siteSettings.tagline === "string" ? siteSettings.tagline.trim() : "";
|
|
4260
4316
|
const previewLogoUrl = resolveMediaURL(siteSettings.logo);
|
|
4261
|
-
const editorKey = (0,
|
|
4317
|
+
const editorKey = (0, import_react18.useMemo)(() => JSON.stringify(initialItems), [initialItems]);
|
|
4262
4318
|
const save = async () => {
|
|
4263
4319
|
setSaving(true);
|
|
4264
4320
|
setError(null);
|
|
@@ -4349,7 +4405,7 @@ function AdminStudioHeaderGlobalView(props) {
|
|
|
4349
4405
|
}
|
|
4350
4406
|
|
|
4351
4407
|
// src/admin/components/studio/AdminStudioFooterGlobalView.tsx
|
|
4352
|
-
var
|
|
4408
|
+
var import_react19 = require("react");
|
|
4353
4409
|
var import_ui9 = require("@payloadcms/ui");
|
|
4354
4410
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
4355
4411
|
var getPropString7 = (props, key, fallback) => {
|
|
@@ -4457,18 +4513,18 @@ function AdminStudioFooterGlobalView(props) {
|
|
|
4457
4513
|
const adminBasePath = useAdminBasePath();
|
|
4458
4514
|
const resolvedGlobalsBasePath = resolveAdminPath(adminBasePath, globalsBasePath);
|
|
4459
4515
|
const rawGlobalPath = resolveAdminPath(adminBasePath, `/globals/${globalSlug}`);
|
|
4460
|
-
const [loading, setLoading] = (0,
|
|
4461
|
-
const [saving, setSaving] = (0,
|
|
4462
|
-
const [error, setError] = (0,
|
|
4463
|
-
const [savedMessage, setSavedMessage] = (0,
|
|
4464
|
-
const [doc, setDoc] = (0,
|
|
4516
|
+
const [loading, setLoading] = (0, import_react19.useState)(true);
|
|
4517
|
+
const [saving, setSaving] = (0, import_react19.useState)(false);
|
|
4518
|
+
const [error, setError] = (0, import_react19.useState)(null);
|
|
4519
|
+
const [savedMessage, setSavedMessage] = (0, import_react19.useState)(null);
|
|
4520
|
+
const [doc, setDoc] = (0, import_react19.useState)({
|
|
4465
4521
|
contactEmail: "",
|
|
4466
4522
|
contactPhone: "",
|
|
4467
4523
|
copyright: ""
|
|
4468
4524
|
});
|
|
4469
|
-
const [siteSettings, setSiteSettings] = (0,
|
|
4470
|
-
const [socialMedia, setSocialMedia] = (0,
|
|
4471
|
-
(0,
|
|
4525
|
+
const [siteSettings, setSiteSettings] = (0, import_react19.useState)({});
|
|
4526
|
+
const [socialMedia, setSocialMedia] = (0, import_react19.useState)({});
|
|
4527
|
+
(0, import_react19.useEffect)(() => {
|
|
4472
4528
|
let cancelled = false;
|
|
4473
4529
|
const run = async () => {
|
|
4474
4530
|
setLoading(true);
|
|
@@ -4520,7 +4576,7 @@ function AdminStudioFooterGlobalView(props) {
|
|
|
4520
4576
|
cancelled = true;
|
|
4521
4577
|
};
|
|
4522
4578
|
}, [globalSlug]);
|
|
4523
|
-
const previewSocialLinks = (0,
|
|
4579
|
+
const previewSocialLinks = (0, import_react19.useMemo)(
|
|
4524
4580
|
() => resolveSocialMediaLinks(socialMedia).map((item) => ({
|
|
4525
4581
|
label: item.label,
|
|
4526
4582
|
platform: item.platform,
|
|
@@ -4724,7 +4780,7 @@ function AdminStudioFooterGlobalView(props) {
|
|
|
4724
4780
|
}
|
|
4725
4781
|
|
|
4726
4782
|
// src/admin/components/studio/AdminStudioContactFormView.tsx
|
|
4727
|
-
var
|
|
4783
|
+
var import_react20 = require("react");
|
|
4728
4784
|
var import_ui10 = require("@payloadcms/ui");
|
|
4729
4785
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
4730
4786
|
var defaultDoc = {
|
|
@@ -4815,12 +4871,12 @@ function AdminStudioContactFormView(props) {
|
|
|
4815
4871
|
const adminBasePath = useAdminBasePath();
|
|
4816
4872
|
const resolvedGlobalsBasePath = resolveAdminPath(adminBasePath, globalsBasePath);
|
|
4817
4873
|
const rawGlobalPath = resolveAdminPath(adminBasePath, `/globals/${globalSlug}`);
|
|
4818
|
-
const [doc, setDoc] = (0,
|
|
4819
|
-
const [error, setError] = (0,
|
|
4820
|
-
const [isLoading, setIsLoading] = (0,
|
|
4821
|
-
const [isSaving, setIsSaving] = (0,
|
|
4822
|
-
const [savedMessage, setSavedMessage] = (0,
|
|
4823
|
-
(0,
|
|
4874
|
+
const [doc, setDoc] = (0, import_react20.useState)(defaultDoc);
|
|
4875
|
+
const [error, setError] = (0, import_react20.useState)(null);
|
|
4876
|
+
const [isLoading, setIsLoading] = (0, import_react20.useState)(true);
|
|
4877
|
+
const [isSaving, setIsSaving] = (0, import_react20.useState)(false);
|
|
4878
|
+
const [savedMessage, setSavedMessage] = (0, import_react20.useState)(null);
|
|
4879
|
+
(0, import_react20.useEffect)(() => {
|
|
4824
4880
|
let mounted = true;
|
|
4825
4881
|
const load = async () => {
|
|
4826
4882
|
setIsLoading(true);
|
|
@@ -4850,7 +4906,7 @@ function AdminStudioContactFormView(props) {
|
|
|
4850
4906
|
mounted = false;
|
|
4851
4907
|
};
|
|
4852
4908
|
}, [globalSlug]);
|
|
4853
|
-
const payload = (0,
|
|
4909
|
+
const payload = (0, import_react20.useMemo)(
|
|
4854
4910
|
() => ({
|
|
4855
4911
|
disabledMessage: doc.disabledMessage,
|
|
4856
4912
|
enabled: doc.enabled,
|
|
@@ -5094,7 +5150,7 @@ function AdminStudioMediaView(props) {
|
|
|
5094
5150
|
}
|
|
5095
5151
|
|
|
5096
5152
|
// src/admin/components/studio/AdminStudioFormsView.tsx
|
|
5097
|
-
var
|
|
5153
|
+
var import_react21 = require("react");
|
|
5098
5154
|
var import_ui12 = require("@payloadcms/ui");
|
|
5099
5155
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
5100
5156
|
var isAdmin3 = (user) => {
|
|
@@ -5250,21 +5306,21 @@ function AdminStudioFormsView(props) {
|
|
|
5250
5306
|
`/collections/${formSubmissionsCollectionSlug}`
|
|
5251
5307
|
);
|
|
5252
5308
|
const rawUploadsPath = resolveAdminPath(adminBasePath, `/collections/${formUploadsCollectionSlug}`);
|
|
5253
|
-
const [selectedFormID, setSelectedFormID] = (0,
|
|
5254
|
-
const [forms, setForms] = (0,
|
|
5255
|
-
const [submissions, setSubmissions] = (0,
|
|
5256
|
-
const [formsLoading, setFormsLoading] = (0,
|
|
5257
|
-
const [submissionsLoading, setSubmissionsLoading] = (0,
|
|
5258
|
-
const [formsError, setFormsError] = (0,
|
|
5259
|
-
const [submissionsError, setSubmissionsError] = (0,
|
|
5260
|
-
const selectedForm = (0,
|
|
5309
|
+
const [selectedFormID, setSelectedFormID] = (0, import_react21.useState)("");
|
|
5310
|
+
const [forms, setForms] = (0, import_react21.useState)([]);
|
|
5311
|
+
const [submissions, setSubmissions] = (0, import_react21.useState)([]);
|
|
5312
|
+
const [formsLoading, setFormsLoading] = (0, import_react21.useState)(true);
|
|
5313
|
+
const [submissionsLoading, setSubmissionsLoading] = (0, import_react21.useState)(false);
|
|
5314
|
+
const [formsError, setFormsError] = (0, import_react21.useState)(null);
|
|
5315
|
+
const [submissionsError, setSubmissionsError] = (0, import_react21.useState)(null);
|
|
5316
|
+
const selectedForm = (0, import_react21.useMemo)(
|
|
5261
5317
|
() => forms.find((form) => {
|
|
5262
5318
|
const id = typeof form.id === "string" || typeof form.id === "number" ? String(form.id) : "";
|
|
5263
5319
|
return selectedFormID.length > 0 && id === selectedFormID;
|
|
5264
5320
|
}) || null,
|
|
5265
5321
|
[forms, selectedFormID]
|
|
5266
5322
|
);
|
|
5267
|
-
(0,
|
|
5323
|
+
(0, import_react21.useEffect)(() => {
|
|
5268
5324
|
if (typeof window === "undefined") {
|
|
5269
5325
|
return;
|
|
5270
5326
|
}
|
|
@@ -5274,7 +5330,7 @@ function AdminStudioFormsView(props) {
|
|
|
5274
5330
|
setSelectedFormID(formID);
|
|
5275
5331
|
}
|
|
5276
5332
|
}, []);
|
|
5277
|
-
(0,
|
|
5333
|
+
(0, import_react21.useEffect)(() => {
|
|
5278
5334
|
if (!canReviewForms(user)) {
|
|
5279
5335
|
return;
|
|
5280
5336
|
}
|
|
@@ -5328,7 +5384,7 @@ function AdminStudioFormsView(props) {
|
|
|
5328
5384
|
cancelled = true;
|
|
5329
5385
|
};
|
|
5330
5386
|
}, [formsCollectionSlug, user]);
|
|
5331
|
-
(0,
|
|
5387
|
+
(0, import_react21.useEffect)(() => {
|
|
5332
5388
|
if (!selectedFormID || !canReviewForms(user)) {
|
|
5333
5389
|
setSubmissions([]);
|
|
5334
5390
|
return;
|
|
@@ -5372,7 +5428,7 @@ function AdminStudioFormsView(props) {
|
|
|
5372
5428
|
cancelled = true;
|
|
5373
5429
|
};
|
|
5374
5430
|
}, [formSubmissionsCollectionSlug, selectedFormID, user]);
|
|
5375
|
-
(0,
|
|
5431
|
+
(0, import_react21.useEffect)(() => {
|
|
5376
5432
|
if (typeof window === "undefined" || !selectedFormID) {
|
|
5377
5433
|
return;
|
|
5378
5434
|
}
|
|
@@ -5933,13 +5989,13 @@ function OpenInStudioMenuItem({ pagesPathBase = "/pages" }) {
|
|
|
5933
5989
|
}
|
|
5934
5990
|
|
|
5935
5991
|
// src/admin/components/studio/PageEditRedirectToStudio.tsx
|
|
5936
|
-
var
|
|
5992
|
+
var import_react22 = require("react");
|
|
5937
5993
|
var import_ui15 = require("@payloadcms/ui");
|
|
5938
5994
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
5939
5995
|
function PageEditRedirectToStudio({ pagesPathBase = "/pages" }) {
|
|
5940
5996
|
const documentInfo = (0, import_ui15.useDocumentInfo)();
|
|
5941
5997
|
const id = documentInfo?.id;
|
|
5942
|
-
(0,
|
|
5998
|
+
(0, import_react22.useEffect)(() => {
|
|
5943
5999
|
if (!id) {
|
|
5944
6000
|
return;
|
|
5945
6001
|
}
|
|
@@ -5966,7 +6022,7 @@ function PageEditRedirectToStudio({ pagesPathBase = "/pages" }) {
|
|
|
5966
6022
|
}
|
|
5967
6023
|
|
|
5968
6024
|
// src/admin/components/studio/StudioBackBreadcrumb.tsx
|
|
5969
|
-
var
|
|
6025
|
+
var import_react23 = require("react");
|
|
5970
6026
|
var import_ui16 = require("@payloadcms/ui");
|
|
5971
6027
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
5972
6028
|
var toTitle = (slug) => slug.split("-").filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
|
|
@@ -6013,8 +6069,8 @@ var buildNav = (pathname, adminBasePath) => {
|
|
|
6013
6069
|
};
|
|
6014
6070
|
function StudioBackBreadcrumb() {
|
|
6015
6071
|
const adminBasePath = useAdminBasePath();
|
|
6016
|
-
const [pathname, setPathname] = (0,
|
|
6017
|
-
(0,
|
|
6072
|
+
const [pathname, setPathname] = (0, import_react23.useState)("");
|
|
6073
|
+
(0, import_react23.useEffect)(() => {
|
|
6018
6074
|
const update = () => setPathname(window.location.pathname);
|
|
6019
6075
|
update();
|
|
6020
6076
|
window.addEventListener("popstate", update);
|
|
@@ -6026,7 +6082,7 @@ function StudioBackBreadcrumb() {
|
|
|
6026
6082
|
}
|
|
6027
6083
|
|
|
6028
6084
|
// src/admin/components/studio/StudioContactFormRedirect.tsx
|
|
6029
|
-
var
|
|
6085
|
+
var import_react24 = require("react");
|
|
6030
6086
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
6031
6087
|
var getPropString12 = (props, key, fallback) => {
|
|
6032
6088
|
if (!props || typeof props !== "object") return fallback;
|
|
@@ -6043,7 +6099,7 @@ function StudioContactFormRedirect(props) {
|
|
|
6043
6099
|
const adminBasePath = useAdminBasePath();
|
|
6044
6100
|
const studioContactFormPath = getPropString12(props, "studioContactFormPath", "/contact-form");
|
|
6045
6101
|
const targetPath = resolveAdminPath(adminBasePath, studioContactFormPath);
|
|
6046
|
-
(0,
|
|
6102
|
+
(0, import_react24.useEffect)(() => {
|
|
6047
6103
|
if (window.location.pathname === targetPath) return;
|
|
6048
6104
|
window.location.replace(targetPath);
|
|
6049
6105
|
}, [targetPath]);
|