@innovastudio/contentbox 1.0.15 → 1.0.19

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
@@ -46,23 +46,36 @@ For viewing content, additional includes are also needed.
46
46
  On the head section:
47
47
 
48
48
  ```html
49
- <link href="box/box.css" rel="stylesheet" type="text/css" />
49
+ <link href="box/box-flex.css" rel="stylesheet" type="text/css" />
50
50
  ```
51
51
 
52
- And before the end of body tag:
52
+ Before the end of the body tag:
53
53
 
54
54
  ```html
55
- <script src="box/box.js" type="text/javascript"></script>
55
+ <script src="box/box-flex.js" type="text/javascript"></script>
56
56
  ```
57
57
 
58
- In the previous version, ContentBox.js is implemented as a JQuery plugin. Now in version 5, it is rewritten in pure Javascript.
59
- However, ContentBox.js includes predesigned Sliders (using Slick slider) that require JQuery to run.
60
- So we need to add the JQuery include:
58
+ #### If you are upgrading from the previous version of ContentBox
59
+
60
+ (this is the same as in the previous version)
61
+
62
+ On the head section:
61
63
 
62
64
  ```html
63
- <script src="path-to/jquery.min.js"></script>
65
+ <link href="box/box.css" rel="stylesheet" type="text/css" />
64
66
  ```
65
-
67
+
68
+ Before the end of the body tag:
69
+
70
+ ```html
71
+ <script src="path-to/jquery.min.js"></script> /* for running the slider */
72
+ <script src="box/box.js" type="text/javascript"></script>
73
+ ```
74
+
75
+ The JQuery include is needed here because the previous version of ContentBox includes predesigned Sliders (using Slick slider) that require JQuery to run.
76
+ If you are not using the slider in your content, then you do not need JQuery include and you can change the **box.css** & **box.js** includes with the **box-flex.css** & **box-flex.js** which exclude the JQuery dependency.
77
+
78
+
66
79
  ## Usage
67
80
 
68
81
  ```html
@@ -78,7 +91,7 @@ const builder = new ContentBox({
78
91
 
79
92
  To get the edited content:
80
93
 
81
- 1) Get the HTML
94
+ 1) Get the HTML content
82
95
 
83
96
  ```javascript
84
97
  let html = builder.html();
@@ -93,6 +106,7 @@ let sectioncss = builder.sectioncss(); // Returns the typography styles for spec
93
106
 
94
107
  Then you can do anything with the content, for example, posting it to the server for saving, etc.
95
108
 
109
+ In production, the saved HTML content should be rendered with its styles.
96
110
 
97
111
  ### Examples (HTML, PHP, React, Vue)
98
112
 
@@ -112,6 +126,7 @@ React and Vue project examples are provided in separate downloads in the user ar
112
126
  - example.php (PHP example)
113
127
  - example-bootstrap.html (using Bootstrap framework)
114
128
  - example-foundation.html (using Foundation framework)
129
+ - example-jquery.html (HTML example from the previous version using JQuery)
115
130
  - src/
116
131
  - contentbox/ (Only provided in Source Code package)
117
132
  - scss/ (Only provided in Source Code package)
@@ -122,7 +137,7 @@ React and Vue project examples are provided in separate downloads in the user ar
122
137
 
123
138
  ## Predesigned Sections (Templates)
124
139
 
125
- To start building a page, you can click the (+) button on the top left sidebar. This will opens a selection of predesigned sections that you can add into your page.
140
+ To start building a page, you can click the (+) button on the top left sidebar. This will open a selection of predesigned sections that you can add into your page.
126
141
 
127
142
  ![Predesigned Sections](docs/predesigned-sections.png)
128
143
 
@@ -177,7 +192,7 @@ assets/minimalist-blocks/
177
192
 
178
193
  It contains:
179
194
  - content.js (snippets JSON file)
180
- - content.css (snippet css file)
195
+ - content.css (snippets css file)
181
196
  - images (contains assets for the snippets)
182
197
  - preview (contains snippet thumbnails)
183
198
 
