@kyro-cms/admin 0.9.4 → 0.9.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import React56, { createContext, lazy, useState, useContext, useRef, useEffect, useCallback, useMemo, Suspense } from 'react';
1
+ import React, { createContext, lazy, useState, useContext, useRef, useEffect, useCallback, useMemo, Suspense } from 'react';
2
2
  import { create, useStore } from 'zustand';
3
3
  import { persist, createJSONStorage } from 'zustand/middleware';
4
- import { GripVertical, Copy, X, Video, Mail, Clock, Database, Users, Tag, Image, Activity, CircleHelp, Sparkles, Blocks, Columns3, Link2, ListOrdered, Box, Heading1, Star, AlignLeft, ChevronDown, File, Code, List, Plus, ChevronRight, ChevronUp, Search, LoaderCircle, Check, RefreshCw, Undo, Redo, Bold, Italic, Underline, Strikethrough, Highlighter, Palette, CheckSquare, Quote, Terminal, Minus, AlignCenter, AlignRight, Link, Minimize2, Maximize2, Grid3X3, FolderPlus, FolderInput, Folder, Trash2, Film, Music, FileText, Archive, Download, Crop, Server, CodeXml, Filter, Pencil, Send, Eye, Info, TriangleAlert, ShieldAlert, CircleCheck, History, CheckCircle2, User, GitCompare, Undo2, ExternalLink, Settings, Shield, Hexagon, Network, Sun, Moon, LogOut, ArrowRight, LayoutDashboard, ArrowUpRight, Webhook, Zap, Pause, Play, Key, Lock, EyeOff, CirclePlay, RefreshCcw, Save, UserPlus, LockOpen } from 'lucide-react';
4
+ import { GripVertical, Copy, X, Video, Mail, Clock, Database, Users, Tag, Image, Activity, CircleHelp, Sparkles, Blocks, Columns3, Link2, ListOrdered, Box, Heading1, Star, AlignLeft, ChevronDown, File, Code, List, Plus, ChevronRight, ChevronUp, Search, LoaderCircle, Check, RefreshCw, Undo, Redo, Bold, Italic, Underline, Strikethrough, Highlighter, Palette, CheckSquare, Quote, Terminal, Minus, AlignCenter, AlignRight, Link, Minimize2, Maximize2, Grid3X3, Filter, FolderPlus, FolderInput, Folder, Trash2, Film, Music, FileText, Archive, Download, Crop, Server, CodeXml, Pencil, Eye, Send, Info, TriangleAlert, ShieldAlert, CircleCheck, History, CheckCircle2, User, GitCompare, Undo2, ExternalLink, Settings, Shield, Hexagon, Network, Sun, Moon, LogOut, ArrowRight, LayoutDashboard, ArrowUpRight, Webhook, Zap, Pause, Play, Key, Lock, EyeOff, CirclePlay, RefreshCcw, Save, UserPlus, LockOpen } from 'lucide-react';
5
5
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
6
6
  import { createPortal } from 'react-dom';
7
7
  import { useEditor, EditorContent } from '@tiptap/react';
@@ -437,6 +437,84 @@ function Shimmer({ variant, count = 1, className = "" }) {
437
437
  i
438
438
  )) });
439
439
  }
440
+ function BackButton({ back }) {
441
+ if (back.href) {
442
+ return /* @__PURE__ */ jsx(
443
+ "a",
444
+ {
445
+ href: back.href,
446
+ onClick: (e) => {
447
+ if (back.onClick) {
448
+ e.preventDefault();
449
+ back.onClick();
450
+ }
451
+ },
452
+ className: "p-1.5 rounded-lg hover:bg-[var(--kyro-surface-accent)] text-[var(--kyro-text-secondary)] transition-all",
453
+ children: /* @__PURE__ */ jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", children: /* @__PURE__ */ jsx("path", { d: "M19 12H5M12 19l-7-7 7-7" }) })
454
+ }
455
+ );
456
+ }
457
+ return /* @__PURE__ */ jsx(
458
+ "button",
459
+ {
460
+ type: "button",
461
+ onClick: back.onClick,
462
+ className: "p-1.5 rounded-lg hover:bg-[var(--kyro-surface-accent)] text-[var(--kyro-text-secondary)] transition-all",
463
+ children: /* @__PURE__ */ jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", children: /* @__PURE__ */ jsx("path", { d: "M19 12H5M12 19l-7-7 7-7" }) })
464
+ }
465
+ );
466
+ }
467
+ function DesktopBreadcrumbs({ breadcrumbs }) {
468
+ return breadcrumbs?.map((crumb, i) => /* @__PURE__ */ jsxs(React.Fragment, { children: [
469
+ i > 0 && /* @__PURE__ */ jsx("span", { className: "opacity-20 text-[10px]", children: "/" }),
470
+ crumb.href || crumb.onClick ? /* @__PURE__ */ jsx(
471
+ "a",
472
+ {
473
+ href: crumb.href,
474
+ onClick: (e) => {
475
+ if (crumb.onClick) {
476
+ e.preventDefault();
477
+ crumb.onClick();
478
+ }
479
+ },
480
+ className: "text-[10px] font-bold tracking-widest text-[var(--kyro-text-secondary)] hover:text-[var(--kyro-primary)] transition-all",
481
+ children: crumb.label
482
+ }
483
+ ) : /* @__PURE__ */ jsx("span", { className: "text-[10px] font-bold tracking-widest opacity-40", children: crumb.label })
484
+ ] }, i));
485
+ }
486
+ function ActionsSlot({ actions }) {
487
+ if (Array.isArray(actions)) {
488
+ return /* @__PURE__ */ jsx("div", { className: "flex items-center gap-3", children: actions.map((act, i) => /* @__PURE__ */ jsxs(
489
+ "button",
490
+ {
491
+ type: "button",
492
+ onClick: act.onClick,
493
+ className: `flex items-center gap-2 px-6 py-2.5 rounded-xl font-bold text-sm transition-all shadow-lg shadow-[var(--kyro-primary)]/10 ${act.variant === "outline" ? "border border-[var(--kyro-border)] text-[var(--kyro-text-secondary)] hover:bg-[var(--kyro-surface-accent)]" : act.variant === "ghost" ? "text-[var(--kyro-text-secondary)] hover:bg-[var(--kyro-surface-accent)] shadow-none" : "kyro-btn-primary hover:opacity-90"} ${act.className || ""}`,
494
+ children: [
495
+ act.icon && /* @__PURE__ */ jsx(act.icon, { className: "w-4 h-4" }),
496
+ act.label
497
+ ]
498
+ },
499
+ i
500
+ )) });
501
+ }
502
+ return /* @__PURE__ */ jsx(Fragment, { children: actions });
503
+ }
504
+ function SingleAction({ action }) {
505
+ return /* @__PURE__ */ jsxs(
506
+ "button",
507
+ {
508
+ type: "button",
509
+ onClick: action.onClick,
510
+ className: `kyro-btn kyro-btn-primary flex items-center gap-2 px-6 py-2.5 rounded-xl font-bold text-sm hover:opacity-90 transition-all shadow-lg shadow-[var(--kyro-primary)]/10 w-full lg:w-auto justify-center ${action.className || ""}`,
511
+ children: [
512
+ action.icon && /* @__PURE__ */ jsx(action.icon, { className: "w-4 h-4" }),
513
+ action.label
514
+ ]
515
+ }
516
+ );
517
+ }
440
518
  function PageHeader({
441
519
  title,
442
520
  description,
@@ -448,80 +526,79 @@ function PageHeader({
448
526
  actions,
449
527
  children
450
528
  }) {
451
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-col lg:flex-row lg:items-center surface-tile justify-between gap-6 pt-4 mb-8", children: [
452
- /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
453
- (breadcrumbs || back) && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-3", children: [
454
- back && /* @__PURE__ */ jsx(
455
- "a",
456
- {
457
- href: back.href,
458
- onClick: (e) => {
459
- if (back.onClick) {
460
- e.preventDefault();
461
- back.onClick();
462
- }
463
- },
464
- className: "p-1.5 rounded-lg hover:bg-[var(--kyro-surface-accent)] text-[var(--kyro-text-secondary)] transition-all",
465
- children: /* @__PURE__ */ jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", children: /* @__PURE__ */ jsx("path", { d: "M19 12H5M12 19l-7-7 7-7" }) })
466
- }
467
- ),
468
- breadcrumbs?.map((crumb, i) => /* @__PURE__ */ jsxs(React56.Fragment, { children: [
469
- i > 0 && /* @__PURE__ */ jsx("span", { className: "opacity-20 text-[10px]", children: "/" }),
470
- crumb.href || crumb.onClick ? /* @__PURE__ */ jsx(
471
- "a",
472
- {
473
- href: crumb.href,
474
- onClick: (e) => {
475
- if (crumb.onClick) {
476
- e.preventDefault();
477
- crumb.onClick();
529
+ const lastBreadcrumb = breadcrumbs?.[breadcrumbs.length - 1];
530
+ return /* @__PURE__ */ jsxs("div", { className: "surface-tile px-3 md:px-6 py-3 md:pt-4 mb-4 md:mb-8", children: [
531
+ /* @__PURE__ */ jsxs("div", { className: "md:hidden space-y-2", children: [
532
+ (breadcrumbs || back) && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
533
+ back && /* @__PURE__ */ jsx(BackButton, { back }),
534
+ /* @__PURE__ */ jsxs("details", { className: "group [&::-webkit-details-marker]:hidden flex-1 min-w-0", children: [
535
+ /* @__PURE__ */ jsxs("summary", { className: "flex items-center gap-2 cursor-pointer list-none", children: [
536
+ /* @__PURE__ */ jsx("span", { className: "flex-1 text-[10px] font-bold tracking-widest text-[var(--kyro-text-secondary)] truncate", children: lastBreadcrumb?.label || "" }),
537
+ /* @__PURE__ */ jsx("svg", { className: "w-3 h-3 text-[var(--kyro-text-secondary)] opacity-40 group-open:rotate-180 transition-transform", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", children: /* @__PURE__ */ jsx("path", { d: "M6 9l6 6 6-6" }) })
538
+ ] }),
539
+ /* @__PURE__ */ jsxs("div", { className: "mt-2 pt-2 border-t border-[var(--kyro-border)] space-y-2", children: [
540
+ breadcrumbs && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: breadcrumbs.map((crumb, i) => /* @__PURE__ */ jsxs(React.Fragment, { children: [
541
+ i > 0 && /* @__PURE__ */ jsx("span", { className: "opacity-20 text-[10px]", children: "/" }),
542
+ crumb.href || crumb.onClick ? /* @__PURE__ */ jsx(
543
+ "a",
544
+ {
545
+ href: crumb.href,
546
+ onClick: (e) => {
547
+ if (crumb.onClick) {
548
+ e.preventDefault();
549
+ crumb.onClick();
550
+ }
551
+ },
552
+ className: "text-[10px] font-bold tracking-widest text-[var(--kyro-text-secondary)] hover:text-[var(--kyro-primary)] transition-all",
553
+ children: crumb.label
478
554
  }
479
- },
480
- className: "text-[10px] font-bold tracking-widest text-[var(--kyro-text-secondary)] hover:text-[var(--kyro-primary)] transition-all",
481
- children: crumb.label
482
- }
483
- ) : /* @__PURE__ */ jsx("span", { className: "text-[10px] font-bold tracking-widest opacity-40", children: crumb.label })
484
- ] }, i))
555
+ ) : /* @__PURE__ */ jsx("span", { className: "text-[10px] font-bold tracking-widest opacity-40", children: crumb.label })
556
+ ] }, i)) }),
557
+ metadata && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 flex-wrap", children: metadata.map((item, i) => /* @__PURE__ */ jsx(React.Fragment, { children: item }, i)) }),
558
+ children
559
+ ] })
560
+ ] })
485
561
  ] }),
486
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
487
- Icon && /* @__PURE__ */ jsx(Icon, { className: "w-6 h-6 text-[var(--kyro-primary)]" }),
488
- title && /* @__PURE__ */ jsx("h1", { className: "text-xl font-bold tracking-tighter text-[var(--kyro-text-primary)] truncate", children: title })
562
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
563
+ Icon && /* @__PURE__ */ jsx(Icon, { className: "w-5 h-5 text-[var(--kyro-primary)] shrink-0" }),
564
+ title && /* @__PURE__ */ jsx("h1", { className: "text-lg font-bold tracking-tighter text-[var(--kyro-text-primary)] truncate", children: title }),
565
+ metadata && !description && /* @__PURE__ */ jsx("span", { className: "h-2 w-2 rounded-full bg-[var(--kyro-primary)] shrink-0" })
489
566
  ] }),
490
- description && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mt-1", children: [
491
- /* @__PURE__ */ jsx("p", { className: "text-[var(--kyro-text-secondary)] font-medium opacity-60 line-clamp-1", children: description }),
492
- metadata && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: metadata.map((item, i) => /* @__PURE__ */ jsxs(React56.Fragment, { children: [
567
+ description && /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-x-2 gap-y-1", children: [
568
+ /* @__PURE__ */ jsx("p", { className: "text-[var(--kyro-text-secondary)] font-medium opacity-60 line-clamp-1 min-w-0 text-xs", children: description }),
569
+ metadata && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: metadata.map((item, i) => /* @__PURE__ */ jsxs(React.Fragment, { children: [
493
570
  i === 0 && /* @__PURE__ */ jsx("span", { className: "opacity-20 ml-1", children: "\xB7" }),
494
571
  item
495
- ] }, i)) }),
496
- children
572
+ ] }, i)) })
497
573
  ] })
