@innovastudio/contentbuilder 1.0.30 → 1.0.34

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.
Files changed (91) hide show
  1. package/README.md +1913 -0
  2. package/license.txt +80 -0
  3. package/package.json +40 -19
  4. package/public/contentbuilder/config.js +8 -0
  5. package/public/contentbuilder/contentbuilder.css +4282 -0
  6. package/public/contentbuilder/contentbuilder.esm.js +59500 -0
  7. package/public/contentbuilder/contentbuilder.min.js +122 -0
  8. package/public/contentbuilder/lang/en.js +299 -0
  9. package/public/contentbuilder/lang/fr.js +299 -0
  10. package/public/contentbuilder/plugins/buttoneditor/images/a.jpg +0 -0
  11. package/public/contentbuilder/plugins/buttoneditor/images/b.jpg +0 -0
  12. package/public/contentbuilder/plugins/buttoneditor/images/c.jpg +0 -0
  13. package/public/contentbuilder/plugins/buttoneditor/images/d.jpg +0 -0
  14. package/public/contentbuilder/plugins/buttoneditor/images/e.jpg +0 -0
  15. package/public/contentbuilder/plugins/buttoneditor/images/f.jpg +0 -0
  16. package/public/contentbuilder/plugins/buttoneditor/images/g.jpg +0 -0
  17. package/public/contentbuilder/plugins/buttoneditor/images/h.jpg +0 -0
  18. package/public/contentbuilder/plugins/buttoneditor/plugin.js +1566 -0
  19. package/public/contentbuilder/plugins/buttoneditor/readme.txt +7 -0
  20. package/public/contentbuilder/plugins/helloworld/plugin.js +15 -0
  21. package/public/contentbuilder/plugins/helloworld/readme.txt +23 -0
  22. package/public/contentbuilder/plugins/preview/plugin.js +301 -0
  23. package/public/contentbuilder/plugins/preview/readme.txt +23 -0
  24. package/public/contentbuilder/plugins/searchreplace/plugin.js +458 -0
  25. package/public/contentbuilder/plugins/searchreplace/readme.txt +23 -0
  26. package/public/contentbuilder/plugins/searchreplace/searchreplace.html +264 -0
  27. package/public/contentbuilder/plugins/showgrid/plugin.js +73 -0
  28. package/public/contentbuilder/plugins/showgrid/readme.txt +23 -0
  29. package/public/contentbuilder/plugins/symbols/plugin.js +2876 -0
  30. package/public/contentbuilder/plugins/symbols/readme.txt +23 -0
  31. package/public/contentbuilder/plugins/wordcount/plugin.js +75 -0
  32. package/public/contentbuilder/plugins/wordcount/readme.txt +23 -0
  33. package/public/contentbuilder/themes/colored-blue.css +1125 -0
  34. package/public/contentbuilder/themes/colored-blue2.css +1125 -0
  35. package/public/contentbuilder/themes/colored-blue3.css +1125 -0
  36. package/public/contentbuilder/themes/colored-blue4.css +1125 -0
  37. package/public/contentbuilder/themes/colored-blue5.css +1125 -0
  38. package/public/contentbuilder/themes/colored-blue6.css +1125 -0
  39. package/public/contentbuilder/themes/colored-blue7.css +1125 -0
  40. package/public/contentbuilder/themes/colored-blue8.css +1125 -0
  41. package/public/contentbuilder/themes/colored-dark.css +1125 -0
  42. package/public/contentbuilder/themes/colored-darkblue.css +1125 -0
  43. package/public/contentbuilder/themes/colored-gray.css +1125 -0
  44. package/public/contentbuilder/themes/colored-green.css +1125 -0
  45. package/public/contentbuilder/themes/colored-green2.css +1125 -0
  46. package/public/contentbuilder/themes/colored-green3.css +1125 -0
  47. package/public/contentbuilder/themes/colored-green4.css +1125 -0
  48. package/public/contentbuilder/themes/colored-green5.css +1125 -0
  49. package/public/contentbuilder/themes/colored-magenta.css +1125 -0
  50. package/public/contentbuilder/themes/colored-orange.css +1125 -0
  51. package/public/contentbuilder/themes/colored-orange2.css +1125 -0
  52. package/public/contentbuilder/themes/colored-orange3.css +1125 -0
  53. package/public/contentbuilder/themes/colored-pink.css +1125 -0
  54. package/public/contentbuilder/themes/colored-pink2.css +1125 -0
  55. package/public/contentbuilder/themes/colored-pink3.css +1125 -0
  56. package/public/contentbuilder/themes/colored-pink4.css +1125 -0
  57. package/public/contentbuilder/themes/colored-purple.css +1125 -0
  58. package/public/contentbuilder/themes/colored-purple2.css +1125 -0
  59. package/public/contentbuilder/themes/colored-red.css +1125 -0
  60. package/public/contentbuilder/themes/colored-red2.css +1125 -0
  61. package/public/contentbuilder/themes/colored-red3.css +1125 -0
  62. package/public/contentbuilder/themes/colored-red4.css +1125 -0
  63. package/public/contentbuilder/themes/colored-red5.css +1125 -0
  64. package/public/contentbuilder/themes/colored-yellow.css +1125 -0
  65. package/public/contentbuilder/themes/colored-yellow2.css +1125 -0
  66. package/public/contentbuilder/themes/dark-blue.css +1125 -0
  67. package/public/contentbuilder/themes/dark-blue2.css +1125 -0
  68. package/public/contentbuilder/themes/dark-blue3.css +1125 -0
  69. package/public/contentbuilder/themes/dark-gray.css +1125 -0
  70. package/public/contentbuilder/themes/dark-pink.css +1125 -0
  71. package/public/contentbuilder/themes/dark-purple.css +1125 -0
  72. package/public/contentbuilder/themes/dark-red.css +1125 -0
  73. package/public/contentbuilder/themes/dark.css +1124 -0
  74. package/public/contentbuilder/themes/light-blue.css +1125 -0
  75. package/public/contentbuilder/themes/light-blue2.css +1125 -0
  76. package/public/contentbuilder/themes/light-blue3.css +1125 -0
  77. package/public/contentbuilder/themes/light-cyan.css +1125 -0
  78. package/public/contentbuilder/themes/light-gray.css +1125 -0
  79. package/public/contentbuilder/themes/light-gray2.css +1125 -0
  80. package/public/contentbuilder/themes/light-green.css +1125 -0
  81. package/public/contentbuilder/themes/light-pink.css +1125 -0
  82. package/public/contentbuilder/themes/light-pink2.css +1125 -0
  83. package/public/contentbuilder/themes/light-purple.css +1125 -0
  84. package/public/contentbuilder/themes/light-purple2.css +1125 -0
  85. package/public/contentbuilder/themes/light-red.css +1125 -0
  86. package/public/contentbuilder/themes/light-yellow.css +1125 -0
  87. package/public/contentbuilder/themes/light-yellow2.css +1125 -0
  88. package/readme.txt +23 -0
  89. package/.eslintrc.json +0 -28
  90. package/lib/contentbuilder.js +0 -46668
  91. package/rollup.config.js +0 -23
