@creaditor/web-starterkit 1.0.6 → 1.0.7
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 +260 -128
- 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/1529.creaditor.bundle.js +1 -1
- package/dist/1529.creaditor.bundle.js.gz +0 -0
- package/dist/1565.creaditor.bundle.js +237 -73
- package/dist/1565.creaditor.bundle.js.gz +0 -0
- package/dist/170.creaditor.bundle.js +11 -5
- package/dist/170.creaditor.bundle.js.gz +0 -0
- package/dist/2384.creaditor.bundle.js +33 -17
- package/dist/2384.creaditor.bundle.js.gz +0 -0
- package/dist/2590.creaditor.bundle.js +1 -2
- package/dist/2590.creaditor.bundle.js.gz +0 -0
- package/dist/3095.creaditor.bundle.js +91 -58
- package/dist/3095.creaditor.bundle.js.gz +0 -0
- package/dist/3521.creaditor.bundle.js +11 -9
- package/dist/3521.creaditor.bundle.js.gz +0 -0
- package/dist/3553.creaditor.bundle.js +1 -1
- package/dist/3553.creaditor.bundle.js.gz +0 -0
- package/dist/3932.creaditor.bundle.js +3 -3
- package/dist/3932.creaditor.bundle.js.gz +0 -0
- package/dist/4114.creaditor.bundle.js +1 -0
- package/dist/4114.creaditor.bundle.js.gz +0 -0
- package/dist/453.creaditor.bundle.js +1 -1
- package/dist/453.creaditor.bundle.js.gz +0 -0
- package/dist/4569.creaditor.bundle.js +141 -108
- package/dist/4569.creaditor.bundle.js.gz +0 -0
- package/dist/4819.creaditor.bundle.js +198 -235
- package/dist/4819.creaditor.bundle.js.gz +0 -0
- package/dist/5119.creaditor.bundle.js +1 -1
- package/dist/5119.creaditor.bundle.js.gz +0 -0
- package/dist/5340.creaditor.bundle.js +125 -36
- package/dist/5340.creaditor.bundle.js.gz +0 -0
- package/dist/5926.creaditor.bundle.js +24 -31
- package/dist/5926.creaditor.bundle.js.gz +0 -0
- package/dist/6937.creaditor.bundle.js +1 -0
- package/dist/6937.creaditor.bundle.js.gz +0 -0
- package/dist/7209.creaditor.bundle.js +2 -3
- package/dist/7209.creaditor.bundle.js.gz +0 -0
- package/dist/7238.creaditor.bundle.js +3 -3
- package/dist/7238.creaditor.bundle.js.gz +0 -0
- package/dist/752.creaditor.bundle.js +3 -7
- package/dist/752.creaditor.bundle.js.gz +0 -0
- package/dist/7937.creaditor.bundle.js +63 -115
- package/dist/7937.creaditor.bundle.js.gz +0 -0
- package/dist/8196.creaditor.bundle.js +51 -0
- package/dist/8196.creaditor.bundle.js.gz +0 -0
- package/dist/8305.creaditor.bundle.js +6 -6
- package/dist/8305.creaditor.bundle.js.gz +0 -0
- package/dist/8478.creaditor.bundle.js +1 -0
- package/dist/8478.creaditor.bundle.js.gz +0 -0
- package/dist/8516.creaditor.bundle.js +1 -1
- package/dist/8516.creaditor.bundle.js.gz +0 -0
- package/dist/8676.creaditor.bundle.js +1 -0
- package/dist/8676.creaditor.bundle.js.gz +0 -0
- package/dist/8916.creaditor.bundle.js +4 -4
- package/dist/8916.creaditor.bundle.js.gz +0 -0
- package/dist/9041.creaditor.bundle.js +1 -1
- package/dist/9041.creaditor.bundle.js.gz +0 -0
- package/dist/9162.creaditor.bundle.js +4 -3
- package/dist/9162.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 +1683 -558
- 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,76 +1,68 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[1260],{91260(t,e,
|
|
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("section");return e&&e.children.forEach(e=>{const o=i.M.get("components",e);o&&"block"===o.type&&t.push(o)}),t},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.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}_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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
4
|
+
<div style="display:flex;justify-content:flex-start;padding:12px 16px 4px;">
|
|
5
|
+
<span
|
|
6
|
+
@click=${()=>this._onToggleAll()}
|
|
7
|
+
@mouseover=${t=>{t.currentTarget.style.color="#333",t.currentTarget.style.textDecoration="underline"}}
|
|
8
|
+
@mouseout=${t=>{t.currentTarget.style.color="#555",t.currentTarget.style.textDecoration="none"}}
|
|
9
|
+
style="display:inline-flex;align-items:center;gap:3px;font-size:12px;color:#555;cursor:pointer;font-family:inherit;"
|
|
10
|
+
>
|
|
11
|
+
<lang-text text=${this._sectionsExpanded?"collapse_all":"expand_all"}></lang-text>
|
|
12
|
+
<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
13
|
+
<polyline points="7 8 12 3 17 8"></polyline>
|
|
14
|
+
<polyline points="7 16 12 21 17 16"></polyline>
|
|
15
|
+
</svg>
|
|
16
|
+
</span>
|
|
17
|
+
</div>
|
|
18
|
+
${"background"===this.tabName?r.qy`
|
|
19
|
+
<cdtr-editor-section label="backgroundColor" .open=${!0}>
|
|
20
|
+
<cdtr-color-swatch-group
|
|
21
|
+
.columns=${1}
|
|
22
|
+
.items=${[{title:"backgroundColor",allowGradient:"web"===t,value:this.background||"#ffffff",onChange:t=>this.cmds.onChangebackground(t)}]}
|
|
23
|
+
></cdtr-color-swatch-group>
|
|
24
|
+
</cdtr-editor-section>
|
|
25
|
+
|
|
26
|
+
<cdtr-editor-section label="backgrounds" .open=${!0}>
|
|
27
|
+
<div style="display:flex;gap:8px;">
|
|
28
|
+
<paper-button
|
|
29
|
+
class="gallery"
|
|
30
|
+
@click=${()=>this.galleryOpened=!0}
|
|
31
|
+
><lang-text
|
|
32
|
+
text="openGalleryImage"
|
|
33
|
+
></lang-text></paper-button>
|
|
34
|
+
<paper-button
|
|
35
|
+
class="backgrounds"
|
|
36
|
+
@click=${()=>a.A.dispatch("open_add_menu",{type:"backgrounds",disabledOptions:!0,target:n.Ay.components[0]})}
|
|
37
|
+
><lang-text
|
|
38
|
+
text="backgrounds"
|
|
39
|
+
></lang-text></paper-button>
|
|
40
|
+
</div>
|
|
41
|
+
${this.isBackgroundImage&&"web"===t?r.qy`<background-editor-plugin
|
|
42
|
+
style="margin-top:8px;"
|
|
28
43
|
backgroundAttachment=${this.backgroundAttachment}
|
|
29
44
|
backgroundPosition=${this.backgroundPosition}
|
|
30
45
|
backgroundRepeat=${this.backgroundRepeat}
|
|
31
46
|
backgroundSize=${this.backgroundSize}
|
|
32
47
|
@change=${this.onChangeImageBackgroundProp}
|
|
33
|
-
></background-editor-plugin
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
style=" font-size: 13px;
|
|
52
|
-
padding: 0;
|
|
53
|
-
text-align: var(--text-align-locale);
|
|
54
|
-
direction: var(--direction-locale);
|
|
55
|
-
justify-content: flex-start;
|
|
56
|
-
color:red;
|
|
57
|
-
margin: 0;"
|
|
58
|
-
@click=${this.cmds.onRemoveBackgroundVideo}
|
|
59
|
-
><lang-text text="remove_background_movie"></lang-text
|
|
60
|
-
></paper-button>`:null}
|
|
61
|
-
</cdtr-row>
|
|
62
|
-
</cdtr-editor-container>
|
|
63
|
-
<cdtr-divider></cdtr-divider>
|
|
64
|
-
<cdtr-editor-container>
|
|
65
|
-
<cdtr-colorpicker-editor
|
|
66
|
-
.hasAlpha=${"web"===t}
|
|
67
|
-
@change=${this.cmds.onChangebackground}
|
|
68
|
-
.value=${this.background}
|
|
69
|
-
text="backgroundColor"
|
|
70
|
-
></cdtr-colorpicker-editor>
|
|
71
|
-
</cdtr-editor-container>
|
|
72
|
-
<cdtr-divider></cdtr-divider>
|
|
73
|
-
<cdtr-editor-container>
|
|
48
|
+
></background-editor-plugin>`:null}
|
|
49
|
+
</cdtr-editor-section>
|
|
50
|
+
|
|
51
|
+
<cdtr-editor-section label="add_urlAddress_from_media_site" .open=${!1}>
|
|
52
|
+
<cdtr-input
|
|
53
|
+
.value="${this.backgroundVideo}"
|
|
54
|
+
@input=${this.cmds.onChangeBackgroundVideo}
|
|
55
|
+
style="width:100%;direction:ltr;text-align:left;"
|
|
56
|
+
placeholder="https://"
|
|
57
|
+
></cdtr-input>
|
|
58
|
+
${"object"==typeof this.backgroundInstance&&this.backgroundInstance?.component?r.qy`<paper-button
|
|
59
|
+
style="font-size:12px;padding:0;text-align:var(--text-align-locale);direction:var(--direction-locale);justify-content:flex-start;color:red;margin:4px 0 0;text-transform:none;"
|
|
60
|
+
@click=${this.cmds.onRemoveBackgroundVideo}
|
|
61
|
+
><lang-text text="remove_background_movie"></lang-text
|
|
62
|
+
></paper-button>`:null}
|
|
63
|
+
</cdtr-editor-section>
|
|
64
|
+
|
|
65
|
+
<cdtr-editor-section label="settings" .open=${!1}>
|
|
74
66
|
<cdtr-checkbox
|
|
75
67
|
@change=${t=>this.onChangeBakgroundExpanding(t)}
|
|
76
68
|
.checked=${this.expand_image_for_outlook}
|
|
@@ -85,18 +77,16 @@
|
|
|
85
77
|
text="expand_image_for_outlook_description"
|
|
86
78
|
></lang-text>
|
|
87
79
|
</h6>
|
|
88
|
-
</cdtr-editor-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
.
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
</cdtr-editor-container>
|
|
99
|
-
<cdtr-editor-container>
|
|
80
|
+
</cdtr-editor-section>`:null}
|
|
81
|
+
${"design"===this.tabName?r.qy`
|
|
82
|
+
<cdtr-editor-section label="backgroundColor" .open=${!0}>
|
|
83
|
+
<cdtr-color-swatch-group
|
|
84
|
+
.columns=${1}
|
|
85
|
+
.items=${[{title:"backgroundColor",allowGradient:"web"===t,value:this.background||"#ffffff",onChange:t=>this.cmds.onChangebackground(t)}]}
|
|
86
|
+
></cdtr-color-swatch-group>
|
|
87
|
+
</cdtr-editor-section>
|
|
88
|
+
|
|
89
|
+
<cdtr-editor-section label="width" .open=${!0}>
|
|
100
90
|
<cdtr-width-editor
|
|
101
91
|
text="width"
|
|
102
92
|
unit="px"
|
|
@@ -109,53 +99,23 @@
|
|
|
109
99
|
<p style="font-size:12px">
|
|
110
100
|
<lang-text whiteSpace="" text="email_600"></lang-text>
|
|
111
101
|
</p>
|
|
112
|
-
</cdtr-editor-
|
|
113
|
-
<cdtr-divider></cdtr-divider>
|
|
114
|
-
<cdtr-editor-container>
|
|
115
|
-
<cdtr-row justify="center">
|
|
116
|
-
<cdtr-col sm="12"
|
|
117
|
-
><cdtr-title style="display:block" class="align-lang"
|
|
118
|
-
><lang-text text="padding"></lang-text></cdtr-title
|
|
119
|
-
></cdtr-col>
|
|
120
|
-
<cdtr-col sm="6"
|
|
121
|
-
><cdtr-spacing
|
|
122
|
-
.topValue="${this.padding.topValue}"
|
|
123
|
-
.bottomValue="${this.padding.bottomValue}"
|
|
124
|
-
.leftValue="${this.padding.leftValue}"
|
|
125
|
-
.rightValue="${this.padding.rightValue}"
|
|
126
|
-
isLock=${!1}
|
|
127
|
-
max="500"
|
|
128
|
-
@input=${this.cmds.onChangePadding}
|
|
129
|
-
></cdtr-spacing
|
|
130
|
-
></cdtr-col>
|
|
131
|
-
</cdtr-row>
|
|
132
|
-
</cdtr-editor-container>
|
|
102
|
+
</cdtr-editor-section>
|
|
133
103
|
|
|
134
|
-
<cdtr-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
.checked="${this.noResponsive}"
|
|
146
|
-
></cdtr-checkbox>
|
|
147
|
-
</cdtr-col>
|
|
104
|
+
<cdtr-editor-section label="padding" .open=${!0}>
|
|
105
|
+
<cdtr-row justify="center">
|
|
106
|
+
<cdtr-spacing
|
|
107
|
+
.topValue="${this.padding.topValue}"
|
|
108
|
+
.bottomValue="${this.padding.bottomValue}"
|
|
109
|
+
.leftValue="${this.padding.leftValue}"
|
|
110
|
+
.rightValue="${this.padding.rightValue}"
|
|
111
|
+
isLock=${!1}
|
|
112
|
+
max="500"
|
|
113
|
+
@input=${this.cmds.onChangePadding}
|
|
114
|
+
></cdtr-spacing>
|
|
148
115
|
</cdtr-row>
|
|
149
|
-
</cdtr-editor-
|
|
150
|
-
<!-- <cdtr-divider></cdtr-divider>
|
|
151
|
-
<cdtr-editor-container>
|
|
152
|
-
<cdtr-radius-editor
|
|
153
|
-
@input=${this.cmds.onchangeRadius}
|
|
154
|
-
></cdtr-radius-editor>
|
|
155
|
-
</cdtr-editor-container> -->
|
|
156
|
-
<cdtr-divider></cdtr-divider>
|
|
116
|
+
</cdtr-editor-section>
|
|
157
117
|
|
|
158
|
-
<cdtr-editor-
|
|
118
|
+
<cdtr-editor-section label="border_design" .open=${!1}>
|
|
159
119
|
<cdtr-border-editor
|
|
160
120
|
.borderStyle=${this.borderStyle}
|
|
161
121
|
.borderWidth=${this.borderWidth}
|
|
@@ -170,11 +130,27 @@
|
|
|
170
130
|
.borderBottomLeftRadius=${this.borderBottomLeftRadius}
|
|
171
131
|
@change=${this.cmds.onChangeBorderStyle}
|
|
172
132
|
></cdtr-border-editor>
|
|
173
|
-
</cdtr-editor-
|
|
133
|
+
</cdtr-editor-section>
|
|
134
|
+
|
|
135
|
+
<cdtr-editor-section label="settings" .open=${!1}>
|
|
136
|
+
<cdtr-row alignItems="center" justify="space-between">
|
|
137
|
+
<cdtr-col>
|
|
138
|
+
<cdtr-title>
|
|
139
|
+
<lang-text text="no_responsive"></lang-text>
|
|
140
|
+
</cdtr-title>
|
|
141
|
+
</cdtr-col>
|
|
142
|
+
<cdtr-col sm="1">
|
|
143
|
+
<cdtr-checkbox
|
|
144
|
+
@change=${this.cmds.toggleResponsive}
|
|
145
|
+
.checked="${this.noResponsive}"
|
|
146
|
+
></cdtr-checkbox>
|
|
147
|
+
</cdtr-col>
|
|
148
|
+
</cdtr-row>
|
|
149
|
+
</cdtr-editor-section>
|
|
174
150
|
`:null}
|
|
175
151
|
|
|
176
|
-
<!-- ${"typography"===this.tabName?
|
|
177
|
-
<!-- ${"spacing"===this.tabName?
|
|
152
|
+
<!-- ${"typography"===this.tabName?r.qy` <cdtr-text-editor-plugin></cdtr-text-editor-plugin> `:null} -->
|
|
153
|
+
<!-- ${"spacing"===this.tabName?r.qy`
|
|
178
154
|
<cdtr-editor-container>
|
|
179
155
|
<cdtr-row justify="center">
|
|
180
156
|
<cdtr-col sm="12"
|
|
@@ -222,13 +198,169 @@
|
|
|
222
198
|
.opened=${this.galleryOpened}
|
|
223
199
|
@file=${this.cmds.onChangeImage}
|
|
224
200
|
></cdtr-gallery>
|
|
225
|
-
`}}g.styles=
|
|
201
|
+
`}}g.styles=r.AH`
|
|
202
|
+
paper-button.gallery,
|
|
203
|
+
paper-button.backgrounds {
|
|
204
|
+
text-transform: none;
|
|
205
|
+
font-size: 12.5px;
|
|
206
|
+
font-weight: 500;
|
|
207
|
+
letter-spacing: 0.01em;
|
|
208
|
+
border-radius: 6px;
|
|
209
|
+
padding: 6px 12px;
|
|
210
|
+
min-width: 0;
|
|
211
|
+
}
|
|
226
212
|
paper-button.gallery {
|
|
227
213
|
background: var(--primary);
|
|
228
214
|
color: var(--primary-text);
|
|
229
215
|
}
|
|
230
216
|
paper-button.backgrounds {
|
|
231
|
-
background:
|
|
217
|
+
background: #333;
|
|
232
218
|
color: #fff;
|
|
233
219
|
}
|
|
234
|
-
`,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}},customElements.define("block-editor",g)}}]);
|
|
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`
|
|
221
|
+
<div class="${t}">
|
|
222
|
+
${(this.items||[]).map((t,e)=>r.qy`
|
|
223
|
+
<div class="swatch-item" @click=${()=>this.openPicker(e)}>
|
|
224
|
+
<div
|
|
225
|
+
class="swatch-circle"
|
|
226
|
+
style="background: ${t.value||"#fff"}"
|
|
227
|
+
></div>
|
|
228
|
+
<span class="swatch-label">
|
|
229
|
+
<lang-text text="${t.title}"></lang-text>
|
|
230
|
+
</span>
|
|
231
|
+
<div class="hidden-picker">
|
|
232
|
+
<cdtr-colorpicker-editor
|
|
233
|
+
id="picker-${e}"
|
|
234
|
+
.hasAlpha=${!1}
|
|
235
|
+
.allowGradient=${!0===t.allowGradient}
|
|
236
|
+
@change=${t.onChange}
|
|
237
|
+
.value=${t.value}
|
|
238
|
+
text="${t.title}"
|
|
239
|
+
></cdtr-colorpicker-editor>
|
|
240
|
+
</div>
|
|
241
|
+
</div>
|
|
242
|
+
`)}
|
|
243
|
+
</div>
|
|
244
|
+
`}}n.styles=[i.L,r.AH`
|
|
245
|
+
:host {
|
|
246
|
+
display: block;
|
|
247
|
+
direction: var(--direction-locale, ltr);
|
|
248
|
+
}
|
|
249
|
+
.grid {
|
|
250
|
+
display: grid;
|
|
251
|
+
grid-template-columns: 1fr 1fr;
|
|
252
|
+
gap: 6px;
|
|
253
|
+
}
|
|
254
|
+
.grid.single-col {
|
|
255
|
+
grid-template-columns: 1fr;
|
|
256
|
+
}
|
|
257
|
+
.swatch-item {
|
|
258
|
+
display: flex;
|
|
259
|
+
align-items: center;
|
|
260
|
+
gap: 8px;
|
|
261
|
+
padding: 8px 10px;
|
|
262
|
+
background: #f6f6f8;
|
|
263
|
+
border-radius: 8px;
|
|
264
|
+
cursor: pointer;
|
|
265
|
+
transition: background 0.15s ease;
|
|
266
|
+
min-width: 0;
|
|
267
|
+
overflow: hidden;
|
|
268
|
+
position: relative;
|
|
269
|
+
}
|
|
270
|
+
.swatch-item:hover {
|
|
271
|
+
background: #eeeff1;
|
|
272
|
+
}
|
|
273
|
+
.swatch-label {
|
|
274
|
+
font-size: 11px;
|
|
275
|
+
color: #555;
|
|
276
|
+
font-weight: 500;
|
|
277
|
+
line-height: 1;
|
|
278
|
+
white-space: nowrap;
|
|
279
|
+
overflow: hidden;
|
|
280
|
+
text-overflow: ellipsis;
|
|
281
|
+
min-width: 0;
|
|
282
|
+
flex: 1;
|
|
283
|
+
}
|
|
284
|
+
.hidden-picker {
|
|
285
|
+
position: absolute;
|
|
286
|
+
width: 1px;
|
|
287
|
+
height: 1px;
|
|
288
|
+
overflow: hidden;
|
|
289
|
+
clip: rect(0,0,0,0);
|
|
290
|
+
pointer-events: none;
|
|
291
|
+
}
|
|
292
|
+
`],n.properties={items:{type:Array},columns:{type:Number}},customElements.define("cdtr-color-swatch-group",n);const a=t=>r.qy`
|
|
293
|
+
<cdtr-color-swatch-group
|
|
294
|
+
.items=${t.items}
|
|
295
|
+
.columns=${t.columns||2}
|
|
296
|
+
></cdtr-color-swatch-group>
|
|
297
|
+
`},12258(t,e,o){o.d(e,{A:()=>n});var r=o(59929);class i extends r.WF{constructor(){super(),this.label="",this.open=!0}toggle(){this.open=!this.open}render(){return r.qy`
|
|
298
|
+
<div class="section">
|
|
299
|
+
<div class="header" @click=${this.toggle}>
|
|
300
|
+
<span class="title"><lang-text text="${this.label}"></lang-text></span>
|
|
301
|
+
<svg class="chevron ${this.open?"open":""}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
302
|
+
<polyline points="6 9 12 15 18 9"></polyline>
|
|
303
|
+
</svg>
|
|
304
|
+
</div>
|
|
305
|
+
<div class="content ${this.open?"open":""}">
|
|
306
|
+
<div class="content-inner">
|
|
307
|
+
<slot></slot>
|
|
308
|
+
</div>
|
|
309
|
+
</div>
|
|
310
|
+
</div>
|
|
311
|
+
`}}i.styles=r.AH`
|
|
312
|
+
:host {
|
|
313
|
+
display: block;
|
|
314
|
+
direction: var(--direction-locale, ltr);
|
|
315
|
+
--editor-container-inline-padding: 0;
|
|
316
|
+
}
|
|
317
|
+
.section {
|
|
318
|
+
border-bottom: 1px solid #eaeaee;
|
|
319
|
+
}
|
|
320
|
+
.header {
|
|
321
|
+
display: flex;
|
|
322
|
+
align-items: center;
|
|
323
|
+
justify-content: space-between;
|
|
324
|
+
padding: 12px 16px;
|
|
325
|
+
cursor: pointer;
|
|
326
|
+
user-select: none;
|
|
327
|
+
}
|
|
328
|
+
.title {
|
|
329
|
+
font-size: 12.5px;
|
|
330
|
+
font-weight: 600;
|
|
331
|
+
color: #222;
|
|
332
|
+
letter-spacing: 0.01em;
|
|
333
|
+
}
|
|
334
|
+
.chevron {
|
|
335
|
+
width: 16px;
|
|
336
|
+
height: 16px;
|
|
337
|
+
transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.15s ease;
|
|
338
|
+
color: #ccc;
|
|
339
|
+
}
|
|
340
|
+
.header:hover .chevron {
|
|
341
|
+
color: #888;
|
|
342
|
+
}
|
|
343
|
+
.chevron.open {
|
|
344
|
+
transform: rotate(180deg);
|
|
345
|
+
}
|
|
346
|
+
.content {
|
|
347
|
+
overflow: hidden;
|
|
348
|
+
transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
|
|
349
|
+
max-height: 0;
|
|
350
|
+
opacity: 0;
|
|
351
|
+
}
|
|
352
|
+
.content.open {
|
|
353
|
+
max-height: 1200px;
|
|
354
|
+
opacity: 1;
|
|
355
|
+
}
|
|
356
|
+
.content-inner {
|
|
357
|
+
padding: 0 16px 12px 16px;
|
|
358
|
+
}
|
|
359
|
+
`,i.properties={label:{type:String},open:{type:Boolean}},customElements.define("cdtr-editor-section",i);const n=(t,e)=>r.qy`
|
|
360
|
+
<cdtr-editor-section
|
|
361
|
+
.label=${t.label}
|
|
362
|
+
.open=${!1!==t.open}
|
|
363
|
+
>
|
|
364
|
+
${e}
|
|
365
|
+
</cdtr-editor-section>
|
|
366
|
+
`}}]);
|
|
Binary file
|
|
@@ -436,4 +436,4 @@
|
|
|
436
436
|
opacity: 0.3;
|
|
437
437
|
}
|
|
438
438
|
}
|
|
439
|
-
`,r=o))||r},71271(e,t,n){n.d(t,{default:()=>
|
|
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}}}}}]);
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[1529],{81529(e,t,s){s.r(t),s.d(t,{EditorBar:()=>l});var i=s(59929),n=s(49937),o=s(
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[1529],{81529(e,t,s){s.r(t),s.d(t,{EditorBar:()=>l});var i=s(59929),n=s(49937),o=s(36565),r=s(69600);const d=o.Ay;class l extends i.WF{constructor(){super(),this.opened=!1,this.offsetY=50,this.offsetX=0,this.reRender=this.reRender.bind(this)}reRender(){if(this.opened&&this.componentId){const e=d.getComponent(this.componentId);if(e&&e.element){const t=e.element.getBoundingClientRect();let s=t.top-this.offsetY;-1!==this.direction.indexOf("left")?this.left=t.left+this.offsetX+"px":this.left=t.left+t.width+"px",this.top=s+"px",-1!==this.direction.indexOf("bottom")&&(this.top=t.top-this.offsetY+t.height+20+"px")}}}render(){return this.opened?(this.style.display="",this.style.left=this.left,this.style.top=this.top,this.style.zIndex=(0,r.A)(),this.style.transform=`translate(${-1!==this.direction.indexOf("left")?"0":"100%"},${-1!==this.direction.indexOf("bottom")?"100%":"0"})`,i.qy` <slot></slot>`):(this.style.display="none",null)}disconnectedCallback(){super.disconnectedCallback(),n.A.unSubscribe("onScroll",this.reRender),d.off("update",this.reRender)}connectedCallback(){super.connectedCallback(),n.A.subscribe("onScroll",this.reRender),d.on("update",this.reRender),setTimeout(()=>{this.reRender()},0)}}l.styles=i.AH`
|
|
2
2
|
:host {
|
|
3
3
|
position: fixed;
|
|
4
4
|
border-radius: 2px;
|
|
Binary file
|