@fraczled/sdk 1.30.3 → 1.30.8
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/README.md +61 -0
- package/dist/fraczled-sdk.es.js +1 -1
- package/dist/fraczled-sdk.umd.js +192 -192
- package/dist/{index-B5pLe-q9.js → index-DDpUxkLl.js} +8421 -8328
- package/dist/{index.es-DVW0Ygin.js → index.es-CxslRRpx.js} +1 -1
- package/index.d.ts +39 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -73,6 +73,7 @@ interface EditorConfig {
|
|
|
73
73
|
hideDefaultPanels?: boolean;
|
|
74
74
|
hiddenPanels?: PanelId[];
|
|
75
75
|
topbarMode?: 'default' | 'custom';
|
|
76
|
+
newDesignModal?: NewDesignModalConfig;
|
|
76
77
|
};
|
|
77
78
|
customPanels?: CustomSidebarPanel[];
|
|
78
79
|
}
|
|
@@ -244,6 +245,66 @@ createFraczledEditor({
|
|
|
244
245
|
|
|
245
246
|
Note: `ui.topbarMode = "custom"` is gated by the `topbarActions` plan feature.
|
|
246
247
|
|
|
248
|
+
### Custom new design modal (SDK only)
|
|
249
|
+
|
|
250
|
+
You can replace the Create New Design modal with your own UI:
|
|
251
|
+
|
|
252
|
+
```ts
|
|
253
|
+
createFraczledEditor({
|
|
254
|
+
apiKey: "YOUR_LICENSE_KEY",
|
|
255
|
+
projectId: "YOUR_PROJECT_ID",
|
|
256
|
+
container: document.getElementById("editor"),
|
|
257
|
+
ui: {
|
|
258
|
+
newDesignModal: {
|
|
259
|
+
render: ({ applySizePreset, onClose }) => (
|
|
260
|
+
<div className="fixed inset-0 bg-black/40 flex items-center justify-center">
|
|
261
|
+
<div className="bg-white rounded-xl p-6 space-y-3">
|
|
262
|
+
<button
|
|
263
|
+
onClick={() => {
|
|
264
|
+
applySizePreset({ name: "Product Card", width: 1200, height: 1200, unit: "px", dpi: 72 });
|
|
265
|
+
onClose();
|
|
266
|
+
}}
|
|
267
|
+
>
|
|
268
|
+
New Product Card
|
|
269
|
+
</button>
|
|
270
|
+
</div>
|
|
271
|
+
</div>
|
|
272
|
+
)
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
Note: `ui.newDesignModal.render` is gated by the `newDesignModal` plan feature.
|
|
279
|
+
|
|
280
|
+
### Custom template sizes (SDK only)
|
|
281
|
+
|
|
282
|
+
You can override the Social Media / Print size presets shown in the Create New Design modal:
|
|
283
|
+
|
|
284
|
+
```ts
|
|
285
|
+
createFraczledEditor({
|
|
286
|
+
apiKey: "YOUR_LICENSE_KEY",
|
|
287
|
+
projectId: "YOUR_PROJECT_ID",
|
|
288
|
+
container: document.getElementById("editor"),
|
|
289
|
+
ui: {
|
|
290
|
+
newDesignModal: {
|
|
291
|
+
sizePresets: {
|
|
292
|
+
social: [
|
|
293
|
+
{ name: "Square Ad", width: 1200, height: 1200, unit: "px", dpi: 72 }
|
|
294
|
+
],
|
|
295
|
+
print: [
|
|
296
|
+
{ name: "Box Sleeve", width: 8, height: 5, unit: "in", dpi: 300, bleed: 0.125 }
|
|
297
|
+
]
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
Notes:
|
|
305
|
+
- `unit` can be `px`, `in`, `mm`, or `pt`. `bleed` and `safeArea` (optional) use the same unit.
|
|
306
|
+
- Size presets are gated by the `templateSizes` plan feature.
|
|
307
|
+
|
|
247
308
|
### Hide built-in tabs (SDK only)
|
|
248
309
|
|
|
249
310
|
You can hide vanilla sidebar tabs in SDK embeds:
|
package/dist/fraczled-sdk.es.js
CHANGED