@fraczled/sdk 1.30.2 → 1.30.6

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 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
  }
@@ -201,6 +202,26 @@ Notes:
201
202
  - `feature` maps to `entitlements.features[feature]` and controls visibility/access based on licensing.
202
203
  - `render` is called when the panel is active, so you can wire buttons directly to `store` methods or read from `state`.
203
204
 
205
+ ### Template save action (SDK only)
206
+
207
+ You can customize the "Save Current Design as Template" button in the Templates → Designs panel:
208
+
209
+ ```ts
210
+ createFraczledEditor({
211
+ apiKey: "YOUR_LICENSE_KEY",
212
+ projectId: "YOUR_PROJECT_ID",
213
+ container: document.getElementById("editor"),
214
+ customTemplates: {
215
+ saveAction: {
216
+ label: "Save as Brand Template",
217
+ onClick: ({ openSaveModal }) => openSaveModal()
218
+ }
219
+ }
220
+ });
221
+ ```
222
+
223
+ Note: This action is gated by the `templateSave` plan feature.
224
+
204
225
  ### Custom topbar actions (SDK only)
205
226
 
206
227
  You can replace the default topbar actions (save/new/export/undo/redo/zoom) with your own UI:
@@ -224,6 +245,66 @@ createFraczledEditor({
224
245
 
225
246
  Note: `ui.topbarMode = "custom"` is gated by the `topbarActions` plan feature.
226
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
+
227
308
  ### Hide built-in tabs (SDK only)
228
309
 
229
310
  You can hide vanilla sidebar tabs in SDK embeds:
@@ -1,6 +1,6 @@
1
1
  import "react";
2
2
  import "react-dom/client";
3
- import { S as o, b as p, a as c, d } from "./index-H9Vygg46.js";
3
+ import { S as o, b as p, a as c, d } from "./index-BMcZvArF.js";
4
4
  export {
5
5
  o as Store,
6
6
  p as createFraczledEditor,