@imgly/plugin-ai-audio-generation-web 0.2.4 → 0.2.6
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/CHANGELOG.md +22 -0
- package/README.md +17 -0
- package/dist/elevenlabs/index.mjs +2 -2
- package/dist/elevenlabs/index.mjs.map +4 -4
- package/dist/index.mjs +8 -8
- package/dist/index.mjs.map +4 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.2.6] - 2025-09-09
|
|
6
|
+
|
|
7
|
+
### New Features
|
|
8
|
+
|
|
9
|
+
- [all] **Feature API Integration**: Added comprehensive Feature API support across all AI plugins to control visibility and availability of features through feature flags. Core features include `providerSelect`, `quickAction`, `quickAction.providerSelect`, `fromText`, and `fromImage` flags.
|
|
10
|
+
- [all] **Quick Action Feature Flags**: Each quick action now automatically registers and respects its own feature flag (e.g., `ly.img.plugin-ai-image-generation-web.quickAction.editImage`), allowing fine-grained control over which quick actions are available to users.
|
|
11
|
+
- [image-generation] **Provider Style Group Control**: Added Feature API support for Recraft providers to control style group visibility. RecraftV3 supports `style.image` and `style.vector` flags, while Recraft20b adds `style.icon` flag for controlling icon style availability.
|
|
12
|
+
- [all] **Provider Selection Feature Flags**: Added support for controlling provider selection UI in both panels (`providerSelect`) and quick actions (`quickAction.providerSelect`), with proper handling when multiple providers are configured.
|
|
13
|
+
|
|
14
|
+
## [0.2.5] - 2025-09-03
|
|
15
|
+
|
|
16
|
+
### New Features
|
|
17
|
+
|
|
18
|
+
- [image-generation] **NanoBanana Provider**: Added NanoBanana text-to-image provider via fal.ai with fast generation times, 1024×1024 resolution, support for multiple output formats (JPEG, PNG), configurable number of images (1-4), and remixPageWithPrompt quick action
|
|
19
|
+
- [image-generation] **NanoBananaEdit Provider**: Added NanoBananaEdit image-to-image provider via fal.ai for editing existing images with text prompts, supporting all standard quick actions (editImage, swapBackground, styleTransfer, artistTransfer, createVariant, combineImages with up to 10 images, remixPage, remixPageWithPrompt)
|
|
20
|
+
- [all] **AI Style Asset Library Translations**: AI style presets in asset libraries now automatically use localized names and descriptions from provider translation files, eliminating the need for manual translation configuration
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
- [all] **fal.ai Provider Configuration**: Fixed singleton configuration conflict when using multiple fal.ai providers with different proxy URLs. Each provider now maintains its own client instance instead of overwriting a global configuration
|
|
25
|
+
- [video-generation] **Missing Dependency**: Added missing `@fal-ai/client` dependency to plugin-ai-video-generation-web package.json to ensure the package works correctly when installed independently
|
|
26
|
+
|
|
5
27
|
## [0.2.4] - 2025-08-07
|
|
6
28
|
|
|
7
29
|
### New Features
|
package/README.md
CHANGED
|
@@ -192,6 +192,23 @@ cesdk.i18n.setTranslations({
|
|
|
192
192
|
});
|
|
193
193
|
```
|
|
194
194
|
|
|
195
|
+
### Feature Control
|
|
196
|
+
|
|
197
|
+
You can control various aspects of the audio generation plugin using the Feature API:
|
|
198
|
+
|
|
199
|
+
```typescript
|
|
200
|
+
// Disable provider selection for speech
|
|
201
|
+
cesdk.feature.enable('ly.img.plugin-ai-audio-generation-web.speech.providerSelect', false);
|
|
202
|
+
|
|
203
|
+
// Disable provider selection for sound effects
|
|
204
|
+
cesdk.feature.enable('ly.img.plugin-ai-audio-generation-web.sound.providerSelect', false);
|
|
205
|
+
|
|
206
|
+
// Control individual provider visibility
|
|
207
|
+
cesdk.feature.enable('ly.img.plugin-ai-audio-generation-web.providerSelect', false);
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
For more information about Feature API and available feature flags, see the [@imgly/plugin-ai-generation-web documentation](https://github.com/imgly/plugins/tree/main/packages/plugin-ai-generation-web#available-feature-flags).
|
|
211
|
+
|
|
195
212
|
### Customizing Labels and Translations
|
|
196
213
|
|
|
197
214
|
You can customize all labels and text in the AI audio generation interface using the translation system. This allows you to provide better labels for your users in any language.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Le=typeof global=="object"&&global&&global.Object===Object&&global,ge=Le,je=typeof self=="object"&&self&&self.Object===Object&&self,De=ge||je||Function("return this")(),g=De,Pe=g.Symbol,k=Pe,me=Object.prototype,Ne=me.hasOwnProperty,_e=me.toString,M=k?k.toStringTag:void 0;function Oe(e){var t=Ne.call(e,M),i=e[M];try{e[M]=void 0;var r=!0}catch{}var n=_e.call(e);return r&&(t?e[M]=i:delete e[M]),n}var ze=Oe,Ue=Object.prototype,Re=Ue.toString;function Be(e){return Re.call(e)}var Fe=Be,Ve="[object Null]",qe="[object Undefined]",J=k?k.toStringTag:void 0;function Ge(e){return e==null?e===void 0?qe:Ve:J&&J in Object(e)?ze(e):Fe(e)}var j=Ge;function Ye(e){return e!=null&&typeof e=="object"}var Z=Ye,zr=Array.isArray;function Qe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var be=Qe,He="[object AsyncFunction]",Ke="[object Function]",We="[object GeneratorFunction]",Ze="[object Proxy]";function Xe(e){if(!be(e))return!1;var t=j(e);return t==Ke||t==We||t==He||t==Ze}var Je=Xe,et=g["__core-js_shared__"],V=et,ee=function(){var e=/[^.]+$/.exec(V&&V.keys&&V.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function tt(e){return!!ee&&ee in e}var it=tt,rt=Function.prototype,nt=rt.toString;function at(e){if(e!=null){try{return nt.call(e)}catch{}try{return e+""}catch{}}return""}var y=at,ot=/[\\^$.*+?()[\]{}|]/g,lt=/^\[object .+?Constructor\]$/,st=Function.prototype,ut=Object.prototype,dt=st.toString,ct=ut.hasOwnProperty,pt=RegExp("^"+dt.call(ct).replace(ot,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function gt(e){if(!be(e)||it(e))return!1;var t=Je(e)?pt:lt;return t.test(y(e))}var mt=gt;function bt(e,t){return e?.[t]}var yt=bt;function ft(e,t){var i=yt(e,t);return mt(i)?i:void 0}var x=ft,ht=x(g,"WeakMap"),Y=ht;function vt(e,t){return e===t||e!==e&&t!==t}var wt=vt,kt=9007199254740991;function xt(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=kt}var At=xt,Ur=Object.prototype,It="[object Arguments]";function Ct(e){return Z(e)&&j(e)==It}var te=Ct,ye=Object.prototype,St=ye.hasOwnProperty,Et=ye.propertyIsEnumerable,Rr=te(function(){return arguments}())?te:function(e){return Z(e)&&St.call(e,"callee")&&!Et.call(e,"callee")},fe=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ie=fe&&typeof module=="object"&&module&&!module.nodeType&&module,Mt=ie&&ie.exports===fe,re=Mt?g.Buffer:void 0,Br=re?re.isBuffer:void 0,Tt="[object Arguments]",$t="[object Array]",Lt="[object Boolean]",jt="[object Date]",Dt="[object Error]",Pt="[object Function]",Nt="[object Map]",_t="[object Number]",Ot="[object Object]",zt="[object RegExp]",Ut="[object Set]",Rt="[object String]",Bt="[object WeakMap]",Ft="[object ArrayBuffer]",Vt="[object DataView]",qt="[object Float32Array]",Gt="[object Float64Array]",Yt="[object Int8Array]",Qt="[object Int16Array]",Ht="[object Int32Array]",Kt="[object Uint8Array]",Wt="[object Uint8ClampedArray]",Zt="[object Uint16Array]",Xt="[object Uint32Array]",a={};a[qt]=a[Gt]=a[Yt]=a[Qt]=a[Ht]=a[Kt]=a[Wt]=a[Zt]=a[Xt]=!0;a[Tt]=a[$t]=a[Ft]=a[Lt]=a[Vt]=a[jt]=a[Dt]=a[Pt]=a[Nt]=a[_t]=a[Ot]=a[zt]=a[Ut]=a[Rt]=a[Bt]=!1;function Jt(e){return Z(e)&&At(e.length)&&!!a[j(e)]}var ei=Jt;function ti(e){return function(t){return e(t)}}var ii=ti,he=typeof exports=="object"&&exports&&!exports.nodeType&&exports,T=he&&typeof module=="object"&&module&&!module.nodeType&&module,ri=T&&T.exports===he,q=ri&&ge.process,ni=function(){try{var e=T&&T.require&&T.require("util").types;return e||q&&q.binding&&q.binding("util")}catch{}}(),ne=ni,ae=ne&&ne.isTypedArray,Fr=ae?ii(ae):ei,ai=Object.prototype,Vr=ai.hasOwnProperty;function oi(e,t){return function(i){return e(t(i))}}var li=oi,qr=li(Object.keys,Object),si=Object.prototype,Gr=si.hasOwnProperty,ui=x(Object,"create"),$=ui;function di(){this.__data__=$?$(null):{},this.size=0}var ci=di;function pi(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var gi=pi,mi="__lodash_hash_undefined__",bi=Object.prototype,yi=bi.hasOwnProperty;function fi(e){var t=this.__data__;if($){var i=t[e];return i===mi?void 0:i}return yi.call(t,e)?t[e]:void 0}var hi=fi,vi=Object.prototype,wi=vi.hasOwnProperty;function ki(e){var t=this.__data__;return $?t[e]!==void 0:wi.call(t,e)}var xi=ki,Ai="__lodash_hash_undefined__";function Ii(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=$&&t===void 0?Ai:t,this}var Ci=Ii;function A(e){var t=-1,i=e==null?0:e.length;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[1])}}A.prototype.clear=ci;A.prototype.delete=gi;A.prototype.get=hi;A.prototype.has=xi;A.prototype.set=Ci;var oe=A;function Si(){this.__data__=[],this.size=0}var Ei=Si;function Mi(e,t){for(var i=e.length;i--;)if(wt(e[i][0],t))return i;return-1}var _=Mi,Ti=Array.prototype,$i=Ti.splice;function Li(e){var t=this.__data__,i=_(t,e);if(i<0)return!1;var r=t.length-1;return i==r?t.pop():$i.call(t,i,1),--this.size,!0}var ji=Li;function Di(e){var t=this.__data__,i=_(t,e);return i<0?void 0:t[i][1]}var Pi=Di;function Ni(e){return _(this.__data__,e)>-1}var _i=Ni;function Oi(e,t){var i=this.__data__,r=_(i,e);return r<0?(++this.size,i.push([e,t])):i[r][1]=t,this}var zi=Oi;function I(e){var t=-1,i=e==null?0:e.length;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[1])}}I.prototype.clear=Ei;I.prototype.delete=ji;I.prototype.get=Pi;I.prototype.has=_i;I.prototype.set=zi;var O=I,Ui=x(g,"Map"),L=Ui;function Ri(){this.size=0,this.__data__={hash:new oe,map:new(L||O),string:new oe}}var Bi=Ri;function Fi(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var Vi=Fi;function qi(e,t){var i=e.__data__;return Vi(t)?i[typeof t=="string"?"string":"hash"]:i.map}var z=qi;function Gi(e){var t=z(this,e).delete(e);return this.size-=t?1:0,t}var Yi=Gi;function Qi(e){return z(this,e).get(e)}var Hi=Qi;function Ki(e){return z(this,e).has(e)}var Wi=Ki;function Zi(e,t){var i=z(this,e),r=i.size;return i.set(e,t),this.size+=i.size==r?0:1,this}var Xi=Zi;function C(e){var t=-1,i=e==null?0:e.length;for(this.clear();++t<i;){var r=e[t];this.set(r[0],r[1])}}C.prototype.clear=Bi;C.prototype.delete=Yi;C.prototype.get=Hi;C.prototype.has=Wi;C.prototype.set=Xi;var ve=C;function Ji(){this.__data__=new O,this.size=0}var er=Ji;function tr(e){var t=this.__data__,i=t.delete(e);return this.size=t.size,i}var ir=tr;function rr(e){return this.__data__.get(e)}var nr=rr;function ar(e){return this.__data__.has(e)}var or=ar,lr=200;function sr(e,t){var i=this.__data__;if(i instanceof O){var r=i.__data__;if(!L||r.length<lr-1)return r.push([e,t]),this.size=++i.size,this;i=this.__data__=new ve(r)}return i.set(e,t),this.size=i.size,this}var ur=sr;function D(e){var t=this.__data__=new O(e);this.size=t.size}D.prototype.clear=er;D.prototype.delete=ir;D.prototype.get=nr;D.prototype.has=or;D.prototype.set=ur;var dr=Object.prototype,Yr=dr.propertyIsEnumerable,cr=x(g,"DataView"),Q=cr,pr=x(g,"Promise"),H=pr,gr=x(g,"Set"),K=gr,le="[object Map]",mr="[object Object]",se="[object Promise]",ue="[object Set]",de="[object WeakMap]",ce="[object DataView]",br=y(Q),yr=y(L),fr=y(H),hr=y(K),vr=y(Y),w=j;(Q&&w(new Q(new ArrayBuffer(1)))!=ce||L&&w(new L)!=le||H&&w(H.resolve())!=se||K&&w(new K)!=ue||Y&&w(new Y)!=de)&&(w=function(e){var t=j(e),i=t==mr?e.constructor:void 0,r=i?y(i):"";if(r)switch(r){case br:return ce;case yr:return le;case fr:return se;case hr:return ue;case vr:return de}return t});var Qr=g.Uint8Array,wr="__lodash_hash_undefined__";function kr(e){return this.__data__.set(e,wr),this}var xr=kr;function Ar(e){return this.__data__.has(e)}var Ir=Ar;function W(e){var t=-1,i=e==null?0:e.length;for(this.__data__=new ve;++t<i;)this.add(e[t])}W.prototype.add=W.prototype.push=xr;W.prototype.has=Ir;var pe=k?k.prototype:void 0,Hr=pe?pe.valueOf:void 0,Cr=Object.prototype,Kr=Cr.hasOwnProperty,Sr=Object.prototype,Wr=Sr.hasOwnProperty,Zr=new RegExp(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,"i"),Xr=new RegExp(/[A-Fa-f0-9]{1}/,"g"),Jr=new RegExp(/[A-Fa-f0-9]{2}/,"g");var Er="ly.img.ai";function we(e){return`${Er}.${e}`}var G="@imgly/plugin-ai-generation",en=`
|
|
2
2
|
<svg>
|
|
3
3
|
<symbol
|
|
4
4
|
fill="none"
|
|
@@ -59,7 +59,7 @@ var je=typeof global=="object"&&global&&global.Object===Object&&global,ge=je,Le=
|
|
|
59
59
|
|
|
60
60
|
</symbol>
|
|
61
61
|
</svg>
|
|
62
|
-
`;var ke={openapi:"3.0.0",info:{title:"Elevenlabs API",version:"1.0.0",description:"Elevenlabs API"},components:{schemas:{ElevenlabsInput:{title:"TextToSpeechInput",type:"object",properties:{prompt:{title:"Prompt",type:"string","x-imgly-builder":{component:"TextArea"}},voice_id:{title:"Voice",type:"string",description:"The voice ID to use for the speech synthesis.",default:"JBFqnCBsd6RMkjVDRZzb"},speed:{title:"Speed",type:"number",description:"The speed of the speech synthesis.",default:1,"x-imgly-step":.05,minimum:.7,maximum:1.2}},"x-elevenlabs-order-properties":["prompt","style","image_size"],required:["prompt","voice_id"]}}}};var Ie={version:"2.0.0",id:"ly.img.voices.eleventlabs",assets:[{id:"JBFqnCBsd6RMkjVDRZzb",label:{en:"George"},tags:{en:["British Accent","warm","middle aged","male","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/JBFqnCBsd6RMkjVDRZzb/e6206d1a-0721-4787-aafb-06a6e705cac5.mp3",thumbUri:"{{base_url}}george.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.42"}},{id:"FGY2WhTYpPnrIDTdsKH5",label:{en:"Laura"},tags:{en:["American Accent","upbeat","young","female","social media"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/FGY2WhTYpPnrIDTdsKH5/67341759-ad08-41a5-be6e-de12fe448618.mp3",thumbUri:"{{base_url}}laura.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.04"}},{id:"IKne3meq5aSn9XLyUdCD",label:{en:"Charlie"},tags:{en:["Australian Accent","natural","middle aged","male","conversational"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/IKne3meq5aSn9XLyUdCD/102de6f2-22ed-43e0-a1f1-111fa75c5481.mp3",thumbUri:"{{base_url}}charlie.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.53"}},{id:"9BWtsMINqrJLrRacOk9x",label:{en:"Aria"},tags:{en:["American Accent","expressive","middle-aged","female","social media"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/9BWtsMINqrJLrRacOk9x/405766b8-1f4e-4d3c-aba1-6f25333823ec.mp3",thumbUri:"{{base_url}}aria.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.71"}},{id:"EXAVITQu4vr4xnSDxMaL",label:{en:"Sarah"},tags:{en:["american Accent","soft","young","female","news"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/EXAVITQu4vr4xnSDxMaL/01a3e33c-6e99-4ee7-8543-ff2216a32186.mp3",thumbUri:"{{base_url}}sarah2.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.53"}},{id:"SAz9YHcvj6GT2YYXdXww",label:{en:"River"},tags:{en:["American Accent","confident","middle-aged","non-binary","social media"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/SAz9YHcvj6GT2YYXdXww/e6c95f0b-2227-491a-b3d7-2249240decb7.mp3",thumbUri:"{{base_url}}river.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.53"}},{id:"XrExE9yKIg1WjnnlVkGX",label:{en:"Matilda"},tags:{en:["American Accent","friendly","middle-aged","female","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/XrExE9yKIg1WjnnlVkGX/b930e18d-6b4d-466e-bab2-0ae97c6d8535.mp3",thumbUri:"{{base_url}}matilda.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.64"}},{id:"N2lVS1w4EtoT3dr4eOWO",label:{en:"Callum"},tags:{en:["Transatlantic Accent","intense","middle-aged","male","characters"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/N2lVS1w4EtoT3dr4eOWO/ac833bd8-ffda-4938-9ebc-b0f99ca25481.mp3",thumbUri:"{{base_url}}callum.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"4.18"}},{id:"TX3LPaxmHKxFdv7VOQHJ",label:{en:"Liam"},tags:{en:["American Accent","articulate","young","male","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/TX3LPaxmHKxFdv7VOQHJ/63148076-6363-42db-aea8-31424308b92c.mp3",thumbUri:"{{base_url}}liam.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"4.13"}},{id:"XB0fDUnXU5powFXDhCwa",label:{en:"Charlotte"},tags:{en:["Swedish Accent","seductive","young","female","characters"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/XB0fDUnXU5powFXDhCwa/942356dc-f10d-4d89-bda5-4f8505ee038b.mp3",thumbUri:"{{base_url}}charlotte.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"5.25"}},{id:"CwhRBWXzGAHq8TQ4Fs17",label:{en:"Roger"},tags:{en:["American Accent","confident","middle-aged","male","social media"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/CwhRBWXzGAHq8TQ4Fs17/58ee3ff5-f6f2-4628-93b8-e38eb31806b0.mp3",thumbUri:"{{base_url}}roger.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.89"}},{id:"nPczCjzI2devNBz1zQrb",label:{en:"Brian"},tags:{en:["American Accent","deep","middle-aged","male","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/nPczCjzI2devNBz1zQrb/2dd3e72c-4fd3-42f1-93ea-abc5d4e5aa1d.mp3",thumbUri:"{{base_url}}brian.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"5.46"}},{id:"cgSgspJ2msm6clMCkdW9",label:{en:"Jessica"},tags:{en:["American Accent","expressive","young","female","conversational"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/cgSgspJ2msm6clMCkdW9/56a97bf8-b69b-448f-846c-c3a11683d45a.mp3",thumbUri:"{{base_url}}jessica.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.89"}},{id:"Xb7hH8MSUJpSbSDYk0k2",label:{en:"Alice"},tags:{en:["British Accent","confident","middle-aged","female","news"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/Xb7hH8MSUJpSbSDYk0k2/d10f7534-11f6-41fe-a012-2de1e482d336.mp3",thumbUri:"{{base_url}}alice.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.53"}},{id:"pFZP5JQG7iQjIQuC4Bku",label:{en:"Lily"},tags:{en:["British Accent","warm","middle-aged","female","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/pFZP5JQG7iQjIQuC4Bku/89b68b35-b3dd-4348-a84a-a3c13a3c2b30.mp3",thumbUri:"{{base_url}}lily.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.11"}},{id:"cjVigY5qzO86Huf0OWal",label:{en:"Eric"},tags:{en:["American Accent","friendly","middle-aged","male","conversational"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/cjVigY5qzO86Huf0OWal/d098fda0-6456-4030-b3d8-63aa048c9070.mp3",thumbUri:"{{base_url}}eric.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.32"}},{id:"bIHbv24MWmeRgasZH58o",label:{en:"Will"},tags:{en:["American Accent","friendly","young","male","social media"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/bIHbv24MWmeRgasZH58o/8caf8f3d-ad29-4980-af41-53f20c72d7a4.mp3",thumbUri:"{{base_url}}will.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.74"}},{id:"iP95p4xoKVk53GoZ742B",label:{en:"Chris"},tags:{en:["American Accent","casual","middle-aged","male","conversational"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/iP95p4xoKVk53GoZ742B/3f4bde72-cc48-40dd-829f-57fbf906f4d7.mp3",thumbUri:"{{base_url}}chris.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.29"}},{id:"pqHfZKP75CvOlQylNhV4",label:{en:"Bill"},tags:{en:["American Accent","trustworthy","old","male","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/pqHfZKP75CvOlQylNhV4/d782b3ff-84ba-4029-848c-acf01285524d.mp3",thumbUri:"{{base_url}}bill.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"5.51"}},{id:"onwK4e9ZLuTAKqWW03F9",label:{en:"Daniel"},tags:{en:["British Accent","authoritative","middle-aged","male","news"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/onwK4e9ZLuTAKqWW03F9/7eee0236-1a72-4b86-b303-5dcadc007ba9.mp3",thumbUri:"{{base_url}}daniel.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"5.75"}}]};function xe(e,t,i){return Math.min(Math.max(e,t),i)}async function U(e){return new Promise((t,i)=>{let r=new Audio;r.src=e,r.addEventListener("loadedmetadata",()=>{let n=r.duration;t(n)}),r.addEventListener("error",n=>{i(new Error(`Failed to load audio metadata: ${n.message}`))})})}var $r={width:256,height:256,backgroundColor:"transparent",waveformColor:"black",pixelsPerSecond:100};async function R(e,t={}){let{width:i,height:r,backgroundColor:n,waveformColor:u,pixelsPerSecond:a}={...$r,...t},p=new AudioContext,l=await e.arrayBuffer(),s=await p.decodeAudioData(l),d=s.duration,c=Math.max(i,Math.ceil(d*a)),P=s.sampleRate*d/c,h=document.createElement("canvas");h.width=i,h.height=r;let m=h.getContext("2d");m.fillStyle=n,m.fillRect(0,0,i,r);let Me=s.getChannelData(0),S=r/2,Ee=s.length;m.strokeStyle=u,m.beginPath(),m.moveTo(0,S);for(let b=0;b<i;b++){let M=1,v=-1;for(let F=0;F<P;F++){let X=Math.floor(b*P+F);if(X<Ee){let N=Me[X];N<M&&(M=N),N>v&&(v=N)}}let Te=S-M*S,$e=S-v*S;m.lineTo(b,$e),m.lineTo(b,Te)}return m.stroke(),new Promise((b,M)=>{h.toBlob(v=>{v?b(v):M(new Error("Canvas to Blob conversion failed"))})})}function B(e,t,i={}){let{ellipsis:r="...",preserveSentences:n=!1,minLength:u=0}=i;if(!e||e.length<=u||e.length<=t)return e;let a=t-r.length;if(n){let s=/[.!?](?:\s|$)/g,d,c=0;for(;(d=s.exec(e))!==null&&!(d.index>a);)c=d.index+1;if(c>0)return e.substring(0,c)+r}let p=e.substring(0,a),l=p.lastIndexOf(" ");return l>0&&(p=p.substring(0,l)),p+r}function Ae(e){return async({cesdk:t})=>jr(t,e)}function jr(e,t){let i=t.baseURL??"https://cdn.img.ly/assets/plugins/plugin-ai-audio-generation-web/v1/elevenlabs/",r="ly.img.ai.audio-generation.speech.elevenlabs",n=`${r}.voiceSelection`,u=Dr(e,i),a="elevenlabs/monolingual/v1";return e.setTranslations({en:{[`panel.${a}`]:"AI Voice",[`panel.${n}`]:"Select a Voice",[`panel.${we("elevenlabs")}`]:"AI Voice",[`libraries.${a}.history.label`]:"AI Voice","libraries.elevenlabs/sound-generation.history.label":"Generated Sound"}}),{id:a,name:"Elevenlabs Multilingual V2",kind:"audio",initialize:async()=>{e.ui.addAssetLibraryEntry({id:u,sourceIds:[u],gridColumns:3}),e.ui.registerPanel(n,({builder:l,payload:s})=>{l.Library(`${r}.voiceSelection.library`,{searchable:!0,entries:[u],onSelect:async d=>{let{id:c,label:f}=d;s?.onSelect(c,f??c,d.meta?.thumbUri),e.ui.closePanel(n)}})})},input:{panel:{type:"schema",document:ke,inputReference:"#/components/schemas/ElevenlabsInput",useFlow:"generation-only",renderCustomProperty:{voice_id:l=>{let s=l.experimental.global("voice",{voiceId:"JBFqnCBsd6RMkjVDRZzb",name:"George",thumbnail:`${i}george.webp`});return l.builder.Button(`${r}.openVoiceSelection`,{inputLabel:[`ly.img.plugin-ai-audio-generation-web.${a}.property.voice_id`,"ly.img.plugin-ai-generation-web.property.voice_id",`ly.img.plugin-ai-audio-generation-web.${a}.defaults.property.voice_id`,"ly.img.plugin-ai-generation-web.defaults.property.voice_id"],icon:"@imgly/Appearance",trailingIcon:"@imgly/ChevronRight",labelAlignment:"left",label:s.value.name,onClick:()=>{e.ui.openPanel(n,{payload:{id:s.value.voiceId,onSelect:(d,c,f)=>{s.setValue({voiceId:d,name:c,thumbnail:f})}}})}}),()=>({id:"voice_id",type:"string",value:s.value.voiceId})}},getBlockInput:async l=>({audio:{label:B(l.prompt,25)}})}},output:{abortable:!0,history:t.history??"@imgly/indexedDB",middleware:t.middlewares??t.middleware??[],generate:async(l,{abortSignal:s})=>{let d=await Lr(l.prompt,l.voice_id,{speed:parseFloat(l.speed.toFixed(10))},t,s),c=URL.createObjectURL(d),[f,P]=await Promise.all([R(d,{width:512,height:128}),U(c)]),h=URL.createObjectURL(f);return{kind:"audio",url:c,duration:P,thumbnailUrl:h}}},config:t}}async function Lr(e,t,i,r,n){let u=`${r.proxyUrl}/v1/text-to-speech/${t}`,a=await fetch(u,{signal:n,method:"POST",headers:{Accept:"audio/mpeg","Content-Type":"application/json",...r.headers??{}},body:JSON.stringify({text:e,model_id:"eleven_multilingual_v2",voice_settings:{speed:xe(i?.speed||1,.7,1.2),stability:i?.stability||.5,similarity_boost:i?.similarityBoost||.5}})});if(!a.ok){let p=await a.text();throw new Error(`API error: ${a.status} - ${p}`)}return a.blob()}function Dr(e,t){let{id:i,assets:r}=Ie;return e.engine.asset.addLocalSource(i),r.map(async n=>{e.engine.asset.addAssetToSource(i,{...n,meta:{...n.meta,thumbUri:n.meta.thumbUri.replace("{{base_url}}",`${t}thumbnails/`)}})}),i}var Ce={openapi:"3.0.0",info:{title:"Elevenlabs Sound Effects API",version:"1.0.0",description:"Elevenlabs Sound Effects API"},components:{schemas:{TextToSoundInput:{title:"TextToSoundInput",type:"object",properties:{text:{title:"Prompt",type:"string","x-imgly-builder":{component:"TextArea"}},duration_seconds:{title:"Duration (sec.)",type:"number",minimum:.6,maximum:22,default:2}},"x-elevenlabs-order-properties":["text"],required:["text"]}}}};function Se(e){return async({cesdk:t})=>Nr(t,e)}function Nr(e,t){let i="elevenlabs/sound-generation";return e.setTranslations({en:{[`panel.${i}`]:"Generate Sound"}}),{id:i,name:"Elevenlabs Sound Generation",kind:"audio",initialize:async()=>{},input:{panel:{type:"schema",document:Ce,inputReference:"#/components/schemas/TextToSoundInput",useFlow:"generation-only",getBlockInput:async n=>({audio:{label:B(n.text,25)}})}},output:{abortable:!0,history:t.history??"@imgly/indexedDB",middleware:t.middlewares??t.middleware??[],generate:async(n,{abortSignal:u})=>{let a=await Or(n.text,n.duration_seconds,t,u),p=URL.createObjectURL(a),[l,s]=await Promise.all([R(a,{width:512,height:128}),U(p)]),d=URL.createObjectURL(l);return{kind:"audio",url:p,duration:s,thumbnailUrl:d}}},config:t}}async function Or(e,t,i,r){let n=`${i.proxyUrl}/v1/sound-generation`,u=await fetch(n,{signal:r,method:"POST",headers:{Accept:"audio/mpeg","Content-Type":"application/json",...i.headers??{}},body:JSON.stringify({text:e,duration_seconds:t})});if(!u.ok){let a=await u.text();throw new Error(`API error: ${u.status} - ${a}`)}return u.blob()}var _r={ElevenMultilingualV2:Ae,ElevenSoundEffects:Se},hn=_r;export{hn as default};
|
|
62
|
+
`;var ke={openapi:"3.0.0",info:{title:"Elevenlabs API",version:"1.0.0",description:"Elevenlabs API"},components:{schemas:{ElevenlabsInput:{title:"TextToSpeechInput",type:"object",properties:{prompt:{title:"Prompt",type:"string","x-imgly-builder":{component:"TextArea"}},voice_id:{title:"Voice",type:"string",description:"The voice ID to use for the speech synthesis.",default:"JBFqnCBsd6RMkjVDRZzb"},speed:{title:"Speed",type:"number",description:"The speed of the speech synthesis.",default:1,"x-imgly-step":.05,minimum:.7,maximum:1.2}},"x-elevenlabs-order-properties":["prompt","style","image_size"],required:["prompt","voice_id"]}}}};var xe={version:"2.0.0",id:"ly.img.voices.eleventlabs",assets:[{id:"JBFqnCBsd6RMkjVDRZzb",label:{en:"George"},tags:{en:["British Accent","warm","middle aged","male","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/JBFqnCBsd6RMkjVDRZzb/e6206d1a-0721-4787-aafb-06a6e705cac5.mp3",thumbUri:"{{base_url}}george.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.42"}},{id:"FGY2WhTYpPnrIDTdsKH5",label:{en:"Laura"},tags:{en:["American Accent","upbeat","young","female","social media"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/FGY2WhTYpPnrIDTdsKH5/67341759-ad08-41a5-be6e-de12fe448618.mp3",thumbUri:"{{base_url}}laura.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.04"}},{id:"IKne3meq5aSn9XLyUdCD",label:{en:"Charlie"},tags:{en:["Australian Accent","natural","middle aged","male","conversational"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/IKne3meq5aSn9XLyUdCD/102de6f2-22ed-43e0-a1f1-111fa75c5481.mp3",thumbUri:"{{base_url}}charlie.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.53"}},{id:"9BWtsMINqrJLrRacOk9x",label:{en:"Aria"},tags:{en:["American Accent","expressive","middle-aged","female","social media"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/9BWtsMINqrJLrRacOk9x/405766b8-1f4e-4d3c-aba1-6f25333823ec.mp3",thumbUri:"{{base_url}}aria.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.71"}},{id:"EXAVITQu4vr4xnSDxMaL",label:{en:"Sarah"},tags:{en:["american Accent","soft","young","female","news"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/EXAVITQu4vr4xnSDxMaL/01a3e33c-6e99-4ee7-8543-ff2216a32186.mp3",thumbUri:"{{base_url}}sarah2.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.53"}},{id:"SAz9YHcvj6GT2YYXdXww",label:{en:"River"},tags:{en:["American Accent","confident","middle-aged","non-binary","social media"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/SAz9YHcvj6GT2YYXdXww/e6c95f0b-2227-491a-b3d7-2249240decb7.mp3",thumbUri:"{{base_url}}river.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.53"}},{id:"XrExE9yKIg1WjnnlVkGX",label:{en:"Matilda"},tags:{en:["American Accent","friendly","middle-aged","female","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/XrExE9yKIg1WjnnlVkGX/b930e18d-6b4d-466e-bab2-0ae97c6d8535.mp3",thumbUri:"{{base_url}}matilda.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.64"}},{id:"N2lVS1w4EtoT3dr4eOWO",label:{en:"Callum"},tags:{en:["Transatlantic Accent","intense","middle-aged","male","characters"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/N2lVS1w4EtoT3dr4eOWO/ac833bd8-ffda-4938-9ebc-b0f99ca25481.mp3",thumbUri:"{{base_url}}callum.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"4.18"}},{id:"TX3LPaxmHKxFdv7VOQHJ",label:{en:"Liam"},tags:{en:["American Accent","articulate","young","male","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/TX3LPaxmHKxFdv7VOQHJ/63148076-6363-42db-aea8-31424308b92c.mp3",thumbUri:"{{base_url}}liam.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"4.13"}},{id:"XB0fDUnXU5powFXDhCwa",label:{en:"Charlotte"},tags:{en:["Swedish Accent","seductive","young","female","characters"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/XB0fDUnXU5powFXDhCwa/942356dc-f10d-4d89-bda5-4f8505ee038b.mp3",thumbUri:"{{base_url}}charlotte.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"5.25"}},{id:"CwhRBWXzGAHq8TQ4Fs17",label:{en:"Roger"},tags:{en:["American Accent","confident","middle-aged","male","social media"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/CwhRBWXzGAHq8TQ4Fs17/58ee3ff5-f6f2-4628-93b8-e38eb31806b0.mp3",thumbUri:"{{base_url}}roger.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.89"}},{id:"nPczCjzI2devNBz1zQrb",label:{en:"Brian"},tags:{en:["American Accent","deep","middle-aged","male","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/nPczCjzI2devNBz1zQrb/2dd3e72c-4fd3-42f1-93ea-abc5d4e5aa1d.mp3",thumbUri:"{{base_url}}brian.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"5.46"}},{id:"cgSgspJ2msm6clMCkdW9",label:{en:"Jessica"},tags:{en:["American Accent","expressive","young","female","conversational"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/cgSgspJ2msm6clMCkdW9/56a97bf8-b69b-448f-846c-c3a11683d45a.mp3",thumbUri:"{{base_url}}jessica.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.89"}},{id:"Xb7hH8MSUJpSbSDYk0k2",label:{en:"Alice"},tags:{en:["British Accent","confident","middle-aged","female","news"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/Xb7hH8MSUJpSbSDYk0k2/d10f7534-11f6-41fe-a012-2de1e482d336.mp3",thumbUri:"{{base_url}}alice.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.53"}},{id:"pFZP5JQG7iQjIQuC4Bku",label:{en:"Lily"},tags:{en:["British Accent","warm","middle-aged","female","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/pFZP5JQG7iQjIQuC4Bku/89b68b35-b3dd-4348-a84a-a3c13a3c2b30.mp3",thumbUri:"{{base_url}}lily.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.11"}},{id:"cjVigY5qzO86Huf0OWal",label:{en:"Eric"},tags:{en:["American Accent","friendly","middle-aged","male","conversational"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/cjVigY5qzO86Huf0OWal/d098fda0-6456-4030-b3d8-63aa048c9070.mp3",thumbUri:"{{base_url}}eric.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.32"}},{id:"bIHbv24MWmeRgasZH58o",label:{en:"Will"},tags:{en:["American Accent","friendly","young","male","social media"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/bIHbv24MWmeRgasZH58o/8caf8f3d-ad29-4980-af41-53f20c72d7a4.mp3",thumbUri:"{{base_url}}will.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"2.74"}},{id:"iP95p4xoKVk53GoZ742B",label:{en:"Chris"},tags:{en:["American Accent","casual","middle-aged","male","conversational"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/iP95p4xoKVk53GoZ742B/3f4bde72-cc48-40dd-829f-57fbf906f4d7.mp3",thumbUri:"{{base_url}}chris.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"3.29"}},{id:"pqHfZKP75CvOlQylNhV4",label:{en:"Bill"},tags:{en:["American Accent","trustworthy","old","male","narration"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/pqHfZKP75CvOlQylNhV4/d782b3ff-84ba-4029-848c-acf01285524d.mp3",thumbUri:"{{base_url}}bill.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"5.51"}},{id:"onwK4e9ZLuTAKqWW03F9",label:{en:"Daniel"},tags:{en:["British Accent","authoritative","middle-aged","male","news"]},meta:{uri:"https://storage.googleapis.com/eleven-public-prod/premade/voices/onwK4e9ZLuTAKqWW03F9/7eee0236-1a72-4b86-b303-5dcadc007ba9.mp3",thumbUri:"{{base_url}}daniel.webp",blockType:"//ly.img.ubq/audio",mimeType:"audio/x-m4a",duration:"5.75"}}]};function Ae(e,t,i){return Math.min(Math.max(e,t),i)}async function U(e){return new Promise((t,i)=>{let r=new Audio;r.src=e,r.addEventListener("loadedmetadata",()=>{let n=r.duration;t(n)}),r.addEventListener("error",n=>{i(new Error(`Failed to load audio metadata: ${n.message}`))})})}var $r={width:256,height:256,backgroundColor:"transparent",waveformColor:"black",pixelsPerSecond:100};async function R(e,t={}){let{width:i,height:r,backgroundColor:n,waveformColor:u,pixelsPerSecond:o}={...$r,...t},p=new AudioContext,l=await e.arrayBuffer(),s=await p.decodeAudioData(l),d=s.duration,c=Math.max(i,Math.ceil(d*o)),P=s.sampleRate*d/c,h=document.createElement("canvas");h.width=i,h.height=r;let m=h.getContext("2d");m.fillStyle=n,m.fillRect(0,0,i,r);let Ee=s.getChannelData(0),S=r/2,Me=s.length;m.strokeStyle=u,m.beginPath(),m.moveTo(0,S);for(let b=0;b<i;b++){let E=1,v=-1;for(let F=0;F<P;F++){let X=Math.floor(b*P+F);if(X<Me){let N=Ee[X];N<E&&(E=N),N>v&&(v=N)}}let Te=S-E*S,$e=S-v*S;m.lineTo(b,$e),m.lineTo(b,Te)}return m.stroke(),new Promise((b,E)=>{h.toBlob(v=>{v?b(v):E(new Error("Canvas to Blob conversion failed"))})})}function B(e,t,i={}){let{ellipsis:r="...",preserveSentences:n=!1,minLength:u=0}=i;if(!e||e.length<=u||e.length<=t)return e;let o=t-r.length;if(n){let s=/[.!?](?:\s|$)/g,d,c=0;for(;(d=s.exec(e))!==null&&!(d.index>o);)c=d.index+1;if(c>0)return e.substring(0,c)+r}let p=e.substring(0,o),l=p.lastIndexOf(" ");return l>0&&(p=p.substring(0,l)),p+r}function Ie(e){return async({cesdk:t})=>Lr(t,e)}function Lr(e,t){let i=t.baseURL??"https://cdn.img.ly/assets/plugins/plugin-ai-audio-generation-web/v1/elevenlabs/",r="ly.img.ai.audio-generation.speech.elevenlabs",n=`${r}.voiceSelection`,u=Dr(e,i),o="elevenlabs/monolingual/v1";return e.setTranslations({en:{[`panel.${o}`]:"AI Voice",[`panel.${n}`]:"Select a Voice",[`panel.${we("elevenlabs")}`]:"AI Voice",[`libraries.${o}.history.label`]:"AI Voice","libraries.elevenlabs/sound-generation.history.label":"Generated Sound"}}),{id:o,name:"Elevenlabs Multilingual V2",kind:"audio",initialize:async()=>{e.ui.addAssetLibraryEntry({id:u,sourceIds:[u],gridColumns:3}),e.ui.registerPanel(n,({builder:l,payload:s})=>{l.Library(`${r}.voiceSelection.library`,{searchable:!0,entries:[u],onSelect:async d=>{let{id:c,label:f}=d;s?.onSelect(c,f??c,d.meta?.thumbUri),e.ui.closePanel(n)}})})},input:{panel:{type:"schema",document:ke,inputReference:"#/components/schemas/ElevenlabsInput",useFlow:"generation-only",renderCustomProperty:{voice_id:l=>{let s=l.experimental.global("voice",{voiceId:"JBFqnCBsd6RMkjVDRZzb",name:"George",thumbnail:`${i}george.webp`});return l.builder.Button(`${r}.openVoiceSelection`,{inputLabel:[`ly.img.plugin-ai-audio-generation-web.${o}.property.voice_id`,"ly.img.plugin-ai-generation-web.property.voice_id",`ly.img.plugin-ai-audio-generation-web.${o}.defaults.property.voice_id`,"ly.img.plugin-ai-generation-web.defaults.property.voice_id"],icon:"@imgly/Appearance",trailingIcon:"@imgly/ChevronRight",labelAlignment:"left",label:s.value.name,onClick:()=>{e.ui.openPanel(n,{payload:{id:s.value.voiceId,onSelect:(d,c,f)=>{s.setValue({voiceId:d,name:c,thumbnail:f})}}})}}),()=>({id:"voice_id",type:"string",value:s.value.voiceId})}},getBlockInput:async l=>({audio:{label:B(l.prompt,25)}})}},output:{abortable:!0,history:t.history??"@imgly/indexedDB",middleware:t.middlewares??t.middleware??[],generate:async(l,{abortSignal:s})=>{let d=await jr(l.prompt,l.voice_id,{speed:parseFloat(l.speed.toFixed(10))},t,s),c=URL.createObjectURL(d),[f,P]=await Promise.all([R(d,{width:512,height:128}),U(c)]),h=URL.createObjectURL(f);return{kind:"audio",url:c,duration:P,thumbnailUrl:h}}},config:t}}async function jr(e,t,i,r,n){let u=`${r.proxyUrl}/v1/text-to-speech/${t}`,o=await fetch(u,{signal:n,method:"POST",headers:{Accept:"audio/mpeg","Content-Type":"application/json",...r.headers??{}},body:JSON.stringify({text:e,model_id:"eleven_multilingual_v2",voice_settings:{speed:Ae(i?.speed||1,.7,1.2),stability:i?.stability||.5,similarity_boost:i?.similarityBoost||.5}})});if(!o.ok){let p=await o.text();throw new Error(`API error: ${o.status} - ${p}`)}return o.blob()}function Dr(e,t){let{id:i,assets:r}=xe;return e.engine.asset.addLocalSource(i),r.map(async n=>{e.engine.asset.addAssetToSource(i,{...n,meta:{...n.meta,thumbUri:n.meta.thumbUri.replace("{{base_url}}",`${t}thumbnails/`)}})}),i}var Ce={openapi:"3.0.0",info:{title:"Elevenlabs Sound Effects API",version:"1.0.0",description:"Elevenlabs Sound Effects API"},components:{schemas:{TextToSoundInput:{title:"TextToSoundInput",type:"object",properties:{text:{title:"Prompt",type:"string","x-imgly-builder":{component:"TextArea"}},duration_seconds:{title:"Duration (sec.)",type:"number",minimum:.6,maximum:22,default:2}},"x-elevenlabs-order-properties":["text"],required:["text"]}}}};function Se(e){return async({cesdk:t})=>Nr(t,e)}function Nr(e,t){let i="elevenlabs/sound-generation";return e.setTranslations({en:{[`panel.${i}`]:"Generate Sound"}}),{id:i,name:"Elevenlabs Sound Generation",kind:"audio",initialize:async()=>{},input:{panel:{type:"schema",document:Ce,inputReference:"#/components/schemas/TextToSoundInput",useFlow:"generation-only",getBlockInput:async n=>({audio:{label:B(n.text,25)}})}},output:{abortable:!0,history:t.history??"@imgly/indexedDB",middleware:t.middlewares??t.middleware??[],generate:async(n,{abortSignal:u})=>{let o=await _r(n.text,n.duration_seconds,t,u),p=URL.createObjectURL(o),[l,s]=await Promise.all([R(o,{width:512,height:128}),U(p)]),d=URL.createObjectURL(l);return{kind:"audio",url:p,duration:s,thumbnailUrl:d}}},config:t}}async function _r(e,t,i,r){let n=`${i.proxyUrl}/v1/sound-generation`,u=await fetch(n,{signal:r,method:"POST",headers:{Accept:"audio/mpeg","Content-Type":"application/json",...i.headers??{}},body:JSON.stringify({text:e,duration_seconds:t})});if(!u.ok){let o=await u.text();throw new Error(`API error: ${u.status} - ${o}`)}return u.blob()}var Or={ElevenMultilingualV2:Ie,ElevenSoundEffects:Se},hn=Or;export{hn as default};
|
|
63
63
|
/*! Bundled license information:
|
|
64
64
|
|
|
65
65
|
@imgly/plugin-ai-generation-web/dist/index.mjs:
|