@orion-studios/payload-studio 0.3.0-beta.9 → 0.4.0-beta.0
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 +198 -245
- package/dist/admin/client.mjs +192 -239
- package/dist/admin/index.d.mts +1 -1
- package/dist/admin/index.d.ts +1 -1
- package/dist/admin/index.js +6 -58
- package/dist/admin/index.mjs +1 -1
- package/dist/admin-app/client.js +136 -0
- package/dist/admin-app/client.mjs +110 -0
- package/dist/admin-app/index.d.mts +3 -0
- package/dist/admin-app/index.d.ts +3 -0
- package/dist/admin-app/index.js +82 -0
- package/dist/admin-app/index.mjs +13 -0
- package/dist/admin-app/styles.css +117 -0
- package/dist/chunk-AAOHJDNS.mjs +67 -0
- package/dist/{chunk-J6HM2LPT.mjs → chunk-J7W5EE3B.mjs} +6 -58
- package/dist/index-BallJs-K.d.mts +43 -0
- package/dist/index-BallJs-K.d.ts +43 -0
- package/dist/{index-vTq0Uy37.d.mts → index-DJFhANvJ.d.mts} +3 -54
- package/dist/{index-vTq0Uy37.d.ts → index-DJFhANvJ.d.ts} +3 -54
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +68 -62
- package/dist/index.mjs +11 -7
- package/dist/studio-pages/client.js +12 -0
- package/dist/studio-pages/client.mjs +12 -0
- package/package.json +13 -2
package/dist/admin/client.js
CHANGED
|
@@ -2276,21 +2276,73 @@ function WelcomeHeader({
|
|
|
2276
2276
|
}
|
|
2277
2277
|
|
|
2278
2278
|
// src/admin/components/studio/AdminStudioDashboard.tsx
|
|
2279
|
-
var
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
var
|
|
2279
|
+
var import_ui3 = require("@payloadcms/ui");
|
|
2280
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2281
|
+
var cardStyle = {
|
|
2282
|
+
background: "var(--theme-elevation-0)",
|
|
2283
|
+
border: "1px solid var(--theme-elevation-150)",
|
|
2284
|
+
borderRadius: 16,
|
|
2285
|
+
color: "inherit",
|
|
2286
|
+
padding: "1rem",
|
|
2287
|
+
textDecoration: "none"
|
|
2288
|
+
};
|
|
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");
|
|
2304
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { style: { padding: "1.2rem 1.2rem 2.5rem" }, children: [
|
|
2305
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_ui3.SetStepNav, { nav: [{ label: "Dashboard", url: "/admin" }] }),
|
|
2306
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h1", { style: { fontSize: "1.6rem", margin: 0 }, children: "Studio" }),
|
|
2307
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { style: { color: "var(--theme-elevation-600)", marginTop: "0.35rem" }, children: "Pick what you want to edit." }),
|
|
2308
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2309
|
+
"div",
|
|
2310
|
+
{
|
|
2311
|
+
style: {
|
|
2312
|
+
display: "grid",
|
|
2313
|
+
gap: "0.85rem",
|
|
2314
|
+
gridTemplateColumns: "repeat(auto-fit, minmax(240px, 1fr))",
|
|
2315
|
+
marginTop: "1.1rem"
|
|
2316
|
+
},
|
|
2317
|
+
children: [
|
|
2318
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("a", { href: `/admin/collections/${pagesCollectionSlug}`, style: cardStyle, children: [
|
|
2319
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { fontWeight: 900 }, children: "Pages" }),
|
|
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." })
|
|
2321
|
+
] }),
|
|
2322
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("a", { href: globalsBasePath, style: cardStyle, children: [
|
|
2323
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { fontWeight: 900 }, children: "Globals" }),
|
|
2324
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { color: "var(--theme-elevation-600)", marginTop: "0.25rem" }, children: "Site settings, header, footer." })
|
|
2325
|
+
] }),
|
|
2326
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("a", { href: `/admin/collections/${mediaCollectionSlug}`, style: cardStyle, children: [
|
|
2327
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { fontWeight: 900 }, children: "Media" }),
|
|
2328
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { style: { color: "var(--theme-elevation-600)", marginTop: "0.25rem" }, children: "Upload and manage images and files." })
|
|
2329
|
+
] })
|
|
2330
|
+
]
|
|
2331
|
+
}
|
|
2332
|
+
)
|
|
2333
|
+
] });
|
|
2334
|
+
}
|
|
2283
2335
|
|
|
2284
2336
|
// src/admin/components/studio/AdminStudioNav.tsx
|
|
2285
2337
|
var import_react11 = require("react");
|
|
2286
|
-
var
|
|
2287
|
-
var
|
|
2338
|
+
var import_ui4 = require("@payloadcms/ui");
|
|
2339
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2288
2340
|
var isAdmin = (user) => {
|
|
2289
2341
|
if (!user || typeof user !== "object") return false;
|
|
2290
2342
|
const role = user.role;
|
|
2291
2343
|
return typeof role === "string" && role === "admin";
|
|
2292
2344
|
};
|
|
2293
|
-
var
|
|
2345
|
+
var getPropString2 = (props, key, fallback) => {
|
|
2294
2346
|
if (!props || typeof props !== "object") return fallback;
|
|
2295
2347
|
const direct = props[key];
|
|
2296
2348
|
if (typeof direct === "string" && direct.length > 0) return direct;
|
|
@@ -2313,10 +2365,12 @@ var getPropBoolean = (props, key, fallback) => {
|
|
|
2313
2365
|
return fallback;
|
|
2314
2366
|
};
|
|
2315
2367
|
function AdminStudioNav(props) {
|
|
2316
|
-
const { user } = (0,
|
|
2317
|
-
const brandName =
|
|
2318
|
-
const logoUrl =
|
|
2319
|
-
const
|
|
2368
|
+
const { user } = (0, import_ui4.useAuth)();
|
|
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");
|
|
2320
2374
|
const compact = getPropBoolean(props, "compact", false);
|
|
2321
2375
|
const branding = useSiteBranding(brandName, logoUrl || void 0);
|
|
2322
2376
|
const resolvedName = branding.siteName || brandName;
|
|
@@ -2327,28 +2381,30 @@ function AdminStudioNav(props) {
|
|
|
2327
2381
|
window.addEventListener("popstate", update);
|
|
2328
2382
|
return () => window.removeEventListener("popstate", update);
|
|
2329
2383
|
}, []);
|
|
2384
|
+
const pagesPath = `/admin/collections/${pagesCollectionSlug}`;
|
|
2385
|
+
const mediaPath = `/admin/collections/${mediaCollectionSlug}`;
|
|
2330
2386
|
const links = (0, import_react11.useMemo)(
|
|
2331
2387
|
() => [
|
|
2332
2388
|
{ href: "/admin", label: "Dashboard", matchPrefixes: ["/admin"] },
|
|
2333
2389
|
{
|
|
2334
|
-
href:
|
|
2390
|
+
href: pagesPath,
|
|
2335
2391
|
label: "Pages",
|
|
2336
|
-
matchPrefixes: [
|
|
2392
|
+
matchPrefixes: [pagesPath]
|
|
2337
2393
|
},
|
|
2338
2394
|
{ href: globalsBasePath, label: "Globals", matchPrefixes: [globalsBasePath, "/admin/globals"] },
|
|
2339
2395
|
{
|
|
2340
|
-
href:
|
|
2396
|
+
href: mediaPath,
|
|
2341
2397
|
label: "Media",
|
|
2342
|
-
matchPrefixes: [
|
|
2398
|
+
matchPrefixes: [mediaPath]
|
|
2343
2399
|
},
|
|
2344
2400
|
{
|
|
2345
|
-
href: "/admin/
|
|
2401
|
+
href: "/admin/collections/users",
|
|
2346
2402
|
label: "Admin Tools",
|
|
2347
|
-
matchPrefixes: ["/admin/
|
|
2403
|
+
matchPrefixes: ["/admin/collections/users"],
|
|
2348
2404
|
adminOnly: true
|
|
2349
2405
|
}
|
|
2350
2406
|
],
|
|
2351
|
-
[globalsBasePath]
|
|
2407
|
+
[globalsBasePath, mediaPath, pagesPath]
|
|
2352
2408
|
);
|
|
2353
2409
|
const linkStyle = (active) => ({
|
|
2354
2410
|
alignItems: "center",
|
|
@@ -2363,7 +2419,7 @@ function AdminStudioNav(props) {
|
|
|
2363
2419
|
padding: compact ? "0.6rem" : "0.6rem 0.75rem",
|
|
2364
2420
|
textDecoration: "none"
|
|
2365
2421
|
});
|
|
2366
|
-
return /* @__PURE__ */ (0,
|
|
2422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
2367
2423
|
"div",
|
|
2368
2424
|
{
|
|
2369
2425
|
style: {
|
|
@@ -2374,8 +2430,8 @@ function AdminStudioNav(props) {
|
|
|
2374
2430
|
padding: compact ? "0.8rem 0.5rem" : "1rem 0.85rem"
|
|
2375
2431
|
},
|
|
2376
2432
|
children: [
|
|
2377
|
-
/* @__PURE__ */ (0,
|
|
2378
|
-
branding.logoUrl ? /* @__PURE__ */ (0,
|
|
2433
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "admin-studio-brand", style: { padding: compact ? "0" : "0 0.35rem 0 2.4rem" }, children: [
|
|
2434
|
+
branding.logoUrl ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2379
2435
|
"div",
|
|
2380
2436
|
{
|
|
2381
2437
|
style: {
|
|
@@ -2385,10 +2441,10 @@ function AdminStudioNav(props) {
|
|
|
2385
2441
|
overflow: "hidden",
|
|
2386
2442
|
width: compact ? 34 : 40
|
|
2387
2443
|
},
|
|
2388
|
-
children: /* @__PURE__ */ (0,
|
|
2444
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("img", { alt: `${resolvedName} logo`, src: branding.logoUrl, style: { height: "100%", objectFit: "cover", width: "100%" } })
|
|
2389
2445
|
}
|
|
2390
2446
|
) : null,
|
|
2391
|
-
/* @__PURE__ */ (0,
|
|
2447
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2392
2448
|
"div",
|
|
2393
2449
|
{
|
|
2394
2450
|
style: {
|
|
@@ -2403,14 +2459,14 @@ function AdminStudioNav(props) {
|
|
|
2403
2459
|
children: compact ? resolvedName.slice(0, 1).toUpperCase() : resolvedName
|
|
2404
2460
|
}
|
|
2405
2461
|
),
|
|
2406
|
-
!compact ? /* @__PURE__ */ (0,
|
|
2462
|
+
!compact ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { color: "var(--theme-elevation-600)", fontSize: "0.85rem" }, children: "Studio" }) : null
|
|
2407
2463
|
] }),
|
|
2408
|
-
/* @__PURE__ */ (0,
|
|
2464
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("nav", { style: { display: "grid", gap: "0.25rem" }, children: links.filter((link) => !link.adminOnly || isAdmin(user)).map((link) => {
|
|
2409
2465
|
const active = link.href === "/admin" ? pathname === "/admin" : link.matchPrefixes.some((prefix) => pathname.startsWith(prefix));
|
|
2410
|
-
return /* @__PURE__ */ (0,
|
|
2466
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("a", { href: link.href, style: linkStyle(active), title: link.label, children: compact ? link.label.slice(0, 1) : link.label }, link.href);
|
|
2411
2467
|
}) }),
|
|
2412
|
-
/* @__PURE__ */ (0,
|
|
2413
|
-
/* @__PURE__ */ (0,
|
|
2468
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { flex: 1 } }),
|
|
2469
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
2414
2470
|
"div",
|
|
2415
2471
|
{
|
|
2416
2472
|
style: {
|
|
@@ -2419,11 +2475,11 @@ function AdminStudioNav(props) {
|
|
|
2419
2475
|
textAlign: compact ? "center" : "left"
|
|
2420
2476
|
},
|
|
2421
2477
|
children: [
|
|
2422
|
-
!compact ? /* @__PURE__ */ (0,
|
|
2423
|
-
/* @__PURE__ */ (0,
|
|
2424
|
-
/* @__PURE__ */ (0,
|
|
2478
|
+
!compact ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
|
|
2479
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { color: "var(--theme-elevation-700)", fontSize: "0.85rem" }, children: "Signed in as" }),
|
|
2480
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontWeight: 800, marginBottom: "0.55rem" }, children: typeof user?.email === "string" ? user.email : "User" })
|
|
2425
2481
|
] }) : null,
|
|
2426
|
-
/* @__PURE__ */ (0,
|
|
2482
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_ui4.Logout, {})
|
|
2427
2483
|
]
|
|
2428
2484
|
}
|
|
2429
2485
|
)
|
|
@@ -2432,119 +2488,16 @@ function AdminStudioNav(props) {
|
|
|
2432
2488
|
);
|
|
2433
2489
|
}
|
|
2434
2490
|
|
|
2435
|
-
// src/admin/components/studio/StudioSectionLayout.tsx
|
|
2436
|
-
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2437
|
-
var STORAGE_KEY2 = "orion-studio-sidebar-collapsed";
|
|
2438
|
-
var ACTIVE_CLASS = "orion-studio-shell-active";
|
|
2439
|
-
function StudioSectionLayout({ children, navProps }) {
|
|
2440
|
-
const [collapsed, setCollapsed] = (0, import_react12.useState)(false);
|
|
2441
|
-
(0, import_react12.useEffect)(() => {
|
|
2442
|
-
try {
|
|
2443
|
-
const stored = window.localStorage.getItem(STORAGE_KEY2);
|
|
2444
|
-
if (stored === "1") {
|
|
2445
|
-
setCollapsed(true);
|
|
2446
|
-
}
|
|
2447
|
-
} catch {
|
|
2448
|
-
}
|
|
2449
|
-
}, []);
|
|
2450
|
-
(0, import_react12.useEffect)(() => {
|
|
2451
|
-
document.body.classList.add(ACTIVE_CLASS);
|
|
2452
|
-
return () => {
|
|
2453
|
-
document.body.classList.remove(ACTIVE_CLASS);
|
|
2454
|
-
};
|
|
2455
|
-
}, []);
|
|
2456
|
-
const toggle = () => {
|
|
2457
|
-
setCollapsed((prev) => {
|
|
2458
|
-
const next = !prev;
|
|
2459
|
-
try {
|
|
2460
|
-
window.localStorage.setItem(STORAGE_KEY2, next ? "1" : "0");
|
|
2461
|
-
} catch {
|
|
2462
|
-
}
|
|
2463
|
-
return next;
|
|
2464
|
-
});
|
|
2465
|
-
};
|
|
2466
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
2467
|
-
"div",
|
|
2468
|
-
{
|
|
2469
|
-
className: `orion-studio-shell ${collapsed ? "is-collapsed" : ""}`,
|
|
2470
|
-
style: {
|
|
2471
|
-
display: "grid",
|
|
2472
|
-
gridTemplateColumns: collapsed ? "84px minmax(0, 1fr)" : "260px minmax(0, 1fr)",
|
|
2473
|
-
minHeight: "100vh"
|
|
2474
|
-
},
|
|
2475
|
-
children: [
|
|
2476
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("aside", { className: "orion-studio-sidebar", children: [
|
|
2477
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2478
|
-
"button",
|
|
2479
|
-
{
|
|
2480
|
-
"aria-label": collapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
2481
|
-
className: "orion-studio-sidebar-toggle",
|
|
2482
|
-
onClick: toggle,
|
|
2483
|
-
type: "button",
|
|
2484
|
-
children: collapsed ? ">" : "<"
|
|
2485
|
-
}
|
|
2486
|
-
),
|
|
2487
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "orion-studio-sidebar-scroll", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(AdminStudioNav, { ...navProps, compact: collapsed }) })
|
|
2488
|
-
] }),
|
|
2489
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("main", { className: "orion-studio-main", children })
|
|
2490
|
-
]
|
|
2491
|
-
}
|
|
2492
|
-
);
|
|
2493
|
-
}
|
|
2494
|
-
|
|
2495
|
-
// src/admin/components/studio/AdminStudioDashboard.tsx
|
|
2496
|
-
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2497
|
-
var cardStyle = {
|
|
2498
|
-
background: "var(--theme-elevation-0)",
|
|
2499
|
-
border: "1px solid var(--theme-elevation-150)",
|
|
2500
|
-
borderRadius: 16,
|
|
2501
|
-
color: "inherit",
|
|
2502
|
-
padding: "1rem",
|
|
2503
|
-
textDecoration: "none"
|
|
2504
|
-
};
|
|
2505
|
-
function AdminStudioDashboard(props) {
|
|
2506
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(StudioSectionLayout, { navProps: props, children: [
|
|
2507
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_ui4.SetStepNav, { nav: [{ label: "Dashboard", url: "/admin" }] }),
|
|
2508
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h1", { style: { fontSize: "1.6rem", margin: 0 }, children: "Studio" }),
|
|
2509
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { style: { color: "var(--theme-elevation-600)", marginTop: "0.35rem" }, children: "Pick what you want to edit." }),
|
|
2510
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2511
|
-
"div",
|
|
2512
|
-
{
|
|
2513
|
-
style: {
|
|
2514
|
-
display: "grid",
|
|
2515
|
-
gap: "0.85rem",
|
|
2516
|
-
gridTemplateColumns: "repeat(auto-fit, minmax(240px, 1fr))",
|
|
2517
|
-
marginTop: "1.1rem"
|
|
2518
|
-
},
|
|
2519
|
-
children: [
|
|
2520
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("a", { href: "/admin/pages", style: cardStyle, children: [
|
|
2521
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontWeight: 900 }, children: "Pages" }),
|
|
2522
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { color: "var(--theme-elevation-600)", marginTop: "0.25rem" }, children: "Edit your site pages with the custom editor." })
|
|
2523
|
-
] }),
|
|
2524
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("a", { href: "/admin/studio-globals", style: cardStyle, children: [
|
|
2525
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontWeight: 900 }, children: "Globals" }),
|
|
2526
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { color: "var(--theme-elevation-600)", marginTop: "0.25rem" }, children: "Site settings, header, footer." })
|
|
2527
|
-
] }),
|
|
2528
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("a", { href: "/admin/media", style: cardStyle, children: [
|
|
2529
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontWeight: 900 }, children: "Media" }),
|
|
2530
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { color: "var(--theme-elevation-600)", marginTop: "0.25rem" }, children: "Upload and manage images and files." })
|
|
2531
|
-
] })
|
|
2532
|
-
]
|
|
2533
|
-
}
|
|
2534
|
-
)
|
|
2535
|
-
] });
|
|
2536
|
-
}
|
|
2537
|
-
|
|
2538
2491
|
// src/admin/components/studio/AdminStudioPagesListView.tsx
|
|
2539
|
-
var
|
|
2492
|
+
var import_react12 = require("react");
|
|
2540
2493
|
var import_ui5 = require("@payloadcms/ui");
|
|
2541
|
-
var
|
|
2494
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2542
2495
|
var isAdmin2 = (user) => {
|
|
2543
2496
|
if (!user || typeof user !== "object") return false;
|
|
2544
2497
|
const role = user.role;
|
|
2545
2498
|
return typeof role === "string" && role === "admin";
|
|
2546
2499
|
};
|
|
2547
|
-
var
|
|
2500
|
+
var getPropString3 = (props, key, fallback) => {
|
|
2548
2501
|
if (!props || typeof props !== "object") return fallback;
|
|
2549
2502
|
const direct = props[key];
|
|
2550
2503
|
if (typeof direct === "string" && direct.length > 0) return direct;
|
|
@@ -2557,11 +2510,11 @@ var getPropString2 = (props, key, fallback) => {
|
|
|
2557
2510
|
};
|
|
2558
2511
|
function AdminStudioPagesListView(props) {
|
|
2559
2512
|
const { user } = (0, import_ui5.useAuth)();
|
|
2560
|
-
const pagesCollectionSlug =
|
|
2561
|
-
const [loading, setLoading] = (0,
|
|
2562
|
-
const [error, setError] = (0,
|
|
2563
|
-
const [docs, setDocs] = (0,
|
|
2564
|
-
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)(() => {
|
|
2565
2518
|
const params = new URLSearchParams({
|
|
2566
2519
|
depth: "0",
|
|
2567
2520
|
limit: "100",
|
|
@@ -2570,7 +2523,7 @@ function AdminStudioPagesListView(props) {
|
|
|
2570
2523
|
});
|
|
2571
2524
|
return `/api/${pagesCollectionSlug}?${params.toString()}`;
|
|
2572
2525
|
}, [pagesCollectionSlug]);
|
|
2573
|
-
(0,
|
|
2526
|
+
(0, import_react12.useEffect)(() => {
|
|
2574
2527
|
let cancelled = false;
|
|
2575
2528
|
const run = async () => {
|
|
2576
2529
|
setLoading(true);
|
|
@@ -2595,14 +2548,14 @@ function AdminStudioPagesListView(props) {
|
|
|
2595
2548
|
cancelled = true;
|
|
2596
2549
|
};
|
|
2597
2550
|
}, [apiURL]);
|
|
2598
|
-
return /* @__PURE__ */ (0,
|
|
2599
|
-
/* @__PURE__ */ (0,
|
|
2600
|
-
/* @__PURE__ */ (0,
|
|
2601
|
-
/* @__PURE__ */ (0,
|
|
2602
|
-
/* @__PURE__ */ (0,
|
|
2603
|
-
/* @__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." })
|
|
2604
2557
|
] }),
|
|
2605
|
-
isAdmin2(user) ? /* @__PURE__ */ (0,
|
|
2558
|
+
isAdmin2(user) ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2606
2559
|
"a",
|
|
2607
2560
|
{
|
|
2608
2561
|
href: `/admin/collections/${pagesCollectionSlug}/create`,
|
|
@@ -2618,10 +2571,10 @@ function AdminStudioPagesListView(props) {
|
|
|
2618
2571
|
}
|
|
2619
2572
|
) : null
|
|
2620
2573
|
] }),
|
|
2621
|
-
loading ? /* @__PURE__ */ (0,
|
|
2622
|
-
error ? /* @__PURE__ */ (0,
|
|
2623
|
-
/* @__PURE__ */ (0,
|
|
2624
|
-
!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)(
|
|
2625
2578
|
"div",
|
|
2626
2579
|
{
|
|
2627
2580
|
style: {
|
|
@@ -2639,7 +2592,7 @@ function AdminStudioPagesListView(props) {
|
|
|
2639
2592
|
const path = typeof doc.path === "string" ? doc.path : "/";
|
|
2640
2593
|
const status = typeof doc._status === "string" ? doc._status : "";
|
|
2641
2594
|
if (!id) return null;
|
|
2642
|
-
return /* @__PURE__ */ (0,
|
|
2595
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2643
2596
|
"a",
|
|
2644
2597
|
{
|
|
2645
2598
|
href: `/admin/pages/${id}`,
|
|
@@ -2655,9 +2608,9 @@ function AdminStudioPagesListView(props) {
|
|
|
2655
2608
|
textDecoration: "none"
|
|
2656
2609
|
},
|
|
2657
2610
|
children: [
|
|
2658
|
-
/* @__PURE__ */ (0,
|
|
2659
|
-
/* @__PURE__ */ (0,
|
|
2660
|
-
/* @__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)(
|
|
2661
2614
|
"div",
|
|
2662
2615
|
{
|
|
2663
2616
|
style: {
|
|
@@ -2670,7 +2623,7 @@ function AdminStudioPagesListView(props) {
|
|
|
2670
2623
|
}
|
|
2671
2624
|
)
|
|
2672
2625
|
] }),
|
|
2673
|
-
/* @__PURE__ */ (0,
|
|
2626
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2674
2627
|
"div",
|
|
2675
2628
|
{
|
|
2676
2629
|
style: {
|
|
@@ -2680,7 +2633,7 @@ function AdminStudioPagesListView(props) {
|
|
|
2680
2633
|
gap: "0.5rem"
|
|
2681
2634
|
},
|
|
2682
2635
|
children: [
|
|
2683
|
-
status ? /* @__PURE__ */ (0,
|
|
2636
|
+
status ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2684
2637
|
"span",
|
|
2685
2638
|
{
|
|
2686
2639
|
style: {
|
|
@@ -2695,7 +2648,7 @@ function AdminStudioPagesListView(props) {
|
|
|
2695
2648
|
children: status
|
|
2696
2649
|
}
|
|
2697
2650
|
) : null,
|
|
2698
|
-
/* @__PURE__ */ (0,
|
|
2651
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { style: { color: "var(--theme-elevation-600)", fontWeight: 800 }, children: "Open" })
|
|
2699
2652
|
]
|
|
2700
2653
|
}
|
|
2701
2654
|
)
|
|
@@ -2709,9 +2662,9 @@ function AdminStudioPagesListView(props) {
|
|
|
2709
2662
|
}
|
|
2710
2663
|
|
|
2711
2664
|
// src/admin/components/studio/AdminStudioPageEditView.tsx
|
|
2712
|
-
var
|
|
2665
|
+
var import_react13 = require("react");
|
|
2713
2666
|
var import_ui6 = require("@payloadcms/ui");
|
|
2714
|
-
var
|
|
2667
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2715
2668
|
var isAdmin3 = (user) => {
|
|
2716
2669
|
if (!user || typeof user !== "object") return false;
|
|
2717
2670
|
const role = user.role;
|
|
@@ -2722,7 +2675,7 @@ var isEditor = (user) => {
|
|
|
2722
2675
|
const role = user.role;
|
|
2723
2676
|
return typeof role === "string" && role === "editor";
|
|
2724
2677
|
};
|
|
2725
|
-
var
|
|
2678
|
+
var getPropString4 = (props, key, fallback) => {
|
|
2726
2679
|
if (!props || typeof props !== "object") return fallback;
|
|
2727
2680
|
const direct = props[key];
|
|
2728
2681
|
if (typeof direct === "string" && direct.length > 0) return direct;
|
|
@@ -2747,13 +2700,13 @@ var getPageIDFromPathname = (pathname) => {
|
|
|
2747
2700
|
};
|
|
2748
2701
|
function AdminStudioPageEditView(props) {
|
|
2749
2702
|
const { user } = (0, import_ui6.useAuth)();
|
|
2750
|
-
const iframeRef = (0,
|
|
2751
|
-
const [saving, setSaving] = (0,
|
|
2752
|
-
const builderBasePath =
|
|
2753
|
-
const pageIDFromParams = (0,
|
|
2754
|
-
const [pageID, setPageID] = (0,
|
|
2755
|
-
const [didResolvePathFallback, setDidResolvePathFallback] = (0,
|
|
2756
|
-
(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)(() => {
|
|
2757
2710
|
if (pageIDFromParams) {
|
|
2758
2711
|
setPageID(pageIDFromParams);
|
|
2759
2712
|
setDidResolvePathFallback(true);
|
|
@@ -2774,7 +2727,7 @@ function AdminStudioPageEditView(props) {
|
|
|
2774
2727
|
setSaving(status);
|
|
2775
2728
|
iframe.contentWindow.postMessage({ source: "payload-visual-builder-parent", type: "save", status }, "*");
|
|
2776
2729
|
};
|
|
2777
|
-
(0,
|
|
2730
|
+
(0, import_react13.useEffect)(() => {
|
|
2778
2731
|
const onMessage = (event) => {
|
|
2779
2732
|
const data = event.data;
|
|
2780
2733
|
if (!data || data.source !== "payload-visual-builder-child" || data.type !== "save-result") {
|
|
@@ -2791,8 +2744,8 @@ function AdminStudioPageEditView(props) {
|
|
|
2791
2744
|
return () => window.removeEventListener("message", onMessage);
|
|
2792
2745
|
}, []);
|
|
2793
2746
|
if (!pageID && !didResolvePathFallback) {
|
|
2794
|
-
return /* @__PURE__ */ (0,
|
|
2795
|
-
/* @__PURE__ */ (0,
|
|
2747
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
2748
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2796
2749
|
import_ui6.SetStepNav,
|
|
2797
2750
|
{
|
|
2798
2751
|
nav: [
|
|
@@ -2801,13 +2754,13 @@ function AdminStudioPageEditView(props) {
|
|
|
2801
2754
|
]
|
|
2802
2755
|
}
|
|
2803
2756
|
),
|
|
2804
|
-
/* @__PURE__ */ (0,
|
|
2805
|
-
/* @__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..." })
|
|
2806
2759
|
] });
|
|
2807
2760
|
}
|
|
2808
2761
|
if (!pageID) {
|
|
2809
|
-
return /* @__PURE__ */ (0,
|
|
2810
|
-
/* @__PURE__ */ (0,
|
|
2762
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
2763
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2811
2764
|
import_ui6.SetStepNav,
|
|
2812
2765
|
{
|
|
2813
2766
|
nav: [
|
|
@@ -2816,12 +2769,12 @@ function AdminStudioPageEditView(props) {
|
|
|
2816
2769
|
]
|
|
2817
2770
|
}
|
|
2818
2771
|
),
|
|
2819
|
-
/* @__PURE__ */ (0,
|
|
2820
|
-
/* @__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." })
|
|
2821
2774
|
] });
|
|
2822
2775
|
}
|
|
2823
|
-
return /* @__PURE__ */ (0,
|
|
2824
|
-
/* @__PURE__ */ (0,
|
|
2776
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
2777
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2825
2778
|
import_ui6.SetStepNav,
|
|
2826
2779
|
{
|
|
2827
2780
|
nav: [
|
|
@@ -2830,8 +2783,8 @@ function AdminStudioPageEditView(props) {
|
|
|
2830
2783
|
]
|
|
2831
2784
|
}
|
|
2832
2785
|
),
|
|
2833
|
-
/* @__PURE__ */ (0,
|
|
2834
|
-
/* @__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)(
|
|
2835
2788
|
"div",
|
|
2836
2789
|
{
|
|
2837
2790
|
style: {
|
|
@@ -2847,9 +2800,9 @@ function AdminStudioPageEditView(props) {
|
|
|
2847
2800
|
zIndex: 20
|
|
2848
2801
|
},
|
|
2849
2802
|
children: [
|
|
2850
|
-
/* @__PURE__ */ (0,
|
|
2851
|
-
/* @__PURE__ */ (0,
|
|
2852
|
-
/* @__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)(
|
|
2853
2806
|
"div",
|
|
2854
2807
|
{
|
|
2855
2808
|
style: {
|
|
@@ -2865,8 +2818,8 @@ function AdminStudioPageEditView(props) {
|
|
|
2865
2818
|
}
|
|
2866
2819
|
)
|
|
2867
2820
|
] }),
|
|
2868
|
-
/* @__PURE__ */ (0,
|
|
2869
|
-
/* @__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)(
|
|
2870
2823
|
"button",
|
|
2871
2824
|
{
|
|
2872
2825
|
disabled: saving !== null,
|
|
@@ -2882,7 +2835,7 @@ function AdminStudioPageEditView(props) {
|
|
|
2882
2835
|
children: saving === "draft" ? "Saving\u2026" : "Save Draft"
|
|
2883
2836
|
}
|
|
2884
2837
|
),
|
|
2885
|
-
/* @__PURE__ */ (0,
|
|
2838
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2886
2839
|
"button",
|
|
2887
2840
|
{
|
|
2888
2841
|
disabled: !canPublish || saving !== null,
|
|
@@ -2905,7 +2858,7 @@ function AdminStudioPageEditView(props) {
|
|
|
2905
2858
|
]
|
|
2906
2859
|
}
|
|
2907
2860
|
),
|
|
2908
|
-
/* @__PURE__ */ (0,
|
|
2861
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2909
2862
|
"iframe",
|
|
2910
2863
|
{
|
|
2911
2864
|
ref: iframeRef,
|
|
@@ -2920,7 +2873,7 @@ function AdminStudioPageEditView(props) {
|
|
|
2920
2873
|
|
|
2921
2874
|
// src/admin/components/studio/AdminStudioGlobalsView.tsx
|
|
2922
2875
|
var import_ui7 = require("@payloadcms/ui");
|
|
2923
|
-
var
|
|
2876
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2924
2877
|
var getPropGlobals = (props) => {
|
|
2925
2878
|
if (!props || typeof props !== "object") return null;
|
|
2926
2879
|
const direct = props.globals;
|
|
@@ -2932,7 +2885,7 @@ var getPropGlobals = (props) => {
|
|
|
2932
2885
|
}
|
|
2933
2886
|
return null;
|
|
2934
2887
|
};
|
|
2935
|
-
var
|
|
2888
|
+
var getPropString5 = (props, key, fallback) => {
|
|
2936
2889
|
if (!props || typeof props !== "object") return fallback;
|
|
2937
2890
|
const direct = props[key];
|
|
2938
2891
|
if (typeof direct === "string" && direct.length > 0) return direct;
|
|
@@ -2944,17 +2897,17 @@ var getPropString4 = (props, key, fallback) => {
|
|
|
2944
2897
|
return fallback;
|
|
2945
2898
|
};
|
|
2946
2899
|
function AdminStudioGlobalsView(props) {
|
|
2947
|
-
const globalsBasePath =
|
|
2900
|
+
const globalsBasePath = getPropString5(props, "globalsBasePath", "/admin/studio-globals");
|
|
2948
2901
|
const globals = getPropGlobals(props) || [
|
|
2949
2902
|
{ slug: "site-settings", label: "Website Settings" },
|
|
2950
2903
|
{ slug: "header", label: "Header & Navigation" },
|
|
2951
2904
|
{ slug: "footer", label: "Footer" }
|
|
2952
2905
|
];
|
|
2953
|
-
return /* @__PURE__ */ (0,
|
|
2954
|
-
/* @__PURE__ */ (0,
|
|
2955
|
-
/* @__PURE__ */ (0,
|
|
2956
|
-
/* @__PURE__ */ (0,
|
|
2957
|
-
/* @__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)(
|
|
2958
2911
|
"a",
|
|
2959
2912
|
{
|
|
2960
2913
|
href: `/admin/globals/${global.slug}`,
|
|
@@ -2967,8 +2920,8 @@ function AdminStudioGlobalsView(props) {
|
|
|
2967
2920
|
textDecoration: "none"
|
|
2968
2921
|
},
|
|
2969
2922
|
children: [
|
|
2970
|
-
/* @__PURE__ */ (0,
|
|
2971
|
-
/* @__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: [
|
|
2972
2925
|
"/admin/globals/",
|
|
2973
2926
|
global.slug
|
|
2974
2927
|
] })
|
|
@@ -2976,7 +2929,7 @@ function AdminStudioGlobalsView(props) {
|
|
|
2976
2929
|
},
|
|
2977
2930
|
global.slug
|
|
2978
2931
|
)) }),
|
|
2979
|
-
/* @__PURE__ */ (0,
|
|
2932
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { marginTop: "1rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2980
2933
|
"a",
|
|
2981
2934
|
{
|
|
2982
2935
|
href: globalsBasePath,
|
|
@@ -2989,8 +2942,8 @@ function AdminStudioGlobalsView(props) {
|
|
|
2989
2942
|
|
|
2990
2943
|
// src/admin/components/studio/AdminStudioMediaView.tsx
|
|
2991
2944
|
var import_ui8 = require("@payloadcms/ui");
|
|
2992
|
-
var
|
|
2993
|
-
var
|
|
2945
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2946
|
+
var getPropString6 = (props, key, fallback) => {
|
|
2994
2947
|
if (!props || typeof props !== "object") return fallback;
|
|
2995
2948
|
const direct = props[key];
|
|
2996
2949
|
if (typeof direct === "string" && direct.length > 0) return direct;
|
|
@@ -3002,12 +2955,12 @@ var getPropString5 = (props, key, fallback) => {
|
|
|
3002
2955
|
return fallback;
|
|
3003
2956
|
};
|
|
3004
2957
|
function AdminStudioMediaView(props) {
|
|
3005
|
-
const mediaCollectionSlug =
|
|
3006
|
-
return /* @__PURE__ */ (0,
|
|
3007
|
-
/* @__PURE__ */ (0,
|
|
3008
|
-
/* @__PURE__ */ (0,
|
|
3009
|
-
/* @__PURE__ */ (0,
|
|
3010
|
-
/* @__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)(
|
|
3011
2964
|
"a",
|
|
3012
2965
|
{
|
|
3013
2966
|
href: `/admin/collections/${mediaCollectionSlug}`,
|
|
@@ -3020,8 +2973,8 @@ function AdminStudioMediaView(props) {
|
|
|
3020
2973
|
textDecoration: "none"
|
|
3021
2974
|
},
|
|
3022
2975
|
children: [
|
|
3023
|
-
/* @__PURE__ */ (0,
|
|
3024
|
-
/* @__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: [
|
|
3025
2978
|
"/admin/collections/",
|
|
3026
2979
|
mediaCollectionSlug
|
|
3027
2980
|
] })
|
|
@@ -3033,13 +2986,13 @@ function AdminStudioMediaView(props) {
|
|
|
3033
2986
|
|
|
3034
2987
|
// src/admin/components/studio/AdminStudioToolsView.tsx
|
|
3035
2988
|
var import_ui9 = require("@payloadcms/ui");
|
|
3036
|
-
var
|
|
2989
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
3037
2990
|
var isAdmin4 = (user) => {
|
|
3038
2991
|
if (!user || typeof user !== "object") return false;
|
|
3039
2992
|
const role = user.role;
|
|
3040
2993
|
return typeof role === "string" && role === "admin";
|
|
3041
2994
|
};
|
|
3042
|
-
var
|
|
2995
|
+
var getPropString7 = (props, key, fallback) => {
|
|
3043
2996
|
if (!props || typeof props !== "object") return fallback;
|
|
3044
2997
|
const direct = props[key];
|
|
3045
2998
|
if (typeof direct === "string" && direct.length > 0) return direct;
|
|
@@ -3053,14 +3006,14 @@ var getPropString6 = (props, key, fallback) => {
|
|
|
3053
3006
|
function AdminStudioToolsView(props) {
|
|
3054
3007
|
const { user } = (0, import_ui9.useAuth)();
|
|
3055
3008
|
if (!isAdmin4(user)) {
|
|
3056
|
-
return /* @__PURE__ */ (0,
|
|
3057
|
-
/* @__PURE__ */ (0,
|
|
3058
|
-
/* @__PURE__ */ (0,
|
|
3059
|
-
/* @__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." })
|
|
3060
3013
|
] });
|
|
3061
3014
|
}
|
|
3062
|
-
const pagesCollectionSlug =
|
|
3063
|
-
const mediaCollectionSlug =
|
|
3015
|
+
const pagesCollectionSlug = getPropString7(props, "pagesCollectionSlug", "pages");
|
|
3016
|
+
const mediaCollectionSlug = getPropString7(props, "mediaCollectionSlug", "media");
|
|
3064
3017
|
const links = [
|
|
3065
3018
|
{ href: `/admin/collections/${pagesCollectionSlug}`, label: "Raw Pages Collection" },
|
|
3066
3019
|
{ href: `/admin/collections/${mediaCollectionSlug}`, label: "Raw Media Collection" },
|
|
@@ -3069,11 +3022,11 @@ function AdminStudioToolsView(props) {
|
|
|
3069
3022
|
{ href: "/admin/globals/footer", label: "Raw Footer Global" },
|
|
3070
3023
|
{ href: "/admin/collections/users", label: "Users / Roles" }
|
|
3071
3024
|
];
|
|
3072
|
-
return /* @__PURE__ */ (0,
|
|
3073
|
-
/* @__PURE__ */ (0,
|
|
3074
|
-
/* @__PURE__ */ (0,
|
|
3075
|
-
/* @__PURE__ */ (0,
|
|
3076
|
-
/* @__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)(
|
|
3077
3030
|
"a",
|
|
3078
3031
|
{
|
|
3079
3032
|
href: link.href,
|
|
@@ -3086,8 +3039,8 @@ function AdminStudioToolsView(props) {
|
|
|
3086
3039
|
textDecoration: "none"
|
|
3087
3040
|
},
|
|
3088
3041
|
children: [
|
|
3089
|
-
/* @__PURE__ */ (0,
|
|
3090
|
-
/* @__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 })
|
|
3091
3044
|
]
|
|
3092
3045
|
},
|
|
3093
3046
|
link.href
|
|
@@ -3097,14 +3050,14 @@ function AdminStudioToolsView(props) {
|
|
|
3097
3050
|
|
|
3098
3051
|
// src/admin/components/studio/OpenInStudioMenuItem.tsx
|
|
3099
3052
|
var import_ui10 = require("@payloadcms/ui");
|
|
3100
|
-
var
|
|
3101
|
-
function OpenInStudioMenuItem({ pagesPathBase = "/
|
|
3053
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
3054
|
+
function OpenInStudioMenuItem({ pagesPathBase = "/studio/pages" }) {
|
|
3102
3055
|
const documentInfo = (0, import_ui10.useDocumentInfo)();
|
|
3103
3056
|
const id = documentInfo?.id;
|
|
3104
3057
|
if (!id) {
|
|
3105
3058
|
return null;
|
|
3106
3059
|
}
|
|
3107
|
-
return /* @__PURE__ */ (0,
|
|
3060
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3108
3061
|
"a",
|
|
3109
3062
|
{
|
|
3110
3063
|
href: `${pagesPathBase}/${id}`,
|
|
@@ -3123,19 +3076,19 @@ function OpenInStudioMenuItem({ pagesPathBase = "/admin/pages" }) {
|
|
|
3123
3076
|
}
|
|
3124
3077
|
|
|
3125
3078
|
// src/admin/components/studio/PageEditRedirectToStudio.tsx
|
|
3126
|
-
var
|
|
3079
|
+
var import_react14 = require("react");
|
|
3127
3080
|
var import_ui11 = require("@payloadcms/ui");
|
|
3128
|
-
var
|
|
3129
|
-
function PageEditRedirectToStudio({ pagesPathBase = "/
|
|
3081
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
3082
|
+
function PageEditRedirectToStudio({ pagesPathBase = "/studio/pages" }) {
|
|
3130
3083
|
const documentInfo = (0, import_ui11.useDocumentInfo)();
|
|
3131
3084
|
const id = documentInfo?.id;
|
|
3132
|
-
(0,
|
|
3085
|
+
(0, import_react14.useEffect)(() => {
|
|
3133
3086
|
if (!id) {
|
|
3134
3087
|
return;
|
|
3135
3088
|
}
|
|
3136
3089
|
window.location.replace(`${pagesPathBase}/${id}`);
|
|
3137
3090
|
}, [id, pagesPathBase]);
|
|
3138
|
-
return /* @__PURE__ */ (0,
|
|
3091
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
3139
3092
|
"div",
|
|
3140
3093
|
{
|
|
3141
3094
|
style: {
|
|
@@ -3147,9 +3100,9 @@ function PageEditRedirectToStudio({ pagesPathBase = "/admin/pages" }) {
|
|
|
3147
3100
|
minHeight: "50vh"
|
|
3148
3101
|
},
|
|
3149
3102
|
children: [
|
|
3150
|
-
/* @__PURE__ */ (0,
|
|
3151
|
-
/* @__PURE__ */ (0,
|
|
3152
|
-
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" })
|
|
3153
3106
|
]
|
|
3154
3107
|
}
|
|
3155
3108
|
);
|
|
@@ -3158,7 +3111,7 @@ function PageEditRedirectToStudio({ pagesPathBase = "/admin/pages" }) {
|
|
|
3158
3111
|
// src/admin/components/studio/StudioBackBreadcrumb.tsx
|
|
3159
3112
|
var import_ui12 = require("@payloadcms/ui");
|
|
3160
3113
|
var import_navigation = require("next/navigation");
|
|
3161
|
-
var
|
|
3114
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
3162
3115
|
var toTitle = (slug) => slug.split("-").filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
|
|
3163
3116
|
var buildNav = (pathname) => {
|
|
3164
3117
|
if (pathname.includes("/globals/")) {
|
|
@@ -3171,19 +3124,19 @@ var buildNav = (pathname) => {
|
|
|
3171
3124
|
}
|
|
3172
3125
|
if (pathname.includes("/collections/pages") || pathname.startsWith("/admin/pages/")) {
|
|
3173
3126
|
return [
|
|
3174
|
-
{ label: "Pages", url: "/admin/pages" },
|
|
3127
|
+
{ label: "Pages", url: "/admin/collections/pages" },
|
|
3175
3128
|
{ label: "Page" }
|
|
3176
3129
|
];
|
|
3177
3130
|
}
|
|
3178
3131
|
if (pathname.includes("/collections/media")) {
|
|
3179
3132
|
return [
|
|
3180
|
-
{ label: "Media", url: "/admin/media" },
|
|
3133
|
+
{ label: "Media", url: "/admin/collections/media" },
|
|
3181
3134
|
{ label: "Media Item" }
|
|
3182
3135
|
];
|
|
3183
3136
|
}
|
|
3184
|
-
if (pathname.startsWith("/admin/tools")) {
|
|
3137
|
+
if (pathname.startsWith("/admin/tools") || pathname.includes("/collections/users")) {
|
|
3185
3138
|
return [
|
|
3186
|
-
{ label: "Admin Tools", url: "/admin/
|
|
3139
|
+
{ label: "Admin Tools", url: "/admin/collections/users" },
|
|
3187
3140
|
{ label: "Tool" }
|
|
3188
3141
|
];
|
|
3189
3142
|
}
|
|
@@ -3193,7 +3146,7 @@ function StudioBackBreadcrumb() {
|
|
|
3193
3146
|
const pathname = (0, import_navigation.usePathname)();
|
|
3194
3147
|
const nav = buildNav(pathname);
|
|
3195
3148
|
if (!nav) return null;
|
|
3196
|
-
return /* @__PURE__ */ (0,
|
|
3149
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_ui12.SetStepNav, { nav });
|
|
3197
3150
|
}
|
|
3198
3151
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3199
3152
|
0 && (module.exports = {
|