@jsonpages/core 1.0.9 → 1.0.12
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 +9 -6
- package/dist/jsonpages-core.js +2666 -2718
- package/dist/jsonpages-core.umd.cjs +39 -39
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -56,15 +56,13 @@ declare interface AdminSidebarProps {
|
|
|
56
56
|
onAddSection?: () => void;
|
|
57
57
|
/** Whether there are unsaved changes (disables Bake HTML / Export JSON when false). */
|
|
58
58
|
hasChanges?: boolean;
|
|
59
|
-
/** Autosave to localStorage when on (default on). When off, draft is not persisted automatically. */
|
|
60
|
-
autosaveEnabled?: boolean;
|
|
61
|
-
/** Called when user toggles autosave. */
|
|
62
|
-
onAutosaveChange?: (enabled: boolean) => void;
|
|
63
59
|
/** Trigger Bake HTML (same as ControlBar). */
|
|
64
60
|
onExportHTML?: () => void;
|
|
65
61
|
/** Trigger Export JSON (same as ControlBar). */
|
|
66
62
|
onExportJSON?: () => void;
|
|
67
|
-
/**
|
|
63
|
+
/** Optional: save to repo (e.g. GitHub). When provided, "Salva su repo" is shown. */
|
|
64
|
+
onSaveToRepo?: () => void;
|
|
65
|
+
/** Restore page from file (resets in-memory draft for current slug). Hidden by default; set showResetToFile to display. */
|
|
68
66
|
onResetToFile?: () => void;
|
|
69
67
|
/** When true, shows the "Ripristina da file" button (default false = hidden). */
|
|
70
68
|
showResetToFile?: boolean;
|
|
@@ -284,7 +282,12 @@ export declare interface PageRendererProps {
|
|
|
284
282
|
export declare interface PersistenceConfig {
|
|
285
283
|
exportJSON: (state: ProjectState, slug: string) => Promise<void>;
|
|
286
284
|
exportHTML: (state: ProjectState, slug: string, cleanHtml: string) => void;
|
|
287
|
-
/**
|
|
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>;
|
|
287
|
+
/**
|
|
288
|
+
* Optional. If provided, flushes in-memory /uploaded-assets/ blobs to disk and returns oldUrl -> newUrl map.
|
|
289
|
+
* Omit when uploads write directly to disk (e.g. public/assets/images) and section data already stores final URLs.
|
|
290
|
+
*/
|
|
288
291
|
flushUploadedAssets?: (urls: string[]) => Promise<Record<string, string>>;
|
|
289
292
|
}
|
|
290
293
|
|