498
574
  ] }),
499
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
500
- actions && (Array.isArray(actions) ? /* @__PURE__ */ jsx("div", { className: "flex items-center gap-3", children: actions.map((act, i) => /* @__PURE__ */ jsxs(
501
- "button",
502
- {
503
- type: "button",
504
- onClick: act.onClick,
505
- className: `flex items-center gap-2 px-6 py-2.5 rounded-xl font-bold text-sm transition-all shadow-lg shadow-[var(--kyro-primary)]/10 ${act.variant === "outline" ? "border border-[var(--kyro-border)] text-[var(--kyro-text-secondary)] hover:bg-[var(--kyro-surface-accent)]" : act.variant === "ghost" ? "text-[var(--kyro-text-secondary)] hover:bg-[var(--kyro-surface-accent)] shadow-none" : "kyro-btn-primary hover:opacity-90"} ${act.className || ""}`,
506
- children: [
507
- act.icon && /* @__PURE__ */ jsx(act.icon, { className: "w-4 h-4" }),
508
- act.label
509
- ]
510
- },
511
- i
512
- )) }) : actions),
513
- action && /* @__PURE__ */ jsxs(
514
- "button",
515
- {
516
- type: "button",
517
- onClick: action.onClick,
518
- className: `kyro-btn kyro-btn-primary flex items-center gap-2 px-6 py-2.5 rounded-xl font-bold text-sm hover:opacity-90 transition-all shadow-lg shadow-[var(--kyro-primary)]/10 ${action.className || ""}`,
519
- children: [
520
- action.icon && /* @__PURE__ */ jsx(action.icon, { className: "w-4 h-4" }),
521
- action.label
522
- ]
523
- }
524
- )
575
+ /* @__PURE__ */ jsxs("div", { className: "hidden md:flex md:flex-row md:items-center justify-between gap-6", children: [
576
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
577
+ (breadcrumbs || back) && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-3", children: [
578
+ back && /* @__PURE__ */ jsx(BackButton, { back }),
579
+ breadcrumbs && /* @__PURE__ */ jsx(DesktopBreadcrumbs, { breadcrumbs })
580
+ ] }),
581
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
582
+ Icon && /* @__PURE__ */ jsx(Icon, { className: "w-6 h-6 text-[var(--kyro-primary)]" }),
583
+ title && /* @__PURE__ */ jsx("h1", { className: "text-xl font-bold tracking-tighter text-[var(--kyro-text-primary)] truncate", children: title })
584
+ ] }),
585
+ (description || metadata) && /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-x-2 gap-y-1 mt-1", children: [
586
+ description && /* @__PURE__ */ jsx("p", { className: "text-[var(--kyro-text-secondary)] font-medium opacity-60 line-clamp-1 min-w-0", children: description }),
587
+ metadata && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: metadata.map((item, i) => /* @__PURE__ */ jsxs(React.Fragment, { children: [
588
+ i === 0 && (description || i > 0) && /* @__PURE__ */ jsx("span", { className: "opacity-20 ml-1", children: "\xB7" }),
589
+ item
590
+ ] }, i)) }),
591
+ children
592
+ ] })
593
+ ] }),
594
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 flex-wrap shrink-0", children: [
595
+ actions && /* @__PURE__ */ jsx(ActionsSlot, { actions }),
596
+ action && /* @__PURE__ */ jsx(SingleAction, { action })
597
+ ] })
598
+ ] }),
599
+ (actions || action) && /* @__PURE__ */ jsxs("div", { className: "md:hidden flex items-center gap-2 mt-3 pt-3 border-t border-[var(--kyro-border)]", children: [
600
+ action && /* @__PURE__ */ jsx(SingleAction, { action }),
601
+ actions && /* @__PURE__ */ jsx(ActionsSlot, { actions })
525
602
  ] })
526
603
  ] });
527
604
  }
