@qarakash/blockwriteai 1.0.10 → 1.0.11
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 +35 -16
- package/dist/blockwriteai.min.js +1 -1
- package/dist/plugins/blockwriteai-ai.min.js +1 -1
- package/package.json +1 -1
- package/types/index.d.ts +6 -0
package/README.md
CHANGED
|
@@ -9,13 +9,13 @@ Use the free core editor for normal documents. Serve premium tools such as AI, M
|
|
|
9
9
|
Add the stylesheet, editor script, and free plugin bundle:
|
|
10
10
|
|
|
11
11
|
```html
|
|
12
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@qarakash/blockwriteai@1.0.
|
|
12
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@qarakash/blockwriteai@1.0.11/dist/blockwriteai.min.css">
|
|
13
13
|
|
|
14
14
|
<div id="editor"></div>
|
|
15
15
|
|
|
16
|
-
<script src="https://cdn.jsdelivr.net/npm/@qarakash/blockwriteai@1.0.
|
|
17
|
-
<script src="https://cdn.jsdelivr.net/npm/@qarakash/blockwriteai@1.0.
|
|
18
|
-
<script src="https://cdn.jsdelivr.net/npm/@qarakash/blockwriteai@1.0.
|
|
16
|
+
<script src="https://cdn.jsdelivr.net/npm/@qarakash/blockwriteai@1.0.11/dist/blockwriteai.min.js"></script>
|
|
17
|
+
<script src="https://cdn.jsdelivr.net/npm/@qarakash/blockwriteai@1.0.11/dist/plugins/blockwriteai-code-assist.min.js"></script>
|
|
18
|
+
<script src="https://cdn.jsdelivr.net/npm/@qarakash/blockwriteai@1.0.11/dist/plugins/blockwriteai-advanced-blocks.min.js"></script>
|
|
19
19
|
<script>
|
|
20
20
|
const editor = new BlockWriteAI({
|
|
21
21
|
holder: "#editor",
|
|
@@ -34,16 +34,26 @@ Add the stylesheet, editor script, and free plugin bundle:
|
|
|
34
34
|
Use these CDN URLs for production:
|
|
35
35
|
|
|
36
36
|
```text
|
|
37
|
-
https://cdn.jsdelivr.net/npm/@qarakash/blockwriteai@1.0.
|
|
38
|
-
https://cdn.jsdelivr.net/npm/@qarakash/blockwriteai@1.0.
|
|
39
|
-
https://cdn.jsdelivr.net/npm/@qarakash/blockwriteai@1.0.
|
|
40
|
-
https://cdn.jsdelivr.net/npm/@qarakash/blockwriteai@1.0.
|
|
37
|
+
https://cdn.jsdelivr.net/npm/@qarakash/blockwriteai@1.0.11/dist/blockwriteai.min.css
|
|
38
|
+
https://cdn.jsdelivr.net/npm/@qarakash/blockwriteai@1.0.11/dist/blockwriteai.min.js
|
|
39
|
+
https://cdn.jsdelivr.net/npm/@qarakash/blockwriteai@1.0.11/dist/plugins/blockwriteai-code-assist.min.js
|
|
40
|
+
https://cdn.jsdelivr.net/npm/@qarakash/blockwriteai@1.0.11/dist/plugins/blockwriteai-advanced-blocks.min.js
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
Optional history plugin:
|
|
44
44
|
|
|
45
45
|
```html
|
|
46
|
-
<script src="https://cdn.jsdelivr.net/npm/@qarakash/blockwriteai@1.0.
|
|
46
|
+
<script src="https://cdn.jsdelivr.net/npm/@qarakash/blockwriteai@1.0.11/dist/plugins/blockwriteai-history.min.js"></script>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Premium CDN integrations should load licensed plugins and verify usage through the production BlockWriteAI Platform:
|
|
50
|
+
|
|
51
|
+
```js
|
|
52
|
+
await BlockWriteAI.loadPremiumPlugins({
|
|
53
|
+
licenseKey: "bwai_live_xxxxx",
|
|
54
|
+
endpoint: BlockWriteAI.platformEndpoints.premiumPlugins,
|
|
55
|
+
features: ["drawing", "mermaid", "signature", "signature_flow", "ai"]
|
|
56
|
+
});
|
|
47
57
|
```
|
|
48
58
|
|
|
49
59
|
## Install With Node
|
|
@@ -60,6 +70,11 @@ import "@qarakash/blockwriteai/plugins/advanced/min";
|
|
|
60
70
|
|
|
61
71
|
const editor = new BlockWriteAI({
|
|
62
72
|
holder: "#editor",
|
|
73
|
+
premium: {
|
|
74
|
+
licenseKey: "bwai_live_xxxxx",
|
|
75
|
+
verifyEndpoint: BlockWriteAI.platformEndpoints.licenseVerify,
|
|
76
|
+
usageEndpoint: BlockWriteAI.platformEndpoints.aiUsage
|
|
77
|
+
},
|
|
63
78
|
async onSave(data) {
|
|
64
79
|
await fetch("/api/documents", {
|
|
65
80
|
method: "POST",
|
|
@@ -85,6 +100,8 @@ use QarAkash\BlockWriteAI\BlockWriteAIAssets;
|
|
|
85
100
|
|
|
86
101
|
echo BlockWriteAIAssets::stylesheetTag('/assets/blockwriteai');
|
|
87
102
|
echo BlockWriteAIAssets::scriptTags('/assets/blockwriteai');
|
|
103
|
+
|
|
104
|
+
$platform = BlockWriteAIAssets::platformEndpoints();
|
|
88
105
|
```
|
|
89
106
|
|
|
90
107
|
Create the editor:
|
|
@@ -122,10 +139,12 @@ copy_static("static/blockwriteai")
|
|
|
122
139
|
Generate tags in Flask, Django, or any Python web app:
|
|
123
140
|
|
|
124
141
|
```python
|
|
125
|
-
from blockwriteai_editor import stylesheet_tag, script_tags
|
|
142
|
+
from blockwriteai_editor import platform_endpoints, stylesheet_tag, script_tags
|
|
126
143
|
|
|
127
144
|
print(stylesheet_tag("/static/blockwriteai"))
|
|
128
145
|
print(script_tags("/static/blockwriteai"))
|
|
146
|
+
|
|
147
|
+
platform = platform_endpoints()
|
|
129
148
|
```
|
|
130
149
|
|
|
131
150
|
Then mount the editor in your template:
|
|
@@ -167,7 +186,7 @@ The JSON endpoint can return a document directly:
|
|
|
167
186
|
```json
|
|
168
187
|
{
|
|
169
188
|
"time": 1779540000000,
|
|
170
|
-
"version": "1.0.
|
|
189
|
+
"version": "1.0.11",
|
|
171
190
|
"blocks": []
|
|
172
191
|
}
|
|
173
192
|
```
|
|
@@ -179,7 +198,7 @@ It can also return a wrapper:
|
|
|
179
198
|
"ok": true,
|
|
180
199
|
"data": {
|
|
181
200
|
"time": 1779540000000,
|
|
182
|
-
"version": "1.0.
|
|
201
|
+
"version": "1.0.11",
|
|
183
202
|
"blocks": []
|
|
184
203
|
}
|
|
185
204
|
}
|
|
@@ -194,7 +213,7 @@ Do not expose premium plugin files as normal public scripts. Load them after you
|
|
|
194
213
|
async function bootEditor() {
|
|
195
214
|
await BlockWriteAI.loadPremiumPlugins({
|
|
196
215
|
licenseKey: "bwai_live_xxxxx",
|
|
197
|
-
endpoint: "
|
|
216
|
+
endpoint: "https://blockwriteai.in/api/premium_plugins.php",
|
|
198
217
|
features: ["drawing", "mermaid", "signature", "signature_flow", "ai"]
|
|
199
218
|
});
|
|
200
219
|
|
|
@@ -202,11 +221,11 @@ Do not expose premium plugin files as normal public scripts. Load them after you
|
|
|
202
221
|
holder: "#editor",
|
|
203
222
|
premium: {
|
|
204
223
|
licenseKey: "bwai_live_xxxxx",
|
|
205
|
-
verifyEndpoint: "
|
|
206
|
-
usageEndpoint: "
|
|
224
|
+
verifyEndpoint: "https://blockwriteai.in/api/license_verify.php",
|
|
225
|
+
usageEndpoint: "https://blockwriteai.in/api/ai_usage.php"
|
|
207
226
|
},
|
|
208
227
|
ai: {
|
|
209
|
-
endpoint: "/api/
|
|
228
|
+
endpoint: "https://blockwriteai.in/api/ai_generate.php"
|
|
210
229
|
}
|
|
211
230
|
});
|
|
212
231
|
}
|