@creaditor/web-starterkit 1.0.11 → 1.0.13
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/dist/1142.creaditor.bundle.js +1 -1
- package/dist/1142.creaditor.bundle.js.gz +0 -0
- package/dist/1260.creaditor.bundle.js +63 -26
- package/dist/1260.creaditor.bundle.js.gz +0 -0
- package/dist/1271.creaditor.bundle.js +1 -1
- package/dist/1271.creaditor.bundle.js.gz +0 -0
- package/dist/1334.creaditor.bundle.js +2 -2
- package/dist/1334.creaditor.bundle.js.gz +0 -0
- package/dist/170.creaditor.bundle.js +144 -17
- package/dist/170.creaditor.bundle.js.gz +0 -0
- package/dist/211.creaditor.bundle.js +1 -1
- package/dist/211.creaditor.bundle.js.gz +0 -0
- package/dist/2234.creaditor.bundle.js +121 -1
- package/dist/2234.creaditor.bundle.js.gz +0 -0
- package/dist/2590.creaditor.bundle.js +1 -1
- package/dist/2590.creaditor.bundle.js.gz +0 -0
- package/dist/2765.creaditor.bundle.js +1 -1
- package/dist/2765.creaditor.bundle.js.gz +0 -0
- package/dist/2956.creaditor.bundle.js +1 -1
- package/dist/2956.creaditor.bundle.js.gz +0 -0
- package/dist/3418.creaditor.bundle.js +1 -1
- package/dist/3418.creaditor.bundle.js.gz +0 -0
- package/dist/353.creaditor.bundle.js +3 -3
- package/dist/353.creaditor.bundle.js.gz +0 -0
- package/dist/3778.creaditor.bundle.js +1 -0
- package/dist/3778.creaditor.bundle.js.gz +0 -0
- package/dist/3792.creaditor.bundle.js +1 -0
- package/dist/3792.creaditor.bundle.js.gz +0 -0
- package/dist/4061.creaditor.bundle.js +1 -1
- package/dist/4061.creaditor.bundle.js.gz +0 -0
- package/dist/4288.creaditor.bundle.js +10 -10
- package/dist/4288.creaditor.bundle.js.gz +0 -0
- package/dist/4475.creaditor.bundle.js +1 -1
- package/dist/4475.creaditor.bundle.js.gz +0 -0
- package/dist/4639.creaditor.bundle.js +1 -1
- package/dist/4639.creaditor.bundle.js.gz +0 -0
- package/dist/4739.creaditor.bundle.js +1 -1
- package/dist/4739.creaditor.bundle.js.gz +0 -0
- package/dist/4762.creaditor.bundle.js +3 -3
- package/dist/4762.creaditor.bundle.js.gz +0 -0
- package/dist/4770.creaditor.bundle.js +3 -3
- package/dist/4770.creaditor.bundle.js.gz +0 -0
- package/dist/4970.creaditor.bundle.js +7 -7
- package/dist/4970.creaditor.bundle.js.gz +0 -0
- package/dist/5119.creaditor.bundle.js +5 -5
- package/dist/5119.creaditor.bundle.js.gz +0 -0
- package/dist/5340.creaditor.bundle.js +19 -18
- package/dist/5340.creaditor.bundle.js.gz +0 -0
- package/dist/5379.creaditor.bundle.js +70 -0
- package/dist/5379.creaditor.bundle.js.gz +0 -0
- package/dist/5391.creaditor.bundle.js +1 -1
- package/dist/5391.creaditor.bundle.js.gz +0 -0
- package/dist/5884.creaditor.bundle.js +91 -0
- package/dist/5884.creaditor.bundle.js.gz +0 -0
- package/dist/5909.creaditor.bundle.js +644 -0
- package/dist/5909.creaditor.bundle.js.gz +0 -0
- package/dist/5926.creaditor.bundle.js +26 -28
- package/dist/5926.creaditor.bundle.js.gz +0 -0
- package/dist/6151.creaditor.bundle.js +1 -1
- package/dist/6151.creaditor.bundle.js.gz +0 -0
- package/dist/638.creaditor.bundle.js +49 -20
- package/dist/638.creaditor.bundle.js.gz +0 -0
- package/dist/6713.creaditor.bundle.js +1 -1
- package/dist/6713.creaditor.bundle.js.gz +0 -0
- package/dist/6814.creaditor.bundle.js +1 -1
- package/dist/6814.creaditor.bundle.js.gz +0 -0
- package/dist/7209.creaditor.bundle.js +98 -56
- package/dist/7209.creaditor.bundle.js.gz +0 -0
- package/dist/7564.creaditor.bundle.js +1 -1
- package/dist/7564.creaditor.bundle.js.gz +0 -0
- package/dist/7937.creaditor.bundle.js +18 -42
- package/dist/7937.creaditor.bundle.js.gz +0 -0
- package/dist/8141.creaditor.bundle.js +2 -2
- package/dist/8141.creaditor.bundle.js.gz +0 -0
- package/dist/8250.creaditor.bundle.js +1 -1
- package/dist/8250.creaditor.bundle.js.gz +0 -0
- package/dist/8646.creaditor.bundle.js +20 -24
- package/dist/8646.creaditor.bundle.js.gz +0 -0
- package/dist/8654.creaditor.bundle.js +7 -7
- package/dist/8654.creaditor.bundle.js.gz +0 -0
- package/dist/9041.creaditor.bundle.js +13 -15
- package/dist/9041.creaditor.bundle.js.gz +0 -0
- package/dist/9431.creaditor.bundle.js +1 -1
- package/dist/9431.creaditor.bundle.js.gz +0 -0
- package/dist/9694.creaditor.bundle.js +1 -1
- package/dist/9694.creaditor.bundle.js.gz +0 -0
- package/dist/creaditor.bundle.js +2102 -1589
- package/dist/creaditor.bundle.js.gz +0 -0
- package/dist/service-worker.js +1 -1
- package/dist/service-worker.js.gz +0 -0
- package/package.json +1 -1
|
@@ -554,9 +554,9 @@
|
|
|
554
554
|
<cdtr-row @click=${t=>{const e=t.currentTarget;if(e){if(t.target.closest("cdtr-gallery"))return;const a=e.querySelector("cdtr-gallery");a&&(a.opened&&(a.opened=!1),setTimeout(()=>{a.opened=!0},100))}}} style="padding:0.7rem 0px;" justify="${t.justify||"center"}" alignItems="center">
|
|
555
555
|
${t.src&&t.hasPreview?r.qy`
|
|
556
556
|
<div style="position: relative; width: 100%; margin-bottom: 10px; border: 1px solid #eee; border-radius: 4px; overflow: hidden;">
|
|
557
|
-
<img
|
|
558
|
-
src="${t.src}"
|
|
559
|
-
style="width: 100%; height:
|
|
557
|
+
<img
|
|
558
|
+
src="${t.src}"
|
|
559
|
+
style="${t.previewWidth?`width: ${t.previewWidth}; max-width: 100%;`:"max-width: 100%;"} height: auto; object-fit: contain; display: block; margin: 0 auto;"
|
|
560
560
|
onerror="this.style.display='none'"
|
|
561
561
|
/>
|
|
562
562
|
${t.isDeletable?r.qy`
|
|
@@ -648,7 +648,7 @@
|
|
|
648
648
|
.target=${t.target}
|
|
649
649
|
@change=${t.onChange}
|
|
650
650
|
></cdtr-link-element
|
|
651
|
-
></cdtr-editor-container>`,
|
|
651
|
+
></cdtr-editor-container>`,W=[{name:"solid",value:"solid"},{name:"dashed",value:"dashed"},{name:"dotted",value:"dotted"},{name:"outset",value:"outset"},{name:"groove",value:"groove"},{name:"double",value:"double"},{name:"ridge",value:"ridge"}],j=t=>r.qy`<cdtr-editor-container>
|
|
652
652
|
<cdtr-row alignItems="center" jusitfyContent="space-between">
|
|
653
653
|
<cdtr-col>
|
|
654
654
|
<cdtr-title><lang-text text="type"></lang-text></cdtr-title>
|
|
@@ -662,7 +662,7 @@
|
|
|
662
662
|
><lang-text text="${t.borderType||t.value}"></lang-text>
|
|
663
663
|
</cdtr-dropdown-button>
|
|
664
664
|
<div slot="content">
|
|
665
|
-
${
|
|
665
|
+
${W.map(e=>r.qy`<cdtr-dropdown-item
|
|
666
666
|
.focused=${e.value===t.borderStyle||e.value===t.value}
|
|
667
667
|
.selected=${e.value===t.borderStyle||e.value===t.value}
|
|
668
668
|
value="${e.value}"
|
|
@@ -1167,7 +1167,7 @@
|
|
|
1167
1167
|
`:null}
|
|
1168
1168
|
</cdtr-row>
|
|
1169
1169
|
</cdtr-editor-container>
|
|
1170
|
-
`;a.e(4217).then(a.bind(a,94217));a(45888);Promise.resolve().then(a.bind(a,58691));class pt extends r.WF{constructor(){super(),this.editor={},this.tabName="",this.factory=this.factory.bind(this),this.execCommandWrapper=this.execCommandWrapper.bind(this),this.connectWith=this.connectWith.bind(this),this.changeTab=this.changeTab.bind(this),this.$select=this.$select.bind(this),this.$update=this.$update.bind(this),this.handleJustifyContent=this.handleJustifyContent.bind(this),this.handleAlignItems=this.handleAlignItems.bind(this),this._onToggleAll=this._onToggleAll.bind(this),this._sectionsExpanded=!1}$select(){this.editor&&this.editor.select&&this.editor.select({changeTab:this.changeTab,tab:this.tabName}),this.connectWith("select")}$update(){this.connectWith("update")}_onToggleAll(){this._sectionsExpanded=!this._sectionsExpanded,this.querySelectorAll("cdtr-editor-section").forEach(t=>{t.open=this._sectionsExpanded,(0,lt.Q)(t.persistKey,t.open)})}_sectionScope(){return`${this.type||""}:${this.tabName||""}`}_applyPersistedOpen(t){const e=this._sectionScope();for(const a of t)if(a&&"section"===a.type){a.persistKey=`${e}::${a.label}`;const t=(0,lt.i)(a.persistKey);void 0!==t&&(a.open=t)}return t}connectedCallback(){super.connectedCallback(),l.Ay.on("update",this.$update),l.Ay.on("select",this.$select),this.addEventListener("toggle-all-sections",this._onToggleAll),this.connectWith("load")}disconnectedCallback(){super.disconnectedCallback(),l.Ay.off("update",this.$update),l.Ay.off("select",this.$select),this.removeEventListener("toggle-all-sections",this._onToggleAll)}connectWith(){const t=new UIEvent(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"update",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(t);const e=l.Ay.components.find(t=>t.type===this.type);e&&(this.component={...e},this.props=e.props,this.editor=e.createEditor(this.commandsBuilder()))}factory(t,e){if("function"==typeof t&&(t=t()),t.debug,"boolean"==typeof t.active&&!t.active)return null;if("function"==typeof t.active){if(!1===t.active())return null}const a=t.type;switch(a){case"background":return dt(t);case"datetime":return D(t);case"radius":return O(t);case"justifyContent":case"alignItems":return P(t,a);case"node":case"lit":case"custom":return t.node();case"button":return U(t);case"borderpicker":return
|
|
1170
|
+
`;a.e(4217).then(a.bind(a,94217));a(45888);Promise.resolve().then(a.bind(a,58691));class pt extends r.WF{constructor(){super(),this.editor={},this.tabName="",this.factory=this.factory.bind(this),this.execCommandWrapper=this.execCommandWrapper.bind(this),this.connectWith=this.connectWith.bind(this),this.changeTab=this.changeTab.bind(this),this.$select=this.$select.bind(this),this.$update=this.$update.bind(this),this.handleJustifyContent=this.handleJustifyContent.bind(this),this.handleAlignItems=this.handleAlignItems.bind(this),this._onToggleAll=this._onToggleAll.bind(this),this._sectionsExpanded=!1}$select(){this.editor&&this.editor.select&&this.editor.select({changeTab:this.changeTab,tab:this.tabName}),this.connectWith("select")}$update(){this.connectWith("update")}_onToggleAll(){this._sectionsExpanded=!this._sectionsExpanded,this.querySelectorAll("cdtr-editor-section").forEach(t=>{t.open=this._sectionsExpanded,(0,lt.Q)(t.persistKey,t.open)})}_sectionScope(){return`${this.type||""}:${this.tabName||""}`}_applyPersistedOpen(t){const e=this._sectionScope();for(const a of t)if(a&&"section"===a.type){a.persistKey=`${e}::${a.label}`;const t=(0,lt.i)(a.persistKey);void 0!==t&&(a.open=t)}return t}connectedCallback(){super.connectedCallback(),l.Ay.on("update",this.$update),l.Ay.on("select",this.$select),this.addEventListener("toggle-all-sections",this._onToggleAll),this.connectWith("load")}disconnectedCallback(){super.disconnectedCallback(),l.Ay.off("update",this.$update),l.Ay.off("select",this.$select),this.removeEventListener("toggle-all-sections",this._onToggleAll)}connectWith(){const t=new UIEvent(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"update",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(t);const e=l.Ay.components.find(t=>t.type===this.type);e&&"function"==typeof e.createEditor&&(this.component={...e},this.props=e.props,this.editor=e.createEditor(this.commandsBuilder()))}factory(t,e){if("function"==typeof t&&(t=t()),t.debug,"boolean"==typeof t.active&&!t.active)return null;if("function"==typeof t.active){if(!1===t.active())return null}const a=t.type;switch(a){case"background":return dt(t);case"datetime":return D(t);case"radius":return O(t);case"justifyContent":case"alignItems":return P(t,a);case"node":case"lit":case"custom":return t.node();case"button":return U(t);case"borderpicker":return j(t);case"linkpicker":return F(t);case"input":return s(t);case"dropdown":return n(t);case"fontSize":return d(t);case"fontFamily":return c(t);case"mergeTags":return G(t);case"boxShadow":return x(t);case"colorpicker":return p(t);case"slider":return h(t);case"divider":return w(t);case"heading":return v(t);case"option":return $(t);case"checkbox":return z(t);case"stringListBuilder":return _(t);case"chipsInput":return L(t);case"typography":return H(t);case"icons":return r.qy`<icons-gallery
|
|
1171
1171
|
.selectedIcon=${t.selectedIcon}
|
|
1172
1172
|
.useIconsApi=${!0===t.useIconsApi}
|
|
1173
1173
|
.iconColor=${t.iconColor??"000000"}
|
|
@@ -1182,7 +1182,7 @@
|
|
|
1182
1182
|
.isOpen=${t.isOpen}
|
|
1183
1183
|
>
|
|
1184
1184
|
${t.children.map(t=>this.factory(t))}
|
|
1185
|
-
</cdtr-accordion-item>`;case"imagePrompt":return document.createElement("cdtr-image-prompt-builder");case"spacingPicker":return st(t);case"section":return(0,nt.A)(t,(t.children||[]).map((t,e)=>this.factory(t,e)));case"colorSwatchGroup":return(0,ct.A)(t)}}execCommandWrapper(t,e){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};a.components=[this.component],l.Ay.store().execCommand(t,e,a)}commandsBuilder(){return{tab:this.tabName,helpers:{Url:C.A,deepMerge:I()},commands:{execCommand:this.execCommandWrapper,injectEditor:o.M.get("injectEditor")}}}changeTab(t){this.tabName=t,this.editor=this.component.createEditor(this.commandsBuilder())}getColElementData(t){const e=t[0]?.closest("col");return e?{colElement:e,justifyValue:e.props.justify,alignItemsValue:e.props.alignItems,colElementRect:e.element.getBoundingClientRect()}:null}shouldShowDesignControls(t,e){const a=t[0]?.element.getBoundingClientRect(),r=t[0]?.type,o=e.find(t=>t.selected)?.text;let i=("design"===o||void 0===o)&&!["root","section","block","row","col"].includes(r);const s=this.getColElementData(t);return s&&s.colElementRect.width===a.width&&(i=!1),i}handleJustifyContent(t){const e=t.target.value,a=l.Ay.getSelectedComponent(),r=a[0]?.closest("col");r&&l.Ay.store().execCommand("justify",e,{find:"col"})}handleAlignItems(t){const e=t.target.value,a=l.Ay.getSelectedComponent(),r=a[0]?.closest("col");r&&l.Ay.store().execCommand("alignItems",e,{find:"col"})}renderJustifyAlignControls(t){return t?(0,nt.A)({label:"alignment",open:!1},[P({value:t.justifyValue,onChange:this.handleJustifyContent}),P({value:t.alignItemsValue,type:"alignItems",title:"alignItems",onChange:this.handleAlignItems})]):null}preprocessLayout(t){if(!t||0===t.length)return t;if(t.some(t=>t&&"section"===t.type))return this._applyPersistedOpen(t);t=t.filter(t=>!!t&&("boolean"==typeof t.active?t.active:"function"!=typeof t.active||!1!==t.active()));const e=[];let a=[];for(const r of t)r&&("function"!=typeof r?"divider"===r.type?(a.length>0&&e.push(a),a=[]):"heading"===r.type?(a.length>0&&e.push(a),a=[r]):a.push(r):a.push(r));a.length>0&&e.push(a);const r=[];let o=0;for(let t=0;t<e.length;t++){const a=e[t];if(a[0]&&"heading"===a[0].type){const t=a[0].text||"settings",e=a.slice(1);e.length>0&&(o++,r.push({type:"section",label:t,open:!0,children:e}))}else r.push(...a)}if(o>=4)for(const t of r)"section"===t.type&&(t.open=!1);return this._applyPersistedOpen(r)}createRenderRoot(){return this}render(){if(!this.editor)return;if("function"!=typeof this.editor.tabs)return;const t=l.Ay.getSelectedComponent(),e=this.editor?.tabs(this.tabName),a=this.getColElementData(t),o=this.shouldShowDesignControls(t,e),i=this.preprocessLayout(this.editor.layout({tabs:e,tab:e.find(t=>t.selected)||{text:"
|
|
1185
|
+
</cdtr-accordion-item>`;case"imagePrompt":return document.createElement("cdtr-image-prompt-builder");case"spacingPicker":return st(t);case"section":return(0,nt.A)(t,(t.children||[]).map((t,e)=>this.factory(t,e)));case"colorSwatchGroup":return(0,ct.A)(t)}}execCommandWrapper(t,e){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};a.components=[this.component],l.Ay.store().execCommand(t,e,a)}commandsBuilder(){return{tab:this.tabName,helpers:{Url:C.A,deepMerge:I()},commands:{execCommand:this.execCommandWrapper,injectEditor:o.M.get("injectEditor")}}}changeTab(t){this.tabName=t,"function"==typeof this.component?.createEditor&&(this.editor=this.component.createEditor(this.commandsBuilder()))}getColElementData(t){const e=t[0]?.closest("col");return e?{colElement:e,justifyValue:e.props.justify,alignItemsValue:e.props.alignItems,colElementRect:e.element.getBoundingClientRect()}:null}shouldShowDesignControls(t,e){const a=t[0]?.element.getBoundingClientRect(),r=t[0]?.type,o=e.find(t=>t.selected)?.text;let i=("design"===o||void 0===o)&&!["root","section","block","row","col"].includes(r);const s=this.getColElementData(t);return s&&s.colElementRect.width===a.width&&(i=!1),i}handleJustifyContent(t){const e=t.target.value,a=l.Ay.getSelectedComponent(),r=a[0]?.closest("col");r&&l.Ay.store().execCommand("justify",e,{find:"col"})}handleAlignItems(t){const e=t.target.value,a=l.Ay.getSelectedComponent(),r=a[0]?.closest("col");r&&l.Ay.store().execCommand("alignItems",e,{find:"col"})}renderJustifyAlignControls(t){return t?(0,nt.A)({label:"alignment",open:!1},[P({value:t.justifyValue,onChange:this.handleJustifyContent}),P({value:t.alignItemsValue,type:"alignItems",title:"alignItems",onChange:this.handleAlignItems})]):null}preprocessLayout(t){if(!t||0===t.length)return t;if(t.some(t=>t&&"section"===t.type))return this._applyPersistedOpen(t);t=t.filter(t=>!!t&&("boolean"==typeof t.active?t.active:"function"!=typeof t.active||!1!==t.active()));const e=[];let a=[];for(const r of t)r&&("function"!=typeof r?"divider"===r.type?(a.length>0&&e.push(a),a=[]):"heading"===r.type?(a.length>0&&e.push(a),a=[r]):a.push(r):a.push(r));a.length>0&&e.push(a);const r=[];let o=0;for(let t=0;t<e.length;t++){const a=e[t];if(a[0]&&"heading"===a[0].type){const t=a[0].text||"settings",e=a.slice(1);e.length>0&&(o++,r.push({type:"section",label:t,open:!0,children:e}))}else r.push(...a)}if(o>=4)for(const t of r)"section"===t.type&&(t.open=!1);return this._applyPersistedOpen(r)}createRenderRoot(){return this}render(){if(!this.editor)return;if("function"!=typeof this.editor.tabs)return;const t=l.Ay.getSelectedComponent(),e=this.editor?.tabs(this.tabName),a=this.getColElementData(t),o=this.shouldShowDesignControls(t,e),i=this.preprocessLayout(this.editor.layout({tabs:e,tab:e.find(t=>t.selected)||e[0]||{text:"style"},changeTab:this.changeTab})),s=i.filter(t=>t&&"section"===t.type).length>=3;return r.qy`<cdtr-editor-tabs
|
|
1186
1186
|
.value=${this.tabName}
|
|
1187
1187
|
@tabChanged=${t=>this.changeTab(t.target.value)}
|
|
1188
1188
|
.tabs=${e}
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5119],{15119(e,t,o){o.d(t,{default:()=>W});var n=o(96374),r=o(86319),l=o(59929);const a=e=>{{const{component:t,commands:o,helpers:a}=e;return{select:e=>{let{changeTab:t,tab:o}=e},tabs:e=>{const t=[{text:"
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5119],{15119(e,t,o){o.d(t,{default:()=>W});var n=o(96374),r=o(86319),l=o(59929);const a=e=>{{const{component:t,commands:o,helpers:a}=e;return{select:e=>{let{changeTab:t,tab:o}=e},tabs:e=>{const t=[{text:"style",selected:!0},{text:"interactions"},..."web"===r.M.get("config","channel")?[{text:"animations"}]:[],{text:"settings"}];return t.forEach(t=>t.selected=t.selected=t.text===e),t},layout:e=>{let{tab:a,changeTab:i,tabs:d}=e;const s=(r.M.get("components")||[]).filter(e=>e&&"block"===e.type&&e.props?.modalable),c=[{value:"",label:"modal_none"},...s.map((e,t)=>({value:e.id,label:e.props?.modalName||`modal ${t+1}`}))],p=t.props.modalBlockId||"",b=c.find(e=>e.value===p)?.label||"modal_none",u=[{type:"heading",level:6,text:"presets",active:()=>"style"===a.text&&"web"===r.M.get("config","channel")},{type:"custom",active:()=>"style"===a.text&&"web"===r.M.get("config","channel"),node:()=>{const e="web"===r.M.get("config","channel"),n={cart:"http://app.creaditor.com/assets/bullets/images/cart-icon.png",arrowRight:"http://app.creaditor.com/assets/bullets/images/1469020585_ic_keyboard_arrow_right_48px.png"},a=[{category:"Basic",presets:[{name:"Solid",style:{background:"#111111",color:"#ffffff",borderRadius:"6px",border:"none",borderWidth:null,borderColor:null,boxShadow:null}},{name:"Pill",style:{background:"#2563eb",color:"#ffffff",borderRadius:"999px",border:"none",borderWidth:null,borderColor:null,boxShadow:null}},{name:"Outline",style:{background:"transparent",color:"#111111",borderRadius:"6px",border:"1px solid #111111",borderWidth:"1px",borderColor:"#111111",boxShadow:null}},{name:"Soft",style:{background:"#eef2ff",color:"#3730a3",borderRadius:"10px",border:"none",borderWidth:null,borderColor:null,boxShadow:null}}]},{category:"Gradients",presets:[{name:"Sunset",style:{background:"linear-gradient(135deg,#ff6a00,#ee0979)",color:"#ffffff",borderRadius:"8px",border:"none",borderWidth:null,borderColor:null,boxShadow:null}},{name:"Ocean",style:{background:"linear-gradient(135deg,#2193b0,#6dd5ed)",color:"#ffffff",borderRadius:"8px",border:"none",borderWidth:null,borderColor:null,boxShadow:null}},{name:"Grape",webOnly:!0,style:{background:"linear-gradient(135deg,#7b2ff7,#f107a3)",color:"#ffffff",borderRadius:"8px",border:"none",borderWidth:null,borderColor:null,boxShadow:null}},{name:"Lime",webOnly:!0,style:{background:"linear-gradient(135deg,#11998e,#38ef7d)",color:"#ffffff",borderRadius:"8px",border:"none",borderWidth:null,borderColor:null,boxShadow:null}}]},{category:"3D blocks",presets:[{name:"Orange",webOnly:!0,style:{background:"#ed8936",color:"#ffffff",borderRadius:"10px",padding:"14px 22px",fontWeight:700,border:"none",borderWidth:null,borderColor:null,boxShadow:"0px 5px 0px 0px #b45309"}},{name:"Green",webOnly:!0,style:{background:"#38a169",color:"#ffffff",borderRadius:"10px",padding:"14px 22px",fontWeight:700,border:"none",borderWidth:null,borderColor:null,boxShadow:"0px 5px 0px 0px #276749"}},{name:"Blue",webOnly:!0,style:{background:"#3182ce",color:"#ffffff",borderRadius:"10px",padding:"14px 22px",fontWeight:700,border:"none",borderWidth:null,borderColor:null,boxShadow:"0px 5px 0px 0px #2151a1"}},{name:"Red",webOnly:!0,style:{background:"#e53e3e",color:"#ffffff",borderRadius:"10px",padding:"14px 22px",fontWeight:700,border:"none",borderWidth:null,borderColor:null,boxShadow:"0px 5px 0px 0px #9b2c2c"}},{name:"Purple",webOnly:!0,style:{background:"#805ad5",color:"#ffffff",borderRadius:"10px",padding:"14px 22px",fontWeight:700,border:"none",borderWidth:null,borderColor:null,boxShadow:"0px 5px 0px 0px #553c9a"}},{name:"Dark",webOnly:!0,style:{background:"#2d3748",color:"#ffffff",borderRadius:"10px",padding:"14px 22px",fontWeight:700,border:"none",borderWidth:null,borderColor:null,boxShadow:"0px 5px 0px 0px #1a202c"}}]},{category:"Effects",presets:[{name:"Neon",webOnly:!0,style:{background:"#0a0a0a",color:"#39ff14",borderRadius:"8px",border:"1px solid #39ff14",borderWidth:"1px",borderColor:"#39ff14",boxShadow:"0 0 10px #39ff14, 0 0 22px rgba(57,255,20,0.5)"}},{name:"Glow",webOnly:!0,style:{background:"#7b2ff7",color:"#ffffff",borderRadius:"10px",border:"none",borderWidth:null,borderColor:null,boxShadow:"0 8px 24px rgba(123,47,247,0.55)"}},{name:"Glass",webOnly:!0,style:{background:"rgba(255,255,255,0.18)",color:"#111111",borderRadius:"12px",border:"1px solid rgba(255,255,255,0.6)",borderWidth:"1px",borderColor:"rgba(255,255,255,0.6)",backdropFilter:"blur(8px)",boxShadow:"0 4px 30px rgba(0,0,0,0.1)"}},{name:"Shadow",webOnly:!0,style:{background:"#ffffff",color:"#111111",borderRadius:"12px",border:"none",borderWidth:null,borderColor:null,boxShadow:"0 10px 24px rgba(0,0,0,0.18)"}},{name:"Emboss",webOnly:!0,style:{background:"#e2e8f0",color:"#2d3748",borderRadius:"10px",border:"none",borderWidth:null,borderColor:null,boxShadow:"inset 0 2px 4px rgba(255,255,255,0.9), inset 0 -2px 4px rgba(0,0,0,0.15), 0 2px 4px rgba(0,0,0,0.1)"}}]},{category:"Premium gradients",presets:[{name:"Aurora",webOnly:!0,style:{background:"linear-gradient(135deg,#667eea,#764ba2)",color:"#ffffff",borderRadius:"10px",border:"none",borderWidth:null,borderColor:null,boxShadow:"0 8px 20px rgba(118,75,162,0.4)"}},{name:"Peach",webOnly:!0,style:{background:"linear-gradient(135deg,#ff9a9e,#fecfef)",color:"#7a2e3a",borderRadius:"10px",border:"none",borderWidth:null,borderColor:null,boxShadow:"0 8px 20px rgba(255,154,158,0.45)"}},{name:"Gold",webOnly:!0,style:{background:"linear-gradient(135deg,#f6d365,#fda085)",color:"#5a3a1a",borderRadius:"10px",border:"none",borderWidth:null,borderColor:null,boxShadow:"0 8px 20px rgba(253,160,133,0.45)"}},{name:"Midnight",webOnly:!0,style:{background:"linear-gradient(135deg,#0f2027,#203a43,#2c5364)",color:"#ffffff",borderRadius:"10px",border:"none",borderWidth:null,borderColor:null,boxShadow:"0 8px 20px rgba(15,32,39,0.5)"}},{name:"Candy",webOnly:!0,style:{background:"linear-gradient(135deg,#f093fb,#f5576c)",color:"#ffffff",borderRadius:"10px",border:"none",borderWidth:null,borderColor:null,boxShadow:"0 8px 20px rgba(245,87,108,0.45)"}}]},{category:"With icon",presets:[{name:"Buy now",icon:{src:n.cart,direction:"left",size:18},style:{background:"#16a34a",color:"#ffffff",borderRadius:"8px",border:"none",borderWidth:null,borderColor:null,boxShadow:null}},{name:"Continue",icon:{src:n.arrowRight,direction:"right",size:18},style:{background:"linear-gradient(135deg,#2563eb,#1e3a8a)",color:"#ffffff",borderRadius:"8px",border:"none",borderWidth:null,borderColor:null,boxShadow:null}}]}].map(t=>({...t,presets:t.presets.filter(t=>e||!t.webOnly)})).filter(e=>e.presets.length>0),i=t.props.text||"Button",d=e=>e.icon?l.qy`<img
|
|
2
2
|
src="${e.icon.src}"
|
|
3
3
|
style="width:16px;height:16px;object-fit:contain;vertical-align:middle;${"right"===e.icon.direction?"margin-left:6px;order:2;":"margin-right:6px;"}"
|
|
4
4
|
/>`:"",s=e=>l.qy`
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
font-weight:${e.style.fontWeight||400};
|
|
15
15
|
box-shadow:${e.style.boxShadow||"none"};"
|
|
16
16
|
>
|
|
17
|
-
${e.icon&&"right"!==e.icon.direction?
|
|
18
|
-
<span style="overflow:hidden;text-overflow:ellipsis;">${
|
|
19
|
-
${e.icon&&"right"===e.icon.direction?
|
|
17
|
+
${e.icon&&"right"!==e.icon.direction?d(e):""}
|
|
18
|
+
<span style="overflow:hidden;text-overflow:ellipsis;">${i}</span>
|
|
19
|
+
${e.icon&&"right"===e.icon.direction?d(e):""}
|
|
20
20
|
</button>
|
|
21
21
|
`;return l.qy`
|
|
22
22
|
<cdtr-editor-container pt="0">
|
|
@@ -31,4 +31,4 @@
|
|
|
31
31
|
`)}
|
|
32
32
|
</div>
|
|
33
33
|
</cdtr-editor-container>
|
|
34
|
-
`}},{type:"heading",level:6,text:"open_modal",active:()=>"modal"===a.text},{type:"info",text:s.length?"modal_pick_hint":"modal_none_hint",active:()=>"modal"===a.text},{type:"dropdown",title:"modal_block",active:()=>"modal"===a.text,value:b,selected:p,items:c,onChange:e=>{o.execCommand("modalBlockId",e.target.value)}},{type:"heading",level:6,text:"settings",active:()=>"design"===a.text},{type:"input",title:"whatTheBtnSays",mergeTags:!0,emoji:!0,active:()=>"design"===a.text,value:t.props.text||"",onInput:e=>{const t=e.target.value;o.execCommand("text",t)}},{type:"heading",level:6,text:"typography",active:()=>"design"===a.text},{type:"typography",active:()=>"design"===a.text,bold:700===t.props.style.fontWeight,italic:"italic"===t.props.style.fontStyle,underline:"underline"===t.props.style.textDecoration,onChange:e=>{switch(e){case"bold":const e=700===t.props.style.fontWeight?400:700;o.execCommand("style",{fontWeight:e});break;case"italic":const n="italic"===t.props.style.fontStyle?"normal":"italic";o.execCommand("style",{fontStyle:n});break;case"underline":const r="underline"===t.props.style.textDecoration?"none":"underline";o.execCommand("style",{textDecoration:r})}}},{type:"fontFamily",active:()=>"design"===a.text,value:t.props.style.fontFamily,weight:"web"===r.M.get("config","channel"),weightValue:t.props.style.fontWeight,onChange:e=>{const t=e.target.value;o.execCommand("style",{fontFamily:t})},onWeightChange:e=>{o.execCommand("style",{fontWeight:e.detail.value})}},{type:"slider",title:"fontSize",step:1,min:8,max:50,active:()=>"design"===a.text,value:parseInt(t.props.style.fontSize)||14,onInput:e=>{const t=e.target.value;o.execCommand("style",{fontSize:t+"px",height:"auto"})}},{type:"heading",level:6,text:"dimensions",active:()=>"design"===a.text},{type:"slider",title:"width",min:10,max:500,active:()=>"design"===a.text,value:parseInt(t.props.style.width),onInput:e=>{const t=e.target.value;o.execCommand("style",{width:t+"px",minWidth:null})}},{type:"heading",level:6,text:"colors",active:()=>"design"===a.text},{type:"colorSwatchGroup",active:()=>"design"===a.text,columns:2,items:[{title:"button_background",allowGradient:!0,value:t.props.style.background||"#000000",onChange:e=>{const r=e.target.value;if(!r.includes("gradient(")){const e=(0,n.w)(t.props.style.color,r);o.execCommand("style",{color:e})}o.execCommand("style",{background:r,backgroundColor:null})}},{title:"font_color",value:t.props.style.color||"#ffffff",onChange:e=>{const t=e.target.value;o.execCommand("style",{color:t})}}]},{type:"heading",level:6,text:"border_design",active:()=>"design"===a.text},{type:"slider",title:"radius",min:0,max:100,active:()=>"design"===a.text,value:parseInt(t.props.style.borderRadius),onInput:e=>{const t=e.target.value;o.execCommand("style",{borderRadius:t+"px"})}},{type:"borderpicker",title:"border",active:()=>"design"===a.text,value:t.props.style.border,onChange:e=>{const t=e.target.value;o.execCommand("style",{border:t})}},{type:"slider",title:"borderWidth",active:()=>"design"===a.text,value:t.props.style.borderWidth,onInput:e=>{const t=e.target.value;o.execCommand("style",{borderWidth:t+"px"})}},{type:"colorpicker",title:"borderColor",active:()=>"design"===a.text,value:t.props.style.borderColor,onChange:e=>{const t=e.target.value;o.execCommand("style",{borderColor:t})}},{type:"heading",level:6,text:"shadow",active:()=>"design"===a.text},{type:"boxShadow",active:()=>"design"===a.text,value:t.props.style.boxShadow,onChange:e=>{o.execCommand("style",{boxShadow:e})}},{type:"linkpicker",href:t.props.onClick?.link,protocol:t.props.onClick?.link?.protocol,target:t.props.onClick?.link?.target,autofocus:!0,active:()=>"link"===a.text,onChange:e=>{const t={link:e.target.value};o.execCommand("onClick",t)}},{type:"checkbox",title:"hasIcon",useIconsApi:!0,checked:!!t.props.hasIcon,active:()=>"icons"===a.text,onChange:e=>{const t=e.target.checked;o.execCommand("hasIcon",t),o.execCommand("iconDirection","left")}},{type:"dropdown",active:()=>"icons"===a.text&&!0===t.props.hasIcon,title:"iconDirection",value:t.props.iconDirection,onChange:e=>{const t=e.target.value;o.execCommand("iconDirection",t)},items:[{value:"left",label:"left"},{value:"right",label:"right"}]},{type:"slider",title:"size",min:10,max:100,active:()=>"icons"===a.text&&!0===t.props.hasIcon,value:t.props.iconSize||16,onInput:e=>{const t=e.target.value;o.execCommand("iconSize",t)}},{type:"icons",active:()=>"icons"===a.text&&!0===t.props.hasIcon,selectedIcon:t.props.iconUrl,onChange:e=>{const t=e.detail;o.execCommand("iconUrl",t.src)}},{type:"heading",level:6,text:"spacing",active:()=>"design"===a.text},{type:"spacingPicker",active:()=>"design"===a.text,hasLeft:!1,hasRight:!1,value:{top:parseInt(t.props.style.paddingTop)||0,bottom:parseInt(t.props.style.paddingBottom)||0,left:parseInt(t.props.style.paddingLeft)||0,right:parseInt(t.props.style.paddingRight)||0},onChange:e=>{e.target.value;const t=e.target.topValue,n=e.target.bottomValue,r=e.target.leftValue,l=e.target.rightValue;o.execCommand("style",{paddingTop:t+"px",paddingBottom:n+"px",paddingLeft:r+"px",paddingRight:l+"px",padding:null})}}]}}}},d=e=>{let{helpers:t,editor:o,getFocused:n}=e;return{set:(e,r,l)=>{switch(r){case"style":return e[r]=t.deepMerge(e[r],l),!0;case"text":return e.text=l,n()||o.chain().setContent(l).run(),!0;case"ripple":case"rippleColor":case"scaleOnHover":case"hasIcon":case"iconUrl":case"iconSize":case"iconDirection":case"modalBlockId":return e[r]=l,!0;case"onClick":if(l.link)return e[r]=l,!0}}}};var i=o(72591),s=o.n(i),c=o(88639),p=o.n(c),b=o(88128),u=o.n(b),g=o(30855),x=o.n(g),f=o(93051),h=o.n(f),m=o(49536),y={};y.setAttributes=x(),y.insert=u().bind(null,"head"),y.domAPI=p(),y.insertStyleElement=h();s()(m.A,y);const A=m.A&&m.A.locals?m.A.locals:void 0;var C=o(81318),w=o(1366),v=o(67291),k=o(85194),S=o(28396);const E=C.YY.create({addKeyboardShortcuts:()=>({Enter:()=>!0})});const W=()=>{const e="button";return{name:e,create:t=>{const{createElement:o,compose:n,helpers:r}=t,{arrayToString:l,mergeDiff:i}=r;let s=!1;const c=document.createElement("div"),p=document.createElement("div"),{editor:b}=function(e){let{content:t,element:o}=e;return{element:o,editor:new C.KE({element:o,extensions:[w.A,v.A,S.A,k.Ay,E],content:t})}}({content:n.props.text,element:p});c.appendChild(p);return b.view.dom.setAttribute("dir","auto"),b.on("update",e=>{let{editor:t}=e;const o=t.getText();n.editor.store().updateComponent(n,"text",o)}),b.on("focus",e=>{let{event:t,editor:o}=e;s=!0}),b.on("blur",e=>{let{event:t,editor:o}=e;s=!1}),c.className=A.button,o({name:e,id:n.id,template:c,commands:{insertContent:e=>{b.commands.insertContent(e),b.chain().focus()}},defaultProps:{style:{height:"auto",width:"200px",padding:"10px",borderRadius:"5px",fontFamily:"Arial",fontSize:"16px"},text:"button"},render:()=>{try{n.props.style.display="",n.props.style.direction=""}catch(e){console.error(e)}i(c,{style:n.props.style}),c.style.height="auto";const e=n.props.hasIcon,t=n.props.iconUrl,o=n.props.iconDirection,r=n.props.iconSize,l="icon_in_button";let a=c.querySelector(`.${l}`)||document.createElement("img");e&&t?(a.className=l,a.src=t,a.style.width=(r||16)+"px",a.style.height=(r||16)+"px",a.style.marginRight="8px",a.style.marginLeft="8px","left"===o?c.insertBefore(a,c.firstChild):c.appendChild(a)):a.remove()},draggable:{group:"element"},droppable:{group:"element"},resizeable:()=>c,handleBar:!0,validator:d({template:c,helpers:r,editor:b,getFocused:function(){return s}}),schema:n.schema,onSelect:e=>{c.classList.add(e)},onDeselect:e=>{c.classList.remove(e)},elementProps:n,destroy:()=>{b.destroy()},remove:()=>{c.remove()},createEditor:a})}}}},49536(e,t,o){o.d(t,{A:()=>d});var n=o(82001),r=o.n(n),l=o(40935),a=o.n(l)()(r());a.push([e.id,".BEr8unIfy4OEGYhlHclN {\n cursor: text !important;\n}\n.BEr8unIfy4OEGYhlHclN {\n min-width: 30px;\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: center;\n padding:10px;\n}\n.BEr8unIfy4OEGYhlHclN p {\n margin: 0;\n line-height: 1;\n}\n.cI3RTMAdk9qoZ8mu9Sm9 {\n width: 100%;\n}\n.VSumPf0Ui7b1pl8cMATP {\n position: absolute;\n z-index: 9;\n width: 3px;\n height: 90%;\n background: var(--resizer-color);\n border-radius: 20px;\n}\n.Vo2Ewnq6ekWFdNMjxBIB {\n left: -8px;\n cursor: w-resize;\n}\n.WLZC84sb1rfaRnHCDyj8 {\n left: calc(100% + 5px);\n cursor: e-resize;\n}\n\n.BEr8unIfy4OEGYhlHclN .VSumPf0Ui7b1pl8cMATP {\n display: none;\n}\n.BEr8unIfy4OEGYhlHclN.Qh20ei1Fa8QUbGinFFbw .VSumPf0Ui7b1pl8cMATP {\n display: block;\n}\n/* .handle{\n display: none;\n}\n.button.selected .handle{\n display: block;\n} */\n","",{version:3,sources:["webpack://./../web-editors/button-editor-component/lib/style.module.css"],names:[],mappings:"AAAA;EACE,uBAAuB;AAOzB;AARA;EAEE,eAAe;EACf,aAAa;EACb,uBAAuB;EACvB,mBAAmB;EACnB,kBAAkB;EAClB,YAAY;AACd;AACA;EACE,SAAS;EACT,cAAc;AAChB;AACA;EACE,WAAW;AACb;AACA;EACE,kBAAkB;EAClB,UAAU;EACV,UAAU;EACV,WAAW;EACX,gCAAgC;EAChC,mBAAmB;AACrB;AACA;EACE,UAAU;EACV,gBAAgB;AAClB;AACA;EACE,sBAAsB;EACtB,gBAAgB;AAClB;;AAEA;EACE,aAAa;AACf;AACA;EACE,cAAc;AAChB;AACA;;;;;GAKG",sourcesContent:[".button {\n cursor: text !important;\n min-width: 30px;\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: center;\n padding:10px;\n}\n.button p {\n margin: 0;\n line-height: 1;\n}\n.contentEditable {\n width: 100%;\n}\n.margin {\n position: absolute;\n z-index: 9;\n width: 3px;\n height: 90%;\n background: var(--resizer-color);\n border-radius: 20px;\n}\n.marginLeft {\n left: -8px;\n cursor: w-resize;\n}\n.marginRight {\n left: calc(100% + 5px);\n cursor: e-resize;\n}\n\n.button .margin {\n display: none;\n}\n.button.selected .margin {\n display: block;\n}\n/* .handle{\n display: none;\n}\n.button.selected .handle{\n display: block;\n} */\n"],sourceRoot:""}]),a.locals={button:"BEr8unIfy4OEGYhlHclN",contentEditable:"cI3RTMAdk9qoZ8mu9Sm9",margin:"VSumPf0Ui7b1pl8cMATP",marginLeft:"Vo2Ewnq6ekWFdNMjxBIB",marginRight:"WLZC84sb1rfaRnHCDyj8",selected:"Qh20ei1Fa8QUbGinFFbw"};const d=a},67291(e,t,o){o.d(t,{A:()=>r});var n=o(81318);const r=n.bP.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",(0,n.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}})}}]);
|
|
34
|
+
`}}];return[{type:"heading",level:6,text:"text",active:()=>"style"===a.text},{type:"input",title:"whatTheBtnSays",mergeTags:!0,emoji:!0,active:()=>"style"===a.text,value:t.props.text||"",onInput:e=>{const t=e.target.value;o.execCommand("text",t)}},{type:"heading",level:6,text:"colors",active:()=>"style"===a.text},{type:"colorSwatchGroup",active:()=>"style"===a.text,columns:2,items:[{title:"button_background",allowGradient:!0,value:t.props.style.background||"#000000",onChange:e=>{const r=e.target.value;if(!r.includes("gradient(")){const e=(0,n.w)(t.props.style.color,r);o.execCommand("style",{color:e})}o.execCommand("style",{background:r,backgroundColor:null})}},{title:"font_color",value:t.props.style.color||"#ffffff",onChange:e=>{const t=e.target.value;o.execCommand("style",{color:t})}}]},{type:"heading",level:6,text:"typography",active:()=>"style"===a.text},{type:"typography",active:()=>"style"===a.text,bold:700===t.props.style.fontWeight,italic:"italic"===t.props.style.fontStyle,underline:"underline"===t.props.style.textDecoration,onChange:e=>{switch(e){case"bold":const e=700===t.props.style.fontWeight?400:700;o.execCommand("style",{fontWeight:e});break;case"italic":const n="italic"===t.props.style.fontStyle?"normal":"italic";o.execCommand("style",{fontStyle:n});break;case"underline":const r="underline"===t.props.style.textDecoration?"none":"underline";o.execCommand("style",{textDecoration:r})}}},{type:"fontFamily",active:()=>"style"===a.text,value:t.props.style.fontFamily,weight:"web"===r.M.get("config","channel"),weightValue:t.props.style.fontWeight,onChange:e=>{const t=e.target.value;o.execCommand("style",{fontFamily:t})},onWeightChange:e=>{o.execCommand("style",{fontWeight:e.detail.value})}},{type:"slider",title:"fontSize",step:1,min:8,max:50,active:()=>"style"===a.text,value:parseInt(t.props.style.fontSize)||14,onInput:e=>{const t=e.target.value;o.execCommand("style",{fontSize:t+"px",height:"auto"})}},{type:"heading",level:6,text:"dimensions",active:()=>"style"===a.text},{type:"slider",title:"width",min:10,max:500,active:()=>"style"===a.text,value:parseInt(t.props.style.width),onInput:e=>{const t=e.target.value;o.execCommand("style",{width:t+"px",minWidth:null})}},{type:"heading",level:6,text:"border_design",active:()=>"style"===a.text},{type:"slider",title:"radius",min:0,max:100,active:()=>"style"===a.text,value:parseInt(t.props.style.borderRadius),onInput:e=>{const t=e.target.value;o.execCommand("style",{borderRadius:t+"px"})}},{type:"borderpicker",title:"border",active:()=>"style"===a.text,value:t.props.style.border,onChange:e=>{const t=e.target.value;o.execCommand("style",{border:t})}},{type:"slider",title:"borderWidth",active:()=>"style"===a.text,value:t.props.style.borderWidth,onInput:e=>{const t=e.target.value;o.execCommand("style",{borderWidth:t+"px"})}},{type:"colorpicker",title:"borderColor",active:()=>"style"===a.text,value:t.props.style.borderColor,onChange:e=>{const t=e.target.value;o.execCommand("style",{borderColor:t})}},{type:"heading",level:6,text:"shadow",active:()=>"style"===a.text},{type:"boxShadow",active:()=>"style"===a.text,value:t.props.style.boxShadow,onChange:e=>{o.execCommand("style",{boxShadow:e})}},{type:"heading",level:6,text:"link",active:()=>"interactions"===a.text},{type:"linkpicker",href:t.props.onClick?.link,protocol:t.props.onClick?.link?.protocol,target:t.props.onClick?.link?.target,autofocus:!0,active:()=>"interactions"===a.text,onChange:e=>{const t={link:e.target.value};o.execCommand("onClick",t)}},{type:"heading",level:6,text:"open_modal",active:()=>"interactions"===a.text&&"web"===r.M.get("config","channel")},{type:"info",text:s.length?"modal_pick_hint":"modal_none_hint",active:()=>"interactions"===a.text&&"web"===r.M.get("config","channel")},{type:"dropdown",title:"modal_block",active:()=>"interactions"===a.text&&"web"===r.M.get("config","channel"),value:b,selected:p,items:c,onChange:e=>{o.execCommand("modalBlockId",e.target.value)}},{type:"heading",level:6,text:"icons",active:()=>"style"===a.text},{type:"checkbox",title:"hasIcon",useIconsApi:!0,checked:!!t.props.hasIcon,active:()=>"style"===a.text,onChange:e=>{const t=e.target.checked;o.execCommand("hasIcon",t),o.execCommand("iconDirection","left")}},{type:"dropdown",active:()=>"style"===a.text&&!0===t.props.hasIcon,title:"iconDirection",value:t.props.iconDirection,onChange:e=>{const t=e.target.value;o.execCommand("iconDirection",t)},items:[{value:"left",label:"left"},{value:"right",label:"right"}]},{type:"slider",title:"size",min:10,max:100,active:()=>"style"===a.text&&!0===t.props.hasIcon,value:t.props.iconSize||16,onInput:e=>{const t=e.target.value;o.execCommand("iconSize",t)}},{type:"icons",active:()=>"style"===a.text&&!0===t.props.hasIcon,selectedIcon:t.props.iconUrl,onChange:e=>{const t=e.detail;o.execCommand("iconUrl",t.src)}},{type:"heading",level:6,text:"spacing",active:()=>"style"===a.text},{type:"spacingPicker",active:()=>"style"===a.text,hasLeft:!1,hasRight:!1,value:{top:parseInt(t.props.style.paddingTop)||0,bottom:parseInt(t.props.style.paddingBottom)||0,left:parseInt(t.props.style.paddingLeft)||0,right:parseInt(t.props.style.paddingRight)||0},onChange:e=>{e.target.value;const t=e.target.topValue,n=e.target.bottomValue,r=e.target.leftValue,l=e.target.rightValue;o.execCommand("style",{paddingTop:t+"px",paddingBottom:n+"px",paddingLeft:r+"px",paddingRight:l+"px",padding:null})}},...u]}}}},i=e=>{let{helpers:t,editor:o,getFocused:n}=e;return{set:(e,r,l)=>{switch(r){case"style":return e[r]=t.deepMerge(e[r],l),!0;case"text":return e.text=l,n()||o.chain().setContent(l).run(),!0;case"ripple":case"rippleColor":case"scaleOnHover":case"hasIcon":case"iconUrl":case"iconSize":case"iconDirection":case"modalBlockId":return e[r]=l,!0;case"onClick":if(l.link)return e[r]=l,!0}}}};var d=o(72591),s=o.n(d),c=o(88639),p=o.n(c),b=o(88128),u=o.n(b),x=o(30855),g=o.n(x),f=o(93051),h=o.n(f),y=o(49536),m={};m.setAttributes=g(),m.insert=u().bind(null,"head"),m.domAPI=p(),m.insertStyleElement=h();s()(y.A,m);const A=y.A&&y.A.locals?y.A.locals:void 0;var C=o(81318),v=o(1366),w=o(67291),k=o(85194),S=o(28396);const E=C.YY.create({addKeyboardShortcuts:()=>({Enter:()=>!0})});const W=()=>{const e="button";return{name:e,create:t=>{const{createElement:o,compose:n,helpers:r}=t,{arrayToString:l,mergeDiff:d}=r;let s=!1;const c=document.createElement("div"),p=document.createElement("div"),{editor:b}=function(e){let{content:t,element:o}=e;return{element:o,editor:new C.KE({element:o,extensions:[v.A,w.A,S.A,k.Ay,E],content:t})}}({content:n.props.text,element:p});c.appendChild(p);return b.view.dom.setAttribute("dir","auto"),b.on("update",e=>{let{editor:t}=e;const o=t.getText();n.editor.store().updateComponent(n,"text",o)}),b.on("focus",e=>{let{event:t,editor:o}=e;s=!0}),b.on("blur",e=>{let{event:t,editor:o}=e;s=!1}),c.className=A.button,o({name:e,id:n.id,template:c,commands:{insertContent:e=>{b.commands.insertContent(e),b.chain().focus()}},defaultProps:{style:{height:"auto",width:"200px",padding:"10px",borderRadius:"5px",fontFamily:"Arial",fontSize:"16px"},text:"button"},render:()=>{try{n.props.style.display="",n.props.style.direction=""}catch(e){console.error(e)}d(c,{style:n.props.style}),c.style.height="auto";const e=n.props.hasIcon,t=n.props.iconUrl,o=n.props.iconDirection,r=n.props.iconSize,l="icon_in_button";let a=c.querySelector(`.${l}`)||document.createElement("img");e&&t?(a.className=l,a.src=t,a.style.width=(r||16)+"px",a.style.height=(r||16)+"px",a.style.marginRight="8px",a.style.marginLeft="8px","left"===o?c.insertBefore(a,c.firstChild):c.appendChild(a)):a.remove()},draggable:{group:"element"},droppable:{group:"element"},resizeable:()=>c,handleBar:!0,validator:i({template:c,helpers:r,editor:b,getFocused:function(){return s}}),schema:n.schema,onSelect:e=>{c.classList.add(e)},onDeselect:e=>{c.classList.remove(e)},elementProps:n,destroy:()=>{b.destroy()},remove:()=>{c.remove()},createEditor:a})}}}},49536(e,t,o){o.d(t,{A:()=>i});var n=o(82001),r=o.n(n),l=o(40935),a=o.n(l)()(r());a.push([e.id,".BEr8unIfy4OEGYhlHclN {\n cursor: text !important;\n}\n.BEr8unIfy4OEGYhlHclN {\n min-width: 30px;\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: center;\n padding:10px;\n}\n.BEr8unIfy4OEGYhlHclN p {\n margin: 0;\n line-height: 1;\n}\n.cI3RTMAdk9qoZ8mu9Sm9 {\n width: 100%;\n}\n.VSumPf0Ui7b1pl8cMATP {\n position: absolute;\n z-index: 9;\n width: 3px;\n height: 90%;\n background: var(--resizer-color);\n border-radius: 20px;\n}\n.Vo2Ewnq6ekWFdNMjxBIB {\n left: -8px;\n cursor: w-resize;\n}\n.WLZC84sb1rfaRnHCDyj8 {\n left: calc(100% + 5px);\n cursor: e-resize;\n}\n\n.BEr8unIfy4OEGYhlHclN .VSumPf0Ui7b1pl8cMATP {\n display: none;\n}\n.BEr8unIfy4OEGYhlHclN.Qh20ei1Fa8QUbGinFFbw .VSumPf0Ui7b1pl8cMATP {\n display: block;\n}\n/* .handle{\n display: none;\n}\n.button.selected .handle{\n display: block;\n} */\n","",{version:3,sources:["webpack://./../web-editors/button-editor-component/lib/style.module.css"],names:[],mappings:"AAAA;EACE,uBAAuB;AAOzB;AARA;EAEE,eAAe;EACf,aAAa;EACb,uBAAuB;EACvB,mBAAmB;EACnB,kBAAkB;EAClB,YAAY;AACd;AACA;EACE,SAAS;EACT,cAAc;AAChB;AACA;EACE,WAAW;AACb;AACA;EACE,kBAAkB;EAClB,UAAU;EACV,UAAU;EACV,WAAW;EACX,gCAAgC;EAChC,mBAAmB;AACrB;AACA;EACE,UAAU;EACV,gBAAgB;AAClB;AACA;EACE,sBAAsB;EACtB,gBAAgB;AAClB;;AAEA;EACE,aAAa;AACf;AACA;EACE,cAAc;AAChB;AACA;;;;;GAKG",sourcesContent:[".button {\n cursor: text !important;\n min-width: 30px;\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: center;\n padding:10px;\n}\n.button p {\n margin: 0;\n line-height: 1;\n}\n.contentEditable {\n width: 100%;\n}\n.margin {\n position: absolute;\n z-index: 9;\n width: 3px;\n height: 90%;\n background: var(--resizer-color);\n border-radius: 20px;\n}\n.marginLeft {\n left: -8px;\n cursor: w-resize;\n}\n.marginRight {\n left: calc(100% + 5px);\n cursor: e-resize;\n}\n\n.button .margin {\n display: none;\n}\n.button.selected .margin {\n display: block;\n}\n/* .handle{\n display: none;\n}\n.button.selected .handle{\n display: block;\n} */\n"],sourceRoot:""}]),a.locals={button:"BEr8unIfy4OEGYhlHclN",contentEditable:"cI3RTMAdk9qoZ8mu9Sm9",margin:"VSumPf0Ui7b1pl8cMATP",marginLeft:"Vo2Ewnq6ekWFdNMjxBIB",marginRight:"WLZC84sb1rfaRnHCDyj8",selected:"Qh20ei1Fa8QUbGinFFbw"};const i=a},67291(e,t,o){o.d(t,{A:()=>r});var n=o(81318);const r=n.bP.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",(0,n.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}})}}]);
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5340],{12258(e,t,o){o.d(t,{A:()=>
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5340],{12258(e,t,o){o.d(t,{A:()=>i});var n=o(59929),s=o(40648);class r extends n.WF{constructor(){super(),this.label="",this.open=!0,this.persistKey=""}toggle(){this.open=!this.open,(0,s.Q)(this.persistKey,this.open)}render(){return n.qy`
|
|
2
2
|
<div class="section">
|
|
3
3
|
<div class="header" @click=${this.toggle}>
|
|
4
4
|
<span class="title"><lang-text text="${this.label}"></lang-text></span>
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
</div>
|
|
13
13
|
</div>
|
|
14
14
|
</div>
|
|
15
|
-
`}}
|
|
15
|
+
`}}r.styles=n.AH`
|
|
16
16
|
:host {
|
|
17
17
|
display: block;
|
|
18
18
|
direction: var(--direction-locale, ltr);
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
.content-inner {
|
|
61
61
|
padding: var(--space-3) var(--space-4) var(--space-3) var(--space-4);
|
|
62
62
|
}
|
|
63
|
-
`,
|
|
63
|
+
`,r.properties={label:{type:String},open:{type:Boolean},persistKey:{type:String}},customElements.define("cdtr-editor-section",r);const i=(e,t)=>n.qy`
|
|
64
64
|
<cdtr-editor-section
|
|
65
65
|
.label=${e.label}
|
|
66
66
|
.open=${!1!==e.open}
|
|
@@ -68,28 +68,28 @@
|
|
|
68
68
|
>
|
|
69
69
|
${t}
|
|
70
70
|
</cdtr-editor-section>
|
|
71
|
-
`},40648(e,t,o){o.d(t,{Q:()=>
|
|
71
|
+
`},40648(e,t,o){o.d(t,{Q:()=>i,i:()=>r});const n="cdtr:section-open";function s(){try{const e=localStorage.getItem(n);return e?JSON.parse(e):{}}catch(e){return{}}}function r(e){if(!e)return;const t=s();return Object.prototype.hasOwnProperty.call(t,e)?!!t[e]:void 0}function i(e,t){if(!e)return;const o=s();o[e]=!!t,function(e){try{localStorage.setItem(n,JSON.stringify(e))}catch(e){}}(o)}},45340(e,t,o){o.r(t),o.d(t,{SettingEditor:()=>a});var n=o(59929),s=o(86319),r=o(36565),i=(o(12258),o(79307));class a extends n.WF{constructor(){super(),this.onInspect=this.onInspect.bind(this),this.name="",this.element_ID=" ",this.cmds={onToggleDisplayMode:(e,t)=>{r.Ay.store().execCommand(`show_on_${e}`,t),this[`show_on_${e}`]=t},onChangeElementID(e){r.Ay.store().execCommand("element_ID",e.target.value)},onChangeName(e){r.Ay.store().execCommand("name",e.target.value)}}}onInspect(){if(r.Ay.components.length>0){const e=r.Ay.components[0].props;this.show_on_desktop=!!e.show_on_desktop,this.show_on_tablet=!!e.show_on_tablet,this.show_on_mobile=!!e.show_on_mobile,this.name=e.name||"",this.element_ID=e.element_ID||""}}connectedCallback(){super.connectedCallback(),r.Ay.on("select",this.onInspect),r.Ay.on("update",this.onInspect),this.onInspect()}disconnectedCallback(){super.disconnectedCallback(),r.Ay.off("select",this.onInspect),r.Ay.off("update",this.onInspect)}render(){const e="block"===r.Ay.getSelectedComponent()[0].type,t="web"===s.M.get("config","channel");return n.qy`
|
|
72
72
|
${e&&t?n.qy`<cdtr-editor-section label="display_mode" .open=${!0}>
|
|
73
73
|
<div class="device-toggle-row">
|
|
74
74
|
<div
|
|
75
75
|
class="device-toggle-btn ${this.show_on_desktop?"active":""}"
|
|
76
76
|
@click=${()=>this.cmds.onToggleDisplayMode("desktop",!this.show_on_desktop)}
|
|
77
77
|
>
|
|
78
|
-
<svg width="14" height="14" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">${
|
|
78
|
+
<svg width="14" height="14" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">${i.oe}</svg>
|
|
79
79
|
<lang-text text="desktop"></lang-text>
|
|
80
80
|
</div>
|
|
81
81
|
<div
|
|
82
82
|
class="device-toggle-btn ${this.show_on_tablet?"active":""}"
|
|
83
83
|
@click=${()=>this.cmds.onToggleDisplayMode("tablet",!this.show_on_tablet)}
|
|
84
84
|
>
|
|
85
|
-
<svg width="14" height="14" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">${
|
|
85
|
+
<svg width="14" height="14" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">${i.kN}</svg>
|
|
86
86
|
<lang-text text="tablet"></lang-text>
|
|
87
87
|
</div>
|
|
88
88
|
<div
|
|
89
89
|
class="device-toggle-btn ${this.show_on_mobile?"active":""}"
|
|
90
90
|
@click=${()=>this.cmds.onToggleDisplayMode("mobile",!this.show_on_mobile)}
|
|
91
91
|
>
|
|
92
|
-
<svg width="14" height="14" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">${
|
|
92
|
+
<svg width="14" height="14" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">${i.S9}</svg>
|
|
93
93
|
<lang-text text="mobile"></lang-text>
|
|
94
94
|
</div>
|
|
95
95
|
</div>
|
|
@@ -126,31 +126,32 @@
|
|
|
126
126
|
}
|
|
127
127
|
.device-toggle-row {
|
|
128
128
|
display: flex;
|
|
129
|
-
gap:
|
|
129
|
+
gap: var(--space-2, 8px);
|
|
130
130
|
}
|
|
131
131
|
.device-toggle-btn {
|
|
132
132
|
display: flex;
|
|
133
133
|
align-items: center;
|
|
134
|
-
gap: 4px;
|
|
135
|
-
padding:
|
|
134
|
+
gap: var(--space-1, 4px);
|
|
135
|
+
padding: var(--space-2, 8px) var(--space-3, 12px);
|
|
136
136
|
border: none;
|
|
137
|
-
border-radius: 6px;
|
|
137
|
+
border-radius: var(--radius-sm, 6px);
|
|
138
138
|
cursor: pointer;
|
|
139
|
-
color: #bbb;
|
|
140
|
-
background: #f4f4f6;
|
|
141
|
-
transition:
|
|
142
|
-
|
|
139
|
+
color: var(--color-text-faint, #bbb);
|
|
140
|
+
background: var(--color-bg-muted, #f4f4f6);
|
|
141
|
+
transition: background var(--duration-fast, 120ms) var(--ease-default, ease),
|
|
142
|
+
color var(--duration-fast, 120ms) var(--ease-default, ease);
|
|
143
|
+
font-size: var(--text-xs, 12px);
|
|
143
144
|
}
|
|
144
145
|
.device-toggle-btn:hover {
|
|
145
146
|
background: #eaeaed;
|
|
146
|
-
color: #888;
|
|
147
|
+
color: var(--color-text-muted, #888);
|
|
147
148
|
}
|
|
148
149
|
.device-toggle-btn svg {
|
|
149
150
|
fill: currentColor;
|
|
150
151
|
flex-shrink: 0;
|
|
151
152
|
}
|
|
152
153
|
.device-toggle-btn.active {
|
|
153
|
-
background: color-
|
|
154
|
-
color: var(--
|
|
154
|
+
background: var(--color-primary-soft, rgba(99, 102, 241, 0.08));
|
|
155
|
+
color: var(--color-primary, #6366f1);
|
|
155
156
|
}
|
|
156
157
|
`,customElements.define("cdtr-setting-editor",a)}}]);
|
|
Binary file
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5379],{55379(a,r,t){t.r(r),t.d(r,{AuroraPreset:()=>e});var n=t(59929);class e extends n.WF{render(){return n.qy`<div class="aurora">
|
|
2
|
+
<span></span><span></span><span></span><span></span>
|
|
3
|
+
</div>`}}e.properties={},e.styles=n.AH`
|
|
4
|
+
:host {
|
|
5
|
+
display: block;
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 100%;
|
|
8
|
+
}
|
|
9
|
+
.aurora {
|
|
10
|
+
position: relative;
|
|
11
|
+
width: 100%;
|
|
12
|
+
height: 100%;
|
|
13
|
+
min-height: 100%;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
background: #060a1a;
|
|
16
|
+
}
|
|
17
|
+
.aurora span {
|
|
18
|
+
position: absolute;
|
|
19
|
+
display: block;
|
|
20
|
+
width: 60vmax;
|
|
21
|
+
height: 60vmax;
|
|
22
|
+
border-radius: 50%;
|
|
23
|
+
filter: blur(60px);
|
|
24
|
+
opacity: 0.55;
|
|
25
|
+
mix-blend-mode: screen;
|
|
26
|
+
will-change: transform;
|
|
27
|
+
animation: aurora-drift 22s ease-in-out infinite;
|
|
28
|
+
}
|
|
29
|
+
.aurora span:nth-child(1) {
|
|
30
|
+
background: radial-gradient(circle, #22d3ee, transparent 60%);
|
|
31
|
+
top: -20%;
|
|
32
|
+
left: -10%;
|
|
33
|
+
animation-duration: 19s;
|
|
34
|
+
}
|
|
35
|
+
.aurora span:nth-child(2) {
|
|
36
|
+
background: radial-gradient(circle, #a855f7, transparent 60%);
|
|
37
|
+
top: 8%;
|
|
38
|
+
right: -15%;
|
|
39
|
+
animation-duration: 23s;
|
|
40
|
+
animation-delay: -4s;
|
|
41
|
+
}
|
|
42
|
+
.aurora span:nth-child(3) {
|
|
43
|
+
background: radial-gradient(circle, #34d399, transparent 60%);
|
|
44
|
+
bottom: -25%;
|
|
45
|
+
left: 18%;
|
|
46
|
+
animation-duration: 27s;
|
|
47
|
+
animation-delay: -8s;
|
|
48
|
+
}
|
|
49
|
+
.aurora span:nth-child(4) {
|
|
50
|
+
background: radial-gradient(circle, #f472b6, transparent 60%);
|
|
51
|
+
bottom: -12%;
|
|
52
|
+
right: 8%;
|
|
53
|
+
animation-duration: 21s;
|
|
54
|
+
animation-delay: -11s;
|
|
55
|
+
}
|
|
56
|
+
@keyframes aurora-drift {
|
|
57
|
+
0% {
|
|
58
|
+
transform: translate(0, 0) scale(1);
|
|
59
|
+
}
|
|
60
|
+
33% {
|
|
61
|
+
transform: translate(8%, 12%) scale(1.15);
|
|
62
|
+
}
|
|
63
|
+
66% {
|
|
64
|
+
transform: translate(-10%, 6%) scale(0.95);
|
|
65
|
+
}
|
|
66
|
+
100% {
|
|
67
|
+
transform: translate(0, 0) scale(1);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
`,customElements.define("cdtr-aurora-preset",e)}}]);
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5391],{85391(n,o,a){var i=a(59929);class r extends i.WF{constructor(){super()}render(){return i.qy`<div class="background">
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5391],{85391(n,o,a){a.r(o),a.d(o,{GlowsPreset:()=>r});var i=a(59929);class r extends i.WF{constructor(){super()}render(){return i.qy`<div class="background">
|
|
2
2
|
<span></span>
|
|
3
3
|
<span></span>
|
|
4
4
|
<span></span>
|
|
Binary file
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5884],{55884(e,t,r){r.d(t,{default:()=>L});var o=r(12106),s=r(59929);let i={};function n(e){i.selected=e}function c(e){return i.selected}var a=r(83423),l=r(81444);const d="https://img.creaditor.ai";function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=t.width??24,o=t.height??24;let s=t.color??"000000";s.startsWith("#")&&(s=s.slice(1));const i=`${d}/icons/serve/${encodeURIComponent(e.category)}/${encodeURIComponent(e.name)}.png?width=${r}&height=${o}`;return(0,l.tG)(i,s)}class h extends s.WF{constructor(){super(),this.searchQuery="",this.iconColor="000000",this.iconSize=34,this.selectedSrc="",this._icons=[],this._loading=!1,this._error=""}willUpdate(e){e.has("searchQuery")&&this.searchQuery?this._fetchIcons():e.has("searchQuery")&&!this.searchQuery&&(this._icons=[],this._error="")}async _fetchIcons(){const e=(this.searchQuery||"").trim();if(e){this._loading=!0,this._error="";try{const t=new URLSearchParams({q:e,limit:"20"}),r=await fetch(`${d}/icons/search?${t.toString()}`);if(!r.ok)throw new Error(r.statusText);const o=await r.json();this._icons=o.icons||[]}catch(e){this._icons=[],this._error=e.message||"Failed to load icons"}finally{this._loading=!1}}else this._icons=[]}_onSelect(e){const t=(this.iconColor||"000000").replace(/^#/,""),r=Number(this.iconSize)||34,o=p(e,{width:r,height:r,color:t});this.dispatchEvent(new CustomEvent("icon-selected",{detail:{src:o,icon:e},bubbles:!0,composed:!0}))}render(){if(!this.searchQuery?.trim())return s.qy``;if(this._loading)return s.qy`<div class="loading"><span class="spinner"></span>Loading icons…</div>`;if(this._error)return s.qy`<div class="error">${this._error}</div>`;if(!this._icons.length)return s.qy``;const e=(this.iconColor||"000000").replace(/^#/,"");return s.qy`
|
|
2
|
+
|
|
3
|
+
<div class="grid">
|
|
4
|
+
${this._icons.map(t=>{const r=p(t,{width:24,height:24,color:e}),o=this.selectedSrc&&(this.selectedSrc.includes(t.name)||this.selectedSrc===r);return s.qy`
|
|
5
|
+
<button
|
|
6
|
+
type="button"
|
|
7
|
+
class="icon-wrap ${o?"selected":""}"
|
|
8
|
+
title="${t.name}"
|
|
9
|
+
@click=${()=>this._onSelect(t)}
|
|
10
|
+
>
|
|
11
|
+
<img src="${r}" alt="${t.name}" loading="lazy" />
|
|
12
|
+
</button>
|
|
13
|
+
`})}
|
|
14
|
+
</div>
|
|
15
|
+
`}}h.properties={searchQuery:{type:String},iconColor:{type:String},iconSize:{type:Number},selectedSrc:{type:String},_icons:{type:Array,state:!0},_loading:{type:Boolean,state:!0},_error:{type:String,state:!0}},h.styles=s.AH`
|
|
16
|
+
:host {
|
|
17
|
+
display: block;
|
|
18
|
+
font-size: 12px;
|
|
19
|
+
}
|
|
20
|
+
.label {
|
|
21
|
+
margin-bottom: 6px;
|
|
22
|
+
color: var(--secondary-text, #666);
|
|
23
|
+
font-weight: 500;
|
|
24
|
+
}
|
|
25
|
+
.grid {
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-wrap: wrap;
|
|
28
|
+
gap: 6px;
|
|
29
|
+
}
|
|
30
|
+
.icon-wrap {
|
|
31
|
+
width: 36px;
|
|
32
|
+
height: 36px;
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
justify-content: center;
|
|
36
|
+
border: 2px solid transparent;
|
|
37
|
+
border-radius: 6px;
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
background: var(--input-bg, #f5f5f5);
|
|
40
|
+
transition: border-color 0.15s, box-shadow 0.15s;
|
|
41
|
+
}
|
|
42
|
+
.icon-wrap:hover {
|
|
43
|
+
border-color: var(--primary, #007bff);
|
|
44
|
+
box-shadow: 0 0 0 1px var(--primary, #007bff);
|
|
45
|
+
}
|
|
46
|
+
.icon-wrap.selected {
|
|
47
|
+
border-color: var(--primary, #007bff);
|
|
48
|
+
background: color-mix(in srgb, var(--primary, #007bff) 12%, transparent);
|
|
49
|
+
}
|
|
50
|
+
.icon-wrap img {
|
|
51
|
+
width: 24px;
|
|
52
|
+
height: 24px;
|
|
53
|
+
object-fit: contain;
|
|
54
|
+
}
|
|
55
|
+
.loading,
|
|
56
|
+
.error {
|
|
57
|
+
padding: 8px 0;
|
|
58
|
+
color: var(--secondary-text, #666);
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
gap: 8px;
|
|
62
|
+
}
|
|
63
|
+
.spinner {
|
|
64
|
+
width: 16px;
|
|
65
|
+
height: 16px;
|
|
66
|
+
border: 2px solid var(--input-bg, #e0e0e0);
|
|
67
|
+
border-top-color: var(--primary, #007bff);
|
|
68
|
+
border-radius: 50%;
|
|
69
|
+
animation: spin 0.7s linear infinite;
|
|
70
|
+
flex: 0 0 auto;
|
|
71
|
+
}
|
|
72
|
+
@keyframes spin {
|
|
73
|
+
to {
|
|
74
|
+
transform: rotate(360deg);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
.error {
|
|
78
|
+
color: var(--error-color, #c00);
|
|
79
|
+
}
|
|
80
|
+
`,customElements.define("social-icon-suggestions",h);var m=r(61919);const f=e=>{{const{component:t,commands:r}=e,o=()=>{let e=c();if(e||(e=t.props.items.find(e=>!e.link),!e&&t.props.items.length>0&&(e=t.props.items[0])),e){!t.props.items.find(t=>t.id===e.id)&&t.props.items.length>0&&(e=t.props.items[0])}return e};return{select:e=>{let{changeTab:t,tab:r}=e;"link"!==r&&t("link")},tabs:e=>{e||(e="link");const t=[{text:"image"},{text:"design"},{text:"link",selected:!0}];return t.forEach(t=>t.selected=t.selected=t.text===e),t},layout:e=>{let{tab:i,changeTab:n,tabs:c}=e;const d=o(),p=[{type:"node",node:()=>s.qy`<img
|
|
81
|
+
style="padding:10px;display:block;margin:auto"
|
|
82
|
+
width="52"
|
|
83
|
+
height="52"
|
|
84
|
+
src=${d?.src?(0,l.tG)(d.src,d.fgColor||d.iconColor):""}
|
|
85
|
+
/>`},{type:"button",text:"delete",bgColor:"#df381d",color:"#fff",icon:"deleteBin",active:!0,onClick:e=>{const s=o();if(!s)return;const i=[...t.props.items];if(i.length<2)return;const n=i.findIndex(e=>e.id===s.id);-1!==n&&(i.splice(n,1),r.execCommand("items",i))}},{type:"divider"},{type:"gallery",active:"image"===i.text,src:d?.src,hasPreview:!0,text:"open_gallery",justify:"flex-start",onChange:e=>{const s=o();if(!s)return;let i=e.detail;Array.isArray(i)&&(i=i[0]);const n=t.props,c=JSON.parse(JSON.stringify(n.items)),a=c.findIndex(e=>e.id===s.id);-1!==a&&(c[a].src=i.src,r.execCommand("items",c))}},{type:"custom",active:()=>{const e=d?.link?.href||d?.url,t=e?(0,l.IE)(a.A,e):null;return("link"===i.text||"image"===i.text)&&!!t},node:()=>{const e=d?.link?.href||d?.url,i=e&&(0,l.IE)(a.A,e)||"";return s.qy`<cdtr-editor-container><social-icon-suggestions
|
|
86
|
+
.searchQuery=${i}
|
|
87
|
+
.iconColor=${d?.fgColor||d?.iconColor||"000000"}
|
|
88
|
+
.iconSize=${parseInt(d?.style?.width,10)||34}
|
|
89
|
+
.selectedSrc=${d?.src||""}
|
|
90
|
+
@icon-selected=${e=>{const s=o();if(!s)return;const i=t.props,n=JSON.parse(JSON.stringify(i.items)),c=n.findIndex(e=>e.id===s.id);-1!==c&&(n[c].src=e.detail.src,r.execCommand("items",n))}}
|
|
91
|
+
></social-icon-suggestions></cdtr-editor-container>`}},{type:"divider"},{type:"linkpicker",href:d?.link||d?.url,active:()=>"link"===i.text&&!!d,onChange:e=>{const s=o();if(!s)return;const i=e.target.value,n=t.props,c=JSON.parse(JSON.stringify(n.items)),d=c.findIndex(e=>e.id===s.id);if(-1!==d){const e=c[d].fgColor||c[d].iconColor,t=function(e,t){const r=(0,l.IE)(a.A,e),o=r?a.A.find(e=>e.type===r):null,s=o?o.src:null;return s?(0,l.tG)(s,t):null}(i.href,e);t&&(c[d].src=t),c[d].url=i.href,c[d].link=i,r.execCommand("items",c)}}},{type:"slider",title:"size",active:"design"===i.text,value:parseInt(d?.style?.width),min:10,max:80,onInput:e=>{const o=e.target.value,s=[...t.props.items];s.forEach(e=>{e.style.width=o+"px",e.style.height=o+"px"}),r.execCommand("items",s)}},{type:"colorpicker",title:"icon_color",alpha:!1,active:()=>"design"===i.text&&!!d,value:d?.fgColor?d.fgColor.startsWith("#")?d.fgColor:"#"+d.fgColor:"#000000",onChange:e=>{const s=o();if(!s)return;let i=e.target.value;i=(0,m.A)(i).toHex(),i.startsWith("#")&&(i=i.slice(1)),8===i.length&&/^[0-9a-fA-F]+$/.test(i)&&(i=i.slice(0,6));const n=t.props,c=JSON.parse(JSON.stringify(n.items));if(!0===n.applyColorToAll)c.forEach(e=>{e.fgColor=i});else{const e=c.findIndex(e=>e.id===s.id);-1!==e&&(c[e].fgColor=i)}r.execCommand("items",c)}},{type:"checkbox",title:"color_them_all",checked:!!t.props.applyColorToAll,active:()=>"design"===i.text&&!!d,onChange:e=>{const t=!!e.target.checked;r.execCommand("applyColorToAll",t)}},{type:"divider"},{type:"slider",title:"spacing",active:"design"===i.text,value:parseFloat(t.props.style.gap),min:0,max:80,onInput:e=>{const t=e.target.value;r.execCommand("style",{gap:t+"px"})}}];return p}}}};var u=r(52144);const g=()=>({set:(e,t,r)=>{switch(t){case"style":if("object"==typeof r)return e[t]=(0,u.A)(e[t],r),!0;break;case"items":if(e[t]=r,Array.isArray(r)){const e=c(),t=r.find(t=>t.id===e?.id);t&&n(t)}return!0;case"src":const o=c();if(o&&Array.isArray(e.items)){const t=[...e.items],s=t.findIndex(e=>e.id===o.id);if(-1!==s)return t[s].src=r,e.items=t,!0}break;case"applyColorToAll":return e[t]=r,!0}}});var y=r(72591),x=r.n(y),b=r(88639),C=r.n(b),v=r(88128),A=r.n(v),k=r(30855),_=r.n(k),w=r(93051),S=r.n(w),I=r(89820),E={};E.setAttributes=_(),E.insert=A().bind(null,"head"),E.domAPI=C(),E.insertStyleElement=S();x()(I.A,E);const $=I.A&&I.A.locals?I.A.locals:void 0;var O=r(23571),T=r(91597);const L=()=>{const e="social";return{name:e,create:t=>{let{createElement:r,compose:s,helpers:i}=t;const d=(0,T.S)(),p=document.createElement("div"),h=document.createElement("div");h.classList.add($.root);new O.Ay(h,{sort:!0,delay:0,delayOnTouchOnly:!1,touchStartThreshold:0,disabled:!1,store:null,animation:150,easing:"cubic-bezier(1, 0, 0, 1)",preventOnFilter:!0,draggable:".item",dataIdAttr:"data-id",ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:1,direction:"horizontal",forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,dragoverBubble:!1,removeCloneOnHide:!0,emptyInsertThreshold:5,setData:function(e,t){e.setData("Text",t.textContent)},onChoose:function(e){e.oldIndex},onUnchoose:function(e){},onStart:function(e){e.oldIndex},onEnd:function(e){const t=JSON.parse(JSON.stringify(s.props.items)),{oldIndex:r,newIndex:o}=e,[i]=t.splice(r,1);t.splice(o,0,i),s.editor.store().execCommand("items",t)},onMove:function(e,t){e.dragged,e.draggedRect,e.related,e.relatedRect,e.willInsertAfter,t.clientY},onChange:function(e){e.newIndex}});p.appendChild(h);const m=r({name:e,id:s.id,template:p,draggable:{group:"element"},droppable:{group:"element"},render:()=>{const e=s.props.items;let t=!1;const r=e.map(e=>{const r=e.url||e.link?.link||"";if(!e.src&&r){const o=(0,l.IE)(a.A,r),s=o?a.A.find(e=>e.type===o):null;if(s)return t=!0,{...e,src:s.src}}return e});t&&setTimeout(()=>s.editor.store().execCommand("items",r),0);const d=t?r:e;for(;h.firstChild;)h.removeChild(h.firstChild);i.mergeDiff(h,{style:s.props.style});const p=c();d.forEach(e=>{const t=document.createElement("img");p?.id===e.id&&t.classList.add($.selected),t.addEventListener("click",()=>{n(e),Array.from(h.children).forEach(e=>{e.classList.remove($.selected)}),t.classList.add($.selected)}),t.classList.add("item"),e.id&&t.setAttribute("data-id",e.id);const r=(0,l.fm)(h);t.src=(0,l.Ff)(e,{color:e.fgColor||e.iconColor,bg:r})||"https://render.creaditor.ai/media/social-icons/broken-link-black-circle.png",i.mergeDiff(t,{style:e.style}),h.append(t)});const m=document.createElement("paper-button");m.style.minWidth="0",m.style.padding=0,m.innerHTML="<cdtr-icon icon='add'></cdtr-icon>",h.append(m),m.addEventListener("click",()=>{setTimeout(()=>{const e=s.props.items[s.props.items.length-1],t={id:(0,o.A)(),fgColor:"",bgColor:"",style:e.style,url:"",src:"https://render.creaditor.ai/media/social-icons/broken-link-black-circle.png"},r=[...s.props.items];r.push(t),n(t),s.editor.store().execCommand("items",r)},200)})},handleBar:!0,defaultProps:{},validator:g(),schema:s.schema,onSelect:e=>{const t=c();if(t){const r=document.querySelector(`[data-id="${t.id}"]`);r?(window.___social_cdtr_item=r,r.classList.add("selected_underlined")):p.classList.add(e)}},onDeselect:e=>{c();window.___social_cdtr_item&&window.___social_cdtr_item.classList.remove("selected_underlined"),p?.classList?.remove(e)},elementProps:s,remove:()=>{p.remove()},createEditor:f});return m.app.on("update",()=>{d.run(()=>{const e=(0,l.fm)(h);if(!e)return;const t=h.querySelectorAll("img"),r=s.props.items;t.forEach((t,o)=>{const s=r[o];if(!s)return;const i=(0,l.Ff)(s,{color:s.fgColor||s.iconColor,bg:e});i&&(t.src=i)})})}),m}}}},89820(e,t,r){r.d(t,{A:()=>c});var o=r(82001),s=r.n(o),i=r(40935),n=r.n(i)()(s());n.push([e.id,".Z7AEJu5h_9kumGVl3K4x{\n display: flex;\n}\n.UA2xJ_pGYNrGNLfjkExO{\n border:1px solid var(--primary);\n}","",{version:3,sources:["webpack://./../newsletter-editors/social-editor-component-newsletter/lib/style.module.css"],names:[],mappings:"AAAA;IACI,aAAa;AACjB;AACA;IACI,+BAA+B;AACnC",sourcesContent:[".root{\n display: flex;\n}\n.selected{\n border:1px solid var(--primary);\n}"],sourceRoot:""}]),n.locals={root:"Z7AEJu5h_9kumGVl3K4x",selected:"UA2xJ_pGYNrGNLfjkExO"};const c=n}}]);
|
|
Binary file
|