@kyro-cms/admin 0.9.5 → 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.
Files changed (35) hide show
  1. package/dist/index.cjs +659 -684
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.css +54 -51
  4. package/dist/index.css.map +1 -1
  5. package/dist/index.js +660 -685
  6. package/dist/index.js.map +1 -1
  7. package/package.json +2 -2
  8. package/src/components/ActionBar.tsx +172 -292
  9. package/src/components/Admin.tsx +7 -1
  10. package/src/components/AutoForm.tsx +573 -367
  11. package/src/components/DetailView.tsx +22 -47
  12. package/src/components/GraphQLPlayground.tsx +473 -223
  13. package/src/components/ListView.tsx +1 -1
  14. package/src/components/MediaGallery.tsx +2 -2
  15. package/src/components/RestPlayground.tsx +482 -519
  16. package/src/components/blocks/AccordionBlock.tsx +1 -1
  17. package/src/components/blocks/ArrayBlock.tsx +1 -1
  18. package/src/components/blocks/ChildBlocksTree.tsx +6 -6
  19. package/src/components/blocks/CodeBlock.tsx +1 -1
  20. package/src/components/blocks/FileBlock.tsx +1 -1
  21. package/src/components/blocks/HeroBlock.tsx +1 -1
  22. package/src/components/blocks/ListBlock.tsx +1 -1
  23. package/src/components/blocks/RelationshipBlock.tsx +1 -1
  24. package/src/components/blocks/RichTextBlock.tsx +1 -1
  25. package/src/components/blocks/VideoBlock.tsx +1 -1
  26. package/src/components/fields/BlocksField.tsx +5 -5
  27. package/src/components/fields/RichTextField.tsx +3 -1
  28. package/src/components/ui/SplitButton.tsx +1 -1
  29. package/src/components/ui/Toast.tsx +2 -1
  30. package/src/layouts/AdminLayout.astro +16 -1
  31. package/src/pages/graphql-explorer.astro +7 -51
  32. package/src/pages/graphql.astro +7 -119
  33. package/src/pages/index.astro +4 -63
  34. package/src/pages/rest-playground.astro +3 -29
  35. package/src/styles/main.css +53 -43
package/dist/index.cjs CHANGED
@@ -1046,7 +1046,7 @@ function ListView({
1046
1046
  ),
1047
1047
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "surface-tile p-4 flex flex-col lg:flex-row gap-4 items-start lg:items-center", children: [
1048
1048
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex-1 w-full lg:max-w-md", children: [
1049
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "w-4 h-4" }),
1049
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--kyro-text-muted)]" }),
1050
1050
  /* @__PURE__ */ jsxRuntime.jsx(
1051
1051
  "input",
1052
1052
  {
@@ -2756,7 +2756,7 @@ function MediaGallery({
2756
2756
  ] })
2757
2757
  ] }) }),
