@innovastudio/contentbuilder 1.5.124 → 1.5.126
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
@@ -304,10 +304,12 @@ declare class ContentBuilder {
|
|
304
304
|
openAIAssistant(): void;
|
305
305
|
closeAIAssistant(): void;
|
306
306
|
saveForUndo(): void;
|
307
|
-
selectAsset(s: string, f?: boolean)
|
308
|
-
|
309
|
-
|
310
|
-
|
307
|
+
selectAsset(s: string, f?: boolean): void;
|
308
|
+
hideModal(modal?: HTMLElement): void;
|
309
|
+
closeAsset(): void;
|
310
|
+
addBlock(html: string, blockContainer?: HTMLElement): void;
|
311
|
+
addPage(box?: HTMLElement): void;
|
312
|
+
setPageSize(s?: string): void;
|
311
313
|
openPageOptions(): void;
|
312
314
|
print(): void;
|
313
315
|
|
package/package.json
CHANGED
@@ -87075,11 +87075,29 @@ ${answer}
|
|
87075
87075
|
data = await response.json();
|
87076
87076
|
}
|
87077
87077
|
if (data.error) {
|
87078
|
+
let errorMessage = '';
|
87079
|
+
if (typeof data.error === 'string') {
|
87080
|
+
errorMessage = data.error;
|
87081
|
+
} else if (typeof data.error === 'object') {
|
87082
|
+
// Target deeply nested error messages
|
87083
|
+
if (data.error.error && data.error.error.message) {
|
87084
|
+
errorMessage = data.error.error.message;
|
87085
|
+
} else if (data.error.message) {
|
87086
|
+
errorMessage = data.error.message;
|
87087
|
+
} else {
|
87088
|
+
// Fallback for other objects
|
87089
|
+
errorMessage = JSON.stringify(data.error);
|
87090
|
+
}
|
87091
|
+
} else {
|
87092
|
+
// Fallback for unexpected types
|
87093
|
+
errorMessage = String(data.error);
|
87094
|
+
}
|
87095
|
+
|
87078
87096
|
// Error response from OpenAI goes here.
|
87079
|
-
console.log('Error:\n' +
|
87097
|
+
console.log('Error:\n' + errorMessage);
|
87080
87098
|
|
87081
87099
|
// ex. wrong API Key => Request failed with status code 401
|
87082
|
-
this.util.showMessage(this.util.out('Request failed.'));
|
87100
|
+
this.util.showMessage(this.util.out('Request failed. ' + errorMessage));
|
87083
87101
|
this.dictation.finish(); // Must be called after finished
|
87084
87102
|
return;
|
87085
87103
|
}
|
@@ -94831,6 +94849,7 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
|
|
94831
94849
|
window.selectImage = this.selectImage.bind(this);
|
94832
94850
|
window.selectVideo = this.selectVideo.bind(this);
|
94833
94851
|
window.selectAsset = this.selectAsset.bind(this);
|
94852
|
+
window.closeAsset = this.closeAsset.bind(this);
|
94834
94853
|
window.assetType = this.assetType.bind(this);
|
94835
94854
|
window.hideModal = this.hideModal.bind(this);
|
94836
94855
|
window.generateImage = this.generateImage.bind(this);
|
@@ -97336,6 +97355,20 @@ Add an image for each feature.`, 'Create a new content showcasing a photo galler
|
|
97336
97355
|
this.util._hideModal(modal); // this _hideModal will also trigger cancelCallback defined by showModal. This is done by programmatically click the overlay.
|
97337
97356
|
}
|
97338
97357
|
|
97358
|
+
closeAsset() {
|
97359
|
+
let modal = document.querySelector('.is-modal.videoselect.active');
|
97360
|
+
if (modal) this.hideModal(modal);
|
97361
|
+
modal = document.querySelector('.is-modal.imageselect.active');
|
97362
|
+
if (modal) this.hideModal(modal);
|
97363
|
+
modal = document.querySelector('.is-modal.fileselect.active');
|
97364
|
+
if (modal) this.hideModal(modal);
|
97365
|
+
modal = document.querySelector('.is-modal.audioselect.active');
|
97366
|
+
if (modal) this.hideModal(modal);
|
97367
|
+
modal = document.querySelector('.is-modal.mediaselect.active');
|
97368
|
+
if (modal) this.hideModal(modal);
|
97369
|
+
modal = document.querySelector('.is-modal.otherselect.active');
|
97370
|
+
if (modal) this.hideModal(modal);
|
97371
|
+
}
|
97339
97372
|
draggable(selector) {
|
97340
97373
|
new Draggable$2({
|
97341
97374
|
selector: selector
|