@innovastudio/contentbox 1.6.110 → 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.110",
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,
@@ -156542,7 +156562,7 @@ class ContentBox {
156542
156562
  // Multiple device buttons on frame
156543
156563
  simpleEditingBreakpoint: '970px',
156544
156564
  // iframe only
156545
- canvas: false,
156565
+ canvas: true,
156546
156566
  blankHtml: '',
156547
156567
  lang: [],
156548
156568
  // Old Template System:
@@ -156775,7 +156795,7 @@ class ContentBox {
156775
156795
  blockCodeEditorMaxWidth: '960px',
156776
156796
  assetRefresh: false,
156777
156797
  slider: 'glide',
156778
- navbar: false,
156798
+ navbar: true,
156779
156799
  screenMode: 'fullview',
156780
156800
  onRender: function () {},
156781
156801
  onChange: function () {},
@@ -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,
@@ -159211,9 +159232,10 @@ class ContentBox {
159211
159232
  // new_section_bg_color: '..',
159212
159233
  // new_section: '..'
159213
159234
  // },
159214
- AIToolbar: true,
159235
+ AIToolbar: false,
159215
159236
  sendCommandUrl: '',
159216
159237
  // http://localhost:8081/answer
159238
+ enableDictation: false,
159217
159239
  hideImageGeneration: false,
159218
159240
 
159219
159241
  /* To enable asset manager */
@@ -160216,6 +160238,8 @@ Add an image for each feature.`, 'Create a new block showcasing a photo gallery
160216
160238
 
160217
160239
  editorSetup() {
160218
160240
  this.editor = new ContentBuilder({
160241
+ metadata: this.settings.metadata,
160242
+ enableDictation: this.settings.enableDictation,
160219
160243
  onStartRequest: this.settings.onStartRequest,
160220
160244
  controlPanel: this.settings.controlPanel,
160221
160245
  canvas: this.settings.canvas,