@creaditor/newsletter-starterkit 1.0.59 → 1.0.60

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,431 @@
1
+ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[8299],{68299(t,e,o){o.r(e),o.d(e,{BlockEditor:()=>g});var r=o(59929),a=o(86319),i=o(15604),n=o(49937),s=o(61084),d=o(30052),l=o(76151),c=o(9334),p=o(96374);const h=[{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);class g extends r.WF{constructor(t){super(),this.onChangeBakgroundExpanding=t=>{const e=t.target.checked;i.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=a.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.onChangeBakgroundExpanding=this.onChangeBakgroundExpanding.bind(this);const e=a.M.get("config","channel");this.tabs=[{text:"style",selected:!0},..."web"===e?[{text:"animations"}]:[],{text:"settings"}],this.tabName="style",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=a.M.get("theme"),this.connectWith=this.connectWith.bind(this),this.cmds={onchangeRadius:t=>{i.Ay.store().execCommand("style",{...t.target.json})},toggleResponsive:t=>{this.noResponsive=!t.target.checked,i.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;i.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})},onRemoveBackground:()=>{this.background="",this.backgroundVideo="",this.backgroundInstance={},i.Ay.store().execCommand("background",null),i.Ay.store().execCommand("style",{background:"",backgroundColor:null,backgroundImage:null})},onChangeBackgroundVideo:t=>{const e=t.target.value;let o;if((0,s.Zj)(e)){const t=h.find(t=>"images"===t.type);t.preset.properties.src=e,o=t.preset}else if((0,d.A)(e));else if((0,l.A)(e)){const t=h.find(t=>"video"===t.type);t.preset.properties.url=e,delete t.preset.properties.videoPath,o=t.preset}o&&(i.Ay.store().execCommand("background",JSON.parse(JSON.stringify(o))),i.Ay.store().execCommand("style",{background:null,backgroundColor: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;i.Ay.store().execCommand("style",{height:e+"%"}),this.height=e},onChangeMargin:t=>{const e=t.target.value,o=t.target.direction;"all"===o?(i.Ay.store().execCommand("style",{marginTop:e+"px",marginBottom:e+"px"}),this.margin={topValue:e,bottomValue:e}):i.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?(i.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}):(i.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;i.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,p.w)(t,e);o.tiptap.chain().selectAll().setColor(r).run()}}}}),i.Ay.store().execCommand("style",{background:e,backgroundColor:null});"web"!==a.M.get("config","channel")&&i.Ay.store().execCommand("background",null)}}}connectedCallback(){super.connectedCallback(),this.connectWith(),i.Ay.on("update",this.connectWith)}disconnectedCallback(){super.disconnectedCallback(),i.Ay.off("update",this.connectWith)}onChangeWidth(t){let e=t.target.value;e<500&&(e=500),e>1e3&&(e=1e3);const o=this.getInnerBlocks();i.Ay.store().execCommand2({transactions:[{key:"style",value:{width:e+"px",maxWidth:"100%"}}],update:[...o]}),this.maxWidth=e}connectWith(){const t=i.Ay.components[i.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;this.isBackgroundImage="images"===o?.type,this.noResponsive=!!t.props.noResponsive,this.modalable=!!t.props.modalable,this.modalName=t.props.modalName||"",this.popupTrigger=t.props.popupTrigger||"button",this.popupDelay=null==t.props.popupDelay?3:t.props.popupDelay,this._rebuildTabs(),this.backgroundInstance=o,this.backgroundVideo=o?.properties?.src||o?.properties?.url||"";const r=t.element,a=window.getComputedStyle(r);this.maxWidth=parseInt(a.width),this.width=parseInt(e.width,10)||this.maxWidth,this.background=e.background||e.backgroundImage||a.backgroundColor,e.backgroundImage&&(this.background=`url(${e.backgroundImage})`),this.padding={topValue:parseInt(a.paddingTop),bottomValue:parseInt(a.paddingBottom),leftValue:parseInt(a.paddingLeft),rightValue:parseInt(a.paddingRight)},this.margin={topValue:parseInt(a.marginTop),bottomValue:parseInt(a.marginBottom)}}}changeTab(t){this.tabName=t.target.value}_toggleModalable(t){this.modalable=t,i.Ay.store().execCommand("modalable",this.modalable),this.tabName=t?"popup":"style",this._rebuildTabs()}_rebuildTabs(){const t=a.M.get("config","channel"),e="web"===t&&this.modalable,o=[{text:"style"},..."web"===t?[{text:"animations"}]:[],{text:"settings"},...e?[{text:"popup"}]:[]];let r=this.tabName;o.some(t=>t.text===r)||(r=e?"popup":"style"),o.forEach(t=>t.selected=t.text===r),this.tabName=r,this.tabs=o}_setModalName(t){this.modalName=t,i.Ay.store().execCommand("modalName",t)}_setPopupTrigger(t){this.popupTrigger=t,i.Ay.store().execCommand("popupTrigger",t)}_setPopupDelay(t){const e=Math.max(0,parseInt(t,10)||0);this.popupDelay=e,i.Ay.store().execCommand("popupDelay",e)}_hasBackground(){if(this.backgroundInstance&&this.backgroundInstance.component)return!0;const t=(this.background||"").trim();return!!t&&"transparent"!==t&&"rgba(0, 0, 0, 0)"!==t&&"none"!==t}render(){const t=a.M.get("config","channel");return r.qy`
2
+ <cdtr-editor-tabs .tabs=${this.tabs} @tabChanged=${this.changeTab}>
3
+ <div slot="content">
4
+ ${"style"===this.tabName?r.qy`
5
+ <cdtr-editor-section .label=${"backgroundColor"} .open=${!0}>
6
+ <cdtr-color-swatch-group
7
+ .columns=${1}
8
+ .items=${[{title:"backgroundColor",allowGradient:"web"===t,value:this.background||"#ffffff",onChange:t=>this.cmds.onChangebackground(t)}]}
9
+ ></cdtr-color-swatch-group>
10
+ </cdtr-editor-section>
11
+
12
+ <cdtr-editor-section .label=${"backgrounds"} .open=${!0}>
13
+ <cdtr-background-panel
14
+ .background=${this.backgroundInstance}
15
+ .channel=${t}
16
+ .opacity=${this.props?.opacity??1}
17
+ .canRemove=${this._hasBackground()}
18
+ .src=${this.backgroundVideo}
19
+ .onOpenGallery=${()=>this.galleryOpened=!0}
20
+ .onChangeSrc=${t=>this.cmds.onChangeBackgroundVideo({target:{value:t}})}
21
+ .onOpenCatalog=${()=>n.A.dispatch("open_add_menu",{type:"backgrounds",disabledOptions:!0,target:i.Ay.components[0]})}
22
+ .onPatchStyle=${t=>i.Ay.store().execCommand("background",(0,s.MC)(this.backgroundInstance,t))}
23
+ .onOpacity=${t=>i.Ay.store().execCommand("opacity",t)}
24
+ .onRemove=${this.cmds.onRemoveBackground}
25
+ ></cdtr-background-panel>
26
+ </cdtr-editor-section>
27
+
28
+ <!-- Distinct from the "layout_behavior" section further down:
29
+ this one is strictly about how the background renders in
30
+ email clients. Both used to be labelled "settings", which
31
+ read as a duplicate and gave the two groups the same
32
+ persistence key shape. -->
33
+ <cdtr-editor-section .label=${"email_compatibility"} .open=${!1}>
34
+ <cdtr-checkbox
35
+ @change=${t=>this.onChangeBakgroundExpanding(t)}
36
+ .checked=${this.expand_image_for_outlook}
37
+ >
38
+ <cdtr-title
39
+ ><lang-text text="expand_image_for_outlook"></lang-text
40
+ ></cdtr-title>
41
+ </cdtr-checkbox>
42
+ <h6>
43
+ <lang-text
44
+ whiteSpace="break-spaces"
45
+ text="expand_image_for_outlook_description"
46
+ ></lang-text>
47
+ </h6>
48
+ </cdtr-editor-section>`:null}
49
+ ${"style"===this.tabName?r.qy`
50
+ <cdtr-editor-section .label=${"width"} .open=${!0}>
51
+ <cdtr-width-editor
52
+ text="width"
53
+ unit="px"
54
+ max="1000"
55
+ min="500"
56
+ .value="${this.width}"
57
+ @input=${this.onChangeWidth}
58
+ .sizes=${[{name:a.M.get("lang","recommended")||"recommended",value:600,default:!0},{name:a.M.get("lang","large")||"large",value:1e3}]}
59
+ ></cdtr-width-editor>
60
+ <p style="font-size:12px">
61
+ <lang-text whiteSpace="" text="email_600"></lang-text>
62
+ </p>
63
+ </cdtr-editor-section>
64
+
65
+ <cdtr-editor-section .label=${"padding"} .open=${!0}>
66
+ <cdtr-row justify="center">
67
+ <cdtr-spacing
68
+ .topValue="${this.padding.topValue}"
69
+ .bottomValue="${this.padding.bottomValue}"
70
+ .leftValue="${this.padding.leftValue}"
71
+ .rightValue="${this.padding.rightValue}"
72
+ isLock=${!1}
73
+ max="500"
74
+ @input=${this.cmds.onChangePadding}
75
+ ></cdtr-spacing>
76
+ </cdtr-row>
77
+ </cdtr-editor-section>
78
+
79
+ <cdtr-editor-section .label=${"border_design"} .open=${!1}>
80
+ <cdtr-border-editor
81
+ .borderStyle=${this.borderStyle}
82
+ .borderWidth=${this.borderWidth}
83
+ .borderColor=${this.borderColor}
84
+ .borderTopWidth=${this.borderTopWidth}
85
+ .borderBottomWidth=${this.borderBottomWidth}
86
+ .borderLeftWidth=${this.borderLeftWidth}
87
+ .borderRightWidth=${this.borderRightWidth}
88
+ .borderTopRightRadius=${this.borderTopRightRadius}
89
+ .borderTopLeftRadius=${this.borderTopLeftRadius}
90
+ .borderBottomRightRadius=${this.borderBottomRightRadius}
91
+ .borderBottomLeftRadius=${this.borderBottomLeftRadius}
92
+ @change=${this.cmds.onChangeBorderStyle}
93
+ ></cdtr-border-editor>
94
+ </cdtr-editor-section>
95
+
96
+ <cdtr-editor-section .label=${"layout_behavior"} .open=${!1}>
97
+ <cdtr-row alignItems="center" justify="space-between">
98
+ <cdtr-col>
99
+ <cdtr-title>
100
+ <lang-text text="no_responsive"></lang-text>
101
+ </cdtr-title>
102
+ </cdtr-col>
103
+ <cdtr-col sm="1">
104
+ <cdtr-checkbox
105
+ @change=${this.cmds.toggleResponsive}
106
+ .checked="${this.noResponsive}"
107
+ ></cdtr-checkbox>
108
+ </cdtr-col>
109
+ </cdtr-row>
110
+ ${"web"===t?r.qy`
111
+ <cdtr-row alignItems="center" justify="space-between">
112
+ <cdtr-col
113
+ style="cursor:pointer"
114
+ @click=${()=>this._toggleModalable(!this.modalable)}
115
+ >
116
+ <cdtr-tooltip content="modal_hidden_on_view">
117
+ <cdtr-title>
118
+ <lang-text text="mark_as_modal"></lang-text>
119
+ </cdtr-title>
120
+ </cdtr-tooltip>
121
+ </cdtr-col>
122
+ <cdtr-col sm="1">
123
+ <cdtr-checkbox
124
+ @change=${t=>this._toggleModalable(!t.target.checked)}
125
+ .checked="${this.modalable}"
126
+ ></cdtr-checkbox>
127
+ </cdtr-col>
128
+ </cdtr-row>
129
+ ${this.modalable?r.qy`<p
130
+ style="font-size:12px;color:#888;line-height:1.5;margin:6px 0 0;font-style:italic;"
131
+ >
132
+ <lang-text
133
+ whiteSpace="normal"
134
+ text="popup_settings_in_tab"
135
+ ></lang-text>
136
+ </p>`:null}
137
+ `:null}
138
+ </cdtr-editor-section>
139
+ `:null}
140
+
141
+ ${"popup"===this.tabName?r.qy`
142
+ <cdtr-editor-section .label=${"modal_name"} .open=${!0}>
143
+ <cdtr-input
144
+ style="width:100%"
145
+ .value=${this.modalName||""}
146
+ .placeholder=${a.M.get("lang","modal_name")||""}
147
+ @change=${t=>this._setModalName(t.target.value)}
148
+ ></cdtr-input>
149
+ </cdtr-editor-section>
150
+
151
+ <cdtr-editor-section .label=${"popup_trigger_label"} .open=${!0}>
152
+ <select
153
+ style="width:100%;padding:8px;border:1px solid var(--color-border,#e0e0e0);border-radius:8px;font:inherit;background:#fff;cursor:pointer;"
154
+ @change=${t=>this._setPopupTrigger(t.target.value)}
155
+ >
156
+ ${["button","load","delay","exit"].map(t=>r.qy`<option
157
+ value=${t}
158
+ ?selected=${this.popupTrigger===t}
159
+ >
160
+ ${a.M.get("lang","popup_trigger_"+t)||t}
161
+ </option>`)}
162
+ </select>
163
+ ${"delay"===this.popupTrigger?r.qy`
164
+ <cdtr-title style="display:block;margin-top:8px">
165
+ <lang-text text="popup_delay_label"></lang-text>
166
+ </cdtr-title>
167
+ <input
168
+ type="number"
169
+ min="0"
170
+ style="width:100%;padding:8px;border:1px solid var(--color-border,#e0e0e0);border-radius:8px;font:inherit;box-sizing:border-box;"
171
+ .value=${String(this.popupDelay)}
172
+ @change=${t=>this._setPopupDelay(t.target.value)}
173
+ />
174
+ `:null}
175
+ <p
176
+ style="font-size:12px;color:#888;line-height:1.5;margin:8px 0 0;font-style:italic;"
177
+ >
178
+ <lang-text
179
+ whiteSpace="normal"
180
+ text="modal_name_hint"
181
+ ></lang-text>
182
+ </p>
183
+ </cdtr-editor-section>
184
+ `:null}
185
+
186
+ <!-- ${"typography"===this.tabName?r.qy` <cdtr-text-editor-plugin></cdtr-text-editor-plugin> `:null} -->
187
+ <!-- ${"spacing"===this.tabName?r.qy`
188
+ <cdtr-editor-container>
189
+ <cdtr-row justify="center">
190
+ <cdtr-col sm="12"
191
+ ><cdtr-title style="display:block" class="align-lang"
192
+ ><lang-text text="padding"></lang-text></cdtr-title
193
+ ></cdtr-col>
194
+ <cdtr-col sm="6"
195
+ ><cdtr-spacing
196
+ .topValue="${this.padding.topValue}"
197
+ .bottomValue="${this.padding.bottomValue}"
198
+ .leftValue="${this.padding.leftValue}"
199
+ .rightValue="${this.padding.rightValue}"
200
+ isLock=${!1}
201
+ max="500"
202
+ @input=${this.cmds.onChangePadding}
203
+ ></cdtr-spacing
204
+ ></cdtr-col>
205
+ </cdtr-row>
206
+ </cdtr-editor-container>
207
+ <cdtr-editor-container>
208
+ <cdtr-row justify="center">
209
+ <cdtr-col sm="12"
210
+ ><cdtr-title style="display:block" class="align-lang"
211
+ ><lang-text text="margin"></lang-text></cdtr-title
212
+ ></cdtr-col>
213
+ <cdtr-col sm="6"
214
+ ><cdtr-spacing
215
+ .topValue=${this.margin.topValue}
216
+ .bottomValue=${this.margin.bottomValue}
217
+ isLock=${!1}
218
+ max="500"
219
+ .hasLeft=${!1}
220
+ .hasRight=${!1}
221
+ @input=${this.cmds.onChangeMargin}
222
+ ></cdtr-spacing
223
+ ></cdtr-col>
224
+ </cdtr-row>
225
+ </cdtr-editor-container>
226
+ `:null} -->
227
+ </div>
228
+ </cdtr-editor-tabs>
229
+ <cdtr-gallery
230
+ .multi=${!0}
231
+ @close=${()=>{this.galleryOpened=!1}}
232
+ .opened=${this.galleryOpened}
233
+ @file=${this.cmds.onChangeImage}
234
+ ></cdtr-gallery>
235
+ `}}g.styles=r.AH`
236
+ paper-button.gallery,
237
+ paper-button.backgrounds {
238
+ text-transform: none;
239
+ font-size: var(--text-sm, 13px);
240
+ font-weight: 500;
241
+ letter-spacing: 0.01em;
242
+ border-radius: var(--radius-sm, 6px);
243
+ padding: var(--space-2, 8px) var(--space-4, 16px);
244
+ min-width: 0;
245
+ transition: background var(--duration-fast, 120ms) var(--ease-default, ease);
246
+ }
247
+ paper-button.gallery {
248
+ background: var(--color-primary, #6366f1);
249
+ color: var(--color-primary-text, #fff);
250
+ }
251
+ paper-button.gallery:hover {
252
+ background: var(--color-primary-hover, #4f46e5);
253
+ }
254
+ paper-button.backgrounds {
255
+ background: var(--color-bg-muted, #f4f4f6);
256
+ color: var(--color-text-secondary, #555);
257
+ }
258
+ paper-button.backgrounds:hover {
259
+ background: #eaeaed;
260
+ }
261
+ `,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},noResponsive:{type:Boolean},modalable:{type:Boolean},modalName:{type:String},popupTrigger:{type:String},popupDelay:{type:Number},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)},15155(t,e,o){o.d(e,{A:()=>n});var r=o(59929),a=o(57176);class i 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`
262
+ <div class="${t}">
263
+ ${(this.items||[]).map((t,e)=>r.qy`
264
+ <div class="swatch-item" @click=${()=>this.openPicker(e)}>
265
+ <div
266
+ class="swatch-circle"
267
+ style="background: ${t.value||"#fff"}"
268
+ ></div>
269
+ <span class="swatch-label">
270
+ <lang-text text="${t.title}"></lang-text>
271
+ </span>
272
+ <div class="hidden-picker">
273
+ <cdtr-colorpicker-editor
274
+ id="picker-${e}"
275
+ .hasAlpha=${!1}
276
+ .allowGradient=${!0===t.allowGradient}
277
+ @change=${t.onChange}
278
+ .value=${t.value}
279
+ text="${t.title}"
280
+ ></cdtr-colorpicker-editor>
281
+ </div>
282
+ </div>
283
+ `)}
284
+ </div>
285
+ `}}i.styles=[a.L,r.AH`
286
+ :host {
287
+ display: block;
288
+ direction: var(--direction-locale, ltr);
289
+ }
290
+ .grid {
291
+ display: grid;
292
+ grid-template-columns: 1fr 1fr;
293
+ gap: 6px;
294
+ }
295
+ .grid.single-col {
296
+ grid-template-columns: 1fr;
297
+ }
298
+ .swatch-item {
299
+ display: flex;
300
+ align-items: center;
301
+ gap: 8px;
302
+ padding: 8px 10px;
303
+ background: #f6f6f8;
304
+ border-radius: 8px;
305
+ cursor: pointer;
306
+ transition: background 0.15s ease;
307
+ min-width: 0;
308
+ overflow: hidden;
309
+ position: relative;
310
+ }
311
+ .swatch-item:hover {
312
+ background: #eeeff1;
313
+ }
314
+ .swatch-label {
315
+ font-size: 11px;
316
+ color: #555;
317
+ font-weight: 500;
318
+ line-height: 1;
319
+ white-space: nowrap;
320
+ overflow: hidden;
321
+ text-overflow: ellipsis;
322
+ min-width: 0;
323
+ flex: 1;
324
+ }
325
+ .hidden-picker {
326
+ position: absolute;
327
+ width: 1px;
328
+ height: 1px;
329
+ overflow: hidden;
330
+ clip: rect(0,0,0,0);
331
+ pointer-events: none;
332
+ }
333
+ `],i.properties={items:{type:Array},columns:{type:Number}},customElements.define("cdtr-color-swatch-group",i);const n=t=>r.qy`
334
+ <cdtr-color-swatch-group
335
+ .items=${t.items}
336
+ .columns=${t.columns||2}
337
+ ></cdtr-color-swatch-group>
338
+ `},12258(t,e,o){o.d(e,{A:()=>n});var r=o(59929),a=o(40648);class i extends r.WF{constructor(){super(),this.label="",this.open=!0,this.persistKey=""}toggle(){this.open=!this.open,(0,a.Q)(this.persistKey,this.open)}render(){return r.qy`
339
+ <div class="section">
340
+ <div class="header" @click=${this.toggle}>
341
+ <span class="title"><lang-text text="${this.label}"></lang-text></span>
342
+ <svg class="chevron ${this.open?"open":""}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
343
+ <polyline points="6 9 12 15 18 9"></polyline>
344
+ </svg>
345
+ </div>
346
+ <div class="content ${this.open?"open":""}">
347
+ <div class="content-inner">
348
+ <slot></slot>
349
+ </div>
350
+ </div>
351
+ </div>
352
+ `}}i.styles=r.AH`
353
+ :host {
354
+ display: block;
355
+ direction: var(--direction-locale, ltr);
356
+ --editor-container-inline-padding: 0;
357
+ }
358
+ .section {
359
+ position: relative;
360
+ }
361
+ /* Inset to the content gutter, not full-bleed: an edge-to-edge rule reads
362
+ as a table border. */
363
+ .section::after {
364
+ content: "";
365
+ display: block;
366
+ height: 1px;
367
+ margin: 0 var(--space-4, 16px);
368
+ background: var(--color-border-subtle, rgba(0, 0, 0, 0.06));
369
+ }
370
+ :host(:last-of-type) .section::after {
371
+ display: none;
372
+ }
373
+ .header {
374
+ display: flex;
375
+ align-items: center;
376
+ justify-content: space-between;
377
+ padding: var(--space-3) var(--space-4);
378
+ cursor: pointer;
379
+ user-select: none;
380
+ /* Keeps the group name visible while its controls scroll past. */
381
+ position: sticky;
382
+ top: 0;
383
+ z-index: 1;
384
+ background: var(--color-bg, #fff);
385
+ }
386
+ .header:hover {
387
+ background: var(--color-bg-subtle, #fafbfc);
388
+ }
389
+ .title {
390
+ /* Larger and lighter than the labels inside it, not bolder — the labels
391
+ are what you act on. */
392
+ font-size: var(--text-md);
393
+ font-weight: 500;
394
+ color: var(--color-text);
395
+ letter-spacing: 0;
396
+ }
397
+ .chevron {
398
+ width: 14px;
399
+ height: 14px;
400
+ transition: transform var(--duration-normal) var(--ease-default), color var(--duration-fast) var(--ease-default);
401
+ color: var(--color-text-faint);
402
+ }
403
+ .header:hover .chevron {
404
+ color: var(--color-text-muted);
405
+ }
406
+ .chevron.open {
407
+ transform: rotate(180deg);
408
+ }
409
+ .content {
410
+ overflow: hidden;
411
+ transition: max-height var(--duration-normal) var(--ease-default), opacity var(--duration-fast) var(--ease-default);
412
+ max-height: 0;
413
+ opacity: 0;
414
+ }
415
+ .content.open {
416
+ max-height: 1200px;
417
+ opacity: 1;
418
+ }
419
+ .content-inner {
420
+ /* Light on top: the controls inside bring their own leading pad. */
421
+ padding: var(--space-1) var(--space-4) var(--space-3) var(--space-4);
422
+ }
423
+ `,i.properties={label:{type:String,reflect:!0,attribute:"data-label"},open:{type:Boolean,reflect:!0},persistKey:{type:String}},customElements.define("cdtr-editor-section",i);const n=(t,e)=>r.qy`
424
+ <cdtr-editor-section
425
+ .label=${t.label}
426
+ .open=${!1!==t.open}
427
+ .persistKey=${t.persistKey||""}
428
+ >
429
+ ${e}
430
+ </cdtr-editor-section>
431
+ `}}]);
Binary file
@@ -1129,7 +1129,7 @@
1129
1129
  `:null}
1130
1130
  </cdtr-row>
1131
1131
  </cdtr-editor-container>
1132
- `;a.e(4217).then(a.bind(a,94217));a(45888);Promise.resolve().then(a.bind(a,58691));class lt extends r.WF{constructor(){super(),this.editor={},this.tabName="",this.factory=this.factory.bind(this),this.execCommandWrapper=this.execCommandWrapper.bind(this),this.connectWith=this.connectWith.bind(this),this.changeTab=this.changeTab.bind(this),this.$select=this.$select.bind(this),this.$update=this.$update.bind(this),this.handleJustifyContent=this.handleJustifyContent.bind(this),this.handleAlignItems=this.handleAlignItems.bind(this)}$select(){this.editor&&this.editor.select&&this.editor.select({changeTab:this.changeTab,tab:this.tabName}),this.connectWith("select")}$update(){this.connectWith("update")}_sectionScope(){return`${this.type||""}:${this.tabName||""}`}_applyPersistedOpen(t){const e=this._sectionScope();for(const a of t)if(a&&"section"===a.type){a.persistKey=`${e}::${a.label}`;const t=(0,it.i)(a.persistKey);void 0!==t&&(a.open=t)}return t}connectedCallback(){super.connectedCallback(),n.Ay.on("update",this.$update),n.Ay.on("select",this.$select),this.connectWith("load")}disconnectedCallback(){super.disconnectedCallback(),n.Ay.off("update",this.$update),n.Ay.off("select",this.$select)}connectWith(){const t=new UIEvent(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"update",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(t);const e=n.Ay.components.find(t=>t.type===this.type);e&&"function"==typeof e.createEditor&&(this.component={...e},this.props=e.props,this.editor=e.createEditor(this.commandsBuilder()))}factory(t,e){if("function"==typeof t&&(t=t()),t.debug,"boolean"==typeof t.active&&!t.active)return null;if("function"==typeof t.active){if(!1===t.active())return null}const a=t.type;switch(a){case"background":return nt(t);case"datetime":return j(t);case"radius":return W(t);case"justifyContent":case"alignItems":return F(t,a);case"node":case"lit":case"custom":return t.node();case"button":return N(t);case"borderpicker":return B(t);case"linkpicker":return q(t);case"input":return(0,i.A)(t);case"dropdown":return(0,s.A)(t);case"fontSize":return c(t);case"fontFamily":return l(t);case"mergeTags":return U(t);case"boxShadow":return v(t);case"colorpicker":return d(t);case"slider":return p(t);case"divider":return b(t);case"heading":return(0,h.A)(t);case"option":return f(t);case"checkbox":return y(t);case"stringListBuilder":return x(t);case"chipsInput":return $(t);case"typography":return M(t);case"icons":return r.qy`<icons-gallery
1132
+ `;a(45888);Promise.resolve().then(a.bind(a,58691));class lt extends r.WF{constructor(){super(),this.editor={},this.tabName="",this.factory=this.factory.bind(this),this.execCommandWrapper=this.execCommandWrapper.bind(this),this.connectWith=this.connectWith.bind(this),this.changeTab=this.changeTab.bind(this),this.$select=this.$select.bind(this),this.$update=this.$update.bind(this),this.handleJustifyContent=this.handleJustifyContent.bind(this),this.handleAlignItems=this.handleAlignItems.bind(this)}$select(){this.editor&&this.editor.select&&this.editor.select({changeTab:this.changeTab,tab:this.tabName}),this.connectWith("select")}$update(){this.connectWith("update")}_sectionScope(){return`${this.type||""}:${this.tabName||""}`}_applyPersistedOpen(t){const e=this._sectionScope();for(const a of t)if(a&&"section"===a.type){a.persistKey=`${e}::${a.label}`;const t=(0,it.i)(a.persistKey);void 0!==t&&(a.open=t)}return t}connectedCallback(){super.connectedCallback(),n.Ay.on("update",this.$update),n.Ay.on("select",this.$select),this.connectWith("load")}disconnectedCallback(){super.disconnectedCallback(),n.Ay.off("update",this.$update),n.Ay.off("select",this.$select)}connectWith(){const t=new UIEvent(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"update",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(t);const e=n.Ay.components.find(t=>t.type===this.type);e&&"function"==typeof e.createEditor&&(this.component={...e},this.props=e.props,this.editor=e.createEditor(this.commandsBuilder()))}factory(t,e){if("function"==typeof t&&(t=t()),t.debug,"boolean"==typeof t.active&&!t.active)return null;if("function"==typeof t.active){if(!1===t.active())return null}const a=t.type;switch(a){case"background":return nt(t);case"datetime":return j(t);case"radius":return W(t);case"justifyContent":case"alignItems":return F(t,a);case"node":case"lit":case"custom":return t.node();case"button":return N(t);case"borderpicker":return B(t);case"linkpicker":return q(t);case"input":return(0,i.A)(t);case"dropdown":return(0,s.A)(t);case"fontSize":return c(t);case"fontFamily":return l(t);case"mergeTags":return U(t);case"boxShadow":return v(t);case"colorpicker":return d(t);case"slider":return p(t);case"divider":return b(t);case"heading":return(0,h.A)(t);case"option":return f(t);case"checkbox":return y(t);case"stringListBuilder":return x(t);case"chipsInput":return $(t);case"typography":return M(t);case"icons":return r.qy`<icons-gallery
1133
1133
  .selectedIcon=${t.selectedIcon}
1134
1134
  .useIconsApi=${!0===t.useIconsApi}
1135
1135
  .iconColor=${t.iconColor??"000000"}
Binary file