2758
2758
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 flex flex-col min-h-0 bg-[var(--kyro-bg)]", children: [
2759
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: `flex-1 overflow-y-auto custom-scrollbar ${pickerMode ? "px-2 py-4" : "py-8 px-4"}`, children: loading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5", children: /* @__PURE__ */ jsxRuntime.jsx(Shimmer, { variant: "media-card", count: 12 }) }) : items.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center py-32 text-center", children: [
2759
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: `flex-1 overflow-y-auto custom-scrollbar ${pickerMode ? "px-2 py-4" : "py-4 px-2 md:py-8 md:px-4"}`, children: loading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-2 gap-4 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5", children: /* @__PURE__ */ jsxRuntime.jsx(Shimmer, { variant: "media-card", count: 12 }) }) : items.length === 0 ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center justify-center py-32 text-center", children: [
2760
2760
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-24 h-24 rounded-[2rem] bg-[var(--kyro-surface-accent)] flex items-center justify-center mb-8 rotate-12 group-hover:rotate-0 transition-transform duration-500", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Grid3X3, { className: "w-10 h-10 text-[var(--kyro-text-muted)] opacity-30" }) }),
2761
2761
  /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-xl font-bold text-[var(--kyro-text-primary)] tracking-tight", children: "No assets found" }),
2762
2762
  /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-[var(--kyro-text-secondary)] mt-2 max-w-xs mx-auto text-sm font-medium leading-relaxed", children: "Upload your first file or create a folder to organize your media assets." }),
@@ -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());
@@ -6315,7 +6317,7 @@ var VideoBlock = ({
6315
6317
  {
6316
6318
  type: "button",
6317
6319
  onClick: () => removeBlock(block3.id),
6318
- className: "p-1 hover:bg-red-50 rounded text-red-500",
6320
+ className: "p-1 hover:bg-[var(--kyro-danger-bg)] rounded text-[var(--kyro-danger)]",
6319
6321
  title: "Remove",
6320
6322
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3 h-3" })
6321
6323
  }
@@ -6425,7 +6427,7 @@ var ListBlock = ({
6425
6427
  {
6426
6428
  type: "button",
6427
6429
  onClick: () => removeBlock(block3.id),
6428
- className: "p-1 hover:bg-red-50 rounded text-red-500",
6430
+ className: "p-1 hover:bg-[var(--kyro-danger-bg)] rounded text-[var(--kyro-danger)]",
6429
6431
  title: "Remove",
6430
6432
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3 h-3" })
6431
6433
  }
@@ -6474,7 +6476,7 @@ var CodeBlock = ({
6474
6476
  {
6475
6477
  type: "button",
6476
6478
  onClick: () => removeBlock(block3.id),
6477
- className: "p-1.5 hover:bg-red-500/10 rounded-lg transition-all text-[var(--kyro-text-muted)] hover:text-red-500",
6479
+ className: "p-1.5 hover:bg-[var(--kyro-danger-bg)] rounded-lg transition-all text-[var(--kyro-text-muted)] hover:text-[var(--kyro-danger)]",
6478
6480
  title: "Remove",
6479
6481
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-4 h-4" })
6480
6482
  }
@@ -6573,7 +6575,7 @@ var FileBlock = ({
6573
6575
  {
6574
6576
  type: "button",
6575
6577
  onClick: () => removeBlock(block3.id),
6576
- className: "p-1 hover:bg-red-50 rounded text-red-500",
6578
+ className: "p-1 hover:bg-[var(--kyro-danger-bg)] rounded text-[var(--kyro-danger)]",
6577
6579
  title: "Remove",
6578
6580
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3 h-3" })
6579
6581
  }
@@ -6819,7 +6821,7 @@ var AccordionBlock = ({
6819
6821
  {
6820
6822
  type: "button",
6821
6823
  onClick: () => removeBlock(block3.id),
6822
- className: "p-1 hover:bg-red-50 rounded text-red-500",
6824
+ className: "p-1 hover:bg-[var(--kyro-danger-bg)] rounded text-[var(--kyro-danger)]",
6823
6825
  title: "Remove",
6824
6826
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3 h-3" })
6825
6827
  }
@@ -6871,7 +6873,7 @@ var RichTextBlock = ({
6871
6873
  {
6872
6874
  type: "button",
6873
6875
  onClick: () => removeBlock(block3.id),
6874
- className: "p-1 hover:bg-red-50 rounded text-red-500",
6876
+ className: "p-1 hover:bg-[var(--kyro-danger-bg)] rounded text-[var(--kyro-danger)]",
6875
6877
  title: "Remove",
6876
6878
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3 h-3" })
6877
6879
  }
@@ -7658,7 +7660,7 @@ var ChildBlocksTree = ({
7658
7660
  handleRemoveChild(child.id);
7659
7661
  setConfirmDeleteId(null);
7660
7662
  },
7661
- className: "px-2 py-1 text-xs bg-red-500 text-white rounded hover:bg-red-600",
7663
+ className: "px-2 py-1 text-xs bg-[var(--kyro-danger)] text-white rounded",
7662
7664
  children: "Remove"
7663
7665
  }
7664
7666
  ),
@@ -7681,8 +7683,8 @@ var ChildBlocksTree = ({
7681
7683
  e.stopPropagation();
7682
7684
  setConfirmDeleteId(child.id);
7683
7685
  },
7684
- className: "p-1.5 rounded-md transition-opacity cursor-pointer hover:bg-red-50",
7685
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3.5 h-3.5 text-red-500 invisible group-hover/column:visible" })
7686
+ className: "p-1.5 rounded-md transition-opacity cursor-pointer hover:bg-[var(--kyro-danger-bg)]",
7687
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3.5 h-3.5 text-[var(--kyro-danger)] invisible group-hover/column:visible" })
7686
7688
  }
7687
7689
  )
7688
7690
  ]
@@ -7879,7 +7881,7 @@ var NestedChildBlocks = ({
7879
7881
  handleRemoveChild(child.id);
7880
7882
  setConfirmDeleteId(null);
7881
7883
  },
7882
- className: "px-2 py-1 text-xs bg-red-500 text-white rounded hover:bg-red-600",
7884
+ className: "px-2 py-1 text-xs bg-[var(--kyro-danger)] text-white rounded",
7883
7885
  children: "Remove"
7884
7886
  }
7885
7887
  ),
@@ -7902,8 +7904,8 @@ var NestedChildBlocks = ({
7902
7904
  e.stopPropagation();
7903
7905
  setConfirmDeleteId(child.id);
7904
7906
  },
7905
- className: "p-1.5 rounded-md invisible group-hover:visible transition-opacity cursor-pointer hover:bg-red-50",
7906
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3.5 h-3.5 text-red-500" })
7907
+ className: "p-1.5 rounded-md invisible group-hover:visible transition-opacity cursor-pointer hover:bg-[var(--kyro-danger-bg)]",
7908
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3.5 h-3.5 text-[var(--kyro-danger)]" })
7907
7909
  }
7908
7910
  )
7909
7911
  ]
@@ -8036,7 +8038,7 @@ var HeroBlock = ({
8036
8038
  {
8037
8039
  type: "button",
8038
8040
  onClick: () => removeBlock(block3.id),
8039
- className: "p-1 hover:bg-red-50 rounded text-red-500",
8041
+ className: "p-1 hover:bg-[var(--kyro-danger-bg)] rounded text-[var(--kyro-danger)]",
8040
8042
  title: "Remove",
8041
8043
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3 h-3" })
8042
8044
  }
@@ -8264,7 +8266,7 @@ var ArrayBlock = ({
8264
8266
  {
8265
8267
  type: "button",
8266
8268
  onClick: () => removeBlock(block3.id),
8267
- className: "p-1 hover:bg-red-50 rounded text-red-500",
8269
+ className: "p-1 hover:bg-[var(--kyro-danger-bg)] rounded text-[var(--kyro-danger)]",
8268
8270
  title: "Remove",
8269
8271
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3 h-3" })
8270
8272
  }
@@ -8481,7 +8483,7 @@ var RelationshipBlock = ({
8481
8483
  {
8482
8484
  type: "button",
8483
8485
  onClick: () => removeBlock(block3.id),
8484
- className: "p-1 hover:bg-red-50 rounded text-red-500",
8486
+ className: "p-1 hover:bg-[var(--kyro-danger-bg)] rounded text-[var(--kyro-danger)]",
8485
8487
  title: "Remove",
8486
8488
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3 h-3" })
8487
8489
  }
@@ -8681,7 +8683,7 @@ var SortableBlockComponent = ({
8681
8683
  removeBlock(block3.id);
8682
8684
  setShowDeleteConfirm(false);
8683
8685
  },
8684
- className: "px-1.5 py-0.5 text-[9px] bg-red-500 hover:bg-red-600 text-white rounded font-semibold transition-colors",
8686
+ className: "px-1.5 py-0.5 text-[9px] bg-[var(--kyro-danger)] text-white rounded font-semibold transition-colors hover:brightness-90",
8685
8687
  children: "Remove"
8686
8688
  }
8687
8689
  ),
@@ -8716,7 +8718,7 @@ var SortableBlockComponent = ({
8716
8718
  e.stopPropagation();
8717
8719
  setShowDeleteConfirm(true);
8718
8720
  },
8719
- className: "p-0.5 hover:bg-red-50 hover:text-red-500 rounded text-[var(--kyro-text-muted)] transition-colors",
8721
+ className: "p-0.5 hover:bg-[var(--kyro-danger-bg)] hover:text-[var(--kyro-danger)] rounded text-[var(--kyro-text-muted)] transition-colors",
8720
8722
  title: "Remove",
8721
8723
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3 h-3" })
8722
8724
  }
@@ -8780,7 +8782,7 @@ var SortableBlockComponent = ({
8780
8782
  removeBlock(block3.id);
8781
8783
  setShowDeleteConfirm(false);
8782
8784
  },
8783
- className: "px-2.5 py-1 text-[10px] bg-red-500 hover:bg-red-600 text-white rounded font-semibold transition-colors",
8785
+ className: "px-2.5 py-1 text-[10px] bg-[var(--kyro-danger)] text-white rounded font-semibold transition-colors hover:brightness-90",
8784
8786
  children: "Remove"
8785
8787
  }
8786
8788
  ),
@@ -8817,7 +8819,7 @@ var SortableBlockComponent = ({
8817
8819
  e.stopPropagation();
8818
8820
  setShowDeleteConfirm(true);
8819
8821
  },
8820
- className: "p-1 hover:bg-red-50 hover:text-red-500 rounded text-[var(--kyro-text-muted)] transition-colors",
8822
+ className: "p-1 hover:bg-[var(--kyro-danger-bg)] hover:text-[var(--kyro-danger)] rounded text-[var(--kyro-text-muted)] transition-colors",
8821
8823
  title: "Remove Block",
8822
8824
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3.5 h-3.5" })
8823
8825
  }
@@ -9007,7 +9009,7 @@ var BlocksField = ({
9007
9009
  }
9008
9010
  }
9009
9011
  };
9010
- const activeBlock = activeDrag ? blockCategories.flatMap((cat) => cat.blocks).find((b) => `drawer-${b.type}` === activeDrag.id) || blocks2.find((b) => b.id === activeDrag.id) : null;
9012
+ const activeBlock = activeDrag ? dynamicCategories.flatMap((cat) => cat.blocks).find((b) => `drawer-${b.type}` === activeDrag.id) || blocks2.find((b) => b.id === activeDrag.id) : null;
9011
9013
  activeBlock ? "label" in activeBlock ? activeBlock.label : activeBlock.type : "Block";
9012
9014
  React.useEffect(() => {
9013
9015
  if (!isDropdownOpen) return;
@@ -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,338 +10487,443 @@ 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
- return /* @__PURE__ */ jsxRuntime.jsxs("header", { className: "surface-tile px-3 md:px-8 py-2 md:py-6 flex items-center justify-between max-md:static sticky top-0 z-50 border-b border-[var(--kyro-border)] mb-0 md:mb-8 bg-[var(--kyro-surface)] backdrop-blur-md", children: [
10491
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1 md:gap-2 min-w-0", children: [
10492
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 md:gap-3 flex-wrap min-w-0", children: [
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 md:p-2 border-0 md:border border-[var(--kyro-border)] rounded-xl hover:bg-[var(--kyro-bg-secondary)] transition-colors shrink-0",
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.jsx("h1", { className: "text-lg md:text-xl font-bold tracking-tighter truncate min-w-0", children: docTitle }),
10502
- /* @__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: [
10503
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: `h-1.5 w-1.5 rounded-full ${statusColor}` }),
10504
- statusLabel
10505
- ] })
10506
- ] }),
10507
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-4 text-[11px] font-medium tracking-wide opacity-60 md:ml-12", children: [
10508
- autoSaveStatus === "saving" && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1.5 text-[var(--kyro-text-muted)]", children: [
10509
- /* @__PURE__ */ jsxRuntime.jsxs(
10510
- "svg",
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
- className: "animate-spin h-3 w-3",
10513
- viewBox: "0 0 24 24",
10514
- fill: "none",
10515
- children: [
10516
- /* @__PURE__ */ jsxRuntime.jsx(
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
- "Saving draft..."
10539
- ] }),
10540
- autoSaveStatus === "success" && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[var(--kyro-success)] flex items-center gap-1", children: [
10541
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "w-4 h-4" }),
10542
- lastSavedAt ? `Saved ${Math.floor((Date.now() - lastSavedAt) / 6e4)}m ago` : "Draft saved"
10543
- ] }),
10544
- autoSaveStatus === "retrying" && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[var(--kyro-warning)] flex items-center gap-1.5", children: [
10545
- /* @__PURE__ */ jsxRuntime.jsxs("svg", { className: "animate-spin h-3 w-3", viewBox: "0 0 24 24", fill: "none", children: [
10546
- /* @__PURE__ */ jsxRuntime.jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
10547
- /* @__PURE__ */ jsxRuntime.jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" })
10548
- ] }),
10549
- "Retrying save (",
10550
- retryCount,
10551
- "/5)"
10552
- ] }),
10553
- autoSaveStatus === "offline" && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[var(--kyro-text-muted)] flex items-center gap-1.5", children: [
10554
- /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
10555
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M10.61 10.61a3 3 0 0 0 4.24 4.24" }),
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
- await saveDocument(formData);
10573
- setAutoSaveStatus("success");
10746
+ setFormData(lastSavedData);
10747
+ markSaved();
10574
10748
  },
10575
- className: "text-[var(--kyro-primary)] hover:underline",
10576
- children: "Keep my changes"
10749
+ className: "text-[var(--kyro-primary)] text-[10px] font-medium hover:underline",
10750
+ children: "Revert"
10577
10751
  }
10578
10752
  ),
10579
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "opacity-30", children: "|" }),
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
- window.location.reload();
10586
- },
10587
- className: "text-[var(--kyro-danger)] hover:underline",
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
- hasUnsavedChanges && autoSaveStatus !== "saving" && autoSaveStatus !== "retrying" && autoSaveStatus !== "conflict" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
10593
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "opacity-30", children: "\u2014" }),
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
- setFormData(lastSavedData);
10600
- markSaved();
10774
+ await saveDocument(formData);
10775
+ setAutoSaveStatus("success");
10601
10776
  },
