@fraczled/sdk 1.0.2 → 1.0.4

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
@@ -16,10 +16,7 @@ import { createFraczledEditor } from "@fraczled/sdk";
16
16
  const editor = createFraczledEditor({
17
17
  apiKey: "YOUR_LICENSE_KEY",
18
18
  projectId: "YOUR_PROJECT_ID",
19
- container: document.getElementById("editor"),
20
- services: {
21
- licenseEndpoint: "https://api.fraczled.com/api/license/validate",
22
- },
19
+ container: document.getElementById("editor")
23
20
  });
24
21
 
25
22
  // Listen for changes
@@ -55,7 +52,6 @@ interface EditorConfig {
55
52
  settings: DocumentSettings;
56
53
  };
57
54
  services?: {
58
- licenseEndpoint?: string;
59
55
  aiEndpoint?: string;
60
56
  unsplashProxyBaseUrl?: string;
61
57
  };
@@ -67,6 +63,7 @@ interface EditorConfig {
67
63
  injectBaseStyles?: boolean;
68
64
  showLoader?: boolean;
69
65
  };
66
+ customPanels?: CustomSidebarPanel[];
70
67
  }
71
68
  ```
72
69
 
@@ -76,6 +73,8 @@ By default, the SDK injects the Tailwind CDN and Google Fonts for convenience. F
76
73
  set `assets.injectTailwind = false` and provide your own CSS bundle (and optionally your own fonts)
77
74
  to avoid relying on external CDNs.
78
75
 
76
+ License validation is always handled by https://fraczled.com and requires outbound HTTPS access.
77
+
79
78
  ## License Keys
80
79
 
81
80
  ### Development Keys (dev\_\*)
@@ -132,6 +131,59 @@ Creates a new editor instance.
132
131
  - `select` - Fired when selection changes
133
132
  - `export` - Fired when user exports
134
133
 
134
+ ## Custom Sidebar Panels
135
+
136
+ You can add your own sidebar tools and panels inside the editor UI. Custom panels render inside the same side panel shell used by built-in tools, and receive access to the `store` and current `state`.
137
+
138
+ ```tsx
139
+ import { createFraczledEditor } from "@fraczled/sdk";
140
+ import { BadgeCheck } from "lucide-react";
141
+
142
+ const editor = createFraczledEditor({
143
+ apiKey: "YOUR_LICENSE_KEY",
144
+ projectId: "YOUR_PROJECT_ID",
145
+ container: document.getElementById("editor"),
146
+ customPanels: [
147
+ {
148
+ id: "my-product:approvals",
149
+ label: "Approvals",
150
+ icon: BadgeCheck,
151
+ feature: "approvals", // optional entitlement key
152
+ render: ({ store, state, closePanel, setActivePanel }) => (
153
+ <div className="space-y-4">
154
+ <div className="rounded-lg border border-slate-200 bg-slate-50 p-3 text-xs text-slate-600">
155
+ Selected elements: {state.selection.length}
156
+ </div>
157
+ <button
158
+ className="w-full rounded-lg bg-slate-900 px-3 py-2 text-sm font-semibold text-white"
159
+ onClick={() =>
160
+ store.addElement({
161
+ type: "text",
162
+ name: "Approved Copy",
163
+ content: "Approved Copy"
164
+ })
165
+ }
166
+ >
167
+ Insert Approved Copy
168
+ </button>
169
+ <button
170
+ className="w-full rounded-lg border border-slate-200 px-3 py-2 text-sm font-medium"
171
+ onClick={closePanel}
172
+ >
173
+ Close
174
+ </button>
175
+ </div>
176
+ )
177
+ }
178
+ ]
179
+ });
180
+ ```
181
+
182
+ Notes:
183
+ - `id` must be unique and should not match built-in tool labels (for example, `Design` or `Elements`).
184
+ - `feature` maps to `entitlements.features[feature]` and controls visibility/access based on licensing.
185
+ - `render` is called when the panel is active, so you can wire buttons directly to `store` methods or read from `state`.
186
+
135
187
  ## Support
136
188
 
137
189
  - Documentation: [fraczled.com/docs](https://fraczled.com/docs)
@@ -1,10 +1,9 @@
1
1
  import "react";
2
2
  import "react-dom/client";
3
- import { S as o, b as p, a as c, d } from "./index-B0_rImap.js";
3
+ import { S as o, b as p, a as c, d } from "./index-D13RaDcT.js";
4
4
  export {
5
5
  o as Store,
6
6
  p as createFraczledEditor,
7
7
  c as createOurEditorApp,
8
8
  d as createStore
9
9
  };
10
- //# sourceMappingURL=fraczled-sdk.es.js.map