@@ -214,13 +229,13 @@ A selection of typography styles is provided for you to choose to format your pa
214
229
 
215
230
  ![Typography Styles](docs/typography.png)
216
231
 
217
- The style can be used to format the entire page or just a specific section or box area of your page.
232
+ The style can be used to format the entire page or just a specific section or a box area of your page.
218
233
 
219
- If the page has one or more sections (or boxes) that have their own typography style, a modal dialog is opened for you to choose to replace all the sections' styles or keep the sections' style and format only the unstyled sections.
234
+ If the page has one or more sections (or boxes) that have their own typography style, a modal dialog is opened for you to choose and replace all the sections' styles or keep the sections' style and format only the unstyled sections.
220
235
 
221
236
  ![Apply options](docs/typography2.png)
222
237
 
223
- To apply the typography style for a specific section or box area, open the Box Settings dialog, select 'Text' tab and click 'Change Style'.
238
+ To apply the typography style for a specific section or box area, open the Box Settings dialog, select the 'Text' tab and click 'Change Style'.
224
239
 
225
240
  ![Apply to a specific section](docs/typography3.png)
226
241
 
@@ -239,6 +254,29 @@ const builder = new ContentBox({
239
254
  });
240
255
  ```
241
256
 
257
+ ### Slider Feature
258
+
259
+ The new version includes predesigned slider templates (using Glide slider) that require some includes:
260
+
261
+ ```html
262
+ <link href="assets/scripts/glide/css/glide.core.css" rel="stylesheet" type="text/css" />
263
+ <link href="assets/scripts/glide/css/glide.theme.css" rel="stylesheet" type="text/css" />
264
+ <script src="assets/scripts/glide/glide.js" type="text/javascript"></script>
265
+ ```
266
+ To enable the slider:
267
+
268
+ ```javascript
269
+ const builder = new ContentBox({
270
+ /*...*/
271
+ slider: 'glide' // default: 'slick' (old version slider)
272
+ });
273
+ ```
274
+
275
+ Values:
276
+ - '' (default) => not using slider
277
+ - 'glide'
278
+ - 'slick' => previous version slider (requires JQuery)
279
+
242
280
  ## Language File
243
281
 
244
282
  With the Language file, you can translate the ContentBox.js interface into another language.
@@ -262,11 +300,11 @@ _txt['Italic'] = 'Italic';
262
300
 
263
301
  You can create your own language file by copying/modifying this file.
264
302
 
265
- ## Adding Custon Buttons to the Sidebar
303
+ ## Adding Custom Buttons to the Sidebar
266
304
 
267
- To add custom buttons to the sidebar, use **addButton** method.
305
+ To add custom buttons to the sidebar, use the **addButton** method.
268
306
 
269
- Here is an example of adding Undo & Redo button. For undo and redo operation, we call the **undo()** and **redo()** methods.
307
+ Here is an example of adding the Undo & Redo button. For the undo and redo operation, we call the **undo()** and **redo()** methods.
270
308
 
271
309
  ```javascript
