@emailmaker/emailmaker 1.0.111-dev.7 → 1.0.111-dev.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/README.md +1 -1
- package/{emailmaker-core.3e49164c.js → emailmaker-core.e66b6bbd.js} +1 -1
- package/emailmaker-esm.js +3 -3
- package/emailmaker.d.ts +27 -27
- package/emailmaker.js +9 -3
- package/iframe/js/amp.DVZOiCd2.js +1 -1
- package/iframe/js/chunk.oX6nCJbK.js +1 -1
- package/iframe/js/iframe-eblock.js +1 -1
- package/iframe/js/iframe.js +1 -1
- package/iframe/js/rules.BSaCN7eK.js +1 -1
- package/iframe/js/sanitize-html.Brggoo7U.js +1 -1
- package/package.json +1 -1
- package/runtime/@ant-design/cssinjs/index.js +1 -1
- package/runtime/@ant-design/icons/index.js +1 -1
- package/runtime/THIRD_PARTY_LICENSES.txt +38 -1
- package/runtime/antd/index.js +1 -1
- package/runtime/dayjs/index.js +1 -1
- package/runtime/uuid/index.js +1 -1
- package/static/core/{42aed026.js → 147560ac.js} +1 -1
- package/static/core/{a006f6f7.js → 1503d3c5.js} +1 -1
- package/static/core/{35624a31.js → 29b5cf4c.js} +1 -1
- package/static/core/{a1a8a556.js → 38431fd5.js} +1 -1
- package/static/core/{7692b5d1.js → 3c618aaa.js} +1 -1
- package/static/core/{3e187db3.js → 3da55a10.js} +1 -1
- package/static/core/{c173a170.js → 4c9ffe8a.js} +1 -1
- package/static/core/{1533d54f.js → 6c508e07.js} +3 -3
- package/static/core/{695f6357.js → 6df5e514.js} +1 -1
- package/static/core/{a15add90.js → 73e3b6fe.js} +1 -1
- package/static/core/{549d710f.js → a207410a.js} +1 -1
- package/static/core/{6f768da1.js → a2f4a86d.js} +1 -1
- package/static/core/{c0a64fe8.js → d19f3661.js} +1 -1
- package/static/core/{1f86e870.js → ea9209aa.js} +1 -1
- package/static/runtime/es-BM3Z0tyv.js +444 -0
- package/static/runtime/es-aqetrgqU.js +5 -0
- package/static/runtime/es-su3SZyyq.js +72 -0
- package/ui-kit/index.js +8 -8
- package/vite/index.cjs +1 -1
- package/vite/index.js +1 -1
- package/static/runtime/DownloadOutlined-D8I-Z3GJ.js +0 -57
- package/static/runtime/es-BC0iT53n.js +0 -387
- package/static/runtime/es-DSH7b6d8.js +0 -4
- package/static/runtime/es-XShFVIAB.js +0 -1
- package/static/runtime/objectWithoutProperties-7yjmsvQX.js +0 -2
- /package/iframe/{iframe-eblock.3e49164c.html → iframe-eblock.e66b6bbd.html} +0 -0
- /package/iframe/{iframe.3e49164c.html → iframe.e66b6bbd.html} +0 -0
- /package/static/runtime/{dayjs.min-BL8gJgHn.js → dayjs.min-CoDbPFFV.js} +0 -0
- /package/static/runtime/{dist-Cgj1taBx.js → dist-DkqHVs-N.js} +0 -0
package/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__emailmaker__.define(`core`,[`require`,`exports`,`module`,`static/core/68277bd8.js`,`static/core/35624a31.js`,`static/core/549d710f.js`,`static/core/1f86e870.js`,`static/core/3e187db3.js`],function(e,t,n){Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),e(`./static/core/68277bd8.js`);let r=e(`./static/core/35624a31.js`),i=e(`./static/core/1f86e870.js`),a=e(`./static/core/549d710f.js`),o=e(`./static/core/3e187db3.js`);function s(e){return async()=>(await e.app.app_init_create({})).data}function c(e,t,n){e.inject(r.Ui,void 0);let i;e.injectFactory(r.Ui,async(e,r)=>i||(i=(async()=>{let e=r?await r:void 0;return t({baseUrl:n.baseUrl,user:n.user,project:n.project,prevApp:e})})(),i),!0)}var l=a.j(e=>{let t,n,i,o,l=!1;function u(e){let t=String(e||``).trim();return t?r.ki(t):void 0}return{setOptions(d){let f=!!e.getInstance(r.Xi),p=d.hasOwnProperty(`baseUrl`)?u(d.baseUrl):t;if(d.hasOwnProperty(`baseUrl`)){let n=e.getInstance(r.Di);t!==p&&n?.setOptions(p?{baseUrl:p}:{})}let m=n!==d.appInit,h=!a.k(i,d.user),g=o!==d.project,_=t!==p;if(n=d.appInit,i=d.user,o=d.project,t=p,f||l&&!m&&!h&&!g&&!_)return;let v=e.getInstance(r.Bi);c(e,n||s(v),{baseUrl:t,user:d.user,project:d.project}),l=!0}}}),u=r.wa(),d=r.wa(),f=a.j(e=>({setOptions(t){let n=i.Bn();e.addService(r.Ei,{execute:n.decorate(async n=>{if(!t.jwtAuth)return;let i=e.getInstance(u);if(!e.getInstance(d)){if(!i)try{let n=e.getInstance(r.Di)?.getOptions()?.baseUrl||``,a=await fetch(`${n}/jwt-auth/token`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t.jwtAuth)});if(!a.ok)throw Error(`JWT auth failed: ${a.status}`);i=(await a.json()).token,e.inject(u,i)}catch{throw e.inject(d,r.Hr),Error(r.Hr)}i&&n.headers.append(`authorization`,`Bearer ${i}`)}})})}})),p=a.j(e=>{let t,n,o;return{async setOptions(s){let c=o!==s.getAuthToken,l=!a.k(t,s.user),u=n!==s.project;if(o=s.getAuthToken,t=s.user,n=s.project,!(!e.getInstance(r.Xi)||!s.getAuthToken)&&!(!c&&!l&&!u))try{let t=await s.getAuthToken(s.user,s.project);e.inject(r.Zi,Promise.resolve(t||``));let n=i.I(t);if(!n)return;e.inject(r.Qi,n);let a=e.getInstance(r.Ui),o=a?await a.catch(()=>void 0):void 0;e.inject(r.Ui,Promise.resolve(i.F(n,o)))}catch{}}}}),m=a.j(e=>{let t=e.getInstance(r.Ki),n=new r._a,a=i.P(n.event);t.addDispose(()=>{let t=e.getInstance(r.qi);n.fire(t)});let o=t.addDisposable(new i.N(a));return t.addDisposable(n),{setOptions({handleDestroy:e}){o.setListener(e)},instance:{handleDestroy:a,destroy:()=>t.dispose()}}}),h=a.j(e=>{let t=e.getInstance(r.Ki),n=i.P(r.na(e,r.Wi)),a=t.addDisposable(new i.N(n));return{setOptions({handleLoad:e}){a.setListener(e)},instance:{handleLoad:n},dispose:()=>t.dispose()}}),g=a.j(e=>{let t=e.getInstance(r.Ki),n=t.addDisposable(new r.ha),a=t.addDisposable(new r.ha),o=r.ta(e,r.Gi),s=i.P(n.event),c=i.P(a.event),l=i.P(o.event),u=t.addDisposable(new i.N(s)),d=t.addDisposable(new i.N(c)),f=t.addDisposable(new i.N(l));return{instance:{handleSetOptions:s,handleOptionsChanged:c,handleConfigChanged:l},async setOptions(e){u.setListener(e.handleSetOptions),d.setListener(e.handleOptionsChanged),f.setListener(e.handleConfigChanged),await n.fire(e),await a.fire(e)},dispose(){}}}),_=1e4;function v(e,t,n,r={}){let i=Object.assign({},e);for(let[e,a]of Object.entries(t))if(a!==void 0)if(n.includes(e)&&typeof a==`object`&&a){let t=i[e],n=r[e]??{};i[e]=Object.assign({},typeof t==`object`&&t?t:n,a)}else i[e]=a;return i}var y={border:{all:null,top:null,right:null,bottom:null,left:null},borderRadius:{all:5,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null},borderRadiusCards:{all:10,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null},padding:{all:null,top:null,right:null,bottom:null,left:null}},b={fontFamily:[`Safe Fonts`,`-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif`],fontSize:16,fontSizeDim:`px`,lineHeight:21,lineHeightDim:`px`,color:`#5a5a5a`,contrastColor:`#FFFFFF`,textAlign:`left`,paddingBottom:10,paddingBottomDim:`px`},x={fontFamily:[`Safe Fonts`,`-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif`],fontSize:24,fontSizeDim:`px`,lineHeight:32,lineHeightDim:`px`,color:`#333333`,contrastColor:`#FFFFFF`,textAlign:`left`,paddingTop:20,paddingTopDim:`px`,paddingBottom:20,paddingBottomDim:`px`,letterSpacing:0,letterSpacingDim:`px`,bold:!0,italic:!1},S={color:`#1C52DC`,contrastColor:`#FFFFFF`,underline:!0},C={fontFamily:[`Safe Fonts`,`-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif`],fontSize:16,fontSizeDim:`px`,letterSpacing:0,letterSpacingDim:`px`,color:`#FFFFFF`,contrastColor:`#1C52DC`,bold:!1,italic:!1,backgroundColor:`#1C52DC`,contrastBackgroundColor:`#FFFFFF`,marginTop:10,marginTopDim:`px`,marginBottom:10,marginBottomDim:`px`,border:y.border,borderRadius:y.borderRadius,textAlign:`center`,padding:y.padding},w={backgroundColor:`#FFFFFF`,contrastBackgroundColor:`#1C52DC`,padding:y.padding},T={contrastBackgroundColor:`#1C52DC`,contrastTextColor:`#FFFFFF`,baseBackgroundColor:`#F8F8F8`,baseTextColor:`#333333`,border:y.border,borderRadius:y.borderRadiusCards};function E(e){return{...b,...e}}function D(e){return{...x,...e,bold:e?.bold??x.bold,italic:e?.italic??x.italic}}function O(e){return{...S,...e,underline:e?.underline??S.underline}}function k(e){return{...C,...e,bold:e?.bold??C.bold,italic:e?.italic??C.italic,border:{...C.border,...e?.border??{}},borderRadius:{...C.borderRadius,...e?.borderRadius??{}},padding:{...C.padding,...e?.padding??{}}}}function A(e){return{...w,...e,padding:{...w.padding,...e?.padding??{}}}}function j(e){return{...T,...e,border:{...T.border,...e?.border??{}},borderRadius:{...T.borderRadius,...e?.borderRadius??{}}}}var M=class{_layoutSettingsChanged=new r._a;_contentStylesChanged=new r._a;_messageSubscription;_messageSubscriptionPromise;_prevLayoutSnapshot;_prevContentSnapshot;constructor(e){this._editor=e}onChangeEmailLayoutSettings(e){let t=this._layoutSettingsChanged.event(e);return this._ensureMessageSubscription(),{dispose:()=>{t.dispose(),this._disposeMessageSubscriptionIfUnused()}}}onChangeEmailContentStyles(e){let t=this._contentStylesChanged.event(e);return this._ensureMessageSubscription(),{dispose:()=>{t.dispose(),this._disposeMessageSubscriptionIfUnused()}}}_disposeMessageSubscriptionIfUnused(){this._layoutSettingsChanged.hasListeners()||this._contentStylesChanged.hasListeners()||(this._messageSubscription?.dispose(),this._messageSubscription=void 0)}_mapLayoutSettings(e={}){return{backgroundColor:e.backgroundColor||``,backgroundImage:(e.backgroundImage||[]).map(e=>({type:`url`,value:e?.value||``})),backgroundPositionX:e.backgroundPositionX||``,backgroundPositionY:e.backgroundPositionY||``,backgroundRepeat:e.backgroundRepeat||``,backgroundSize:e.backgroundSize||``,backgroundColorContent:e.backgroundColorContent||``,textStrong:e.textStrong||!1,textItalic:e.textItalic||!1,textUnderline:e.textUnderline||!1,width:e.width,responsive:e.responsive}}_parseCommonStyles(e){let t={...r.wi};try{e&&e!==`{}`&&(t=JSON.parse(e))}catch{}return t}_mapCommonStylesToContentStyles(e){return{text:E(e.text),headings:D(e.headings),links:O(e.links),buttons:k(e.buttons),block:A(e.block),cards:j(e.cards)}}_getCurrentLayoutSettings(e){return this._mapLayoutSettings(o.O(e.getState()))}_getCurrentContentStyles(e){return this._mapCommonStylesToContentStyles(this._parseCommonStyles(o.w(e.getState())?.common_styles))}_getLayoutSnapshot(e){return JSON.stringify(e)}_getContentSnapshot(e){return JSON.stringify(e)}async _ensureMessageSubscription(){if(!this._messageSubscription){if(this._messageSubscriptionPromise)return this._messageSubscriptionPromise;this._messageSubscriptionPromise=(async()=>{let e=await this._editor.container.getInstanceAsync(r.$i);if(this._messageSubscription)return;let t=this._editor.container.getOrCreateInstance(r.ca,()=>new r.ma),n=this._getCurrentLayoutSettings(e),i=this._getCurrentContentStyles(e);this._prevLayoutSnapshot=this._getLayoutSnapshot(n),this._prevContentSnapshot=this._getContentSnapshot(i),this._messageSubscription=t.addListener(e=>{let t=e?.data?.operation;if(t===r.Wr.APPLICATION_EMAIL_SETTINGS_SET){let t=this._mapLayoutSettings(e.data?.settings),n=this._getLayoutSnapshot(t);n!==this._prevLayoutSnapshot&&(this._prevLayoutSnapshot=n,this._layoutSettingsChanged.fire(t));return}if(t!==r.Wr.APPLICATION_COMMON_STYLES_UPDATE)return;let n=this._mapCommonStylesToContentStyles(e.data?.settings?.commonStyles??{...r.wi}),i=this._getContentSnapshot(n);i!==this._prevContentSnapshot&&(this._prevContentSnapshot=i,this._contentStylesChanged.fire(n))})})();try{await this._messageSubscriptionPromise}finally{this._messageSubscriptionPromise=void 0}}}async getEmailLayoutSettings(){let e=await this._editor.container.getInstanceAsync(r.$i);return await this._waitForEmailSettingsFromIframe(e),this._getCurrentLayoutSettings(e)}async setEmailLayoutSettings(e){let t=await this._editor.container.getInstanceAsync(r.$i);await this._waitForEmailSettingsFromIframe(t);let n={...o.O(t.getState()),...e};t.dispatch(o.W(n));let i=this._mapLayoutSettings(n);this._prevLayoutSnapshot=this._getLayoutSnapshot(i),this._layoutSettingsChanged.fire(i)}async _waitForEmailSettingsFromIframe(e,t=_){let n=e.getState(),i=o.w(n),a=o.O(n);if(i?.is_inited&&a&&Object.keys(a).length>0&&(a.backgroundColor||a.backgroundImage?.[0]?.value||a.width?.value||a.responsive!==void 0)||i?.is_inited)return;let s=this._editor.container,c=r.na(s,r.ea.ON_EMAIL_INIT_ID);return new Promise(e=>{let n=!1,r,i=()=>{r&&=(clearTimeout(r),void 0)},a=c(()=>{n||(n=!0,i(),a.dispose(),e())});r=setTimeout(()=>{n||(n=!0,a.dispose(),e())},t)})}async getEmailContentStyles(){let e=await this._editor.container.getInstanceAsync(r.$i);return this._getCurrentContentStyles(e)}async setEmailContentStyles(e){let t=await this._editor.container.getInstanceAsync(r.$i),n=o.w(t.getState());if(!n)return;let i=this._parseCommonStyles(n.common_styles);e.text!==void 0&&(i.text={...i.text||{},...e.text}),e.headings!==void 0&&(i.headings={...i.headings||{},...e.headings}),e.links!==void 0&&(i.links={...i.links||{},...e.links}),e.buttons!==void 0&&(i.buttons=v(i.buttons||{},e.buttons,[`border`,`borderRadius`,`padding`],{border:y.border,borderRadius:y.borderRadius,padding:y.padding})),e.block!==void 0&&(i.block=v(i.block||{},e.block,[`padding`],{padding:y.padding})),e.cards!==void 0&&(i.cards=v(i.cards||{},e.cards,[`border`,`borderRadius`],{border:y.border,borderRadius:y.borderRadiusCards})),t.dispatch(o.R({...n,common_styles:JSON.stringify(i)}));let a=this._mapCommonStylesToContentStyles(i);this._prevContentSnapshot=this._getContentSnapshot(a),this._contentStylesChanged.fire(a)}},N={...r.ra,EmailSettingsApi:M};({...r.ra});var P={...N};function F(){i.j.addAll(P)}var I=[m,h,g,f,p,a.T,l];async function L(){return(await Promise.resolve().then(()=>e(`./static/core/1533d54f.js`))).default}var R=e=>{let t=null,n=!1;return{instance:{},async setOptions(i){if(!t&&!n){t=(await L())(e);let n=await e.getInstanceAsync(r.qi);Object.assign(n,t.instance||{}),F()}t&&await t.setOptions(i)},dispose(){t?.dispose(),n=!0}}},z=a.A([...I,R]),B=class{_storage=Object.create(null);get(e){let t=this._storage[e];return t&&(!t.expires||t.expires<Date.now())?t.value:``}set(e,t,n){this._storage[e]={value:t,expires:n.expires?n.expires*1e3+Date.now():void 0}}remove(e){delete this._storage[e]}},V=100,H={events:[],container:null,collection:null};function U(e,t){H.container=e,H.collection=t,t.onLifecycle(e=>{H.events.push({...e,timestamp:Date.now()}),H.events.length>V&&(H.events=H.events.slice(-V))}),typeof window<`u`&&(window.__EMAILMAKER_DEVTOOLS__=W())}function W(){return{enabled:!0,plugins(){return H.collection?H.collection.getStatus().map(e=>({...e,hasInit:!0,hasDispose:!0,hasAfterInit:!0})):[]},registry(){if(!H.container)return[];try{return H.container.getInstance(i.M).keys().map(String)}catch{return[]}},events(e=50){return H.events.slice(-e)},clearEvents(){H.events=[]},getPlugin(e){if(H.collection)try{return H.collection.use(e)}catch{return}}}}var G=a.A([z]);async function K(e){let t=new r.Da;async function n(){let n=r.Ca.createChild();if(e.standaloneKey){n.inject(r.Xi,e.standaloneKey);let i=r.na(n,r.ea.FILE_PROXY_EVENT_ID);t.addDisposable(i(async({url:e})=>(await fetch(e)).blob(),Number.MIN_VALUE))}n.inject(r.Ki,t),n.inject(r.zi,new B),r.Ai(n);let i=G(n),a={...i.instance,container:n};if(n.inject(r.qi,a),await i.setOptions(e),e.devTools)try{let e=n.getInstance(r.Yi);e&&U(n,e)}catch{}return r.ta(n,r.Wi).fire(a),a}return n()}async function q(e){let t=new Map;typeof e==`object`&&(e=e.code);let n=await i.a(e,async e=>{await i.g(e.document,e=>i.m.getEscapedText(e)===e?i.y(e):e,t);for(let t of e.document.querySelectorAll(`.em-amp-show-disabled`))t.remove();e.handleRender(async({contentDocument:e,managedNodeController:t})=>{await i.n(e,{mappedTags:{script:`___script`},commit:()=>t.commit()})})},[800]),r=await i.a(e,async e=>{await i.g(e.document,e=>i.m.getEscapedText(e)===e?i.y(e):e,t);for(let t of e.document.querySelectorAll(`.em-amp-show-only`))t.remove();await i.t(e.document,{mappedTags:{script:`___script`}})},[800]);return{code:e,html:r,ampHtml:n}}(function(e){if(!(!e||typeof e!=`object`)){var t=e.__emailmaker__||={},n=t.__compat||={};n.host=n.host||null,n.packages=n.packages||{},n.warned=n.warned||{},n.normalizeVersion||=function(e){return String(e||``).split(`-`)[0]||`0.0.0`},n.parseVersion||=function(e){var t=n.normalizeVersion(e).split(`.`);return{major:parseInt(t[0]||`0`,10),minor:parseInt(t[1]||`0`,10),patch:parseInt(t[2]||`0`,10)}},n.compareVersions||=function(e,t){var r=n.parseVersion(e),i=n.parseVersion(t);return r.major===i.major?r.minor===i.minor?r.patch-i.patch:r.minor-i.minor:r.major-i.major},n.satisfies||=function(e,t){if(!t||t===`*`||t===`latest`)return!0;var r=n.normalizeVersion(e),i=String(t||``).trim();if(!i)return!0;if(i.charAt(0)===`^`){var a=n.parseVersion(i.slice(1)),o=n.parseVersion(r);return n.compareVersions(r,i.slice(1))<0?!1:a.major>0?o.major===a.major:a.minor>0?o.major===0&&o.minor===a.minor:o.major===0&&o.minor===0&&o.patch===a.patch}return n.normalizeVersion(r)===n.normalizeVersion(i)},n.warnOnce||=function(e,t,r){n.warned[e]||(n.warned[e]=!0)},n.validateAll||=function(){var e=n.host,t=n.packages||{};e&&e.supports&&Object.keys(t).forEach(function(r){var i=t[r],a=e.supports[r];a&&!n.satisfies(i.version,a)&&n.warnOnce(`host:`+r+`:`+i.version+`:`+a,`Host supports a different package version range.`,{packageId:r,packageVersion:i.version,supportedRange:a,hostVersion:e.version})}),Object.keys(t).forEach(function(r){var i=t[r],a=i.requires||{};Object.keys(a).forEach(function(o){var s=a[o],c=o===`host`?e&&e.version:t[o]&&t[o].version;c&&(n.satisfies(c,s)||n.warnOnce(r+`:`+o+`:`+c+`:`+s,`Loaded package is outside the declared compatibility range.`,{packageId:r,packageVersion:i.version,targetId:o,targetVersion:c,requiredRange:s}))})})},n.registerHost||=function(e){n.host=e,n.validateAll()},n.registerPackage||=function(e){n.packages[e.id]=e,n.validateAll()},t.__compat.registerHost({version:`1.0.111-dev.7`,supports:{"extensions-api":`^0.9.0`,"extensions-react":`^0.9.0`,"extensions-sandbox":`^0.9.0`}})}})(typeof window<`u`?window:typeof globalThis<`u`?globalThis:void 0),t.init=K,t.parseAMP=q,t.version=`1.0.111-dev.7`});
|
|
1
|
+
__emailmaker__.define(`core`,[`require`,`exports`,`module`,`static/core/68277bd8.js`,`static/core/29b5cf4c.js`,`static/core/a207410a.js`,`static/core/ea9209aa.js`,`static/core/3da55a10.js`],function(e,t,n){Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),e(`./static/core/68277bd8.js`);let r=e(`./static/core/29b5cf4c.js`),i=e(`./static/core/ea9209aa.js`),a=e(`./static/core/a207410a.js`),o=e(`./static/core/3da55a10.js`);function s(e){return async()=>(await e.app.app_init_create({})).data}function c(e,t,n){e.inject(r.Ui,void 0);let i;e.injectFactory(r.Ui,async(e,r)=>i||(i=(async()=>{let e=r?await r:void 0;return t({baseUrl:n.baseUrl,user:n.user,project:n.project,prevApp:e})})(),i),!0)}var l=a.j(e=>{let t,n,i,o,l=!1;function u(e){let t=String(e||``).trim();return t?r.ki(t):void 0}return{setOptions(d){let f=!!e.getInstance(r.Xi),p=d.hasOwnProperty(`baseUrl`)?u(d.baseUrl):t;if(d.hasOwnProperty(`baseUrl`)){let n=e.getInstance(r.Di);t!==p&&n?.setOptions(p?{baseUrl:p}:{})}let m=n!==d.appInit,h=!a.k(i,d.user),g=o!==d.project,_=t!==p;if(n=d.appInit,i=d.user,o=d.project,t=p,f||l&&!m&&!h&&!g&&!_)return;let v=e.getInstance(r.Bi);c(e,n||s(v),{baseUrl:t,user:d.user,project:d.project}),l=!0}}}),u=r.wa(),d=r.wa(),f=a.j(e=>({setOptions(t){let n=i.Bn();e.addService(r.Ei,{execute:n.decorate(async n=>{if(!t.jwtAuth)return;let i=e.getInstance(u);if(!e.getInstance(d)){if(!i)try{let n=e.getInstance(r.Di)?.getOptions()?.baseUrl||``,a=await fetch(`${n}/jwt-auth/token`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t.jwtAuth)});if(!a.ok)throw Error(`JWT auth failed: ${a.status}`);i=(await a.json()).token,e.inject(u,i)}catch{throw e.inject(d,r.Hr),Error(r.Hr)}i&&n.headers.append(`authorization`,`Bearer ${i}`)}})})}})),p=a.j(e=>{let t,n,o;return{async setOptions(s){let c=o!==s.getAuthToken,l=!a.k(t,s.user),u=n!==s.project;if(o=s.getAuthToken,t=s.user,n=s.project,!(!e.getInstance(r.Xi)||!s.getAuthToken)&&!(!c&&!l&&!u))try{let t=await s.getAuthToken(s.user,s.project);e.inject(r.Zi,Promise.resolve(t||``));let n=i.I(t);if(!n)return;e.inject(r.Qi,n);let a=e.getInstance(r.Ui),o=a?await a.catch(()=>void 0):void 0;e.inject(r.Ui,Promise.resolve(i.F(n,o)))}catch{}}}}),m=a.j(e=>{let t=e.getInstance(r.Ki),n=new r._a,a=i.P(n.event);t.addDispose(()=>{let t=e.getInstance(r.qi);n.fire(t)});let o=t.addDisposable(new i.N(a));return t.addDisposable(n),{setOptions({handleDestroy:e}){o.setListener(e)},instance:{handleDestroy:a,destroy:()=>t.dispose()}}}),h=a.j(e=>{let t=e.getInstance(r.Ki),n=i.P(r.na(e,r.Wi)),a=t.addDisposable(new i.N(n));return{setOptions({handleLoad:e}){a.setListener(e)},instance:{handleLoad:n},dispose:()=>t.dispose()}}),g=a.j(e=>{let t=e.getInstance(r.Ki),n=t.addDisposable(new r.ha),a=t.addDisposable(new r.ha),o=r.ta(e,r.Gi),s=i.P(n.event),c=i.P(a.event),l=i.P(o.event),u=t.addDisposable(new i.N(s)),d=t.addDisposable(new i.N(c)),f=t.addDisposable(new i.N(l));return{instance:{handleSetOptions:s,handleOptionsChanged:c,handleConfigChanged:l},async setOptions(e){u.setListener(e.handleSetOptions),d.setListener(e.handleOptionsChanged),f.setListener(e.handleConfigChanged),await n.fire(e),await a.fire(e)},dispose(){}}}),_=1e4;function v(e,t,n,r={}){let i=Object.assign({},e);for(let[e,a]of Object.entries(t))if(a!==void 0)if(n.includes(e)&&typeof a==`object`&&a){let t=i[e],n=r[e]??{};i[e]=Object.assign({},typeof t==`object`&&t?t:n,a)}else i[e]=a;return i}var y={border:{all:null,top:null,right:null,bottom:null,left:null},borderRadius:{all:5,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null},borderRadiusCards:{all:10,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null},padding:{all:null,top:null,right:null,bottom:null,left:null}},b={fontFamily:[`Safe Fonts`,`-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif`],fontSize:16,fontSizeDim:`px`,lineHeight:21,lineHeightDim:`px`,color:`#5a5a5a`,contrastColor:`#FFFFFF`,textAlign:`left`,paddingBottom:10,paddingBottomDim:`px`},x={fontFamily:[`Safe Fonts`,`-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif`],fontSize:24,fontSizeDim:`px`,lineHeight:32,lineHeightDim:`px`,color:`#333333`,contrastColor:`#FFFFFF`,textAlign:`left`,paddingTop:20,paddingTopDim:`px`,paddingBottom:20,paddingBottomDim:`px`,letterSpacing:0,letterSpacingDim:`px`,bold:!0,italic:!1},S={color:`#1C52DC`,contrastColor:`#FFFFFF`,underline:!0},C={fontFamily:[`Safe Fonts`,`-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif`],fontSize:16,fontSizeDim:`px`,letterSpacing:0,letterSpacingDim:`px`,color:`#FFFFFF`,contrastColor:`#1C52DC`,bold:!1,italic:!1,backgroundColor:`#1C52DC`,contrastBackgroundColor:`#FFFFFF`,marginTop:10,marginTopDim:`px`,marginBottom:10,marginBottomDim:`px`,border:y.border,borderRadius:y.borderRadius,textAlign:`center`,padding:y.padding},w={backgroundColor:`#FFFFFF`,contrastBackgroundColor:`#1C52DC`,padding:y.padding},T={contrastBackgroundColor:`#1C52DC`,contrastTextColor:`#FFFFFF`,baseBackgroundColor:`#F8F8F8`,baseTextColor:`#333333`,border:y.border,borderRadius:y.borderRadiusCards};function E(e){return{...b,...e}}function D(e){return{...x,...e,bold:e?.bold??x.bold,italic:e?.italic??x.italic}}function O(e){return{...S,...e,underline:e?.underline??S.underline}}function k(e){return{...C,...e,bold:e?.bold??C.bold,italic:e?.italic??C.italic,border:{...C.border,...e?.border??{}},borderRadius:{...C.borderRadius,...e?.borderRadius??{}},padding:{...C.padding,...e?.padding??{}}}}function A(e){return{...w,...e,padding:{...w.padding,...e?.padding??{}}}}function j(e){return{...T,...e,border:{...T.border,...e?.border??{}},borderRadius:{...T.borderRadius,...e?.borderRadius??{}}}}var M=class{_layoutSettingsChanged=new r._a;_contentStylesChanged=new r._a;_messageSubscription;_messageSubscriptionPromise;_prevLayoutSnapshot;_prevContentSnapshot;constructor(e){this._editor=e}onChangeEmailLayoutSettings(e){let t=this._layoutSettingsChanged.event(e);return this._ensureMessageSubscription(),{dispose:()=>{t.dispose(),this._disposeMessageSubscriptionIfUnused()}}}onChangeEmailContentStyles(e){let t=this._contentStylesChanged.event(e);return this._ensureMessageSubscription(),{dispose:()=>{t.dispose(),this._disposeMessageSubscriptionIfUnused()}}}_disposeMessageSubscriptionIfUnused(){this._layoutSettingsChanged.hasListeners()||this._contentStylesChanged.hasListeners()||(this._messageSubscription?.dispose(),this._messageSubscription=void 0)}_mapLayoutSettings(e={}){return{backgroundColor:e.backgroundColor||``,backgroundImage:(e.backgroundImage||[]).map(e=>({type:`url`,value:e?.value||``})),backgroundPositionX:e.backgroundPositionX||``,backgroundPositionY:e.backgroundPositionY||``,backgroundRepeat:e.backgroundRepeat||``,backgroundSize:e.backgroundSize||``,backgroundColorContent:e.backgroundColorContent||``,textStrong:e.textStrong||!1,textItalic:e.textItalic||!1,textUnderline:e.textUnderline||!1,width:e.width,responsive:e.responsive}}_parseCommonStyles(e){let t={...r.wi};try{e&&e!==`{}`&&(t=JSON.parse(e))}catch{}return t}_mapCommonStylesToContentStyles(e){return{text:E(e.text),headings:D(e.headings),links:O(e.links),buttons:k(e.buttons),block:A(e.block),cards:j(e.cards)}}_getCurrentLayoutSettings(e){return this._mapLayoutSettings(o.O(e.getState()))}_getCurrentContentStyles(e){return this._mapCommonStylesToContentStyles(this._parseCommonStyles(o.w(e.getState())?.common_styles))}_getLayoutSnapshot(e){return JSON.stringify(e)}_getContentSnapshot(e){return JSON.stringify(e)}async _ensureMessageSubscription(){if(!this._messageSubscription){if(this._messageSubscriptionPromise)return this._messageSubscriptionPromise;this._messageSubscriptionPromise=(async()=>{let e=await this._editor.container.getInstanceAsync(r.$i);if(this._messageSubscription)return;let t=this._editor.container.getOrCreateInstance(r.ca,()=>new r.ma),n=this._getCurrentLayoutSettings(e),i=this._getCurrentContentStyles(e);this._prevLayoutSnapshot=this._getLayoutSnapshot(n),this._prevContentSnapshot=this._getContentSnapshot(i),this._messageSubscription=t.addListener(e=>{let t=e?.data?.operation;if(t===r.Wr.APPLICATION_EMAIL_SETTINGS_SET){let t=this._mapLayoutSettings(e.data?.settings),n=this._getLayoutSnapshot(t);n!==this._prevLayoutSnapshot&&(this._prevLayoutSnapshot=n,this._layoutSettingsChanged.fire(t));return}if(t!==r.Wr.APPLICATION_COMMON_STYLES_UPDATE)return;let n=this._mapCommonStylesToContentStyles(e.data?.settings?.commonStyles??{...r.wi}),i=this._getContentSnapshot(n);i!==this._prevContentSnapshot&&(this._prevContentSnapshot=i,this._contentStylesChanged.fire(n))})})();try{await this._messageSubscriptionPromise}finally{this._messageSubscriptionPromise=void 0}}}async getEmailLayoutSettings(){let e=await this._editor.container.getInstanceAsync(r.$i);return await this._waitForEmailSettingsFromIframe(e),this._getCurrentLayoutSettings(e)}async setEmailLayoutSettings(e){let t=await this._editor.container.getInstanceAsync(r.$i);await this._waitForEmailSettingsFromIframe(t);let n={...o.O(t.getState()),...e};t.dispatch(o.W(n));let i=this._mapLayoutSettings(n);this._prevLayoutSnapshot=this._getLayoutSnapshot(i),this._layoutSettingsChanged.fire(i)}async _waitForEmailSettingsFromIframe(e,t=_){let n=e.getState(),i=o.w(n),a=o.O(n);if(i?.is_inited&&a&&Object.keys(a).length>0&&(a.backgroundColor||a.backgroundImage?.[0]?.value||a.width?.value||a.responsive!==void 0)||i?.is_inited)return;let s=this._editor.container,c=r.na(s,r.ea.ON_EMAIL_INIT_ID);return new Promise(e=>{let n=!1,r,i=()=>{r&&=(clearTimeout(r),void 0)},a=c(()=>{n||(n=!0,i(),a.dispose(),e())});r=setTimeout(()=>{n||(n=!0,a.dispose(),e())},t)})}async getEmailContentStyles(){let e=await this._editor.container.getInstanceAsync(r.$i);return this._getCurrentContentStyles(e)}async setEmailContentStyles(e){let t=await this._editor.container.getInstanceAsync(r.$i),n=o.w(t.getState());if(!n)return;let i=this._parseCommonStyles(n.common_styles);e.text!==void 0&&(i.text={...i.text||{},...e.text}),e.headings!==void 0&&(i.headings={...i.headings||{},...e.headings}),e.links!==void 0&&(i.links={...i.links||{},...e.links}),e.buttons!==void 0&&(i.buttons=v(i.buttons||{},e.buttons,[`border`,`borderRadius`,`padding`],{border:y.border,borderRadius:y.borderRadius,padding:y.padding})),e.block!==void 0&&(i.block=v(i.block||{},e.block,[`padding`],{padding:y.padding})),e.cards!==void 0&&(i.cards=v(i.cards||{},e.cards,[`border`,`borderRadius`],{border:y.border,borderRadius:y.borderRadiusCards})),t.dispatch(o.R({...n,common_styles:JSON.stringify(i)}));let a=this._mapCommonStylesToContentStyles(i);this._prevContentSnapshot=this._getContentSnapshot(a),this._contentStylesChanged.fire(a)}},N={...r.ra,EmailSettingsApi:M};({...r.ra});var P={...N};function F(){i.j.addAll(P)}var I=[m,h,g,f,p,a.T,l];async function L(){return(await Promise.resolve().then(()=>e(`./static/core/6c508e07.js`))).default}var R=e=>{let t=null,n=!1;return{instance:{},async setOptions(i){if(!t&&!n){t=(await L())(e);let n=await e.getInstanceAsync(r.qi);Object.assign(n,t.instance||{}),F()}t&&await t.setOptions(i)},dispose(){t?.dispose(),n=!0}}},z=a.A([...I,R]),B=class{_storage=Object.create(null);get(e){let t=this._storage[e];return t&&(!t.expires||t.expires<Date.now())?t.value:``}set(e,t,n){this._storage[e]={value:t,expires:n.expires?n.expires*1e3+Date.now():void 0}}remove(e){delete this._storage[e]}},V=100,H={events:[],container:null,collection:null};function U(e,t){H.container=e,H.collection=t,t.onLifecycle(e=>{H.events.push({...e,timestamp:Date.now()}),H.events.length>V&&(H.events=H.events.slice(-V))}),typeof window<`u`&&(window.__EMAILMAKER_DEVTOOLS__=W())}function W(){return{enabled:!0,plugins(){return H.collection?H.collection.getStatus().map(e=>({...e,hasInit:!0,hasDispose:!0,hasAfterInit:!0})):[]},registry(){if(!H.container)return[];try{return H.container.getInstance(i.M).keys().map(String)}catch{return[]}},events(e=50){return H.events.slice(-e)},clearEvents(){H.events=[]},getPlugin(e){if(H.collection)try{return H.collection.use(e)}catch{return}}}}var G=a.A([z]);async function K(e){let t=new r.Da;async function n(){let n=r.Ca.createChild();if(e.standaloneKey){n.inject(r.Xi,e.standaloneKey);let i=r.na(n,r.ea.FILE_PROXY_EVENT_ID);t.addDisposable(i(async({url:e})=>(await fetch(e)).blob(),Number.MIN_VALUE))}n.inject(r.Ki,t),n.inject(r.zi,new B),r.Ai(n);let i=G(n),a={...i.instance,container:n};if(n.inject(r.qi,a),await i.setOptions(e),e.devTools)try{let e=n.getInstance(r.Yi);e&&U(n,e)}catch{}return r.ta(n,r.Wi).fire(a),a}return n()}async function q(e){let t=new Map;typeof e==`object`&&(e=e.code);let n=await i.a(e,async e=>{await i.g(e.document,e=>i.m.getEscapedText(e)===e?i.y(e):e,t);for(let t of e.document.querySelectorAll(`.em-amp-show-disabled`))t.remove();e.handleRender(async({contentDocument:e,managedNodeController:t})=>{await i.n(e,{mappedTags:{script:`___script`},commit:()=>t.commit()})})},[800]),r=await i.a(e,async e=>{await i.g(e.document,e=>i.m.getEscapedText(e)===e?i.y(e):e,t);for(let t of e.document.querySelectorAll(`.em-amp-show-only`))t.remove();await i.t(e.document,{mappedTags:{script:`___script`}})},[800]);return{code:e,html:r,ampHtml:n}}(function(e){if(!(!e||typeof e!=`object`)){var t=e.__emailmaker__||={},n=t.__compat||={};n.host=n.host||null,n.packages=n.packages||{},n.warned=n.warned||{},n.normalizeVersion||=function(e){return String(e||``).split(`-`)[0]||`0.0.0`},n.parseVersion||=function(e){var t=n.normalizeVersion(e).split(`.`);return{major:parseInt(t[0]||`0`,10),minor:parseInt(t[1]||`0`,10),patch:parseInt(t[2]||`0`,10)}},n.compareVersions||=function(e,t){var r=n.parseVersion(e),i=n.parseVersion(t);return r.major===i.major?r.minor===i.minor?r.patch-i.patch:r.minor-i.minor:r.major-i.major},n.satisfies||=function(e,t){if(!t||t===`*`||t===`latest`)return!0;var r=n.normalizeVersion(e),i=String(t||``).trim();if(!i)return!0;if(i.charAt(0)===`^`){var a=n.parseVersion(i.slice(1)),o=n.parseVersion(r);return n.compareVersions(r,i.slice(1))<0?!1:a.major>0?o.major===a.major:a.minor>0?o.major===0&&o.minor===a.minor:o.major===0&&o.minor===0&&o.patch===a.patch}return n.normalizeVersion(r)===n.normalizeVersion(i)},n.warnOnce||=function(e,t,r){n.warned[e]||(n.warned[e]=!0)},n.validateAll||=function(){var e=n.host,t=n.packages||{};e&&e.supports&&Object.keys(t).forEach(function(r){var i=t[r],a=e.supports[r];a&&!n.satisfies(i.version,a)&&n.warnOnce(`host:`+r+`:`+i.version+`:`+a,`Host supports a different package version range.`,{packageId:r,packageVersion:i.version,supportedRange:a,hostVersion:e.version})}),Object.keys(t).forEach(function(r){var i=t[r],a=i.requires||{};Object.keys(a).forEach(function(o){var s=a[o],c=o===`host`?e&&e.version:t[o]&&t[o].version;c&&(n.satisfies(c,s)||n.warnOnce(r+`:`+o+`:`+c+`:`+s,`Loaded package is outside the declared compatibility range.`,{packageId:r,packageVersion:i.version,targetId:o,targetVersion:c,requiredRange:s}))})})},n.registerHost||=function(e){n.host=e,n.validateAll()},n.registerPackage||=function(e){n.packages[e.id]=e,n.validateAll()},t.__compat.registerHost({version:`1.0.111-dev.8`,supports:{"extensions-api":`^0.9.0`,"extensions-react":`^0.9.0`,"extensions-sandbox":`^0.9.0`}})}})(typeof window<`u`?window:typeof globalThis<`u`?globalThis:void 0),t.init=K,t.parseAMP=q,t.version=`1.0.111-dev.8`});
|
package/emailmaker-esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{i as e,n as t,r as n,t as r}from"./static/esm/e16c1e05.js";import{n as i,t as a}from"./static/esm/7ac2c74d.js";(function(){var e=window.__emailmaker__=window.__emailmaker__||{};__emailmaker__.publicPath||(__emailmaker__.publicPath=(function(){var e=(function(){if(typeof document>`u`)return`./`;var e=document.getElementsByTagName(`script`),t=document.currentScript||e[e.length-1];return t&&t.src?t.src.substring(0,t.src.lastIndexOf(`/`)+1):`./`})();e||=`./`;try{var t=String(e);if(/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(t)||t.indexOf(`//`)===0)return t;var n=typeof document<`u`&&document.baseURI?document.baseURI:typeof window<`u`&&window.location?window.location.href:``;return n?new URL(t,n).href:t}catch{return String(e)}})()),__emailmaker__.assetUrl||(__emailmaker__.assetUrl=function(e){function t(e){try{var t=typeof document<`u`&&document.baseURI?document.baseURI:typeof window<`u`&&window.location?window.location.href:``;return t?new URL(String(e||``),t).href:String(e||``)}catch{return String(e||``)}}var n=String(e||``);if(!n)return``;if(/^(?:data:|blob:)/.test(n))return n;if(/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.indexOf(`//`)===0||n.charAt(0)===`/`)return t(n);var r=n.replace(/^\.\/+/,``).replace(/^\/+/,``),i=`static/media`.replace(/^\.\/+/,``).replace(/^\/+/,``).replace(/\/+$/,``),a=i&&r.indexOf(i+`/`)!==0?i+`/`+r:r,o=__emailmaker__.publicPath||`./`;try{return new URL(a,o).href}catch{return o.slice(-1)!==`/`&&(o+=`/`),t(o+a)}});var t=e.modules=Object.create(null),n=import(
|
|
1
|
+
import{i as e,n as t,r as n,t as r}from"./static/esm/e16c1e05.js";import{n as i,t as a}from"./static/esm/7ac2c74d.js";(function(){var e=window.__emailmaker__=window.__emailmaker__||{};__emailmaker__.publicPath||(__emailmaker__.publicPath=(function(){var e=(function(){if(typeof document>`u`)return`./`;var e=document.getElementsByTagName(`script`),t=document.currentScript||e[e.length-1];return t&&t.src?t.src.substring(0,t.src.lastIndexOf(`/`)+1):`./`})();e||=`./`;try{var t=String(e);if(/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(t)||t.indexOf(`//`)===0)return t;var n=typeof document<`u`&&document.baseURI?document.baseURI:typeof window<`u`&&window.location?window.location.href:``;return n?new URL(t,n).href:t}catch{return String(e)}})()),__emailmaker__.assetUrl||(__emailmaker__.assetUrl=function(e){function t(e){try{var t=typeof document<`u`&&document.baseURI?document.baseURI:typeof window<`u`&&window.location?window.location.href:``;return t?new URL(String(e||``),t).href:String(e||``)}catch{return String(e||``)}}var n=String(e||``);if(!n)return``;if(/^(?:data:|blob:)/.test(n))return n;if(/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.indexOf(`//`)===0||n.charAt(0)===`/`)return t(n);var r=n.replace(/^\.\/+/,``).replace(/^\/+/,``),i=`static/media`.replace(/^\.\/+/,``).replace(/^\/+/,``).replace(/\/+$/,``),a=i&&r.indexOf(i+`/`)!==0?i+`/`+r:r,o=__emailmaker__.publicPath||`./`;try{return new URL(a,o).href}catch{return o.slice(-1)!==`/`&&(o+=`/`),t(o+a)}});var t=e.modules=Object.create(null),n=import(`./runtime/index.js`),r=import(`./ui-kit/index.js`);t.React=n.then(function(e){return e.React}),t.ReactDom=n.then(function(e){return e.ReactDom}),t.ReactDomClient=n.then(function(e){return e.ReactDomClient}),t.ReactJsxRuntime=n.then(function(e){return e.ReactJsxRuntime}),t.ReactJsxDevRuntime=n.then(function(e){return e.ReactJsxDevRuntime}),t.PropTypes=n.then(function(e){return e.PropTypes}),t.ReactRouterDom=n.then(function(e){return e.ReactRouterDom}),t.Antd=n.then(function(e){return e.Antd}),t.AntDesignIcons=n.then(function(e){return e.AntDesignIcons}),t.AntDesignCssinjs=n.then(function(e){return e.AntDesignCssinjs}),t.Classnames=n.then(function(e){return e.Classnames}),t.Dayjs=n.then(function(e){return e.Dayjs}),t.Uuid=n.then(function(e){return e.Uuid}),t.UiKit=r.then(function(e){return e.UiKit===void 0?e:e.UiKit});var i=Promise.all([n,r]).then(function(e){var n=e[0]||Object.create(null),r=Object.create(null);for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i]);var a=e[1]||Object.create(null);for(var o in r.UiKit=a.UiKit===void 0?a:a.UiKit,r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o]);return r}),a=t,o=i;typeof e.define!=`function`&&(Function(`__amdEnv`,`/**
|
|
2
2
|
* Async AMD Loader (IIFE version for injection)
|
|
3
3
|
*
|
|
4
4
|
* This file is injected at the beginning of iframe entry points.
|
|
@@ -476,7 +476,7 @@ import{i as e,n as t,r as n,t as r}from"./static/esm/e16c1e05.js";import{n as i,
|
|
|
476
476
|
__amdEnv.require = require;
|
|
477
477
|
__amdEnv.syncRequire = syncRequire;
|
|
478
478
|
})();
|
|
479
|
-
`)(e),typeof e.require==`function`&&typeof e.require.config==`function`&&e.require.config({baseUrl:`./`,paths:{core:`emailmaker-core.
|
|
479
|
+
`)(e),typeof e.require==`function`&&typeof e.require.config==`function`&&e.require.config({baseUrl:`./`,paths:{core:`emailmaker-core.e66b6bbd.js`}}));var s=typeof e.prefetch==`function`?e.prefetch:void 0;if(e.prefetch=function(){return i.then(function(){if(typeof s==`function`)return s.call(e)})},typeof e.define==`function`){var c=typeof WeakMap<`u`?new WeakMap:null;function t(e){if(!e||typeof e!=`object`&&typeof e!=`function`||e.__esModule)return e;if(c){var t=c.get(e);if(t)return t}var n=Object.create(null);Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});for(var r=Reflect.ownKeys(e),i=0;i<r.length;i++){var a=r[i];if(a!==`__esModule`){var o=Object.getOwnPropertyDescriptor(e,a);o&&Object.defineProperty(n,a,o)}}return Object.prototype.hasOwnProperty.call(n,`default`)||Object.defineProperty(n,`default`,{enumerable:!0,value:e,writable:!1}),c&&c.set(e,n),n}e.define(`react`,[],function(){var e=a.React;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.React;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/react`,[],function(){var e=a.React;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.React;return t(n)}):t(e)}),e.define(`react-dom`,[],function(){var e=a.ReactDom;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactDom;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/react-dom`,[],function(){var e=a.ReactDom;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactDom;return t(n)}):t(e)}),e.define(`react-dom/client`,[],function(){var e=a.ReactDomClient;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactDomClient;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/react-dom/client`,[],function(){var e=a.ReactDomClient;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactDomClient;return t(n)}):t(e)}),e.define(`react/jsx-runtime`,[],function(){var e=a.ReactJsxRuntime;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactJsxRuntime;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/react/jsx-runtime`,[],function(){var e=a.ReactJsxRuntime;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactJsxRuntime;return t(n)}):t(e)}),e.define(`react/jsx-dev-runtime`,[],function(){var e=a.ReactJsxDevRuntime;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactJsxDevRuntime;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/react/jsx-dev-runtime`,[],function(){var e=a.ReactJsxDevRuntime;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactJsxDevRuntime;return t(n)}):t(e)}),e.define(`prop-types`,[],function(){var e=a.PropTypes;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.PropTypes;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/prop-types`,[],function(){var e=a.PropTypes;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.PropTypes;return t(n)}):t(e)}),e.define(`react-router-dom`,[],function(){var e=a.ReactRouterDom;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactRouterDom;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/react-router-dom`,[],function(){var e=a.ReactRouterDom;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.ReactRouterDom;return t(n)}):t(e)}),e.define(`antd`,[],function(){var e=a.Antd;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.Antd;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/antd`,[],function(){var e=a.Antd;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.Antd;return t(n)}):t(e)}),e.define(`@ant-design/icons`,[],function(){var e=a.AntDesignIcons;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.AntDesignIcons;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/@ant-design/icons`,[],function(){var e=a.AntDesignIcons;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.AntDesignIcons;return t(n)}):t(e)}),e.define(`@ant-design/cssinjs`,[],function(){var e=a.AntDesignCssinjs;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.AntDesignCssinjs;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/@ant-design/cssinjs`,[],function(){var e=a.AntDesignCssinjs;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.AntDesignCssinjs;return t(n)}):t(e)}),e.define(`classnames`,[],function(){var e=a.Classnames;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.Classnames;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/classnames`,[],function(){var e=a.Classnames;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.Classnames;return t(n)}):t(e)}),e.define(`dayjs`,[],function(){var e=a.Dayjs;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.Dayjs;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/dayjs`,[],function(){var e=a.Dayjs;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.Dayjs;return t(n)}):t(e)}),e.define(`uuid`,[],function(){var e=a.Uuid;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.Uuid;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/runtime/uuid`,[],function(){var e=a.Uuid;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.Uuid;return t(n)}):t(e)}),e.define(`@emailmaker/ui-kit`,[],function(){var e=a.UiKit;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.UiKit;return t(n)}):t(e)}),e.define(`@emailmaker/emailmaker/ui-kit`,[],function(){var e=a.UiKit;return e&&typeof e.then==`function`||e===void 0?o.then(function(e){var n=e.UiKit;return t(n)}):t(e)})}globalThis.__SHARED_RUNTIME_INIT_SENTINEL__=`@shared-runtime:init-complete`})();var o=null,s=`core`;function c(){return typeof window.__emailmaker__?.require==`function`?new Promise((e,t)=>{window.__emailmaker__.require([s],t=>e(t),e=>t(e instanceof Error?e:Error(`[loadEngine] Failed to require core module`)))}):Promise.reject(Error(`[loadEngine] AMD loader is unavailable`))}function l(){return o||=c(),o}var u=null,d=null;async function f(e){typeof e?.prefetch==`function`&&await e.prefetch()}function p(){return u||=l().then(()=>void 0),u}function m(e){return d||=f(e),d}function h(e){return Promise.all([p(),m(e)]).then(()=>void 0)}function g(e){let t=e?.startupPrefetchMode;return t===`eager`||t===`idle`||t===`manual`||t===`off`?t:`eager`}function _(e){Promise.resolve().then(()=>h(e)).catch(()=>{})}function v(e){Promise.resolve().then(()=>m(e)).catch(()=>{})}function y(e){let t=g(e);if(t===`eager`)_(e);else if(t===`idle`){let t=window.requestIdleCallback;typeof t==`function`?t(()=>_(e),{timeout:1500}):setTimeout(()=>_(e),0)}}var b=new WeakMap,x=`data-emailmaker-config-styles`;function S(e){return typeof e==`string`?e.trim():``}function C(e,t){if(e.firstChild){e.insertBefore(t,e.firstChild);return}e.appendChild(t)}function w(e,t,n){if(!e||typeof document>`u`)return null;let r=S(t),i=b.get(e),a=n||e;if(!r)return i&&(i.remove(),b.delete(e)),null;if(i)return i.textContent!==r&&(i.textContent=r),(i.parentNode!==a||i!==a.firstChild)&&C(a,i),i;let o=document.createElement(`style`);return o.setAttribute(x,`true`),o.textContent=r,C(a,o),b.set(e,o),o}function T(e){if(!e)return;let t=b.get(e);t&&(t.remove(),b.delete(e))}var E=`
|
|
480
480
|
.blocks-app-initial-spinner-wrapper {
|
|
481
481
|
width: 100%;
|
|
482
482
|
height: 100%;
|
|
@@ -505,4 +505,4 @@ import{i as e,n as t,r as n,t as r}from"./static/esm/e16c1e05.js";import{n as i,
|
|
|
505
505
|
100% {
|
|
506
506
|
transform: rotate(360deg);
|
|
507
507
|
}
|
|
508
|
-
}`;function D(){return()=>{}}function O(e,t){if(!e||typeof document>`u`)return D();e.querySelectorAll(`.blocks-app-initial-spinner-wrapper`).forEach(e=>{e.remove()});let n=document.createElement(`div`);n.classList.add(`blocks-app-initial-spinner-wrapper`);let r=document.createElement(`div`);r.classList.add(`blocks-app-initial-spinner`),n.appendChild(r);let i=document.createElement(`style`);i.setAttribute(t,`true`),i.textContent=E,document.head?.appendChild(i),e.appendChild(n);let a=!1;return()=>{a||(a=!0,n.remove(),i.remove())}}var k=new WeakMap,A=new Map;function j(e){return M(String(e||``).trim()||`https://app.emailmaker.ru/api/`)}function M(e){let t=e;for(;t.endsWith(`/`);)t=t.slice(0,t.length-1);return`${t}/wp-json`}async function N(e){if(!e.getAuthToken)return;let t=await e.getAuthToken(e.user,e.project,void 0);return t?`Bearer ${t}`:void 0}function P(e){return async({baseUrl:t})=>{let n=j(t);if(!n)throw Error(`[Loader] appInit warmup requires baseUrl or REACT_APP_OPENAPI_BASE_URL`);let r=new Headers({Accept:`application/json`,"Content-Type":`application/x-www-form-urlencoded;charset=UTF-8`}),i=await N(e);i&&r.set(`authorization`,i);let a=await fetch(`${n}/app/v1/app_init`,{method:`POST`,headers:r,body:new URLSearchParams,credentials:`same-origin`});if(!a.ok)throw Error(`[Loader] appInit request failed: ${a.status} ${a.statusText}`);return a.json()}}function F(e){return JSON.stringify({baseUrl:j(e.baseUrl)||``,project:e.project??``,userId:e.user?.id??``})}function I(e){return async t=>{let n=F(t),r=A.get(n);if(r)return r;let i=Promise.resolve(e(t)).catch(e=>{throw A.delete(n),e});return A.set(n,i),i}}function L(e){if(e.standaloneKey)return e;let t=e.appInit||P(e),n=k.get(t);return n||(n=I(t),k.set(t,n)),Promise.resolve(n({baseUrl:e.baseUrl,user:e.user,project:e.project,prevApp:void 0})).catch(e=>{}),{...e,appInit:n}}var R=new WeakMap;function z(e){let t=null;return async(n,r,i)=>(t||=Promise.resolve(e(n,r,i)).finally(()=>{t=null}),t)}function B(e){if(e.standaloneKey)return e;let t=e.getAuthToken;if(!t)return e;let n=R.get(t);return n||(n=z(t),R.set(t,n)),Promise.resolve(n(e.user,e.project,void 0)).catch(e=>{}),{...e,getAuthToken:n}}(function(e){if(!(!e||typeof e!=`object`)){var t=e.__emailmaker__||={},n=t.__compat||={};n.host=n.host||null,n.packages=n.packages||{},n.warned=n.warned||{},n.normalizeVersion||=function(e){return String(e||``).split(`-`)[0]||`0.0.0`},n.parseVersion||=function(e){var t=n.normalizeVersion(e).split(`.`);return{major:parseInt(t[0]||`0`,10),minor:parseInt(t[1]||`0`,10),patch:parseInt(t[2]||`0`,10)}},n.compareVersions||=function(e,t){var r=n.parseVersion(e),i=n.parseVersion(t);return r.major===i.major?r.minor===i.minor?r.patch-i.patch:r.minor-i.minor:r.major-i.major},n.satisfies||=function(e,t){if(!t||t===`*`||t===`latest`)return!0;var r=n.normalizeVersion(e),i=String(t||``).trim();if(!i)return!0;if(i.charAt(0)===`^`){var a=n.parseVersion(i.slice(1)),o=n.parseVersion(r);return n.compareVersions(r,i.slice(1))<0?!1:a.major>0?o.major===a.major:a.minor>0?o.major===0&&o.minor===a.minor:o.major===0&&o.minor===0&&o.patch===a.patch}return n.normalizeVersion(r)===n.normalizeVersion(i)},n.warnOnce||=function(e,t,r){n.warned[e]||(n.warned[e]=!0)},n.validateAll||=function(){var e=n.host,t=n.packages||{};e&&e.supports&&Object.keys(t).forEach(function(r){var i=t[r],a=e.supports[r];a&&!n.satisfies(i.version,a)&&n.warnOnce(`host:`+r+`:`+i.version+`:`+a,`Host supports a different package version range.`,{packageId:r,packageVersion:i.version,supportedRange:a,hostVersion:e.version})}),Object.keys(t).forEach(function(r){var i=t[r],a=i.requires||{};Object.keys(a).forEach(function(o){var s=a[o],c=o===`host`?e&&e.version:t[o]&&t[o].version;c&&(n.satisfies(c,s)||n.warnOnce(r+`:`+o+`:`+c+`:`+s,`Loaded package is outside the declared compatibility range.`,{packageId:r,packageVersion:i.version,targetId:o,targetVersion:c,requiredRange:s}))})})},n.registerHost||=function(e){n.host=e,n.validateAll()},n.registerPackage||=function(e){n.packages[e.id]=e,n.validateAll()},t.__compat.registerHost({version:`1.0.111-dev.
|
|
508
|
+
}`;function D(){return()=>{}}function O(e,t){if(!e||typeof document>`u`)return D();e.querySelectorAll(`.blocks-app-initial-spinner-wrapper`).forEach(e=>{e.remove()});let n=document.createElement(`div`);n.classList.add(`blocks-app-initial-spinner-wrapper`);let r=document.createElement(`div`);r.classList.add(`blocks-app-initial-spinner`),n.appendChild(r);let i=document.createElement(`style`);i.setAttribute(t,`true`),i.textContent=E,document.head?.appendChild(i),e.appendChild(n);let a=!1;return()=>{a||(a=!0,n.remove(),i.remove())}}var k=new WeakMap,A=new Map;function j(e){return M(String(e||``).trim()||`https://app.emailmaker.ru/api/`)}function M(e){let t=e;for(;t.endsWith(`/`);)t=t.slice(0,t.length-1);return`${t}/wp-json`}async function N(e){if(!e.getAuthToken)return;let t=await e.getAuthToken(e.user,e.project,void 0);return t?`Bearer ${t}`:void 0}function P(e){return async({baseUrl:t})=>{let n=j(t);if(!n)throw Error(`[Loader] appInit warmup requires baseUrl or REACT_APP_OPENAPI_BASE_URL`);let r=new Headers({Accept:`application/json`,"Content-Type":`application/x-www-form-urlencoded;charset=UTF-8`}),i=await N(e);i&&r.set(`authorization`,i);let a=await fetch(`${n}/app/v1/app_init`,{method:`POST`,headers:r,body:new URLSearchParams,credentials:`same-origin`});if(!a.ok)throw Error(`[Loader] appInit request failed: ${a.status} ${a.statusText}`);return a.json()}}function F(e){return JSON.stringify({baseUrl:j(e.baseUrl)||``,project:e.project??``,userId:e.user?.id??``})}function I(e){return async t=>{let n=F(t),r=A.get(n);if(r)return r;let i=Promise.resolve(e(t)).catch(e=>{throw A.delete(n),e});return A.set(n,i),i}}function L(e){if(e.standaloneKey)return e;let t=e.appInit||P(e),n=k.get(t);return n||(n=I(t),k.set(t,n)),Promise.resolve(n({baseUrl:e.baseUrl,user:e.user,project:e.project,prevApp:void 0})).catch(e=>{}),{...e,appInit:n}}var R=new WeakMap;function z(e){let t=null;return async(n,r,i)=>(t||=Promise.resolve(e(n,r,i)).finally(()=>{t=null}),t)}function B(e){if(e.standaloneKey)return e;let t=e.getAuthToken;if(!t)return e;let n=R.get(t);return n||(n=z(t),R.set(t,n)),Promise.resolve(n(e.user,e.project,void 0)).catch(e=>{}),{...e,getAuthToken:n}}(function(e){if(!(!e||typeof e!=`object`)){var t=e.__emailmaker__||={},n=t.__compat||={};n.host=n.host||null,n.packages=n.packages||{},n.warned=n.warned||{},n.normalizeVersion||=function(e){return String(e||``).split(`-`)[0]||`0.0.0`},n.parseVersion||=function(e){var t=n.normalizeVersion(e).split(`.`);return{major:parseInt(t[0]||`0`,10),minor:parseInt(t[1]||`0`,10),patch:parseInt(t[2]||`0`,10)}},n.compareVersions||=function(e,t){var r=n.parseVersion(e),i=n.parseVersion(t);return r.major===i.major?r.minor===i.minor?r.patch-i.patch:r.minor-i.minor:r.major-i.major},n.satisfies||=function(e,t){if(!t||t===`*`||t===`latest`)return!0;var r=n.normalizeVersion(e),i=String(t||``).trim();if(!i)return!0;if(i.charAt(0)===`^`){var a=n.parseVersion(i.slice(1)),o=n.parseVersion(r);return n.compareVersions(r,i.slice(1))<0?!1:a.major>0?o.major===a.major:a.minor>0?o.major===0&&o.minor===a.minor:o.major===0&&o.minor===0&&o.patch===a.patch}return n.normalizeVersion(r)===n.normalizeVersion(i)},n.warnOnce||=function(e,t,r){n.warned[e]||(n.warned[e]=!0)},n.validateAll||=function(){var e=n.host,t=n.packages||{};e&&e.supports&&Object.keys(t).forEach(function(r){var i=t[r],a=e.supports[r];a&&!n.satisfies(i.version,a)&&n.warnOnce(`host:`+r+`:`+i.version+`:`+a,`Host supports a different package version range.`,{packageId:r,packageVersion:i.version,supportedRange:a,hostVersion:e.version})}),Object.keys(t).forEach(function(r){var i=t[r],a=i.requires||{};Object.keys(a).forEach(function(o){var s=a[o],c=o===`host`?e&&e.version:t[o]&&t[o].version;c&&(n.satisfies(c,s)||n.warnOnce(r+`:`+o+`:`+c+`:`+s,`Loaded package is outside the declared compatibility range.`,{packageId:r,packageVersion:i.version,targetId:o,targetVersion:c,requiredRange:s}))})})},n.registerHost||=function(e){n.host=e,n.validateAll()},n.registerPackage||=function(e){n.packages[e.id]=e,n.validateAll()},t.__compat.registerHost({version:`1.0.111-dev.8`,supports:{"extensions-api":`^0.9.0`,"extensions-react":`^0.9.0`,"extensions-sandbox":`^0.9.0`}})}})(typeof window<`u`?window:typeof globalThis<`u`?globalThis:void 0);function V(e,t){return{...e,element:t}}function H(){return()=>{}}function U(e){let t=e.element;return!t||typeof t==`string`||typeof document>`u`?H():(w(t,e.config?.styles,t),()=>{T(t)})}function W(e){if(e.initialSpinner===!1||typeof document>`u`)return{options:e,cleanup:H()};let t=e.element;if(!t||typeof t==`string`)return{options:e,cleanup:H()};t.querySelectorAll(`.blocks-app-initial-spinner-wrapper`).forEach(e=>{e.remove()});let n=O(t,`data-emailmaker`),r=e.handleChunkLoaded;return{options:{...e,handleChunkLoaded:()=>{n(),r?.()}},cleanup:n}}function G(e){return e?.length?e.some(e=>Array.isArray(e)?!1:!!(e&&typeof e==`object`&&`url`in e)):!1}var K=`1.0.111-dev.8`;async function q(e){await h(window.__emailmaker__===void 0?void 0:window.__emailmaker__)}async function J(t){let n=new e,r=await i(t.element,n);n.dispose();let o=L(B(V(t,r)));if(r){let e=a.get(r);if(e)try{let t=await e;if(t.getElement()===r)return t.reset(o)}catch{a.get(r)===e&&a.delete(r)}}let s=U(o),c=W(o),u=c.options;await p();let d=window.__emailmaker__===void 0?void 0:window.__emailmaker__;G(u.plugins)?await m(d):v(d);let f=l().then(e=>e.init(u));r&&a.set(r,f);try{let e=await f;return r&&a.set(r,e),e}catch(e){throw s(),c.cleanup(),r&&a.get(r)===f&&a.delete(r),e}}async function Y(e){return(await l()).parseAMP(e)}typeof window<`u`&&y(window.__emailmaker__===void 0?void 0:window.__emailmaker__);export{t as errors,r as helpers,J as init,Y as parseAMP,n as pluginRegistry,q as preload,K as version};
|
package/emailmaker.d.ts
CHANGED
|
@@ -736,7 +736,7 @@ interface IFrameErrorInfo {
|
|
|
736
736
|
entityType: 'email' | 'block';
|
|
737
737
|
sentryEventId: string;
|
|
738
738
|
}
|
|
739
|
-
declare namespace Notify {
|
|
739
|
+
export declare namespace Notify {
|
|
740
740
|
type FM_Notifications<Notifications extends Record<string, any>> = { [Key in keyof Notifications as `FM_${Key & string}`]: Notifications[Key] };
|
|
741
741
|
/**
|
|
742
742
|
* Payload types for FM_* notification events.
|
|
@@ -1030,7 +1030,7 @@ declare namespace Notify {
|
|
|
1030
1030
|
} & Info;
|
|
1031
1031
|
}
|
|
1032
1032
|
type NotifyEvent = Notify.SuccessEvent | Notify.ErrorEvent | Notify.WarningEvent | Notify.InfoEvent;
|
|
1033
|
-
declare namespace ExportedApi {
|
|
1033
|
+
export declare namespace ExportedApi {
|
|
1034
1034
|
interface Block {
|
|
1035
1035
|
meta?: Record<string, unknown>;
|
|
1036
1036
|
/**
|
|
@@ -1071,7 +1071,7 @@ declare namespace ExportedApi {
|
|
|
1071
1071
|
global_block?: boolean;
|
|
1072
1072
|
}
|
|
1073
1073
|
}
|
|
1074
|
-
declare namespace ExportedApi {
|
|
1074
|
+
export declare namespace ExportedApi {
|
|
1075
1075
|
interface BlockRevision {
|
|
1076
1076
|
/** ID of the editorial board author. */
|
|
1077
1077
|
author?: string | number;
|
|
@@ -1118,7 +1118,7 @@ declare namespace ExportedApi {
|
|
|
1118
1118
|
code?: string;
|
|
1119
1119
|
}
|
|
1120
1120
|
}
|
|
1121
|
-
declare namespace ExportedApi {
|
|
1121
|
+
export declare namespace ExportedApi {
|
|
1122
1122
|
enum CodeErrorSeverity {
|
|
1123
1123
|
Hint = 1,
|
|
1124
1124
|
Info = 2,
|
|
@@ -1143,7 +1143,7 @@ declare namespace ExportedApi {
|
|
|
1143
1143
|
tags?: CodeErrorTag[];
|
|
1144
1144
|
}
|
|
1145
1145
|
}
|
|
1146
|
-
declare namespace ExportedApi {
|
|
1146
|
+
export declare namespace ExportedApi {
|
|
1147
1147
|
interface Comment {
|
|
1148
1148
|
/** Unique identifier for the comment. */
|
|
1149
1149
|
id?: string;
|
|
@@ -1213,7 +1213,7 @@ declare namespace ExportedApi {
|
|
|
1213
1213
|
parent?: string;
|
|
1214
1214
|
}
|
|
1215
1215
|
}
|
|
1216
|
-
declare namespace ExportedApi {
|
|
1216
|
+
export declare namespace ExportedApi {
|
|
1217
1217
|
/** Monaco (code editor) options passed through the email editor chrome. */
|
|
1218
1218
|
type EditorOptions = {
|
|
1219
1219
|
fontSize?: number;
|
|
@@ -1224,7 +1224,7 @@ declare namespace ExportedApi {
|
|
|
1224
1224
|
insertSpaces?: boolean;
|
|
1225
1225
|
};
|
|
1226
1226
|
}
|
|
1227
|
-
declare namespace ExportedApi {
|
|
1227
|
+
export declare namespace ExportedApi {
|
|
1228
1228
|
interface Email {
|
|
1229
1229
|
meta?: Record<string, unknown>;
|
|
1230
1230
|
/**
|
|
@@ -1264,7 +1264,7 @@ declare namespace ExportedApi {
|
|
|
1264
1264
|
};
|
|
1265
1265
|
}
|
|
1266
1266
|
}
|
|
1267
|
-
declare namespace ExportedApi {
|
|
1267
|
+
export declare namespace ExportedApi {
|
|
1268
1268
|
interface EmailRevision {
|
|
1269
1269
|
/** ID of the editorial board author. */
|
|
1270
1270
|
author?: string;
|
|
@@ -1308,11 +1308,11 @@ declare namespace ExportedApi {
|
|
|
1308
1308
|
};
|
|
1309
1309
|
}
|
|
1310
1310
|
}
|
|
1311
|
-
declare namespace ExportedApi {
|
|
1311
|
+
export declare namespace ExportedApi {
|
|
1312
1312
|
/** Opaque palette/typography blob for a theme id; keep **`any`** until a public theme schema is exported. */
|
|
1313
1313
|
export type ThemeConfig = any;
|
|
1314
1314
|
}
|
|
1315
|
-
declare namespace ExportedApi {
|
|
1315
|
+
export declare namespace ExportedApi {
|
|
1316
1316
|
export type CodeModeDirection = 'none' | 'left' | 'right' | 'bottom';
|
|
1317
1317
|
export type Locale = 'en_US' | 'ru_RU';
|
|
1318
1318
|
export type ConfigMods = 'pro' | 'editor' | 'simple' | 'freeUserBlocks';
|
|
@@ -1705,7 +1705,7 @@ declare namespace ExportedApi {
|
|
|
1705
1705
|
interface Options extends AppConfigMixin.Options {}
|
|
1706
1706
|
interface Instance extends AppConfigMixin.Instance {}
|
|
1707
1707
|
}
|
|
1708
|
-
declare namespace ExportedApi {
|
|
1708
|
+
export declare namespace ExportedApi {
|
|
1709
1709
|
export interface AppInitResult {
|
|
1710
1710
|
project: number;
|
|
1711
1711
|
app_id: number;
|
|
@@ -1734,7 +1734,7 @@ declare namespace ExportedApi {
|
|
|
1734
1734
|
interface Options extends AppInitMixin.Options {}
|
|
1735
1735
|
interface Instance extends AppInitMixin.Instance {}
|
|
1736
1736
|
}
|
|
1737
|
-
declare namespace ExportedApi {
|
|
1737
|
+
export declare namespace ExportedApi {
|
|
1738
1738
|
export type JWTAuthOptions = {
|
|
1739
1739
|
email: string;
|
|
1740
1740
|
password: string;
|
|
@@ -1750,7 +1750,7 @@ declare namespace ExportedApi {
|
|
|
1750
1750
|
interface Options extends JWTMixin.Options {}
|
|
1751
1751
|
interface Instance extends JWTMixin.Instance {}
|
|
1752
1752
|
}
|
|
1753
|
-
declare namespace ExportedApi {
|
|
1753
|
+
export declare namespace ExportedApi {
|
|
1754
1754
|
type OAuthCallback = (user?: User, project?: string | number, prevToken?: string) => MayBePromise<string>;
|
|
1755
1755
|
type OAuthOptions = {
|
|
1756
1756
|
/**
|
|
@@ -1768,7 +1768,7 @@ declare namespace ExportedApi {
|
|
|
1768
1768
|
interface Options extends OAuthMixin.Options {}
|
|
1769
1769
|
interface Instance extends OAuthMixin.Instance {}
|
|
1770
1770
|
}
|
|
1771
|
-
declare namespace ExportedApi {
|
|
1771
|
+
export declare namespace ExportedApi {
|
|
1772
1772
|
interface CoreOptions {
|
|
1773
1773
|
element?: string | Element | DocumentFragment;
|
|
1774
1774
|
handleChunkLoaded?: () => void;
|
|
@@ -1782,7 +1782,7 @@ declare namespace ExportedApi {
|
|
|
1782
1782
|
interface Options extends CoreMixin.Options {}
|
|
1783
1783
|
interface Instance extends CoreMixin.Instance {}
|
|
1784
1784
|
}
|
|
1785
|
-
declare namespace ExportedApi {
|
|
1785
|
+
export declare namespace ExportedApi {
|
|
1786
1786
|
namespace DataMixin {
|
|
1787
1787
|
type BlockShowOptions = {
|
|
1788
1788
|
/** block content */block: Block | string; /** autosaves */
|
|
@@ -1951,7 +1951,7 @@ declare namespace ExportedApi {
|
|
|
1951
1951
|
}
|
|
1952
1952
|
interface Instance extends DataMixin.Instance {}
|
|
1953
1953
|
}
|
|
1954
|
-
declare namespace ExportedApi {
|
|
1954
|
+
export declare namespace ExportedApi {
|
|
1955
1955
|
namespace DestroyableMixin {
|
|
1956
1956
|
type DestroyListener = AppListener<ExportedApi.Instance>;
|
|
1957
1957
|
interface Options {
|
|
@@ -1969,7 +1969,7 @@ declare namespace ExportedApi {
|
|
|
1969
1969
|
type SetOptionsListener = AppListener<Options>;
|
|
1970
1970
|
type OptionsChangedListener = AppListener<Options>;
|
|
1971
1971
|
type ConfigChangedListener = AppListener<Partial<Config>>;
|
|
1972
|
-
declare namespace ExportedApi {
|
|
1972
|
+
export declare namespace ExportedApi {
|
|
1973
1973
|
namespace OptionsEventsMixin {
|
|
1974
1974
|
interface Options {
|
|
1975
1975
|
/** Called when setOptions is invoked (before applying) */
|
|
@@ -1991,7 +1991,7 @@ declare namespace ExportedApi {
|
|
|
1991
1991
|
interface Options extends OptionsEventsMixin.Options {}
|
|
1992
1992
|
interface Instance extends OptionsEventsMixin.Instance {}
|
|
1993
1993
|
}
|
|
1994
|
-
declare namespace ExportedApi {
|
|
1994
|
+
export declare namespace ExportedApi {
|
|
1995
1995
|
namespace SpinMixin {
|
|
1996
1996
|
interface Options {
|
|
1997
1997
|
element?: string | Element | DocumentFragment;
|
|
@@ -2002,7 +2002,7 @@ declare namespace ExportedApi {
|
|
|
2002
2002
|
interface Options extends SpinMixin.Options {}
|
|
2003
2003
|
interface Instance extends SpinMixin.Instance {}
|
|
2004
2004
|
}
|
|
2005
|
-
declare namespace ExportedApi {
|
|
2005
|
+
export declare namespace ExportedApi {
|
|
2006
2006
|
namespace ImageHandlerMixin {
|
|
2007
2007
|
type LoadEventPayload = {
|
|
2008
2008
|
file: File;
|
|
@@ -2030,7 +2030,7 @@ declare namespace ExportedApi {
|
|
|
2030
2030
|
interface Options extends ImageHandlerMixin.Options {}
|
|
2031
2031
|
interface Instance extends ImageHandlerMixin.Instance {}
|
|
2032
2032
|
}
|
|
2033
|
-
declare namespace ExportedApi {
|
|
2033
|
+
export declare namespace ExportedApi {
|
|
2034
2034
|
namespace LoadHandlerMixin {
|
|
2035
2035
|
type LoadListener = AppListener<ExportedApi.Instance>;
|
|
2036
2036
|
interface Options {
|
|
@@ -2044,7 +2044,7 @@ declare namespace ExportedApi {
|
|
|
2044
2044
|
interface Options extends LoadHandlerMixin.Options {}
|
|
2045
2045
|
interface Instance extends LoadHandlerMixin.Instance {}
|
|
2046
2046
|
}
|
|
2047
|
-
declare namespace ExportedApi {
|
|
2047
|
+
export declare namespace ExportedApi {
|
|
2048
2048
|
type ConfigNotify = Notify & Partial<NotifyEvent> & {
|
|
2049
2049
|
message: string | HTMLElement;
|
|
2050
2050
|
};
|
|
@@ -2580,7 +2580,7 @@ interface StorageProvider {
|
|
|
2580
2580
|
extension?: string;
|
|
2581
2581
|
}) => MayBePromise<FileSystemItemUpdate>;
|
|
2582
2582
|
}
|
|
2583
|
-
declare namespace ExportedApi {
|
|
2583
|
+
export declare namespace ExportedApi {
|
|
2584
2584
|
export interface Options {
|
|
2585
2585
|
storageProvider?: StorageProvider;
|
|
2586
2586
|
}
|
|
@@ -2862,7 +2862,7 @@ declare namespace ExportedApi {
|
|
|
2862
2862
|
backendProxyPolicy?: BackendProxyPolicy;
|
|
2863
2863
|
}
|
|
2864
2864
|
}
|
|
2865
|
-
declare namespace ExportedApi {
|
|
2865
|
+
export declare namespace ExportedApi {
|
|
2866
2866
|
namespace UndoRedoMixin {
|
|
2867
2867
|
interface Instance {
|
|
2868
2868
|
/**
|
|
@@ -2983,7 +2983,7 @@ type PluginDescriptor<Key extends Extract<keyof PluginTypeMap, string> = Extract
|
|
|
2983
2983
|
* All supported ways to specify a plugin in the plugins config array.
|
|
2984
2984
|
*/
|
|
2985
2985
|
type PluginEntryItem = keyof PluginTypeMap | IPluginConstructor | [keyof PluginTypeMap, unknown] | [IPluginConstructor, unknown] | PluginLoader | PluginDescriptor;
|
|
2986
|
-
declare namespace ExportedApi {
|
|
2986
|
+
export declare namespace ExportedApi {
|
|
2987
2987
|
interface Options {
|
|
2988
2988
|
plugins?: PluginEntryItem[];
|
|
2989
2989
|
/** Enable DevTools for debugging plugins (auto-enabled in development) */
|
|
@@ -3101,7 +3101,7 @@ declare const version: string;
|
|
|
3101
3101
|
*/
|
|
3102
3102
|
declare const pluginRegistry: PluginRegistry;
|
|
3103
3103
|
/** File manager and integration errors surfaced to host apps (subset used by storage layers). */
|
|
3104
|
-
declare namespace errors {
|
|
3104
|
+
export declare namespace errors {
|
|
3105
3105
|
/**
|
|
3106
3106
|
* FileManagerApiError
|
|
3107
3107
|
* @example
|
|
@@ -3120,7 +3120,7 @@ declare namespace errors {
|
|
|
3120
3120
|
constructor(message: string, code: FileManagerErrorCode, httpStatus?: number, details?: unknown);
|
|
3121
3121
|
}
|
|
3122
3122
|
}
|
|
3123
|
-
declare namespace helpers {
|
|
3123
|
+
export declare namespace helpers {
|
|
3124
3124
|
/**
|
|
3125
3125
|
* mapHttpStatusToErrorCode
|
|
3126
3126
|
* @example
|
|
@@ -3130,4 +3130,4 @@ declare namespace helpers {
|
|
|
3130
3130
|
*/
|
|
3131
3131
|
export function mapHttpStatusToErrorCode(status: number, defaultCode?: FileManagerErrorCode): FileManagerErrorCode;
|
|
3132
3132
|
}
|
|
3133
|
-
export { ApiPaginationResponse, AppEvent, AppListener, BatchResult, BlockDesc, COMMON_STYLES, CommonStyles, CommonStylesBlock, CommonStylesBorder, CommonStylesBorderRadius, CommonStylesBorderSide, CommonStylesButton, CommonStylesCard, CommonStylesHeading, CommonStylesLink, CommonStylesPadding, CommonStylesText, Config, CreateEvent, CreateEventPayload, CreateListener, EditStackData, EditStackSnapshot, EmailDesc,
|
|
3133
|
+
export { ApiPaginationResponse, AppEvent, AppListener, BatchResult, BlockDesc, COMMON_STYLES, CommonStyles, CommonStylesBlock, CommonStylesBorder, CommonStylesBorderRadius, CommonStylesBorderSide, CommonStylesButton, CommonStylesCard, CommonStylesHeading, CommonStylesLink, CommonStylesPadding, CommonStylesText, Config, CreateEvent, CreateEventPayload, CreateListener, EditStackData, EditStackSnapshot, EmailDesc, ExtractPluginOptions, fileManager_d_exports as FileManager, FileManagerApiErrorInfo, FileSystemItem, FileSystemItemUpdate, GetFileDataOptions, GlobalBlockPropagateUpdatePayload, IFrameErrorInfo, IPlugin, IPluginConstructor, ISelection, ISingleModelEditStackData, IUndoRedoService, Instance, InstanceOfPluginType, MayBePromise, MergeTag, MergeTagGroup, MergeTagItem, ModulePluginDescriptor, type NotifyEvent, OperationResult, Options, ParsedAMP, PluginClassConstructor, PluginDescriptor, PluginEntryItem, PluginFunctionConstructor, PluginLoader, PluginRegistry, PluginTypeMap, PreloadOptions, PromiseWrap, RecursivePartial, RegistryPluginDescriptor, RemoveEvent, RemoveEventPayload, RemoveListener, SaveEvent, SaveEventPayload, SaveListener, SortState, StorageProvider, StorageProviderController, UploadFileItemInput, UploadFilesRequest, WindowPluginDescriptor, init, parseAMP, pluginRegistry, preload, version };
|
package/emailmaker.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
})(typeof globalThis !== 'undefined' ? globalThis : typeof self !== 'undefined' ? self : this, function() {
|
|
13
13
|
'use strict';
|
|
14
14
|
|
|
15
|
-
var e=window.__emailmaker__||(window.__emailmaker__={});(function(){"use strict";if(e!==void 0&&e.define)return;e===void 0&&(window.__amdEnv={});var t={},n={},r={},i={},a={},o=`./`,s={};function c(e,t){var n=Error(`[AMD] Failed to load module "`+e+`"`+(t?`: `+t.message:``));return n.moduleId=e,n.cause=t,n}function l(e,t,n){var r=Error(`[AMD] Failed to resolve dependency "`+t+`" for module "`+e+`"`+(n?`: `+n.message:``));return r.moduleId=e,r.dependencyId=t,r.cause=n,r}function u(e){for(var t=String(e||``).split(`/`),n=[],r=0;r<t.length;r++){var i=t[r];if(!(!i||i===`.`)){if(i===`..`){n.length>0&&n.pop();continue}n.push(i)}}return n.join(`/`)}function d(e){var t=String(e||``).replace(/\\/g,`/`),n=String(o||`./`).replace(/\\/g,`/`);return n=n.replace(/^\.\/+/,``),n=n.replace(/^\/+/,``),n&&n.slice(-1)!==`/`&&(n+=`/`),n&&t.indexOf(n)===0&&(t=t.slice(n.length)),t.indexOf(`./`)===0&&(t=t.slice(2)),t}function f(e,t){var n=String(e||``);if(!n)return n;if(!(n.indexOf(`./`)===0||n.indexOf(`../`)===0))return d(u(n));var r=u(t||``),i=r?r.split(`/`):[];i.length>0&&i.pop();for(var a=n.split(`/`),o=0;o<a.length;o++){var s=a[o];if(!(!s||s===`.`)){if(s===`..`){i.length>0&&i.pop();continue}i.push(s)}}return d(i.join(`/`))}function p(e){return/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e)||e.indexOf(`//`)===0}function m(e){var t=String(e||``);if(!t||p(t))return t;try{var n=typeof document<`u`&&document.baseURI?document.baseURI:typeof window<`u`&&window.location?window.location.href:``;return n?new URL(t,n).href:t}catch{return t}}function h(){var t=String(o||`./`);if(t.slice(-1)!==`/`&&(t+=`/`),p(t)||t.charAt(0)===`/`)return t;if(e!==void 0&&e&&e.publicPath)try{return new URL(t,m(e.publicPath)).href}catch{}return m(t)}function g(e,t){var n=f(e,t),r=h(),i=Object.prototype.hasOwnProperty.call(s,n)?String(s[n]||``):n;i.slice(-3)!==`.js`&&(i+=`.js`);try{return new URL(i,r).href}catch{return r+i}}function _(){if(typeof document>`u`)return``;var e=document.currentScript;if(e){var t=e.getAttribute(`data-amd-module-id`);if(t)return t}return``}function v(e,n,r){if(Array.isArray(e)?(r=n,n=e,e=_()):typeof e==`function`?(r=e,n=[],e=_()):typeof n==`function`&&(r=n,n=[]),!e)throw Error(`[AMD] Anonymous define() could not be associated with a module id`);e in t||(t[e]={deps:n||[],factory:r})}v.amd={async:!0};function y(){return function(){}}function b(e,t){return{id:e,exports:t,uri:g(e)}}function x(e,t,n,r){if(Array.isArray(e)){var i=Promise.all(e.map(function(e){return C(e,r)})).then(function(e){return t&&t.apply(null,e),e});return n&&i.catch(n),i}return C(e,r)}function S(e,o){if(Array.isArray(e))throw Error(`[AMD] syncRequire does not support dependency arrays`);var s=f(e,o);if(s in a)throw a[s];if(s in n)return n[s];if(s in r||s in i)throw c(s,Error(`Module is still loading asynchronously`));if(!(s in t))throw c(s,Error(`Module is not available for syncRequire`));return T(s)}function C(e,i){var o=f(e,i);return o in a?Promise.reject(a[o]):o in n?Promise.resolve(n[o]):o in r?r[o]:o in t?(r[o]=w(o),r[o]):(r[o]=D(o).then(function(){if(!(o in t)){var e=c(o,Error(`Module not defined after script load`));throw a[o]=e,e}return w(o)}).catch(function(e){delete r[o];var t=c(o,e);throw a[o]=t,t}),r[o])}function w(e){var i=t[e],o=E(e),s=y(),c=b(e,s);return Promise.all(i.deps.map(function(t){return t===`exports`?s:t===`require`?o:t===`module`?c:C(t,e).catch(function(n){throw l(e,t,n)})})).then(function(t){var a=i.factory.apply(null,t);return a&&typeof a.then==`function`?a.then(function(t){return n[e]=t===void 0?c.exports:t,delete r[e],n[e]}):(n[e]=a===void 0?c.exports:a,delete r[e],n[e])}).catch(function(t){throw delete r[e],a[e]=t,t})}function T(e){var r=t[e],i=E(e),o=y(),s=b(e,o);try{var u=r.deps.map(function(t){if(t===`exports`)return o;if(t===`require`)return i;if(t===`module`)return s;try{return S(t,e)}catch(n){throw l(e,t,n)}}),d=r.factory.apply(null,u);if(d&&typeof d.then==`function`)throw c(e,Error(`Module resolved asynchronously and cannot be syncRequired`));return n[e]=d===void 0?s.exports:d,n[e]}catch(t){throw a[e]=t,t}}function E(e){var r=function(r,i,a){if(Array.isArray(r))return x(r,i,a,e);var o=f(r,e);return o in n?n[o]:o in t?S(r,e):C(r,e)};return r.resolve=function(t){return f(t,e)},r.toUrl=function(t){return g(t,e)},r.sync=function(t){return S(t,e)},r}function D(e){if(e in i)return i[e];var t=g(e);return document.querySelector(`script[src="`+t+`"]`)?(i[e]=Promise.resolve(),i[e]):(i[e]=new Promise(function(n,r){var a=document.createElement(`script`);a.src=t,a.setAttribute(`data-amd-module-id`,e),a.async=!0,a.onload=function(){n()},a.onerror=function(){delete i[e],r(Error(`Failed to load script: `+t))},document.head.appendChild(a)}),i[e])}x.config=function(e){if(e.baseUrl&&(o=e.baseUrl),e.paths)for(var t in e.paths)Object.prototype.hasOwnProperty.call(e.paths,t)&&(s[t]=e.paths[t])},x.modules=t,x.resolved=n,x.errors=a,x.toUrl=g,x.sync=S,e.define=v,e.require=x,e.syncRequire=S})(),e.require.config({baseUrl:`./`,paths:{core:`emailmaker-core.
|
|
15
|
+
var e=window.__emailmaker__||(window.__emailmaker__={});(function(){"use strict";if(e!==void 0&&e.define)return;e===void 0&&(window.__amdEnv={});var t={},n={},r={},i={},a={},o=`./`,s={};function c(e,t){var n=Error(`[AMD] Failed to load module "`+e+`"`+(t?`: `+t.message:``));return n.moduleId=e,n.cause=t,n}function l(e,t,n){var r=Error(`[AMD] Failed to resolve dependency "`+t+`" for module "`+e+`"`+(n?`: `+n.message:``));return r.moduleId=e,r.dependencyId=t,r.cause=n,r}function u(e){for(var t=String(e||``).split(`/`),n=[],r=0;r<t.length;r++){var i=t[r];if(!(!i||i===`.`)){if(i===`..`){n.length>0&&n.pop();continue}n.push(i)}}return n.join(`/`)}function d(e){var t=String(e||``).replace(/\\/g,`/`),n=String(o||`./`).replace(/\\/g,`/`);return n=n.replace(/^\.\/+/,``),n=n.replace(/^\/+/,``),n&&n.slice(-1)!==`/`&&(n+=`/`),n&&t.indexOf(n)===0&&(t=t.slice(n.length)),t.indexOf(`./`)===0&&(t=t.slice(2)),t}function f(e,t){var n=String(e||``);if(!n)return n;if(!(n.indexOf(`./`)===0||n.indexOf(`../`)===0))return d(u(n));var r=u(t||``),i=r?r.split(`/`):[];i.length>0&&i.pop();for(var a=n.split(`/`),o=0;o<a.length;o++){var s=a[o];if(!(!s||s===`.`)){if(s===`..`){i.length>0&&i.pop();continue}i.push(s)}}return d(i.join(`/`))}function p(e){return/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e)||e.indexOf(`//`)===0}function m(e){var t=String(e||``);if(!t||p(t))return t;try{var n=typeof document<`u`&&document.baseURI?document.baseURI:typeof window<`u`&&window.location?window.location.href:``;return n?new URL(t,n).href:t}catch{return t}}function h(){var t=String(o||`./`);if(t.slice(-1)!==`/`&&(t+=`/`),p(t)||t.charAt(0)===`/`)return t;if(e!==void 0&&e&&e.publicPath)try{return new URL(t,m(e.publicPath)).href}catch{}return m(t)}function g(e,t){var n=f(e,t),r=h(),i=Object.prototype.hasOwnProperty.call(s,n)?String(s[n]||``):n;i.slice(-3)!==`.js`&&(i+=`.js`);try{return new URL(i,r).href}catch{return r+i}}function _(){if(typeof document>`u`)return``;var e=document.currentScript;if(e){var t=e.getAttribute(`data-amd-module-id`);if(t)return t}return``}function v(e,n,r){if(Array.isArray(e)?(r=n,n=e,e=_()):typeof e==`function`?(r=e,n=[],e=_()):typeof n==`function`&&(r=n,n=[]),!e)throw Error(`[AMD] Anonymous define() could not be associated with a module id`);e in t||(t[e]={deps:n||[],factory:r})}v.amd={async:!0};function y(){return function(){}}function b(e,t){return{id:e,exports:t,uri:g(e)}}function x(e,t,n,r){if(Array.isArray(e)){var i=Promise.all(e.map(function(e){return C(e,r)})).then(function(e){return t&&t.apply(null,e),e});return n&&i.catch(n),i}return C(e,r)}function S(e,o){if(Array.isArray(e))throw Error(`[AMD] syncRequire does not support dependency arrays`);var s=f(e,o);if(s in a)throw a[s];if(s in n)return n[s];if(s in r||s in i)throw c(s,Error(`Module is still loading asynchronously`));if(!(s in t))throw c(s,Error(`Module is not available for syncRequire`));return T(s)}function C(e,i){var o=f(e,i);return o in a?Promise.reject(a[o]):o in n?Promise.resolve(n[o]):o in r?r[o]:o in t?(r[o]=w(o),r[o]):(r[o]=D(o).then(function(){if(!(o in t)){var e=c(o,Error(`Module not defined after script load`));throw a[o]=e,e}return w(o)}).catch(function(e){delete r[o];var t=c(o,e);throw a[o]=t,t}),r[o])}function w(e){var i=t[e],o=E(e),s=y(),c=b(e,s);return Promise.all(i.deps.map(function(t){return t===`exports`?s:t===`require`?o:t===`module`?c:C(t,e).catch(function(n){throw l(e,t,n)})})).then(function(t){var a=i.factory.apply(null,t);return a&&typeof a.then==`function`?a.then(function(t){return n[e]=t===void 0?c.exports:t,delete r[e],n[e]}):(n[e]=a===void 0?c.exports:a,delete r[e],n[e])}).catch(function(t){throw delete r[e],a[e]=t,t})}function T(e){var r=t[e],i=E(e),o=y(),s=b(e,o);try{var u=r.deps.map(function(t){if(t===`exports`)return o;if(t===`require`)return i;if(t===`module`)return s;try{return S(t,e)}catch(n){throw l(e,t,n)}}),d=r.factory.apply(null,u);if(d&&typeof d.then==`function`)throw c(e,Error(`Module resolved asynchronously and cannot be syncRequired`));return n[e]=d===void 0?s.exports:d,n[e]}catch(t){throw a[e]=t,t}}function E(e){var r=function(r,i,a){if(Array.isArray(r))return x(r,i,a,e);var o=f(r,e);return o in n?n[o]:o in t?S(r,e):C(r,e)};return r.resolve=function(t){return f(t,e)},r.toUrl=function(t){return g(t,e)},r.sync=function(t){return S(t,e)},r}function D(e){if(e in i)return i[e];var t=g(e);return document.querySelector(`script[src="`+t+`"]`)?(i[e]=Promise.resolve(),i[e]):(i[e]=new Promise(function(n,r){var a=document.createElement(`script`);a.src=t,a.setAttribute(`data-amd-module-id`,e),a.async=!0,a.onload=function(){n()},a.onerror=function(){delete i[e],r(Error(`Failed to load script: `+t))},document.head.appendChild(a)}),i[e])}x.config=function(e){if(e.baseUrl&&(o=e.baseUrl),e.paths)for(var t in e.paths)Object.prototype.hasOwnProperty.call(e.paths,t)&&(s[t]=e.paths[t])},x.modules=t,x.resolved=n,x.errors=a,x.toUrl=g,x.sync=S,e.define=v,e.require=x,e.syncRequire=S})(),e.require.config({baseUrl:`./`,paths:{core:`emailmaker-core.e66b6bbd.js`}});
|
|
16
16
|
|
|
17
17
|
// PublicPath (script detection via document.currentScript)
|
|
18
18
|
if (!__emailmaker__.publicPath) {
|
|
@@ -196,6 +196,12 @@ if (!__emailmaker__.assetUrl) {
|
|
|
196
196
|
}
|
|
197
197
|
var uiKitMod = __parts[1] || Object.create(null);
|
|
198
198
|
merged["UiKit"] = uiKitMod["UiKit"] !== undefined ? uiKitMod["UiKit"] : uiKitMod;
|
|
199
|
+
// Hydrate modules for sync UMD/globals externals (`ns.modules.Antd`, etc.).
|
|
200
|
+
for (var __hydrateKey in merged) {
|
|
201
|
+
if (Object.prototype.hasOwnProperty.call(merged, __hydrateKey)) {
|
|
202
|
+
modules[__hydrateKey] = merged[__hydrateKey];
|
|
203
|
+
}
|
|
204
|
+
}
|
|
199
205
|
return merged;
|
|
200
206
|
});
|
|
201
207
|
|
|
@@ -705,7 +711,7 @@ if (typeof ns.define === 'function') {
|
|
|
705
711
|
})();
|
|
706
712
|
|
|
707
713
|
|
|
708
|
-
__emailmaker__.define(`emailmaker.js`,[`require`,`exports`,`module`],function(e,t,n){Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var r=Object.defineProperty,i=(e,t)=>{let n={};for(var i in e)r(n,i,{get:e[i],enumerable:!0});return t||r(n,Symbol.toStringTag,{value:`Module`}),n},a=class e{_isDisposed=!1;constructor(e=[]){this._inner=e}addDisposable(t){return this._inner.push(t),t instanceof e&&t.addDispose(()=>{this.removeDisposable(t)}),t}addDispose(e){this.addDisposable({dispose:e})}removeDisposable(e){let t=this._inner.indexOf(e);t>=0&&this._inner.splice(t,1)}isDisposed(){return this._isDisposed}dispose(){if(!this._isDisposed){this._isDisposed=!0;for(let e of[...this._inner])e.dispose()}}};function o(e){return`service_container_${e}`}var s=class e extends a{_injectCallbacks=[];_injections=Object.create(null);_runCallbacks(e){this._injectCallbacks.forEach(t=>t(e))}constructor(e=null){super(),this._parent=e,e&&this.addDisposable(e.onInject(e=>this._runCallbacks(e)))}onInject=e=>(this._injectCallbacks.push(e),{dispose:()=>{let t=this._injectCallbacks.indexOf(e);t>=0&&this._injectCallbacks.splice(t,1)}});inject(e,t){this._injections[e]=()=>t,this._runCallbacks(e)}injectFactory(e,t,n){let r=this._injections[e],i=typeof r==`function`?r():r,a=this._injections[e]=()=>(i=t(this,i),i);n&&a(),this._runCallbacks(e)}_find(e,t=!0){return this._injections[e]||t&&this._parent?._find(e)}_onInject(e,t,n=new a){return n.addDisposable(this.onInject(r=>{e===r&&(n.dispose(),t(this.getInstance(r)))})),this._parent&&n.addDisposable(this._parent._onInject(e,t,n)),this.addDisposable(n),n}getInstance(e,t=!0){let n=this._find(e,t);if(typeof n==`function`)return n()}getOrCreateInstance(e,t){let n=this._find(e);if(typeof n==`function`)return n();let r=t(this);return this.inject(e,r),r}getInstanceAsync(e){let t=this._find(e);return typeof t==`function`?Promise.resolve(t()):new Promise(t=>this._onInject(e,()=>t(this.getInstance(e))))}addService(e,t){let n=o(e);this.injectFactory(n,(e,n=[])=>n.indexOf(t)<0?[...n,t]:n);let r=new a;return r.addDispose(()=>{this.injectFactory(n,(e,n=[])=>n.filter(e=>e!==t))}),r}addServiceFactory(e,t,n){let r=o(e),i;this.injectFactory(r,(e,n=[])=>(i=t(e,i),i===void 0?n:n.indexOf(i)<0?[...n,i]:n),n);let s=new a;return s.addDispose(()=>{this.injectFactory(r,(e,t=[])=>i===void 0?t:t.filter(e=>e!==i))}),s}getServices(e){let t=o(e);return[...this.getInstance(t,!1)||[],...this._parent?.getServices(e)||[]]}createChild(){return new e(this)}getOrCreateIsolatedContainer(t){return this.getOrCreateInstance(t,()=>{let n=this._parent?.getOrCreateIsolatedContainer(t);return new e(n)})}dispose(){this._injections=Object.create(null)}};function c(e){return e.startsWith(`__`)?e:`__${e}__`}function l(e){if(typeof globalThis>`u`)throw Error(`[di] globalThis is required for namespace container access.`);let t=c(e),n=globalThis;return n[t]??={}}function
|
|
714
|
+
__emailmaker__.define(`emailmaker.js`,[`require`,`exports`,`module`],function(e,t,n){Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var r=Object.defineProperty,i=(e,t)=>{let n={};for(var i in e)r(n,i,{get:e[i],enumerable:!0});return t||r(n,Symbol.toStringTag,{value:`Module`}),n},a=class e{_isDisposed=!1;constructor(e=[]){this._inner=e}addDisposable(t){return this._inner.push(t),t instanceof e&&t.addDispose(()=>{this.removeDisposable(t)}),t}addDispose(e){this.addDisposable({dispose:e})}removeDisposable(e){let t=this._inner.indexOf(e);t>=0&&this._inner.splice(t,1)}isDisposed(){return this._isDisposed}dispose(){if(!this._isDisposed){this._isDisposed=!0;for(let e of[...this._inner])e.dispose()}}};function o(e){return`service_container_${e}`}var s=class e extends a{_injectCallbacks=[];_injections=Object.create(null);_runCallbacks(e){this._injectCallbacks.forEach(t=>t(e))}constructor(e=null){super(),this._parent=e,e&&this.addDisposable(e.onInject(e=>this._runCallbacks(e)))}onInject=e=>(this._injectCallbacks.push(e),{dispose:()=>{let t=this._injectCallbacks.indexOf(e);t>=0&&this._injectCallbacks.splice(t,1)}});inject(e,t){this._injections[e]=()=>t,this._runCallbacks(e)}injectFactory(e,t,n){let r=this._injections[e],i=typeof r==`function`?r():r,a=this._injections[e]=()=>(i=t(this,i),i);n&&a(),this._runCallbacks(e)}_find(e,t=!0){return this._injections[e]||t&&this._parent?._find(e)}_onInject(e,t,n=new a){return n.addDisposable(this.onInject(r=>{e===r&&(n.dispose(),t(this.getInstance(r)))})),this._parent&&n.addDisposable(this._parent._onInject(e,t,n)),this.addDisposable(n),n}getInstance(e,t=!0){let n=this._find(e,t);if(typeof n==`function`)return n()}getOrCreateInstance(e,t){let n=this._find(e);if(typeof n==`function`)return n();let r=t(this);return this.inject(e,r),r}getInstanceAsync(e){let t=this._find(e);return typeof t==`function`?Promise.resolve(t()):new Promise(t=>this._onInject(e,()=>t(this.getInstance(e))))}addService(e,t){let n=o(e);this.injectFactory(n,(e,n=[])=>n.indexOf(t)<0?[...n,t]:n);let r=new a;return r.addDispose(()=>{this.injectFactory(n,(e,n=[])=>n.filter(e=>e!==t))}),r}addServiceFactory(e,t,n){let r=o(e),i;this.injectFactory(r,(e,n=[])=>(i=t(e,i),i===void 0?n:n.indexOf(i)<0?[...n,i]:n),n);let s=new a;return s.addDispose(()=>{this.injectFactory(r,(e,t=[])=>i===void 0?t:t.filter(e=>e!==i))}),s}getServices(e){let t=o(e);return[...this.getInstance(t,!1)||[],...this._parent?.getServices(e)||[]]}createChild(){return new e(this)}getOrCreateIsolatedContainer(t){return this.getOrCreateInstance(t,()=>{let n=this._parent?.getOrCreateIsolatedContainer(t);return new e(n)})}dispose(){this._injections=Object.create(null)}};function c(e){return e.startsWith(`__`)?e:`__${e}__`}function l(e){if(typeof globalThis>`u`)throw Error(`[di] globalThis is required for namespace container access.`);let t=c(e),n=globalThis;return n[t]??={}}function u(e){return typeof e==`object`&&!!e&&typeof e.inject==`function`&&typeof e.getInstance==`function`}function ee(e){return c(e||`emailmaker`)}function d(e){let t=l(ee(e));if(u(t.container))return t.container;let n=new s(null);return t.container=n,n}function f(e){return d(e)}function p(){return`umd`}function te(e){if(typeof globalThis>`u`)return;let t=p(),n=globalThis[e]??{};globalThis[e]=n;let r=n.__diagnostics??={},i=r.diModuleEval??={evalCount:0,records:[],duplicateWarned:!1};i.records.push({buildSource:t,timestamp:Date.now(),stack:Error().stack}),i.evalCount+=1,!(i.evalCount<=1||i.duplicateWarned)&&(i.duplicateWarned=!0,i.evalCount,i.records)}function ne(){return`__emailmaker__`}function m(e,t){if(te(t),typeof globalThis>`u`)return e;let n=p(),r=globalThis,i=r[t]=r[t]||{},a=i.__diagnostics=i.__diagnostics||{},o=a.dependencyResolver=a.dependencyResolver||{entries:[],warnings:[]},s={container:e,source:`packages/runtime-core/di/index.ts`,buildSource:n,timestamp:Date.now(),stack:Error().stack};if(o.entries.push(s),o.entries.length>1){let e=o.entries[0];if(o.entries.some(t=>t.container!==e.container)&&!o.duplicateWarningShown){o.duplicateWarningShown=!0;let e={message:`[di] Multiple DependencyResolver instances detected on namespace`,namespaceKey:t,buildSource:n,entries:o.entries};o.warnings.push(e)}}return e}var h;function g(){if(h)return h;let e=ne();return h=m(d(e),e),h}new Proxy({},{get(e,t,n){let r=g(),i=Reflect.get(r,t,n);return typeof i==`function`?i.bind(r):i}});var _=class e extends Error{code;httpStatus;details;constructor(t,n,r,i){super(t),this.name=`FileManagerApiError`,this.code=n,this.httpStatus=r,this.details=i;let a=Error.captureStackTrace;a&&a(this,e)}};function v(e,t=`BackendError`){switch(e){case 400:return`ValidationError`;case 401:return`AuthenticationFailed`;case 403:return`AuthorizationFailed`;case 404:return`FileNotFound`;case 413:return`PayloadTooLarge`;case 415:return`UnsupportedMediaType`;case 429:return`RateLimitExceeded`;case 500:return`BackendError`;case 503:return`ServiceUnavailable`;case 504:return`Timeout`;default:return t}}var y=class{_plugins=new Map;_listeners=new Map;_getOrCreateEntry(e){let t=this._plugins.get(e);return t||(t={overrides:[]},this._plugins.set(e,t)),t}_applyOverrides(e,t){let n=this._plugins.get(e);if(n?.overrides)for(let e of n.overrides)t=e(t)||t;return t}_notifyListeners(e,t){let n=this._listeners.get(e);if(!n||n.length===0)return;for(let e of n)try{e.callback(t)}catch{}let r=n.filter(e=>!e.once);r.length>0?this._listeners.set(e,r):this._listeners.delete(e)}get(e){let t=this._plugins.get(e);if(t?.ctor)return this._applyOverrides(e,t.ctor)}async getAsync(e){let t=this._plugins.get(e);if(t?.ctor)return this._applyOverrides(e,t.ctor);if(t?.loading){let n=await t.loading;return this._applyOverrides(e,n)}if(t?.factory){let n=Promise.resolve(t.factory()).then(n=>(t.ctor=n,t.loading=void 0,this._notifyListeners(e,n),n));t.loading=n;let r=await n;return this._applyOverrides(e,r)}return new Promise(t=>{this.on(e,n=>t(this._applyOverrides(e,n)))})}add(e,t){let n=this._getOrCreateEntry(e);n.ctor=t,this._notifyListeners(e,t)}addAll(e){for(let t of Object.keys(e)){let n=e[t];n!==void 0&&this.add(t,n)}}addAsync(e,t){let n=this._getOrCreateEntry(e);return n.factory=t,{dispose:()=>{n.ctor||(n.factory=void 0)}}}has(e){let t=this._plugins.get(e);return!!(t?.ctor||t?.factory)}isLoaded(e){return!!this._plugins.get(e)?.ctor}override(e,t){let n=this._getOrCreateEntry(e);return n.overrides.push(t),{dispose:()=>{let e=n.overrides.indexOf(t);e>=0&&n.overrides.splice(e,1)}}}on(e,t){let n=this.get(e);n&&t(n);let r=this._listeners.get(e);r||(r=[],this._listeners.set(e,r));let i={callback:t,once:!1};return r.push(i),{dispose:()=>this._removeListener(e,t)}}once(e,t){let n=this.get(e);if(n)return t(n),{dispose:()=>{}};let r=this._listeners.get(e);r||(r=[],this._listeners.set(e,r));let i={callback:t,once:!0};return r.push(i),{dispose:()=>this._removeListener(e,t)}}off(e,t){this._removeListener(e,t)}_removeListener(e,t){let n=this._listeners.get(e);if(n){let r=n.findIndex(e=>e.callback===t);r>=0&&n.splice(r,1),n.length===0&&this._listeners.delete(e)}}keys(){return Array.from(this._plugins.keys())}forContext(){let e=this;return{add(t,n){e.add(t,n)}}}},b=class{constructor(e){this.resolveRegistry=e}target(){return this.resolveRegistry()}get(e){return this.target().get(e)}getAsync(e){return this.target().getAsync(e)}add(e,t){return this.target().add(e,t)}addAll(e){return this.target().addAll(e)}addAsync(e,t){return this.target().addAsync(e,t)}has(e){return this.target().has(e)}isLoaded(e){return this.target().isLoaded(e)}override(e,t){return this.target().override(e,t)}on(e,t){return this.target().on(e,t)}once(e,t){return this.target().once(e,t)}off(e,t){return this.target().off(e,t)}keys(){return this.target().keys()}forContext(){return this.target().forContext()}},x=null,S=`core`;function C(){return typeof __emailmaker__?.require==`function`?new Promise((e,t)=>{__emailmaker__.require([S],t=>e(t),e=>t(e instanceof Error?e:Error(`[loadEngine] Failed to require core module`)))}):Promise.reject(Error(`[loadEngine] AMD loader is unavailable`))}function w(){return x||=C(),x}var T=null,E=null;async function D(e){typeof e?.prefetch==`function`&&await e.prefetch()}function O(){return T||=w().then(()=>{}),T}function k(e){return E||=D(e),E}function A(e){return Promise.all([O(),k(e)]).then(()=>{})}function j(e){let t=e?.startupPrefetchMode;return t===`eager`||t===`idle`||t===`manual`||t===`off`?t:`eager`}function M(e){Promise.resolve().then(()=>A(e)).catch(()=>{})}function N(e){Promise.resolve().then(()=>k(e)).catch(()=>{})}function P(e){let t=j(e);if(t===`eager`)M(e);else if(t===`idle`){let t=window.requestIdleCallback;typeof t==`function`?t(()=>M(e),{timeout:1500}):setTimeout(()=>M(e),0)}}var F=`PluginRegistry`;function I(e=f()){return e.getOrCreateInstance(F,()=>new y)}var L=new b(()=>I()),R=new WeakMap,z=`data-emailmaker-config-styles`;function B(e){return typeof e==`string`?e.trim():``}function V(e,t){if(e.firstChild){e.insertBefore(t,e.firstChild);return}e.appendChild(t)}function H(e,t,n){if(!e||typeof document>`u`)return null;let r=B(t),i=R.get(e),a=n||e;if(!r)return i&&(i.remove(),R.delete(e)),null;if(i)return i.textContent!==r&&(i.textContent=r),(i.parentNode!==a||i!==a.firstChild)&&V(a,i),i;let o=document.createElement(`style`);return o.setAttribute(z,`true`),o.textContent=r,V(a,o),R.set(e,o),o}function U(e){if(!e)return;let t=R.get(e);t&&(t.remove(),R.delete(e))}function W(e,t){if(typeof e<`u`)if(typeof e==`string`){if(e=document.querySelector(e),e)return e;let n=t.addDisposable(new a);return new Promise((t,r)=>{let i=new MutationObserver(()=>{e=document.querySelector(e),e&&(n.dispose(),t(e))});i.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),n.addDisposable({dispose:()=>i.disconnect()})})}else return e;else return e}var G=new Map,K=`
|
|
709
715
|
.blocks-app-initial-spinner-wrapper {
|
|
710
716
|
width: 100%;
|
|
711
717
|
height: 100%;
|
|
@@ -734,7 +740,7 @@ __emailmaker__.define(`emailmaker.js`,[`require`,`exports`,`module`],function(e,
|
|
|
734
740
|
100% {
|
|
735
741
|
transform: rotate(360deg);
|
|
736
742
|
}
|
|
737
|
-
}`;function
|
|
743
|
+
}`;function re(){return()=>{}}function q(e,t){if(!e||typeof document>`u`)return re();e.querySelectorAll(`.blocks-app-initial-spinner-wrapper`).forEach(e=>{e.remove()});let n=document.createElement(`div`);n.classList.add(`blocks-app-initial-spinner-wrapper`);let r=document.createElement(`div`);r.classList.add(`blocks-app-initial-spinner`),n.appendChild(r);let i=document.createElement(`style`);i.setAttribute(t,`true`),i.textContent=K,document.head?.appendChild(i),e.appendChild(n);let a=!1;return()=>{a||(a=!0,n.remove(),i.remove())}}var J=new WeakMap,Y=new Map;function X(e){return ie(String(e||``).trim()||`https://app.emailmaker.ru/api/`)}function ie(e){let t=e;for(;t.endsWith(`/`);)t=t.slice(0,t.length-1);return`${t}/wp-json`}async function ae(e){if(!e.getAuthToken)return;let t=await e.getAuthToken(e.user,e.project,void 0);return t?`Bearer ${t}`:void 0}function oe(e){return async({baseUrl:t})=>{let n=X(t);if(!n)throw Error(`[Loader] appInit warmup requires baseUrl or REACT_APP_OPENAPI_BASE_URL`);let r=new Headers({Accept:`application/json`,"Content-Type":`application/x-www-form-urlencoded;charset=UTF-8`}),i=await ae(e);i&&r.set(`authorization`,i);let a=await fetch(`${n}/app/v1/app_init`,{method:`POST`,headers:r,body:new URLSearchParams,credentials:`same-origin`});if(!a.ok)throw Error(`[Loader] appInit request failed: ${a.status} ${a.statusText}`);return a.json()}}function se(e){return JSON.stringify({baseUrl:X(e.baseUrl)||``,project:e.project??``,userId:e.user?.id??``})}function ce(e){return async t=>{let n=se(t),r=Y.get(n);if(r)return r;let i=Promise.resolve(e(t)).catch(e=>{throw Y.delete(n),e});return Y.set(n,i),i}}function le(e){if(e.standaloneKey)return e;let t=e.appInit||oe(e),n=J.get(t);return n||(n=ce(t),J.set(t,n)),Promise.resolve(n({baseUrl:e.baseUrl,user:e.user,project:e.project,prevApp:void 0})).catch(e=>{}),{...e,appInit:n}}var Z=new WeakMap;function ue(e){let t=null;return async(n,r,i)=>(t||=Promise.resolve(e(n,r,i)).finally(()=>{t=null}),t)}function de(e){if(e.standaloneKey)return e;let t=e.getAuthToken;if(!t)return e;let n=Z.get(t);return n||(n=ue(t),Z.set(t,n)),Promise.resolve(n(e.user,e.project,void 0)).catch(e=>{}),{...e,getAuthToken:n}}var fe=i({FileManagerApiError:()=>_}),pe=i({mapHttpStatusToErrorCode:()=>v});(function(e){if(!(!e||typeof e!=`object`)){var t=e.__emailmaker__||={},n=t.__compat||={};n.host=n.host||null,n.packages=n.packages||{},n.warned=n.warned||{},n.normalizeVersion||=function(e){return String(e||``).split(`-`)[0]||`0.0.0`},n.parseVersion||=function(e){var t=n.normalizeVersion(e).split(`.`);return{major:parseInt(t[0]||`0`,10),minor:parseInt(t[1]||`0`,10),patch:parseInt(t[2]||`0`,10)}},n.compareVersions||=function(e,t){var r=n.parseVersion(e),i=n.parseVersion(t);return r.major===i.major?r.minor===i.minor?r.patch-i.patch:r.minor-i.minor:r.major-i.major},n.satisfies||=function(e,t){if(!t||t===`*`||t===`latest`)return!0;var r=n.normalizeVersion(e),i=String(t||``).trim();if(!i)return!0;if(i.charAt(0)===`^`){var a=n.parseVersion(i.slice(1)),o=n.parseVersion(r);return n.compareVersions(r,i.slice(1))<0?!1:a.major>0?o.major===a.major:a.minor>0?o.major===0&&o.minor===a.minor:o.major===0&&o.minor===0&&o.patch===a.patch}return n.normalizeVersion(r)===n.normalizeVersion(i)},n.warnOnce||=function(e,t,r){n.warned[e]||(n.warned[e]=!0)},n.validateAll||=function(){var e=n.host,t=n.packages||{};e&&e.supports&&Object.keys(t).forEach(function(r){var i=t[r],a=e.supports[r];a&&!n.satisfies(i.version,a)&&n.warnOnce(`host:`+r+`:`+i.version+`:`+a,`Host supports a different package version range.`,{packageId:r,packageVersion:i.version,supportedRange:a,hostVersion:e.version})}),Object.keys(t).forEach(function(r){var i=t[r],a=i.requires||{};Object.keys(a).forEach(function(o){var s=a[o],c=o===`host`?e&&e.version:t[o]&&t[o].version;c&&(n.satisfies(c,s)||n.warnOnce(r+`:`+o+`:`+c+`:`+s,`Loaded package is outside the declared compatibility range.`,{packageId:r,packageVersion:i.version,targetId:o,targetVersion:c,requiredRange:s}))})})},n.registerHost||=function(e){n.host=e,n.validateAll()},n.registerPackage||=function(e){n.packages[e.id]=e,n.validateAll()},t.__compat.registerHost({version:`1.0.111-dev.8`,supports:{"extensions-api":`^0.9.0`,"extensions-react":`^0.9.0`,"extensions-sandbox":`^0.9.0`}})}})(typeof window<`u`?window:typeof globalThis<`u`?globalThis:void 0);function me(e,t){return{...e,element:t}}function Q(){return()=>{}}function he(e){let t=e.element;return!t||typeof t==`string`||typeof document>`u`?Q():(H(t,e.config?.styles,t),()=>{U(t)})}function ge(e){if(e.initialSpinner===!1||typeof document>`u`)return{options:e,cleanup:Q()};let t=e.element;if(!t||typeof t==`string`)return{options:e,cleanup:Q()};t.querySelectorAll(`.blocks-app-initial-spinner-wrapper`).forEach(e=>{e.remove()});let n=q(t,`data-emailmaker`),r=e.handleChunkLoaded;return{options:{...e,handleChunkLoaded:()=>{n(),r?.()}},cleanup:n}}function $(e){return e?.length?e.some(e=>Array.isArray(e)?!1:!!(e&&typeof e==`object`&&`url`in e)):!1}var _e=`1.0.111-dev.8`;async function ve(e){await A(typeof __emailmaker__<`u`?__emailmaker__:void 0)}async function ye(e){let t=new a,n=await W(e.element,t);t.dispose();let r=le(de(me(e,n)));if(n){let e=G.get(n);if(e)try{let t=await e;if(t.getElement()===n)return t.reset(r)}catch{G.get(n)===e&&G.delete(n)}}let i=he(r),o=ge(r),s=o.options;await O();let c=typeof __emailmaker__<`u`?__emailmaker__:void 0;$(s.plugins)?await k(c):N(c);let l=w().then(e=>e.init(s));n&&G.set(n,l);try{let e=await l;return n&&G.set(n,e),e}catch(e){throw i(),o.cleanup(),n&&G.get(n)===l&&G.delete(n),e}}async function be(e){return(await w()).parseAMP(e)}typeof window<`u`&&P(typeof __emailmaker__<`u`?__emailmaker__:void 0),Object.defineProperty(t,`errors`,{enumerable:!0,get:function(){return fe}}),Object.defineProperty(t,`helpers`,{enumerable:!0,get:function(){return pe}}),t.init=ye,t.parseAMP=be,t.pluginRegistry=L,t.preload=ve,t.version=_e});
|
|
738
744
|
|
|
739
745
|
// Возвращаем API из entry модуля
|
|
740
746
|
return __emailmaker__.syncRequire("emailmaker.js");
|