@emailmaker/emailmaker 1.3.5 → 1.3.8
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 +15 -0
- package/README.md +20 -0
- package/emailmaker-core.091c986b.js +874 -0
- package/emailmaker-esm.js +53 -39
- package/{emailmaker-po.33f5584d.js → emailmaker-po.091c986b.js} +1 -1
- package/emailmaker.d.ts +95 -5
- package/emailmaker.js +54 -40
- package/iframe/.vite/manifest.json +4 -4
- package/iframe/css/sandbox.css +6 -0
- package/iframe/{iframe-eblock.33f5584d.html → iframe-eblock.091c986b.html} +2 -2
- package/iframe/{iframe.33f5584d.html → iframe.091c986b.html} +2 -2
- package/iframe/js/elMarkupHelper.DoIAMao4.js +279 -0
- package/iframe/js/{iframe-eblock.body.33f5584d.js → iframe-eblock.body.091c986b.js} +1 -1
- package/iframe/js/iframe-eblock.js +2 -2
- package/iframe/js/iframe.body.091c986b.js +129 -0
- package/iframe/js/iframe.js +2 -2
- package/package.json +1 -1
- package/runtime/react/index.js +1 -1
- package/static/core/166a67bd.js +1 -0
- package/static/core/1a65ef0f.js +1 -0
- package/static/core/{99be02b7.js → 1c67ab93.js} +1 -1
- package/static/core/{2cee0217.js → 1d004581.js} +1 -1
- package/static/core/{64c425bf.js → 220d7d31.js} +1 -1
- package/static/core/{5150fae0.js → 2da7d310.js} +2 -2
- package/static/core/322d3e9f.js +1 -0
- package/static/core/{a74cc07c.js → 34756b09.js} +1 -1
- package/static/core/36f3f772.js +1 -0
- package/static/core/3b9931cd.js +1 -0
- package/static/core/{e21f8693.js → 3bff2ae6.js} +1 -1
- package/static/core/{4a259bd9.js → 454350da.js} +1 -1
- package/static/core/{4797d4f7.js → 4852c0de.js} +6 -6
- package/static/core/{423efc66.js → 5272f5b2.js} +1 -1
- package/static/core/{97ab9fc2.js → 5f176d0a.js} +1 -1
- package/static/core/674e22a5.js +1 -0
- package/static/core/{89df46ff.js → 6ce85877.js} +1 -1
- package/static/core/7b8fbc31.js +1 -0
- package/static/core/{4ee64f35.js → 867b1e0a.js} +1 -1
- package/static/core/89b1052c.js +1 -0
- package/static/core/{d7e61b4c.js → 8b8c93f4.js} +1 -1
- package/static/core/8e97c82c.js +163 -0
- package/static/core/8eea6488.js +1 -0
- package/static/core/9a4cfb0a.js +1 -0
- package/static/core/{65db94be.js → 9d388494.js} +1 -1
- package/static/core/{d4b8f1e0.js → 9e1370a6.js} +1 -1
- package/static/core/{90aedd7b.js → a59d579e.js} +1 -1
- package/static/core/{4fd85bc9.js → a6abc393.js} +2 -2
- package/static/core/aa33047a.js +1 -0
- package/static/core/abde5a43.js +2 -0
- package/static/core/{294defd8.js → b69579c4.js} +1 -1
- package/static/core/{5913ff80.js → bcc4db3e.js} +1 -1
- package/static/core/{19f19adb.js → c0b0ceff.js} +3 -3
- package/static/core/c5edcfc7.js +1 -0
- package/static/core/{3320a3fd.js → c9d5118c.js} +1 -1
- package/static/core/{239be344.js → caf9f1a6.js} +1 -1
- package/static/core/{3a0fc0cb.js → d241119a.js} +1 -1
- package/static/core/d4c10a7e.js +10 -0
- package/static/core/d517188a.js +1 -0
- package/static/core/db92581b.js +19 -0
- package/static/core/{78663aeb.js → de0d3c9a.js} +1 -1
- package/static/core/{2fbd0ef8.js → e995a70d.js} +1 -1
- package/static/core/ee26ef3d.js +1 -0
- package/static/core/f399000c.js +1 -0
- package/static/core/{42f18479.js → f875f388.js} +1 -1
- package/static/esm/{9610f2de.js → 95cbf920.js} +1 -1
- package/static/umd-runtime/{runtime.ylG9Pc4W.js → runtime.CV4WRxRc.js} +1 -1
- package/vendor/@emailmaker/ui-kit/package.json +1 -1
- package/emailmaker-core.33f5584d.js +0 -859
- package/iframe/js/elMarkupHelper.B6dyF9UI.js +0 -278
- package/iframe/js/iframe.body.33f5584d.js +0 -129
- package/static/core/c2fc9f27.js +0 -1
- package/static/core/f52ad95a.js +0 -28
|
@@ -42,4 +42,4 @@ __emailmaker__.define("po",["require","exports","module"],function(na,ct,aa){Obj
|
|
|
42
42
|
|
|
43
43
|
`),"utf-8"):u.convert(i.join(`
|
|
44
44
|
|
|
45
|
-
`),this._charset)}})),Hn=R(((o,t)=>{var e=je(),u=st();t.exports=function(p,h){return new f(p,h).parse()};function f(p,h){this._fileContents=p,this._writeFunc="writeUInt32LE",this._readFunc="readUInt32LE",this._charset=h||"iso-8859-1",this._table={charset:this._charset,headers:void 0,translations:{}}}f.prototype.MAGIC=2500072158,f.prototype._checkMagick=function(){return this._fileContents.readUInt32LE(0)===this.MAGIC?(this._readFunc="readUInt32LE",this._writeFunc="writeUInt32LE",!0):this._fileContents.readUInt32BE(0)===this.MAGIC?(this._readFunc="readUInt32BE",this._writeFunc="writeUInt32BE",!0):!1},f.prototype._loadTranslationTable=function(){for(var p=this._offsetOriginals,h=this._offsetTranslations,i,r,s,n,l=0;l<this._total;l++)r=this._fileContents[this._readFunc](p),p+=4,i=this._fileContents[this._readFunc](p),p+=4,s=this._fileContents.slice(i,i+r),r=this._fileContents[this._readFunc](h),h+=4,i=this._fileContents[this._readFunc](h),h+=4,n=this._fileContents.slice(i,i+r),!l&&!s.toString()&&this._handleCharset(n),s=e.convert(s,"utf-8",this._charset).toString("utf-8"),n=e.convert(n,"utf-8",this._charset).toString("utf-8"),this._addString(s,n);this._fileContents=null},f.prototype._handleCharset=function(p){var h=p.toString(),i;(i=h.match(/[; ]charset\s*=\s*([\w-]+)/i))&&(this._charset=this._table.charset=u.formatCharset(i[1],this._charset)),p=e.convert(p,"utf-8",this._charset).toString("utf-8"),this._table.headers=u.parseHeader(p)},f.prototype._addString=function(p,h){var i={},r,s,n;p=p.split(""),p.length>1?(s=p.shift(),i.msgctxt=s):s="",p=p.join(""),r=p.split("\0"),p=r.shift(),i.msgid=p,(n=r.join("\0"))&&(i.msgid_plural=n),h=h.split("\0"),i.msgstr=[].concat(h||[]),this._table.translations[s]||(this._table.translations[s]={}),this._table.translations[s][p]=i},f.prototype.parse=function(){return this._checkMagick()?(this._revision=this._fileContents[this._readFunc](4),this._total=this._fileContents[this._readFunc](8),this._offsetOriginals=this._fileContents[this._readFunc](12),this._offsetTranslations=this._fileContents[this._readFunc](16),this._loadTranslationTable(),this._table):!1}})),Jn=R(((o,t)=>{var e=ot().Buffer,u=je(),f=st();t.exports=function(h){return new p(h).compile()};function p(h){this._table=h||{},this._table.headers=this._table.headers||{},this._table.translations=this._table.translations||{},this._translations=[],this._writeFunc="writeUInt32LE",this._handleCharset()}p.prototype.MAGIC=2500072158,p.prototype._handleCharset=function(){var h=(this._table.headers["content-type"]||"text/plain").split(";"),i=h.shift(),r=f.formatCharset(this._table.charset),s=[];s=h.map(function(n){var l=n.split("="),y=l.shift().trim(),g=l.join("=");return y.toLowerCase()==="charset"?(r||(r=f.formatCharset(g.trim()||"utf-8")),"charset="+r):n}),r||(r=this._table.charset||"utf-8",s.push("charset="+r)),this._table.charset=r,this._table.headers["content-type"]=i+"; "+s.join("; "),this._charset=r},p.prototype._generateList=function(){var h=[];return h.push({msgid:e.alloc(0),msgstr:u.convert(f.generateHeader(this._table.headers),this._charset)}),Object.keys(this._table.translations).forEach(function(i){typeof this._table.translations[i]=="object"&&Object.keys(this._table.translations[i]).forEach(function(r){if(typeof this._table.translations[i][r]=="object"&&!(i===""&&r==="")){var s=this._table.translations[i][r].msgid_plural,n=r,l;i&&(n=i+""+n),s&&(n+="\0"+s),l=[].concat(this._table.translations[i][r].msgstr||[]).join("\0"),h.push({msgid:u.convert(n,this._charset),msgstr:u.convert(l,this._charset)})}}.bind(this))}.bind(this)),h},p.prototype._calculateSize=function(h){var i=0,r=0,s=0;return h.forEach(function(n){i+=n.msgid.length+1,r+=n.msgstr.length+1}),s=28+8*h.length+8*h.length+i+r,{msgid:i,msgstr:r,total:s}},p.prototype._build=function(h,i){var r=e.alloc(i.total),s=0,n,l;for(r[this._writeFunc](this.MAGIC,0),r[this._writeFunc](0,4),r[this._writeFunc](h.length,8),r[this._writeFunc](28,12),r[this._writeFunc](28+8*h.length,16),r[this._writeFunc](0,20),r[this._writeFunc](28+8*h.length*2,24),s=28+16*h.length,n=0,l=h.length;n<l;n++)h[n].msgid.copy(r,s),r[this._writeFunc](h[n].msgid.length,28+n*8),r[this._writeFunc](s,28+n*8+4),r[s+h[n].msgid.length]=0,s+=h[n].msgid.length+1;for(n=0,l=h.length;n<l;n++)h[n].msgstr.copy(r,s),r[this._writeFunc](h[n].msgstr.length,28+8*h.length+n*8),r[this._writeFunc](s,28+8*h.length+n*8+4),r[s+h[n].msgstr.length]=0,s+=h[n].msgstr.length+1;return r},p.prototype.compile=function(){var h=this._generateList(),i=this._calculateSize(h);return h.sort(function(r,s){return r.msgid>s.msgid?1:r.msgid<s.msgid?-1:0}),this._build(h,i)}})),Xn=R(((o,t)=>{var e=Yn();t.exports={po:{parse:e.parse,createParseStream:e.stream,compile:Vn()},mo:{parse:Hn(),compile:Jn()}}})),Kn=R(((o,t)=>{var e=Wn();t.exports=function(u,f){f=f||{};const p={pretty:!1,fuzzy:!1,stringify:!1,format:"raw",domain:"messages",charset:"utf8",fullMF:!1,mfOptions:{}};for(const n in p)f[n]=typeof f[n]<"u"?f[n]:p[n];let h={},i={};if(f.format==="mf"){const n=u.toString().includes('"Plural-Forms:')?f.mfOptions:Object.assign({},{pluralFunction:()=>0},f.mfOptions);return i=Object.keys(n).length>0?e.parsePo(u,n):e.parsePo(u),f.fullMF?f.stringify?JSON.stringify(i,null,f.pretty?" ":null):i:(i&&(i.translations&&i.translations[""]?(h=i.translations[""],Object.keys(i.translations).forEach(function(l){l===""?Object.keys(i.translations[""]).forEach(function(y){h[y]=i.translations[""][y]}):h[l]=i.translations[l]})):h=i.translations||{}),f.stringify?JSON.stringify(h,null,f.pretty?" ":null):h)}const r=Xn().po.parse(u,p.charset),s=r.translations;if(Object.keys(s).forEach(function(n){const l=r.translations[n],y=r.headers?r.headers["plural-forms"]:"";Object.keys(l).forEach(function(g,b){const w=l[g],v=n.length?n+""+g:g,B=w.comments&&w.comments.flag&&w.comments.flag.match(/fuzzy/)!==null;(!B||f.fuzzy)&&(f.format==="jed"?i[v]=[w.msgid_plural?w.msgid_plural:null].concat(w.msgstr):y==="nplurals=1; plural=0;"?(msgstr=w.msgid_plural?[w.msgstr]:w.msgstr,i[v]=[w.msgid_plural?w.msgid_plural:null].concat(msgstr)):i[v]=[w.msgid_plural?w.msgid_plural:null].concat(w.msgstr)),f["fallback-to-msgid"]&&(B&&!f.fuzzy||w.msgstr[0]==="")&&(i[v]=[w.msgid_plural?w.msgid_plural:null].concat(w.msgid_plural?[g,w.msgid_plural]:[g]))})}),r.headers&&(i[""]=r.headers),f.format==="mf"&&delete i[""],f.format.indexOf("jed")===0){const n={domain:f.domain,locale_data:{}};if(f.format==="jed"){for(const l in i)if(i.hasOwnProperty(l)&&l!==""){for(let y=2;y<i[l].length;y++)i[l][y]===""&&(i[l][y]=i[l][0]);i[l].shift()}}n.locale_data[f.domain]=i,n.locale_data[f.domain][""]={domain:f.domain,plural_forms:i[""]["plural-forms"],lang:i[""].language},i=n}return f.stringify?JSON.stringify(i,null,f.pretty?" ":null):i}})),Zn=It(Kn());function Qn(o){if(typeof o=="function")return o;const t=o?.default;return typeof t=="function"?t:void 0}function ea(o){if(!(o==null||typeof o!="object"||Array.isArray(o)))return o}function ta(o){const t=Qn(Zn.default)?.(o,{format:"jed",fuzzy:!0,domain:"default"});return ea(t?.locale_data?.default)}var ra="1.3.
|
|
45
|
+
`),this._charset)}})),Hn=R(((o,t)=>{var e=je(),u=st();t.exports=function(p,h){return new f(p,h).parse()};function f(p,h){this._fileContents=p,this._writeFunc="writeUInt32LE",this._readFunc="readUInt32LE",this._charset=h||"iso-8859-1",this._table={charset:this._charset,headers:void 0,translations:{}}}f.prototype.MAGIC=2500072158,f.prototype._checkMagick=function(){return this._fileContents.readUInt32LE(0)===this.MAGIC?(this._readFunc="readUInt32LE",this._writeFunc="writeUInt32LE",!0):this._fileContents.readUInt32BE(0)===this.MAGIC?(this._readFunc="readUInt32BE",this._writeFunc="writeUInt32BE",!0):!1},f.prototype._loadTranslationTable=function(){for(var p=this._offsetOriginals,h=this._offsetTranslations,i,r,s,n,l=0;l<this._total;l++)r=this._fileContents[this._readFunc](p),p+=4,i=this._fileContents[this._readFunc](p),p+=4,s=this._fileContents.slice(i,i+r),r=this._fileContents[this._readFunc](h),h+=4,i=this._fileContents[this._readFunc](h),h+=4,n=this._fileContents.slice(i,i+r),!l&&!s.toString()&&this._handleCharset(n),s=e.convert(s,"utf-8",this._charset).toString("utf-8"),n=e.convert(n,"utf-8",this._charset).toString("utf-8"),this._addString(s,n);this._fileContents=null},f.prototype._handleCharset=function(p){var h=p.toString(),i;(i=h.match(/[; ]charset\s*=\s*([\w-]+)/i))&&(this._charset=this._table.charset=u.formatCharset(i[1],this._charset)),p=e.convert(p,"utf-8",this._charset).toString("utf-8"),this._table.headers=u.parseHeader(p)},f.prototype._addString=function(p,h){var i={},r,s,n;p=p.split(""),p.length>1?(s=p.shift(),i.msgctxt=s):s="",p=p.join(""),r=p.split("\0"),p=r.shift(),i.msgid=p,(n=r.join("\0"))&&(i.msgid_plural=n),h=h.split("\0"),i.msgstr=[].concat(h||[]),this._table.translations[s]||(this._table.translations[s]={}),this._table.translations[s][p]=i},f.prototype.parse=function(){return this._checkMagick()?(this._revision=this._fileContents[this._readFunc](4),this._total=this._fileContents[this._readFunc](8),this._offsetOriginals=this._fileContents[this._readFunc](12),this._offsetTranslations=this._fileContents[this._readFunc](16),this._loadTranslationTable(),this._table):!1}})),Jn=R(((o,t)=>{var e=ot().Buffer,u=je(),f=st();t.exports=function(h){return new p(h).compile()};function p(h){this._table=h||{},this._table.headers=this._table.headers||{},this._table.translations=this._table.translations||{},this._translations=[],this._writeFunc="writeUInt32LE",this._handleCharset()}p.prototype.MAGIC=2500072158,p.prototype._handleCharset=function(){var h=(this._table.headers["content-type"]||"text/plain").split(";"),i=h.shift(),r=f.formatCharset(this._table.charset),s=[];s=h.map(function(n){var l=n.split("="),y=l.shift().trim(),g=l.join("=");return y.toLowerCase()==="charset"?(r||(r=f.formatCharset(g.trim()||"utf-8")),"charset="+r):n}),r||(r=this._table.charset||"utf-8",s.push("charset="+r)),this._table.charset=r,this._table.headers["content-type"]=i+"; "+s.join("; "),this._charset=r},p.prototype._generateList=function(){var h=[];return h.push({msgid:e.alloc(0),msgstr:u.convert(f.generateHeader(this._table.headers),this._charset)}),Object.keys(this._table.translations).forEach(function(i){typeof this._table.translations[i]=="object"&&Object.keys(this._table.translations[i]).forEach(function(r){if(typeof this._table.translations[i][r]=="object"&&!(i===""&&r==="")){var s=this._table.translations[i][r].msgid_plural,n=r,l;i&&(n=i+""+n),s&&(n+="\0"+s),l=[].concat(this._table.translations[i][r].msgstr||[]).join("\0"),h.push({msgid:u.convert(n,this._charset),msgstr:u.convert(l,this._charset)})}}.bind(this))}.bind(this)),h},p.prototype._calculateSize=function(h){var i=0,r=0,s=0;return h.forEach(function(n){i+=n.msgid.length+1,r+=n.msgstr.length+1}),s=28+8*h.length+8*h.length+i+r,{msgid:i,msgstr:r,total:s}},p.prototype._build=function(h,i){var r=e.alloc(i.total),s=0,n,l;for(r[this._writeFunc](this.MAGIC,0),r[this._writeFunc](0,4),r[this._writeFunc](h.length,8),r[this._writeFunc](28,12),r[this._writeFunc](28+8*h.length,16),r[this._writeFunc](0,20),r[this._writeFunc](28+8*h.length*2,24),s=28+16*h.length,n=0,l=h.length;n<l;n++)h[n].msgid.copy(r,s),r[this._writeFunc](h[n].msgid.length,28+n*8),r[this._writeFunc](s,28+n*8+4),r[s+h[n].msgid.length]=0,s+=h[n].msgid.length+1;for(n=0,l=h.length;n<l;n++)h[n].msgstr.copy(r,s),r[this._writeFunc](h[n].msgstr.length,28+8*h.length+n*8),r[this._writeFunc](s,28+8*h.length+n*8+4),r[s+h[n].msgstr.length]=0,s+=h[n].msgstr.length+1;return r},p.prototype.compile=function(){var h=this._generateList(),i=this._calculateSize(h);return h.sort(function(r,s){return r.msgid>s.msgid?1:r.msgid<s.msgid?-1:0}),this._build(h,i)}})),Xn=R(((o,t)=>{var e=Yn();t.exports={po:{parse:e.parse,createParseStream:e.stream,compile:Vn()},mo:{parse:Hn(),compile:Jn()}}})),Kn=R(((o,t)=>{var e=Wn();t.exports=function(u,f){f=f||{};const p={pretty:!1,fuzzy:!1,stringify:!1,format:"raw",domain:"messages",charset:"utf8",fullMF:!1,mfOptions:{}};for(const n in p)f[n]=typeof f[n]<"u"?f[n]:p[n];let h={},i={};if(f.format==="mf"){const n=u.toString().includes('"Plural-Forms:')?f.mfOptions:Object.assign({},{pluralFunction:()=>0},f.mfOptions);return i=Object.keys(n).length>0?e.parsePo(u,n):e.parsePo(u),f.fullMF?f.stringify?JSON.stringify(i,null,f.pretty?" ":null):i:(i&&(i.translations&&i.translations[""]?(h=i.translations[""],Object.keys(i.translations).forEach(function(l){l===""?Object.keys(i.translations[""]).forEach(function(y){h[y]=i.translations[""][y]}):h[l]=i.translations[l]})):h=i.translations||{}),f.stringify?JSON.stringify(h,null,f.pretty?" ":null):h)}const r=Xn().po.parse(u,p.charset),s=r.translations;if(Object.keys(s).forEach(function(n){const l=r.translations[n],y=r.headers?r.headers["plural-forms"]:"";Object.keys(l).forEach(function(g,b){const w=l[g],v=n.length?n+""+g:g,B=w.comments&&w.comments.flag&&w.comments.flag.match(/fuzzy/)!==null;(!B||f.fuzzy)&&(f.format==="jed"?i[v]=[w.msgid_plural?w.msgid_plural:null].concat(w.msgstr):y==="nplurals=1; plural=0;"?(msgstr=w.msgid_plural?[w.msgstr]:w.msgstr,i[v]=[w.msgid_plural?w.msgid_plural:null].concat(msgstr)):i[v]=[w.msgid_plural?w.msgid_plural:null].concat(w.msgstr)),f["fallback-to-msgid"]&&(B&&!f.fuzzy||w.msgstr[0]==="")&&(i[v]=[w.msgid_plural?w.msgid_plural:null].concat(w.msgid_plural?[g,w.msgid_plural]:[g]))})}),r.headers&&(i[""]=r.headers),f.format==="mf"&&delete i[""],f.format.indexOf("jed")===0){const n={domain:f.domain,locale_data:{}};if(f.format==="jed"){for(const l in i)if(i.hasOwnProperty(l)&&l!==""){for(let y=2;y<i[l].length;y++)i[l][y]===""&&(i[l][y]=i[l][0]);i[l].shift()}}n.locale_data[f.domain]=i,n.locale_data[f.domain][""]={domain:f.domain,plural_forms:i[""]["plural-forms"],lang:i[""].language},i=n}return f.stringify?JSON.stringify(i,null,f.pretty?" ":null):i}})),Zn=It(Kn());function Qn(o){if(typeof o=="function")return o;const t=o?.default;return typeof t=="function"?t:void 0}function ea(o){if(!(o==null||typeof o!="object"||Array.isArray(o)))return o}function ta(o){const t=Qn(Zn.default)?.(o,{format:"jed",fuzzy:!0,domain:"default"});return ea(t?.locale_data?.default)}var ra="1.3.8";ct.parsePoCatalog=ta,ct.version=ra});
|
package/emailmaker.d.ts
CHANGED
|
@@ -501,7 +501,7 @@ export declare namespace Notify {
|
|
|
501
501
|
};
|
|
502
502
|
EMAIL_ACCESS_TO_LOCKED_ERROR: EmailDesc;
|
|
503
503
|
EMAIL_TOO_MANY_TAGS_ERROR: EmailDesc;
|
|
504
|
-
/**
|
|
504
|
+
/** @deprecated Never fired: an email with empty content now saves like any other edit. */
|
|
505
505
|
EMAIL_EMPTY_SAVE_BLOCKED: EmailDesc;
|
|
506
506
|
/** Saving was refused because the canvas has not handed all its edits over to the document yet. */
|
|
507
507
|
EMAIL_CANVAS_NOT_SYNCED_ERROR: EmailDesc;
|
|
@@ -1128,6 +1128,84 @@ export declare namespace ExportedApi {
|
|
|
1128
1128
|
/** AI long-form generator cap per period. */
|
|
1129
1129
|
ai_generator_limit: number;
|
|
1130
1130
|
}
|
|
1131
|
+
/** AgentConsentDetail is one labeled fact of a consent question, for example the address a file comes from. */
|
|
1132
|
+
interface AgentConsentDetail {
|
|
1133
|
+
readonly label: string;
|
|
1134
|
+
readonly value: string;
|
|
1135
|
+
}
|
|
1136
|
+
/** AgentConsent is what the user reads before agreeing: the action as a phrase in the user's language and facts about it. */
|
|
1137
|
+
interface AgentConsent {
|
|
1138
|
+
readonly title: string;
|
|
1139
|
+
readonly details?: readonly AgentConsentDetail[];
|
|
1140
|
+
}
|
|
1141
|
+
/** AgentConfirmItem is one action the user is asked about; show `consent` when it is there, and `title` otherwise. */
|
|
1142
|
+
interface AgentConfirmItem {
|
|
1143
|
+
/** tool is the name the model calls the command by; `command` is its id. */
|
|
1144
|
+
readonly tool: string;
|
|
1145
|
+
readonly command: string;
|
|
1146
|
+
/** title is the command title as its author wrote it; `description` is written for the model, not for the user. */
|
|
1147
|
+
readonly title: string;
|
|
1148
|
+
readonly description?: string;
|
|
1149
|
+
/**
|
|
1150
|
+
* input is a copy of the call as the model sent it: changing it does not change what runs. An action that needs consent never
|
|
1151
|
+
* holds `{ "$result": "0.element" }` references, a batch is refused before asking. Only the request about a whole batch shows
|
|
1152
|
+
* all its calls here, and the calls without consent may hold such references.
|
|
1153
|
+
*/
|
|
1154
|
+
readonly input: unknown;
|
|
1155
|
+
/** consent is the text for the user in the user's language; absent when the command gives none or it could not be read. */
|
|
1156
|
+
readonly consent?: AgentConsent;
|
|
1157
|
+
/** fromPlugin marks a command of a plugin rather than of the editor. */
|
|
1158
|
+
readonly fromPlugin?: true;
|
|
1159
|
+
}
|
|
1160
|
+
/** AgentConfirmRequest is what the user is asked before an AI agent runs a command that needs consent. */
|
|
1161
|
+
interface AgentConfirmRequest extends AgentConfirmItem {
|
|
1162
|
+
/** signal aborts when the call is cancelled or the editor is destroyed; a pending question should then close, its late answer is ignored. */
|
|
1163
|
+
readonly signal: AbortSignal;
|
|
1164
|
+
/**
|
|
1165
|
+
* batch is set when one answer covers a whole `agent.batch`: `items` lists the first actions that need consent and
|
|
1166
|
+
* `more` counts the rest. The answer applies to all of them, and a refusal leaves every call of the batch undone.
|
|
1167
|
+
*/
|
|
1168
|
+
readonly batch?: {
|
|
1169
|
+
readonly items: readonly AgentConfirmItem[];
|
|
1170
|
+
readonly more: number;
|
|
1171
|
+
};
|
|
1172
|
+
}
|
|
1173
|
+
/** AgentBatchCall is one call of the `agent_batch` tool: a tool name (or command id) and its input. */
|
|
1174
|
+
interface AgentBatchCall {
|
|
1175
|
+
readonly tool: string;
|
|
1176
|
+
readonly args?: Readonly<Record<string, unknown>>;
|
|
1177
|
+
}
|
|
1178
|
+
/**
|
|
1179
|
+
* AgentBatchResult is the value of the `agent_batch` tool. A batch stopped midway is still `ok: true`: check `failed`, the
|
|
1180
|
+
* `completed` calls before it stay done. A check before the consent window that refuses a call, or a `$result` reference in a
|
|
1181
|
+
* call that needs consent, gives `completed: 0` with that call in `failed`; a refused consent is not a result but the error `declined`.
|
|
1182
|
+
*/
|
|
1183
|
+
interface AgentBatchResult {
|
|
1184
|
+
readonly completed: number;
|
|
1185
|
+
readonly results: readonly unknown[];
|
|
1186
|
+
readonly failed?: {
|
|
1187
|
+
readonly index: number;
|
|
1188
|
+
readonly tool: string;
|
|
1189
|
+
readonly error: {
|
|
1190
|
+
readonly code: string;
|
|
1191
|
+
readonly message: string;
|
|
1192
|
+
};
|
|
1193
|
+
};
|
|
1194
|
+
}
|
|
1195
|
+
/**
|
|
1196
|
+
* AgentConfig is the policy for AI agents that work in the editor through `use('Agent')`; it only narrows what
|
|
1197
|
+
* command authors opened. `deny` and `confirm` take command ids (`crm.edit`), tool names (`crm_edit`) or prefixes with `.*` (`crm.*`).
|
|
1198
|
+
*/
|
|
1199
|
+
interface AgentConfig {
|
|
1200
|
+
/** `false` switches the way in for agents off: no tools, every call is refused. Default `true`. */
|
|
1201
|
+
enabled?: boolean;
|
|
1202
|
+
/** Commands the agent may not call. */
|
|
1203
|
+
deny?: string[];
|
|
1204
|
+
/** Commands the user confirms before the agent runs them, besides those their authors marked. */
|
|
1205
|
+
confirm?: string[];
|
|
1206
|
+
/** Ask the user in your own interface instead of the editor's window; resolve `true` to allow, any other answer gives the call the error `declined`. Called once per batch. */
|
|
1207
|
+
onConfirm?: (request: AgentConfirmRequest) => boolean | Promise<boolean>;
|
|
1208
|
+
}
|
|
1131
1209
|
/**
|
|
1132
1210
|
* Full editor chrome: themes, toolbox visibility, export actions, palette blocks, and image-center behavior.
|
|
1133
1211
|
* Pass via **`init({ config })`**; after **`init`**, use **`instance.setConfig`** / **`updateConfig`** (**`Partial<Config>`**).
|
|
@@ -1135,6 +1213,8 @@ export declare namespace ExportedApi {
|
|
|
1135
1213
|
interface Config {
|
|
1136
1214
|
/** Application mode */
|
|
1137
1215
|
mode?: ConfigMods;
|
|
1216
|
+
/** Policy for AI agents; see {@link AgentConfig}. */
|
|
1217
|
+
agent?: AgentConfig;
|
|
1138
1218
|
/** Counters and limits */
|
|
1139
1219
|
counters?: Counters;
|
|
1140
1220
|
limits?: Limits;
|
|
@@ -1466,6 +1546,12 @@ export declare namespace ExportedApi {
|
|
|
1466
1546
|
blocksSavedEnabled?: boolean;
|
|
1467
1547
|
/** common blocks display */
|
|
1468
1548
|
blocksCommonEnabled?: boolean;
|
|
1549
|
+
/**
|
|
1550
|
+
* Source of the common blocks tab when blocks are stored on the Go backend and `handleReadCommonBlocks`
|
|
1551
|
+
* returned nothing: `gallery` — the product gallery, `project` — the blocks of the project this plugin key
|
|
1552
|
+
* belongs to. Project blocks can be inserted but not edited. Default `gallery`.
|
|
1553
|
+
*/
|
|
1554
|
+
blocksCommonSource?: 'gallery' | 'project';
|
|
1469
1555
|
/** template blocks display */
|
|
1470
1556
|
blocksTemplateEnabled?: boolean;
|
|
1471
1557
|
/** block search display */
|
|
@@ -2156,7 +2242,7 @@ export declare namespace ExportedApi {
|
|
|
2156
2242
|
* Resolves with the saved email; rejects when the save did not happen:
|
|
2157
2243
|
* - the error thrown (or the rejection) of your `handleSaveEmail`, passed through unchanged;
|
|
2158
2244
|
* - {@link errors.IntegratorSaveTimeoutError} — `handleSaveEmail` did not settle in time;
|
|
2159
|
-
* - {@link errors.SaveRefusedError} — the save was refused by a rule (`reason`: `'locked'`, `'too-many-tags'
|
|
2245
|
+
* - {@link errors.SaveRefusedError} — the save was refused by a rule (`reason`: `'locked'`, `'too-many-tags'`).
|
|
2160
2246
|
*
|
|
2161
2247
|
* Tell them apart with `instanceof` against `errors.*` or by `error.name`.
|
|
2162
2248
|
*/
|
|
@@ -3766,15 +3852,19 @@ export declare namespace errors {
|
|
|
3766
3852
|
'locked' |
|
|
3767
3853
|
/** The email has more tags than allowed. */
|
|
3768
3854
|
'too-many-tags' |
|
|
3769
|
-
/**
|
|
3770
|
-
'empty-content'
|
|
3855
|
+
/** @deprecated Never used: an email with empty content now saves like any other edit. */
|
|
3856
|
+
'empty-content' |
|
|
3857
|
+
/** A plugin refused the save in `document.willSave`; its text is in `detail`. */
|
|
3858
|
+
'plugin-refused';
|
|
3771
3859
|
/**
|
|
3772
3860
|
* `save()` rejected by a rule before reaching `handleSaveEmail`; the email was not saved.
|
|
3773
3861
|
*/
|
|
3774
3862
|
export class SaveRefusedError extends Error {
|
|
3775
3863
|
public readonly name: 'SaveRefusedError';
|
|
3776
3864
|
public readonly reason: SaveRefusalReason;
|
|
3777
|
-
|
|
3865
|
+
/** The text for the user from whoever refused; set when a plugin refused. */
|
|
3866
|
+
public readonly detail?: string;
|
|
3867
|
+
constructor(reason: SaveRefusalReason, detail?: string);
|
|
3778
3868
|
}
|
|
3779
3869
|
}
|
|
3780
3870
|
export declare namespace helpers {
|