@kyro-cms/admin 0.11.6 → 0.12.1

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 (32) hide show
  1. package/dist/index.cjs +25 -25
  2. package/dist/index.d.cts +4 -2
  3. package/dist/index.d.ts +4 -2
  4. package/dist/index.js +20 -20
  5. package/package.json +1 -1
  6. package/src/components/ActionBar.tsx +35 -5
  7. package/src/components/AutoForm.tsx +97 -40
  8. package/src/components/DetailView.tsx +41 -0
  9. package/src/components/FieldRenderer.tsx +11 -0
  10. package/src/components/GraphQLPlayground.tsx +259 -12
  11. package/src/components/MediaGallery.tsx +65 -51
  12. package/src/components/WebhookManager.tsx +338 -188
  13. package/src/components/autoform/AutoFormHeader.tsx +19 -9
  14. package/src/components/autoform/ErrorBoundary.tsx +93 -0
  15. package/src/components/blocks/HeadingSubheadingBlock.tsx +2 -2
  16. package/src/components/blocks/HeroBlock.tsx +2 -2
  17. package/src/components/fields/BlocksField.tsx +69 -17
  18. package/src/components/fields/HeadingSubheadingField.tsx +2 -2
  19. package/src/components/fields/HeroField.tsx +4 -4
  20. package/src/components/fields/IconField.tsx +79 -0
  21. package/src/components/fields/RelationshipField.tsx +2 -2
  22. package/src/components/fields/UploadField.tsx +7 -5
  23. package/src/components/fields/extensions/blocksStore.ts +1 -1
  24. package/src/components/fields/index.ts +1 -0
  25. package/src/components/ui/BlockDrawer.tsx +39 -0
  26. package/src/components/ui/IconPickerModal.tsx +80 -0
  27. package/src/components/ui/ImageFocalEditor.tsx +112 -71
  28. package/src/components/ui/Modal.tsx +4 -2
  29. package/src/components/ui/icons.tsx +1 -1
  30. package/src/hooks/useAutoFormState.ts +51 -1
  31. package/src/integration.ts +4 -4
  32. package/src/pages/settings/[slug].astro +1 -1
@@ -0,0 +1,80 @@
1
+ import React, { useState, useMemo } from "react";
2
+ import { Modal } from "./Modal";
3
+ import * as LucideIcons from "lucide-react";
4
+ import { Search } from "./icons";
5
+
6
+ // Extract only valid components from lucide-react
7
+ const availableIcons = Object.keys(LucideIcons).filter((key) => {
8
+ return /^[A-Z]/.test(key) && key !== "LucideProps" && key !== "Icon";
9
+ });
10
+
11
+ interface IconPickerModalProps {
12
+ open: boolean;
13
+ onClose: () => void;
14
+ onSelect: (iconName: string) => void;
15
+ }
16
+
17
+ export function IconPickerModal({ open, onClose, onSelect }: IconPickerModalProps) {
18
+ const [search, setSearch] = useState("");
19
+
20
+ const filteredIcons = useMemo(() => {
21
+ if (!search) return availableIcons;
22
+ const lowerSearch = search.toLowerCase();
23
+ return availableIcons.filter((iconName) => iconName.toLowerCase().includes(lowerSearch));
24
+ }, [search]);
25
+
26
+ return (
27
+ <Modal
28
+ open={open}
29
+ onClose={onClose}
30
+ title="Select an Icon"
31
+ size="xl"
32
+ >
33
+ <div className="flex flex-col h-[60vh]">
34
+ <div className="relative mb-6">
35
+ <Search className="absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--kyro-text-muted)]" />
36
+ <input
37
+ type="text"
38
+ placeholder="Search icons..."
39
+ value={search}
40
+ onChange={(e) => setSearch(e.target.value)}
41
+ className="w-full pl-10 pr-4 py-3 bg-[var(--kyro-surface-accent)] border border-[var(--kyro-border)] rounded-xl focus:outline-none focus:ring-2 focus:ring-[var(--kyro-primary)] transition-all text-sm font-bold"
42
+ />
43
+ </div>
44
+
45
+ <div className="flex-1 overflow-y-auto min-h-0 custom-scrollbar pr-2">
46
+ {filteredIcons.length === 0 ? (
47
+ <div className="flex items-center justify-center h-full text-[var(--kyro-text-secondary)] font-medium">
48
+ No icons found
49
+ </div>
50
+ ) : (
51
+ <div className="grid grid-cols-4 sm:grid-cols-6 md:grid-cols-8 gap-3 pb-8">
52
+ {filteredIcons.map((iconName) => {
53
+ const IconComponent = (LucideIcons as any)[iconName];
54
+ // we store standard kebab-case in db
55
+ const kebabName = iconName
56
+ .replace(/([a-z])([A-Z])/g, "$1-$2")
57
+ .toLowerCase();
58
+
59
+ return (
60
+ <button
61
+ key={iconName}
62
+ type="button"
63
+ onClick={() => {
64
+ onSelect(kebabName);
65
+ onClose();
66
+ }}
67
+ className="flex flex-col items-center justify-center p-3 gap-2 rounded-md border border-[var(--kyro-border)] hover:bg-[var(--kyro-surface-accent)] hover:border-[var(--kyro-primary)] transition-all group"
68
+ title={iconName}
69
+ >
70
+ <IconComponent className="w-6 h-6 text-[var(--kyro-text-secondary)] group-hover:text-[var(--kyro-primary)] transition-colors" strokeWidth={1.5} />
71
+ </button>
72
+ );
73
+ })}
74
+ </div>
75
+ )}
76
+ </div>
77
+ </div>
78
+ </Modal>
79
+ );
80
+ }
@@ -1,7 +1,7 @@
1
- import React, { useState, useRef, useEffect, useCallback } from "react";
1
+ import React, { useState, useRef, useEffect, useCallback, useMemo } from "react";
2
2
  import ReactCrop, { type Crop } from "react-image-crop";