@@ -0,0 +1,7 @@
1
+ Preview Plugin
2
+
3
+ To install the plugin, modify config file (contentbuilder\config.js) as follow:
4
+
5
+ _cb.settings.plugins = ['buttoneditor'];
6
+
7
+ When you click a button, there will be an 'Edit' icon displayed.
@@ -0,0 +1,15 @@
1
+ /*
2
+ Hello World Plugin
3
+ */
4
+
5
+ (function () {
6
+
7
+ var button_html = '<button id="my_helloworld_button" title="Hello World" style="text-transform:none">hello</button>';
8
+
9
+ _cb.addButton('helloworld', button_html, '#my_helloworld_button', function () {
10
+
11
+ alert('Hello World');
12
+
13
+ });
14
+
15
+ })();
@@ -0,0 +1,23 @@
1
+ Hello World Plugin
2
+
3
+ To install the plugin, modify config file (contentbuilder\config.js) as follow:
4
+
5
+ _cb.settings.plugins = ['helloworld'];
6
+
7
+ This plugin will add a 'Hello World' button on the 'More' popup on toolbar (click the 'More' button).
8
+
9
+ You can also add the "helloworld" button on the buttons or buttonsMore parameters:
10
+
11
+ var obj = $.contentbuilder({
12
+ ...
13
+ buttons: [..., "helloworld", ...]
14
+ });
15
+
16
+ or
17
+
18
+ var obj = $.contentbuilder({
19
+ ...
20
+ buttonsMore: [..., "helloworld", ...]
21
+ });
22
+
23
+ For more info about buttons or buttonsMore parameters, please check the ContentBuilder.js readme.txt.
@@ -0,0 +1,301 @@
1
+ /*
2
+ Preview Plugin
3
+ */
4
+
5
+ (function () {
6
+
7
+ var _screenwidth = window.innerWidth;
8
+ if (_screenwidth <= 640) return;
9
+
10
+ var html =
11
+ '<div class="is-modal is-modal-content previewcontent" style="z-index:10004;;">' +
12
+ '<div style="width:100%;height:100%;position: relative;display: flex;flex-direction: column;align-items: center;padding: 0px;">' +
13
+ '<div class="is-modal-close" style="z-index:2;width:30px;height:30px;position:absolute;top:0px;right:0px;box-sizing:border-box;padding:0;line-height:30px;font-size: 12px;color:#777;text-align:center;cursor:pointer;"><svg class="is-icon-flex" style="width:30px;height:30px;"><use xlink:href="#ion-ios-close-empty"></use></svg></div>' +
14
+ '<div class="is-modal-bar" style="position: absolute;top: 0;left: 0;width: 100%;z-index:1;line-height:1.5;height:32px;padding:0;">' +
15
+ '<div style="width:100%;height:100%;display:flex;justify-content:center;">' +
16
+ '<div class="size-control" data-width="1440" style="width:1440px;border-left: none; border-right: none;">' +
17
+ '<div class="size-control" data-width="1024" style="width:1024px;">' +
18
+ '<div class="size-control" data-width="768" style="width:768px;">' +
19
+ '<div class="size-control" data-width="425" style="width:425px;">' +
20
+ '<div class="size-control" data-width="375" style="width:375px;">' +
21
+ '<div class="size-control" data-width="320" style="width:320px;">' +
22
+ '<div class="size-control-info" style="line-height:32px;">1440px</div>' +
23
+ "</div>" +
24
+ "</div>" +
25
+ "</div>" +
26
+ "</div>" +
27
+ "</div>" +
28
+ "</div>" +
29
+ "</div>" +
30
+ "</div>" +
31
+ '<iframe data-width="1440" style="width:100%;height:100%;max-width:1440px;border:none;border-top:32px solid transparent;margin:0;box-sizing:border-box;background:#fff;" src="about:blank"></iframe>' +
32
+ "</div>" +
33
+ "</div>" +
34
+ '<svg width="0" height="0" style="position:absolute;display:none;">' +
35
+ "<defs>" +
36
+ '<symbol viewBox="0 0 512 512" id="ion-ios-close-empty"><path d="M340.2 160l-84.4 84.3-84-83.9-11.8 11.8 84 83.8-84 83.9 11.8 11.7 84-83.8 84.4 84.2 11.8-11.7-84.4-84.3 84.4-84.2z"></path></symbol>' +
37
+ '<symbol viewBox="0 0 512 512" id="ion-ios-search-strong"><path d="M344.5 298c15-23.6 23.8-51.6 23.8-81.7 0-84.1-68.1-152.3-152.1-152.3C132.1 64 64 132.2 64 216.3c0 84.1 68.1 152.3 152.1 152.3 30.5 0 58.9-9 82.7-24.4l6.9-4.8L414.3 448l33.7-34.3-108.5-108.6 5-7.1zm-43.1-166.8c22.7 22.7 35.2 52.9 35.2 85s-12.5 62.3-35.2 85c-22.7 22.7-52.9 35.2-85 35.2s-62.3-12.5-85-35.2c-22.7-22.7-35.2-52.9-35.2-85s12.5-62.3 35.2-85c22.7-22.7 52.9-35.2 85-35.2s62.3 12.5 85 35.2z"></path></symbol>' +
38
+ "</defs>" +
39
+ "</svg>";
40
+
41
+ _cb.addHtml(html);
42
+
43
+ // var css =
44
+ // "<style>" +
45
+ // ".size-control {cursor:pointer;background:#ddd;border-left:#fff 2px solid;border-right:#fff 2px solid;height:100%;display:flex;justify-content:center;}" +
46
+ // ".size-control-info {text-align:center;color:#000;}" +
47
+ // ".size-control.hover {background:rgb(170,170,170);}" +
48
+ // "</style>";
49
+
50
+ // _cb.addCss(css);
51
+
52
+ var button_html =
53
+ '<button class="previewcontent-button" title="Preview" style="font-size:15px;vertical-align:bottom;">' +
54
+ '<svg class="is-icon-flex"><use xlink:href="#ion-eye"></use></svg>' +
55
+ "</button>";
56
+
57
+ _cb.addButton('preview', button_html, '.previewcontent-button', function (e) {
58
+
59
+ showPreviewWindow();
60
+ e.preventDefault();
61
+
62
+ });
63
+ _cb.addButton2('preview', button_html, '.previewcontent-button', function (e) {
64
+
65
+ showPreviewWindow();
66
+ e.preventDefault();
67
+
68
+ });
69
+
70
+ var modal = document.querySelector(".is-modal.previewcontent");
71
+ if(!modal) return; // in case builder is destroyed
72
+
73
+ var btnClose = modal.querySelector('.is-modal-close');
74
+ btnClose.addEventListener('click', function(e){
75
+ _cb.hideModal(modal);
76
+ });
77
+
78
+ var removeClass = function(element, classname) {
79
+ if(!element) return;
80
+ if(element.classList.length>0) {
81
+ element.className = element.className.replace(new RegExp('\\b'+ classname+'\\b', 'g'), '');
82
+ element.className = element.className.replace(/ +/g, ' ');
83
+ if(element.className === ' ') element.removeAttribute('class');
84
+ }
85
+ }
86
+
87
+ var addClass = function(element, classname) {
88
+ if(!element) return;
89
+ if(hasClass(element,classname)) return;
90
+ if(element.classList.length===0) element.className = classname;
91
+ else element.className = element.className + ' ' + classname;
92
+ element.className = element.className.replace(/ +/g, ' ');
93
+ }
94
+
95
+ var hasClass = function(element, classname) {
96
+ if(!element) return false;
97
+ try{
98
+ let s = element.getAttribute('class');
99
+ return new RegExp('\\b'+ classname+'\\b').test(s);
100
+ } catch(e) {
101
+ 0;
102
+ }
103
+ }
104
+
105
+ var sizeControls = modal.querySelectorAll(".size-control");
106
+ Array.prototype.forEach.call(sizeControls, function(sizeControl){
107
+
108
+ sizeControl.addEventListener('mouseover', function(e) {
109
+
110
+ var elms = modal.querySelectorAll(".size-control");
111
+ Array.prototype.forEach.call(elms, function(elm){
112
+ // elm.style.background = "#ddd";
113
+ removeClass(elm, 'hover');
114
+ });
115
+ // sizeControl.style.background = "#aaa";
116
+ addClass(sizeControl, 'hover');
117
+
118
+ elms = sizeControl.querySelectorAll(".size-control");
119
+ Array.prototype.forEach.call(elms, function(elm){
120
+ // elm.style.background = "#aaa";
121
+ addClass(elm, 'hover');
122
+ });
123
+
124
+ // modal.querySelector(".size-control-info").style.color = '#fff';
125
+
126
+ var w = sizeControl.getAttribute('data-width');
127
+ modal.querySelector(".size-control-info").innerHTML = w + 'px';
128
+ e.preventDefault();
129
+ e.stopImmediatePropagation();
130
+
131
+ });
132
+
133
+ sizeControl.addEventListener('mouseout', function(e) {
134
+
135
+ var elms = modal.querySelectorAll(".size-control");
136
+ Array.prototype.forEach.call(elms, function(elm){
137
+ // elm.style.background = "#ddd";
138
+ removeClass(elm, 'hover');
139
+ });
140
+ // modal.querySelector(".size-control-info").style.color = '#000';
141
+
142
+ var currW = modal.querySelector("iframe").getAttribute('data-width');
143
+ modal.querySelector(".size-control-info").innerText = currW + 'px';
144
+
145
+ });
146
+
147
+ sizeControl.addEventListener('click', function(e) {
148
+
149
+ var w = sizeControl.getAttribute('data-width');
150
+
151
+ modal.querySelector("iframe").style.maxWidth = w + 'px';
152
+ modal.querySelector("iframe").setAttribute('data-width', w);
153
+
154
+ e.preventDefault();
155
+ e.stopImmediatePropagation();
156
+
157
+ });
158
+
159
+ });
160
+
161
+ })();
162
+
163
+ function showPreviewWindow() {
164
+
165
+ var modal = document.querySelector(".is-modal.previewcontent");
166
+ _cb.showModal(modal);
167
+
168
+ //check if builder is inside iframe
169
+ if(window.frameElement) {
170
+ var c = getFramedWindow(window.frameElement);
171
+ var doc = c.document;
172
+ } else {
173
+ var doc = parent.document;
174
+ }
175
+
176
+ var basehref = "";
177
+ var base = doc.querySelectorAll("base[href]");
178
+ if (base.length > 0) {
179
+ basehref = '<base href="' + base[0].href + '" />';
180
+ }
181
+
182
+ var csslinks = "";
183
+ var styles = doc.querySelectorAll("link[href]");
184
+ for (var i = 0; i < styles.length; i++) {
185
+ if (
186
+ styles[i].href.indexOf(".css") != -1 &&
187
+ styles[i].href.indexOf("contentbox.css") == -1 &&
188
+ styles[i].href.indexOf("contentbuilder.css") == -1
189
+ ) {
190
+ csslinks +=
191
+ '<link href="' +
192
+ styles[i].href +
193
+ '" rel="stylesheet" type="text/css" />';
194
+ }
195
+ }
196
+
197
+ var jsincludes = "";
198
+ var scripts = doc.querySelectorAll("script[src]");
199
+ for (var i = 0; i < scripts.length; i++) {
200
+ if (
201
+ scripts[i].src.indexOf(".js") != -1 &&
202
+ scripts[i].src.indexOf("index.js") == -1 &&
203
+ scripts[i].src.indexOf("contentbox.js") == -1 &&
204
+ scripts[i].src.indexOf("contentbox.min.js") == -1 &&
205
+ scripts[i].src.indexOf("contentbuilder.js") == -1 &&
206
+ scripts[i].src.indexOf("contentbuilder.min.js") == -1 &&
207
+ scripts[i].src.indexOf("plugin.js") == -1 &&
208
+ scripts[i].src.indexOf("config.js") == -1 &&
209
+ scripts[i].src.indexOf("en.js") == -1 &&
210
+ scripts[i].src.indexOf("minimalist-blocks") == -1
211
+ ) {
212
+ jsincludes +=
213
+ '<script src="' +
214
+ scripts[i].src +
215
+ '" type="text/javascript"></script>';
216
+ }
217
+ }
218
+
219
+ // No script
220
+ jsincludes = '';
221
+
222
+ /* Get Page */
223
+ if (!document.querySelector(".is-wrapper")) {
224
+ var maxwidth = "800px";
225
+ var maxw = window.getComputedStyle(document.querySelector(".is-builder")).getPropertyValue('max-width');
226
+ if (!isNaN(parseInt(maxw))) maxwidth = maxw;
227
+
228
+ var content = _cb.html();
229
+
230
+ var doc = modal.querySelector('iframe').contentWindow.document;
231
+ doc.open();
232
+ doc.write(
233
+ "<html>" +
234
+ "<head>" +
235
+ basehref +
236
+ '<meta charset="utf-8">' +
237
+ "<title></title>" +
238
+ csslinks +
239
+ (_cb.useLightbox? '<link href="'+_cb.assetPath+'scripts/lightbox/lightbox.css" rel="stylesheet" type="text/css" />':'') +
240
+ "<style>" +
241
+ ".slider-image { display:block !important; }" +
242
+ ".container {margin:35px auto 0; max-width: " +
243
+ maxwidth +
244
+ "; width:100%; padding:0 20px; box-sizing: border-box;}" +
245
+ "</style>" +
246
+ '<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>' +
247
+ "</head>" +
248
+ "<body>" +
249
+ '<div class="container">' +
250
+ content +
251
+ "</div>" +
252
+ jsincludes +
253
+ (_cb.useLightbox? '<script src="'+_cb.assetPath+'scripts/lightbox/lightbox.js"></script><script>window.lightbox.init();</script>':'') +
254
+ "</body>" +
255
+ "</html>"
256
+ );
257
+ doc.close();
258
+
259
+ } else {
260
+ // ContentBox
261
+ var content = jQuery(".is-wrapper")
262
+ .data("contentbox")
263
+ .html();
264
+
265
+ var doc = modal.querySelector('iframe').contentWindow.document;
266
+ doc.open();
267
+ doc.write(
268
+ "<html>" +
269
+ "<head>" +
270
+ basehref +
271
+ '<meta charset="utf-8">' +
272
+ "<title></title>" +
273
+ csslinks +
274
+ "<style>" +
275
+ ".slider-image { display:block !important; }" +
276
+ "</style>" +
277
+ '<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>' +
278
+ "</head>" +
279
+ "<body>" +
280
+ '<div class="is-wrapper">' +
281
+ content +
282
+ "</div>" +
283
+ jsincludes +
284
+ "</body>" +
285
+ "</html>"
286
+ );
287
+ doc.close();
288
+
289
+ }
290
+ //Or you can specify your custom preview page:
291
+ //modal.find('iframe').attr('src','preview.html');
292
+ }
293
+
294
+ function getFramedWindow(f) {
295
+ if(f.parentNode == null)
296
+ f = document.body.appendChild(f);
297
+ var w = (f.contentWindow || f.contentDocument);
298
+ if(w && w.nodeType && w.nodeType==9)
299
+ w = (w.defaultView || w.parentWindow);
300
+ return w;
301
+ }
@@ -0,0 +1,23 @@
1
+ Preview Plugin
2
+
3
+ To install the plugin, modify config file (contentbuilder\config.js) as follow:
4
+
5
+ _cb.settings.plugins = ['preview'];
6
+
7
+ This plugin will add a 'Preview' button on the 'More' popup on the toolbar (click the 'More' button).
8
+
9
+ You can also add the "preview" button on the toolbar as follow:
10
+
11
+ var obj = $.contentbuilder({
12
+ ...
13
+ buttons: [..., "preview", ...]
14
+ });
15
+
16
+ or
17
+
18
+ var obj = $.contentbuilder({
19
+ ...
20
+ buttonsMore: [..., "preview", ...]
21
+ });
22
+
23
+ (For more info about buttons or buttonsMore parameters, please check the ContentBuilder.js readme.txt)