@orion-studios/payload-studio 0.3.0-beta.6 → 0.3.0-beta.7
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 +111 -228
- package/dist/admin/client.mjs +102 -219
- package/dist/admin.css +9 -2
- package/dist/index.mjs +6 -6
- package/package.json +1 -1
package/dist/admin/client.js
CHANGED
|
@@ -1338,25 +1338,31 @@ function Icon({ brandName = "Orion Studio", logoUrl } = {}) {
|
|
|
1338
1338
|
{
|
|
1339
1339
|
style: {
|
|
1340
1340
|
alignItems: "center",
|
|
1341
|
-
borderRadius:
|
|
1341
|
+
borderRadius: 6,
|
|
1342
1342
|
display: "flex",
|
|
1343
|
-
height:
|
|
1343
|
+
height: "100%",
|
|
1344
1344
|
justifyContent: "center",
|
|
1345
1345
|
overflow: "hidden",
|
|
1346
|
-
width:
|
|
1346
|
+
width: "100%"
|
|
1347
1347
|
},
|
|
1348
1348
|
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1349
1349
|
"img",
|
|
1350
1350
|
{
|
|
1351
1351
|
alt: "Site logo",
|
|
1352
1352
|
src: resolvedLogo,
|
|
1353
|
-
style: {
|
|
1353
|
+
style: {
|
|
1354
|
+
borderRadius: 6,
|
|
1355
|
+
height: "100%",
|
|
1356
|
+
objectFit: "contain",
|
|
1357
|
+
padding: 1,
|
|
1358
|
+
width: "100%"
|
|
1359
|
+
}
|
|
1354
1360
|
}
|
|
1355
1361
|
)
|
|
1356
1362
|
}
|
|
1357
1363
|
);
|
|
1358
1364
|
}
|
|
1359
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { fill: "none", height: "
|
|
1365
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { fill: "none", height: "100%", viewBox: "0 0 32 32", width: "100%", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1360
1366
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("rect", { fill: "var(--admin-accent, #3b82f6)", height: "32", rx: "8", width: "32" }),
|
|
1361
1367
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("g", { transform: "translate(4, 4)", children: [
|
|
1362
1368
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
@@ -2463,122 +2469,9 @@ function AdminStudioNav(props) {
|
|
|
2463
2469
|
}
|
|
2464
2470
|
|
|
2465
2471
|
// src/admin/components/studio/AdminStudioPagesListView.tsx
|
|
2466
|
-
var import_react13 = require("react");
|
|
2467
|
-
var import_ui4 = require("@payloadcms/ui");
|
|
2468
|
-
|
|
2469
|
-
// src/admin/components/studio/StudioSectionLayout.tsx
|
|
2470
2472
|
var import_react12 = require("react");
|
|
2473
|
+
var import_ui4 = require("@payloadcms/ui");
|
|
2471
2474
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2472
|
-
var STORAGE_KEY2 = "orion-studio-sidebar-collapsed";
|
|
2473
|
-
var getSectionCrumb = (pathname) => {
|
|
2474
|
-
if (pathname.startsWith("/admin/pages") || pathname.includes("/collections/pages")) {
|
|
2475
|
-
return { href: "/admin/pages", label: "Pages" };
|
|
2476
|
-
}
|
|
2477
|
-
if (pathname.startsWith("/admin/studio-globals") || pathname.includes("/globals/")) {
|
|
2478
|
-
return { href: "/admin/studio-globals", label: "Globals" };
|
|
2479
|
-
}
|
|
2480
|
-
if (pathname.startsWith("/admin/media") || pathname.includes("/collections/media")) {
|
|
2481
|
-
return { href: "/admin/media", label: "Media" };
|
|
2482
|
-
}
|
|
2483
|
-
if (pathname.startsWith("/admin/tools")) {
|
|
2484
|
-
return { href: "/admin/tools", label: "Admin Tools" };
|
|
2485
|
-
}
|
|
2486
|
-
return null;
|
|
2487
|
-
};
|
|
2488
|
-
function StudioSectionLayout({ children, navProps }) {
|
|
2489
|
-
const [collapsed, setCollapsed] = (0, import_react12.useState)(false);
|
|
2490
|
-
const [pathname, setPathname] = (0, import_react12.useState)("");
|
|
2491
|
-
(0, import_react12.useEffect)(() => {
|
|
2492
|
-
try {
|
|
2493
|
-
const stored = window.localStorage.getItem(STORAGE_KEY2);
|
|
2494
|
-
if (stored === "1") setCollapsed(true);
|
|
2495
|
-
} catch {
|
|
2496
|
-
}
|
|
2497
|
-
const update = () => setPathname(window.location.pathname);
|
|
2498
|
-
update();
|
|
2499
|
-
window.addEventListener("popstate", update);
|
|
2500
|
-
return () => window.removeEventListener("popstate", update);
|
|
2501
|
-
}, []);
|
|
2502
|
-
const toggle = () => {
|
|
2503
|
-
setCollapsed((prev) => {
|
|
2504
|
-
const next = !prev;
|
|
2505
|
-
try {
|
|
2506
|
-
window.localStorage.setItem(STORAGE_KEY2, next ? "1" : "0");
|
|
2507
|
-
} catch {
|
|
2508
|
-
}
|
|
2509
|
-
return next;
|
|
2510
|
-
});
|
|
2511
|
-
};
|
|
2512
|
-
const crumb = getSectionCrumb(pathname);
|
|
2513
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2514
|
-
"div",
|
|
2515
|
-
{
|
|
2516
|
-
style: {
|
|
2517
|
-
background: "var(--theme-elevation-0)",
|
|
2518
|
-
display: "grid",
|
|
2519
|
-
gridTemplateColumns: collapsed ? "84px minmax(0, 1fr)" : "260px minmax(0, 1fr)",
|
|
2520
|
-
minHeight: "100vh"
|
|
2521
|
-
},
|
|
2522
|
-
children: [
|
|
2523
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2524
|
-
"aside",
|
|
2525
|
-
{
|
|
2526
|
-
className: "orion-studio-sidebar",
|
|
2527
|
-
style: {
|
|
2528
|
-
borderRight: "1px solid var(--theme-elevation-150)",
|
|
2529
|
-
height: "100vh",
|
|
2530
|
-
overflow: "visible",
|
|
2531
|
-
position: "sticky",
|
|
2532
|
-
top: 0,
|
|
2533
|
-
zIndex: 2
|
|
2534
|
-
},
|
|
2535
|
-
children: [
|
|
2536
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2537
|
-
"button",
|
|
2538
|
-
{
|
|
2539
|
-
"aria-label": collapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
2540
|
-
onClick: toggle,
|
|
2541
|
-
style: {
|
|
2542
|
-
alignItems: "center",
|
|
2543
|
-
background: "var(--theme-elevation-0)",
|
|
2544
|
-
border: "1px solid var(--theme-elevation-200)",
|
|
2545
|
-
borderRadius: 8,
|
|
2546
|
-
cursor: "pointer",
|
|
2547
|
-
display: "flex",
|
|
2548
|
-
height: 30,
|
|
2549
|
-
justifyContent: "center",
|
|
2550
|
-
position: "absolute",
|
|
2551
|
-
right: -15,
|
|
2552
|
-
top: 10,
|
|
2553
|
-
width: 30,
|
|
2554
|
-
zIndex: 5
|
|
2555
|
-
},
|
|
2556
|
-
type: "button",
|
|
2557
|
-
children: collapsed ? ">" : "<"
|
|
2558
|
-
}
|
|
2559
|
-
),
|
|
2560
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { height: "100%", overflowY: "auto" }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(AdminStudioNav, { ...navProps, compact: collapsed }) })
|
|
2561
|
-
]
|
|
2562
|
-
}
|
|
2563
|
-
),
|
|
2564
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("main", { style: { minWidth: 0, padding: "1.2rem 1.2rem 2.5rem" }, children: [
|
|
2565
|
-
crumb ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { alignItems: "center", display: "flex", gap: "0.35rem", marginBottom: "0.7rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2566
|
-
"a",
|
|
2567
|
-
{
|
|
2568
|
-
href: crumb.href,
|
|
2569
|
-
style: { color: "var(--theme-elevation-700)", fontSize: "0.9rem", textDecoration: "none" },
|
|
2570
|
-
children: crumb.label
|
|
2571
|
-
}
|
|
2572
|
-
) }) : null,
|
|
2573
|
-
children
|
|
2574
|
-
] })
|
|
2575
|
-
]
|
|
2576
|
-
}
|
|
2577
|
-
);
|
|
2578
|
-
}
|
|
2579
|
-
|
|
2580
|
-
// src/admin/components/studio/AdminStudioPagesListView.tsx
|
|
2581
|
-
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2582
2475
|
var isAdmin2 = (user) => {
|
|
2583
2476
|
if (!user || typeof user !== "object") return false;
|
|
2584
2477
|
const role = user.role;
|
|
@@ -2598,10 +2491,10 @@ var getPropString2 = (props, key, fallback) => {
|
|
|
2598
2491
|
function AdminStudioPagesListView(props) {
|
|
2599
2492
|
const { user } = (0, import_ui4.useAuth)();
|
|
2600
2493
|
const pagesCollectionSlug = getPropString2(props, "pagesCollectionSlug", "pages");
|
|
2601
|
-
const [loading, setLoading] = (0,
|
|
2602
|
-
const [error, setError] = (0,
|
|
2603
|
-
const [docs, setDocs] = (0,
|
|
2604
|
-
const apiURL = (0,
|
|
2494
|
+
const [loading, setLoading] = (0, import_react12.useState)(true);
|
|
2495
|
+
const [error, setError] = (0, import_react12.useState)(null);
|
|
2496
|
+
const [docs, setDocs] = (0, import_react12.useState)([]);
|
|
2497
|
+
const apiURL = (0, import_react12.useMemo)(() => {
|
|
2605
2498
|
const params = new URLSearchParams({
|
|
2606
2499
|
depth: "0",
|
|
2607
2500
|
limit: "100",
|
|
@@ -2610,7 +2503,7 @@ function AdminStudioPagesListView(props) {
|
|
|
2610
2503
|
});
|
|
2611
2504
|
return `/api/${pagesCollectionSlug}?${params.toString()}`;
|
|
2612
2505
|
}, [pagesCollectionSlug]);
|
|
2613
|
-
(0,
|
|
2506
|
+
(0, import_react12.useEffect)(() => {
|
|
2614
2507
|
let cancelled = false;
|
|
2615
2508
|
const run = async () => {
|
|
2616
2509
|
setLoading(true);
|
|
@@ -2635,13 +2528,14 @@ function AdminStudioPagesListView(props) {
|
|
|
2635
2528
|
cancelled = true;
|
|
2636
2529
|
};
|
|
2637
2530
|
}, [apiURL]);
|
|
2638
|
-
return /* @__PURE__ */ (0,
|
|
2639
|
-
/* @__PURE__ */ (0,
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
/* @__PURE__ */ (0,
|
|
2531
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
2532
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_ui4.SetStepNav, { nav: [{ label: "Pages", url: "/admin/pages" }] }),
|
|
2533
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { alignItems: "flex-end", display: "flex", gap: "0.75rem" }, children: [
|
|
2534
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { flex: 1 }, children: [
|
|
2535
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h1", { style: { margin: 0 }, children: "Pages" }),
|
|
2536
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { style: { color: "var(--theme-elevation-600)", marginTop: "0.35rem" }, children: "Open a page to edit it in the custom editor." })
|
|
2643
2537
|
] }),
|
|
2644
|
-
isAdmin2(user) ? /* @__PURE__ */ (0,
|
|
2538
|
+
isAdmin2(user) ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2645
2539
|
"a",
|
|
2646
2540
|
{
|
|
2647
2541
|
href: `/admin/collections/${pagesCollectionSlug}/create`,
|
|
@@ -2657,10 +2551,10 @@ function AdminStudioPagesListView(props) {
|
|
|
2657
2551
|
}
|
|
2658
2552
|
) : null
|
|
2659
2553
|
] }),
|
|
2660
|
-
loading ? /* @__PURE__ */ (0,
|
|
2661
|
-
error ? /* @__PURE__ */ (0,
|
|
2662
|
-
/* @__PURE__ */ (0,
|
|
2663
|
-
!loading && !error && docs.length === 0 ? /* @__PURE__ */ (0,
|
|
2554
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { color: "var(--theme-elevation-600)", marginTop: "1rem" }, children: "Loading..." }) : null,
|
|
2555
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { color: "crimson", marginTop: "1rem" }, children: error }) : null,
|
|
2556
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { display: "grid", gap: "0.6rem", marginTop: "1rem" }, children: [
|
|
2557
|
+
!loading && !error && docs.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2664
2558
|
"div",
|
|
2665
2559
|
{
|
|
2666
2560
|
style: {
|
|
@@ -2678,7 +2572,7 @@ function AdminStudioPagesListView(props) {
|
|
|
2678
2572
|
const path = typeof doc.path === "string" ? doc.path : "/";
|
|
2679
2573
|
const status = typeof doc._status === "string" ? doc._status : "";
|
|
2680
2574
|
if (!id) return null;
|
|
2681
|
-
return /* @__PURE__ */ (0,
|
|
2575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2682
2576
|
"a",
|
|
2683
2577
|
{
|
|
2684
2578
|
href: `/admin/pages/${id}`,
|
|
@@ -2694,9 +2588,9 @@ function AdminStudioPagesListView(props) {
|
|
|
2694
2588
|
textDecoration: "none"
|
|
2695
2589
|
},
|
|
2696
2590
|
children: [
|
|
2697
|
-
/* @__PURE__ */ (0,
|
|
2698
|
-
/* @__PURE__ */ (0,
|
|
2699
|
-
/* @__PURE__ */ (0,
|
|
2591
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { minWidth: 0 }, children: [
|
|
2592
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontWeight: 900, overflow: "hidden", textOverflow: "ellipsis" }, children: title }),
|
|
2593
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2700
2594
|
"div",
|
|
2701
2595
|
{
|
|
2702
2596
|
style: {
|
|
@@ -2709,7 +2603,7 @@ function AdminStudioPagesListView(props) {
|
|
|
2709
2603
|
}
|
|
2710
2604
|
)
|
|
2711
2605
|
] }),
|
|
2712
|
-
/* @__PURE__ */ (0,
|
|
2606
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2713
2607
|
"div",
|
|
2714
2608
|
{
|
|
2715
2609
|
style: {
|
|
@@ -2719,7 +2613,7 @@ function AdminStudioPagesListView(props) {
|
|
|
2719
2613
|
gap: "0.5rem"
|
|
2720
2614
|
},
|
|
2721
2615
|
children: [
|
|
2722
|
-
status ? /* @__PURE__ */ (0,
|
|
2616
|
+
status ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2723
2617
|
"span",
|
|
2724
2618
|
{
|
|
2725
2619
|
style: {
|
|
@@ -2734,7 +2628,7 @@ function AdminStudioPagesListView(props) {
|
|
|
2734
2628
|
children: status
|
|
2735
2629
|
}
|
|
2736
2630
|
) : null,
|
|
2737
|
-
/* @__PURE__ */ (0,
|
|
2631
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { color: "var(--theme-elevation-600)", fontWeight: 800 }, children: "Open" })
|
|
2738
2632
|
]
|
|
2739
2633
|
}
|
|
2740
2634
|
)
|
|
@@ -2748,9 +2642,9 @@ function AdminStudioPagesListView(props) {
|
|
|
2748
2642
|
}
|
|
2749
2643
|
|
|
2750
2644
|
// src/admin/components/studio/AdminStudioPageEditView.tsx
|
|
2751
|
-
var
|
|
2645
|
+
var import_react13 = require("react");
|
|
2752
2646
|
var import_ui5 = require("@payloadcms/ui");
|
|
2753
|
-
var
|
|
2647
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2754
2648
|
var isAdmin3 = (user) => {
|
|
2755
2649
|
if (!user || typeof user !== "object") return false;
|
|
2756
2650
|
const role = user.role;
|
|
@@ -2786,13 +2680,13 @@ var getPageIDFromPathname = (pathname) => {
|
|
|
2786
2680
|
};
|
|
2787
2681
|
function AdminStudioPageEditView(props) {
|
|
2788
2682
|
const { user } = (0, import_ui5.useAuth)();
|
|
2789
|
-
const iframeRef = (0,
|
|
2790
|
-
const [saving, setSaving] = (0,
|
|
2683
|
+
const iframeRef = (0, import_react13.useRef)(null);
|
|
2684
|
+
const [saving, setSaving] = (0, import_react13.useState)(null);
|
|
2791
2685
|
const builderBasePath = getPropString3(props, "builderBasePath", "/builder");
|
|
2792
|
-
const pageIDFromParams = (0,
|
|
2793
|
-
const [pageID, setPageID] = (0,
|
|
2794
|
-
const [didResolvePathFallback, setDidResolvePathFallback] = (0,
|
|
2795
|
-
(0,
|
|
2686
|
+
const pageIDFromParams = (0, import_react13.useMemo)(() => getParam(props.params, "id"), [props.params]);
|
|
2687
|
+
const [pageID, setPageID] = (0, import_react13.useState)(pageIDFromParams);
|
|
2688
|
+
const [didResolvePathFallback, setDidResolvePathFallback] = (0, import_react13.useState)(false);
|
|
2689
|
+
(0, import_react13.useEffect)(() => {
|
|
2796
2690
|
if (pageIDFromParams) {
|
|
2797
2691
|
setPageID(pageIDFromParams);
|
|
2798
2692
|
setDidResolvePathFallback(true);
|
|
@@ -2813,7 +2707,7 @@ function AdminStudioPageEditView(props) {
|
|
|
2813
2707
|
setSaving(status);
|
|
2814
2708
|
iframe.contentWindow.postMessage({ source: "payload-visual-builder-parent", type: "save", status }, "*");
|
|
2815
2709
|
};
|
|
2816
|
-
(0,
|
|
2710
|
+
(0, import_react13.useEffect)(() => {
|
|
2817
2711
|
const onMessage = (event) => {
|
|
2818
2712
|
const data = event.data;
|
|
2819
2713
|
if (!data || data.source !== "payload-visual-builder-child" || data.type !== "save-result") {
|
|
@@ -2830,19 +2724,19 @@ function AdminStudioPageEditView(props) {
|
|
|
2830
2724
|
return () => window.removeEventListener("message", onMessage);
|
|
2831
2725
|
}, []);
|
|
2832
2726
|
if (!pageID && !didResolvePathFallback) {
|
|
2833
|
-
return /* @__PURE__ */ (0,
|
|
2834
|
-
/* @__PURE__ */ (0,
|
|
2835
|
-
/* @__PURE__ */ (0,
|
|
2727
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { padding: "1.2rem" }, children: [
|
|
2728
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("h1", { style: { margin: 0 }, children: "Page Editor" }),
|
|
2729
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { style: { color: "var(--theme-elevation-600)" }, children: "Loading page editor..." })
|
|
2836
2730
|
] });
|
|
2837
2731
|
}
|
|
2838
2732
|
if (!pageID) {
|
|
2839
|
-
return /* @__PURE__ */ (0,
|
|
2840
|
-
/* @__PURE__ */ (0,
|
|
2841
|
-
/* @__PURE__ */ (0,
|
|
2733
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { padding: "1.2rem" }, children: [
|
|
2734
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("h1", { style: { margin: 0 }, children: "Page Editor" }),
|
|
2735
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { style: { color: "var(--theme-elevation-600)" }, children: "Missing page ID." })
|
|
2842
2736
|
] });
|
|
2843
2737
|
}
|
|
2844
|
-
return /* @__PURE__ */ (0,
|
|
2845
|
-
/* @__PURE__ */ (0,
|
|
2738
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { display: "grid", gridTemplateRows: "auto 1fr", height: "calc(100vh - 0px)" }, children: [
|
|
2739
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2846
2740
|
"div",
|
|
2847
2741
|
{
|
|
2848
2742
|
style: {
|
|
@@ -2858,9 +2752,9 @@ function AdminStudioPageEditView(props) {
|
|
|
2858
2752
|
zIndex: 20
|
|
2859
2753
|
},
|
|
2860
2754
|
children: [
|
|
2861
|
-
/* @__PURE__ */ (0,
|
|
2862
|
-
/* @__PURE__ */ (0,
|
|
2863
|
-
/* @__PURE__ */ (0,
|
|
2755
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { minWidth: 0 }, children: [
|
|
2756
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { fontWeight: 900 }, children: "Page Editor" }),
|
|
2757
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2864
2758
|
"div",
|
|
2865
2759
|
{
|
|
2866
2760
|
style: {
|
|
@@ -2876,8 +2770,8 @@ function AdminStudioPageEditView(props) {
|
|
|
2876
2770
|
}
|
|
2877
2771
|
)
|
|
2878
2772
|
] }),
|
|
2879
|
-
/* @__PURE__ */ (0,
|
|
2880
|
-
/* @__PURE__ */ (0,
|
|
2773
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { alignItems: "center", display: "flex", gap: "0.5rem" }, children: [
|
|
2774
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2881
2775
|
"button",
|
|
2882
2776
|
{
|
|
2883
2777
|
disabled: saving !== null,
|
|
@@ -2893,7 +2787,7 @@ function AdminStudioPageEditView(props) {
|
|
|
2893
2787
|
children: saving === "draft" ? "Saving\u2026" : "Save Draft"
|
|
2894
2788
|
}
|
|
2895
2789
|
),
|
|
2896
|
-
/* @__PURE__ */ (0,
|
|
2790
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2897
2791
|
"button",
|
|
2898
2792
|
{
|
|
2899
2793
|
disabled: !canPublish || saving !== null,
|
|
@@ -2916,7 +2810,7 @@ function AdminStudioPageEditView(props) {
|
|
|
2916
2810
|
]
|
|
2917
2811
|
}
|
|
2918
2812
|
),
|
|
2919
|
-
/* @__PURE__ */ (0,
|
|
2813
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2920
2814
|
"iframe",
|
|
2921
2815
|
{
|
|
2922
2816
|
ref: iframeRef,
|
|
@@ -2929,7 +2823,8 @@ function AdminStudioPageEditView(props) {
|
|
|
2929
2823
|
}
|
|
2930
2824
|
|
|
2931
2825
|
// src/admin/components/studio/AdminStudioGlobalsView.tsx
|
|
2932
|
-
var
|
|
2826
|
+
var import_ui6 = require("@payloadcms/ui");
|
|
2827
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2933
2828
|
var getPropGlobals = (props) => {
|
|
2934
2829
|
if (!props || typeof props !== "object") return null;
|
|
2935
2830
|
const direct = props.globals;
|
|
@@ -2959,10 +2854,11 @@ function AdminStudioGlobalsView(props) {
|
|
|
2959
2854
|
{ slug: "header", label: "Header & Navigation" },
|
|
2960
2855
|
{ slug: "footer", label: "Footer" }
|
|
2961
2856
|
];
|
|
2962
|
-
return /* @__PURE__ */ (0,
|
|
2963
|
-
/* @__PURE__ */ (0,
|
|
2964
|
-
/* @__PURE__ */ (0,
|
|
2965
|
-
/* @__PURE__ */ (0,
|
|
2857
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
2858
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_ui6.SetStepNav, { nav: [{ label: "Globals", url: globalsBasePath }] }),
|
|
2859
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("h1", { style: { margin: 0 }, children: "Globals" }),
|
|
2860
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { style: { color: "var(--theme-elevation-600)", marginTop: "0.35rem" }, children: "Site-wide settings." }),
|
|
2861
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { display: "grid", gap: "0.6rem", marginTop: "1rem" }, children: globals.map((global) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2966
2862
|
"a",
|
|
2967
2863
|
{
|
|
2968
2864
|
href: `/admin/globals/${global.slug}`,
|
|
@@ -2975,8 +2871,8 @@ function AdminStudioGlobalsView(props) {
|
|
|
2975
2871
|
textDecoration: "none"
|
|
2976
2872
|
},
|
|
2977
2873
|
children: [
|
|
2978
|
-
/* @__PURE__ */ (0,
|
|
2979
|
-
/* @__PURE__ */ (0,
|
|
2874
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { fontWeight: 900 }, children: global.label }),
|
|
2875
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { style: { color: "var(--theme-elevation-600)", fontSize: "0.9rem" }, children: [
|
|
2980
2876
|
"/admin/globals/",
|
|
2981
2877
|
global.slug
|
|
2982
2878
|
] })
|
|
@@ -2984,7 +2880,7 @@ function AdminStudioGlobalsView(props) {
|
|
|
2984
2880
|
},
|
|
2985
2881
|
global.slug
|
|
2986
2882
|
)) }),
|
|
2987
|
-
/* @__PURE__ */ (0,
|
|
2883
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { marginTop: "1rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2988
2884
|
"a",
|
|
2989
2885
|
{
|
|
2990
2886
|
href: globalsBasePath,
|
|
@@ -2996,7 +2892,8 @@ function AdminStudioGlobalsView(props) {
|
|
|
2996
2892
|
}
|
|
2997
2893
|
|
|
2998
2894
|
// src/admin/components/studio/AdminStudioMediaView.tsx
|
|
2999
|
-
var
|
|
2895
|
+
var import_ui7 = require("@payloadcms/ui");
|
|
2896
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
3000
2897
|
var getPropString5 = (props, key, fallback) => {
|
|
3001
2898
|
if (!props || typeof props !== "object") return fallback;
|
|
3002
2899
|
const direct = props[key];
|
|
@@ -3010,10 +2907,11 @@ var getPropString5 = (props, key, fallback) => {
|
|
|
3010
2907
|
};
|
|
3011
2908
|
function AdminStudioMediaView(props) {
|
|
3012
2909
|
const mediaCollectionSlug = getPropString5(props, "mediaCollectionSlug", "media");
|
|
3013
|
-
return /* @__PURE__ */ (0,
|
|
3014
|
-
/* @__PURE__ */ (0,
|
|
3015
|
-
/* @__PURE__ */ (0,
|
|
3016
|
-
/* @__PURE__ */ (0,
|
|
2910
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
2911
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_ui7.SetStepNav, { nav: [{ label: "Media", url: "/admin/media" }] }),
|
|
2912
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("h1", { style: { margin: 0 }, children: "Media" }),
|
|
2913
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { style: { color: "var(--theme-elevation-600)", marginTop: "0.35rem" }, children: "Media management is currently using Payload's library." }),
|
|
2914
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { style: { display: "grid", gap: "0.6rem", marginTop: "1rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
3017
2915
|
"a",
|
|
3018
2916
|
{
|
|
3019
2917
|
href: `/admin/collections/${mediaCollectionSlug}`,
|
|
@@ -3026,8 +2924,8 @@ function AdminStudioMediaView(props) {
|
|
|
3026
2924
|
textDecoration: "none"
|
|
3027
2925
|
},
|
|
3028
2926
|
children: [
|
|
3029
|
-
/* @__PURE__ */ (0,
|
|
3030
|
-
/* @__PURE__ */ (0,
|
|
2927
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { style: { fontWeight: 900 }, children: "Open Media Library" }),
|
|
2928
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { style: { color: "var(--theme-elevation-600)", fontSize: "0.9rem" }, children: [
|
|
3031
2929
|
"/admin/collections/",
|
|
3032
2930
|
mediaCollectionSlug
|
|
3033
2931
|
] })
|
|
@@ -3038,8 +2936,8 @@ function AdminStudioMediaView(props) {
|
|
|
3038
2936
|
}
|
|
3039
2937
|
|
|
3040
2938
|
// src/admin/components/studio/AdminStudioToolsView.tsx
|
|
3041
|
-
var
|
|
3042
|
-
var
|
|
2939
|
+
var import_ui8 = require("@payloadcms/ui");
|
|
2940
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
3043
2941
|
var isAdmin4 = (user) => {
|
|
3044
2942
|
if (!user || typeof user !== "object") return false;
|
|
3045
2943
|
const role = user.role;
|
|
@@ -3057,11 +2955,12 @@ var getPropString6 = (props, key, fallback) => {
|
|
|
3057
2955
|
return fallback;
|
|
3058
2956
|
};
|
|
3059
2957
|
function AdminStudioToolsView(props) {
|
|
3060
|
-
const { user } = (0,
|
|
2958
|
+
const { user } = (0, import_ui8.useAuth)();
|
|
3061
2959
|
if (!isAdmin4(user)) {
|
|
3062
|
-
return /* @__PURE__ */ (0,
|
|
3063
|
-
/* @__PURE__ */ (0,
|
|
3064
|
-
/* @__PURE__ */ (0,
|
|
2960
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
2961
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_ui8.SetStepNav, { nav: [{ label: "Admin Tools", url: "/admin/tools" }] }),
|
|
2962
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h1", { style: { margin: 0 }, children: "Admin Tools" }),
|
|
2963
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { style: { color: "var(--theme-elevation-600)" }, children: "You do not have access to this page." })
|
|
3065
2964
|
] });
|
|
3066
2965
|
}
|
|
3067
2966
|
const pagesCollectionSlug = getPropString6(props, "pagesCollectionSlug", "pages");
|
|
@@ -3074,10 +2973,11 @@ function AdminStudioToolsView(props) {
|
|
|
3074
2973
|
{ href: "/admin/globals/footer", label: "Raw Footer Global" },
|
|
3075
2974
|
{ href: "/admin/collections/users", label: "Users / Roles" }
|
|
3076
2975
|
];
|
|
3077
|
-
return /* @__PURE__ */ (0,
|
|
3078
|
-
/* @__PURE__ */ (0,
|
|
3079
|
-
/* @__PURE__ */ (0,
|
|
3080
|
-
/* @__PURE__ */ (0,
|
|
2976
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
2977
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_ui8.SetStepNav, { nav: [{ label: "Admin Tools", url: "/admin/tools" }] }),
|
|
2978
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h1", { style: { margin: 0 }, children: "Admin Tools" }),
|
|
2979
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { style: { color: "var(--theme-elevation-600)", marginTop: "0.35rem" }, children: "Hidden fallback links for administrators." }),
|
|
2980
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { display: "grid", gap: "0.6rem", marginTop: "1rem" }, children: links.map((link) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3081
2981
|
"a",
|
|
3082
2982
|
{
|
|
3083
2983
|
href: link.href,
|
|
@@ -3090,8 +2990,8 @@ function AdminStudioToolsView(props) {
|
|
|
3090
2990
|
textDecoration: "none"
|
|
3091
2991
|
},
|
|
3092
2992
|
children: [
|
|
3093
|
-
/* @__PURE__ */ (0,
|
|
3094
|
-
/* @__PURE__ */ (0,
|
|
2993
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { fontWeight: 900 }, children: link.label }),
|
|
2994
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { color: "var(--theme-elevation-600)", fontSize: "0.9rem" }, children: link.href })
|
|
3095
2995
|
]
|
|
3096
2996
|
},
|
|
3097
2997
|
link.href
|
|
@@ -3100,15 +3000,15 @@ function AdminStudioToolsView(props) {
|
|
|
3100
3000
|
}
|
|
3101
3001
|
|
|
3102
3002
|
// src/admin/components/studio/OpenInStudioMenuItem.tsx
|
|
3103
|
-
var
|
|
3104
|
-
var
|
|
3003
|
+
var import_ui9 = require("@payloadcms/ui");
|
|
3004
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
3105
3005
|
function OpenInStudioMenuItem({ pagesPathBase = "/admin/pages" }) {
|
|
3106
|
-
const documentInfo = (0,
|
|
3006
|
+
const documentInfo = (0, import_ui9.useDocumentInfo)();
|
|
3107
3007
|
const id = documentInfo?.id;
|
|
3108
3008
|
if (!id) {
|
|
3109
3009
|
return null;
|
|
3110
3010
|
}
|
|
3111
|
-
return /* @__PURE__ */ (0,
|
|
3011
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3112
3012
|
"a",
|
|
3113
3013
|
{
|
|
3114
3014
|
href: `${pagesPathBase}/${id}`,
|
|
@@ -3127,19 +3027,19 @@ function OpenInStudioMenuItem({ pagesPathBase = "/admin/pages" }) {
|
|
|
3127
3027
|
}
|
|
3128
3028
|
|
|
3129
3029
|
// src/admin/components/studio/PageEditRedirectToStudio.tsx
|
|
3130
|
-
var
|
|
3131
|
-
var
|
|
3132
|
-
var
|
|
3030
|
+
var import_react14 = require("react");
|
|
3031
|
+
var import_ui10 = require("@payloadcms/ui");
|
|
3032
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
3133
3033
|
function PageEditRedirectToStudio({ pagesPathBase = "/admin/pages" }) {
|
|
3134
|
-
const documentInfo = (0,
|
|
3034
|
+
const documentInfo = (0, import_ui10.useDocumentInfo)();
|
|
3135
3035
|
const id = documentInfo?.id;
|
|
3136
|
-
(0,
|
|
3036
|
+
(0, import_react14.useEffect)(() => {
|
|
3137
3037
|
if (!id) {
|
|
3138
3038
|
return;
|
|
3139
3039
|
}
|
|
3140
3040
|
window.location.replace(`${pagesPathBase}/${id}`);
|
|
3141
3041
|
}, [id, pagesPathBase]);
|
|
3142
|
-
return /* @__PURE__ */ (0,
|
|
3042
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
3143
3043
|
"div",
|
|
3144
3044
|
{
|
|
3145
3045
|
style: {
|
|
@@ -3151,19 +3051,19 @@ function PageEditRedirectToStudio({ pagesPathBase = "/admin/pages" }) {
|
|
|
3151
3051
|
minHeight: "50vh"
|
|
3152
3052
|
},
|
|
3153
3053
|
children: [
|
|
3154
|
-
/* @__PURE__ */ (0,
|
|
3155
|
-
/* @__PURE__ */ (0,
|
|
3156
|
-
id ? /* @__PURE__ */ (0,
|
|
3054
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h2", { style: { margin: 0 }, children: "Opening Editor..." }),
|
|
3055
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { style: { color: "var(--theme-elevation-600)", margin: 0 }, children: "Redirecting to the custom page editor." }),
|
|
3056
|
+
id ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("a", { href: `${pagesPathBase}/${id}`, children: "Continue to Editor" }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("a", { href: pagesPathBase, children: "Open Pages" })
|
|
3157
3057
|
]
|
|
3158
3058
|
}
|
|
3159
3059
|
);
|
|
3160
3060
|
}
|
|
3161
3061
|
|
|
3162
3062
|
// src/admin/components/studio/StudioBackBreadcrumb.tsx
|
|
3163
|
-
var
|
|
3063
|
+
var import_ui11 = require("@payloadcms/ui");
|
|
3164
3064
|
var import_navigation = require("next/navigation");
|
|
3165
|
-
var
|
|
3166
|
-
var
|
|
3065
|
+
var import_react15 = require("react");
|
|
3066
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
3167
3067
|
var resolveSectionLink = (pathname) => {
|
|
3168
3068
|
if (pathname.includes("/globals/")) {
|
|
3169
3069
|
return { href: "/admin/studio-globals", label: "Globals" };
|
|
@@ -3181,9 +3081,9 @@ var resolveSectionLink = (pathname) => {
|
|
|
3181
3081
|
};
|
|
3182
3082
|
function StudioBackBreadcrumb() {
|
|
3183
3083
|
const pathname = (0, import_navigation.usePathname)();
|
|
3184
|
-
const { stepNav } = (0,
|
|
3084
|
+
const { stepNav } = (0, import_ui11.useStepNav)();
|
|
3185
3085
|
const section = resolveSectionLink(pathname);
|
|
3186
|
-
const mergedNav = (0,
|
|
3086
|
+
const mergedNav = (0, import_react15.useMemo)(() => {
|
|
3187
3087
|
if (!section) return stepNav;
|
|
3188
3088
|
const rest = stepNav.filter((item) => {
|
|
3189
3089
|
return !(typeof item.label === "string" && item.label.toLowerCase() === section.label.toLowerCase());
|
|
@@ -3191,24 +3091,7 @@ function StudioBackBreadcrumb() {
|
|
|
3191
3091
|
return [{ label: section.label, url: section.href }, ...rest];
|
|
3192
3092
|
}, [section, stepNav]);
|
|
3193
3093
|
if (!section) return null;
|
|
3194
|
-
return /* @__PURE__ */ (0,
|
|
3195
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_ui9.SetStepNav, { nav: mergedNav }),
|
|
3196
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { style: { marginBottom: "0.75rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
3197
|
-
"a",
|
|
3198
|
-
{
|
|
3199
|
-
href: section.href,
|
|
3200
|
-
style: {
|
|
3201
|
-
color: "var(--theme-elevation-700)",
|
|
3202
|
-
fontSize: "0.9rem",
|
|
3203
|
-
textDecoration: "none"
|
|
3204
|
-
},
|
|
3205
|
-
children: [
|
|
3206
|
-
"Back to ",
|
|
3207
|
-
section.label
|
|
3208
|
-
]
|
|
3209
|
-
}
|
|
3210
|
-
) })
|
|
3211
|
-
] });
|
|
3094
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_ui11.SetStepNav, { nav: mergedNav });
|
|
3212
3095
|
}
|
|
3213
3096
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3214
3097
|
0 && (module.exports = {
|
package/dist/admin/client.mjs
CHANGED
|
@@ -161,25 +161,31 @@ function Icon({ brandName = "Orion Studio", logoUrl } = {}) {
|
|
|
161
161
|
{
|
|
162
162
|
style: {
|
|
163
163
|
alignItems: "center",
|
|
164
|
-
borderRadius:
|
|
164
|
+
borderRadius: 6,
|
|
165
165
|
display: "flex",
|
|
166
|
-
height:
|
|
166
|
+
height: "100%",
|
|
167
167
|
justifyContent: "center",
|
|
168
168
|
overflow: "hidden",
|
|
169
|
-
width:
|
|
169
|
+
width: "100%"
|
|
170
170
|
},
|
|
171
171
|
children: /* @__PURE__ */ jsx2(
|
|
172
172
|
"img",
|
|
173
173
|
{
|
|
174
174
|
alt: "Site logo",
|
|
175
175
|
src: resolvedLogo,
|
|
176
|
-
style: {
|
|
176
|
+
style: {
|
|
177
|
+
borderRadius: 6,
|
|
178
|
+
height: "100%",
|
|
179
|
+
objectFit: "contain",
|
|
180
|
+
padding: 1,
|
|
181
|
+
width: "100%"
|
|
182
|
+
}
|
|
177
183
|
}
|
|
178
184
|
)
|
|
179
185
|
}
|
|
180
186
|
);
|
|
181
187
|
}
|
|
182
|
-
return /* @__PURE__ */ jsxs2("svg", { fill: "none", height: "
|
|
188
|
+
return /* @__PURE__ */ jsxs2("svg", { fill: "none", height: "100%", viewBox: "0 0 32 32", width: "100%", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
183
189
|
/* @__PURE__ */ jsx2("rect", { fill: "var(--admin-accent, #3b82f6)", height: "32", rx: "8", width: "32" }),
|
|
184
190
|
/* @__PURE__ */ jsxs2("g", { transform: "translate(4, 4)", children: [
|
|
185
191
|
/* @__PURE__ */ jsx2(
|
|
@@ -1282,122 +1288,9 @@ function AdminStudioNav(props) {
|
|
|
1282
1288
|
}
|
|
1283
1289
|
|
|
1284
1290
|
// src/admin/components/studio/AdminStudioPagesListView.tsx
|
|
1285
|
-
import { useEffect as
|
|
1286
|
-
import { useAuth as useAuth2 } from "@payloadcms/ui";
|
|
1287
|
-
|
|
1288
|
-
// src/admin/components/studio/StudioSectionLayout.tsx
|
|
1289
|
-
import { useEffect as useEffect7, useState as useState6 } from "react";
|
|
1290
|
-
import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1291
|
-
var STORAGE_KEY2 = "orion-studio-sidebar-collapsed";
|
|
1292
|
-
var getSectionCrumb = (pathname) => {
|
|
1293
|
-
if (pathname.startsWith("/admin/pages") || pathname.includes("/collections/pages")) {
|
|
1294
|
-
return { href: "/admin/pages", label: "Pages" };
|
|
1295
|
-
}
|
|
1296
|
-
if (pathname.startsWith("/admin/studio-globals") || pathname.includes("/globals/")) {
|
|
1297
|
-
return { href: "/admin/studio-globals", label: "Globals" };
|
|
1298
|
-
}
|
|
1299
|
-
if (pathname.startsWith("/admin/media") || pathname.includes("/collections/media")) {
|
|
1300
|
-
return { href: "/admin/media", label: "Media" };
|
|
1301
|
-
}
|
|
1302
|
-
if (pathname.startsWith("/admin/tools")) {
|
|
1303
|
-
return { href: "/admin/tools", label: "Admin Tools" };
|
|
1304
|
-
}
|
|
1305
|
-
return null;
|
|
1306
|
-
};
|
|
1307
|
-
function StudioSectionLayout({ children, navProps }) {
|
|
1308
|
-
const [collapsed, setCollapsed] = useState6(false);
|
|
1309
|
-
const [pathname, setPathname] = useState6("");
|
|
1310
|
-
useEffect7(() => {
|
|
1311
|
-
try {
|
|
1312
|
-
const stored = window.localStorage.getItem(STORAGE_KEY2);
|
|
1313
|
-
if (stored === "1") setCollapsed(true);
|
|
1314
|
-
} catch {
|
|
1315
|
-
}
|
|
1316
|
-
const update = () => setPathname(window.location.pathname);
|
|
1317
|
-
update();
|
|
1318
|
-
window.addEventListener("popstate", update);
|
|
1319
|
-
return () => window.removeEventListener("popstate", update);
|
|
1320
|
-
}, []);
|
|
1321
|
-
const toggle = () => {
|
|
1322
|
-
setCollapsed((prev) => {
|
|
1323
|
-
const next = !prev;
|
|
1324
|
-
try {
|
|
1325
|
-
window.localStorage.setItem(STORAGE_KEY2, next ? "1" : "0");
|
|
1326
|
-
} catch {
|
|
1327
|
-
}
|
|
1328
|
-
return next;
|
|
1329
|
-
});
|
|
1330
|
-
};
|
|
1331
|
-
const crumb = getSectionCrumb(pathname);
|
|
1332
|
-
return /* @__PURE__ */ jsxs11(
|
|
1333
|
-
"div",
|
|
1334
|
-
{
|
|
1335
|
-
style: {
|
|
1336
|
-
background: "var(--theme-elevation-0)",
|
|
1337
|
-
display: "grid",
|
|
1338
|
-
gridTemplateColumns: collapsed ? "84px minmax(0, 1fr)" : "260px minmax(0, 1fr)",
|
|
1339
|
-
minHeight: "100vh"
|
|
1340
|
-
},
|
|
1341
|
-
children: [
|
|
1342
|
-
/* @__PURE__ */ jsxs11(
|
|
1343
|
-
"aside",
|
|
1344
|
-
{
|
|
1345
|
-
className: "orion-studio-sidebar",
|
|
1346
|
-
style: {
|
|
1347
|
-
borderRight: "1px solid var(--theme-elevation-150)",
|
|
1348
|
-
height: "100vh",
|
|
1349
|
-
overflow: "visible",
|
|
1350
|
-
position: "sticky",
|
|
1351
|
-
top: 0,
|
|
1352
|
-
zIndex: 2
|
|
1353
|
-
},
|
|
1354
|
-
children: [
|
|
1355
|
-
/* @__PURE__ */ jsx12(
|
|
1356
|
-
"button",
|
|
1357
|
-
{
|
|
1358
|
-
"aria-label": collapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
1359
|
-
onClick: toggle,
|
|
1360
|
-
style: {
|
|
1361
|
-
alignItems: "center",
|
|
1362
|
-
background: "var(--theme-elevation-0)",
|
|
1363
|
-
border: "1px solid var(--theme-elevation-200)",
|
|
1364
|
-
borderRadius: 8,
|
|
1365
|
-
cursor: "pointer",
|
|
1366
|
-
display: "flex",
|
|
1367
|
-
height: 30,
|
|
1368
|
-
justifyContent: "center",
|
|
1369
|
-
position: "absolute",
|
|
1370
|
-
right: -15,
|
|
1371
|
-
top: 10,
|
|
1372
|
-
width: 30,
|
|
1373
|
-
zIndex: 5
|
|
1374
|
-
},
|
|
1375
|
-
type: "button",
|
|
1376
|
-
children: collapsed ? ">" : "<"
|
|
1377
|
-
}
|
|
1378
|
-
),
|
|
1379
|
-
/* @__PURE__ */ jsx12("div", { style: { height: "100%", overflowY: "auto" }, children: /* @__PURE__ */ jsx12(AdminStudioNav, { ...navProps, compact: collapsed }) })
|
|
1380
|
-
]
|
|
1381
|
-
}
|
|
1382
|
-
),
|
|
1383
|
-
/* @__PURE__ */ jsxs11("main", { style: { minWidth: 0, padding: "1.2rem 1.2rem 2.5rem" }, children: [
|
|
1384
|
-
crumb ? /* @__PURE__ */ jsx12("div", { style: { alignItems: "center", display: "flex", gap: "0.35rem", marginBottom: "0.7rem" }, children: /* @__PURE__ */ jsx12(
|
|
1385
|
-
"a",
|
|
1386
|
-
{
|
|
1387
|
-
href: crumb.href,
|
|
1388
|
-
style: { color: "var(--theme-elevation-700)", fontSize: "0.9rem", textDecoration: "none" },
|
|
1389
|
-
children: crumb.label
|
|
1390
|
-
}
|
|
1391
|
-
) }) : null,
|
|
1392
|
-
children
|
|
1393
|
-
] })
|
|
1394
|
-
]
|
|
1395
|
-
}
|
|
1396
|
-
);
|
|
1397
|
-
}
|
|
1398
|
-
|
|
1399
|
-
// src/admin/components/studio/AdminStudioPagesListView.tsx
|
|
1400
|
-
import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1291
|
+
import { useEffect as useEffect7, useMemo as useMemo2, useState as useState6 } from "react";
|
|
1292
|
+
import { SetStepNav, useAuth as useAuth2 } from "@payloadcms/ui";
|
|
1293
|
+
import { Fragment as Fragment3, jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1401
1294
|
var isAdmin2 = (user) => {
|
|
1402
1295
|
if (!user || typeof user !== "object") return false;
|
|
1403
1296
|
const role = user.role;
|
|
@@ -1417,9 +1310,9 @@ var getPropString2 = (props, key, fallback) => {
|
|
|
1417
1310
|
function AdminStudioPagesListView(props) {
|
|
1418
1311
|
const { user } = useAuth2();
|
|
1419
1312
|
const pagesCollectionSlug = getPropString2(props, "pagesCollectionSlug", "pages");
|
|
1420
|
-
const [loading, setLoading] =
|
|
1421
|
-
const [error, setError] =
|
|
1422
|
-
const [docs, setDocs] =
|
|
1313
|
+
const [loading, setLoading] = useState6(true);
|
|
1314
|
+
const [error, setError] = useState6(null);
|
|
1315
|
+
const [docs, setDocs] = useState6([]);
|
|
1423
1316
|
const apiURL = useMemo2(() => {
|
|
1424
1317
|
const params = new URLSearchParams({
|
|
1425
1318
|
depth: "0",
|
|
@@ -1429,7 +1322,7 @@ function AdminStudioPagesListView(props) {
|
|
|
1429
1322
|
});
|
|
1430
1323
|
return `/api/${pagesCollectionSlug}?${params.toString()}`;
|
|
1431
1324
|
}, [pagesCollectionSlug]);
|
|
1432
|
-
|
|
1325
|
+
useEffect7(() => {
|
|
1433
1326
|
let cancelled = false;
|
|
1434
1327
|
const run = async () => {
|
|
1435
1328
|
setLoading(true);
|
|
@@ -1454,13 +1347,14 @@ function AdminStudioPagesListView(props) {
|
|
|
1454
1347
|
cancelled = true;
|
|
1455
1348
|
};
|
|
1456
1349
|
}, [apiURL]);
|
|
1457
|
-
return /* @__PURE__ */
|
|
1458
|
-
/* @__PURE__ */
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
/* @__PURE__ */
|
|
1350
|
+
return /* @__PURE__ */ jsxs11(Fragment3, { children: [
|
|
1351
|
+
/* @__PURE__ */ jsx12(SetStepNav, { nav: [{ label: "Pages", url: "/admin/pages" }] }),
|
|
1352
|
+
/* @__PURE__ */ jsxs11("div", { style: { alignItems: "flex-end", display: "flex", gap: "0.75rem" }, children: [
|
|
1353
|
+
/* @__PURE__ */ jsxs11("div", { style: { flex: 1 }, children: [
|
|
1354
|
+
/* @__PURE__ */ jsx12("h1", { style: { margin: 0 }, children: "Pages" }),
|
|
1355
|
+
/* @__PURE__ */ jsx12("p", { style: { color: "var(--theme-elevation-600)", marginTop: "0.35rem" }, children: "Open a page to edit it in the custom editor." })
|
|
1462
1356
|
] }),
|
|
1463
|
-
isAdmin2(user) ? /* @__PURE__ */
|
|
1357
|
+
isAdmin2(user) ? /* @__PURE__ */ jsx12(
|
|
1464
1358
|
"a",
|
|
1465
1359
|
{
|
|
1466
1360
|
href: `/admin/collections/${pagesCollectionSlug}/create`,
|
|
@@ -1476,10 +1370,10 @@ function AdminStudioPagesListView(props) {
|
|
|
1476
1370
|
}
|
|
1477
1371
|
) : null
|
|
1478
1372
|
] }),
|
|
1479
|
-
loading ? /* @__PURE__ */
|
|
1480
|
-
error ? /* @__PURE__ */
|
|
1481
|
-
/* @__PURE__ */
|
|
1482
|
-
!loading && !error && docs.length === 0 ? /* @__PURE__ */
|
|
1373
|
+
loading ? /* @__PURE__ */ jsx12("div", { style: { color: "var(--theme-elevation-600)", marginTop: "1rem" }, children: "Loading..." }) : null,
|
|
1374
|
+
error ? /* @__PURE__ */ jsx12("div", { style: { color: "crimson", marginTop: "1rem" }, children: error }) : null,
|
|
1375
|
+
/* @__PURE__ */ jsxs11("div", { style: { display: "grid", gap: "0.6rem", marginTop: "1rem" }, children: [
|
|
1376
|
+
!loading && !error && docs.length === 0 ? /* @__PURE__ */ jsx12(
|
|
1483
1377
|
"div",
|
|
1484
1378
|
{
|
|
1485
1379
|
style: {
|
|
@@ -1497,7 +1391,7 @@ function AdminStudioPagesListView(props) {
|
|
|
1497
1391
|
const path = typeof doc.path === "string" ? doc.path : "/";
|
|
1498
1392
|
const status = typeof doc._status === "string" ? doc._status : "";
|
|
1499
1393
|
if (!id) return null;
|
|
1500
|
-
return /* @__PURE__ */
|
|
1394
|
+
return /* @__PURE__ */ jsxs11(
|
|
1501
1395
|
"a",
|
|
1502
1396
|
{
|
|
1503
1397
|
href: `/admin/pages/${id}`,
|
|
@@ -1513,9 +1407,9 @@ function AdminStudioPagesListView(props) {
|
|
|
1513
1407
|
textDecoration: "none"
|
|
1514
1408
|
},
|
|
1515
1409
|
children: [
|
|
1516
|
-
/* @__PURE__ */
|
|
1517
|
-
/* @__PURE__ */
|
|
1518
|
-
/* @__PURE__ */
|
|
1410
|
+
/* @__PURE__ */ jsxs11("div", { style: { minWidth: 0 }, children: [
|
|
1411
|
+
/* @__PURE__ */ jsx12("div", { style: { fontWeight: 900, overflow: "hidden", textOverflow: "ellipsis" }, children: title }),
|
|
1412
|
+
/* @__PURE__ */ jsx12(
|
|
1519
1413
|
"div",
|
|
1520
1414
|
{
|
|
1521
1415
|
style: {
|
|
@@ -1528,7 +1422,7 @@ function AdminStudioPagesListView(props) {
|
|
|
1528
1422
|
}
|
|
1529
1423
|
)
|
|
1530
1424
|
] }),
|
|
1531
|
-
/* @__PURE__ */
|
|
1425
|
+
/* @__PURE__ */ jsxs11(
|
|
1532
1426
|
"div",
|
|
1533
1427
|
{
|
|
1534
1428
|
style: {
|
|
@@ -1538,7 +1432,7 @@ function AdminStudioPagesListView(props) {
|
|
|
1538
1432
|
gap: "0.5rem"
|
|
1539
1433
|
},
|
|
1540
1434
|
children: [
|
|
1541
|
-
status ? /* @__PURE__ */
|
|
1435
|
+
status ? /* @__PURE__ */ jsx12(
|
|
1542
1436
|
"span",
|
|
1543
1437
|
{
|
|
1544
1438
|
style: {
|
|
@@ -1553,7 +1447,7 @@ function AdminStudioPagesListView(props) {
|
|
|
1553
1447
|
children: status
|
|
1554
1448
|
}
|
|
1555
1449
|
) : null,
|
|
1556
|
-
/* @__PURE__ */
|
|
1450
|
+
/* @__PURE__ */ jsx12("span", { style: { color: "var(--theme-elevation-600)", fontWeight: 800 }, children: "Open" })
|
|
1557
1451
|
]
|
|
1558
1452
|
}
|
|
1559
1453
|
)
|
|
@@ -1567,9 +1461,9 @@ function AdminStudioPagesListView(props) {
|
|
|
1567
1461
|
}
|
|
1568
1462
|
|
|
1569
1463
|
// src/admin/components/studio/AdminStudioPageEditView.tsx
|
|
1570
|
-
import { useEffect as
|
|
1464
|
+
import { useEffect as useEffect8, useMemo as useMemo3, useRef as useRef3, useState as useState7 } from "react";
|
|
1571
1465
|
import { toast, useAuth as useAuth3 } from "@payloadcms/ui";
|
|
1572
|
-
import { jsx as
|
|
1466
|
+
import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1573
1467
|
var isAdmin3 = (user) => {
|
|
1574
1468
|
if (!user || typeof user !== "object") return false;
|
|
1575
1469
|
const role = user.role;
|
|
@@ -1606,12 +1500,12 @@ var getPageIDFromPathname = (pathname) => {
|
|
|
1606
1500
|
function AdminStudioPageEditView(props) {
|
|
1607
1501
|
const { user } = useAuth3();
|
|
1608
1502
|
const iframeRef = useRef3(null);
|
|
1609
|
-
const [saving, setSaving] =
|
|
1503
|
+
const [saving, setSaving] = useState7(null);
|
|
1610
1504
|
const builderBasePath = getPropString3(props, "builderBasePath", "/builder");
|
|
1611
1505
|
const pageIDFromParams = useMemo3(() => getParam(props.params, "id"), [props.params]);
|
|
1612
|
-
const [pageID, setPageID] =
|
|
1613
|
-
const [didResolvePathFallback, setDidResolvePathFallback] =
|
|
1614
|
-
|
|
1506
|
+
const [pageID, setPageID] = useState7(pageIDFromParams);
|
|
1507
|
+
const [didResolvePathFallback, setDidResolvePathFallback] = useState7(false);
|
|
1508
|
+
useEffect8(() => {
|
|
1615
1509
|
if (pageIDFromParams) {
|
|
1616
1510
|
setPageID(pageIDFromParams);
|
|
1617
1511
|
setDidResolvePathFallback(true);
|
|
@@ -1632,7 +1526,7 @@ function AdminStudioPageEditView(props) {
|
|
|
1632
1526
|
setSaving(status);
|
|
1633
1527
|
iframe.contentWindow.postMessage({ source: "payload-visual-builder-parent", type: "save", status }, "*");
|
|
1634
1528
|
};
|
|
1635
|
-
|
|
1529
|
+
useEffect8(() => {
|
|
1636
1530
|
const onMessage = (event) => {
|
|
1637
1531
|
const data = event.data;
|
|
1638
1532
|
if (!data || data.source !== "payload-visual-builder-child" || data.type !== "save-result") {
|
|
@@ -1649,19 +1543,19 @@ function AdminStudioPageEditView(props) {
|
|
|
1649
1543
|
return () => window.removeEventListener("message", onMessage);
|
|
1650
1544
|
}, []);
|
|
1651
1545
|
if (!pageID && !didResolvePathFallback) {
|
|
1652
|
-
return /* @__PURE__ */
|
|
1653
|
-
/* @__PURE__ */
|
|
1654
|
-
/* @__PURE__ */
|
|
1546
|
+
return /* @__PURE__ */ jsxs12("div", { style: { padding: "1.2rem" }, children: [
|
|
1547
|
+
/* @__PURE__ */ jsx13("h1", { style: { margin: 0 }, children: "Page Editor" }),
|
|
1548
|
+
/* @__PURE__ */ jsx13("p", { style: { color: "var(--theme-elevation-600)" }, children: "Loading page editor..." })
|
|
1655
1549
|
] });
|
|
1656
1550
|
}
|
|
1657
1551
|
if (!pageID) {
|
|
1658
|
-
return /* @__PURE__ */
|
|
1659
|
-
/* @__PURE__ */
|
|
1660
|
-
/* @__PURE__ */
|
|
1552
|
+
return /* @__PURE__ */ jsxs12("div", { style: { padding: "1.2rem" }, children: [
|
|
1553
|
+
/* @__PURE__ */ jsx13("h1", { style: { margin: 0 }, children: "Page Editor" }),
|
|
1554
|
+
/* @__PURE__ */ jsx13("p", { style: { color: "var(--theme-elevation-600)" }, children: "Missing page ID." })
|
|
1661
1555
|
] });
|
|
1662
1556
|
}
|
|
1663
|
-
return /* @__PURE__ */
|
|
1664
|
-
/* @__PURE__ */
|
|
1557
|
+
return /* @__PURE__ */ jsxs12("div", { style: { display: "grid", gridTemplateRows: "auto 1fr", height: "calc(100vh - 0px)" }, children: [
|
|
1558
|
+
/* @__PURE__ */ jsxs12(
|
|
1665
1559
|
"div",
|
|
1666
1560
|
{
|
|
1667
1561
|
style: {
|
|
@@ -1677,9 +1571,9 @@ function AdminStudioPageEditView(props) {
|
|
|
1677
1571
|
zIndex: 20
|
|
1678
1572
|
},
|
|
1679
1573
|
children: [
|
|
1680
|
-
/* @__PURE__ */
|
|
1681
|
-
/* @__PURE__ */
|
|
1682
|
-
/* @__PURE__ */
|
|
1574
|
+
/* @__PURE__ */ jsxs12("div", { style: { minWidth: 0 }, children: [
|
|
1575
|
+
/* @__PURE__ */ jsx13("div", { style: { fontWeight: 900 }, children: "Page Editor" }),
|
|
1576
|
+
/* @__PURE__ */ jsxs12(
|
|
1683
1577
|
"div",
|
|
1684
1578
|
{
|
|
1685
1579
|
style: {
|
|
@@ -1695,8 +1589,8 @@ function AdminStudioPageEditView(props) {
|
|
|
1695
1589
|
}
|
|
1696
1590
|
)
|
|
1697
1591
|
] }),
|
|
1698
|
-
/* @__PURE__ */
|
|
1699
|
-
/* @__PURE__ */
|
|
1592
|
+
/* @__PURE__ */ jsxs12("div", { style: { alignItems: "center", display: "flex", gap: "0.5rem" }, children: [
|
|
1593
|
+
/* @__PURE__ */ jsx13(
|
|
1700
1594
|
"button",
|
|
1701
1595
|
{
|
|
1702
1596
|
disabled: saving !== null,
|
|
@@ -1712,7 +1606,7 @@ function AdminStudioPageEditView(props) {
|
|
|
1712
1606
|
children: saving === "draft" ? "Saving\u2026" : "Save Draft"
|
|
1713
1607
|
}
|
|
1714
1608
|
),
|
|
1715
|
-
/* @__PURE__ */
|
|
1609
|
+
/* @__PURE__ */ jsx13(
|
|
1716
1610
|
"button",
|
|
1717
1611
|
{
|
|
1718
1612
|
disabled: !canPublish || saving !== null,
|
|
@@ -1735,7 +1629,7 @@ function AdminStudioPageEditView(props) {
|
|
|
1735
1629
|
]
|
|
1736
1630
|
}
|
|
1737
1631
|
),
|
|
1738
|
-
/* @__PURE__ */
|
|
1632
|
+
/* @__PURE__ */ jsx13(
|
|
1739
1633
|
"iframe",
|
|
1740
1634
|
{
|
|
1741
1635
|
ref: iframeRef,
|
|
@@ -1748,7 +1642,8 @@ function AdminStudioPageEditView(props) {
|
|
|
1748
1642
|
}
|
|
1749
1643
|
|
|
1750
1644
|
// src/admin/components/studio/AdminStudioGlobalsView.tsx
|
|
1751
|
-
import {
|
|
1645
|
+
import { SetStepNav as SetStepNav2 } from "@payloadcms/ui";
|
|
1646
|
+
import { Fragment as Fragment4, jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1752
1647
|
var getPropGlobals = (props) => {
|
|
1753
1648
|
if (!props || typeof props !== "object") return null;
|
|
1754
1649
|
const direct = props.globals;
|
|
@@ -1778,10 +1673,11 @@ function AdminStudioGlobalsView(props) {
|
|
|
1778
1673
|
{ slug: "header", label: "Header & Navigation" },
|
|
1779
1674
|
{ slug: "footer", label: "Footer" }
|
|
1780
1675
|
];
|
|
1781
|
-
return /* @__PURE__ */
|
|
1782
|
-
/* @__PURE__ */
|
|
1783
|
-
/* @__PURE__ */
|
|
1784
|
-
/* @__PURE__ */
|
|
1676
|
+
return /* @__PURE__ */ jsxs13(Fragment4, { children: [
|
|
1677
|
+
/* @__PURE__ */ jsx14(SetStepNav2, { nav: [{ label: "Globals", url: globalsBasePath }] }),
|
|
1678
|
+
/* @__PURE__ */ jsx14("h1", { style: { margin: 0 }, children: "Globals" }),
|
|
1679
|
+
/* @__PURE__ */ jsx14("p", { style: { color: "var(--theme-elevation-600)", marginTop: "0.35rem" }, children: "Site-wide settings." }),
|
|
1680
|
+
/* @__PURE__ */ jsx14("div", { style: { display: "grid", gap: "0.6rem", marginTop: "1rem" }, children: globals.map((global) => /* @__PURE__ */ jsxs13(
|
|
1785
1681
|
"a",
|
|
1786
1682
|
{
|
|
1787
1683
|
href: `/admin/globals/${global.slug}`,
|
|
@@ -1794,8 +1690,8 @@ function AdminStudioGlobalsView(props) {
|
|
|
1794
1690
|
textDecoration: "none"
|
|
1795
1691
|
},
|
|
1796
1692
|
children: [
|
|
1797
|
-
/* @__PURE__ */
|
|
1798
|
-
/* @__PURE__ */
|
|
1693
|
+
/* @__PURE__ */ jsx14("div", { style: { fontWeight: 900 }, children: global.label }),
|
|
1694
|
+
/* @__PURE__ */ jsxs13("div", { style: { color: "var(--theme-elevation-600)", fontSize: "0.9rem" }, children: [
|
|
1799
1695
|
"/admin/globals/",
|
|
1800
1696
|
global.slug
|
|
1801
1697
|
] })
|
|
@@ -1803,7 +1699,7 @@ function AdminStudioGlobalsView(props) {
|
|
|
1803
1699
|
},
|
|
1804
1700
|
global.slug
|
|
1805
1701
|
)) }),
|
|
1806
|
-
/* @__PURE__ */
|
|
1702
|
+
/* @__PURE__ */ jsx14("div", { style: { marginTop: "1rem" }, children: /* @__PURE__ */ jsx14(
|
|
1807
1703
|
"a",
|
|
1808
1704
|
{
|
|
1809
1705
|
href: globalsBasePath,
|
|
@@ -1815,7 +1711,8 @@ function AdminStudioGlobalsView(props) {
|
|
|
1815
1711
|
}
|
|
1816
1712
|
|
|
1817
1713
|
// src/admin/components/studio/AdminStudioMediaView.tsx
|
|
1818
|
-
import {
|
|
1714
|
+
import { SetStepNav as SetStepNav3 } from "@payloadcms/ui";
|
|
1715
|
+
import { Fragment as Fragment5, jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1819
1716
|
var getPropString5 = (props, key, fallback) => {
|
|
1820
1717
|
if (!props || typeof props !== "object") return fallback;
|
|
1821
1718
|
const direct = props[key];
|
|
@@ -1829,10 +1726,11 @@ var getPropString5 = (props, key, fallback) => {
|
|
|
1829
1726
|
};
|
|
1830
1727
|
function AdminStudioMediaView(props) {
|
|
1831
1728
|
const mediaCollectionSlug = getPropString5(props, "mediaCollectionSlug", "media");
|
|
1832
|
-
return /* @__PURE__ */
|
|
1833
|
-
/* @__PURE__ */
|
|
1834
|
-
/* @__PURE__ */
|
|
1835
|
-
/* @__PURE__ */
|
|
1729
|
+
return /* @__PURE__ */ jsxs14(Fragment5, { children: [
|
|
1730
|
+
/* @__PURE__ */ jsx15(SetStepNav3, { nav: [{ label: "Media", url: "/admin/media" }] }),
|
|
1731
|
+
/* @__PURE__ */ jsx15("h1", { style: { margin: 0 }, children: "Media" }),
|
|
1732
|
+
/* @__PURE__ */ jsx15("p", { style: { color: "var(--theme-elevation-600)", marginTop: "0.35rem" }, children: "Media management is currently using Payload's library." }),
|
|
1733
|
+
/* @__PURE__ */ jsx15("div", { style: { display: "grid", gap: "0.6rem", marginTop: "1rem" }, children: /* @__PURE__ */ jsxs14(
|
|
1836
1734
|
"a",
|
|
1837
1735
|
{
|
|
1838
1736
|
href: `/admin/collections/${mediaCollectionSlug}`,
|
|
@@ -1845,8 +1743,8 @@ function AdminStudioMediaView(props) {
|
|
|
1845
1743
|
textDecoration: "none"
|
|
1846
1744
|
},
|
|
1847
1745
|
children: [
|
|
1848
|
-
/* @__PURE__ */
|
|
1849
|
-
/* @__PURE__ */
|
|
1746
|
+
/* @__PURE__ */ jsx15("div", { style: { fontWeight: 900 }, children: "Open Media Library" }),
|
|
1747
|
+
/* @__PURE__ */ jsxs14("div", { style: { color: "var(--theme-elevation-600)", fontSize: "0.9rem" }, children: [
|
|
1850
1748
|
"/admin/collections/",
|
|
1851
1749
|
mediaCollectionSlug
|
|
1852
1750
|
] })
|
|
@@ -1857,8 +1755,8 @@ function AdminStudioMediaView(props) {
|
|
|
1857
1755
|
}
|
|
1858
1756
|
|
|
1859
1757
|
// src/admin/components/studio/AdminStudioToolsView.tsx
|
|
1860
|
-
import { useAuth as useAuth4 } from "@payloadcms/ui";
|
|
1861
|
-
import { jsx as
|
|
1758
|
+
import { SetStepNav as SetStepNav4, useAuth as useAuth4 } from "@payloadcms/ui";
|
|
1759
|
+
import { Fragment as Fragment6, jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1862
1760
|
var isAdmin4 = (user) => {
|
|
1863
1761
|
if (!user || typeof user !== "object") return false;
|
|
1864
1762
|
const role = user.role;
|
|
@@ -1878,9 +1776,10 @@ var getPropString6 = (props, key, fallback) => {
|
|
|
1878
1776
|
function AdminStudioToolsView(props) {
|
|
1879
1777
|
const { user } = useAuth4();
|
|
1880
1778
|
if (!isAdmin4(user)) {
|
|
1881
|
-
return /* @__PURE__ */
|
|
1882
|
-
/* @__PURE__ */
|
|
1883
|
-
/* @__PURE__ */
|
|
1779
|
+
return /* @__PURE__ */ jsxs15(Fragment6, { children: [
|
|
1780
|
+
/* @__PURE__ */ jsx16(SetStepNav4, { nav: [{ label: "Admin Tools", url: "/admin/tools" }] }),
|
|
1781
|
+
/* @__PURE__ */ jsx16("h1", { style: { margin: 0 }, children: "Admin Tools" }),
|
|
1782
|
+
/* @__PURE__ */ jsx16("p", { style: { color: "var(--theme-elevation-600)" }, children: "You do not have access to this page." })
|
|
1884
1783
|
] });
|
|
1885
1784
|
}
|
|
1886
1785
|
const pagesCollectionSlug = getPropString6(props, "pagesCollectionSlug", "pages");
|
|
@@ -1893,10 +1792,11 @@ function AdminStudioToolsView(props) {
|
|
|
1893
1792
|
{ href: "/admin/globals/footer", label: "Raw Footer Global" },
|
|
1894
1793
|
{ href: "/admin/collections/users", label: "Users / Roles" }
|
|
1895
1794
|
];
|
|
1896
|
-
return /* @__PURE__ */
|
|
1897
|
-
/* @__PURE__ */
|
|
1898
|
-
/* @__PURE__ */
|
|
1899
|
-
/* @__PURE__ */
|
|
1795
|
+
return /* @__PURE__ */ jsxs15(Fragment6, { children: [
|
|
1796
|
+
/* @__PURE__ */ jsx16(SetStepNav4, { nav: [{ label: "Admin Tools", url: "/admin/tools" }] }),
|
|
1797
|
+
/* @__PURE__ */ jsx16("h1", { style: { margin: 0 }, children: "Admin Tools" }),
|
|
1798
|
+
/* @__PURE__ */ jsx16("p", { style: { color: "var(--theme-elevation-600)", marginTop: "0.35rem" }, children: "Hidden fallback links for administrators." }),
|
|
1799
|
+
/* @__PURE__ */ jsx16("div", { style: { display: "grid", gap: "0.6rem", marginTop: "1rem" }, children: links.map((link) => /* @__PURE__ */ jsxs15(
|
|
1900
1800
|
"a",
|
|
1901
1801
|
{
|
|
1902
1802
|
href: link.href,
|
|
@@ -1909,8 +1809,8 @@ function AdminStudioToolsView(props) {
|
|
|
1909
1809
|
textDecoration: "none"
|
|
1910
1810
|
},
|
|
1911
1811
|
children: [
|
|
1912
|
-
/* @__PURE__ */
|
|
1913
|
-
/* @__PURE__ */
|
|
1812
|
+
/* @__PURE__ */ jsx16("div", { style: { fontWeight: 900 }, children: link.label }),
|
|
1813
|
+
/* @__PURE__ */ jsx16("div", { style: { color: "var(--theme-elevation-600)", fontSize: "0.9rem" }, children: link.href })
|
|
1914
1814
|
]
|
|
1915
1815
|
},
|
|
1916
1816
|
link.href
|
|
@@ -1920,14 +1820,14 @@ function AdminStudioToolsView(props) {
|
|
|
1920
1820
|
|
|
1921
1821
|
// src/admin/components/studio/OpenInStudioMenuItem.tsx
|
|
1922
1822
|
import { useDocumentInfo } from "@payloadcms/ui";
|
|
1923
|
-
import { jsx as
|
|
1823
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1924
1824
|
function OpenInStudioMenuItem({ pagesPathBase = "/admin/pages" }) {
|
|
1925
1825
|
const documentInfo = useDocumentInfo();
|
|
1926
1826
|
const id = documentInfo?.id;
|
|
1927
1827
|
if (!id) {
|
|
1928
1828
|
return null;
|
|
1929
1829
|
}
|
|
1930
|
-
return /* @__PURE__ */
|
|
1830
|
+
return /* @__PURE__ */ jsx17(
|
|
1931
1831
|
"a",
|
|
1932
1832
|
{
|
|
1933
1833
|
href: `${pagesPathBase}/${id}`,
|
|
@@ -1946,19 +1846,19 @@ function OpenInStudioMenuItem({ pagesPathBase = "/admin/pages" }) {
|
|
|
1946
1846
|
}
|
|
1947
1847
|
|
|
1948
1848
|
// src/admin/components/studio/PageEditRedirectToStudio.tsx
|
|
1949
|
-
import { useEffect as
|
|
1849
|
+
import { useEffect as useEffect9 } from "react";
|
|
1950
1850
|
import { useDocumentInfo as useDocumentInfo2 } from "@payloadcms/ui";
|
|
1951
|
-
import { jsx as
|
|
1851
|
+
import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1952
1852
|
function PageEditRedirectToStudio({ pagesPathBase = "/admin/pages" }) {
|
|
1953
1853
|
const documentInfo = useDocumentInfo2();
|
|
1954
1854
|
const id = documentInfo?.id;
|
|
1955
|
-
|
|
1855
|
+
useEffect9(() => {
|
|
1956
1856
|
if (!id) {
|
|
1957
1857
|
return;
|
|
1958
1858
|
}
|
|
1959
1859
|
window.location.replace(`${pagesPathBase}/${id}`);
|
|
1960
1860
|
}, [id, pagesPathBase]);
|
|
1961
|
-
return /* @__PURE__ */
|
|
1861
|
+
return /* @__PURE__ */ jsxs16(
|
|
1962
1862
|
"div",
|
|
1963
1863
|
{
|
|
1964
1864
|
style: {
|
|
@@ -1970,19 +1870,19 @@ function PageEditRedirectToStudio({ pagesPathBase = "/admin/pages" }) {
|
|
|
1970
1870
|
minHeight: "50vh"
|
|
1971
1871
|
},
|
|
1972
1872
|
children: [
|
|
1973
|
-
/* @__PURE__ */
|
|
1974
|
-
/* @__PURE__ */
|
|
1975
|
-
id ? /* @__PURE__ */
|
|
1873
|
+
/* @__PURE__ */ jsx18("h2", { style: { margin: 0 }, children: "Opening Editor..." }),
|
|
1874
|
+
/* @__PURE__ */ jsx18("p", { style: { color: "var(--theme-elevation-600)", margin: 0 }, children: "Redirecting to the custom page editor." }),
|
|
1875
|
+
id ? /* @__PURE__ */ jsx18("a", { href: `${pagesPathBase}/${id}`, children: "Continue to Editor" }) : /* @__PURE__ */ jsx18("a", { href: pagesPathBase, children: "Open Pages" })
|
|
1976
1876
|
]
|
|
1977
1877
|
}
|
|
1978
1878
|
);
|
|
1979
1879
|
}
|
|
1980
1880
|
|
|
1981
1881
|
// src/admin/components/studio/StudioBackBreadcrumb.tsx
|
|
1982
|
-
import { SetStepNav, useStepNav } from "@payloadcms/ui";
|
|
1882
|
+
import { SetStepNav as SetStepNav5, useStepNav } from "@payloadcms/ui";
|
|
1983
1883
|
import { usePathname } from "next/navigation";
|
|
1984
1884
|
import { useMemo as useMemo4 } from "react";
|
|
1985
|
-
import {
|
|
1885
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
1986
1886
|
var resolveSectionLink = (pathname) => {
|
|
1987
1887
|
if (pathname.includes("/globals/")) {
|
|
1988
1888
|
return { href: "/admin/studio-globals", label: "Globals" };
|
|
@@ -2010,24 +1910,7 @@ function StudioBackBreadcrumb() {
|
|
|
2010
1910
|
return [{ label: section.label, url: section.href }, ...rest];
|
|
2011
1911
|
}, [section, stepNav]);
|
|
2012
1912
|
if (!section) return null;
|
|
2013
|
-
return /* @__PURE__ */
|
|
2014
|
-
/* @__PURE__ */ jsx20(SetStepNav, { nav: mergedNav }),
|
|
2015
|
-
/* @__PURE__ */ jsx20("div", { style: { marginBottom: "0.75rem" }, children: /* @__PURE__ */ jsxs18(
|
|
2016
|
-
"a",
|
|
2017
|
-
{
|
|
2018
|
-
href: section.href,
|
|
2019
|
-
style: {
|
|
2020
|
-
color: "var(--theme-elevation-700)",
|
|
2021
|
-
fontSize: "0.9rem",
|
|
2022
|
-
textDecoration: "none"
|
|
2023
|
-
},
|
|
2024
|
-
children: [
|
|
2025
|
-
"Back to ",
|
|
2026
|
-
section.label
|
|
2027
|
-
]
|
|
2028
|
-
}
|
|
2029
|
-
) })
|
|
2030
|
-
] });
|
|
1913
|
+
return /* @__PURE__ */ jsx19(SetStepNav5, { nav: mergedNav });
|
|
2031
1914
|
}
|
|
2032
1915
|
export {
|
|
2033
1916
|
AdminStudioDashboard,
|
package/dist/admin.css
CHANGED
|
@@ -336,8 +336,7 @@ html {
|
|
|
336
336
|
}
|
|
337
337
|
|
|
338
338
|
.template-default__nav,
|
|
339
|
-
.nav
|
|
340
|
-
.orion-studio-sidebar {
|
|
339
|
+
.nav {
|
|
341
340
|
background: var(--orion-sidebar-bg) !important;
|
|
342
341
|
}
|
|
343
342
|
|
|
@@ -387,3 +386,11 @@ html {
|
|
|
387
386
|
.admin-studio-brand {
|
|
388
387
|
padding-left: 0 !important;
|
|
389
388
|
}
|
|
389
|
+
|
|
390
|
+
/* Keep breadcrumb root icon/logo fully visible in compact step-nav slot */
|
|
391
|
+
.step-nav__home > span,
|
|
392
|
+
.step-nav__home .graphic-icon,
|
|
393
|
+
.step-nav__home > span > div {
|
|
394
|
+
height: 100%;
|
|
395
|
+
width: 100%;
|
|
396
|
+
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
admin_exports
|
|
3
3
|
} from "./chunk-J6HM2LPT.mjs";
|
|
4
|
-
import {
|
|
5
|
-
studio_exports
|
|
6
|
-
} from "./chunk-WLXZDMK3.mjs";
|
|
7
|
-
import {
|
|
8
|
-
studio_pages_exports
|
|
9
|
-
} from "./chunk-Q76U4Z53.mjs";
|
|
10
4
|
import {
|
|
11
5
|
blocks_exports
|
|
12
6
|
} from "./chunk-L62FYT57.mjs";
|
|
13
7
|
import {
|
|
14
8
|
nextjs_exports
|
|
15
9
|
} from "./chunk-ZLLNO5FM.mjs";
|
|
10
|
+
import {
|
|
11
|
+
studio_pages_exports
|
|
12
|
+
} from "./chunk-Q76U4Z53.mjs";
|
|
13
|
+
import {
|
|
14
|
+
studio_exports
|
|
15
|
+
} from "./chunk-WLXZDMK3.mjs";
|
|
16
16
|
import "./chunk-6BWS3CLP.mjs";
|
|
17
17
|
export {
|
|
18
18
|
admin_exports as admin,
|