@diy-website-builder/sdk 0.1.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 +52 -0
- package/dist/diy-website-builder-editor.js +1021 -0
- package/dist/diy-website-builder-editor.js.LICENSE.txt +6 -0
- package/dist/index.d.ts +59 -0
- package/package.json +31 -0
package/README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# `@diy-website-builder/sdk`
|
|
2
|
+
|
|
3
|
+
Framework-agnostic **v3** visual website builder editor. Mounts into any `HTMLElement`.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @diy-website-builder/sdk
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import DIYWebsiteBuilderEditor from "@diy-website-builder/sdk";
|
|
15
|
+
|
|
16
|
+
const editor = new DIYWebsiteBuilderEditor.Builder({
|
|
17
|
+
apiKey: "YOUR_API_KEY",
|
|
18
|
+
shortId: "my-site",
|
|
19
|
+
container: document.getElementById("editor")!,
|
|
20
|
+
exitURL: "/dashboard",
|
|
21
|
+
onPublish: (url) => console.log("published", url),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
// later
|
|
25
|
+
editor.destroy();
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## API
|
|
29
|
+
|
|
30
|
+
| Option | Type | Required | Notes |
|
|
31
|
+
| --- | --- | --- | --- |
|
|
32
|
+
| `apiKey` | `string` | yes | Project API key |
|
|
33
|
+
| `shortId` | `string` | yes | Project short id |
|
|
34
|
+
| `container` | `HTMLElement` | yes | Mount node |
|
|
35
|
+
| `language` | `string` | no | UI language |
|
|
36
|
+
| `exitURL` | `string` | no | Exit / back navigation |
|
|
37
|
+
| `enableAI` | `boolean` | no | Enable AI / vibe features |
|
|
38
|
+
| `onPublish` | `(url?: string) => void` | no | After publish |
|
|
39
|
+
| `onPaidFeatureClick` | `(event) => void` | no | Upgrade / paywall hooks |
|
|
40
|
+
| `showMessage` | `(message, type, options?) => void` | no | Toast host |
|
|
41
|
+
|
|
42
|
+
Styles are injected by the bundle (`injectStyles`).
|
|
43
|
+
|
|
44
|
+
## Build (contributors)
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npm install
|
|
48
|
+
npm run build
|
|
49
|
+
npm run pack # writes a publishable .tgz under dist/package/
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
The published package ships only the UMD bundle + public `dist/index.d.ts` (no workspace `file:` dependencies).
|