@jsonpages/core 1.0.12 → 1.0.15

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.d.ts CHANGED
@@ -58,10 +58,10 @@ declare interface AdminSidebarProps {
58
58
  hasChanges?: boolean;
59
59
  /** Trigger Bake HTML (same as ControlBar). */
60
60
  onExportHTML?: () => void;
61
- /** Trigger Export JSON (same as ControlBar). */
62
- onExportJSON?: () => void;
63
- /** Optional: save to repo (e.g. GitHub). When provided, "Salva su repo" is shown. */
64
- onSaveToRepo?: () => void;
61
+ /** Save to file (writes JSON to repo via server). Replaces Export JSON in sidebar when provided. */
62
+ onSaveToFile?: () => void;
63
+ /** When true, show "Salvato" in the status bar (e.g. for 2s after save-to-file succeeds). */
64
+ saveSuccessFeedback?: boolean;
65
65
  /** Restore page from file (resets in-memory draft for current slug). Hidden by default; set showResetToFile to display. */
66
66
  onResetToFile?: () => void;
67
67
  /** When true, shows the "Ripristina da file" button (default false = hidden). */
@@ -282,8 +282,11 @@ export declare interface PageRendererProps {
282
282
  export declare interface PersistenceConfig {
283
283
  exportJSON: (state: ProjectState, slug: string) => Promise<void>;
284
284
  exportHTML: (state: ProjectState, slug: string, cleanHtml: string) => void;
285
- /** Optional: save state to remote (e.g. Git repo). When provided, "Salva su repo" is shown. */
286
- saveToRepo?: (state: ProjectState, slug: string) => Promise<void>;
285
+ /**
286
+ * Optional. Save current state to repo files (e.g. POST to /api/save-to-file); server writes
287
+ * src/data/config/*.json and src/data/pages/<slug>.json. No git push.
288
+ */
289
+ saveToFile?: (state: ProjectState, slug: string) => Promise<void>;
287
290
  /**
288
291
  * Optional. If provided, flushes in-memory /uploaded-assets/ blobs to disk and returns oldUrl -> newUrl map.
289
292
  * Omit when uploads write directly to disk (e.g. public/assets/images) and section data already stores final URLs.