@innovastudio/contentbuilder 1.5.119 → 1.5.121

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@innovastudio/contentbuilder",
3
3
  "type": "module",
4
- "version": "1.5.119",
4
+ "version": "1.5.121",
5
5
  "description": "",
6
6
  "main": "public/contentbuilder/contentbuilder.esm.js",
7
7
  "types": "index.d.ts",
@@ -5220,25 +5220,23 @@ class Util {
5220
5220
  if (item.classList.contains('is-row-tool')) return;
5221
5221
  if (item.classList.contains('is-col-tool')) return;
5222
5222
  if (item.classList.contains('is-rowadd-tool')) return;
5223
+ item.style.width = '';
5224
+ item.style.flex = '';
5225
+ // if(item.getAttribute('data-html')) {
5226
+ // // Don't change width on custom block
5227
+ // if(!item.style.width) { // But if width is not set, add default 50%
5228
+ // item.style.width = '50%';
5229
+ // item.style.flex = '0 0 auto';
5230
+ // }
5231
+ // if(this.getAllColumns(row).length === 1) { // only 1 col in a row
5232
+ // item.style.width = '';
5233
+ // item.style.flex = '';
5234
+ // }
5235
+ // } else {
5236
+ // item.style.width = '';
5237
+ // item.style.flex = '';
5238
+ // }
5223
5239
 
5224
- // item.style.width = '';
5225
- // item.style.flex = '';
5226
- if (item.getAttribute('data-html')) {
5227
- // Don't change width on custom block
5228
- if (!item.style.width) {
5229
- // But if width is not set, add default 50%
5230
- item.style.width = '50%';
5231
- item.style.flex = '0 0 auto';
5232
- }
5233
- if (this.getAllColumns(row).length === 1) {
5234
- // only 1 col in a row
5235
- item.style.width = '';
5236
- item.style.flex = '';
5237
- }
5238
- } else {
5239
- item.style.width = '';
5240
- item.style.flex = '';
5241
- }
5242
5240
  if (item.classList.contains('sm-hidden')) {
5243
5241
  smHidden = true;
5244
5242
  }
@@ -18071,8 +18069,7 @@ const renderSnippetPanel = (builder, snippetOpen) => {
18071
18069
  // let safariAgent = false;
18072
18070
 
18073
18071
  let activeBuilderArea;
18074
-
18075
- // let itemHeight;
18072
+ let itemHeight;
18076
18073
 
18077
18074
  /*
18078
18075
  const isMobile = dom.detectMobileOrTablet();
@@ -18103,8 +18100,7 @@ const renderSnippetPanel = (builder, snippetOpen) => {
18103
18100
 
18104
18101
  sort: false,
18105
18102
  animation: 150,
18106
- onChoose: () => {
18107
- //evt
18103
+ onChoose: evt => {
18108
18104
  // Adjust temmporary
18109
18105
  const newCss = `
18110
18106
  <style id="css-scale">
@@ -18116,9 +18112,7 @@ const renderSnippetPanel = (builder, snippetOpen) => {
18116
18112
  }
18117
18113
  </style>
18118
18114
  `;
18119
-
18120
- // itemHeight = evt.item.offsetHeight;
18121
-
18115
+ itemHeight = evt.item.offsetHeight;
18122
18116
  if (builder.iframe) {
18123
18117
  const oldCss = builder.contentStuff.querySelector('#css-scale');
18124
18118
  if (oldCss) oldCss.parentNode.removeChild(oldCss);
@@ -18134,18 +18128,17 @@ const renderSnippetPanel = (builder, snippetOpen) => {
18134
18128
  builder.util.clearPops();
18135
18129
  builder.hideElementTools();
18136
18130
  },
18137
- /*
18138
- onClone: (evt) =>{
18139
- // fix broken image on cloned element
18140
- var cloneEl = evt.clone;
18141
- let img = cloneEl.querySelector('img');
18142
- img.style.opacity = 0.0001;
18143
- cloneEl.style.height = itemHeight + 'px';
18144
- let timestamp = new Date().getTime();
18145
- img.src = img.src+'?'+timestamp;
18146
- img.style.opacity = '';
18131
+ onClone: evt => {
18132
+ // fix broken image on cloned element
18133
+ var cloneEl = evt.clone;
18134
+ let img = cloneEl.querySelector('img');
18135
+ img.style.opacity = 0.0001;
18136
+ cloneEl.style.height = itemHeight + 'px';
18137
+ let timestamp = new Date().getTime();
18138
+ let separator = img.src.includes('?') ? '&' : '?';
18139
+ img.src = img.src + separator + timestamp;
18140
+ img.style.opacity = '';
18147
18141
  },
18148
- */
18149
18142
  onMove: () => {
18150
18143
  let emptyinfo = builder.doc.querySelector('.row-add-initial'); // if there is empty info, remove it during snippet drag drop
18151
18144
  // if(emptyinfo) emptyinfo.parentNode.removeChild(emptyinfo);