easy-email-pro-core 1.26.2 → 1.26.4
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/lib/index.cjs.js +1 -1
- package/lib/index.es.js +104 -62
- package/package.json +1 -1
package/lib/index.cjs.js
CHANGED
|
@@ -61,7 +61,7 @@ You passed in: '`+this.raw_options[i]+"'");return u},t.prototype._is_valid_selec
|
|
|
61
61
|
<mj-column width="150px">
|
|
62
62
|
<mj-image target="_blank" alt="easy email pro" href="https://www.easyemail.pro/?utm_source=brand_logo&utm_client_id=${nt.clientId}" padding="5px 10px" container-background-color="#fafafa" src="https://cdn.shopify.com/s/files/1/0863/8971/9346/files/image.png" />
|
|
63
63
|
</mj-column>
|
|
64
|
-
</mj-section>`),l=l.replace(/\<!-- GLOBAL_EXTRACT_HEADER --\>/,f),s0(e)||(l=l.replace(/\<mj-html-attributes\>([\w\W]*?)\<\/mj-html-attributes\>/,"")),a?D0.html(l,{indent_size:2,wrap_attributes_indent_size:2,max_preserve_newlines:0,preserve_newlines:!1}):l}static elementToMjml(e,r){return _i.unescape(tn.renderToStaticMarkup(T.createElement(at,{universalElements:r.universalElements,mode:r.mode,context:{content:r.pageElement},displayMode:r.displayMode||"desktop-mobile",keepEmptyAttributes:!!r.keepEmptyAttributes,mergetagsData:r.mergetagsData,attributesVariables:r.attributesVariables},T.createElement(le,{node:W.cloneDeep(e)}))))}static isPageDataVariable(e){return/\$var\(([\s\S]+)\)/g.test(e)}};re($e,"version","0.14.0"),re($e,"mjmlToBlockElement",C0),re($e,"getPageDataVariables",(e,r)=>{var i;return((i=e.data.variables)==null?void 0:i.reduce((n,a)=>G(H({},n),{[a.name]:a.value}),H({},r)))||H({},r)}),re($e,"renderWithPageVariables",(e,r,i)=>{if(!r)return e;const n=W.cloneDeep(e),a=new Set;if(typeof n=="string")return n.replace(/\$var\(([\s\S]+)\)/g,(o,c)=>W.get(r,c,""));const u=o=>{W.forOwn(o,(c,p)=>{!a.has(c)&&!T.isValidElement(c)&&(a.add(c),typeof c=="object"?(p!=="children"||i)&&u(c):typeof c=="string"&&(o[p]=c.replace(/\$var\(([\s\S]+)\)/g,(h,x)=>W.get(r,x,""))))})};return u(n),n}),re($e,"getUniversalElements",o0),re($e,"transformUniversalElements",l0);let mt=$e;const Qa=T.createContext({}),Bi=()=>T.useContext(Qa),at=t=>{const e=T.useMemo(()=>{const r=mt.getPageDataVariables(t.context.content,t.attributesVariables||{});return G(H({},t),{pageVariables:r})},[t]);return T.createElement(Qa.Provider,{value:e},t.children)};var Za=(t=>(t.RESPONSIVE="RESPONSIVE",t.TEMPLATE_ENGINE="TEMPLATE_ENGINE",t))(Za||{});class ir{constructor(){re(this,"enabledResponsive",!0)}}re(ir,"type","RESPONSIVE");class nr{}re(nr,"type","TEMPLATE_ENGINE");class Ja{}const Ee=class Ee{static registerPlugins(e){e.forEach(r=>{Ee.registerPlugin(r)})}static registerPlugin(e){const r=new e;r instanceof ir?(Ee.enabledResponsive=r.enabledResponsive,Ee.generateResponsive=r.generateResponsive):r instanceof nr?(Ee.generateIterationTemplate=r.generateIterationTemplate,Ee.generateConditionTemplate=r.generateConditionTemplate,Ee.generateVariable=r.generateVariable,Ee.isVariable=r.isVariable,Ee.renderWithData=r.renderWithData):r instanceof Ja&&r.generateElement()}};re(Ee,"enabledResponsive",!1),re(Ee,"generateResponsive",e=>{const r=se.getBlockByType(e.node.type),{mode:i,children:n,context:a,idx:u,node:o,keepEmptyAttributes:c,mergetagsData:p}=e;return r.render(G(H({},e),{mode:i,children:n,context:a,idx:u,node:o,keepEmptyAttributes:c,mergetagsData:p}))}),re(Ee,"generateIterationTemplate",(e,r)=>r),re(Ee,"isVariable",e=>!1),re(Ee,"generateConditionTemplate",(e,r)=>r),re(Ee,"generateVariable",e=>e),re(Ee,"renderWithData",(e,r)=>e);let He=Ee;const le=t=>{var g,w,m,y,E;const{children:e,node:r,idx:i}=t,{mode:n,context:a,displayMode:u,keepEmptyAttributes:o,mergetagsData:c,pageVariables:p}=Bi(),h=se.getBlockByType(r.type);if(!h)throw new Error(`${r.type} block is not registered`);let x=G(H({},r),{attributes:H({},r.attributes),mobileAttributes:H({},r.mobileAttributes)});const _=W.get(x,"attributes.css-class")||"";n==="production"&&_&&W.set(x,"attributes.css-class",_.replace($a,"").replace(bi,""));const A=(g=x.attributes["mj-class"])==null?void 0:g.trim();if(A&&a.content.data.classAttributes){const F={},s=A.split(" ").map(D=>D.trim()).filter(Boolean);Object.values(s).forEach(D=>{W.get(a.content.data.classAttributes,D)&&Object.assign(F,W.get(a.content.data.classAttributes,D))}),x.attributes=K(F,x.attributes)}const v=(w=a.content.data.blockAttributes)==null?void 0:w[x.type];v&&(x.attributes=K(v,x.attributes));const C=(m=a.content.data.categoryAttributes)==null?void 0:m[h.category];a.content.data.globalAttributes&&(x.attributes=K(a.content.data.globalAttributes,x.attributes)),C&&(x.attributes=K(C,x.attributes));const d=H({},se.getBlockByType(x.type).defaultData.attributes);if(d&&(W.get(x.attributes,"padding","").trim()&&(delete d.padding,delete d["padding-top"],delete d["padding-bottom"],delete d["padding-left"],delete d["padding-right"]),W.get(x.attributes,"inner-padding","").trim()&&(delete d["inner-padding"],delete d["inner-padding-top"],delete d["inner-padding-bottom"],delete d["inner-padding-left"],delete d["inner-padding-right"]),x.attributes=K(d,x.attributes)),he.isSectionElement(r)||he.isWrapperElement(r)){const F=a.content.attributes["content-background-color"];F&&(x.attributes=K({"background-color":F},x.attributes))}let f=p;he.isWidgetElement(x)?(f=K(p,x.data.input),x=mt.renderWithPageVariables(x,f,!0)):x=mt.renderWithPageVariables(x,f);let b=He.generateResponsive({mode:n,children:e,context:a,idx:i,node:x,keepEmptyAttributes:o,mergetagsData:c,displayMode:u});if(n==="production"){const F=(y=r.logic)==null?void 0:y.condition,s=(E=r.logic)==null?void 0:E.iteration;s&&s.enabled&&(b=He.generateIterationTemplate(s,b)),F&&F.enabled&&(b=He.generateConditionTemplate(W.cloneDeep(F),b))}return T.createElement(T.Fragment,null,b)},qe=({node:t})=>{let e=t.text;const r={};return e?(t.bold&&(e=T.createElement("strong",null,e)),t.italic&&(e=T.createElement("em",null,e)),t.underline&&(e=T.createElement("u",null,e)),t.strikethrough&&(e=T.createElement("del",null,e)),t.link&&(e=T.createElement("a",{href:t.link.href,target:t.link.blank?"_blank":void 0},e)),t.color&&(r.color=t.color),t.bgColor&&(r.backgroundColor=t.bgColor),t.fontSize&&(r.fontSize=t.fontSize),t.fontFamily&&(r.fontFamily=t.fontFamily),W.isString(e)&&Object.keys(r).length===0?T.createElement(T.Fragment,null,e):T.createElement("span",{style:r},e)):null};function pe(t){const{params:e,params:{node:r,idx:i,children:n,keepEmptyAttributes:a},tag:u,children:o}=t,c=o||n,p=iu(e,{keepEmptyAttributes:a,removeDefaultAttributes:e.mode==="production"}),h=T.createElement(T.Fragment,null,`<${u}${p?` ${p}`:""}>`,c||r.children.map((x,_)=>{if(he.isTextNode(x)){const A=x.text.replace(/ {2}/g," ");return he.isTextListElement(r)?T.createElement(T.Fragment,{key:_},"<li>",T.createElement(qe,G(H({key:_},e),{node:G(H({},x),{text:A})})),"</li>"):T.createElement(qe,G(H({key:_},e),{node:G(H({},x),{text:A})}))}return T.createElement(le,G(H({key:_},e),{idx:i?he.getChildIdx(i,_):null,node:x}))}),`</${u}>`);return T.createElement(T.Fragment,null,h)}const es=t=>{if(T.isValidElement(t)||W.isString(t)||W.isUndefined(t)||W.isNumber(t)||W.isBoolean(t)||t===null||Array.isArray(t)&&t.every(e=>es(e)))return!0};function ue(t){return!!es(t)}function wi(t){const u=t,{data:e,idx:r,children:i}=u,n=de(u,["data","idx","children"]),a={type:$.WRAPPER,data:e||{},attributes:H({},n),children:ue(i)?[]:i||[]};return T.createElement(le,{idx:r,node:a,children:ue(i)?i:null})}function ts(t){const u=t,{data:e,idx:r,children:i}=u,n=de(u,["data","idx","children"]),a={type:$.SECTION,data:e||{},attributes:H({},n),children:ue(i)?[]:i||[]};return T.createElement(le,{idx:r,node:a,children:ue(i)?i:null})}function rs(t){const u=t,{data:e,idx:r,children:i}=u,n=de(u,["data","idx","children"]),a={type:$.GROUP,data:e||{},attributes:H({},n),children:ue(i)?[]:i||[]};return T.createElement(le,{idx:r,node:a,children:ue(i)?i:null})}function is(t){const u=t,{data:e,idx:r,children:i}=u,n=de(u,["data","idx","children"]),a={type:$.COLUMN,data:e||{},attributes:H({},n),children:ue(i)?[]:i||[]};return T.createElement(le,{idx:r,node:a,children:ue(i)?i:null})}function ns(t){const u=t,{data:e,children:r,idx:i}=u,n=de(u,["data","children","idx"]),a={type:$.BUTTON,data:e||{},attributes:H({},n),children:ue(r)?[]:r||[]};return T.createElement(le,{idx:i,node:a,children:ue(r)?r:null})}function as(t){const u=t,{data:e,idx:r,children:i}=u,n=de(u,["data","idx","children"]),a={type:$.IMAGE,data:e||{},attributes:H({},n),children:ue(i)?[]:i||[]};return T.createElement(le,{idx:r,node:a,children:ue(i)?i:null})}function ar(t){const u=t,{data:e,idx:r,children:i}=u,n=de(u,["data","idx","children"]),a={type:$.TEXT,data:e||{},attributes:H({},n),children:ue(i)?[]:i||[]};return T.createElement(le,{idx:r,node:a,children:ue(i)?i:null})}function ss(t){const u=t,{data:e,idx:r,children:i}=u,n=de(u,["data","idx","children"]),a={type:$.SPACER,data:e||{},attributes:H({},n),children:ue(i)?[]:i||[]};return T.createElement(le,{idx:r,node:a,children:ue(i)?i:null})}function Re(t){const u=t,{data:e,children:r,idx:i}=u,n=de(u,["data","children","idx"]),a={type:$.RAW,data:e||{content:r||""},attributes:H({},n),children:ue(r)?[]:r||[]};return T.createElement(le,{idx:i,node:a,children:ue(r)?r:null})}function us(t){const u=t,{data:e,idx:r,children:i}=u,n=de(u,["data","idx","children"]),a={type:$.DIVIDER,data:e||{},attributes:H({},n),children:ue(i)?[]:i||[]};return T.createElement(le,{idx:r,node:a,children:ue(i)?i:null})}function os(t){const u=t,{data:e,idx:r,children:i}=u,n=de(u,["data","idx","children"]),a={type:$.NAVBAR,data:e||{},attributes:H({},n),children:ue(i)?[]:i||[]};return T.createElement(le,{idx:r,node:a,children:ue(i)?i:null})}function ls(t){const u=t,{data:e,idx:r,children:i}=u,n=de(u,["data","idx","children"]),a={type:$.NAVBAR_LINK,data:e||{},attributes:H({},n),children:ue(i)?[]:i||[]};return T.createElement(le,{idx:r,node:a,children:ue(i)?i:null})}function cs(t){const u=t,{data:e,idx:r,children:i}=u,n=de(u,["data","idx","children"]),a={type:$.SOCIAL,data:e||{},attributes:H({},n),children:ue(i)?[]:i||[]};return T.createElement(le,{idx:r,node:a,children:ue(i)?i:null})}function ps(t){const u=t,{data:e,idx:r,children:i}=u,n=de(u,["data","idx","children"]),a={type:$.SOCIAL_ELEMENT,data:e||{},attributes:H({},n),children:ue(i)?[]:i||[]};return T.createElement(le,{idx:r,node:a,children:ue(i)?i:null})}function ds(t){const u=t,{data:e,idx:r,children:i}=u,n=de(u,["data","idx","children"]),a={type:$.HERO,data:e||{},attributes:H({},n),children:ue(i)?[]:i||[]};return T.createElement(le,{idx:r,node:a,children:ue(i)?i:null})}function B0(t){const u=t,{tagName:e,children:r,idx:i}=u,n=de(u,["tagName","children","idx"]),a={type:$.HTML_NODE,data:{tagName:e},attributes:H({},n),children:ue(r)?[]:r||[]};return T.createElement(le,{idx:i,node:a,children:ue(r)?r:null})}function w0(t){const a=t,{idx:e,children:r}=a,i=de(a,["idx","children"]),n={type:j.FOR_EACH,data:H({},i),attributes:{},children:ue(r)?[]:r||[]};return T.createElement(le,{idx:e,node:n,children:ue(r)?r:null})}function F0(t){const a=t,{idx:e,children:r}=a,i=de(a,["idx","children"]),n={type:j.SHOW,data:G(H({},i),{component:r}),attributes:{},children:[]};return T.createElement(le,{idx:e,node:n,children:r})}function T0(t){const u=t,{tagName:e,idx:r,children:i}=u,n=de(u,["tagName","idx","children"]),a={type:j.HTML_DOM_NODE,data:{tagName:e},attributes:H({},n),children:ue(i)?[]:i||[]};return T.createElement(le,{idx:r,node:a,children:ue(i)?i:null})}function hs(t){const a=t,{idx:e,children:r}=a,i=de(a,["idx","children"]),n={type:$.TABLE,data:{code:String(r)},attributes:H({},i),children:[]};return T.createElement(le,{idx:e,node:n,children:null})}function k0(t){const a=t,{children:e,idx:r}=a,i=de(a,["children","idx"]),n={type:$.DANGEROUS_CODE,data:{code:String(e)},attributes:H({},i),children:[]};return T.createElement(le,{idx:r,node:n,children:null})}const S0=({node:t})=>T.createElement(le,{node:G(H({},t),{attributes:G(H({},t.attributes),{"css-class":it(t.attributes["css-class"],bi)})})}),R0=Object.freeze(Object.defineProperty({__proto__:null,BasicBlock:pe,BlockRenderer:le,Button:ns,Code:k0,Column:is,ContentLeaf:qe,Divider:us,ForEach:w0,Group:rs,Hero:ds,HtmlDomNode:T0,HtmlNode:B0,Image:as,Navbar:os,NavbarLink:ls,Raw:Re,Section:ts,Show:F0,SlateNodePlaceholder:S0,Social:cs,SocialElement:ps,Spacer:ss,Table:hs,Text:ar,Wrapper:wi},Symbol.toStringTag,{value:"Module"})),O0={attributes:{width:"600px","margin-top":"30px","margin-bottom":"30px","link-text-decoration":"underline"},data:{breakpoint:"480px"}},N0={get name(){return X("Page")},defaultData:O0,type:$.PAGE,create:t=>{const e={type:$.PAGE,data:{breakpoint:"480px",globalAttributes:{"font-family":"Arial, sans-serif"}},attributes:{},children:[]};return K(e,t)},category:z.PAGE,render(t){var d,l,f,b,g,w;const{node:e,node:{data:r,attributes:i},mode:n}=t,a=r.breakpoint?`<mj-breakpoint width="${r.breakpoint}" />`:"",u=[...r.headStyles||[]];n==="testing"?u.unshift({content:Ma}):(u.unshift({content:n0}),u.unshift({content:a0,inline:"inline"}));const o=u.map(m=>`<mj-style ${m.inline?'inline="inline"':""}>${m.content}</mj-style>`).join(`
|
|
64
|
+
</mj-section>`),l=l.replace(/\<!-- GLOBAL_EXTRACT_HEADER --\>/,f),s0(e)||(l=l.replace(/\<mj-html-attributes\>([\w\W]*?)\<\/mj-html-attributes\>/,"")),a?D0.html(l,{indent_size:2,wrap_attributes_indent_size:2,max_preserve_newlines:0,preserve_newlines:!1}):l}static elementToMjml(e,r){return _i.unescape(tn.renderToStaticMarkup(T.createElement(at,{universalElements:r.universalElements,mode:r.mode,context:{content:r.pageElement},displayMode:r.displayMode||"desktop-mobile",keepEmptyAttributes:!!r.keepEmptyAttributes,mergetagsData:r.mergetagsData,attributesVariables:r.attributesVariables},T.createElement(le,{node:W.cloneDeep(e)}))))}static isPageDataVariable(e){return/\$var\(([\s\S]+)\)/g.test(e)}};re($e,"version","0.14.0"),re($e,"mjmlToBlockElement",C0),re($e,"getPageDataVariables",(e,r)=>{var i;return((i=e.data.variables)==null?void 0:i.reduce((n,a)=>G(H({},n),{[a.name]:a.value}),H({},r)))||H({},r)}),re($e,"renderWithPageVariables",(e,r,i)=>{if(!r)return e;const n=W.cloneDeep(e),a=new Set;if(typeof n=="string")return n.replace(/\$var\(([\s\S]+)\)/g,(o,c)=>W.get(r,c,""));const u=o=>{W.forOwn(o,(c,p)=>{!a.has(c)&&!T.isValidElement(c)&&(a.add(c),typeof c=="object"?(p!=="children"||i)&&u(c):typeof c=="string"&&(o[p]=c.replace(/\$var\(([\s\S]+)\)/g,(h,x)=>W.get(r,x,""))))})};return u(n),n}),re($e,"getUniversalElements",o0),re($e,"transformUniversalElements",l0);let mt=$e;const Qa=T.createContext({}),Bi=()=>T.useContext(Qa),at=t=>{const e=T.useMemo(()=>{const r=mt.getPageDataVariables(t.context.content,t.attributesVariables||{});return G(H({},t),{pageVariables:r})},[t]);return T.createElement(Qa.Provider,{value:e},t.children)};var Za=(t=>(t.RESPONSIVE="RESPONSIVE",t.TEMPLATE_ENGINE="TEMPLATE_ENGINE",t))(Za||{});class ir{constructor(){re(this,"enabledResponsive",!0)}}re(ir,"type","RESPONSIVE");class nr{}re(nr,"type","TEMPLATE_ENGINE");class Ja{}const Ee=class Ee{static registerPlugins(e){e.forEach(r=>{Ee.registerPlugin(r)})}static registerPlugin(e){const r=new e;r instanceof ir?(Ee.enabledResponsive=r.enabledResponsive,Ee.generateResponsive=r.generateResponsive):r instanceof nr?(Ee.generateIterationTemplate=r.generateIterationTemplate,Ee.generateConditionTemplate=r.generateConditionTemplate,Ee.generateVariable=r.generateVariable,Ee.isVariable=r.isVariable,Ee.renderWithData=r.renderWithData):r instanceof Ja&&r.generateElement()}};re(Ee,"enabledResponsive",!1),re(Ee,"generateResponsive",e=>{const r=se.getBlockByType(e.node.type),{mode:i,children:n,context:a,idx:u,node:o,keepEmptyAttributes:c,mergetagsData:p}=e;return r.render(G(H({},e),{mode:i,children:n,context:a,idx:u,node:o,keepEmptyAttributes:c,mergetagsData:p}))}),re(Ee,"generateIterationTemplate",(e,r)=>r),re(Ee,"isVariable",e=>!1),re(Ee,"generateConditionTemplate",(e,r)=>r),re(Ee,"generateVariable",e=>e),re(Ee,"renderWithData",(e,r)=>e);let He=Ee;const le=t=>{var g,w,m,y,E;const{children:e,node:r,idx:i}=t,{mode:n,context:a,displayMode:u,keepEmptyAttributes:o,mergetagsData:c,pageVariables:p}=Bi(),h=se.getBlockByType(r.type);if(!h)throw new Error(`${r.type} block is not registered`);let x=G(H({},r),{attributes:H({},r.attributes),mobileAttributes:H({},r.mobileAttributes)});const _=W.get(x,"attributes.css-class")||"";n==="production"&&_&&W.set(x,"attributes.css-class",_.replace($a,"").replace(bi,""));const A=(g=x.attributes["mj-class"])==null?void 0:g.trim();if(A&&a.content.data.classAttributes){const F={},s=A.split(" ").map(D=>D.trim()).filter(Boolean);Object.values(s).forEach(D=>{W.get(a.content.data.classAttributes,D)&&Object.assign(F,W.get(a.content.data.classAttributes,D))}),x.attributes=K(F,x.attributes)}const v=(w=a.content.data.blockAttributes)==null?void 0:w[x.type];v&&(x.attributes=K(v,x.attributes));const C=(m=a.content.data.categoryAttributes)==null?void 0:m[h.category];a.content.data.globalAttributes&&(x.attributes=K(a.content.data.globalAttributes,x.attributes)),C&&(x.attributes=K(C,x.attributes));const d=H({},se.getBlockByType(x.type).defaultData.attributes);if(d&&(W.get(x.attributes,"padding","").trim()&&(delete d.padding,delete d["padding-top"],delete d["padding-bottom"],delete d["padding-left"],delete d["padding-right"]),W.get(x.attributes,"inner-padding","").trim()&&(delete d["inner-padding"],delete d["inner-padding-top"],delete d["inner-padding-bottom"],delete d["inner-padding-left"],delete d["inner-padding-right"]),x.attributes=K(d,x.attributes)),he.isSectionElement(r)||he.isWrapperElement(r)){const F=a.content.attributes["content-background-color"];F&&(x.attributes=K({"background-color":F},x.attributes))}let f=p;he.isWidgetElement(x)?(f=K(p,x.data.input),x=mt.renderWithPageVariables(x,f,!0)):x=mt.renderWithPageVariables(x,f);let b=He.generateResponsive({mode:n,children:e,context:a,idx:i,node:x,keepEmptyAttributes:o,mergetagsData:c,displayMode:u});if(n==="production"){const F=(y=r.logic)==null?void 0:y.condition,s=(E=r.logic)==null?void 0:E.iteration;s&&s.enabled&&(b=He.generateIterationTemplate(s,b)),F&&F.enabled&&(b=He.generateConditionTemplate(W.cloneDeep(F),b))}return T.createElement(T.Fragment,null,b)},qe=({node:t})=>{let e=t.text;const r={};if(!e)return null;const i=t;return Object.keys(i).filter(a=>a!=="text").forEach(a=>{switch(a){case"bold":e=T.createElement("strong",null,e);break;case"italic":e=T.createElement("em",null,e);break;case"underline":e=T.createElement("u",null,e);break;case"strikethrough":e=T.createElement("del",null,e);break;case"link":i.link&&(e=T.createElement("a",{href:i.link.href,target:i.link.blank?"_blank":void 0},e));break;case"color":r.color=i.color;break;case"bgColor":r.backgroundColor=i.bgColor;break;case"fontSize":r.fontSize=i.fontSize;break;case"fontFamily":r.fontFamily=i.fontFamily;break;default:W.set(r,a,W.get(i,a))}}),W.isString(e)&&Object.keys(r).length===0?T.createElement(T.Fragment,null,e):T.createElement("span",{style:r},e)};function pe(t){const{params:e,params:{node:r,idx:i,children:n,keepEmptyAttributes:a},tag:u,children:o}=t,c=o||n,p=iu(e,{keepEmptyAttributes:a,removeDefaultAttributes:e.mode==="production"}),h=T.createElement(T.Fragment,null,`<${u}${p?` ${p}`:""}>`,c||r.children.map((x,_)=>{if(he.isTextNode(x)){const A=x.text.replace(/ {2}/g," ");return he.isTextListElement(r)?T.createElement(T.Fragment,{key:_},"<li>",T.createElement(qe,G(H({key:_},e),{node:G(H({},x),{text:A})})),"</li>"):T.createElement(qe,G(H({key:_},e),{node:G(H({},x),{text:A})}))}return T.createElement(le,G(H({key:_},e),{idx:i?he.getChildIdx(i,_):null,node:x}))}),`</${u}>`);return T.createElement(T.Fragment,null,h)}const es=t=>{if(T.isValidElement(t)||W.isString(t)||W.isUndefined(t)||W.isNumber(t)||W.isBoolean(t)||t===null||Array.isArray(t)&&t.every(e=>es(e)))return!0};function ue(t){return!!es(t)}function wi(t){const u=t,{data:e,idx:r,children:i}=u,n=de(u,["data","idx","children"]),a={type:$.WRAPPER,data:e||{},attributes:H({},n),children:ue(i)?[]:i||[]};return T.createElement(le,{idx:r,node:a,children:ue(i)?i:null})}function ts(t){const u=t,{data:e,idx:r,children:i}=u,n=de(u,["data","idx","children"]),a={type:$.SECTION,data:e||{},attributes:H({},n),children:ue(i)?[]:i||[]};return T.createElement(le,{idx:r,node:a,children:ue(i)?i:null})}function rs(t){const u=t,{data:e,idx:r,children:i}=u,n=de(u,["data","idx","children"]),a={type:$.GROUP,data:e||{},attributes:H({},n),children:ue(i)?[]:i||[]};return T.createElement(le,{idx:r,node:a,children:ue(i)?i:null})}function is(t){const u=t,{data:e,idx:r,children:i}=u,n=de(u,["data","idx","children"]),a={type:$.COLUMN,data:e||{},attributes:H({},n),children:ue(i)?[]:i||[]};return T.createElement(le,{idx:r,node:a,children:ue(i)?i:null})}function ns(t){const u=t,{data:e,children:r,idx:i}=u,n=de(u,["data","children","idx"]),a={type:$.BUTTON,data:e||{},attributes:H({},n),children:ue(r)?[]:r||[]};return T.createElement(le,{idx:i,node:a,children:ue(r)?r:null})}function as(t){const u=t,{data:e,idx:r,children:i}=u,n=de(u,["data","idx","children"]),a={type:$.IMAGE,data:e||{},attributes:H({},n),children:ue(i)?[]:i||[]};return T.createElement(le,{idx:r,node:a,children:ue(i)?i:null})}function ar(t){const u=t,{data:e,idx:r,children:i}=u,n=de(u,["data","idx","children"]),a={type:$.TEXT,data:e||{},attributes:H({},n),children:ue(i)?[]:i||[]};return T.createElement(le,{idx:r,node:a,children:ue(i)?i:null})}function ss(t){const u=t,{data:e,idx:r,children:i}=u,n=de(u,["data","idx","children"]),a={type:$.SPACER,data:e||{},attributes:H({},n),children:ue(i)?[]:i||[]};return T.createElement(le,{idx:r,node:a,children:ue(i)?i:null})}function Re(t){const u=t,{data:e,children:r,idx:i}=u,n=de(u,["data","children","idx"]),a={type:$.RAW,data:e||{content:r||""},attributes:H({},n),children:ue(r)?[]:r||[]};return T.createElement(le,{idx:i,node:a,children:ue(r)?r:null})}function us(t){const u=t,{data:e,idx:r,children:i}=u,n=de(u,["data","idx","children"]),a={type:$.DIVIDER,data:e||{},attributes:H({},n),children:ue(i)?[]:i||[]};return T.createElement(le,{idx:r,node:a,children:ue(i)?i:null})}function os(t){const u=t,{data:e,idx:r,children:i}=u,n=de(u,["data","idx","children"]),a={type:$.NAVBAR,data:e||{},attributes:H({},n),children:ue(i)?[]:i||[]};return T.createElement(le,{idx:r,node:a,children:ue(i)?i:null})}function ls(t){const u=t,{data:e,idx:r,children:i}=u,n=de(u,["data","idx","children"]),a={type:$.NAVBAR_LINK,data:e||{},attributes:H({},n),children:ue(i)?[]:i||[]};return T.createElement(le,{idx:r,node:a,children:ue(i)?i:null})}function cs(t){const u=t,{data:e,idx:r,children:i}=u,n=de(u,["data","idx","children"]),a={type:$.SOCIAL,data:e||{},attributes:H({},n),children:ue(i)?[]:i||[]};return T.createElement(le,{idx:r,node:a,children:ue(i)?i:null})}function ps(t){const u=t,{data:e,idx:r,children:i}=u,n=de(u,["data","idx","children"]),a={type:$.SOCIAL_ELEMENT,data:e||{},attributes:H({},n),children:ue(i)?[]:i||[]};return T.createElement(le,{idx:r,node:a,children:ue(i)?i:null})}function ds(t){const u=t,{data:e,idx:r,children:i}=u,n=de(u,["data","idx","children"]),a={type:$.HERO,data:e||{},attributes:H({},n),children:ue(i)?[]:i||[]};return T.createElement(le,{idx:r,node:a,children:ue(i)?i:null})}function B0(t){const u=t,{tagName:e,children:r,idx:i}=u,n=de(u,["tagName","children","idx"]),a={type:$.HTML_NODE,data:{tagName:e},attributes:H({},n),children:ue(r)?[]:r||[]};return T.createElement(le,{idx:i,node:a,children:ue(r)?r:null})}function w0(t){const a=t,{idx:e,children:r}=a,i=de(a,["idx","children"]),n={type:j.FOR_EACH,data:H({},i),attributes:{},children:ue(r)?[]:r||[]};return T.createElement(le,{idx:e,node:n,children:ue(r)?r:null})}function F0(t){const a=t,{idx:e,children:r}=a,i=de(a,["idx","children"]),n={type:j.SHOW,data:G(H({},i),{component:r}),attributes:{},children:[]};return T.createElement(le,{idx:e,node:n,children:r})}function T0(t){const u=t,{tagName:e,idx:r,children:i}=u,n=de(u,["tagName","idx","children"]),a={type:j.HTML_DOM_NODE,data:{tagName:e},attributes:H({},n),children:ue(i)?[]:i||[]};return T.createElement(le,{idx:r,node:a,children:ue(i)?i:null})}function hs(t){const a=t,{idx:e,children:r}=a,i=de(a,["idx","children"]),n={type:$.TABLE,data:{code:String(r)},attributes:H({},i),children:[]};return T.createElement(le,{idx:e,node:n,children:null})}function k0(t){const a=t,{children:e,idx:r}=a,i=de(a,["children","idx"]),n={type:$.DANGEROUS_CODE,data:{code:String(e)},attributes:H({},i),children:[]};return T.createElement(le,{idx:r,node:n,children:null})}const S0=({node:t})=>T.createElement(le,{node:G(H({},t),{attributes:G(H({},t.attributes),{"css-class":it(t.attributes["css-class"],bi)})})}),R0=Object.freeze(Object.defineProperty({__proto__:null,BasicBlock:pe,BlockRenderer:le,Button:ns,Code:k0,Column:is,ContentLeaf:qe,Divider:us,ForEach:w0,Group:rs,Hero:ds,HtmlDomNode:T0,HtmlNode:B0,Image:as,Navbar:os,NavbarLink:ls,Raw:Re,Section:ts,Show:F0,SlateNodePlaceholder:S0,Social:cs,SocialElement:ps,Spacer:ss,Table:hs,Text:ar,Wrapper:wi},Symbol.toStringTag,{value:"Module"})),O0={attributes:{width:"600px","margin-top":"30px","margin-bottom":"30px","link-text-decoration":"underline"},data:{breakpoint:"480px"}},N0={get name(){return X("Page")},defaultData:O0,type:$.PAGE,create:t=>{const e={type:$.PAGE,data:{breakpoint:"480px",globalAttributes:{"font-family":"Arial, sans-serif"}},attributes:{},children:[]};return K(e,t)},category:z.PAGE,render(t){var d,l,f,b,g,w;const{node:e,node:{data:r,attributes:i},mode:n}=t,a=r.breakpoint?`<mj-breakpoint width="${r.breakpoint}" />`:"",u=[...r.headStyles||[]];n==="testing"?u.unshift({content:Ma}):(u.unshift({content:n0}),u.unshift({content:a0,inline:"inline"}));const o=u.map(m=>`<mj-style ${m.inline?'inline="inline"':""}>${m.content}</mj-style>`).join(`
|
|
65
65
|
`)||"",c={color:((d=i["link-color"])==null?void 0:d.trim())||"inherit","font-weight":(l=i["link-font-weight"])==null?void 0:l.trim(),"text-decoration":(f=i["link-text-decoration"])==null?void 0:f.trim(),"font-style":(b=i["link-font-style"])==null?void 0:b.trim()},h=`<mj-style>.mjbody a, .mjbody a:hover, .mjbody a:active, .mjbody a[href], .mjbody a[href]:hover, .mjbody a[href]:active {${Object.keys(c).map(m=>{const y=c;return y[m]?`${m}: ${y[m]}`:""}).filter(Boolean).join(";")}}</mj-style>`,x=i["background-color"]?`background-color="${i["background-color"]}"`:"",_=i["margin-top"]&&i["margin-top"]!=="0px"?`<mj-section padding="0px"><mj-column><mj-spacer height="${i["margin-top"]}"></mj-spacer></mj-column></mj-section>`:"",A=i["margin-bottom"]&&i["margin-bottom"]!=="0px"?`<mj-section padding="0px"><mj-column><mj-spacer height="${i["margin-top"]}"></mj-spacer></mj-column></mj-section>`:"",v=r.preheader?`<mj-preview>${r.preheader}</mj-preview>`:"",C=i.width||"600px";return T.createElement(T.Fragment,null,`
|
|
66
66
|
<mjml>
|
|
67
67
|
<mj-head>
|
package/lib/index.es.js
CHANGED
|
@@ -36,7 +36,7 @@ var kt = (t, e, r) => new Promise((i, n) => {
|
|
|
36
36
|
}, o = (c) => c.done ? i(c.value) : Promise.resolve(c.value).then(a, u);
|
|
37
37
|
o((r = r.apply(t, e)).next());
|
|
38
38
|
});
|
|
39
|
-
import { mergeWith as hu, cloneDeep as we, isArray as fu, get as de, isString as Nt, set as
|
|
39
|
+
import { mergeWith as hu, cloneDeep as we, isArray as fu, get as de, isString as Nt, set as at, camelCase as _u, forOwn as xu, isUndefined as gu, isNumber as mu, isBoolean as Du, merge as Be, omit as Pa, chunk as bu, pickBy as Au } from "lodash";
|
|
40
40
|
import T, { useContext as Eu, useMemo as vu, isValidElement as yu } from "react";
|
|
41
41
|
import Ji from "axios";
|
|
42
42
|
import { renderToStaticMarkup as en } from "react-dom/server";
|
|
@@ -951,7 +951,7 @@ function Ru() {
|
|
|
951
951
|
}(_r)), _r.exports;
|
|
952
952
|
}
|
|
953
953
|
var xr = { exports: {} }, un;
|
|
954
|
-
function
|
|
954
|
+
function lt() {
|
|
955
955
|
return un || (un = 1, function(t, e) {
|
|
956
956
|
(function(r, i) {
|
|
957
957
|
t.exports = i(ue());
|
|
@@ -1108,7 +1108,7 @@ function Ou() {
|
|
|
1108
1108
|
}(gr)), gr.exports;
|
|
1109
1109
|
}
|
|
1110
1110
|
var mr = { exports: {} }, ln;
|
|
1111
|
-
function
|
|
1111
|
+
function ct() {
|
|
1112
1112
|
return ln || (ln = 1, function(t, e) {
|
|
1113
1113
|
(function(r, i) {
|
|
1114
1114
|
t.exports = i(ue());
|
|
@@ -1415,7 +1415,7 @@ function Ua() {
|
|
|
1415
1415
|
if (qe < 16)
|
|
1416
1416
|
Ye = Ht.high = v[C + qe * 2] | 0, Oe = Ht.low = v[C + qe * 2 + 1] | 0;
|
|
1417
1417
|
else {
|
|
1418
|
-
var Hi = _[qe - 15],
|
|
1418
|
+
var Hi = _[qe - 15], ht = Hi.high, Ft = Hi.low, Qs = (ht >>> 1 | Ft << 31) ^ (ht >>> 8 | Ft << 24) ^ ht >>> 7, zi = (Ft >>> 1 | ht << 31) ^ (Ft >>> 8 | ht << 24) ^ (Ft >>> 7 | ht << 25), Ui = _[qe - 2], ft = Ui.high, Tt = Ui.low, Zs = (ft >>> 19 | Tt << 13) ^ (ft << 3 | Tt >>> 29) ^ ft >>> 6, Mi = (Tt >>> 19 | ft << 13) ^ (Tt << 3 | ft >>> 29) ^ (Tt >>> 6 | ft << 26), $i = _[qe - 7], Js = $i.high, eu = $i.low, Vi = _[qe - 16], tu = Vi.high, ji = Vi.low;
|
|
1419
1419
|
Oe = zi + eu, Ye = Qs + Js + (Oe >>> 0 < zi >>> 0 ? 1 : 0), Oe = Oe + Mi, Ye = Ye + Zs + (Oe >>> 0 < Mi >>> 0 ? 1 : 0), Oe = Oe + ji, Ye = Ye + tu + (Oe >>> 0 < ji >>> 0 ? 1 : 0), Ht.high = Ye, Ht.low = Oe;
|
|
1420
1420
|
}
|
|
1421
1421
|
var ru = ge & $e ^ ~ge & Pt, Wi = Ce & ze ^ ~Ce & Bt, iu = ee & ie ^ ee & be ^ ie & be, nu = re & Y ^ re & fe ^ Y & fe, au = (ee >>> 28 | re << 4) ^ (ee << 30 | re >>> 2) ^ (ee << 25 | re >>> 7), Gi = (re >>> 28 | ee << 4) ^ (re << 30 | ee >>> 2) ^ (re << 25 | ee >>> 7), su = (ge >>> 14 | Ce << 18) ^ (ge >>> 18 | Ce << 14) ^ (ge << 23 | Ce >>> 9), uu = (Ce >>> 14 | ge << 18) ^ (Ce >>> 18 | ge << 14) ^ (Ce << 23 | ge >>> 9), Ki = x[qe], ou = Ki.high, Xi = Ki.low, Te = wt + uu, Qe = cr + su + (Te >>> 0 < wt >>> 0 ? 1 : 0), Te = Te + Wi, Qe = Qe + ru + (Te >>> 0 < Wi >>> 0 ? 1 : 0), Te = Te + Xi, Qe = Qe + ou + (Te >>> 0 < Xi >>> 0 ? 1 : 0), Te = Te + Oe, Qe = Qe + Ye + (Te >>> 0 < Oe >>> 0 ? 1 : 0), Yi = Gi + nu, lu = au + iu + (Yi >>> 0 < Gi >>> 0 ? 1 : 0);
|
|
@@ -2994,7 +2994,7 @@ var Ur = { exports: {} }, Rn;
|
|
|
2994
2994
|
function Yu() {
|
|
2995
2995
|
return Rn || (Rn = 1, function(t, e) {
|
|
2996
2996
|
(function(r, i, n) {
|
|
2997
|
-
t.exports = i(ue(),
|
|
2997
|
+
t.exports = i(ue(), lt(), ct(), tt(), De());
|
|
2998
2998
|
})(J, function(r) {
|
|
2999
2999
|
return function() {
|
|
3000
3000
|
var i = r, n = i.lib, a = n.BlockCipher, u = i.algo, o = [], c = [], p = [], h = [], x = [], _ = [], A = [], v = [], C = [], d = [];
|
|
@@ -3054,7 +3054,7 @@ var Mr = { exports: {} }, On;
|
|
|
3054
3054
|
function Qu() {
|
|
3055
3055
|
return On || (On = 1, function(t, e) {
|
|
3056
3056
|
(function(r, i, n) {
|
|
3057
|
-
t.exports = i(ue(),
|
|
3057
|
+
t.exports = i(ue(), lt(), ct(), tt(), De());
|
|
3058
3058
|
})(J, function(r) {
|
|
3059
3059
|
return function() {
|
|
3060
3060
|
var i = r, n = i.lib, a = n.WordArray, u = n.BlockCipher, o = i.algo, c = [
|
|
@@ -3774,7 +3774,7 @@ var $r = { exports: {} }, Nn;
|
|
|
3774
3774
|
function Zu() {
|
|
3775
3775
|
return Nn || (Nn = 1, function(t, e) {
|
|
3776
3776
|
(function(r, i, n) {
|
|
3777
|
-
t.exports = i(ue(),
|
|
3777
|
+
t.exports = i(ue(), lt(), ct(), tt(), De());
|
|
3778
3778
|
})(J, function(r) {
|
|
3779
3779
|
return function() {
|
|
3780
3780
|
var i = r, n = i.lib, a = n.StreamCipher, u = i.algo, o = u.RC4 = a.extend({
|
|
@@ -3828,7 +3828,7 @@ var Vr = { exports: {} }, Ln;
|
|
|
3828
3828
|
function Ju() {
|
|
3829
3829
|
return Ln || (Ln = 1, function(t, e) {
|
|
3830
3830
|
(function(r, i, n) {
|
|
3831
|
-
t.exports = i(ue(),
|
|
3831
|
+
t.exports = i(ue(), lt(), ct(), tt(), De());
|
|
3832
3832
|
})(J, function(r) {
|
|
3833
3833
|
return function() {
|
|
3834
3834
|
var i = r, n = i.lib, a = n.StreamCipher, u = i.algo, o = [], c = [], p = [], h = u.Rabbit = a.extend({
|
|
@@ -3894,7 +3894,7 @@ var jr = { exports: {} }, qn;
|
|
|
3894
3894
|
function e0() {
|
|
3895
3895
|
return qn || (qn = 1, function(t, e) {
|
|
3896
3896
|
(function(r, i, n) {
|
|
3897
|
-
t.exports = i(ue(),
|
|
3897
|
+
t.exports = i(ue(), lt(), ct(), tt(), De());
|
|
3898
3898
|
})(J, function(r) {
|
|
3899
3899
|
return function() {
|
|
3900
3900
|
var i = r, n = i.lib, a = n.StreamCipher, u = i.algo, o = [], c = [], p = [], h = u.RabbitLegacy = a.extend({
|
|
@@ -3958,7 +3958,7 @@ var Wr = { exports: {} }, In;
|
|
|
3958
3958
|
function t0() {
|
|
3959
3959
|
return In || (In = 1, function(t, e) {
|
|
3960
3960
|
(function(r, i, n) {
|
|
3961
|
-
t.exports = i(ue(),
|
|
3961
|
+
t.exports = i(ue(), lt(), ct(), tt(), De());
|
|
3962
3962
|
})(J, function(r) {
|
|
3963
3963
|
return function() {
|
|
3964
3964
|
var i = r, n = i.lib, a = n.BlockCipher, u = i.algo;
|
|
@@ -5078,7 +5078,7 @@ function t0() {
|
|
|
5078
5078
|
}
|
|
5079
5079
|
(function(t, e) {
|
|
5080
5080
|
(function(r, i, n) {
|
|
5081
|
-
t.exports = i(ue(), nr(), Su(), Ru(),
|
|
5081
|
+
t.exports = i(ue(), nr(), Su(), Ru(), lt(), Ou(), ct(), za(), Di(), Nu(), Ua(), Lu(), qu(), Iu(), bi(), Pu(), tt(), De(), Hu(), zu(), Uu(), Mu(), $u(), Vu(), ju(), Wu(), Gu(), Ku(), Xu(), Yu(), Qu(), Zu(), Ju(), e0(), t0());
|
|
5082
5082
|
})(J, function(r) {
|
|
5083
5083
|
return r;
|
|
5084
5084
|
});
|
|
@@ -5543,7 +5543,7 @@ function f0(t) {
|
|
|
5543
5543
|
throw new Error("No universalElements");
|
|
5544
5544
|
if (!t.universalElements[i.uid])
|
|
5545
5545
|
throw new Error(`Can not find element by uid ${i.uid}`);
|
|
5546
|
-
|
|
5546
|
+
at(e, n, we(t.universalElements[i.uid]));
|
|
5547
5547
|
}
|
|
5548
5548
|
i.children.forEach((a, u) => {
|
|
5549
5549
|
he.isTextNode(a) || r(a, he.getChildIdx(n, u));
|
|
@@ -5789,7 +5789,7 @@ function Ka() {
|
|
|
5789
5789
|
}
|
|
5790
5790
|
return r.prototype = new t(), ei.Options = r, ei;
|
|
5791
5791
|
}
|
|
5792
|
-
var
|
|
5792
|
+
var _t = {}, ti = {}, Gn;
|
|
5793
5793
|
function vi() {
|
|
5794
5794
|
if (Gn)
|
|
5795
5795
|
return ti;
|
|
@@ -6070,7 +6070,7 @@ function Xa() {
|
|
|
6070
6070
|
var ea;
|
|
6071
6071
|
function jt() {
|
|
6072
6072
|
if (ea)
|
|
6073
|
-
return
|
|
6073
|
+
return _t;
|
|
6074
6074
|
ea = 1;
|
|
6075
6075
|
var t = vi().InputScanner, e = er().Tokenizer, r = er().TOKEN, i = yi().Directives, n = Ga(), a = ar().Pattern, u = Xa().TemplatablePattern;
|
|
6076
6076
|
function o(m, y) {
|
|
@@ -6266,7 +6266,7 @@ function jt() {
|
|
|
6266
6266
|
B += s.read(), D += B;
|
|
6267
6267
|
}
|
|
6268
6268
|
return D;
|
|
6269
|
-
},
|
|
6269
|
+
}, _t.Tokenizer = g, _t.TOKEN = c, _t.positionable_operators = A.slice(), _t.line_starters = d.slice(), _t;
|
|
6270
6270
|
}
|
|
6271
6271
|
var ta;
|
|
6272
6272
|
function g0() {
|
|
@@ -7680,7 +7680,7 @@ const oe = (t) => {
|
|
|
7680
7680
|
mobileAttributes: H({}, r.mobileAttributes)
|
|
7681
7681
|
});
|
|
7682
7682
|
const _ = de(x, "attributes.css-class") || "";
|
|
7683
|
-
n === "production" && _ &&
|
|
7683
|
+
n === "production" && _ && at(
|
|
7684
7684
|
x,
|
|
7685
7685
|
"attributes.css-class",
|
|
7686
7686
|
_.replace(c0, "").replace($a, "")
|
|
@@ -7748,7 +7748,49 @@ const oe = (t) => {
|
|
|
7748
7748
|
}, Pe = ({ node: t }) => {
|
|
7749
7749
|
let e = t.text;
|
|
7750
7750
|
const r = {};
|
|
7751
|
-
|
|
7751
|
+
if (!e)
|
|
7752
|
+
return null;
|
|
7753
|
+
const i = t;
|
|
7754
|
+
return Object.keys(i).filter((a) => a !== "text").forEach((a) => {
|
|
7755
|
+
switch (a) {
|
|
7756
|
+
case "bold":
|
|
7757
|
+
e = /* @__PURE__ */ T.createElement("strong", null, e);
|
|
7758
|
+
break;
|
|
7759
|
+
case "italic":
|
|
7760
|
+
e = /* @__PURE__ */ T.createElement("em", null, e);
|
|
7761
|
+
break;
|
|
7762
|
+
case "underline":
|
|
7763
|
+
e = /* @__PURE__ */ T.createElement("u", null, e);
|
|
7764
|
+
break;
|
|
7765
|
+
case "strikethrough":
|
|
7766
|
+
e = /* @__PURE__ */ T.createElement("del", null, e);
|
|
7767
|
+
break;
|
|
7768
|
+
case "link":
|
|
7769
|
+
i.link && (e = /* @__PURE__ */ T.createElement(
|
|
7770
|
+
"a",
|
|
7771
|
+
{
|
|
7772
|
+
href: i.link.href,
|
|
7773
|
+
target: i.link.blank ? "_blank" : void 0
|
|
7774
|
+
},
|
|
7775
|
+
e
|
|
7776
|
+
));
|
|
7777
|
+
break;
|
|
7778
|
+
case "color":
|
|
7779
|
+
r.color = i.color;
|
|
7780
|
+
break;
|
|
7781
|
+
case "bgColor":
|
|
7782
|
+
r.backgroundColor = i.bgColor;
|
|
7783
|
+
break;
|
|
7784
|
+
case "fontSize":
|
|
7785
|
+
r.fontSize = i.fontSize;
|
|
7786
|
+
break;
|
|
7787
|
+
case "fontFamily":
|
|
7788
|
+
r.fontFamily = i.fontFamily;
|
|
7789
|
+
break;
|
|
7790
|
+
default:
|
|
7791
|
+
at(r, a, de(i, a));
|
|
7792
|
+
}
|
|
7793
|
+
}), Nt(e) && Object.keys(r).length === 0 ? /* @__PURE__ */ T.createElement(T.Fragment, null, e) : /* @__PURE__ */ T.createElement("span", { style: r }, e);
|
|
7752
7794
|
};
|
|
7753
7795
|
function ce(t) {
|
|
7754
7796
|
const {
|
|
@@ -10668,7 +10710,7 @@ class Le {
|
|
|
10668
10710
|
return this.end - this.begin;
|
|
10669
10711
|
}
|
|
10670
10712
|
}
|
|
10671
|
-
class
|
|
10713
|
+
class pt {
|
|
10672
10714
|
liquidMethodMissing(e) {
|
|
10673
10715
|
}
|
|
10674
10716
|
}
|
|
@@ -10692,7 +10734,7 @@ function Q(t) {
|
|
|
10692
10734
|
return t = Z(t), Me(t) ? t : Xe(t) ? "" : me(t) ? t.map((e) => Q(e)).join("") : String(t);
|
|
10693
10735
|
}
|
|
10694
10736
|
function Z(t) {
|
|
10695
|
-
return t instanceof
|
|
10737
|
+
return t instanceof pt && Fe(t.valueOf) ? t.valueOf() : t;
|
|
10696
10738
|
}
|
|
10697
10739
|
function ur(t) {
|
|
10698
10740
|
return typeof t == "number";
|
|
@@ -10841,7 +10883,7 @@ function He(t, e) {
|
|
|
10841
10883
|
throw new wl(r);
|
|
10842
10884
|
}
|
|
10843
10885
|
}
|
|
10844
|
-
class Rl extends
|
|
10886
|
+
class Rl extends pt {
|
|
10845
10887
|
equals(e) {
|
|
10846
10888
|
return Xe(Z(e));
|
|
10847
10889
|
}
|
|
@@ -10861,7 +10903,7 @@ class Rl extends ct {
|
|
|
10861
10903
|
return null;
|
|
10862
10904
|
}
|
|
10863
10905
|
}
|
|
10864
|
-
class or extends
|
|
10906
|
+
class or extends pt {
|
|
10865
10907
|
equals(e) {
|
|
10866
10908
|
return e instanceof or ? !1 : (e = Z(e), Me(e) || me(e) ? e.length === 0 : Fi(e) ? Object.keys(e).length === 0 : !1);
|
|
10867
10909
|
}
|
|
@@ -10886,7 +10928,7 @@ class Ol extends or {
|
|
|
10886
10928
|
return e === !1 || Xe(Z(e)) ? !0 : Me(e) ? /^\s*$/.test(e) : super.equals(e);
|
|
10887
10929
|
}
|
|
10888
10930
|
}
|
|
10889
|
-
class ki extends
|
|
10931
|
+
class ki extends pt {
|
|
10890
10932
|
constructor(e, r, i) {
|
|
10891
10933
|
super(), this.i = 0, this.length = e, this.name = `${i}-${r}`;
|
|
10892
10934
|
}
|
|
@@ -10915,7 +10957,7 @@ class ki extends ct {
|
|
|
10915
10957
|
return JSON.stringify(this);
|
|
10916
10958
|
}
|
|
10917
10959
|
}
|
|
10918
|
-
class va extends
|
|
10960
|
+
class va extends pt {
|
|
10919
10961
|
constructor(e = () => "") {
|
|
10920
10962
|
super(), this.superBlockRender = e;
|
|
10921
10963
|
}
|
|
@@ -11520,7 +11562,7 @@ function* fc(t) {
|
|
|
11520
11562
|
for (; e.length; )
|
|
11521
11563
|
yield e.pop();
|
|
11522
11564
|
}
|
|
11523
|
-
function
|
|
11565
|
+
function st(t, e) {
|
|
11524
11566
|
return !lr(t, e);
|
|
11525
11567
|
}
|
|
11526
11568
|
function lr(t, e) {
|
|
@@ -11535,8 +11577,8 @@ const _c = {
|
|
|
11535
11577
|
"<=": (t, e) => Ie(t) ? t.leq(e) : Ie(e) ? e.geq(t) : Z(t) <= Z(e),
|
|
11536
11578
|
contains: (t, e) => (t = Z(t), me(t) ? t.some((r) => Qt(r, e)) : Me(t) ? t.indexOf(Z(e)) > -1 : !1),
|
|
11537
11579
|
not: (t, e) => lr(Z(t), e),
|
|
11538
|
-
and: (t, e, r) =>
|
|
11539
|
-
or: (t, e, r) =>
|
|
11580
|
+
and: (t, e, r) => st(Z(t), r) && st(Z(e), r),
|
|
11581
|
+
or: (t, e, r) => st(Z(t), r) || st(Z(e), r)
|
|
11540
11582
|
};
|
|
11541
11583
|
function Qt(t, e) {
|
|
11542
11584
|
return Ie(t) ? t.equals(e) : Ie(e) ? e.equals(t) : (t = Z(t), e = Z(e), me(t) ? me(e) && xc(t, e) : t === e);
|
|
@@ -11727,7 +11769,7 @@ function qc(t, e) {
|
|
|
11727
11769
|
let r = !1;
|
|
11728
11770
|
for (let i = 0; i < t.length; i++) {
|
|
11729
11771
|
const n = t[i];
|
|
11730
|
-
Wc(n) && (!r && n.trimLeft && Ic(t[i - 1], e.greedy),
|
|
11772
|
+
Wc(n) && (!r && n.trimLeft && Ic(t[i - 1], e.greedy), dt(n) && (n.name === "raw" ? r = !0 : n.name === "endraw" && (r = !1)), !r && n.trimRight && Pc(t[i + 1], e.greedy));
|
|
11731
11773
|
}
|
|
11732
11774
|
}
|
|
11733
11775
|
function Ic(t, e) {
|
|
@@ -12085,7 +12127,7 @@ class Hc {
|
|
|
12085
12127
|
this.trigger("start");
|
|
12086
12128
|
let e;
|
|
12087
12129
|
for (; !this.stopRequested && (e = this.tokens.shift()); ) {
|
|
12088
|
-
if (this.trigger("token", e) ||
|
|
12130
|
+
if (this.trigger("token", e) || dt(e) && this.trigger(`tag:${e.name}`, e))
|
|
12089
12131
|
continue;
|
|
12090
12132
|
const r = this.parseToken(e, this.tokens);
|
|
12091
12133
|
this.trigger("template", r);
|
|
@@ -12188,10 +12230,10 @@ class $c extends Ni {
|
|
|
12188
12230
|
r.write(this.str);
|
|
12189
12231
|
}
|
|
12190
12232
|
}
|
|
12191
|
-
var
|
|
12233
|
+
var ot;
|
|
12192
12234
|
(function(t) {
|
|
12193
12235
|
t.Partials = "partials", t.Layouts = "layouts", t.Root = "root";
|
|
12194
|
-
})(
|
|
12236
|
+
})(ot || (ot = {}));
|
|
12195
12237
|
class Vc {
|
|
12196
12238
|
constructor(e) {
|
|
12197
12239
|
if (this.options = e, e.relativeReference) {
|
|
@@ -12205,7 +12247,7 @@ class Vc {
|
|
|
12205
12247
|
}
|
|
12206
12248
|
*lookup(e, r, i, n) {
|
|
12207
12249
|
const { fs: a } = this.options, u = this.options[r];
|
|
12208
|
-
for (const o of this.candidates(e, u, n, r !==
|
|
12250
|
+
for (const o of this.candidates(e, u, n, r !== ot.Root))
|
|
12209
12251
|
if (i ? a.existsSync(o) : yield a.exists(o))
|
|
12210
12252
|
return o;
|
|
12211
12253
|
throw this.lookupError(e, u);
|
|
@@ -12255,7 +12297,7 @@ class jc {
|
|
|
12255
12297
|
}
|
|
12256
12298
|
parseToken(e, r) {
|
|
12257
12299
|
try {
|
|
12258
|
-
if (
|
|
12300
|
+
if (dt(e)) {
|
|
12259
12301
|
const i = this.liquid.tags[e.name];
|
|
12260
12302
|
return He(i, `tag "${e.name}" not found`), new i(e, r, this.liquid);
|
|
12261
12303
|
}
|
|
@@ -12267,7 +12309,7 @@ class jc {
|
|
|
12267
12309
|
parseStream(e) {
|
|
12268
12310
|
return new Hc(e, (r, i) => this.parseToken(r, i));
|
|
12269
12311
|
}
|
|
12270
|
-
*_parseFileCached(e, r, i =
|
|
12312
|
+
*_parseFileCached(e, r, i = ot.Root, n) {
|
|
12271
12313
|
const a = this.cache, u = this.loader.shouldLoadRelative(e) ? n + "," + e : i + ":" + e, o = yield a.read(u);
|
|
12272
12314
|
if (o)
|
|
12273
12315
|
return o;
|
|
@@ -12279,7 +12321,7 @@ class jc {
|
|
|
12279
12321
|
throw a.remove(u), h;
|
|
12280
12322
|
}
|
|
12281
12323
|
}
|
|
12282
|
-
*_parseFile(e, r, i =
|
|
12324
|
+
*_parseFile(e, r, i = ot.Root, n) {
|
|
12283
12325
|
const a = yield this.loader.lookup(e, i, r, n);
|
|
12284
12326
|
return this.liquid.parse(r ? this.fs.readFileSync(a) : yield this.fs.readFile(a), a);
|
|
12285
12327
|
}
|
|
@@ -12300,7 +12342,7 @@ function Li(t) {
|
|
|
12300
12342
|
function Gc(t) {
|
|
12301
12343
|
return rt(t) === _e.Output;
|
|
12302
12344
|
}
|
|
12303
|
-
function
|
|
12345
|
+
function dt(t) {
|
|
12304
12346
|
return rt(t) === _e.Tag;
|
|
12305
12347
|
}
|
|
12306
12348
|
function Kc(t) {
|
|
@@ -12315,7 +12357,7 @@ function Yc(t) {
|
|
|
12315
12357
|
function rt(t) {
|
|
12316
12358
|
return t ? t.kind : -1;
|
|
12317
12359
|
}
|
|
12318
|
-
class
|
|
12360
|
+
class xt {
|
|
12319
12361
|
constructor(e = {}, r = nt, i = {}) {
|
|
12320
12362
|
var n, a, u;
|
|
12321
12363
|
this.scopes = [{}], this.registers = {}, this.sync = !!i.sync, this.opts = r, this.globals = (n = i.globals) !== null && n !== void 0 ? n : r.globals, this.environments = e, this.strictVariables = (a = i.strictVariables) !== null && a !== void 0 ? a : this.opts.strictVariables, this.ownPropertyOnly = (u = i.ownPropertyOnly) !== null && u !== void 0 ? u : r.ownPropertyOnly;
|
|
@@ -12385,10 +12427,10 @@ function Qc(t, e, r) {
|
|
|
12385
12427
|
if (me(t) && e < 0)
|
|
12386
12428
|
return t[t.length + +e];
|
|
12387
12429
|
const i = Zc(t, e, r);
|
|
12388
|
-
return i === void 0 && t instanceof
|
|
12430
|
+
return i === void 0 && t instanceof pt ? t.liquidMethodMissing(e) : Fe(i) ? i.call(t) : e === "size" ? tp(t) : e === "first" ? Jc(t) : e === "last" ? ep(t) : i;
|
|
12389
12431
|
}
|
|
12390
12432
|
function Zc(t, e, r) {
|
|
12391
|
-
if (!(r && !Object.hasOwnProperty.call(t, e) && !(t instanceof
|
|
12433
|
+
if (!(r && !Object.hasOwnProperty.call(t, e) && !(t instanceof pt)))
|
|
12392
12434
|
return t[e];
|
|
12393
12435
|
}
|
|
12394
12436
|
function Jc(t) {
|
|
@@ -12405,10 +12447,10 @@ function tp(t) {
|
|
|
12405
12447
|
if (typeof t == "object")
|
|
12406
12448
|
return Object.keys(t).length;
|
|
12407
12449
|
}
|
|
12408
|
-
var
|
|
12450
|
+
var ut;
|
|
12409
12451
|
(function(t) {
|
|
12410
12452
|
t[t.OUTPUT = 0] = "OUTPUT", t[t.STORE = 1] = "STORE";
|
|
12411
|
-
})(
|
|
12453
|
+
})(ut || (ut = {}));
|
|
12412
12454
|
const rp = Re(Math.abs), ip = Re(Math.max), np = Re(Math.min), ap = Re(Math.ceil), sp = Re((t, e, r = !1) => r ? Math.floor(t / e) : t / e), up = Re(Math.floor), op = Re((t, e) => t - e), lp = Re((t, e) => t % e), cp = Re((t, e) => t * e);
|
|
12413
12455
|
function pp(t, e = 0) {
|
|
12414
12456
|
t = Z(t), e = Z(e);
|
|
@@ -12488,7 +12530,7 @@ function* Tp(t, e, r) {
|
|
|
12488
12530
|
t = Ue(Z(t));
|
|
12489
12531
|
for (const n of t)
|
|
12490
12532
|
i.push(yield this.context._getFromScope(n, Q(e).split("."), !1));
|
|
12491
|
-
return t.filter((n, a) => r === void 0 ?
|
|
12533
|
+
return t.filter((n, a) => r === void 0 ? st(i[a], this.context) : Ie(r) ? r.equals(i[a]) : i[a] === r);
|
|
12492
12534
|
}
|
|
12493
12535
|
function kp(t) {
|
|
12494
12536
|
t = Z(t);
|
|
@@ -12688,7 +12730,7 @@ class ud extends xe {
|
|
|
12688
12730
|
constructor(e, r, i) {
|
|
12689
12731
|
for (super(e, r, i), this.templates = [], this.variable = this.readVariableName(); r.length; ) {
|
|
12690
12732
|
const n = r.shift();
|
|
12691
|
-
if (
|
|
12733
|
+
if (dt(n) && n.name === "endcapture")
|
|
12692
12734
|
return;
|
|
12693
12735
|
this.templates.push(i.parser.parseToken(n, r));
|
|
12694
12736
|
}
|
|
@@ -12750,7 +12792,7 @@ class ld extends xe {
|
|
|
12750
12792
|
constructor(e, r, i) {
|
|
12751
12793
|
for (super(e, r, i); r.length; ) {
|
|
12752
12794
|
const n = r.shift();
|
|
12753
|
-
if (
|
|
12795
|
+
if (dt(n) && n.name === "endcomment")
|
|
12754
12796
|
return;
|
|
12755
12797
|
}
|
|
12756
12798
|
throw new Error(`tag ${e.getText()} not closed`);
|
|
@@ -12782,7 +12824,7 @@ class cd extends xe {
|
|
|
12782
12824
|
*render(e, r) {
|
|
12783
12825
|
const { liquid: i, hash: n } = this, a = yield Ii(this.file, e, i);
|
|
12784
12826
|
He(a, () => `illegal file path "${a}"`);
|
|
12785
|
-
const u = new
|
|
12827
|
+
const u = new xt({}, e.opts, { sync: e.sync, globals: e.globals, strictVariables: e.strictVariables }), o = u.bottom();
|
|
12786
12828
|
if (ir(o, yield n.render(e)), this.with) {
|
|
12787
12829
|
const { value: c, alias: p } = this.with;
|
|
12788
12830
|
o[p || a] = yield ve(c, e);
|
|
@@ -12833,7 +12875,7 @@ class pd extends xe {
|
|
|
12833
12875
|
const { liquid: i, hash: n, withVar: a } = this, { renderer: u } = i, o = yield Ii(this.file, e, i);
|
|
12834
12876
|
He(o, () => `illegal file path "${o}"`);
|
|
12835
12877
|
const c = e.saveRegister("blocks", "blockMode");
|
|
12836
|
-
e.setRegister("blocks", {}), e.setRegister("blockMode",
|
|
12878
|
+
e.setRegister("blocks", {}), e.setRegister("blockMode", ut.OUTPUT);
|
|
12837
12879
|
const p = yield n.render(e);
|
|
12838
12880
|
a && (p[o] = yield ve(a, e));
|
|
12839
12881
|
const h = yield i._parsePartialFile(o, e.sync, this.currentFile);
|
|
@@ -12897,7 +12939,7 @@ class fd extends xe {
|
|
|
12897
12939
|
const i = this.liquid.renderer;
|
|
12898
12940
|
for (const { value: n, templates: a } of this.branches) {
|
|
12899
12941
|
const u = yield n.value(e, e.opts.lenientIf);
|
|
12900
|
-
if (
|
|
12942
|
+
if (st(u, e)) {
|
|
12901
12943
|
yield i.renderTemplates(a, e, r);
|
|
12902
12944
|
return;
|
|
12903
12945
|
}
|
|
@@ -12923,15 +12965,15 @@ class xd extends xe {
|
|
|
12923
12965
|
*render(e, r) {
|
|
12924
12966
|
const { liquid: i, args: n, file: a } = this, { renderer: u } = i;
|
|
12925
12967
|
if (a === void 0) {
|
|
12926
|
-
e.setRegister("blockMode",
|
|
12968
|
+
e.setRegister("blockMode", ut.OUTPUT), yield u.renderTemplates(this.templates, e, r);
|
|
12927
12969
|
return;
|
|
12928
12970
|
}
|
|
12929
12971
|
const o = yield Ii(this.file, e, i);
|
|
12930
12972
|
He(o, () => `illegal file path "${o}"`);
|
|
12931
12973
|
const c = yield i._parseLayoutFile(o, e.sync, this.currentFile);
|
|
12932
|
-
e.setRegister("blockMode",
|
|
12974
|
+
e.setRegister("blockMode", ut.STORE);
|
|
12933
12975
|
const p = yield u.renderTemplates(this.templates, e), h = e.getRegister("blocks");
|
|
12934
|
-
h[""] === void 0 && (h[""] = (x, _) => _.write(p)), e.setRegister("blockMode",
|
|
12976
|
+
h[""] === void 0 && (h[""] = (x, _) => _.write(p)), e.setRegister("blockMode", ut.OUTPUT), e.push(yield n.render(e)), yield u.renderTemplates(c, e, r), e.pop();
|
|
12935
12977
|
}
|
|
12936
12978
|
}
|
|
12937
12979
|
class gd extends xe {
|
|
@@ -12940,7 +12982,7 @@ class gd extends xe {
|
|
|
12940
12982
|
const n = /\w+/.exec(e.args);
|
|
12941
12983
|
for (this.block = n ? n[0] : ""; r.length; ) {
|
|
12942
12984
|
const a = r.shift();
|
|
12943
|
-
if (
|
|
12985
|
+
if (dt(a) && a.name === "endblock")
|
|
12944
12986
|
return;
|
|
12945
12987
|
const u = i.parser.parseToken(a, r);
|
|
12946
12988
|
this.templates.push(u);
|
|
@@ -12949,7 +12991,7 @@ class gd extends xe {
|
|
|
12949
12991
|
}
|
|
12950
12992
|
*render(e, r) {
|
|
12951
12993
|
const i = this.getBlockRender(e);
|
|
12952
|
-
e.getRegister("blockMode") ===
|
|
12994
|
+
e.getRegister("blockMode") === ut.STORE ? e.getRegister("blocks")[this.block] = i : yield i(new va(), r);
|
|
12953
12995
|
}
|
|
12954
12996
|
getBlockRender(e) {
|
|
12955
12997
|
const { liquid: r, templates: i } = this, n = e.getRegister("blocks")[this.block], a = function* (u, o) {
|
|
@@ -12962,7 +13004,7 @@ class md extends xe {
|
|
|
12962
13004
|
constructor(e, r, i) {
|
|
12963
13005
|
for (super(e, r, i), this.tokens = []; r.length; ) {
|
|
12964
13006
|
const n = r.shift();
|
|
12965
|
-
if (
|
|
13007
|
+
if (dt(n) && n.name === "endraw")
|
|
12966
13008
|
return;
|
|
12967
13009
|
this.tokens.push(n);
|
|
12968
13010
|
}
|
|
@@ -13033,7 +13075,7 @@ class Ad extends xe {
|
|
|
13033
13075
|
}
|
|
13034
13076
|
this.branches.push({
|
|
13035
13077
|
value: new Ke(u.args, this.liquid),
|
|
13036
|
-
test:
|
|
13078
|
+
test: st,
|
|
13037
13079
|
templates: n = []
|
|
13038
13080
|
});
|
|
13039
13081
|
}).on("tag:else", () => {
|
|
@@ -13128,7 +13170,7 @@ class Pi {
|
|
|
13128
13170
|
return this.parser.parse(e, r);
|
|
13129
13171
|
}
|
|
13130
13172
|
_render(e, r, i) {
|
|
13131
|
-
const n = r instanceof
|
|
13173
|
+
const n = r instanceof xt ? r : new xt(r, this.options, i);
|
|
13132
13174
|
return this.renderer.renderTemplates(e, n);
|
|
13133
13175
|
}
|
|
13134
13176
|
render(e, r, i) {
|
|
@@ -13140,7 +13182,7 @@ class Pi {
|
|
|
13140
13182
|
return et(this._render(e, r, Object.assign(Object.assign({}, i), { sync: !0 })));
|
|
13141
13183
|
}
|
|
13142
13184
|
renderToNodeStream(e, r, i = {}) {
|
|
13143
|
-
const n = new
|
|
13185
|
+
const n = new xt(r, this.options, i);
|
|
13144
13186
|
return this.renderer.renderTemplatesToNodeStream(e, n);
|
|
13145
13187
|
}
|
|
13146
13188
|
_parseAndRender(e, r, i) {
|
|
@@ -13156,10 +13198,10 @@ class Pi {
|
|
|
13156
13198
|
return et(this._parseAndRender(e, r, Object.assign(Object.assign({}, i), { sync: !0 })));
|
|
13157
13199
|
}
|
|
13158
13200
|
_parsePartialFile(e, r, i) {
|
|
13159
|
-
return this.parser.parseFile(e, r,
|
|
13201
|
+
return this.parser.parseFile(e, r, ot.Partials, i);
|
|
13160
13202
|
}
|
|
13161
13203
|
_parseLayoutFile(e, r, i) {
|
|
13162
|
-
return this.parser.parseFile(e, r,
|
|
13204
|
+
return this.parser.parseFile(e, r, ot.Layouts, i);
|
|
13163
13205
|
}
|
|
13164
13206
|
_parseFile(e, r, i, n) {
|
|
13165
13207
|
return this.parser.parseFile(e, r, i, n);
|
|
@@ -13191,7 +13233,7 @@ class Pi {
|
|
|
13191
13233
|
});
|
|
13192
13234
|
}
|
|
13193
13235
|
_evalValue(e, r) {
|
|
13194
|
-
const i = new Ke(e, this), n = r instanceof
|
|
13236
|
+
const i = new Ke(e, this), n = r instanceof xt ? r : new xt(r, this.options);
|
|
13195
13237
|
return i.value(n);
|
|
13196
13238
|
}
|
|
13197
13239
|
evalValue(e, r) {
|
|
@@ -13324,7 +13366,7 @@ class qd extends Ci {
|
|
|
13324
13366
|
if (n === "only-desktop") {
|
|
13325
13367
|
if (a.visible === "mobile" || C.includes(A))
|
|
13326
13368
|
return null;
|
|
13327
|
-
C.includes(v) ||
|
|
13369
|
+
C.includes(v) || at(
|
|
13328
13370
|
a,
|
|
13329
13371
|
"attributes.css-class",
|
|
13330
13372
|
gt(C, v)
|
|
@@ -13332,7 +13374,7 @@ class qd extends Ci {
|
|
|
13332
13374
|
} else if (n === "only-mobile") {
|
|
13333
13375
|
if (C.includes(v))
|
|
13334
13376
|
return null;
|
|
13335
|
-
C.includes(A) ||
|
|
13377
|
+
C.includes(A) || at(
|
|
13336
13378
|
a,
|
|
13337
13379
|
"attributes.css-class",
|
|
13338
13380
|
gt(C, A)
|
|
@@ -13351,11 +13393,11 @@ class qd extends Ci {
|
|
|
13351
13393
|
d,
|
|
13352
13394
|
a.attributes
|
|
13353
13395
|
);
|
|
13354
|
-
a.visible === "desktop" ?
|
|
13396
|
+
a.visible === "desktop" ? at(
|
|
13355
13397
|
a,
|
|
13356
13398
|
"attributes.css-class",
|
|
13357
13399
|
gt(C, v)
|
|
13358
|
-
) : a.visible === "mobile" &&
|
|
13400
|
+
) : a.visible === "mobile" && at(
|
|
13359
13401
|
a,
|
|
13360
13402
|
"attributes.css-class",
|
|
13361
13403
|
gt(C, A)
|