@innovastudio/contentbuilder 1.4.65 → 1.4.67

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.4.65",
4
+ "version": "1.4.67",
5
5
  "description": "",
6
6
  "main": "public/contentbuilder/contentbuilder.esm.js",
7
7
  "files": [
@@ -56006,6 +56006,9 @@ class ColorPicker {
56006
56006
  if (color) {
56007
56007
  this.opts.color = color;
56008
56008
  this.setColor(color, true);
56009
+ } else {
56010
+ let inputColor = this.pickcolor.querySelector('.input-text');
56011
+ inputColor.value = '';
56009
56012
  }
56010
56013
  const handleKeyDown = e => {
56011
56014
  if (e.keyCode === 27) {
@@ -56028,11 +56031,30 @@ class ColorPicker {
56028
56031
  let inputColor = this.pickcolor.querySelector('.input-text');
56029
56032
  inputColor.focus();
56030
56033
  }
56034
+ isColorName(color) {
56035
+ const colorNamePattern = /^([a-z]+)$/i;
56036
+ return colorNamePattern.test(color);
56037
+ }
56038
+ convertColorToRGB(colorName) {
56039
+ const tempElement = document.createElement('div');
56040
+ tempElement.style.color = colorName;
56041
+ document.body.appendChild(tempElement);
56042
+ const computedColor = window.getComputedStyle(tempElement).color;
56043
+ document.body.removeChild(tempElement);
56044
+
56045
+ // Extract RGB values from the computed color
56046
+ const rgbValues = computedColor.match(/\d+/g);
56047
+ return `rgb(${rgbValues[0]}, ${rgbValues[1]}, ${rgbValues[2]})`;
56048
+ }
56031
56049
  setColor(color, noCallback) {
56032
56050
  let pickcolor = this.pickcolor;
56033
56051
  let pickcolormore = this.pickcolormore;
56034
- var colorOpacity = pickcolor.querySelector('.color-opacity');
56052
+ let colorOpacity = pickcolor.querySelector('.color-opacity');
56035
56053
  let colorgradient = pickcolor.querySelector('.color-gradient');
56054
+ const isColorName = this.isColorName(color);
56055
+ if (isColorName) {
56056
+ color = this.convertColorToRGB(color);
56057
+ }
56036
56058
  let base = color;
56037
56059
  let rgb;
56038
56060
  if (base.indexOf('rgb') !== -1) {
@@ -77373,34 +77395,25 @@ class Dictation {
77373
77395
  margin-bottom: 2.2rem;
77374
77396
  display: flex;
77375
77397
  flex: none;
77376
- width: 255px;
77398
+ width: 350px;
77377
77399
  height: auto;
77378
77400
  flex-direction: column;
77379
77401
  justify-content: space-between;
77380
77402
  border-radius: 0.25rem;
77381
77403
  border: 1px solid rgb(156 163 175/.75);
77382
77404
  padding: 1.5rem 2rem;
77405
+ box-sizing: border-box;
77383
77406
  letter-spacing: .025em;
77384
77407
  box-shadow: 5px 5px 0px rgb(0 0 0 / 3%);
77385
- font-size: 20px;
77408
+ font-size: 19px;
77386
77409
  font-weight: 300;
77387
77410
  font-family: sans-serif;
77388
77411
  line-height: 1.3;
77389
77412
  cursor:pointer;
77390
77413
  transition: all 0.3s ease;
77391
77414
  }
77392
- /*
77393
- .is-modal.commandlist .is-modal-content > div > div:focus {
77394
- outline: #5fa1f0 2px solid;
77395
- outline-offset: 2px;
77396
- }
77397
- */
77398
77415
  .is-modal.commandlist .is-modal-content > div > div:hover {
77399
77416
  background: rgba(0, 0, 0, 0.03);
77400
- /*
77401
- outline: #5fa1f0 2px solid;
77402
- border: 1px solid transparent;
77403
- */
77404
77417
  }
77405
77418
  .dark .is-modal.commandlist .is-modal-content > div > div:hover {
77406
77419
  background: rgba(255, 255, 255, 0.05);
@@ -77489,7 +77502,7 @@ class Dictation {
77489
77502
  <span style="display: flex;
77490
77503
  justify-content: center;
77491
77504
  align-items: center;">
77492
- ${util.out('Send a Command')}</span>
77505
+ ${util.out('AI Assistant')}</span>
77493
77506
  <button class="is-modal-close" tabindex="-1" title="${util.out('Close')}">
77494
77507
  <svg class="is-icon-flex"style="width:20px;height:20px"><use xlink:href="#ion-ios-close-empty"></use></svg>
77495
77508
  </button>
@@ -77886,7 +77899,8 @@ class Similarity {
77886
77899
  maxKey = key;
77887
77900
  }
77888
77901
  }
77889
- const similarityThreshold = 0.6;
77902
+ // console.log(maxSimilarity)
77903
+ const similarityThreshold = this.builder.similarityThreshold; //0.65;
77890
77904
  if (maxSimilarity >= similarityThreshold) {
77891
77905
  return maxKey;
77892
77906
  }
@@ -78543,6 +78557,7 @@ class ContentBuilder {
78543
78557
  capitalize: ['capitalize'],
78544
78558
  clean: ['clean']
78545
78559
  },
78560
+ similarityThreshold: 0.65,
78546
78561
  commandList: {
78547
78562
  select: ['select', 'select first'],
78548
78563
  select_next: ['select next', 'select after'],