@@ -583,7 +660,7 @@ function Button({
583
660
  }
584
661
  function Pagination({ page, totalPages, totalDocs, limit, onPageChange, onLimitChange }) {
585
662
  if (totalPages <= 1) return null;
586
- return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-4 py-3 border-t border-[var(--kyro-border)]", children: [
663
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col sm:flex-row items-center justify-between gap-3 px-4 py-3 border-t border-[var(--kyro-border)]", children: [
587
664
  totalDocs !== void 0 && limit ? /* @__PURE__ */ jsxs("span", { className: "text-xs text-[var(--kyro-text-secondary)] font-medium", children: [
588
665
  "Showing ",
589
666
  (page - 1) * limit + 1,
@@ -592,7 +669,7 @@ function Pagination({ page, totalPages, totalDocs, limit, onPageChange, onLimitC
592
669
  " of ",
593
670
  totalDocs
594
671
  ] }) : /* @__PURE__ */ jsx("span", {}),
595
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
672
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 flex-wrap justify-center", children: [
596
673
  onLimitChange && /* @__PURE__ */ jsxs(
597
674
  "select",
598
675
  {
@@ -947,7 +1024,7 @@ function ListView({
947
1024
  }
948
1025
  ),
949
1026
  /* @__PURE__ */ jsxs("div", { className: "surface-tile p-4 flex flex-col lg:flex-row gap-4 items-start lg:items-center", children: [
950
- /* @__PURE__ */ jsxs("div", { className: "relative flex-1 max-w-md", children: [
1027
+ /* @__PURE__ */ jsxs("div", { className: "relative flex-1 w-full lg:max-w-md", children: [
951
1028
  /* @__PURE__ */ jsx(Search, { className: "w-4 h-4" }),
952
1029
  /* @__PURE__ */ jsx(
953
1030
  "input",
@@ -1140,7 +1217,7 @@ function ListView({
1140
1217
  }
1141
1218
  )
1142
1219
  ] }) : /* @__PURE__ */ jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs("table", { className: "w-full text-left", children: [
1143
- /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { className: "text-[var(--kyro-text-secondary)] font-bold text-[10px] tracking-[0.3em] border-b border-[var(--kyro-border)]", children: [
1220
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { className: "text-[var(--kyro-text-secondary)] font-bold text-[10px] tracking-[0.3em] border-b border-[var(--kyro-border)] whitespace-nowrap", children: [
1144
1221
  /* @__PURE__ */ jsx("th", { className: "px-4 py-4 w-10", children: /* @__PURE__ */ jsx(
1145
1222
  "input",
1146
1223
  {
@@ -1933,10 +2010,10 @@ function SlidePanel({
1933
2010
  };
1934
2011
  }, [open, onClose]);
1935
2012
  const widthClasses = {
1936
- sm: "w-[320px]",
1937
- md: "w-[400px]",
1938
- lg: "w-[550px]",
1939
- xl: "w-[700px]"
2013
+ sm: "w-full sm:w-[320px]",
2014
+ md: "w-full sm:w-[400px]",
2015
+ lg: "w-full sm:w-[550px]",
2016
+ xl: "w-full sm:w-[700px]"
1940
2017
  };
1941
2018
  if (!open || !hydrated) return null;
1942
2019
  return createPortal(
@@ -2236,6 +2313,7 @@ function MediaGallery({
2236
2313
  {}
2237
2314
  );
2238
2315
  const [showNewFolderModal, setShowNewFolderModal] = useState(false);
2316
+ const [showMobileFilters, setShowMobileFilters] = useState(false);
2239
2317
  const [storageConfigured, setStorageConfigured] = useState(null);
2240
2318
  const [storageChecked, setStorageChecked] = useState(false);
2241
2319
  const [showStorageConfigModal, setShowStorageConfigModal] = useState(false);
@@ -2389,6 +2467,7 @@ function MediaGallery({
2389
2467
  await apiPost("/api/media/folders", { name });
2390
2468
  loadFolders();
2391
2469
  setShowNewFolderModal(false);
2470
+ toast.success(`Folder "${name}" created`);
2392
2471
  } catch (error) {
2393
2472
  console.error("Failed to create folder:", error);
2394
2473
  toast.error("Failed to create folder");
@@ -2406,6 +2485,7 @@ function MediaGallery({
2406
2485
  if (currentFolder === folder) setCurrentFolder("");
2407
2486
  loadFolders();
2408
2487
  loadMedia();
2488
+ toast.success(`Folder "${folder}" deleted`);
2409
2489
  } catch (error) {
2410
2490
  console.error("Failed to delete folder:", error);
2411
2491
  toast.error("Failed to delete folder");
@@ -2420,8 +2500,10 @@ function MediaGallery({
2420
2500
  if (panelItem?.id === id) {
2421
2501
  setPanelItem(result.doc);
2422
2502
  }
2503
+ toast.success("Metadata updated");
2423
2504
  } catch (error) {
2424
2505
  console.error("Failed to update metadata:", error);
2506
+ toast.error("Failed to update metadata");
2425
2507
  }
2426
2508
  };
2427
2509
  const onImageLoad = (e) => {
@@ -2470,6 +2552,7 @@ function MediaGallery({
2470
2552
  await apiUpload("/api/media", formData);
2471
2553
  loadMedia();
2472
2554
  setShowCrop(false);
2555
+ toast.success("Cropped image saved");
2473
2556
  }
2474
2557
  }
2475
2558
  } catch (err) {
@@ -2505,7 +2588,7 @@ function MediaGallery({
2505
2588
  }
2506
2589
  },
2507
2590
  children: [
2508
- /* @__PURE__ */ jsxs("div", { className: `flex flex-col lg:flex-row lg:items-center justify-between gap-6 border-b border-[var(--kyro-border)] backdrop-blur-md sticky top-0 z-40 ${pickerMode ? "p-2" : "p-6 rounded-xl surface-tile"}`, children: [
2591
+ /* @__PURE__ */ jsxs("div", { className: `flex flex-col lg:flex-row lg:items-center justify-between gap-6 border-b border-[var(--kyro-border)] backdrop-blur-md sticky top-0 ${pickerMode ? "p-2" : "p-6 rounded-xl surface-tile"}`, children: [
2509
2592
  !pickerMode && /* @__PURE__ */ jsx("div", { className: "flex items-center gap-4", children: /* @__PURE__ */ jsxs("div", { children: [
2510
2593
  /* @__PURE__ */ jsx("h2", { className: "text-xl font-bold tracking-tighter text-[var(--kyro-text-primary)]", children: "Media Library" }),
2511
2594
  /* @__PURE__ */ jsx("div", { className: "flex items-center gap-3 mt-1", children: /* @__PURE__ */ jsxs("span", { className: "text-[10px] font-bold tracking-widest text-[var(--kyro-text-secondary)] opacity-50", children: [
@@ -2516,7 +2599,7 @@ function MediaGallery({
2516
2599
  ] }) }),
2517
2600
  /* @__PURE__ */ jsxs("div", { className: `flex items-center gap-3 flex-wrap lg:flex-nowrap ${pickerMode ? "w-full" : ""}`, children: [
2518
2601
  /* @__PURE__ */ jsxs("div", { className: "relative group flex-1 min-w-[200px]", children: [
2519
- /* @__PURE__ */ jsx(Search, { className: "w-4 h-4" }),
2602
+ /* @__PURE__ */ jsx(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--kyro-text-muted)]" }),
2520
2603
  /* @__PURE__ */ jsx(
2521
2604
  "input",
2522
2605
  {
@@ -2529,21 +2612,31 @@ function MediaGallery({
2529
2612
  )
2530
2613
  ] }),
2531
2614
  !pickerMode && /* @__PURE__ */ jsxs(Fragment, { children: [
2532
- /* @__PURE__ */ jsxs("div", { className: "flex bg-[var(--kyro-surface-accent)] p-1 rounded-xl border border-[var(--kyro-border)]", children: [
2533
- /* @__PURE__ */ jsx(
2534
- "button",
2535
- {
2536
- onClick: () => setView("grid"),
2537
- className: `p-2 rounded-lg transition-all ${view === "grid" ? "bg-[var(--kyro-surface)] shadow-sm text-[var(--kyro-text-primary)]" : "text-[var(--kyro-text-secondary)] opacity-50 hover:opacity-100"}`,
2538
- children: /* @__PURE__ */ jsx(Grid3X3, { className: "w-4 h-4" })
2539
- }
2540
- ),
2615
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
2616
+ /* @__PURE__ */ jsxs("div", { className: "flex bg-[var(--kyro-surface-accent)] p-1 rounded-xl border border-[var(--kyro-border)]", children: [
2617
+ /* @__PURE__ */ jsx(
2618
+ "button",
2619
+ {
2620
+ onClick: () => setView("grid"),
2621
+ className: `p-2 rounded-lg transition-all ${view === "grid" ? "bg-[var(--kyro-surface)] shadow-sm text-[var(--kyro-text-primary)]" : "text-[var(--kyro-text-secondary)] opacity-50 hover:opacity-100"}`,
2622
+ children: /* @__PURE__ */ jsx(Grid3X3, { className: "w-4 h-4" })
2623
+ }
2624
+ ),
2625
+ /* @__PURE__ */ jsx(
2626
+ "button",
2627
+ {
2628
+ onClick: () => setView("list"),
2629
+ className: `p-2 rounded-lg transition-all ${view === "list" ? "bg-[var(--kyro-surface)] shadow-sm text-[var(--kyro-text-primary)]" : "text-[var(--kyro-text-secondary)] opacity-50 hover:opacity-100"}`,
2630
+ children: /* @__PURE__ */ jsx(File, { className: "w-4 h-4" })
2631
+ }
2632
+ )
2633
+ ] }),
2541
2634
  /* @__PURE__ */ jsx(
2542
2635
  "button",
2543
2636
  {
2544
- onClick: () => setView("list"),
2545
- className: `p-2 rounded-lg transition-all ${view === "list" ? "bg-[var(--kyro-surface)] shadow-sm text-[var(--kyro-text-primary)]" : "text-[var(--kyro-text-secondary)] opacity-50 hover:opacity-100"}`,
2546
- children: /* @__PURE__ */ jsx(File, { className: "w-4 h-4" })
2637
+ onClick: () => setShowMobileFilters(true),
2638
+ className: "md:hidden p-2 rounded-xl bg-[var(--kyro-surface-accent)] border border-[var(--kyro-border)] text-[var(--kyro-text-secondary)] hover:text-[var(--kyro-text-primary)] transition-colors",
2639
+ children: /* @__PURE__ */ jsx(Filter, { className: "w-4 h-4" })
2547
2640
  }
2548
2641
  )
2549
2642
  ] }),
@@ -2842,6 +2935,105 @@ function MediaGallery({
2842
2935
  )
2843
2936
  ] })
2844
2937
  ] }),
2938
+ showMobileFilters && !pickerMode && /* @__PURE__ */ jsxs("div", { className: "fixed inset-0 z-[70] md:hidden", children: [
2939
+ /* @__PURE__ */ jsx(
2940
+ "div",
2941
+ {
2942
+ className: "fixed inset-0 bg-black/50 backdrop-blur-sm",
2943
+ onClick: () => setShowMobileFilters(false)
2944
+ }
2945
+ ),
2946
+ /* @__PURE__ */ jsxs("div", { className: "fixed bottom-0 left-0 right-0 bg-[var(--kyro-surface)] rounded-t-3xl shadow-2xl max-h-[70vh] overflow-y-auto animate-in slide-in-from-bottom-12 duration-300", children: [
2947
+ /* @__PURE__ */ jsxs("div", { className: "sticky top-0 bg-[var(--kyro-surface)] z-10 flex items-center justify-between p-6 pb-4 border-b border-[var(--kyro-border)]", children: [
2948
+ /* @__PURE__ */ jsx("h3", { className: "text-sm font-bold tracking-tight text-[var(--kyro-text-primary)]", children: "Filters" }),
2949
+ /* @__PURE__ */ jsx(
2950
+ "button",
2951
+ {
2952
+ onClick: () => setShowMobileFilters(false),
2953
+ className: "p-2 rounded-xl hover:bg-[var(--kyro-surface-accent)] transition-colors text-[var(--kyro-text-muted)]",
2954
+ children: /* @__PURE__ */ jsx(X, { className: "w-4 h-4" })
2955
+ }
2956
+ )
2957
+ ] }),
2958
+ /* @__PURE__ */ jsxs("div", { className: "p-6 space-y-8", children: [
2959
+ /* @__PURE__ */ jsxs("div", { children: [
2960
+ /* @__PURE__ */ jsx("span", { className: "text-[10px] font-bold tracking-[0.2em] text-[var(--kyro-text-secondary)] opacity-40 block mb-4", children: "Quick Filters" }),
2961
+ /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: ["all", "image", "video", "audio", "document", "archive"].map((t) => /* @__PURE__ */ jsx(
2962
+ "button",
2963
+ {
2964
+ onClick: () => {
2965
+ setFilter(t);
2966
+ setShowMobileFilters(false);
2967
+ },
2968
+ className: `px-4 py-2 rounded-xl text-[11px] font-bold capitalize transition-all border ${filter === t ? "bg-[var(--kyro-sidebar-active)] text-[var(--kyro-sidebar-text-active)] border-transparent" : "bg-[var(--kyro-surface-accent)] text-[var(--kyro-text-secondary)] border-[var(--kyro-border)] hover:border-[var(--kyro-text-muted)]"}`,
2969
+ children: t
2970
+ },
2971
+ t
2972
+ )) })
2973
+ ] }),
2974
+ /* @__PURE__ */ jsxs("div", { children: [
2975
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-4", children: [
2976
+ /* @__PURE__ */ jsx("span", { className: "text-[10px] font-bold tracking-[0.2em] text-[var(--kyro-text-secondary)] opacity-40", children: "Folders" }),
2977
+ /* @__PURE__ */ jsx(
2978
+ "button",
2979
+ {
2980
+ onClick: () => {
2981
+ setShowNewFolderModal(true);
2982
+ setShowMobileFilters(false);
2983
+ },
2984
+ className: "p-1.5 hover:bg-[var(--kyro-surface-accent)] rounded-lg transition-colors text-[var(--kyro-text-primary)]",
2985
+ children: /* @__PURE__ */ jsx(FolderPlus, { className: "w-4 h-4" })
2986
+ }
2987
+ )
2988
+ ] }),
2989
+ /* @__PURE__ */ jsxs("nav", { className: "space-y-1", children: [
2990
+ /* @__PURE__ */ jsxs(
2991
+ "button",
2992
+ {
2993
+ onClick: () => {
2994
+ setCurrentFolder("");
2995
+ setShowMobileFilters(false);
2996
+ },
2997
+ className: `w-full flex items-center gap-3 px-4 py-2.5 rounded-xl text-xs font-bold transition-all ${currentFolder === "" ? "bg-[var(--kyro-sidebar-active)] text-[var(--kyro-sidebar-text-active)] shadow-md" : "text-[var(--kyro-text-secondary)] hover:bg-[var(--kyro-surface-accent)] hover:text-[var(--kyro-text-primary)]"}`,
2998
+ children: [
2999
+ /* @__PURE__ */ jsx(FolderInput, { className: "w-4 h-4 opacity-70" }),
3000
+ "All Assets"
3001
+ ]
3002
+ }
3003
+ ),
3004
+ folders.map((folder) => /* @__PURE__ */ jsxs("div", { className: "group relative", children: [
3005
+ /* @__PURE__ */ jsxs(
3006
+ "button",
3007
+ {
3008
+ onClick: () => {
3009
+ setCurrentFolder(folder);
3010
+ setShowMobileFilters(false);
3011
+ },
3012
+ className: `w-full flex items-center gap-3 px-4 py-2.5 rounded-xl text-xs font-bold transition-all ${currentFolder === folder ? "bg-[var(--kyro-sidebar-active)] text-[var(--kyro-sidebar-text-active)] shadow-md" : "text-[var(--kyro-text-secondary)] hover:bg-[var(--kyro-surface-accent)] hover:text-[var(--kyro-text-primary)]"}`,
3013
+ children: [
3014
+ /* @__PURE__ */ jsx("div", { className: "w-4 h-4 flex items-center justify-center opacity-70", children: /* @__PURE__ */ jsx(Folder, { fill: currentFolder === folder ? "currentColor" : "none" }) }),
3015
+ folder
3016
+ ]
3017
+ }
3018
+ ),
3019
+ /* @__PURE__ */ jsx(
3020
+ "button",
3021
+ {
3022
+ onClick: (e) => {
3023
+ e.stopPropagation();
3024
+ handleDeleteFolder(folder);
3025
+ setShowMobileFilters(false);
3026
+ },
3027
+ className: "absolute right-2 top-1/2 -translate-y-1/2 p-1.5 text-red-500 opacity-0 group-hover:opacity-100 transition-all hover:bg-red-50 rounded-lg",
3028
+ children: /* @__PURE__ */ jsx(Trash2, { className: "w-3.5 h-3.5" })
3029
+ }
3030
+ )
3031
+ ] }, folder))
3032
+ ] })
3033
+ ] })
3034
+ ] })
3035
+ ] })
3036
+ ] }),
2845
3037
  /* @__PURE__ */ jsx(
2846
3038
  SlidePanel,
2847
3039
  {
@@ -3139,6 +3331,8 @@ function MediaGallery({
3139
3331
  setShowStorageConfigModal(false);
3140
3332
  setStorageConfigured(true);
3141
3333
  window.location.reload();
3334
+ }).catch(() => {
3335
+ toast.error("Failed to configure storage");
3142
3336
  });
3143
3337
  },
3144
3338
  className: "flex-1 px-4 py-3 border border-[var(--kyro-border)] text-[var(--kyro-text-secondary)] rounded-xl font-bold hover:bg-[var(--kyro-surface-accent)] transition-colors",
@@ -6124,7 +6318,7 @@ var ListField = ({
6124
6318
  onChange,
6125
6319
  compact = false
6126
6320
  }) => {
6127
- const [inputValue, setInputValue] = React56.useState("");
6321
+ const [inputValue, setInputValue] = React.useState("");
6128
6322
  const handleAdd = () => {
6129
6323
  if (inputValue.trim()) {
6130
6324
  onChange([...items, inputValue.trim()]);
@@ -6380,7 +6574,7 @@ var AccordionField = ({
6380
6574
  onChange,
6381
6575
  compact = false
6382
6576
  }) => {
6383
- const [openIndex, setOpenIndex] = React56.useState(0);
6577
+ const [openIndex, setOpenIndex] = React.useState(0);
6384
6578
  const handleTitleChange = (index, value) => {
6385
6579
  const newItems = [...items];
6386
6580
  newItems[index] = { ...newItems[index], title: value };
@@ -6806,7 +7000,7 @@ function ArrayLayout({
6806
7000
  const firstField = fields2[0];
6807
7001
  const labelField = firstField?.name || "user";
6808
7002
  const isRelationship = firstField?.type === "relationship";
6809
- const [openIndex, setOpenIndex] = React56.useState(0);
7003
+ const [openIndex, setOpenIndex] = React.useState(0);
6810
7004
  function getItemLabel(item) {
6811
7005
  for (const key of ["label", "title", "name"]) {
6812
7006
  const val = item[key];
@@ -8520,11 +8714,11 @@ var SortableBlockComponent = ({
8520
8714
  )
8521
8715
  ] });
8522
8716
  }
8523
- return /* @__PURE__ */ jsxs("div", { ref: setNodeRef, style, className: "relative group pl-8 mb-2", children: [
8717
+ return /* @__PURE__ */ jsxs("div", { ref: setNodeRef, style, className: "relative group md:pl-8 mb-2", children: [
8524
8718
  /* @__PURE__ */ jsx(
8525
8719
  "div",
8526
8720
  {
8527
- className: "absolute left-0 top-1/2 -translate-y-1/2 p-1.5 cursor-grab active:cursor-grabbing text-[var(--kyro-text-muted)] opacity-0 group-hover:opacity-100 transition-opacity hover:bg-[var(--kyro-surface-accent)] rounded",
8721
+ className: "hidden md:absolute left-0 top-1/2 -translate-y-1/2 p-1.5 cursor-grab active:cursor-grabbing text-[var(--kyro-text-muted)] opacity-0 group-hover:opacity-100 transition-opacity hover:bg-[var(--kyro-surface-accent)] rounded",
8528
8722
  ...attributes,
8529
8723
  ...listeners,
8530
8724
  children: /* @__PURE__ */ jsx(GripVertical, { className: "w-4 h-4" })
@@ -8621,7 +8815,7 @@ var SortableBlockComponent = ({
8621
8815
  )
8622
8816
  ] });
8623
8817
  };
8624
- var SortableBlock = React56.memo(SortableBlockComponent);
8818
+ var SortableBlock = React.memo(SortableBlockComponent);
8625
8819
  var BlocksField = ({
8626
8820
  field: field3,
8627
8821
  value,
@@ -10040,7 +10234,7 @@ function AutoForm({
10040
10234
  return /* @__PURE__ */ jsx(
10041
10235
  "div",
10042
10236
  {
10043
- className: "kyro-form-row flex gap-6 items-end",
10237
+ className: "kyro-form-row flex flex-col md:flex-row gap-4 md:gap-6 items-start md:items-end w-full",
10044
10238
  children: rowFields?.map((f) => {
10045
10239
  const fAdmin = f.admin || {};
10046
10240
  const actionUrl = fAdmin?.action;
@@ -10272,24 +10466,24 @@ function AutoForm({
10272
10466
  const statusLabel = hasUnpublishedChanges ? "Draft (unpublished changes)" : docStatus === "published" ? "Published" : "Draft";
10273
10467
  const statusColor = docStatus === "published" && !hasUnsavedChanges ? "bg-[var(--kyro-success)]" : hasUnpublishedChanges ? "bg-[var(--kyro-warning)]" : "bg-[var(--kyro-text-muted)]";
10274
10468
  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";
10275
- return /* @__PURE__ */ jsxs("header", { className: "surface-tile px-8 py-6 flex items-center justify-between sticky top-0 z-50 border-b border-[var(--kyro-border)] mb-8 bg-[var(--kyro-surface)] backdrop-blur-md", children: [
10276
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
10277
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
10469
+ return /* @__PURE__ */ 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: [
10470
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1 md:gap-2 min-w-0", children: [
10471
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 md:gap-3 flex-wrap min-w-0", children: [
10278
10472
  /* @__PURE__ */ jsx(
10279
10473
  "a",
10280
10474
  {
10281
10475
  href: `/${collectionSlug}`,
10282
- className: "p-2 border border-[var(--kyro-border)] rounded-xl hover:bg-[var(--kyro-bg-secondary)] transition-colors",
10476
+ 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",
10283
10477
  children: /* @__PURE__ */ jsx(ChevronRight, { className: "w-4 h-4" })
10284
10478
  }
10285
10479
  ),
10286
- /* @__PURE__ */ jsx("h1", { className: "text-xl font-bold tracking-tighter", children: docTitle }),
10287
- /* @__PURE__ */ jsxs("span", { className: `inline-flex items-center gap-1.5 px-2 rounded-full text-[10px] font-regular border ${statusBadgeBg}`, children: [
10480
+ /* @__PURE__ */ jsx("h1", { className: "text-lg md:text-xl font-bold tracking-tighter truncate min-w-0", children: docTitle }),
10481
+ /* @__PURE__ */ jsxs("span", { className: `shrink-0 inline-flex items-center gap-1.5 px-2 rounded-full text-[10px] font-regular border ${statusBadgeBg}`, children: [
10288
10482
  /* @__PURE__ */ jsx("span", { className: `h-1.5 w-1.5 rounded-full ${statusColor}` }),
10289
10483
  statusLabel
10290
10484
  ] })
10291
10485
  ] }),
10292
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4 text-[11px] font-medium tracking-wide opacity-60 ml-12", children: [
10486
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4 text-[11px] font-medium tracking-wide opacity-60 md:ml-12", children: [
10293
10487
  autoSaveStatus === "saving" && /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1.5 text-[var(--kyro-text-muted)]", children: [
10294
10488
  /* @__PURE__ */ jsxs(
10295
10489
  "svg",
@@ -10410,7 +10604,7 @@ function AutoForm({
10410
10604
  ] })
10411
10605
  ] })
10412
10606
  ] }),
10413
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-6", children: [
10607
+ /* @__PURE__ */ jsxs("div", { className: "max-md:hidden flex items-center gap-6", children: [
10414
10608
  /* @__PURE__ */ 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__ */ jsx(
10415
10609
  "button",
10416
10610
  {
@@ -10595,15 +10789,15 @@ function AutoForm({
10595
10789
  };
10596
10790
  const renderEditView = () => {
10597
10791
  if (layout === "single") {
10598
- return /* @__PURE__ */ jsx("div", { className: "w-full space-y-8", children: /* @__PURE__ */ jsx("div", { className: "surface-tile p-8 space-y-8", children: config.fields.map((f) => renderField(f)) }) });
10792
+ return /* @__PURE__ */ jsx("div", { className: "w-full space-y-6 md:space-y-8", children: /* @__PURE__ */ jsx("div", { className: "surface-tile p-4 md:p-8 space-y-6 md:space-y-8", children: config.fields.map((f) => renderField(f)) }) });
10599
10793
  }
10600
10794
  const hasSidebarFields = config.fields.some((f) => f.admin?.position === "sidebar") && !showPreview;
10601
10795
  return /* @__PURE__ */ jsxs(
10602
10796
  "div",
10603
10797
  {
10604
- className: `w-full mx-auto grid 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]"}`,
10798
+ 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]"}`,
10605
10799
  children: [
10606
- /* @__PURE__ */ jsx("div", { className: "space-y-8 animate-in fade-in slide-in-from-left-4 duration-500", children: config.tabs ? renderField({ type: "tabs", tabs: config.tabs }) : /* @__PURE__ */ jsx("div", { className: "surface-tile p-8 space-y-8", children: config.fields.filter(
10800
+ /* @__PURE__ */ 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__ */ jsx("div", { className: "surface-tile p-4 md:p-8 space-y-6 md:space-y-8", children: config.fields.filter(
10607
10801
  (f) => !f.admin?.position || f.admin.position === "main"
10608
10802
  ).map((f) => renderField(f)) }) }),
10609
10803
  showPreview ? /* @__PURE__ */ jsx("div", { className: "sticky top-36 h-[calc(100vh-280px)] animate-in fade-in slide-in-from-right-10 duration-700", children: /* @__PURE__ */ jsxs("div", { className: "w-full h-full rounded-3xl border border-[var(--kyro-border)] bg-[var(--kyro-bg-secondary)] shadow-2xl overflow-hidden relative group", children: [
@@ -10620,9 +10814,18 @@ function AutoForm({
10620
10814
  }
10621
10815
  ),
10622
10816
  /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-transparent pointer-events-none border-[12px] border-[var(--kyro-surface)] rounded-3xl" })
10623
- ] }) }) : sidebarCollapsed ? null : /* @__PURE__ */ jsx("div", { className: "space-y-6 animate-in fade-in slide-in-from-right-4 duration-500", children: config.fields.some((f) => f.admin?.position === "sidebar") && /* @__PURE__ */ jsxs("div", { className: "surface-tile p-6 space-y-6", children: [
10624
- /* @__PURE__ */ jsx("h3", { className: "text-[10px] font-bold tracking-[0.2em] opacity-40", children: "Settings" }),
10625
- config.fields.filter((f) => f.admin?.position === "sidebar").map((f) => renderField(f))
10817
+ ] }) }) : sidebarCollapsed ? null : /* @__PURE__ */ 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__ */ jsxs(Fragment, { children: [
10818
+ /* @__PURE__ */ jsxs("div", { className: "hidden lg:block surface-tile p-6 space-y-6", children: [
10819
+ /* @__PURE__ */ jsx("h3", { className: "text-[10px] font-bold tracking-[0.2em] opacity-40", children: "Settings" }),
10820
+ config.fields.filter((f) => f.admin?.position === "sidebar").map((f) => renderField(f))
10821
+ ] }),
10822
+ /* @__PURE__ */ jsxs("details", { className: "lg:hidden surface-tile p-4 space-y-4 group", children: [
10823
+ /* @__PURE__ */ 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: [
10824
+ /* @__PURE__ */ 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__ */ jsx("path", { d: "M9 18l6-6-6-6" }) }),
10825
+ "Settings"
10826
+ ] }),
10827
+ /* @__PURE__ */ 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)) })
10828
+ ] })
10626
10829
  ] }) })
10627
10830
  ]
10628
10831
  }
@@ -10874,7 +11077,7 @@ function AutoForm({
10874
11077
  }
10875
11078
  )
10876
11079
  ] }),
10877
- /* @__PURE__ */ jsxs("main", { className: "w-full", children: [
11080
+ /* @__PURE__ */ jsxs("main", { className: "w-full pt-6 md:pt-0", children: [
10878
11081
  view === "edit" && renderEditView(),
10879
11082
  view === "version" && renderVersionView(),
10880
11083
  view === "api" && renderApiView()
@@ -10892,9 +11095,13 @@ function ActionBar({
10892
11095
  onViewHistory,
10893
11096
  onPreview,
10894
11097
  onDelete,
11098
+ onBack,
11099
+ onToggleSidebar,
10895
11100
  publishedAt,
10896
11101
  updatedAt
10897
11102
  }) {
11103
+ const view = useAutoFormStore((s) => s.view) || "edit";
11104
+ const setView = useAutoFormStore((s) => s.setView);
10898
11105
  const getSaveStatusText = () => {
10899
11106
  if (saveStatus === "saving") return "Saving...";
10900
11107
  if (saveStatus === "saved") return "Saved";
@@ -10941,101 +11148,268 @@ function ActionBar({
10941
11148
  if (!dateStr) return "Never";
10942
11149
  return new Date(dateStr).toLocaleString();
10943
11150
  };
10944
- return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between py-3 px-1", children: [
10945
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4", children: [
10946
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
11151
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
11152
+ /* @__PURE__ */ 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: [
11153
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
11154
+ onBack && /* @__PURE__ */ jsx(
11155
+ "button",
11156
+ {
11157
+ type: "button",
11158
+ onClick: onBack,
11159
+ className: "p-2 rounded-lg hover:bg-[var(--kyro-surface-accent)] text-[var(--kyro-text-secondary)] transition-all",
11160
+ children: /* @__PURE__ */ jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", children: /* @__PURE__ */ jsx("path", { d: "M19 12H5M12 19l-7-7 7-7" }) })
11161
+ }
11162
+ ),
11163
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 ml-auto", children: [
11164
+ onPreview && /* @__PURE__ */ jsx(
11165
+ "button",
11166
+ {
11167
+ type: "button",
11168
+ onClick: onPreview,
11169
+ className: "p-2 rounded-lg hover:bg-[var(--kyro-surface-accent)] text-[var(--kyro-text-secondary)] transition-all",
11170
+ title: "Preview",
11171
+ children: /* @__PURE__ */ jsx(Eye, { className: "w-4 h-4" })
11172
+ }
11173
+ ),
11174
+ onViewHistory && /* @__PURE__ */ jsx(
11175
+ "button",
11176
+ {
11177
+ type: "button",
11178
+ onClick: onViewHistory,
11179
+ className: "p-2 rounded-lg hover:bg-[var(--kyro-surface-accent)] text-[var(--kyro-text-secondary)] transition-all",
11180
+ title: "View History",
11181
+ children: /* @__PURE__ */ jsx(Clock, { className: "w-4 h-4" })
11182
+ }
11183
+ ),
11184
+ onDuplicate && /* @__PURE__ */ jsx(
11185
+ "button",
11186
+ {
11187
+ type: "button",
11188
+ onClick: onDuplicate,
11189
+ className: "p-2 rounded-lg hover:bg-[var(--kyro-surface-accent)] text-[var(--kyro-text-secondary)] transition-all",
11190
+ title: "Duplicate",
11191
+ children: /* @__PURE__ */ jsx(Copy, { className: "w-4 h-4" })
11192
+ }
11193
+ ),
11194
+ onDelete && /* @__PURE__ */ jsx(
11195
+ "button",
11196
+ {
11197
+ type: "button",
11198
+ onClick: onDelete,
11199
+ className: "p-2 rounded-lg hover:bg-[var(--kyro-danger-bg)] text-[var(--kyro-error)] transition-all",
11200
+ title: "Delete",
11201
+ children: /* @__PURE__ */ jsx(Trash2, { className: "w-4 h-4" })
11202
+ }
11203
+ ),
11204
+ onToggleSidebar && /* @__PURE__ */ jsx(
11205
+ "button",
11206
+ {
11207
+ type: "button",
11208
+ onClick: onToggleSidebar,
11209
+ className: "p-2 rounded-lg hover:bg-[var(--kyro-surface-accent)] text-[var(--kyro-text-secondary)] transition-all",
11210
+ title: "Toggle Sidebar",
11211
+ children: /* @__PURE__ */ jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
11212
+ /* @__PURE__ */ jsx("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }),
11213
+ /* @__PURE__ */ jsx("line", { x1: "9", y1: "3", x2: "9", y2: "21" })
11214
+ ] })
11215
+ }
11216
+ )
11217
+ ] })
11218
+ ] }),
11219
+ /* @__PURE__ */ 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__ */ jsx(
11220
+ "button",
11221
+ {
11222
+ type: "button",
11223
+ onClick: () => setView(v),
11224
+ 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"}`,
11225
+ children: v === "edit" ? "Edit" : v === "version" ? "Version" : "API"
11226
+ },
11227
+ v
11228
+ )) }),
11229
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
10947
11230
  getStatusBadge(),
10948
11231
  getSaveStatusText() && /* @__PURE__ */ jsxs(
10949
11232
  "span",
10950
11233
  {
10951
- className: `text-sm ${saveStatus === "error" ? "text-[var(--kyro-error)]" : "text-[var(--kyro-text-muted)]"}`,
11234
+ className: `text-xs ${saveStatus === "error" ? "text-[var(--kyro-error)]" : "text-[var(--kyro-text-muted)]"}`,
10952
11235
  children: [
10953
11236
  saveStatus === "saving" ? /* @__PURE__ */ jsx(Spinner, { size: "sm", className: "inline mr-1" }) : null,
10954
11237
  getSaveStatusText()
10955
11238
  ]
10956
11239
  }
10957
- )
11240
+ ),
11241
+ /* @__PURE__ */ jsxs("span", { className: "text-[10px] text-[var(--kyro-text-muted)] ml-auto", children: [
11242
+ updatedAt && `Updated ${formatDate2(updatedAt)}`,
11243
+ publishedAt && status === "published" && ` \xB7 Published ${formatDate2(publishedAt)}`
11244
+ ] })
10958
11245
  ] }),
10959
- /* @__PURE__ */ jsxs("div", { className: "text-xs space-y-0.5", children: [
10960
- updatedAt && /* @__PURE__ */ jsxs("div", { className: "text-[var(--kyro-text-muted)]", children: [
10961
- "Updated: ",
10962
- formatDate2(updatedAt)
11246
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
11247
+ status === "draft" && onPublish && /* @__PURE__ */ jsxs(
11248
+ "button",
11249
+ {
11250
+ type: "button",
11251
+ onClick: onPublish,
11252
+ disabled: saveStatus === "saving",
11253
+ className: "kyro-btn kyro-btn-primary kyro-btn-md flex items-center gap-2 flex-1 justify-center",
11254
+ children: [
11255
+ /* @__PURE__ */ jsx(Send, { className: "w-4 h-4" }),
11256
+ "Publish"
11257
+ ]
11258
+ }
11259
+ ),
11260
+ status === "published" && onUnpublish && /* @__PURE__ */ jsxs(
11261
+ "button",
11262
+ {
11263
+ type: "button",
11264
+ onClick: onUnpublish,
11265
+ disabled: saveStatus === "saving",
11266
+ className: "kyro-btn kyro-btn-secondary kyro-btn-md flex items-center gap-2 flex-1 justify-center",
11267
+ children: [
11268
+ /* @__PURE__ */ jsx(Undo, { className: "w-4 h-4" }),
11269
+ "Unpublish"
11270
+ ]
11271
+ }
11272
+ ),
11273
+ /* @__PURE__ */ jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsxs(
11274
+ SplitButton,
11275
+ {
11276
+ status,
11277
+ saveStatus,
11278
+ hasChanges,
11279
+ onPublish: onSave,
11280
+ children: [
11281
+ onDuplicate && /* @__PURE__ */ jsx(
11282
+ DropdownItem,
11283
+ {
11284
+ icon: /* @__PURE__ */ jsx(Copy, { className: "w-4 h-4" }),
11285
+ children: "Duplicate"
11286
+ }
11287
+ ),
11288
+ onViewHistory && /* @__PURE__ */ jsx(
11289
+ DropdownItem,
11290
+ {
11291
+ icon: /* @__PURE__ */ jsx(Clock, { className: "w-4 h-4" }),
11292
+ children: "View History"
11293
+ }
11294
+ ),
11295
+ onPreview && /* @__PURE__ */ jsx(
11296
+ DropdownItem,
11297
+ {
11298
+ icon: /* @__PURE__ */ jsx(Eye, { className: "w-4 h-4" }),
11299
+ children: "Preview"
11300
+ }
11301
+ ),
11302
+ (onDuplicate || onViewHistory || onPreview) && /* @__PURE__ */ jsx(DropdownSeparator, {}),
11303
+ onDelete && /* @__PURE__ */ jsx(
11304
+ DropdownItem,
11305
+ {
11306
+ onClick: onDelete,
11307
+ danger: true,
11308
+ icon: /* @__PURE__ */ jsx(Trash2, { className: "w-4 h-4" }),
11309
+ children: "Delete"
11310
+ }
11311
+ )
11312
+ ]
11313
+ }
11314
+ ) })
11315
+ ] })
11316
+ ] }),
11317
+ /* @__PURE__ */ 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: [
11318
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center gap-4", children: [
11319
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
11320
+ getStatusBadge(),
11321
+ getSaveStatusText() && /* @__PURE__ */ jsxs(
11322
+ "span",
11323
+ {
11324
+ className: `text-sm ${saveStatus === "error" ? "text-[var(--kyro-error)]" : "text-[var(--kyro-text-muted)]"}`,
11325
+ children: [
11326
+ saveStatus === "saving" ? /* @__PURE__ */ jsx(Spinner, { size: "sm", className: "inline mr-1" }) : null,
11327
+ getSaveStatusText()
11328
+ ]
11329
+ }
11330
+ )
10963
11331
  ] }),
10964
- publishedAt && status === "published" && /* @__PURE__ */ jsxs("div", { className: "text-[var(--kyro-primary)] font-medium", children: [
10965
- "Published: ",
10966
- formatDate2(publishedAt)
11332
+ /* @__PURE__ */ jsxs("div", { className: "text-xs space-y-0.5", children: [
11333
+ updatedAt && /* @__PURE__ */ jsxs("div", { className: "text-[var(--kyro-text-muted)]", children: [
11334
+ "Updated: ",
11335
+ formatDate2(updatedAt)
11336
+ ] }),
11337
+ publishedAt && status === "published" && /* @__PURE__ */ jsxs("div", { className: "text-[var(--kyro-primary)] font-medium", children: [
11338
+ "Published: ",
11339
+ formatDate2(publishedAt)
11340
+ ] })
10967
11341
  ] })
11342
+ ] }),
11343
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
11344
+ status === "draft" && onPublish && /* @__PURE__ */ jsxs(
11345
+ "button",
11346
+ {
11347
+ type: "button",
11348
+ onClick: onPublish,
11349
+ disabled: saveStatus === "saving",
11350
+ className: "kyro-btn kyro-btn-primary kyro-btn-md flex items-center gap-2",
11351
+ children: [
11352
+ /* @__PURE__ */ jsx(Send, { className: "w-4 h-4" }),
11353
+ "Publish"
11354
+ ]
11355
+ }
11356
+ ),
11357
+ status === "published" && onUnpublish && /* @__PURE__ */ jsxs(
11358
+ "button",
11359
+ {
11360
+ type: "button",
11361
+ onClick: onUnpublish,
11362
+ disabled: saveStatus === "saving",
11363
+ className: "kyro-btn kyro-btn-secondary kyro-btn-md flex items-center gap-2",
11364
+ children: [
11365
+ /* @__PURE__ */ jsx(Undo, { className: "w-4 h-4" }),
11366
+ "Unpublish"
11367
+ ]
11368
+ }
11369
+ ),
11370
+ /* @__PURE__ */ jsxs(
11371
+ SplitButton,
11372
+ {
11373
+ status,
11374
+ saveStatus,
11375
+ hasChanges,
11376
+ onPublish: onSave,
11377
+ children: [
11378
+ onDuplicate && /* @__PURE__ */ jsx(
11379
+ DropdownItem,
11380
+ {
11381
+ icon: /* @__PURE__ */ jsx(Copy, { className: "w-4 h-4" }),
11382
+ children: "Duplicate"
11383
+ }
11384
+ ),
11385
+ onViewHistory && /* @__PURE__ */ jsx(
11386
+ DropdownItem,
11387
+ {
11388
+ icon: /* @__PURE__ */ jsx(Clock, { className: "w-4 h-4" }),
11389
+ children: "View History"
11390
+ }
11391
+ ),
11392
+ onPreview && /* @__PURE__ */ jsx(
11393
+ DropdownItem,
11394
+ {
11395
+ icon: /* @__PURE__ */ jsx(Eye, { className: "w-4 h-4" }),
11396
+ children: "Preview"
11397
+ }
11398
+ ),
11399
+ (onDuplicate || onViewHistory || onPreview) && /* @__PURE__ */ jsx(DropdownSeparator, {}),
11400
+ onDelete && /* @__PURE__ */ jsx(
11401
+ DropdownItem,
11402
+ {
11403
+ onClick: onDelete,
11404
+ danger: true,
11405
+ icon: /* @__PURE__ */ jsx(Trash2, { className: "w-4 h-4" }),
11406
+ children: "Delete"
11407
+ }
11408
+ )
11409
+ ]
11410
+ }
11411
+ )
10968
11412
  ] })
10969
- ] }),
10970
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
10971
- status === "draft" && onPublish && /* @__PURE__ */ jsxs(
10972
- "button",
10973
- {
10974
- type: "button",
10975
- onClick: onPublish,
10976
- disabled: saveStatus === "saving",
10977
- className: "kyro-btn kyro-btn-primary kyro-btn-md flex items-center gap-2",
10978
- children: [
10979
- /* @__PURE__ */ jsx(Send, { className: "w-4 h-4" }),
10980
- "Publish"
10981
- ]
10982
- }
10983
- ),
10984
- status === "published" && onUnpublish && /* @__PURE__ */ jsxs(
10985
- "button",
10986
- {
10987
- type: "button",
10988
- onClick: onUnpublish,
10989
- disabled: saveStatus === "saving",
10990
- className: "kyro-btn kyro-btn-secondary kyro-btn-md flex items-center gap-2",
10991
- children: [
10992
- /* @__PURE__ */ jsx(Undo, { className: "w-4 h-4" }),
10993
- "Unpublish"
10994
- ]
10995
- }
10996
- ),
10997
- /* @__PURE__ */ jsxs(
10998
- SplitButton,
10999
- {
11000
- status,
11001
- saveStatus,
11002
- hasChanges,
11003
- onPublish: onSave,
11004
- children: [
11005
- onDuplicate && /* @__PURE__ */ jsx(
11006
- DropdownItem,
11007
- {
11008
- icon: /* @__PURE__ */ jsx(Copy, { className: "w-4 h-4" }),
11009
- children: "Duplicate"
11010
- }
11011
- ),
11012
- onViewHistory && /* @__PURE__ */ jsx(
11013
- DropdownItem,
11014
- {
11015
- icon: /* @__PURE__ */ jsx(Clock, { className: "w-4 h-4" }),
11016
- children: "View History"
11017
- }
11018
- ),
11019
- onPreview && /* @__PURE__ */ jsx(
11020
- DropdownItem,
11021
- {
11022
- icon: /* @__PURE__ */ jsx(Eye, { className: "w-4 h-4" }),
11023
- children: "Preview"
11024
- }
11025
- ),
11026
- (onDuplicate || onViewHistory || onPreview) && /* @__PURE__ */ jsx(DropdownSeparator, {}),
11027
- onDelete && /* @__PURE__ */ jsx(
11028
- DropdownItem,
11029
- {
11030
- onClick: onDelete,
11031
- danger: true,
11032
- icon: /* @__PURE__ */ jsx(Trash2, { className: "w-4 h-4" }),
11033
- children: "Delete"
11034
- }
11035
- )
11036
- ]
11037
- }
11038
- )
11039
11413
  ] })
11040
11414
  ] });
11041
11415
  }
@@ -11259,7 +11633,27 @@ function DetailView({
11259
11633
  ]
11260
11634
  }
11261
11635
  ),
11262
- !isSingleLayout && /* @__PURE__ */ jsx(
11636
+ isSingleLayout ? /* @__PURE__ */ jsx("div", { className: "md:hidden", children: /* @__PURE__ */ jsx(
11637
+ ActionBar,
11638
+ {
11639
+ status,
11640
+ saveStatus,
11641
+ hasChanges,
11642
+ onSave: () => handleSave(false),
11643
+ onPublish: handlePublish,
11644
+ onUnpublish: status === "published" ? handleUnpublish : void 0,
11645
+ onDuplicate: handleDuplicate,
11646
+ onViewHistory: () => {
11647
+ window.dispatchEvent(new CustomEvent("kyro:show-version-history"));
11648
+ },
11649
+ onPreview: () => window.open(`/preview/${slug}/${documentId}`, "_blank"),
11650
+ onDelete: handleDeleteTrigger,
11651
+ onBack,
11652
+ onToggleSidebar: () => window.dispatchEvent(new CustomEvent("toggle-sidebar")),
11653
+ publishedAt,
11654
+ updatedAt
11655
+ }
11656
+ ) }) : /* @__PURE__ */ jsx(
11263
11657
  ActionBar,
11264
11658
  {
11265
11659
  status,
@@ -11274,6 +11668,8 @@ function DetailView({
11274
11668
  },
11275
11669
  onPreview: () => window.open(`/preview/${slug}/${documentId}`, "_blank"),
11276
11670
  onDelete: handleDeleteTrigger,
11671
+ onBack,
11672
+ onToggleSidebar: () => window.dispatchEvent(new CustomEvent("toggle-sidebar")),
11277
11673
  publishedAt,
11278
11674
  updatedAt
11279
11675
  }
@@ -11281,9 +11677,9 @@ function DetailView({
11281
11677
  /* @__PURE__ */ jsxs(
11282
11678
  "div",
11283
11679
  {
11284
- className: isSingleLayout ? "w-full pb-32 pt-8" : "w-full mx-auto grid grid-cols-1 lg:grid-cols-[1fr_360px] gap-8 pb-32",
11680
+ 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",
11285
11681
  children: [
11286
- /* @__PURE__ */ jsx("div", { className: "space-y-8 min-w-0", children: /* @__PURE__ */ jsxs("div", { className: "surface-tile p-8", children: [
11682
+ /* @__PURE__ */ jsx("div", { className: "space-y-4 md:space-y-8 min-w-0", children: /* @__PURE__ */ jsxs("div", { className: "surface-tile p-4 md:p-8", children: [
11287
11683
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-8 px-1", children: [
11288
11684
  /* @__PURE__ */ jsx("h2", { className: "text-[10px] font-bold tracking-[0.2em] opacity-40", children: "Core Configuration" }),
11289
11685
  /* @__PURE__ */ jsx("div", { className: "h-px flex-1 bg-[var(--kyro-border)] ml-6 opacity-30" })
@@ -11325,10 +11721,10 @@ function DetailView({
11325
11721
  )
11326
11722
  ] })
11327
11723
  ] }) }),
11328
- !isSingleLayout && /* @__PURE__ */ jsxs("div", { className: "space-y-6 animate-in fade-in slide-in-from-right-4 duration-500", children: [
11329
- /* @__PURE__ */ jsxs("div", { className: "surface-tile p-8", children: [
11330
- /* @__PURE__ */ jsx("h3", { className: "text-[10px] font-bold tracking-[0.2em] opacity-40 mb-6", children: "Metadata" }),
11331
- /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
11724
+ !isSingleLayout && /* @__PURE__ */ jsxs("div", { className: "space-y-4 md:space-y-6 animate-in fade-in slide-in-from-right-4 duration-500", children: [
11725
+ /* @__PURE__ */ jsxs("div", { className: "surface-tile p-4 md:p-8", children: [
11726
+ /* @__PURE__ */ jsx("h3", { className: "text-[10px] font-bold tracking-[0.2em] opacity-40 mb-4 md:mb-6", children: "Metadata" }),
11727
+ /* @__PURE__ */ jsxs("div", { className: "space-y-4 md:space-y-6", children: [
11332
11728
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
11333
11729
  /* @__PURE__ */ jsx("span", { className: "text-[10px] font-bold tracking-widest opacity-40", children: "Dynamic Status" }),
11334
11730
  /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
@@ -11362,9 +11758,9 @@ function DetailView({
11362
11758
  ] })
11363
11759
  ] })
11364
11760
  ] }),
11365
- /* @__PURE__ */ jsxs("div", { className: "surface-tile p-8 bg-[var(--kyro-bg-secondary)]", children: [
11366
- /* @__PURE__ */ jsx("h3", { className: "text-[10px] font-bold tracking-[0.2em] opacity-40 mb-4", children: "Quick Links" }),
11367
- /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
11761
+ /* @__PURE__ */ jsxs("div", { className: "surface-tile p-4 md:p-8 bg-[var(--kyro-bg-secondary)]", children: [
11762
+ /* @__PURE__ */ jsx("h3", { className: "text-[10px] font-bold tracking-[0.2em] opacity-40 mb-3 md:mb-4", children: "Quick Links" }),
11763
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2 md:space-y-3", children: [
11368
11764
  /* @__PURE__ */ jsx(
11369
11765
  "button",
11370
11766
  {
@@ -11451,8 +11847,8 @@ function CreateView({
11451
11847
  ] });
11452
11848
  }
11453
11849
  function Toast({ type, message, onClose }) {
11454
- const [isPaused, setIsPaused] = React56.useState(false);
11455
- const timerRef = React56.useRef(null);
11850
+ const [isPaused, setIsPaused] = React.useState(false);
11851
+ const timerRef = React.useRef(null);
11456
11852
  const startTimer = () => {
11457
11853
  if (timerRef.current) clearTimeout(timerRef.current);
11458
11854
  timerRef.current = setTimeout(onClose, 5e3);
@@ -11460,7 +11856,7 @@ function Toast({ type, message, onClose }) {
11460
11856
  const clearTimer = () => {
11461
11857
  if (timerRef.current) clearTimeout(timerRef.current);
11462
11858
  };
11463
- React56.useEffect(() => {
11859
+ React.useEffect(() => {
11464
11860
  if (!isPaused) {
11465
11861
  startTimer();
11466
11862
  } else {
@@ -11481,14 +11877,13 @@ function Toast({ type, message, onClose }) {
11481
11877
  onMouseEnter: () => setIsPaused(true),
11482
11878
  onMouseLeave: () => setIsPaused(false),
11483
11879
  children: [
11484
- /* @__PURE__ */ jsx("div", { className: "kyro-toast-accent" }),
11485
11880
  /* @__PURE__ */ jsx("div", { className: "kyro-toast-icon-container", children: /* @__PURE__ */ jsx(Icon, { className: "w-4 h-4" }) }),
11486
11881
  /* @__PURE__ */ jsx("div", { className: "kyro-toast-content", children: /* @__PURE__ */ jsx("p", { className: "kyro-toast-message", children: message }) }),
11487
11882
  /* @__PURE__ */ jsx(
11488
11883
  "button",
11489
11884
  {
11490
11885
  type: "button",
11491
- className: "kyro-toast-close group-hover:opacity-100 opacity-40 transition-opacity",
11886
+ className: "kyro-toast-close",
11492
11887
  onClick: onClose,
11493
11888
  children: /* @__PURE__ */ jsx(X, { className: "w-3.5 h-3.5" })
11494
11889
  }
@@ -11506,14 +11901,19 @@ function useToast() {
11506
11901
  const toasts = useToastStore((state) => state.toasts);
11507
11902
  return { toasts, addToast, removeToast };
11508
11903
  }
11904
+ function Toaster() {
11905
+ const toasts = useToastStore((state) => state.toasts);
11906
+ const removeToast = useToastStore((state) => state.removeToast);
11907
+ return /* @__PURE__ */ jsx("div", { className: "kyro-toasts-container", style: { position: "fixed", bottom: "24px", right: "24px", display: "flex", flexDirection: "column", gap: "12px", zIndex: 9999, pointerEvents: "none" }, children: toasts.map((t) => /* @__PURE__ */ jsx("div", { style: { pointerEvents: "auto" }, children: /* @__PURE__ */ jsx(Toast, { type: t.type, message: t.message, onClose: () => removeToast(t.id) }) }, t.id)) });
11908
+ }
11509
11909
  function LoginPage({ onAuth, theme = "light" }) {
11510
11910
  const [mode, setMode] = useState("login");
11511
11911
  const [email, setEmail] = useState("");
11512
11912
  const [password, setPassword] = useState("");
11513
11913
  const [confirmPassword, setConfirmPassword] = useState("");
11514
11914
  const [loading, setLoading] = useState(false);
11515
- const [toasts, setToasts] = useState([]);
11516
11915
  const [isFirstUser, setIsFirstUser] = useState(false);
11916
+ const addToast = useToastStore((state) => state.addToast);
11517
11917
  useEffect(() => {
11518
11918
  checkIfFirstUser();
11519
11919
  }, []);
@@ -11525,13 +11925,6 @@ function LoginPage({ onAuth, theme = "light" }) {
11525
11925
  setMode("register");
11526
11926
  }
11527
11927
  };
11528
- const addToast = (type, message) => {
11529
- const id = Math.random().toString(36).substring(7);
11530
- setToasts((prev) => [...prev, { id, type, message }]);
11531
- setTimeout(() => {
11532
- setToasts((prev) => prev.filter((t) => t.id !== id));
11533
- }, 5e3);
11534
- };
11535
11928
  const handleSubmit = async (e) => {
11536
11929
  e.preventDefault();
11537
11930
  setLoading(true);
@@ -11557,7 +11950,7 @@ function LoginPage({ onAuth, theme = "light" }) {
11557
11950
  setLoading(false);
11558
11951
  }
11559
11952
  };
11560
- return /* @__PURE__ */ jsx(ThemeProvider, { defaultMode: theme, children: /* @__PURE__ */ jsx(ToastProvider, { children: /* @__PURE__ */ jsxs("div", { className: "kyro-login-page", children: [
11953
+ return /* @__PURE__ */ jsx(ThemeProvider, { defaultMode: theme, children: /* @__PURE__ */ jsxs("div", { className: "kyro-login-page", children: [
11561
11954
  /* @__PURE__ */ jsxs("div", { className: "kyro-login-container", children: [
11562
11955
  /* @__PURE__ */ jsxs("div", { className: "kyro-login-header", children: [
11563
11956
  /* @__PURE__ */ jsx("h1", { className: "kyro-login-title", children: isFirstUser ? "Create Admin Account" : mode === "login" ? "Sign In" : "Create Account" }),
@@ -11647,16 +12040,8 @@ function LoginPage({ onAuth, theme = "light" }) {
11647
12040
  )
11648
12041
  ] }) }) })
11649
12042
  ] }),
11650
- toasts.map((toast2) => /* @__PURE__ */ jsx(
11651
- Toast,
11652
- {
11653
- type: toast2.type,
11654
- message: toast2.message,
11655
- onClose: () => setToasts((prev) => prev.filter((t) => t.id !== toast2.id))
11656
- },
11657
- toast2.id
11658
- ))
11659
- ] }) }) });
12043
+ /* @__PURE__ */ jsx(Toaster, {})
12044
+ ] }) });
11660
12045
  }
11661
12046
  function Dashboard({ collections: collections2, onNavigate, user }) {
11662
12047
  const { permissions } = useAuthStore();
@@ -12078,7 +12463,7 @@ function UserManagement() {
12078
12463
  const filteredUsers = users.filter(
12079
12464
  (u) => u.email.toLowerCase().includes(searchQuery.toLowerCase()) || u.name?.toLowerCase().includes(searchQuery.toLowerCase())
12080
12465
  );
12081
- return /* @__PURE__ */ jsxs("div", { className: "w-full space-y-6 animate-in fade-in slide-in-from-bottom-4 duration-700 px-8 pb-12", children: [
12466
+ return /* @__PURE__ */ jsxs("div", { className: "w-full space-y-6 animate-in fade-in slide-in-from-bottom-4 duration-700 px-4 md:px-8 pb-12", children: [
12082
12467
  /* @__PURE__ */ jsx(
12083
12468
  PageHeader,
12084
12469
  {
@@ -12116,8 +12501,8 @@ function UserManagement() {
12116
12501
  /* @__PURE__ */ jsx("button", { className: "px-4 py-1.5 text-[10px] font-bold tracking-widest opacity-40 hover:opacity-100 transition-all", children: "LOCKED" })
12117
12502
  ] })
12118
12503
  ] }),
12119
- /* @__PURE__ */ jsx("div", { className: "surface-tile overflow-hidden", children: /* @__PURE__ */ jsxs("table", { className: "w-full text-left table-fixed", children: [
12120
- /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { className: "text-[var(--kyro-text-secondary)] font-bold text-[9px] tracking-[0.2em] uppercase border-b border-[var(--kyro-border)]", children: [
12504
+ /* @__PURE__ */ jsx("div", { className: "surface-tile overflow-x-auto", children: /* @__PURE__ */ jsxs("table", { className: "w-full text-left", children: [
12505
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { className: "text-[var(--kyro-text-secondary)] font-bold text-[9px] tracking-[0.2em] uppercase border-b border-[var(--kyro-border)] whitespace-nowrap", children: [
12121
12506
  /* @__PURE__ */ jsx("th", { className: "px-6 py-4 w-64", children: "Member Identity" }),
12122
12507
  /* @__PURE__ */ jsx("th", { className: "px-6 py-4", children: "Administrative Role" }),
12123
12508
  /* @__PURE__ */ jsx("th", { className: "px-6 py-4", children: "Security Status" }),
@@ -12848,6 +13233,7 @@ function useResourceManager(options) {
12848
13233
  await apiDelete(`${options.endpoint}/${id}`);
12849
13234
  setItems((prev) => prev.filter((item) => item.id !== id));
12850
13235
  options.onSuccess?.("delete", id);
13236
+ toast.success(`${resourceName} deleted`);
12851
13237
  } catch (e) {
12852
13238
  const message = e instanceof Error ? e.message : `Failed to delete ${resourceName}`;
12853
13239
  toast.error(message);
@@ -13076,12 +13462,12 @@ function WebhookManager() {
13076
13462
  ] })
13077
13463
  ] })
13078
13464
  ] }),
13079
- /* @__PURE__ */ jsxs("div", { className: "grid sm:grid-cols-3 gap-6 pt-2", children: [
13465
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 sm:grid-cols-3 gap-6 pt-2", children: [
13080
13466
  /* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
13081
13467
  /* @__PURE__ */ jsx("span", { className: "text-[9px] font-bold uppercase tracking-widest opacity-30", children: "Destination" }),
13082
13468
  /* @__PURE__ */ jsx("div", { className: "font-mono text-xs opacity-60 truncate max-w-[200px]", title: webhook.url, children: webhook.url })
13083
13469
  ] }),
13084
- /* @__PURE__ */ jsxs("div", { className: "space-y-1 border-l border-[var(--kyro-border)] pl-6", children: [
13470
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1 sm:border-l border-t sm:border-t-0 border-[var(--kyro-border)] pt-4 sm:pt-0 sm:pl-6 mt-4 sm:mt-0", children: [
13085
13471
  /* @__PURE__ */ jsx("span", { className: "text-[9px] font-bold uppercase tracking-widest opacity-30", children: "Events" }),
13086
13472
  /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-1", children: [
13087
13473
  webhook.events.slice(0, 2).map((event) => /* @__PURE__ */ jsx(Badge, { variant: "outline", className: "text-[8px] font-bold px-1.5 opacity-60", children: event }, event)),
@@ -13092,7 +13478,7 @@ function WebhookManager() {
13092
13478
  ] })
13093
13479
  ] })
13094
13480
  ] }),
13095
- /* @__PURE__ */ jsxs("div", { className: "space-y-1 border-l border-[var(--kyro-border)] pl-6", children: [
13481
+ /* @__PURE__ */ jsxs("div", { className: "space-y-1 sm:border-l border-t sm:border-t-0 border-[var(--kyro-border)] pt-4 sm:pt-0 sm:pl-6 mt-4 sm:mt-0", children: [
13096
13482
  /* @__PURE__ */ jsx("span", { className: "text-[9px] font-bold uppercase tracking-widest opacity-30", children: "Activity" }),
13097
13483
  /* @__PURE__ */ jsxs("div", { className: "text-[10px] font-bold opacity-60 flex items-center gap-1.5", children: [
13098
13484
  /* @__PURE__ */ jsx(Clock, { className: "w-3 h-3" }),
@@ -13195,7 +13581,7 @@ function WebhookManager() {
13195
13581
  ] }),
13196
13582
  /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
13197
13583
  /* @__PURE__ */ jsx("label", { className: "block text-xs font-bold mb-1.5 text-[var(--kyro-text-secondary)] uppercase tracking-wider", children: "Subscribed Events" }),
13198
- /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-4", children: eventOptions.map((opt) => /* @__PURE__ */ jsxs(
13584
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: eventOptions.map((opt) => /* @__PURE__ */ jsxs(
13199
13585
  "button",
13200
13586
  {
13201
13587
  type: "button",
@@ -13711,8 +14097,6 @@ function Admin({ config, theme = "light", onThemeChange }) {
13711
14097
  const [currentView, setCurrentView] = useState("list");
13712
14098
  const [activeDocumentId, setActiveDocumentId] = useState(null);
13713
14099
  const [isCommandPaletteOpen, setIsCommandPaletteOpen] = useState(false);
13714
- const toasts = useToastStore((state) => state.toasts);
13715
- const removeToast = useToastStore((state) => state.removeToast);
13716
14100
  useEffect(() => {
13717
14101
  const checkAuth = async () => {
13718
14102
  try {
@@ -13834,15 +14218,7 @@ function Admin({ config, theme = "light", onThemeChange }) {
13834
14218
  renderContent()
13835
14219
  ] }) }) }),
13836
14220
  /* @__PURE__ */ jsx(GlobalModal, {}),
13837
- /* @__PURE__ */ jsx("div", { className: "kyro-toasts-container", children: toasts.map((t) => /* @__PURE__ */ jsx(
13838
- Toast,
13839
- {
13840
- type: t.type,
13841
- message: t.message,
13842
- onClose: () => removeToast(t.id)
13843
- },
13844
- t.id
13845
- )) })
14221
+ /* @__PURE__ */ jsx(Toaster, {})
13846
14222
  ] }) });
13847
14223
  }
13848
14224
  function BulkActionsBar({