@creaditor/newsletter-starterkit 1.0.42 → 1.0.43

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.
@@ -0,0 +1,234 @@
1
+ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[1260],{91260(t,e,r){r.r(e),r.d(e,{BlockEditor:()=>h});var o=r(24586),i=r(59929),d=r(86319),n=r(9507),a=r(49937),s=r(83235);const c=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 p=r(9334),l=r(96374);const g=[{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"}}}}];r.e(4217).then(r.bind(r,94217));class h extends i.WF{constructor(t){super(),(0,o.A)(this,"onChangeBakgroundExpanding",t=>{const e=t.target.checked;n.Ay.store().execCommand("expand_image_for_outlook",!e)}),(0,o.A)(this,"getInnerBlocks",()=>{const t=[],e=this.component.parent("section");return e&&e.children.forEach(e=>{const r=d.M.get("components",e);r&&"block"===r.type&&t.push(r)}),t}),this.onChangeWidth=this.onChangeWidth.bind(this),this.getInnerBlocks=this.getInnerBlocks.bind(this),this.isBackgroundImage=!1,this.backgroundVideo="",this.galleryOpened=!1,this.onChangeBakgroundExpanding=this.onChangeBakgroundExpanding.bind(this),this.tabs=[{text:"background"},{text:"design",selected:!0},{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=d.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 r;if((0,s.A)(e)){const t=g.find(t=>"images"===t.type);t.preset.properties.src=e,r=t.preset}else if(function(t){const e=(/(?:\.([^.]+))?$/.exec(t.toLowerCase())??[])[1]??"";return-1!==c.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=g.find(t=>"video"===t.type);t.preset.properties.url=e,delete t.preset.properties.videoPath,r=t.preset}r&&(n.Ay.store().execCommand("background",JSON.parse(JSON.stringify(r))),n.Ay.store().execCommand("style",{background:null})),this.backgroundVideo=e},onChangeImage:t=>{const e=t.detail,r=[];Array.isArray(e)?e.forEach(t=>r.push(t.src)):r.push(e.src),this.cmds.onChangeBackgroundVideo({target:{value:r.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,r=t.target.direction;"all"===r?(n.Ay.store().execCommand("style",{marginTop:e+"px",marginBottom:e+"px"}),this.margin={topValue:e,bottomValue:e}):n.Ay.store().execCommand("style",{[(0,p.A)(`margin-${r.toLowerCase()}`)]:e+"px"})},onChangePadding:t=>{const e=t.target.value,r=t.target.direction,o=(0,p.A)(`padding-${r.toLowerCase()}`);"all"===r?(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",{[o]:e+"px",[`padding-${r.toLowerCase()}`]:null}),this.props.style={[o]:e+"px"},this[`padding${r.toLowerCase()}`]=e)},onChangebackground(t){const e=t.target.value;this.background=e;n.Ay.components.forEach(t=>{const r=t.find("text");if(r&&!r.closest("card")){let t=r.tiptap.getAttributes("textStyle").color;if(!t){const e=r.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 o=(0,l.w)(t,e);r.tiptap.chain().selectAll().setColor(o).run()}}}}),n.Ay.store().execCommand("style",{background:e,backgroundColor:null});"web"!==d.M.get("config","channel")&&n.Ay.store().execCommand("background",null)}}}onChangeImageBackgroundProp(t){const e=t.detail,{key:r,value:o}=e;if(this.props.background){const t=JSON.parse(JSON.stringify(this.props.background)),e=t.properties;if(!e.style[r])throw new Error(`${r} is not a valid property`);e.style[r]=o,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 r=this.getInnerBlocks();n.Ay.store().execCommand2({transactions:[{key:"style",value:{width:e+"px",maxWidth:"100%"}}],update:[...r]}),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 r=t.props.background;if(this.isBackgroundImage="images"===r?.type,this.noResponsive=!!t.props.noResponsive,this.isBackgroundImage){const t=r.properties;this.backgroundAttachment=t.style.backgroundAttachment,this.backgroundPosition=t.style.backgroundPosition,this.backgroundRepeat=t.style.backgroundRepeat,this.backgroundSize=t.style.backgroundSize}this.backgroundInstance=r,this.backgroundVideo=r?.properties?.src||r?.properties?.url||"";const o=t.element,i=window.getComputedStyle(o);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}render(){const t=d.M.get("config","channel");return i.qy`
2
+ <cdtr-editor-tabs .tabs=${this.tabs} @tabChanged=${this.changeTab}>
3
+ <div slot="content">
4
+ ${"background"===this.tabName?i.qy` <cdtr-editor-container>
5
+ <cdtr-row justify="space-between">
6
+ <cdtr-col sm="5"
7
+ ><paper-button
8
+ class="gallery"
9
+ raised
10
+ @click=${()=>this.galleryOpened=!0}
11
+ ><lang-text
12
+ text="openGalleryImage"
13
+ ></lang-text></paper-button
14
+ ></cdtr-col>
15
+ <cdtr-col sm="5">
16
+ <paper-button
17
+ class="backgrounds"
18
+ raised
19
+ @click=${()=>a.A.dispatch("open_add_menu",{type:"backgrounds",disabledOptions:!0,target:n.Ay.components[0]})}
20
+ ><lang-text
21
+ text="backgrounds"
22
+ ></lang-text></paper-button
23
+ ></cdtr-col>
24
+ </cdtr-row>
25
+ </cdtr-editor-container>
26
+ ${this.isBackgroundImage&&"web"===t?i.qy`<cdtr-editor-container>
27
+ <background-editor-plugin
28
+ backgroundAttachment=${this.backgroundAttachment}
29
+ backgroundPosition=${this.backgroundPosition}
30
+ backgroundRepeat=${this.backgroundRepeat}
31
+ backgroundSize=${this.backgroundSize}
32
+ @change=${this.onChangeImageBackgroundProp}
33
+ ></background-editor-plugin
34
+ ></cdtr-editor-container>`:null}
35
+ <cdtr-editor-container>
36
+ <cdtr-row>
37
+ <cdtr-title
38
+ ><lang-text
39
+ text="add_urlAddress_from_media_site"
40
+ ></lang-text
41
+ ></cdtr-title>
42
+ </cdtr-row>
43
+ <cdtr-row>
44
+ <cdtr-input
45
+ .value="${this.backgroundVideo}"
46
+ @input=${this.cmds.onChangeBackgroundVideo}
47
+ style="width:100%;direction:ltr;text-align:left;"
48
+ placeholder="https://"
49
+ ></cdtr-input>
50
+ ${"object"==typeof this.backgroundInstance&&this.backgroundInstance?.component?i.qy`<paper-button
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>
74
+ <cdtr-checkbox
75
+ @change=${t=>this.onChangeBakgroundExpanding(t)}
76
+ .checked=${this.expand_image_for_outlook}
77
+ >
78
+ <cdtr-title
79
+ ><lang-text text="expand_image_for_outlook"></lang-text
80
+ ></cdtr-title>
81
+ </cdtr-checkbox>
82
+ <h6>
83
+ <lang-text
84
+ whiteSpace="break-spaces"
85
+ text="expand_image_for_outlook_description"
86
+ ></lang-text>
87
+ </h6>
88
+ </cdtr-editor-container>
89
+ <cdtr-divider></cdtr-divider>`:null}
90
+ ${"design"===this.tabName?i.qy`
91
+ <cdtr-editor-container>
92
+ <cdtr-colorpicker-editor
93
+ .hasAlpha=${!1}
94
+ @change=${this.cmds.onChangebackground}
95
+ .value=${this.background}
96
+ text="backgroundColor"
97
+ ></cdtr-colorpicker-editor>
98
+ </cdtr-editor-container>
99
+ <cdtr-editor-container>
100
+ <cdtr-width-editor
101
+ text="width"
102
+ unit="px"
103
+ max="1000"
104
+ min="500"
105
+ .value="${this.width}"
106
+ @input=${this.onChangeWidth}
107
+ .sizes=${[{name:d.M.get("lang","recommended")||"recommended",value:600,default:!0},{name:d.M.get("lang","large")||"large",value:1e3}]}
108
+ ></cdtr-width-editor>
109
+ <p style="font-size:12px">
110
+ <lang-text whiteSpace="" text="email_600"></lang-text>
111
+ </p>
112
+ </cdtr-editor-container>
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>
133
+
134
+ <cdtr-divider></cdtr-divider>
135
+ <cdtr-editor-container>
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-container>
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>
157
+
158
+ <cdtr-editor-container>
159
+ <cdtr-border-editor
160
+ .borderStyle=${this.borderStyle}
161
+ .borderWidth=${this.borderWidth}
162
+ .borderColor=${this.borderColor}
163
+ .borderTopWidth=${this.borderTopWidth}
164
+ .borderBottomWidth=${this.borderBottomWidth}
165
+ .borderLeftWidth=${this.borderLeftWidth}
166
+ .borderRightWidth=${this.borderRightWidth}
167
+ .borderTopRightRadius=${this.borderTopRightRadius}
168
+ .borderTopLeftRadius=${this.borderTopLeftRadius}
169
+ .borderBottomRightRadius=${this.borderBottomRightRadius}
170
+ .borderBottomLeftRadius=${this.borderBottomLeftRadius}
171
+ @change=${this.cmds.onChangeBorderStyle}
172
+ ></cdtr-border-editor>
173
+ </cdtr-editor-container>
174
+ `:null}
175
+
176
+ <!-- ${"typography"===this.tabName?i.qy` <cdtr-text-editor-plugin></cdtr-text-editor-plugin> `:null} -->
177
+ <!-- ${"spacing"===this.tabName?i.qy`
178
+ <cdtr-editor-container>
179
+ <cdtr-row justify="center">
180
+ <cdtr-col sm="12"
181
+ ><cdtr-title style="display:block" class="align-lang"
182
+ ><lang-text text="padding"></lang-text></cdtr-title
183
+ ></cdtr-col>
184
+ <cdtr-col sm="6"
185
+ ><cdtr-spacing
186
+ .topValue="${this.padding.topValue}"
187
+ .bottomValue="${this.padding.bottomValue}"
188
+ .leftValue="${this.padding.leftValue}"
189
+ .rightValue="${this.padding.rightValue}"
190
+ isLock=${!1}
191
+ max="500"
192
+ @input=${this.cmds.onChangePadding}
193
+ ></cdtr-spacing
194
+ ></cdtr-col>
195
+ </cdtr-row>
196
+ </cdtr-editor-container>
197
+ <cdtr-editor-container>
198
+ <cdtr-row justify="center">
199
+ <cdtr-col sm="12"
200
+ ><cdtr-title style="display:block" class="align-lang"
201
+ ><lang-text text="margin"></lang-text></cdtr-title
202
+ ></cdtr-col>
203
+ <cdtr-col sm="6"
204
+ ><cdtr-spacing
205
+ .topValue=${this.margin.topValue}
206
+ .bottomValue=${this.margin.bottomValue}
207
+ isLock=${!1}
208
+ max="500"
209
+ .hasLeft=${!1}
210
+ .hasRight=${!1}
211
+ @input=${this.cmds.onChangeMargin}
212
+ ></cdtr-spacing
213
+ ></cdtr-col>
214
+ </cdtr-row>
215
+ </cdtr-editor-container>
216
+ `:null} -->
217
+ </div>
218
+ </cdtr-editor-tabs>
219
+ <cdtr-gallery
220
+ .multi=${!0}
221
+ @close=${()=>{this.galleryOpened=!1}}
222
+ .opened=${this.galleryOpened}
223
+ @file=${this.cmds.onChangeImage}
224
+ ></cdtr-gallery>
225
+ `}}(0,o.A)(h,"styles",i.AH`
226
+ paper-button.gallery {
227
+ background: var(--primary);
228
+ color: var(--primary-text);
229
+ }
230
+ paper-button.backgrounds {
231
+ background: BLACK;
232
+ color: #fff;
233
+ }
234
+ `),(0,o.A)(h,"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",h)}}]);
Binary file
@@ -1,7 +1,7 @@
1
1
  "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[3521],{83521(t,e,i){i.r(e),i.d(e,{DesignFactory:()=>l});var o=i(24586),r=i(5441),n=i(59929),s=i(9507),d=i(18057),c=i(86319);i.e(8315).then(i.bind(i,68315));class l extends n.WF{constructor(){super(),this.lastEditor=null,c.M.set({injectEditor:t=>{this.injected=!0,this.lastEditor=this.editor,this.backToEditor=this.editor,this.editor=t}}),this.editor=n.qy`<cdtr-ilustration-preference
2
2
  width="200px"
3
3
  height="200px"
4
- ></cdtr-ilustration-preference>`,this.delayer=new d.A,this.connect=this.connect.bind(this),this.editors={block:{selector:"block-editor",load:()=>i.e(741).then(i.bind(i,60741)),component:null},no_editor:{selector:"cdtr-no-component",load:()=>i.e(8854).then(i.bind(i,68854)),component:null,attrs:{style:"margin:auto;display:block;max-width:150px;margin-top:30px;"}}},this.type=null,s.Ay.on("select",this.connect)}connect(t){let{editor:e}=t;if(!e)return;let i=e.type;if("string"!=typeof i)return;if(this.editor?.type===i)return;if(!this.editors[i]){const t=c.M.get("config","editor","configure","plugins");if(Array.isArray(t)){const e=t.find(t=>t.name===i);if(e&&"function"==typeof e.createEditor){this.editor=document.createElement("cdtr-editor-builder"),this.editor.type=i;const t=e.createEditor();return void(t&&(this.editor.editors=t.layout,t!==this.backToEditor&&this.lastEditor&&(this.lastEditor=null)))}}i="no_editor"}this.type=i;const o=(0,r.A)("div",null,(0,r.A)("cdtr-block-loader",null),(0,r.A)("cdtr-title",{style:"text-align:center;"},(0,r.A)("lang-text",{text:"please_wait_downloading_new_version"})));this.editors[i]&&!this.editors[i].component&&(this.editors[i].load().then(()=>{if(o.remove(),this.editors[i].attrs)for(const t in this.editors[i].attrs)if(Object.hasOwnProperty.call(this.editors[i].attrs,t)){const e=this.editors[i].attrs[t];this.editors[i].component[t]=e}}),this.editors[i].component=document.createElement(this.editors[i].selector),this.editors[i].component.appendChild(o)),this.editors[i].component&&(this.editor=this.editors[i].component)}goBack(){this.lastEditor&&(this.editor=this.lastEditor,this.lastEditor=null)}createRenderRoot(){return this}render(){return n.qy` ${this.lastEditor?n.qy` <cdtr-row justify="end">
4
+ ></cdtr-ilustration-preference>`,this.delayer=new d.A,this.connect=this.connect.bind(this),this.editors={block:{selector:"block-editor",load:()=>i.e(1260).then(i.bind(i,91260)),component:null},no_editor:{selector:"cdtr-no-component",load:()=>i.e(8854).then(i.bind(i,68854)),component:null,attrs:{style:"margin:auto;display:block;max-width:150px;margin-top:30px;"}}},this.type=null,s.Ay.on("select",this.connect)}connect(t){let{editor:e}=t;if(!e)return;let i=e.type;if("string"!=typeof i)return;if(this.editor?.type===i)return;if(!this.editors[i]){const t=c.M.get("config","editor","configure","plugins");if(Array.isArray(t)){const e=t.find(t=>t.name===i);if(e&&"function"==typeof e.createEditor){this.editor=document.createElement("cdtr-editor-builder"),this.editor.type=i;const t=e.createEditor();return void(t&&(this.editor.editors=t.layout,t!==this.backToEditor&&this.lastEditor&&(this.lastEditor=null)))}}i="no_editor"}this.type=i;const o=(0,r.A)("div",null,(0,r.A)("cdtr-block-loader",null),(0,r.A)("cdtr-title",{style:"text-align:center;"},(0,r.A)("lang-text",{text:"please_wait_downloading_new_version"})));this.editors[i]&&!this.editors[i].component&&(this.editors[i].load().then(()=>{if(o.remove(),this.editors[i].attrs)for(const t in this.editors[i].attrs)if(Object.hasOwnProperty.call(this.editors[i].attrs,t)){const e=this.editors[i].attrs[t];this.editors[i].component[t]=e}}),this.editors[i].component=document.createElement(this.editors[i].selector),this.editors[i].component.appendChild(o)),this.editors[i].component&&(this.editor=this.editors[i].component)}goBack(){this.lastEditor&&(this.editor=this.lastEditor,this.lastEditor=null)}createRenderRoot(){return this}render(){return n.qy` ${this.lastEditor?n.qy` <cdtr-row justify="end">
5
5
  <paper-button
6
6
  @click=${this.goBack}
7
7
  style="margin:.5rem 0;padding:0;min-width:0;direction:var(--direction-locale);"
Binary file