@innovastudio/contentbuilder 1.4.128 → 1.4.129

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@innovastudio/contentbuilder",
3
3
  "type": "module",
4
- "version": "1.4.128",
4
+ "version": "1.4.129",
5
5
  "description": "",
6
6
  "main": "public/contentbuilder/contentbuilder.esm.js",
7
7
  "files": [
@@ -13190,23 +13190,23 @@ const renderQuickAdd = builder => {
13190
13190
  elm = quickadd.querySelector('.add-button');
13191
13191
  if (elm) dom.addEventListener(elm, 'click', () => {
13192
13192
  const mode = quickadd.getAttribute('data-mode');
13193
- let html = `<div>
13193
+ let html = `<div class="flex">
13194
13194
  <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-6 text-black leading-14 rounded border-transparent hover:border-transparent font-normal tracking-wide" style="background-color: rgb(240, 240, 240);">Read More</a>
13195
13195
  </div>`;
13196
13196
  if (builder.opts.emailMode) {
13197
- html = '<div><a href="#" role="button" style="margin-top: ;margin-right: ;margin-bottom: ;margin-left: ;display: inline-block; text-decoration: none; transition: all 0.16s ease 0s; border-style: solid; cursor: pointer; background-color: rgb(220, 220, 220); color: rgb(0, 0, 0); border-color: rgb(220, 220, 220); border-width: 2px; border-radius: 0px; padding: 13px 28px; line-height: 21px; text-transform: uppercase; font-weight: 400; font-size: 14px; letter-spacing: 3px;">Read More</a></div>';
13197
+ html = '<div class="flex"><a href="#" role="button" style="margin-top: ;margin-right: ;margin-bottom: ;margin-left: ;display: inline-block; text-decoration: none; transition: all 0.16s ease 0s; border-style: solid; cursor: pointer; background-color: rgb(220, 220, 220); color: rgb(0, 0, 0); border-color: rgb(220, 220, 220); border-width: 2px; border-radius: 0px; padding: 13px 28px; line-height: 21px; text-transform: uppercase; font-weight: 400; font-size: 14px; letter-spacing: 3px;">Read More</a></div>';
13198
13198
  }
13199
13199
  util.addContent(html, mode);
13200
13200
  });
13201
13201
  elm = quickadd.querySelector('.add-twobutton');
13202
13202
  if (elm) dom.addEventListener(elm, 'click', () => {
13203
13203
  const mode = quickadd.getAttribute('data-mode');
13204
- let html = `<div>
13204
+ let html = `<div class="flex">
13205
13205
  <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-6 text-black leading-14 rounded border-transparent hover:border-transparent font-normal tracking-wide" style="background-color: rgb(240, 240, 240);">Read More</a>
13206
13206
  <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-6 border-current hover:border-current font-normal leading-14 rounded tracking-wide">Get Started</a>
13207
13207
  </div>`;
13208
13208
  if (builder.opts.emailMode) {
13209
- html = `<div>
13209
+ html = `<div class="flex">
13210
13210
  <a href="#" role="button" style="margin-top: ;margin-right: ;margin-bottom: ;margin-left: ;display: inline-block; text-decoration: none; transition: all 0.16s ease 0s; border-style: solid; cursor: pointer; background-color: rgb(220, 220, 220); color: rgb(0, 0, 0); border-color: rgb(220, 220, 220); border-width: 2px; border-radius: 0px; padding: 13px 28px; line-height: 21px; text-transform: uppercase; font-weight: 400; font-size: 14px; letter-spacing: 3px;">Read More</a> &nbsp;
13211
13211
  <a href="#" role="button" style="display: inline-block; text-decoration: none; transition: all 0.16s ease 0s; border-style: solid; cursor: pointer; background-color: rgba(0, 0, 0, 0); border-color: rgb(53, 53, 53); border-width: 2px; border-radius: 0px; padding: 13px 28px; line-height: 21px; text-transform: uppercase; font-weight: 600; font-size: 14px; letter-spacing: 3px; color: rgb(53, 53, 53);">Get Started</a>
13212
13212
  </div>`;
@@ -76877,6 +76877,27 @@ class ContentBuilder {
76877
76877
  // ON KEYUP
76878
76878
  col.addEventListener('keyup', this.handleCellKeyup.bind(this, col));
76879
76879
 
76880
+ // ON DOUBLE CLICK TO SELECT
76881
+ let isDoubleClick = false; // Double click flag
76882
+
76883
+ col.addEventListener('dblclick', () => {
76884
+ isDoubleClick = true;
76885
+ });
76886
+ col.addEventListener('mouseup', () => {
76887
+ if (isDoubleClick) {
76888
+ let selection = this.win.getSelection();
76889
+ let selectedText = selection.toString().trim();
76890
+ if (selectedText.length > 0) {
76891
+ let elm = this.dom.getElm();
76892
+ if (!this.dom.hasClass(elm.parentNode.parentNode, 'is-builder')) {
76893
+ this.dom.selectElementContents(elm);
76894
+ }
76895
+ }
76896
+ // Reset the flag after handling the double-click
76897
+ isDoubleClick = false;
76898
+ }
76899
+ });
76900
+
76880
76901
  // ON FOCUS
76881
76902
  // col.addEventListener('focus', this.handleCellFocus.bind(this, col));
76882
76903