10602
- className: "text-[var(--kyro-primary)] hover:underline",
10603
- children: "Revert changes"
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("div", { className: "max-md:hidden flex items-center gap-6", children: [
10629
- /* @__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(
10630
- "button",
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
- "input",
10798
+ "a",
10776
10799
  {
10777
- type: "datetime-local",
10778
- id: "schedule-datetime",
10779
- className: "kyro-form-input text-xs mb-3 w-full",
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.jsxs("div", { className: "flex items-center gap-2 justify-end", children: [
10784
- /* @__PURE__ */ jsxRuntime.jsx(
10785
- "button",
10786
- {
10787
- type: "button",
10788
- onClick: () => setShowSchedulePicker(false),
10789
- className: "px-3 py-1.5 text-xs kyro-btn rounded-lg",
10790
- children: "Cancel"
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
- const val = document.getElementById("schedule-datetime")?.value;
10799
- if (val) handleSchedulePublish(val);
10819
+ onClick: async () => {
10820
+ setFormData(lastSavedData);
10821
+ markSaved();
10800
10822
  },
10801
- className: "px-3 py-1.5 text-xs kyro-btn-success rounded-lg",
10802
- children: "Schedule"
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
- ] }) })
10807
- ] })
10808
- ] })
10809
- ] });
10810
- };
10811
- const renderEditView = () => {
10812
- if (layout === "single") {
10813
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full space-y-6 md:space-y-8", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "surface-tile p-4 md:p-8 space-y-6 md:space-y-8", children: config.fields.map((f) => renderField(f)) }) });
10814
- }
10815
- const hasSidebarFields = config.fields.some((f) => f.admin?.position === "sidebar") && !showPreview;
10816
- return /* @__PURE__ */ jsxRuntime.jsxs(
10817
- "div",
10818
- {
10819
- className: `w-full mx-auto grid gap-4 md:gap-8 pb-32 transition-all duration-700 ${showPreview ? "grid-cols-1 lg:grid-cols-2" : sidebarCollapsed || !hasSidebarFields ? "grid-cols-1" : "grid-cols-1 lg:grid-cols-[1fr_380px]"}`,
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
+ ] })
10914
+ ] })
10915
+ ] })
10916
+ ] });
10917
+ };
10918
+ const renderEditView = () => {
10919
+ if (layout === "single") {
10920
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full space-y-6 md:space-y-8", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "surface-tile p-4 md:p-8 space-y-6 md:space-y-8", children: config.fields.map((f) => renderField(f)) }) });
10921
+ }
10922
+ const hasSidebarFields = config.fields.some((f) => f.admin?.position === "sidebar") && !showPreview;
10923
+ return /* @__PURE__ */ jsxRuntime.jsxs(
10924
+ "div",
10925
+ {
10926
+ className: `w-full mx-auto grid gap-4 md:gap-8 pb-32 transition-all duration-700 ${showPreview ? "grid-cols-1 lg:grid-cols-2" : sidebarCollapsed || !hasSidebarFields ? "grid-cols-1" : "grid-cols-1 lg:grid-cols-[1fr_380px]"}`,
10820
10927
  children: [
10821
10928
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-6 md:space-y-8 animate-in fade-in slide-in-from-left-4 duration-500", children: config.tabs ? renderField({ type: "tabs", tabs: config.tabs }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "surface-tile p-4 md:p-8 space-y-6 md:space-y-8", children: config.fields.filter(
10822
10929
  (f) => !f.admin?.position || f.admin.position === "main"
@@ -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(jsxRuntime.Fragment, { children: [
10839
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "hidden lg:block surface-tile p-6 space-y-6", children: [
10840
- /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-[10px] font-bold tracking-[0.2em] opacity-40", children: "Settings" }),
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.jsx("div", { className: "col-span-2 text-[var(--kyro-text-primary)] truncate", children: typeof d.newValue === "object" ? JSON.stringify(d.newValue) : String(d.newValue ?? "null") })
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
- const isDraftVersion = v.status === "draft";
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: `grid grid-cols-12 gap-3 px-6 py-3 items-center 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)]"} ${isDraftVersion ? "" : ""}`,
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.jsx("div", { className: "col-span-1 flex items-center gap-2", children: compareMode ? /* @__PURE__ */ jsxRuntime.jsx(
10928
- "div",
10929
- {
10930
- className: `w-4 h-4 rounded-full border ${isSelected ? "border-[var(--kyro-primary)] bg-[var(--kyro-primary)]" : "border-[var(--kyro-border)]"}`,
10931
- children: isSelected && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "w-4 h-4" })
10932
- }
10933
- ) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] font-bold text-[var(--kyro-text-muted)] w-5", children: versions.length - i }) }),
10934
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "col-span-4 min-w-0", children: [
10935
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-[13px] font-medium text-[var(--kyro-text-primary)] truncate flex items-center gap-2", children: [
10936
- v.changeDescription || "Snapshot",
10937
- 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" })
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: "text-[11px] text-[var(--kyro-text-muted)]", children: new Date(v.createdAt).toLocaleString("en-US", {
10940
- month: "short",
10941
- day: "numeric",
10942
- hour: "2-digit",
10943
- minute: "2-digit"
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.jsx("div", { className: "col-span-3", children: v.status && /* @__PURE__ */ jsxRuntime.jsxs(
10947
- "span",
10948
- {
10949
- 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)]"}`,
10950
- children: [
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: `w-1.5 h-1.5 rounded-full ${v.status === "published" ? "bg-[var(--kyro-success)]" : "bg-[var(--kyro-warning)]"}`
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.status
10958
- ]
10959
- }
10960
- ) }),
10961
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-2 text-[11px] text-[var(--kyro-text-muted)]", children: v.createdBy || "system" }),
10962
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-span-2 flex justify-end", children: !compareMode && /* @__PURE__ */ jsxRuntime.jsx(
10963
- "button",
10964
- {
10965
- type: "button",
10966
- onClick: () => handleRestoreVersion(v.id),
10967
- className: "px-3 py-1.5 rounded-lg border border-[var(--kyro-border)] text-[11px] font-bold tracking-wider text-[var(--kyro-text-secondary)] kyro-btn-primary hover:border-[var(--kyro-primary)] transition-all active:scale-95",
10968
- children: "Restore"
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 changes";
11296
+ if (hasChanges) return "Unsaved";
11131
11297
  return null;
11132
11298
  };
11133
- const getStatusBadge = () => {
11134
- const statusConfig2 = {
11135
- draft: {
11136
- label: "Draft",
11137
- class: "bg-gray-100 text-gray-600 border-gray-200",
11138
- icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "w-3 h-3" })
11139
- },
11140
- published: {
11141
- label: "Published",
11142
- class: "bg-green-100 text-green-700 border-green-200",
11143
- icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Send, { className: "w-3 h-3" })
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
- className: `inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-xs font-semibold border ${config.class}`,
11161
- children: [
11162
- config.icon,
11163
- config.label
11164
- ]
11165
- }
11166
- );
11167
- };
11168
- const formatDate2 = (dateStr) => {
11169
- if (!dateStr) return "Never";
11170
- return new Date(dateStr).toLocaleString();
11171
- };
11172
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
11173
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "md:hidden flex flex-col gap-3 py-3 px-4 bg-[var(--kyro-bg)] border-t border-[var(--kyro-border)]", children: [
11174
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
11175
- onBack && /* @__PURE__ */ jsxRuntime.jsx(
11176
- "button",
11177
- {
11178
- type: "button",
11179
- onClick: onBack,
11180
- className: "p-2 rounded-lg hover:bg-[var(--kyro-surface-accent)] text-[var(--kyro-text-secondary)] transition-all",
11181
- 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" }) })
11182
- }
11183
- ),
11184
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 ml-auto", children: [
11185
- onPreview && /* @__PURE__ */ jsxRuntime.jsx(
11186
- "button",
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: onToggleSidebar,
11230
- className: "p-2 rounded-lg hover:bg-[var(--kyro-surface-accent)] text-[var(--kyro-text-secondary)] transition-all",
11231
- title: "Toggle Sidebar",
11232
- children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
11233
- /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }),
11234
- /* @__PURE__ */ jsxRuntime.jsx("line", { x1: "9", y1: "3", x2: "9", y2: "21" })
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: "flex items-center gap-1 bg-[var(--kyro-bg-secondary)] p-0.5 rounded-lg border border-[var(--kyro-border)] self-start", children: ["edit", "version", "api"].map((v) => /* @__PURE__ */ jsxRuntime.jsx(
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: () => setView(v),
11245
- className: `px-4 py-1.5 text-xs 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 hover:opacity-100"}`,
11246
- children: v === "edit" ? "Edit" : v === "version" ? "Version" : "API"
11247
- },
11248
- v
11249
- )) }),
11250
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
11251
- getStatusBadge(),
11252
- getSaveStatusText() && /* @__PURE__ */ jsxRuntime.jsxs(
11253
- "span",
11254
- {
11255
- className: `text-xs ${saveStatus === "error" ? "text-[var(--kyro-error)]" : "text-[var(--kyro-text-muted)]"}`,
11256
- children: [
11257
- saveStatus === "saving" ? /* @__PURE__ */ jsxRuntime.jsx(Spinner, { size: "sm", className: "inline mr-1" }) : null,
11258
- getSaveStatusText()
11259
- ]
11260
- }
11261
- ),
11262
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-[10px] text-[var(--kyro-text-muted)] ml-auto", children: [
11263
- updatedAt && `Updated ${formatDate2(updatedAt)}`,
11264
- publishedAt && status === "published" && ` \xB7 Published ${formatDate2(publishedAt)}`
11265
- ] })
11266
- ] }),
11267
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
11268
- status === "draft" && onPublish && /* @__PURE__ */ jsxRuntime.jsxs(
11269
- "button",
11270
- {
11271
- type: "button",
11272
- onClick: onPublish,
11273
- disabled: saveStatus === "saving",
11274
- className: "kyro-btn kyro-btn-primary kyro-btn-md flex items-center gap-2 flex-1 justify-center",
11275
- children: [
11276
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Send, { className: "w-4 h-4" }),
11277
- "Publish"
11278
- ]
11279
- }
11280
- ),
11281
- status === "published" && onUnpublish && /* @__PURE__ */ jsxRuntime.jsxs(
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
- isSingleLayout ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "md:hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
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 pb-32 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 pb-32",
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: [
@@ -11898,13 +11868,14 @@ function Toast({ type, message, onClose }) {
11898
11868
  onMouseEnter: () => setIsPaused(true),
11899
11869
  onMouseLeave: () => setIsPaused(false),
11900
11870
  children: [
11871
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kyro-toast-accent" }),
11901
11872
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kyro-toast-icon-container", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "w-4 h-4" }) }),
11902
11873
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "kyro-toast-content", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "kyro-toast-message", children: message }) }),
11903
11874
  /* @__PURE__ */ jsxRuntime.jsx(
11904
11875
  "button",
11905
11876
  {
11906
11877
  type: "button",
11907
- className: "kyro-toast-close",
11878
+ className: "kyro-toast-close group-hover:opacity-100 opacity-40 transition-opacity",
11908
11879
  onClick: onClose,
11909
11880
  children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-3.5 h-3.5" })
11910
11881
  }
@@ -14153,7 +14124,11 @@ function Admin({ config, theme = "light", onThemeChange }) {
14153
14124
  }
14154
14125
  };
14155
14126
  window.addEventListener("keydown", handleKeyDown);
14156
- return () => window.removeEventListener("keydown", handleKeyDown);
14127
+ window.openCommandPalette = () => setIsCommandPaletteOpen(true);
14128
+ return () => {
14129
+ window.removeEventListener("keydown", handleKeyDown);
14130
+ delete window.openCommandPalette;
14131
+ };
14157
14132
  }, []);
14158
14133
  if (!authenticated) {
14159
14134
  return /* @__PURE__ */ jsxRuntime.jsx(