272
310
  builder.addButton({
@@ -316,15 +354,15 @@ builder.addButton({
316
354
  });
317
355
  ```
318
356
 
319
- Here we get the content and its styles using **html()**, **mainCss()**, and **sectionCss()** methods and save them into the browser's local storage. The content then will be used in the **preview.html** for viewing.
357
+ Here we get the content and its styles using the **html()**, **mainCss()**, and **sectionCss()** methods and save them into the browser's local storage. The content will then be used in the **preview.html** for viewing.
320
358
 
321
359
  ## Embedding Box Cover (Background) Image
322
360
 
323
- In Box Settings, you can specify box's cover or background image.
361
+ In the Box Settings, you can specify a box's cover or background image.
324
362
 
325
363
  ![Box Cover](docs/box-cover.png)
326
364
 
327
- However, for quick upload an image without opening the Box Settings, you can click the box's image button. This allows you to browse local images and select an image to upload as a box's image cover (background).
365
+ However, to quickly upload an image without opening the Box Settings, you can click the box image button. This allows you to browse local images and select an image to upload as a box image cover (background).
328
366
 
329
367
  ![Box Cover](docs/box-cover2.png)
330
368
 
@@ -337,7 +375,7 @@ There are 2 methods for uploading cover image:
337
375
 
338
376
  #### Form Method
339
377
 
340
- Here we use **coverImageHandler** parameter to specify upload handler for saving image on the server.
378
+ Here we use the **coverImageHandler** parameter to specify the upload handler for saving images on the server.
341
379
 
342
380
  ```javascript
343
381
  const builder = new ContentBox({
@@ -354,7 +392,7 @@ As examples, you can use the provided handler:
354
392
 
355
393
  #### AJAX Post Method
356
394
 
357
- Here we use **onUploadCoverImage** parameter to specify a custom upload function.
395
+ Here we use the **onUploadCoverImage** parameter to specify a custom upload function.
358
396
 
359
397
  ```javascript
360
398
  const builder = new ContentBox({
@@ -383,7 +421,7 @@ const builder = new ContentBox({
383
421
  });
384
422
  ```
385
423
 
386
- Within the function we can use Axios to post an image to the server. Then the server should return the saved image url. Here we use **boxImage(url)** method to apply the image url as a background cover.
424
+ Within the function we can use Axios to post an image to the server. Then the server should return the saved image url. Here we use the **boxImage(url)** method to apply the image url as a background cover.
387
425
 
388
426
  In this example, the image is posted to an endpoint: **/upload**
389
427
  If you’re using Node.js, you can implement the endpoint to save the image using:
@@ -420,7 +458,7 @@ let html = builder.html();
420
458
  let mainCss = builder.mainCss(); // Returns the default typography style for the page.
421
459
  let sectioncss = builder.sectioncss(); // Returns the typography styles for specific sections on the page
422
460
  ```
423
- You can save the HTML and its styles above into a database. And when you need to load the content back for editing, use **loadHtml()** and **loadStyles** methods.
461
+ You can save the HTML and its styles above into a database. And when you need to load the content back for editing, use the **loadHtml()** and **loadStyles** methods.
424
462
 
425
463
  ```javascript
426
464
  builder.loadHtml(html);
@@ -453,9 +491,9 @@ builder.destroy();
453
491
 
454
492
  ## ContentBuilder.js Features
455
493
 
456
- ContentBox.js uses ContentBuilder.js as its HTML editor. So most of the ContentBuilder.js options/parameters can be accessed through ContentBox.js object.
494
+ ContentBox.js uses ContentBuilder.js as its HTML editor. So most of the ContentBuilder.js options/parameters can be accessed through the ContentBox.js object.
457
495
 
458
- For example, to specify custom file browser (or Asset Manager):
496
+ For example, to specify a custom file browser (or Asset Manager):
459
497
 
460
498
  ```javascript
461
499
  const builder = new ContentBox({
@@ -508,5 +546,5 @@ function uploadFile(e, callback) {
508
546
  }
509
547
  ```
510
548
 
511
- More configuration options can be found in ContentBuilder.js documentation: https://innovastudio.com/docs/contentbuilder.pdf
549
+ More configuration options can be found in the ContentBuilder.js documentation: https://innovastudio.com/docs/contentbuilder.pdf
512
550
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@innovastudio/contentbox",
3
- "version": "1.0.15",
3
+ "version": "1.0.19",
4
4
  "description": "",
5
5
  "main": "public/contentbox/contentbox.esm.js",
6
6
  "files": [
@@ -38,11 +38,11 @@
38
38
  "webpack-dev-server": "^4.0.0"
39
39
  },
40
40
  "dependencies": {
41
- "@innovastudio/contentbuilder": "^1.0.49",
41
+ "@innovastudio/contentbuilder": "^1.0.50",
42
42
  "axios": "^0.21.4",
43
43
  "cors": "^2.8.5",
44
44
  "express": "^4.17.1",
45
45
  "express-session": "^1.17.2",
46
- "pace-js": "^1.2.4"
46
+ "js-beautify": "^1.14.0"
47
47
  }
48
48
  }