@innovastudio/contentbuilder 1.3.85 → 1.3.87

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 (62) hide show
  1. package/package.json +1 -1
  2. package/public/contentbuilder/contentbuilder.css +132 -71
  3. package/public/contentbuilder/contentbuilder.esm.js +1997 -901
  4. package/public/contentbuilder/contentbuilder.min.js +8 -8
  5. package/public/contentbuilder/lang/en.js +8 -1
  6. package/public/contentbuilder/lang/fr.js +8 -1
  7. package/public/contentbuilder/themes/colored-blue.css +9 -4
  8. package/public/contentbuilder/themes/colored-blue2.css +9 -4
  9. package/public/contentbuilder/themes/colored-blue3.css +9 -4
  10. package/public/contentbuilder/themes/colored-blue4.css +9 -4
  11. package/public/contentbuilder/themes/colored-blue5.css +9 -4
  12. package/public/contentbuilder/themes/colored-blue6.css +9 -4
  13. package/public/contentbuilder/themes/colored-blue7.css +9 -4
  14. package/public/contentbuilder/themes/colored-blue8.css +9 -4
  15. package/public/contentbuilder/themes/colored-dark.css +9 -4
  16. package/public/contentbuilder/themes/colored-darkblue.css +9 -4
  17. package/public/contentbuilder/themes/colored-gray.css +9 -4
  18. package/public/contentbuilder/themes/colored-green.css +9 -4
  19. package/public/contentbuilder/themes/colored-green2.css +9 -4
  20. package/public/contentbuilder/themes/colored-green3.css +9 -4
  21. package/public/contentbuilder/themes/colored-green4.css +9 -4
  22. package/public/contentbuilder/themes/colored-green5.css +9 -4
  23. package/public/contentbuilder/themes/colored-magenta.css +9 -4
  24. package/public/contentbuilder/themes/colored-orange.css +9 -4
  25. package/public/contentbuilder/themes/colored-orange2.css +9 -4
  26. package/public/contentbuilder/themes/colored-orange3.css +9 -4
  27. package/public/contentbuilder/themes/colored-pink.css +9 -4
  28. package/public/contentbuilder/themes/colored-pink2.css +9 -4
  29. package/public/contentbuilder/themes/colored-pink3.css +9 -4
  30. package/public/contentbuilder/themes/colored-pink4.css +9 -4
  31. package/public/contentbuilder/themes/colored-purple.css +9 -4
  32. package/public/contentbuilder/themes/colored-purple2.css +9 -4
  33. package/public/contentbuilder/themes/colored-red.css +9 -4
  34. package/public/contentbuilder/themes/colored-red2.css +9 -4
  35. package/public/contentbuilder/themes/colored-red3.css +9 -4
  36. package/public/contentbuilder/themes/colored-red4.css +9 -4
  37. package/public/contentbuilder/themes/colored-red5.css +9 -4
  38. package/public/contentbuilder/themes/colored-yellow.css +9 -4
  39. package/public/contentbuilder/themes/colored-yellow2.css +9 -4
  40. package/public/contentbuilder/themes/dark-blue.css +15 -4
  41. package/public/contentbuilder/themes/dark-blue2.css +15 -4
  42. package/public/contentbuilder/themes/dark-blue3.css +15 -4
  43. package/public/contentbuilder/themes/dark-gray.css +15 -4
  44. package/public/contentbuilder/themes/dark-pink.css +15 -4
  45. package/public/contentbuilder/themes/dark-purple.css +15 -4
  46. package/public/contentbuilder/themes/dark-red.css +15 -4
  47. package/public/contentbuilder/themes/dark.css +15 -4
  48. package/public/contentbuilder/themes/light-blue.css +9 -4
  49. package/public/contentbuilder/themes/light-blue2.css +9 -4
  50. package/public/contentbuilder/themes/light-blue3.css +9 -4
  51. package/public/contentbuilder/themes/light-cyan.css +9 -4
  52. package/public/contentbuilder/themes/light-gray.css +9 -4
  53. package/public/contentbuilder/themes/light-gray2.css +9 -4
  54. package/public/contentbuilder/themes/light-gray3.css +9 -4
  55. package/public/contentbuilder/themes/light-green.css +9 -4
  56. package/public/contentbuilder/themes/light-pink.css +9 -4
  57. package/public/contentbuilder/themes/light-pink2.css +9 -4
  58. package/public/contentbuilder/themes/light-purple.css +9 -4
  59. package/public/contentbuilder/themes/light-purple2.css +9 -4
  60. package/public/contentbuilder/themes/light-red.css +9 -4
  61. package/public/contentbuilder/themes/light-yellow.css +9 -4
  62. package/public/contentbuilder/themes/light-yellow2.css +9 -4
@@ -7212,6 +7212,167 @@ class Util {
7212
7212
  return html;
7213
7213
  }
7214
7214
 
7215
+ getPageTemplate(framework) {
7216
+ let pageTemplate = '';
7217
+
7218
+ if (framework === '') {
7219
+ pageTemplate = `
7220
+ <!DOCTYPE html>
7221
+ <html lang="en">
7222
+ <head>
7223
+ <meta charset="utf-8">
7224
+ <title>Page</title>
7225
+ <meta name="viewport" content="width=device-width, initial-scale=1">
7226
+ <meta name="description" content="">
7227
+ <link rel="shortcut icon" href="#" />
7228
+
7229
+ <link href="[%PATH%]/assets/minimalist-blocks/content.css" rel="stylesheet" type="text/css" />
7230
+
7231
+ <link href="[%PATH%]/assets/scripts/glide/css/glide.core.css" rel="stylesheet" type="text/css" />
7232
+ <link href="[%PATH%]/assets/scripts/glide/css/glide.theme.css" rel="stylesheet" type="text/css" />
7233
+ <script src="[%PATH%]/assets/scripts/glide/glide.js" type="text/javascript"></script>
7234
+
7235
+ <style>
7236
+ .container {
7237
+ margin: 150px auto 0;
7238
+ max-width: 800px;
7239
+ width: 100%;
7240
+ padding: 0 20px;
7241
+ box-sizing: border-box;
7242
+ }
7243
+ </style>
7244
+ </head>
7245
+ <body>
7246
+
7247
+ <div class="container">
7248
+ [%CONTENT%]
7249
+ </div>
7250
+
7251
+ </body>
7252
+ </html>
7253
+ `;
7254
+ } else if (framework === 'tailwind') {
7255
+ pageTemplate = `
7256
+ <!DOCTYPE html>
7257
+ <html lang="en">
7258
+ <head>
7259
+ <meta charset="utf-8">
7260
+ <title>Page</title>
7261
+ <meta name="viewport" content="width=device-width, initial-scale=1">
7262
+ <meta name="description" content="">
7263
+ <link rel="shortcut icon" href="#" />
7264
+
7265
+ <link href="[%PATH%]/assets/minimalist-blocks/content-tailwind.css" rel="stylesheet" type="text/css" />
7266
+
7267
+ <link href="[%PATH%]/assets/scripts/glide/css/glide.core.css" rel="stylesheet" type="text/css" />
7268
+ <link href="[%PATH%]/assets/scripts/glide/css/glide.theme.css" rel="stylesheet" type="text/css" />
7269
+ <script src="[%PATH%]/assets/scripts/glide/glide.js" type="text/javascript"></script>
7270
+
7271
+ <link rel="stylesheet" href="[%PATH%]/assets/frameworks/tailwindcss/styles.css">
7272
+ <!-- To build your own, please see: https://tailwindcss.com/docs/installation -->
7273
+
7274
+ <style>
7275
+ .container {
7276
+ margin: 150px auto 0;
7277
+ max-width: 800px;
7278
+ width: 100%;
7279
+ padding: 0 20px;
7280
+ box-sizing: border-box;
7281
+ }
7282
+ </style>
7283
+ </head>
7284
+ <body>
7285
+
7286
+ <div class="container">
7287
+ [%CONTENT%]
7288
+ </div>
7289
+
7290
+ </body>
7291
+ </html>
7292
+ `;
7293
+ } else if (framework === 'bootstrap') {
7294
+ pageTemplate = `
7295
+ <!DOCTYPE html>
7296
+ <html lang="en">
7297
+ <head>
7298
+ <meta charset="utf-8">
7299
+ <title>Page</title>
7300
+ <meta name="viewport" content="width=device-width, initial-scale=1">
7301
+ <meta name="description" content="">
7302
+ <link rel="shortcut icon" href="#" />
7303
+
7304
+ <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
7305
+
7306
+ <link href="[%PATH%]/assets/minimalist-blocks/content.css" rel="stylesheet" type="text/css" />
7307
+
7308
+ <link href="[%PATH%]/assets/scripts/glide/css/glide.core.css" rel="stylesheet" type="text/css" />
7309
+ <link href="[%PATH%]/assets/scripts/glide/css/glide.theme.css" rel="stylesheet" type="text/css" />
7310
+ <script src="[%PATH%]/assets/scripts/glide/glide.js" type="text/javascript"></script>
7311
+
7312
+ <style>
7313
+ .container {margin: 140px auto; max-width: 800px; width:100%; padding:0 35px; box-sizing: border-box;}
7314
+ /* Bootstrap css adjustment to enable column drag to resize */
7315
+ .row > *,
7316
+ .column {
7317
+ max-width: unset !important;
7318
+ }
7319
+ </style>
7320
+ </head>
7321
+ <body>
7322
+
7323
+ <div class="container">
7324
+ [%CONTENT%]
7325
+ </div>
7326
+
7327
+ </body>
7328
+ </html>
7329
+ `;
7330
+ } else if (framework === 'foundation') {
7331
+ pageTemplate = `
7332
+ <!DOCTYPE html>
7333
+ <html lang="en">
7334
+ <head>
7335
+ <meta charset="utf-8">
7336
+ <title>Page</title>
7337
+ <meta name="viewport" content="width=device-width, initial-scale=1">
7338
+ <meta name="description" content="">
7339
+ <link rel="shortcut icon" href="#" />
7340
+
7341
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.5.3/css/foundation.min.css">
7342
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.5.3/css/foundation-float.min.css">
7343
+
7344
+ <link href="[%PATH%]/assets/minimalist-blocks/content.css" rel="stylesheet" type="text/css" />
7345
+
7346
+ <link href="[%PATH%]/assets/scripts/glide/css/glide.core.css" rel="stylesheet" type="text/css" />
7347
+ <link href="[%PATH%]/assets/scripts/glide/css/glide.theme.css" rel="stylesheet" type="text/css" />
7348
+ <script src="[%PATH%]/assets/scripts/glide/glide.js" type="text/javascript"></script>
7349
+
7350
+ <style>
7351
+ .container {
7352
+ margin: 150px auto 0;
7353
+ max-width: 800px;
7354
+ width: 100%;
7355
+ padding: 0 20px;
7356
+ box-sizing: border-box;
7357
+ }
7358
+ </style>
7359
+ </head>
7360
+ <body>
7361
+
7362
+ <div class="container">
7363
+ [%CONTENT%]
7364
+ </div>
7365
+
7366
+ </body>
7367
+ </html>
7368
+ `;
7369
+ } else {
7370
+ pageTemplate = '[%CONTENT%]';
7371
+ }
7372
+
7373
+ return pageTemplate;
7374
+ }
7375
+
7215
7376
  }
