@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/readme.txt CHANGED
@@ -1,253 +1,306 @@
1
- ContentBox.js 5.9.5
1
+ ========================================================================
2
+ CONTENTBOX.JS 6.0.1
3
+ ========================================================================
2
4
 
3
- Note: If you have Source Code package (Super license), please refer to:
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
- readme-sourcecode.txt
9
+ This file is your starting point. It covers:
6
10
 
7
- for additional information.
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
- Documentation:
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
- https://demo.innovastudio.com/docs/ContentBox.pdf (old version)
24
+ ------------------------------------------------------------------------
25
+ 1. GETTING STARTED
26
+ ------------------------------------------------------------------------
14
27
 
15
- https://demo.innovastudio.com/docs/AI-Assistant.pdf (AI Assistant documentation)
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
- Getting started
33
+ A. HTML EXAMPLE
19
34
 
20
- You can choose to run the HTML, PHP or JavaScript project examples:
35
+ 1. Unzip the package (folder: ContentBox/)
21
36
 
22
- A. To try the HTML example:
37
+ 2. From a terminal, in the project folder, install the server
38
+ dependencies (the example uses a Node.js server):
23
39
 
24
- 1. Unzip the project files:
40
+ > cd ContentBox
41
+ > npm install
25
42
 
26
-    - ContentBox/
43
+ 3. Create your .env file from the template and add your API keys:
27
44
 
28
- 2. Open terminal, go to the project directory and install the required server dependencies.
29
- The example is using Node.js server.
45
+ > cp .env.example .env
30
46
 
31
- > cd ContentBox
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
- > npm install
51
+ 4. Run the server:
34
52
 
35
- Note: To run this command, you need to have NPM installed.
36
- Download & install NPM from https://nodejs.org/en/download/.
53
+ > node server.js
37
54
 
38
- 3. Run the server:
55
+ 5. Open in your browser:
39
56
 
40
- > node server.js
57
+ http://localhost:8081/example.html
41
58
 
42
- 4. Open from your browser:
43
59
 
44
- http://localhost:8081/example.html
60
+ B. PHP EXAMPLE
45
61
 
62
+ Open in your browser:
46
63
 
47
- B. To try the PHP Example, open from your browser:
64
+ http://localhost/.../public/example.php
48
65
 
49
- http://localhost/.../public/example.php
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. To try the JavaScript project, install the dependencies and start the project:
69
+ C. JAVASCRIPT PROJECT
55
70
 
56
- > npm install
71
+ A small project that imports the library and configures it in code:
57
72
 
58
- > npm start
73
+ > npm install
74
+ > npm start
59
75
 
60
- A browser window will be opened with the example running.
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
- The project is using Node.js server:
81
+ ------------------------------------------------------------------------
82
+ 2. WHERE THINGS LIVE
83
+ ------------------------------------------------------------------------
68
84
 
69
- server.js
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
- NOTE:
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
- - To use the AI Assistant:
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
- 1. Obtain the API key from OpenAI or OpenRouter
76
-
77
- https://openai.com
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
- or
112
+ docs/ Documentation, including the upgrade
113
+ guide.
80
114
 
81
- https://openrouter.ai
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
- 2. Update the .env file with your API key.
120
+ ------------------------------------------------------------------------
121
+ 3. HOW TO CUSTOMIZE
122
+ ------------------------------------------------------------------------
86
123
 
87
- OPENAI_API_KEY=YOUR_OPENAI_API_KEY
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
- or
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
- OPENROUTER_API_KEY=YOUR_API_KEY
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
- Or if you're using PHP, update the api/config.php file with your API key:
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
- $OPENAI_API_KEY = 'YOUR_API_KEY';
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
- $OPENROUTER_API_KEY = 'YOUR_API_KEY';
100
-
101
- 3. Ensure that the sendCommandUrl parameter is set with the API endpoint:
152
+ ------------------------------------------------------------------------
153
+ 4. WORKING WITH AN AI ASSISTANT (CLAUDE, ETC.)
154
+ ------------------------------------------------------------------------
102
155
 
