@kyro-cms/admin 0.9.6 → 0.9.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +617 -647
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +2 -0
- package/dist/index.css.map +1 -1
- package/dist/index.js +618 -648
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/ActionBar.tsx +172 -292
- package/src/components/AutoForm.tsx +573 -367
- package/src/components/DetailView.tsx +22 -47
- package/src/components/GraphQLPlayground.tsx +30 -16
- package/src/components/RestPlayground.tsx +49 -10
- package/src/components/fields/RichTextField.tsx +3 -1
- package/src/components/ui/SplitButton.tsx +1 -1
- package/src/styles/main.css +2 -0
package/dist/index.cjs
CHANGED
|
@@ -3903,7 +3903,9 @@ function RichTextField({
|
|
|
3903
3903
|
const editor = react.useEditor({
|
|
3904
3904
|
extensions: [
|
|
3905
3905
|
StarterKit__default.default.configure({
|
|
3906
|
-
codeBlock: true
|
|
3906
|
+
codeBlock: true,
|
|
3907
|
+
link: false,
|
|
3908
|
+
underline: false
|
|
3907
3909
|
}),
|
|
3908
3910
|
Link4__default.default.configure({
|
|
3909
3911
|
openOnClick: false
|
|
@@ -3923,7 +3925,7 @@ function RichTextField({
|
|
|
3923
3925
|
extensionTextStyle.TextStyle,
|
|
3924
3926
|
Color__default.default
|
|
3925
3927
|
],
|
|
3926
|
-
content: value || {},
|
|
3928
|
+
content: value || { type: "doc", content: [] },
|
|
3927
3929
|
editable: !disabled,
|
|
3928
3930
|
onUpdate: ({ editor: editor2 }) => {
|
|
3929
3931
|
onChange(editor2.getJSON());
|
|
@@ -9684,7 +9686,7 @@ function SplitButton({
|
|
|
9684
9686
|
if (saveStatus === "saved") return `${btnBase} bg-[var(--kyro-success)] border-[var(--kyro-success)] text-[var(--kyro-sidebar-text-active)]`;
|
|
9685
9687
|
if (saveStatus === "error") return `${btnBase} bg-[var(--kyro-error)] border-[var(--kyro-error)] text-[var(--kyro-sidebar-text-active)]`;
|
|
9686
9688
|
if (isPublishedIdle) return `${btnBase} bg-[var(--kyro-gray-200)] border-[var(--kyro-gray-200)] text-[var(--kyro-text-muted)] cursor-not-allowed`;
|
|
9687
|
-
return `${btnBase} bg-[var(--kyro-primary)] border-[var(--kyro-primary)] hover:bg-[var(--kyro-primary-hover)]`;
|
|
9689
|
+
return `${btnBase} bg-[var(--kyro-primary)] border-[var(--kyro-primary)] text-[var(--kyro-sidebar-text-active)] hover:bg-[var(--kyro-primary-hover)]`;
|
|
9688
9690
|
};
|
|
9689
9691
|
const chevronBase = "kyro-btn kyro-btn-md px-2 rounded-l-none border-l-[1px] border-white/20 transition-all duration-300";
|
|
9690
9692
|
const getChevronClass = () => {
|
|
@@ -10485,325 +10487,430 @@ function AutoForm({
|
|
|
10485
10487
|
const createdAt = formData.createdAt ? new Date(formData.createdAt).toLocaleString() : "Just now";
|
|
10486
10488
|
!formData.id || documentStatus === "draft";
|
|
10487
10489
|
const statusLabel = hasUnpublishedChanges ? "Draft (unpublished changes)" : docStatus === "published" ? "Published" : "Draft";
|
|
10490
|
+
const statusLabelMobile = hasUnpublishedChanges ? "Unpublished" : docStatus === "published" ? "Published" : "Draft";
|
|
10488
10491
|
const statusColor = docStatus === "published" && !hasUnsavedChanges ? "bg-[var(--kyro-success)]" : hasUnpublishedChanges ? "bg-[var(--kyro-warning)]" : "bg-[var(--kyro-text-muted)]";
|
|
10489
10492
|
const statusBadgeBg = docStatus === "published" && !hasUnpublishedChanges ? "bg-[var(--kyro-success)]/10 text-[var(--kyro-success)] border-[var(--kyro-success)]/20" : hasUnpublishedChanges ? "bg-[var(--kyro-warning)]/10 text-[var(--kyro-warning)] border-[var(--kyro-warning)]/20" : "bg-[var(--kyro-text-muted)]/10 text-[var(--kyro-text-muted)] border-[var(--kyro-text-muted)]/20";
|
|
10490
|
-
|
|
10491
|
-
/* @__PURE__ */ jsxRuntime.jsxs("
|
|
10492
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
10493
|
+
const renderAutoSaveStatus = (compact = false) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
10494
|
+
autoSaveStatus === "saving" && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1.5 text-[var(--kyro-text-muted)]", children: [
|
|
10495
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
10496
|
+
"svg",
|
|
10497
|
+
{
|
|
10498
|
+
className: "animate-spin h-3 w-3 shrink-0",
|
|
10499
|
+
viewBox: "0 0 24 24",
|
|
10500
|
+
fill: "none",
|
|
10501
|
+
children: [
|
|
10502
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10503
|
+
"circle",
|
|
10504
|
+
{
|
|
10505
|
+
className: "opacity-25",
|
|
10506
|
+
cx: "12",
|
|
10507
|
+
cy: "12",
|
|
10508
|
+
r: "10",
|
|
10509
|
+
stroke: "currentColor",
|
|
10510
|
+
strokeWidth: "4"
|
|
10511
|
+
}
|
|
10512
|
+
),
|
|
10513
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10514
|
+
"path",
|
|
10515
|
+
{
|
|
10516
|
+
className: "opacity-75",
|
|
10517
|
+
fill: "currentColor",
|
|
10518
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"
|
|
10519
|
+
}
|
|
10520
|
+
)
|
|
10521
|
+
]
|
|
10522
|
+
}
|
|
10523
|
+
),
|
|
10524
|
+
compact ? "Saving\u2026" : "Saving draft..."
|
|
10525
|
+
] }),
|
|
10526
|
+
autoSaveStatus === "success" && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[var(--kyro-success)] flex items-center gap-1", children: [
|
|
10527
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "w-3.5 h-3.5 shrink-0" }),
|
|
10528
|
+
compact ? "Saved" : lastSavedAt ? `Saved ${Math.floor((Date.now() - lastSavedAt) / 6e4)}m ago` : "Draft saved"
|
|
10529
|
+
] }),
|
|
10530
|
+
autoSaveStatus === "retrying" && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[var(--kyro-warning)] flex items-center gap-1.5", children: [
|
|
10531
|
+
/* @__PURE__ */ jsxRuntime.jsxs("svg", { className: "animate-spin h-3 w-3 shrink-0", viewBox: "0 0 24 24", fill: "none", children: [
|
|
10532
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
10533
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" })
|
|
10534
|
+
] }),
|
|
10535
|
+
compact ? `Retry ${retryCount}/5` : `Retrying save (${retryCount}/5)`
|
|
10536
|
+
] }),
|
|
10537
|
+
autoSaveStatus === "offline" && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[var(--kyro-text-muted)] flex items-center gap-1.5", children: [
|
|
10538
|
+
/* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "shrink-0", children: [
|
|
10539
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10.61 10.61a3 3 0 0 0 4.24 4.24" }),
|
|
10540
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M13.36 13.36a3 3 0 0 0-4.24-4.24" }),
|
|
10541
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m2 2 20 20" }),
|
|
10542
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M18.36 5.64a9 9 0 0 0-12.72 0" }),
|
|
10543
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M22.61 1.39a15 15 0 0 0-21.22 0" })
|
|
10544
|
+
] }),
|
|
10545
|
+
compact ? "Offline" : "Offline \u2014 cached locally"
|
|
10546
|
+
] }),
|
|
10547
|
+
autoSaveStatus === "error" && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[var(--kyro-danger)]", children: compact ? "Failed" : "Draft save failed" }),
|
|
10548
|
+
autoSaveStatus === "conflict" && (compact ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[var(--kyro-danger)] font-semibold", children: "Conflict" }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
10549
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[var(--kyro-danger)] font-semibold", children: "Conflict detected" }),
|
|
10550
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "opacity-30", children: "\u2014" }),
|
|
10551
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10552
|
+
"button",
|
|
10553
|
+
{
|
|
10554
|
+
type: "button",
|
|
10555
|
+
onClick: async () => {
|
|
10556
|
+
await saveDocument(formData);
|
|
10557
|
+
setAutoSaveStatus("success");
|
|
10558
|
+
},
|
|
10559
|
+
className: "text-[var(--kyro-primary)] hover:underline",
|
|
10560
|
+
children: "Keep my changes"
|
|
10561
|
+
}
|
|
10562
|
+
),
|
|
10563
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "opacity-30", children: "|" }),
|
|
10564
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10565
|
+
"button",
|
|
10566
|
+
{
|
|
10567
|
+
type: "button",
|
|
10568
|
+
onClick: () => {
|
|
10569
|
+
window.location.reload();
|
|
10570
|
+
},
|
|
10571
|
+
className: "text-[var(--kyro-danger)] hover:underline",
|
|
10572
|
+
children: "Reload server version"
|
|
10573
|
+
}
|
|
10574
|
+
)
|
|
10575
|
+
] }))
|
|
10576
|
+
] });
|
|
10577
|
+
const renderKebabMenu = () => !isNew && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10578
|
+
Dropdown,
|
|
10579
|
+
{
|
|
10580
|
+
trigger: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10581
|
+
"button",
|
|
10582
|
+
{
|
|
10583
|
+
type: "button",
|
|
10584
|
+
className: "kyro-btn p-2 md:p-2.5 rounded-xl border border-[var(--kyro-border)] hover:bg-[var(--kyro-bg-secondary)] transition-all",
|
|
10585
|
+
title: "More actions",
|
|
10586
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", children: [
|
|
10587
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "5", r: "1.5" }),
|
|
10588
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "1.5" }),
|
|
10589
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "19", r: "1.5" })
|
|
10590
|
+
] })
|
|
10591
|
+
}
|
|
10592
|
+
),
|
|
10593
|
+
direction: "down",
|
|
10594
|
+
children: [
|
|
10595
|
+
!globalSlug && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10596
|
+
DropdownItem,
|
|
10597
|
+
{
|
|
10598
|
+
onClick: handleCreateNew,
|
|
10599
|
+
icon: /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
10600
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "5", x2: "12", y2: "19" }),
|
|
10601
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "5", y1: "12", x2: "19", y2: "12" })
|
|
10602
|
+
] }),
|
|
10603
|
+
children: "Create New"
|
|
10604
|
+
}
|
|
10605
|
+
),
|
|
10606
|
+
!globalSlug && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10607
|
+
DropdownItem,
|
|
10608
|
+
{
|
|
10609
|
+
onClick: handleDuplicate,
|
|
10610
|
+
icon: /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
10611
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2", ry: "2" }),
|
|
10612
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
10613
|
+
] }),
|
|
10614
|
+
children: "Duplicate"
|
|
10615
|
+
}
|
|
10616
|
+
),
|
|
10617
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10618
|
+
DropdownItem,
|
|
10619
|
+
{
|
|
10620
|
+
onClick: () => setShowSchedulePicker(true),
|
|
10621
|
+
icon: /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
10622
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }),
|
|
10623
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "16", y1: "2", x2: "16", y2: "6" }),
|
|
10624
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "8", y1: "2", x2: "8", y2: "6" }),
|
|
10625
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "3", y1: "10", x2: "21", y2: "10" })
|
|
10626
|
+
] }),
|
|
10627
|
+
children: "Schedule Publish"
|
|
10628
|
+
}
|
|
10629
|
+
),
|
|
10630
|
+
documentStatus === "published" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10631
|
+
DropdownItem,
|
|
10632
|
+
{
|
|
10633
|
+
onClick: handleUnpublish,
|
|
10634
|
+
icon: /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
10635
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24" }),
|
|
10636
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
|
10637
|
+
] }),
|
|
10638
|
+
children: "Unpublish"
|
|
10639
|
+
}
|
|
10640
|
+
),
|
|
10641
|
+
!globalSlug && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
10642
|
+
/* @__PURE__ */ jsxRuntime.jsx(DropdownSeparator, {}),
|
|
10643
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10644
|
+
DropdownItem,
|
|
10645
|
+
{
|
|
10646
|
+
onClick: handleDelete,
|
|
10647
|
+
danger: true,
|
|
10648
|
+
icon: /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
10649
|
+
/* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "3 6 5 6 21 6" }),
|
|
10650
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })
|
|
10651
|
+
] }),
|
|
10652
|
+
children: "Delete"
|
|
10653
|
+
}
|
|
10654
|
+
)
|
|
10655
|
+
] })
|
|
10656
|
+
]
|
|
10657
|
+
}
|
|
10658
|
+
);
|
|
10659
|
+
const renderSchedulePicker = () => showSchedulePicker && /* @__PURE__ */ jsxRuntime.jsx("div", { ref: scheduleRef, className: "relative", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute right-0 top-2 p-4 rounded-lg border border-[var(--kyro-border)] bg-[var(--kyro-surface)] shadow-2xl z-50 min-w-[260px]", children: [
|
|
10660
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium mb-2", children: "Schedule Publish" }),
|
|
10661
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10662
|
+
"input",
|
|
10663
|
+
{
|
|
10664
|
+
type: "datetime-local",
|
|
10665
|
+
id: "schedule-datetime",
|
|
10666
|
+
className: "kyro-form-input text-xs mb-3 w-full",
|
|
10667
|
+
min: (/* @__PURE__ */ new Date()).toISOString().slice(0, 16)
|
|
10668
|
+
}
|
|
10669
|
+
),
|
|
10670
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 justify-end", children: [
|
|
10671
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10672
|
+
"button",
|
|
10673
|
+
{
|
|
10674
|
+
type: "button",
|
|
10675
|
+
onClick: () => setShowSchedulePicker(false),
|
|
10676
|
+
className: "px-3 py-1.5 text-xs kyro-btn rounded-lg",
|
|
10677
|
+
children: "Cancel"
|
|
10678
|
+
}
|
|
10679
|
+
),
|
|
10680
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10681
|
+
"button",
|
|
10682
|
+
{
|
|
10683
|
+
type: "button",
|
|
10684
|
+
onClick: () => {
|
|
10685
|
+
const val = document.getElementById("schedule-datetime")?.value;
|
|
10686
|
+
if (val) handleSchedulePublish(val);
|
|
10687
|
+
},
|
|
10688
|
+
className: "px-3 py-1.5 text-xs kyro-btn-success rounded-lg",
|
|
10689
|
+
children: "Schedule"
|
|
10690
|
+
}
|
|
10691
|
+
)
|
|
10692
|
+
] })
|
|
10693
|
+
] }) });
|
|
10694
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
10695
|
+
/* @__PURE__ */ jsxRuntime.jsxs("header", { className: "md:hidden border-b border-[var(--kyro-border)] bg-[var(--kyro-surface)] backdrop-blur-md rounded-lg", children: [
|
|
10696
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 px-3 py-2.5", children: [
|
|
10493
10697
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10494
10698
|
"a",
|
|
10495
10699
|
{
|
|
10496
10700
|
href: `/${collectionSlug}`,
|
|
10497
|
-
className: "p-1.5
|
|
10701
|
+
className: "p-1.5 rounded-lg hover:bg-[var(--kyro-bg-secondary)] transition-colors shrink-0",
|
|
10702
|
+
"aria-label": "Back to list",
|
|
10498
10703
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "w-4 h-4" })
|
|
10499
10704
|
}
|
|
10500
10705
|
),
|
|
10501
|
-
/* @__PURE__ */ jsxRuntime.
|
|
10502
|
-
|
|
10503
|
-
/* @__PURE__ */ jsxRuntime.
|
|
10504
|
-
|
|
10505
|
-
|
|
10506
|
-
|
|
10507
|
-
|
|
10508
|
-
|
|
10509
|
-
/* @__PURE__ */ jsxRuntime.
|
|
10510
|
-
|
|
10706
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 min-w-0 flex-1", children: [
|
|
10707
|
+
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-base font-bold tracking-tight truncate min-w-0", children: docTitle }),
|
|
10708
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: `shrink-0 inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full text-[9px] font-medium border ${statusBadgeBg}`, children: [
|
|
10709
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `h-1.5 w-1.5 rounded-full ${statusColor}` }),
|
|
10710
|
+
statusLabelMobile
|
|
10711
|
+
] })
|
|
10712
|
+
] }),
|
|
10713
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5 shrink-0", children: [
|
|
10714
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10715
|
+
SplitButton,
|
|
10511
10716
|
{
|
|
10512
|
-
|
|
10513
|
-
|
|
10514
|
-
|
|
10515
|
-
|
|
10516
|
-
|
|
10517
|
-
"circle",
|
|
10518
|
-
{
|
|
10519
|
-
className: "opacity-25",
|
|
10520
|
-
cx: "12",
|
|
10521
|
-
cy: "12",
|
|
10522
|
-
r: "10",
|
|
10523
|
-
stroke: "currentColor",
|
|
10524
|
-
strokeWidth: "4"
|
|
10525
|
-
}
|
|
10526
|
-
),
|
|
10527
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10528
|
-
"path",
|
|
10529
|
-
{
|
|
10530
|
-
className: "opacity-75",
|
|
10531
|
-
fill: "currentColor",
|
|
10532
|
-
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"
|
|
10533
|
-
}
|
|
10534
|
-
)
|
|
10535
|
-
]
|
|
10717
|
+
status: documentStatus,
|
|
10718
|
+
saveStatus: localSaveStatus,
|
|
10719
|
+
hasChanges: hasUnsavedChanges,
|
|
10720
|
+
onPublish: handlePublish,
|
|
10721
|
+
disabled: localSaveStatus === "saving"
|
|
10536
10722
|
}
|
|
10537
10723
|
),
|
|
10538
|
-
|
|
10539
|
-
|
|
10540
|
-
|
|
10541
|
-
|
|
10542
|
-
|
|
10543
|
-
]
|
|
10544
|
-
|
|
10545
|
-
|
|
10546
|
-
|
|
10547
|
-
|
|
10548
|
-
|
|
10549
|
-
|
|
10550
|
-
|
|
10551
|
-
|
|
10552
|
-
|
|
10553
|
-
|
|
10554
|
-
|
|
10555
|
-
|
|
10556
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M13.36 13.36a3 3 0 0 0-4.24-4.24" }),
|
|
10557
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "m2 2 20 20" }),
|
|
10558
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M18.36 5.64a9 9 0 0 0-12.72 0" }),
|
|
10559
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M22.61 1.39a15 15 0 0 0-21.22 0" })
|
|
10560
|
-
] }),
|
|
10561
|
-
"Offline \u2014 cached locally"
|
|
10562
|
-
] }),
|
|
10563
|
-
autoSaveStatus === "error" && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[var(--kyro-danger)]", children: "Draft save failed" }),
|
|
10564
|
-
autoSaveStatus === "conflict" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
10565
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[var(--kyro-danger)] font-semibold", children: "Conflict detected" }),
|
|
10566
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "opacity-30", children: "\u2014" }),
|
|
10567
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10724
|
+
renderKebabMenu(),
|
|
10725
|
+
renderSchedulePicker()
|
|
10726
|
+
] })
|
|
10727
|
+
] }),
|
|
10728
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-3 py-1.5 border-t border-[var(--kyro-border)]/50 bg-[var(--kyro-bg-secondary)]/30", children: [
|
|
10729
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-0.5 bg-[var(--kyro-bg-secondary)] p-0.5 rounded-lg border border-[var(--kyro-border)]/50", children: ["edit", "version", "api"].map((v) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10730
|
+
"button",
|
|
10731
|
+
{
|
|
10732
|
+
type: "button",
|
|
10733
|
+
onClick: () => setView(v),
|
|
10734
|
+
className: `px-3 py-1 text-[10px] font-bold rounded-md transition-all ${view === v ? "bg-[var(--kyro-surface)] shadow-sm border border-[var(--kyro-border)] text-[var(--kyro-text-primary)]" : "text-[var(--kyro-text-secondary)] opacity-50 active:opacity-100"}`,
|
|
10735
|
+
children: v === "edit" ? "Edit" : v === "version" ? "History" : "API"
|
|
10736
|
+
},
|
|
10737
|
+
v
|
|
10738
|
+
)) }),
|
|
10739
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-[10px] font-medium", children: [
|
|
10740
|
+
renderAutoSaveStatus(true),
|
|
10741
|
+
hasUnsavedChanges && autoSaveStatus !== "saving" && autoSaveStatus !== "retrying" && autoSaveStatus !== "conflict" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10568
10742
|
"button",
|
|
10569
10743
|
{
|
|
10570
10744
|
type: "button",
|
|
10571
10745
|
onClick: async () => {
|
|
10572
|
-
|
|
10573
|
-
|
|
10746
|
+
setFormData(lastSavedData);
|
|
10747
|
+
markSaved();
|
|
10574
10748
|
},
|
|
10575
|
-
className: "text-[var(--kyro-primary)] hover:underline",
|
|
10576
|
-
children: "
|
|
10749
|
+
className: "text-[var(--kyro-primary)] text-[10px] font-medium hover:underline",
|
|
10750
|
+
children: "Revert"
|
|
10577
10751
|
}
|
|
10578
10752
|
),
|
|
10579
|
-
/* @__PURE__ */ jsxRuntime.jsx("
|
|
10753
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-4 w-px bg-[var(--kyro-border)] mx-0.5" }),
|
|
10580
10754
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10581
10755
|
"button",
|
|
10582
10756
|
{
|
|
10583
10757
|
type: "button",
|
|
10584
|
-
onClick: () =>
|
|
10585
|
-
|
|
10586
|
-
|
|
10587
|
-
className: "
|
|
10588
|
-
children: "Reload server version"
|
|
10758
|
+
onClick: () => setShowPreview(!showPreview),
|
|
10759
|
+
className: `p-1.5 rounded-lg transition-all ${showPreview ? "bg-[var(--kyro-primary)]/10 text-[var(--kyro-primary)]" : "text-[var(--kyro-text-secondary)] hover:bg-[var(--kyro-bg-secondary)]"}`,
|
|
10760
|
+
title: "Live Preview",
|
|
10761
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ExternalLink, { className: "w-3.5 h-3.5" })
|
|
10589
10762
|
}
|
|
10590
10763
|
)
|
|
10591
|
-
] })
|
|
10592
|
-
|
|
10593
|
-
|
|
10764
|
+
] })
|
|
10765
|
+
] }),
|
|
10766
|
+
autoSaveStatus === "conflict" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2 px-3 py-2 border-t border-[var(--kyro-danger)]/30 bg-[var(--kyro-danger)]/5", children: [
|
|
10767
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] font-semibold text-[var(--kyro-danger)]", children: "Conflict detected" }),
|
|
10768
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
10594
10769
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10595
10770
|
"button",
|
|
10596
10771
|
{
|
|
10597
10772
|
type: "button",
|
|
10598
10773
|
onClick: async () => {
|
|
10599
|
-
|
|
10600
|
-
|
|
10774
|
+
await saveDocument(formData);
|
|
10775
|
+
setAutoSaveStatus("success");
|
|
10601
10776
|
},
|
|
10602
|
-
className: "text-[var(--kyro-primary)] hover:underline",
|
|
10603
|
-
children: "
|
|
10777
|
+
className: "text-[11px] font-medium text-[var(--kyro-primary)] hover:underline",
|
|
10778
|
+
children: "Keep mine"
|
|
10779
|
+
}
|
|
10780
|
+
),
|
|
10781
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[var(--kyro-text-muted)] opacity-30", children: "|" }),
|
|
10782
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10783
|
+
"button",
|
|
10784
|
+
{
|
|
10785
|
+
type: "button",
|
|
10786
|
+
onClick: () => window.location.reload(),
|
|
10787
|
+
className: "text-[11px] font-medium text-[var(--kyro-danger)] hover:underline",
|
|
10788
|
+
children: "Reload"
|
|
10604
10789
|
}
|
|
10605
10790
|
)
|
|
10606
|
-
] }),
|
|
10607
|
-
lastSavedAt && autoSaveStatus !== "saving" && autoSaveStatus !== "retrying" && autoSaveStatus !== "success" && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "border-l border-[var(--kyro-border)] pl-4", children: [
|
|
10608
|
-
"Draft saved ",
|
|
10609
|
-
(() => {
|
|
10610
|
-
const diffMs = now - lastSavedAt;
|
|
10611
|
-
const diffMin = Math.floor(diffMs / 6e4);
|
|
10612
|
-
const diffSec = Math.floor(diffMs / 1e3);
|
|
10613
|
-
if (diffMin >= 1) return `${diffMin}m ago`;
|
|
10614
|
-
if (diffSec >= 5) return `${diffSec}s ago`;
|
|
10615
|
-
return "just now";
|
|
10616
|
-
})()
|
|
10617
|
-
] }),
|
|
10618
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "border-l border-[var(--kyro-border)] pl-4", children: [
|
|
10619
|
-
"Modified ",
|
|
10620
|
-
lastModified
|
|
10621
|
-
] }),
|
|
10622
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "border-l border-[var(--kyro-border)] pl-4", children: [
|
|
10623
|
-
"Created ",
|
|
10624
|
-
createdAt
|
|
10625
10791
|
] })
|
|
10626
10792
|
] })
|
|
10627
10793
|
] }),
|
|
10628
|
-
/* @__PURE__ */ jsxRuntime.jsxs("
|
|
10629
|
-
/* @__PURE__ */ jsxRuntime.
|
|
10630
|
-
"
|
|
10631
|
-
{
|
|
10632
|
-
type: "button",
|
|
10633
|
-
onClick: () => setView(v),
|
|
10634
|
-
className: `px-5 py-2 text-xs font-bold rounded-lg transition-all ${view === v ? "bg-[var(--kyro-surface)] shadow-sm border border-[var(--kyro-border)] text-[var(--kyro-text-primary)]" : "text-[var(--kyro-text-secondary)] opacity-50 hover:opacity-100"}`,
|
|
10635
|
-
children: v.toUpperCase()
|
|
10636
|
-
},
|
|
10637
|
-
v
|
|
10638
|
-
)) }),
|
|
10639
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-8 w-px bg-[var(--kyro-border)] mx-2" }),
|
|
10640
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
10641
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
10642
|
-
"button",
|
|
10643
|
-
{
|
|
10644
|
-
type: "button",
|
|
10645
|
-
onClick: () => setShowPreview(!showPreview),
|
|
10646
|
-
className: `kyro-btn p-2.5 rounded-xl transition-all flex items-center gap-2 ${showPreview ? "shadow-lg" : "text-[var(--kyro-text-secondary)] hover:bg-[var(--kyro-bg-secondary)]"}`,
|
|
10647
|
-
title: "Live Preview",
|
|
10648
|
-
children: [
|
|
10649
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ExternalLink, { className: "w-4 h-4" }),
|
|
10650
|
-
showPreview && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-bold tracking-widest pr-1", children: "Active" })
|
|
10651
|
-
]
|
|
10652
|
-
}
|
|
10653
|
-
),
|
|
10654
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10655
|
-
"button",
|
|
10656
|
-
{
|
|
10657
|
-
type: "button",
|
|
10658
|
-
onClick: () => {
|
|
10659
|
-
window.dispatchEvent(new CustomEvent("toggle-sidebar"));
|
|
10660
|
-
},
|
|
10661
|
-
className: `kyro-btn p-2.5 rounded-xl transition-all ${sidebarCollapsed ? "" : "text-[var(--kyro-text-secondary)] hover:bg-[var(--kyro-bg-secondary)]"}`,
|
|
10662
|
-
title: "Toggle Sidebar",
|
|
10663
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10664
|
-
"svg",
|
|
10665
|
-
{
|
|
10666
|
-
width: "20",
|
|
10667
|
-
height: "20",
|
|
10668
|
-
viewBox: "0 0 24 24",
|
|
10669
|
-
fill: "none",
|
|
10670
|
-
stroke: "currentColor",
|
|
10671
|
-
strokeWidth: "2",
|
|
10672
|
-
children: [
|
|
10673
|
-
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }),
|
|
10674
|
-
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "9", y1: "3", x2: "9", y2: "21" })
|
|
10675
|
-
]
|
|
10676
|
-
}
|
|
10677
|
-
)
|
|
10678
|
-
}
|
|
10679
|
-
),
|
|
10680
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10681
|
-
SplitButton,
|
|
10682
|
-
{
|
|
10683
|
-
status: documentStatus,
|
|
10684
|
-
saveStatus: localSaveStatus,
|
|
10685
|
-
hasChanges: hasUnsavedChanges,
|
|
10686
|
-
onPublish: handlePublish,
|
|
10687
|
-
disabled: localSaveStatus === "saving"
|
|
10688
|
-
}
|
|
10689
|
-
),
|
|
10690
|
-
!isNew && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10691
|
-
Dropdown,
|
|
10692
|
-
{
|
|
10693
|
-
trigger: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10694
|
-
"button",
|
|
10695
|
-
{
|
|
10696
|
-
type: "button",
|
|
10697
|
-
className: "kyro-btn p-2.5 rounded-xl border border-[var(--kyro-border)] hover:bg-[var(--kyro-bg-secondary)] transition-all",
|
|
10698
|
-
title: "More actions",
|
|
10699
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", children: [
|
|
10700
|
-
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "5", r: "1.5" }),
|
|
10701
|
-
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "1.5" }),
|
|
10702
|
-
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "19", r: "1.5" })
|
|
10703
|
-
] })
|
|
10704
|
-
}
|
|
10705
|
-
),
|
|
10706
|
-
direction: "down",
|
|
10707
|
-
children: [
|
|
10708
|
-
!globalSlug && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10709
|
-
DropdownItem,
|
|
10710
|
-
{
|
|
10711
|
-
onClick: handleCreateNew,
|
|
10712
|
-
icon: /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
10713
|
-
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "12", y1: "5", x2: "12", y2: "19" }),
|
|
10714
|
-
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "5", y1: "12", x2: "19", y2: "12" })
|
|
10715
|
-
] }),
|
|
10716
|
-
children: "Create New"
|
|
10717
|
-
}
|
|
10718
|
-
),
|
|
10719
|
-
!globalSlug && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10720
|
-
DropdownItem,
|
|
10721
|
-
{
|
|
10722
|
-
onClick: handleDuplicate,
|
|
10723
|
-
icon: /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
10724
|
-
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2", ry: "2" }),
|
|
10725
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
|
|
10726
|
-
] }),
|
|
10727
|
-
children: "Duplicate"
|
|
10728
|
-
}
|
|
10729
|
-
),
|
|
10730
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10731
|
-
DropdownItem,
|
|
10732
|
-
{
|
|
10733
|
-
onClick: () => setShowSchedulePicker(true),
|
|
10734
|
-
icon: /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
10735
|
-
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2", ry: "2" }),
|
|
10736
|
-
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "16", y1: "2", x2: "16", y2: "6" }),
|
|
10737
|
-
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "8", y1: "2", x2: "8", y2: "6" }),
|
|
10738
|
-
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "3", y1: "10", x2: "21", y2: "10" })
|
|
10739
|
-
] }),
|
|
10740
|
-
children: "Schedule Publish"
|
|
10741
|
-
}
|
|
10742
|
-
),
|
|
10743
|
-
documentStatus === "published" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
10744
|
-
DropdownItem,
|
|
10745
|
-
{
|
|
10746
|
-
onClick: handleUnpublish,
|
|
10747
|
-
icon: /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
10748
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24" }),
|
|
10749
|
-
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
|
|
10750
|
-
] }),
|
|
10751
|
-
children: "Unpublish"
|
|
10752
|
-
}
|
|
10753
|
-
),
|
|
10754
|
-
!globalSlug && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
10755
|
-
/* @__PURE__ */ jsxRuntime.jsx(DropdownSeparator, {}),
|
|
10756
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10757
|
-
DropdownItem,
|
|
10758
|
-
{
|
|
10759
|
-
onClick: handleDelete,
|
|
10760
|
-
danger: true,
|
|
10761
|
-
icon: /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
10762
|
-
/* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "3 6 5 6 21 6" }),
|
|
10763
|
-
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })
|
|
10764
|
-
] }),
|
|
10765
|
-
children: "Delete"
|
|
10766
|
-
}
|
|
10767
|
-
)
|
|
10768
|
-
] })
|
|
10769
|
-
]
|
|
10770
|
-
}
|
|
10771
|
-
),
|
|
10772
|
-
showSchedulePicker && /* @__PURE__ */ jsxRuntime.jsx("div", { ref: scheduleRef, className: "relative", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute right-0 top-2 p-4 rounded-lg border border-[var(--kyro-border)] bg-[var(--kyro-surface)] shadow-2xl z-50", children: [
|
|
10773
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-medium mb-2", children: "Schedule Publish" }),
|
|
10794
|
+
/* @__PURE__ */ jsxRuntime.jsxs("header", { className: "hidden md:flex surface-tile px-8 py-6 items-center justify-between sticky top-0 border-b border-[var(--kyro-border)] mb-8 bg-[var(--kyro-surface)] backdrop-blur-md", children: [
|
|
10795
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2 min-w-0", children: [
|
|
10796
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 flex-wrap min-w-0", children: [
|
|
10774
10797
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10775
|
-
"
|
|
10798
|
+
"a",
|
|
10776
10799
|
{
|
|
10777
|
-
|
|
10778
|
-
|
|
10779
|
-
className: "
|
|
10780
|
-
min: (/* @__PURE__ */ new Date()).toISOString().slice(0, 16)
|
|
10800
|
+
href: `/${collectionSlug}`,
|
|
10801
|
+
className: "p-2 border border-[var(--kyro-border)] rounded-xl hover:bg-[var(--kyro-bg-secondary)] transition-colors shrink-0",
|
|
10802
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "w-4 h-4" })
|
|
10781
10803
|
}
|
|
10782
10804
|
),
|
|
10783
|
-
/* @__PURE__ */ jsxRuntime.
|
|
10784
|
-
|
|
10785
|
-
|
|
10786
|
-
|
|
10787
|
-
|
|
10788
|
-
|
|
10789
|
-
|
|
10790
|
-
|
|
10791
|
-
|
|
10792
|
-
),
|
|
10805
|
+
/* @__PURE__ */ jsxRuntime.jsx("h1", { className: "text-xl font-bold tracking-tighter truncate min-w-0", children: docTitle }),
|
|
10806
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: `shrink-0 inline-flex items-center gap-1.5 px-2 rounded-full text-[10px] font-regular border ${statusBadgeBg}`, children: [
|
|
10807
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `h-1.5 w-1.5 rounded-full ${statusColor}` }),
|
|
10808
|
+
statusLabel
|
|
10809
|
+
] })
|
|
10810
|
+
] }),
|
|
10811
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-4 text-[11px] font-medium tracking-wide opacity-60 ml-12", children: [
|
|
10812
|
+
renderAutoSaveStatus(false),
|
|
10813
|
+
hasUnsavedChanges && autoSaveStatus !== "saving" && autoSaveStatus !== "retrying" && autoSaveStatus !== "conflict" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
10814
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "opacity-30", children: "\u2014" }),
|
|
10793
10815
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10794
10816
|
"button",
|
|
10795
10817
|
{
|
|
10796
10818
|
type: "button",
|
|
10797
|
-
onClick: () => {
|
|
10798
|
-
|
|
10799
|
-
|
|
10819
|
+
onClick: async () => {
|
|
10820
|
+
setFormData(lastSavedData);
|
|
10821
|
+
markSaved();
|
|
10800
10822
|
},
|
|
10801
|
-
className: "
|
|
10802
|
-
children: "
|
|
10823
|
+
className: "text-[var(--kyro-primary)] hover:underline",
|
|
10824
|
+
children: "Revert changes"
|
|
10803
10825
|
}
|
|
10804
10826
|
)
|
|
10827
|
+
] }),
|
|
10828
|
+
lastSavedAt && autoSaveStatus !== "saving" && autoSaveStatus !== "retrying" && autoSaveStatus !== "success" && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "border-l border-[var(--kyro-border)] pl-4", children: [
|
|
10829
|
+
"Draft saved ",
|
|
10830
|
+
(() => {
|
|
10831
|
+
const diffMs = now - lastSavedAt;
|
|
10832
|
+
const diffMin = Math.floor(diffMs / 6e4);
|
|
10833
|
+
const diffSec = Math.floor(diffMs / 1e3);
|
|
10834
|
+
if (diffMin >= 1) return `${diffMin}m ago`;
|
|
10835
|
+
if (diffSec >= 5) return `${diffSec}s ago`;
|
|
10836
|
+
return "just now";
|
|
10837
|
+
})()
|
|
10838
|
+
] }),
|
|
10839
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "border-l border-[var(--kyro-border)] pl-4", children: [
|
|
10840
|
+
"Modified ",
|
|
10841
|
+
lastModified
|
|
10842
|
+
] }),
|
|
10843
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "border-l border-[var(--kyro-border)] pl-4", children: [
|
|
10844
|
+
"Created ",
|
|
10845
|
+
createdAt
|
|
10805
10846
|
] })
|
|
10806
|
-
] })
|
|
10847
|
+
] })
|
|
10848
|
+
] }),
|
|
10849
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-6", children: [
|
|
10850
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1 bg-[var(--kyro-bg-secondary)] p-1 rounded-xl border border-[var(--kyro-border)]", children: ["edit", "version", "api"].map((v) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
10851
|
+
"button",
|
|
10852
|
+
{
|
|
10853
|
+
type: "button",
|
|
10854
|
+
onClick: () => setView(v),
|
|
10855
|
+
className: `px-5 py-2 text-xs font-bold rounded-lg transition-all ${view === v ? "bg-[var(--kyro-surface)] shadow-sm border border-[var(--kyro-border)] text-[var(--kyro-text-primary)]" : "text-[var(--kyro-text-secondary)] opacity-50 hover:opacity-100"}`,
|
|
10856
|
+
children: v.toUpperCase()
|
|
10857
|
+
},
|
|
10858
|
+
v
|
|
10859
|
+
)) }),
|
|
10860
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-8 w-px bg-[var(--kyro-border)] mx-2" }),
|
|
10861
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
10862
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
10863
|
+
"button",
|
|
10864
|
+
{
|
|
10865
|
+
type: "button",
|
|
10866
|
+
onClick: () => setShowPreview(!showPreview),
|
|
10867
|
+
className: `kyro-btn p-2.5 rounded-xl transition-all flex items-center gap-2 ${showPreview ? "shadow-lg" : "text-[var(--kyro-text-secondary)] hover:bg-[var(--kyro-bg-secondary)]"}`,
|
|
10868
|
+
title: "Live Preview",
|
|
10869
|
+
children: [
|
|
10870
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ExternalLink, { className: "w-4 h-4" }),
|
|
10871
|
+
showPreview && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-bold tracking-widest pr-1", children: "Active" })
|
|
10872
|
+
]
|
|
10873
|
+
}
|
|
10874
|
+
),
|
|
10875
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10876
|
+
"button",
|
|
10877
|
+
{
|
|
10878
|
+
type: "button",
|
|
10879
|
+
onClick: () => {
|
|
10880
|
+
window.dispatchEvent(new CustomEvent("toggle-sidebar"));
|
|
10881
|
+
},
|
|
10882
|
+
className: `kyro-btn p-2.5 rounded-xl transition-all ${sidebarCollapsed ? "" : "text-[var(--kyro-text-secondary)] hover:bg-[var(--kyro-bg-secondary)]"}`,
|
|
10883
|
+
title: "Toggle Sidebar",
|
|
10884
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10885
|
+
"svg",
|
|
10886
|
+
{
|
|
10887
|
+
width: "20",
|
|
10888
|
+
height: "20",
|
|
10889
|
+
viewBox: "0 0 24 24",
|
|
10890
|
+
fill: "none",
|
|
10891
|
+
stroke: "currentColor",
|
|
10892
|
+
strokeWidth: "2",
|
|
10893
|
+
children: [
|
|
10894
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }),
|
|
10895
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "9", y1: "3", x2: "9", y2: "21" })
|
|
10896
|
+
]
|
|
10897
|
+
}
|
|
10898
|
+
)
|
|
10899
|
+
}
|
|
10900
|
+
),
|
|
10901
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
10902
|
+
SplitButton,
|
|
10903
|
+
{
|
|
10904
|
+
status: documentStatus,
|
|
10905
|
+
saveStatus: localSaveStatus,
|
|
10906
|
+
hasChanges: hasUnsavedChanges,
|
|
10907
|
+
onPublish: handlePublish,
|
|
10908
|
+
disabled: localSaveStatus === "saving"
|
|
10909
|
+
}
|
|
10910
|
+
),
|
|
10911
|
+
renderKebabMenu(),
|
|
10912
|
+
renderSchedulePicker()
|
|
10913
|
+
] })
|
|
10807
10914
|
] })
|
|
10808
10915
|
] })
|
|
10809
10916
|
] });
|
|
@@ -10835,27 +10942,18 @@ function AutoForm({
|
|
|
10835
10942
|
}
|
|
10836
10943
|
),
|
|
10837
10944
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 bg-transparent pointer-events-none border-[12px] border-[var(--kyro-surface)] rounded-3xl" })
|
|
10838
|
-
] }) }) : sidebarCollapsed ? null : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-4 md:space-y-6 animate-in fade-in slide-in-from-right-4 duration-500", children: config.fields.some((f) => f.admin?.position === "sidebar") && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10839
|
-
/* @__PURE__ */ jsxRuntime.
|
|
10840
|
-
|
|
10841
|
-
config.fields.filter((f) => f.admin?.position === "sidebar").map((f) => renderField(f))
|
|
10842
|
-
] }),
|
|
10843
|
-
/* @__PURE__ */ jsxRuntime.jsxs("details", { className: "lg:hidden surface-tile p-4 space-y-4 group", children: [
|
|
10844
|
-
/* @__PURE__ */ jsxRuntime.jsxs("summary", { className: "cursor-pointer font-semibold text-xs tracking-widest opacity-40 text-[var(--kyro-text-secondary)] select-none flex items-center gap-2", children: [
|
|
10845
|
-
/* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-3 h-3 transition-transform group-open:rotate-90", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 18l6-6-6-6" }) }),
|
|
10846
|
-
"Settings"
|
|
10847
|
-
] }),
|
|
10848
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-4 pt-4 border-t border-[var(--kyro-border)]", children: config.fields.filter((f) => f.admin?.position === "sidebar").map((f) => renderField(f)) })
|
|
10849
|
-
] })
|
|
10945
|
+
] }) }) : sidebarCollapsed ? null : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-4 md:space-y-6 animate-in fade-in slide-in-from-right-4 duration-500", children: config.fields.some((f) => f.admin?.position === "sidebar") && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "surface-tile p-4 md:p-6 space-y-4 md:space-y-6", children: [
|
|
10946
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-[10px] font-bold tracking-[0.2em] opacity-40", children: "Settings" }),
|
|
10947
|
+
config.fields.filter((f) => f.admin?.position === "sidebar").map((f) => renderField(f))
|
|
10850
10948
|
] }) })
|
|
10851
10949
|
]
|
|
10852
10950
|
}
|
|
10853
10951
|
);
|
|
10854
10952
|
};
|
|
10855
10953
|
const renderVersionView = () => /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full animate-in fade-in slide-in-from-bottom-4 pb-12", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "surface-tile p-0 overflow-hidden", children: [
|
|
10856
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-6 py-4 border-b border-[var(--kyro-border)] flex items-center justify-between", children: [
|
|
10954
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-4 md:px-6 py-3 md:py-4 border-b border-[var(--kyro-border)] flex flex-col md:flex-row md:items-center justify-between gap-2", children: [
|
|
10857
10955
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
10858
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-bold text-[var(--kyro-text-primary)]", children: "Version History" }),
|
|
10956
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-base md:text-lg font-bold text-[var(--kyro-text-primary)]", children: "Version History" }),
|
|
10859
10957
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[11px] text-[var(--kyro-text-muted)] mt-0.5", children: compareMode ? `Select 2 versions \xB7 ${compareSelected.length}/2 chosen` : `${versions.length} snapshot${versions.length !== 1 ? "s" : ""} \xB7 Auto-saved` })
|
|
10860
10958
|
] }),
|
|
10861
10959
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
@@ -10904,11 +11002,14 @@ function AutoForm({
|
|
|
10904
11002
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-h-[400px] overflow-y-auto", children: compareDiffs.map((d, i) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10905
11003
|
"div",
|
|
10906
11004
|
{
|
|
10907
|
-
className: "grid grid-cols-4 gap-3 px-6 py-2.5 text-[11px] font-mono border-t border-[var(--kyro-border)] hover:bg-[var(--kyro-bg-secondary)]",
|
|
11005
|
+
className: "flex flex-col md:grid md:grid-cols-4 gap-1 md:gap-3 px-4 md:px-6 py-2.5 text-[11px] font-mono border-t border-[var(--kyro-border)] hover:bg-[var(--kyro-bg-secondary)]",
|
|
10908
11006
|
children: [
|
|
10909
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[var(--kyro-text-muted)] truncate", children: d.field }),
|
|
10910
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[var(--kyro-text-muted)] truncate", children: typeof d.oldValue === "object" ? JSON.stringify(d.oldValue) : String(d.oldValue ?? "null") }),
|
|
10911
|
-
/* @__PURE__ */ jsxRuntime.
|
|
11007
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[var(--kyro-text-muted)] truncate font-semibold md:font-normal", children: d.field }),
|
|
11008
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[var(--kyro-text-muted)] truncate hidden md:block", children: typeof d.oldValue === "object" ? JSON.stringify(d.oldValue) : String(d.oldValue ?? "null") }),
|
|
11009
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "md:col-span-2 text-[var(--kyro-text-primary)] truncate", children: [
|
|
11010
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "md:hidden text-[var(--kyro-text-muted)]", children: "\u2192 " }),
|
|
11011
|
+
typeof d.newValue === "object" ? JSON.stringify(d.newValue) : String(d.newValue ?? "null")
|
|
11012
|
+
] })
|
|
10912
11013
|
]
|
|
10913
11014
|
},
|
|
10914
11015
|
i
|
|
@@ -10916,58 +11017,108 @@ function AutoForm({
|
|
|
10916
11017
|
] }),
|
|
10917
11018
|
loadingVersions ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center py-16", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "animate-spin text-[var(--kyro-primary)]", children: "\u231B" }) }) : versions.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-center py-16 text-[var(--kyro-text-muted)] text-sm italic", children: "No versions yet." }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "divide-y divide-[var(--kyro-border)]", children: versions.map((v, i) => {
|
|
10918
11019
|
const isSelected = compareSelected.includes(v.id);
|
|
10919
|
-
|
|
11020
|
+
v.status === "draft";
|
|
10920
11021
|
const isAutoSaved = (v.changeDescription || "").toLowerCase().includes("auto");
|
|
10921
11022
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10922
11023
|
"div",
|
|
10923
11024
|
{
|
|
10924
11025
|
onClick: compareMode ? () => toggleCompareSelection(v.id) : void 0,
|
|
10925
|
-
className: `
|
|
11026
|
+
className: `transition-all ${compareMode ? isSelected ? "bg-[var(--kyro-primary)]/5 cursor-pointer" : "hover:bg-[var(--kyro-bg-secondary)] cursor-pointer" : "hover:bg-[var(--kyro-bg-secondary)]"}`,
|
|
10926
11027
|
children: [
|
|
10927
|
-
/* @__PURE__ */ jsxRuntime.
|
|
10928
|
-
"div",
|
|
10929
|
-
|
|
10930
|
-
|
|
10931
|
-
|
|
10932
|
-
|
|
10933
|
-
|
|
10934
|
-
|
|
10935
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "
|
|
10936
|
-
|
|
10937
|
-
|
|
11028
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "hidden md:grid grid-cols-12 gap-3 px-6 py-3 items-center", children: [
|
|
11029
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-1 flex items-center gap-2", children: compareMode ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
11030
|
+
"div",
|
|
11031
|
+
{
|
|
11032
|
+
className: `w-4 h-4 rounded-full border ${isSelected ? "border-[var(--kyro-primary)] bg-[var(--kyro-primary)]" : "border-[var(--kyro-border)]"}`,
|
|
11033
|
+
children: isSelected && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "w-4 h-4" })
|
|
11034
|
+
}
|
|
11035
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-bold text-[var(--kyro-text-muted)] w-5", children: versions.length - i }) }),
|
|
11036
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-4 min-w-0", children: [
|
|
11037
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-[13px] font-medium text-[var(--kyro-text-primary)] truncate flex items-center gap-2", children: [
|
|
11038
|
+
v.changeDescription || "Snapshot",
|
|
11039
|
+
isAutoSaved && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[9px] px-1.5 py-0.5 bg-[var(--kyro-bg-secondary)] text-[var(--kyro-text-secondary)] rounded font-bold tracking-wider", children: "Auto" })
|
|
11040
|
+
] }),
|
|
11041
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[11px] text-[var(--kyro-text-muted)]", children: new Date(v.createdAt).toLocaleString("en-US", {
|
|
11042
|
+
month: "short",
|
|
11043
|
+
day: "numeric",
|
|
11044
|
+
hour: "2-digit",
|
|
11045
|
+
minute: "2-digit"
|
|
11046
|
+
}) })
|
|
10938
11047
|
] }),
|
|
10939
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "
|
|
10940
|
-
|
|
10941
|
-
|
|
10942
|
-
|
|
10943
|
-
|
|
10944
|
-
|
|
11048
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-3", children: v.status && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11049
|
+
"span",
|
|
11050
|
+
{
|
|
11051
|
+
className: `inline-flex items-center gap-1 px-2 py-0.5 rounded text-[10px] font-bold capitalize tracking-wider ${v.status === "published" ? " text-[var(--kyro-success)]" : " text-[var(--kyro-warning)]"}`,
|
|
11052
|
+
children: [
|
|
11053
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11054
|
+
"span",
|
|
11055
|
+
{
|
|
11056
|
+
className: `w-1.5 h-1.5 rounded-full ${v.status === "published" ? "bg-[var(--kyro-success)]" : "bg-[var(--kyro-warning)]"}`
|
|
11057
|
+
}
|
|
11058
|
+
),
|
|
11059
|
+
v.status
|
|
11060
|
+
]
|
|
11061
|
+
}
|
|
11062
|
+
) }),
|
|
11063
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-2 text-[11px] text-[var(--kyro-text-muted)]", children: v.createdBy || "system" }),
|
|
11064
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-2 flex justify-end", children: !compareMode && /* @__PURE__ */ jsxRuntime.jsx(
|
|
11065
|
+
"button",
|
|
11066
|
+
{
|
|
11067
|
+
type: "button",
|
|
11068
|
+
onClick: () => handleRestoreVersion(v.id),
|
|
11069
|
+
className: "px-3 py-1.5 rounded-lg border border-[var(--kyro-border)] text-[11px] font-bold tracking-wider text-[var(--kyro-text-secondary)] hover:text-[var(--kyro-text-primary)] hover:border-[var(--kyro-primary)] transition-all active:scale-95",
|
|
11070
|
+
children: "Restore"
|
|
11071
|
+
}
|
|
11072
|
+
) })
|
|
10945
11073
|
] }),
|
|
10946
|
-
/* @__PURE__ */ jsxRuntime.
|
|
10947
|
-
"
|
|
10948
|
-
|
|
10949
|
-
|
|
10950
|
-
|
|
10951
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11074
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "md:hidden flex items-start gap-3 px-4 py-3", children: [
|
|
11075
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "pt-0.5 shrink-0", children: compareMode ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
11076
|
+
"div",
|
|
11077
|
+
{
|
|
11078
|
+
className: `w-4 h-4 rounded-full border ${isSelected ? "border-[var(--kyro-primary)] bg-[var(--kyro-primary)]" : "border-[var(--kyro-border)]"}`,
|
|
11079
|
+
children: isSelected && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "w-4 h-4" })
|
|
11080
|
+
}
|
|
11081
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-bold text-[var(--kyro-text-muted)] w-5 inline-block text-center", children: versions.length - i }) }),
|
|
11082
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
11083
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-[13px] font-medium text-[var(--kyro-text-primary)] truncate flex items-center gap-1.5", children: [
|
|
11084
|
+
v.changeDescription || "Snapshot",
|
|
11085
|
+
isAutoSaved && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[9px] px-1 py-0.5 bg-[var(--kyro-bg-secondary)] text-[var(--kyro-text-secondary)] rounded font-bold tracking-wider shrink-0", children: "Auto" })
|
|
11086
|
+
] }),
|
|
11087
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 mt-1 flex-wrap", children: [
|
|
11088
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] text-[var(--kyro-text-muted)]", children: new Date(v.createdAt).toLocaleString("en-US", {
|
|
11089
|
+
month: "short",
|
|
11090
|
+
day: "numeric",
|
|
11091
|
+
hour: "2-digit",
|
|
11092
|
+
minute: "2-digit"
|
|
11093
|
+
}) }),
|
|
11094
|
+
v.status && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
10952
11095
|
"span",
|
|
10953
11096
|
{
|
|
10954
|
-
className: `
|
|
11097
|
+
className: `inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[9px] font-bold capitalize tracking-wider ${v.status === "published" ? "text-[var(--kyro-success)]" : "text-[var(--kyro-warning)]"}`,
|
|
11098
|
+
children: [
|
|
11099
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11100
|
+
"span",
|
|
11101
|
+
{
|
|
11102
|
+
className: `w-1 h-1 rounded-full ${v.status === "published" ? "bg-[var(--kyro-success)]" : "bg-[var(--kyro-warning)]"}`
|
|
11103
|
+
}
|
|
11104
|
+
),
|
|
11105
|
+
v.status
|
|
11106
|
+
]
|
|
10955
11107
|
}
|
|
10956
11108
|
),
|
|
10957
|
-
v.
|
|
10958
|
-
]
|
|
10959
|
-
}
|
|
10960
|
-
|
|
10961
|
-
|
|
10962
|
-
|
|
10963
|
-
|
|
10964
|
-
|
|
10965
|
-
|
|
10966
|
-
|
|
10967
|
-
|
|
10968
|
-
|
|
10969
|
-
|
|
10970
|
-
) })
|
|
11109
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-[var(--kyro-text-muted)] opacity-60", children: v.createdBy || "system" })
|
|
11110
|
+
] })
|
|
11111
|
+
] }),
|
|
11112
|
+
!compareMode && /* @__PURE__ */ jsxRuntime.jsx(
|
|
11113
|
+
"button",
|
|
11114
|
+
{
|
|
11115
|
+
type: "button",
|
|
11116
|
+
onClick: () => handleRestoreVersion(v.id),
|
|
11117
|
+
className: "shrink-0 px-2.5 py-1 rounded-lg border border-[var(--kyro-border)] text-[10px] font-bold tracking-wider text-[var(--kyro-text-secondary)] hover:text-[var(--kyro-text-primary)] hover:border-[var(--kyro-primary)] transition-all active:scale-95",
|
|
11118
|
+
children: "Restore"
|
|
11119
|
+
}
|
|
11120
|
+
)
|
|
11121
|
+
] })
|
|
10971
11122
|
]
|
|
10972
11123
|
},
|
|
10973
11124
|
v.id
|
|
@@ -11105,6 +11256,12 @@ function AutoForm({
|
|
|
11105
11256
|
] })
|
|
11106
11257
|
] });
|
|
11107
11258
|
}
|
|
11259
|
+
var STATUS_DOT = {
|
|
11260
|
+
draft: "bg-[var(--kyro-warning)]",
|
|
11261
|
+
published: "bg-[var(--kyro-success)]",
|
|
11262
|
+
scheduled: "bg-[var(--kyro-primary)]",
|
|
11263
|
+
archived: "bg-[var(--kyro-text-muted)]"
|
|
11264
|
+
};
|
|
11108
11265
|
function ActionBar({
|
|
11109
11266
|
status,
|
|
11110
11267
|
saveStatus,
|
|
@@ -11123,314 +11280,147 @@ function ActionBar({
|
|
|
11123
11280
|
}) {
|
|
11124
11281
|
const view = useAutoFormStore((s) => s.view) || "edit";
|
|
11125
11282
|
const setView = useAutoFormStore((s) => s.setView);
|
|
11283
|
+
const [moreOpen, setMoreOpen] = React.useState(false);
|
|
11284
|
+
const moreRef = React.useRef(null);
|
|
11285
|
+
React.useEffect(() => {
|
|
11286
|
+
const handleClick = (e) => {
|
|
11287
|
+
if (moreRef.current && !moreRef.current.contains(e.target)) setMoreOpen(false);
|
|
11288
|
+
};
|
|
11289
|
+
document.addEventListener("mousedown", handleClick);
|
|
11290
|
+
return () => document.removeEventListener("mousedown", handleClick);
|
|
11291
|
+
}, []);
|
|
11126
11292
|
const getSaveStatusText = () => {
|
|
11127
11293
|
if (saveStatus === "saving") return "Saving...";
|
|
11128
11294
|
if (saveStatus === "saved") return "Saved";
|
|
11129
11295
|
if (saveStatus === "error") return "Error saving";
|
|
11130
|
-
if (hasChanges) return "Unsaved
|
|
11296
|
+
if (hasChanges) return "Unsaved";
|
|
11131
11297
|
return null;
|
|
11132
11298
|
};
|
|
11133
|
-
const
|
|
11134
|
-
|
|
11135
|
-
|
|
11136
|
-
|
|
11137
|
-
|
|
11138
|
-
|
|
11139
|
-
|
|
11140
|
-
|
|
11141
|
-
|
|
11142
|
-
|
|
11143
|
-
|
|
11144
|
-
|
|
11145
|
-
scheduled: {
|
|
11146
|
-
label: "Scheduled",
|
|
11147
|
-
class: "bg-blue-100 text-blue-700 border-blue-200",
|
|
11148
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Clock, { className: "w-3 h-3" })
|
|
11149
|
-
},
|
|
11150
|
-
archived: {
|
|
11151
|
-
label: "Archived",
|
|
11152
|
-
class: "bg-yellow-100 text-yellow-700 border-yellow-200",
|
|
11153
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Archive, { className: "w-3 h-3" })
|
|
11154
|
-
}
|
|
11155
|
-
};
|
|
11156
|
-
const config = statusConfig2[status];
|
|
11157
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11158
|
-
"span",
|
|
11299
|
+
const tabs = ["edit", "version", "api"];
|
|
11300
|
+
const saveText = getSaveStatusText();
|
|
11301
|
+
const iconBtnClass = "p-1.5 rounded-lg hover:bg-[var(--kyro-surface-accent)] text-[var(--kyro-text-muted)] hover:text-[var(--kyro-text-primary)] transition-all shrink-0";
|
|
11302
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 px-2 py-1.5 bg-[var(--kyro-surface)] border-b border-[var(--kyro-border)] w-full overflow-x-auto", children: [
|
|
11303
|
+
onBack && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: onBack, className: "p-1 rounded-lg hover:bg-[var(--kyro-surface-accent)] text-[var(--kyro-text-secondary)] transition-all shrink-0", children: /* @__PURE__ */ jsxRuntime.jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M19 12H5M12 19l-7-7 7-7" }) }) }),
|
|
11304
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `w-2 h-2 rounded-full shrink-0 ${STATUS_DOT[status] || "bg-[var(--kyro-text-muted)]"}` }),
|
|
11305
|
+
saveText && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: `text-[10px] whitespace-nowrap max-md:hidden ${saveStatus === "error" ? "text-[var(--kyro-error)]" : "text-[var(--kyro-text-muted)]"}`, children: [
|
|
11306
|
+
saveStatus === "saving" && /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: "sm", className: "inline mr-0.5" }),
|
|
11307
|
+
saveText
|
|
11308
|
+
] }),
|
|
11309
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-0.5 bg-[var(--kyro-bg-secondary)] p-0.5 rounded-lg border border-[var(--kyro-border)] shrink-0 max-md:hidden", children: tabs.map((v) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
11310
|
+
"button",
|
|
11159
11311
|
{
|
|
11160
|
-
|
|
11161
|
-
|
|
11162
|
-
|
|
11163
|
-
|
|
11164
|
-
|
|
11165
|
-
|
|
11166
|
-
)
|
|
11167
|
-
|
|
11168
|
-
|
|
11169
|
-
|
|
11170
|
-
|
|
11171
|
-
|
|
11172
|
-
|
|
11173
|
-
|
|
11174
|
-
|
|
11175
|
-
|
|
11176
|
-
|
|
11177
|
-
|
|
11178
|
-
|
|
11179
|
-
|
|
11180
|
-
className:
|
|
11181
|
-
|
|
11182
|
-
|
|
11183
|
-
|
|
11184
|
-
|
|
11185
|
-
|
|
11186
|
-
|
|
11187
|
-
{
|
|
11188
|
-
type: "button",
|
|
11189
|
-
onClick: onPreview,
|
|
11190
|
-
className: "p-2 rounded-lg hover:bg-[var(--kyro-surface-accent)] text-[var(--kyro-text-secondary)] transition-all",
|
|
11191
|
-
title: "Preview",
|
|
11192
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Eye, { className: "w-4 h-4" })
|
|
11193
|
-
}
|
|
11194
|
-
),
|
|
11195
|
-
onViewHistory && /* @__PURE__ */ jsxRuntime.jsx(
|
|
11196
|
-
"button",
|
|
11197
|
-
{
|
|
11198
|
-
type: "button",
|
|
11199
|
-
onClick: onViewHistory,
|
|
11200
|
-
className: "p-2 rounded-lg hover:bg-[var(--kyro-surface-accent)] text-[var(--kyro-text-secondary)] transition-all",
|
|
11201
|
-
title: "View History",
|
|
11202
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Clock, { className: "w-4 h-4" })
|
|
11203
|
-
}
|
|
11204
|
-
),
|
|
11205
|
-
onDuplicate && /* @__PURE__ */ jsxRuntime.jsx(
|
|
11206
|
-
"button",
|
|
11207
|
-
{
|
|
11208
|
-
type: "button",
|
|
11209
|
-
onClick: onDuplicate,
|
|
11210
|
-
className: "p-2 rounded-lg hover:bg-[var(--kyro-surface-accent)] text-[var(--kyro-text-secondary)] transition-all",
|
|
11211
|
-
title: "Duplicate",
|
|
11212
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Copy, { className: "w-4 h-4" })
|
|
11213
|
-
}
|
|
11214
|
-
),
|
|
11215
|
-
onDelete && /* @__PURE__ */ jsxRuntime.jsx(
|
|
11216
|
-
"button",
|
|
11217
|
-
{
|
|
11218
|
-
type: "button",
|
|
11219
|
-
onClick: onDelete,
|
|
11220
|
-
className: "p-2 rounded-lg hover:bg-[var(--kyro-danger-bg)] text-[var(--kyro-error)] transition-all",
|
|
11221
|
-
title: "Delete",
|
|
11222
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "w-4 h-4" })
|
|
11223
|
-
}
|
|
11224
|
-
),
|
|
11225
|
-
onToggleSidebar && /* @__PURE__ */ jsxRuntime.jsx(
|
|
11312
|
+
type: "button",
|
|
11313
|
+
onClick: () => setView(v),
|
|
11314
|
+
className: `px-2.5 py-1 text-[11px] font-semibold rounded-md transition-all ${view === v ? "bg-[var(--kyro-surface)] shadow-sm border border-[var(--kyro-border)] text-[var(--kyro-text-primary)]" : "text-[var(--kyro-text-secondary)] hover:text-[var(--kyro-text-primary)]"}`,
|
|
11315
|
+
children: v === "edit" ? "Edit" : v === "version" ? "Ver" : "API"
|
|
11316
|
+
},
|
|
11317
|
+
v
|
|
11318
|
+
)) }),
|
|
11319
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 ml-auto shrink-0", children: [
|
|
11320
|
+
onPreview && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: onPreview, className: `${iconBtnClass} max-md:hidden`, title: "Preview", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Eye, { className: "w-3.5 h-3.5" }) }),
|
|
11321
|
+
onViewHistory && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: onViewHistory, className: `${iconBtnClass} max-md:hidden`, title: "View History", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Clock, { className: "w-3.5 h-3.5" }) }),
|
|
11322
|
+
onDuplicate && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: onDuplicate, className: `${iconBtnClass} max-md:hidden`, title: "Duplicate", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Copy, { className: "w-3.5 h-3.5" }) }),
|
|
11323
|
+
onDelete && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: onDelete, className: `${iconBtnClass} hover:bg-[var(--kyro-danger-bg)] hover:text-[var(--kyro-danger)] max-md:hidden`, title: "Delete", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "w-3.5 h-3.5" }) }),
|
|
11324
|
+
onToggleSidebar && /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: onToggleSidebar, className: `${iconBtnClass} max-md:hidden`, title: "Toggle Sidebar", children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
11325
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }),
|
|
11326
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "9", y1: "3", x2: "9", y2: "21" })
|
|
11327
|
+
] }) }),
|
|
11328
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { ref: moreRef, className: "relative md:hidden", children: [
|
|
11329
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: () => setMoreOpen(!moreOpen), className: iconBtnClass, title: "More", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.EllipsisVertical, { className: "w-3.5 h-3.5" }) }),
|
|
11330
|
+
moreOpen && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute right-0 top-full mt-1 w-48 bg-[var(--kyro-surface)] border border-[var(--kyro-border)] rounded-lg shadow-xl z-50 py-1 max-h-[70vh] overflow-y-auto", children: [
|
|
11331
|
+
saveText && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-3 py-2 text-[10px] text-[var(--kyro-text-muted)] border-b border-[var(--kyro-border)] flex items-center gap-1.5", children: [
|
|
11332
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: `w-1.5 h-1.5 rounded-full ${STATUS_DOT[status]}` }),
|
|
11333
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "capitalize", children: status }),
|
|
11334
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "\xB7" }),
|
|
11335
|
+
saveStatus === "saving" && /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: "sm", className: "inline" }),
|
|
11336
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: saveText })
|
|
11337
|
+
] }),
|
|
11338
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex gap-1 px-2 py-2 border-b border-[var(--kyro-border)]", children: tabs.map((v) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
11226
11339
|
"button",
|
|
11227
11340
|
{
|
|
11228
11341
|
type: "button",
|
|
11229
|
-
onClick:
|
|
11230
|
-
|
|
11231
|
-
|
|
11232
|
-
|
|
11233
|
-
|
|
11234
|
-
|
|
11235
|
-
|
|
11236
|
-
|
|
11237
|
-
)
|
|
11342
|
+
onClick: () => {
|
|
11343
|
+
setView(v);
|
|
11344
|
+
setMoreOpen(false);
|
|
11345
|
+
},
|
|
11346
|
+
className: `px-2.5 py-1 text-[11px] font-semibold rounded-md transition-all flex-1 ${view === v ? "bg-[var(--kyro-primary)] text-white" : "text-[var(--kyro-text-muted)] hover:text-[var(--kyro-text-primary)]"}`,
|
|
11347
|
+
children: v === "edit" ? "Edit" : v === "version" ? "Ver" : "API"
|
|
11348
|
+
},
|
|
11349
|
+
v
|
|
11350
|
+
)) }),
|
|
11351
|
+
onViewHistory && /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", onClick: () => {
|
|
11352
|
+
onViewHistory();
|
|
11353
|
+
setMoreOpen(false);
|
|
11354
|
+
}, className: "w-full flex items-center gap-2 px-3 py-2 text-xs text-[var(--kyro-text-primary)] hover:bg-[var(--kyro-surface-accent)] transition-colors", children: [
|
|
11355
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Clock, { className: "w-3.5 h-3.5" }),
|
|
11356
|
+
" View History"
|
|
11357
|
+
] }),
|
|
11358
|
+
onDuplicate && /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", onClick: () => {
|
|
11359
|
+
onDuplicate();
|
|
11360
|
+
setMoreOpen(false);
|
|
11361
|
+
}, className: "w-full flex items-center gap-2 px-3 py-2 text-xs text-[var(--kyro-text-primary)] hover:bg-[var(--kyro-surface-accent)] transition-colors", children: [
|
|
11362
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Copy, { className: "w-3.5 h-3.5" }),
|
|
11363
|
+
" Duplicate"
|
|
11364
|
+
] }),
|
|
11365
|
+
onPreview && /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", onClick: () => {
|
|
11366
|
+
onPreview();
|
|
11367
|
+
setMoreOpen(false);
|
|
11368
|
+
}, className: "w-full flex items-center gap-2 px-3 py-2 text-xs text-[var(--kyro-text-primary)] hover:bg-[var(--kyro-surface-accent)] transition-colors", children: [
|
|
11369
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Eye, { className: "w-3.5 h-3.5" }),
|
|
11370
|
+
" Preview"
|
|
11371
|
+
] }),
|
|
11372
|
+
onDelete && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-[var(--kyro-border)] mt-1 pt-1", children: /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", onClick: () => {
|
|
11373
|
+
onDelete();
|
|
11374
|
+
setMoreOpen(false);
|
|
11375
|
+
}, className: "w-full flex items-center gap-2 px-3 py-2 text-xs text-[var(--kyro-danger)] hover:bg-[var(--kyro-danger-bg)] transition-colors", children: [
|
|
11376
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "w-3.5 h-3.5" }),
|
|
11377
|
+
" Delete"
|
|
11378
|
+
] }) })
|
|
11238
11379
|
] })
|
|
11239
11380
|
] }),
|
|
11240
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "
|
|
11381
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-4 w-px bg-[var(--kyro-border)] mx-0.5" }),
|
|
11382
|
+
status === "draft" && onPublish && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11241
11383
|
"button",
|
|
11242
11384
|
{
|
|
11243
11385
|
type: "button",
|
|
11244
|
-
onClick:
|
|
11245
|
-
|
|
11246
|
-
|
|
11247
|
-
|
|
11248
|
-
|
|
11249
|
-
|
|
11250
|
-
|
|
11251
|
-
|
|
11252
|
-
|
|
11253
|
-
|
|
11254
|
-
|
|
11255
|
-
|
|
11256
|
-
|
|
11257
|
-
|
|
11258
|
-
|
|
11259
|
-
|
|
11260
|
-
|
|
11261
|
-
|
|
11262
|
-
|
|
11263
|
-
|
|
11264
|
-
|
|
11265
|
-
|
|
11266
|
-
|
|
11267
|
-
|
|
11268
|
-
|
|
11269
|
-
|
|
11270
|
-
|
|
11271
|
-
|
|
11272
|
-
|
|
11273
|
-
|
|
11274
|
-
|
|
11275
|
-
children:
|
|
11276
|
-
|
|
11277
|
-
|
|
11278
|
-
|
|
11279
|
-
|
|
11280
|
-
|
|
11281
|
-
|
|
11282
|
-
"button",
|
|
11283
|
-
{
|
|
11284
|
-
type: "button",
|
|
11285
|
-
onClick: onUnpublish,
|
|
11286
|
-
disabled: saveStatus === "saving",
|
|
11287
|
-
className: "kyro-btn kyro-btn-secondary kyro-btn-md flex items-center gap-2 flex-1 justify-center",
|
|
11288
|
-
children: [
|
|
11289
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Undo, { className: "w-4 h-4" }),
|
|
11290
|
-
"Unpublish"
|
|
11291
|
-
]
|
|
11292
|
-
}
|
|
11293
|
-
),
|
|
11294
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11295
|
-
SplitButton,
|
|
11296
|
-
{
|
|
11297
|
-
status,
|
|
11298
|
-
saveStatus,
|
|
11299
|
-
hasChanges,
|
|
11300
|
-
onPublish: onSave,
|
|
11301
|
-
children: [
|
|
11302
|
-
onDuplicate && /* @__PURE__ */ jsxRuntime.jsx(
|
|
11303
|
-
DropdownItem,
|
|
11304
|
-
{
|
|
11305
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Copy, { className: "w-4 h-4" }),
|
|
11306
|
-
children: "Duplicate"
|
|
11307
|
-
}
|
|
11308
|
-
),
|
|
11309
|
-
onViewHistory && /* @__PURE__ */ jsxRuntime.jsx(
|
|
11310
|
-
DropdownItem,
|
|
11311
|
-
{
|
|
11312
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Clock, { className: "w-4 h-4" }),
|
|
11313
|
-
children: "View History"
|
|
11314
|
-
}
|
|
11315
|
-
),
|
|
11316
|
-
onPreview && /* @__PURE__ */ jsxRuntime.jsx(
|
|
11317
|
-
DropdownItem,
|
|
11318
|
-
{
|
|
11319
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Eye, { className: "w-4 h-4" }),
|
|
11320
|
-
children: "Preview"
|
|
11321
|
-
}
|
|
11322
|
-
),
|
|
11323
|
-
(onDuplicate || onViewHistory || onPreview) && /* @__PURE__ */ jsxRuntime.jsx(DropdownSeparator, {}),
|
|
11324
|
-
onDelete && /* @__PURE__ */ jsxRuntime.jsx(
|
|
11325
|
-
DropdownItem,
|
|
11326
|
-
{
|
|
11327
|
-
onClick: onDelete,
|
|
11328
|
-
danger: true,
|
|
11329
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "w-4 h-4" }),
|
|
11330
|
-
children: "Delete"
|
|
11331
|
-
}
|
|
11332
|
-
)
|
|
11333
|
-
]
|
|
11334
|
-
}
|
|
11335
|
-
) })
|
|
11336
|
-
] })
|
|
11337
|
-
] }),
|
|
11338
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "hidden md:flex flex-row items-center justify-between gap-4 py-3 px-6 bg-transparent border-0 static z-40", children: [
|
|
11339
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row items-center gap-4", children: [
|
|
11340
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
11341
|
-
getStatusBadge(),
|
|
11342
|
-
getSaveStatusText() && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11343
|
-
"span",
|
|
11344
|
-
{
|
|
11345
|
-
className: `text-sm ${saveStatus === "error" ? "text-[var(--kyro-error)]" : "text-[var(--kyro-text-muted)]"}`,
|
|
11346
|
-
children: [
|
|
11347
|
-
saveStatus === "saving" ? /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: "sm", className: "inline mr-1" }) : null,
|
|
11348
|
-
getSaveStatusText()
|
|
11349
|
-
]
|
|
11350
|
-
}
|
|
11351
|
-
)
|
|
11352
|
-
] }),
|
|
11353
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-xs space-y-0.5", children: [
|
|
11354
|
-
updatedAt && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-[var(--kyro-text-muted)]", children: [
|
|
11355
|
-
"Updated: ",
|
|
11356
|
-
formatDate2(updatedAt)
|
|
11357
|
-
] }),
|
|
11358
|
-
publishedAt && status === "published" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-[var(--kyro-primary)] font-medium", children: [
|
|
11359
|
-
"Published: ",
|
|
11360
|
-
formatDate2(publishedAt)
|
|
11361
|
-
] })
|
|
11362
|
-
] })
|
|
11363
|
-
] }),
|
|
11364
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
|
|
11365
|
-
status === "draft" && onPublish && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11366
|
-
"button",
|
|
11367
|
-
{
|
|
11368
|
-
type: "button",
|
|
11369
|
-
onClick: onPublish,
|
|
11370
|
-
disabled: saveStatus === "saving",
|
|
11371
|
-
className: "kyro-btn kyro-btn-primary kyro-btn-md flex items-center gap-2",
|
|
11372
|
-
children: [
|
|
11373
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Send, { className: "w-4 h-4" }),
|
|
11374
|
-
"Publish"
|
|
11375
|
-
]
|
|
11376
|
-
}
|
|
11377
|
-
),
|
|
11378
|
-
status === "published" && onUnpublish && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11379
|
-
"button",
|
|
11380
|
-
{
|
|
11381
|
-
type: "button",
|
|
11382
|
-
onClick: onUnpublish,
|
|
11383
|
-
disabled: saveStatus === "saving",
|
|
11384
|
-
className: "kyro-btn kyro-btn-secondary kyro-btn-md flex items-center gap-2",
|
|
11385
|
-
children: [
|
|
11386
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Undo, { className: "w-4 h-4" }),
|
|
11387
|
-
"Unpublish"
|
|
11388
|
-
]
|
|
11389
|
-
}
|
|
11390
|
-
),
|
|
11391
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11392
|
-
SplitButton,
|
|
11393
|
-
{
|
|
11394
|
-
status,
|
|
11395
|
-
saveStatus,
|
|
11396
|
-
hasChanges,
|
|
11397
|
-
onPublish: onSave,
|
|
11398
|
-
children: [
|
|
11399
|
-
onDuplicate && /* @__PURE__ */ jsxRuntime.jsx(
|
|
11400
|
-
DropdownItem,
|
|
11401
|
-
{
|
|
11402
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Copy, { className: "w-4 h-4" }),
|
|
11403
|
-
children: "Duplicate"
|
|
11404
|
-
}
|
|
11405
|
-
),
|
|
11406
|
-
onViewHistory && /* @__PURE__ */ jsxRuntime.jsx(
|
|
11407
|
-
DropdownItem,
|
|
11408
|
-
{
|
|
11409
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Clock, { className: "w-4 h-4" }),
|
|
11410
|
-
children: "View History"
|
|
11411
|
-
}
|
|
11412
|
-
),
|
|
11413
|
-
onPreview && /* @__PURE__ */ jsxRuntime.jsx(
|
|
11414
|
-
DropdownItem,
|
|
11415
|
-
{
|
|
11416
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Eye, { className: "w-4 h-4" }),
|
|
11417
|
-
children: "Preview"
|
|
11418
|
-
}
|
|
11419
|
-
),
|
|
11420
|
-
(onDuplicate || onViewHistory || onPreview) && /* @__PURE__ */ jsxRuntime.jsx(DropdownSeparator, {}),
|
|
11421
|
-
onDelete && /* @__PURE__ */ jsxRuntime.jsx(
|
|
11422
|
-
DropdownItem,
|
|
11423
|
-
{
|
|
11424
|
-
onClick: onDelete,
|
|
11425
|
-
danger: true,
|
|
11426
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "w-4 h-4" }),
|
|
11427
|
-
children: "Delete"
|
|
11428
|
-
}
|
|
11429
|
-
)
|
|
11430
|
-
]
|
|
11431
|
-
}
|
|
11432
|
-
)
|
|
11433
|
-
] })
|
|
11386
|
+
onClick: onPublish,
|
|
11387
|
+
disabled: saveStatus === "saving",
|
|
11388
|
+
className: "kyro-btn kyro-btn-primary kyro-btn-sm flex items-center gap-1 shrink-0",
|
|
11389
|
+
children: [
|
|
11390
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Send, { className: "w-3.5 h-3.5" }),
|
|
11391
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "max-md:hidden", children: "Publish" })
|
|
11392
|
+
]
|
|
11393
|
+
}
|
|
11394
|
+
),
|
|
11395
|
+
status === "published" && onUnpublish && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11396
|
+
"button",
|
|
11397
|
+
{
|
|
11398
|
+
type: "button",
|
|
11399
|
+
onClick: onUnpublish,
|
|
11400
|
+
disabled: saveStatus === "saving",
|
|
11401
|
+
className: "kyro-btn kyro-btn-secondary kyro-btn-sm flex items-center gap-1 shrink-0",
|
|
11402
|
+
children: [
|
|
11403
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Undo, { className: "w-3.5 h-3.5" }),
|
|
11404
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "max-md:hidden", children: "Unpublish" })
|
|
11405
|
+
]
|
|
11406
|
+
}
|
|
11407
|
+
),
|
|
11408
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11409
|
+
SplitButton,
|
|
11410
|
+
{
|
|
11411
|
+
status,
|
|
11412
|
+
saveStatus,
|
|
11413
|
+
hasChanges,
|
|
11414
|
+
onPublish: onSave,
|
|
11415
|
+
children: [
|
|
11416
|
+
onDuplicate && /* @__PURE__ */ jsxRuntime.jsx(DropdownItem, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Copy, { className: "w-4 h-4" }), children: "Duplicate" }),
|
|
11417
|
+
onViewHistory && /* @__PURE__ */ jsxRuntime.jsx(DropdownItem, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Clock, { className: "w-4 h-4" }), children: "View History" }),
|
|
11418
|
+
onPreview && /* @__PURE__ */ jsxRuntime.jsx(DropdownItem, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Eye, { className: "w-4 h-4" }), children: "Preview" }),
|
|
11419
|
+
(onDuplicate || onViewHistory || onPreview) && /* @__PURE__ */ jsxRuntime.jsx(DropdownSeparator, {}),
|
|
11420
|
+
onDelete && /* @__PURE__ */ jsxRuntime.jsx(DropdownItem, { onClick: onDelete, danger: true, icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "w-4 h-4" }), children: "Delete" })
|
|
11421
|
+
]
|
|
11422
|
+
}
|
|
11423
|
+
)
|
|
11434
11424
|
] })
|
|
11435
11425
|
] });
|
|
11436
11426
|
}
|
|
@@ -11654,27 +11644,7 @@ function DetailView({
|
|
|
11654
11644
|
]
|
|
11655
11645
|
}
|
|
11656
11646
|
),
|
|
11657
|
-
|
|
11658
|
-
ActionBar,
|
|
11659
|
-
{
|
|
11660
|
-
status,
|
|
11661
|
-
saveStatus,
|
|
11662
|
-
hasChanges,
|
|
11663
|
-
onSave: () => handleSave(false),
|
|
11664
|
-
onPublish: handlePublish,
|
|
11665
|
-
onUnpublish: status === "published" ? handleUnpublish : void 0,
|
|
11666
|
-
onDuplicate: handleDuplicate,
|
|
11667
|
-
onViewHistory: () => {
|
|
11668
|
-
window.dispatchEvent(new CustomEvent("kyro:show-version-history"));
|
|
11669
|
-
},
|
|
11670
|
-
onPreview: () => window.open(`/preview/${slug}/${documentId}`, "_blank"),
|
|
11671
|
-
onDelete: handleDeleteTrigger,
|
|
11672
|
-
onBack,
|
|
11673
|
-
onToggleSidebar: () => window.dispatchEvent(new CustomEvent("toggle-sidebar")),
|
|
11674
|
-
publishedAt,
|
|
11675
|
-
updatedAt
|
|
11676
|
-
}
|
|
11677
|
-
) }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
11647
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
11678
11648
|
ActionBar,
|
|
11679
11649
|
{
|
|
11680
11650
|
status,
|
|
@@ -11698,7 +11668,7 @@ function DetailView({
|
|
|
11698
11668
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
11699
11669
|
"div",
|
|
11700
11670
|
{
|
|
11701
|
-
className: isSingleLayout ? "w-full
|
|
11671
|
+
className: isSingleLayout ? "w-full pt-4 md:pt-8" : "w-full mx-auto grid grid-cols-1 lg:grid-cols-[1fr_360px] gap-4 md:gap-8 pt-4 md:pt-0",
|
|
11702
11672
|
children: [
|
|
11703
11673
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-4 md:space-y-8 min-w-0", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "surface-tile p-4 md:p-8", children: [
|
|
11704
11674
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-8 px-1", children: [
|