@innovastudio/contentbuilder 1.5.179 → 1.5.181
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
package/package.json
CHANGED
|
@@ -51143,11 +51143,12 @@ class SettingsUIGenerator {
|
|
|
51143
51143
|
const values = this.getFormValues(form);
|
|
51144
51144
|
onChange(values, element);
|
|
51145
51145
|
});
|
|
51146
|
-
form.addEventListener('change', () => {
|
|
51147
|
-
|
|
51148
|
-
|
|
51149
|
-
});
|
|
51146
|
+
// form.addEventListener('change', () => {
|
|
51147
|
+
// const values = this.getFormValues(form);
|
|
51148
|
+
// onChange(values, element);
|
|
51149
|
+
// });
|
|
51150
51150
|
}
|
|
51151
|
+
|
|
51151
51152
|
return form;
|
|
51152
51153
|
}
|
|
51153
51154
|
|
|
@@ -72807,14 +72808,14 @@ class Rte {
|
|
|
72807
72808
|
_protected = true;
|
|
72808
72809
|
}
|
|
72809
72810
|
let customcode = false;
|
|
72810
|
-
let subblock = false;
|
|
72811
72811
|
if (col.hasAttribute('data-html')) {
|
|
72812
72812
|
// Column contains custom code.
|
|
72813
72813
|
customcode = true;
|
|
72814
|
-
|
|
72815
|
-
|
|
72816
|
-
|
|
72817
|
-
|
|
72814
|
+
}
|
|
72815
|
+
const plugin = elm.closest('[data-cb-type]');
|
|
72816
|
+
let subblock = false;
|
|
72817
|
+
if (elm.closest('.is-subblock') && !elm.classList.contains('is-subblock')) {
|
|
72818
|
+
subblock = true;
|
|
72818
72819
|
}
|
|
72819
72820
|
if (this.builder.canvas) this.hideBlockButtons();
|
|
72820
72821
|
|
|
@@ -72835,7 +72836,7 @@ class Rte {
|
|
|
72835
72836
|
if (btnTextSettings) btnTextSettings.style.display = '';
|
|
72836
72837
|
if (btnLink) btnLink.style.display = '';
|
|
72837
72838
|
if (btnSymbol) btnSymbol.style.display = '';
|
|
72838
|
-
if (!customcode && !noedit && !_protected || subblock) {
|
|
72839
|
+
if (!customcode && !noedit && !_protected && !plugin || subblock) {
|
|
72839
72840
|
if ((dom.hasClass(elm, 'is-social') || dom.hasClass(elm, 'is-rounded-button-medium') || dom.hasClass(elm, 'cell-active')) && !dom.getSelected()) {
|
|
72840
72841
|
if (this.elementRteTool.style.display === 'none' || this.elementRteTool.style.display === '') {
|
|
72841
72842
|
this.elementRteTool.style.display = 'flex';
|
|
@@ -85218,6 +85219,7 @@ class Dictation {
|
|
|
85218
85219
|
label: 'Nano Banana',
|
|
85219
85220
|
sizes: [],
|
|
85220
85221
|
// no size options
|
|
85222
|
+
// sizes: ['21:9', '16:9', '3:2', '4:3', '5:4', '1:1', '4:5', '3:4', '2:3', '9:16'], // no size options
|
|
85221
85223
|
output_format: 'jpeg'
|
|
85222
85224
|
}, {
|
|
85223
85225
|
id: 'fal-ai/imagen4/preview/fast',
|
|
@@ -100637,14 +100639,42 @@ Please obtain a license at: https://innovastudio.com/contentbox`);
|
|
|
100637
100639
|
}
|
|
100638
100640
|
}
|
|
100639
100641
|
|
|
100642
|
+
async createImage(prompt, options) {
|
|
100643
|
+
if (options) this.imageGenerationSettings = options;
|
|
100644
|
+
return new Promise((resolve, reject) => {
|
|
100645
|
+
try {
|
|
100646
|
+
this.generateImage(prompt, imageUrl => {
|
|
100647
|
+
resolve(imageUrl);
|
|
100648
|
+
});
|
|
100649
|
+
} catch (err) {
|
|
100650
|
+
reject(err);
|
|
100651
|
+
}
|
|
100652
|
+
});
|
|
100653
|
+
}
|
|
100640
100654
|
async generateImage_Fal(prompt, callback) {
|
|
100641
|
-
|
|
100655
|
+
let modelId;
|
|
100656
|
+
let imageSize;
|
|
100657
|
+
let outputFormat;
|
|
100658
|
+
const modal = this.builderStuff.querySelector('.commandconfig');
|
|
100659
|
+
if (modal) {
|
|
100660
|
+
const inpImageModelSelect = modal.querySelector('#inpImageModelSelect');
|
|
100661
|
+
const inpImageSizeSelect = modal.querySelector('#inpImageSizeSelect');
|
|
100662
|
+
const outputFormatField = modal.querySelector('#inpImageOutputFormat');
|
|
100663
|
+
modelId = inpImageModelSelect.value;
|
|
100664
|
+
imageSize = inpImageSizeSelect.value;
|
|
100665
|
+
outputFormat = outputFormatField.value;
|
|
100666
|
+
} else if (this.imageGenerationSettings) {
|
|
100667
|
+
modelId = this.imageGenerationSettings.modelId;
|
|
100668
|
+
imageSize = this.imageGenerationSettings.imageSize;
|
|
100669
|
+
outputFormat = this.imageGenerationSettings.outputFormat;
|
|
100670
|
+
} else {
|
|
100671
|
+
modelId = 'fal-ai/flux-1/schnell';
|
|
100672
|
+
imageSize = 'landscape_4_3';
|
|
100673
|
+
outputFormat = 'jpeg';
|
|
100674
|
+
}
|
|
100642
100675
|
|
|
100643
100676
|
// Construct inputs: model, prompt, size, output format
|
|
100644
|
-
|
|
100645
|
-
const inpImageSizeSelect = modal.querySelector('#inpImageSizeSelect');
|
|
100646
|
-
const outputFormatField = modal.querySelector('#inpImageOutputFormat');
|
|
100647
|
-
const modelId = inpImageModelSelect.value;
|
|
100677
|
+
|
|
100648
100678
|
const modelDef = this.dictation.imageModels.find(m => m.id === modelId) || {};
|
|
100649
100679
|
|
|
100650
100680
|
// Build options dynamically
|
|
@@ -100654,18 +100684,15 @@ Please obtain a license at: https://innovastudio.com/contentbox`);
|
|
|
100654
100684
|
if (modelDef && modelDef.sizes !== undefined) {
|
|
100655
100685
|
if (modelDef.sizes !== null && modelDef.sizes.length !== 0) {
|
|
100656
100686
|
const sizeParam = modelDef.size_param || 'image_size'; // default
|
|
100657
|
-
const imageSize = inpImageSizeSelect.value;
|
|
100658
100687
|
options[sizeParam] = imageSize;
|
|
100659
100688
|
}
|
|
100660
100689
|
// if sizes = [] => no size options => exclude size.
|
|
100661
100690
|
} else {
|
|
100662
100691
|
// if sizes not defined, use default set
|
|
100663
|
-
const imageSize = inpImageSizeSelect.value;
|
|
100664
100692
|
options['image_size'] = imageSize;
|
|
100665
100693
|
}
|
|
100666
100694
|
|
|
100667
100695
|
// Handle output_format if present
|
|
100668
|
-
const outputFormat = outputFormatField.value;
|
|
100669
100696
|
if (outputFormat) {
|
|
100670
100697
|
const outputParam = modelDef.output_param || 'output_format'; // default
|
|
100671
100698
|
options[outputParam] = outputFormat;
|