@jsonpages/core 1.0.2 → 1.0.3

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
@@ -60,6 +60,20 @@ declare interface AdminSidebarProps {
60
60
  onExportHTML?: () => void;
61
61
  /** Trigger Export JSON (same as ControlBar). */
62
62
  onExportJSON?: () => void;
63
+ /** Restore page from file (clears localStorage draft for current slug). Hidden by default; set showResetToFile to display. */
64
+ onResetToFile?: () => void;
65
+ /** When true, shows the "Ripristina da file" button (default false = hidden). */
66
+ showResetToFile?: boolean;
67
+ }
68
+
69
+ /** Optional config for the Image Picker (gallery from assets, save to assets). */
70
+ export declare interface AssetsConfig {
71
+ /** Base URL for assets (e.g. "/assets"). Used to resolve library image URLs and display gallery. */
72
+ assetsBaseUrl?: string;
73
+ /** Library images for the picker "Libreria" tab. Tenant can build from public/assets or provide a static list. */
74
+ assetsManifest?: LibraryImageEntry[];
75
+ /** Optional: upload file to tenant assets and return the public URL. If omitted, upload tab uses data URL. */
76
+ onAssetUpload?: (file: File) => Promise<string>;
63
77
  }
64
78
 
65
79
  /**
@@ -104,10 +118,12 @@ export declare interface ConfigContextValue {
104
118
  schemas: Schemas;
105
119
  /** For asset resolution (e.g. image picker preview). */
106
120
  tenantId?: string;
121
+ /** Optional assets config for Image Picker (gallery, upload). */
122
+ assets?: AssetsConfig;
107
123
  }
108
124
 
109
125
  export declare const ConfigProvider: default_2.FC<{
110
- config: Pick<JsonPagesConfig, 'registry' | 'schemas' | 'tenantId'>;
126
+ config: Pick<JsonPagesConfig, 'registry' | 'schemas' | 'tenantId' | 'assets'>;
111
127
  children: default_2.ReactNode;
112
128
  }>;
113
129
 
@@ -170,7 +186,7 @@ export declare const InputWidgets: {
170
186
  readonly 'ui:textarea': ({ label, value, onChange }: BaseWidgetProps<string>) => JSX.Element;
171
187
  readonly 'ui:select': ({ label, value, onChange, options }: BaseWidgetProps<string>) => JSX.Element;
172
188
  readonly 'ui:checkbox': ({ label, value, onChange }: BaseWidgetProps<boolean>) => JSX.Element;
173
- readonly 'ui:image-picker': ({ label, value, onChange }: BaseWidgetProps<string>) => JSX.Element;
189
+ readonly 'ui:image-picker': ({ label, value, onChange }: BaseWidgetProps<unknown>) => JSX.Element;
174
190
  readonly 'ui:icon-picker': ({ label, value, onChange }: BaseWidgetProps<string>) => JSX.Element;
175
191
  };
176
192
 
@@ -198,6 +214,8 @@ export declare interface JsonPagesConfig {
198
214
  NotFoundComponent?: default_2.ComponentType;
199
215
  /** Optional "Add section" library config (labels, addable types, default data). */
200
216
  addSection?: AddSectionConfig;
217
+ /** Optional assets config for Image Picker (gallery, upload target). */
218
+ assets?: AssetsConfig;
201
219
  }
202
220
 
203
221
  export declare function JsonPagesEngine({ config }: JsonPagesEngineProps): JSX.Element;
@@ -213,6 +231,14 @@ export declare interface LayerItem {
213
231
  title?: string;
214
232
  }
215
233
 
234
+ /** Image entry for the Image Picker Library tab (from tenant assets or manifest). */
235
+ export declare interface LibraryImageEntry {
236
+ id: string;
237
+ url: string;
238
+ alt: string;
239
+ tags?: string[];
240
+ }
241
+
216
242
  export declare interface MenuConfig {
217
243
  main: MenuItem[];
218
244
  }