103
- const builder = new ContentBox({
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
- If you're using PHP:
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
- const builder = new ContentBox({
112
- // ...
113
- sendCommandUrl: 'api/sendcommand.php',
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
- Most examples in the package have this parameter configured, so you can run and test them.
118
- Examples in React/Next.js and Laravel are also provided.
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
- server.js
173
+ ------------------------------------------------------------------------
174
+ 5. SETTING UP THE AI FEATURES (API KEYS)
175
+ ------------------------------------------------------------------------
124
176
 
125
- For more information, please refer to the documentation:
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
- https://demo.innovastudio.com/docs/AI-Assistant.pdf
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
- - To use the AI image generation:
185
+ 5.1 AI ASSISTANT
136
186
 
137
- - New version:
187
+ 1. Get an API key from OpenAI or OpenRouter:
138
188
 
139
- 1. Obtain the API key from Fal.ai:
189
+ https://openai.com
190
+ https://openrouter.ai (use this for access to many models)
140
191
 
141
- https://fal.ai
142
-
143
- 2. Update the .env file with your API key.
192
+ 2. Add it to the .env file:
144
193
 
145
- FAL_API_KEY=YOUR_API_KEY
194
+ OPENAI_API_KEY=YOUR_OPENAI_API_KEY
195
+ OPENROUTER_API_KEY=YOUR_API_KEY
146
196
 
147
- Alternatively, if you're using PHP, update the 'api/config.php' file with your API key:
197
+ Or, for PHP, add it to api/config.php:
148
198
 
149
- $FAL_API_KEY = 'YOUR_API_KEY';
199
+ $OPENAI_API_KEY = 'YOUR_API_KEY';
200
+ $OPENROUTER_API_KEY = 'YOUR_API_KEY';
150
201
 
151
- 3. Obtain the API key from OpenAI
152
-
153
- https://openai.com
202
+ 3. Set the sendCommandUrl option to the endpoint:
154
203
 
155
- 4. Update the .env file with your API key.
204
+ const builder = new ContentBox({
205
+ // ...
206
+ sendCommandUrl: '/sendcommand',
207
+ // sendCommandUrl: '/openrouter', // OpenRouter
208
+ });
156
209
 
157
- OPENAI_API_KEY=YOUR_OPENAI_API_KEY
210
+ For PHP:
158
211
 
159
- Or if you're using PHP, update the api/config.php file with your API key:
212
+ const builder = new ContentBox({
213
+ // ...
214
+ sendCommandUrl: 'api/sendcommand.php',
215
+ // sendCommandUrl: '/api/openrouter.php', // OpenRouter
216
+ });
160
217
 
161
- $OPENAI_API_KEY = 'YOUR_API_KEY';
218
+ The JavaScript project serves these endpoints from server.js.
162
219
 
163
- 5. Ensure that the following parameters are set:
220
+ 5.2 AI IMAGE GENERATION
164
221
 
165
- const builder = new ContentBox({
166
- // ...
222
+ Current provider - Fal.ai:
167
223
 
168
- defaultImageGenerationProvider: 'fal',
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
- If you're using PHP:
226
+ FAL_API_KEY=YOUR_API_KEY
175
227
 
176
- const builder = new ContentBox({
177
- // ...
228
+ (PHP: add $FAL_API_KEY = 'YOUR_API_KEY'; to api/config.php)
178
229
 
179
- defaultImageGenerationProvider: 'fal',
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
- - Legacy version:
234
+ (PHP: $OPENAI_API_KEY = 'YOUR_API_KEY'; in api/config.php)
187
235
 
188
- 1. Obtain the API key from Getimg:
189
-
190
- https://getimg.ai/tools/api
236
+ 3. Set these options:
191
237
 
192
- 2. Update the .env file with your API key.
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
- GETIMG_API_KEY=YOUR_API_KEY
246
+ For PHP:
195
247
 
196
- Alternatively, if you're using PHP, update the 'api/config.php' file with your API key:
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
- $GETIMG_API_KEY = 'YOUR_API_KEY';
256
+ The JavaScript project serves these endpoints from server.js.
199
257
 
200
- 3. Ensure that the following parameters are set:
201
258
 
202
- const builder = new ContentBox({
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
- If you're using PHP:
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-with-plugins.html
267
+ - public/preview.html
235
268
 
236
- Example with plugin implementation:
269
+ For a full example with plugins in use, see:
237
270
 
238
271
  - public/example-plugins.html
239
272
 
240
273
 
241
- - IMPORTANT:
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
- Please add your own security to the API endpoints!
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