@orion-studios/payload-studio 0.6.0-beta.1 → 0.6.0-beta.2
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.d.mts +1 -0
- package/dist/admin/client.d.ts +1 -0
- package/dist/admin/client.js +1087 -987
- package/dist/admin/client.mjs +752 -653
- package/dist/admin/index.d.mts +1 -1
- package/dist/admin/index.d.ts +1 -1
- package/dist/admin/index.js +6 -0
- package/dist/admin/index.mjs +1 -1
- package/dist/admin-app/styles.css +59 -0
- package/dist/{chunk-Q2HGC67S.mjs → chunk-QJAWO6K3.mjs} +6 -0
- package/dist/{index-BMitiKK8.d.ts → index-B6_D4Hm4.d.ts} +4 -0
- package/dist/{index-D_b24Gef.d.mts → index-CYaWadBl.d.mts} +4 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -0
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/admin/client.mjs
CHANGED
|
@@ -258,14 +258,112 @@ function AdminLoginIntro({ brandName = "Orion Studio", logoUrl } = {}) {
|
|
|
258
258
|
] });
|
|
259
259
|
}
|
|
260
260
|
|
|
261
|
+
// src/admin/components/AdminLoginPasswordToggle.tsx
|
|
262
|
+
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
263
|
+
import { createPortal } from "react-dom";
|
|
264
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
265
|
+
var loginPasswordSelector = '.template-minimal.login .login__form input[name="password"]';
|
|
266
|
+
function EyeIcon({ crossed = false }) {
|
|
267
|
+
return /* @__PURE__ */ jsxs4(
|
|
268
|
+
"svg",
|
|
269
|
+
{
|
|
270
|
+
"aria-hidden": "true",
|
|
271
|
+
fill: "none",
|
|
272
|
+
height: "18",
|
|
273
|
+
stroke: "currentColor",
|
|
274
|
+
strokeLinecap: "round",
|
|
275
|
+
strokeLinejoin: "round",
|
|
276
|
+
strokeWidth: "1.9",
|
|
277
|
+
viewBox: "0 0 24 24",
|
|
278
|
+
width: "18",
|
|
279
|
+
children: [
|
|
280
|
+
/* @__PURE__ */ jsx4("path", { d: "M2 12s3.6-6 10-6 10 6 10 6-3.6 6-10 6S2 12 2 12Z" }),
|
|
281
|
+
/* @__PURE__ */ jsx4("circle", { cx: "12", cy: "12", r: "2.75" }),
|
|
282
|
+
crossed ? /* @__PURE__ */ jsx4("path", { d: "M4 4l16 16" }) : null
|
|
283
|
+
]
|
|
284
|
+
}
|
|
285
|
+
);
|
|
286
|
+
}
|
|
287
|
+
function AdminLoginPasswordToggle() {
|
|
288
|
+
const [hostEl, setHostEl] = useState2(null);
|
|
289
|
+
const [inputEl, setInputEl] = useState2(null);
|
|
290
|
+
const [portalEl, setPortalEl] = useState2(null);
|
|
291
|
+
const [visible, setVisible] = useState2(false);
|
|
292
|
+
useEffect2(() => {
|
|
293
|
+
const sync = () => {
|
|
294
|
+
const nextInput = document.querySelector(loginPasswordSelector);
|
|
295
|
+
const nextHost = nextInput?.parentElement ?? null;
|
|
296
|
+
setInputEl((current) => current === nextInput ? current : nextInput);
|
|
297
|
+
setHostEl((current) => current === nextHost ? current : nextHost);
|
|
298
|
+
};
|
|
299
|
+
sync();
|
|
300
|
+
const observer = new MutationObserver(sync);
|
|
301
|
+
observer.observe(document.body, {
|
|
302
|
+
childList: true,
|
|
303
|
+
subtree: true
|
|
304
|
+
});
|
|
305
|
+
return () => observer.disconnect();
|
|
306
|
+
}, []);
|
|
307
|
+
useEffect2(() => {
|
|
308
|
+
setVisible(false);
|
|
309
|
+
}, [inputEl]);
|
|
310
|
+
useEffect2(() => {
|
|
311
|
+
if (!inputEl) {
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
inputEl.type = visible ? "text" : "password";
|
|
315
|
+
return () => {
|
|
316
|
+
inputEl.type = "password";
|
|
317
|
+
};
|
|
318
|
+
}, [inputEl, visible]);
|
|
319
|
+
useEffect2(() => {
|
|
320
|
+
if (!hostEl) {
|
|
321
|
+
setPortalEl(null);
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
const existing = hostEl.querySelector(".orion-admin-password-toggle-slot");
|
|
325
|
+
const slot = existing || document.createElement("div");
|
|
326
|
+
slot.className = "orion-admin-password-toggle-slot";
|
|
327
|
+
if (!slot.parentElement) {
|
|
328
|
+
hostEl.appendChild(slot);
|
|
329
|
+
}
|
|
330
|
+
setPortalEl(slot);
|
|
331
|
+
return () => {
|
|
332
|
+
if (slot.parentElement === hostEl) {
|
|
333
|
+
slot.remove();
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
}, [hostEl]);
|
|
337
|
+
if (!inputEl || inputEl.disabled || !portalEl) {
|
|
338
|
+
return null;
|
|
339
|
+
}
|
|
340
|
+
return createPortal(
|
|
341
|
+
/* @__PURE__ */ jsx4(
|
|
342
|
+
"button",
|
|
343
|
+
{
|
|
344
|
+
"aria-label": visible ? "Hide password" : "Show password",
|
|
345
|
+
"aria-pressed": visible,
|
|
346
|
+
className: "orion-admin-password-toggle",
|
|
347
|
+
"data-visible": visible ? "true" : "false",
|
|
348
|
+
onClick: () => setVisible((current) => !current),
|
|
349
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
350
|
+
title: visible ? "Hide password" : "Show password",
|
|
351
|
+
type: "button",
|
|
352
|
+
children: /* @__PURE__ */ jsx4(EyeIcon, { crossed: visible })
|
|
353
|
+
}
|
|
354
|
+
),
|
|
355
|
+
portalEl
|
|
356
|
+
);
|
|
357
|
+
}
|
|
358
|
+
|
|
261
359
|
// src/admin/components/Dashboard.tsx
|
|
262
|
-
import { useEffect as
|
|
360
|
+
import { useEffect as useEffect5, useState as useState5 } from "react";
|
|
263
361
|
|
|
264
362
|
// src/admin/components/ThemeSwitcher.tsx
|
|
265
363
|
import { useLayoutEffect } from "react";
|
|
266
364
|
|
|
267
365
|
// src/admin/hooks/useTheme.ts
|
|
268
|
-
import { useCallback, useEffect as
|
|
366
|
+
import { useCallback, useEffect as useEffect3, useRef, useState as useState3 } from "react";
|
|
269
367
|
var STORAGE_KEY = "orion-admin-theme";
|
|
270
368
|
function applyTheme(theme) {
|
|
271
369
|
const html = document.documentElement;
|
|
@@ -299,12 +397,12 @@ function cacheTheme(theme) {
|
|
|
299
397
|
}
|
|
300
398
|
}
|
|
301
399
|
function useTheme(defaultTheme = "brand-light") {
|
|
302
|
-
const [theme, setThemeState] =
|
|
303
|
-
const [isLoading, setIsLoading] =
|
|
304
|
-
const [hasMounted, setHasMounted] =
|
|
400
|
+
const [theme, setThemeState] = useState3(defaultTheme);
|
|
401
|
+
const [isLoading, setIsLoading] = useState3(true);
|
|
402
|
+
const [hasMounted, setHasMounted] = useState3(false);
|
|
305
403
|
const debounceRef = useRef(null);
|
|
306
404
|
const userIdRef = useRef(null);
|
|
307
|
-
|
|
405
|
+
useEffect3(() => {
|
|
308
406
|
setHasMounted(true);
|
|
309
407
|
const cached = getCachedTheme();
|
|
310
408
|
if (cached) {
|
|
@@ -379,31 +477,31 @@ function useTheme(defaultTheme = "brand-light") {
|
|
|
379
477
|
}
|
|
380
478
|
|
|
381
479
|
// src/admin/components/ThemeSwitcher.tsx
|
|
382
|
-
import { Fragment, jsx as
|
|
480
|
+
import { Fragment, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
383
481
|
var iconSize = 16;
|
|
384
482
|
function SunIcon() {
|
|
385
|
-
return /* @__PURE__ */
|
|
386
|
-
/* @__PURE__ */
|
|
387
|
-
/* @__PURE__ */
|
|
388
|
-
/* @__PURE__ */
|
|
389
|
-
/* @__PURE__ */
|
|
390
|
-
/* @__PURE__ */
|
|
391
|
-
/* @__PURE__ */
|
|
392
|
-
/* @__PURE__ */
|
|
393
|
-
/* @__PURE__ */
|
|
394
|
-
/* @__PURE__ */
|
|
483
|
+
return /* @__PURE__ */ jsxs5("svg", { width: iconSize, height: iconSize, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
484
|
+
/* @__PURE__ */ jsx5("circle", { cx: "12", cy: "12", r: "5" }),
|
|
485
|
+
/* @__PURE__ */ jsx5("line", { x1: "12", y1: "1", x2: "12", y2: "3" }),
|
|
486
|
+
/* @__PURE__ */ jsx5("line", { x1: "12", y1: "21", x2: "12", y2: "23" }),
|
|
487
|
+
/* @__PURE__ */ jsx5("line", { x1: "4.22", y1: "4.22", x2: "5.64", y2: "5.64" }),
|
|
488
|
+
/* @__PURE__ */ jsx5("line", { x1: "18.36", y1: "18.36", x2: "19.78", y2: "19.78" }),
|
|
489
|
+
/* @__PURE__ */ jsx5("line", { x1: "1", y1: "12", x2: "3", y2: "12" }),
|
|
490
|
+
/* @__PURE__ */ jsx5("line", { x1: "21", y1: "12", x2: "23", y2: "12" }),
|
|
491
|
+
/* @__PURE__ */ jsx5("line", { x1: "4.22", y1: "19.78", x2: "5.64", y2: "18.36" }),
|
|
492
|
+
/* @__PURE__ */ jsx5("line", { x1: "18.36", y1: "5.64", x2: "19.78", y2: "4.22" })
|
|
395
493
|
] });
|
|
396
494
|
}
|
|
397
495
|
function MoonIcon() {
|
|
398
|
-
return /* @__PURE__ */
|
|
496
|
+
return /* @__PURE__ */ jsx5("svg", { width: iconSize, height: iconSize, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx5("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }) });
|
|
399
497
|
}
|
|
400
498
|
function PaletteIcon() {
|
|
401
|
-
return /* @__PURE__ */
|
|
402
|
-
/* @__PURE__ */
|
|
403
|
-
/* @__PURE__ */
|
|
404
|
-
/* @__PURE__ */
|
|
405
|
-
/* @__PURE__ */
|
|
406
|
-
/* @__PURE__ */
|
|
499
|
+
return /* @__PURE__ */ jsxs5("svg", { width: iconSize, height: iconSize, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
500
|
+
/* @__PURE__ */ jsx5("circle", { cx: "13.5", cy: "6.5", r: "0.5", fill: "currentColor" }),
|
|
501
|
+
/* @__PURE__ */ jsx5("circle", { cx: "17.5", cy: "10.5", r: "0.5", fill: "currentColor" }),
|
|
502
|
+
/* @__PURE__ */ jsx5("circle", { cx: "8.5", cy: "7.5", r: "0.5", fill: "currentColor" }),
|
|
503
|
+
/* @__PURE__ */ jsx5("circle", { cx: "6.5", cy: "12", r: "0.5", fill: "currentColor" }),
|
|
504
|
+
/* @__PURE__ */ jsx5("path", { d: "M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z" })
|
|
407
505
|
] });
|
|
408
506
|
}
|
|
409
507
|
var buttonBase = {
|
|
@@ -438,7 +536,7 @@ function ThemeSwitcher({
|
|
|
438
536
|
const { isDark, isBrand, hasMounted, toggleDarkMode, toggleBrandMode } = useTheme(defaultTheme);
|
|
439
537
|
const showDark = hasMounted && isDark;
|
|
440
538
|
const showBrand = hasMounted && isBrand;
|
|
441
|
-
return /* @__PURE__ */
|
|
539
|
+
return /* @__PURE__ */ jsxs5(
|
|
442
540
|
"div",
|
|
443
541
|
{
|
|
444
542
|
style: {
|
|
@@ -448,7 +546,7 @@ function ThemeSwitcher({
|
|
|
448
546
|
padding: "8px 12px"
|
|
449
547
|
},
|
|
450
548
|
children: [
|
|
451
|
-
/* @__PURE__ */
|
|
549
|
+
/* @__PURE__ */ jsx5(
|
|
452
550
|
"button",
|
|
453
551
|
{
|
|
454
552
|
type: "button",
|
|
@@ -456,10 +554,10 @@ function ThemeSwitcher({
|
|
|
456
554
|
style: showDark ? buttonActive : buttonBase,
|
|
457
555
|
title: showDark ? "Switch to light mode" : "Switch to dark mode",
|
|
458
556
|
"aria-label": showDark ? "Switch to light mode" : "Switch to dark mode",
|
|
459
|
-
children: showDark ? /* @__PURE__ */
|
|
557
|
+
children: showDark ? /* @__PURE__ */ jsx5(MoonIcon, {}) : /* @__PURE__ */ jsx5(SunIcon, {})
|
|
460
558
|
}
|
|
461
559
|
),
|
|
462
|
-
/* @__PURE__ */
|
|
560
|
+
/* @__PURE__ */ jsx5(
|
|
463
561
|
"button",
|
|
464
562
|
{
|
|
465
563
|
type: "button",
|
|
@@ -467,7 +565,7 @@ function ThemeSwitcher({
|
|
|
467
565
|
style: showBrand ? buttonActive : buttonBase,
|
|
468
566
|
title: showBrand ? "Switch to standard colors" : "Switch to brand colors",
|
|
469
567
|
"aria-label": showBrand ? "Switch to standard colors" : "Switch to brand colors",
|
|
470
|
-
children: /* @__PURE__ */
|
|
568
|
+
children: /* @__PURE__ */ jsx5(PaletteIcon, {})
|
|
471
569
|
}
|
|
472
570
|
)
|
|
473
571
|
]
|
|
@@ -519,24 +617,24 @@ function ThemeProvider({
|
|
|
519
617
|
} catch {
|
|
520
618
|
}
|
|
521
619
|
}, [allowThemePreference, defaultTheme]);
|
|
522
|
-
return /* @__PURE__ */
|
|
620
|
+
return /* @__PURE__ */ jsx5(Fragment, { children });
|
|
523
621
|
}
|
|
524
622
|
|
|
525
623
|
// src/admin/components/HelpTooltip.tsx
|
|
526
|
-
import { useCallback as useCallback2, useEffect as
|
|
527
|
-
import { jsx as
|
|
624
|
+
import { useCallback as useCallback2, useEffect as useEffect4, useRef as useRef2, useState as useState4 } from "react";
|
|
625
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
528
626
|
function HelpTooltip({
|
|
529
627
|
content,
|
|
530
628
|
position = "top"
|
|
531
629
|
}) {
|
|
532
|
-
const [isVisible, setIsVisible] =
|
|
630
|
+
const [isVisible, setIsVisible] = useState4(false);
|
|
533
631
|
const triggerRef = useRef2(null);
|
|
534
632
|
const tooltipRef = useRef2(null);
|
|
535
633
|
const tooltipId = useRef2(`tooltip-${Math.random().toString(36).slice(2, 9)}`);
|
|
536
634
|
const show = useCallback2(() => setIsVisible(true), []);
|
|
537
635
|
const hide = useCallback2(() => setIsVisible(false), []);
|
|
538
636
|
const toggle = useCallback2(() => setIsVisible((v) => !v), []);
|
|
539
|
-
|
|
637
|
+
useEffect4(() => {
|
|
540
638
|
if (!isVisible) return;
|
|
541
639
|
const handleKeyDown = (e) => {
|
|
542
640
|
if (e.key === "Escape") setIsVisible(false);
|
|
@@ -544,7 +642,7 @@ function HelpTooltip({
|
|
|
544
642
|
document.addEventListener("keydown", handleKeyDown);
|
|
545
643
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
546
644
|
}, [isVisible]);
|
|
547
|
-
|
|
645
|
+
useEffect4(() => {
|
|
548
646
|
if (!isVisible) return;
|
|
549
647
|
const handleClick = (e) => {
|
|
550
648
|
if (triggerRef.current && !triggerRef.current.contains(e.target) && tooltipRef.current && !tooltipRef.current.contains(e.target)) {
|
|
@@ -560,8 +658,8 @@ function HelpTooltip({
|
|
|
560
658
|
left: { right: "100%", top: "50%", transform: "translateY(-50%)", marginRight: 8 },
|
|
561
659
|
right: { left: "100%", top: "50%", transform: "translateY(-50%)", marginLeft: 8 }
|
|
562
660
|
};
|
|
563
|
-
return /* @__PURE__ */
|
|
564
|
-
/* @__PURE__ */
|
|
661
|
+
return /* @__PURE__ */ jsxs6("span", { style: { position: "relative", display: "inline-flex", verticalAlign: "middle", marginLeft: 6 }, children: [
|
|
662
|
+
/* @__PURE__ */ jsx6(
|
|
565
663
|
"button",
|
|
566
664
|
{
|
|
567
665
|
ref: triggerRef,
|
|
@@ -597,7 +695,7 @@ function HelpTooltip({
|
|
|
597
695
|
children: "?"
|
|
598
696
|
}
|
|
599
697
|
),
|
|
600
|
-
isVisible && /* @__PURE__ */
|
|
698
|
+
isVisible && /* @__PURE__ */ jsx6(
|
|
601
699
|
"div",
|
|
602
700
|
{
|
|
603
701
|
ref: tooltipRef,
|
|
@@ -627,7 +725,7 @@ function HelpTooltip({
|
|
|
627
725
|
}
|
|
628
726
|
|
|
629
727
|
// src/admin/components/StatusBadge.tsx
|
|
630
|
-
import { jsx as
|
|
728
|
+
import { jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
631
729
|
var statusConfig = {
|
|
632
730
|
draft: { label: "Draft" },
|
|
633
731
|
published: { label: "Published" },
|
|
@@ -639,7 +737,7 @@ function StatusBadge({
|
|
|
639
737
|
}) {
|
|
640
738
|
const config = statusConfig[status];
|
|
641
739
|
const isSm = size === "sm";
|
|
642
|
-
return /* @__PURE__ */
|
|
740
|
+
return /* @__PURE__ */ jsxs7(
|
|
643
741
|
"span",
|
|
644
742
|
{
|
|
645
743
|
style: {
|
|
@@ -656,7 +754,7 @@ function StatusBadge({
|
|
|
656
754
|
whiteSpace: "nowrap"
|
|
657
755
|
},
|
|
658
756
|
children: [
|
|
659
|
-
/* @__PURE__ */
|
|
757
|
+
/* @__PURE__ */ jsx7(
|
|
660
758
|
"span",
|
|
661
759
|
{
|
|
662
760
|
style: {
|
|
@@ -675,46 +773,46 @@ function StatusBadge({
|
|
|
675
773
|
}
|
|
676
774
|
|
|
677
775
|
// src/admin/components/Dashboard.tsx
|
|
678
|
-
import { jsx as
|
|
776
|
+
import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
679
777
|
function PagesIcon({ size = 24 }) {
|
|
680
|
-
return /* @__PURE__ */
|
|
681
|
-
/* @__PURE__ */
|
|
682
|
-
/* @__PURE__ */
|
|
683
|
-
/* @__PURE__ */
|
|
684
|
-
/* @__PURE__ */
|
|
685
|
-
/* @__PURE__ */
|
|
778
|
+
return /* @__PURE__ */ jsxs8("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
779
|
+
/* @__PURE__ */ jsx8("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
780
|
+
/* @__PURE__ */ jsx8("polyline", { points: "14 2 14 8 20 8" }),
|
|
781
|
+
/* @__PURE__ */ jsx8("line", { x1: "16", y1: "13", x2: "8", y2: "13" }),
|
|
782
|
+
/* @__PURE__ */ jsx8("line", { x1: "16", y1: "17", x2: "8", y2: "17" }),
|
|
783
|
+
/* @__PURE__ */ jsx8("polyline", { points: "10 9 9 9 8 9" })
|
|
686
784
|
] });
|
|
687
785
|
}
|
|
688
786
|
function MediaIcon({ size = 24 }) {
|
|
689
|
-
return /* @__PURE__ */
|
|
690
|
-
/* @__PURE__ */
|
|
691
|
-
/* @__PURE__ */
|
|
692
|
-
/* @__PURE__ */
|
|
787
|
+
return /* @__PURE__ */ jsxs8("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
788
|
+
/* @__PURE__ */ jsx8("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }),
|
|
789
|
+
/* @__PURE__ */ jsx8("circle", { cx: "8.5", cy: "8.5", r: "1.5" }),
|
|
790
|
+
/* @__PURE__ */ jsx8("polyline", { points: "21 15 16 10 5 21" })
|
|
693
791
|
] });
|
|
694
792
|
}
|
|
695
793
|
function SettingsIcon({ size = 24 }) {
|
|
696
|
-
return /* @__PURE__ */
|
|
697
|
-
/* @__PURE__ */
|
|
698
|
-
/* @__PURE__ */
|
|
794
|
+
return /* @__PURE__ */ jsxs8("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
795
|
+
/* @__PURE__ */ jsx8("circle", { cx: "12", cy: "12", r: "3" }),
|
|
796
|
+
/* @__PURE__ */ jsx8("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z" })
|
|
699
797
|
] });
|
|
700
798
|
}
|
|
701
799
|
function LayoutIcon({ size = 24 }) {
|
|
702
|
-
return /* @__PURE__ */
|
|
703
|
-
/* @__PURE__ */
|
|
704
|
-
/* @__PURE__ */
|
|
705
|
-
/* @__PURE__ */
|
|
800
|
+
return /* @__PURE__ */ jsxs8("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
801
|
+
/* @__PURE__ */ jsx8("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }),
|
|
802
|
+
/* @__PURE__ */ jsx8("line", { x1: "3", y1: "9", x2: "21", y2: "9" }),
|
|
803
|
+
/* @__PURE__ */ jsx8("line", { x1: "3", y1: "15", x2: "21", y2: "15" })
|
|
706
804
|
] });
|
|
707
805
|
}
|
|
708
806
|
function PlusIcon({ size = 16 }) {
|
|
709
|
-
return /* @__PURE__ */
|
|
710
|
-
/* @__PURE__ */
|
|
711
|
-
/* @__PURE__ */
|
|
807
|
+
return /* @__PURE__ */ jsxs8("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2.5, strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
808
|
+
/* @__PURE__ */ jsx8("line", { x1: "12", y1: "5", x2: "12", y2: "19" }),
|
|
809
|
+
/* @__PURE__ */ jsx8("line", { x1: "5", y1: "12", x2: "19", y2: "12" })
|
|
712
810
|
] });
|
|
713
811
|
}
|
|
714
812
|
function ClockIcon({ size = 14 }) {
|
|
715
|
-
return /* @__PURE__ */
|
|
716
|
-
/* @__PURE__ */
|
|
717
|
-
/* @__PURE__ */
|
|
813
|
+
return /* @__PURE__ */ jsxs8("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
814
|
+
/* @__PURE__ */ jsx8("circle", { cx: "12", cy: "12", r: "10" }),
|
|
815
|
+
/* @__PURE__ */ jsx8("polyline", { points: "12 6 12 12 16 14" })
|
|
718
816
|
] });
|
|
719
817
|
}
|
|
720
818
|
function getGreeting() {
|
|
@@ -737,11 +835,11 @@ function formatRelativeTime(dateStr) {
|
|
|
737
835
|
return date.toLocaleDateString();
|
|
738
836
|
}
|
|
739
837
|
function Dashboard() {
|
|
740
|
-
const [userName, setUserName] =
|
|
741
|
-
const [recentPages, setRecentPages] =
|
|
742
|
-
const [pageCount, setPageCount] =
|
|
743
|
-
const [mediaCount, setMediaCount] =
|
|
744
|
-
|
|
838
|
+
const [userName, setUserName] = useState5("");
|
|
839
|
+
const [recentPages, setRecentPages] = useState5([]);
|
|
840
|
+
const [pageCount, setPageCount] = useState5(null);
|
|
841
|
+
const [mediaCount, setMediaCount] = useState5(null);
|
|
842
|
+
useEffect5(() => {
|
|
745
843
|
fetch("/api/users/me", { credentials: "include" }).then((res) => res.json()).then((data) => {
|
|
746
844
|
const user = data?.user || data;
|
|
747
845
|
setUserName(user?.fullName || user?.email?.split("@")[0] || "");
|
|
@@ -757,24 +855,24 @@ function Dashboard() {
|
|
|
757
855
|
}).catch(() => {
|
|
758
856
|
});
|
|
759
857
|
}, []);
|
|
760
|
-
return /* @__PURE__ */
|
|
761
|
-
/* @__PURE__ */
|
|
762
|
-
/* @__PURE__ */
|
|
763
|
-
/* @__PURE__ */
|
|
858
|
+
return /* @__PURE__ */ jsxs8("div", { style: { padding: "32px", maxWidth: 1200, margin: "0 auto" }, children: [
|
|
859
|
+
/* @__PURE__ */ jsxs8("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", marginBottom: 32 }, children: [
|
|
860
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
861
|
+
/* @__PURE__ */ jsxs8("h1", { style: { fontSize: 28, fontWeight: 700, color: "var(--admin-text)", margin: "0 0 6px" }, children: [
|
|
764
862
|
getGreeting(),
|
|
765
863
|
userName ? `, ${userName}` : ""
|
|
766
864
|
] }),
|
|
767
|
-
/* @__PURE__ */
|
|
865
|
+
/* @__PURE__ */ jsx8("p", { style: { fontSize: 15, color: "var(--admin-text-muted)", margin: 0 }, children: "Manage your website content and settings from here." })
|
|
768
866
|
] }),
|
|
769
|
-
/* @__PURE__ */
|
|
867
|
+
/* @__PURE__ */ jsx8(ThemeSwitcher, {})
|
|
770
868
|
] }),
|
|
771
|
-
/* @__PURE__ */
|
|
772
|
-
/* @__PURE__ */
|
|
773
|
-
/* @__PURE__ */
|
|
774
|
-
/* @__PURE__ */
|
|
775
|
-
/* @__PURE__ */
|
|
869
|
+
/* @__PURE__ */ jsxs8("div", { style: { display: "flex", gap: 10, marginBottom: 32, flexWrap: "wrap" }, children: [
|
|
870
|
+
/* @__PURE__ */ jsx8(QuickAction, { href: "/admin/collections/pages/create", icon: /* @__PURE__ */ jsx8(PlusIcon, {}), label: "New Page" }),
|
|
871
|
+
/* @__PURE__ */ jsx8(QuickAction, { href: "/admin/collections/media/create", icon: /* @__PURE__ */ jsx8(PlusIcon, {}), label: "Upload Media" }),
|
|
872
|
+
/* @__PURE__ */ jsx8(QuickAction, { href: "/admin/globals/header", icon: /* @__PURE__ */ jsx8(LayoutIcon, { size: 16 }), label: "Edit Navigation" }),
|
|
873
|
+
/* @__PURE__ */ jsx8(QuickAction, { href: "/admin/globals/site-settings", icon: /* @__PURE__ */ jsx8(SettingsIcon, { size: 16 }), label: "Website Settings" })
|
|
776
874
|
] }),
|
|
777
|
-
/* @__PURE__ */
|
|
875
|
+
/* @__PURE__ */ jsxs8(
|
|
778
876
|
"div",
|
|
779
877
|
{
|
|
780
878
|
style: {
|
|
@@ -784,10 +882,10 @@ function Dashboard() {
|
|
|
784
882
|
marginBottom: 32
|
|
785
883
|
},
|
|
786
884
|
children: [
|
|
787
|
-
/* @__PURE__ */
|
|
885
|
+
/* @__PURE__ */ jsx8(
|
|
788
886
|
ContentCard,
|
|
789
887
|
{
|
|
790
|
-
icon: /* @__PURE__ */
|
|
888
|
+
icon: /* @__PURE__ */ jsx8(PagesIcon, {}),
|
|
791
889
|
title: "Pages",
|
|
792
890
|
description: "Create and manage your website pages",
|
|
793
891
|
count: pageCount,
|
|
@@ -799,10 +897,10 @@ function Dashboard() {
|
|
|
799
897
|
]
|
|
800
898
|
}
|
|
801
899
|
),
|
|
802
|
-
/* @__PURE__ */
|
|
900
|
+
/* @__PURE__ */ jsx8(
|
|
803
901
|
ContentCard,
|
|
804
902
|
{
|
|
805
|
-
icon: /* @__PURE__ */
|
|
903
|
+
icon: /* @__PURE__ */ jsx8(MediaIcon, {}),
|
|
806
904
|
title: "Media Library",
|
|
807
905
|
description: "Upload and organize images and files",
|
|
808
906
|
count: mediaCount,
|
|
@@ -814,10 +912,10 @@ function Dashboard() {
|
|
|
814
912
|
]
|
|
815
913
|
}
|
|
816
914
|
),
|
|
817
|
-
/* @__PURE__ */
|
|
915
|
+
/* @__PURE__ */ jsx8(
|
|
818
916
|
ContentCard,
|
|
819
917
|
{
|
|
820
|
-
icon: /* @__PURE__ */
|
|
918
|
+
icon: /* @__PURE__ */ jsx8(LayoutIcon, {}),
|
|
821
919
|
title: "Site Design",
|
|
822
920
|
description: "Customize your header, footer, and site-wide settings",
|
|
823
921
|
tooltip: "These settings apply to every page on your website \u2014 your navigation menu, footer information, and global SEO settings.",
|
|
@@ -831,7 +929,7 @@ function Dashboard() {
|
|
|
831
929
|
]
|
|
832
930
|
}
|
|
833
931
|
),
|
|
834
|
-
recentPages.length > 0 && /* @__PURE__ */
|
|
932
|
+
recentPages.length > 0 && /* @__PURE__ */ jsxs8(
|
|
835
933
|
"div",
|
|
836
934
|
{
|
|
837
935
|
style: {
|
|
@@ -841,7 +939,7 @@ function Dashboard() {
|
|
|
841
939
|
overflow: "hidden"
|
|
842
940
|
},
|
|
843
941
|
children: [
|
|
844
|
-
/* @__PURE__ */
|
|
942
|
+
/* @__PURE__ */ jsxs8(
|
|
845
943
|
"div",
|
|
846
944
|
{
|
|
847
945
|
style: {
|
|
@@ -852,11 +950,11 @@ function Dashboard() {
|
|
|
852
950
|
justifyContent: "space-between"
|
|
853
951
|
},
|
|
854
952
|
children: [
|
|
855
|
-
/* @__PURE__ */
|
|
856
|
-
/* @__PURE__ */
|
|
953
|
+
/* @__PURE__ */ jsxs8("h3", { style: { fontSize: 15, fontWeight: 600, color: "var(--admin-text)", margin: 0, display: "flex", alignItems: "center", gap: 6 }, children: [
|
|
954
|
+
/* @__PURE__ */ jsx8(ClockIcon, {}),
|
|
857
955
|
" Recently Edited"
|
|
858
956
|
] }),
|
|
859
|
-
/* @__PURE__ */
|
|
957
|
+
/* @__PURE__ */ jsx8(
|
|
860
958
|
"a",
|
|
861
959
|
{
|
|
862
960
|
href: "/admin/collections/pages",
|
|
@@ -867,7 +965,7 @@ function Dashboard() {
|
|
|
867
965
|
]
|
|
868
966
|
}
|
|
869
967
|
),
|
|
870
|
-
recentPages.map((page, i) => /* @__PURE__ */
|
|
968
|
+
recentPages.map((page, i) => /* @__PURE__ */ jsxs8(
|
|
871
969
|
"a",
|
|
872
970
|
{
|
|
873
971
|
href: `/admin/collections/pages/${page.id}`,
|
|
@@ -887,13 +985,13 @@ function Dashboard() {
|
|
|
887
985
|
e.currentTarget.style.backgroundColor = "transparent";
|
|
888
986
|
},
|
|
889
987
|
children: [
|
|
890
|
-
/* @__PURE__ */
|
|
891
|
-
/* @__PURE__ */
|
|
892
|
-
/* @__PURE__ */
|
|
988
|
+
/* @__PURE__ */ jsxs8("div", { style: { display: "flex", alignItems: "center", gap: 12, minWidth: 0 }, children: [
|
|
989
|
+
/* @__PURE__ */ jsx8(PagesIcon, { size: 16 }),
|
|
990
|
+
/* @__PURE__ */ jsx8("span", { style: { fontSize: 14, fontWeight: 500, color: "var(--admin-text)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: page.title || page.slug || "Untitled" })
|
|
893
991
|
] }),
|
|
894
|
-
/* @__PURE__ */
|
|
895
|
-
page._status && /* @__PURE__ */
|
|
896
|
-
/* @__PURE__ */
|
|
992
|
+
/* @__PURE__ */ jsxs8("div", { style: { display: "flex", alignItems: "center", gap: 12, flexShrink: 0 }, children: [
|
|
993
|
+
page._status && /* @__PURE__ */ jsx8(StatusBadge, { status: page._status, size: "sm" }),
|
|
994
|
+
/* @__PURE__ */ jsx8("span", { style: { fontSize: 12, color: "var(--admin-text-muted)", whiteSpace: "nowrap" }, children: formatRelativeTime(page.updatedAt) })
|
|
897
995
|
] })
|
|
898
996
|
]
|
|
899
997
|
},
|
|
@@ -905,7 +1003,7 @@ function Dashboard() {
|
|
|
905
1003
|
] });
|
|
906
1004
|
}
|
|
907
1005
|
function QuickAction({ href, icon, label }) {
|
|
908
|
-
return /* @__PURE__ */
|
|
1006
|
+
return /* @__PURE__ */ jsxs8(
|
|
909
1007
|
"a",
|
|
910
1008
|
{
|
|
911
1009
|
href,
|
|
@@ -950,7 +1048,7 @@ function ContentCard({
|
|
|
950
1048
|
tooltip,
|
|
951
1049
|
actions
|
|
952
1050
|
}) {
|
|
953
|
-
return /* @__PURE__ */
|
|
1051
|
+
return /* @__PURE__ */ jsxs8(
|
|
954
1052
|
"div",
|
|
955
1053
|
{
|
|
956
1054
|
style: {
|
|
@@ -965,8 +1063,8 @@ function ContentCard({
|
|
|
965
1063
|
transition: "all 0.2s ease"
|
|
966
1064
|
},
|
|
967
1065
|
children: [
|
|
968
|
-
/* @__PURE__ */
|
|
969
|
-
/* @__PURE__ */
|
|
1066
|
+
/* @__PURE__ */ jsx8("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between" }, children: /* @__PURE__ */ jsxs8("div", { style: { display: "flex", alignItems: "center", gap: 12 }, children: [
|
|
1067
|
+
/* @__PURE__ */ jsx8(
|
|
970
1068
|
"div",
|
|
971
1069
|
{
|
|
972
1070
|
style: {
|
|
@@ -982,20 +1080,20 @@ function ContentCard({
|
|
|
982
1080
|
children: icon
|
|
983
1081
|
}
|
|
984
1082
|
),
|
|
985
|
-
/* @__PURE__ */
|
|
986
|
-
/* @__PURE__ */
|
|
1083
|
+
/* @__PURE__ */ jsxs8("div", { children: [
|
|
1084
|
+
/* @__PURE__ */ jsxs8("h3", { style: { fontSize: 16, fontWeight: 600, color: "var(--admin-text)", margin: 0, display: "flex", alignItems: "center" }, children: [
|
|
987
1085
|
title,
|
|
988
|
-
tooltip && /* @__PURE__ */
|
|
1086
|
+
tooltip && /* @__PURE__ */ jsx8(HelpTooltip, { content: tooltip, position: "right" })
|
|
989
1087
|
] }),
|
|
990
|
-
count !== void 0 && count !== null && /* @__PURE__ */
|
|
1088
|
+
count !== void 0 && count !== null && /* @__PURE__ */ jsxs8("span", { style: { fontSize: 12, color: "var(--admin-text-muted)" }, children: [
|
|
991
1089
|
count,
|
|
992
1090
|
" ",
|
|
993
1091
|
countLabel
|
|
994
1092
|
] })
|
|
995
1093
|
] })
|
|
996
1094
|
] }) }),
|
|
997
|
-
/* @__PURE__ */
|
|
998
|
-
actions && actions.length > 0 && /* @__PURE__ */
|
|
1095
|
+
/* @__PURE__ */ jsx8("p", { style: { fontSize: 13, color: "var(--admin-text-muted)", margin: 0, lineHeight: 1.5 }, children: description }),
|
|
1096
|
+
actions && actions.length > 0 && /* @__PURE__ */ jsx8("div", { style: { display: "flex", gap: 8, marginTop: "auto", flexWrap: "wrap" }, children: actions.map((action) => /* @__PURE__ */ jsx8(
|
|
999
1097
|
"a",
|
|
1000
1098
|
{
|
|
1001
1099
|
href: action.href,
|
|
@@ -1027,7 +1125,7 @@ function ContentCard({
|
|
|
1027
1125
|
}
|
|
1028
1126
|
|
|
1029
1127
|
// src/admin/components/EmptyState.tsx
|
|
1030
|
-
import { jsx as
|
|
1128
|
+
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1031
1129
|
function EmptyState({
|
|
1032
1130
|
icon,
|
|
1033
1131
|
title,
|
|
@@ -1035,7 +1133,7 @@ function EmptyState({
|
|
|
1035
1133
|
actionLabel,
|
|
1036
1134
|
actionHref
|
|
1037
1135
|
}) {
|
|
1038
|
-
return /* @__PURE__ */
|
|
1136
|
+
return /* @__PURE__ */ jsxs9(
|
|
1039
1137
|
"div",
|
|
1040
1138
|
{
|
|
1041
1139
|
style: {
|
|
@@ -1050,7 +1148,7 @@ function EmptyState({
|
|
|
1050
1148
|
border: "1px dashed var(--admin-border)"
|
|
1051
1149
|
},
|
|
1052
1150
|
children: [
|
|
1053
|
-
icon && /* @__PURE__ */
|
|
1151
|
+
icon && /* @__PURE__ */ jsx9(
|
|
1054
1152
|
"div",
|
|
1055
1153
|
{
|
|
1056
1154
|
style: {
|
|
@@ -1061,7 +1159,7 @@ function EmptyState({
|
|
|
1061
1159
|
children: icon
|
|
1062
1160
|
}
|
|
1063
1161
|
),
|
|
1064
|
-
/* @__PURE__ */
|
|
1162
|
+
/* @__PURE__ */ jsx9(
|
|
1065
1163
|
"h3",
|
|
1066
1164
|
{
|
|
1067
1165
|
style: {
|
|
@@ -1073,7 +1171,7 @@ function EmptyState({
|
|
|
1073
1171
|
children: title
|
|
1074
1172
|
}
|
|
1075
1173
|
),
|
|
1076
|
-
/* @__PURE__ */
|
|
1174
|
+
/* @__PURE__ */ jsx9(
|
|
1077
1175
|
"p",
|
|
1078
1176
|
{
|
|
1079
1177
|
style: {
|
|
@@ -1086,7 +1184,7 @@ function EmptyState({
|
|
|
1086
1184
|
children: description
|
|
1087
1185
|
}
|
|
1088
1186
|
),
|
|
1089
|
-
actionLabel && actionHref && /* @__PURE__ */
|
|
1187
|
+
actionLabel && actionHref && /* @__PURE__ */ jsx9(
|
|
1090
1188
|
"a",
|
|
1091
1189
|
{
|
|
1092
1190
|
href: actionHref,
|
|
@@ -1113,24 +1211,24 @@ function EmptyState({
|
|
|
1113
1211
|
|
|
1114
1212
|
// src/admin/components/OrionBlocksField.tsx
|
|
1115
1213
|
import { lazy, Suspense } from "react";
|
|
1116
|
-
import { jsx as
|
|
1214
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
1117
1215
|
var OrionBlocksFieldImpl = lazy(async () => {
|
|
1118
1216
|
const mod = await import("../OrionBlocksFieldImpl-QX5GTMQZ.mjs");
|
|
1119
1217
|
return { default: mod.OrionBlocksFieldImpl };
|
|
1120
1218
|
});
|
|
1121
1219
|
function OrionBlocksField(props) {
|
|
1122
|
-
return /* @__PURE__ */
|
|
1220
|
+
return /* @__PURE__ */ jsx10(Suspense, { fallback: null, children: /* @__PURE__ */ jsx10(OrionBlocksFieldImpl, { ...props }) });
|
|
1123
1221
|
}
|
|
1124
1222
|
|
|
1125
1223
|
// src/admin/components/WelcomeHeader.tsx
|
|
1126
|
-
import { jsx as
|
|
1224
|
+
import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1127
1225
|
function WelcomeHeader({
|
|
1128
1226
|
title,
|
|
1129
1227
|
description,
|
|
1130
1228
|
tooltip,
|
|
1131
1229
|
actions
|
|
1132
1230
|
}) {
|
|
1133
|
-
return /* @__PURE__ */
|
|
1231
|
+
return /* @__PURE__ */ jsxs10(
|
|
1134
1232
|
"div",
|
|
1135
1233
|
{
|
|
1136
1234
|
style: {
|
|
@@ -1142,8 +1240,8 @@ function WelcomeHeader({
|
|
|
1142
1240
|
marginBottom: 24
|
|
1143
1241
|
},
|
|
1144
1242
|
children: [
|
|
1145
|
-
/* @__PURE__ */
|
|
1146
|
-
/* @__PURE__ */
|
|
1243
|
+
/* @__PURE__ */ jsxs10("div", { children: [
|
|
1244
|
+
/* @__PURE__ */ jsxs10(
|
|
1147
1245
|
"h1",
|
|
1148
1246
|
{
|
|
1149
1247
|
style: {
|
|
@@ -1156,13 +1254,13 @@ function WelcomeHeader({
|
|
|
1156
1254
|
},
|
|
1157
1255
|
children: [
|
|
1158
1256
|
title,
|
|
1159
|
-
tooltip && /* @__PURE__ */
|
|
1257
|
+
tooltip && /* @__PURE__ */ jsx11(HelpTooltip, { content: tooltip, position: "right" })
|
|
1160
1258
|
]
|
|
1161
1259
|
}
|
|
1162
1260
|
),
|
|
1163
|
-
description && /* @__PURE__ */
|
|
1261
|
+
description && /* @__PURE__ */ jsx11("p", { style: { fontSize: 14, color: "var(--admin-text-muted)", margin: "6px 0 0" }, children: description })
|
|
1164
1262
|
] }),
|
|
1165
|
-
actions && /* @__PURE__ */
|
|
1263
|
+
actions && /* @__PURE__ */ jsx11("div", { style: { display: "flex", gap: 8 }, children: actions })
|
|
1166
1264
|
]
|
|
1167
1265
|
}
|
|
1168
1266
|
);
|
|
@@ -1172,32 +1270,32 @@ function WelcomeHeader({
|
|
|
1172
1270
|
import Link from "next/link";
|
|
1173
1271
|
|
|
1174
1272
|
// src/admin-app/components/AdminBreadcrumbs.tsx
|
|
1175
|
-
import { jsx as
|
|
1273
|
+
import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1176
1274
|
function AdminBreadcrumbs({ items }) {
|
|
1177
|
-
return /* @__PURE__ */
|
|
1275
|
+
return /* @__PURE__ */ jsx12("nav", { "aria-label": "Breadcrumb", className: "orion-admin-breadcrumbs", children: items.map((item, index) => {
|
|
1178
1276
|
const isLast = index === items.length - 1;
|
|
1179
|
-
return /* @__PURE__ */
|
|
1180
|
-
item.href && !isLast ? /* @__PURE__ */
|
|
1181
|
-
!isLast ? /* @__PURE__ */
|
|
1277
|
+
return /* @__PURE__ */ jsxs11("span", { children: [
|
|
1278
|
+
item.href && !isLast ? /* @__PURE__ */ jsx12("a", { href: item.href, children: item.label }) : /* @__PURE__ */ jsx12("span", { children: item.label }),
|
|
1279
|
+
!isLast ? /* @__PURE__ */ jsx12("span", { className: "orion-admin-breadcrumb-sep", children: "/" }) : null
|
|
1182
1280
|
] }, `${item.label}-${index}`);
|
|
1183
1281
|
}) });
|
|
1184
1282
|
}
|
|
1185
1283
|
|
|
1186
1284
|
// src/admin-app/components/AdminPage.tsx
|
|
1187
|
-
import { jsx as
|
|
1285
|
+
import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1188
1286
|
function AdminPage({ title, description, breadcrumbs, actions, children }) {
|
|
1189
|
-
return /* @__PURE__ */
|
|
1190
|
-
/* @__PURE__ */
|
|
1191
|
-
/* @__PURE__ */
|
|
1192
|
-
/* @__PURE__ */
|
|
1193
|
-
/* @__PURE__ */
|
|
1194
|
-
/* @__PURE__ */
|
|
1195
|
-
description ? /* @__PURE__ */
|
|
1287
|
+
return /* @__PURE__ */ jsxs12("div", { className: "orion-admin-page", children: [
|
|
1288
|
+
/* @__PURE__ */ jsxs12("div", { className: "orion-admin-page-header", children: [
|
|
1289
|
+
/* @__PURE__ */ jsx13(AdminBreadcrumbs, { items: breadcrumbs }),
|
|
1290
|
+
/* @__PURE__ */ jsxs12("div", { className: "orion-admin-page-title-row", children: [
|
|
1291
|
+
/* @__PURE__ */ jsxs12("div", { children: [
|
|
1292
|
+
/* @__PURE__ */ jsx13("h1", { children: title }),
|
|
1293
|
+
description ? /* @__PURE__ */ jsx13("p", { children: description }) : null
|
|
1196
1294
|
] }),
|
|
1197
|
-
actions ? /* @__PURE__ */
|
|
1295
|
+
actions ? /* @__PURE__ */ jsx13("div", { className: "orion-admin-page-actions", children: actions }) : null
|
|
1198
1296
|
] })
|
|
1199
1297
|
] }),
|
|
1200
|
-
/* @__PURE__ */
|
|
1298
|
+
/* @__PURE__ */ jsx13("div", { className: "orion-admin-page-content", children })
|
|
1201
1299
|
] });
|
|
1202
1300
|
}
|
|
1203
1301
|
|
|
@@ -1280,7 +1378,7 @@ var resolveStudioSections = (value) => {
|
|
|
1280
1378
|
};
|
|
1281
1379
|
|
|
1282
1380
|
// src/admin/components/studio/adminPathUtils.ts
|
|
1283
|
-
import { useEffect as
|
|
1381
|
+
import { useEffect as useEffect6, useState as useState6 } from "react";
|
|
1284
1382
|
var DEFAULT_ADMIN_BASE_PATH = "/admin";
|
|
1285
1383
|
var normalizePath = (value) => {
|
|
1286
1384
|
if (!value || value === "/") return "/";
|
|
@@ -1342,8 +1440,8 @@ var resolveAdminPath = (adminBasePath, targetPath) => {
|
|
|
1342
1440
|
return `${normalizedBasePath}${normalizedTargetPath}`;
|
|
1343
1441
|
};
|
|
1344
1442
|
var useAdminBasePath = (fallback = DEFAULT_ADMIN_BASE_PATH) => {
|
|
1345
|
-
const [adminBasePath, setAdminBasePath] =
|
|
1346
|
-
|
|
1443
|
+
const [adminBasePath, setAdminBasePath] = useState6(normalizeAdminBasePath(fallback));
|
|
1444
|
+
useEffect6(() => {
|
|
1347
1445
|
const update = () => {
|
|
1348
1446
|
setAdminBasePath(detectAdminBasePath(window.location.pathname, fallback));
|
|
1349
1447
|
};
|
|
@@ -1517,7 +1615,7 @@ var isStudioShellRoute = (pathname, props, adminBasePath) => {
|
|
|
1517
1615
|
};
|
|
1518
1616
|
|
|
1519
1617
|
// src/admin/components/studio/StudioSectionLayout.tsx
|
|
1520
|
-
import { jsx as
|
|
1618
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
1521
1619
|
function StudioSectionLayout({ children, navProps }) {
|
|
1522
1620
|
const { user } = useAuth();
|
|
1523
1621
|
const pathname = usePathname() || "";
|
|
@@ -1547,7 +1645,7 @@ function StudioSectionLayout({ children, navProps }) {
|
|
|
1547
1645
|
},
|
|
1548
1646
|
[adminBasePath, router]
|
|
1549
1647
|
);
|
|
1550
|
-
return /* @__PURE__ */
|
|
1648
|
+
return /* @__PURE__ */ jsx14(
|
|
1551
1649
|
AdminShellClient,
|
|
1552
1650
|
{
|
|
1553
1651
|
brandName: branding.siteName || defaultBrandName,
|
|
@@ -1564,7 +1662,7 @@ function StudioSectionLayout({ children, navProps }) {
|
|
|
1564
1662
|
}
|
|
1565
1663
|
|
|
1566
1664
|
// src/admin/components/studio/AdminStudioDashboard.tsx
|
|
1567
|
-
import { jsx as
|
|
1665
|
+
import { jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1568
1666
|
var getPropString2 = (props, key, fallback) => {
|
|
1569
1667
|
if (!props || typeof props !== "object") return fallback;
|
|
1570
1668
|
const direct = props[key];
|
|
@@ -1612,36 +1710,36 @@ function AdminStudioDashboard(props) {
|
|
|
1612
1710
|
title: section.card?.title || section.label,
|
|
1613
1711
|
description: section.card?.description || ""
|
|
1614
1712
|
}));
|
|
1615
|
-
return /* @__PURE__ */
|
|
1713
|
+
return /* @__PURE__ */ jsx15(StudioSectionLayout, { navProps: props, children: /* @__PURE__ */ jsx15(
|
|
1616
1714
|
AdminPage,
|
|
1617
1715
|
{
|
|
1618
1716
|
breadcrumbs: [{ label: "Dashboard" }],
|
|
1619
1717
|
description: "Pick what you want to manage.",
|
|
1620
1718
|
title: "Studio",
|
|
1621
|
-
children: /* @__PURE__ */
|
|
1622
|
-
/* @__PURE__ */
|
|
1623
|
-
/* @__PURE__ */
|
|
1624
|
-
/* @__PURE__ */
|
|
1719
|
+
children: /* @__PURE__ */ jsxs13("div", { className: "orion-admin-grid", children: [
|
|
1720
|
+
/* @__PURE__ */ jsxs13(Link, { className: "orion-admin-card", href: pagesPath, children: [
|
|
1721
|
+
/* @__PURE__ */ jsx15("strong", { children: "Pages" }),
|
|
1722
|
+
/* @__PURE__ */ jsx15("span", { children: "Manage and edit site pages in the custom builder." })
|
|
1625
1723
|
] }),
|
|
1626
|
-
formsEnabled ? /* @__PURE__ */
|
|
1627
|
-
/* @__PURE__ */
|
|
1628
|
-
/* @__PURE__ */
|
|
1724
|
+
formsEnabled ? /* @__PURE__ */ jsxs13(Link, { className: "orion-admin-card", href: formsPath, children: [
|
|
1725
|
+
/* @__PURE__ */ jsx15("strong", { children: "Forms" }),
|
|
1726
|
+
/* @__PURE__ */ jsx15("span", { children: "Review forms, submissions, and uploaded files." })
|
|
1629
1727
|
] }) : null,
|
|
1630
|
-
extensionCards.map((card) => /* @__PURE__ */
|
|
1631
|
-
/* @__PURE__ */
|
|
1632
|
-
/* @__PURE__ */
|
|
1728
|
+
extensionCards.map((card) => /* @__PURE__ */ jsxs13(Link, { className: "orion-admin-card", href: card.href, children: [
|
|
1729
|
+
/* @__PURE__ */ jsx15("strong", { children: card.title }),
|
|
1730
|
+
/* @__PURE__ */ jsx15("span", { children: card.description })
|
|
1633
1731
|
] }, card.href)),
|
|
1634
|
-
/* @__PURE__ */
|
|
1635
|
-
/* @__PURE__ */
|
|
1636
|
-
/* @__PURE__ */
|
|
1732
|
+
/* @__PURE__ */ jsxs13(Link, { className: "orion-admin-card", href: resolvedGlobalsBasePath, children: [
|
|
1733
|
+
/* @__PURE__ */ jsx15("strong", { children: "Globals" }),
|
|
1734
|
+
/* @__PURE__ */ jsx15("span", { children: "Update site settings, navigation, footer, social links, and form settings." })
|
|
1637
1735
|
] }),
|
|
1638
|
-
/* @__PURE__ */
|
|
1639
|
-
/* @__PURE__ */
|
|
1640
|
-
/* @__PURE__ */
|
|
1736
|
+
/* @__PURE__ */ jsxs13(Link, { className: "orion-admin-card", href: mediaPath, children: [
|
|
1737
|
+
/* @__PURE__ */ jsx15("strong", { children: "Media" }),
|
|
1738
|
+
/* @__PURE__ */ jsx15("span", { children: "Upload and manage all site media assets." })
|
|
1641
1739
|
] }),
|
|
1642
|
-
/* @__PURE__ */
|
|
1643
|
-
/* @__PURE__ */
|
|
1644
|
-
/* @__PURE__ */
|
|
1740
|
+
/* @__PURE__ */ jsxs13(Link, { className: "orion-admin-card", href: toolsPath, children: [
|
|
1741
|
+
/* @__PURE__ */ jsx15("strong", { children: "Admin Tools" }),
|
|
1742
|
+
/* @__PURE__ */ jsx15("span", { children: "Manage users, roles, and system fallback links." })
|
|
1645
1743
|
] })
|
|
1646
1744
|
] })
|
|
1647
1745
|
}
|
|
@@ -1652,7 +1750,7 @@ function AdminStudioDashboard(props) {
|
|
|
1652
1750
|
import { useMemo as useMemo2 } from "react";
|
|
1653
1751
|
import { usePathname as usePathname2 } from "next/navigation";
|
|
1654
1752
|
import { Logout, useAuth as useAuth2 } from "@payloadcms/ui";
|
|
1655
|
-
import { Fragment as Fragment2, jsx as
|
|
1753
|
+
import { Fragment as Fragment2, jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1656
1754
|
var iconSize2 = 18;
|
|
1657
1755
|
function NavIcon({ sectionID }) {
|
|
1658
1756
|
const props = {
|
|
@@ -1667,47 +1765,47 @@ function NavIcon({ sectionID }) {
|
|
|
1667
1765
|
};
|
|
1668
1766
|
switch (sectionID) {
|
|
1669
1767
|
case "dashboard":
|
|
1670
|
-
return /* @__PURE__ */
|
|
1671
|
-
/* @__PURE__ */
|
|
1672
|
-
/* @__PURE__ */
|
|
1673
|
-
/* @__PURE__ */
|
|
1674
|
-
/* @__PURE__ */
|
|
1768
|
+
return /* @__PURE__ */ jsxs14("svg", { ...props, children: [
|
|
1769
|
+
/* @__PURE__ */ jsx16("rect", { x: "3", y: "3", width: "7", height: "9", rx: "1" }),
|
|
1770
|
+
/* @__PURE__ */ jsx16("rect", { x: "14", y: "3", width: "7", height: "5", rx: "1" }),
|
|
1771
|
+
/* @__PURE__ */ jsx16("rect", { x: "14", y: "12", width: "7", height: "9", rx: "1" }),
|
|
1772
|
+
/* @__PURE__ */ jsx16("rect", { x: "3", y: "16", width: "7", height: "5", rx: "1" })
|
|
1675
1773
|
] });
|
|
1676
1774
|
case "pages":
|
|
1677
|
-
return /* @__PURE__ */
|
|
1678
|
-
/* @__PURE__ */
|
|
1679
|
-
/* @__PURE__ */
|
|
1680
|
-
/* @__PURE__ */
|
|
1681
|
-
/* @__PURE__ */
|
|
1775
|
+
return /* @__PURE__ */ jsxs14("svg", { ...props, children: [
|
|
1776
|
+
/* @__PURE__ */ jsx16("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z" }),
|
|
1777
|
+
/* @__PURE__ */ jsx16("polyline", { points: "14 2 14 8 20 8" }),
|
|
1778
|
+
/* @__PURE__ */ jsx16("line", { x1: "8", y1: "13", x2: "16", y2: "13" }),
|
|
1779
|
+
/* @__PURE__ */ jsx16("line", { x1: "8", y1: "17", x2: "12", y2: "17" })
|
|
1682
1780
|
] });
|
|
1683
1781
|
case "forms":
|
|
1684
|
-
return /* @__PURE__ */
|
|
1685
|
-
/* @__PURE__ */
|
|
1686
|
-
/* @__PURE__ */
|
|
1687
|
-
/* @__PURE__ */
|
|
1688
|
-
/* @__PURE__ */
|
|
1689
|
-
/* @__PURE__ */
|
|
1782
|
+
return /* @__PURE__ */ jsxs14("svg", { ...props, children: [
|
|
1783
|
+
/* @__PURE__ */ jsx16("path", { d: "M9 3h6" }),
|
|
1784
|
+
/* @__PURE__ */ jsx16("path", { d: "M12 3v18" }),
|
|
1785
|
+
/* @__PURE__ */ jsx16("path", { d: "M5 7h14a2 2 0 0 1 2 2v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a2 2 0 0 1 2-2Z" }),
|
|
1786
|
+
/* @__PURE__ */ jsx16("path", { d: "M7 11h10" }),
|
|
1787
|
+
/* @__PURE__ */ jsx16("path", { d: "M7 15h6" })
|
|
1690
1788
|
] });
|
|
1691
1789
|
case "globals":
|
|
1692
|
-
return /* @__PURE__ */
|
|
1693
|
-
/* @__PURE__ */
|
|
1694
|
-
/* @__PURE__ */
|
|
1790
|
+
return /* @__PURE__ */ jsxs14("svg", { ...props, children: [
|
|
1791
|
+
/* @__PURE__ */ jsx16("circle", { cx: "12", cy: "12", r: "3" }),
|
|
1792
|
+
/* @__PURE__ */ jsx16("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1Z" })
|
|
1695
1793
|
] });
|
|
1696
1794
|
case "media":
|
|
1697
|
-
return /* @__PURE__ */
|
|
1698
|
-
/* @__PURE__ */
|
|
1699
|
-
/* @__PURE__ */
|
|
1700
|
-
/* @__PURE__ */
|
|
1795
|
+
return /* @__PURE__ */ jsxs14("svg", { ...props, children: [
|
|
1796
|
+
/* @__PURE__ */ jsx16("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }),
|
|
1797
|
+
/* @__PURE__ */ jsx16("circle", { cx: "8.5", cy: "8.5", r: "1.5" }),
|
|
1798
|
+
/* @__PURE__ */ jsx16("polyline", { points: "21 15 16 10 5 21" })
|
|
1701
1799
|
] });
|
|
1702
1800
|
case "analytics":
|
|
1703
|
-
return /* @__PURE__ */
|
|
1704
|
-
/* @__PURE__ */
|
|
1705
|
-
/* @__PURE__ */
|
|
1706
|
-
/* @__PURE__ */
|
|
1707
|
-
/* @__PURE__ */
|
|
1801
|
+
return /* @__PURE__ */ jsxs14("svg", { ...props, children: [
|
|
1802
|
+
/* @__PURE__ */ jsx16("path", { d: "M4 19V5" }),
|
|
1803
|
+
/* @__PURE__ */ jsx16("path", { d: "M10 19V10" }),
|
|
1804
|
+
/* @__PURE__ */ jsx16("path", { d: "M16 19v-6" }),
|
|
1805
|
+
/* @__PURE__ */ jsx16("path", { d: "M22 19V3" })
|
|
1708
1806
|
] });
|
|
1709
1807
|
case "admin-tools":
|
|
1710
|
-
return /* @__PURE__ */
|
|
1808
|
+
return /* @__PURE__ */ jsx16("svg", { ...props, children: /* @__PURE__ */ jsx16("path", { d: "M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76Z" }) });
|
|
1711
1809
|
default:
|
|
1712
1810
|
return null;
|
|
1713
1811
|
}
|
|
@@ -1740,7 +1838,7 @@ function AdminStudioNav(props) {
|
|
|
1740
1838
|
padding: compact ? "0.6rem" : "0.6rem 0.75rem",
|
|
1741
1839
|
textDecoration: "none"
|
|
1742
1840
|
});
|
|
1743
|
-
return /* @__PURE__ */
|
|
1841
|
+
return /* @__PURE__ */ jsxs14(
|
|
1744
1842
|
"div",
|
|
1745
1843
|
{
|
|
1746
1844
|
style: {
|
|
@@ -1751,8 +1849,8 @@ function AdminStudioNav(props) {
|
|
|
1751
1849
|
padding: compact ? "0.8rem 0.5rem" : "1rem 0.85rem"
|
|
1752
1850
|
},
|
|
1753
1851
|
children: [
|
|
1754
|
-
/* @__PURE__ */
|
|
1755
|
-
branding.logoUrl ? /* @__PURE__ */
|
|
1852
|
+
/* @__PURE__ */ jsxs14("div", { className: "admin-studio-brand", style: { padding: compact ? "0" : "0 0.35rem 0 2.4rem" }, children: [
|
|
1853
|
+
branding.logoUrl ? /* @__PURE__ */ jsx16(
|
|
1756
1854
|
"div",
|
|
1757
1855
|
{
|
|
1758
1856
|
style: {
|
|
@@ -1762,10 +1860,10 @@ function AdminStudioNav(props) {
|
|
|
1762
1860
|
overflow: "hidden",
|
|
1763
1861
|
width: compact ? 34 : 40
|
|
1764
1862
|
},
|
|
1765
|
-
children: /* @__PURE__ */
|
|
1863
|
+
children: /* @__PURE__ */ jsx16("img", { alt: `${resolvedName} logo`, src: branding.logoUrl, style: { height: "100%", objectFit: "cover", width: "100%" } })
|
|
1766
1864
|
}
|
|
1767
1865
|
) : null,
|
|
1768
|
-
/* @__PURE__ */
|
|
1866
|
+
/* @__PURE__ */ jsx16(
|
|
1769
1867
|
"div",
|
|
1770
1868
|
{
|
|
1771
1869
|
style: {
|
|
@@ -1780,12 +1878,12 @@ function AdminStudioNav(props) {
|
|
|
1780
1878
|
children: compact ? resolvedName.slice(0, 1).toUpperCase() : resolvedName
|
|
1781
1879
|
}
|
|
1782
1880
|
),
|
|
1783
|
-
!compact ? /* @__PURE__ */
|
|
1881
|
+
!compact ? /* @__PURE__ */ jsx16("div", { style: { color: "var(--theme-elevation-600)", fontSize: "0.85rem" }, children: "Studio" }) : null
|
|
1784
1882
|
] }),
|
|
1785
|
-
/* @__PURE__ */
|
|
1883
|
+
/* @__PURE__ */ jsx16("nav", { style: { display: "grid", gap: "0.25rem" }, children: links.filter((link) => !link.roles || userRole && link.roles.includes(userRole)).map((link) => {
|
|
1786
1884
|
const active = link.href === dashboardPath ? pathname === dashboardPath : link.matchPrefixes.some((prefix) => pathname.startsWith(prefix));
|
|
1787
|
-
return /* @__PURE__ */
|
|
1788
|
-
const icon = /* @__PURE__ */
|
|
1885
|
+
return /* @__PURE__ */ jsx16("a", { href: link.href, style: linkStyle(active), title: link.label, children: (() => {
|
|
1886
|
+
const icon = /* @__PURE__ */ jsx16(
|
|
1789
1887
|
NavIcon,
|
|
1790
1888
|
{
|
|
1791
1889
|
sectionID: link.icon === "tools" ? "admin-tools" : link.icon || ""
|
|
@@ -1794,14 +1892,14 @@ function AdminStudioNav(props) {
|
|
|
1794
1892
|
if (compact) {
|
|
1795
1893
|
return icon || link.label.slice(0, 1);
|
|
1796
1894
|
}
|
|
1797
|
-
return /* @__PURE__ */
|
|
1895
|
+
return /* @__PURE__ */ jsxs14("span", { style: { alignItems: "center", display: "inline-flex", gap: "0.6rem" }, children: [
|
|
1798
1896
|
icon,
|
|
1799
|
-
/* @__PURE__ */
|
|
1897
|
+
/* @__PURE__ */ jsx16("span", { children: link.label })
|
|
1800
1898
|
] });
|
|
1801
1899
|
})() }, link.href);
|
|
1802
1900
|
}) }),
|
|
1803
|
-
/* @__PURE__ */
|
|
1804
|
-
/* @__PURE__ */
|
|
1901
|
+
/* @__PURE__ */ jsx16("div", { style: { flex: 1 } }),
|
|
1902
|
+
/* @__PURE__ */ jsxs14(
|
|
1805
1903
|
"div",
|
|
1806
1904
|
{
|
|
1807
1905
|
style: {
|
|
@@ -1810,11 +1908,11 @@ function AdminStudioNav(props) {
|
|
|
1810
1908
|
textAlign: compact ? "center" : "left"
|
|
1811
1909
|
},
|
|
1812
1910
|
children: [
|
|
1813
|
-
!compact ? /* @__PURE__ */
|
|
1814
|
-
/* @__PURE__ */
|
|
1815
|
-
/* @__PURE__ */
|
|
1911
|
+
!compact ? /* @__PURE__ */ jsxs14(Fragment2, { children: [
|
|
1912
|
+
/* @__PURE__ */ jsx16("div", { style: { color: "var(--theme-elevation-700)", fontSize: "0.85rem" }, children: "Signed in as" }),
|
|
1913
|
+
/* @__PURE__ */ jsx16("div", { style: { fontWeight: 800, marginBottom: "0.55rem" }, children: typeof user?.email === "string" ? user.email : "User" })
|
|
1816
1914
|
] }) : null,
|
|
1817
|
-
/* @__PURE__ */
|
|
1915
|
+
/* @__PURE__ */ jsx16(Logout, {})
|
|
1818
1916
|
]
|
|
1819
1917
|
}
|
|
1820
1918
|
)
|
|
@@ -1824,10 +1922,10 @@ function AdminStudioNav(props) {
|
|
|
1824
1922
|
}
|
|
1825
1923
|
|
|
1826
1924
|
// src/admin/components/studio/AdminStudioPagesListView.tsx
|
|
1827
|
-
import { useEffect as
|
|
1925
|
+
import { useEffect as useEffect7, useMemo as useMemo3, useState as useState7 } from "react";
|
|
1828
1926
|
import Link2 from "next/link";
|
|
1829
1927
|
import { useAuth as useAuth3 } from "@payloadcms/ui";
|
|
1830
|
-
import { jsx as
|
|
1928
|
+
import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1831
1929
|
var isAdmin = (user) => {
|
|
1832
1930
|
if (!user || typeof user !== "object") return false;
|
|
1833
1931
|
const role = user.role;
|
|
@@ -1849,9 +1947,9 @@ function AdminStudioPagesListView(props) {
|
|
|
1849
1947
|
const pagesCollectionSlug = getPropString3(props, "pagesCollectionSlug", "pages");
|
|
1850
1948
|
const adminBasePath = useAdminBasePath();
|
|
1851
1949
|
const newPagePath = resolveAdminPath(adminBasePath, "/pages/new");
|
|
1852
|
-
const [loading, setLoading] =
|
|
1853
|
-
const [error, setError] =
|
|
1854
|
-
const [docs, setDocs] =
|
|
1950
|
+
const [loading, setLoading] = useState7(true);
|
|
1951
|
+
const [error, setError] = useState7(null);
|
|
1952
|
+
const [docs, setDocs] = useState7([]);
|
|
1855
1953
|
const apiURL = useMemo3(() => {
|
|
1856
1954
|
const params = new URLSearchParams({
|
|
1857
1955
|
depth: "0",
|
|
@@ -1861,7 +1959,7 @@ function AdminStudioPagesListView(props) {
|
|
|
1861
1959
|
});
|
|
1862
1960
|
return `/api/${pagesCollectionSlug}?${params.toString()}`;
|
|
1863
1961
|
}, [pagesCollectionSlug]);
|
|
1864
|
-
|
|
1962
|
+
useEffect7(() => {
|
|
1865
1963
|
let cancelled = false;
|
|
1866
1964
|
const run = async () => {
|
|
1867
1965
|
setLoading(true);
|
|
@@ -1891,10 +1989,10 @@ function AdminStudioPagesListView(props) {
|
|
|
1891
1989
|
cancelled = true;
|
|
1892
1990
|
};
|
|
1893
1991
|
}, [apiURL]);
|
|
1894
|
-
return /* @__PURE__ */
|
|
1992
|
+
return /* @__PURE__ */ jsx17(StudioSectionLayout, { navProps: props, children: /* @__PURE__ */ jsxs15(
|
|
1895
1993
|
AdminPage,
|
|
1896
1994
|
{
|
|
1897
|
-
actions: isAdmin(user) ? /* @__PURE__ */
|
|
1995
|
+
actions: isAdmin(user) ? /* @__PURE__ */ jsx17(Link2, { className: "orion-admin-action-button", href: newPagePath, children: "New Page" }) : null,
|
|
1898
1996
|
breadcrumbs: [
|
|
1899
1997
|
{ label: "Dashboard", href: adminBasePath },
|
|
1900
1998
|
{ label: "Pages" }
|
|
@@ -1902,21 +2000,21 @@ function AdminStudioPagesListView(props) {
|
|
|
1902
2000
|
description: "Open a page to edit it in the inline custom builder.",
|
|
1903
2001
|
title: "Pages",
|
|
1904
2002
|
children: [
|
|
1905
|
-
loading ? /* @__PURE__ */
|
|
1906
|
-
error ? /* @__PURE__ */
|
|
1907
|
-
/* @__PURE__ */
|
|
1908
|
-
!loading && !error && docs.length === 0 ? /* @__PURE__ */
|
|
1909
|
-
/* @__PURE__ */
|
|
1910
|
-
/* @__PURE__ */
|
|
2003
|
+
loading ? /* @__PURE__ */ jsx17("div", { className: "orion-admin-list-meta", children: "Loading..." }) : null,
|
|
2004
|
+
error ? /* @__PURE__ */ jsx17("div", { className: "orion-admin-error", children: error }) : null,
|
|
2005
|
+
/* @__PURE__ */ jsxs15("div", { className: "orion-admin-list", children: [
|
|
2006
|
+
!loading && !error && docs.length === 0 ? /* @__PURE__ */ jsxs15("div", { className: "orion-admin-card", children: [
|
|
2007
|
+
/* @__PURE__ */ jsx17("strong", { children: "No pages yet" }),
|
|
2008
|
+
/* @__PURE__ */ jsx17("span", { children: "Create the first page to start building content." })
|
|
1911
2009
|
] }) : null,
|
|
1912
2010
|
docs.map((doc) => {
|
|
1913
2011
|
const id = typeof doc.id === "string" || typeof doc.id === "number" ? String(doc.id) : "";
|
|
1914
2012
|
if (!id) return null;
|
|
1915
2013
|
const title = typeof doc.title === "string" ? doc.title : "Untitled Page";
|
|
1916
2014
|
const status = typeof doc._status === "string" ? doc._status : "draft";
|
|
1917
|
-
return /* @__PURE__ */
|
|
1918
|
-
/* @__PURE__ */
|
|
1919
|
-
/* @__PURE__ */
|
|
2015
|
+
return /* @__PURE__ */ jsxs15(Link2, { className: "orion-admin-list-item", href: resolveAdminPath(adminBasePath, `/pages/${id}`), children: [
|
|
2016
|
+
/* @__PURE__ */ jsx17("div", { children: /* @__PURE__ */ jsx17("strong", { children: title }) }),
|
|
2017
|
+
/* @__PURE__ */ jsx17("span", { className: "orion-admin-pill", children: status })
|
|
1920
2018
|
] }, id);
|
|
1921
2019
|
})
|
|
1922
2020
|
] })
|
|
@@ -1926,9 +2024,9 @@ function AdminStudioPagesListView(props) {
|
|
|
1926
2024
|
}
|
|
1927
2025
|
|
|
1928
2026
|
// src/admin/components/studio/AdminStudioPageEditView.tsx
|
|
1929
|
-
import { useEffect as
|
|
2027
|
+
import { useEffect as useEffect8, useMemo as useMemo4, useRef as useRef3, useState as useState8 } from "react";
|
|
1930
2028
|
import { SetStepNav, toast, useAuth as useAuth4 } from "@payloadcms/ui";
|
|
1931
|
-
import { Fragment as Fragment3, jsx as
|
|
2029
|
+
import { Fragment as Fragment3, jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1932
2030
|
var isAdmin2 = (user) => {
|
|
1933
2031
|
if (!user || typeof user !== "object") return false;
|
|
1934
2032
|
const role = user.role;
|
|
@@ -1969,17 +2067,17 @@ function AdminStudioPageEditView(props) {
|
|
|
1969
2067
|
const { user } = useAuth4();
|
|
1970
2068
|
const adminBasePath = useAdminBasePath();
|
|
1971
2069
|
const iframeRef = useRef3(null);
|
|
1972
|
-
const [saving, setSaving] =
|
|
1973
|
-
const [dirty, setDirty] =
|
|
1974
|
-
const [hasUnpublishedChanges, setHasUnpublishedChanges] =
|
|
1975
|
-
const [canUndo, setCanUndo] =
|
|
1976
|
-
const [canRedo, setCanRedo] =
|
|
2070
|
+
const [saving, setSaving] = useState8(null);
|
|
2071
|
+
const [dirty, setDirty] = useState8(false);
|
|
2072
|
+
const [hasUnpublishedChanges, setHasUnpublishedChanges] = useState8(false);
|
|
2073
|
+
const [canUndo, setCanUndo] = useState8(false);
|
|
2074
|
+
const [canRedo, setCanRedo] = useState8(false);
|
|
1977
2075
|
const builderBasePath = getPropString4(props, "builderBasePath", "/builder");
|
|
1978
2076
|
const pagesPath = resolveAdminPath(adminBasePath, "/pages");
|
|
1979
2077
|
const pageIDFromParams = useMemo4(() => getParam(props.params, "id"), [props.params]);
|
|
1980
|
-
const [pageID, setPageID] =
|
|
1981
|
-
const [didResolvePathFallback, setDidResolvePathFallback] =
|
|
1982
|
-
|
|
2078
|
+
const [pageID, setPageID] = useState8(pageIDFromParams);
|
|
2079
|
+
const [didResolvePathFallback, setDidResolvePathFallback] = useState8(false);
|
|
2080
|
+
useEffect8(() => {
|
|
1983
2081
|
if (pageIDFromParams) {
|
|
1984
2082
|
setPageID(pageIDFromParams);
|
|
1985
2083
|
setDidResolvePathFallback(true);
|
|
@@ -2023,7 +2121,7 @@ function AdminStudioPageEditView(props) {
|
|
|
2023
2121
|
} catch {
|
|
2024
2122
|
}
|
|
2025
2123
|
};
|
|
2026
|
-
|
|
2124
|
+
useEffect8(() => {
|
|
2027
2125
|
if (!pageID) {
|
|
2028
2126
|
return;
|
|
2029
2127
|
}
|
|
@@ -2046,7 +2144,7 @@ function AdminStudioPageEditView(props) {
|
|
|
2046
2144
|
}
|
|
2047
2145
|
iframe.contentWindow.postMessage({ source: "payload-visual-builder-parent", type }, "*");
|
|
2048
2146
|
};
|
|
2049
|
-
|
|
2147
|
+
useEffect8(() => {
|
|
2050
2148
|
const onMessage = (event) => {
|
|
2051
2149
|
const data = event.data;
|
|
2052
2150
|
if (!data || data.source !== "payload-visual-builder-child" || typeof data.type !== "string") {
|
|
@@ -2081,8 +2179,8 @@ function AdminStudioPageEditView(props) {
|
|
|
2081
2179
|
return () => window.removeEventListener("message", onMessage);
|
|
2082
2180
|
}, []);
|
|
2083
2181
|
if (!pageID && !didResolvePathFallback) {
|
|
2084
|
-
return /* @__PURE__ */
|
|
2085
|
-
/* @__PURE__ */
|
|
2182
|
+
return /* @__PURE__ */ jsx18(StudioSectionLayout, { navProps: props, children: /* @__PURE__ */ jsxs16(Fragment3, { children: [
|
|
2183
|
+
/* @__PURE__ */ jsx18(
|
|
2086
2184
|
SetStepNav,
|
|
2087
2185
|
{
|
|
2088
2186
|
nav: [
|
|
@@ -2091,13 +2189,13 @@ function AdminStudioPageEditView(props) {
|
|
|
2091
2189
|
]
|
|
2092
2190
|
}
|
|
2093
2191
|
),
|
|
2094
|
-
/* @__PURE__ */
|
|
2095
|
-
/* @__PURE__ */
|
|
2192
|
+
/* @__PURE__ */ jsx18("h1", { style: { margin: 0 }, children: "Page Editor" }),
|
|
2193
|
+
/* @__PURE__ */ jsx18("p", { style: { color: "var(--theme-elevation-600)" }, children: "Loading page editor..." })
|
|
2096
2194
|
] }) });
|
|
2097
2195
|
}
|
|
2098
2196
|
if (!pageID) {
|
|
2099
|
-
return /* @__PURE__ */
|
|
2100
|
-
/* @__PURE__ */
|
|
2197
|
+
return /* @__PURE__ */ jsx18(StudioSectionLayout, { navProps: props, children: /* @__PURE__ */ jsxs16(Fragment3, { children: [
|
|
2198
|
+
/* @__PURE__ */ jsx18(
|
|
2101
2199
|
SetStepNav,
|
|
2102
2200
|
{
|
|
2103
2201
|
nav: [
|
|
@@ -2106,12 +2204,12 @@ function AdminStudioPageEditView(props) {
|
|
|
2106
2204
|
]
|
|
2107
2205
|
}
|
|
2108
2206
|
),
|
|
2109
|
-
/* @__PURE__ */
|
|
2110
|
-
/* @__PURE__ */
|
|
2207
|
+
/* @__PURE__ */ jsx18("h1", { style: { margin: 0 }, children: "Page Editor" }),
|
|
2208
|
+
/* @__PURE__ */ jsx18("p", { style: { color: "var(--theme-elevation-600)" }, children: "Missing page ID." })
|
|
2111
2209
|
] }) });
|
|
2112
2210
|
}
|
|
2113
|
-
return /* @__PURE__ */
|
|
2114
|
-
/* @__PURE__ */
|
|
2211
|
+
return /* @__PURE__ */ jsx18(StudioSectionLayout, { navProps: props, children: /* @__PURE__ */ jsxs16(Fragment3, { children: [
|
|
2212
|
+
/* @__PURE__ */ jsx18(
|
|
2115
2213
|
SetStepNav,
|
|
2116
2214
|
{
|
|
2117
2215
|
nav: [
|
|
@@ -2120,8 +2218,8 @@ function AdminStudioPageEditView(props) {
|
|
|
2120
2218
|
]
|
|
2121
2219
|
}
|
|
2122
2220
|
),
|
|
2123
|
-
/* @__PURE__ */
|
|
2124
|
-
/* @__PURE__ */
|
|
2221
|
+
/* @__PURE__ */ jsxs16("div", { style: { display: "grid", gridTemplateRows: "auto 1fr", height: "calc(100vh - 120px)" }, children: [
|
|
2222
|
+
/* @__PURE__ */ jsxs16(
|
|
2125
2223
|
"div",
|
|
2126
2224
|
{
|
|
2127
2225
|
style: {
|
|
@@ -2137,9 +2235,9 @@ function AdminStudioPageEditView(props) {
|
|
|
2137
2235
|
zIndex: 20
|
|
2138
2236
|
},
|
|
2139
2237
|
children: [
|
|
2140
|
-
/* @__PURE__ */
|
|
2141
|
-
/* @__PURE__ */
|
|
2142
|
-
/* @__PURE__ */
|
|
2238
|
+
/* @__PURE__ */ jsxs16("div", { style: { minWidth: 0 }, children: [
|
|
2239
|
+
/* @__PURE__ */ jsx18("div", { style: { fontWeight: 900 }, children: "Page Editor" }),
|
|
2240
|
+
/* @__PURE__ */ jsxs16(
|
|
2143
2241
|
"div",
|
|
2144
2242
|
{
|
|
2145
2243
|
style: {
|
|
@@ -2155,9 +2253,9 @@ function AdminStudioPageEditView(props) {
|
|
|
2155
2253
|
}
|
|
2156
2254
|
)
|
|
2157
2255
|
] }),
|
|
2158
|
-
/* @__PURE__ */
|
|
2159
|
-
/* @__PURE__ */
|
|
2160
|
-
/* @__PURE__ */
|
|
2256
|
+
/* @__PURE__ */ jsxs16("div", { style: { alignItems: "center", display: "flex", gap: "0.5rem" }, children: [
|
|
2257
|
+
/* @__PURE__ */ jsx18("div", { style: { color: dirty ? "var(--theme-elevation-900)" : "var(--theme-elevation-600)", fontSize: "0.85rem", fontWeight: 700 }, children: dirty ? "Unsaved changes" : "All changes saved" }),
|
|
2258
|
+
/* @__PURE__ */ jsx18(
|
|
2161
2259
|
"div",
|
|
2162
2260
|
{
|
|
2163
2261
|
style: {
|
|
@@ -2174,7 +2272,7 @@ function AdminStudioPageEditView(props) {
|
|
|
2174
2272
|
children: hasUnpublishedChanges ? "Unpublished draft changes" : "Live is up to date"
|
|
2175
2273
|
}
|
|
2176
2274
|
),
|
|
2177
|
-
/* @__PURE__ */
|
|
2275
|
+
/* @__PURE__ */ jsx18(
|
|
2178
2276
|
"button",
|
|
2179
2277
|
{
|
|
2180
2278
|
disabled: !canUndo,
|
|
@@ -2190,7 +2288,7 @@ function AdminStudioPageEditView(props) {
|
|
|
2190
2288
|
children: "Undo"
|
|
2191
2289
|
}
|
|
2192
2290
|
),
|
|
2193
|
-
/* @__PURE__ */
|
|
2291
|
+
/* @__PURE__ */ jsx18(
|
|
2194
2292
|
"button",
|
|
2195
2293
|
{
|
|
2196
2294
|
disabled: !canRedo,
|
|
@@ -2206,7 +2304,7 @@ function AdminStudioPageEditView(props) {
|
|
|
2206
2304
|
children: "Redo"
|
|
2207
2305
|
}
|
|
2208
2306
|
),
|
|
2209
|
-
/* @__PURE__ */
|
|
2307
|
+
/* @__PURE__ */ jsx18(
|
|
2210
2308
|
"button",
|
|
2211
2309
|
{
|
|
2212
2310
|
disabled: saving !== null,
|
|
@@ -2222,7 +2320,7 @@ function AdminStudioPageEditView(props) {
|
|
|
2222
2320
|
children: saving === "draft" ? "Saving\u2026" : "Save Draft"
|
|
2223
2321
|
}
|
|
2224
2322
|
),
|
|
2225
|
-
/* @__PURE__ */
|
|
2323
|
+
/* @__PURE__ */ jsx18(
|
|
2226
2324
|
"button",
|
|
2227
2325
|
{
|
|
2228
2326
|
disabled: !canPublish || saving !== null,
|
|
@@ -2245,7 +2343,7 @@ function AdminStudioPageEditView(props) {
|
|
|
2245
2343
|
]
|
|
2246
2344
|
}
|
|
2247
2345
|
),
|
|
2248
|
-
/* @__PURE__ */
|
|
2346
|
+
/* @__PURE__ */ jsx18(
|
|
2249
2347
|
"iframe",
|
|
2250
2348
|
{
|
|
2251
2349
|
ref: iframeRef,
|
|
@@ -2265,9 +2363,9 @@ function AdminStudioPageEditView(props) {
|
|
|
2265
2363
|
}
|
|
2266
2364
|
|
|
2267
2365
|
// src/admin/components/studio/AdminStudioNewPageView.tsx
|
|
2268
|
-
import { useState as
|
|
2366
|
+
import { useState as useState9 } from "react";
|
|
2269
2367
|
import { useAuth as useAuth5 } from "@payloadcms/ui";
|
|
2270
|
-
import { jsx as
|
|
2368
|
+
import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2271
2369
|
var pageTemplates = ["standard", "landing", "services", "contact"];
|
|
2272
2370
|
var getPropString5 = (props, key, fallback) => {
|
|
2273
2371
|
if (!props || typeof props !== "object") return fallback;
|
|
@@ -2290,10 +2388,10 @@ function AdminStudioNewPageView(props) {
|
|
|
2290
2388
|
const { user } = useAuth5();
|
|
2291
2389
|
const adminBasePath = useAdminBasePath();
|
|
2292
2390
|
const pagesCollectionSlug = getPropString5(props, "pagesCollectionSlug", "pages");
|
|
2293
|
-
const [submitting, setSubmitting] =
|
|
2294
|
-
const [error, setError] =
|
|
2391
|
+
const [submitting, setSubmitting] = useState9(false);
|
|
2392
|
+
const [error, setError] = useState9(null);
|
|
2295
2393
|
if (!canManagePages(user)) {
|
|
2296
|
-
return /* @__PURE__ */
|
|
2394
|
+
return /* @__PURE__ */ jsx19(StudioSectionLayout, { navProps: props, children: /* @__PURE__ */ jsx19(
|
|
2297
2395
|
AdminPage,
|
|
2298
2396
|
{
|
|
2299
2397
|
breadcrumbs: [
|
|
@@ -2303,9 +2401,9 @@ function AdminStudioNewPageView(props) {
|
|
|
2303
2401
|
],
|
|
2304
2402
|
description: "You do not have access to create pages.",
|
|
2305
2403
|
title: "New Page",
|
|
2306
|
-
children: /* @__PURE__ */
|
|
2307
|
-
/* @__PURE__ */
|
|
2308
|
-
/* @__PURE__ */
|
|
2404
|
+
children: /* @__PURE__ */ jsxs17("div", { className: "orion-admin-card", children: [
|
|
2405
|
+
/* @__PURE__ */ jsx19("strong", { children: "Access denied" }),
|
|
2406
|
+
/* @__PURE__ */ jsx19("span", { children: "This section is restricted to administrator and editor accounts." })
|
|
2309
2407
|
] })
|
|
2310
2408
|
}
|
|
2311
2409
|
) });
|
|
@@ -2350,7 +2448,7 @@ function AdminStudioNewPageView(props) {
|
|
|
2350
2448
|
setSubmitting(false);
|
|
2351
2449
|
}
|
|
2352
2450
|
};
|
|
2353
|
-
return /* @__PURE__ */
|
|
2451
|
+
return /* @__PURE__ */ jsx19(StudioSectionLayout, { navProps: props, children: /* @__PURE__ */ jsx19(
|
|
2354
2452
|
AdminPage,
|
|
2355
2453
|
{
|
|
2356
2454
|
breadcrumbs: [
|
|
@@ -2360,33 +2458,33 @@ function AdminStudioNewPageView(props) {
|
|
|
2360
2458
|
],
|
|
2361
2459
|
description: "Create a new page and open it in the custom editor.",
|
|
2362
2460
|
title: "New Page",
|
|
2363
|
-
children: /* @__PURE__ */
|
|
2364
|
-
error ? /* @__PURE__ */
|
|
2365
|
-
/* @__PURE__ */
|
|
2461
|
+
children: /* @__PURE__ */ jsxs17("form", { className: "orion-admin-form", onSubmit: createPage, children: [
|
|
2462
|
+
error ? /* @__PURE__ */ jsx19("div", { className: "orion-admin-error", children: error }) : null,
|
|
2463
|
+
/* @__PURE__ */ jsxs17("label", { children: [
|
|
2366
2464
|
"Title",
|
|
2367
|
-
/* @__PURE__ */
|
|
2465
|
+
/* @__PURE__ */ jsx19("input", { name: "title", placeholder: "Services", required: true, type: "text" })
|
|
2368
2466
|
] }),
|
|
2369
|
-
/* @__PURE__ */
|
|
2467
|
+
/* @__PURE__ */ jsxs17("label", { children: [
|
|
2370
2468
|
"Slug",
|
|
2371
|
-
/* @__PURE__ */
|
|
2469
|
+
/* @__PURE__ */ jsx19("input", { name: "slug", placeholder: "services", type: "text" })
|
|
2372
2470
|
] }),
|
|
2373
|
-
/* @__PURE__ */
|
|
2471
|
+
/* @__PURE__ */ jsxs17("label", { children: [
|
|
2374
2472
|
"Template",
|
|
2375
|
-
/* @__PURE__ */
|
|
2376
|
-
/* @__PURE__ */
|
|
2377
|
-
/* @__PURE__ */
|
|
2378
|
-
/* @__PURE__ */
|
|
2379
|
-
/* @__PURE__ */
|
|
2473
|
+
/* @__PURE__ */ jsxs17("select", { defaultValue: "standard", name: "template", children: [
|
|
2474
|
+
/* @__PURE__ */ jsx19("option", { value: "standard", children: "Standard" }),
|
|
2475
|
+
/* @__PURE__ */ jsx19("option", { value: "landing", children: "Landing" }),
|
|
2476
|
+
/* @__PURE__ */ jsx19("option", { value: "contact", children: "Contact" }),
|
|
2477
|
+
/* @__PURE__ */ jsx19("option", { value: "services", children: "Services" })
|
|
2380
2478
|
] })
|
|
2381
2479
|
] }),
|
|
2382
|
-
/* @__PURE__ */
|
|
2480
|
+
/* @__PURE__ */ jsx19("button", { disabled: submitting, type: "submit", children: submitting ? "Creating..." : "Create Page" })
|
|
2383
2481
|
] })
|
|
2384
2482
|
}
|
|
2385
2483
|
) });
|
|
2386
2484
|
}
|
|
2387
2485
|
|
|
2388
2486
|
// src/admin/components/studio/AdminStudioGlobalsView.tsx
|
|
2389
|
-
import { jsx as
|
|
2487
|
+
import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2390
2488
|
var getPropGlobals = (props) => {
|
|
2391
2489
|
if (!props || typeof props !== "object") return null;
|
|
2392
2490
|
const direct = props.globals;
|
|
@@ -2406,7 +2504,7 @@ function AdminStudioGlobalsView(props) {
|
|
|
2406
2504
|
{ slug: "footer", label: "Footer" },
|
|
2407
2505
|
{ slug: "social-media", label: "Social Media" }
|
|
2408
2506
|
];
|
|
2409
|
-
return /* @__PURE__ */
|
|
2507
|
+
return /* @__PURE__ */ jsx20(StudioSectionLayout, { navProps: props, children: /* @__PURE__ */ jsx20(
|
|
2410
2508
|
AdminPage,
|
|
2411
2509
|
{
|
|
2412
2510
|
breadcrumbs: [
|
|
@@ -2415,17 +2513,17 @@ function AdminStudioGlobalsView(props) {
|
|
|
2415
2513
|
],
|
|
2416
2514
|
description: "Site-wide content and branding settings.",
|
|
2417
2515
|
title: "Globals",
|
|
2418
|
-
children: /* @__PURE__ */
|
|
2516
|
+
children: /* @__PURE__ */ jsx20("div", { className: "orion-admin-list", children: globals.map((global) => {
|
|
2419
2517
|
const href = resolveAdminPath(
|
|
2420
2518
|
adminBasePath,
|
|
2421
2519
|
typeof global.href === "string" ? global.href : `/globals/${global.slug}`
|
|
2422
2520
|
);
|
|
2423
|
-
return /* @__PURE__ */
|
|
2424
|
-
/* @__PURE__ */
|
|
2425
|
-
/* @__PURE__ */
|
|
2426
|
-
/* @__PURE__ */
|
|
2521
|
+
return /* @__PURE__ */ jsxs18("a", { className: "orion-admin-list-item", href, children: [
|
|
2522
|
+
/* @__PURE__ */ jsxs18("div", { children: [
|
|
2523
|
+
/* @__PURE__ */ jsx20("strong", { children: global.label }),
|
|
2524
|
+
/* @__PURE__ */ jsx20("div", { className: "orion-admin-list-meta", children: typeof global.description === "string" && global.description.length > 0 ? global.description : href })
|
|
2427
2525
|
] }),
|
|
2428
|
-
/* @__PURE__ */
|
|
2526
|
+
/* @__PURE__ */ jsx20("span", { className: "orion-admin-list-meta", children: "Open" })
|
|
2429
2527
|
] }, global.slug);
|
|
2430
2528
|
}) })
|
|
2431
2529
|
}
|
|
@@ -2433,8 +2531,8 @@ function AdminStudioGlobalsView(props) {
|
|
|
2433
2531
|
}
|
|
2434
2532
|
|
|
2435
2533
|
// src/admin/components/studio/AdminStudioSiteSettingsGlobalView.tsx
|
|
2436
|
-
import { useEffect as
|
|
2437
|
-
import { jsx as
|
|
2534
|
+
import { useEffect as useEffect9, useMemo as useMemo5, useState as useState10 } from "react";
|
|
2535
|
+
import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2438
2536
|
var getPropString6 = (props, key, fallback) => {
|
|
2439
2537
|
if (!props || typeof props !== "object") return fallback;
|
|
2440
2538
|
const direct = props[key];
|
|
@@ -2519,13 +2617,13 @@ function AdminStudioSiteSettingsGlobalView(props) {
|
|
|
2519
2617
|
const mediaCollectionSlug = getPropString6(props, "mediaCollectionSlug", "media");
|
|
2520
2618
|
const adminBasePath = useAdminBasePath();
|
|
2521
2619
|
const resolvedGlobalsBasePath = resolveAdminPath(adminBasePath, globalsBasePath);
|
|
2522
|
-
const [loading, setLoading] =
|
|
2523
|
-
const [saving, setSaving] =
|
|
2524
|
-
const [error, setError] =
|
|
2525
|
-
const [savedMessage, setSavedMessage] =
|
|
2526
|
-
const [globalData, setGlobalData] =
|
|
2527
|
-
const [mediaOptions, setMediaOptions] =
|
|
2528
|
-
|
|
2620
|
+
const [loading, setLoading] = useState10(true);
|
|
2621
|
+
const [saving, setSaving] = useState10(false);
|
|
2622
|
+
const [error, setError] = useState10(null);
|
|
2623
|
+
const [savedMessage, setSavedMessage] = useState10(null);
|
|
2624
|
+
const [globalData, setGlobalData] = useState10({});
|
|
2625
|
+
const [mediaOptions, setMediaOptions] = useState10([]);
|
|
2626
|
+
useEffect9(() => {
|
|
2529
2627
|
let cancelled = false;
|
|
2530
2628
|
const run = async () => {
|
|
2531
2629
|
setLoading(true);
|
|
@@ -2671,7 +2769,7 @@ function AdminStudioSiteSettingsGlobalView(props) {
|
|
|
2671
2769
|
};
|
|
2672
2770
|
const logoID = getRelationID(globalData.logo);
|
|
2673
2771
|
const ogImageID = getRelationID(defaultSeo.ogImage);
|
|
2674
|
-
return /* @__PURE__ */
|
|
2772
|
+
return /* @__PURE__ */ jsx21(StudioSectionLayout, { navProps: props, children: /* @__PURE__ */ jsxs19(
|
|
2675
2773
|
AdminPage,
|
|
2676
2774
|
{
|
|
2677
2775
|
breadcrumbs: [
|
|
@@ -2682,126 +2780,126 @@ function AdminStudioSiteSettingsGlobalView(props) {
|
|
|
2682
2780
|
description: "Manage site-wide brand, SEO, and business metadata.",
|
|
2683
2781
|
title: "Website Settings",
|
|
2684
2782
|
children: [
|
|
2685
|
-
loading ? /* @__PURE__ */
|
|
2686
|
-
!loading ? /* @__PURE__ */
|
|
2687
|
-
error ? /* @__PURE__ */
|
|
2688
|
-
savedMessage ? /* @__PURE__ */
|
|
2689
|
-
/* @__PURE__ */
|
|
2783
|
+
loading ? /* @__PURE__ */ jsx21("div", { className: "orion-admin-list-meta", children: "Loading..." }) : null,
|
|
2784
|
+
!loading ? /* @__PURE__ */ jsxs19("form", { className: "orion-admin-form", onSubmit: save, children: [
|
|
2785
|
+
error ? /* @__PURE__ */ jsx21("div", { className: "orion-admin-error", children: error }) : null,
|
|
2786
|
+
savedMessage ? /* @__PURE__ */ jsx21("div", { className: "orion-admin-success", children: savedMessage }) : null,
|
|
2787
|
+
/* @__PURE__ */ jsxs19("label", { children: [
|
|
2690
2788
|
"Site Name",
|
|
2691
|
-
/* @__PURE__ */
|
|
2789
|
+
/* @__PURE__ */ jsx21("input", { defaultValue: String(globalData.siteName || ""), name: "siteName", required: true, type: "text" })
|
|
2692
2790
|
] }),
|
|
2693
|
-
/* @__PURE__ */
|
|
2791
|
+
/* @__PURE__ */ jsxs19("label", { children: [
|
|
2694
2792
|
"Tagline",
|
|
2695
|
-
/* @__PURE__ */
|
|
2793
|
+
/* @__PURE__ */ jsx21("input", { defaultValue: String(globalData.tagline || ""), name: "tagline", type: "text" })
|
|
2696
2794
|
] }),
|
|
2697
|
-
/* @__PURE__ */
|
|
2795
|
+
/* @__PURE__ */ jsxs19("label", { children: [
|
|
2698
2796
|
"Logo (media ID)",
|
|
2699
|
-
/* @__PURE__ */
|
|
2700
|
-
/* @__PURE__ */
|
|
2797
|
+
/* @__PURE__ */ jsxs19("select", { defaultValue: logoID ? String(logoID) : "", name: "logo", children: [
|
|
2798
|
+
/* @__PURE__ */ jsx21("option", { value: "", children: "No logo" }),
|
|
2701
2799
|
mediaOptions.map((asset) => {
|
|
2702
2800
|
const id = typeof asset.id === "string" || typeof asset.id === "number" ? String(asset.id) : "";
|
|
2703
2801
|
if (!id) return null;
|
|
2704
|
-
return /* @__PURE__ */
|
|
2802
|
+
return /* @__PURE__ */ jsx21("option", { value: id, children: asset.filename || `Media ${id}` }, id);
|
|
2705
2803
|
})
|
|
2706
2804
|
] })
|
|
2707
2805
|
] }),
|
|
2708
|
-
/* @__PURE__ */
|
|
2806
|
+
/* @__PURE__ */ jsxs19("label", { children: [
|
|
2709
2807
|
"SEO Meta Title",
|
|
2710
|
-
/* @__PURE__ */
|
|
2808
|
+
/* @__PURE__ */ jsx21("input", { defaultValue: String(defaultSeo.metaTitle || ""), name: "metaTitle", type: "text" })
|
|
2711
2809
|
] }),
|
|
2712
|
-
/* @__PURE__ */
|
|
2810
|
+
/* @__PURE__ */ jsxs19("label", { children: [
|
|
2713
2811
|
"SEO Meta Description",
|
|
2714
|
-
/* @__PURE__ */
|
|
2812
|
+
/* @__PURE__ */ jsx21("textarea", { defaultValue: String(defaultSeo.metaDescription || ""), name: "metaDescription", rows: 3 })
|
|
2715
2813
|
] }),
|
|
2716
|
-
/* @__PURE__ */
|
|
2814
|
+
/* @__PURE__ */ jsxs19("label", { children: [
|
|
2717
2815
|
"Canonical Base URL",
|
|
2718
|
-
/* @__PURE__ */
|
|
2816
|
+
/* @__PURE__ */ jsx21("input", { defaultValue: String(defaultSeo.canonicalBaseUrl || ""), name: "canonicalBaseUrl", type: "text" })
|
|
2719
2817
|
] }),
|
|
2720
|
-
/* @__PURE__ */
|
|
2818
|
+
/* @__PURE__ */ jsxs19("label", { children: [
|
|
2721
2819
|
"SEO OG Image (media ID)",
|
|
2722
|
-
/* @__PURE__ */
|
|
2723
|
-
/* @__PURE__ */
|
|
2820
|
+
/* @__PURE__ */ jsxs19("select", { defaultValue: ogImageID ? String(ogImageID) : "", name: "ogImage", children: [
|
|
2821
|
+
/* @__PURE__ */ jsx21("option", { value: "", children: "No image" }),
|
|
2724
2822
|
mediaOptions.map((asset) => {
|
|
2725
2823
|
const id = typeof asset.id === "string" || typeof asset.id === "number" ? String(asset.id) : "";
|
|
2726
2824
|
if (!id) return null;
|
|
2727
|
-
return /* @__PURE__ */
|
|
2825
|
+
return /* @__PURE__ */ jsx21("option", { value: id, children: asset.filename || `Media ${id}` }, id);
|
|
2728
2826
|
})
|
|
2729
2827
|
] })
|
|
2730
2828
|
] }),
|
|
2731
|
-
/* @__PURE__ */
|
|
2829
|
+
/* @__PURE__ */ jsxs19("label", { children: [
|
|
2732
2830
|
"Business Schema Type",
|
|
2733
|
-
/* @__PURE__ */
|
|
2831
|
+
/* @__PURE__ */ jsx21("input", { defaultValue: String(businessProfile.schemaType || "Store"), name: "schemaType", type: "text" })
|
|
2734
2832
|
] }),
|
|
2735
|
-
/* @__PURE__ */
|
|
2833
|
+
/* @__PURE__ */ jsxs19("label", { children: [
|
|
2736
2834
|
"Business Description",
|
|
2737
|
-
/* @__PURE__ */
|
|
2835
|
+
/* @__PURE__ */ jsx21("textarea", { defaultValue: String(businessProfile.description || ""), name: "businessDescription", rows: 4 })
|
|
2738
2836
|
] }),
|
|
2739
|
-
/* @__PURE__ */
|
|
2837
|
+
/* @__PURE__ */ jsxs19("label", { children: [
|
|
2740
2838
|
"Street Address",
|
|
2741
|
-
/* @__PURE__ */
|
|
2839
|
+
/* @__PURE__ */ jsx21("input", { defaultValue: String(businessProfile.streetAddress || ""), name: "streetAddress", type: "text" })
|
|
2742
2840
|
] }),
|
|
2743
|
-
/* @__PURE__ */
|
|
2841
|
+
/* @__PURE__ */ jsxs19("label", { children: [
|
|
2744
2842
|
"City",
|
|
2745
|
-
/* @__PURE__ */
|
|
2843
|
+
/* @__PURE__ */ jsx21("input", { defaultValue: String(businessProfile.addressLocality || ""), name: "addressLocality", type: "text" })
|
|
2746
2844
|
] }),
|
|
2747
|
-
/* @__PURE__ */
|
|
2845
|
+
/* @__PURE__ */ jsxs19("label", { children: [
|
|
2748
2846
|
"State / Region",
|
|
2749
|
-
/* @__PURE__ */
|
|
2847
|
+
/* @__PURE__ */ jsx21("input", { defaultValue: String(businessProfile.addressRegion || ""), name: "addressRegion", type: "text" })
|
|
2750
2848
|
] }),
|
|
2751
|
-
/* @__PURE__ */
|
|
2849
|
+
/* @__PURE__ */ jsxs19("label", { children: [
|
|
2752
2850
|
"Postal Code",
|
|
2753
|
-
/* @__PURE__ */
|
|
2851
|
+
/* @__PURE__ */ jsx21("input", { defaultValue: String(businessProfile.postalCode || ""), name: "postalCode", type: "text" })
|
|
2754
2852
|
] }),
|
|
2755
|
-
/* @__PURE__ */
|
|
2853
|
+
/* @__PURE__ */ jsxs19("label", { children: [
|
|
2756
2854
|
"Country Code",
|
|
2757
|
-
/* @__PURE__ */
|
|
2855
|
+
/* @__PURE__ */ jsx21("input", { defaultValue: String(businessProfile.addressCountry || "US"), name: "addressCountry", type: "text" })
|
|
2758
2856
|
] }),
|
|
2759
|
-
/* @__PURE__ */
|
|
2857
|
+
/* @__PURE__ */ jsxs19("label", { children: [
|
|
2760
2858
|
"Neighborhood",
|
|
2761
|
-
/* @__PURE__ */
|
|
2859
|
+
/* @__PURE__ */ jsx21("input", { defaultValue: String(businessProfile.neighborhood || ""), name: "neighborhood", type: "text" })
|
|
2762
2860
|
] }),
|
|
2763
|
-
/* @__PURE__ */
|
|
2861
|
+
/* @__PURE__ */ jsxs19("label", { children: [
|
|
2764
2862
|
"Latitude",
|
|
2765
|
-
/* @__PURE__ */
|
|
2863
|
+
/* @__PURE__ */ jsx21("input", { defaultValue: String(businessProfile.latitude || ""), name: "latitude", type: "text" })
|
|
2766
2864
|
] }),
|
|
2767
|
-
/* @__PURE__ */
|
|
2865
|
+
/* @__PURE__ */ jsxs19("label", { children: [
|
|
2768
2866
|
"Longitude",
|
|
2769
|
-
/* @__PURE__ */
|
|
2867
|
+
/* @__PURE__ */ jsx21("input", { defaultValue: String(businessProfile.longitude || ""), name: "longitude", type: "text" })
|
|
2770
2868
|
] }),
|
|
2771
|
-
/* @__PURE__ */
|
|
2869
|
+
/* @__PURE__ */ jsxs19("label", { children: [
|
|
2772
2870
|
"Price Range",
|
|
2773
|
-
/* @__PURE__ */
|
|
2871
|
+
/* @__PURE__ */ jsx21("input", { defaultValue: String(businessProfile.priceRange || ""), name: "priceRange", type: "text" })
|
|
2774
2872
|
] }),
|
|
2775
|
-
/* @__PURE__ */
|
|
2873
|
+
/* @__PURE__ */ jsxs19("label", { children: [
|
|
2776
2874
|
"Map URL",
|
|
2777
|
-
/* @__PURE__ */
|
|
2875
|
+
/* @__PURE__ */ jsx21("input", { defaultValue: String(businessProfile.mapUrl || ""), name: "mapUrl", type: "text" })
|
|
2778
2876
|
] }),
|
|
2779
|
-
/* @__PURE__ */
|
|
2877
|
+
/* @__PURE__ */ jsxs19("label", { children: [
|
|
2780
2878
|
"LLM Summary",
|
|
2781
|
-
/* @__PURE__ */
|
|
2879
|
+
/* @__PURE__ */ jsx21("textarea", { defaultValue: String(businessProfile.llmsSummary || ""), name: "llmsSummary", rows: 4 })
|
|
2782
2880
|
] }),
|
|
2783
|
-
/* @__PURE__ */
|
|
2881
|
+
/* @__PURE__ */ jsxs19("label", { children: [
|
|
2784
2882
|
"Opening Hours Rows",
|
|
2785
|
-
/* @__PURE__ */
|
|
2786
|
-
/* @__PURE__ */
|
|
2883
|
+
/* @__PURE__ */ jsx21("textarea", { defaultValue: openingHoursRows, name: "openingHoursRows", rows: 4 }),
|
|
2884
|
+
/* @__PURE__ */ jsxs19("span", { style: { color: "var(--orion-admin-muted)", fontSize: "0.82rem", fontWeight: 600 }, children: [
|
|
2787
2885
|
"One row per line: ",
|
|
2788
|
-
/* @__PURE__ */
|
|
2886
|
+
/* @__PURE__ */ jsx21("code", { children: "Monday,Tuesday,Wednesday|10:00|19:00" })
|
|
2789
2887
|
] })
|
|
2790
2888
|
] }),
|
|
2791
|
-
/* @__PURE__ */
|
|
2889
|
+
/* @__PURE__ */ jsxs19("label", { children: [
|
|
2792
2890
|
"Citation / SameAs URLs",
|
|
2793
|
-
/* @__PURE__ */
|
|
2794
|
-
/* @__PURE__ */
|
|
2891
|
+
/* @__PURE__ */ jsx21("textarea", { defaultValue: sameAsRows, name: "sameAsRows", rows: 4 }),
|
|
2892
|
+
/* @__PURE__ */ jsx21("span", { style: { color: "var(--orion-admin-muted)", fontSize: "0.82rem", fontWeight: 600 }, children: "One absolute URL per line. Social links still come from the Social Media global." })
|
|
2795
2893
|
] }),
|
|
2796
|
-
/* @__PURE__ */
|
|
2894
|
+
/* @__PURE__ */ jsxs19("label", { children: [
|
|
2797
2895
|
"Service Schema Rows",
|
|
2798
|
-
/* @__PURE__ */
|
|
2799
|
-
/* @__PURE__ */
|
|
2896
|
+
/* @__PURE__ */ jsx21("textarea", { defaultValue: serviceCatalogRows, name: "serviceCatalogRows", rows: 6 }),
|
|
2897
|
+
/* @__PURE__ */ jsxs19("span", { style: { color: "var(--orion-admin-muted)", fontSize: "0.82rem", fontWeight: 600 }, children: [
|
|
2800
2898
|
"One row per line: ",
|
|
2801
|
-
/* @__PURE__ */
|
|
2899
|
+
/* @__PURE__ */ jsx21("code", { children: "Name|Description|Optional price range|/page-path" })
|
|
2802
2900
|
] })
|
|
2803
2901
|
] }),
|
|
2804
|
-
/* @__PURE__ */
|
|
2902
|
+
/* @__PURE__ */ jsx21("button", { disabled: saving, type: "submit", children: saving ? "Saving..." : "Save Global" })
|
|
2805
2903
|
] }) : null
|
|
2806
2904
|
]
|
|
2807
2905
|
}
|
|
@@ -2809,7 +2907,7 @@ function AdminStudioSiteSettingsGlobalView(props) {
|
|
|
2809
2907
|
}
|
|
2810
2908
|
|
|
2811
2909
|
// src/admin/components/studio/AdminStudioSocialMediaGlobalView.tsx
|
|
2812
|
-
import { useEffect as
|
|
2910
|
+
import { useEffect as useEffect10, useMemo as useMemo6, useState as useState11 } from "react";
|
|
2813
2911
|
|
|
2814
2912
|
// src/shared/socialMedia.ts
|
|
2815
2913
|
var SOCIAL_MEDIA_PLATFORM_LABELS = {
|
|
@@ -2891,7 +2989,7 @@ var SOCIAL_MEDIA_DEFAULT_ICON_BY_PLATFORM = SOCIAL_MEDIA_PLATFORMS.reduce(
|
|
|
2891
2989
|
);
|
|
2892
2990
|
|
|
2893
2991
|
// src/admin/components/studio/AdminStudioSocialMediaGlobalView.tsx
|
|
2894
|
-
import { jsx as
|
|
2992
|
+
import { jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2895
2993
|
var getSocialUrlFieldName = (platform) => `social-${platform}-url`;
|
|
2896
2994
|
var getSocialIconFieldName = (platform) => `social-${platform}-icon`;
|
|
2897
2995
|
var getPropString7 = (props, key, fallback) => {
|
|
@@ -2946,12 +3044,12 @@ function AdminStudioSocialMediaGlobalView(props) {
|
|
|
2946
3044
|
const globalsBasePath = getPropString7(props, "globalsBasePath", "/globals");
|
|
2947
3045
|
const adminBasePath = useAdminBasePath();
|
|
2948
3046
|
const resolvedGlobalsBasePath = resolveAdminPath(adminBasePath, globalsBasePath);
|
|
2949
|
-
const [loading, setLoading] =
|
|
2950
|
-
const [saving, setSaving] =
|
|
2951
|
-
const [error, setError] =
|
|
2952
|
-
const [savedMessage, setSavedMessage] =
|
|
2953
|
-
const [globalData, setGlobalData] =
|
|
2954
|
-
|
|
3047
|
+
const [loading, setLoading] = useState11(true);
|
|
3048
|
+
const [saving, setSaving] = useState11(false);
|
|
3049
|
+
const [error, setError] = useState11(null);
|
|
3050
|
+
const [savedMessage, setSavedMessage] = useState11(null);
|
|
3051
|
+
const [globalData, setGlobalData] = useState11({});
|
|
3052
|
+
useEffect10(() => {
|
|
2955
3053
|
let cancelled = false;
|
|
2956
3054
|
const run = async () => {
|
|
2957
3055
|
setLoading(true);
|
|
@@ -3028,7 +3126,7 @@ function AdminStudioSocialMediaGlobalView(props) {
|
|
|
3028
3126
|
setSaving(false);
|
|
3029
3127
|
}
|
|
3030
3128
|
};
|
|
3031
|
-
return /* @__PURE__ */
|
|
3129
|
+
return /* @__PURE__ */ jsx22(StudioSectionLayout, { navProps: props, children: /* @__PURE__ */ jsxs20(
|
|
3032
3130
|
AdminPage,
|
|
3033
3131
|
{
|
|
3034
3132
|
breadcrumbs: [
|
|
@@ -3039,16 +3137,16 @@ function AdminStudioSocialMediaGlobalView(props) {
|
|
|
3039
3137
|
description: "Control which social profiles appear across the site.",
|
|
3040
3138
|
title: "Social Media",
|
|
3041
3139
|
children: [
|
|
3042
|
-
loading ? /* @__PURE__ */
|
|
3043
|
-
!loading ? /* @__PURE__ */
|
|
3044
|
-
error ? /* @__PURE__ */
|
|
3045
|
-
savedMessage ? /* @__PURE__ */
|
|
3046
|
-
/* @__PURE__ */
|
|
3140
|
+
loading ? /* @__PURE__ */ jsx22("div", { className: "orion-admin-list-meta", children: "Loading..." }) : null,
|
|
3141
|
+
!loading ? /* @__PURE__ */ jsxs20("form", { className: "orion-admin-form", onSubmit: save, children: [
|
|
3142
|
+
error ? /* @__PURE__ */ jsx22("div", { className: "orion-admin-error", children: error }) : null,
|
|
3143
|
+
savedMessage ? /* @__PURE__ */ jsx22("div", { className: "orion-admin-success", children: savedMessage }) : null,
|
|
3144
|
+
/* @__PURE__ */ jsx22("div", { style: { color: "var(--orion-admin-muted)", fontSize: "0.88rem", fontWeight: 700 }, children: "Add URLs for the platforms you use. Leave a URL blank to hide that platform." }),
|
|
3047
3145
|
SOCIAL_MEDIA_PLATFORMS.map((platform) => {
|
|
3048
3146
|
const profile = socialProfiles[platform];
|
|
3049
3147
|
const platformLabel = SOCIAL_MEDIA_PLATFORM_LABELS[platform];
|
|
3050
3148
|
const placeholderDomain = platform === "x" ? "x.com" : `${platform}.com`;
|
|
3051
|
-
return /* @__PURE__ */
|
|
3149
|
+
return /* @__PURE__ */ jsxs20(
|
|
3052
3150
|
"fieldset",
|
|
3053
3151
|
{
|
|
3054
3152
|
style: {
|
|
@@ -3059,10 +3157,10 @@ function AdminStudioSocialMediaGlobalView(props) {
|
|
|
3059
3157
|
padding: "0.85rem"
|
|
3060
3158
|
},
|
|
3061
3159
|
children: [
|
|
3062
|
-
/* @__PURE__ */
|
|
3063
|
-
/* @__PURE__ */
|
|
3160
|
+
/* @__PURE__ */ jsx22("legend", { style: { fontWeight: 700, padding: "0 0.3rem" }, children: platformLabel }),
|
|
3161
|
+
/* @__PURE__ */ jsxs20("label", { children: [
|
|
3064
3162
|
"Profile URL",
|
|
3065
|
-
/* @__PURE__ */
|
|
3163
|
+
/* @__PURE__ */ jsx22(
|
|
3066
3164
|
"input",
|
|
3067
3165
|
{
|
|
3068
3166
|
defaultValue: profile.url,
|
|
@@ -3073,16 +3171,16 @@ function AdminStudioSocialMediaGlobalView(props) {
|
|
|
3073
3171
|
}
|
|
3074
3172
|
)
|
|
3075
3173
|
] }),
|
|
3076
|
-
/* @__PURE__ */
|
|
3174
|
+
/* @__PURE__ */ jsxs20("label", { children: [
|
|
3077
3175
|
"Icon Style",
|
|
3078
|
-
/* @__PURE__ */
|
|
3176
|
+
/* @__PURE__ */ jsx22("select", { defaultValue: profile.icon, name: getSocialIconFieldName(platform), children: SOCIAL_MEDIA_ICON_OPTIONS[platform].map((option) => /* @__PURE__ */ jsx22("option", { value: option.value, children: option.label }, option.value)) })
|
|
3079
3177
|
] })
|
|
3080
3178
|
]
|
|
3081
3179
|
},
|
|
3082
3180
|
platform
|
|
3083
3181
|
);
|
|
3084
3182
|
}),
|
|
3085
|
-
/* @__PURE__ */
|
|
3183
|
+
/* @__PURE__ */ jsx22("button", { disabled: saving, type: "submit", children: saving ? "Saving..." : "Save Global" })
|
|
3086
3184
|
] }) : null
|
|
3087
3185
|
]
|
|
3088
3186
|
}
|
|
@@ -3090,7 +3188,7 @@ function AdminStudioSocialMediaGlobalView(props) {
|
|
|
3090
3188
|
}
|
|
3091
3189
|
|
|
3092
3190
|
// src/admin/components/studio/AdminStudioHeaderGlobalView.tsx
|
|
3093
|
-
import { useEffect as
|
|
3191
|
+
import { useEffect as useEffect11, useMemo as useMemo7, useState as useState12 } from "react";
|
|
3094
3192
|
import { SetStepNav as SetStepNav2 } from "@payloadcms/ui";
|
|
3095
3193
|
|
|
3096
3194
|
// src/nextjs/utilities/socialMedia.ts
|
|
@@ -3120,7 +3218,7 @@ function resolveSocialMediaLinks(data) {
|
|
|
3120
3218
|
}
|
|
3121
3219
|
|
|
3122
3220
|
// src/admin/components/studio/AdminStudioHeaderGlobalView.tsx
|
|
3123
|
-
import { jsx as
|
|
3221
|
+
import { jsx as jsx23, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3124
3222
|
var getPropString8 = (props, key, fallback) => {
|
|
3125
3223
|
if (!props || typeof props !== "object") return fallback;
|
|
3126
3224
|
const direct = props[key];
|
|
@@ -3186,16 +3284,16 @@ function AdminStudioHeaderGlobalView(props) {
|
|
|
3186
3284
|
const adminBasePath = useAdminBasePath();
|
|
3187
3285
|
const resolvedGlobalsBasePath = resolveAdminPath(adminBasePath, globalsBasePath);
|
|
3188
3286
|
const rawGlobalPath = resolveAdminPath(adminBasePath, `/globals/${globalSlug}`);
|
|
3189
|
-
const [loading, setLoading] =
|
|
3190
|
-
const [saving, setSaving] =
|
|
3191
|
-
const [error, setError] =
|
|
3192
|
-
const [savedMessage, setSavedMessage] =
|
|
3193
|
-
const [initialItems, setInitialItems] =
|
|
3194
|
-
const [liveItems, setLiveItems] =
|
|
3195
|
-
const [pages, setPages] =
|
|
3196
|
-
const [siteSettings, setSiteSettings] =
|
|
3197
|
-
const [socialMedia, setSocialMedia] =
|
|
3198
|
-
|
|
3287
|
+
const [loading, setLoading] = useState12(true);
|
|
3288
|
+
const [saving, setSaving] = useState12(false);
|
|
3289
|
+
const [error, setError] = useState12(null);
|
|
3290
|
+
const [savedMessage, setSavedMessage] = useState12(null);
|
|
3291
|
+
const [initialItems, setInitialItems] = useState12([]);
|
|
3292
|
+
const [liveItems, setLiveItems] = useState12([]);
|
|
3293
|
+
const [pages, setPages] = useState12([]);
|
|
3294
|
+
const [siteSettings, setSiteSettings] = useState12({});
|
|
3295
|
+
const [socialMedia, setSocialMedia] = useState12({});
|
|
3296
|
+
useEffect11(() => {
|
|
3199
3297
|
let cancelled = false;
|
|
3200
3298
|
const run = async () => {
|
|
3201
3299
|
setLoading(true);
|
|
@@ -3304,8 +3402,8 @@ function AdminStudioHeaderGlobalView(props) {
|
|
|
3304
3402
|
setSaving(false);
|
|
3305
3403
|
}
|
|
3306
3404
|
};
|
|
3307
|
-
return /* @__PURE__ */
|
|
3308
|
-
/* @__PURE__ */
|
|
3405
|
+
return /* @__PURE__ */ jsx23(StudioSectionLayout, { navProps: props, children: /* @__PURE__ */ jsxs21("div", { style: { paddingBottom: "2rem" }, children: [
|
|
3406
|
+
/* @__PURE__ */ jsx23(
|
|
3309
3407
|
SetStepNav2,
|
|
3310
3408
|
{
|
|
3311
3409
|
nav: [
|
|
@@ -3314,13 +3412,13 @@ function AdminStudioHeaderGlobalView(props) {
|
|
|
3314
3412
|
]
|
|
3315
3413
|
}
|
|
3316
3414
|
),
|
|
3317
|
-
/* @__PURE__ */
|
|
3318
|
-
/* @__PURE__ */
|
|
3319
|
-
loading ? /* @__PURE__ */
|
|
3320
|
-
error ? /* @__PURE__ */
|
|
3321
|
-
savedMessage ? /* @__PURE__ */
|
|
3322
|
-
!loading ? /* @__PURE__ */
|
|
3323
|
-
/* @__PURE__ */
|
|
3415
|
+
/* @__PURE__ */ jsx23("h1", { style: { margin: 0 }, children: "Header & Navigation" }),
|
|
3416
|
+
/* @__PURE__ */ jsx23("p", { style: { color: "var(--theme-elevation-600)", marginTop: "0.35rem" }, children: "Manage the main website navigation and preview it in place." }),
|
|
3417
|
+
loading ? /* @__PURE__ */ jsx23("p", { style: { color: "var(--theme-elevation-600)" }, children: "Loading header settings\u2026" }) : null,
|
|
3418
|
+
error ? /* @__PURE__ */ jsx23("p", { style: { color: "var(--theme-error-600)" }, children: error }) : null,
|
|
3419
|
+
savedMessage ? /* @__PURE__ */ jsx23("p", { style: { color: "var(--theme-success-700)" }, children: savedMessage }) : null,
|
|
3420
|
+
!loading ? /* @__PURE__ */ jsxs21("div", { style: { display: "grid", gap: "1rem", marginTop: "1rem" }, children: [
|
|
3421
|
+
/* @__PURE__ */ jsx23(
|
|
3324
3422
|
HeaderNavEditorWithPreview,
|
|
3325
3423
|
{
|
|
3326
3424
|
actionHref,
|
|
@@ -3337,7 +3435,7 @@ function AdminStudioHeaderGlobalView(props) {
|
|
|
3337
3435
|
},
|
|
3338
3436
|
editorKey
|
|
3339
3437
|
),
|
|
3340
|
-
/* @__PURE__ */
|
|
3438
|
+
/* @__PURE__ */ jsx23("div", { style: { display: "flex", gap: "0.6rem" }, children: /* @__PURE__ */ jsx23(
|
|
3341
3439
|
"button",
|
|
3342
3440
|
{
|
|
3343
3441
|
disabled: saving,
|
|
@@ -3361,9 +3459,9 @@ function AdminStudioHeaderGlobalView(props) {
|
|
|
3361
3459
|
}
|
|
3362
3460
|
|
|
3363
3461
|
// src/admin/components/studio/AdminStudioFooterGlobalView.tsx
|
|
3364
|
-
import { useEffect as
|
|
3462
|
+
import { useEffect as useEffect12, useMemo as useMemo8, useState as useState13 } from "react";
|
|
3365
3463
|
import { SetStepNav as SetStepNav3 } from "@payloadcms/ui";
|
|
3366
|
-
import { jsx as
|
|
3464
|
+
import { jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3367
3465
|
var getPropString9 = (props, key, fallback) => {
|
|
3368
3466
|
if (!props || typeof props !== "object") return fallback;
|
|
3369
3467
|
const direct = props[key];
|
|
@@ -3469,18 +3567,18 @@ function AdminStudioFooterGlobalView(props) {
|
|
|
3469
3567
|
const adminBasePath = useAdminBasePath();
|
|
3470
3568
|
const resolvedGlobalsBasePath = resolveAdminPath(adminBasePath, globalsBasePath);
|
|
3471
3569
|
const rawGlobalPath = resolveAdminPath(adminBasePath, `/globals/${globalSlug}`);
|
|
3472
|
-
const [loading, setLoading] =
|
|
3473
|
-
const [saving, setSaving] =
|
|
3474
|
-
const [error, setError] =
|
|
3475
|
-
const [savedMessage, setSavedMessage] =
|
|
3476
|
-
const [doc, setDoc] =
|
|
3570
|
+
const [loading, setLoading] = useState13(true);
|
|
3571
|
+
const [saving, setSaving] = useState13(false);
|
|
3572
|
+
const [error, setError] = useState13(null);
|
|
3573
|
+
const [savedMessage, setSavedMessage] = useState13(null);
|
|
3574
|
+
const [doc, setDoc] = useState13({
|
|
3477
3575
|
contactEmail: "",
|
|
3478
3576
|
contactPhone: "",
|
|
3479
3577
|
copyright: ""
|
|
3480
3578
|
});
|
|
3481
|
-
const [siteSettings, setSiteSettings] =
|
|
3482
|
-
const [socialMedia, setSocialMedia] =
|
|
3483
|
-
|
|
3579
|
+
const [siteSettings, setSiteSettings] = useState13({});
|
|
3580
|
+
const [socialMedia, setSocialMedia] = useState13({});
|
|
3581
|
+
useEffect12(() => {
|
|
3484
3582
|
let cancelled = false;
|
|
3485
3583
|
const run = async () => {
|
|
3486
3584
|
setLoading(true);
|
|
@@ -3577,8 +3675,8 @@ function AdminStudioFooterGlobalView(props) {
|
|
|
3577
3675
|
setSaving(false);
|
|
3578
3676
|
}
|
|
3579
3677
|
};
|
|
3580
|
-
return /* @__PURE__ */
|
|
3581
|
-
/* @__PURE__ */
|
|
3678
|
+
return /* @__PURE__ */ jsx24(StudioSectionLayout, { navProps: props, children: /* @__PURE__ */ jsxs22("div", { style: { paddingBottom: "2rem" }, children: [
|
|
3679
|
+
/* @__PURE__ */ jsx24(
|
|
3582
3680
|
SetStepNav3,
|
|
3583
3681
|
{
|
|
3584
3682
|
nav: [
|
|
@@ -3587,13 +3685,13 @@ function AdminStudioFooterGlobalView(props) {
|
|
|
3587
3685
|
]
|
|
3588
3686
|
}
|
|
3589
3687
|
),
|
|
3590
|
-
/* @__PURE__ */
|
|
3591
|
-
/* @__PURE__ */
|
|
3592
|
-
loading ? /* @__PURE__ */
|
|
3593
|
-
error ? /* @__PURE__ */
|
|
3594
|
-
savedMessage ? /* @__PURE__ */
|
|
3595
|
-
!loading ? /* @__PURE__ */
|
|
3596
|
-
/* @__PURE__ */
|
|
3688
|
+
/* @__PURE__ */ jsx24("h1", { style: { margin: 0 }, children: "Footer" }),
|
|
3689
|
+
/* @__PURE__ */ jsx24("p", { style: { color: "var(--theme-elevation-600)", marginTop: "0.35rem" }, children: "Manage footer contact details and preview the package footer in place." }),
|
|
3690
|
+
loading ? /* @__PURE__ */ jsx24("p", { style: { color: "var(--theme-elevation-600)" }, children: "Loading footer settings\u2026" }) : null,
|
|
3691
|
+
error ? /* @__PURE__ */ jsx24("p", { style: { color: "var(--theme-error-600)" }, children: error }) : null,
|
|
3692
|
+
savedMessage ? /* @__PURE__ */ jsx24("p", { style: { color: "var(--theme-success-700)" }, children: savedMessage }) : null,
|
|
3693
|
+
!loading ? /* @__PURE__ */ jsxs22("div", { style: { display: "grid", gap: "1rem", marginTop: "1rem" }, children: [
|
|
3694
|
+
/* @__PURE__ */ jsxs22(
|
|
3597
3695
|
"label",
|
|
3598
3696
|
{
|
|
3599
3697
|
style: {
|
|
@@ -3605,7 +3703,7 @@ function AdminStudioFooterGlobalView(props) {
|
|
|
3605
3703
|
},
|
|
3606
3704
|
children: [
|
|
3607
3705
|
"Copyright",
|
|
3608
|
-
/* @__PURE__ */
|
|
3706
|
+
/* @__PURE__ */ jsx24(
|
|
3609
3707
|
"input",
|
|
3610
3708
|
{
|
|
3611
3709
|
onChange: (event) => setDoc((current) => ({ ...current, copyright: event.target.value })),
|
|
@@ -3626,7 +3724,7 @@ function AdminStudioFooterGlobalView(props) {
|
|
|
3626
3724
|
]
|
|
3627
3725
|
}
|
|
3628
3726
|
),
|
|
3629
|
-
/* @__PURE__ */
|
|
3727
|
+
/* @__PURE__ */ jsxs22(
|
|
3630
3728
|
"label",
|
|
3631
3729
|
{
|
|
3632
3730
|
style: {
|
|
@@ -3638,7 +3736,7 @@ function AdminStudioFooterGlobalView(props) {
|
|
|
3638
3736
|
},
|
|
3639
3737
|
children: [
|
|
3640
3738
|
"Contact Email",
|
|
3641
|
-
/* @__PURE__ */
|
|
3739
|
+
/* @__PURE__ */ jsx24(
|
|
3642
3740
|
"input",
|
|
3643
3741
|
{
|
|
3644
3742
|
onChange: (event) => setDoc((current) => ({ ...current, contactEmail: event.target.value })),
|
|
@@ -3659,7 +3757,7 @@ function AdminStudioFooterGlobalView(props) {
|
|
|
3659
3757
|
]
|
|
3660
3758
|
}
|
|
3661
3759
|
),
|
|
3662
|
-
/* @__PURE__ */
|
|
3760
|
+
/* @__PURE__ */ jsxs22(
|
|
3663
3761
|
"label",
|
|
3664
3762
|
{
|
|
3665
3763
|
style: {
|
|
@@ -3671,7 +3769,7 @@ function AdminStudioFooterGlobalView(props) {
|
|
|
3671
3769
|
},
|
|
3672
3770
|
children: [
|
|
3673
3771
|
"Contact Phone",
|
|
3674
|
-
/* @__PURE__ */
|
|
3772
|
+
/* @__PURE__ */ jsx24(
|
|
3675
3773
|
"input",
|
|
3676
3774
|
{
|
|
3677
3775
|
onChange: (event) => setDoc((current) => ({ ...current, contactPhone: event.target.value })),
|
|
@@ -3692,8 +3790,8 @@ function AdminStudioFooterGlobalView(props) {
|
|
|
3692
3790
|
]
|
|
3693
3791
|
}
|
|
3694
3792
|
),
|
|
3695
|
-
/* @__PURE__ */
|
|
3696
|
-
/* @__PURE__ */
|
|
3793
|
+
/* @__PURE__ */ jsx24("div", { className: "orion-admin-preview-label", children: "Footer Preview" }),
|
|
3794
|
+
/* @__PURE__ */ jsx24("div", { className: "orion-admin-preview-frame", children: /* @__PURE__ */ jsx24("div", { className: "orion-admin-preview-surface", children: /* @__PURE__ */ jsx24(
|
|
3697
3795
|
SiteFooterPreview,
|
|
3698
3796
|
{
|
|
3699
3797
|
site: {
|
|
@@ -3712,7 +3810,7 @@ function AdminStudioFooterGlobalView(props) {
|
|
|
3712
3810
|
}
|
|
3713
3811
|
}
|
|
3714
3812
|
) }) }),
|
|
3715
|
-
/* @__PURE__ */
|
|
3813
|
+
/* @__PURE__ */ jsx24("div", { style: { display: "flex", gap: "0.6rem" }, children: /* @__PURE__ */ jsx24(
|
|
3716
3814
|
"button",
|
|
3717
3815
|
{
|
|
3718
3816
|
disabled: saving,
|
|
@@ -3736,9 +3834,9 @@ function AdminStudioFooterGlobalView(props) {
|
|
|
3736
3834
|
}
|
|
3737
3835
|
|
|
3738
3836
|
// src/admin/components/studio/AdminStudioContactFormView.tsx
|
|
3739
|
-
import { useEffect as
|
|
3837
|
+
import { useEffect as useEffect13, useMemo as useMemo9, useState as useState14 } from "react";
|
|
3740
3838
|
import { SetStepNav as SetStepNav4 } from "@payloadcms/ui";
|
|
3741
|
-
import { jsx as
|
|
3839
|
+
import { jsx as jsx25, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3742
3840
|
var defaultDoc = {
|
|
3743
3841
|
disabledMessage: "This form is temporarily unavailable. Please call us for immediate service.",
|
|
3744
3842
|
enabled: true,
|
|
@@ -3827,12 +3925,12 @@ function AdminStudioContactFormView(props) {
|
|
|
3827
3925
|
const adminBasePath = useAdminBasePath();
|
|
3828
3926
|
const resolvedGlobalsBasePath = resolveAdminPath(adminBasePath, globalsBasePath);
|
|
3829
3927
|
const rawGlobalPath = resolveAdminPath(adminBasePath, `/globals/${globalSlug}`);
|
|
3830
|
-
const [doc, setDoc] =
|
|
3831
|
-
const [error, setError] =
|
|
3832
|
-
const [isLoading, setIsLoading] =
|
|
3833
|
-
const [isSaving, setIsSaving] =
|
|
3834
|
-
const [savedMessage, setSavedMessage] =
|
|
3835
|
-
|
|
3928
|
+
const [doc, setDoc] = useState14(defaultDoc);
|
|
3929
|
+
const [error, setError] = useState14(null);
|
|
3930
|
+
const [isLoading, setIsLoading] = useState14(true);
|
|
3931
|
+
const [isSaving, setIsSaving] = useState14(false);
|
|
3932
|
+
const [savedMessage, setSavedMessage] = useState14(null);
|
|
3933
|
+
useEffect13(() => {
|
|
3836
3934
|
let mounted = true;
|
|
3837
3935
|
const load = async () => {
|
|
3838
3936
|
setIsLoading(true);
|
|
@@ -3899,8 +3997,8 @@ function AdminStudioContactFormView(props) {
|
|
|
3899
3997
|
setIsSaving(false);
|
|
3900
3998
|
}
|
|
3901
3999
|
};
|
|
3902
|
-
return /* @__PURE__ */
|
|
3903
|
-
/* @__PURE__ */
|
|
4000
|
+
return /* @__PURE__ */ jsx25(StudioSectionLayout, { navProps: props, children: /* @__PURE__ */ jsxs23("div", { style: { paddingBottom: "2rem" }, children: [
|
|
4001
|
+
/* @__PURE__ */ jsx25(
|
|
3904
4002
|
SetStepNav4,
|
|
3905
4003
|
{
|
|
3906
4004
|
nav: [
|
|
@@ -3909,14 +4007,14 @@ function AdminStudioContactFormView(props) {
|
|
|
3909
4007
|
]
|
|
3910
4008
|
}
|
|
3911
4009
|
),
|
|
3912
|
-
/* @__PURE__ */
|
|
3913
|
-
/* @__PURE__ */
|
|
3914
|
-
isLoading ? /* @__PURE__ */
|
|
3915
|
-
error ? /* @__PURE__ */
|
|
3916
|
-
savedMessage ? /* @__PURE__ */
|
|
3917
|
-
!isLoading ? /* @__PURE__ */
|
|
3918
|
-
/* @__PURE__ */
|
|
3919
|
-
/* @__PURE__ */
|
|
4010
|
+
/* @__PURE__ */ jsx25("h1", { style: { margin: 0 }, children: "Contact Form" }),
|
|
4011
|
+
/* @__PURE__ */ jsx25("p", { style: { color: "var(--theme-elevation-600)", marginTop: "0.35rem" }, children: "Edit form behavior and submission messaging without leaving Studio." }),
|
|
4012
|
+
isLoading ? /* @__PURE__ */ jsx25("p", { style: { color: "var(--theme-elevation-600)" }, children: "Loading form settings\u2026" }) : null,
|
|
4013
|
+
error ? /* @__PURE__ */ jsx25("p", { style: { color: "var(--theme-error-600)" }, children: error }) : null,
|
|
4014
|
+
savedMessage ? /* @__PURE__ */ jsx25("p", { style: { color: "var(--theme-success-700)" }, children: savedMessage }) : null,
|
|
4015
|
+
!isLoading ? /* @__PURE__ */ jsxs23("div", { style: { display: "grid", gap: "1rem", marginTop: "1rem", maxWidth: 900 }, children: [
|
|
4016
|
+
/* @__PURE__ */ jsxs23("label", { style: { ...fieldLabelStyle, alignItems: "center", display: "flex", gap: "0.6rem" }, children: [
|
|
4017
|
+
/* @__PURE__ */ jsx25(
|
|
3920
4018
|
"input",
|
|
3921
4019
|
{
|
|
3922
4020
|
checked: doc.enabled,
|
|
@@ -3926,9 +4024,9 @@ function AdminStudioContactFormView(props) {
|
|
|
3926
4024
|
),
|
|
3927
4025
|
"Form enabled"
|
|
3928
4026
|
] }),
|
|
3929
|
-
/* @__PURE__ */
|
|
4027
|
+
/* @__PURE__ */ jsxs23("label", { style: fieldLabelStyle, children: [
|
|
3930
4028
|
"Notification Email",
|
|
3931
|
-
/* @__PURE__ */
|
|
4029
|
+
/* @__PURE__ */ jsx25(
|
|
3932
4030
|
"input",
|
|
3933
4031
|
{
|
|
3934
4032
|
onChange: (event) => setDoc((prev) => ({ ...prev, notificationEmail: event.target.value })),
|
|
@@ -3938,9 +4036,9 @@ function AdminStudioContactFormView(props) {
|
|
|
3938
4036
|
}
|
|
3939
4037
|
)
|
|
3940
4038
|
] }),
|
|
3941
|
-
/* @__PURE__ */
|
|
4039
|
+
/* @__PURE__ */ jsxs23("label", { style: fieldLabelStyle, children: [
|
|
3942
4040
|
"Submit Button Label",
|
|
3943
|
-
/* @__PURE__ */
|
|
4041
|
+
/* @__PURE__ */ jsx25(
|
|
3944
4042
|
"input",
|
|
3945
4043
|
{
|
|
3946
4044
|
onChange: (event) => setDoc((prev) => ({ ...prev, submitButtonLabel: event.target.value })),
|
|
@@ -3950,9 +4048,9 @@ function AdminStudioContactFormView(props) {
|
|
|
3950
4048
|
}
|
|
3951
4049
|
)
|
|
3952
4050
|
] }),
|
|
3953
|
-
/* @__PURE__ */
|
|
4051
|
+
/* @__PURE__ */ jsxs23("label", { style: fieldLabelStyle, children: [
|
|
3954
4052
|
"Success Message",
|
|
3955
|
-
/* @__PURE__ */
|
|
4053
|
+
/* @__PURE__ */ jsx25(
|
|
3956
4054
|
"input",
|
|
3957
4055
|
{
|
|
3958
4056
|
onChange: (event) => setDoc((prev) => ({ ...prev, successMessage: event.target.value })),
|
|
@@ -3962,9 +4060,9 @@ function AdminStudioContactFormView(props) {
|
|
|
3962
4060
|
}
|
|
3963
4061
|
)
|
|
3964
4062
|
] }),
|
|
3965
|
-
/* @__PURE__ */
|
|
4063
|
+
/* @__PURE__ */ jsxs23("label", { style: fieldLabelStyle, children: [
|
|
3966
4064
|
"Error Message",
|
|
3967
|
-
/* @__PURE__ */
|
|
4065
|
+
/* @__PURE__ */ jsx25(
|
|
3968
4066
|
"input",
|
|
3969
4067
|
{
|
|
3970
4068
|
onChange: (event) => setDoc((prev) => ({ ...prev, errorMessage: event.target.value })),
|
|
@@ -3974,9 +4072,9 @@ function AdminStudioContactFormView(props) {
|
|
|
3974
4072
|
}
|
|
3975
4073
|
)
|
|
3976
4074
|
] }),
|
|
3977
|
-
/* @__PURE__ */
|
|
4075
|
+
/* @__PURE__ */ jsxs23("label", { style: fieldLabelStyle, children: [
|
|
3978
4076
|
"Disabled Message",
|
|
3979
|
-
/* @__PURE__ */
|
|
4077
|
+
/* @__PURE__ */ jsx25(
|
|
3980
4078
|
"input",
|
|
3981
4079
|
{
|
|
3982
4080
|
onChange: (event) => setDoc((prev) => ({ ...prev, disabledMessage: event.target.value })),
|
|
@@ -3986,7 +4084,7 @@ function AdminStudioContactFormView(props) {
|
|
|
3986
4084
|
}
|
|
3987
4085
|
)
|
|
3988
4086
|
] }),
|
|
3989
|
-
/* @__PURE__ */
|
|
4087
|
+
/* @__PURE__ */ jsxs23(
|
|
3990
4088
|
"div",
|
|
3991
4089
|
{
|
|
3992
4090
|
style: {
|
|
@@ -3996,9 +4094,9 @@ function AdminStudioContactFormView(props) {
|
|
|
3996
4094
|
padding: "0.85rem"
|
|
3997
4095
|
},
|
|
3998
4096
|
children: [
|
|
3999
|
-
/* @__PURE__ */
|
|
4000
|
-
/* @__PURE__ */
|
|
4001
|
-
/* @__PURE__ */
|
|
4097
|
+
/* @__PURE__ */ jsx25("div", { style: { fontWeight: 900, marginBottom: "0.65rem" }, children: "Service Options" }),
|
|
4098
|
+
/* @__PURE__ */ jsx25("div", { style: { display: "grid", gap: "0.55rem" }, children: doc.serviceOptions.map((option, index) => /* @__PURE__ */ jsxs23("div", { style: { display: "flex", gap: "0.5rem" }, children: [
|
|
4099
|
+
/* @__PURE__ */ jsx25(
|
|
4002
4100
|
"input",
|
|
4003
4101
|
{
|
|
4004
4102
|
onChange: (event) => setDoc((prev) => ({
|
|
@@ -4012,7 +4110,7 @@ function AdminStudioContactFormView(props) {
|
|
|
4012
4110
|
value: option.label
|
|
4013
4111
|
}
|
|
4014
4112
|
),
|
|
4015
|
-
/* @__PURE__ */
|
|
4113
|
+
/* @__PURE__ */ jsx25(
|
|
4016
4114
|
"button",
|
|
4017
4115
|
{
|
|
4018
4116
|
onClick: () => setDoc((prev) => ({
|
|
@@ -4025,7 +4123,7 @@ function AdminStudioContactFormView(props) {
|
|
|
4025
4123
|
}
|
|
4026
4124
|
)
|
|
4027
4125
|
] }, `${index}-${option.label}`)) }),
|
|
4028
|
-
/* @__PURE__ */
|
|
4126
|
+
/* @__PURE__ */ jsx25(
|
|
4029
4127
|
"button",
|
|
4030
4128
|
{
|
|
4031
4129
|
onClick: () => setDoc((prev) => ({
|
|
@@ -4040,9 +4138,9 @@ function AdminStudioContactFormView(props) {
|
|
|
4040
4138
|
]
|
|
4041
4139
|
}
|
|
4042
4140
|
),
|
|
4043
|
-
/* @__PURE__ */
|
|
4044
|
-
/* @__PURE__ */
|
|
4045
|
-
/* @__PURE__ */
|
|
4141
|
+
/* @__PURE__ */ jsxs23("div", { style: { display: "flex", gap: "0.6rem" }, children: [
|
|
4142
|
+
/* @__PURE__ */ jsx25("button", { disabled: isSaving, onClick: () => void save(), style: buttonStyle, type: "button", children: isSaving ? "Saving\u2026" : "Save Form Settings" }),
|
|
4143
|
+
/* @__PURE__ */ jsx25(
|
|
4046
4144
|
"a",
|
|
4047
4145
|
{
|
|
4048
4146
|
href: rawGlobalPath,
|
|
@@ -4062,8 +4160,8 @@ function AdminStudioContactFormView(props) {
|
|
|
4062
4160
|
}
|
|
4063
4161
|
|
|
4064
4162
|
// src/admin/components/studio/AdminStudioMediaView.tsx
|
|
4065
|
-
import { useEffect as
|
|
4066
|
-
import { jsx as
|
|
4163
|
+
import { useEffect as useEffect14, useMemo as useMemo10, useState as useState15 } from "react";
|
|
4164
|
+
import { jsx as jsx26, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
4067
4165
|
var MEDIA_LIBRARY_SYNC_EVENT = "orion-media-library-updated";
|
|
4068
4166
|
var getPropString11 = (props, key, fallback) => {
|
|
4069
4167
|
if (!props || typeof props !== "object") return fallback;
|
|
@@ -4079,9 +4177,9 @@ var getPropString11 = (props, key, fallback) => {
|
|
|
4079
4177
|
function AdminStudioMediaView(props) {
|
|
4080
4178
|
const mediaCollectionSlug = getPropString11(props, "mediaCollectionSlug", "media");
|
|
4081
4179
|
const adminBasePath = useAdminBasePath();
|
|
4082
|
-
const [docs, setDocs] =
|
|
4083
|
-
const [loading, setLoading] =
|
|
4084
|
-
const [error, setError] =
|
|
4180
|
+
const [docs, setDocs] = useState15([]);
|
|
4181
|
+
const [loading, setLoading] = useState15(true);
|
|
4182
|
+
const [error, setError] = useState15(null);
|
|
4085
4183
|
const apiURL = useMemo10(() => {
|
|
4086
4184
|
const params = new URLSearchParams({
|
|
4087
4185
|
depth: "0",
|
|
@@ -4091,7 +4189,7 @@ function AdminStudioMediaView(props) {
|
|
|
4091
4189
|
});
|
|
4092
4190
|
return `/api/${mediaCollectionSlug}?${params.toString()}`;
|
|
4093
4191
|
}, [mediaCollectionSlug]);
|
|
4094
|
-
|
|
4192
|
+
useEffect14(() => {
|
|
4095
4193
|
let cancelled = false;
|
|
4096
4194
|
const run = async () => {
|
|
4097
4195
|
setLoading(true);
|
|
@@ -4127,7 +4225,7 @@ function AdminStudioMediaView(props) {
|
|
|
4127
4225
|
window.removeEventListener("storage", rerun);
|
|
4128
4226
|
};
|
|
4129
4227
|
}, [apiURL]);
|
|
4130
|
-
return /* @__PURE__ */
|
|
4228
|
+
return /* @__PURE__ */ jsx26(StudioSectionLayout, { navProps: props, children: /* @__PURE__ */ jsxs24(
|
|
4131
4229
|
AdminPage,
|
|
4132
4230
|
{
|
|
4133
4231
|
breadcrumbs: [
|
|
@@ -4137,18 +4235,18 @@ function AdminStudioMediaView(props) {
|
|
|
4137
4235
|
description: `${docs.length} asset${docs.length === 1 ? "" : "s"} \u2014 Upload assets here, including logos used in Site Settings branding.`,
|
|
4138
4236
|
title: "Media",
|
|
4139
4237
|
children: [
|
|
4140
|
-
/* @__PURE__ */
|
|
4141
|
-
loading ? /* @__PURE__ */
|
|
4142
|
-
error ? /* @__PURE__ */
|
|
4143
|
-
/* @__PURE__ */
|
|
4144
|
-
!loading && !error && docs.length === 0 ? /* @__PURE__ */
|
|
4145
|
-
/* @__PURE__ */
|
|
4146
|
-
/* @__PURE__ */
|
|
4238
|
+
/* @__PURE__ */ jsx26(MediaUploadForm, {}),
|
|
4239
|
+
loading ? /* @__PURE__ */ jsx26("div", { className: "orion-admin-list-meta", style: { marginTop: "1rem" }, children: "Loading..." }) : null,
|
|
4240
|
+
error ? /* @__PURE__ */ jsx26("div", { className: "orion-admin-error", style: { marginTop: "1rem" }, children: error }) : null,
|
|
4241
|
+
/* @__PURE__ */ jsxs24("div", { className: "orion-admin-list", style: { marginTop: "1rem" }, children: [
|
|
4242
|
+
!loading && !error && docs.length === 0 ? /* @__PURE__ */ jsxs24("div", { className: "orion-admin-card", children: [
|
|
4243
|
+
/* @__PURE__ */ jsx26("strong", { children: "No media found" }),
|
|
4244
|
+
/* @__PURE__ */ jsx26("span", { children: "Upload an image to get started." })
|
|
4147
4245
|
] }) : null,
|
|
4148
4246
|
docs.map((doc) => {
|
|
4149
4247
|
const id = typeof doc.id === "string" || typeof doc.id === "number" ? String(doc.id) : "";
|
|
4150
4248
|
if (!id) return null;
|
|
4151
|
-
return /* @__PURE__ */
|
|
4249
|
+
return /* @__PURE__ */ jsx26(
|
|
4152
4250
|
MediaListItem,
|
|
4153
4251
|
{
|
|
4154
4252
|
alt: doc.alt,
|
|
@@ -4171,8 +4269,8 @@ function AdminStudioMediaView(props) {
|
|
|
4171
4269
|
}
|
|
4172
4270
|
|
|
4173
4271
|
// src/admin/components/studio/AdminStudioMediaItemView.tsx
|
|
4174
|
-
import { useEffect as
|
|
4175
|
-
import { jsx as
|
|
4272
|
+
import { useEffect as useEffect15, useMemo as useMemo11, useState as useState16 } from "react";
|
|
4273
|
+
import { jsx as jsx27, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
4176
4274
|
var getPropString12 = (props, key, fallback) => {
|
|
4177
4275
|
if (!props || typeof props !== "object") return fallback;
|
|
4178
4276
|
const direct = props[key];
|
|
@@ -4203,12 +4301,12 @@ function AdminStudioMediaItemView(props) {
|
|
|
4203
4301
|
const adminBasePath = useAdminBasePath();
|
|
4204
4302
|
const mediaPath = resolveAdminPath(adminBasePath, "/media");
|
|
4205
4303
|
const mediaIDFromParams = useMemo11(() => getParam2(props.params, "id"), [props.params]);
|
|
4206
|
-
const [mediaID, setMediaID] =
|
|
4207
|
-
const [doc, setDoc] =
|
|
4208
|
-
const [loading, setLoading] =
|
|
4209
|
-
const [error, setError] =
|
|
4210
|
-
const [savedMessage, setSavedMessage] =
|
|
4211
|
-
|
|
4304
|
+
const [mediaID, setMediaID] = useState16(mediaIDFromParams);
|
|
4305
|
+
const [doc, setDoc] = useState16(null);
|
|
4306
|
+
const [loading, setLoading] = useState16(true);
|
|
4307
|
+
const [error, setError] = useState16(null);
|
|
4308
|
+
const [savedMessage, setSavedMessage] = useState16(null);
|
|
4309
|
+
useEffect15(() => {
|
|
4212
4310
|
if (mediaIDFromParams) {
|
|
4213
4311
|
setMediaID(mediaIDFromParams);
|
|
4214
4312
|
return;
|
|
@@ -4236,7 +4334,7 @@ function AdminStudioMediaItemView(props) {
|
|
|
4236
4334
|
setLoading(false);
|
|
4237
4335
|
}
|
|
4238
4336
|
};
|
|
4239
|
-
|
|
4337
|
+
useEffect15(() => {
|
|
4240
4338
|
if (!mediaID) return;
|
|
4241
4339
|
void loadDoc(mediaID);
|
|
4242
4340
|
}, [mediaCollectionSlug, mediaID]);
|
|
@@ -4282,7 +4380,7 @@ function AdminStudioMediaItemView(props) {
|
|
|
4282
4380
|
setError(deleteError instanceof Error ? deleteError.message : "Failed to delete media item.");
|
|
4283
4381
|
}
|
|
4284
4382
|
};
|
|
4285
|
-
return /* @__PURE__ */
|
|
4383
|
+
return /* @__PURE__ */ jsx27(StudioSectionLayout, { navProps: props, children: /* @__PURE__ */ jsxs25(
|
|
4286
4384
|
AdminPage,
|
|
4287
4385
|
{
|
|
4288
4386
|
breadcrumbs: [
|
|
@@ -4293,10 +4391,10 @@ function AdminStudioMediaItemView(props) {
|
|
|
4293
4391
|
description: "Update metadata or remove the selected asset.",
|
|
4294
4392
|
title: "Media Asset",
|
|
4295
4393
|
children: [
|
|
4296
|
-
loading ? /* @__PURE__ */
|
|
4297
|
-
error ? /* @__PURE__ */
|
|
4298
|
-
savedMessage ? /* @__PURE__ */
|
|
4299
|
-
!loading && !error && doc && mediaID ? /* @__PURE__ */
|
|
4394
|
+
loading ? /* @__PURE__ */ jsx27("div", { className: "orion-admin-list-meta", children: "Loading..." }) : null,
|
|
4395
|
+
error ? /* @__PURE__ */ jsx27("div", { className: "orion-admin-error", children: error }) : null,
|
|
4396
|
+
savedMessage ? /* @__PURE__ */ jsx27("div", { className: "orion-admin-success", children: savedMessage }) : null,
|
|
4397
|
+
!loading && !error && doc && mediaID ? /* @__PURE__ */ jsx27(
|
|
4300
4398
|
MediaDetailPanel,
|
|
4301
4399
|
{
|
|
4302
4400
|
alt: doc.alt,
|
|
@@ -4319,9 +4417,9 @@ function AdminStudioMediaItemView(props) {
|
|
|
4319
4417
|
|
|
4320
4418
|
// src/admin/components/studio/AdminStudioFormsView.tsx
|
|
4321
4419
|
import Link3 from "next/link";
|
|
4322
|
-
import { useEffect as
|
|
4420
|
+
import { useEffect as useEffect16, useMemo as useMemo12, useState as useState17 } from "react";
|
|
4323
4421
|
import { useAuth as useAuth6 } from "@payloadcms/ui";
|
|
4324
|
-
import { jsx as
|
|
4422
|
+
import { jsx as jsx28, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
4325
4423
|
var FORM_TONES = [
|
|
4326
4424
|
{
|
|
4327
4425
|
accent: "var(--orion-cms-tone-1, var(--orion-cms-accent, var(--orion-admin-accent)))",
|
|
@@ -4533,9 +4631,9 @@ var loadCollection = async (slug, params) => {
|
|
|
4533
4631
|
const payload = await response.json();
|
|
4534
4632
|
return Array.isArray(payload.docs) ? payload.docs : [];
|
|
4535
4633
|
};
|
|
4536
|
-
var renderEmptyMessage = (message) => /* @__PURE__ */
|
|
4537
|
-
/* @__PURE__ */
|
|
4538
|
-
/* @__PURE__ */
|
|
4634
|
+
var renderEmptyMessage = (message) => /* @__PURE__ */ jsxs26("div", { className: "orion-admin-empty-state", children: [
|
|
4635
|
+
/* @__PURE__ */ jsx28("strong", { children: "No responses yet" }),
|
|
4636
|
+
/* @__PURE__ */ jsx28("span", { children: message })
|
|
4539
4637
|
] });
|
|
4540
4638
|
function AdminStudioFormsView(props) {
|
|
4541
4639
|
const { user } = useAuth6();
|
|
@@ -4553,11 +4651,11 @@ function AdminStudioFormsView(props) {
|
|
|
4553
4651
|
`/collections/${formSubmissionsCollectionSlug}`
|
|
4554
4652
|
);
|
|
4555
4653
|
const rawUploadsPath = resolveAdminPath(adminBasePath, `/collections/${formUploadsCollectionSlug}`);
|
|
4556
|
-
const [forms, setForms] =
|
|
4557
|
-
const [submissions, setSubmissions] =
|
|
4558
|
-
const [loading, setLoading] =
|
|
4559
|
-
const [error, setError] =
|
|
4560
|
-
|
|
4654
|
+
const [forms, setForms] = useState17([]);
|
|
4655
|
+
const [submissions, setSubmissions] = useState17([]);
|
|
4656
|
+
const [loading, setLoading] = useState17(true);
|
|
4657
|
+
const [error, setError] = useState17(null);
|
|
4658
|
+
useEffect16(() => {
|
|
4561
4659
|
if (!canReviewForms(user)) {
|
|
4562
4660
|
return;
|
|
4563
4661
|
}
|
|
@@ -4621,7 +4719,7 @@ function AdminStudioFormsView(props) {
|
|
|
4621
4719
|
[forms, submissionsByForm]
|
|
4622
4720
|
);
|
|
4623
4721
|
if (!canReviewForms(user)) {
|
|
4624
|
-
return /* @__PURE__ */
|
|
4722
|
+
return /* @__PURE__ */ jsx28(StudioSectionLayout, { navProps: props, children: /* @__PURE__ */ jsx28(
|
|
4625
4723
|
AdminPage,
|
|
4626
4724
|
{
|
|
4627
4725
|
breadcrumbs: [
|
|
@@ -4630,14 +4728,14 @@ function AdminStudioFormsView(props) {
|
|
|
4630
4728
|
],
|
|
4631
4729
|
description: "You do not have access to this section.",
|
|
4632
4730
|
title: "Forms",
|
|
4633
|
-
children: /* @__PURE__ */
|
|
4634
|
-
/* @__PURE__ */
|
|
4635
|
-
/* @__PURE__ */
|
|
4731
|
+
children: /* @__PURE__ */ jsxs26("div", { className: "orion-admin-card", children: [
|
|
4732
|
+
/* @__PURE__ */ jsx28("strong", { children: "Access denied" }),
|
|
4733
|
+
/* @__PURE__ */ jsx28("span", { children: "This section is restricted to editor and administrator accounts." })
|
|
4636
4734
|
] })
|
|
4637
4735
|
}
|
|
4638
4736
|
) });
|
|
4639
4737
|
}
|
|
4640
|
-
return /* @__PURE__ */
|
|
4738
|
+
return /* @__PURE__ */ jsx28(StudioSectionLayout, { navProps: props, children: /* @__PURE__ */ jsxs26(
|
|
4641
4739
|
AdminPage,
|
|
4642
4740
|
{
|
|
4643
4741
|
breadcrumbs: [
|
|
@@ -4647,30 +4745,30 @@ function AdminStudioFormsView(props) {
|
|
|
4647
4745
|
description: "Review live forms, recent responses, and uploaded files.",
|
|
4648
4746
|
title: "Forms",
|
|
4649
4747
|
children: [
|
|
4650
|
-
loading ? /* @__PURE__ */
|
|
4651
|
-
error ? /* @__PURE__ */
|
|
4652
|
-
!loading && !error ? /* @__PURE__ */
|
|
4653
|
-
/* @__PURE__ */
|
|
4654
|
-
/* @__PURE__ */
|
|
4655
|
-
/* @__PURE__ */
|
|
4656
|
-
/* @__PURE__ */
|
|
4657
|
-
/* @__PURE__ */
|
|
4748
|
+
loading ? /* @__PURE__ */ jsx28("div", { className: "orion-admin-list-meta", children: "Loading..." }) : null,
|
|
4749
|
+
error ? /* @__PURE__ */ jsx28("div", { className: "orion-admin-error", children: error }) : null,
|
|
4750
|
+
!loading && !error ? /* @__PURE__ */ jsxs26("div", { className: "orion-admin-forms-dashboard", children: [
|
|
4751
|
+
/* @__PURE__ */ jsxs26("div", { className: "orion-admin-forms-summary-grid", children: [
|
|
4752
|
+
/* @__PURE__ */ jsxs26("article", { className: "orion-admin-overview-stat", children: [
|
|
4753
|
+
/* @__PURE__ */ jsx28("span", { className: "orion-admin-overview-stat-label", children: "Configured forms" }),
|
|
4754
|
+
/* @__PURE__ */ jsx28("strong", { children: forms.length }),
|
|
4755
|
+
/* @__PURE__ */ jsx28("p", { children: "Published or draft forms currently available inside the CMS." })
|
|
4658
4756
|
] }),
|
|
4659
|
-
/* @__PURE__ */
|
|
4660
|
-
/* @__PURE__ */
|
|
4661
|
-
/* @__PURE__ */
|
|
4662
|
-
/* @__PURE__ */
|
|
4757
|
+
/* @__PURE__ */ jsxs26("article", { className: "orion-admin-overview-stat", children: [
|
|
4758
|
+
/* @__PURE__ */ jsx28("span", { className: "orion-admin-overview-stat-label", children: "Recent submissions" }),
|
|
4759
|
+
/* @__PURE__ */ jsx28("strong", { children: submissions.length }),
|
|
4760
|
+
/* @__PURE__ */ jsx28("p", { children: "Latest 200 responses collected across every form." })
|
|
4663
4761
|
] }),
|
|
4664
|
-
/* @__PURE__ */
|
|
4665
|
-
/* @__PURE__ */
|
|
4666
|
-
/* @__PURE__ */
|
|
4667
|
-
/* @__PURE__ */
|
|
4762
|
+
/* @__PURE__ */ jsxs26("article", { className: "orion-admin-overview-stat", children: [
|
|
4763
|
+
/* @__PURE__ */ jsx28("span", { className: "orion-admin-overview-stat-label", children: "Most active form" }),
|
|
4764
|
+
/* @__PURE__ */ jsx28("strong", { children: busiestForm && busiestForm.count > 0 ? busiestForm.title : "No activity yet" }),
|
|
4765
|
+
/* @__PURE__ */ jsx28("p", { children: busiestForm && busiestForm.count > 0 ? `${busiestForm.count} response${busiestForm.count === 1 ? "" : "s"} in this view.` : "Submissions will surface here once a form starts receiving traffic." })
|
|
4668
4766
|
] })
|
|
4669
4767
|
] }),
|
|
4670
|
-
forms.length === 0 ? /* @__PURE__ */
|
|
4671
|
-
/* @__PURE__ */
|
|
4672
|
-
/* @__PURE__ */
|
|
4673
|
-
] }) : /* @__PURE__ */
|
|
4768
|
+
forms.length === 0 ? /* @__PURE__ */ jsxs26("div", { className: "orion-admin-card", children: [
|
|
4769
|
+
/* @__PURE__ */ jsx28("strong", { children: "No forms found" }),
|
|
4770
|
+
/* @__PURE__ */ jsx28("span", { children: "Create a form in Payload to start collecting responses." })
|
|
4771
|
+
] }) : /* @__PURE__ */ jsx28("div", { className: "orion-admin-forms-board-list", children: forms.map((form) => {
|
|
4674
4772
|
const id = typeof form.id === "string" || typeof form.id === "number" ? String(form.id) : "";
|
|
4675
4773
|
if (!id) return null;
|
|
4676
4774
|
const title = typeof form.title === "string" && form.title.trim().length > 0 ? form.title : "Untitled Form";
|
|
@@ -4685,30 +4783,30 @@ function AdminStudioFormsView(props) {
|
|
|
4685
4783
|
const updatedMeta = form.updatedAt ? `Updated ${formatDate(form.updatedAt)}` : "Update time unavailable";
|
|
4686
4784
|
const toneStyle = getFormToneStyle(slug, title || id);
|
|
4687
4785
|
const isResponsePanelScrollable = formSubmissions.length > RESPONSE_SCROLL_THRESHOLD;
|
|
4688
|
-
return /* @__PURE__ */
|
|
4689
|
-
/* @__PURE__ */
|
|
4690
|
-
/* @__PURE__ */
|
|
4691
|
-
/* @__PURE__ */
|
|
4692
|
-
/* @__PURE__ */
|
|
4693
|
-
/* @__PURE__ */
|
|
4786
|
+
return /* @__PURE__ */ jsxs26("section", { className: "orion-admin-form-board", style: toneStyle, children: [
|
|
4787
|
+
/* @__PURE__ */ jsxs26("div", { className: "orion-admin-form-board-header", children: [
|
|
4788
|
+
/* @__PURE__ */ jsxs26("div", { className: "orion-admin-form-board-heading", children: [
|
|
4789
|
+
/* @__PURE__ */ jsxs26("div", { className: "orion-admin-form-board-kicker-row", children: [
|
|
4790
|
+
/* @__PURE__ */ jsx28("span", { className: "orion-admin-form-board-kicker", children: slug || "No slug set" }),
|
|
4791
|
+
/* @__PURE__ */ jsx28("span", { className: "orion-admin-form-board-meta", children: updatedMeta })
|
|
4694
4792
|
] }),
|
|
4695
|
-
/* @__PURE__ */
|
|
4696
|
-
/* @__PURE__ */
|
|
4697
|
-
/* @__PURE__ */
|
|
4698
|
-
/* @__PURE__ */
|
|
4699
|
-
/* @__PURE__ */
|
|
4793
|
+
/* @__PURE__ */ jsxs26("div", { className: "orion-admin-form-board-title-row", children: [
|
|
4794
|
+
/* @__PURE__ */ jsx28("div", { className: "orion-admin-form-board-mark", children: getInitials(title, slug) }),
|
|
4795
|
+
/* @__PURE__ */ jsxs26("div", { className: "orion-admin-form-board-copy", children: [
|
|
4796
|
+
/* @__PURE__ */ jsx28("h2", { className: "orion-admin-form-board-title", children: title }),
|
|
4797
|
+
/* @__PURE__ */ jsx28("p", { className: "orion-admin-form-board-subtitle", children: latestResponse ? `Latest response ${latestResponseLabel}` : "Awaiting the first submission" })
|
|
4700
4798
|
] })
|
|
4701
4799
|
] })
|
|
4702
4800
|
] }),
|
|
4703
|
-
/* @__PURE__ */
|
|
4704
|
-
/* @__PURE__ */
|
|
4705
|
-
/* @__PURE__ */
|
|
4706
|
-
/* @__PURE__ */
|
|
4801
|
+
/* @__PURE__ */ jsxs26("div", { className: "orion-admin-form-board-actions", children: [
|
|
4802
|
+
/* @__PURE__ */ jsxs26("div", { className: "orion-admin-form-board-count", children: [
|
|
4803
|
+
/* @__PURE__ */ jsx28("span", { className: "orion-admin-form-board-count-value", children: formSubmissions.length }),
|
|
4804
|
+
/* @__PURE__ */ jsxs26("span", { className: "orion-admin-form-board-count-label", children: [
|
|
4707
4805
|
"response",
|
|
4708
4806
|
formSubmissions.length === 1 ? "" : "s"
|
|
4709
4807
|
] })
|
|
4710
4808
|
] }),
|
|
4711
|
-
/* @__PURE__ */
|
|
4809
|
+
/* @__PURE__ */ jsx28(
|
|
4712
4810
|
Link3,
|
|
4713
4811
|
{
|
|
4714
4812
|
className: "orion-admin-action-button orion-admin-action-button--soft",
|
|
@@ -4718,35 +4816,35 @@ function AdminStudioFormsView(props) {
|
|
|
4718
4816
|
)
|
|
4719
4817
|
] })
|
|
4720
4818
|
] }),
|
|
4721
|
-
/* @__PURE__ */
|
|
4722
|
-
/* @__PURE__ */
|
|
4723
|
-
/* @__PURE__ */
|
|
4724
|
-
/* @__PURE__ */
|
|
4819
|
+
/* @__PURE__ */ jsxs26("div", { className: "orion-admin-form-board-metrics", children: [
|
|
4820
|
+
/* @__PURE__ */ jsxs26("article", { className: "orion-admin-form-metric", children: [
|
|
4821
|
+
/* @__PURE__ */ jsx28("span", { className: "orion-admin-form-metric-label", children: "Workflow steps" }),
|
|
4822
|
+
/* @__PURE__ */ jsx28("strong", { className: "orion-admin-form-metric-value", children: stepCount })
|
|
4725
4823
|
] }),
|
|
4726
|
-
/* @__PURE__ */
|
|
4727
|
-
/* @__PURE__ */
|
|
4728
|
-
/* @__PURE__ */
|
|
4824
|
+
/* @__PURE__ */ jsxs26("article", { className: "orion-admin-form-metric", children: [
|
|
4825
|
+
/* @__PURE__ */ jsx28("span", { className: "orion-admin-form-metric-label", children: "Fields" }),
|
|
4826
|
+
/* @__PURE__ */ jsx28("strong", { className: "orion-admin-form-metric-value", children: fieldCount })
|
|
4729
4827
|
] }),
|
|
4730
|
-
/* @__PURE__ */
|
|
4731
|
-
/* @__PURE__ */
|
|
4732
|
-
/* @__PURE__ */
|
|
4828
|
+
/* @__PURE__ */ jsxs26("article", { className: "orion-admin-form-metric", children: [
|
|
4829
|
+
/* @__PURE__ */ jsx28("span", { className: "orion-admin-form-metric-label", children: "Submit button" }),
|
|
4830
|
+
/* @__PURE__ */ jsx28("strong", { className: "orion-admin-form-metric-value is-copy", children: submitLabel })
|
|
4733
4831
|
] }),
|
|
4734
|
-
/* @__PURE__ */
|
|
4735
|
-
/* @__PURE__ */
|
|
4736
|
-
/* @__PURE__ */
|
|
4832
|
+
/* @__PURE__ */ jsxs26("article", { className: "orion-admin-form-metric", children: [
|
|
4833
|
+
/* @__PURE__ */ jsx28("span", { className: "orion-admin-form-metric-label", children: "Latest response" }),
|
|
4834
|
+
/* @__PURE__ */ jsx28("strong", { className: "orion-admin-form-metric-value is-copy", children: latestResponseLabel })
|
|
4737
4835
|
] })
|
|
4738
4836
|
] }),
|
|
4739
|
-
/* @__PURE__ */
|
|
4740
|
-
/* @__PURE__ */
|
|
4741
|
-
/* @__PURE__ */
|
|
4742
|
-
/* @__PURE__ */
|
|
4743
|
-
/* @__PURE__ */
|
|
4837
|
+
/* @__PURE__ */ jsxs26("div", { className: "orion-admin-form-response-panel", children: [
|
|
4838
|
+
/* @__PURE__ */ jsxs26("div", { className: "orion-admin-form-response-panel-header", children: [
|
|
4839
|
+
/* @__PURE__ */ jsxs26("div", { children: [
|
|
4840
|
+
/* @__PURE__ */ jsx28("span", { className: "orion-admin-form-section-label", children: "Response stream" }),
|
|
4841
|
+
/* @__PURE__ */ jsx28("strong", { children: formSubmissions.length > 0 ? `${formSubmissions.length} recent submission${formSubmissions.length === 1 ? "" : "s"}` : "No responses yet" })
|
|
4744
4842
|
] }),
|
|
4745
|
-
isResponsePanelScrollable ? /* @__PURE__ */
|
|
4843
|
+
isResponsePanelScrollable ? /* @__PURE__ */ jsx28("span", { className: "orion-admin-form-panel-note", children: "Latest 3 visible. Scroll for older responses." }) : formSubmissions.length > 0 ? /* @__PURE__ */ jsx28("span", { className: "orion-admin-form-panel-note", children: "Showing all recent activity" }) : null
|
|
4746
4844
|
] }),
|
|
4747
4845
|
formSubmissions.length === 0 ? renderEmptyMessage(
|
|
4748
4846
|
"This form will start filling this lane as soon as the first submission arrives."
|
|
4749
|
-
) : /* @__PURE__ */
|
|
4847
|
+
) : /* @__PURE__ */ jsx28(
|
|
4750
4848
|
"div",
|
|
4751
4849
|
{
|
|
4752
4850
|
className: [
|
|
@@ -4770,33 +4868,33 @@ function AdminStudioFormsView(props) {
|
|
|
4770
4868
|
);
|
|
4771
4869
|
const visibleUploads = uploads.slice(0, 2);
|
|
4772
4870
|
const hiddenUploadCount = uploads.length - visibleUploads.length;
|
|
4773
|
-
return /* @__PURE__ */
|
|
4871
|
+
return /* @__PURE__ */ jsxs26(
|
|
4774
4872
|
"article",
|
|
4775
4873
|
{
|
|
4776
4874
|
className: "orion-admin-response-card",
|
|
4777
4875
|
children: [
|
|
4778
|
-
/* @__PURE__ */
|
|
4779
|
-
/* @__PURE__ */
|
|
4780
|
-
/* @__PURE__ */
|
|
4781
|
-
/* @__PURE__ */
|
|
4782
|
-
/* @__PURE__ */
|
|
4783
|
-
/* @__PURE__ */
|
|
4876
|
+
/* @__PURE__ */ jsxs26("div", { className: "orion-admin-response-card-main", children: [
|
|
4877
|
+
/* @__PURE__ */ jsxs26("div", { className: "orion-admin-response-card-top", children: [
|
|
4878
|
+
/* @__PURE__ */ jsx28("div", { className: "orion-admin-response-badge", children: getInitials(identity.name, identity.email, title) }),
|
|
4879
|
+
/* @__PURE__ */ jsxs26("div", { className: "orion-admin-response-heading", children: [
|
|
4880
|
+
/* @__PURE__ */ jsx28("strong", { children: primaryIdentity }),
|
|
4881
|
+
/* @__PURE__ */ jsx28("div", { className: "orion-admin-response-secondary", children: secondaryIdentity })
|
|
4784
4882
|
] }),
|
|
4785
|
-
/* @__PURE__ */
|
|
4883
|
+
/* @__PURE__ */ jsx28("div", { className: "orion-admin-response-date", children: formatDate(submission.submittedAt) })
|
|
4786
4884
|
] }),
|
|
4787
|
-
previewFields.length > 0 ? /* @__PURE__ */
|
|
4885
|
+
previewFields.length > 0 ? /* @__PURE__ */ jsx28("div", { className: "orion-admin-response-chip-row", children: previewFields.map((field, index) => /* @__PURE__ */ jsxs26(
|
|
4788
4886
|
"div",
|
|
4789
4887
|
{
|
|
4790
4888
|
className: "orion-admin-response-chip",
|
|
4791
4889
|
children: [
|
|
4792
|
-
/* @__PURE__ */
|
|
4793
|
-
/* @__PURE__ */
|
|
4890
|
+
/* @__PURE__ */ jsx28("span", { className: "orion-admin-response-chip-label", children: field.label }),
|
|
4891
|
+
/* @__PURE__ */ jsx28("span", { className: "orion-admin-response-chip-value", children: field.value })
|
|
4794
4892
|
]
|
|
4795
4893
|
},
|
|
4796
4894
|
`${submissionID}-${field.label}-${index}`
|
|
4797
|
-
)) }) : /* @__PURE__ */
|
|
4798
|
-
uploads.length > 0 ? /* @__PURE__ */
|
|
4799
|
-
/* @__PURE__ */
|
|
4895
|
+
)) }) : /* @__PURE__ */ jsx28("div", { className: "orion-admin-response-empty", children: "No preview fields are available for this submission." }),
|
|
4896
|
+
uploads.length > 0 ? /* @__PURE__ */ jsxs26("div", { className: "orion-admin-response-upload-row", children: [
|
|
4897
|
+
/* @__PURE__ */ jsx28("span", { className: "orion-admin-upload-label", children: "Uploads" }),
|
|
4800
4898
|
visibleUploads.map((upload) => {
|
|
4801
4899
|
const uploadID = typeof upload.id === "string" || typeof upload.id === "number" ? String(upload.id) : "";
|
|
4802
4900
|
if (!uploadID) return null;
|
|
@@ -4810,7 +4908,7 @@ function AdminStudioFormsView(props) {
|
|
|
4810
4908
|
),
|
|
4811
4909
|
38
|
|
4812
4910
|
);
|
|
4813
|
-
return /* @__PURE__ */
|
|
4911
|
+
return /* @__PURE__ */ jsx28(
|
|
4814
4912
|
Link3,
|
|
4815
4913
|
{
|
|
4816
4914
|
className: "orion-admin-upload-chip",
|
|
@@ -4820,14 +4918,14 @@ function AdminStudioFormsView(props) {
|
|
|
4820
4918
|
uploadID
|
|
4821
4919
|
);
|
|
4822
4920
|
}),
|
|
4823
|
-
hiddenUploadCount > 0 ? /* @__PURE__ */
|
|
4921
|
+
hiddenUploadCount > 0 ? /* @__PURE__ */ jsxs26("span", { className: "orion-admin-upload-chip is-passive", children: [
|
|
4824
4922
|
"+",
|
|
4825
4923
|
hiddenUploadCount,
|
|
4826
4924
|
" more"
|
|
4827
4925
|
] }) : null
|
|
4828
4926
|
] }) : null
|
|
4829
4927
|
] }),
|
|
4830
|
-
/* @__PURE__ */
|
|
4928
|
+
/* @__PURE__ */ jsx28(
|
|
4831
4929
|
Link3,
|
|
4832
4930
|
{
|
|
4833
4931
|
className: "orion-admin-action-button orion-admin-action-button--ghost",
|
|
@@ -4852,9 +4950,9 @@ function AdminStudioFormsView(props) {
|
|
|
4852
4950
|
}
|
|
4853
4951
|
|
|
4854
4952
|
// src/admin/components/studio/AdminStudioToolsView.tsx
|
|
4855
|
-
import { useEffect as
|
|
4953
|
+
import { useEffect as useEffect17, useState as useState18 } from "react";
|
|
4856
4954
|
import { useAuth as useAuth7 } from "@payloadcms/ui";
|
|
4857
|
-
import { jsx as
|
|
4955
|
+
import { jsx as jsx29, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
4858
4956
|
var userRoles = ["admin", "client", "editor"];
|
|
4859
4957
|
var isAdmin4 = (user) => {
|
|
4860
4958
|
if (!user || typeof user !== "object") return false;
|
|
@@ -4865,14 +4963,14 @@ var normalizeRole = (value) => userRoles.includes(value) ? value : "editor";
|
|
|
4865
4963
|
function AdminStudioToolsView(props) {
|
|
4866
4964
|
const { user } = useAuth7();
|
|
4867
4965
|
const adminBasePath = useAdminBasePath();
|
|
4868
|
-
const [docs, setDocs] =
|
|
4869
|
-
const [loading, setLoading] =
|
|
4870
|
-
const [error, setError] =
|
|
4871
|
-
const [savedMessage, setSavedMessage] =
|
|
4872
|
-
const [createSubmitting, setCreateSubmitting] =
|
|
4873
|
-
const [updatingUserID, setUpdatingUserID] =
|
|
4966
|
+
const [docs, setDocs] = useState18([]);
|
|
4967
|
+
const [loading, setLoading] = useState18(true);
|
|
4968
|
+
const [error, setError] = useState18(null);
|
|
4969
|
+
const [savedMessage, setSavedMessage] = useState18(null);
|
|
4970
|
+
const [createSubmitting, setCreateSubmitting] = useState18(false);
|
|
4971
|
+
const [updatingUserID, setUpdatingUserID] = useState18(null);
|
|
4874
4972
|
if (!isAdmin4(user)) {
|
|
4875
|
-
return /* @__PURE__ */
|
|
4973
|
+
return /* @__PURE__ */ jsx29(StudioSectionLayout, { navProps: props, children: /* @__PURE__ */ jsx29(
|
|
4876
4974
|
AdminPage,
|
|
4877
4975
|
{
|
|
4878
4976
|
breadcrumbs: [
|
|
@@ -4881,9 +4979,9 @@ function AdminStudioToolsView(props) {
|
|
|
4881
4979
|
],
|
|
4882
4980
|
description: "You do not have access to this section.",
|
|
4883
4981
|
title: "Admin Tools",
|
|
4884
|
-
children: /* @__PURE__ */
|
|
4885
|
-
/* @__PURE__ */
|
|
4886
|
-
/* @__PURE__ */
|
|
4982
|
+
children: /* @__PURE__ */ jsxs27("div", { className: "orion-admin-card", children: [
|
|
4983
|
+
/* @__PURE__ */ jsx29("strong", { children: "Access denied" }),
|
|
4984
|
+
/* @__PURE__ */ jsx29("span", { children: "This section is restricted to administrator accounts." })
|
|
4887
4985
|
] })
|
|
4888
4986
|
}
|
|
4889
4987
|
) });
|
|
@@ -4912,7 +5010,7 @@ function AdminStudioToolsView(props) {
|
|
|
4912
5010
|
setLoading(false);
|
|
4913
5011
|
}
|
|
4914
5012
|
};
|
|
4915
|
-
|
|
5013
|
+
useEffect17(() => {
|
|
4916
5014
|
void loadUsers();
|
|
4917
5015
|
}, []);
|
|
4918
5016
|
const createUser = async (event) => {
|
|
@@ -4983,7 +5081,7 @@ function AdminStudioToolsView(props) {
|
|
|
4983
5081
|
setUpdatingUserID(null);
|
|
4984
5082
|
}
|
|
4985
5083
|
};
|
|
4986
|
-
return /* @__PURE__ */
|
|
5084
|
+
return /* @__PURE__ */ jsx29(StudioSectionLayout, { navProps: props, children: /* @__PURE__ */ jsxs27(
|
|
4987
5085
|
AdminPage,
|
|
4988
5086
|
{
|
|
4989
5087
|
breadcrumbs: [
|
|
@@ -4993,53 +5091,53 @@ function AdminStudioToolsView(props) {
|
|
|
4993
5091
|
description: "Manage users and fallback links to Payload native admin.",
|
|
4994
5092
|
title: "Admin Tools",
|
|
4995
5093
|
children: [
|
|
4996
|
-
/* @__PURE__ */
|
|
4997
|
-
error ? /* @__PURE__ */
|
|
4998
|
-
savedMessage ? /* @__PURE__ */
|
|
4999
|
-
/* @__PURE__ */
|
|
5000
|
-
/* @__PURE__ */
|
|
5001
|
-
/* @__PURE__ */
|
|
5094
|
+
/* @__PURE__ */ jsx29("div", { className: "orion-admin-inline-actions", style: { marginBottom: "1rem" }, children: /* @__PURE__ */ jsx29("a", { className: "orion-admin-action-button", href: "/admin-core", target: "_blank", children: "Open Payload Core Admin" }) }),
|
|
5095
|
+
error ? /* @__PURE__ */ jsx29("div", { className: "orion-admin-error", style: { marginBottom: "1rem" }, children: error }) : null,
|
|
5096
|
+
savedMessage ? /* @__PURE__ */ jsx29("div", { className: "orion-admin-success", style: { marginBottom: "1rem" }, children: savedMessage }) : null,
|
|
5097
|
+
/* @__PURE__ */ jsxs27("form", { className: "orion-admin-form", onSubmit: createUser, style: { marginBottom: "1rem" }, children: [
|
|
5098
|
+
/* @__PURE__ */ jsx29("strong", { children: "Create User" }),
|
|
5099
|
+
/* @__PURE__ */ jsxs27("label", { children: [
|
|
5002
5100
|
"Email",
|
|
5003
|
-
/* @__PURE__ */
|
|
5101
|
+
/* @__PURE__ */ jsx29("input", { name: "email", required: true, type: "email" })
|
|
5004
5102
|
] }),
|
|
5005
|
-
/* @__PURE__ */
|
|
5103
|
+
/* @__PURE__ */ jsxs27("label", { children: [
|
|
5006
5104
|
"Full Name",
|
|
5007
|
-
/* @__PURE__ */
|
|
5105
|
+
/* @__PURE__ */ jsx29("input", { name: "fullName", type: "text" })
|
|
5008
5106
|
] }),
|
|
5009
|
-
/* @__PURE__ */
|
|
5107
|
+
/* @__PURE__ */ jsxs27("label", { children: [
|
|
5010
5108
|
"Password",
|
|
5011
|
-
/* @__PURE__ */
|
|
5109
|
+
/* @__PURE__ */ jsx29("input", { name: "password", required: true, type: "password" })
|
|
5012
5110
|
] }),
|
|
5013
|
-
/* @__PURE__ */
|
|
5111
|
+
/* @__PURE__ */ jsxs27("label", { children: [
|
|
5014
5112
|
"Role",
|
|
5015
|
-
/* @__PURE__ */
|
|
5016
|
-
/* @__PURE__ */
|
|
5017
|
-
/* @__PURE__ */
|
|
5018
|
-
/* @__PURE__ */
|
|
5113
|
+
/* @__PURE__ */ jsxs27("select", { defaultValue: "editor", name: "role", children: [
|
|
5114
|
+
/* @__PURE__ */ jsx29("option", { value: "admin", children: "admin" }),
|
|
5115
|
+
/* @__PURE__ */ jsx29("option", { value: "editor", children: "editor" }),
|
|
5116
|
+
/* @__PURE__ */ jsx29("option", { value: "client", children: "client" })
|
|
5019
5117
|
] })
|
|
5020
5118
|
] }),
|
|
5021
|
-
/* @__PURE__ */
|
|
5119
|
+
/* @__PURE__ */ jsx29("button", { disabled: createSubmitting, type: "submit", children: createSubmitting ? "Creating..." : "Create User" })
|
|
5022
5120
|
] }),
|
|
5023
|
-
loading ? /* @__PURE__ */
|
|
5024
|
-
/* @__PURE__ */
|
|
5121
|
+
loading ? /* @__PURE__ */ jsx29("div", { className: "orion-admin-list-meta", children: "Loading..." }) : null,
|
|
5122
|
+
/* @__PURE__ */ jsx29("div", { className: "orion-admin-list", children: docs.map((doc) => {
|
|
5025
5123
|
const id = typeof doc.id === "string" || typeof doc.id === "number" ? String(doc.id) : "";
|
|
5026
5124
|
if (!id) return null;
|
|
5027
5125
|
const email = typeof doc.email === "string" ? doc.email : `user-${id}`;
|
|
5028
5126
|
const fullName = typeof doc.fullName === "string" ? doc.fullName : "";
|
|
5029
5127
|
const currentRole = typeof doc.role === "string" ? normalizeRole(doc.role) : "editor";
|
|
5030
|
-
return /* @__PURE__ */
|
|
5031
|
-
/* @__PURE__ */
|
|
5032
|
-
/* @__PURE__ */
|
|
5033
|
-
/* @__PURE__ */
|
|
5128
|
+
return /* @__PURE__ */ jsxs27("div", { className: "orion-admin-list-item", children: [
|
|
5129
|
+
/* @__PURE__ */ jsxs27("div", { children: [
|
|
5130
|
+
/* @__PURE__ */ jsx29("strong", { children: email }),
|
|
5131
|
+
/* @__PURE__ */ jsx29("div", { className: "orion-admin-list-meta", children: fullName || "No full name set" })
|
|
5034
5132
|
] }),
|
|
5035
|
-
/* @__PURE__ */
|
|
5036
|
-
/* @__PURE__ */
|
|
5037
|
-
/* @__PURE__ */
|
|
5038
|
-
/* @__PURE__ */
|
|
5039
|
-
/* @__PURE__ */
|
|
5040
|
-
/* @__PURE__ */
|
|
5133
|
+
/* @__PURE__ */ jsxs27("form", { className: "orion-admin-inline-actions", onSubmit: updateUserRole, children: [
|
|
5134
|
+
/* @__PURE__ */ jsx29("input", { name: "id", type: "hidden", value: id }),
|
|
5135
|
+
/* @__PURE__ */ jsxs27("select", { defaultValue: currentRole, name: "role", children: [
|
|
5136
|
+
/* @__PURE__ */ jsx29("option", { value: "admin", children: "admin" }),
|
|
5137
|
+
/* @__PURE__ */ jsx29("option", { value: "editor", children: "editor" }),
|
|
5138
|
+
/* @__PURE__ */ jsx29("option", { value: "client", children: "client" })
|
|
5041
5139
|
] }),
|
|
5042
|
-
/* @__PURE__ */
|
|
5140
|
+
/* @__PURE__ */ jsx29("button", { disabled: updatingUserID === id, type: "submit", children: updatingUserID === id ? "Updating..." : "Update" })
|
|
5043
5141
|
] })
|
|
5044
5142
|
] }, id);
|
|
5045
5143
|
}) })
|
|
@@ -5050,14 +5148,14 @@ function AdminStudioToolsView(props) {
|
|
|
5050
5148
|
|
|
5051
5149
|
// src/admin/components/studio/OpenInStudioMenuItem.tsx
|
|
5052
5150
|
import { useDocumentInfo } from "@payloadcms/ui";
|
|
5053
|
-
import { jsx as
|
|
5151
|
+
import { jsx as jsx30 } from "react/jsx-runtime";
|
|
5054
5152
|
function OpenInStudioMenuItem({ pagesPathBase = "/pages" }) {
|
|
5055
5153
|
const documentInfo = useDocumentInfo();
|
|
5056
5154
|
const id = documentInfo?.id;
|
|
5057
5155
|
if (!id) {
|
|
5058
5156
|
return null;
|
|
5059
5157
|
}
|
|
5060
|
-
return /* @__PURE__ */
|
|
5158
|
+
return /* @__PURE__ */ jsx30(
|
|
5061
5159
|
"a",
|
|
5062
5160
|
{
|
|
5063
5161
|
href: `${pagesPathBase}/${id}`,
|
|
@@ -5076,19 +5174,19 @@ function OpenInStudioMenuItem({ pagesPathBase = "/pages" }) {
|
|
|
5076
5174
|
}
|
|
5077
5175
|
|
|
5078
5176
|
// src/admin/components/studio/PageEditRedirectToStudio.tsx
|
|
5079
|
-
import { useEffect as
|
|
5177
|
+
import { useEffect as useEffect18 } from "react";
|
|
5080
5178
|
import { useDocumentInfo as useDocumentInfo2 } from "@payloadcms/ui";
|
|
5081
|
-
import { jsx as
|
|
5179
|
+
import { jsx as jsx31, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
5082
5180
|
function PageEditRedirectToStudio({ pagesPathBase = "/pages" }) {
|
|
5083
5181
|
const documentInfo = useDocumentInfo2();
|
|
5084
5182
|
const id = documentInfo?.id;
|
|
5085
|
-
|
|
5183
|
+
useEffect18(() => {
|
|
5086
5184
|
if (!id) {
|
|
5087
5185
|
return;
|
|
5088
5186
|
}
|
|
5089
5187
|
window.location.replace(`${pagesPathBase}/${id}`);
|
|
5090
5188
|
}, [id, pagesPathBase]);
|
|
5091
|
-
return /* @__PURE__ */
|
|
5189
|
+
return /* @__PURE__ */ jsxs28(
|
|
5092
5190
|
"div",
|
|
5093
5191
|
{
|
|
5094
5192
|
style: {
|
|
@@ -5100,18 +5198,18 @@ function PageEditRedirectToStudio({ pagesPathBase = "/pages" }) {
|
|
|
5100
5198
|
minHeight: "50vh"
|
|
5101
5199
|
},
|
|
5102
5200
|
children: [
|
|
5103
|
-
/* @__PURE__ */
|
|
5104
|
-
/* @__PURE__ */
|
|
5105
|
-
id ? /* @__PURE__ */
|
|
5201
|
+
/* @__PURE__ */ jsx31("h2", { style: { margin: 0 }, children: "Opening Editor..." }),
|
|
5202
|
+
/* @__PURE__ */ jsx31("p", { style: { color: "var(--theme-elevation-600)", margin: 0 }, children: "Redirecting to the custom page editor." }),
|
|
5203
|
+
id ? /* @__PURE__ */ jsx31("a", { href: `${pagesPathBase}/${id}`, children: "Continue to Editor" }) : /* @__PURE__ */ jsx31("a", { href: pagesPathBase, children: "Open Pages" })
|
|
5106
5204
|
]
|
|
5107
5205
|
}
|
|
5108
5206
|
);
|
|
5109
5207
|
}
|
|
5110
5208
|
|
|
5111
5209
|
// src/admin/components/studio/StudioBackBreadcrumb.tsx
|
|
5112
|
-
import { useEffect as
|
|
5210
|
+
import { useEffect as useEffect19, useState as useState19 } from "react";
|
|
5113
5211
|
import { SetStepNav as SetStepNav5 } from "@payloadcms/ui";
|
|
5114
|
-
import { jsx as
|
|
5212
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
5115
5213
|
var toTitle = (slug) => slug.split("-").filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join(" ");
|
|
5116
5214
|
var buildNav = (pathname, adminBasePath) => {
|
|
5117
5215
|
if (pathname.includes("/globals/")) {
|
|
@@ -5156,8 +5254,8 @@ var buildNav = (pathname, adminBasePath) => {
|
|
|
5156
5254
|
};
|
|
5157
5255
|
function StudioBackBreadcrumb() {
|
|
5158
5256
|
const adminBasePath = useAdminBasePath();
|
|
5159
|
-
const [pathname, setPathname] =
|
|
5160
|
-
|
|
5257
|
+
const [pathname, setPathname] = useState19("");
|
|
5258
|
+
useEffect19(() => {
|
|
5161
5259
|
const update = () => setPathname(window.location.pathname);
|
|
5162
5260
|
update();
|
|
5163
5261
|
window.addEventListener("popstate", update);
|
|
@@ -5165,12 +5263,12 @@ function StudioBackBreadcrumb() {
|
|
|
5165
5263
|
}, []);
|
|
5166
5264
|
const nav = buildNav(pathname, adminBasePath);
|
|
5167
5265
|
if (!nav) return null;
|
|
5168
|
-
return /* @__PURE__ */
|
|
5266
|
+
return /* @__PURE__ */ jsx32(SetStepNav5, { nav });
|
|
5169
5267
|
}
|
|
5170
5268
|
|
|
5171
5269
|
// src/admin/components/studio/StudioContactFormRedirect.tsx
|
|
5172
|
-
import { useEffect as
|
|
5173
|
-
import { jsx as
|
|
5270
|
+
import { useEffect as useEffect20 } from "react";
|
|
5271
|
+
import { jsx as jsx33, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
5174
5272
|
var getPropString14 = (props, key, fallback) => {
|
|
5175
5273
|
if (!props || typeof props !== "object") return fallback;
|
|
5176
5274
|
const direct = props[key];
|
|
@@ -5186,11 +5284,11 @@ function StudioContactFormRedirect(props) {
|
|
|
5186
5284
|
const adminBasePath = useAdminBasePath();
|
|
5187
5285
|
const studioContactFormPath = getPropString14(props, "studioContactFormPath", "/contact-form");
|
|
5188
5286
|
const targetPath = resolveAdminPath(adminBasePath, studioContactFormPath);
|
|
5189
|
-
|
|
5287
|
+
useEffect20(() => {
|
|
5190
5288
|
if (window.location.pathname === targetPath) return;
|
|
5191
5289
|
window.location.replace(targetPath);
|
|
5192
5290
|
}, [targetPath]);
|
|
5193
|
-
return /* @__PURE__ */
|
|
5291
|
+
return /* @__PURE__ */ jsxs29(
|
|
5194
5292
|
"div",
|
|
5195
5293
|
{
|
|
5196
5294
|
style: {
|
|
@@ -5203,14 +5301,15 @@ function StudioContactFormRedirect(props) {
|
|
|
5203
5301
|
minHeight: "40vh"
|
|
5204
5302
|
},
|
|
5205
5303
|
children: [
|
|
5206
|
-
/* @__PURE__ */
|
|
5207
|
-
/* @__PURE__ */
|
|
5304
|
+
/* @__PURE__ */ jsx33("h2", { style: { margin: 0 }, children: "Opening Contact Form Editor..." }),
|
|
5305
|
+
/* @__PURE__ */ jsx33("a", { href: targetPath, children: "Continue" })
|
|
5208
5306
|
]
|
|
5209
5307
|
}
|
|
5210
5308
|
);
|
|
5211
5309
|
}
|
|
5212
5310
|
export {
|
|
5213
5311
|
AdminLoginIntro,
|
|
5312
|
+
AdminLoginPasswordToggle,
|
|
5214
5313
|
AdminStudioContactFormView,
|
|
5215
5314
|
AdminStudioDashboard,
|
|
5216
5315
|
AdminStudioFooterGlobalView,
|