3
3
  import "react-image-crop/dist/ReactCrop.css";
4
- import { Crop as CropIcon, MousePointerClick, RefreshCcw } from "./icons";
4
+ import { Crop as CropIcon, MousePointerClick, RefreshCcw, Eye } from "./icons";
5
5
 
6
6
  interface RectPercent {
7
7
  x: number;
@@ -145,6 +145,19 @@ export function ImageFocalEditor({
145
145
  setShowHotspot(false);
146
146
  };
147
147
 
148
+ // Build preview URL with crop params
149
+ const previewUrl = useMemo(() => {
150
+ if (!crop || !crop.width || !crop.height) return null;
151
+ const params = new URLSearchParams({ url });
152
+ params.set("cx", String(crop.x));
153
+ params.set("cy", String(crop.y));
154
+ params.set("cw", String(crop.width));
155
+ params.set("ch", String(crop.height));
156
+ return `/api/media/resize?${params.toString()}`;
157
+ }, [url, crop]);
158
+
159
+ const hasCrop = crop?.width && crop.height;
160
+
148
161
  return (
149
162
  <div className="flex flex-col h-full bg-[var(--kyro-bg)]">
150
163
  {/* Toolbar */}
@@ -211,87 +224,115 @@ export function ImageFocalEditor({
211
224
  </div>
212
225
  </div>
213
226
 
214
- {/* Editor Area */}
215
- <div className="flex-1 w-full flex items-center justify-center p-8 overflow-hidden relative select-none">
216
- <div className="relative max-w-full max-h-full flex items-center justify-center" ref={containerRef}>
217
- <ReactCrop
218
- crop={crop}
219
- onChange={(c, pc) => setCrop(pc)} // Save percentage crop
220
- locked={mode === "hotspot"}
221
- className={mode === "hotspot" ? "opacity-70 transition-opacity" : "transition-opacity"}
222
- >
223
- <img
224
- ref={imgRef}
225
- src={url}
226
- alt="Focal Editor"
227
- className="max-h-[70vh] object-contain pointer-events-none"
228
- onLoad={onImageLoad}
229
- />
230
- </ReactCrop>
231
-
232
- {/* Hotspot Overlay */}
233
- {showHotspot && imgRef.current && (
234
- <div
235
- className="absolute inset-0 z-10 pointer-events-none flex items-center justify-center"
227
+ {/* Editor + Preview Area */}
228
+ <div className="flex-1 flex overflow-hidden">
229
+ {/* Editor (left) */}
230
+ <div className="flex-1 w-full flex items-center justify-center p-8 overflow-hidden relative select-none">
231
+ <div className="relative max-w-full max-h-full flex items-center justify-center" ref={containerRef}>
232
+ <ReactCrop
233
+ crop={crop}
234
+ onChange={(c, pc) => setCrop(pc)} // Save percentage crop
235
+ locked={mode === "hotspot"}
236
+ className={mode === "hotspot" ? "opacity-70 transition-opacity" : "transition-opacity"}
236
237
  >
237
- {/* Overlay that matches the image dimensions exactly */}
238
- <div
239
- className="relative"
240
- style={{
241
- width: imgRef.current.width,
242
- height: imgRef.current.height
243
- }}
238
+ <img
239
+ ref={imgRef}
240
+ src={url}
241
+ alt="Focal Editor"
242
+ className="max-h-[70vh] object-contain pointer-events-none"
243
+ onLoad={onImageLoad}
244
+ />
245
+ </ReactCrop>
246
+
247
+ {/* Hotspot Overlay */}
248
+ {showHotspot && imgRef.current && (
249
+ <div
250
+ className="absolute inset-0 z-10 pointer-events-none flex items-center justify-center"
244
251
  >
245
- <div
246
- className={`absolute border-2 shadow-2xl transition-colors duration-200 ${
247
- mode === "hotspot"
248
- ? "border-blue-500 bg-blue-500/20 cursor-move pointer-events-auto shadow-blue-500/50"
249
- : "border-blue-500/50 bg-blue-500/10 pointer-events-none"
250
- }`}
251
- style={{
252
- left: `${hotspot.x}%`,
253
- top: `${hotspot.y}%`,
254
- width: `${hotspot.width}%`,
255
- height: `${hotspot.height}%`,
256
- borderRadius: "50%",
252
+ {/* Overlay that matches the image dimensions exactly */}
253
+ <div
254
+ className="relative"
255
+ style={{
256
+ width: imgRef.current.width,
257
+ height: imgRef.current.height
257
258
  }}
258
- onPointerDown={(e) => handlePointerDown(e)}
259
259
  >
260
- {/* Center dot */}
261
- <div className="absolute top-1/2 left-1/2 w-2 h-2 -ml-1 -mt-1 bg-blue-500 rounded-full"></div>
262
-
263
- {/* Resize handles */}
264
- {mode === "hotspot" && (
265
- <>
266
- <div
267
- className="absolute top-0 left-1/2 w-4 h-4 -ml-2 -mt-2 bg-blue-500 rounded-full cursor-ns-resize"
268
- onPointerDown={(e) => handlePointerDown(e, "n")}
269
- />
270
- <div
271
- className="absolute bottom-0 left-1/2 w-4 h-4 -ml-2 -mb-2 bg-blue-500 rounded-full cursor-ns-resize"
272
- onPointerDown={(e) => handlePointerDown(e, "s")}
273
- />
274
- <div
275
- className="absolute top-1/2 left-0 w-4 h-4 -ml-2 -mt-2 bg-blue-500 rounded-full cursor-ew-resize"
276
- onPointerDown={(e) => handlePointerDown(e, "w")}
277
- />
278
- <div
279
- className="absolute top-1/2 right-0 w-4 h-4 -mr-2 -mt-2 bg-blue-500 rounded-full cursor-ew-resize"
280
- onPointerDown={(e) => handlePointerDown(e, "e")}
281
- />
282
- </>
283
- )}
260
+ <div
261
+ className={`absolute border-2 shadow-2xl transition-colors duration-200 ${
262
+ mode === "hotspot"
263
+ ? "border-blue-500 bg-blue-500/20 cursor-move pointer-events-auto shadow-blue-500/50"
264
+ : "border-blue-500/50 bg-blue-500/10 pointer-events-none"
265
+ }`}
266
+ style={{
267
+ left: `${hotspot.x}%`,
268
+ top: `${hotspot.y}%`,
269
+ width: `${hotspot.width}%`,
270
+ height: `${hotspot.height}%`,
271
+ borderRadius: "50%",
272
+ }}
273
+ onPointerDown={(e) => handlePointerDown(e)}
274
+ >
275
+ {/* Center dot */}
276
+ <div className="absolute top-1/2 left-1/2 w-2 h-2 -ml-1 -mt-1 bg-blue-500 rounded-full"></div>
277
+
278
+ {/* Resize handles */}
279
+ {mode === "hotspot" && (
280
+ <>
281
+ <div
282
+ className="absolute top-0 left-1/2 w-4 h-4 -ml-2 -mt-2 bg-blue-500 rounded-full cursor-ns-resize"
283
+ onPointerDown={(e) => handlePointerDown(e, "n")}
284
+ />
285
+ <div
286
+ className="absolute bottom-0 left-1/2 w-4 h-4 -ml-2 -mb-2 bg-blue-500 rounded-full cursor-ns-resize"
287
+ onPointerDown={(e) => handlePointerDown(e, "s")}
288
+ />
289
+ <div
290
+ className="absolute top-1/2 left-0 w-4 h-4 -ml-2 -mt-2 bg-blue-500 rounded-full cursor-ew-resize"
291
+ onPointerDown={(e) => handlePointerDown(e, "w")}
292
+ />
293
+ <div
294
+ className="absolute top-1/2 right-0 w-4 h-4 -mr-2 -mt-2 bg-blue-500 rounded-full cursor-ew-resize"
295
+ onPointerDown={(e) => handlePointerDown(e, "e")}
296
+ />
297
+ </>
298
+ )}
299
+ </div>
284
300
  </div>
285
301
  </div>
286
- </div>
287
- )}
302
+ )}
303
+ </div>
288
304
  </div>
305
+
306
+ {/* Preview (right) */}
307
+ {hasCrop && (
308
+ <div className="w-[280px] border-l border-[var(--kyro-border)] bg-[var(--kyro-surface)] flex flex-col overflow-hidden">
309
+ <div className="flex items-center gap-2 px-4 py-3 border-b border-[var(--kyro-border)]">
310
+ <Eye className="w-4 h-4 text-[var(--kyro-text-secondary)]" />
311
+ <span className="text-xs font-bold text-[var(--kyro-text-secondary)] tracking-wide uppercase">
312
+ Preview
313
+ </span>
314
+ </div>
315
+ <div className="flex-1 flex items-center justify-center p-4 overflow-hidden">
316
+ {previewUrl && (
317
+ <img
318
+ src={previewUrl}
319
+ alt="Crop preview"
320
+ className="max-w-full max-h-full object-contain rounded-lg shadow-lg border border-[var(--kyro-border)]"
321
+ />
322
+ )}
323
+ </div>
324
+ <div className="px-4 py-3 border-t border-[var(--kyro-border)] text-[10px] text-[var(--kyro-text-secondary)] font-mono">
325
+ <div>x: {crop?.x?.toFixed(1)}% y: {crop?.y?.toFixed(1)}%</div>
326
+ <div>w: {crop?.width?.toFixed(1)}% h: {crop?.height?.toFixed(1)}%</div>
327
+ </div>
328
+ </div>
329
+ )}
289
330
  </div>
290
331
 
291
332
  {/* Help Text */}
292
333
  <div className="p-4 text-center bg-[var(--kyro-surface-accent)] border-t border-[var(--kyro-border)] text-sm text-[var(--kyro-text-secondary)]">
293
334
  {mode === "crop"
294
- ? "Drag to define the crop area. This creates a bounding box for the image."
335
+ ? "Drag to define the crop area. The preview panel shows the result in real-time."
295
336
  : "Drag the circle to define the focal hotspot. This area will always remain visible when the image is resized."}
296
337
  </div>
297
338
  </div>
@@ -18,7 +18,7 @@ interface ModalProps {
18
18
  title: string;
19
19
  children: ReactNode;
20
20
  footer?: ReactNode;
21
- size?: "sm" | "md" | "lg" | "full";
21
+ size?: "sm" | "md" | "lg" | "xl" | "2xl" | "full";
22
22
  variant?: "default" | "danger" | "lightbox";
23
23
  }
24
24
 
@@ -28,7 +28,7 @@ export function Modal({
28
28
  title,
29
29
  children,
30
30
  footer,
31
- size = "md",
31
+ size = "lg",
32
32
  variant = "default",
33
33
  }: ModalProps) {
34
34
  useEffect(() => {
@@ -53,6 +53,8 @@ export function Modal({
53
53
  sm: "max-w-sm",
54
54
  md: "max-w-md",
55
55
  lg: "max-w-lg",
56
+ xl: "max-w-xl",
57
+ "2xl": "max-w-2xl",
56
58
  full: "w-full h-full max-w-none rounded-none border-0",
57
59
  };
58
60
 
@@ -110,4 +110,4 @@ export { Grid3X3 as IconGrid3X3 } from "lucide-react";
110
110
  // Direct re-exports for files that still use original lucide-react names
111
111
  export { Activity as Activity, AlignLeft as AlignLeft, Archive as Archive, ArrowDown as ArrowDown, ArrowRight as ArrowRight, ArrowUpRight as ArrowUpRight, Blocks as Blocks, Box as Box, Calendar as Calendar, Check as Check, ChevronDown as ChevronDown, ChevronLeft as ChevronLeft, ChevronRight as ChevronRight, ChevronUp as ChevronUp, Clock as Clock, Code as Code, Columns3 as Columns3, Copy as Copy, Crop as Crop, Download as Download, ExternalLink as ExternalLink, Eye as Eye, EyeOff as EyeOff, File as File, File as FileIcon, FileText as FileText, Globe as Globe, Film as Film, Filter as Filter, Folder as Folder, FolderInput as FolderInput, FolderPlus as FolderPlus, GripVertical as GripVertical, Heading1 as Heading1, Image as Image, Info as Info, Key as Key, LayoutDashboard as LayoutDashboard, Link as Link, Link2 as Link2, List as List, ListOrdered as ListOrdered, Lock as Lock, Mail as Mail, Maximize2 as Maximize2, Menu as Menu, Minus as Minus, Monitor as Monitor, MousePointerClick as MousePointerClick, Music as Music, Palette as Palette, Pause as Pause, Play as Play, Plus as Plus, RefreshCcw as RefreshCcw, RefreshCw as RefreshCw, Save as Save, Search as Search, Send as Send, Settings as Settings, Shield as Shield, Sparkles as Sparkles, Star as Star, Tag as Tag, Terminal as Terminal, ToggleLeft as ToggleLeft, ToggleRight as ToggleRight, Trash2 as Trash2, TrendingUp as TrendingUp, Type as Type, User as User, UserPlus as UserPlus, Users as Users, Video as Video, Webhook as Webhook, X as X, Zap as Zap, CircleHelp as HelpCircle } from "lucide-react";
112
112
  export { CircleCheck as CheckCircle2, Grid3X3 as Grid, House as Home, LayoutPanelTop as Layout, LoaderCircle as Loader2, LockOpen as Unlock, CirclePlay as PlayCircle, TriangleAlert as AlertTriangle, CodeXml as Code2, CloudDownload as DownloadCloud, EllipsisVertical as MoreVertical, ShieldCheck as ShieldCheck, ShieldAlert as ShieldAlert, Pencil as Edit2, Moon as Moon, Sun as Sun, LogOut as LogOut, Database as Database, Hexagon as Hexagon, Network as Network, Book as Book, Bold as Bold, Italic as Italic, Underline as Underline, Strikethrough as Strikethrough, Undo as Undo, Redo as Redo, Dot as Dot, Grid3X3, Laptop as Laptop, Smartphone as Smartphone } from "lucide-react";
113
- export { Server as Server, XCircle as XCircle, Clipboard as Clipboard, Upload as Upload } from "lucide-react";
113
+ export { Server as Server, XCircle as XCircle, Clipboard as Clipboard, ClipboardPaste as ClipboardPaste, ClipboardCopy as ClipboardCopy, Upload as Upload } from "lucide-react";
@@ -151,7 +151,7 @@ const persistBrowserDraft = useCallback(
151
151
  const latestFormData = state.formData;
152
152
  const currentLastSaved = state.lastSavedData;
153
153
 
154
- if (autoSaveSkipRef.current || (!versionsEnabled && !!globalSlug)) return;
154
+ if (autoSaveSkipRef.current) return;
155
155
  if (!globalSlug && (!collectionSlug || !latestFormData.id)) return;
156
156
  if (!state.hasDirtyFields()) return;
157
157
 
@@ -169,6 +169,10 @@ const persistBrowserDraft = useCallback(
169
169
  setAutoSaveStatus("saving");
170
170
  state.setBackgroundProcessing(true);
171
171
 
172
+ if (globalSlug) {
173
+ window.dispatchEvent(new Event("kyro:global-save-start"));
174
+ }
175
+
172
176
  try {
173
177
  const url = globalSlug
174
178
  ? resolveUrl(`/api/globals/${globalSlug}?autosave=true`)
@@ -226,6 +230,9 @@ const persistBrowserDraft = useCallback(
226
230
  setAutoSaveStatus("offline");
227
231
  }
228
232
  } finally {
233
+ if (globalSlug) {
234
+ window.dispatchEvent(new Event("kyro:global-save-end"));
235
+ }
229
236
  setIsAutoSaving(false);
230
237
  useAutoFormStore.getState().setBackgroundProcessing(false);
231
238
  }
@@ -287,6 +294,48 @@ const persistBrowserDraft = useCallback(
287
294
  [collectionSlug, globalSlug, setAutoSaveStatus],
288
295
  );
289
296
 
297
+ // Force-save: retries without baseUpdatedAt to bypass OCC (conflict override)
298
+ const forceSave = useCallback(
299
+ async (isDraft = true) => {
300
+ const state = useAutoFormStore.getState();
301
+ const payload = state.formData;
302
+
303
+ const url = globalSlug
304
+ ? resolveUrl(`/api/globals/${globalSlug}`)
305
+ : resolveUrl(`/api/${collectionSlug}/${payload.id}`);
306
+
307
+ const response = await fetchWithAuth(
308
+ url,
309
+ {
310
+ method: "PATCH",
311
+ headers: {
312
+ "Content-Type": "application/json",
313
+ "X-Draft": String(isDraft),
314
+ },
315
+ body: JSON.stringify({
316
+ ...normalizeUploadFields(payload) as Record<string, unknown>,
317
+ }),
318
+ },
319
+ );
320
+
321
+ if (response.ok) {
322
+ const result = await response.json();
323
+ const savedData = result.data || payload;
324
+ state.setFormData({ ...payload, ...savedData });
325
+ state.setLastSavedData({ ...payload, ...savedData });
326
+ setAutoSaveStatus("success");
327
+ setTimeout(() => {
328
+ if (useAutoFormStore.getState().autoSaveStatus === "success") {
329
+ setAutoSaveStatus("idle");
330
+ }
331
+ }, 2000);
332
+ }
333
+
334
+ return response;
335
+ },
336
+ [collectionSlug, globalSlug, setAutoSaveStatus],
337
+ );
338
+
290
339
  // Track sidebar toggle
291
340
  useEffect(() => {
292
341
  const handleToggle = () => {
@@ -527,6 +576,7 @@ const persistBrowserDraft = useCallback(
527
576
  fetchVersions,
528
577
  performAutoSave: performAutosave,
529
578
  saveDocument,
579
+ forceSave,
530
580
  autoSaveSkipRef,
531
581
  lastAutoSaveTimeRef,
532
582
  documentStatus,
@@ -141,11 +141,11 @@ export function kyroAdmin(options: KyroAdminOptions = {}): AstroIntegration {
141
141
  ];
142
142
  for (const col of (configResult.collections || [])) {
143
143
  if (col.seo) {
144
- const mainTabsField = col.fields?.find((f: any) => f.type === 'tabs' && f.name === 'mainTabs');
145
- if (mainTabsField?.tabs) {
144
+ const tabsField = col.fields?.find((f: any) => f.type === 'tabs' && f.name === 'tabs');
145
+ if (tabsField?.tabs) {
146
146
  // Only add if not already injected (avoid duplicates on hot-reload)
147
- if (!mainTabsField.tabs.find((t: any) => t.label === 'SEO Settings')) {
148
- mainTabsField.tabs.push({ label: "SEO Settings", fields: seoFields });
147
+ if (!tabsField.tabs.find((t: any) => t.label === 'SEO Settings')) {
148
+ tabsField.tabs.push({ label: "SEO Settings", fields: seoFields });
149
149
  }
150
150
  }
151
151
  }
@@ -118,7 +118,7 @@ const description =
118
118
  window.addEventListener("kyro:global-save-start", () => {
119
119
  if (saveBtn) {
120
120
  saveBtn.disabled = true;
121
- saveBtn.innerHTML = "Saving...";
121
+ saveBtn.innerHTML = `<svg class="animate-spin -ml-1 mr-2 h-4 w-4 text-white inline-block" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path></svg>Saving...`;
122
122
  saveBtn.classList.add("opacity-50", "cursor-wait");
123
123
  }
124
124
  });