7216
7377
  class Dom {
7217
7378
  constructor(builder) {
@@ -14522,7 +14683,7 @@ var loader = {
14522
14683
  __getMonacoInstance: __getMonacoInstance
14523
14684
  };
14524
14685
 
14525
- const dom$h = new Dom();
14686
+ const dom$j = new Dom();
14526
14687
  let hash$1 = {};
14527
14688
  class HtmlUtil {
14528
14689
  constructor(builder) {
@@ -14570,28 +14731,28 @@ class HtmlUtil {
14570
14731
  </div>
14571
14732
 
14572
14733
  `;
14573
- dom$h.appendHtml(builderStuff, html);
14734
+ dom$j.appendHtml(builderStuff, html);
14574
14735
  viewhtml = builderStuff.querySelector('.viewhtml');
14575
14736
  let viewhtmlmonaco = builderStuff.querySelector('.viewhtmlmonaco');
14576
14737
  let viewhtmlexternal = builderStuff.querySelector('.viewhtmlexternal');
14577
14738
  let elm = viewhtml.querySelector('.input-ok');
14578
- dom$h.addEventListener(elm, 'click', () => {
14739
+ dom$j.addEventListener(elm, 'click', () => {
14579
14740
  this.applyHtml(viewhtml);
14580
14741
  });
14581
14742
  elm = viewhtml.querySelector('.input-cancel');
14582
- dom$h.addEventListener(elm, 'click', () => {
14743
+ dom$j.addEventListener(elm, 'click', () => {
14583
14744
  this.builder.hideModal(viewhtml);
14584
14745
  });
14585
14746
  elm = viewhtmlmonaco.querySelector('.input-ok');
14586
- dom$h.addEventListener(elm, 'click', () => {
14747
+ dom$j.addEventListener(elm, 'click', () => {
14587
14748
  this.applyHtml(viewhtmlmonaco);
14588
14749
  });
14589
14750
  elm = viewhtmlmonaco.querySelector('.input-cancel');
14590
- dom$h.addEventListener(elm, 'click', () => {
14751
+ dom$j.addEventListener(elm, 'click', () => {
14591
14752
  this.builder.hideModal(viewhtmlmonaco);
14592
14753
  });
14593
14754
  elm = viewhtmlexternal.querySelector('.input-ok');
14594
- dom$h.addEventListener(elm, 'click', () => {
14755
+ dom$j.addEventListener(elm, 'click', () => {
14595
14756
  const source = document.querySelector('textarea[data-source-active]');
14596
14757
  const selectorOk = source.getAttribute('data-source-ok');
14597
14758
  source.removeAttribute('data-source-active');
@@ -14601,7 +14762,7 @@ class HtmlUtil {
14601
14762
  this.builder.hideModal(viewhtmlexternal);
14602
14763
  });
14603
14764
  elm = viewhtmlexternal.querySelector('.input-cancel');
14604
- dom$h.addEventListener(elm, 'click', () => {
14765
+ dom$j.addEventListener(elm, 'click', () => {
14605
14766
  const source = document.querySelector('textarea[data-source-active]');
14606
14767
  const selectorCancel = source.getAttribute('data-source-cancel');
14607
14768
  source.removeAttribute('data-source-active');
@@ -14888,7 +15049,7 @@ class HtmlUtil {
14888
15049
 
14889
15050
  this.builder.cleanHtmlFormatting = false; //Change to row selection
14890
15051
 
14891
- dom$h.removeClass(row, 'row-outline');
15052
+ dom$j.removeClass(row, 'row-outline');
14892
15053
  }
14893
15054
 
14894
15055
  if (mode === 'full') {
@@ -15133,112 +15294,116 @@ class HtmlUtil {
15133
15294
 
15134
15295
  _builder.removeAttribute('data-sort');
15135
15296
 
15136
- dom$h.removeClass(_builder, 'builder-active');
15137
- const rows = dom$h.elementChildren(_builder);
15297
+ dom$j.removeClass(_builder, 'builder-active');
15298
+ const rows = dom$j.elementChildren(_builder);
15138
15299
  rows.forEach(row => {
15139
- const cols = dom$h.elementChildren(row);
15300
+ const cols = dom$j.elementChildren(row);
15140
15301
  cols.forEach(col => {
15141
15302
  col.style.cursor = '';
15142
15303
  });
15143
15304
  });
15144
15305
  }); // cleanup cursor from drag to resize columns
15145
15306
 
15146
- const rows = dom$h.elementChildren(tmp);
15307
+ const rows = dom$j.elementChildren(tmp);
15147
15308
  rows.forEach(row => {
15148
15309
  row.style.cursor = ''; //if tmp is row html, then this is a column
15149
15310
 
15150
- const cols = dom$h.elementChildren(row);
15311
+ const cols = dom$j.elementChildren(row);
15151
15312
  cols.forEach(col => {
15152
15313
  col.style.cursor = '';
15153
15314
  });
15154
15315
  });
15155
15316
  let elms = tmp.querySelectorAll('.sortable-chosen');
15156
- dom$h.removeClasses(elms, 'sortable-chosen');
15317
+ dom$j.removeClasses(elms, 'sortable-chosen');
15157
15318
  elms = tmp.querySelectorAll('.sortable-ghost');
15158
- dom$h.removeClasses(elms, 'sortable-ghost');
15319
+ dom$j.removeClasses(elms, 'sortable-ghost');
15159
15320
  elms = tmp.querySelectorAll('.elm-active');
15160
- dom$h.removeClasses(elms, 'elm-active');
15321
+ dom$j.removeClasses(elms, 'elm-active');
15161
15322
  elms = tmp.querySelectorAll('.elm-inspected');
15162
- dom$h.removeClasses(elms, 'elm-inspected');
15323
+ dom$j.removeClasses(elms, 'elm-inspected');
15163
15324
  elms = tmp.querySelectorAll('.cell-active');
15164
- dom$h.removeClasses(elms, 'cell-active');
15325
+ dom$j.removeClasses(elms, 'cell-active');
15165
15326
  elms = tmp.querySelectorAll('.row-active');
15166
- dom$h.removeClasses(elms, 'row-active');
15327
+ dom$j.removeClasses(elms, 'row-active');
15167
15328
  elms = tmp.querySelectorAll('.row-outline');
15168
- dom$h.removeClasses(elms, 'row-outline');
15329
+ dom$j.removeClasses(elms, 'row-outline');
15169
15330
  elms = tmp.querySelectorAll('.is-builder');
15170
- dom$h.removeClasses(elms, 'is-builder');
15331
+ dom$j.removeClasses(elms, 'is-builder');
15171
15332
  elms = tmp.querySelectorAll('.row-outline');
15172
- dom$h.removeClasses(elms, 'row-outline');
15333
+ dom$j.removeClasses(elms, 'row-outline');
15173
15334
  elms = tmp.querySelectorAll('[data-click]');
15174
- dom$h.removeAttributes(elms, 'data-click');
15335
+ dom$j.removeAttributes(elms, 'data-click');
15175
15336
  elms = tmp.querySelectorAll('[contenteditable]');
15176
- dom$h.removeAttributes(elms, 'contenteditable');
15337
+ dom$j.removeAttributes(elms, 'contenteditable');
15177
15338
  elms = tmp.querySelectorAll('[draggridoutline]');
15178
- dom$h.removeAttributes(elms, 'draggridoutline');
15339
+ dom$j.removeAttributes(elms, 'draggridoutline');
15179
15340
  elms = tmp.querySelectorAll('[between-blocks-left]');
15180
- dom$h.removeAttributes(elms, 'between-blocks-left');
15341
+ dom$j.removeAttributes(elms, 'between-blocks-left');
15181
15342
  elms = tmp.querySelectorAll('[between-blocks-center]');
15182
- dom$h.removeAttributes(elms, 'between-blocks-center');
15343
+ dom$j.removeAttributes(elms, 'between-blocks-center');
15183
15344
  elms = tmp.querySelectorAll('[hideelementhighlight]');
15184
- dom$h.removeAttributes(elms, 'hideelementhighlight');
15345
+ dom$j.removeAttributes(elms, 'hideelementhighlight');
15185
15346
  elms = tmp.querySelectorAll('[data-module-active]');
15186
- dom$h.removeAttributes(elms, 'data-module-active');
15347
+ dom$j.removeAttributes(elms, 'data-module-active');
15187
15348
  elms = tmp.querySelectorAll('[draggable]');
15188
- dom$h.removeAttributes(elms, 'draggable');
15349
+ dom$j.removeAttributes(elms, 'draggable');
15189
15350
  elms = tmp.querySelectorAll('[data-animated]');
15190
- dom$h.removeAttributes(elms, 'data-animated');
15351
+ dom$j.removeAttributes(elms, 'data-animated');
15191
15352
  elms = tmp.querySelectorAll('[data-saveforundo]');
15192
- dom$h.removeAttributes(elms, 'data-saveforundo');
15353
+ dom$j.removeAttributes(elms, 'data-saveforundo');
15193
15354
  elms = tmp.querySelectorAll('[hidesnippetaddtool]');
15194
- dom$h.removeAttributes(elms, 'hidesnippetaddtool');
15355
+ dom$j.removeAttributes(elms, 'hidesnippetaddtool');
15195
15356
  elms = tmp.querySelectorAll('[gray]');
15196
- dom$h.removeAttributes(elms, 'gray');
15357
+ dom$j.removeAttributes(elms, 'gray');
15197
15358
  elms = tmp.querySelectorAll('[rowoutline]');
15198
- dom$h.removeAttributes(elms, 'rowoutline');
15359
+ dom$j.removeAttributes(elms, 'rowoutline');
15199
15360
  elms = tmp.querySelectorAll('[hidecolumntool]');
15200
- dom$h.removeAttributes(elms, 'hidecolumntool');
15361
+ dom$j.removeAttributes(elms, 'hidecolumntool');
15201
15362
  elms = tmp.querySelectorAll('[grayoutline]');
15202
- dom$h.removeAttributes(elms, 'grayoutline');
15363
+ dom$j.removeAttributes(elms, 'grayoutline');
15203
15364
  elms = tmp.querySelectorAll('[hideoutline]');
15204
- dom$h.removeAttributes(elms, 'hideoutline');
15365
+ dom$j.removeAttributes(elms, 'hideoutline');
15205
15366
  elms = tmp.querySelectorAll('[leftrowtool]');
15206
- dom$h.removeAttributes(elms, 'leftrowtool');
15367
+ dom$j.removeAttributes(elms, 'leftrowtool');
15207
15368
  elms = tmp.querySelectorAll('[minimal]');
15208
- dom$h.removeAttributes(elms, 'minimal');
15369
+ dom$j.removeAttributes(elms, 'minimal');
15209
15370
  elms = tmp.querySelectorAll('[clean]');
15210
- dom$h.removeAttributes(elms, 'clean');
15371
+ dom$j.removeAttributes(elms, 'clean');
15211
15372
  elms = tmp.querySelectorAll('[grideditor]');
15212
- dom$h.removeAttributes(elms, 'grideditor');
15373
+ dom$j.removeAttributes(elms, 'grideditor');
15213
15374
  elms = tmp.querySelectorAll('[gridoutline]');
15214
- dom$h.removeAttributes(elms, 'gridoutline');
15215
- dom$h.removeElements(tmp.querySelectorAll('.is-row-tool'));
15216
- dom$h.removeElements(tmp.querySelectorAll('.is-col-tool'));
15217
- dom$h.removeElements(tmp.querySelectorAll('.is-rowadd-tool'));
15218
- dom$h.removeElements(tmp.querySelectorAll('.ovl'));
15219
- dom$h.removeElements(tmp.querySelectorAll('.row-add-initial')); //Extra cleaning
15375
+ dom$j.removeAttributes(elms, 'gridoutline');
15376
+ dom$j.removeElements(tmp.querySelectorAll('.is-row-tool'));
15377
+ dom$j.removeElements(tmp.querySelectorAll('.is-col-tool'));
15378
+ dom$j.removeElements(tmp.querySelectorAll('.is-rowadd-tool'));
15379
+ dom$j.removeElements(tmp.querySelectorAll('.ovl'));
15380
+ dom$j.removeElements(tmp.querySelectorAll('.row-add-initial')); //Extra cleaning
15220
15381
 
15221
15382
  elms = tmp.querySelectorAll('.aos-init');
15222
- dom$h.removeClasses(elms, 'aos-init');
15383
+ dom$j.removeClasses(elms, 'aos-init');
15223
15384
  elms = tmp.querySelectorAll('.aos-animate');
15224
- dom$h.removeClasses(elms, 'aos-animate');
15385
+ dom$j.removeClasses(elms, 'aos-animate');
15225
15386
  elms = tmp.querySelectorAll('.skrollable');
15226
- dom$h.removeClasses(elms, 'skrollable');
15387
+ dom$j.removeClasses(elms, 'skrollable');
15227
15388
  elms = tmp.querySelectorAll('.skrollable-after');
15228
- dom$h.removeClasses(elms, 'skrollable-after');
15389
+ dom$j.removeClasses(elms, 'skrollable-after');
15229
15390
  elms = tmp.querySelectorAll('.skrollable-before');
15230
- dom$h.removeClasses(elms, 'skrollable-before');
15391
+ dom$j.removeClasses(elms, 'skrollable-before');
15231
15392
  elms = tmp.querySelectorAll('.skrollable-between');
15232
- dom$h.removeClasses(elms, 'skrollable-between');
15393
+ dom$j.removeClasses(elms, 'skrollable-between');
15233
15394
  elms = tmp.querySelectorAll('.is-inview');
15234
- dom$h.removeClasses(elms, 'is-inview');
15395
+ dom$j.removeClasses(elms, 'is-inview');
15235
15396
  let emptyclasses = tmp.querySelectorAll('[class=""]');
15236
15397
  Array.prototype.forEach.call(emptyclasses, emptyclass => {
15237
15398
  emptyclass.removeAttribute('class');
15238
15399
  });
15239
- dom$h.removeEmptyStyle(tmp);
15400
+ let unusedOverlays = tmp.querySelectorAll('.is-row-overlay');
15401
+ Array.prototype.forEach.call(unusedOverlays, unusedOverlay => {
15402
+ if (!unusedOverlay.hasAttribute('style')) unusedOverlay.parentNode.removeChild(unusedOverlay);
15403
+ });
15404
+ dom$j.removeEmptyStyle(tmp);
15240
15405
  elms = tmp.querySelectorAll('[data-keep]');
15241
- dom$h.removeAttributes(elms, 'data-keep'); //Backward compatible: cleanup button <span contenteditable="false"><a contenteditable="true">button</a></span>
15406
+ dom$j.removeAttributes(elms, 'data-keep'); //Backward compatible: cleanup button <span contenteditable="false"><a contenteditable="true">button</a></span>
15242
15407
 
15243
15408
  let links = tmp.querySelectorAll('a');
15244
15409
  Array.prototype.forEach.call(links, link => {
@@ -15254,77 +15419,77 @@ class HtmlUtil {
15254
15419
  //ContentBox
15255
15420
  // Remove dummy DIV after last section
15256
15421
  let elms = tmp.querySelectorAll('.is-dummy');
15257
- dom$h.removeElements(elms);
15422
+ dom$j.removeElements(elms);
15258
15423
  elms = tmp.querySelectorAll('[data-scroll]');
15259
- dom$h.removeAttributes(elms, 'data-scroll');
15424
+ dom$j.removeAttributes(elms, 'data-scroll');
15260
15425
  elms = tmp.querySelectorAll('[data-scroll-once]');
15261
- dom$h.removeAttributes(elms, 'data-scroll-once');
15426
+ dom$j.removeAttributes(elms, 'data-scroll-once');
15262
15427
 
15263
15428
  if (this.builder.shortenOutput) {
15264
15429
  elms = tmp.querySelectorAll('[data-noedit]');
15265
- dom$h.removeAttributes(elms, 'data-noedit');
15430
+ dom$j.removeAttributes(elms, 'data-noedit');
15266
15431
  elms = tmp.querySelectorAll('[data-module]');
15267
- dom$h.removeAttributes(elms, 'data-module');
15432
+ dom$j.removeAttributes(elms, 'data-module');
15268
15433
  elms = tmp.querySelectorAll('[data-module-desc]');
15269
- dom$h.removeAttributes(elms, 'data-module-desc');
15434
+ dom$j.removeAttributes(elms, 'data-module-desc');
15270
15435
  elms = tmp.querySelectorAll('[data-dialog-width]');
15271
- dom$h.removeAttributes(elms, 'data-dialog-width');
15436
+ dom$j.removeAttributes(elms, 'data-dialog-width');
15272
15437
  elms = tmp.querySelectorAll('[data-dialog-height]');
15273
- dom$h.removeAttributes(elms, 'data-dialog-height');
15438
+ dom$j.removeAttributes(elms, 'data-dialog-height');
15274
15439
  elms = tmp.querySelectorAll('[data-html]');
15275
- dom$h.removeAttributes(elms, 'data-html');
15440
+ dom$j.removeAttributes(elms, 'data-html');
15276
15441
  elms = tmp.querySelectorAll('[data-settings]');
15277
- dom$h.removeAttributes(elms, 'data-settings');
15442
+ dom$j.removeAttributes(elms, 'data-settings');
15278
15443
  elms = tmp.querySelectorAll('[data-html-1]');
15279
- dom$h.removeAttributes(elms, 'data-html-1');
15444
+ dom$j.removeAttributes(elms, 'data-html-1');
15280
15445
  elms = tmp.querySelectorAll('[data-html-2]');
15281
- dom$h.removeAttributes(elms, 'data-html-2');
15446
+ dom$j.removeAttributes(elms, 'data-html-2');
15282
15447
  elms = tmp.querySelectorAll('[data-html-3]');
15283
- dom$h.removeAttributes(elms, 'data-html-3');
15448
+ dom$j.removeAttributes(elms, 'data-html-3');
15284
15449
  elms = tmp.querySelectorAll('[data-html-4]');
15285
- dom$h.removeAttributes(elms, 'data-html-4');
15450
+ dom$j.removeAttributes(elms, 'data-html-4');
15286
15451
  elms = tmp.querySelectorAll('[data-html-5]');
15287
- dom$h.removeAttributes(elms, 'data-html-5');
15452
+ dom$j.removeAttributes(elms, 'data-html-5');
15288
15453
  elms = tmp.querySelectorAll('[data-html-6]');
15289
- dom$h.removeAttributes(elms, 'data-html-6');
15454
+ dom$j.removeAttributes(elms, 'data-html-6');
15290
15455
  elms = tmp.querySelectorAll('[data-html-7]');
15291
- dom$h.removeAttributes(elms, 'data-html-7');
15456
+ dom$j.removeAttributes(elms, 'data-html-7');
15292
15457
  elms = tmp.querySelectorAll('[data-html-8]');
15293
- dom$h.removeAttributes(elms, 'data-html-8');
15458
+ dom$j.removeAttributes(elms, 'data-html-8');
15294
15459
  elms = tmp.querySelectorAll('[data-html-9]');
15295
- dom$h.removeAttributes(elms, 'data-html-9');
15460
+ dom$j.removeAttributes(elms, 'data-html-9');
15296
15461
  elms = tmp.querySelectorAll('[data-html-10]');
15297
- dom$h.removeAttributes(elms, 'data-html-10');
15462
+ dom$j.removeAttributes(elms, 'data-html-10');
15298
15463
  elms = tmp.querySelectorAll('[data-html-12]');
15299
- dom$h.removeAttributes(elms, 'data-html-12');
15464
+ dom$j.removeAttributes(elms, 'data-html-12');
15300
15465
  elms = tmp.querySelectorAll('[data-html-13]');
15301
- dom$h.removeAttributes(elms, 'data-html-13');
15466
+ dom$j.removeAttributes(elms, 'data-html-13');
15302
15467
  elms = tmp.querySelectorAll('[data-html-14]');
15303
- dom$h.removeAttributes(elms, 'data-html-14');
15468
+ dom$j.removeAttributes(elms, 'data-html-14');
15304
15469
  elms = tmp.querySelectorAll('[data-html-15]');
15305
- dom$h.removeAttributes(elms, 'data-html-15');
15470
+ dom$j.removeAttributes(elms, 'data-html-15');
15306
15471
  elms = tmp.querySelectorAll('[data-html-16]');
15307
- dom$h.removeAttributes(elms, 'data-html-16');
15472
+ dom$j.removeAttributes(elms, 'data-html-16');
15308
15473
  elms = tmp.querySelectorAll('[data-html-17]');
15309
- dom$h.removeAttributes(elms, 'data-html-17');
15474
+ dom$j.removeAttributes(elms, 'data-html-17');
15310
15475
  elms = tmp.querySelectorAll('[data-html-18]');
15311
- dom$h.removeAttributes(elms, 'data-html-18');
15476
+ dom$j.removeAttributes(elms, 'data-html-18');
15312
15477
  elms = tmp.querySelectorAll('[data-html-19]');
15313
- dom$h.removeAttributes(elms, 'data-html-19');
15478
+ dom$j.removeAttributes(elms, 'data-html-19');
15314
15479
  elms = tmp.querySelectorAll('[data-html-20]');
15315
- dom$h.removeAttributes(elms, 'data-html-20');
15480
+ dom$j.removeAttributes(elms, 'data-html-20');
15316
15481
  elms = tmp.querySelectorAll('[data-html-21]');
15317
- dom$h.removeAttributes(elms, 'data-html-21');
15482
+ dom$j.removeAttributes(elms, 'data-html-21');
15318
15483
  elms = tmp.querySelectorAll('[data-html-21]');
15319
- dom$h.removeAttributes(elms, 'data-html-21');
15484
+ dom$j.removeAttributes(elms, 'data-html-21');
15320
15485
  elms = tmp.querySelectorAll('[data-html-22]');
15321
- dom$h.removeAttributes(elms, 'data-html-22');
15486
+ dom$j.removeAttributes(elms, 'data-html-22');
15322
15487
  elms = tmp.querySelectorAll('[data-html-23]');
15323
- dom$h.removeAttributes(elms, 'data-html-23');
15488
+ dom$j.removeAttributes(elms, 'data-html-23');
15324
15489
  elms = tmp.querySelectorAll('[data-html-24]');
15325
- dom$h.removeAttributes(elms, 'data-html-24');
15490
+ dom$j.removeAttributes(elms, 'data-html-24');
15326
15491
  elms = tmp.querySelectorAll('[data-html-25]');
15327
- dom$h.removeAttributes(elms, 'data-html-25');
15492
+ dom$j.removeAttributes(elms, 'data-html-25');
15328
15493
  } // cleaning
15329
15494
 
15330
15495
 
@@ -15339,23 +15504,23 @@ class HtmlUtil {
15339
15504
  });
15340
15505
  elms = tmp.querySelectorAll('.is-animated');
15341
15506
  Array.prototype.forEach.call(elms, elm => {
15342
- dom$h.removeClass(elm, 'animated');
15343
- dom$h.removeClass(elm, 'pulse');
15344
- dom$h.removeClass(elm, 'bounceIn');
15345
- dom$h.removeClass(elm, 'fadeIn');
15346
- dom$h.removeClass(elm, 'fadeOut'); //new
15347
-
15348
- dom$h.removeClass(elm, 'fadeInDown');
15349
- dom$h.removeClass(elm, 'fadeInLeft');
15350
- dom$h.removeClass(elm, 'fadeInRight');
15351
- dom$h.removeClass(elm, 'fadeInUp');
15352
- dom$h.removeClass(elm, 'flipInX');
15353
- dom$h.removeClass(elm, 'flipInY');
15354
- dom$h.removeClass(elm, 'slideInUp');
15355
- dom$h.removeClass(elm, 'slideInDown');
15356
- dom$h.removeClass(elm, 'slideInLeft');
15357
- dom$h.removeClass(elm, 'slideInRight');
15358
- dom$h.removeClass(elm, 'zoomIn');
15507
+ dom$j.removeClass(elm, 'animated');
15508
+ dom$j.removeClass(elm, 'pulse');
15509
+ dom$j.removeClass(elm, 'bounceIn');
15510
+ dom$j.removeClass(elm, 'fadeIn');
15511
+ dom$j.removeClass(elm, 'fadeOut'); //new
15512
+
15513
+ dom$j.removeClass(elm, 'fadeInDown');
15514
+ dom$j.removeClass(elm, 'fadeInLeft');
15515
+ dom$j.removeClass(elm, 'fadeInRight');
15516
+ dom$j.removeClass(elm, 'fadeInUp');
15517
+ dom$j.removeClass(elm, 'flipInX');
15518
+ dom$j.removeClass(elm, 'flipInY');
15519
+ dom$j.removeClass(elm, 'slideInUp');
15520
+ dom$j.removeClass(elm, 'slideInDown');
15521
+ dom$j.removeClass(elm, 'slideInLeft');
15522
+ dom$j.removeClass(elm, 'slideInRight');
15523
+ dom$j.removeClass(elm, 'zoomIn');
15359
15524
  elm.style.animationDelay = '';
15360
15525
  elm.style.transitionDelay = '';
15361
15526
  elm.style.transitionDuration = '';
@@ -15369,39 +15534,39 @@ class HtmlUtil {
15369
15534
 
15370
15535
  elms = tmp.querySelectorAll('.is-appeared');
15371
15536
  Array.prototype.forEach.call(elms, elm => {
15372
- dom$h.removeClass(elm, 'is-appeared');
15537
+ dom$j.removeClass(elm, 'is-appeared');
15373
15538
  });
15374
15539
  elms = tmp.querySelectorAll('.box-active');
15375
15540
  Array.prototype.forEach.call(elms, elm => {
15376
- dom$h.removeClass(elm, 'box-active');
15541
+ dom$j.removeClass(elm, 'box-active');
15377
15542
  });
15378
15543
  elms = tmp.querySelectorAll('.section-active');
15379
15544
  Array.prototype.forEach.call(elms, elm => {
15380
- dom$h.removeClass(elm, 'section-active');
15545
+ dom$j.removeClass(elm, 'section-active');
15381
15546
  });
15382
15547
  elms = tmp.querySelectorAll('.section-select');
15383
15548
  Array.prototype.forEach.call(elms, elm => {
15384
- dom$h.removeClass(elm, 'section-select');
15549
+ dom$j.removeClass(elm, 'section-select');
15385
15550
  });
15386
15551
  elms = tmp.querySelectorAll('.box-select');
15387
15552
  Array.prototype.forEach.call(elms, elm => {
15388
- dom$h.removeClass(elm, 'box-select');
15553
+ dom$j.removeClass(elm, 'box-select');
15389
15554
  });
15390
15555
  elms = tmp.querySelectorAll('.is-section-tool');
15391
- dom$h.removeElements(elms);
15556
+ dom$j.removeElements(elms);
15392
15557
  elms = tmp.querySelectorAll('.is-box-tool');
15393
- dom$h.removeElements(elms);
15558
+ dom$j.removeElements(elms);
15394
15559
  elms = tmp.querySelectorAll('.is-section-info');
15395
- dom$h.removeElements(elms);
15560
+ dom$j.removeElements(elms);
15396
15561
  var html_content = '';
15397
15562
  var html_footer = '';
15398
15563
  var html_others = ''; // Apply behavior on each row
15399
15564
 
15400
- const sections = dom$h.elementChildren(tmp);
15565
+ const sections = dom$j.elementChildren(tmp);
15401
15566
  sections.forEach(section => {
15402
15567
  let currentSection = section;
15403
15568
 
15404
- if (dom$h.hasClass(currentSection, 'is-section')) {
15569
+ if (dom$j.hasClass(currentSection, 'is-section')) {
15405
15570
  var secclass = ''; // var secstyle = '';
15406
15571
 
15407
15572
  if (currentSection.getAttribute('class')) secclass = ' class="' + currentSection.getAttribute('class') + '"'; // if (currentSection.getAttribute('style')) secstyle = ' style="' + currentSection.getAttribute('style') + '"';
@@ -15443,69 +15608,69 @@ class HtmlUtil {
15443
15608
 
15444
15609
  if (this.builder.shortenOutput) {
15445
15610
  elms = tmp.querySelectorAll('[data-noedit]');
15446
- dom$h.removeAttributes(elms, 'data-noedit');
15611
+ dom$j.removeAttributes(elms, 'data-noedit');
15447
15612
  elms = tmp.querySelectorAll('[data-module]');
15448
- dom$h.removeAttributes(elms, 'data-module');
15613
+ dom$j.removeAttributes(elms, 'data-module');
15449
15614
  elms = tmp.querySelectorAll('[data-module-desc]');
15450
- dom$h.removeAttributes(elms, 'data-module-desc');
15615
+ dom$j.removeAttributes(elms, 'data-module-desc');
15451
15616
  elms = tmp.querySelectorAll('[data-dialog-width]');
15452
- dom$h.removeAttributes(elms, 'data-dialog-width');
15617
+ dom$j.removeAttributes(elms, 'data-dialog-width');
15453
15618
  elms = tmp.querySelectorAll('[data-dialog-height]');
15454
- dom$h.removeAttributes(elms, 'data-dialog-height');
15619
+ dom$j.removeAttributes(elms, 'data-dialog-height');
15455
15620
  elms = tmp.querySelectorAll('[data-html]');
15456
- dom$h.removeAttributes(elms, 'data-html');
15621
+ dom$j.removeAttributes(elms, 'data-html');
15457
15622
  elms = tmp.querySelectorAll('[data-settings]');
15458
- dom$h.removeAttributes(elms, 'data-settings');
15623
+ dom$j.removeAttributes(elms, 'data-settings');
15459
15624
  elms = tmp.querySelectorAll('[data-html-1]');
15460
- dom$h.removeAttributes(elms, 'data-html-1');
15625
+ dom$j.removeAttributes(elms, 'data-html-1');
15461
15626
  elms = tmp.querySelectorAll('[data-html-2]');
15462
- dom$h.removeAttributes(elms, 'data-html-2');
15627
+ dom$j.removeAttributes(elms, 'data-html-2');
15463
15628
  elms = tmp.querySelectorAll('[data-html-3]');
15464
- dom$h.removeAttributes(elms, 'data-html-3');
15629
+ dom$j.removeAttributes(elms, 'data-html-3');
15465
15630
  elms = tmp.querySelectorAll('[data-html-4]');
15466
- dom$h.removeAttributes(elms, 'data-html-4');
15631
+ dom$j.removeAttributes(elms, 'data-html-4');
15467
15632
  elms = tmp.querySelectorAll('[data-html-5]');
15468
- dom$h.removeAttributes(elms, 'data-html-5');
15633
+ dom$j.removeAttributes(elms, 'data-html-5');
15469
15634
  elms = tmp.querySelectorAll('[data-html-6]');
15470
- dom$h.removeAttributes(elms, 'data-html-6');
15635
+ dom$j.removeAttributes(elms, 'data-html-6');
15471
15636
  elms = tmp.querySelectorAll('[data-html-7]');
15472
- dom$h.removeAttributes(elms, 'data-html-7');
15637
+ dom$j.removeAttributes(elms, 'data-html-7');
15473
15638
  elms = tmp.querySelectorAll('[data-html-8]');
15474
- dom$h.removeAttributes(elms, 'data-html-8');
15639
+ dom$j.removeAttributes(elms, 'data-html-8');
15475
15640
  elms = tmp.querySelectorAll('[data-html-9]');
15476
- dom$h.removeAttributes(elms, 'data-html-9');
15641
+ dom$j.removeAttributes(elms, 'data-html-9');
15477
15642
  elms = tmp.querySelectorAll('[data-html-10]');
15478
- dom$h.removeAttributes(elms, 'data-html-10');
15643
+ dom$j.removeAttributes(elms, 'data-html-10');
15479
15644
  elms = tmp.querySelectorAll('[data-html-12]');
15480
- dom$h.removeAttributes(elms, 'data-html-12');
15645
+ dom$j.removeAttributes(elms, 'data-html-12');
15481
15646
  elms = tmp.querySelectorAll('[data-html-13]');
15482
- dom$h.removeAttributes(elms, 'data-html-13');
15647
+ dom$j.removeAttributes(elms, 'data-html-13');
15483
15648
  elms = tmp.querySelectorAll('[data-html-14]');
15484
- dom$h.removeAttributes(elms, 'data-html-14');
15649
+ dom$j.removeAttributes(elms, 'data-html-14');
15485
15650
  elms = tmp.querySelectorAll('[data-html-15]');
15486
- dom$h.removeAttributes(elms, 'data-html-15');
15651
+ dom$j.removeAttributes(elms, 'data-html-15');
15487
15652
  elms = tmp.querySelectorAll('[data-html-16]');
15488
- dom$h.removeAttributes(elms, 'data-html-16');
15653
+ dom$j.removeAttributes(elms, 'data-html-16');
15489
15654
  elms = tmp.querySelectorAll('[data-html-17]');
15490
- dom$h.removeAttributes(elms, 'data-html-17');
15655
+ dom$j.removeAttributes(elms, 'data-html-17');
15491
15656
  elms = tmp.querySelectorAll('[data-html-18]');
15492
- dom$h.removeAttributes(elms, 'data-html-18');
15657
+ dom$j.removeAttributes(elms, 'data-html-18');
15493
15658
  elms = tmp.querySelectorAll('[data-html-19]');
15494
- dom$h.removeAttributes(elms, 'data-html-19');
15659
+ dom$j.removeAttributes(elms, 'data-html-19');
15495
15660
  elms = tmp.querySelectorAll('[data-html-20]');
15496
- dom$h.removeAttributes(elms, 'data-html-20');
15661
+ dom$j.removeAttributes(elms, 'data-html-20');
15497
15662
  elms = tmp.querySelectorAll('[data-html-21]');
15498
- dom$h.removeAttributes(elms, 'data-html-21');
15663
+ dom$j.removeAttributes(elms, 'data-html-21');
15499
15664
  elms = tmp.querySelectorAll('[data-html-21]');
15500
- dom$h.removeAttributes(elms, 'data-html-21');
15665
+ dom$j.removeAttributes(elms, 'data-html-21');
15501
15666
  elms = tmp.querySelectorAll('[data-html-22]');
15502
- dom$h.removeAttributes(elms, 'data-html-22');
15667
+ dom$j.removeAttributes(elms, 'data-html-22');
15503
15668
  elms = tmp.querySelectorAll('[data-html-23]');
15504
- dom$h.removeAttributes(elms, 'data-html-23');
15669
+ dom$j.removeAttributes(elms, 'data-html-23');
15505
15670
  elms = tmp.querySelectorAll('[data-html-24]');
15506
- dom$h.removeAttributes(elms, 'data-html-24');
15671
+ dom$j.removeAttributes(elms, 'data-html-24');
15507
15672
  elms = tmp.querySelectorAll('[data-html-25]');
15508
- dom$h.removeAttributes(elms, 'data-html-25');
15673
+ dom$j.removeAttributes(elms, 'data-html-25');
15509
15674
  }
15510
15675
 
15511
15676
  html = tmp.innerHTML.trim();
@@ -21884,7 +22049,7 @@ _extends(Remove, {
21884
22049
  Sortable.mount(new AutoScrollPlugin());
21885
22050
  Sortable.mount(Remove, Revert);
21886
22051
 
21887
- const dom$g = new Dom();
22052
+ const dom$i = new Dom();
21888
22053
 
21889
22054
  class Select {
21890
22055
  constructor(dropDown) {
@@ -21909,14 +22074,14 @@ class Select {
21909
22074
  this.toggle(false);
21910
22075
  dropDown.dispatchEvent(new Event('change'));
21911
22076
  toggler.focus();
21912
- let elms = dom$g.elementChildren(menu);
22077
+ let elms = dom$i.elementChildren(menu);
21913
22078
  elms.forEach(elm => {
21914
- dom$g.removeClass(elm, 'selected');
22079
+ dom$i.removeClass(elm, 'selected');
21915
22080
  });
21916
22081
  let optionselected = menu.querySelector('[data-value="' + val + '"]');
21917
22082
 
21918
22083
  if (optionselected) {
21919
- dom$g.addClass(optionselected, 'selected');
22084
+ dom$i.addClass(optionselected, 'selected');
21920
22085
  }
21921
22086
  };
21922
22087
 
@@ -21971,7 +22136,7 @@ class Select {
21971
22136
  let optionselected = menu.querySelector('[data-value="' + this.value + '"]');
21972
22137
 
21973
22138
  if (optionselected) {
21974
- dom$g.addClass(optionselected, 'selected');
22139
+ dom$i.addClass(optionselected, 'selected');
21975
22140
  optionselected.focus();
21976
22141
  }
21977
22142
 
@@ -55417,589 +55582,171 @@ class Element$1 {
55417
55582
 
55418
55583
  }
55419
55584
 
55420
- class RowTool {
55421
- constructor(builder) {
55422
- this.builder = builder;
55423
- const util = this.builder.util;
55424
- this.util = util;
55425
- const builderStuff = this.builder.builderStuff;
55426
- const dom = this.builder.dom;
55427
- this.dom = dom;
55428
- this.grid = new Grid(builder);
55429
- let rowMore = builderStuff.querySelector('.rowmore');
55430
- let htmlbutton = '';
55431
- if (builder.opts.rowHtmlEditor) htmlbutton = `<button type="button" title="${util.out('HTML')}" class="row-html">
55432
- <span><svg class="is-icon-flex" style="margin-right:-3px;width:12px;height:12px;"><use xlink:href="#ion-ios-arrow-left"></use></svg><svg class="is-icon-flex" style="margin-left:-2px;width:12px;height:12px;"><use xlink:href="#ion-ios-arrow-right"></use></svg></span>${util.out('HTML')}
55433
- </button>`;
55585
+ class Modal {
55586
+ constructor(opts = {}) {
55587
+ let defaults = {
55588
+ animateModal: false,
55589
+ elementToAnimate: '',
55590
+ stuffPlacement: '#_cbhtml'
55591
+ };
55592
+ this.opts = Object.assign(this, defaults, opts);
55593
+ this.id = this.makeId();
55594
+ let builderStuff = document.querySelector(this.opts.stuffPlacement);
55434
55595
 
55435
- if (!rowMore) {
55436
- let html = `<div class="is-pop rowmore" style="z-index:10002;" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
55437
- <div style="display:flex;flex-flow:wrap;">
55438
- <button type="button" title="${util.out('Move Up')}" class="row-up"><span><svg class="is-icon-flex" style="width:15px;height:15px;"><use xlink:href="#ion-ios-arrow-thin-up"></use></svg></span>${util.out('Move Up')}</button>
55439
- <button type="button" title="${util.out('Move Down')}" class="row-down"><span><svg class="is-icon-flex" style="width:15px;height:15px;"><use xlink:href="#ion-ios-arrow-thin-down"></use></svg></span>${util.out('Move Down')}</button>
55440
- <button type="button" title="${util.out('Duplicate')}" class="row-duplicate"><span><svg class="is-icon-flex" style="width:12px;height:12px;"><use xlink:href="#ion-ios-photos-outline"></use></svg></span>${util.out('Duplicate')}</button>
55441
- ${htmlbutton}
55442
- </div>
55443
- </div>`;
55444
- dom.appendHtml(builderStuff, html);
55445
- rowMore = builderStuff.querySelector('.rowmore');
55446
- let elm = rowMore.querySelector('.row-up');
55447
- if (elm) dom.addEventListener(elm, 'click', () => {
55448
- this.grid.moveRowUp(); // util.clearControls();
55449
- });
55450
- elm = rowMore.querySelector('.row-down');
55451
- if (elm) dom.addEventListener(elm, 'click', () => {
55452
- this.grid.moveRowDown(); // util.clearControls();
55453
- });
55454
- elm = rowMore.querySelector('.row-duplicate');
55455
- if (elm) dom.addEventListener(elm, 'click', () => {
55456
- this.grid.duplicateRow(); // this.rowMore.style.display = '';
55596
+ if (!builderStuff) {
55597
+ builderStuff = document.createElement('div');
55598
+ builderStuff.id = '_cbhtml';
55599
+ document.body.appendChild(builderStuff);
55600
+ }
55457
55601
 
55458
- util.hidePop(rowMore); //Hide Column tool (new!)
55602
+ this.builderStuff = builderStuff; // Stuff placement for this (single) instance
55459
55603
 
55460
- util.hideColumnTool();
55461
- util.clearControls();
55462
- });
55463
- elm = rowMore.querySelector('.row-html');
55464
- if (elm) dom.addEventListener(elm, 'click', () => {
55465
- // const cell = util.cellSelected();
55466
- // if(!cell) return;
55467
- let row;
55468
- let cell = util.cellSelected();
55604
+ const objStuff = document.createElement('div');
55605
+ objStuff.id = this.id;
55606
+ builderStuff.appendChild(objStuff);
55607
+ this.objStuff = objStuff;
55608
+ }
55469
55609
 
55470
- if (cell) {
55471
- row = cell.parentNode;
55472
- } else {
55473
- row = util.rowSelected();
55474
- }
55610
+ confirm(message, callback, animated) {
55611
+ let html = `<div class="is-modal is-confirm" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
55612
+ <div class="is-modal-content" style="padding-bottom:20px;">
55613
+ <div style="margin: 20px 0 30px;font-size: 14px;">${message}</div>
55614
+ <button title="${this.out('Delete')}" class="input-ok classic">${this.out('Delete')}</button>
55615
+ </div>
55616
+ </div>`;
55617
+ let confirmModal = this.objStuff.querySelector('.is-confirm');
55475
55618
 
55476
- if (!row) return;
55477
- const htmlutil = new HtmlUtil(builder);
55478
- htmlutil.view('row');
55479
- });
55619
+ if (!confirmModal) {
55620
+ this.objStuff.insertAdjacentHTML('beforeend', html);
55621
+ confirmModal = this.builderStuff.querySelector('.is-confirm');
55480
55622
  }
55481
55623
 
55482
- this.rowMore = rowMore; // // Click anywhere will hide Column tool
55483
- // document.addEventListener('mousedown', (e) => {
55484
- // e = e || window.event;
55485
- // var target = e.target || e.srcElement;
55486
- // if(rowMore.style.display === 'flex'){
55487
- // let a = dom.parentsHasClass(target, 'rowmore');
55488
- // let b = dom.parentsHasClass(target, 'row-more');
55489
- // if(a||b) {
55490
- // return;
55491
- // }
55492
- // else {
55493
- // // rowMore.style.display = '';
55494
- // util.hidePop(rowMore);
55495
- // }
55496
- // }
55497
- // });
55498
- }
55624
+ this.show(confirmModal, false, () => {
55625
+ //this function runs when overlay is clicked. Remove modal.
55626
+ confirmModal.parentNode.removeChild(confirmModal); //do task
55499
55627
 
55500
- render(row) {
55501
- const dom = this.dom;
55502
- const util = this.builder.util;
55503
- const builderStuff = this.builder.builderStuff;
55504
- let rowMore = this.rowMore;
55505
- let rowtool = row.querySelector('.is-row-tool');
55628
+ callback(false);
55629
+ }, animated);
55630
+ let buttonok = confirmModal.querySelector('.is-confirm .input-ok');
55631
+ this.addEventListener(buttonok, 'click', () => {
55632
+ this.hide(confirmModal);
55633
+ confirmModal.parentNode.removeChild(confirmModal); //remove modal
55634
+ //do task
55506
55635
 
55507
- if (!rowtool) {
55508
- let html = `<div class="is-tool is-row-tool">
55509
- <div title="${util.out('Move')}" role="button" tabindex="-1" class="row-handle" style="width:100%;cursor:move;text-align:center;"><svg class="is-icon-flex"><use xlink:href="#ion-move"></use></svg></div>
55510
- <button type="button" tabindex="-1" title="${util.out('More')}" class="row-more"><svg class="is-icon-flex"><use xlink:href="#ion-more"></use></svg></button>
55511
- <button type="button" tabindex="-1" title="${util.out('Grid Editor')}" class="row-grideditor"><svg class="is-icon-flex"><use xlink:href="#ion-grid"></use></svg></button>
55512
- <button type="button" tabindex="-1" title="${util.out('Delete')}" class="row-remove"><svg class="is-icon-flex"><use xlink:href="#ion-ios-close-empty"></use></svg></button>
55513
- </div>
55514
- <div class="is-tool is-col-tool">
55515
- <button type="button" tabindex="-1" title="${util.out('Add')}" class="cell-add"><svg class="is-icon-flex"><use xlink:href="#ion-ios-plus-empty"></use></svg></button>
55516
- <button type="button" tabindex="-1" title="${util.out('More')}" class="cell-more"><svg class="is-icon-flex"><use xlink:href="#ion-more"></use></svg></button>
55517
- <button type="button" tabindex="-1" title="${util.out('Delete')}" class="cell-remove"><svg class="is-icon-flex" style="margin-left:-1px"><use xlink:href="#ion-ios-close-empty"></use></svg></button>
55518
- </div>
55519
- `;
55520
- dom.appendHtml(row, html);
55521
- rowtool = row.querySelector('.is-row-tool'); // Prepare for tooltip
55636
+ callback(true);
55637
+ });
55638
+ }
55522
55639
 
55523
- let elms = rowtool.querySelectorAll('[title]');
55524
- Array.prototype.forEach.call(elms, elm => {
55525
- elm.setAttribute('data-title', elm.getAttribute('title'));
55640
+ show(modal, overlayStay, cancelCallback, animated) {
55641
+ this.addClass(modal, 'active'); // animated param (if set) will overide global setting
55526
55642
 
55527
- if (!this.builder.iframe) {
55528
- this.builder.tooltip.set(elm, 5, 3);
55529
- } else {
55530
- this.builder.tooltip.set(elm, 5, 3, true);
55531
- }
55532
- });
55533
- let coltool = row.querySelector('.is-col-tool'); // Prepare for tooltip
55643
+ let animate = false;
55534
55644
 
55535
- elms = coltool.querySelectorAll('[title]');
55536
- Array.prototype.forEach.call(elms, elm => {
55537
- elm.setAttribute('data-title', elm.getAttribute('title'));
55645
+ if (!(typeof animated === 'undefined' || animated === null)) {
55646
+ // animated param is set
55647
+ animate = animated;
55648
+ } else {
55649
+ // if animated param is not set
55650
+ animate = this.opts.animateModal; // use global setting
55651
+ }
55538
55652
 
55539
- if (!this.builder.iframe) {
55540
- this.builder.tooltip.set(elm, 5, 3);
55541
- } else {
55542
- this.builder.tooltip.set(elm, 5, 3, true);
55543
- }
55544
- }); // Check for backward compatibility
55653
+ if (animate) {
55654
+ const buildercontainers = document.querySelectorAll(this.opts.elementToAnimate);
55655
+ Array.prototype.forEach.call(buildercontainers, buildercontainer => {
55656
+ // buildercontainer.style.transform = 'scale(0.98)';
55657
+ // buildercontainer.style.WebkitTransform= 'scale(0.98)';
55658
+ // buildercontainer.style.MozTransform= 'scale(0.98)';
55659
+ buildercontainer.style.transform = `scale(${this.builder.opts.zoom - 0.02})`;
55660
+ buildercontainer.style.WebkitTransform = `scale(${this.builder.opts.zoom - 0.02})`;
55661
+ buildercontainer.style.MozTransform = `scale(${this.builder.opts.zoom - 0.02})`;
55662
+ buildercontainer.setAttribute('scaled-down', '1');
55663
+ });
55664
+ }
55545
55665
 
55546
- let marginLeft = window.getComputedStyle(coltool, null).getPropertyValue('margin-left');
55666
+ if (!modal.querySelector('.is-modal-overlay')) {
55667
+ let html;
55547
55668
 
55548
- if (parseInt(marginLeft) === 0) {
55549
- this.builder.backwardCompatible();
55669
+ if (overlayStay) {
55670
+ html = '<div class="is-modal-overlay overlay-stay"></div>';
55671
+ } else {
55672
+ html = '<div class="is-modal-overlay"></div>';
55550
55673
  }
55551
55674
 
55552
- const btnCellAdd = coltool.querySelector('.cell-add');
55553
- if (btnCellAdd) dom.addEventListener(btnCellAdd, 'click', () => {
55554
- let cell = util.cellSelected();
55555
- if (!cell) return;
55556
- let quickadd = this.builder.builderStuff.querySelector('.is-pop.quickadd');
55557
- let tabs = quickadd.querySelector('.is-pop-tabs');
55558
- tabs.style.display = 'flex';
55559
- let top, left;
55560
-
55561
- if (!this.builder.iframe) {
55562
- top = btnCellAdd.getBoundingClientRect().top + window.pageYOffset;
55563
- left = btnCellAdd.getBoundingClientRect().left + window.pageXOffset;
55564
- } else {
55565
- let adjY = this.builder.iframe.getBoundingClientRect().top + window.pageYOffset;
55566
- let adjX = this.builder.iframe.getBoundingClientRect().left + window.pageXOffset;
55567
- top = btnCellAdd.getBoundingClientRect().top + adjY + 10;
55568
- left = btnCellAdd.getBoundingClientRect().left + adjX + 5;
55569
- } // quickadd.style.display = 'flex';
55570
-
55571
-
55572
- util.showPop(quickadd, false, btnCellAdd); //const w = quickadd.offsetWidth; //to get value, element must not hidden (display:none). So set display:flex before this.
55573
- //const h = quickadd.offsetHeight;
55675
+ modal.insertAdjacentHTML('afterbegin', html);
55574
55676
 
55575
- quickadd.style.top = top + 35 + 'px';
55576
- quickadd.style.left = left + 'px';
55577
- dom.removeClass(quickadd, 'arrow-bottom');
55578
- dom.removeClass(quickadd, 'arrow-left');
55579
- dom.removeClass(quickadd, 'arrow-right');
55580
- dom.removeClass(quickadd, 'center');
55581
- dom.removeClass(quickadd, 'right');
55582
- dom.addClass(quickadd, 'arrow-top');
55583
- dom.addClass(quickadd, 'left');
55584
- let val = quickadd.querySelector('.active').getAttribute('data-value');
55677
+ if (!overlayStay) {
55678
+ let overlay = modal.querySelector('.is-modal-overlay');
55679
+ this.addEventListener(overlay, 'click', () => {
55680
+ //cancelCallback
55681
+ if (cancelCallback) cancelCallback();
55682
+ this.hide(modal);
55683
+ });
55684
+ }
55685
+ }
55686
+ }
55585
55687
 
55586
- if (val === 'left') {
55587
- quickadd.setAttribute('data-mode', 'cell-left');
55588
- } else {
55589
- quickadd.setAttribute('data-mode', 'cell-right');
55688
+ hide(modal) {
55689
+ if (this.opts.elementToAnimate !== '') {
55690
+ const buildercontainers = document.querySelectorAll(this.opts.elementToAnimate);
55691
+ Array.prototype.forEach.call(buildercontainers, buildercontainer => {
55692
+ // buildercontainer.style.transform = '';
55693
+ // buildercontainer.style.WebkitTransform= '';
55694
+ // buildercontainer.style.MozTransform= '';
55695
+ if (buildercontainer.getAttribute('scaled-down')) {
55696
+ buildercontainer.style.transform = `scale(${this.builder.opts.zoom})`;
55697
+ buildercontainer.style.WebkitTransform = `scale(${this.builder.opts.zoom})`;
55698
+ buildercontainer.style.MozTransform = `scale(${this.builder.opts.zoom})`;
55699
+ buildercontainer.removeAttribute('scaled-down');
55590
55700
  }
55591
55701
  });
55592
- const btnCellMore = coltool.querySelector('.cell-more');
55593
- if (btnCellMore) dom.addEventListener(btnCellMore, 'click', () => {
55594
- let cell = util.cellSelected();
55595
- if (!cell) return;
55596
- let top, left;
55597
-
55598
- if (!this.builder.iframe) {
55599
- top = btnCellMore.getBoundingClientRect().top + window.pageYOffset;
55600
- left = btnCellMore.getBoundingClientRect().left + window.pageXOffset;
55601
- } else {
55602
- let adjY = this.builder.iframe.getBoundingClientRect().top + window.pageYOffset;
55603
- let adjX = this.builder.iframe.getBoundingClientRect().left + window.pageXOffset;
55604
- top = btnCellMore.getBoundingClientRect().top + adjY;
55605
- left = btnCellMore.getBoundingClientRect().left + adjX;
55606
- }
55607
-
55608
- const columnMore = builderStuff.querySelector('.columnmore'); // columnMore.style.display = 'flex';
55702
+ }
55609
55703
 
55610
- util.showPop(columnMore, false, btnCellMore); //const w = columnMore.offsetWidth; //to get value, element must not hidden (display:none). So set display:flex before this.
55611
- //const h = columnMore.offsetHeight;
55704
+ this.removeClass(modal, 'active');
55705
+ } // http://stackoverflow.com/questions/1349404/generate-a-string-of-5-random-characters-in-javascript
55612
55706
 
55613
- columnMore.style.top = top + 35 + 'px';
55614
- columnMore.style.left = left - 7 + 'px';
55615
- dom.removeClass(columnMore, 'arrow-bottom');
55616
- dom.removeClass(columnMore, 'arrow-left');
55617
- dom.removeClass(columnMore, 'arrow-right');
55618
- dom.removeClass(columnMore, 'center');
55619
- dom.removeClass(columnMore, 'right');
55620
- dom.addClass(columnMore, 'arrow-top');
55621
- dom.addClass(columnMore, 'left');
55622
- const btnCellLocking = columnMore.querySelector('.cell-locking');
55623
55707
 
55624
- if (cell.hasAttribute('data-noedit')) {
55625
- dom.addClass(btnCellLocking, 'on'); // btnCellLocking.innerHTML = '<svg class="is-icon-flex"><use xlink:href="#icon-lock"></use></svg>';
55626
- } else {
55627
- dom.removeClass(btnCellLocking, 'on'); // btnCellLocking.innerHTML = '<svg class="is-icon-flex"><use xlink:href="#icon-lock-off"></use></svg>';
55628
- }
55629
- });
55630
- const btnCellRemove = coltool.querySelector('.cell-remove');
55631
- if (btnCellRemove) dom.addEventListener(btnCellRemove, 'click', () => {
55632
- const grid = new Grid(this.builder);
55633
- grid.removeColumn();
55634
- util.clearControls();
55635
- });
55636
- let btnGridEditor = rowtool.querySelector('.row-grideditor');
55637
- if (btnGridEditor) dom.addEventListener(btnGridEditor, 'click', () => {
55638
- const grideditor = builderStuff.querySelector('.grideditor');
55708
+ makeId() {
55709
+ let text = '';
55710
+ let possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
55639
55711
 
55640
- if (dom.hasClass(grideditor, 'active')) {
55641
- dom.removeClass(grideditor, 'active');
55642
- const builders = document.querySelectorAll(this.builder.opts.container);
55643
- Array.prototype.forEach.call(builders, builder => {
55644
- builder.removeAttribute('grideditor');
55645
- });
55646
- } else {
55647
- // dom.addClass(grideditor, 'active');
55648
- this.util.showModal(grideditor, false, () => {
55649
- btnGridEditor.removeAttribute('data-focus');
55650
- btnGridEditor.focus();
55651
- });
55652
- btnGridEditor.setAttribute('data-focus', true);
55653
- const builders = document.querySelectorAll(this.builder.opts.container);
55654
- Array.prototype.forEach.call(builders, builder => {
55655
- builder.setAttribute('grideditor', '');
55656
- }); // Grid Editor Status
55657
- // On/off outline button
55712
+ for (let i = 0; i < 2; i++) text += possible.charAt(Math.floor(Math.random() * possible.length));
55658
55713
 
55659
- const btnGridOutline = grideditor.querySelector('.grid-outline');
55660
- const container = document.querySelector(this.builder.opts.container); // get one
55714
+ let text2 = '';
55715
+ let possible2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
55661
55716
 
55662
- if (container.hasAttribute('gridoutline')) {
55663
- dom.addClass(btnGridOutline, 'on');
55664
- } else {
55665
- dom.removeClass(btnGridOutline, 'on');
55666
- } // On/off lock button
55717
+ for (let i = 0; i < 5; i++) text2 += possible2.charAt(Math.floor(Math.random() * possible2.length));
55667
55718
 
55719
+ return text + text2;
55720
+ }
55668
55721
 
55669
- const btnCellLocking = grideditor.querySelector('.cell-locking');
55670
- let cell = util.cellSelected();
55722
+ addClass(element, classname) {
55723
+ if (!element) return;
55724
+ if (this.hasClass(element, classname)) return;
55725
+ if (element.classList.length === 0) element.className = classname;else element.className = element.className + ' ' + classname;
55726
+ }
55671
55727
 
55672
- if (cell) {
55673
- if (cell.hasAttribute('data-noedit')) {
55674
- dom.addClass(btnCellLocking, 'on');
55675
- } else {
55676
- dom.removeClass(btnCellLocking, 'on');
55677
- }
55678
- } else {
55679
- dom.removeClass(btnCellLocking, 'on');
55680
- }
55681
- }
55682
- });
55683
- const btnMore = rowtool.querySelector('.row-more');
55684
- if (btnMore) dom.addEventListener(btnMore, 'click', () => {
55685
- let row;
55686
- let cell = util.cellSelected();
55728
+ removeClass(element, classname) {
55729
+ if (!element) return;
55687
55730
 
55688
- if (cell) {
55689
- row = cell.parentNode;
55690
- } else {
55691
- row = util.rowSelected();
55692
- }
55731
+ if (element.classList.length > 0) {
55732
+ element.className = element.className.replace(classname, '');
55733
+ }
55734
+ }
55693
55735
 
55694
- if (!row) return; //Change to row selection
55736
+ hasClass(element, classname) {
55737
+ if (!element) return false;
55738
+ return element.classList ? element.classList.contains(classname) : new RegExp('\\b' + classname + '\\b').test(element.className);
55739
+ }
55695
55740
 
55696
- dom.removeClass(row, 'row-outline'); //Hide Column tool (new!)
55741
+ addEventListener(parent, type, listener) {
55742
+ parent.addEventListener(type, listener);
55743
+ }
55697
55744
 
55698
- util.hideColumnTool(); // const top = btnMore.getBoundingClientRect().top + window.pageYOffset;
55699
- // const left = btnMore.getBoundingClientRect().left + window.pageXOffset;
55745
+ }
55700
55746
 
55701
- let top, left;
55702
-
55703
- if (!this.builder.iframe) {
55704
- top = btnMore.getBoundingClientRect().top + window.pageYOffset;
55705
- left = btnMore.getBoundingClientRect().left + window.pageXOffset;
55706
- } else {
55707
- let adjY = this.builder.iframe.getBoundingClientRect().top + window.pageYOffset;
55708
- let adjX = this.builder.iframe.getBoundingClientRect().left + window.pageXOffset;
55709
- top = btnMore.getBoundingClientRect().top + adjY;
55710
- left = btnMore.getBoundingClientRect().left + adjX;
55711
- } // rowMore.style.display = 'flex';
55712
-
55713
-
55714
- util.showPop(rowMore, false, btnMore); //const w = rowMore.offsetWidth; //to get value, element must not hidden (display:none). So set display:flex before this.
55715
- //const h = rowMore.offsetHeight;
55716
-
55717
- rowMore.style.top = top - 8 + 'px';
55718
- dom.removeClass(rowMore, 'arrow-bottom');
55719
- dom.removeClass(rowMore, 'arrow-left');
55720
- dom.removeClass(rowMore, 'arrow-right');
55721
- dom.removeClass(rowMore, 'center');
55722
- dom.removeClass(rowMore, 'right');
55723
- dom.removeClass(rowMore, 'left');
55724
-
55725
- if (this.builder.opts.rowTool === 'right') {
55726
- rowMore.style.left = left - rowMore.offsetWidth - 10 + 'px';
55727
- dom.addClass(rowMore, 'arrow-right');
55728
- dom.addClass(rowMore, 'left');
55729
- } else {
55730
- rowMore.style.left = left + 35 + 'px';
55731
- dom.addClass(rowMore, 'arrow-left');
55732
- dom.addClass(rowMore, 'left');
55733
- }
55734
-
55735
- let btnRowHtml = rowMore.querySelector('.row-html');
55736
- let btnRowDuplicate = rowMore.querySelector('.row-duplicate');
55737
-
55738
- if (row.querySelector('[data-html]')) {
55739
- if (btnRowHtml) btnRowHtml.style.display = 'none';
55740
- if (btnRowDuplicate) btnRowDuplicate.style.display = 'none';
55741
- } else {
55742
- if (btnRowHtml) btnRowHtml.style.display = '';
55743
- if (btnRowDuplicate) btnRowDuplicate.style.display = '';
55744
- }
55745
- });
55746
- let elm = rowtool.querySelector('.row-remove');
55747
- if (elm) dom.addEventListener(elm, 'click', () => {
55748
- this.grid.removeRow();
55749
- util.clearControls();
55750
- });
55751
- }
55752
- }
55753
-
55754
- }
55755
-
55756
- class RowAddTool {
55757
- constructor(builder) {
55758
- this.builder = builder;
55759
- const dom = this.builder.dom;
55760
- this.dom = dom;
55761
- }
55762
-
55763
- render(row) {
55764
- const dom = this.dom;
55765
- const util = this.builder.util;
55766
- const quickadd = renderQuickAdd(this.builder);
55767
- let rowaddtool = row.querySelector('.is-rowadd-tool');
55768
-
55769
- if (!rowaddtool) {
55770
- const html = `<div class="is-rowadd-tool" style="height:0">
55771
- <button type="button" tabindex="-1" title="${util.out('Add')}" title="${util.out('Add')}" style="outline:none;line-height:1;margin:0;padding:0;cursor:pointer;background-color:rgba(255,255,255,0.9);"><svg class="is-icon-flex" style="fill:rgba(0, 0, 0, 0.8);width:17px;height:17px;"><use xlink:href="#ion-ios-plus-empty"></use></svg></button>
55772
- </div>`;
55773
- dom.appendHtml(row, html);
55774
- rowaddtool = row.querySelector('.is-rowadd-tool'); // Prepare for tooltip
55775
-
55776
- let elms = rowaddtool.querySelectorAll('[title]');
55777
- Array.prototype.forEach.call(elms, elm => {
55778
- elm.setAttribute('data-title', elm.getAttribute('title'));
55779
-
55780
- if (!this.builder.iframe) {
55781
- this.builder.tooltip.set(elm, 5, 3);
55782
- } else {
55783
- this.builder.tooltip.set(elm, 5, 3, true);
55784
- }
55785
- });
55786
- }
55787
-
55788
- let btnRowAdd = rowaddtool.querySelector('button');
55789
- dom.addEventListener(btnRowAdd, 'click', () => {
55790
- let tabs = quickadd.querySelector('.is-pop-tabs');
55791
- tabs.style.display = 'none';
55792
- const viewportHeight = window.innerHeight;
55793
- let top, left;
55794
-
55795
- if (!this.builder.iframe) {
55796
- top = btnRowAdd.getBoundingClientRect().top;
55797
- left = btnRowAdd.getBoundingClientRect().left;
55798
- } else {
55799
- let adjY = this.builder.iframe.getBoundingClientRect().top;
55800
- let adjX = this.builder.iframe.getBoundingClientRect().left;
55801
- top = btnRowAdd.getBoundingClientRect().top + adjY;
55802
- left = btnRowAdd.getBoundingClientRect().left + adjX;
55803
- } // quickadd.style.display = 'flex';
55804
-
55805
-
55806
- util.showPop(quickadd, false, btnRowAdd);
55807
- const w = quickadd.offsetWidth; //to get value, element must not hidden (display:none). So set display:flex before this.
55808
-
55809
- const h = quickadd.offsetHeight;
55810
-
55811
- if (viewportHeight - top > h) {
55812
- quickadd.style.top = top + window.pageYOffset + 27 + 'px';
55813
- quickadd.style.left = left - w / 2 + 7 + 'px';
55814
- dom.removeClass(quickadd, 'arrow-bottom');
55815
- dom.removeClass(quickadd, 'arrow-right');
55816
- dom.removeClass(quickadd, 'arrow-left');
55817
- dom.removeClass(quickadd, 'center');
55818
- dom.addClass(quickadd, 'arrow-top');
55819
- dom.addClass(quickadd, 'center');
55820
- } else {
55821
- quickadd.style.top = top + window.pageYOffset - h - 8 + 'px';
55822
- quickadd.style.left = left - w / 2 + 7 + 'px';
55823
- dom.removeClass(quickadd, 'arrow-top');
55824
- dom.removeClass(quickadd, 'arrow-right');
55825
- dom.removeClass(quickadd, 'arrow-left');
55826
- dom.removeClass(quickadd, 'center');
55827
- dom.addClass(quickadd, 'arrow-bottom');
55828
- dom.addClass(quickadd, 'center');
55829
- }
55830
-
55831
- quickadd.setAttribute('data-mode', 'row');
55832
- return false;
55833
- });
55834
- }
55835
-
55836
- }
55837
-
55838
- class Modal {
55839
- constructor(opts = {}) {
55840
- let defaults = {
55841
- animateModal: false,
55842
- elementToAnimate: '',
55843
- stuffPlacement: '#_cbhtml'
55844
- };
55845
- this.opts = Object.assign(this, defaults, opts);
55846
- this.id = this.makeId();
55847
- let builderStuff = document.querySelector(this.opts.stuffPlacement);
55848
-
55849
- if (!builderStuff) {
55850
- builderStuff = document.createElement('div');
55851
- builderStuff.id = '_cbhtml';
55852
- document.body.appendChild(builderStuff);
55853
- }
55854
-
55855
- this.builderStuff = builderStuff; // Stuff placement for this (single) instance
55856
-
55857
- const objStuff = document.createElement('div');
55858
- objStuff.id = this.id;
55859
- builderStuff.appendChild(objStuff);
55860
- this.objStuff = objStuff;
55861
- }
55862
-
55863
- confirm(message, callback, animated) {
55864
- let html = `<div class="is-modal is-confirm" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
55865
- <div class="is-modal-content" style="padding-bottom:20px;">
55866
- <div style="margin: 20px 0 30px;font-size: 14px;">${message}</div>
55867
- <button title="${this.out('Delete')}" class="input-ok classic">${this.out('Delete')}</button>
55868
- </div>
55869
- </div>`;
55870
- let confirmModal = this.objStuff.querySelector('.is-confirm');
55871
-
55872
- if (!confirmModal) {
55873
- this.objStuff.insertAdjacentHTML('beforeend', html);
55874
- confirmModal = this.builderStuff.querySelector('.is-confirm');
55875
- }
55876
-
55877
- this.show(confirmModal, false, () => {
55878
- //this function runs when overlay is clicked. Remove modal.
55879
- confirmModal.parentNode.removeChild(confirmModal); //do task
55880
-
55881
- callback(false);
55882
- }, animated);
55883
- let buttonok = confirmModal.querySelector('.is-confirm .input-ok');
55884
- this.addEventListener(buttonok, 'click', () => {
55885
- this.hide(confirmModal);
55886
- confirmModal.parentNode.removeChild(confirmModal); //remove modal
55887
- //do task
55888
-
55889
- callback(true);
55890
- });
55891
- }
55892
-
55893
- show(modal, overlayStay, cancelCallback, animated) {
55894
- this.addClass(modal, 'active'); // animated param (if set) will overide global setting
55895
-
55896
- let animate = false;
55897
-
55898
- if (!(typeof animated === 'undefined' || animated === null)) {
55899
- // animated param is set
55900
- animate = animated;
55901
- } else {
55902
- // if animated param is not set
55903
- animate = this.opts.animateModal; // use global setting
55904
- }
55905
-
55906
- if (animate) {
55907
- const buildercontainers = document.querySelectorAll(this.opts.elementToAnimate);
55908
- Array.prototype.forEach.call(buildercontainers, buildercontainer => {
55909
- // buildercontainer.style.transform = 'scale(0.98)';
55910
- // buildercontainer.style.WebkitTransform= 'scale(0.98)';
55911
- // buildercontainer.style.MozTransform= 'scale(0.98)';
55912
- buildercontainer.style.transform = `scale(${this.builder.opts.zoom - 0.02})`;
55913
- buildercontainer.style.WebkitTransform = `scale(${this.builder.opts.zoom - 0.02})`;
55914
- buildercontainer.style.MozTransform = `scale(${this.builder.opts.zoom - 0.02})`;
55915
- buildercontainer.setAttribute('scaled-down', '1');
55916
- });
55917
- }
55918
-
55919
- if (!modal.querySelector('.is-modal-overlay')) {
55920
- let html;
55921
-
55922
- if (overlayStay) {
55923
- html = '<div class="is-modal-overlay overlay-stay"></div>';
55924
- } else {
55925
- html = '<div class="is-modal-overlay"></div>';
55926
- }
55927
-
55928
- modal.insertAdjacentHTML('afterbegin', html);
55929
-
55930
- if (!overlayStay) {
55931
- let overlay = modal.querySelector('.is-modal-overlay');
55932
- this.addEventListener(overlay, 'click', () => {
55933
- //cancelCallback
55934
- if (cancelCallback) cancelCallback();
55935
- this.hide(modal);
55936
- });
55937
- }
55938
- }
55939
- }
55940
-
55941
- hide(modal) {
55942
- if (this.opts.elementToAnimate !== '') {
55943
- const buildercontainers = document.querySelectorAll(this.opts.elementToAnimate);
55944
- Array.prototype.forEach.call(buildercontainers, buildercontainer => {
55945
- // buildercontainer.style.transform = '';
55946
- // buildercontainer.style.WebkitTransform= '';
55947
- // buildercontainer.style.MozTransform= '';
55948
- if (buildercontainer.getAttribute('scaled-down')) {
55949
- buildercontainer.style.transform = `scale(${this.builder.opts.zoom})`;
55950
- buildercontainer.style.WebkitTransform = `scale(${this.builder.opts.zoom})`;
55951
- buildercontainer.style.MozTransform = `scale(${this.builder.opts.zoom})`;
55952
- buildercontainer.removeAttribute('scaled-down');
55953
- }
55954
- });
55955
- }
55956
-
55957
- this.removeClass(modal, 'active');
55958
- } // http://stackoverflow.com/questions/1349404/generate-a-string-of-5-random-characters-in-javascript
55959
-
55960
-
55961
- makeId() {
55962
- let text = '';
55963
- let possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
55964
-
55965
- for (let i = 0; i < 2; i++) text += possible.charAt(Math.floor(Math.random() * possible.length));
55966
-
55967
- let text2 = '';
55968
- let possible2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
55969
-
55970
- for (let i = 0; i < 5; i++) text2 += possible2.charAt(Math.floor(Math.random() * possible2.length));
55971
-
55972
- return text + text2;
55973
- }
55974
-
55975
- addClass(element, classname) {
55976
- if (!element) return;
55977
- if (this.hasClass(element, classname)) return;
55978
- if (element.classList.length === 0) element.className = classname;else element.className = element.className + ' ' + classname;
55979
- }
55980
-
55981
- removeClass(element, classname) {
55982
- if (!element) return;
55983
-
55984
- if (element.classList.length > 0) {
55985
- element.className = element.className.replace(classname, '');
55986
- }
55987
- }
55988
-
55989
- hasClass(element, classname) {
55990
- if (!element) return false;
55991
- return element.classList ? element.classList.contains(classname) : new RegExp('\\b' + classname + '\\b').test(element.className);
55992
- }
55993
-
55994
- addEventListener(parent, type, listener) {
55995
- parent.addEventListener(type, listener);
55996
- }
55997
-
55998
- }
55999
-
56000
- /*
56001
- - doesn't accept 3 digit hex
56002
- */
55747
+ /*
55748
+ - doesn't accept 3 digit hex
55749
+ */
56003
55750
 
56004
55751
  class ColorPicker {
56005
55752
  constructor(opts = {}) {
@@ -57620,6 +57367,939 @@ var parseGradient = function (regExpLib, input) {
57620
57367
  return result;
57621
57368
  };
57622
57369
 
57370
+ class RowTool {
57371
+ constructor(builder) {
57372
+ this.builder = builder;
57373
+ const util = this.builder.util;
57374
+ this.util = util;
57375
+ const builderStuff = this.builder.builderStuff;
57376
+ const dom = this.builder.dom;
57377
+ this.dom = dom;
57378
+ this.grid = new Grid(builder);
57379
+ let rowMore = builderStuff.querySelector('.rowmore');
57380
+ let htmlbutton = '';
57381
+ if (builder.opts.rowHtmlEditor) htmlbutton = `<button type="button" title="${util.out('HTML')}" class="row-html">
57382
+ <span><svg class="is-icon-flex" style="margin-right:-3px;width:12px;height:12px;"><use xlink:href="#ion-ios-arrow-left"></use></svg><svg class="is-icon-flex" style="margin-left:-2px;width:12px;height:12px;"><use xlink:href="#ion-ios-arrow-right"></use></svg></span>${util.out('HTML')}
57383
+ </button>`;
57384
+
57385
+ if (!rowMore) {
57386
+ let html = `<div class="is-pop rowmore" style="z-index:10002;" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
57387
+ <div style="display:flex;flex-flow:wrap;">
57388
+ <button type="button" title="${util.out('Move Up')}" class="row-up"><span><svg class="is-icon-flex" style="width:15px;height:15px;"><use xlink:href="#ion-ios-arrow-thin-up"></use></svg></span>${util.out('Move Up')}</button>
57389
+ <button type="button" title="${util.out('Move Down')}" class="row-down"><span><svg class="is-icon-flex" style="width:15px;height:15px;"><use xlink:href="#ion-ios-arrow-thin-down"></use></svg></span>${util.out('Move Down')}</button>
57390
+ <button type="button" title="${util.out('Duplicate')}" class="row-duplicate"><span><svg class="is-icon-flex" style="width:12px;height:12px;"><use xlink:href="#ion-ios-photos-outline"></use></svg></span>${util.out('Duplicate')}</button>
57391
+ ${htmlbutton}
57392
+ <div class="is-separator"></div>
57393
+ <button type="button" title="${util.out('Lock')}" class="row-locking"><span><svg class="is-icon-flex" style="width:13px;height:13px;"><use xlink:href="#icon-lock"></use></svg></span>${util.out('Lock')}</button>
57394
+ <button type="button" title="${util.out('Settings')}" class="row-settings"><span><svg class="is-icon-flex" style="width:12px;height:12px;"><use xlink:href="#ion-ios-gear"></use></svg></span>${util.out('Settings')}</button>
57395
+ </div>
57396
+ </div>
57397
+
57398
+ <div class="is-modal rowsettings" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
57399
+ <div class="is-modal-content">
57400
+ <div class="is-modal-bar is-draggable">
57401
+ ${util.out('Row Settings')}
57402
+ <button class="is-modal-close" title="${util.out('Close')}" tabindex="-1">&#10005;</button>
57403
+ </div>
57404
+
57405
+ <div style="padding:0;margin-top:35px;">
57406
+
57407
+ <div class="is-tabs" data-group="rowsettings">
57408
+ <a title="${util.out('General')}" id="tabRowGeneral" href="#" data-content="divRowGeneral" class="active">${util.out('General')}</a>
57409
+ <a title="${util.out('More')}" id="tabRowMore" href="#" data-content="divRowMore">${util.out('More')}</a>
57410
+ </div>
57411
+ <div id="divRowGeneral" class="is-tab-content active" data-group="rowsettings" style="display:flex" tabindex="-1">
57412
+
57413
+ <div style="padding-bottom: 3px;">${util.out('Background Color')}:</div>
57414
+ <div style="display:flex;">
57415
+ <button title="${util.out('Background Color')}" class="input-row-bgcolor is-btn-color" style="margin-right:15px"></button>
57416
+ <button title="${util.out('Gradient')}" class="input-row-gradient classic" data-value="+"> ${util.out('Gradient')} </button>
57417
+ </div>
57418
+
57419
+ <div style="padding-top:20px;padding-bottom: 3px;">${util.out('Background Image')}:</div>
57420
+ <div>
57421
+ <div class="cell-bgimage-preview"></div>
57422
+ <div style="display: flex">
57423
+ <button title="${util.out('Image')}" class="input-cell-bgimage">
57424
+ <svg class="is-icon-flex"><use xlink:href="#ion-image"></use></svg>
57425
+ <span>${util.out('Image')}</span>
57426
+ </button>
57427
+ <button title="${util.out('Select')}" class="input-select"><svg class="is-icon-flex"><use xlink:href="#ion-more"></use></svg></button>
57428
+ <button title="${util.out('Remove')}" class="input-row-bgremove"><svg class="is-icon-flex" style="width:11px;height:11px;"><use xlink:href="#icon-clean"></use></svg></button>
57429
+ <button title="${util.out('Adjust')}" class="input-row-bgimageadjust" style="width:40px"><svg class="is-icon-flex"><use xlink:href="#ion-wrench"></use></svg></button>
57430
+ </div>
57431
+ </div>
57432
+
57433
+ <div style="padding:30px 0 10px;">
57434
+ <label class="label-row-grayscale label-checkbox" for="chkRowGrayscale"><input id="chkRowGrayscale" class="chk-row-grayscale" type="checkbox" /> ${util.out('Grayscale')}</label>
57435
+ </div>
57436
+
57437
+ <div class="is-separator"></div>
57438
+
57439
+ <div class="div-target" style="display: flex;justify-content: flex-end;padding: 5px 0 0;">
57440
+ <button title="${util.out('Desktop')}" class="input-device on" data-value="" style="width:40px;height:25px;">
57441
+ <svg class="is-icon-flex" style="width:16px;height:16px"><use xlink:href="#icon-device-desktop"></use></svg>
57442
+ </button>
57443
+ <button title="${util.out('Tablet')}" class="input-device" data-value="sm" style="width:40px;height:25px;">
57444
+ <svg class="is-icon-flex" style="width:16px;height:16px"><use xlink:href="#icon-device-tablet"></use></svg>
57445
+ </button>
57446
+ <button title="${util.out('Mobile')}" class="input-device" data-value="xs" style="width:40px;height:25px;">
57447
+ <svg class="is-icon-flex" style="width:13px;height:13px"><use xlink:href="#icon-device-mobile"></use></svg>
57448
+ </button>
57449
+ </div>
57450
+
57451
+ <div style="padding-top:0;padding-bottom:3px;">${util.out('Visibility')}:</div>
57452
+ <div class="div-visibility" style="display:flex;">
57453
+ <button title="${util.out('Visible')}" class="input-visible on" data-value="sm" style="width:100px;height:34px;">
57454
+ <svg class="is-icon-flex" style="width:16px;height:16px"><use xlink:href="#icon-eye"></use></svg>
57455
+ <span>${util.out('Visible')}</span>
57456
+ </button>
57457
+ <button title="${util.out('Hidden')}" class="input-hidden" data-value="xs" style="width:100px;height:34px;">
57458
+ <svg class="is-icon-flex" style="width:16px;height:16px"><use xlink:href="#icon-eye-off"></use></svg>
57459
+ <span>${util.out('Hidden')}</span>
57460
+ </button>
57461
+ </div>
57462
+
57463
+ </div>
57464
+
57465
+ <div id="divRowMore" class="is-tab-content" data-group="rowsettings" tabindex="-1">
57466
+
57467
+ <label for="inpRowId">${util.out('Add Row ID')}:</label>
57468
+ <div>
57469
+ <input id="inpRowId" class="input-row-id" type="text" onkeypress="return /[0-9a-zA-Z_]/i.test(event.key)" style="height:38px">
57470
+ </div>
57471
+
57472
+ <label for="inpRowCssClasses" style="padding:20px 0 3px;">${util.out('Add Css Classes')}:</label>
57473
+ <div>
57474
+ <input id="inpRowCssClasses" class="input-row-classes" type="text" style="height:38px">
57475
+ </div>
57476
+
57477
+ </div>
57478
+
57479
+ </div>
57480
+
57481
+ </div>
57482
+ </div>
57483
+
57484
+ `;
57485
+ dom.appendHtml(builderStuff, html);
57486
+ rowMore = builderStuff.querySelector('.rowmore');
57487
+ const rowSettings = builderStuff.querySelector('.is-modal.rowsettings');
57488
+ const imageSource = document.querySelector('.is-modal.imagesource');
57489
+ const imageAdjust = document.querySelector('.is-modal.imageadjust');
57490
+ const imageAdjust2 = document.querySelector('.is-modal.imageadjust2');
57491
+ this.rowSettings = rowSettings;
57492
+ this.imageSource = imageSource;
57493
+ this.imageAdjust = imageAdjust;
57494
+ this.imageAdjust2 = imageAdjust2;
57495
+ this.divRowGeneral = builderStuff.querySelector('#divRowGeneral'); // Open Row Settings
57496
+
57497
+ let elm = rowMore.querySelector('.row-settings');
57498
+ if (elm) dom.addEventListener(elm, 'click', () => {
57499
+ const row = this.rowOverlay();
57500
+ if (!row) return;
57501
+ this.readRowStyles(row); //save selection
57502
+
57503
+ util.saveSelection();
57504
+ util.showModal(rowSettings, false, () => {
57505
+ let rtetool = builderStuff.querySelector('.is-rte-tool');
57506
+
57507
+ if (rtetool.style.display === 'flex') {
57508
+ // means text selection
57509
+ util.restoreSelection();
57510
+ }
57511
+ }); // this.rowMore.style.display = '';
57512
+
57513
+ util.hidePop(this.rowMore);
57514
+ }); // Row Background color
57515
+
57516
+ let btnRowBgColor = rowSettings.querySelector('.input-row-bgcolor');
57517
+ btnRowBgColor.addEventListener('click', e => {
57518
+ this.builder.uo.saveForUndo(true); // checkLater = true
57519
+
57520
+ let elm = e.target;
57521
+ this.builder.colorPicker.open(color => {
57522
+ const row = this.rowOverlay();
57523
+ if (!row) return;
57524
+ row.style.backgroundColor = color;
57525
+ elm.style.backgroundColor = color; // preview
57526
+ //Trigger Change event
57527
+
57528
+ this.builder.opts.onChange();
57529
+ }, rowSettings.querySelector('.input-row-bgcolor').style.backgroundColor, () => {
57530
+ btnRowBgColor.removeAttribute('data-focus');
57531
+ btnRowBgColor.focus();
57532
+ });
57533
+ btnRowBgColor.setAttribute('data-focus', true);
57534
+ }); // Row Background Image
57535
+
57536
+ const btnRowBgImage = rowSettings.querySelector('.input-cell-bgimage');
57537
+ if (btnRowBgImage) dom.addEventListener(btnRowBgImage, 'click', () => {
57538
+ const row = this.rowOverlay();
57539
+ if (!row) return; //Get current value
57540
+
57541
+ let imgUrl = '';
57542
+
57543
+ if (row.style.backgroundImage) {
57544
+ if (row.style.backgroundImage.indexOf('url(') !== -1) {
57545
+ imgUrl = row.style.backgroundImage.slice(4, -1).replace(/["']/g, '');
57546
+ }
57547
+ }
57548
+
57549
+ this.builder.colTool.openImagePicker(imgUrl, url => {
57550
+ const row = this.rowOverlay();
57551
+ if (!row) return;
57552
+ this.builder.uo.saveForUndo();
57553
+ row.style.backgroundImage = `url("${url}")`;
57554
+ row.style.backgroundSize = 'cover';
57555
+ row.style.backgroundRepeat = 'no-repeat';
57556
+ const div = rowSettings.querySelector('.cell-bgimage-preview');
57557
+ const btnImageAdjust = this.rowSettings.querySelector('.input-row-bgimageadjust');
57558
+ const btnImageRemove = this.rowSettings.querySelector('.input-row-bgremove');
57559
+ btnImageAdjust.style.display = 'none';
57560
+ btnImageRemove.style.display = 'none';
57561
+
57562
+ if (url !== '') {
57563
+ div.innerHTML = `<img src="${url}">`;
57564
+ btnImageAdjust.style.display = 'flex';
57565
+ btnImageRemove.style.display = 'flex';
57566
+ } else {
57567
+ div.innerHTML = '';
57568
+ } //Trigger Change event
57569
+
57570
+
57571
+ this.builder.opts.onChange();
57572
+ }, btnRowBgImage);
57573
+ }); // Row Background Image Adjust
57574
+
57575
+ const btnImageAdjust = rowSettings.querySelector('.input-row-bgimageadjust');
57576
+ if (btnImageAdjust) dom.addEventListener(btnImageAdjust, 'click', () => {
57577
+ const row = this.rowOverlay();
57578
+ if (!row) return;
57579
+ this.builder.colTool.openImageAdjust(row, btnImageAdjust);
57580
+ });
57581
+ elm = rowSettings.querySelector('.input-row-bgremove');
57582
+ if (elm) dom.addEventListener(elm, 'click', () => {
57583
+ const row = this.rowOverlay();
57584
+ if (!row) return;
57585
+ this.builder.uo.saveForUndo();
57586
+ row.style.backgroundImage = '';
57587
+ row.style.backgroundSize = '';
57588
+ row.style.backgroundRepeat = '';
57589
+ row.style.backgroundPosition = '';
57590
+ const div = rowSettings.querySelector('.cell-bgimage-preview');
57591
+ const btnImageAdjust = this.rowSettings.querySelector('.input-row-bgimageadjust');
57592
+ const btnImageRemove = this.rowSettings.querySelector('.input-row-bgremove');
57593
+ btnImageAdjust.style.display = 'none';
57594
+ btnImageRemove.style.display = 'none';
57595
+ div.innerHTML = ''; //Trigger Change event
57596
+
57597
+ this.builder.opts.onChange();
57598
+ }); // Row Background Image Open Asset
57599
+
57600
+ if (!this.builder.opts.onImageSelectClick && this.builder.opts.imageselect === '') {
57601
+ this.divRowGeneral.querySelector('.input-select').style.display = 'none';
57602
+ }
57603
+
57604
+ const btnRowBgImageOpenAsset = this.divRowGeneral.querySelector('.input-select');
57605
+ this.builder.renderSelectAsset(btnRowBgImageOpenAsset, 'image', url => {
57606
+ const row = this.rowOverlay();
57607
+ if (!row) return;
57608
+ this.builder.uo.saveForUndo();
57609
+ row.style.backgroundImage = `url("${url}")`;
57610
+ row.style.backgroundSize = 'cover';
57611
+ row.style.backgroundRepeat = 'no-repeat';
57612
+ const div = rowSettings.querySelector('.cell-bgimage-preview');
57613
+ const btnImageAdjust = this.rowSettings.querySelector('.input-row-bgimageadjust');
57614
+ const btnImageRemove = this.rowSettings.querySelector('.input-row-bgremove');
57615
+ btnImageAdjust.style.display = 'none';
57616
+ btnImageRemove.style.display = 'none';
57617
+
57618
+ if (url !== '') {
57619
+ div.innerHTML = `<img src="${url}">`;
57620
+ btnImageAdjust.style.display = 'flex';
57621
+ btnImageRemove.style.display = 'flex';
57622
+ } else {
57623
+ div.innerHTML = '';
57624
+ } //Trigger Change event
57625
+
57626
+
57627
+ this.builder.opts.onChange();
57628
+ }); // Background gradient
57629
+
57630
+ const gradientPicker = new GradientPicker({
57631
+ colors: this.builder.colors,
57632
+ gradientcolors: this.builder.opts.gradientcolors,
57633
+ lang: this.builder.opts.lang
57634
+ });
57635
+ let btnRowGradient = rowSettings.querySelector('.input-row-gradient');
57636
+ btnRowGradient.addEventListener('click', () => {
57637
+ this.builder.uo.saveForUndo(true); // checkLater = true
57638
+
57639
+ const row = this.rowOverlay();
57640
+ if (!row) return;
57641
+ gradientPicker.open(row, () => {
57642
+ const btnImageAdjust = this.rowSettings.querySelector('.input-row-bgimageadjust');
57643
+ btnImageAdjust.style.display = 'none';
57644
+ const btnImageRemove = this.rowSettings.querySelector('.input-row-bgremove');
57645
+ btnImageRemove.style.display = 'none';
57646
+ const div = this.rowSettings.querySelector('.cell-bgimage-preview');
57647
+ div.innerHTML = '';
57648
+ const inpSrc = this.imageSource.querySelector('.input-src');
57649
+ inpSrc.value = ''; //Trigger Change event
57650
+
57651
+ this.builder.opts.onChange();
57652
+ }, isChanged => {
57653
+
57654
+ btnRowGradient.removeAttribute('data-focus');
57655
+ btnRowGradient.focus();
57656
+ });
57657
+ btnRowGradient.setAttribute('data-focus', true);
57658
+ });
57659
+ const chkRowGrayscale = rowSettings.querySelector('.chk-row-grayscale');
57660
+ chkRowGrayscale.addEventListener('click', () => {
57661
+ this.builder.uo.saveForUndo();
57662
+ const row = this.rowOverlay();
57663
+ if (!row) return;
57664
+
57665
+ if (chkRowGrayscale.checked) {
57666
+ row.style.filter = 'grayscale(1)';
57667
+ } else {
57668
+ if (row.style.filter) {
57669
+ row.style.filter = row.style.filter.replace('grayscale(1)', '');
57670
+ }
57671
+ } //Trigger Change event
57672
+
57673
+
57674
+ this.builder.opts.onChange();
57675
+ }); // Responsive Visibility
57676
+
57677
+ let btns = this.rowSettings.querySelectorAll('.input-device');
57678
+ btns.forEach(btn => {
57679
+ btn.addEventListener('click', () => {
57680
+ let row = util.rowSelected();
57681
+ if (!row) return;
57682
+ let elms = this.rowSettings.querySelectorAll('.input-device');
57683
+ elms.forEach(elm => {
57684
+ elm.classList.remove('on');
57685
+ });
57686
+ btn.classList.add('on');
57687
+ this.realtimeVisibility(row);
57688
+ });
57689
+ });
57690
+ let btnVisible = this.rowSettings.querySelector('.input-visible');
57691
+ let btnHidden = this.rowSettings.querySelector('.input-hidden');
57692
+ btnVisible.addEventListener('click', () => {
57693
+ let row = util.rowSelected();
57694
+ if (!row) return;
57695
+ row.classList.remove('hideonmobile');
57696
+ let divTarget = this.rowSettings.querySelector('.div-target');
57697
+ let target = this.builder.responsive.readTarget(divTarget);
57698
+
57699
+ if (target === 'xs') {
57700
+ row.classList.remove('xs-hidden');
57701
+ } else if (target === 'sm') {
57702
+ row.classList.remove('sm-hidden');
57703
+ } else if (target === '') {
57704
+ row.classList.remove('desktop-hidden');
57705
+ }
57706
+
57707
+ btnVisible.classList.add('on');
57708
+ btnHidden.classList.remove('on');
57709
+ });
57710
+ btnHidden.addEventListener('click', () => {
57711
+ let row = util.rowSelected();
57712
+ if (!row) return;
57713
+ row.classList.remove('hideonmobile');
57714
+ let divTarget = this.rowSettings.querySelector('.div-target');
57715
+ let target = this.builder.responsive.readTarget(divTarget);
57716
+
57717
+ if (target === 'xs') {
57718
+ row.classList.add('xs-hidden');
57719
+ } else if (target === 'sm') {
57720
+ row.classList.add('sm-hidden');
57721
+ } else if (target === '') {
57722
+ row.classList.add('desktop-hidden');
57723
+ }
57724
+
57725
+ btnVisible.classList.remove('on');
57726
+ btnHidden.classList.add('on');
57727
+ }); //More
57728
+
57729
+ let inpRowId = rowSettings.querySelector('.input-row-id');
57730
+ inpRowId.addEventListener('change', () => {
57731
+ let row = util.rowSelected();
57732
+ if (!row) return;
57733
+ this.builder.uo.saveForUndo();
57734
+
57735
+ if (inpRowId.value !== '') {
57736
+ row.setAttribute('id', inpRowId.value);
57737
+ } else {
57738
+ row.removeAttribute('id');
57739
+ } //Trigger Change event
57740
+
57741
+
57742
+ this.builder.opts.onChange();
57743
+ });
57744
+ let inpRowCssClasses = rowSettings.querySelector('.input-row-classes');
57745
+ inpRowCssClasses.addEventListener('change', () => {
57746
+ let row = util.rowSelected();
57747
+ if (!row) return;
57748
+ this.builder.uo.saveForUndo();
57749
+ let arrCurrentClasses = [];
57750
+ let currentClasses = row.getAttribute('data-class');
57751
+ if (currentClasses) arrCurrentClasses = currentClasses.split(' ');
57752
+ let arrNewClasses = [];
57753
+ let newClasses = inpRowCssClasses.value;
57754
+ arrNewClasses = newClasses.split(' ');
57755
+ arrCurrentClasses.forEach(item => {
57756
+ if (!arrNewClasses.includes(item)) {
57757
+ row.classList.remove(item);
57758
+ }
57759
+ });
57760
+ arrNewClasses.forEach(item => {
57761
+ if (item !== '') row.classList.add(item);
57762
+ }); // save
57763
+
57764
+ row.setAttribute('data-class', newClasses);
57765
+ if (row.getAttribute('data-class') === '') row.removeAttribute('data-class'); //Trigger Change event
57766
+
57767
+ this.builder.opts.onChange();
57768
+ }); //-----------------
57769
+
57770
+ elm = rowMore.querySelector('.row-up');
57771
+ if (elm) dom.addEventListener(elm, 'click', () => {
57772
+ this.grid.moveRowUp(); // util.clearControls();
57773
+ });
57774
+ elm = rowMore.querySelector('.row-down');
57775
+ if (elm) dom.addEventListener(elm, 'click', () => {
57776
+ this.grid.moveRowDown(); // util.clearControls();
57777
+ });
57778
+ elm = rowMore.querySelector('.row-duplicate');
57779
+ if (elm) dom.addEventListener(elm, 'click', () => {
57780
+ this.grid.duplicateRow(); // this.rowMore.style.display = '';
57781
+
57782
+ util.hidePop(rowMore); //Hide Column tool (new!)
57783
+
57784
+ util.hideColumnTool();
57785
+ util.clearControls();
57786
+ });
57787
+ elm = rowMore.querySelector('.row-html');
57788
+ if (elm) dom.addEventListener(elm, 'click', () => {
57789
+ // const cell = util.cellSelected();
57790
+ // if(!cell) return;
57791
+ let row;
57792
+ let cell = util.cellSelected();
57793
+
57794
+ if (cell) {
57795
+ row = cell.parentNode;
57796
+ } else {
57797
+ row = util.rowSelected();
57798
+ }
57799
+
57800
+ if (!row) return;
57801
+ const htmlutil = new HtmlUtil(builder);
57802
+ htmlutil.view('row');
57803
+ }); // Lock/Unlock Row
57804
+
57805
+ const btnRowLocking = rowMore.querySelector('.row-locking');
57806
+ if (btnRowLocking) dom.addEventListener(btnRowLocking, 'click', e => {
57807
+ let row = util.rowSelected();
57808
+ if (!row) return;
57809
+ let currentLocking = false;
57810
+ let elms = row.querySelectorAll('[data-noedit]');
57811
+ elms.forEach(elm => {
57812
+ if (!elm.hasAttribute('data-html')) {
57813
+ currentLocking = true;
57814
+ }
57815
+ });
57816
+
57817
+ if (!currentLocking) {
57818
+ Array.from(row.children).map(cell => {
57819
+ if (cell.classList.contains('is-row-tool')) return;
57820
+ if (cell.classList.contains('is-col-tool')) return;
57821
+ if (cell.classList.contains('is-rowadd-tool')) return;
57822
+ if (cell.classList.contains('is-row-overlay')) return;
57823
+ cell.setAttribute('data-noedit', '');
57824
+ cell.contentEditable = false;
57825
+ this.util.clearActiveElement(true);
57826
+ this.builder.colTool.showHideLockIndicator(cell);
57827
+ this.builder.element.applyBehavior(cell);
57828
+ });
57829
+ dom.addClass(btnRowLocking, 'on');
57830
+ } else {
57831
+ Array.from(row.children).map(cell => {
57832
+ if (cell.classList.contains('is-row-tool')) return;
57833
+ if (cell.classList.contains('is-col-tool')) return;
57834
+ if (cell.classList.contains('is-rowadd-tool')) return;
57835
+ if (cell.classList.contains('is-row-overlay')) return;
57836
+ cell.removeAttribute('data-noedit');
57837
+ cell.contentEditable = true;
57838
+ this.builder.colTool.showHideLockIndicator(cell);
57839
+ this.builder.element.applyBehavior(cell);
57840
+ });
57841
+ dom.removeClass(btnRowLocking, 'on');
57842
+ }
57843
+
57844
+ util.hidePop(rowMore);
57845
+ e.preventDefault();
57846
+ });
57847
+ }
57848
+
57849
+ this.rowMore = rowMore; // // Click anywhere will hide Column tool
57850
+ // document.addEventListener('mousedown', (e) => {
57851
+ // e = e || window.event;
57852
+ // var target = e.target || e.srcElement;
57853
+ // if(rowMore.style.display === 'flex'){
57854
+ // let a = dom.parentsHasClass(target, 'rowmore');
57855
+ // let b = dom.parentsHasClass(target, 'row-more');
57856
+ // if(a||b) {
57857
+ // return;
57858
+ // }
57859
+ // else {
57860
+ // // rowMore.style.display = '';
57861
+ // util.hidePop(rowMore);
57862
+ // }
57863
+ // }
57864
+ // });
57865
+ }
57866
+
57867
+ realtimeVisibility(row) {
57868
+ let divTarget = this.rowSettings.querySelector('.div-target');
57869
+ let divVisibility = this.rowSettings.querySelector('.div-visibility');
57870
+ let target = this.builder.responsive.readTarget(divTarget);
57871
+ let valVisibility = this.builder.responsive.getVisibility(row, target);
57872
+ this.builder.responsive.showVisibility(divVisibility, valVisibility);
57873
+ }
57874
+
57875
+ render(row) {
57876
+ const dom = this.dom;
57877
+ const util = this.builder.util;
57878
+ const builderStuff = this.builder.builderStuff;
57879
+ let rowMore = this.rowMore;
57880
+ let rowtool = row.querySelector('.is-row-tool');
57881
+
57882
+ if (!rowtool) {
57883
+ let html = `<div class="is-tool is-row-tool">
57884
+ <div title="${util.out('Move')}" role="button" tabindex="-1" class="row-handle" style="width:100%;cursor:move;text-align:center;"><svg class="is-icon-flex"><use xlink:href="#ion-move"></use></svg></div>
57885
+ <button type="button" tabindex="-1" title="${util.out('More')}" class="row-more"><svg class="is-icon-flex"><use xlink:href="#ion-more"></use></svg></button>
57886
+ <button type="button" tabindex="-1" title="${util.out('Grid Editor')}" class="row-grideditor"><svg class="is-icon-flex"><use xlink:href="#ion-grid"></use></svg></button>
57887
+ <button type="button" tabindex="-1" title="${util.out('Delete')}" class="row-remove"><svg class="is-icon-flex"><use xlink:href="#ion-ios-close-empty"></use></svg></button>
57888
+ </div>
57889
+ <div class="is-tool is-col-tool">
57890
+ <button type="button" tabindex="-1" title="${util.out('Add')}" class="cell-add"><svg class="is-icon-flex"><use xlink:href="#ion-ios-plus-empty"></use></svg></button>
57891
+ <button type="button" tabindex="-1" title="${util.out('More')}" class="cell-more"><svg class="is-icon-flex"><use xlink:href="#ion-more"></use></svg></button>
57892
+ <button type="button" tabindex="-1" title="${util.out('Delete')}" class="cell-remove"><svg class="is-icon-flex" style="margin-left:-1px"><use xlink:href="#ion-ios-close-empty"></use></svg></button>
57893
+ </div>
57894
+ `;
57895
+ dom.appendHtml(row, html);
57896
+ rowtool = row.querySelector('.is-row-tool'); // Prepare for tooltip
57897
+
57898
+ let elms = rowtool.querySelectorAll('[title]');
57899
+ Array.prototype.forEach.call(elms, elm => {
57900
+ elm.setAttribute('data-title', elm.getAttribute('title'));
57901
+
57902
+ if (!this.builder.iframe) {
57903
+ this.builder.tooltip.set(elm, 5, 3);
57904
+ } else {
57905
+ this.builder.tooltip.set(elm, 5, 3, true);
57906
+ }
57907
+ });
57908
+ let coltool = row.querySelector('.is-col-tool'); // Prepare for tooltip
57909
+
57910
+ elms = coltool.querySelectorAll('[title]');
57911
+ Array.prototype.forEach.call(elms, elm => {
57912
+ elm.setAttribute('data-title', elm.getAttribute('title'));
57913
+
57914
+ if (!this.builder.iframe) {
57915
+ this.builder.tooltip.set(elm, 5, 3);
57916
+ } else {
57917
+ this.builder.tooltip.set(elm, 5, 3, true);
57918
+ }
57919
+ }); // Check for backward compatibility
57920
+
57921
+ let marginLeft = window.getComputedStyle(coltool, null).getPropertyValue('margin-left');
57922
+
57923
+ if (parseInt(marginLeft) === 0) {
57924
+ this.builder.backwardCompatible();
57925
+ }
57926
+
57927
+ const btnCellAdd = coltool.querySelector('.cell-add');
57928
+ if (btnCellAdd) dom.addEventListener(btnCellAdd, 'click', () => {
57929
+ let cell = util.cellSelected();
57930
+ if (!cell) return;
57931
+ let quickadd = this.builder.builderStuff.querySelector('.is-pop.quickadd');
57932
+ let tabs = quickadd.querySelector('.is-pop-tabs');
57933
+ tabs.style.display = 'flex';
57934
+ let top, left;
57935
+
57936
+ if (!this.builder.iframe) {
57937
+ top = btnCellAdd.getBoundingClientRect().top + window.pageYOffset;
57938
+ left = btnCellAdd.getBoundingClientRect().left + window.pageXOffset;
57939
+ } else {
57940
+ let adjY = this.builder.iframe.getBoundingClientRect().top + window.pageYOffset;
57941
+ let adjX = this.builder.iframe.getBoundingClientRect().left + window.pageXOffset;
57942
+ top = btnCellAdd.getBoundingClientRect().top + adjY + 10;
57943
+ left = btnCellAdd.getBoundingClientRect().left + adjX + 5;
57944
+ } // quickadd.style.display = 'flex';
57945
+
57946
+
57947
+ util.showPop(quickadd, false, btnCellAdd); //const w = quickadd.offsetWidth; //to get value, element must not hidden (display:none). So set display:flex before this.
57948
+ //const h = quickadd.offsetHeight;
57949
+
57950
+ quickadd.style.top = top + 35 + 'px';
57951
+ quickadd.style.left = left + 'px';
57952
+ dom.removeClass(quickadd, 'arrow-bottom');
57953
+ dom.removeClass(quickadd, 'arrow-left');
57954
+ dom.removeClass(quickadd, 'arrow-right');
57955
+ dom.removeClass(quickadd, 'center');
57956
+ dom.removeClass(quickadd, 'right');
57957
+ dom.addClass(quickadd, 'arrow-top');
57958
+ dom.addClass(quickadd, 'left');
57959
+ let val = quickadd.querySelector('.active').getAttribute('data-value');
57960
+
57961
+ if (val === 'left') {
57962
+ quickadd.setAttribute('data-mode', 'cell-left');
57963
+ } else {
57964
+ quickadd.setAttribute('data-mode', 'cell-right');
57965
+ }
57966
+ });
57967
+ const btnCellMore = coltool.querySelector('.cell-more');
57968
+ if (btnCellMore) dom.addEventListener(btnCellMore, 'click', () => {
57969
+ let cell = util.cellSelected();
57970
+ if (!cell) return;
57971
+ let top, left;
57972
+
57973
+ if (!this.builder.iframe) {
57974
+ top = btnCellMore.getBoundingClientRect().top + window.pageYOffset;
57975
+ left = btnCellMore.getBoundingClientRect().left + window.pageXOffset;
57976
+ } else {
57977
+ let adjY = this.builder.iframe.getBoundingClientRect().top + window.pageYOffset;
57978
+ let adjX = this.builder.iframe.getBoundingClientRect().left + window.pageXOffset;
57979
+ top = btnCellMore.getBoundingClientRect().top + adjY;
57980
+ left = btnCellMore.getBoundingClientRect().left + adjX;
57981
+ }
57982
+
57983
+ const columnMore = builderStuff.querySelector('.columnmore'); // columnMore.style.display = 'flex';
57984
+
57985
+ util.showPop(columnMore, false, btnCellMore); //const w = columnMore.offsetWidth; //to get value, element must not hidden (display:none). So set display:flex before this.
57986
+ //const h = columnMore.offsetHeight;
57987
+
57988
+ columnMore.style.top = top + 35 + 'px';
57989
+ columnMore.style.left = left - 7 + 'px';
57990
+ dom.removeClass(columnMore, 'arrow-bottom');
57991
+ dom.removeClass(columnMore, 'arrow-left');
57992
+ dom.removeClass(columnMore, 'arrow-right');
57993
+ dom.removeClass(columnMore, 'center');
57994
+ dom.removeClass(columnMore, 'right');
57995
+ dom.addClass(columnMore, 'arrow-top');
57996
+ dom.addClass(columnMore, 'left');
57997
+ const btnCellLocking = columnMore.querySelector('.cell-locking');
57998
+
57999
+ if (cell.hasAttribute('data-noedit')) {
58000
+ dom.addClass(btnCellLocking, 'on'); // btnCellLocking.innerHTML = '<svg class="is-icon-flex"><use xlink:href="#icon-lock"></use></svg>';
58001
+ } else {
58002
+ dom.removeClass(btnCellLocking, 'on'); // btnCellLocking.innerHTML = '<svg class="is-icon-flex"><use xlink:href="#icon-lock-off"></use></svg>';
58003
+ }
58004
+ });
58005
+ const btnCellRemove = coltool.querySelector('.cell-remove');
58006
+ if (btnCellRemove) dom.addEventListener(btnCellRemove, 'click', () => {
58007
+ const grid = new Grid(this.builder);
58008
+ grid.removeColumn();
58009
+ util.clearControls();
58010
+ });
58011
+ let btnGridEditor = rowtool.querySelector('.row-grideditor');
58012
+ if (btnGridEditor) dom.addEventListener(btnGridEditor, 'click', () => {
58013
+ const grideditor = builderStuff.querySelector('.grideditor');
58014
+
58015
+ if (dom.hasClass(grideditor, 'active')) {
58016
+ dom.removeClass(grideditor, 'active');
58017
+ const builders = document.querySelectorAll(this.builder.opts.container);
58018
+ Array.prototype.forEach.call(builders, builder => {
58019
+ builder.removeAttribute('grideditor');
58020
+ });
58021
+ } else {
58022
+ // dom.addClass(grideditor, 'active');
58023
+ this.util.showModal(grideditor, false, () => {
58024
+ btnGridEditor.removeAttribute('data-focus');
58025
+ btnGridEditor.focus();
58026
+ });
58027
+ btnGridEditor.setAttribute('data-focus', true);
58028
+ const builders = document.querySelectorAll(this.builder.opts.container);
58029
+ Array.prototype.forEach.call(builders, builder => {
58030
+ builder.setAttribute('grideditor', '');
58031
+ }); // Grid Editor Status
58032
+ // On/off outline button
58033
+
58034
+ const btnGridOutline = grideditor.querySelector('.grid-outline');
58035
+ const container = document.querySelector(this.builder.opts.container); // get one
58036
+
58037
+ if (container.hasAttribute('gridoutline')) {
58038
+ dom.addClass(btnGridOutline, 'on');
58039
+ } else {
58040
+ dom.removeClass(btnGridOutline, 'on');
58041
+ } // On/off lock button
58042
+
58043
+
58044
+ const btnCellLocking = grideditor.querySelector('.cell-locking');
58045
+ let cell = util.cellSelected();
58046
+
58047
+ if (cell) {
58048
+ if (cell.hasAttribute('data-noedit')) {
58049
+ dom.addClass(btnCellLocking, 'on');
58050
+ } else {
58051
+ dom.removeClass(btnCellLocking, 'on');
58052
+ }
58053
+ } else {
58054
+ dom.removeClass(btnCellLocking, 'on');
58055
+ }
58056
+ }
58057
+ });
58058
+ const btnMore = rowtool.querySelector('.row-more');
58059
+ if (btnMore) dom.addEventListener(btnMore, 'click', () => {
58060
+ let row;
58061
+ let cell = util.cellSelected();
58062
+
58063
+ if (cell) {
58064
+ row = cell.parentNode;
58065
+ } else {
58066
+ row = util.rowSelected();
58067
+ }
58068
+
58069
+ if (!row) return; //Change to row selection
58070
+
58071
+ dom.removeClass(row, 'row-outline'); //Hide Column tool (new!)
58072
+
58073
+ util.hideColumnTool(); // const top = btnMore.getBoundingClientRect().top + window.pageYOffset;
58074
+ // const left = btnMore.getBoundingClientRect().left + window.pageXOffset;
58075
+
58076
+ let top, left;
58077
+
58078
+ if (!this.builder.iframe) {
58079
+ top = btnMore.getBoundingClientRect().top + window.pageYOffset;
58080
+ left = btnMore.getBoundingClientRect().left + window.pageXOffset;
58081
+ } else {
58082
+ let adjY = this.builder.iframe.getBoundingClientRect().top + window.pageYOffset;
58083
+ let adjX = this.builder.iframe.getBoundingClientRect().left + window.pageXOffset;
58084
+ top = btnMore.getBoundingClientRect().top + adjY;
58085
+ left = btnMore.getBoundingClientRect().left + adjX;
58086
+ } // rowMore.style.display = 'flex';
58087
+
58088
+
58089
+ util.showPop(rowMore, false, btnMore); //const w = rowMore.offsetWidth; //to get value, element must not hidden (display:none). So set display:flex before this.
58090
+ //const h = rowMore.offsetHeight;
58091
+
58092
+ rowMore.style.top = top - 8 + 'px';
58093
+ dom.removeClass(rowMore, 'arrow-bottom');
58094
+ dom.removeClass(rowMore, 'arrow-left');
58095
+ dom.removeClass(rowMore, 'arrow-right');
58096
+ dom.removeClass(rowMore, 'center');
58097
+ dom.removeClass(rowMore, 'right');
58098
+ dom.removeClass(rowMore, 'left');
58099
+
58100
+ if (this.builder.opts.rowTool === 'right') {
58101
+ rowMore.style.left = left - rowMore.offsetWidth - 10 + 'px';
58102
+ dom.addClass(rowMore, 'arrow-right');
58103
+ dom.addClass(rowMore, 'left');
58104
+ } else {
58105
+ rowMore.style.left = left + 35 + 'px';
58106
+ dom.addClass(rowMore, 'arrow-left');
58107
+ dom.addClass(rowMore, 'left');
58108
+ }
58109
+
58110
+ let btnRowHtml = rowMore.querySelector('.row-html');
58111
+ let btnRowDuplicate = rowMore.querySelector('.row-duplicate');
58112
+
58113
+ if (row.querySelector('[data-html]')) {
58114
+ if (btnRowHtml) btnRowHtml.style.display = 'none';
58115
+ if (btnRowDuplicate) btnRowDuplicate.style.display = 'none';
58116
+ } else {
58117
+ if (btnRowHtml) btnRowHtml.style.display = '';
58118
+ if (btnRowDuplicate) btnRowDuplicate.style.display = '';
58119
+ }
58120
+
58121
+ let currentLocking = false;
58122
+ let elms = row.querySelectorAll('[data-noedit]');
58123
+ elms.forEach(elm => {
58124
+ if (!elm.hasAttribute('data-html')) {
58125
+ currentLocking = true;
58126
+ }
58127
+ });
58128
+ const btnRowLocking = rowMore.querySelector('.row-locking');
58129
+
58130
+ if (currentLocking) {
58131
+ dom.addClass(btnRowLocking, 'on');
58132
+ } else {
58133
+ dom.removeClass(btnRowLocking, 'on');
58134
+ }
58135
+ });
58136
+ let elm = rowtool.querySelector('.row-remove');
58137
+ if (elm) dom.addEventListener(elm, 'click', () => {
58138
+ this.grid.removeRow();
58139
+ util.clearControls();
58140
+ });
58141
+ }
58142
+ }
58143
+
58144
+ readRowStyles(row) {
58145
+ this.util.clearActiveElement(); // Background color
58146
+
58147
+ let s = row.style.backgroundColor;
58148
+ let btn = this.rowSettings.querySelector('.input-row-bgcolor');
58149
+ if (s) btn.style.backgroundColor = s;else btn.style.backgroundColor = 'transparent';
58150
+ let imgUrl = '';
58151
+ const div = this.rowSettings.querySelector('.cell-bgimage-preview');
58152
+ const btnImageAdjust = this.rowSettings.querySelector('.input-row-bgimageadjust');
58153
+ btnImageAdjust.style.display = 'none';
58154
+ const btnImageRemove = this.rowSettings.querySelector('.input-row-bgremove');
58155
+ btnImageRemove.style.display = 'none';
58156
+
58157
+ if (row.style.backgroundImage) {
58158
+ if (row.style.backgroundImage.indexOf('url(') !== -1) {
58159
+ imgUrl = row.style.backgroundImage.slice(4, -1).replace(/["']/g, '');
58160
+ div.innerHTML = `<img src="${imgUrl}">`;
58161
+ btnImageAdjust.style.display = 'flex';
58162
+ btnImageRemove.style.display = 'flex';
58163
+ } else {
58164
+ div.innerHTML = '';
58165
+ }
58166
+ } else {
58167
+ div.innerHTML = '';
58168
+ }
58169
+
58170
+ const chkRowGrayscale = this.rowSettings.querySelector('.chk-row-grayscale');
58171
+ chkRowGrayscale.checked = false;
58172
+
58173
+ if (row.style.filter) {
58174
+ if (row.style.filter.indexOf('grayscale') !== -1) {
58175
+ chkRowGrayscale.checked = true;
58176
+ }
58177
+ }
58178
+
58179
+ let actualRow = row.parentNode; // row is actually row overlay
58180
+
58181
+ this.realtimeVisibility(actualRow); //More
58182
+
58183
+ let inpRowId = this.rowSettings.querySelector('.input-row-id');
58184
+ inpRowId.value = '';
58185
+ const rowId = actualRow.getAttribute('id');
58186
+
58187
+ if (rowId) {
58188
+ inpRowId.value = rowId;
58189
+ }
58190
+
58191
+ let inpRowClasses = this.rowSettings.querySelector('.input-row-classes');
58192
+ inpRowClasses.value = '';
58193
+ const classes = actualRow.getAttribute('data-class');
58194
+ inpRowClasses.value = classes;
58195
+ }
58196
+
58197
+ rowOverlay() {
58198
+ // let row;
58199
+ // let cell = util.cellSelected();
58200
+ // if(cell) {
58201
+ // row = cell.parentNode;
58202
+ // } else {
58203
+ // row = util.rowSelected();
58204
+ // }
58205
+ // if(!row) return;
58206
+ let row = this.util.rowSelected();
58207
+ if (!row) return false;
58208
+ let rowOverlay = row.querySelector('.is-row-overlay');
58209
+
58210
+ if (!rowOverlay) {
58211
+ this.dom.appendHtml(row, '<div class="is-row-overlay"></div>');
58212
+ rowOverlay = row.querySelector('.is-row-overlay');
58213
+ }
58214
+
58215
+ row.classList.add('relative');
58216
+ return rowOverlay;
58217
+ }
58218
+
58219
+ }
58220
+
58221
+ class RowAddTool {
58222
+ constructor(builder) {
58223
+ this.builder = builder;
58224
+ const dom = this.builder.dom;
58225
+ this.dom = dom;
58226
+ }
58227
+
58228
+ render(row) {
58229
+ const dom = this.dom;
58230
+ const util = this.builder.util;
58231
+ const quickadd = renderQuickAdd(this.builder);
58232
+ let rowaddtool = row.querySelector('.is-rowadd-tool');
58233
+
58234
+ if (!rowaddtool) {
58235
+ const html = `<div class="is-rowadd-tool" style="height:0">
58236
+ <button type="button" tabindex="-1" title="${util.out('Add')}" title="${util.out('Add')}" style="outline:none;line-height:1;margin:0;padding:0;cursor:pointer;background-color:rgba(255,255,255,0.9);"><svg class="is-icon-flex" style="fill:rgba(0, 0, 0, 0.8);width:17px;height:17px;"><use xlink:href="#ion-ios-plus-empty"></use></svg></button>
58237
+ </div>`;
58238
+ dom.appendHtml(row, html);
58239
+ rowaddtool = row.querySelector('.is-rowadd-tool'); // Prepare for tooltip
58240
+
58241
+ let elms = rowaddtool.querySelectorAll('[title]');
58242
+ Array.prototype.forEach.call(elms, elm => {
58243
+ elm.setAttribute('data-title', elm.getAttribute('title'));
58244
+
58245
+ if (!this.builder.iframe) {
58246
+ this.builder.tooltip.set(elm, 5, 3);
58247
+ } else {
58248
+ this.builder.tooltip.set(elm, 5, 3, true);
58249
+ }
58250
+ });
58251
+ }
58252
+
58253
+ let btnRowAdd = rowaddtool.querySelector('button');
58254
+ dom.addEventListener(btnRowAdd, 'click', () => {
58255
+ let tabs = quickadd.querySelector('.is-pop-tabs');
58256
+ tabs.style.display = 'none';
58257
+ const viewportHeight = window.innerHeight;
58258
+ let top, left;
58259
+
58260
+ if (!this.builder.iframe) {
58261
+ top = btnRowAdd.getBoundingClientRect().top;
58262
+ left = btnRowAdd.getBoundingClientRect().left;
58263
+ } else {
58264
+ let adjY = this.builder.iframe.getBoundingClientRect().top;
58265
+ let adjX = this.builder.iframe.getBoundingClientRect().left;
58266
+ top = btnRowAdd.getBoundingClientRect().top + adjY;
58267
+ left = btnRowAdd.getBoundingClientRect().left + adjX;
58268
+ } // quickadd.style.display = 'flex';
58269
+
58270
+
58271
+ util.showPop(quickadd, false, btnRowAdd);
58272
+ const w = quickadd.offsetWidth; //to get value, element must not hidden (display:none). So set display:flex before this.
58273
+
58274
+ const h = quickadd.offsetHeight;
58275
+
58276
+ if (viewportHeight - top > h) {
58277
+ quickadd.style.top = top + window.pageYOffset + 27 + 'px';
58278
+ quickadd.style.left = left - w / 2 + 7 + 'px';
58279
+ dom.removeClass(quickadd, 'arrow-bottom');
58280
+ dom.removeClass(quickadd, 'arrow-right');
58281
+ dom.removeClass(quickadd, 'arrow-left');
58282
+ dom.removeClass(quickadd, 'center');
58283
+ dom.addClass(quickadd, 'arrow-top');
58284
+ dom.addClass(quickadd, 'center');
58285
+ } else {
58286
+ quickadd.style.top = top + window.pageYOffset - h - 8 + 'px';
58287
+ quickadd.style.left = left - w / 2 + 7 + 'px';
58288
+ dom.removeClass(quickadd, 'arrow-top');
58289
+ dom.removeClass(quickadd, 'arrow-right');
58290
+ dom.removeClass(quickadd, 'arrow-left');
58291
+ dom.removeClass(quickadd, 'center');
58292
+ dom.addClass(quickadd, 'arrow-bottom');
58293
+ dom.addClass(quickadd, 'center');
58294
+ }
58295
+
58296
+ quickadd.setAttribute('data-mode', 'row');
58297
+ return false;
58298
+ });
58299
+ }
58300
+
58301
+ }
58302
+
57623
58303
  class ColumnTool {
57624
58304
  constructor(builder) {
57625
58305
  this.builder = builder;
@@ -57689,6 +58369,7 @@ class ColumnTool {
57689
58369
  ${this.builder.useLightbox ? `
57690
58370
  <a title="${util.out('On Click')}" id="tabCellClick" href="#" data-content="divCellClick">${util.out('On Click')}</a>
57691
58371
  ` : ''}
58372
+ <a title="${util.out('More')}" id="tabCellMore" href="#" data-content="divCellMore">${util.out('More')}</a>
57692
58373
  </div>
57693
58374
  <div id="divCellGeneral" class="is-tab-content active" data-group="cellsettings" style="display:flex" tabindex="-1">
57694
58375
 
@@ -57708,7 +58389,7 @@ class ColumnTool {
57708
58389
  </button>
57709
58390
  <button title="${util.out('Select')}" class="input-select"><svg class="is-icon-flex"><use xlink:href="#ion-more"></use></svg></button>
57710
58391
  <button title="${util.out('Remove')}" class="input-cell-bgremove"><svg class="is-icon-flex" style="width:11px;height:11px;"><use xlink:href="#icon-clean"></use></svg></button>
57711
- <button title="${util.out('Adjust')}" class="input-cell-bgimageadjust"><svg class="is-icon-flex"><use xlink:href="#ion-wrench"></use></svg></button>
58392
+ <button title="${util.out('Adjust')}" class="input-cell-bgimageadjust" style="width:40px"><svg class="is-icon-flex"><use xlink:href="#ion-wrench"></use></svg></button>
57712
58393
  </div>
57713
58394
  </div>
57714
58395
 
@@ -57885,10 +58566,26 @@ class ColumnTool {
57885
58566
  <p>${util.out('You can test the On-Click action on page if you lock the column by clicking the lock button')} <svg class="is-icon-flex"><use xlink:href="#icon-lock"></use></svg>.</p>
57886
58567
 
57887
58568
  </div>
58569
+
58570
+ <div id="divCellMore" class="is-tab-content" data-group="cellsettings" tabindex="-1">
58571
+
58572
+ <label for="inpCellId">${util.out('Add Column ID')}:</label>
58573
+ <div>
58574
+ <input id="inpCellId" class="input-cell-id" type="text" onkeypress="return /[0-9a-zA-Z_]/i.test(event.key)" style="height:38px">
58575
+ </div>
58576
+
58577
+ <label for="inpCellCssClasses" style="padding:20px 0 3px;">${util.out('Add Css Classes')}:</label>
58578
+ <div>
58579
+ <input id="inpCellCssClasses" class="input-cell-classes" type="text" style="height:38px">
58580
+ </div>
58581
+
58582
+ </div>
58583
+
57888
58584
 
57889
58585
  </div>
57890
58586
 
57891
58587
  </div>
58588
+
57892
58589
  </div>
57893
58590
 
57894
58591
  <div class="is-modal imageadjust" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
@@ -58177,6 +58874,47 @@ class ColumnTool {
58177
58874
  }); // this.columnMore.style.display = '';
58178
58875
 
58179
58876
  util.hidePop(this.columnMore);
58877
+ }); //More
58878
+
58879
+ let inpCellId = cellSettings.querySelector('.input-cell-id');
58880
+ inpCellId.addEventListener('change', () => {
58881
+ let cell = util.cellSelected();
58882
+ if (!cell) return;
58883
+ this.builder.uo.saveForUndo();
58884
+
58885
+ if (inpCellId.value !== '') {
58886
+ cell.setAttribute('id', inpCellId.value);
58887
+ } else {
58888
+ cell.removeAttribute('id');
58889
+ } //Trigger Change event
58890
+
58891
+
58892
+ this.builder.opts.onChange();
58893
+ });
58894
+ let inpCellCssClasses = cellSettings.querySelector('.input-cell-classes');
58895
+ inpCellCssClasses.addEventListener('change', () => {
58896
+ let cell = util.cellSelected();
58897
+ if (!cell) return;
58898
+ this.builder.uo.saveForUndo();
58899
+ let arrCurrentClasses = [];
58900
+ let currentClasses = cell.getAttribute('data-class');
58901
+ if (currentClasses) arrCurrentClasses = currentClasses.split(' ');
58902
+ let arrNewClasses = [];
58903
+ let newClasses = inpCellCssClasses.value;
58904
+ arrNewClasses = newClasses.split(' ');
58905
+ arrCurrentClasses.forEach(item => {
58906
+ if (!arrNewClasses.includes(item)) {
58907
+ cell.classList.remove(item);
58908
+ }
58909
+ });
58910
+ arrNewClasses.forEach(item => {
58911
+ if (item !== '') cell.classList.add(item);
58912
+ }); // save
58913
+
58914
+ cell.setAttribute('data-class', newClasses);
58915
+ if (cell.getAttribute('data-class') === '') cell.removeAttribute('data-class'); //Trigger Change event
58916
+
58917
+ this.builder.opts.onChange();
58180
58918
  }); // Column Background color
58181
58919
 
58182
58920
  let btnCellBgColor = cellSettings.querySelector('.input-cell-bgcolor');
@@ -58251,6 +58989,7 @@ class ColumnTool {
58251
58989
  cell.style.backgroundImage = '';
58252
58990
  cell.style.backgroundSize = '';
58253
58991
  cell.style.backgroundRepeat = '';
58992
+ cell.style.backgroundPosition = '';
58254
58993
  const div = cellSettings.querySelector('.cell-bgimage-preview');
58255
58994
  const btnImageAdjust = this.cellSettings.querySelector('.input-cell-bgimageadjust');
58256
58995
  const btnImageRemove = this.cellSettings.querySelector('.input-cell-bgremove');
@@ -59605,7 +60344,20 @@ class ColumnTool {
59605
60344
  dom.addClass(btn, 'on');
59606
60345
  }
59607
60346
 
59608
- this.realtimeVisibility(cell);
60347
+ this.realtimeVisibility(cell); //More
60348
+
60349
+ let inpCellId = this.cellSettings.querySelector('.input-cell-id');
60350
+ inpCellId.value = '';
60351
+ const rowId = cell.getAttribute('id');
60352
+
60353
+ if (rowId) {
60354
+ inpCellId.value = rowId;
60355
+ }
60356
+
60357
+ let inpCellClasses = this.cellSettings.querySelector('.input-cell-classes');
60358
+ inpCellClasses.value = '';
60359
+ const classes = cell.getAttribute('data-class');
60360
+ inpCellClasses.value = classes;
59609
60361
  }
59610
60362
 
59611
60363
  realtimeVisibility(cell) {
@@ -59743,9 +60495,15 @@ class ColumnTool {
59743
60495
  inpImageHorSlider.value = 50;
59744
60496
  inpImageVertSlider.value = 60;
59745
60497
  inpImageScaleSlider.value = 0;
60498
+
60499
+ if (elm.classList.contains('cell-active') || elm.classList.contains('is-row-overlay')) {
60500
+ inpImageHorSlider.value = 0;
60501
+ inpImageVertSlider.value = 0;
60502
+ }
60503
+
59746
60504
  elm.style.backgroundPositionX = '';
59747
60505
  elm.style.backgroundPositionY = '';
59748
- elm.style.backgroundSize = ''; // Clean unused
60506
+ elm.style.backgroundSize = 'cover'; // Clean unused
59749
60507
 
59750
60508
  elm.style.left = '';
59751
60509
  elm.style.top = '';
@@ -60257,7 +61015,7 @@ class ColumnTool {
60257
61015
 
60258
61016
  }
60259
61017
 
60260
- const dom$f = new Dom();
61018
+ const dom$h = new Dom();
60261
61019
 
60262
61020
  class ELementStyleEditor {
60263
61021
  constructor(builder) {
@@ -60290,21 +61048,21 @@ class ELementStyleEditor {
60290
61048
  </div>
60291
61049
  </div>
60292
61050
  `;
60293
- dom$f.appendHtml(builderStuff, html);
61051
+ dom$h.appendHtml(builderStuff, html);
60294
61052
  modalStyles = builderStuff.querySelector('.editstyles');
60295
61053
  let btn = modalStyles.querySelector('.is-modal-close');
60296
- dom$f.addEventListener(btn, 'click', () => {
60297
- dom$f.removeClass(modalStyles, 'active');
61054
+ dom$h.addEventListener(btn, 'click', () => {
61055
+ dom$h.removeClass(modalStyles, 'active');
60298
61056
  var panel = this.builderStuff.querySelector('.is-side.elementstyles'); // if all close
60299
61057
 
60300
- if (!dom$f.hasClass(panel, 'active')) {
61058
+ if (!dom$h.hasClass(panel, 'active')) {
60301
61059
  let elms = document.querySelectorAll('[data-saveforundo]');
60302
61060
  Array.prototype.forEach.call(elms, elm => {
60303
61061
  elm.removeAttribute('data-saveforundo');
60304
61062
  });
60305
61063
  elms = document.querySelectorAll('.elm-inspected');
60306
61064
  Array.prototype.forEach.call(elms, elm => {
60307
- dom$f.removeClass(elm, 'elm-inspected');
61065
+ dom$h.removeClass(elm, 'elm-inspected');
60308
61066
  });
60309
61067
  }
60310
61068
  });
@@ -60315,29 +61073,29 @@ class ELementStyleEditor {
60315
61073
 
60316
61074
  let bElmActive = false;
60317
61075
 
60318
- if (dom$f.hasClass(elm, 'elm-active')) {
61076
+ if (dom$h.hasClass(elm, 'elm-active')) {
60319
61077
  bElmActive = true;
60320
61078
  }
60321
61079
 
60322
61080
  let bCellActive = false;
60323
61081
 
60324
- if (dom$f.hasClass(elm, 'elm-active')) {
61082
+ if (dom$h.hasClass(elm, 'elm-active')) {
60325
61083
  bCellActive = true;
60326
61084
  }
60327
61085
 
60328
61086
  let bRowActive = false;
60329
61087
 
60330
- if (dom$f.hasClass(elm, 'row-active')) {
61088
+ if (dom$h.hasClass(elm, 'row-active')) {
60331
61089
  bRowActive = true;
60332
61090
  }
60333
61091
 
60334
61092
  elm.setAttribute('class', val); //update
60335
61093
  //builder classes
60336
61094
 
60337
- if (bElmActive) dom$f.addClass(elm, 'elm-active');
60338
- if (bCellActive) dom$f.addClass(elm, 'cell-active');
60339
- if (bRowActive) dom$f.addClass(elm, 'row-active');
60340
- dom$f.addClass(elm, 'elm-inspected'); //Trigger Change event
61095
+ if (bElmActive) dom$h.addClass(elm, 'elm-active');
61096
+ if (bCellActive) dom$h.addClass(elm, 'cell-active');
61097
+ if (bRowActive) dom$h.addClass(elm, 'row-active');
61098
+ dom$h.addClass(elm, 'elm-inspected'); //Trigger Change event
60341
61099
 
60342
61100
  this.builder.opts.onChange();
60343
61101
  });
@@ -60353,10 +61111,10 @@ class ELementStyleEditor {
60353
61111
  }
60354
61112
 
60355
61113
  toggleStyleEditor() {
60356
- if (!dom$f.hasClass(this.modalStyles, 'active')) {
60357
- dom$f.addClass(this.modalStyles, 'active');
61114
+ if (!dom$h.hasClass(this.modalStyles, 'active')) {
61115
+ dom$h.addClass(this.modalStyles, 'active');
60358
61116
  } else {
60359
- dom$f.removeClass(this.modalStyles, 'active');
61117
+ dom$h.removeClass(this.modalStyles, 'active');
60360
61118
  }
60361
61119
  }
60362
61120
 
@@ -60377,9 +61135,9 @@ class ELementStyleEditor {
60377
61135
 
60378
61136
  }
60379
61137
 
60380
- const dom$e = new Dom();
61138
+ const dom$g = new Dom();
60381
61139
 
60382
- class ElementBoxStyles {
61140
+ class ElementGeneralStyles {
60383
61141
  constructor(builder) {
60384
61142
  this.builder = builder;
60385
61143
  const util = this.builder.util;
@@ -60387,120 +61145,66 @@ class ElementBoxStyles {
60387
61145
  this.util = util;
60388
61146
  this.builderStuff = builderStuff;
60389
61147
  const elementStyleEditor = new ELementStyleEditor(builder);
60390
- let panelStuff = builderStuff.querySelector('#divElementBox');
61148
+ let panelStuff = builderStuff.querySelector('#divElementGeneral');
60391
61149
  this.panelStuff = panelStuff;
60392
61150
  const html = `
60393
- <div class="is-settings">
60394
- <div class="is-label">${util.out('Background Color')}:</div>
61151
+ <div class="is-settings" style="width: 100%">
61152
+ <div class="is-label" style="margin:0 0 3px">${util.out('Background Color')}:</div>
60395
61153
  <div>
60396
61154
  <button title="${util.out('Background Color')}" class="input-elm-bgcolor is-btn-color" style="margin-right:15px"></button>
60397
61155
  <button title="${util.out('Gradient')}" class="input-elm-gradient classic" data-value="+"> ${util.out('Gradient')} </button>
60398
61156
  </div>
60399
61157
  </div>
60400
61158
 
60401
- <div style="margin-top: 25px;font-weight:bold;width:100%;">${util.out('Dimension')}</div>
60402
-
60403
- <div class="is-settings" style="width:110px">
60404
- <div><label for="inpElmWidth">${util.out('Width')}:</label></div>
60405
- <div style="display:flex">
60406
- <input type="text" id="inpElmWidth" value="" style="width:45px"/>
60407
- <select id="inpElmWidthUnit"">
60408
- <option value="px">px</option>
60409
- <option value="em">em</option>
60410
- <option value="vw">vw</option>
60411
- <option value="vh">vh</option>
60412
- <option value="%">%</option>
60413
- </select>
60414
- </div>
60415
- </div>
60416
- <div class="is-settings" style="width:110px;">
60417
- <div><label for="inpElmHeight">${util.out('Height')}:</label></div>
60418
- <div style="display:flex">
60419
- <input type="text" id="inpElmHeight" value="" style="width:45px"/>
60420
- <select id="inpElmHeightUnit"">
60421
- <option value="px">px</option>
60422
- <option value="em">em</option>
60423
- <option value="vw">vw</option>
60424
- <option value="vh">vh</option>
60425
- <option value="%">%</option>
60426
- </select>
60427
- </div>
60428
- </div>
60429
- <div class="is-settings" style="width:110px;">
60430
- <div><label for="inpElmMaxWidth">${util.out('Max Width')}:</label></div>
60431
- <div style="display:flex">
60432
- <input type="text" id="inpElmMaxWidth" value="" style="width:45px"/>
60433
- <select id="inpElmMaxWidthUnit"">
60434
- <option value="px">px</option>
60435
- <option value="em">em</option>
60436
- <option value="vw">vw</option>
60437
- <option value="vh">vh</option>
60438
- <option value="%">%</option>
60439
- </select>
60440
- </div>
60441
- </div>
60442
- <div class="is-settings" style="width:110px;">
60443
- <div><label for="inpElmMaxHeight">${util.out('Max Height')}:</label></div>
60444
- <div style="display:flex">
60445
- <input type="text" id="inpElmMaxHeight" value="" style="width:45px"/>
60446
- <select id="inpElmMaxHeightUnit"">
60447
- <option value="px">px</option>
60448
- <option value="em">em</option>
60449
- <option value="vw">vw</option>
60450
- <option value="vh">vh</option>
60451
- <option value="%">%</option>
60452
- </select>
60453
- </div>
60454
- </div>
60455
- <div class="is-settings" style="width:110px;">
60456
- <div><label for="inpElmMinWidth">${util.out('Min Width')}:</label></div>
60457
- <div style="display:flex">
60458
- <input type="text" id="inpElmMinWidth" value="" style="width:45px"/>
60459
- <select id="inpElmMinWidthUnit"">
60460
- <option value="px">px</option>
60461
- <option value="em">em</option>
60462
- <option value="vw">vw</option>
60463
- <option value="vh">vh</option>
60464
- <option value="%">%</option>
60465
- </select>
61159
+ <div style="padding-top:20px;padding-bottom: 3px;">${util.out('Background Image')}:</div>
61160
+ <div class="is-settings" style="width: 100%">
61161
+ <div class="elm-bgimage-preview"></div>
61162
+ <div style="display: flex">
61163
+ <button title="${util.out('Image')}" class="input-elm-bgimage">
61164
+ <svg class="is-icon-flex"><use xlink:href="#ion-image"></use></svg>
61165
+ <span style="margin-left: 5px;">${util.out('Image')}</span>
61166
+ </button>
61167
+ <button title="${util.out('Select')}" class="input-select"><svg class="is-icon-flex"><use xlink:href="#ion-more"></use></svg></button>
61168
+ <button title="${util.out('Remove')}" class="input-elm-bgremove"><svg class="is-icon-flex" style="width:11px;height:11px;"><use xlink:href="#icon-clean"></use></svg></button>
61169
+ <button title="${util.out('Adjust')}" class="input-elm-bgimageadjust" style="width:40px"><svg class="is-icon-flex" style="width:13px;height:13px;flex:none"><use xlink:href="#ion-wrench"></use></svg></button>
60466
61170
  </div>
60467
61171
  </div>
60468
- <div class="is-settings" style="width:110px;">
60469
- <div><label for="inpElmMinHeight">${util.out('Min Height')}:</label></div>
60470
- <div style="display:flex">
60471
- <input type="text" id="inpElmMinHeight" value="" style="width:45px"/>
60472
- <select id="inpElmMinHeightUnit"">
60473
- <option value="px">px</option>
60474
- <option value="em">em</option>
60475
- <option value="vw">vw</option>
60476
- <option value="vh">vh</option>
60477
- <option value="%">%</option>
60478
- </select>
60479
- </div>
61172
+
61173
+ <div class="is-settings" style="padding-top:20px;width: 100%">
61174
+ <label class="label-elm-grayscale label-checkbox" for="chkElmGrayscale"><input id="chkElmGrayscale" class="chk-elm-grayscale" type="checkbox" /> ${util.out('Grayscale')}</label>
60480
61175
  </div>
60481
-
60482
- <div class="is-settings" style="width:110px;">
60483
- <div>${util.out('Overflow x')}:</div>
60484
- <div>
60485
- <select id="inpElmOverflowX"">
60486
- <option value=""></option>
60487
- <option value="auto">Auto</option>
60488
- <option value="hidden">Hidden</option>
60489
- </select>
61176
+
61177
+ <div class="is-separator" style="margin-top:28px;margin-bottom:5px;"></div>
61178
+
61179
+ <div class="is-settings" style="padding-top:0;margin-top:0;width: 100%">
61180
+ <div class="div-target" style="display: flex;justify-content: flex-end;padding: 5px 0 0;">
61181
+ <button title="${util.out('Desktop')}" class="input-device on" data-value="" style="width:40px;height:25px;">
61182
+ <svg class="is-icon-flex" style="width:16px;height:16px;flex:none"><use xlink:href="#icon-device-desktop"></use></svg>
61183
+ </button>
61184
+ <button title="${util.out('Tablet')}" class="input-device" data-value="sm" style="width:40px;height:25px;">
61185
+ <svg class="is-icon-flex" style="width:16px;height:16px;flex:none"><use xlink:href="#icon-device-tablet"></use></svg>
61186
+ </button>
61187
+ <button title="${util.out('Mobile')}" class="input-device" data-value="xs" style="width:40px;height:25px;">
61188
+ <svg class="is-icon-flex" style="width:13px;height:13px;flex:none"><use xlink:href="#icon-device-mobile"></use></svg>
61189
+ </button>
60490
61190
  </div>
60491
- </div>
60492
- <div class="is-settings" style="width:110px;">
60493
- <div>${util.out('Overflow y')}:</div>
60494
- <div>
60495
- <select id="inpElmOverflowY"">
60496
- <option value=""></option>
60497
- <option value="auto">Auto</option>
60498
- <option value="hidden">Hidden</option>
60499
- </select>
61191
+
61192
+ <div style="padding-top:0;padding-bottom:3px;">${util.out('Visibility')}:</div>
61193
+ <div class="div-visibility" style="display:flex;">
61194
+ <button title="${util.out('Visible')}" class="input-visible on" data-value="sm" style="width:100px;height:34px;">
61195
+ <svg class="is-icon-flex" style="width:16px;height:16px"><use xlink:href="#icon-eye"></use></svg>
61196
+ <span>${util.out('Visible')}</span>
61197
+ </button>
61198
+ <button title="${util.out('Hidden')}" class="input-hidden" data-value="xs" style="width:100px;height:34px;">
61199
+ <svg class="is-icon-flex" style="width:16px;height:16px"><use xlink:href="#icon-eye-off"></use></svg>
61200
+ <span>${util.out('Hidden')}</span>
61201
+ </button>
60500
61202
  </div>
60501
61203
  </div>
61204
+
61205
+
60502
61206
  `;
60503
- dom$e.appendHtml(panelStuff, html); // Background color
61207
+ dom$g.appendHtml(panelStuff, html); // Background color
60504
61208
 
60505
61209
  let btnElmBgColor = panelStuff.querySelector('.input-elm-bgcolor');
60506
61210
  btnElmBgColor.addEventListener('click', e => {
@@ -60543,7 +61247,331 @@ class ElementBoxStyles {
60543
61247
  btnElmGradient.focus();
60544
61248
  });
60545
61249
  btnElmGradient.setAttribute('data-focus', true);
60546
- }); // Others
61250
+ }); // Elm Background Image
61251
+
61252
+ const btnElmBgImage = panelStuff.querySelector('.input-elm-bgimage');
61253
+ if (btnElmBgImage) dom$g.addEventListener(btnElmBgImage, 'click', () => {
61254
+ const elm = this.builder.inspectedElement; //Get current value
61255
+
61256
+ let imgUrl = '';
61257
+
61258
+ if (elm.style.backgroundImage) {
61259
+ if (elm.style.backgroundImage.indexOf('url(') !== -1) {
61260
+ imgUrl = elm.style.backgroundImage.slice(4, -1).replace(/["']/g, '');
61261
+ }
61262
+ }
61263
+
61264
+ this.builder.colTool.openImagePicker(imgUrl, url => {
61265
+ this.builder.uo.saveForUndo();
61266
+ const elm = this.builder.inspectedElement;
61267
+ this.builder.uo.saveForUndo();
61268
+ elm.style.backgroundImage = `url("${url}")`;
61269
+ elm.style.backgroundSize = 'cover';
61270
+ elm.style.backgroundRepeat = 'no-repeat';
61271
+ const div = panelStuff.querySelector('.elm-bgimage-preview');
61272
+ const btnImageAdjust = this.panelStuff.querySelector('.input-elm-bgimageadjust');
61273
+ const btnImageRemove = this.panelStuff.querySelector('.input-elm-bgremove');
61274
+ btnImageAdjust.style.display = 'none';
61275
+ btnImageRemove.style.display = 'none';
61276
+
61277
+ if (url !== '') {
61278
+ div.innerHTML = `<img src="${url}">`;
61279
+ btnImageAdjust.style.display = 'flex';
61280
+ btnImageRemove.style.display = 'flex';
61281
+ } else {
61282
+ div.innerHTML = '';
61283
+ }
61284
+
61285
+ elementStyleEditor.refresh(); //Trigger Change event
61286
+
61287
+ this.builder.opts.onChange();
61288
+ }, btnElmBgImage);
61289
+ }); // Elm Background Image Adjust
61290
+
61291
+ const btnImageAdjust = panelStuff.querySelector('.input-elm-bgimageadjust');
61292
+ if (btnImageAdjust) dom$g.addEventListener(btnImageAdjust, 'click', () => {
61293
+ const elm = this.builder.inspectedElement;
61294
+ this.builder.colTool.openImageAdjust(elm, btnImageAdjust);
61295
+ });
61296
+ const btnImageRemove = panelStuff.querySelector('.input-elm-bgremove');
61297
+ if (btnImageRemove) dom$g.addEventListener(btnImageRemove, 'click', () => {
61298
+ const elm = this.builder.inspectedElement;
61299
+ this.builder.uo.saveForUndo();
61300
+ elm.style.backgroundImage = '';
61301
+ elm.style.backgroundSize = '';
61302
+ elm.style.backgroundRepeat = '';
61303
+ elm.style.backgroundPosition = '';
61304
+ const div = panelStuff.querySelector('.elm-bgimage-preview');
61305
+ const btnImageAdjust = this.panelStuff.querySelector('.input-elm-bgimageadjust');
61306
+ const btnImageRemove = this.panelStuff.querySelector('.input-elm-bgremove');
61307
+ btnImageAdjust.style.display = 'none';
61308
+ btnImageRemove.style.display = 'none';
61309
+ div.innerHTML = '';
61310
+ elementStyleEditor.refresh(); //Trigger Change event
61311
+
61312
+ this.builder.opts.onChange();
61313
+ }); // Elm Background Image Open Asset
61314
+
61315
+ if (!this.builder.opts.onImageSelectClick && this.builder.opts.imageselect === '') {
61316
+ panelStuff.querySelector('.input-select').style.display = 'none';
61317
+ }
61318
+
61319
+ const btnElmBgImageOpenAsset = panelStuff.querySelector('.input-select');
61320
+ this.builder.renderSelectAsset(btnElmBgImageOpenAsset, 'image', url => {
61321
+ const elm = this.builder.inspectedElement;
61322
+ this.builder.uo.saveForUndo();
61323
+ elm.style.backgroundImage = `url("${url}")`;
61324
+ elm.style.backgroundSize = 'cover';
61325
+ elm.style.backgroundRepeat = 'no-repeat';
61326
+ const div = panelStuff.querySelector('.elm-bgimage-preview');
61327
+ const btnImageAdjust = this.panelStuff.querySelector('.input-elm-bgimageadjust');
61328
+ const btnImageRemove = this.panelStuff.querySelector('.input-elm-bgremove');
61329
+ btnImageAdjust.style.display = 'none';
61330
+ btnImageRemove.style.display = 'none';
61331
+
61332
+ if (url !== '') {
61333
+ div.innerHTML = `<img src="${url}">`;
61334
+ btnImageAdjust.style.display = 'flex';
61335
+ btnImageRemove.style.display = 'flex';
61336
+ } else {
61337
+ div.innerHTML = '';
61338
+ }
61339
+
61340
+ elementStyleEditor.refresh(); //Trigger Change event
61341
+
61342
+ this.builder.opts.onChange();
61343
+ });
61344
+ const chkElmGrayscale = panelStuff.querySelector('.chk-elm-grayscale');
61345
+ chkElmGrayscale.addEventListener('click', () => {
61346
+ this.builder.uo.saveForUndo();
61347
+ const elm = this.builder.inspectedElement;
61348
+
61349
+ if (chkElmGrayscale.checked) {
61350
+ elm.style.filter = 'grayscale(1)';
61351
+ } else {
61352
+ if (elm.style.filter) {
61353
+ elm.style.filter = elm.style.filter.replace('grayscale(1)', '');
61354
+ }
61355
+ }
61356
+
61357
+ elementStyleEditor.refresh(); //Trigger Change event
61358
+
61359
+ this.builder.opts.onChange();
61360
+ }); // Responsive Visibility
61361
+
61362
+ let btns = panelStuff.querySelectorAll('.input-device');
61363
+ btns.forEach(btn => {
61364
+ btn.addEventListener('click', () => {
61365
+ const elm = this.builder.inspectedElement;
61366
+ let elms = panelStuff.querySelectorAll('.input-device');
61367
+ elms.forEach(elm => {
61368
+ elm.classList.remove('on');
61369
+ });
61370
+ btn.classList.add('on');
61371
+ this.realtimeVisibility(elm);
61372
+ });
61373
+ });
61374
+ let btnVisible = panelStuff.querySelector('.input-visible');
61375
+ let btnHidden = panelStuff.querySelector('.input-hidden');
61376
+ btnVisible.addEventListener('click', () => {
61377
+ const elm = this.builder.inspectedElement;
61378
+ elm.classList.remove('hideonmobile');
61379
+ let divTarget = panelStuff.querySelector('.div-target');
61380
+ let target = this.builder.responsive.readTarget(divTarget);
61381
+
61382
+ if (target === 'xs') {
61383
+ elm.classList.remove('xs-hidden');
61384
+ } else if (target === 'sm') {
61385
+ elm.classList.remove('sm-hidden');
61386
+ } else if (target === '') {
61387
+ elm.classList.remove('desktop-hidden');
61388
+ }
61389
+
61390
+ btnVisible.classList.add('on');
61391
+ btnHidden.classList.remove('on');
61392
+ });
61393
+ btnHidden.addEventListener('click', () => {
61394
+ const elm = this.builder.inspectedElement;
61395
+ elm.classList.remove('hideonmobile');
61396
+ let divTarget = panelStuff.querySelector('.div-target');
61397
+ let target = this.builder.responsive.readTarget(divTarget);
61398
+
61399
+ if (target === 'xs') {
61400
+ elm.classList.add('xs-hidden');
61401
+ } else if (target === 'sm') {
61402
+ elm.classList.add('sm-hidden');
61403
+ } else if (target === '') {
61404
+ elm.classList.add('desktop-hidden');
61405
+ }
61406
+
61407
+ btnVisible.classList.remove('on');
61408
+ btnHidden.classList.add('on');
61409
+ });
61410
+ }
61411
+
61412
+ readElementStyles(elm) {
61413
+ let panelStuff = this.panelStuff; // Background color
61414
+
61415
+ let s = elm.style.backgroundColor;
61416
+ let btn = panelStuff.querySelector('.input-elm-bgcolor');
61417
+ if (s) btn.style.backgroundColor = s;else btn.style.backgroundColor = 'transparent'; // Background image
61418
+
61419
+ let imgUrl = '';
61420
+ const div = panelStuff.querySelector('.elm-bgimage-preview');
61421
+ const btnImageAdjust = panelStuff.querySelector('.input-elm-bgimageadjust');
61422
+ btnImageAdjust.style.display = 'none';
61423
+ const btnImageRemove = panelStuff.querySelector('.input-elm-bgremove');
61424
+ btnImageRemove.style.display = 'none';
61425
+
61426
+ if (elm.style.backgroundImage) {
61427
+ if (elm.style.backgroundImage.indexOf('url(') !== -1) {
61428
+ imgUrl = elm.style.backgroundImage.slice(4, -1).replace(/["']/g, '');
61429
+ div.innerHTML = `<img src="${imgUrl}">`;
61430
+ btnImageAdjust.style.display = 'flex';
61431
+ btnImageRemove.style.display = 'flex';
61432
+ } else {
61433
+ div.innerHTML = '';
61434
+ }
61435
+ } else {
61436
+ div.innerHTML = '';
61437
+ }
61438
+
61439
+ const chkRowGrayscale = panelStuff.querySelector('.chk-elm-grayscale');
61440
+ chkRowGrayscale.checked = false;
61441
+
61442
+ if (elm.style.filter) {
61443
+ if (elm.style.filter.indexOf('grayscale') !== -1) {
61444
+ chkRowGrayscale.checked = true;
61445
+ }
61446
+ }
61447
+
61448
+ this.realtimeVisibility(elm);
61449
+ }
61450
+
61451
+ realtimeVisibility(row) {
61452
+ let divTarget = this.panelStuff.querySelector('.div-target');
61453
+ let divVisibility = this.panelStuff.querySelector('.div-visibility');
61454
+ let target = this.builder.responsive.readTarget(divTarget);
61455
+ let valVisibility = this.builder.responsive.getVisibility(row, target);
61456
+ this.builder.responsive.showVisibility(divVisibility, valVisibility);
61457
+ }
61458
+
61459
+ }
61460
+
61461
+ const dom$f = new Dom();
61462
+
61463
+ class ElementBoxStyles {
61464
+ constructor(builder) {
61465
+ this.builder = builder;
61466
+ const util = this.builder.util;
61467
+ const builderStuff = this.builder.builderStuff;
61468
+ this.util = util;
61469
+ this.builderStuff = builderStuff;
61470
+ const elementStyleEditor = new ELementStyleEditor(builder);
61471
+ let panelStuff = builderStuff.querySelector('#divElementBox');
61472
+ this.panelStuff = panelStuff;
61473
+ const html = `
61474
+ <div class="is-settings" style="width:110px">
61475
+ <div><label for="inpElmWidth">${util.out('Width')}:</label></div>
61476
+ <div style="display:flex">
61477
+ <input type="text" id="inpElmWidth" value="" style="width:45px"/>
61478
+ <select id="inpElmWidthUnit"">
61479
+ <option value="px">px</option>
61480
+ <option value="em">em</option>
61481
+ <option value="vw">vw</option>
61482
+ <option value="vh">vh</option>
61483
+ <option value="%">%</option>
61484
+ </select>
61485
+ </div>
61486
+ </div>
61487
+ <div class="is-settings" style="width:110px;">
61488
+ <div><label for="inpElmHeight">${util.out('Height')}:</label></div>
61489
+ <div style="display:flex">
61490
+ <input type="text" id="inpElmHeight" value="" style="width:45px"/>
61491
+ <select id="inpElmHeightUnit"">
61492
+ <option value="px">px</option>
61493
+ <option value="em">em</option>
61494
+ <option value="vw">vw</option>
61495
+ <option value="vh">vh</option>
61496
+ <option value="%">%</option>
61497
+ </select>
61498
+ </div>
61499
+ </div>
61500
+ <div class="is-settings" style="width:110px;">
61501
+ <div><label for="inpElmMaxWidth">${util.out('Max Width')}:</label></div>
61502
+ <div style="display:flex">
61503
+ <input type="text" id="inpElmMaxWidth" value="" style="width:45px"/>
61504
+ <select id="inpElmMaxWidthUnit"">
61505
+ <option value="px">px</option>
61506
+ <option value="em">em</option>
61507
+ <option value="vw">vw</option>
61508
+ <option value="vh">vh</option>
61509
+ <option value="%">%</option>
61510
+ </select>
61511
+ </div>
61512
+ </div>
61513
+ <div class="is-settings" style="width:110px;">
61514
+ <div><label for="inpElmMaxHeight">${util.out('Max Height')}:</label></div>
61515
+ <div style="display:flex">
61516
+ <input type="text" id="inpElmMaxHeight" value="" style="width:45px"/>
61517
+ <select id="inpElmMaxHeightUnit"">
61518
+ <option value="px">px</option>
61519
+ <option value="em">em</option>
61520
+ <option value="vw">vw</option>
61521
+ <option value="vh">vh</option>
61522
+ <option value="%">%</option>
61523
+ </select>
61524
+ </div>
61525
+ </div>
61526
+ <div class="is-settings" style="width:110px;">
61527
+ <div><label for="inpElmMinWidth">${util.out('Min Width')}:</label></div>
61528
+ <div style="display:flex">
61529
+ <input type="text" id="inpElmMinWidth" value="" style="width:45px"/>
61530
+ <select id="inpElmMinWidthUnit"">
61531
+ <option value="px">px</option>
61532
+ <option value="em">em</option>
61533
+ <option value="vw">vw</option>
61534
+ <option value="vh">vh</option>
61535
+ <option value="%">%</option>
61536
+ </select>
61537
+ </div>
61538
+ </div>
61539
+ <div class="is-settings" style="width:110px;">
61540
+ <div><label for="inpElmMinHeight">${util.out('Min Height')}:</label></div>
61541
+ <div style="display:flex">
61542
+ <input type="text" id="inpElmMinHeight" value="" style="width:45px"/>
61543
+ <select id="inpElmMinHeightUnit"">
61544
+ <option value="px">px</option>
61545
+ <option value="em">em</option>
61546
+ <option value="vw">vw</option>
61547
+ <option value="vh">vh</option>
61548
+ <option value="%">%</option>
61549
+ </select>
61550
+ </div>
61551
+ </div>
61552
+
61553
+ <div class="is-settings" style="width:110px;">
61554
+ <div>${util.out('Overflow x')}:</div>
61555
+ <div>
61556
+ <select id="inpElmOverflowX"">
61557
+ <option value=""></option>
61558
+ <option value="auto">Auto</option>
61559
+ <option value="hidden">Hidden</option>
61560
+ </select>
61561
+ </div>
61562
+ </div>
61563
+ <div class="is-settings" style="width:110px;">
61564
+ <div>${util.out('Overflow y')}:</div>
61565
+ <div>
61566
+ <select id="inpElmOverflowY"">
61567
+ <option value=""></option>
61568
+ <option value="auto">Auto</option>
61569
+ <option value="hidden">Hidden</option>
61570
+ </select>
61571
+ </div>
61572
+ </div>
61573
+ `;
61574
+ dom$f.appendHtml(panelStuff, html); // Others
60547
61575
 
60548
61576
  let inpElmMaxWidth = panelStuff.querySelector('#inpElmMaxWidth');
60549
61577
  inpElmMaxWidth.addEventListener('click', () => {
@@ -60784,17 +61812,13 @@ class ElementBoxStyles {
60784
61812
  }
60785
61813
 
60786
61814
  readElementStyles(elm) {
60787
- let panelStuff = this.panelStuff; // Background color
60788
-
60789
- let s = elm.style.backgroundColor;
60790
- let btn = panelStuff.querySelector('.input-elm-bgcolor');
60791
- if (s) btn.style.backgroundColor = s;else btn.style.backgroundColor = 'transparent'; // Max Width
61815
+ let panelStuff = this.panelStuff; // Max Width
60792
61816
 
60793
61817
  const inpElmMaxWidth = panelStuff.querySelector('#inpElmMaxWidth');
60794
61818
  const inpElmMaxWidthUnit = panelStuff.querySelector('#inpElmMaxWidthUnit');
60795
61819
  inpElmMaxWidth.value = '';
60796
61820
  inpElmMaxWidthUnit.value = 'px';
60797
- s = elm.style.maxWidth;
61821
+ let s = elm.style.maxWidth;
60798
61822
  let nMaxWidth = parseInt(s);
60799
61823
 
60800
61824
  if (!isNaN(nMaxWidth)) {
@@ -60903,7 +61927,7 @@ class ElementBoxStyles {
60903
61927
 
60904
61928
  }
60905
61929
 
60906
- const dom$d = new Dom();
61930
+ const dom$e = new Dom();
60907
61931
 
60908
61932
  class ElementSpacingStyles {
60909
61933
  constructor(builder) {
@@ -61045,7 +62069,7 @@ class ElementSpacingStyles {
61045
62069
  </div>
61046
62070
  </div>
61047
62071
  `;
61048
- dom$d.appendHtml(panelStuff, html); // Margin
62072
+ dom$e.appendHtml(panelStuff, html); // Margin
61049
62073
 
61050
62074
  let inpElmMarginLeft = panelStuff.querySelector('#inpElmMarginLeft');
61051
62075
  inpElmMarginLeft.addEventListener('click', () => {
@@ -61363,9 +62387,9 @@ class ElementSpacingStyles {
61363
62387
  let elm = this.builder.inspectedElement;
61364
62388
 
61365
62389
  if (chkResetMarginLeft.checked) {
61366
- dom$d.addClass(elm, 'margin-left-1024-reset');
62390
+ dom$e.addClass(elm, 'margin-left-1024-reset');
61367
62391
  } else {
61368
- dom$d.removeClass(elm, 'margin-left-1024-reset');
62392
+ dom$e.removeClass(elm, 'margin-left-1024-reset');
61369
62393
  }
61370
62394
 
61371
62395
  elementStyleEditor.refresh(); //Trigger Change event
@@ -61378,9 +62402,9 @@ class ElementSpacingStyles {
61378
62402
  let elm = this.builder.inspectedElement;
61379
62403
 
61380
62404
  if (chkResetMarginRight.checked) {
61381
- dom$d.addClass(elm, 'margin-right-1024-reset');
62405
+ dom$e.addClass(elm, 'margin-right-1024-reset');
61382
62406
  } else {
61383
- dom$d.removeClass(elm, 'margin-right-1024-reset');
62407
+ dom$e.removeClass(elm, 'margin-right-1024-reset');
61384
62408
  }
61385
62409
 
61386
62410
  elementStyleEditor.refresh(); //Trigger Change event
@@ -61543,13 +62567,13 @@ class ElementSpacingStyles {
61543
62567
  } // Responsive Positioning
61544
62568
 
61545
62569
 
61546
- if (dom$d.hasClass(elm, 'margin-left-1024-reset')) {
62570
+ if (dom$e.hasClass(elm, 'margin-left-1024-reset')) {
61547
62571
  panelStuff.querySelector('#chkResetMarginLeft').checked = true;
61548
62572
  } else {
61549
62573
  panelStuff.querySelector('#chkResetMarginLeft').checked = false;
61550
62574
  }
61551
62575
 
61552
- if (dom$d.hasClass(elm, 'margin-right-1024-reset')) {
62576
+ if (dom$e.hasClass(elm, 'margin-right-1024-reset')) {
61553
62577
  panelStuff.querySelector('#chkResetMarginRight').checked = true;
61554
62578
  } else {
61555
62579
  panelStuff.querySelector('#chkResetMarginRight').checked = false;
@@ -61558,7 +62582,7 @@ class ElementSpacingStyles {
61558
62582
 
61559
62583
  }
61560
62584
 
61561
- const dom$c = new Dom();
62585
+ const dom$d = new Dom();
61562
62586
 
61563
62587
  class ElementBorderStyles {
61564
62588
  constructor(builder) {
@@ -61679,7 +62703,7 @@ class ElementBorderStyles {
61679
62703
  </div>
61680
62704
  </div>
61681
62705
  `;
61682
- dom$c.appendHtml(panelStuff, html); // Border color
62706
+ dom$d.appendHtml(panelStuff, html); // Border color
61683
62707
 
61684
62708
  let btnElmBorderColor = panelStuff.querySelector('.input-elm-bordercolor');
61685
62709
  btnElmBorderColor.addEventListener('click', e => {
@@ -62300,7 +63324,7 @@ class ElementBorderStyles {
62300
63324
 
62301
63325
  }
62302
63326
 
62303
- const dom$b = new Dom();
63327
+ const dom$c = new Dom();
62304
63328
 
62305
63329
  class ElementTextStyles {
62306
63330
  constructor(builder) {
@@ -62442,7 +63466,7 @@ class ElementTextStyles {
62442
63466
  </div>
62443
63467
  </div>
62444
63468
  `;
62445
- dom$b.appendHtml(panelStuff, html);
63469
+ dom$c.appendHtml(panelStuff, html);
62446
63470
  const htmlmodal = `
62447
63471
  <div class="is-modal pickfontfamily" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
62448
63472
  <div class="is-modal-content">
@@ -62453,7 +63477,7 @@ class ElementTextStyles {
62453
63477
  </div>
62454
63478
  </div>
62455
63479
  `;
62456
- dom$b.appendHtml(builderStuff, htmlmodal);
63480
+ dom$c.appendHtml(builderStuff, htmlmodal);
62457
63481
  const fontModal = builderStuff.querySelector('.is-modal.pickfontfamily'); // Text color
62458
63482
 
62459
63483
  let btnElmTextColor = panelStuff.querySelector('.input-elm-color');
@@ -62559,8 +63583,8 @@ class ElementTextStyles {
62559
63583
  const arrSizes = this.builder.opts.fontSizeClassValues;
62560
63584
 
62561
63585
  for (var i = 0; i <= arrSizes.length - 1; i++) {
62562
- if (dom$b.hasClass(elm, 'size-' + arrSizes[i])) {
62563
- dom$b.removeClass(elm, 'size-' + arrSizes[i]);
63586
+ if (dom$c.hasClass(elm, 'size-' + arrSizes[i])) {
63587
+ dom$c.removeClass(elm, 'size-' + arrSizes[i]);
62564
63588
  }
62565
63589
  }
62566
63590
 
@@ -62710,9 +63734,9 @@ class ElementTextStyles {
62710
63734
  f = f.trim().toLowerCase();
62711
63735
 
62712
63736
  if (f === fontname && f !== '') {
62713
- dom$b.addClass(e, 'on');
63737
+ dom$c.addClass(e, 'on');
62714
63738
  } else {
62715
- dom$b.removeClass(e, 'on');
63739
+ dom$c.removeClass(e, 'on');
62716
63740
  }
62717
63741
  }); //Select active font
62718
63742
 
@@ -62727,7 +63751,7 @@ class ElementTextStyles {
62727
63751
  } else {
62728
63752
  if (iframeDocument) {
62729
63753
  [].forEach.call(iframeDocument.querySelectorAll('#divFontList > li'), e => {
62730
- dom$b.removeClass(e, 'on');
63754
+ dom$c.removeClass(e, 'on');
62731
63755
  });
62732
63756
  }
62733
63757
  }
@@ -62849,7 +63873,7 @@ class ElementTextStyles {
62849
63873
 
62850
63874
  }
62851
63875
 
62852
- const dom$a = new Dom();
63876
+ const dom$b = new Dom();
62853
63877
 
62854
63878
  class ElementCornerStyles {
62855
63879
  constructor(builder) {
@@ -62901,7 +63925,7 @@ class ElementCornerStyles {
62901
63925
  </div>
62902
63926
  </div>
62903
63927
  `;
62904
- dom$a.appendHtml(panelStuff, html);
63928
+ dom$b.appendHtml(panelStuff, html);
62905
63929
  const inpElmBorderRadius = panelStuff.querySelector('#inpElmBorderRadius');
62906
63930
  inpElmBorderRadius.addEventListener('click', () => {
62907
63931
  this.builder.uo.saveForUndo();
@@ -63044,7 +64068,7 @@ class ElementCornerStyles {
63044
64068
 
63045
64069
  }
63046
64070
 
63047
- const dom$9 = new Dom();
64071
+ const dom$a = new Dom();
63048
64072
 
63049
64073
  class ElementShadowStyles {
63050
64074
  constructor(builder) {
@@ -63120,7 +64144,7 @@ class ElementShadowStyles {
63120
64144
  </div>
63121
64145
  </div>
63122
64146
  `;
63123
- dom$9.appendHtml(panelStuff, html); // Shadow color
64147
+ dom$a.appendHtml(panelStuff, html); // Shadow color
63124
64148
 
63125
64149
  let btnElmShadowColor = panelStuff.querySelector('.input-elm-shadowcolor');
63126
64150
  btnElmShadowColor.addEventListener('click', () => {
@@ -63311,7 +64335,7 @@ class ElementShadowStyles {
63311
64335
 
63312
64336
  }
63313
64337
 
63314
- const dom$8 = new Dom();
64338
+ const dom$9 = new Dom();
63315
64339
 
63316
64340
  class ElementDisplayStyles {
63317
64341
  constructor(builder) {
@@ -63409,7 +64433,7 @@ class ElementDisplayStyles {
63409
64433
  </div>
63410
64434
  </div>
63411
64435
  `;
63412
- dom$8.appendHtml(panelStuff, html);
64436
+ dom$9.appendHtml(panelStuff, html);
63413
64437
  const inpElmDisplay = panelStuff.querySelector('#inpElmDisplay');
63414
64438
  inpElmDisplay.addEventListener('change', () => {
63415
64439
  this.builder.uo.saveForUndo();
@@ -63502,7 +64526,7 @@ class ElementDisplayStyles {
63502
64526
 
63503
64527
  }
63504
64528
 
63505
- const dom$7 = new Dom();
64529
+ const dom$8 = new Dom();
63506
64530
 
63507
64531
  class ElementPositionStyles {
63508
64532
  constructor(builder) {
@@ -63597,7 +64621,7 @@ class ElementPositionStyles {
63597
64621
  </div>
63598
64622
  </div>
63599
64623
  `;
63600
- dom$7.appendHtml(panelStuff, html);
64624
+ dom$8.appendHtml(panelStuff, html);
63601
64625
  const inpElmPosition = panelStuff.querySelector('#inpElmPosition');
63602
64626
  inpElmPosition.addEventListener('change', () => {
63603
64627
  this.builder.uo.saveForUndo();
@@ -63841,7 +64865,7 @@ class ElementPositionStyles {
63841
64865
 
63842
64866
  }
63843
64867
 
63844
- const dom$6 = new Dom();
64868
+ const dom$7 = new Dom();
63845
64869
 
63846
64870
  class ElementEffectStyles {
63847
64871
  constructor(builder) {
@@ -63921,7 +64945,7 @@ class ElementEffectStyles {
63921
64945
  </div>
63922
64946
  </div>
63923
64947
  `;
63924
- dom$6.appendHtml(panelStuff, html);
64948
+ dom$7.appendHtml(panelStuff, html);
63925
64949
  const inpElmOpacity = panelStuff.querySelector('#inpElmOpacity');
63926
64950
  inpElmOpacity.addEventListener('click', () => {
63927
64951
  this.builder.uo.saveForUndo();
@@ -64396,7 +65420,7 @@ class ElementEffectStyles {
64396
65420
 
64397
65421
  }
64398
65422
 
64399
- const dom$5 = new Dom();
65423
+ const dom$6 = new Dom();
64400
65424
 
64401
65425
  class ElementAttributeStyles {
64402
65426
  constructor(builder) {
@@ -64472,7 +65496,7 @@ class ElementAttributeStyles {
64472
65496
  </div>
64473
65497
  </div>
64474
65498
  `;
64475
- dom$5.appendHtml(panelStuff, html);
65499
+ dom$6.appendHtml(panelStuff, html);
64476
65500
  let inps = panelStuff.querySelectorAll('#inpElmAttr1,#inpElmAttr2,#inpElmAttr3,#inpElmAttr4,#inpElmAttr5,#inpElmAttrVal1,#inpElmAttrVal2,#inpElmAttrVal3,#inpElmAttrVal4,#inpElmAttrVal5');
64477
65501
  Array.prototype.forEach.call(inps, inp => {
64478
65502
  inp.addEventListener('click', () => {
@@ -64540,6 +65564,93 @@ class ElementAttributeStyles {
64540
65564
 
64541
65565
  }
64542
65566
 
65567
+ const dom$5 = new Dom();
65568
+
65569
+ class ElementMoreStyles {
65570
+ constructor(builder) {
65571
+ this.builder = builder;
65572
+ const util = this.builder.util;
65573
+ const builderStuff = this.builder.builderStuff;
65574
+ this.util = util;
65575
+ this.builderStuff = builderStuff;
65576
+ let panelStuff = builderStuff.querySelector('#divElementMore');
65577
+ this.panelStuff = panelStuff;
65578
+ const html = `
65579
+
65580
+ <div class="is-settings" style="width:100%;margin-bottom:9px;">
65581
+ <div>${util.out('Add Element ID')}:</div>
65582
+ <div>
65583
+ <input type="text" id="inpElmId" value="" style="width:100%"/>
65584
+ </div>
65585
+ </div>
65586
+
65587
+ <div class="is-settings" style="width:100%;margin-bottom:9px;">
65588
+ <div>${util.out('Add Css Classes')}:</div>
65589
+ <div>
65590
+ <input type="text" id="inpElmCssClasses" value="" style="width:100%"/>
65591
+ </div>
65592
+ </div>
65593
+
65594
+ `;
65595
+ dom$5.appendHtml(panelStuff, html);
65596
+ const inpElmId = panelStuff.querySelector('#inpElmId');
65597
+ inpElmId.addEventListener('change', () => {
65598
+ let elm = this.builder.inspectedElement;
65599
+ this.builder.uo.saveForUndo();
65600
+
65601
+ if (inpElmId.value !== '') {
65602
+ elm.setAttribute('id', inpElmId.value);
65603
+ } else {
65604
+ elm.removeAttribute('id');
65605
+ } //Trigger Change event
65606
+
65607
+
65608
+ this.builder.opts.onChange();
65609
+ });
65610
+ const inpElmCssClasses = panelStuff.querySelector('#inpElmCssClasses');
65611
+ inpElmCssClasses.addEventListener('change', () => {
65612
+ let elm = this.builder.inspectedElement;
65613
+ this.builder.uo.saveForUndo();
65614
+ let arrCurrentClasses = [];
65615
+ let currentClasses = elm.getAttribute('data-class');
65616
+ if (currentClasses) arrCurrentClasses = currentClasses.split(' ');
65617
+ let arrNewClasses = [];
65618
+ let newClasses = inpElmCssClasses.value;
65619
+ arrNewClasses = newClasses.split(' ');
65620
+ arrCurrentClasses.forEach(item => {
65621
+ if (!arrNewClasses.includes(item)) {
65622
+ elm.classList.remove(item);
65623
+ }
65624
+ });
65625
+ arrNewClasses.forEach(item => {
65626
+ if (item !== '') elm.classList.add(item);
65627
+ }); // save
65628
+
65629
+ elm.setAttribute('data-class', newClasses);
65630
+ if (elm.getAttribute('data-class') === '') elm.removeAttribute('data-class'); //Trigger Change event
65631
+
65632
+ this.builder.opts.onChange();
65633
+ });
65634
+ }
65635
+
65636
+ readElementStyles(elm) {
65637
+ let panelStuff = this.panelStuff;
65638
+ const inpElmId = panelStuff.querySelector('#inpElmId');
65639
+ inpElmId.value = '';
65640
+ const rowId = elm.getAttribute('id');
65641
+
65642
+ if (rowId) {
65643
+ inpElmId.value = rowId;
65644
+ }
65645
+
65646
+ const inpElmCssClasses = panelStuff.querySelector('#inpElmCssClasses');
65647
+ inpElmCssClasses.value = '';
65648
+ const classes = elm.getAttribute('data-class');
65649
+ inpElmCssClasses.value = classes;
65650
+ }
65651
+
65652
+ }
65653
+
64543
65654
  const dom$4 = new Dom();
64544
65655
 
64545
65656
  class ElementAnimationStyles {
@@ -64816,24 +65927,29 @@ class ElementPanel {
64816
65927
  <div style="width:100%;height:100%;overflow-y:auto;overflow-x:hidden;position:absolute;top:0px;left:0px;box-sizing:border-box;border-top:100px solid transparent;padding:0px;">
64817
65928
 
64818
65929
  <div class="is-tabs" data-group="element" style="padding-right:0;padding-bottom:0;">
64819
- <a title="${util.out('Box')}" id="tabElementBox" href="" data-content="divElementBox" class="active">${util.out('Box')}</a>
65930
+ <a title="${util.out('General')}" id="tabElementGeneral" href="" data-content="divElementGeneral" class="active">${util.out('General')}</a>
65931
+ <a title="${util.out('Box')}" id="tabElementBox" href="" data-content="divElementBox">${util.out('Box')}</a>
64820
65932
  <a title="${util.out('Spacing')}" id="tabElementSpacing" href="" data-content="divElementSpacing">${util.out('Spacing')}</a>
64821
- <a title="${util.out('Border')}" id="tabElementBorder" href="" data-content="divElementBorder">${util.out('Border')}</a>
64822
65933
  <a title="${util.out('Text')}" id="tabElementText" href="" data-content="divElementText">${util.out('Text')}</a>
64823
- <a title="${util.out('More')}" id="tabElementMore" data-menu="divElementMore" href=""><svg class="is-icon-flex" style="width:15px;height:15px;"><use xlink:href="#ion-more"></use></svg></a>
65934
+ <a title="${util.out('More')}" id="tabElementMore" data-menu="divElementMoreItems" href=""><svg class="is-icon-flex" style="width:15px;height:15px;"><use xlink:href="#ion-more"></use></svg></a>
64824
65935
  </div>
64825
65936
 
64826
- <ul id="divElementMore" class="is-tabs-more" data-group="element" tabindex="-1" aria-modal="true" aria-hidden="true">
65937
+ <ul id="divElementMoreItems" style="top: 50px;left: 140px;" class="is-tabs-more" data-group="element" tabindex="-1" aria-modal="true" aria-hidden="true">
65938
+ <li title="${util.out('Border')}" id="tabElementBorder" data-content="divElementBorder" tabindex="0">${util.out('Border')}</li>
64827
65939
  <li title="${util.out('Corners')}" id="tabElementCorner" data-content="divElementCorner" tabindex="0">${util.out('Corners')}</li>
64828
65940
  <li title="${util.out('Shadow')}" id="tabElementShadow" data-content="divElementShadow" tabindex="0">${util.out('Shadow')}</li>
64829
65941
  <li title="${util.out('Display')}" id="tabElementDisplay" data-content="divElementDisplay" tabindex="0">${util.out('Display')}</li>
64830
65942
  <li title="${util.out('Position')}" id="tabElementPosition" data-content="divElementPosition" tabindex="0">${util.out('Position')}</li>
64831
65943
  <li title="${util.out('Effects')}" id="tabElementEffect" data-content="divElementEffect" tabindex="0">${util.out('Effects')}</li>
64832
- <li title="${util.out('Attributes')}" id="tabElementAttribute" data-content="divElementAttribute" tabindex="0">${util.out('Attributes')}</li>
65944
+ <li style="display:none" title="${util.out('Attributes')}" id="tabElementAttribute" data-content="divElementAttribute" tabindex="0">${util.out('Attributes')}</li>
64833
65945
  ${this.builder.opts.elementAnimate === true ? `<li title="${util.out('Animation')}" id="tabElementAnimation" data-content="divElementAnimation" tabindex="0">${util.out('Animation')}</li>` : ''}
65946
+ <li title="${util.out('More')}" id="tabElementMore" data-content="divElementMore" tabindex="0">${util.out('More')}</li>
64834
65947
  </ul>
64835
65948
 
64836
- <div id="divElementBox" class="is-tab-content active" tabindex="-1" data-group="element" style="display:flex;flex-flow:wrap;padding:12px 20px;">
65949
+ <div id="divElementGeneral" class="is-tab-content active" tabindex="-1" data-group="element" style="display:flex;flex-flow:wrap;padding:12px 20px;">
65950
+ </div>
65951
+
65952
+ <div id="divElementBox" class="is-tab-content active" tabindex="-1" data-group="element" style="display:none;flex-flow:wrap;padding:12px 20px;">
64837
65953
  </div>
64838
65954
 
64839
65955
  <div id="divElementSpacing" class="is-tab-content" tabindex="-1" data-group="element" style="display:none;flex-flow:wrap;padding:12px 20px;">
@@ -64866,6 +65982,8 @@ class ElementPanel {
64866
65982
  <div id="divElementAnimation" class="is-tab-content" tabindex="-1" data-group="element" style="display:none;flex-flow:wrap;padding:12px 20px;">
64867
65983
  </div>
64868
65984
 
65985
+ <div id="divElementMore" class="is-tab-content" tabindex="-1" data-group="element" style="display:none;flex-flow:wrap;padding:12px 20px;">
65986
+ </div>
64869
65987
  </div>
64870
65988
  </div>
64871
65989
  `;
@@ -64885,6 +66003,8 @@ class ElementPanel {
64885
66003
  this.panel = panel;
64886
66004
  const elementBoxStyles = new ElementBoxStyles(builder);
64887
66005
  this.elementBoxStyles = elementBoxStyles;
66006
+ const elementGeneralStyles = new ElementGeneralStyles(builder);
66007
+ this.elementGeneralStyles = elementGeneralStyles;
64888
66008
  const elementSpacingStyles = new ElementSpacingStyles(builder);
64889
66009
  this.elementSpacingStyles = elementSpacingStyles;
64890
66010
  const elementBorderStyles = new ElementBorderStyles(builder);
@@ -64903,6 +66023,8 @@ class ElementPanel {
64903
66023
  this.elementEffectStyles = elementEffectStyles;
64904
66024
  const elementAttributeStyles = new ElementAttributeStyles(builder);
64905
66025
  this.elementAttributeStyles = elementAttributeStyles;
66026
+ const elementMoreStyles = new ElementMoreStyles(builder);
66027
+ this.elementMoreStyles = elementMoreStyles;
64906
66028
  const elementAnimationStyles = new ElementAnimationStyles(builder);
64907
66029
  this.elementAnimationStyles = elementAnimationStyles;
64908
66030
  }
@@ -64914,6 +66036,7 @@ class ElementPanel {
64914
66036
  }
64915
66037
 
64916
66038
  inspect(elm) {
66039
+ this.elementGeneralStyles.readElementStyles(elm);
64917
66040
  this.elementBoxStyles.readElementStyles(elm);
64918
66041
  this.elementSpacingStyles.readElementStyles(elm);
64919
66042
  this.elementBorderStyles.readElementStyles(elm);
@@ -64924,6 +66047,7 @@ class ElementPanel {
64924
66047
  this.elementPositionStyles.readElementStyles(elm);
64925
66048
  this.elementEffectStyles.readElementStyles(elm);
64926
66049
  this.elementAttributeStyles.readElementStyles(elm);
66050
+ this.elementMoreStyles.readElementStyles(elm);
64927
66051
  this.elementAnimationStyles.readElementStyles(elm);
64928
66052
  let panel = this.panel;
64929
66053
  let elms = this.builder.doc.querySelectorAll('[data-saveforundo]');
@@ -75467,39 +76591,6 @@ class ContentBuilder {
75467
76591
  </div>
75468
76592
  </div>
75469
76593
  `,
75470
- pageTemplate: `<!DOCTYPE html>
75471
- <html lang="en">
75472
- <head>
75473
- <meta charset="utf-8">
75474
- <title>Page</title>
75475
- <meta name="viewport" content="width=device-width, initial-scale=1">
75476
- <meta name="description" content="">
75477
- <link rel="shortcut icon" href="#" />
75478
-
75479
- <link href="[%PATH%]/assets/minimalist-blocks/content.css" rel="stylesheet" type="text/css" />
75480
-
75481
- <link href="[%PATH%]/assets/scripts/glide/css/glide.core.css" rel="stylesheet" type="text/css" />
75482
- <link href="[%PATH%]/assets/scripts/glide/css/glide.theme.css" rel="stylesheet" type="text/css" />
75483
- <script src="[%PATH%]/assets/scripts/glide/glide.js" type="text/javascript"></script>
75484
-
75485
- <style>
75486
- .container {
75487
- margin: 150px auto 0;
75488
- max-width: 800px;
75489
- width: 100%;
75490
- padding: 0 20px;
75491
- box-sizing: border-box;
75492
- }
75493
- </style>
75494
- </head>
75495
- <body>
75496
-
75497
- <div class="container">
75498
- [%CONTENT%]
75499
- </div>
75500
-
75501
- </body>
75502
- </html>`,
75503
76594
 
75504
76595
  /*
75505
76596
  onZoomStart: () => {
@@ -76015,6 +77106,11 @@ class ContentBuilder {
76015
77106
  const util = new Util(this); // General utilities
76016
77107
 
76017
77108
  this.util = util;
77109
+
77110
+ if (!this.pageTemplate) {
77111
+ this.pageTemplate = util.getPageTemplate(this.framework);
77112
+ }
77113
+
76018
77114
  const responsive = new Responsive(this); // General utilities
76019
77115
 
76020
77116
  this.responsive = responsive; // Content stuff