@innovastudio/contentbuilder 1.5.149 → 1.5.150

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -103,6 +103,7 @@ interface ContentBuilderOptions {
103
103
  audioSelect?: string;
104
104
  mediaSelect?: string;
105
105
  filePicker?: string;
106
+ filePickerSize?: string;
106
107
  selectIcon?: string;
107
108
  otherSelect?: string;
108
109
  otherSelectCaption?: string;
@@ -219,6 +220,9 @@ interface ContentBuilderOptions {
219
220
  commandInfoCanvasMode?: any[];
220
221
  onStartRequest?: () => void;
221
222
 
223
+ defaultHeaders?: { [key: string]: string };
224
+ headers?: { [key: string]: string };
225
+
222
226
  defaultImageGenerationProvider?: string;
223
227
  imageModel?: string;
224
228
  imageSize?: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@innovastudio/contentbuilder",
3
3
  "type": "module",
4
- "version": "1.5.149",
4
+ "version": "1.5.150",
5
5
  "description": "",
6
6
  "main": "public/contentbuilder/contentbuilder.esm.js",
7
7
  "types": "index.d.ts",
@@ -520,8 +520,8 @@ button:focus-visible {
520
520
  top: 0;
521
521
  left: 0;
522
522
  background: #fff;
523
- border: 1px solid #f2f2f2;
524
- box-shadow: 4px 17px 20px 0px rgba(0, 0, 0, 0.08);
523
+ border: 1px solid #dcdcdc;
524
+ box-shadow: 3px 11px 24px 0px rgba(0, 0, 0, 0.05);
525
525
  outline: none;
526
526
  border-radius: 7px;
527
527
  overflow: hidden;
@@ -2845,7 +2845,8 @@ button:focus-visible {
2845
2845
  flex-direction: row;
2846
2846
  align-items: flex-start;
2847
2847
  border-radius: 6px;
2848
- box-shadow: 9px 14px 30px 1px rgba(0, 0, 0, 0.12);
2848
+ border: 1px solid #dcdcdc;
2849
+ box-shadow: 3px 11px 24px 0px rgba(0, 0, 0, 0.05);
2849
2850
  background-color: #fff;
2850
2851
  }
2851
2852
  #_cbhtml .is-modal.snippetwindow.left,
@@ -4723,6 +4723,7 @@ class Util {
4723
4723
  showRtePop(pop, onShow, btn) {
4724
4724
  const dom = this.dom;
4725
4725
  pop.style.display = 'flex';
4726
+ pop.setAttribute('aria-hidden', 'false');
4726
4727
  if (onShow) onShow();
4727
4728
  dom.removeClass(pop, 'deactive');
4728
4729
  dom.addClass(pop, 'active');
@@ -4787,6 +4788,7 @@ class Util {
4787
4788
  pop.style.display = '';
4788
4789
  dom.removeClass(pop, 'active');
4789
4790
  dom.addClass(pop, 'deactive');
4791
+ pop.setAttribute('aria-hidden', 'true');
4790
4792
  }
4791
4793
  showPopOverlay(pop, cancelCallback, btn) {
4792
4794
  const builderStuff = this.builder.builderStuff;
@@ -5460,12 +5462,27 @@ class Util {
5460
5462
  if (mode === 'cell' || mode === 'cell-right') {
5461
5463
  dom.moveAfter(cellElement, cell);
5462
5464
  }
5465
+ let element;
5466
+ if (cellElement.childNodes && cellElement.childNodes[0]) {
5467
+ element = cellElement.childNodes[0];
5468
+ }
5463
5469
  let builderActive = this.builder.doc.querySelector('.builder-active');
5464
5470
  if (builderActive) this.builder.applyBehaviorOn(builderActive);
5465
5471
  this.fixLayout(row);
5466
- cellElement.click(); //change active block to the newly created
5467
- }
5468
5472
 
5473
+ // cellElement.click(); //change active block to the newly created
5474
+ if (element && element.tagName.toLowerCase() === 'img') {
5475
+ element.onload = () => {
5476
+ element.click();
5477
+ element.onload = null;
5478
+ setTimeout(() => {
5479
+ this.builder.element.image.repositionImageTool();
5480
+ }, 100);
5481
+ };
5482
+ } else if (element) {
5483
+ element.click();
5484
+ }
5485
+ }
5469
5486
  if (mode === 'row') {
5470
5487
  this.builder.uo.saveForUndo();
5471
5488
  let rowElement, cellElement;
@@ -5503,11 +5520,26 @@ class Util {
5503
5520
  }
5504
5521
  row.parentNode.insertBefore(rowElement, row);
5505
5522
  dom.moveAfter(rowElement, row);
5523
+ let element;
5524
+ if (rowElement.childNodes && rowElement.childNodes[0].childNodes && rowElement.childNodes[0].childNodes) {
5525
+ element = rowElement.childNodes[0].childNodes[0];
5526
+ }
5506
5527
  let builderActive = this.builder.doc.querySelector('.builder-active');
5507
5528
  if (builderActive) this.builder.applyBehaviorOn(builderActive);
5508
- cellElement.click(); //change active block to the newly created
5509
- }
5510
5529
 
5530
+ // cellElement.click(); //change active block to the newly created
5531
+ if (element && element.tagName.toLowerCase() === 'img') {
5532
+ element.onload = () => {
5533
+ element.click();
5534
+ element.onload = null;
5535
+ setTimeout(() => {
5536
+ this.builder.element.image.repositionImageTool();
5537
+ }, 100);
5538
+ };
5539
+ } else if (element) {
5540
+ element.click();
5541
+ }
5542
+ }
5511
5543
  if (mode === 'elm') {
5512
5544
  let elm = this.builder.activeElement; // See elementtool.js line 195-196. // document.querySelector('.elm-active');
5513
5545
  if (!elm) return;
@@ -5538,6 +5570,9 @@ class Util {
5538
5570
  let checkLoad = setInterval(() => {
5539
5571
  if (newelement.complete) {
5540
5572
  newelement.click();
5573
+ setTimeout(() => {
5574
+ this.builder.element.image.repositionImageTool();
5575
+ }, 100);
5541
5576
  clearInterval(checkLoad);
5542
5577
  }
5543
5578
  }, 30);
@@ -67707,6 +67742,7 @@ class Rte {
67707
67742
  const top = btn.getBoundingClientRect().top;
67708
67743
  const left = btn.getBoundingClientRect().left;
67709
67744
  pop.style.display = 'flex';
67745
+ pop.setAttribute('aria-hidden', 'false');
67710
67746
  const w = pop.offsetWidth; //to get value, element must not hidden (display:none). So set display:flex before this.
67711
67747
  const h = pop.offsetHeight;
67712
67748
  if (!dom.hasClass(pop, 'active')) {
@@ -67741,6 +67777,7 @@ class Rte {
67741
67777
  const top = btn.getBoundingClientRect().top;
67742
67778
  const left = btn.getBoundingClientRect().left;
67743
67779
  pop.style.display = 'flex';
67780
+ pop.setAttribute('aria-hidden', 'false');
67744
67781
  const w = pop.offsetWidth; //to get value, element must not hidden (display:none). So set display:flex before this.
67745
67782
  const h = pop.offsetHeight;
67746
67783
  if (!dom.hasClass(pop, 'active')) {
@@ -68577,6 +68614,7 @@ class Rte {
68577
68614
  const top = btn.getBoundingClientRect().top;
68578
68615
  const left = btn.getBoundingClientRect().left;
68579
68616
  pop.style.display = 'flex';
68617
+ pop.setAttribute('aria-hidden', 'false');
68580
68618
  const w = pop.offsetWidth; //to get value, element must not hidden (display:none). So set display:flex before this.
68581
68619
  const h = pop.offsetHeight;
68582
68620
  if (!dom.hasClass(pop, 'active')) {
@@ -68903,6 +68941,7 @@ class Rte {
68903
68941
  const top = btn.getBoundingClientRect().top;
68904
68942
  const left = btn.getBoundingClientRect().left;
68905
68943
  pop.style.display = 'flex';
68944
+ pop.setAttribute('aria-hidden', 'false');
68906
68945
  const w = pop.offsetWidth; //to get value, element must not hidden (display:none). So set display:flex before this.
68907
68946
  const h = pop.offsetHeight;
68908
68947
  if (!dom.hasClass(pop, 'active')) {
@@ -70420,6 +70459,7 @@ class Rte {
70420
70459
  const top = btnRteIcons.getBoundingClientRect().top;
70421
70460
  const left = btnRteIcons.getBoundingClientRect().left;
70422
70461
  pop.style.display = 'flex';
70462
+ pop.setAttribute('aria-hidden', 'false');
70423
70463
  const w = pop.offsetWidth; //to get value, element must not hidden (display:none). So set display:flex before this.
70424
70464
  const h = pop.offsetHeight;
70425
70465
  if (!dom.hasClass(pop, 'active')) {
@@ -70507,6 +70547,7 @@ class Rte {
70507
70547
  });
70508
70548
  const pop = this.rteMoreOptions;
70509
70549
  pop.style.display = 'flex';
70550
+ pop.setAttribute('aria-hidden', 'false');
70510
70551
  const w = pop.offsetWidth; //to get value, element must not hidden (display:none). So set display:flex before this.
70511
70552
  const h = pop.offsetHeight;
70512
70553
  if (this.builder.opts.toolbar === 'left') {
@@ -70583,6 +70624,7 @@ class Rte {
70583
70624
  const top = btnElementRteMore.getBoundingClientRect().top;
70584
70625
  const left = btnElementRteMore.getBoundingClientRect().left;
70585
70626
  pop.style.display = 'flex';
70627
+ pop.setAttribute('aria-hidden', 'false');
70586
70628
  const w = pop.offsetWidth; //to get value, element must not hidden (display:none). So set display:flex before this.
70587
70629
  const h = pop.offsetHeight;
70588
70630
  if (this.builder.opts.toolbar === 'left') {
@@ -84372,6 +84414,7 @@ class Dictation {
84372
84414
  return;
84373
84415
  }
84374
84416
  this.modalCommand.classList.add('active');
84417
+ this.modalCommand.setAttribute('aria-hidden', 'false');
84375
84418
  inpCommand.focus();
84376
84419
  localStorage.setItem('_dictation', '1');
84377
84420
  const chkAutoSend = this.builderStuff.querySelector('#chkAutoSendCommand');
@@ -93018,6 +93061,7 @@ class ContentBuilder {
93018
93061
  mediaSelect: '',
93019
93062
  // NEW: for image & video
93020
93063
 
93064
+ filePickerSize: 'medium',
93021
93065
  // selectIcon: '<svg class="is-icon-flex"><use xlink:href="#ion-more"></use></svg>',
93022
93066
  selectIcon: '<svg class="is-icon-flex" style="width:16px;height:16px;"><use xlink:href="#icon-folder"></use></svg>',
93023
93067
  // NEW: for any other file select. Will be visible on hyperlink dialog, image dialog (image link), and Column Settings dialog (on Click tab)
@@ -94080,7 +94124,7 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
94080
94124
  this.settings.fileselect = this.settings.filePicker;
94081
94125
  this.settings.videoselect = this.settings.filePicker;
94082
94126
  }
94083
- if (this.assetPanelFullScreen) {
94127
+ if (this.assetPanelFullScreen || this.filePickerSize === 'fullscreen') {
94084
94128
  this.imageSelectWidth = '100vw';
94085
94129
  this.imageSelectHeight = '100vh';
94086
94130
  this.fileSelectWidth = '100vw';
@@ -94100,6 +94144,26 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
94100
94144
  this.mediaSelectMaxWidth = '100vw';
94101
94145
  this.otherSelectMaxWidth = '100vw';
94102
94146
  }
94147
+ if (this.filePickerSize === 'large') {
94148
+ this.imageSelectWidth = '100%';
94149
+ this.imageSelectHeight = '90vh';
94150
+ this.fileSelectWidth = '100%';
94151
+ this.fileSelectHeight = '90vh';
94152
+ this.videoSelectWidth = '100%';
94153
+ this.videoSelectHeight = '90vh';
94154
+ this.audioSelectWidth = '100%';
94155
+ this.audioSelectHeight = '90vh';
94156
+ this.mediaSelectWidth = '100%';
94157
+ this.mediaSelectHeight = '90vh';
94158
+ this.otherSelectWidth = '100%';
94159
+ this.otherSelectHeight = '90vh';
94160
+ this.imageSelectMaxWidth = '92vw';
94161
+ this.fileSelectMaxWidth = '92vw';
94162
+ this.videoSelectMaxWidth = '92vw';
94163
+ this.audioSelectMaxWidth = '92vw';
94164
+ this.mediaSelectMaxWidth = '92vw';
94165
+ this.otherSelectMaxWidth = '92vw';
94166
+ }
94103
94167
 
94104
94168
  // if(this.opts.largerImageHandler!=='') {
94105
94169
  // this.opts.mediaHandler = this.opts.largerImageHandler;