@innovastudio/contentbox 1.6.194 → 1.6.196
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/index.d.ts +246 -1
- package/package.json +12 -4
- package/public/contentbox/contentbox.css +1370 -829
- package/public/contentbox/contentbox.esm.js +79812 -77404
- package/public/contentbox/contentbox.min.js +12 -109
- package/public/contentbox/lang/en.js +429 -63
- package/readme.txt +208 -155
package/readme.txt
CHANGED
|
@@ -1,253 +1,306 @@
|
|
|
1
|
-
|
|
1
|
+
========================================================================
|
|
2
|
+
CONTENTBOX.JS 6.0.1
|
|
3
|
+
========================================================================
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
Thanks for using ContentBox - a browser-based drag & drop page builder.
|
|
6
|
+
This package contains the ready-to-use library plus HTML, PHP, and
|
|
7
|
+
JavaScript examples showing how to run and configure it.
|
|
4
8
|
|
|
5
|
-
|
|
9
|
+
This file is your starting point. It covers:
|
|
6
10
|
|
|
7
|
-
|
|
11
|
+
1. Getting started (run the examples)
|
|
12
|
+
2. Where things live (a map of the package)
|
|
13
|
+
3. How to customize
|
|
14
|
+
4. Working with an AI assistant (Claude, etc.)
|
|
15
|
+
5. Setting up the AI features (API keys)
|
|
16
|
+
6. Registering plugins
|
|
17
|
+
7. Upgrading to a new version
|
|
18
|
+
8. Documentation & support
|
|
8
19
|
|
|
9
|
-
|
|
20
|
+
If you have the Source Code package (Super License), also see
|
|
21
|
+
readme-sourcecode.txt - it covers running and editing the library source.
|
|
10
22
|
|
|
11
|
-
https://github.com/innovastudio-dev/contentbox/
|
|
12
23
|
|
|
13
|
-
|
|
24
|
+
------------------------------------------------------------------------
|
|
25
|
+
1. GETTING STARTED
|
|
26
|
+
------------------------------------------------------------------------
|
|
14
27
|
|
|
15
|
-
|
|
28
|
+
You can run the HTML, PHP, or JavaScript example. All you need for the
|
|
29
|
+
HTML and JavaScript ones is Node.js / npm installed:
|
|
30
|
+
https://nodejs.org/en/download/
|
|
16
31
|
|
|
17
32
|
|
|
18
|
-
|
|
33
|
+
A. HTML EXAMPLE
|
|
19
34
|
|
|
20
|
-
|
|
35
|
+
1. Unzip the package (folder: ContentBox/)
|
|
21
36
|
|
|
22
|
-
|
|
37
|
+
2. From a terminal, in the project folder, install the server
|
|
38
|
+
dependencies (the example uses a Node.js server):
|
|
23
39
|
|
|
24
|
-
|
|
40
|
+
> cd ContentBox
|
|
41
|
+
> npm install
|
|
25
42
|
|
|
26
|
-
|
|
43
|
+
3. Create your .env file from the template and add your API keys:
|
|
27
44
|
|
|
28
|
-
|
|
29
|
-
The example is using Node.js server.
|
|
45
|
+
> cp .env.example .env
|
|
30
46
|
|
|
31
|
-
|
|
47
|
+
The .env file holds your API keys and is excluded from version
|
|
48
|
+
control (.gitignore). Only .env.example is committed, so never
|
|
49
|
+
put real keys in it.
|
|
32
50
|
|
|
33
|
-
|
|
51
|
+
4. Run the server:
|
|
34
52
|
|
|
35
|
-
|
|
36
|
-
Download & install NPM from https://nodejs.org/en/download/.
|
|
53
|
+
> node server.js
|
|
37
54
|
|
|
38
|
-
|
|
55
|
+
5. Open in your browser:
|
|
39
56
|
|
|
40
|
-
|
|
57
|
+
http://localhost:8081/example.html
|
|
41
58
|
|
|
42
|
-
4. Open from your browser:
|
|
43
59
|
|
|
44
|
-
|
|
60
|
+
B. PHP EXAMPLE
|
|
45
61
|
|
|
62
|
+
Open in your browser:
|
|
46
63
|
|
|
47
|
-
|
|
64
|
+
http://localhost/.../public/example.php
|
|
48
65
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
If you're using Visual Studio Code, you can use the PHP Server extension.
|
|
66
|
+
(In VS Code, the PHP Server extension is an easy way to serve it.)
|
|
52
67
|
|
|
53
68
|
|
|
54
|
-
C.
|
|
69
|
+
C. JAVASCRIPT PROJECT
|
|
55
70
|
|
|
56
|
-
|
|
71
|
+
A small project that imports the library and configures it in code:
|
|
57
72
|
|
|
58
|
-
|
|
73
|
+
> npm install
|
|
74
|
+
> npm start
|
|
59
75
|
|
|
60
|
-
A browser window
|
|
76
|
+
A browser window opens with the example running. The file to look
|
|
77
|
+
at is src/index.js (see the next section). Examples for React/Next.js
|
|
78
|
+
and Laravel are also provided.
|
|
61
79
|
|
|
62
|
-
Note:
|
|
63
|
-
The code for this project is:
|
|
64
|
-
|
|
65
|
-
src/index.js
|
|
66
80
|
|
|
67
|
-
|
|
81
|
+
------------------------------------------------------------------------
|
|
82
|
+
2. WHERE THINGS LIVE
|
|
83
|
+
------------------------------------------------------------------------
|
|
68
84
|
|
|
69
|
-
|
|
85
|
+
src/index.js The JavaScript project's code: it
|
|
86
|
+
imports ContentBox (from the npm
|
|
87
|
+
package) and configures it. This is the
|
|
88
|
+
best place to learn how to wire up the
|
|
89
|
+
builder - uploads, AI providers,
|
|
90
|
+
templates, plugins - as real, working
|
|
91
|
+
code you can copy from.
|
|
70
92
|
|
|
71
|
-
|
|
93
|
+
public/ Everything served in the browser:
|
|
94
|
+
example.html The main HTML example.
|
|
95
|
+
example.php The PHP example.
|
|
96
|
+
blank-plugins.html Plugin registration (see section 6).
|
|
97
|
+
preview.html Preview page (renders saved content).
|
|
98
|
+
contentbox/ The built library.
|
|
99
|
+
assets/ Templates, snippets, plugins, fonts.
|
|
100
|
+
assets/plugins/ The plugins (one folder each).
|
|
101
|
+
api/ PHP backend endpoints (uploads, AI).
|
|
72
102
|
|
|
73
|
-
-
|
|
103
|
+
server.js / server-aws.js The Node.js backend for the examples
|
|
104
|
+
(uploads + AI endpoints). server-aws.js
|
|
105
|
+
is the same thing using S3 storage.
|
|
74
106
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
107
|
+
.env / .env.example Your API keys for the AI features
|
|
108
|
+
(see section 5). Copy .env.example to
|
|
109
|
+
.env and fill in your keys. Needed only
|
|
110
|
+
if you use the AI-assisted features.
|
|
78
111
|
|
|
79
|
-
|
|
112
|
+
docs/ Documentation, including the upgrade
|
|
113
|
+
guide.
|
|
80
114
|
|
|
81
|
-
|
|
115
|
+
Note: this package contains the ready-to-use library, not its source.
|
|
116
|
+
If you need to change how the library itself works, that's what the
|
|
117
|
+
Source Code (Super License) package is for.
|
|
82
118
|
|
|
83
|
-
Use OpenRouter if you want to use various models.
|
|
84
119
|
|
|
85
|
-
|
|
120
|
+
------------------------------------------------------------------------
|
|
121
|
+
3. HOW TO CUSTOMIZE
|
|
122
|
+
------------------------------------------------------------------------
|
|
86
123
|
|
|
87
|
-
|
|
124
|
+
1. CONFIGURE WITH OPTIONS.
|
|
125
|
+
Most behavior - the sidebar, upload handlers, AI endpoints,
|
|
126
|
+
templates - is controlled by the options object passed to
|
|
127
|
+
"new ContentBox({...})". See src/index.js for a live example, and
|
|
128
|
+
docs/ for the full list of options and methods.
|
|
88
129
|
|
|
89
|
-
|
|
130
|
+
2. ADD FEATURES WITH PLUGINS.
|
|
131
|
+
A plugin is its own folder under public/assets/plugins/<name>/
|
|
132
|
+
(an index.js and a style.css), loaded via the "plugins" option.
|
|
133
|
+
(See section 6 for registering plugins in your own pages.) The
|
|
134
|
+
plugin docs sit right beside them:
|
|
90
135
|
|
|
91
|
-
|
|
136
|
+
public/assets/plugins/README.md catalog
|
|
137
|
+
public/assets/plugins/plugin-dev-guide.md how to build one
|
|
138
|
+
public/assets/plugins/plugin-example.md worked example
|
|
139
|
+
public/assets/plugins/plugin-patterns.md common patterns
|
|
140
|
+
public/assets/plugins/plugin-best-practices.md conventions
|
|
92
141
|
|
|
93
|
-
|
|
142
|
+
They're plain Markdown, so you can hand the folder to an AI
|
|
143
|
+
assistant as reference and just describe the plugin you want.
|
|
94
144
|
|
|
95
|
-
|
|
145
|
+
3. RESTYLE WITH CSS / TEMPLATES.
|
|
146
|
+
Templates live under public/assets/ and can be customized there.
|
|
147
|
+
Add your own CSS to override styles. (The SCSS theme sources, for
|
|
148
|
+
building new themes from scratch, come with the Source Code
|
|
149
|
+
package.)
|
|
96
150
|
|
|
97
|
-
or
|
|
98
151
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
152
|
+
------------------------------------------------------------------------
|
|
153
|
+
4. WORKING WITH AN AI ASSISTANT (CLAUDE, ETC.)
|
|
154
|
+
------------------------------------------------------------------------
|
|
102
155
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
sendCommandUrl: '/sendcommand',
|
|
106
|
-
// sendCommandUrl: '/openrouter', // Using OpenRouter (https://openrouter.ai/)
|
|
107
|
-
});
|
|
156
|
+
An AI coding assistant such as Claude Code can do a lot with this package
|
|
157
|
+
alone. Point it at the project and it can read:
|
|
108
158
|
|
|
109
|
-
|
|
159
|
+
- docs/ - the documentation (options, methods, guides),
|
|
160
|
+
- src/index.js - a real, working configuration to follow,
|
|
161
|
+
- assets/plugins/ - the plugin API and docs.
|
|
110
162
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
// sendCommandUrl: '/api/openrouter.php', // Using OpenRouter (https://openrouter.ai/)
|
|
115
|
-
});
|
|
163
|
+
With those in the project, it can tell you which option to set for a
|
|
164
|
+
given goal, adjust your src/index.js, or build a plugin against the real
|
|
165
|
+
plugin structure - grounded in the actual API rather than guesswork.
|
|
116
166
|
|
|
117
|
-
|
|
118
|
-
|
|
167
|
+
The Source Code package takes this further: with the full library source
|
|
168
|
+
in your project, an assistant has the complete context to work from - so
|
|
169
|
+
it builds with more confidence, and opens up a wider range of what you
|
|
170
|
+
can create, grounded in how ContentBox really works.
|
|
119
171
|
|
|
120
|
-
The JavaScript project example in this package uses Node.js for the API endpoint /sendcommand.
|
|
121
|
-
Please refer to the Node.js file:
|
|
122
172
|
|
|
123
|
-
|
|
173
|
+
------------------------------------------------------------------------
|
|
174
|
+
5. SETTING UP THE AI FEATURES (API KEYS)
|
|
175
|
+
------------------------------------------------------------------------
|
|
124
176
|
|
|
125
|
-
|
|
177
|
+
The AI Assistant and AI image generation are optional. They work once
|
|
178
|
+
you add API keys and point the matching options at the endpoints. Most
|
|
179
|
+
examples in the package already have these options set, so they run as
|
|
180
|
+
soon as the keys are in place.
|
|
126
181
|
|
|
127
|
-
|
|
182
|
+
Add your own security to the API endpoints before going to production!
|
|
128
183
|
|
|
129
|
-
- For speech recognition (if dictation is enabled), the browser's built-in
|
|
130
|
-
speech recognition is used. However, certain browsers may not support this feature.
|
|
131
|
-
We recommend using Deepgram for browser compatibility and accuracy.
|
|
132
|
-
Obtain the Deepgram API key from https://deepgram.com and update the .env file with your API key.
|
|
133
|
-
Then enable the 'speechTranscribeUrl' parameter in the ContentBox initialization (src/index.js).
|
|
134
184
|
|
|
135
|
-
|
|
185
|
+
5.1 AI ASSISTANT
|
|
136
186
|
|
|
137
|
-
|
|
187
|
+
1. Get an API key from OpenAI or OpenRouter:
|
|
138
188
|
|
|
139
|
-
|
|
189
|
+
https://openai.com
|
|
190
|
+
https://openrouter.ai (use this for access to many models)
|
|
140
191
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
2. Update the .env file with your API key.
|
|
192
|
+
2. Add it to the .env file:
|
|
144
193
|
|
|
145
|
-
|
|
194
|
+
OPENAI_API_KEY=YOUR_OPENAI_API_KEY
|
|
195
|
+
OPENROUTER_API_KEY=YOUR_API_KEY
|
|
146
196
|
|
|
147
|
-
|
|
197
|
+
Or, for PHP, add it to api/config.php:
|
|
148
198
|
|
|
149
|
-
|
|
199
|
+
$OPENAI_API_KEY = 'YOUR_API_KEY';
|
|
200
|
+
$OPENROUTER_API_KEY = 'YOUR_API_KEY';
|
|
150
201
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
https://openai.com
|
|
202
|
+
3. Set the sendCommandUrl option to the endpoint:
|
|
154
203
|
|
|
155
|
-
|
|
204
|
+
const builder = new ContentBox({
|
|
205
|
+
// ...
|
|
206
|
+
sendCommandUrl: '/sendcommand',
|
|
207
|
+
// sendCommandUrl: '/openrouter', // OpenRouter
|
|
208
|
+
});
|
|
156
209
|
|
|
157
|
-
|
|
210
|
+
For PHP:
|
|
158
211
|
|
|
159
|
-
|
|
212
|
+
const builder = new ContentBox({
|
|
213
|
+
// ...
|
|
214
|
+
sendCommandUrl: 'api/sendcommand.php',
|
|
215
|
+
// sendCommandUrl: '/api/openrouter.php', // OpenRouter
|
|
216
|
+
});
|
|
160
217
|
|
|
161
|
-
|
|
218
|
+
The JavaScript project serves these endpoints from server.js.
|
|
162
219
|
|
|
163
|
-
|
|
220
|
+
5.2 AI IMAGE GENERATION
|
|
164
221
|
|
|
165
|
-
|
|
166
|
-
// ...
|
|
222
|
+
Current provider - Fal.ai:
|
|
167
223
|
|
|
168
|
-
|
|
169
|
-
generateMediaUrl_Fal: '/request-fal',
|
|
170
|
-
checkRequestStatusUrl_Fal: '/status-fal',
|
|
171
|
-
getResultUrl_Fal: '/result-fal',
|
|
172
|
-
});
|
|
224
|
+
1. Get an API key from https://fal.ai and add it to .env:
|
|
173
225
|
|
|
174
|
-
|
|
226
|
+
FAL_API_KEY=YOUR_API_KEY
|
|
175
227
|
|
|
176
|
-
|
|
177
|
-
// ...
|
|
228
|
+
(PHP: add $FAL_API_KEY = 'YOUR_API_KEY'; to api/config.php)
|
|
178
229
|
|
|
179
|
-
|
|
180
|
-
generateMediaUrl_Fal: 'api/request-fal.php',
|
|
181
|
-
checkRequestStatusUrl_Fal: 'api/status-fal.php',
|
|
182
|
-
getResultUrl_Fal: 'api/result-fal.php',
|
|
183
|
-
});
|
|
230
|
+
2. Also add an OpenAI key (https://openai.com) to .env:
|
|
184
231
|
|
|
232
|
+
OPENAI_API_KEY=YOUR_OPENAI_API_KEY
|
|
185
233
|
|
|
186
|
-
|
|
234
|
+
(PHP: $OPENAI_API_KEY = 'YOUR_API_KEY'; in api/config.php)
|
|
187
235
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
https://getimg.ai/tools/api
|
|
236
|
+
3. Set these options:
|
|
191
237
|
|
|
192
|
-
|
|
238
|
+
const builder = new ContentBox({
|
|
239
|
+
// ...
|
|
240
|
+
defaultImageGenerationProvider: 'fal',
|
|
241
|
+
generateMediaUrl_Fal: '/request-fal',
|
|
242
|
+
checkRequestStatusUrl_Fal: '/status-fal',
|
|
243
|
+
getResultUrl_Fal: '/result-fal',
|
|
244
|
+
});
|
|
193
245
|
|
|
194
|
-
|
|
246
|
+
For PHP:
|
|
195
247
|
|
|
196
|
-
|
|
248
|
+
const builder = new ContentBox({
|
|
249
|
+
// ...
|
|
250
|
+
defaultImageGenerationProvider: 'fal',
|
|
251
|
+
generateMediaUrl_Fal: 'api/request-fal.php',
|
|
252
|
+
checkRequestStatusUrl_Fal: 'api/status-fal.php',
|
|
253
|
+
getResultUrl_Fal: 'api/result-fal.php',
|
|
254
|
+
});
|
|
197
255
|
|
|
198
|
-
|
|
256
|
+
The JavaScript project serves these endpoints from server.js.
|
|
199
257
|
|
|
200
|
-
3. Ensure that the following parameters are set:
|
|
201
258
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
textToImageUrl: '/texttoimage',
|
|
206
|
-
upscaleImageUrl: '/upscaleimage',
|
|
207
|
-
imageModel: 'flux-schnell',
|
|
208
|
-
imageAutoUpscale: false,
|
|
209
|
-
// viewFileUrl: '/viewfile', // If using S3
|
|
210
|
-
});
|
|
259
|
+
------------------------------------------------------------------------
|
|
260
|
+
6. REGISTERING PLUGINS
|
|
261
|
+
------------------------------------------------------------------------
|
|
211
262
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
const builder = new ContentBox({
|
|
215
|
-
// ...
|
|
216
|
-
|
|
217
|
-
textToImageUrl: 'api/texttoimage.php',
|
|
218
|
-
upscaleImageUrl: 'api/upscaleimage.php',
|
|
219
|
-
imageModel: 'flux-schnell',
|
|
220
|
-
imageAutoUpscale: false,
|
|
221
|
-
});
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
Most examples in the package have this parameter configured, so you can run and test them.
|
|
225
|
-
|
|
226
|
-
The JavaScript project example in this package uses Node.js for the API endpoints.
|
|
227
|
-
Please refer to the Node.js file:
|
|
228
|
-
|
|
229
|
-
server.js
|
|
230
|
-
|
|
231
|
-
- To register new plugins, update the following files:
|
|
263
|
+
Pages that display plugin content need the plugins registered. To add
|
|
264
|
+
new plugins, update:
|
|
232
265
|
|
|
233
266
|
- public/blank-plugins.html
|
|
234
|
-
- public/preview
|
|
267
|
+
- public/preview.html
|
|
235
268
|
|
|
236
|
-
|
|
269
|
+
For a full example with plugins in use, see:
|
|
237
270
|
|
|
238
271
|
- public/example-plugins.html
|
|
239
272
|
|
|
240
273
|
|
|
241
|
-
|
|
274
|
+
------------------------------------------------------------------------
|
|
275
|
+
7. UPGRADING TO A NEW VERSION
|
|
276
|
+
------------------------------------------------------------------------
|
|
277
|
+
|
|
278
|
+
Updates are backward compatible - your existing content and code keep
|
|
279
|
+
working. You replace the package folders with the new ones:
|
|
280
|
+
|
|
281
|
+
public/box/
|
|
282
|
+
public/contentbox/
|
|
283
|
+
public/contentbuilder/
|
|
284
|
+
public/assets/
|
|
285
|
+
public/runtime/
|
|
286
|
+
blank.html (or blank-plugins.html)
|
|
287
|
+
preview.html
|
|
242
288
|
|
|
243
|
-
|
|
289
|
+
And if you install from npm, also update the editor script:
|
|
244
290
|
|
|
291
|
+
> npm i @innovastudio/contentbox@latest
|
|
245
292
|
|
|
293
|
+
Full step-by-step instructions, including the Runtime library, are in:
|
|
246
294
|
|
|
247
|
-
|
|
248
|
-
SUPPORT:
|
|
295
|
+
upgrading-contentbox.md
|
|
249
296
|
|
|
250
|
-
Email us at: support@innovastudio.com
|
|
251
297
|
|
|
298
|
+
------------------------------------------------------------------------
|
|
299
|
+
8. DOCUMENTATION & SUPPORT
|
|
300
|
+
------------------------------------------------------------------------
|
|
252
301
|
|
|
302
|
+
Documentation: docs/README.md
|
|
303
|
+
https://github.com/innovastudio-dev/contentbox/
|
|
304
|
+
Upgrade guide: upgrading-contentbox.md
|
|
253
305
|
|
|
306
|
+
Questions? Email us at: support@innovastudio.com
|