@innovastudio/contentbox 1.6.111 → 1.6.112

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/contentbox",
3
3
  "type": "module",
4
- "version": "1.6.111",
4
+ "version": "1.6.112",
5
5
  "description": "",
6
6
  "main": "public/contentbox/contentbox.esm.js",
7
7
  "types": "index.d.ts",
@@ -59,7 +59,7 @@
59
59
  "ws": "^8.13.0"
60
60
  },
61
61
  "dependencies": {
62
- "@innovastudio/contentbuilder": "^1.5.108",
62
+ "@innovastudio/contentbuilder": "^1.5.110",
63
63
  "js-beautify": "^1.14.0",
64
64
  "sortablejs": "^1.15.2"
65
65
  }
@@ -76681,8 +76681,23 @@ class Module {
76681
76681
  setTimeout(() => {
76682
76682
  iframe.style.opacity = '';
76683
76683
  }, 1);
76684
+
76685
+ /*
76686
+ // import myText from './myfile.txt?raw';
76687
+ // Replace assets path
76688
+ let moduleContent = '';
76689
+ if(modulename==='form-builder') {
76690
+ moduleContent = TXT_FormBuilder;
76691
+ }
76692
+ moduleContent = moduleContent.replace(/="assets\//g, '="' + this.builder.settings.assetPath);
76693
+ iframe.srcdoc = moduleContent;
76694
+ setTimeout(()=>{
76695
+ iframe.style.opacity = '';
76696
+ }, 1);
76697
+ */
76684
76698
  }
76685
76699
  }
76700
+
76686
76701
  click(col) {
76687
76702
  let custommodule = false;
76688
76703
  if (col.hasAttribute('data-module')) {
@@ -113365,13 +113380,15 @@ ${answer}
113365
113380
  if (this.builder.sendCommand) {
113366
113381
  data = await this.builder.sendCommand(messages);
113367
113382
  } else {
113383
+ let headers = {
113384
+ ...this.builder.headers,
113385
+ ...this.builder.defaultHeaders
113386
+ };
113368
113387
  const response = await fetch(this.builder.sendCommandUrl, {
113369
113388
  signal: this.signal,
113370
113389
  // Abort
113371
113390
  method: 'POST',
113372
- headers: {
113373
- 'Content-Type': 'application/json'
113374
- },
113391
+ headers,
113375
113392
  body: JSON.stringify(messages)
113376
113393
  });
113377
113394
  data = await response.json();
@@ -113435,11 +113452,13 @@ ${answer}
113435
113452
  if (this.builder.consoleLog) {
113436
113453
  if (!(error + '').includes('Failed to fetch')) {
113437
113454
  // Only if not CORS error
113455
+ let headers = {
113456
+ ...this.builder.headers,
113457
+ ...this.builder.defaultHeaders
113458
+ };
113438
113459
  const response = await fetch(this.builder.sendCommandUrl, {
113439
113460
  method: 'POST',
113440
- headers: {
113441
- 'Content-Type': 'application/json'
113442
- },
113461
+ headers,
113443
113462
  body: JSON.stringify(messages)
113444
113463
  });
113445
113464
  const data = await response.text();
@@ -119532,6 +119551,7 @@ class ContentBuilder {
119532
119551
  'Content-Type': 'application/json'
119533
119552
  },
119534
119553
  headers: {},
119554
+ metadata: {},
119535
119555
  /* Prompt/Command Stuff for AI Assistant */
119536
119556
  startAIAssistant: false,
119537
119557
  isContentBox: false,
@@ -159202,6 +159222,7 @@ class ContentBox {
159202
159222
  'Content-Type': 'application/json'
159203
159223
  },
159204
159224
  headers: {},
159225
+ metadata: {},
159205
159226
 
159206
159227
  /* Prompt/Command Stuff */
159207
159228
  consoleLog: false,
@@ -160217,6 +160238,7 @@ Add an image for each feature.`, 'Create a new block showcasing a photo gallery
160217
160238
 
160218
160239
  editorSetup() {
160219
160240
  this.editor = new ContentBuilder({
160241
+ metadata: this.settings.metadata,
160220
160242
  enableDictation: this.settings.enableDictation,
160221
160243
  onStartRequest: this.settings.onStartRequest,
160222
160244
  controlPanel: this.settings.controlPanel,