@creaditor/newsletter-starterkit 1.0.54 → 1.0.55
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/1260.creaditor.bundle.js +43 -6
- package/dist/1260.creaditor.bundle.js.gz +0 -0
- package/dist/1271.creaditor.bundle.js +1 -439
- package/dist/1271.creaditor.bundle.js.gz +0 -0
- package/dist/1403.creaditor.bundle.js +110 -0
- package/dist/1403.creaditor.bundle.js.gz +0 -0
- package/dist/1565.creaditor.bundle.js +106 -105
- package/dist/1565.creaditor.bundle.js.gz +0 -0
- package/dist/168.creaditor.bundle.js +4 -4
- package/dist/168.creaditor.bundle.js.gz +0 -0
- package/dist/2384.creaditor.bundle.js +4 -4
- package/dist/2384.creaditor.bundle.js.gz +0 -0
- package/dist/4186.creaditor.bundle.js +1 -1
- package/dist/4186.creaditor.bundle.js.gz +0 -0
- package/dist/4569.creaditor.bundle.js +64 -257
- package/dist/4569.creaditor.bundle.js.gz +0 -0
- package/dist/4819.creaditor.bundle.js +1 -1
- package/dist/4819.creaditor.bundle.js.gz +0 -0
- package/dist/5340.creaditor.bundle.js +7 -6
- package/dist/5340.creaditor.bundle.js.gz +0 -0
- package/dist/574.creaditor.bundle.js +5 -5
- package/dist/574.creaditor.bundle.js.gz +0 -0
- package/dist/5926.creaditor.bundle.js +1 -1
- package/dist/5926.creaditor.bundle.js.gz +0 -0
- package/dist/763.creaditor.bundle.js +1 -1
- package/dist/763.creaditor.bundle.js.gz +0 -0
- package/dist/7789.creaditor.bundle.js +25 -0
- package/dist/7789.creaditor.bundle.js.LICENSE.txt +32 -0
- package/dist/7789.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/7789.creaditor.bundle.js.gz +0 -0
- package/dist/7937.creaditor.bundle.js +1 -1
- package/dist/7937.creaditor.bundle.js.gz +0 -0
- package/dist/8173.creaditor.bundle.js +1 -1
- package/dist/8173.creaditor.bundle.js.gz +0 -0
- package/dist/9158.creaditor.bundle.js +613 -0
- package/dist/9158.creaditor.bundle.js.LICENSE.txt +10 -0
- package/dist/9158.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/9158.creaditor.bundle.js.gz +0 -0
- package/dist/creaditor.bundle.js +1349 -600
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[1260],{91260(t,e,o){o.r(e),o.d(e,{BlockEditor:()=>g});var r=o(59929),i=o(86319),n=o(36565),a=o(49937),s=o(83235);const d=JSON.parse('["3g2","3gp","aaf","asf","avchd","avi","drc","flv","m2v","m3u8","m4p","m4v","mkv","mng","mov","mp2","mp4","mpe","mpeg","mpg","mpv","mxf","nsv","ogg","ogv","qt","rm","rmvb","roq","svi","vob","webm","wmv","yuv"]');var c=o(9334),l=o(96374);const p=[{id:"video-background",name:"video",thumb:"https://i.ytimg.com/vi/RhlQvbvMg-0/hqdefault.jpg?sqp=-oaymwEWCKgBEF5IWvKriqkDCQgBFQAAiEIYAQ==&rs=AOn4CLCKBaHlpHj3ghOXWjB2br9kHjPg7w",group:["section-component"],type:"video",preset:{installed:!1,component:"cdtr-background-video",properties:{type:"video",url:"https://www.youtube.com/watch?v=RhlQvbvMg-0",loop:!0,volume:0,controls:0,muted:!0,playing:!0,config:{playerVars:{showinfo:0,controls:0,playsinline:0}},style:{zIndex:0,width:window.innerWidth+500,height:window.innerWidth-560,pointerEvents:"none",transform:"translate(-10%,-0%)"}}}},{id:"images-background",name:"some-images",thumb:"http://demos.creative-tim.com/paper-kit-2/assets/img/antoine-barres.jpg",group:["section-component"],type:"images",preset:{tags:[],installed:!1,type:"images",component:"cdtr-images-preset",properties:{src:"http://demos.creative-tim.com/paper-kit-2/assets/img/antoine-barres.jpg,https://images.pexels.com/photos/1408221/pexels-photo-1408221.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",style:{backgroundAttachment:"local",backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"cover"}}}}];o(12258),o(15155);o.e(4217).then(o.bind(o,94217));class g extends r.WF{constructor(t){super(),this.onChangeBakgroundExpanding=t=>{const e=t.target.checked;n.Ay.store().execCommand("expand_image_for_outlook",!e)},this.getInnerBlocks=()=>{const t=[],e=this.component.parent(
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[1260],{91260(t,e,o){o.r(e),o.d(e,{BlockEditor:()=>g});var r=o(59929),i=o(86319),n=o(36565),a=o(49937),s=o(83235);const d=JSON.parse('["3g2","3gp","aaf","asf","avchd","avi","drc","flv","m2v","m3u8","m4p","m4v","mkv","mng","mov","mp2","mp4","mpe","mpeg","mpg","mpv","mxf","nsv","ogg","ogv","qt","rm","rmvb","roq","svi","vob","webm","wmv","yuv"]');var c=o(9334),l=o(96374);const p=[{id:"video-background",name:"video",thumb:"https://i.ytimg.com/vi/RhlQvbvMg-0/hqdefault.jpg?sqp=-oaymwEWCKgBEF5IWvKriqkDCQgBFQAAiEIYAQ==&rs=AOn4CLCKBaHlpHj3ghOXWjB2br9kHjPg7w",group:["section-component"],type:"video",preset:{installed:!1,component:"cdtr-background-video",properties:{type:"video",url:"https://www.youtube.com/watch?v=RhlQvbvMg-0",loop:!0,volume:0,controls:0,muted:!0,playing:!0,config:{playerVars:{showinfo:0,controls:0,playsinline:0}},style:{zIndex:0,width:window.innerWidth+500,height:window.innerWidth-560,pointerEvents:"none",transform:"translate(-10%,-0%)"}}}},{id:"images-background",name:"some-images",thumb:"http://demos.creative-tim.com/paper-kit-2/assets/img/antoine-barres.jpg",group:["section-component"],type:"images",preset:{tags:[],installed:!1,type:"images",component:"cdtr-images-preset",properties:{src:"http://demos.creative-tim.com/paper-kit-2/assets/img/antoine-barres.jpg,https://images.pexels.com/photos/1408221/pexels-photo-1408221.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",style:{backgroundAttachment:"local",backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"cover"}}}}];o(12258),o(15155);o.e(4217).then(o.bind(o,94217));class g extends r.WF{constructor(t){super(),this.onChangeBakgroundExpanding=t=>{const e=t.target.checked;n.Ay.store().execCommand("expand_image_for_outlook",!e)},this.getInnerBlocks=()=>{const t=[],e=this.component.parent();return e&&"section"===e.type?(e.children.forEach(e=>{const o=i.M.get("components",e);o&&"block"===o.type&&t.push(o)}),t):[this.component]},this.onChangeWidth=this.onChangeWidth.bind(this),this.getInnerBlocks=this.getInnerBlocks.bind(this),this.isBackgroundImage=!1,this.backgroundVideo="",this.galleryOpened=!1,this._sectionsExpanded=!1,this.onChangeBakgroundExpanding=this.onChangeBakgroundExpanding.bind(this);const e=i.M.get("config","channel");this.tabs=[{text:"background"},{text:"design",selected:!0},..."web"===e?[{text:"animations"}]:[],{text:"settings"}],this.tabName="design",this.maxWidth=0,this.background="",this.padding={topValue:0,bottomValue:0,leftValue:0,rightValue:0},this.margin={topValue:0,bottomValue:0},this.borderStyle="solid",this.borderWidth=0,this.borderColor="#000",this.theme=i.M.get("theme"),this.connectWith=this.connectWith.bind(this),this.cmds={onchangeRadius:t=>{n.Ay.store().execCommand("style",{...t.target.json})},toggleResponsive:t=>{this.noResponsive=!t.target.checked,n.Ay.store().execCommand("noResponsive",this.noResponsive)},onChangeBorderStyle:t=>{this.borderStyle=t.target.borderStyle||"",this.borderWidth=t.target.borderWidth||1,this.borderColor=t.target.borderColor||"#000",this.borderRadius=t.target.borderRadius||0;t.target.json;n.Ay.store().execCommand("style",{borderStyle:this.borderStyle,borderColor:this.borderColor,borderTopWidth:t.target.borderTopWidth||"0px",borderBottomWidth:t.target.borderBottomWidth||"0px",borderLeftWidth:t.target.borderLeftWidth||"0px",borderRightWidth:t.target.borderRightWidth||"0px",borderTopRightRadius:parseInt(t.target.borderTopRightRadius||0)+"px",borderTopLeftRadius:parseInt(t.target.borderTopLeftRadius||0)+"px",borderBottomRightRadius:parseInt(t.target.borderBottomRightRadius||0)+"px",borderBottomLeftRadius:parseInt(t.target.borderBottomLeftRadius||0)+"px",borderRadius:null})},onRemoveBackgroundVideo:()=>{this.backgroundVideo="",this.backgroundInstance={},n.Ay.store().execCommand("background","transparent")},onChangeBackgroundVideo:t=>{const e=t.target.value;let o;if((0,s.A)(e)){const t=p.find(t=>"images"===t.type);t.preset.properties.src=e,o=t.preset}else if(function(t){const e=(/(?:\.([^.]+))?$/.exec(t.toLowerCase())??[])[1]??"";return-1!==d.findIndex(t=>t===e)}(e));else if(function(t){if(t&&t.match(/^(?:https?:\/\/)?(?:m\.|www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/))return!0;return!1}(e)){const t=p.find(t=>"video"===t.type);t.preset.properties.url=e,delete t.preset.properties.videoPath,o=t.preset}o&&(n.Ay.store().execCommand("background",JSON.parse(JSON.stringify(o))),n.Ay.store().execCommand("style",{background:null})),this.backgroundVideo=e},onChangeImage:t=>{const e=t.detail,o=[];Array.isArray(e)?e.forEach(t=>o.push(t.src)):o.push(e.src),this.cmds.onChangeBackgroundVideo({target:{value:o.join(",")}}),this.galleryOpened=!1},onChangeHeight:t=>{const e=t.target.value;n.Ay.store().execCommand("style",{height:e+"%"}),this.height=e},onChangeMargin:t=>{const e=t.target.value,o=t.target.direction;"all"===o?(n.Ay.store().execCommand("style",{marginTop:e+"px",marginBottom:e+"px"}),this.margin={topValue:e,bottomValue:e}):n.Ay.store().execCommand("style",{[(0,c.A)(`margin-${o.toLowerCase()}`)]:e+"px"})},onChangePadding:t=>{const e=t.target.value,o=t.target.direction,r=(0,c.A)(`padding-${o.toLowerCase()}`);"all"===o?(n.Ay.store().execCommand("style",{padding:null,"padding-top":null,"padding-bottom":null,"padding-left":null,"padding-right":null,paddingTop:e+"px",paddingBottom:e+"px",paddingLeft:e+"px",paddingRight:e+"px","padding-right":null,"padding-left":null,"padding-top":null,"padding-bottom":null}),this.padding={topValue:e,bottomValue:e,leftValue:e,rightValue:e}):(n.Ay.store().execCommand("style",{[r]:e+"px",[`padding-${o.toLowerCase()}`]:null}),this.props.style={[r]:e+"px"},this[`padding${o.toLowerCase()}`]=e)},onChangebackground(t){const e=t.target.value;this.background=e;n.Ay.components.forEach(t=>{const o=t.find("text");if(o&&!o.closest("card")){let t=o.tiptap.getAttributes("textStyle").color;if(!t){const e=o.element.querySelector("p,h1,h2,h3,h4,h5,h6");e&&(t=window.getComputedStyle(e).color)}if(t){if("transparent"===t)return;if(!t.includes("var(--")&&!e.includes("var(--")&&"transparent"!==e&&"rgba(0, 0, 0, 0)"!==e&&"rgb(0, 0, 0)"!==e){const r=(0,l.w)(t,e);o.tiptap.chain().selectAll().setColor(r).run()}}}}),n.Ay.store().execCommand("style",{background:e,backgroundColor:null});"web"!==i.M.get("config","channel")&&n.Ay.store().execCommand("background",null)}}}onChangeImageBackgroundProp(t){const e=t.detail,{key:o,value:r}=e;if(this.props.background){const t=JSON.parse(JSON.stringify(this.props.background)),e=t.properties;if(!e.style[o])throw new Error(`${o} is not a valid property`);e.style[o]=r,n.Ay.store().execCommand("background",t)}}connectedCallback(){super.connectedCallback(),this.connectWith(),n.Ay.on("update",this.connectWith)}disconnectedCallback(){super.disconnectedCallback(),n.Ay.off("update",this.connectWith)}onChangeWidth(t){let e=t.target.value;e<500&&(e=500),e>1e3&&(e=1e3);const o=this.getInnerBlocks();n.Ay.store().execCommand2({transactions:[{key:"style",value:{width:e+"px",maxWidth:"100%"}}],update:[...o]}),this.maxWidth=e}connectWith(){const t=n.Ay.components[n.Ay.components.length-1];if(this.component=t,t&&"block"===t.type){this.props=t.props;let{style:e}=this.props;e||(e={}),t.props||(t.props={}),t.props.style||(t.props.style={}),this.expand_image_for_outlook=!!t.props.expand_image_for_outlook,this.boxShadow=t.props.style.boxShadow,this.borderStyle=t.props.style.borderStyle,this.borderWidth=t.props.style.borderWidth,this.borderTopRightRadius=parseInt(t.props.style.borderTopRightRadius),this.borderTopLeftRadius=parseInt(t.props.style.borderTopLeftRadius),this.borderBottomRightRadius=parseInt(t.props.style.borderBottomRightRadius),this.borderBottomLeftRadius=parseInt(t.props.style.borderBottomLeftRadius),this.borderTopWidth=parseInt(t.props.style.borderTopWidth),this.borderBottomWidth=parseInt(t.props.style.borderBottomWidth),this.borderLeftWidth=parseInt(t.props.style.borderLeftWidth),this.borderRightWidth=parseInt(t.props.style.borderRightWidth),this.borderColor=t.props.style.borderColor;const o=t.props.background;if(this.isBackgroundImage="images"===o?.type,this.noResponsive=!!t.props.noResponsive,this.modalable=!!t.props.modalable,this.modalName=t.props.modalName||"",this.isBackgroundImage){const t=o.properties;this.backgroundAttachment=t.style.backgroundAttachment,this.backgroundPosition=t.style.backgroundPosition,this.backgroundRepeat=t.style.backgroundRepeat,this.backgroundSize=t.style.backgroundSize}this.backgroundInstance=o,this.backgroundVideo=o?.properties?.src||o?.properties?.url||"";const r=t.element,i=window.getComputedStyle(r);this.maxWidth=parseInt(i.width),this.width=parseInt(e.width,10)||this.maxWidth,this.background=e.background||e.backgroundImage||i.backgroundColor,e.backgroundImage&&(this.background=`url(${e.backgroundImage})`),this.padding={topValue:parseInt(i.paddingTop),bottomValue:parseInt(i.paddingBottom),leftValue:parseInt(i.paddingLeft),rightValue:parseInt(i.paddingRight)},this.margin={topValue:parseInt(i.marginTop),bottomValue:parseInt(i.marginBottom)}}}changeTab(t){this.tabName=t.target.value}_toggleModalable(t){this.modalable=t,n.Ay.store().execCommand("modalable",this.modalable)}_setModalName(t){this.modalName=t,n.Ay.store().execCommand("modalName",t)}_onToggleAll(){this._sectionsExpanded=!this._sectionsExpanded,this.shadowRoot.querySelectorAll("cdtr-editor-section").forEach(t=>{t.open=this._sectionsExpanded})}render(){const t=i.M.get("config","channel");return r.qy`
|
|
2
2
|
<cdtr-editor-tabs .tabs=${this.tabs} @tabChanged=${this.changeTab}>
|
|
3
3
|
<div slot="content">
|
|
4
4
|
<div style="display:flex;justify-content:flex-start;padding:12px 16px 4px;">
|
|
@@ -146,6 +146,42 @@
|
|
|
146
146
|
></cdtr-checkbox>
|
|
147
147
|
</cdtr-col>
|
|
148
148
|
</cdtr-row>
|
|
149
|
+
${"web"===t?r.qy`
|
|
150
|
+
<cdtr-row alignItems="center" justify="space-between">
|
|
151
|
+
<cdtr-col
|
|
152
|
+
style="cursor:pointer"
|
|
153
|
+
@click=${()=>this._toggleModalable(!this.modalable)}
|
|
154
|
+
>
|
|
155
|
+
<cdtr-tooltip content="modal_hidden_on_view">
|
|
156
|
+
<cdtr-title>
|
|
157
|
+
<lang-text text="mark_as_modal"></lang-text>
|
|
158
|
+
</cdtr-title>
|
|
159
|
+
</cdtr-tooltip>
|
|
160
|
+
</cdtr-col>
|
|
161
|
+
<cdtr-col sm="1">
|
|
162
|
+
<cdtr-checkbox
|
|
163
|
+
@change=${t=>this._toggleModalable(!t.target.checked)}
|
|
164
|
+
.checked="${this.modalable}"
|
|
165
|
+
></cdtr-checkbox>
|
|
166
|
+
</cdtr-col>
|
|
167
|
+
</cdtr-row>
|
|
168
|
+
${this.modalable?r.qy`
|
|
169
|
+
<cdtr-title style="display:block;margin-top:8px">
|
|
170
|
+
<lang-text text="modal_name"></lang-text>
|
|
171
|
+
</cdtr-title>
|
|
172
|
+
<cdtr-input
|
|
173
|
+
style="width:100%"
|
|
174
|
+
.value=${this.modalName||""}
|
|
175
|
+
.placeholder=${i.M.get("lang","modal_name")||""}
|
|
176
|
+
@change=${t=>this._setModalName(t.target.value)}
|
|
177
|
+
></cdtr-input>
|
|
178
|
+
<p
|
|
179
|
+
style="font-size:12px;color:#888;line-height:1.5;margin:4px 0 0;font-style:italic;"
|
|
180
|
+
>
|
|
181
|
+
<lang-text text="modal_name_hint"></lang-text>
|
|
182
|
+
</p>
|
|
183
|
+
`:null}
|
|
184
|
+
`:null}
|
|
149
185
|
</cdtr-editor-section>
|
|
150
186
|
`:null}
|
|
151
187
|
|
|
@@ -217,7 +253,7 @@
|
|
|
217
253
|
background: #333;
|
|
218
254
|
color: #fff;
|
|
219
255
|
}
|
|
220
|
-
`,g.properties={maxWidth:{type:Number},backgroundInstance:{type:Object},padding:{type:Object},margin:{type:Object},tabs:{type:Array},tabName:{type:String},galleryOpened:{type:Boolean},backgroundVideo:{type:String,reflect:!0},isBackgroundImage:{type:Boolean},backgroundAttachment:{type:String},backgroundPosition:{type:String},backgroundRepeat:{type:String},backgroundSize:{type:String},noResponsive:{type:Boolean},borderStyle:{type:String},borderWidth:{type:Number},borderColor:{type:String},borderTopRightRadius:{type:Number},borderTopLeftRadius:{type:Number},borderBottomRightRadius:{type:Number},borderBottomLeftRadius:{type:Number},borderTopWidth:{type:Number},borderBottomWidth:{type:Number},borderLeftWidth:{type:Number},borderRightWidth:{type:Number},_sectionsExpanded:{type:Boolean,state:!0}},customElements.define("block-editor",g)},15155(t,e,o){o.d(e,{A:()=>a});var r=o(59929),i=o(57176);class n extends r.WF{constructor(){super(),this.items=[],this.columns=2}async openPicker(t){const e=this.shadowRoot.querySelector(`#picker-${t}`);if(!e)return;await e.updateComplete;const o=e.shadowRoot?.querySelector("color-playground");if(o)if(await o.updateComplete,"function"==typeof o.openColorpicker)o.openColorpicker();else{(o.shadowRoot?.querySelector('[role="button"]')||o.shadowRoot?.querySelector("div")||o).click()}}render(){const t=1===this.columns?"grid single-col":"grid";return r.qy`
|
|
256
|
+
`,g.properties={maxWidth:{type:Number},backgroundInstance:{type:Object},padding:{type:Object},margin:{type:Object},tabs:{type:Array},tabName:{type:String},galleryOpened:{type:Boolean},backgroundVideo:{type:String,reflect:!0},isBackgroundImage:{type:Boolean},backgroundAttachment:{type:String},backgroundPosition:{type:String},backgroundRepeat:{type:String},backgroundSize:{type:String},noResponsive:{type:Boolean},modalable:{type:Boolean},modalName:{type:String},borderStyle:{type:String},borderWidth:{type:Number},borderColor:{type:String},borderTopRightRadius:{type:Number},borderTopLeftRadius:{type:Number},borderBottomRightRadius:{type:Number},borderBottomLeftRadius:{type:Number},borderTopWidth:{type:Number},borderBottomWidth:{type:Number},borderLeftWidth:{type:Number},borderRightWidth:{type:Number},_sectionsExpanded:{type:Boolean,state:!0}},customElements.define("block-editor",g)},15155(t,e,o){o.d(e,{A:()=>a});var r=o(59929),i=o(57176);class n extends r.WF{constructor(){super(),this.items=[],this.columns=2}async openPicker(t){const e=this.shadowRoot.querySelector(`#picker-${t}`);if(!e)return;await e.updateComplete;const o=e.shadowRoot?.querySelector("color-playground");if(o)if(await o.updateComplete,"function"==typeof o.openColorpicker)o.openColorpicker();else{(o.shadowRoot?.querySelector('[role="button"]')||o.shadowRoot?.querySelector("div")||o).click()}}render(){const t=1===this.columns?"grid single-col":"grid";return r.qy`
|
|
221
257
|
<div class="${t}">
|
|
222
258
|
${(this.items||[]).map((t,e)=>r.qy`
|
|
223
259
|
<div class="swatch-item" @click=${()=>this.openPicker(e)}>
|
|
@@ -294,7 +330,7 @@
|
|
|
294
330
|
.items=${t.items}
|
|
295
331
|
.columns=${t.columns||2}
|
|
296
332
|
></cdtr-color-swatch-group>
|
|
297
|
-
`},12258(t,e,o){o.d(e,{A:()=>
|
|
333
|
+
`},12258(t,e,o){o.d(e,{A:()=>a});var r=o(59929),i=o(40648);class n extends r.WF{constructor(){super(),this.label="",this.open=!0,this.persistKey=""}toggle(){this.open=!this.open,(0,i.Q)(this.persistKey,this.open)}render(){return r.qy`
|
|
298
334
|
<div class="section">
|
|
299
335
|
<div class="header" @click=${this.toggle}>
|
|
300
336
|
<span class="title"><lang-text text="${this.label}"></lang-text></span>
|
|
@@ -308,7 +344,7 @@
|
|
|
308
344
|
</div>
|
|
309
345
|
</div>
|
|
310
346
|
</div>
|
|
311
|
-
`}}
|
|
347
|
+
`}}n.styles=r.AH`
|
|
312
348
|
:host {
|
|
313
349
|
display: block;
|
|
314
350
|
direction: var(--direction-locale, ltr);
|
|
@@ -356,11 +392,12 @@
|
|
|
356
392
|
.content-inner {
|
|
357
393
|
padding: 0 16px 12px 16px;
|
|
358
394
|
}
|
|
359
|
-
`,
|
|
395
|
+
`,n.properties={label:{type:String},open:{type:Boolean},persistKey:{type:String}},customElements.define("cdtr-editor-section",n);const a=(t,e)=>r.qy`
|
|
360
396
|
<cdtr-editor-section
|
|
361
397
|
.label=${t.label}
|
|
362
398
|
.open=${!1!==t.open}
|
|
399
|
+
.persistKey=${t.persistKey||""}
|
|
363
400
|
>
|
|
364
401
|
${e}
|
|
365
402
|
</cdtr-editor-section>
|
|
366
|
-
`}}]);
|
|
403
|
+
`},40648(t,e,o){o.d(e,{Q:()=>a,i:()=>n});const r="cdtr:section-open";function i(){try{const t=localStorage.getItem(r);return t?JSON.parse(t):{}}catch(t){return{}}}function n(t){if(!t)return;const e=i();return Object.prototype.hasOwnProperty.call(e,t)?!!e[t]:void 0}function a(t,e){if(!t)return;const o=i();o[t]=!!e,function(t){try{localStorage.setItem(r,JSON.stringify(t))}catch(t){}}(o)}}}]);
|
|
Binary file
|
|
@@ -1,439 +1 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[
|
|
2
|
-
<cdtr-editor-container>
|
|
3
|
-
<div class="editor-container">
|
|
4
|
-
<div class="prompt-section">
|
|
5
|
-
<div class="prompt-header">
|
|
6
|
-
<div class="prompt-icon">✍️</div>
|
|
7
|
-
<label class="prompt-label" for="prompt-input">
|
|
8
|
-
<lang-text text="prompt_editor_title"></lang-text>
|
|
9
|
-
</label>
|
|
10
|
-
</div>
|
|
11
|
-
|
|
12
|
-
<cdtr-input
|
|
13
|
-
id="business-name-input"
|
|
14
|
-
label="Business Name"
|
|
15
|
-
.value=${this.businessName}
|
|
16
|
-
@input=${this.handleBusinessNameChange}
|
|
17
|
-
placeholder="Enter_your_business_name"
|
|
18
|
-
></cdtr-input>
|
|
19
|
-
|
|
20
|
-
<cdtr-input
|
|
21
|
-
id="business-type-input"
|
|
22
|
-
label="Business Type"
|
|
23
|
-
.value=${this.businessType}
|
|
24
|
-
@input=${this.handleBusinessTypeChange}
|
|
25
|
-
placeholder="Enter_your_business_type"
|
|
26
|
-
></cdtr-input>
|
|
27
|
-
|
|
28
|
-
<cdtr-input
|
|
29
|
-
id="url-input"
|
|
30
|
-
label="URL"
|
|
31
|
-
.value=${this.url}
|
|
32
|
-
@input=${this.handleUrlChange}
|
|
33
|
-
placeholder="Enter_the_URL_of_the_page"
|
|
34
|
-
></cdtr-input>
|
|
35
|
-
|
|
36
|
-
<cdtr-textarea
|
|
37
|
-
autofocus=${!0}
|
|
38
|
-
id="prompt-input"
|
|
39
|
-
class="prompt-input"
|
|
40
|
-
placeholder=""
|
|
41
|
-
.value=${this.prompt}
|
|
42
|
-
@input=${this.handlePromptChange}
|
|
43
|
-
></cdtr-textarea>
|
|
44
|
-
|
|
45
|
-
<cdtr-dropdown .value=${e}>
|
|
46
|
-
<cdtr-dropdown-button slot="trigger">
|
|
47
|
-
<lang-text text="${e||"paragraph"}"></lang-text>
|
|
48
|
-
</cdtr-dropdown-button>
|
|
49
|
-
<div slot="content">
|
|
50
|
-
<cdtr-dropdown-item
|
|
51
|
-
@click=${()=>this.handleContentTypeChange("title")}
|
|
52
|
-
>
|
|
53
|
-
<lang-text text="title"></lang-text>
|
|
54
|
-
</cdtr-dropdown-item>
|
|
55
|
-
<cdtr-dropdown-item
|
|
56
|
-
@click=${()=>this.handleContentTypeChange("paragraph")}
|
|
57
|
-
>
|
|
58
|
-
<lang-text text="paragraph"></lang-text>
|
|
59
|
-
</cdtr-dropdown-item>
|
|
60
|
-
</div>
|
|
61
|
-
</cdtr-dropdown>
|
|
62
|
-
<cdtr-row justify="space-between">
|
|
63
|
-
<cdtr-col>
|
|
64
|
-
<span class="prompt-context">
|
|
65
|
-
<lang-text text="prompt_editor_context"></lang-text>
|
|
66
|
-
</span>
|
|
67
|
-
</cdtr-col>
|
|
68
|
-
<cdtr-col sm="2">
|
|
69
|
-
<cdtr-checkbox
|
|
70
|
-
.checked=${this.includeContext}
|
|
71
|
-
@change=${this.handleIncludeContextChange}
|
|
72
|
-
></cdtr-checkbox>
|
|
73
|
-
</cdtr-col>
|
|
74
|
-
</cdtr-row>
|
|
75
|
-
<paper-button
|
|
76
|
-
fullWidth
|
|
77
|
-
class="generate-button"
|
|
78
|
-
?disabled=${this.isLoading||!this.prompt}
|
|
79
|
-
@click=${this.handleGenerate}
|
|
80
|
-
>
|
|
81
|
-
${this.isLoading?i.qy`
|
|
82
|
-
<div class="loading-spinner"></div>
|
|
83
|
-
<lang-text text="creating_magic"></lang-text>
|
|
84
|
-
`:i.qy` <lang-text text="generate_content"></lang-text> `}
|
|
85
|
-
</paper-button>
|
|
86
|
-
</div>
|
|
87
|
-
|
|
88
|
-
${this.generatedText?i.qy`
|
|
89
|
-
<div class="result-section">
|
|
90
|
-
<div class="result-content">${this.generatedText}</div>
|
|
91
|
-
</div>
|
|
92
|
-
`:""}
|
|
93
|
-
</div>
|
|
94
|
-
</cdtr-editor-container>
|
|
95
|
-
`}}).properties={prompt:{type:String},generatedText:{type:String},isLoading:{type:Boolean},context:{type:String},includeContext:{type:Boolean},businessType:{type:String},businessName:{type:String},contentType:{type:String},url:{type:String}},o.styles=i.AH`
|
|
96
|
-
:host {
|
|
97
|
-
--primary: #7c3aed;
|
|
98
|
-
--primary-light: #a78bfa;
|
|
99
|
-
--primary-dark: #5b21b6;
|
|
100
|
-
--accent: #f472b6;
|
|
101
|
-
--accent-light: #f9a8d4;
|
|
102
|
-
--accent-dark: #db2777;
|
|
103
|
-
--surface: #f8fafc;
|
|
104
|
-
--surface-dark: #f1f5f9;
|
|
105
|
-
--text-primary: #0f172a;
|
|
106
|
-
--text-secondary: #334155;
|
|
107
|
-
--gradient-primary: linear-gradient(
|
|
108
|
-
135deg,
|
|
109
|
-
var(--primary) 0%,
|
|
110
|
-
var(--accent) 100%
|
|
111
|
-
);
|
|
112
|
-
--gradient-accent: linear-gradient(
|
|
113
|
-
135deg,
|
|
114
|
-
var(--accent) 0%,
|
|
115
|
-
var(--primary) 100%
|
|
116
|
-
);
|
|
117
|
-
--gradient-surface: linear-gradient(
|
|
118
|
-
135deg,
|
|
119
|
-
var(--surface) 0%,
|
|
120
|
-
var(--surface-dark) 100%
|
|
121
|
-
);
|
|
122
|
-
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
|
|
123
|
-
--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
|
|
124
|
-
0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
|
125
|
-
--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
|
|
126
|
-
0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
|
127
|
-
--shadow-glow: 0 0 20px rgba(124, 58, 237, 0.3),
|
|
128
|
-
0 0 40px rgba(244, 114, 182, 0.2);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
* {
|
|
132
|
-
box-sizing: border-box;
|
|
133
|
-
margin: 0;
|
|
134
|
-
padding: 0;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
:host {
|
|
138
|
-
display: block;
|
|
139
|
-
width: 100%;
|
|
140
|
-
margin: 0;
|
|
141
|
-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
|
|
142
|
-
Ubuntu, Cantarell, sans-serif;
|
|
143
|
-
background: var(--gradient-surface);
|
|
144
|
-
min-height: 100vh;
|
|
145
|
-
position: relative;
|
|
146
|
-
overflow: hidden;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
:host::before {
|
|
150
|
-
content: "";
|
|
151
|
-
position: absolute;
|
|
152
|
-
top: 0;
|
|
153
|
-
left: 0;
|
|
154
|
-
right: 0;
|
|
155
|
-
bottom: 0;
|
|
156
|
-
background: radial-gradient(
|
|
157
|
-
circle at 0% 0%,
|
|
158
|
-
rgba(124, 58, 237, 0.1) 0%,
|
|
159
|
-
transparent 50%
|
|
160
|
-
),
|
|
161
|
-
radial-gradient(
|
|
162
|
-
circle at 100% 100%,
|
|
163
|
-
rgba(244, 114, 182, 0.1) 0%,
|
|
164
|
-
transparent 50%
|
|
165
|
-
);
|
|
166
|
-
pointer-events: none;
|
|
167
|
-
animation: gradientShift 15s ease infinite;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
@keyframes gradientShift {
|
|
171
|
-
0% {
|
|
172
|
-
background-position: 0% 0%;
|
|
173
|
-
}
|
|
174
|
-
50% {
|
|
175
|
-
background-position: 100% 100%;
|
|
176
|
-
}
|
|
177
|
-
100% {
|
|
178
|
-
background-position: 0% 0%;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
.editor-container {
|
|
183
|
-
display: flex;
|
|
184
|
-
flex-direction: column;
|
|
185
|
-
gap: 1.5rem;
|
|
186
|
-
padding: 1.5rem;
|
|
187
|
-
position: relative;
|
|
188
|
-
overflow: hidden;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
.prompt-section {
|
|
192
|
-
display: flex;
|
|
193
|
-
flex-direction: column;
|
|
194
|
-
gap: 1rem;
|
|
195
|
-
position: relative;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
.prompt-header {
|
|
199
|
-
display: flex;
|
|
200
|
-
align-items: center;
|
|
201
|
-
justify-content: space-between;
|
|
202
|
-
gap: 0.75rem;
|
|
203
|
-
margin-bottom: 0.5rem;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
.prompt-icon {
|
|
207
|
-
width: 40px;
|
|
208
|
-
height: 40px;
|
|
209
|
-
background: var(--gradient-primary);
|
|
210
|
-
border-radius: 12px;
|
|
211
|
-
display: flex;
|
|
212
|
-
align-items: center;
|
|
213
|
-
justify-content: center;
|
|
214
|
-
color: white;
|
|
215
|
-
font-weight: bold;
|
|
216
|
-
position: relative;
|
|
217
|
-
transform-origin: center;
|
|
218
|
-
animation: iconFloat 3s ease-in-out infinite;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
@keyframes iconFloat {
|
|
222
|
-
0%,
|
|
223
|
-
100% {
|
|
224
|
-
transform: translateY(0) rotate(0deg);
|
|
225
|
-
}
|
|
226
|
-
50% {
|
|
227
|
-
transform: translateY(-5px) rotate(5deg);
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
.prompt-icon::after {
|
|
232
|
-
content: "";
|
|
233
|
-
position: absolute;
|
|
234
|
-
inset: -2px;
|
|
235
|
-
background: var(--gradient-primary);
|
|
236
|
-
border-radius: 14px;
|
|
237
|
-
z-index: -1;
|
|
238
|
-
opacity: 0.5;
|
|
239
|
-
filter: blur(8px);
|
|
240
|
-
animation: iconGlow 3s ease-in-out infinite;
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
@keyframes iconGlow {
|
|
244
|
-
0%,
|
|
245
|
-
100% {
|
|
246
|
-
opacity: 0.5;
|
|
247
|
-
filter: blur(8px);
|
|
248
|
-
}
|
|
249
|
-
50% {
|
|
250
|
-
opacity: 0.8;
|
|
251
|
-
filter: blur(12px);
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
.prompt-label {
|
|
256
|
-
font-size: 1.25rem;
|
|
257
|
-
font-weight: 600;
|
|
258
|
-
color: var(--text-primary);
|
|
259
|
-
letter-spacing: -0.02em;
|
|
260
|
-
display: flex;
|
|
261
|
-
align-items: center;
|
|
262
|
-
gap: 0.75rem;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
.prompt-label::after {
|
|
266
|
-
content: "AI";
|
|
267
|
-
font-size: 0.875rem;
|
|
268
|
-
background: var(--gradient-primary);
|
|
269
|
-
color: white;
|
|
270
|
-
padding: 0.25rem 0.75rem;
|
|
271
|
-
border-radius: 6px;
|
|
272
|
-
font-weight: 500;
|
|
273
|
-
animation: badgeFloat 3s ease-in-out infinite;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
@keyframes badgeFloat {
|
|
277
|
-
0%,
|
|
278
|
-
100% {
|
|
279
|
-
transform: translateY(0);
|
|
280
|
-
}
|
|
281
|
-
50% {
|
|
282
|
-
transform: translateY(-2px);
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
.generate-button {
|
|
287
|
-
width: 100%;
|
|
288
|
-
align-self: flex-end;
|
|
289
|
-
padding: 0.875rem 1.75rem;
|
|
290
|
-
background: var(--gradient-primary);
|
|
291
|
-
color: white;
|
|
292
|
-
border: none;
|
|
293
|
-
border-radius: 10px;
|
|
294
|
-
font-size: 1rem;
|
|
295
|
-
font-weight: 600;
|
|
296
|
-
cursor: pointer;
|
|
297
|
-
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
298
|
-
display: flex;
|
|
299
|
-
align-items: center;
|
|
300
|
-
gap: 0.75rem;
|
|
301
|
-
position: relative;
|
|
302
|
-
overflow: hidden;
|
|
303
|
-
box-shadow: var(--shadow-md);
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
.generate-button::before {
|
|
307
|
-
content: "";
|
|
308
|
-
position: absolute;
|
|
309
|
-
top: 0;
|
|
310
|
-
left: 0;
|
|
311
|
-
right: 0;
|
|
312
|
-
bottom: 0;
|
|
313
|
-
background: linear-gradient(
|
|
314
|
-
135deg,
|
|
315
|
-
rgba(255, 255, 255, 0.2) 0%,
|
|
316
|
-
rgba(255, 255, 255, 0) 100%
|
|
317
|
-
);
|
|
318
|
-
opacity: 0;
|
|
319
|
-
transition: opacity 0.3s ease;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
.generate-button:hover::before {
|
|
323
|
-
opacity: 1;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
.generate-button:hover {
|
|
327
|
-
transform: translateY(-2px);
|
|
328
|
-
box-shadow: var(--shadow-glow);
|
|
329
|
-
background: var(--gradient-accent);
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
.generate-button:active {
|
|
333
|
-
transform: translateY(0);
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
.generate-button:disabled {
|
|
337
|
-
background: var(--gradient-surface);
|
|
338
|
-
cursor: not-allowed;
|
|
339
|
-
transform: none;
|
|
340
|
-
box-shadow: none;
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
.result-section {
|
|
344
|
-
margin-top: 0.5rem;
|
|
345
|
-
padding: 1.5rem;
|
|
346
|
-
background: rgba(255, 255, 255, 0.8);
|
|
347
|
-
border-radius: 12px;
|
|
348
|
-
min-height: 160px;
|
|
349
|
-
opacity: 0;
|
|
350
|
-
transform: translateY(10px);
|
|
351
|
-
animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
|
|
352
|
-
position: relative;
|
|
353
|
-
overflow: hidden;
|
|
354
|
-
backdrop-filter: blur(8px);
|
|
355
|
-
box-shadow: var(--shadow-md);
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
.result-section::before {
|
|
359
|
-
content: "";
|
|
360
|
-
position: absolute;
|
|
361
|
-
top: 0;
|
|
362
|
-
left: 0;
|
|
363
|
-
right: 0;
|
|
364
|
-
height: 3px;
|
|
365
|
-
background: var(--gradient-primary);
|
|
366
|
-
opacity: 0.8;
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
.result-content {
|
|
370
|
-
white-space: pre-wrap;
|
|
371
|
-
line-height: 1.7;
|
|
372
|
-
color: var(--text-primary);
|
|
373
|
-
font-size: 1rem;
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
.loading-spinner {
|
|
377
|
-
width: 20px;
|
|
378
|
-
height: 20px;
|
|
379
|
-
border: 2px solid rgba(255, 255, 255, 0.3);
|
|
380
|
-
border-top: 2px solid white;
|
|
381
|
-
border-radius: 50%;
|
|
382
|
-
animation: spin 1s linear infinite;
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
@keyframes spin {
|
|
386
|
-
0% {
|
|
387
|
-
transform: rotate(0deg);
|
|
388
|
-
}
|
|
389
|
-
100% {
|
|
390
|
-
transform: rotate(360deg);
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
@keyframes fadeIn {
|
|
395
|
-
from {
|
|
396
|
-
opacity: 0;
|
|
397
|
-
transform: translateY(10px);
|
|
398
|
-
}
|
|
399
|
-
to {
|
|
400
|
-
opacity: 1;
|
|
401
|
-
transform: translateY(0);
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
/* Decorative elements */
|
|
406
|
-
.editor-container::after {
|
|
407
|
-
content: "";
|
|
408
|
-
position: absolute;
|
|
409
|
-
top: 50%;
|
|
410
|
-
left: 50%;
|
|
411
|
-
width: 200%;
|
|
412
|
-
height: 200%;
|
|
413
|
-
background: radial-gradient(
|
|
414
|
-
circle at center,
|
|
415
|
-
rgba(124, 58, 237, 0.1) 0%,
|
|
416
|
-
transparent 50%
|
|
417
|
-
);
|
|
418
|
-
transform: translate(-50%, -50%);
|
|
419
|
-
pointer-events: none;
|
|
420
|
-
animation: pulse 4s ease-in-out infinite;
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
.prompt-context {
|
|
424
|
-
font-size: 13px;
|
|
425
|
-
color: var(--text-secondary);
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
@keyframes pulse {
|
|
429
|
-
0%,
|
|
430
|
-
100% {
|
|
431
|
-
transform: translate(-50%, -50%) scale(1);
|
|
432
|
-
opacity: 0.5;
|
|
433
|
-
}
|
|
434
|
-
50% {
|
|
435
|
-
transform: translate(-50%, -50%) scale(1.1);
|
|
436
|
-
opacity: 0.3;
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
`,r=o))||r},71271(e,t,n){n.d(t,{default:()=>m});var r=n(53577),o=n(74265),a=n(86319);const i=[100,300,400,500,600,700,900].map(e=>({value:String(e),label:String(e)})),s=e=>{{const{component:t,commands:n,helpers:s}=e,l=t.tiptap,c=l.state.selection.$anchor.node().attrs,p=l.isActive("heading",{level:1})?"h1":l.isActive("heading",{level:2})?"h2":l.isActive("heading",{level:3})?"h3":l.isActive("heading",{level:4})?"h4":l.isActive("heading",{level:5})?"h5":l.isActive("heading",{level:6})?"h6":"paragraph";let d=e.languageJson;const g=e.language||"he";return d||(d="he"===g?r:o),{select:e=>{let{changeTab:t,tab:n}=e},tabs:e=>{const t=l.isActive("customBulletItem"),n=[{text:"design",selected:!t},...t?[{text:"icons",selected:!0}]:[],{text:"settings"}];return n.forEach(t=>t.selected=t.text===e),n},layout:e=>{let{tab:r,changeTab:o,tabs:s}=e;return[{type:"info",text:"text_micro_copy",active:()=>"design"===r.text},{type:"heading",level:6,text:"typography",active:()=>"design"===r.text},{type:"dropdown",active:()=>"design"===r.text,title:"type",value:p,items:[{value:"H1"},{value:"H2"},{value:"H3"},{value:"H4"},{value:"H5"},{value:"H6"},{value:"paragraph"}],onChange:e=>{const t=e.target.value;switch(t){case"H1":case"H2":case"H3":case"H4":case"H5":case"H6":l.chain().setHeading({level:parseInt(t.slice(1))}).run();break;case"paragraph":l.chain().setParagraph().run()}}},{type:"slider",title:"fontSize",min:8,step:2,max:74,value:parseInt(l.getAttributes("textStyle").fontSize||"16px"),active:()=>"design"===r.text,onInput:e=>{const n=e.target.value,r=t.tiptap,o=r.view.state.selection;o.from===o.to?r.chain().selectAll().setFontSize(n).run():r.chain().setFontSize(n).run()}},{type:"dropdown",title:"fontWeight",active:()=>"design"===r.text&&"web"===a.M.get("config","channel"),value:String(l.getAttributes("textStyle").fontWeight||400),selected:String(l.getAttributes("textStyle").fontWeight||400),items:i,onChange:e=>{const n=e.target.value,r=t.tiptap,o=r.view.state.selection;o.from===o.to?r.chain().selectAll().setFontWeight(n).run():r.chain().setFontWeight(n).run()}},{type:"heading",level:6,text:"spacing",active:()=>"design"===r.text},{type:"slider",title:"lineHeight",min:1,max:3,step:.1,value:parseFloat(c.lineHeight||1),active:()=>"design"===r.text,onInput:e=>{const n=e.target.value,r=t.tiptap,o=r.view.state.selection;o.from===o.to?r.chain().selectAll().setLineHeight(n).run():r.chain().setLineHeight(n).run()}},{type:"slider",title:"letterSpacing",min:1,max:10,step:1,value:parseFloat(c.letterSpacing)||1,active:()=>"design"===r.text,onInput:e=>{const n=e.target.value,r=t.tiptap,o=r.view.state.selection;n<=1?o.from===o.to?r.chain().selectAll().setLetterSpacing("normal").run():r.chain().setLetterSpacing("normal").run():o.from===o.to?r.chain().selectAll().setLetterSpacing(n+"px").run():r.chain().setLetterSpacing(n+"px").run()}},{type:"heading",level:6,text:"colors",active:()=>"design"===r.text},{type:"colorSwatchGroup",active:()=>"design"===r.text,columns:2,items:[{title:"font_color",value:l.getAttributes("textStyle").color||"#000000",onChange:e=>{const n=e.target.value,r=t.tiptap,o=r.view.state.selection;if(o.from===o.to){const{state:e,view:t}=r,o=e.tr,{from:a,to:i}={from:0,to:e.doc.content.size};e.doc.nodesBetween(a,i,(t,r)=>{if(t.isText){t.marks.some(e=>"link"===e.type.name)||o.addMark(r,r+t.nodeSize,e.schema.marks.textStyle.create({color:n}))}}),t.dispatch(o)}else r.chain().setColor(n).focus().run()}},{title:"backgroundColor",allowGradient:!0,value:t.props.style.background||t.props.style.backgroundColor||"#ffffff",onChange:e=>{const t=e.target.value;n.execCommand("style",{background:t,backgroundColor:null})}}]},{type:"heading",level:6,text:"layout",active:()=>"design"===r.text},{type:"slider",active:()=>"design"===r.text,title:"maxWidth",value:parseFloat(t.props.style.width),min:20,max:1e3,onInput:e=>{const t=e.target.value;n.execCommand("style",{width:t+"px"})}},{type:"divider"},{type:"colorpicker",active:()=>"icons"===r.text,title:d.iconColor||"Icon color",alpha:!1,value:l.getAttributes(" textStyle").color||"#0000",onChange:e=>{const t=e.target.value;l.chain().setCustomBulletStyles({fill:t}).run()}},{type:"divider",active:()=>"icons"===r.text},{type:"slider",active:()=>"icons"===r.text,title:d.iconSize||"Icon size",value:parseInt(l.getAttributes("customBulletItem").width)||24,min:10,max:40,onInput:e=>{const t=e.target.value;l.chain().setCustomBulletStyles({width:t+"px",height:t+"px"}).run()}},{type:"icons",active:()=>"icons"===r.text,selectedIcon:t.props.src,useIconsApi:!0,iconColor:t.props.iconColor||"000000",iconSize:parseInt(t.props.style?.width,10)||24,onChange:e=>{const n=e.detail;t.tiptap.chain().focus().setCustomBulletIcon({svgIcon:n.urlPng}).run()}}]}}}};var l=n(52144);const c=e=>{let{helpers:t,tiptap:n,composeId:r,template:o}=e;return{set:(e,a,i)=>{switch(a){case"style":return"object"==typeof i&&(e[a]=(0,l.A)(e[a],i),t.mergeDiff(o,{style:e[a]})),!0;case"text":e[a]=i;const s=n.getJSON();return i&&"object"==typeof i&&JSON.stringify(s)!==JSON.stringify(i.childNodes)&&(i&&i.focusedElement&&i.focusedElement===r?(n.chain().focus().setContent(i.childNodes).run(),i.to&&i.from&&n.commands.setTextSelection({from:i.from,to:i.to})):n.chain().setContent(i.childNodes).run()),delete e?.text?.markdown,!0}}}};var p=n(84488),d=n.n(p);n(70567);const g=[];let u=!1,h=null;const m=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t="text";return{name:t,create:n=>{const{createElement:r,compose:o,helpers:i}=n,{mergeDiff:l}=i,p=document.createElement("div");l(p,{style:o.props.style});const m=a.M.get("config","editor","configure","editorProps","fonts");let x=a.M.get("config","target");"string"==typeof x&&(x=document.querySelector(x)),x||(x=document.body);const y=d()({element:p,container:x||document.body,editable:!0,offsetTop:40,onClickMagic:e=>{let{insertContent:t,getJSON:n,getHTML:r,getText:o,selectAll:i,insertContentHtml:s}=e;const l=a.M.get("injectEditor"),c=document.createElement("cdtr-text-prompt-editor");l(c),c.context=o(),c.addEventListener("text-generation-start",e=>{i()}),c.addEventListener("text-generation-chunk",e=>{t(e.detail.chunk)}),c.addEventListener("text-generation-complete",e=>{i(),s(e.detail.text)}),c.addEventListener("text-generation-error",e=>{console.error("Text generation error:",e.detail.error)})},content:"string"==typeof o.props.text.markdown?o.props.text.markdown:o.props.text.childNodes,defaultDirection:"rtl",onBlur:()=>{h===y&&(h=null),setTimeout(()=>{h!==y&&(u=!1)},150)},onFocus:()=>{if(!u||h===y||null===h){if(u=!0,h=y,g.length>0)for(g.forEach(e=>{e!==y&&e.hideEditor()});g.length>0;)g.pop();g.push(y),setTimeout(()=>{h===y&&u&&y.showEditor()},100)}},onUpdate:e=>{let{editor:t,transaction:n}=e;if(0===n.steps.length)return;const r=n.curSelection.from,a=n.curSelection.to,i={childNodes:t.getJSON(),from:r,to:a,focusedElement:o.id};f.commands.execCommand("text",i)},ignoresBlurByQuerySelectors:[".ignore-events"],builder:[{type:"fontFamily",fonts:m||[],useCloud:!0},{type:"fontSize",sizes:e.fontSize||[8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74]},{type:"horizonRule"},{type:"clearFormat"},{type:"bold"},{type:"strike"},{type:"italic"},{type:"underline"},{type:"table"},{type:"emoji"},{type:"unLink"},{type:"link"},{type:"customList"},{type:"numbered"},{type:"bullet"},{type:"backcolor"},{type:"fontColor"},{type:"direction"},{type:"justify"},{type:"right"},{type:"center"},{type:"left"},{type:"image"},{type:"mergeTags"},{type:"magic"}]}),f=r({name:t,id:o.id,template:p,defaultProps:{text:{},style:{}},draggable:{group:"element"},droppable:{group:"element"},resizeable:()=>p,handleBar:!0,validator:c({template:p,helpers:i,tiptap:y,composeId:o.id}),schema:o.schema,onSelect:e=>{p.classList.add(e)},onDeselect:e=>{p.classList.remove(e)},elementProps:o,remove:()=>{p.remove()},createEditor:s});return o.props.text.markdown&&y.chain().insertContent(" ").run(),f.addProp("tiptap",y),f}}}}}]);
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[1271],{71271(e,t,n){n.d(t,{default:()=>v});var o=n(53577),i=n(74265),a=n(86319),s=n(20252);const l=[100,300,400,500,600,700,900].map(e=>({value:String(e),label:String(e)})),r=e=>{{const{component:t,commands:n,helpers:r}=e,c=t.tiptap,p=c.state.selection.$anchor.node().attrs,d=c.isActive("heading",{level:1})?"h1":c.isActive("heading",{level:2})?"h2":c.isActive("heading",{level:3})?"h3":c.isActive("heading",{level:4})?"h4":c.isActive("heading",{level:5})?"h5":c.isActive("heading",{level:6})?"h6":"paragraph";let u=e.languageJson;const g=e.language||"he";return u||(u="he"===g?o:i),{select:e=>{let{changeTab:t,tab:n}=e},tabs:e=>{const t=c.isActive("customBulletItem"),n=[{text:"design",selected:!t},...t?[{text:"icons",selected:!0}]:[],{text:"settings"}];return n.forEach(t=>t.selected=t.text===e),n},layout:e=>{let{tab:o,changeTab:i,tabs:r}=e;return[{type:"info",text:"text_micro_copy",active:()=>"design"===o.text},{type:"heading",level:6,text:"typography",active:()=>"design"===o.text},{type:"dropdown",active:()=>"design"===o.text,title:"type",value:d,items:[{value:"H1"},{value:"H2"},{value:"H3"},{value:"H4"},{value:"H5"},{value:"H6"},{value:"paragraph"}],onChange:e=>{const t=e.target.value;switch(t){case"H1":case"H2":case"H3":case"H4":case"H5":case"H6":c.chain().setHeading({level:parseInt(t.slice(1))}).run();break;case"paragraph":c.chain().setParagraph().run()}}},{type:"slider",title:"fontSize",min:8,step:2,max:74,value:parseInt(c.getAttributes("textStyle").fontSize||"16px"),active:()=>"design"===o.text,onInput:e=>{const n=e.target.value,o=t.tiptap,i=o.view.state.selection;i.from===i.to?o.chain().selectAll().setFontSize(n).run():o.chain().setFontSize(n).run()}},{type:"dropdown",title:"fontWeight",active:()=>"design"===o.text&&"web"===a.M.get("config","channel"),value:String(c.getAttributes("textStyle").fontWeight||400),selected:String(c.getAttributes("textStyle").fontWeight||400),items:l,onChange:e=>{const n=e.target.value,o=t.tiptap,i=o.view.state.selection;i.from===i.to?o.chain().selectAll().setFontWeight(n).run():o.chain().setFontWeight(n).run()}},{type:"checkbox",title:"smart_change",active:()=>"design"===o.text,checked:(0,s.z)(),onChange:e=>{(0,s.R)(!!e.target.checked)}},{type:"heading",level:6,text:"spacing",active:()=>"design"===o.text},{type:"slider",title:"lineHeight",min:1,max:3,step:.1,value:parseFloat(p.lineHeight||1),active:()=>"design"===o.text,onInput:e=>{const n=e.target.value,o=t.tiptap,i=o.view.state.selection;i.from===i.to?o.chain().selectAll().setLineHeight(n).run():o.chain().setLineHeight(n).run()}},{type:"slider",title:"letterSpacing",min:1,max:10,step:1,value:parseFloat(p.letterSpacing)||1,active:()=>"design"===o.text,onInput:e=>{const n=e.target.value,o=t.tiptap,i=o.view.state.selection;n<=1?i.from===i.to?o.chain().selectAll().setLetterSpacing("normal").run():o.chain().setLetterSpacing("normal").run():i.from===i.to?o.chain().selectAll().setLetterSpacing(n+"px").run():o.chain().setLetterSpacing(n+"px").run()}},{type:"heading",level:6,text:"colors",active:()=>"design"===o.text},{type:"colorSwatchGroup",active:()=>"design"===o.text,columns:2,items:[{title:"font_color",value:c.getAttributes("textStyle").color||"#000000",onChange:e=>{const n=e.target.value,o=t.tiptap,i=o.view.state.selection;if(i.from===i.to){const{state:e,view:t}=o,i=e.tr,{from:a,to:s}={from:0,to:e.doc.content.size};e.doc.nodesBetween(a,s,(t,o)=>{if(t.isText){t.marks.some(e=>"link"===e.type.name)||i.addMark(o,o+t.nodeSize,e.schema.marks.textStyle.create({color:n}))}}),t.dispatch(i)}else o.chain().setColor(n).focus().run()}},{title:"backgroundColor",allowGradient:!0,value:t.props.style.background||t.props.style.backgroundColor||"#ffffff",onChange:e=>{const t=e.target.value;n.execCommand("style",{background:t,backgroundColor:null})}}]},{type:"heading",level:6,text:"layout",active:()=>"design"===o.text},{type:"slider",active:()=>"design"===o.text,title:"maxWidth",value:parseFloat(t.props.style.width),min:20,max:1e3,onInput:e=>{const t=e.target.value;n.execCommand("style",{width:t+"px"})}},{type:"divider"},{type:"colorpicker",active:()=>"icons"===o.text,title:u.iconColor||"Icon color",alpha:!1,value:c.getAttributes(" textStyle").color||"#0000",onChange:e=>{const t=e.target.value;c.chain().setCustomBulletStyles({fill:t}).run()}},{type:"divider",active:()=>"icons"===o.text},{type:"slider",active:()=>"icons"===o.text,title:u.iconSize||"Icon size",value:parseInt(c.getAttributes("customBulletItem").width)||24,min:10,max:40,onInput:e=>{const t=e.target.value;c.chain().setCustomBulletStyles({width:t+"px",height:t+"px"}).run()}},{type:"icons",active:()=>"icons"===o.text,selectedIcon:t.props.src,useIconsApi:!0,iconColor:t.props.iconColor||"000000",iconSize:parseInt(t.props.style?.width,10)||24,onChange:e=>{const n=e.detail;t.tiptap.chain().focus().setCustomBulletIcon({svgIcon:n.urlPng}).run()}}]}}}};var c=n(52144);const p=e=>{let{helpers:t,tiptap:n,composeId:o,template:i}=e;return{set:(e,a,s)=>{switch(a){case"style":return"object"==typeof s&&(e[a]=(0,c.A)(e[a],s),t.mergeDiff(i,{style:e[a]})),!0;case"text":e[a]=s;const l=n.getJSON();return s&&"object"==typeof s&&JSON.stringify(l)!==JSON.stringify(s.childNodes)&&(s&&s.focusedElement&&s.focusedElement===o?(n.chain().focus().setContent(s.childNodes).run(),s.to&&s.from&&n.commands.setTextSelection({from:s.from,to:s.to})):n.chain().setContent(s.childNodes).run()),delete e?.text?.markdown,!0}}}};var d=n(84488),u=n.n(d);n(70567);const g=[];let h=!1,m=null;const v=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t="text";return{name:t,create:n=>{const{createElement:o,compose:i,helpers:s}=n,{mergeDiff:l}=s,c=document.createElement("div");l(c,{style:i.props.style});const d=a.M.get("config","editor","configure","editorProps","fonts");let v=a.M.get("config","target");"string"==typeof v&&(v=document.querySelector(v)),v||(v=document.body);const y=u()({element:c,container:v||document.body,editable:!0,offsetTop:40,onClickMagic:e=>{let{insertContent:t,getJSON:n,getHTML:o,getText:i,selectAll:s,insertContentHtml:l}=e;const r=a.M.get("injectEditor"),c=document.createElement("cdtr-text-prompt-editor");r(c),c.context=i(),c.addEventListener("text-generation-start",e=>{s()}),c.addEventListener("text-generation-chunk",e=>{t(e.detail.chunk)}),c.addEventListener("text-generation-complete",e=>{s(),l(e.detail.text)}),c.addEventListener("text-generation-error",e=>{console.error("Text generation error:",e.detail.error)})},content:"string"==typeof i.props.text.markdown?i.props.text.markdown:i.props.text.childNodes,defaultDirection:"rtl",onBlur:()=>{m===y&&(m=null),setTimeout(()=>{m!==y&&(h=!1)},150)},onFocus:()=>{if(!h||m===y||null===m){if(h=!0,m=y,g.length>0)for(g.forEach(e=>{e!==y&&e.hideEditor()});g.length>0;)g.pop();g.push(y),setTimeout(()=>{m===y&&h&&y.showEditor()},100)}},onUpdate:e=>{let{editor:t,transaction:n}=e;if(0===n.steps.length)return;const o=n.curSelection.from,a=n.curSelection.to,s={childNodes:t.getJSON(),from:o,to:a,focusedElement:i.id};f.commands.execCommand("text",s)},ignoresBlurByQuerySelectors:[".ignore-events"],builder:[{type:"fontFamily",fonts:d||[],useCloud:!0},{type:"fontSize",sizes:e.fontSize||[8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74]},{type:"horizonRule"},{type:"clearFormat"},{type:"bold"},{type:"strike"},{type:"italic"},{type:"underline"},{type:"table"},{type:"emoji"},{type:"unLink"},{type:"link"},{type:"customList"},{type:"numbered"},{type:"bullet"},{type:"backcolor"},{type:"fontColor"},{type:"direction"},{type:"justify"},{type:"right"},{type:"center"},{type:"left"},{type:"image"},{type:"mergeTags"},{type:"magic"}]}),f=o({name:t,id:i.id,template:c,defaultProps:{text:{},style:{}},draggable:{group:"element"},droppable:{group:"element"},resizeable:()=>c,handleBar:!0,validator:p({template:c,helpers:s,tiptap:y,composeId:i.id}),schema:i.schema,onSelect:e=>{c.classList.add(e)},onDeselect:e=>{c.classList.remove(e)},elementProps:i,remove:()=>{c.remove()},createEditor:r});return i.props.text.markdown&&y.chain().insertContent(" ").run(),f.addProp("tiptap",y),f}}}}}]);
|
|
Binary file
|