@innovastudio/contentbox 1.6.5 → 1.6.6

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.
@@ -15320,6 +15320,56 @@ class Text {
15320
15320
  });
15321
15321
  }
15322
15322
 
15323
+ setFlexGrow(isGrow) {
15324
+ let elm = this.getElm();
15325
+ if (!elm) return;
15326
+
15327
+ if (isGrow) {
15328
+ let activeColumn = this.builder.controlpanel.activeColumn;
15329
+ activeColumn.classList.add('flex');
15330
+ activeColumn.classList.add('flex-col');
15331
+ elm.classList.add('grow');
15332
+ } else {
15333
+ elm.classList.remove('grow');
15334
+ }
15335
+
15336
+ elm.style.flexGrow = ''; // clean inline style
15337
+ }
15338
+
15339
+ justifyColumn(val) {
15340
+ let activeColumn = this.builder.controlpanel.activeColumn;
15341
+ activeColumn.classList.add('flex');
15342
+ activeColumn.classList.add('flex-col');
15343
+ activeColumn.classList.remove('justify-start');
15344
+ activeColumn.classList.remove('justify-center');
15345
+ activeColumn.classList.remove('justify-end');
15346
+ activeColumn.classList.remove('justify-between');
15347
+
15348
+ if (val === 'justify-start') {
15349
+ activeColumn.classList.add('justify-start');
15350
+ } else if (val === 'justify-center') {
15351
+ activeColumn.classList.add('justify-center');
15352
+ } else if (val === 'justify-end') {
15353
+ activeColumn.classList.add('justify-end');
15354
+ } else if (val === 'justify-between') {
15355
+ activeColumn.classList.add('justify-between');
15356
+ } else if (val === '') {
15357
+ activeColumn.classList.remove('flex');
15358
+ activeColumn.classList.remove('flex-col');
15359
+ /*
15360
+ if(activeColumn.classList.contains('items-center') ||
15361
+ activeColumn.classList.contains('items-end')) {
15362
+ // Do Nothing
15363
+ } else {
15364
+ activeColumn.classList.remove('flex');
15365
+ activeColumn.classList.remove('flex-col');
15366
+ }
15367
+ */
15368
+ }
15369
+
15370
+ activeColumn.querySelectorAll('.grow').forEach(elm => elm.classList.remove('grow'));
15371
+ }
15372
+
15323
15373
  setTextColor(color) {
15324
15374
  let elm = this.getElm();
15325
15375
  const text = this.getSelectedText();
@@ -17029,6 +17079,31 @@ class PanelText {
17029
17079
 
17030
17080
  </div>
17031
17081
 
17082
+
17083
+ <button class="accordion-item" aria-expanded="false" aria-controls="contenttext0">
17084
+ ${out('Placement')}
17085
+ <span><svg><use xlink:href="#icon-chevron-down"></use></svg></span>
17086
+ </button>
17087
+ <div class="accordion-content" id="contenttext0" aria-hidden="true">
17088
+
17089
+ <div class="subpanel">
17090
+ <div class="group mt-2">
17091
+ <button title="${out('Top')}" data-justify="justify-start"><svg><use xlink:href="#icon-align-box-top"></use></svg></button>
17092
+ <button title="${out('Middle')}" data-justify="justify-center"><svg><use xlink:href="#icon-align-box-middle"></use></svg></button>
17093
+ <button title="${out('Bottom')}" data-justify="justify-end"><svg><use xlink:href="#icon-align-box-bottom"></use></svg></button>
17094
+ <button title="${out('Full')}" data-justify="justify-between"><svg><use xlink:href="#icon-align-box-stretch"></use></svg></button>
17095
+ <button title="${out('Clear')}" data-justify=""><svg><use xlink:href="#icon-eraser"></use></svg></button>
17096
+ </div>
17097
+
17098
+ <label class="label checkbox flexgrow mt-2">
17099
+ <input type="checkbox" class="chk-flexgrow" />
17100
+ <span>${out('Grow')}</span>
17101
+ </label>
17102
+ </div>
17103
+
17104
+ </div>
17105
+
17106
+
17032
17107
  <button class="accordion-item" aria-expanded="false" aria-controls="contenttext1">
17033
17108
  ${out('Font Settings')}
17034
17109
  <span><svg><use xlink:href="#icon-chevron-down"></use></svg></span>
@@ -17045,6 +17120,7 @@ class PanelText {
17045
17120
 
17046
17121
  <div class="label changedevice">
17047
17122
  <span>${out('Font Size')}:</span>
17123
+ <span class="val-fontsize" style="flex-grow:1;margin-left:9px"></span>
17048
17124
  <button title="${out('Change Device')}" class="btn-device"><svg style="width:13px;height:13px;"><use xlink:href="#icon-devices"></use></svg></button>
17049
17125
  </div>
17050
17126
 
@@ -17055,7 +17131,10 @@ class PanelText {
17055
17131
  <button title="${out('Clear')}" data-value=""><svg><use xlink:href="#icon-eraser"></use></svg></button>
17056
17132
  </div>
17057
17133
 
17058
- <div class="label">${out('Font Weight')}:</div>
17134
+ <div class="label flex flex-row">
17135
+ <span>${out('Font Weight')}:</span>
17136
+ <span class="val-fontweight" style="flex-grow:1;margin-left:9px"></span>
17137
+ </div>
17059
17138
 
17060
17139
  <div class="group fontweight">
17061
17140
  <button title="100" data-value="100">100</button>
@@ -17087,7 +17166,10 @@ class PanelText {
17087
17166
  </select>
17088
17167
  </div>
17089
17168
 
17090
- <div class="label">${out('Line Spacing')}:</div>
17169
+ <div class="label flex flex-row">
17170
+ <span>${out('Line Spacing')}:</span>
17171
+ <span class="val-linespacing" style="flex-grow:1;margin-left:9px"></span>
17172
+ </div>
17091
17173
 
17092
17174
  <div class="group linespacing">
17093
17175
 
@@ -17098,7 +17180,10 @@ class PanelText {
17098
17180
  <button title="${out('Clear')}" data-value=""><svg><use xlink:href="#icon-eraser"></use></svg></button>
17099
17181
  </div>
17100
17182
 
17101
- <div class="label">${out('Letter Spacing')}:</div>
17183
+ <div class="label flex flex-row">
17184
+ <span>${out('Letter Spacing')}:</span>
17185
+ <span class="val-letterspacing" style="flex-grow:1;margin-left:9px"></span>
17186
+ </div>
17102
17187
 
17103
17188
  <div class="group letterspacing">
17104
17189
  <button title="1" data-value="1">1</button>
@@ -17384,6 +17469,27 @@ class PanelText {
17384
17469
  const btnImage = panel.querySelector('.btn-image');
17385
17470
  btnImage.addEventListener('click', () => {
17386
17471
  this.builder.editor.rte.insertImage();
17472
+ }); // Flex
17473
+
17474
+ const btnJustify = panel.querySelectorAll('[data-justify]');
17475
+ btnJustify.forEach(btn => {
17476
+ btn.addEventListener('click', () => {
17477
+ this.saveForUndo();
17478
+ const val = btn.getAttribute('data-justify');
17479
+ this.text.justifyColumn(val);
17480
+ this.getState(); // this.builder.onChange();
17481
+
17482
+ this.builder.editor.onChange(); // this is because the changed element is in ContentBuilder scope
17483
+ });
17484
+ });
17485
+ const chkFlexGrow = panel.querySelector('.chk-flexgrow');
17486
+ chkFlexGrow.addEventListener('click', () => {
17487
+ this.saveForUndo();
17488
+ let isFlexGrow = chkFlexGrow.checked;
17489
+ this.text.setFlexGrow(isFlexGrow);
17490
+ this.getState(); // this.builder.onChange();
17491
+
17492
+ this.builder.editor.onChange(); // this is because the changed element is in ContentBuilder scope
17387
17493
  });
17388
17494
  }
17389
17495
 
@@ -17439,6 +17545,23 @@ class PanelText {
17439
17545
  } else {
17440
17546
  btnBackColorPick.classList.remove('nocolor');
17441
17547
  btnBackColorPick.parentNode.style.marginTop = '';
17548
+ } // Flex
17549
+
17550
+
17551
+ const chkFlexGrow = this.panel.querySelector('.chk-flexgrow');
17552
+ chkFlexGrow.checked = false;
17553
+ if (activeElement.closest('.grow')) chkFlexGrow.checked = true;
17554
+ this.panel.querySelectorAll('[data-justify]').forEach(elm => elm.classList.remove('on'));
17555
+ let activeColumn = this.builder.controlpanel.activeColumn;
17556
+
17557
+ if (activeColumn.classList.contains('justify-start')) {
17558
+ this.panel.querySelector('[data-justify=justify-start]').classList.add('on');
17559
+ } else if (activeColumn.classList.contains('justify-center')) {
17560
+ this.panel.querySelector('[data-justify=justify-center]').classList.add('on');
17561
+ } else if (activeColumn.classList.contains('justify-end')) {
17562
+ this.panel.querySelector('[data-justify=justify-end]').classList.add('on');
17563
+ } else if (activeColumn.classList.contains('justify-between')) {
17564
+ this.panel.querySelector('[data-justify=justify-between]').classList.add('on');
17442
17565
  }
17443
17566
 
17444
17567
  if (!document.body.classList.contains('controlpanel')) return;
@@ -17533,11 +17656,14 @@ class PanelText {
17533
17656
  // Font Size
17534
17657
  const arrSizes = this.builder.fontSizeClassValues;
17535
17658
  this.panel.querySelectorAll('.group.fontsizes button').forEach(btn => btn.classList.remove('on'));
17659
+ const spanFontSize = this.panel.querySelector('.val-fontsize');
17660
+ spanFontSize.innerText = '';
17536
17661
  let found = false; // Check if size is defined for specific screenMode
17537
17662
 
17538
17663
  if (prefix !== '') for (let i = 0; i <= arrSizes.length - 1; i++) {
17539
17664
  if (container.classList.contains(prefix + 'size-' + arrSizes[i])) {
17540
17665
  found = true;
17666
+ spanFontSize.innerText = arrSizes[i];
17541
17667
  const btns = this.panel.querySelectorAll('.group.fontsizes button');
17542
17668
  btns.forEach(btn => {
17543
17669
  let num = btn.getAttribute('data-value');
@@ -17554,12 +17680,14 @@ class PanelText {
17554
17680
  for (let i = 0; i <= arrSizes.length - 1; i++) {
17555
17681
  if (container.classList.contains('size-' + arrSizes[i])) {
17556
17682
  // Get current class
17683
+ spanFontSize.innerText = arrSizes[i];
17557
17684
  const btns = this.panel.querySelectorAll('.group.fontsizes button');
17558
17685
  btns.forEach(btn => {
17559
17686
  let num = btn.getAttribute('data-value');
17560
17687
 
17561
17688
  if (parseInt(num) === arrSizes[i]) {
17562
17689
  btn.classList.add('on');
17690
+ spanFontSize.innerText = num;
17563
17691
  }
17564
17692
  });
17565
17693
  }
@@ -17569,24 +17697,27 @@ class PanelText {
17569
17697
 
17570
17698
  let classes = this.builder.cssClasses.fontWeight;
17571
17699
  this.panel.querySelectorAll('.group.fontweight button').forEach(btn => btn.classList.remove('on'));
17700
+ const spanFontWeight = this.panel.querySelector('.val-fontweight');
17701
+ spanFontWeight.innerText = '';
17572
17702
 
17573
17703
  for (let i = 0; i < Object.keys(classes).length; i++) {
17574
17704
  let className = Object.values(classes)[i];
17575
17705
 
17576
17706
  if (container.classList.contains(className)) {
17707
+ let val;
17708
+ if (className === classes.thin) val = '100';
17709
+ if (className === classes.extralight) val = '200';
17710
+ if (className === classes.light) val = '300';
17711
+ if (className === classes.normal) val = '400';
17712
+ if (className === classes.medium) val = '500';
17713
+ if (className === classes.semibold) val = '600';
17714
+ if (className === classes.bold) val = '700';
17715
+ if (className === classes.extrabold) val = '800';
17716
+ if (className === classes.black) val = '900';
17717
+ if (val) spanFontWeight.innerText = val;
17577
17718
  const btns = this.panel.querySelectorAll('.group.fontweight button');
17578
17719
  Array.prototype.forEach.call(btns, btn => {
17579
17720
  let num = btn.getAttribute('data-value');
17580
- let val;
17581
- if (className === classes.thin) val = '100';
17582
- if (className === classes.extralight) val = '200';
17583
- if (className === classes.light) val = '300';
17584
- if (className === classes.normal) val = '400';
17585
- if (className === classes.medium) val = '500';
17586
- if (className === classes.semibold) val = '600';
17587
- if (className === classes.bold) val = '700';
17588
- if (className === classes.extrabold) val = '800';
17589
- if (className === classes.black) val = '900';
17590
17721
 
17591
17722
  if (num === val) {
17592
17723
  btn.classList.add('on');
@@ -17598,6 +17729,10 @@ class PanelText {
17598
17729
 
17599
17730
  this.panel.querySelectorAll('.group.linespacing button').forEach(btn => btn.classList.remove('on'));
17600
17731
  this.panel.querySelectorAll('.group.letterspacing button').forEach(btn => btn.classList.remove('on'));
17732
+ const spanLineSpacing = this.panel.querySelector('.val-linespacing');
17733
+ spanLineSpacing.innerText = '';
17734
+ const spanLetterSpacing = this.panel.querySelector('.val-letterspacing');
17735
+ spanLetterSpacing.innerText = '';
17601
17736
  const block = this.text.getParentBlock(container);
17602
17737
 
17603
17738
  if (block) {
@@ -17608,25 +17743,40 @@ class PanelText {
17608
17743
  let className = Object.values(classes)[i];
17609
17744
 
17610
17745
  if (block.classList.contains(className)) {
17746
+ let val;
17747
+ if (className === classes.leading_5) val = '0.5';
17748
+ if (className === classes.leading_6) val = '0.6';
17749
+ if (className === classes.leading_7) val = '0.7';
17750
+ if (className === classes.leading_8) val = '0.8';
17751
+ if (className === classes.leading_9) val = '0.9';
17752
+ if (className === classes.leading_10) val = '1';
17753
+ if (className === classes.leading_11) val = '1.1';
17754
+ if (className === classes.leading_12) val = '1.2';
17755
+ if (className === classes.leading_125) val = '1.25';
17756
+ if (className === classes.leading_13) val = '1.3';
17757
+ if (className === classes.leading_1375) val = '1.375';
17758
+ if (className === classes.leading_14) val = '1.4';
17759
+ if (className === classes.leading_15) val = '1.5';
17760
+ if (className === classes.leading_16) val = '1.6';
17761
+ if (className === classes.leading_1625) val = '1.625';
17762
+ if (className === classes.leading_17) val = '1.7';
17763
+ if (className === classes.leading_18) val = '1.8';
17764
+ if (className === classes.leading_19) val = '1.9';
17765
+ if (className === classes.leading_20) val = '2';
17766
+ if (className === classes.leading_21) val = '2.1';
17767
+ if (className === classes.leading_22) val = '2.2';
17768
+ if (className === classes.leading_23) val = '2.3';
17769
+ if (className === classes.leading_24) val = '2.4';
17770
+ if (className === classes.leading_25) val = '2.5';
17771
+ if (className === classes.leading_26) val = '2.6';
17772
+ if (className === classes.leading_27) val = '2.7';
17773
+ if (className === classes.leading_28) val = '2.8';
17774
+ if (className === classes.leading_29) val = '2.9';
17775
+ if (className === classes.leading_30) val = '3';
17776
+ if (val) spanLineSpacing.innerText = val;
17611
17777
  const btns = this.panel.querySelectorAll('.group.linespacing button');
17612
- Array.prototype.forEach.call(btns, btn => {
17778
+ btns.forEach(btn => {
17613
17779
  let num = btn.getAttribute('data-value');
17614
- let val;
17615
- if (className === classes.leading_8) val = '0.8';
17616
- if (className === classes.leading_9) val = '0.9';
17617
- if (className === classes.leading_10) val = '1';
17618
- if (className === classes.leading_11) val = '1.1';
17619
- if (className === classes.leading_12) val = '1.2';
17620
- if (className === classes.leading_13) val = '1.3';
17621
- if (className === classes.leading_14) val = '1.4';
17622
- if (className === classes.leading_15) val = '1.5';
17623
- if (className === classes.leading_16) val = '1.6';
17624
- if (className === classes.leading_17) val = '1.7';
17625
- if (className === classes.leading_18) val = '1.8';
17626
- if (className === classes.leading_19) val = '1.9';
17627
- if (className === classes.leading_20) val = '2';
17628
- if (className === classes.leading_21) val = '2.1';
17629
- if (className === classes.leading_22) val = '2.2';
17630
17780
 
17631
17781
  if (num === val) {
17632
17782
  btn.classList.add('on');
@@ -17642,12 +17792,36 @@ class PanelText {
17642
17792
  let className = Object.values(classes)[i];
17643
17793
 
17644
17794
  if (block.classList.contains(className)) {
17795
+ let val;
17796
+ if (className === classes.tracking__100) val = '-4';
17797
+ if (className === classes.tracking__075) val = '-3';
17798
+ if (className === classes.tracking__050) val = '-2';
17799
+ if (className === classes.tracking__025) val = '-1';
17800
+ if (className === classes.tracking_000) val = '';
17801
+ if (className === classes.tracking_025) val = '1';
17802
+ if (className === classes.tracking_050) val = '2';
17803
+ if (className === classes.tracking_075) val = '3';
17804
+ if (className === classes.tracking_100) val = '4';
17805
+ if (className === classes.tracking_125) val = '5';
17806
+ if (className === classes.tracking_150) val = '6';
17807
+ if (className === classes.tracking_175) val = '7';
17808
+ if (className === classes.tracking_200) val = '8';
17809
+ if (className === classes.tracking_225) val = '9';
17810
+ if (className === classes.tracking_250) val = '10';
17811
+ if (className === classes.tracking_275) val = '11';
17812
+ if (className === classes.tracking_300) val = '12';
17813
+ if (className === classes.tracking_325) val = '13';
17814
+ if (className === classes.tracking_350) val = '14';
17815
+ if (className === classes.tracking_375) val = '15';
17816
+ if (className === classes.tracking_400) val = '16';
17817
+ if (className === classes.tracking_425) val = '17';
17818
+ if (className === classes.tracking_450) val = '18';
17819
+ if (className === classes.tracking_475) val = '19';
17820
+ if (className === classes.tracking_500) val = '20';
17821
+ if (val) spanLetterSpacing.innerText = val;
17645
17822
  const btns = this.panel.querySelectorAll('.group.letterspacing button');
17646
- Array.prototype.forEach.call(btns, btn => {
17823
+ btns.forEach(btn => {
17647
17824
  let num = btn.getAttribute('data-value');
17648
- let val;
17649
- if (className === classes.tracking_025) val = '1';
17650
- if (className === classes.tracking_050) val = '2';
17651
17825
 
17652
17826
  if (num === val) {
17653
17827
  btn.classList.add('on');
@@ -19026,13 +19200,13 @@ class PanelBox {
19026
19200
  <button title="${out('Clear')}" class="btn-clear"><svg><use xlink:href="#icon-eraser"></use></svg></button>
19027
19201
  </div>
19028
19202
 
19029
- <label class="label checkbox grayscale mt-2">
19203
+ <label class="label checkbox grayscale mt-2" style="margin-bottom:16px">
19030
19204
  <input type="checkbox" class="chk-grayscale" />
19031
19205
  <span>${out('Grayscale')}</span>
19032
19206
  </label>
19033
19207
 
19034
19208
  <div class="defaulttextcolor">
19035
- <div class="label mt-5">${out('Text Color')}:</div>
19209
+ <div class="label mt-3">${out('Text Color')}:</div>
19036
19210
  <div class="group textcolor">
19037
19211
  <button title="${out('Light')}" data-textcolor="light">${out('Light')}</button>
19038
19212
  <button title="${out('Dark')}" data-textcolor="dark">${out('Dark')}</button>
@@ -19047,6 +19221,10 @@ class PanelBox {
19047
19221
  </button>
19048
19222
  </div>
19049
19223
 
19224
+ <div class="group editspacing mt-2">
19225
+ <button title="${out('Spacing')}" class="btn-spacing" data-value="">${out('Spacing')}</button>
19226
+ </div>
19227
+
19050
19228
  </div>
19051
19229
 
19052
19230
  <button class="accordion-item btn-accordion-content" aria-expanded="false" aria-controls="boxcontent1">
@@ -19141,10 +19319,6 @@ class PanelBox {
19141
19319
  </div>
19142
19320
  </div>
19143
19321
 
19144
- <div class="group editspacing">
19145
- <button title="${out('Spacing')}" class="btn-spacing" data-value="">${out('Spacing')}</button>
19146
- </div>
19147
-
19148
19322
  </div>
19149
19323
 
19150
19324
  </div>
@@ -20971,18 +21145,48 @@ class PanelColumn {
20971
21145
  <span>${out('Grayscale')}</span>
20972
21146
  </label>
20973
21147
 
21148
+ <div class="group editspacing mt-3">
21149
+ <button title="${out('Spacing')}" class="btn-spacing" data-value="">${out('Spacing')}</button>
21150
+ </div>
21151
+
20974
21152
  </div>
20975
21153
 
20976
21154
  <button class="accordion-item btn-accordion-content" aria-expanded="false" aria-controls="columncontent1">
20977
- ${out('Content')}
21155
+ ${out('Placement')}
20978
21156
  <span><svg><use xlink:href="#icon-chevron-down"></use></svg></span>
20979
21157
  </button>
20980
21158
  <div class="accordion-content" id="columncontent1" aria-hidden="true">
20981
21159
 
20982
21160
  <div class="subpanel">
20983
- <div class="label mt-2">${out('Position')}:</div>
20984
21161
 
20985
- <div class="flex" style="justify-content:flex-start;align-items: flex-end;">
21162
+ <div class="label mt-2">${out('Vertical')}:</div>
21163
+ <div class="group flexjustify">
21164
+ <button title="${out('Top')}" data-justify="justify-start"><svg><use xlink:href="#icon-align-box-top"></use></svg></button>
21165
+ <button title="${out('Middle')}" data-justify="justify-center"><svg><use xlink:href="#icon-align-box-middle"></use></svg></button>
21166
+ <button title="${out('Bottom')}" data-justify="justify-end"><svg><use xlink:href="#icon-align-box-bottom"></use></svg></button>
21167
+ <button title="${out('Full')}" data-justify="justify-between"><svg><use xlink:href="#icon-align-box-stretch"></use></svg></button>
21168
+ <button title="${out('Clear')}" data-justify=""><svg><use xlink:href="#icon-eraser"></use></svg></button>
21169
+ </div>
21170
+
21171
+ <div class="label mt-2">${out('Horizontal')}:</div>
21172
+ <div class="group flexjustify" style="margin-right:13px">
21173
+ <button title="${out('Left')}" data-align="items-start"><svg><use xlink:href="#icon-align-box-left"></use></svg></button>
21174
+ <button title="${out('Center')}" data-align="items-center"><svg><use xlink:href="#icon-align-box-center"></use></svg></button>
21175
+ <button title="${out('Right')}" data-align="items-end"><svg><use xlink:href="#icon-align-box-right"></use></svg></button>
21176
+ <button title="${out('Clear')}" data-align=""><svg><use xlink:href="#icon-eraser"></use></svg></button>
21177
+ </div>
21178
+ <br>
21179
+ <div class="group clearflex mt-2">
21180
+ <button title="${out('Clear All')}" class="btn-clearflex">
21181
+ <svg><use xlink:href="#icon-eraser"></use></svg>
21182
+ <span>${out('Clear All')}</span>
21183
+ </button>
21184
+ </div>
21185
+
21186
+
21187
+ <div class="label mt-2" style="display:none">${out('Position')}:</div>
21188
+
21189
+ <div class="flex" style="justify-content:flex-start;align-items: flex-end;display:none">
20986
21190
  <div class="group contentposition mr-3">
20987
21191
  <div class="flex">
20988
21192
  <button title="${out('Top Left')}" data-content-pos="topleft">&#8598;</button>
@@ -21005,10 +21209,6 @@ class PanelColumn {
21005
21209
  <button title="${out('Clear')}" class="btn-clear" data-content-pos=""><svg><use xlink:href="#icon-eraser"></use></svg></button>
21006
21210
  </div>
21007
21211
  </div>
21008
-
21009
- <div class="group editspacing mt-3">
21010
- <button title="${out('Spacing')}" class="btn-spacing" data-value="">${out('Spacing')}</button>
21011
- </div>
21012
21212
  </div>
21013
21213
 
21014
21214
  </div>
@@ -21225,6 +21425,94 @@ class PanelColumn {
21225
21425
  btnTextColor.forEach(btn => btn.classList.remove('on'));
21226
21426
  if (s !== '') btn.classList.add('on');
21227
21427
  });
21428
+ }); // Flex
21429
+
21430
+ const btnJustify = panel.querySelectorAll('[data-justify]');
21431
+ btnJustify.forEach(btn => {
21432
+ btn.addEventListener('click', () => {
21433
+ this.builder.editor.saveForUndo();
21434
+ const s = btn.getAttribute('data-justify');
21435
+ let activeColumn = this.builder.controlpanel.activeColumn;
21436
+ activeColumn.classList.add('flex');
21437
+ activeColumn.classList.add('flex-col');
21438
+ activeColumn.classList.remove('justify-start');
21439
+ activeColumn.classList.remove('justify-center');
21440
+ activeColumn.classList.remove('justify-end');
21441
+ activeColumn.classList.remove('justify-between');
21442
+
21443
+ if (s === 'justify-start') {
21444
+ activeColumn.classList.add('justify-start');
21445
+ } else if (s === 'justify-center') {
21446
+ activeColumn.classList.add('justify-center');
21447
+ } else if (s === 'justify-end') {
21448
+ activeColumn.classList.add('justify-end');
21449
+ } else if (s === 'justify-between') {
21450
+ activeColumn.classList.add('justify-between');
21451
+ } else if (s === '') {
21452
+ if (activeColumn.classList.contains('items-center') || activeColumn.classList.contains('items-end')) ; else {
21453
+ activeColumn.classList.remove('flex');
21454
+ activeColumn.classList.remove('flex-col');
21455
+ }
21456
+ }
21457
+
21458
+ activeColumn.querySelectorAll('.grow').forEach(elm => elm.classList.remove('grow')); // this.getState();
21459
+
21460
+ panel.querySelectorAll('[data-justify]').forEach(btn => btn.classList.remove('on'));
21461
+ if (s !== '') btn.classList.add('on'); // this.builder.onChange();
21462
+
21463
+ this.builder.editor.onChange(); // this is because the changed element is in ContentBuilder scope
21464
+ });
21465
+ });
21466
+ const btnAlign = panel.querySelectorAll('[data-align]');
21467
+ btnAlign.forEach(btn => {
21468
+ btn.addEventListener('click', () => {
21469
+ this.builder.editor.saveForUndo();
21470
+ const s = btn.getAttribute('data-align');
21471
+ let activeColumn = this.builder.controlpanel.activeColumn;
21472
+ activeColumn.classList.add('flex');
21473
+ activeColumn.classList.add('flex-col');
21474
+ activeColumn.classList.remove('items-start');
21475
+ activeColumn.classList.remove('items-center');
21476
+ activeColumn.classList.remove('items-end');
21477
+
21478
+ if (s === 'items-start') ; else if (s === 'items-center') {
21479
+ activeColumn.classList.add('items-center');
21480
+ } else if (s === 'items-end') {
21481
+ activeColumn.classList.add('items-end');
21482
+ } else if (s === '') {
21483
+ if (activeColumn.classList.contains('justify-start') || activeColumn.classList.contains('justify-center') || activeColumn.classList.contains('justify-end') || activeColumn.classList.contains('justify-between')) ; else {
21484
+ activeColumn.classList.remove('flex');
21485
+ activeColumn.classList.remove('flex-col');
21486
+ }
21487
+ }
21488
+
21489
+ activeColumn.querySelectorAll('.grow').forEach(elm => elm.classList.remove('grow')); // this.getState();
21490
+
21491
+ panel.querySelectorAll('[data-align]').forEach(btn => btn.classList.remove('on'));
21492
+ if (s !== '') btn.classList.add('on'); // this.builder.onChange();
21493
+
21494
+ this.builder.editor.onChange(); // this is because the changed element is in ContentBuilder scope
21495
+ });
21496
+ });
21497
+ const btnClearFlex = panel.querySelector('.btn-clearflex');
21498
+ btnClearFlex.addEventListener('click', () => {
21499
+ this.builder.editor.saveForUndo();
21500
+ let activeColumn = this.builder.controlpanel.activeColumn;
21501
+ activeColumn.classList.remove('flex');
21502
+ activeColumn.classList.remove('flex-col');
21503
+ activeColumn.classList.remove('justify-start');
21504
+ activeColumn.classList.remove('justify-center');
21505
+ activeColumn.classList.remove('justify-end');
21506
+ activeColumn.classList.remove('justify-between');
21507
+ activeColumn.classList.remove('items-start');
21508
+ activeColumn.classList.remove('items-center');
21509
+ activeColumn.classList.remove('items-end');
21510
+ activeColumn.querySelectorAll('.grow').forEach(elm => elm.classList.remove('grow')); // this.getState();
21511
+
21512
+ panel.querySelectorAll('[data-justify]').forEach(btn => btn.classList.remove('on'));
21513
+ panel.querySelectorAll('[data-align]').forEach(btn => btn.classList.remove('on')); // this.builder.onChange();
21514
+
21515
+ this.builder.editor.onChange(); // this is because the changed element is in ContentBuilder scope
21228
21516
  }); // Positiom
21229
21517
 
21230
21518
  const btnContentJustify = panel.querySelectorAll('[data-content-justify]');
@@ -21594,6 +21882,31 @@ class PanelColumn {
21594
21882
 
21595
21883
  if (activeColumn.classList.contains('is-light-text')) {
21596
21884
  panel.querySelector('[data-textcolor="light"').classList.add('on');
21885
+ } // Flex
21886
+
21887
+
21888
+ panel.querySelectorAll('[data-justify]').forEach(elm => elm.classList.remove('on'));
21889
+
21890
+ if (activeColumn.classList.contains('justify-start')) {
21891
+ panel.querySelector('[data-justify=justify-start]').classList.add('on');
21892
+ } else if (activeColumn.classList.contains('justify-center')) {
21893
+ panel.querySelector('[data-justify=justify-center]').classList.add('on');
21894
+ } else if (activeColumn.classList.contains('justify-end')) {
21895
+ panel.querySelector('[data-justify=justify-end]').classList.add('on');
21896
+ } else if (activeColumn.classList.contains('justify-between')) {
21897
+ panel.querySelector('[data-justify=justify-between]').classList.add('on');
21898
+ }
21899
+
21900
+ panel.querySelectorAll('[data-align]').forEach(elm => elm.classList.remove('on')); // items-start class is not used/needed
21901
+
21902
+ if (activeColumn.classList.contains('items-center')) {
21903
+ panel.querySelector('[data-align=items-center]').classList.add('on');
21904
+ } else if (activeColumn.classList.contains('items-end')) {
21905
+ panel.querySelector('[data-align=items-end]').classList.add('on');
21906
+ } else {
21907
+ if (activeColumn.classList.contains('flex')) {
21908
+ panel.querySelector('[data-align=items-start]').classList.add('on');
21909
+ }
21597
21910
  } // Position
21598
21911
 
21599
21912
 
@@ -31517,18 +31830,20 @@ class Util$1 {
31517
31830
  this.builder.activeIcon = null;
31518
31831
 
31519
31832
  // RTE
31520
- let rteTool = builderStuff.querySelector('.is-rte-tool');
31521
- // rteTool.style.display = 'none';
31522
- let rteButtons = rteTool.querySelectorAll('button');
31523
- Array.prototype.forEach.call(rteButtons, rteButton => {
31524
- dom.removeClass(rteButton, 'on');
31525
- });
31526
- let elementRteTool = builderStuff.querySelector('.is-elementrte-tool');
31527
- // rteTool.style.display = 'none';
31528
- rteButtons = elementRteTool.querySelectorAll('button');
31529
- Array.prototype.forEach.call(rteButtons, rteButton => {
31530
- dom.removeClass(rteButton, 'on');
31531
- });
31833
+ if (!this.builder.controlPanel) {
31834
+ let rteTool = builderStuff.querySelector('.is-rte-tool');
31835
+ // rteTool.style.display = 'none';
31836
+ let rteButtons = rteTool.querySelectorAll('button');
31837
+ Array.prototype.forEach.call(rteButtons, rteButton => {
31838
+ dom.removeClass(rteButton, 'on');
31839
+ });
31840
+ let elementRteTool = builderStuff.querySelector('.is-elementrte-tool');
31841
+ // rteTool.style.display = 'none';
31842
+ rteButtons = elementRteTool.querySelectorAll('button');
31843
+ Array.prototype.forEach.call(rteButtons, rteButton => {
31844
+ dom.removeClass(rteButton, 'on');
31845
+ });
31846
+ }
31532
31847
  let pops = builderStuff.querySelectorAll('.is-pop');
31533
31848
  Array.prototype.forEach.call(pops, pop => {
31534
31849
  pop.style.display = '';
@@ -31606,7 +31921,7 @@ class Util$1 {
31606
31921
  this.builder.activeIcon = null;
31607
31922
  this.builder.inspectedElement = null;
31608
31923
  this.builder.activeElement = null;
31609
- if (all) {
31924
+ if (all && !this.builder.controlPanel) {
31610
31925
  // RTE
31611
31926
  let rtetool = builderStuff.querySelector('.is-rte-tool');
31612
31927
  if (rtetool) rtetool.style.display = 'none';
@@ -31737,17 +32052,19 @@ class Util$1 {
31737
32052
  });
31738
32053
 
31739
32054
  // RTE
31740
- if (this.builder.toolbarDisplay === 'auto') {
31741
- let rtetool = builderStuff.querySelector('.is-rte-tool');
31742
- if (rtetool) rtetool.style.display = 'none';
31743
- let elementRtetool = builderStuff.querySelector('.is-elementrte-tool');
31744
- if (elementRtetool) elementRtetool.style.display = 'none';
32055
+ if (!this.builder.controlPanel) {
32056
+ if (this.builder.toolbarDisplay === 'auto') {
32057
+ let rtetool = builderStuff.querySelector('.is-rte-tool');
32058
+ if (rtetool) rtetool.style.display = 'none';
32059
+ let elementRtetool = builderStuff.querySelector('.is-elementrte-tool');
32060
+ if (elementRtetool) elementRtetool.style.display = 'none';
31745
32061
 
31746
- // Click ok on code view should hide these as well
31747
- let rtetoolmore = builderStuff.querySelector('.rte-more-options');
31748
- if (rtetoolmore) rtetoolmore.style.display = '';
31749
- let elementRtetoolmore = builderStuff.querySelector('.elementrte-more-options');
31750
- if (elementRtetoolmore) elementRtetoolmore.style.display = '';
32062
+ // Click ok on code view should hide these as well
32063
+ let rtetoolmore = builderStuff.querySelector('.rte-more-options');
32064
+ if (rtetoolmore) rtetoolmore.style.display = '';
32065
+ let elementRtetoolmore = builderStuff.querySelector('.elementrte-more-options');
32066
+ if (elementRtetoolmore) elementRtetoolmore.style.display = '';
32067
+ }
31751
32068
  }
31752
32069
 
31753
32070
  // Element
@@ -31755,13 +32072,15 @@ class Util$1 {
31755
32072
  Array.prototype.forEach.call(elms, elm => {
31756
32073
  dom.removeClass(elm, 'elm-active');
31757
32074
  });
31758
- let rtepops = builderStuff.querySelectorAll('.is-rte-pop');
31759
- Array.prototype.forEach.call(rtepops, rtepop => {
31760
- rtepop.style.display = '';
31761
- dom.removeClass(rtepop, 'active');
31762
- dom.removeClass(rtepop, 'deactive');
31763
- // dom.addClass(rtepop, 'deactive');
31764
- });
32075
+ if (!this.builder.controlPanel) {
32076
+ let rtepops = builderStuff.querySelectorAll('.is-rte-pop');
32077
+ Array.prototype.forEach.call(rtepops, rtepop => {
32078
+ rtepop.style.display = '';
32079
+ dom.removeClass(rtepop, 'active');
32080
+ dom.removeClass(rtepop, 'deactive');
32081
+ // dom.addClass(rtepop, 'deactive');
32082
+ });
32083
+ }
31765
32084
 
31766
32085
  let pops = builderStuff.querySelectorAll('.is-pop');
31767
32086
  Array.prototype.forEach.call(pops, pop => {
@@ -42203,12 +42522,45 @@ const prepareSvgIcons = builder => {
42203
42522
  <path d="M5 10h11a4 4 0 1 1 0 8h-1"></path>
42204
42523
  </symbol>
42205
42524
  <symbol id="icon-publish" viewBox="0 0 24 24" stroke-width="1.4" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
42206
- <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
42207
- <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path>
42208
- <path d="M9 12l2 2l4 -4"></path>
42525
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
42526
+ <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path>
42527
+ <path d="M9 12l2 2l4 -4"></path>
42528
+ </symbol>
42529
+
42530
+ <symbol id="icon-align-box-top" viewBox="0 0 24 24" stroke-width="1.4" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
42531
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"/>
42532
+ <path d="M3 3m0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z" />
42533
+ <path d="M15 10h-7" />
42534
+ <path d="M15 7h-7" />
42535
+ </symbol>
42536
+ <symbol id="icon-align-box-middle" viewBox="0 0 24 24" stroke-width="1.4" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
42537
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"/>
42538
+ <path d="M3 3m0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z" />
42539
+ <path d="M15 13h-7" />
42540
+ <path d="M15 10h-7" />
42541
+ </symbol>
42542
+ <symbol id="icon-align-box-bottom" viewBox="0 0 24 24" stroke-width="1.4" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
42543
+ <path d="M3 3m0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z" />
42544
+ <path d="M15 17h-7" />
42545
+ <path d="M15 14h-7" />
42546
+ </symbol>
42547
+ <symbol id="icon-align-box-stretch" viewBox="0 0 24 24" stroke-width="1.4" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
42548
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"/>
42549
+ <path d="M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z" />
42550
+ <path d="M15 17h-7" />
42551
+ <path d="M15 7h-7" />
42552
+ </symbol>
42553
+
42554
+ <symbol id="icon-align-box-left" viewBox="0 0 24 24" stroke-width="1.4" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
42555
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3 3m0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z" /><path d="M9 15h-2" /><path d="M13 12h-6" /><path d="M11 9h-4" />
42556
+ </symbol>
42557
+ <symbol id="icon-align-box-center" viewBox="0 0 24 24" stroke-width="1.4" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
42558
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3 19v-14a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z" /><path d="M11 15h2" /><path d="M9 12h6" /><path d="M10 9h4" />
42559
+ </symbol>
42560
+ <symbol id="icon-align-box-right" viewBox="0 0 24 24" stroke-width="1.4" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
42561
+ <path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M15 15h2" /><path d="M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z" /><path d="M11 12h6" /><path d="M13 9h4" />
42209
42562
  </symbol>
42210
42563
 
42211
-
42212
42564
  </defs>
42213
42565
  </svg>`;
42214
42566
  builder.dom.appendHtml(builder.builderStuff, html);
@@ -79500,17 +79852,26 @@ class Hyperlink {
79500
79852
  // Link tool
79501
79853
  const linkTool = this.linkTool;
79502
79854
  let linkDisplay = dom.getStyle(link, 'display');
79503
- if (linkDisplay === 'inline-block' || linkDisplay === 'flex') {
79504
- linkTool.querySelector('.link-duplicate').style.display = 'block';
79505
- linkTool.querySelector('.link-remove').style.display = 'block';
79506
- } else {
79507
- if (this.builder.activeIcon) {
79855
+ /*
79856
+ if(linkDisplay==='inline-block' || linkDisplay==='flex'){
79508
79857
  linkTool.querySelector('.link-duplicate').style.display = 'block';
79509
79858
  linkTool.querySelector('.link-remove').style.display = 'block';
79510
- } else {
79511
- linkTool.querySelector('.link-duplicate').style.display = 'none';
79512
- linkTool.querySelector('.link-remove').style.display = 'none';
79513
- }
79859
+ } else {
79860
+ if(this.builder.activeIcon) {
79861
+ linkTool.querySelector('.link-duplicate').style.display = 'block';
79862
+ linkTool.querySelector('.link-remove').style.display = 'block';
79863
+ } else {
79864
+ linkTool.querySelector('.link-duplicate').style.display = 'none';
79865
+ linkTool.querySelector('.link-remove').style.display = 'none';
79866
+ }
79867
+ }
79868
+ */
79869
+ if (linkDisplay === 'inline' & !this.builder.activeIcon) {
79870
+ linkTool.querySelector('.link-duplicate').style.display = 'none';
79871
+ linkTool.querySelector('.link-remove').style.display = 'none';
79872
+ } else {
79873
+ linkTool.querySelector('.link-duplicate').style.display = 'block';
79874
+ linkTool.querySelector('.link-remove').style.display = 'block';
79514
79875
  }
79515
79876
 
79516
79877
  // Button Stuff
@@ -106640,6 +107001,7 @@ class ContentBuilder {
106640
107001
  this.elmTool.repositionElementTool(true);
106641
107002
  this.element.image.imageTool.style.display = '';
106642
107003
  this.element.module.moduleTool.style.display = '';
107004
+ this.element.hyperlink.linkTool.style.display = '';
106643
107005
  this.colTool.lockIndicator.style.display = '';
106644
107006
  return ret;
106645
107007
  };