@innovastudio/contentbuilder 1.5.100 → 1.5.102

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/index.d.ts CHANGED
@@ -209,6 +209,7 @@ interface ContentBuilderOptions {
209
209
  commandList?: object;
210
210
  commandInfo?: any[];
211
211
  commandInfoCanvasMode?: any[];
212
+ onStartRequest?: () => void;
212
213
  }
213
214
 
214
215
  declare class ContentBuilder {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@innovastudio/contentbuilder",
3
3
  "type": "module",
4
- "version": "1.5.100",
4
+ "version": "1.5.102",
5
5
  "description": "",
6
6
  "main": "public/contentbuilder/contentbuilder.esm.js",
7
7
  "types": "index.d.ts",
@@ -86571,6 +86571,7 @@ ${answer}
86571
86571
  let temperature = localStorage.getItem('_temp') || this.builder.temperature;
86572
86572
  let topP = localStorage.getItem('_top_p') || this.builder.topP;
86573
86573
  let num = 1;
86574
+ if (this.builder.settings.onStartRequest) this.builder.settings.onStartRequest();
86574
86575
  const messages = {
86575
86576
  question,
86576
86577
  context,
@@ -86578,8 +86579,12 @@ ${answer}
86578
86579
  functs,
86579
86580
  temperature,
86580
86581
  topP,
86581
- num
86582
+ num,
86583
+ metadata: this.builder.settings.metadata || {}
86582
86584
  };
86585
+
86586
+ // console.log(messages);
86587
+
86583
86588
  try {
86584
86589
  /*
86585
86590
  const response = await fetch(this.builder.sendCommandUrl, {
@@ -95245,9 +95250,20 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
95245
95250
  onStart: () => {
95246
95251
  this.uo.saveForUndo(); // Even if cancelled, saveForUndo will make sure not to save if there is no change
95247
95252
 
95253
+ // Set all to uneditable
95254
+ const editables = this.doc.querySelectorAll('[contenteditable="true"]');
95255
+ editables.forEach(item => {
95256
+ item.setAttribute('contenteditable', 'none'); // use 'none' (not false) for later rollback (to differentiate from existing contenteditable="false" elements)
95257
+ });
95258
+
95248
95259
  this.elmTool.hide();
95249
95260
  },
95250
95261
  onEnd: () => {
95262
+ // Back to editable
95263
+ const editables = this.doc.querySelectorAll('[contenteditable="none"]');
95264
+ editables.forEach(item => {
95265
+ item.setAttribute('contenteditable', 'true');
95266
+ });
95251
95267
  this.util.checkEmpty(); // for multiple instances check
95252
95268
 
95253
95269
  // if(this.sortableOnPage) this.sortableOnPage.destroy(); // enable drop as section (ContentBox)