@fraczled/sdk 1.22.0 → 1.24.0

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
@@ -8,6 +8,12 @@ Embed a powerful design editor in your application with the Fraczled SDK.
8
8
  npm install @fraczled/sdk
9
9
  ```
10
10
 
11
+ ## Server-gated delivery (required)
12
+
13
+ To prevent unauthorized usage, always gate the SDK bundle through your backend.
14
+ Use `/api/editor/init` to validate the license, then serve the SDK from `/api/editor/sdk`.
15
+ See `docs/license-enforcement.md` for the full flow.
16
+
11
17
  ## Quick Start
12
18
 
13
19
  ```typescript
@@ -63,6 +69,10 @@ interface EditorConfig {
63
69
  injectBaseStyles?: boolean;
64
70
  showLoader?: boolean;
65
71
  };
72
+ ui?: {
73
+ hideDefaultPanels?: boolean;
74
+ hiddenPanels?: PanelId[];
75
+ };
66
76
  customPanels?: CustomSidebarPanel[];
67
77
  }
68
78
  ```
@@ -188,6 +198,51 @@ Notes:
188
198
  - `feature` maps to `entitlements.features[feature]` and controls visibility/access based on licensing.
189
199
  - `render` is called when the panel is active, so you can wire buttons directly to `store` methods or read from `state`.
190
200
 
201
+ ### Hide built-in tabs (SDK only)
202
+
203
+ You can hide vanilla sidebar tabs in SDK embeds:
204
+
205
+ ```ts
206
+ import { createFraczledEditor, ToolType } from "@fraczled/sdk";
207
+
208
+ createFraczledEditor({
209
+ apiKey: "YOUR_LICENSE_KEY",
210
+ projectId: "YOUR_PROJECT_ID",
211
+ container: document.getElementById("editor"),
212
+ ui: {
213
+ hideDefaultPanels: true,
214
+ // or hide specific tabs:
215
+ // hiddenPanels: [ToolType.IMAGES, ToolType.BRAND, "my-product:approvals"]
216
+ },
217
+ customPanels: [
218
+ {
219
+ id: "my-product:approvals",
220
+ label: "Approvals",
221
+ render: ({ store }) => (
222
+ <button onClick={() => store.exportJSON()}>Export JSON</button>
223
+ )
224
+ }
225
+ ]
226
+ });
227
+ ```
228
+
229
+ Notes:
230
+ - `hiddenPanels` applies to both default and custom panels by id.
231
+ - Removing the `ui` config restores the vanilla sidebar.
232
+ - Hiding tabs is UI-only; it does not disable underlying features.
233
+
234
+ Built-in panel IDs you can hide:
235
+ - `ToolType.TEMPLATES` (label: Create)
236
+ - `ToolType.DESIGN`
237
+ - `ToolType.ELEMENTS`
238
+ - `ToolType.DRAW`
239
+ - `ToolType.TEXT`
240
+ - `ToolType.IMAGES`
241
+ - `ToolType.BRAND`
242
+ - `ToolType.UPLOADS`
243
+ - `ToolType.QR_CODE`
244
+ - `ToolType.LAYERS`
245
+
191
246
  ## Support
192
247
 
193
248
  - Documentation: [fraczled.com/docs](https://fraczled.com/docs)
@@ -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-k1BSXNWh.js";
3
+ import { S as o, b as p, a as c, d } from "./index-lfj94R-C.js";
4
4
  export {
5
5
  o as Store,
6
6
  p as createFraczledEditor,