@jsonpages/core 1.0.11 → 1.0.14

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,8 +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;
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;
63
65
  /** Restore page from file (resets in-memory draft for current slug). Hidden by default; set showResetToFile to display. */
64
66
  onResetToFile?: () => void;
65
67
  /** When true, shows the "Ripristina da file" button (default false = hidden). */
@@ -280,6 +282,11 @@ export declare interface PageRendererProps {
280
282
  export declare interface PersistenceConfig {
281
283
  exportJSON: (state: ProjectState, slug: string) => Promise<void>;
282
284
  exportHTML: (state: ProjectState, slug: string, cleanHtml: string) => 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>;
283
290
  /**
284
291
  * Optional. If provided, flushes in-memory /uploaded-assets/ blobs to disk and returns oldUrl -> newUrl map.
285
292
  * Omit when uploads write directly to disk (e.g. public/assets/images) and section data already stores final URLs.