@orion-studios/payload-studio 0.3.0-beta.10 → 0.3.0-beta.12
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 +143 -188
- package/dist/admin/client.mjs +141 -186
- package/dist/admin/index.d.mts +1 -1
- package/dist/admin/index.d.ts +1 -1
- package/dist/admin/index.js +9 -79
- package/dist/admin/index.mjs +1 -1
- package/dist/{chunk-J6HM2LPT.mjs → chunk-HNXCUY3A.mjs} +9 -79
- package/dist/{index-vTq0Uy37.d.mts → index--BGNW-lz.d.mts} +3 -65
- package/dist/{index-vTq0Uy37.d.ts → index--BGNW-lz.d.ts} +3 -65
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +9 -79
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/admin/client.js
CHANGED
|
@@ -2286,7 +2286,21 @@ var cardStyle = {
|
|
|
2286
2286
|
padding: "1rem",
|
|
2287
2287
|
textDecoration: "none"
|
|
2288
2288
|
};
|
|
2289
|
-
|
|
2289
|
+
var getPropString = (props, key, fallback) => {
|
|
2290
|
+
if (!props || typeof props !== "object") return fallback;
|
|
2291
|
+
const direct = props[key];
|
|
2292
|
+
if (typeof direct === "string" && direct.length > 0) return direct;
|
|
2293
|
+
const clientProps = props.clientProps;
|
|
2294
|
+
if (clientProps && typeof clientProps === "object") {
|
|
2295
|
+
const nested = clientProps[key];
|
|
2296
|
+
if (typeof nested === "string" && nested.length > 0) return nested;
|
|
2297
|
+
}
|
|
2298
|
+
return fallback;
|
|
2299
|
+
};
|
|
2300
|
+
function AdminStudioDashboard(props) {
|
|
2301
|
+
const pagesCollectionSlug = getPropString(props, "pagesCollectionSlug", "pages");
|
|
2302
|
+
const mediaCollectionSlug = getPropString(props, "mediaCollectionSlug", "media");
|
|
2303
|
+
const globalsBasePath = getPropString(props, "globalsBasePath", "/admin/globals");
|
|
2290
2304
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { padding: "1.2rem 1.2rem 2.5rem" }, children: [
|
|
2291
2305
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_ui3.SetStepNav, { nav: [{ label: "Dashboard", url: "/admin" }] }),
|
|
2292
2306
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h1", { style: { fontSize: "1.6rem", margin: 0 }, children: "Studio" }),
|
|
@@ -2301,15 +2315,15 @@ function AdminStudioDashboard() {
|
|
|
2301
2315
|
marginTop: "1.1rem"
|
|
2302
2316
|
},
|
|
2303
2317
|
children: [
|
|
2304
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("a", { href:
|
|
2318
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("a", { href: `/admin/collections/${pagesCollectionSlug}`, style: cardStyle, children: [
|
|
2305
2319
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { fontWeight: 900 }, children: "Pages" }),
|
|
2306
2320
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { color: "var(--theme-elevation-600)", marginTop: "0.25rem" }, children: "Edit your site pages with the custom editor." })
|
|
2307
2321
|
] }),
|
|
2308
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("a", { href:
|
|
2322
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("a", { href: globalsBasePath, style: cardStyle, children: [
|
|
2309
2323
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { fontWeight: 900 }, children: "Globals" }),
|
|
2310
2324
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { color: "var(--theme-elevation-600)", marginTop: "0.25rem" }, children: "Site settings, header, footer." })
|
|
2311
2325
|
] }),
|
|
2312
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("a", { href:
|
|
2326
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("a", { href: `/admin/collections/${mediaCollectionSlug}`, style: cardStyle, children: [
|
|
2313
2327
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { fontWeight: 900 }, children: "Media" }),
|
|
2314
2328
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { color: "var(--theme-elevation-600)", marginTop: "0.25rem" }, children: "Upload and manage images and files." })
|
|
2315
2329
|
] })
|
|
@@ -2328,7 +2342,7 @@ var isAdmin = (user) => {
|
|
|
2328
2342
|
const role = user.role;
|
|
2329
2343
|
return typeof role === "string" && role === "admin";
|
|
2330
2344
|
};
|
|
2331
|
-
var
|
|
2345
|
+
var getPropString2 = (props, key, fallback) => {
|
|
2332
2346
|
if (!props || typeof props !== "object") return fallback;
|
|
2333
2347
|
const direct = props[key];
|
|
2334
2348
|
if (typeof direct === "string" && direct.length > 0) return direct;
|
|
@@ -2352,9 +2366,11 @@ var getPropBoolean = (props, key, fallback) => {
|
|
|
2352
2366
|
};
|
|
2353
2367
|
function AdminStudioNav(props) {
|
|
2354
2368
|
const { user } = (0, import_ui4.useAuth)();
|
|
2355
|
-
const brandName =
|
|
2356
|
-
const logoUrl =
|
|
2357
|
-
const
|
|
2369
|
+
const brandName = getPropString2(props, "brandName", "Orion Studio");
|
|
2370
|
+
const logoUrl = getPropString2(props, "logoUrl", "");
|
|
2371
|
+
const pagesCollectionSlug = getPropString2(props, "pagesCollectionSlug", "pages");
|
|
2372
|
+
const mediaCollectionSlug = getPropString2(props, "mediaCollectionSlug", "media");
|
|
2373
|
+
const globalsBasePath = getPropString2(props, "globalsBasePath", "/admin/globals");
|
|
2358
2374
|
const compact = getPropBoolean(props, "compact", false);
|
|
2359
2375
|
const branding = useSiteBranding(brandName, logoUrl || void 0);
|
|
2360
2376
|
const resolvedName = branding.siteName || brandName;
|
|
@@ -2365,28 +2381,30 @@ function AdminStudioNav(props) {
|
|
|
2365
2381
|
window.addEventListener("popstate", update);
|
|
2366
2382
|
return () => window.removeEventListener("popstate", update);
|
|
2367
2383
|
}, []);
|
|
2384
|
+
const pagesPath = `/admin/collections/${pagesCollectionSlug}`;
|
|
2385
|
+
const mediaPath = `/admin/collections/${mediaCollectionSlug}`;
|
|
2368
2386
|
const links = (0, import_react11.useMemo)(
|
|
2369
2387
|
() => [
|
|
2370
2388
|
{ href: "/admin", label: "Dashboard", matchPrefixes: ["/admin"] },
|
|
2371
2389
|
{
|
|
2372
|
-
href:
|
|
2390
|
+
href: pagesPath,
|
|
2373
2391
|
label: "Pages",
|
|
2374
|
-
matchPrefixes: [
|
|
2392
|
+
matchPrefixes: [pagesPath]
|
|
2375
2393
|
},
|
|
2376
2394
|
{ href: globalsBasePath, label: "Globals", matchPrefixes: [globalsBasePath, "/admin/globals"] },
|
|
2377
2395
|
{
|
|
2378
|
-
href:
|
|
2396
|
+
href: mediaPath,
|
|
2379
2397
|
label: "Media",
|
|
2380
|
-
matchPrefixes: [
|
|
2398
|
+
matchPrefixes: [mediaPath]
|
|
2381
2399
|
},
|
|
2382
2400
|
{
|
|
2383
|
-
href: "/admin/
|
|
2401
|
+
href: "/admin/collections/users",
|
|
2384
2402
|
label: "Admin Tools",
|
|
2385
|
-
matchPrefixes: ["/admin/
|
|
2403
|
+
matchPrefixes: ["/admin/collections/users"],
|
|
2386
2404
|
adminOnly: true
|
|
2387
2405
|
}
|
|
2388
2406
|
],
|
|
2389
|
-
[globalsBasePath]
|
|
2407
|
+
[globalsBasePath, mediaPath, pagesPath]
|
|
2390
2408
|
);
|
|
2391
2409
|
const linkStyle = (active) => ({
|
|
2392
2410
|
alignItems: "center",
|
|
@@ -2471,78 +2489,15 @@ function AdminStudioNav(props) {
|
|
|
2471
2489
|
}
|
|
2472
2490
|
|
|
2473
2491
|
// src/admin/components/studio/AdminStudioPagesListView.tsx
|
|
2474
|
-
var import_react13 = require("react");
|
|
2475
|
-
var import_ui5 = require("@payloadcms/ui");
|
|
2476
|
-
|
|
2477
|
-
// src/admin/components/studio/StudioSectionLayout.tsx
|
|
2478
2492
|
var import_react12 = require("react");
|
|
2493
|
+
var import_ui5 = require("@payloadcms/ui");
|
|
2479
2494
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2480
|
-
var STORAGE_KEY2 = "orion-studio-sidebar-collapsed";
|
|
2481
|
-
var ACTIVE_CLASS = "orion-studio-shell-active";
|
|
2482
|
-
function StudioSectionLayout({ children, navProps }) {
|
|
2483
|
-
const [collapsed, setCollapsed] = (0, import_react12.useState)(false);
|
|
2484
|
-
(0, import_react12.useEffect)(() => {
|
|
2485
|
-
try {
|
|
2486
|
-
const stored = window.localStorage.getItem(STORAGE_KEY2);
|
|
2487
|
-
if (stored === "1") {
|
|
2488
|
-
setCollapsed(true);
|
|
2489
|
-
}
|
|
2490
|
-
} catch {
|
|
2491
|
-
}
|
|
2492
|
-
}, []);
|
|
2493
|
-
(0, import_react12.useEffect)(() => {
|
|
2494
|
-
document.body.classList.add(ACTIVE_CLASS);
|
|
2495
|
-
return () => {
|
|
2496
|
-
document.body.classList.remove(ACTIVE_CLASS);
|
|
2497
|
-
};
|
|
2498
|
-
}, []);
|
|
2499
|
-
const toggle = () => {
|
|
2500
|
-
setCollapsed((prev) => {
|
|
2501
|
-
const next = !prev;
|
|
2502
|
-
try {
|
|
2503
|
-
window.localStorage.setItem(STORAGE_KEY2, next ? "1" : "0");
|
|
2504
|
-
} catch {
|
|
2505
|
-
}
|
|
2506
|
-
return next;
|
|
2507
|
-
});
|
|
2508
|
-
};
|
|
2509
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2510
|
-
"div",
|
|
2511
|
-
{
|
|
2512
|
-
className: `orion-studio-shell ${collapsed ? "is-collapsed" : ""}`,
|
|
2513
|
-
style: {
|
|
2514
|
-
display: "grid",
|
|
2515
|
-
gridTemplateColumns: collapsed ? "84px minmax(0, 1fr)" : "260px minmax(0, 1fr)",
|
|
2516
|
-
minHeight: "100vh"
|
|
2517
|
-
},
|
|
2518
|
-
children: [
|
|
2519
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("aside", { className: "orion-studio-sidebar", children: [
|
|
2520
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2521
|
-
"button",
|
|
2522
|
-
{
|
|
2523
|
-
"aria-label": collapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
2524
|
-
className: "orion-studio-sidebar-toggle",
|
|
2525
|
-
onClick: toggle,
|
|
2526
|
-
type: "button",
|
|
2527
|
-
children: collapsed ? ">" : "<"
|
|
2528
|
-
}
|
|
2529
|
-
),
|
|
2530
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "orion-studio-sidebar-scroll", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(AdminStudioNav, { ...navProps, compact: collapsed }) })
|
|
2531
|
-
] }),
|
|
2532
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("main", { className: "orion-studio-main", children })
|
|
2533
|
-
]
|
|
2534
|
-
}
|
|
2535
|
-
);
|
|
2536
|
-
}
|
|
2537
|
-
|
|
2538
|
-
// src/admin/components/studio/AdminStudioPagesListView.tsx
|
|
2539
|
-
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2540
2495
|
var isAdmin2 = (user) => {
|
|
2541
2496
|
if (!user || typeof user !== "object") return false;
|
|
2542
2497
|
const role = user.role;
|
|
2543
2498
|
return typeof role === "string" && role === "admin";
|
|
2544
2499
|
};
|
|
2545
|
-
var
|
|
2500
|
+
var getPropString3 = (props, key, fallback) => {
|
|
2546
2501
|
if (!props || typeof props !== "object") return fallback;
|
|
2547
2502
|
const direct = props[key];
|
|
2548
2503
|
if (typeof direct === "string" && direct.length > 0) return direct;
|
|
@@ -2555,11 +2510,11 @@ var getPropString2 = (props, key, fallback) => {
|
|
|
2555
2510
|
};
|
|
2556
2511
|
function AdminStudioPagesListView(props) {
|
|
2557
2512
|
const { user } = (0, import_ui5.useAuth)();
|
|
2558
|
-
const pagesCollectionSlug =
|
|
2559
|
-
const [loading, setLoading] = (0,
|
|
2560
|
-
const [error, setError] = (0,
|
|
2561
|
-
const [docs, setDocs] = (0,
|
|
2562
|
-
const apiURL = (0,
|
|
2513
|
+
const pagesCollectionSlug = getPropString3(props, "pagesCollectionSlug", "pages");
|
|
2514
|
+
const [loading, setLoading] = (0, import_react12.useState)(true);
|
|
2515
|
+
const [error, setError] = (0, import_react12.useState)(null);
|
|
2516
|
+
const [docs, setDocs] = (0, import_react12.useState)([]);
|
|
2517
|
+
const apiURL = (0, import_react12.useMemo)(() => {
|
|
2563
2518
|
const params = new URLSearchParams({
|
|
2564
2519
|
depth: "0",
|
|
2565
2520
|
limit: "100",
|
|
@@ -2568,7 +2523,7 @@ function AdminStudioPagesListView(props) {
|
|
|
2568
2523
|
});
|
|
2569
2524
|
return `/api/${pagesCollectionSlug}?${params.toString()}`;
|
|
2570
2525
|
}, [pagesCollectionSlug]);
|
|
2571
|
-
(0,
|
|
2526
|
+
(0, import_react12.useEffect)(() => {
|
|
2572
2527
|
let cancelled = false;
|
|
2573
2528
|
const run = async () => {
|
|
2574
2529
|
setLoading(true);
|
|
@@ -2593,14 +2548,14 @@ function AdminStudioPagesListView(props) {
|
|
|
2593
2548
|
cancelled = true;
|
|
2594
2549
|
};
|
|
2595
2550
|
}, [apiURL]);
|
|
2596
|
-
return /* @__PURE__ */ (0,
|
|
2597
|
-
/* @__PURE__ */ (0,
|
|
2598
|
-
/* @__PURE__ */ (0,
|
|
2599
|
-
/* @__PURE__ */ (0,
|
|
2600
|
-
/* @__PURE__ */ (0,
|
|
2601
|
-
/* @__PURE__ */ (0,
|
|
2551
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
2552
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_ui5.SetStepNav, { nav: [{ label: "Pages", url: "/admin/pages" }] }),
|
|
2553
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { alignItems: "flex-end", display: "flex", gap: "0.75rem" }, children: [
|
|
2554
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { flex: 1 }, children: [
|
|
2555
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h1", { style: { margin: 0 }, children: "Pages" }),
|
|
2556
|
+
/* @__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." })
|
|
2602
2557
|
] }),
|
|
2603
|
-
isAdmin2(user) ? /* @__PURE__ */ (0,
|
|
2558
|
+
isAdmin2(user) ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2604
2559
|
"a",
|
|
2605
2560
|
{
|
|
2606
2561
|
href: `/admin/collections/${pagesCollectionSlug}/create`,
|
|
@@ -2616,10 +2571,10 @@ function AdminStudioPagesListView(props) {
|
|
|
2616
2571
|
}
|
|
2617
2572
|
) : null
|
|
2618
2573
|
] }),
|
|
2619
|
-
loading ? /* @__PURE__ */ (0,
|
|
2620
|
-
error ? /* @__PURE__ */ (0,
|
|
2621
|
-
/* @__PURE__ */ (0,
|
|
2622
|
-
!loading && !error && docs.length === 0 ? /* @__PURE__ */ (0,
|
|
2574
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { color: "var(--theme-elevation-600)", marginTop: "1rem" }, children: "Loading..." }) : null,
|
|
2575
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { color: "crimson", marginTop: "1rem" }, children: error }) : null,
|
|
2576
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { display: "grid", gap: "0.6rem", marginTop: "1rem" }, children: [
|
|
2577
|
+
!loading && !error && docs.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2623
2578
|
"div",
|
|
2624
2579
|
{
|
|
2625
2580
|
style: {
|
|
@@ -2637,7 +2592,7 @@ function AdminStudioPagesListView(props) {
|
|
|
2637
2592
|
const path = typeof doc.path === "string" ? doc.path : "/";
|
|
2638
2593
|
const status = typeof doc._status === "string" ? doc._status : "";
|
|
2639
2594
|
if (!id) return null;
|
|
2640
|
-
return /* @__PURE__ */ (0,
|
|
2595
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2641
2596
|
"a",
|
|
2642
2597
|
{
|
|
2643
2598
|
href: `/admin/pages/${id}`,
|
|
@@ -2653,9 +2608,9 @@ function AdminStudioPagesListView(props) {
|
|
|
2653
2608
|
textDecoration: "none"
|
|
2654
2609
|
},
|
|
2655
2610
|
children: [
|
|
2656
|
-
/* @__PURE__ */ (0,
|
|
2657
|
-
/* @__PURE__ */ (0,
|
|
2658
|
-
/* @__PURE__ */ (0,
|
|
2611
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { style: { minWidth: 0 }, children: [
|
|
2612
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontWeight: 900, overflow: "hidden", textOverflow: "ellipsis" }, children: title }),
|
|
2613
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2659
2614
|
"div",
|
|
2660
2615
|
{
|
|
2661
2616
|
style: {
|
|
@@ -2668,7 +2623,7 @@ function AdminStudioPagesListView(props) {
|
|
|
2668
2623
|
}
|
|
2669
2624
|
)
|
|
2670
2625
|
] }),
|
|
2671
|
-
/* @__PURE__ */ (0,
|
|
2626
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2672
2627
|
"div",
|
|
2673
2628
|
{
|
|
2674
2629
|
style: {
|
|
@@ -2678,7 +2633,7 @@ function AdminStudioPagesListView(props) {
|
|
|
2678
2633
|
gap: "0.5rem"
|
|
2679
2634
|
},
|
|
2680
2635
|
children: [
|
|
2681
|
-
status ? /* @__PURE__ */ (0,
|
|
2636
|
+
status ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2682
2637
|
"span",
|
|
2683
2638
|
{
|
|
2684
2639
|
style: {
|
|
@@ -2693,7 +2648,7 @@ function AdminStudioPagesListView(props) {
|
|
|
2693
2648
|
children: status
|
|
2694
2649
|
}
|
|
2695
2650
|
) : null,
|
|
2696
|
-
/* @__PURE__ */ (0,
|
|
2651
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { color: "var(--theme-elevation-600)", fontWeight: 800 }, children: "Open" })
|
|
2697
2652
|
]
|
|
2698
2653
|
}
|
|
2699
2654
|
)
|
|
@@ -2707,9 +2662,9 @@ function AdminStudioPagesListView(props) {
|
|
|
2707
2662
|
}
|
|
2708
2663
|
|
|
2709
2664
|
// src/admin/components/studio/AdminStudioPageEditView.tsx
|
|
2710
|
-
var
|
|
2665
|
+
var import_react13 = require("react");
|
|
2711
2666
|
var import_ui6 = require("@payloadcms/ui");
|
|
2712
|
-
var
|
|
2667
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2713
2668
|
var isAdmin3 = (user) => {
|
|
2714
2669
|
if (!user || typeof user !== "object") return false;
|
|
2715
2670
|
const role = user.role;
|
|
@@ -2720,7 +2675,7 @@ var isEditor = (user) => {
|
|
|
2720
2675
|
const role = user.role;
|
|
2721
2676
|
return typeof role === "string" && role === "editor";
|
|
2722
2677
|
};
|
|
2723
|
-
var
|
|
2678
|
+
var getPropString4 = (props, key, fallback) => {
|
|
2724
2679
|
if (!props || typeof props !== "object") return fallback;
|
|
2725
2680
|
const direct = props[key];
|
|
2726
2681
|
if (typeof direct === "string" && direct.length > 0) return direct;
|
|
@@ -2745,13 +2700,13 @@ var getPageIDFromPathname = (pathname) => {
|
|
|
2745
2700
|
};
|
|
2746
2701
|
function AdminStudioPageEditView(props) {
|
|
2747
2702
|
const { user } = (0, import_ui6.useAuth)();
|
|
2748
|
-
const iframeRef = (0,
|
|
2749
|
-
const [saving, setSaving] = (0,
|
|
2750
|
-
const builderBasePath =
|
|
2751
|
-
const pageIDFromParams = (0,
|
|
2752
|
-
const [pageID, setPageID] = (0,
|
|
2753
|
-
const [didResolvePathFallback, setDidResolvePathFallback] = (0,
|
|
2754
|
-
(0,
|
|
2703
|
+
const iframeRef = (0, import_react13.useRef)(null);
|
|
2704
|
+
const [saving, setSaving] = (0, import_react13.useState)(null);
|
|
2705
|
+
const builderBasePath = getPropString4(props, "builderBasePath", "/builder");
|
|
2706
|
+
const pageIDFromParams = (0, import_react13.useMemo)(() => getParam(props.params, "id"), [props.params]);
|
|
2707
|
+
const [pageID, setPageID] = (0, import_react13.useState)(pageIDFromParams);
|
|
2708
|
+
const [didResolvePathFallback, setDidResolvePathFallback] = (0, import_react13.useState)(false);
|
|
2709
|
+
(0, import_react13.useEffect)(() => {
|
|
2755
2710
|
if (pageIDFromParams) {
|
|
2756
2711
|
setPageID(pageIDFromParams);
|
|
2757
2712
|
setDidResolvePathFallback(true);
|
|
@@ -2772,7 +2727,7 @@ function AdminStudioPageEditView(props) {
|
|
|
2772
2727
|
setSaving(status);
|
|
2773
2728
|
iframe.contentWindow.postMessage({ source: "payload-visual-builder-parent", type: "save", status }, "*");
|
|
2774
2729
|
};
|
|
2775
|
-
(0,
|
|
2730
|
+
(0, import_react13.useEffect)(() => {
|
|
2776
2731
|
const onMessage = (event) => {
|
|
2777
2732
|
const data = event.data;
|
|
2778
2733
|
if (!data || data.source !== "payload-visual-builder-child" || data.type !== "save-result") {
|
|
@@ -2789,8 +2744,8 @@ function AdminStudioPageEditView(props) {
|
|
|
2789
2744
|
return () => window.removeEventListener("message", onMessage);
|
|
2790
2745
|
}, []);
|
|
2791
2746
|
if (!pageID && !didResolvePathFallback) {
|
|
2792
|
-
return /* @__PURE__ */ (0,
|
|
2793
|
-
/* @__PURE__ */ (0,
|
|
2747
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
2748
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2794
2749
|
import_ui6.SetStepNav,
|
|
2795
2750
|
{
|
|
2796
2751
|
nav: [
|
|
@@ -2799,13 +2754,13 @@ function AdminStudioPageEditView(props) {
|
|
|
2799
2754
|
]
|
|
2800
2755
|
}
|
|
2801
2756
|
),
|
|
2802
|
-
/* @__PURE__ */ (0,
|
|
2803
|
-
/* @__PURE__ */ (0,
|
|
2757
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("h1", { style: { margin: 0 }, children: "Page Editor" }),
|
|
2758
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { style: { color: "var(--theme-elevation-600)" }, children: "Loading page editor..." })
|
|
2804
2759
|
] });
|
|
2805
2760
|
}
|
|
2806
2761
|
if (!pageID) {
|
|
2807
|
-
return /* @__PURE__ */ (0,
|
|
2808
|
-
/* @__PURE__ */ (0,
|
|
2762
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
2763
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2809
2764
|
import_ui6.SetStepNav,
|
|
2810
2765
|
{
|
|
2811
2766
|
nav: [
|
|
@@ -2814,12 +2769,12 @@ function AdminStudioPageEditView(props) {
|
|
|
2814
2769
|
]
|
|
2815
2770
|
}
|
|
2816
2771
|
),
|
|
2817
|
-
/* @__PURE__ */ (0,
|
|
2818
|
-
/* @__PURE__ */ (0,
|
|
2772
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("h1", { style: { margin: 0 }, children: "Page Editor" }),
|
|
2773
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { style: { color: "var(--theme-elevation-600)" }, children: "Missing page ID." })
|
|
2819
2774
|
] });
|
|
2820
2775
|
}
|
|
2821
|
-
return /* @__PURE__ */ (0,
|
|
2822
|
-
/* @__PURE__ */ (0,
|
|
2776
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
2777
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2823
2778
|
import_ui6.SetStepNav,
|
|
2824
2779
|
{
|
|
2825
2780
|
nav: [
|
|
@@ -2828,8 +2783,8 @@ function AdminStudioPageEditView(props) {
|
|
|
2828
2783
|
]
|
|
2829
2784
|
}
|
|
2830
2785
|
),
|
|
2831
|
-
/* @__PURE__ */ (0,
|
|
2832
|
-
/* @__PURE__ */ (0,
|
|
2786
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { display: "grid", gridTemplateRows: "auto 1fr", height: "calc(100vh - 120px)" }, children: [
|
|
2787
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2833
2788
|
"div",
|
|
2834
2789
|
{
|
|
2835
2790
|
style: {
|
|
@@ -2845,9 +2800,9 @@ function AdminStudioPageEditView(props) {
|
|
|
2845
2800
|
zIndex: 20
|
|
2846
2801
|
},
|
|
2847
2802
|
children: [
|
|
2848
|
-
/* @__PURE__ */ (0,
|
|
2849
|
-
/* @__PURE__ */ (0,
|
|
2850
|
-
/* @__PURE__ */ (0,
|
|
2803
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { minWidth: 0 }, children: [
|
|
2804
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { fontWeight: 900 }, children: "Page Editor" }),
|
|
2805
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2851
2806
|
"div",
|
|
2852
2807
|
{
|
|
2853
2808
|
style: {
|
|
@@ -2863,8 +2818,8 @@ function AdminStudioPageEditView(props) {
|
|
|
2863
2818
|
}
|
|
2864
2819
|
)
|
|
2865
2820
|
] }),
|
|
2866
|
-
/* @__PURE__ */ (0,
|
|
2867
|
-
/* @__PURE__ */ (0,
|
|
2821
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { style: { alignItems: "center", display: "flex", gap: "0.5rem" }, children: [
|
|
2822
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2868
2823
|
"button",
|
|
2869
2824
|
{
|
|
2870
2825
|
disabled: saving !== null,
|
|
@@ -2880,7 +2835,7 @@ function AdminStudioPageEditView(props) {
|
|
|
2880
2835
|
children: saving === "draft" ? "Saving\u2026" : "Save Draft"
|
|
2881
2836
|
}
|
|
2882
2837
|
),
|
|
2883
|
-
/* @__PURE__ */ (0,
|
|
2838
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2884
2839
|
"button",
|
|
2885
2840
|
{
|
|
2886
2841
|
disabled: !canPublish || saving !== null,
|
|
@@ -2903,7 +2858,7 @@ function AdminStudioPageEditView(props) {
|
|
|
2903
2858
|
]
|
|
2904
2859
|
}
|
|
2905
2860
|
),
|
|
2906
|
-
/* @__PURE__ */ (0,
|
|
2861
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2907
2862
|
"iframe",
|
|
2908
2863
|
{
|
|
2909
2864
|
ref: iframeRef,
|
|
@@ -2918,7 +2873,7 @@ function AdminStudioPageEditView(props) {
|
|
|
2918
2873
|
|
|
2919
2874
|
// src/admin/components/studio/AdminStudioGlobalsView.tsx
|
|
2920
2875
|
var import_ui7 = require("@payloadcms/ui");
|
|
2921
|
-
var
|
|
2876
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2922
2877
|
var getPropGlobals = (props) => {
|
|
2923
2878
|
if (!props || typeof props !== "object") return null;
|
|
2924
2879
|
const direct = props.globals;
|
|
@@ -2930,7 +2885,7 @@ var getPropGlobals = (props) => {
|
|
|
2930
2885
|
}
|
|
2931
2886
|
return null;
|
|
2932
2887
|
};
|
|
2933
|
-
var
|
|
2888
|
+
var getPropString5 = (props, key, fallback) => {
|
|
2934
2889
|
if (!props || typeof props !== "object") return fallback;
|
|
2935
2890
|
const direct = props[key];
|
|
2936
2891
|
if (typeof direct === "string" && direct.length > 0) return direct;
|
|
@@ -2942,17 +2897,17 @@ var getPropString4 = (props, key, fallback) => {
|
|
|
2942
2897
|
return fallback;
|
|
2943
2898
|
};
|
|
2944
2899
|
function AdminStudioGlobalsView(props) {
|
|
2945
|
-
const globalsBasePath =
|
|
2900
|
+
const globalsBasePath = getPropString5(props, "globalsBasePath", "/admin/studio-globals");
|
|
2946
2901
|
const globals = getPropGlobals(props) || [
|
|
2947
2902
|
{ slug: "site-settings", label: "Website Settings" },
|
|
2948
2903
|
{ slug: "header", label: "Header & Navigation" },
|
|
2949
2904
|
{ slug: "footer", label: "Footer" }
|
|
2950
2905
|
];
|
|
2951
|
-
return /* @__PURE__ */ (0,
|
|
2952
|
-
/* @__PURE__ */ (0,
|
|
2953
|
-
/* @__PURE__ */ (0,
|
|
2954
|
-
/* @__PURE__ */ (0,
|
|
2955
|
-
/* @__PURE__ */ (0,
|
|
2906
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
2907
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_ui7.SetStepNav, { nav: [{ label: "Globals", url: globalsBasePath }] }),
|
|
2908
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("h1", { style: { margin: 0 }, children: "Globals" }),
|
|
2909
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { style: { color: "var(--theme-elevation-600)", marginTop: "0.35rem" }, children: "Site-wide settings." }),
|
|
2910
|
+
/* @__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)(
|
|
2956
2911
|
"a",
|
|
2957
2912
|
{
|
|
2958
2913
|
href: `/admin/globals/${global.slug}`,
|
|
@@ -2965,8 +2920,8 @@ function AdminStudioGlobalsView(props) {
|
|
|
2965
2920
|
textDecoration: "none"
|
|
2966
2921
|
},
|
|
2967
2922
|
children: [
|
|
2968
|
-
/* @__PURE__ */ (0,
|
|
2969
|
-
/* @__PURE__ */ (0,
|
|
2923
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { fontWeight: 900 }, children: global.label }),
|
|
2924
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { style: { color: "var(--theme-elevation-600)", fontSize: "0.9rem" }, children: [
|
|
2970
2925
|
"/admin/globals/",
|
|
2971
2926
|
global.slug
|
|
2972
2927
|
] })
|
|
@@ -2974,7 +2929,7 @@ function AdminStudioGlobalsView(props) {
|
|
|
2974
2929
|
},
|
|
2975
2930
|
global.slug
|
|
2976
2931
|
)) }),
|
|
2977
|
-
/* @__PURE__ */ (0,
|
|
2932
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { marginTop: "1rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2978
2933
|
"a",
|
|
2979
2934
|
{
|
|
2980
2935
|
href: globalsBasePath,
|
|
@@ -2987,8 +2942,8 @@ function AdminStudioGlobalsView(props) {
|
|
|
2987
2942
|
|
|
2988
2943
|
// src/admin/components/studio/AdminStudioMediaView.tsx
|
|
2989
2944
|
var import_ui8 = require("@payloadcms/ui");
|
|
2990
|
-
var
|
|
2991
|
-
var
|
|
2945
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2946
|
+
var getPropString6 = (props, key, fallback) => {
|
|
2992
2947
|
if (!props || typeof props !== "object") return fallback;
|
|
2993
2948
|
const direct = props[key];
|
|
2994
2949
|
if (typeof direct === "string" && direct.length > 0) return direct;
|
|
@@ -3000,12 +2955,12 @@ var getPropString5 = (props, key, fallback) => {
|
|
|
3000
2955
|
return fallback;
|
|
3001
2956
|
};
|
|
3002
2957
|
function AdminStudioMediaView(props) {
|
|
3003
|
-
const mediaCollectionSlug =
|
|
3004
|
-
return /* @__PURE__ */ (0,
|
|
3005
|
-
/* @__PURE__ */ (0,
|
|
3006
|
-
/* @__PURE__ */ (0,
|
|
3007
|
-
/* @__PURE__ */ (0,
|
|
3008
|
-
/* @__PURE__ */ (0,
|
|
2958
|
+
const mediaCollectionSlug = getPropString6(props, "mediaCollectionSlug", "media");
|
|
2959
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
2960
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_ui8.SetStepNav, { nav: [{ label: "Media", url: "/admin/media" }] }),
|
|
2961
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("h1", { style: { margin: 0 }, children: "Media" }),
|
|
2962
|
+
/* @__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." }),
|
|
2963
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { style: { display: "grid", gap: "0.6rem", marginTop: "1rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
3009
2964
|
"a",
|
|
3010
2965
|
{
|
|
3011
2966
|
href: `/admin/collections/${mediaCollectionSlug}`,
|
|
@@ -3018,8 +2973,8 @@ function AdminStudioMediaView(props) {
|
|
|
3018
2973
|
textDecoration: "none"
|
|
3019
2974
|
},
|
|
3020
2975
|
children: [
|
|
3021
|
-
/* @__PURE__ */ (0,
|
|
3022
|
-
/* @__PURE__ */ (0,
|
|
2976
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { style: { fontWeight: 900 }, children: "Open Media Library" }),
|
|
2977
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { style: { color: "var(--theme-elevation-600)", fontSize: "0.9rem" }, children: [
|
|
3023
2978
|
"/admin/collections/",
|
|
3024
2979
|
mediaCollectionSlug
|
|
3025
2980
|
] })
|
|
@@ -3031,13 +2986,13 @@ function AdminStudioMediaView(props) {
|
|
|
3031
2986
|
|
|
3032
2987
|
// src/admin/components/studio/AdminStudioToolsView.tsx
|
|
3033
2988
|
var import_ui9 = require("@payloadcms/ui");
|
|
3034
|
-
var
|
|
2989
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
3035
2990
|
var isAdmin4 = (user) => {
|
|
3036
2991
|
if (!user || typeof user !== "object") return false;
|
|
3037
2992
|
const role = user.role;
|
|
3038
2993
|
return typeof role === "string" && role === "admin";
|
|
3039
2994
|
};
|
|
3040
|
-
var
|
|
2995
|
+
var getPropString7 = (props, key, fallback) => {
|
|
3041
2996
|
if (!props || typeof props !== "object") return fallback;
|
|
3042
2997
|
const direct = props[key];
|
|
3043
2998
|
if (typeof direct === "string" && direct.length > 0) return direct;
|
|
@@ -3051,14 +3006,14 @@ var getPropString6 = (props, key, fallback) => {
|
|
|
3051
3006
|
function AdminStudioToolsView(props) {
|
|
3052
3007
|
const { user } = (0, import_ui9.useAuth)();
|
|
3053
3008
|
if (!isAdmin4(user)) {
|
|
3054
|
-
return /* @__PURE__ */ (0,
|
|
3055
|
-
/* @__PURE__ */ (0,
|
|
3056
|
-
/* @__PURE__ */ (0,
|
|
3057
|
-
/* @__PURE__ */ (0,
|
|
3009
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
3010
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_ui9.SetStepNav, { nav: [{ label: "Admin Tools", url: "/admin/tools" }] }),
|
|
3011
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h1", { style: { margin: 0 }, children: "Admin Tools" }),
|
|
3012
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { style: { color: "var(--theme-elevation-600)" }, children: "You do not have access to this page." })
|
|
3058
3013
|
] });
|
|
3059
3014
|
}
|
|
3060
|
-
const pagesCollectionSlug =
|
|
3061
|
-
const mediaCollectionSlug =
|
|
3015
|
+
const pagesCollectionSlug = getPropString7(props, "pagesCollectionSlug", "pages");
|
|
3016
|
+
const mediaCollectionSlug = getPropString7(props, "mediaCollectionSlug", "media");
|
|
3062
3017
|
const links = [
|
|
3063
3018
|
{ href: `/admin/collections/${pagesCollectionSlug}`, label: "Raw Pages Collection" },
|
|
3064
3019
|
{ href: `/admin/collections/${mediaCollectionSlug}`, label: "Raw Media Collection" },
|
|
@@ -3067,11 +3022,11 @@ function AdminStudioToolsView(props) {
|
|
|
3067
3022
|
{ href: "/admin/globals/footer", label: "Raw Footer Global" },
|
|
3068
3023
|
{ href: "/admin/collections/users", label: "Users / Roles" }
|
|
3069
3024
|
];
|
|
3070
|
-
return /* @__PURE__ */ (0,
|
|
3071
|
-
/* @__PURE__ */ (0,
|
|
3072
|
-
/* @__PURE__ */ (0,
|
|
3073
|
-
/* @__PURE__ */ (0,
|
|
3074
|
-
/* @__PURE__ */ (0,
|
|
3025
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
3026
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_ui9.SetStepNav, { nav: [{ label: "Admin Tools", url: "/admin/tools" }] }),
|
|
3027
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h1", { style: { margin: 0 }, children: "Admin Tools" }),
|
|
3028
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { style: { color: "var(--theme-elevation-600)", marginTop: "0.35rem" }, children: "Hidden fallback links for administrators." }),
|
|
3029
|
+
/* @__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)(
|
|
3075
3030
|
"a",
|
|
3076
3031
|
{
|
|
3077
3032
|
href: link.href,
|
|
@@ -3084,8 +3039,8 @@ function AdminStudioToolsView(props) {
|
|
|
3084
3039
|
textDecoration: "none"
|
|
3085
3040
|
},
|
|
3086
3041
|
children: [
|
|
3087
|
-
/* @__PURE__ */ (0,
|
|
3088
|
-
/* @__PURE__ */ (0,
|
|
3042
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { fontWeight: 900 }, children: link.label }),
|
|
3043
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { style: { color: "var(--theme-elevation-600)", fontSize: "0.9rem" }, children: link.href })
|
|
3089
3044
|
]
|
|
3090
3045
|
},
|
|
3091
3046
|
link.href
|
|
@@ -3095,14 +3050,14 @@ function AdminStudioToolsView(props) {
|
|
|
3095
3050
|
|
|
3096
3051
|
// src/admin/components/studio/OpenInStudioMenuItem.tsx
|
|
3097
3052
|
var import_ui10 = require("@payloadcms/ui");
|
|
3098
|
-
var
|
|
3099
|
-
function OpenInStudioMenuItem({ pagesPathBase = "/
|
|
3053
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
3054
|
+
function OpenInStudioMenuItem({ pagesPathBase = "/studio/pages" }) {
|
|
3100
3055
|
const documentInfo = (0, import_ui10.useDocumentInfo)();
|
|
3101
3056
|
const id = documentInfo?.id;
|
|
3102
3057
|
if (!id) {
|
|
3103
3058
|
return null;
|
|
3104
3059
|
}
|
|
3105
|
-
return /* @__PURE__ */ (0,
|
|
3060
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3106
3061
|
"a",
|
|
3107
3062
|
{
|
|
3108
3063
|
href: `${pagesPathBase}/${id}`,
|
|
@@ -3121,19 +3076,19 @@ function OpenInStudioMenuItem({ pagesPathBase = "/admin/pages" }) {
|
|
|
3121
3076
|
}
|
|
3122
3077
|
|
|
3123
3078
|
// src/admin/components/studio/PageEditRedirectToStudio.tsx
|
|
3124
|
-
var
|
|
3079
|
+
var import_react14 = require("react");
|
|
3125
3080
|
var import_ui11 = require("@payloadcms/ui");
|
|
3126
|
-
var
|
|
3127
|
-
function PageEditRedirectToStudio({ pagesPathBase = "/
|
|
3081
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
3082
|
+
function PageEditRedirectToStudio({ pagesPathBase = "/studio/pages" }) {
|
|
3128
3083
|
const documentInfo = (0, import_ui11.useDocumentInfo)();
|
|
3129
3084
|
const id = documentInfo?.id;
|
|
3130
|
-
(0,
|
|
3085
|
+
(0, import_react14.useEffect)(() => {
|
|
3131
3086
|
if (!id) {
|
|
3132
3087
|
return;
|
|
3133
3088
|
}
|
|
3134
3089
|
window.location.replace(`${pagesPathBase}/${id}`);
|
|
3135
3090
|
}, [id, pagesPathBase]);
|
|
3136
|
-
return /* @__PURE__ */ (0,
|
|
3091
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
3137
3092
|
"div",
|
|
3138
3093
|
{
|
|
3139
3094
|
style: {
|
|
@@ -3145,9 +3100,9 @@ function PageEditRedirectToStudio({ pagesPathBase = "/admin/pages" }) {
|
|
|
3145
3100
|
minHeight: "50vh"
|
|
3146
3101
|
},
|
|
3147
3102
|
children: [
|
|
3148
|
-
/* @__PURE__ */ (0,
|
|
3149
|
-
/* @__PURE__ */ (0,
|
|
3150
|
-
id ? /* @__PURE__ */ (0,
|
|
3103
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h2", { style: { margin: 0 }, children: "Opening Editor..." }),
|
|
3104
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { style: { color: "var(--theme-elevation-600)", margin: 0 }, children: "Redirecting to the custom page editor." }),
|
|
3105
|
+
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" })
|
|
3151
3106
|
]
|
|
3152
3107
|
}
|
|
3153
3108
|
);
|
|
@@ -3156,32 +3111,32 @@ function PageEditRedirectToStudio({ pagesPathBase = "/admin/pages" }) {
|
|
|
3156
3111
|
// src/admin/components/studio/StudioBackBreadcrumb.tsx
|
|
3157
3112
|
var import_ui12 = require("@payloadcms/ui");
|
|
3158
3113
|
var import_navigation = require("next/navigation");
|
|
3159
|
-
var
|
|
3114
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
3160
3115
|
var toTitle = (slug) => slug.split("-").filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
|
|
3161
3116
|
var buildNav = (pathname) => {
|
|
3162
3117
|
if (pathname.includes("/globals/")) {
|
|
3163
3118
|
const slug = pathname.split("/globals/")[1]?.split("/")[0] || "";
|
|
3164
3119
|
const currentLabel = slug === "site-settings" ? "Website Settings" : toTitle(slug) || "Global";
|
|
3165
3120
|
return [
|
|
3166
|
-
{ label: "Globals", url: "/admin/
|
|
3121
|
+
{ label: "Globals", url: "/admin/globals" },
|
|
3167
3122
|
{ label: currentLabel }
|
|
3168
3123
|
];
|
|
3169
3124
|
}
|
|
3170
3125
|
if (pathname.includes("/collections/pages") || pathname.startsWith("/admin/pages/")) {
|
|
3171
3126
|
return [
|
|
3172
|
-
{ label: "Pages", url: "/admin/pages" },
|
|
3127
|
+
{ label: "Pages", url: "/admin/collections/pages" },
|
|
3173
3128
|
{ label: "Page" }
|
|
3174
3129
|
];
|
|
3175
3130
|
}
|
|
3176
3131
|
if (pathname.includes("/collections/media")) {
|
|
3177
3132
|
return [
|
|
3178
|
-
{ label: "Media", url: "/admin/media" },
|
|
3133
|
+
{ label: "Media", url: "/admin/collections/media" },
|
|
3179
3134
|
{ label: "Media Item" }
|
|
3180
3135
|
];
|
|
3181
3136
|
}
|
|
3182
|
-
if (pathname.startsWith("/admin/tools")) {
|
|
3137
|
+
if (pathname.startsWith("/admin/tools") || pathname.includes("/collections/users")) {
|
|
3183
3138
|
return [
|
|
3184
|
-
{ label: "Admin Tools", url: "/admin/
|
|
3139
|
+
{ label: "Admin Tools", url: "/admin/collections/users" },
|
|
3185
3140
|
{ label: "Tool" }
|
|
3186
3141
|
];
|
|
3187
3142
|
}
|
|
@@ -3191,7 +3146,7 @@ function StudioBackBreadcrumb() {
|
|
|
3191
3146
|
const pathname = (0, import_navigation.usePathname)();
|
|
3192
3147
|
const nav = buildNav(pathname);
|
|
3193
3148
|
if (!nav) return null;
|
|
3194
|
-
return /* @__PURE__ */ (0,
|
|
3149
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_ui12.SetStepNav, { nav });
|
|
3195
3150
|
}
|
|
3196
3151
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3197
3152
|
0 && (module.exports = {
|