@creaditor/web-starterkit 1.0.65 → 1.0.67
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/100.creaditor.bundle.js +348 -0
- package/dist/100.creaditor.bundle.js.gz +0 -0
- package/dist/380.creaditor.bundle.js +4 -4
- package/dist/380.creaditor.bundle.js.gz +0 -0
- package/dist/3847.creaditor.bundle.js +6 -2
- package/dist/3847.creaditor.bundle.js.gz +0 -0
- package/dist/8758.creaditor.bundle.js +1 -0
- package/dist/8758.creaditor.bundle.js.gz +0 -0
- package/dist/creaditor.bundle.js +146 -146
- 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
- package/dist/1142.creaditor.bundle.js +0 -1
- package/dist/1142.creaditor.bundle.js.gz +0 -0
- package/dist/5884.creaditor.bundle.js +0 -91
- package/dist/5884.creaditor.bundle.js.gz +0 -0
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[100],{20100(e,t,i){i.d(t,{default:()=>V});var o=i(59929);let n={};const s=new Set;function r(e){n.selected=e}function a(e){return n.selected}var d=i(23571),l=i(12106),c=i(86319),p=i(83423),h=i(81444);const u="https://img.creaditor.ai";function f(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=t.width??24,o=t.height??24;let n=t.color??"000000";n.startsWith("#")&&(n=n.slice(1));const s=`${u}/icons/serve/${encodeURIComponent(e.category)}/${encodeURIComponent(e.name)}.png?width=${i}&height=${o}`;return(0,h.tG)(s,n)}class m extends o.WF{constructor(){super(),this.searchQuery="",this.iconColor="000000",this.iconSize=34,this.selectedSrc="",this._icons=[],this._loading=!1,this._error=""}willUpdate(e){e.has("searchQuery")&&this.searchQuery?this._fetchIcons():e.has("searchQuery")&&!this.searchQuery&&(this._icons=[],this._error="")}async _fetchIcons(){const e=(this.searchQuery||"").trim();if(e){this._loading=!0,this._error="";try{const t=new URLSearchParams({q:e,limit:"20"}),i=await fetch(`${u}/icons/search?${t.toString()}`);if(!i.ok)throw new Error(i.statusText);const o=await i.json();this._icons=o.icons||[]}catch(e){this._icons=[],this._error=e.message||"Failed to load icons"}finally{this._loading=!1}}else this._icons=[]}_onSelect(e){const t=(this.iconColor||"000000").replace(/^#/,""),i=Number(this.iconSize)||34,o=f(e,{width:i,height:i,color:t});this.dispatchEvent(new CustomEvent("icon-selected",{detail:{src:o,icon:e},bubbles:!0,composed:!0}))}render(){const e=(this.iconColor||"000000").replace(/^#/,""),t=this.searchQuery?.trim()&&!this._loading?this._icons:[];return o.qy`
|
|
2
|
+
${this._loading?o.qy`<div class="loading"><span class="spinner"></span>Loading icons…</div>`:null}
|
|
3
|
+
${this._error?o.qy`<div class="error">${this._error}</div>`:null}
|
|
4
|
+
<div class="grid">
|
|
5
|
+
${t.map(t=>{const i=f(t,{width:24,height:24,color:e}),n=this.selectedSrc&&(this.selectedSrc.includes(t.name)||this.selectedSrc===i);return o.qy`
|
|
6
|
+
<button
|
|
7
|
+
type="button"
|
|
8
|
+
class="icon-wrap ${n?"selected":""}"
|
|
9
|
+
title="${t.name}"
|
|
10
|
+
@click=${()=>this._onSelect(t)}
|
|
11
|
+
>
|
|
12
|
+
<img src="${i}" alt="${t.name}" loading="lazy" />
|
|
13
|
+
</button>
|
|
14
|
+
`})}
|
|
15
|
+
<slot></slot>
|
|
16
|
+
</div>
|
|
17
|
+
`}}m.properties={searchQuery:{type:String},iconColor:{type:String},iconSize:{type:Number},selectedSrc:{type:String},_icons:{type:Array,state:!0},_loading:{type:Boolean,state:!0},_error:{type:String,state:!0}},m.styles=o.AH`
|
|
18
|
+
:host {
|
|
19
|
+
display: block;
|
|
20
|
+
font-size: 12px;
|
|
21
|
+
}
|
|
22
|
+
.label {
|
|
23
|
+
margin-bottom: 6px;
|
|
24
|
+
color: var(--secondary-text, #666);
|
|
25
|
+
font-weight: 500;
|
|
26
|
+
}
|
|
27
|
+
.grid {
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-wrap: wrap;
|
|
30
|
+
gap: 6px;
|
|
31
|
+
}
|
|
32
|
+
.icon-wrap {
|
|
33
|
+
width: 36px;
|
|
34
|
+
height: 36px;
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
padding: 0;
|
|
39
|
+
border: 1px solid transparent;
|
|
40
|
+
border-radius: 8px;
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
background: #f4f4f6;
|
|
43
|
+
transition: border-color 0.15s, box-shadow 0.15s;
|
|
44
|
+
}
|
|
45
|
+
.icon-wrap:hover {
|
|
46
|
+
border-color: #c9c5d6;
|
|
47
|
+
}
|
|
48
|
+
.icon-wrap.selected {
|
|
49
|
+
border-color: #4f46e5;
|
|
50
|
+
box-shadow: 0 0 0 1px #4f46e5;
|
|
51
|
+
background: #fff;
|
|
52
|
+
}
|
|
53
|
+
.icon-wrap img {
|
|
54
|
+
width: 24px;
|
|
55
|
+
height: 24px;
|
|
56
|
+
object-fit: contain;
|
|
57
|
+
}
|
|
58
|
+
.loading,
|
|
59
|
+
.error {
|
|
60
|
+
padding: 8px 0;
|
|
61
|
+
color: var(--secondary-text, #666);
|
|
62
|
+
display: flex;
|
|
63
|
+
align-items: center;
|
|
64
|
+
gap: 8px;
|
|
65
|
+
}
|
|
66
|
+
.spinner {
|
|
67
|
+
width: 16px;
|
|
68
|
+
height: 16px;
|
|
69
|
+
border: 2px solid var(--input-bg, #e0e0e0);
|
|
70
|
+
border-top-color: var(--primary, #007bff);
|
|
71
|
+
border-radius: 50%;
|
|
72
|
+
animation: spin 0.7s linear infinite;
|
|
73
|
+
flex: 0 0 auto;
|
|
74
|
+
}
|
|
75
|
+
@keyframes spin {
|
|
76
|
+
to {
|
|
77
|
+
transform: rotate(360deg);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
.error {
|
|
81
|
+
color: var(--error-color, #c00);
|
|
82
|
+
}
|
|
83
|
+
`,customElements.define("social-icon-suggestions",m);const g=o.AH`
|
|
84
|
+
:host {
|
|
85
|
+
display: grid;
|
|
86
|
+
grid-template-columns: minmax(0, 1fr);
|
|
87
|
+
gap: 8px;
|
|
88
|
+
font-size: 14px;
|
|
89
|
+
color: #1f1d2b;
|
|
90
|
+
}
|
|
91
|
+
.list {
|
|
92
|
+
display: grid;
|
|
93
|
+
/* never wider than the panel, whatever the link fields inside want */
|
|
94
|
+
grid-template-columns: minmax(0, 1fr);
|
|
95
|
+
gap: 8px;
|
|
96
|
+
}
|
|
97
|
+
.card {
|
|
98
|
+
border: 1px solid #e6e4ee;
|
|
99
|
+
border-radius: 10px;
|
|
100
|
+
background: #fff;
|
|
101
|
+
}
|
|
102
|
+
.card.open {
|
|
103
|
+
border-color: #c9c5d6;
|
|
104
|
+
box-shadow: 0 2px 8px rgba(20, 16, 40, 0.06);
|
|
105
|
+
}
|
|
106
|
+
.row {
|
|
107
|
+
display: flex;
|
|
108
|
+
align-items: center;
|
|
109
|
+
gap: 4px;
|
|
110
|
+
height: 42px;
|
|
111
|
+
padding-inline: 4px 10px;
|
|
112
|
+
}
|
|
113
|
+
.handle {
|
|
114
|
+
flex: none;
|
|
115
|
+
width: 24px;
|
|
116
|
+
height: 32px;
|
|
117
|
+
display: grid;
|
|
118
|
+
place-items: center;
|
|
119
|
+
color: #9a97a8;
|
|
120
|
+
cursor: grab;
|
|
121
|
+
}
|
|
122
|
+
.handle svg {
|
|
123
|
+
width: 14px;
|
|
124
|
+
height: 14px;
|
|
125
|
+
fill: currentColor;
|
|
126
|
+
}
|
|
127
|
+
.pick {
|
|
128
|
+
flex: 1;
|
|
129
|
+
min-width: 0;
|
|
130
|
+
height: 100%;
|
|
131
|
+
display: flex;
|
|
132
|
+
align-items: center;
|
|
133
|
+
gap: 8px;
|
|
134
|
+
padding: 0 4px;
|
|
135
|
+
border: 0;
|
|
136
|
+
border-radius: 6px;
|
|
137
|
+
background: none;
|
|
138
|
+
font: inherit;
|
|
139
|
+
color: inherit;
|
|
140
|
+
text-align: start;
|
|
141
|
+
cursor: pointer;
|
|
142
|
+
}
|
|
143
|
+
.pick:focus-visible {
|
|
144
|
+
outline: 2px solid #4f46e5;
|
|
145
|
+
outline-offset: -2px;
|
|
146
|
+
}
|
|
147
|
+
.pick img,
|
|
148
|
+
.pending {
|
|
149
|
+
flex: none;
|
|
150
|
+
width: 24px;
|
|
151
|
+
height: 24px;
|
|
152
|
+
object-fit: contain;
|
|
153
|
+
}
|
|
154
|
+
.pending {
|
|
155
|
+
box-sizing: border-box;
|
|
156
|
+
border: 1.5px dashed #b9b6c6;
|
|
157
|
+
border-radius: 50%;
|
|
158
|
+
}
|
|
159
|
+
.name {
|
|
160
|
+
flex: 1;
|
|
161
|
+
min-width: 0;
|
|
162
|
+
overflow: hidden;
|
|
163
|
+
text-overflow: ellipsis;
|
|
164
|
+
white-space: nowrap;
|
|
165
|
+
/* a link reads left to right in a Hebrew panel too, cut at its end */
|
|
166
|
+
unicode-bidi: plaintext;
|
|
167
|
+
}
|
|
168
|
+
.name.new {
|
|
169
|
+
color: #6b6880;
|
|
170
|
+
}
|
|
171
|
+
.chev {
|
|
172
|
+
flex: none;
|
|
173
|
+
width: 14px;
|
|
174
|
+
height: 14px;
|
|
175
|
+
fill: none;
|
|
176
|
+
stroke: #6b6880;
|
|
177
|
+
stroke-width: 2;
|
|
178
|
+
stroke-linecap: round;
|
|
179
|
+
stroke-linejoin: round;
|
|
180
|
+
transition: transform 0.15s;
|
|
181
|
+
}
|
|
182
|
+
.card.open .chev {
|
|
183
|
+
transform: rotate(180deg);
|
|
184
|
+
}
|
|
185
|
+
.body {
|
|
186
|
+
display: grid;
|
|
187
|
+
grid-template-columns: minmax(0, 1fr);
|
|
188
|
+
/* sections apart, their own parts close */
|
|
189
|
+
gap: 20px;
|
|
190
|
+
padding: 14px;
|
|
191
|
+
border-top: 1px solid #ebe9f2;
|
|
192
|
+
}
|
|
193
|
+
.section {
|
|
194
|
+
display: grid;
|
|
195
|
+
grid-template-columns: minmax(0, 1fr);
|
|
196
|
+
gap: 8px;
|
|
197
|
+
}
|
|
198
|
+
.label {
|
|
199
|
+
font-size: 13px;
|
|
200
|
+
font-weight: 500;
|
|
201
|
+
}
|
|
202
|
+
/* sits at the end of the icon styles, the same size as them */
|
|
203
|
+
.upload {
|
|
204
|
+
width: 36px;
|
|
205
|
+
height: 36px;
|
|
206
|
+
display: grid;
|
|
207
|
+
place-items: center;
|
|
208
|
+
padding: 0;
|
|
209
|
+
border: 1px dashed #b9b6c6;
|
|
210
|
+
border-radius: 8px;
|
|
211
|
+
background: #fff;
|
|
212
|
+
color: #6b6880;
|
|
213
|
+
cursor: pointer;
|
|
214
|
+
}
|
|
215
|
+
.upload:hover {
|
|
216
|
+
border-color: #4f46e5;
|
|
217
|
+
color: #4f46e5;
|
|
218
|
+
}
|
|
219
|
+
.upload svg {
|
|
220
|
+
width: 16px;
|
|
221
|
+
height: 16px;
|
|
222
|
+
fill: none;
|
|
223
|
+
stroke: currentColor;
|
|
224
|
+
stroke-width: 2;
|
|
225
|
+
stroke-linecap: round;
|
|
226
|
+
stroke-linejoin: round;
|
|
227
|
+
}
|
|
228
|
+
.foot {
|
|
229
|
+
display: flex;
|
|
230
|
+
align-items: center;
|
|
231
|
+
margin-top: -6px;
|
|
232
|
+
padding-top: 10px;
|
|
233
|
+
border-top: 1px solid #ebe9f2;
|
|
234
|
+
}
|
|
235
|
+
.remove {
|
|
236
|
+
margin-inline-start: auto;
|
|
237
|
+
padding: 2px 0;
|
|
238
|
+
border: 0;
|
|
239
|
+
background: none;
|
|
240
|
+
font: inherit;
|
|
241
|
+
font-size: 13px;
|
|
242
|
+
font-weight: 500;
|
|
243
|
+
color: #b42318;
|
|
244
|
+
cursor: pointer;
|
|
245
|
+
}
|
|
246
|
+
.remove:hover {
|
|
247
|
+
text-decoration: underline;
|
|
248
|
+
}
|
|
249
|
+
.add {
|
|
250
|
+
width: 100%;
|
|
251
|
+
height: 44px;
|
|
252
|
+
margin-top: 2px;
|
|
253
|
+
border: 1.5px dashed #d6d3e2;
|
|
254
|
+
border-radius: 10px;
|
|
255
|
+
background: #fff;
|
|
256
|
+
font: inherit;
|
|
257
|
+
font-weight: 500;
|
|
258
|
+
color: inherit;
|
|
259
|
+
cursor: pointer;
|
|
260
|
+
}
|
|
261
|
+
.add:hover {
|
|
262
|
+
border-color: #a7adbb;
|
|
263
|
+
}
|
|
264
|
+
.sortable-ghost {
|
|
265
|
+
opacity: 0.4;
|
|
266
|
+
}
|
|
267
|
+
`,b=(e,t)=>c.M.get("lang",e)||t,A=o.JW`<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="9" cy="6" r="1.6"/><circle cx="15" cy="6" r="1.6"/><circle cx="9" cy="12" r="1.6"/><circle cx="15" cy="12" r="1.6"/><circle cx="9" cy="18" r="1.6"/><circle cx="15" cy="18" r="1.6"/></svg>`,x=o.JW`<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 15V4M7 9l5-5 5 5M5 15v4a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-4"/></svg>`,v=o.JW`<svg class="chev" viewBox="0 0 24 24" aria-hidden="true"><path d="M6 9l6 6 6-6"/></svg>`,y={youtube:"YouTube",whatsapp:"WhatsApp",linkedin:"LinkedIn",tiktok:"TikTok",wechat:"WeChat",x:"X"},w={x:"twitter-x",website:"globe"},C=e=>e.link?.href||e.url||"",k=e=>e.fgColor||e.iconColor,_=e=>e?(0,h.IE)(p.A,e):void 0;class I extends o.WF{constructor(){super(),this._draft=!1}connectedCallback(){super.connectedCallback();const e=()=>function(){const e=!!n.addPending;return n.addPending=!1,e}()&&this._openDraft();var t;e(),this._offAdd=(t=e,s.add(t),()=>s.delete(t))}_openDraft(){this._draftLink=null,this._draft=!0}firstUpdated(){this._sortable=d.Ay.create(this.renderRoot.querySelector(".list"),{handle:".handle",draggable:".card",forceFallback:!0,animation:150,onStart:e=>{let{item:t}=e;this._dragNext=t.nextSibling},onEnd:e=>{let{item:t,from:i,oldIndex:o,newIndex:n}=e;if(i.insertBefore(t,this._dragNext),o===n)return;const s=[...this.items];s.splice(n,0,s.splice(o,1)[0]),this._emit(s)}})}updated(e){if(!e.has("_draft")||!this._draft)return;const t=this.renderRoot.querySelector(".draft cdtr-link-element");t?.updateComplete.then(()=>{const e=t.renderRoot.querySelector("cdtr-input");e?.updateComplete.then(()=>e.inputRef?.value?.focus())})}disconnectedCallback(){super.disconnectedCallback(),this._sortable?.destroy(),this._offAdd?.()}_emit(e){this.items=e,this.dispatchEvent(new CustomEvent("items-change",{detail:e}))}_update(e,t){this._emit(this.items.map((i,o)=>o===e?{...i,...t}:i))}_toggle(e){this._draft=!1,r(a()?.id===e.id?null:e),this.requestUpdate()}_setLink(e,t){const i=this.items[e],o=t?.href||"",n=_(o)!==_(C(i))||(e=>{const t=e=>e.split("?")[0];return!e.src||e.src===h.Ww||!!C(e)&&t(e.src)===t((0,h.Vv)(C(e)))})(i),s=o&&n?(0,h.Vv)(o,k(i)):i.src;this._update(e,{link:t,url:o,src:s})}_commitDraft(){const e=this._draftLink,t=e?.href;if(!this._draft||!t)return;this._draftLink=null;const i=this.items||[],o=i[i.length-1],n={id:(0,l.A)(),fgColor:o?.fgColor||"",bgColor:"",style:{...o?.style||{width:"34px",height:"34px"}},url:t,link:e,src:(0,h.Vv)(t,o?.fgColor)};this._draft=!1,r(n),this._emit([...i,n])}_remove(e){a()?.id===this.items[e].id&&r(null),this._emit(this.items.filter((t,i)=>i!==e))}_body(e,t){const i=C(e),n=i?_(i)||"website":void 0;return o.qy`<div class="body">
|
|
268
|
+
<div class="section">
|
|
269
|
+
<div class="label">${b("address","Address")}</div>
|
|
270
|
+
<cdtr-link-element
|
|
271
|
+
compact
|
|
272
|
+
.href=${e.link||e.url||""}
|
|
273
|
+
.protocol=${e.link?.protocol}
|
|
274
|
+
.target=${e.link?.target}
|
|
275
|
+
@change=${e=>this._setLink(t,e.target.value)}
|
|
276
|
+
></cdtr-link-element>
|
|
277
|
+
</div>
|
|
278
|
+
<div class="section">
|
|
279
|
+
<div class="label">${b("icon_style","Icon style")}</div>
|
|
280
|
+
<social-icon-suggestions
|
|
281
|
+
.searchQuery=${w[n]||n||""}
|
|
282
|
+
.iconColor=${k(e)||"000000"}
|
|
283
|
+
.iconSize=${parseInt(e.style?.width,10)||34}
|
|
284
|
+
.selectedSrc=${e.src||""}
|
|
285
|
+
@icon-selected=${e=>this._update(t,{src:e.detail.src})}
|
|
286
|
+
>
|
|
287
|
+
<button
|
|
288
|
+
class="upload"
|
|
289
|
+
title=${b("upload","Upload Image")}
|
|
290
|
+
@click=${e=>e.currentTarget.closest(".section").querySelector("cdtr-gallery").opened=!0}
|
|
291
|
+
>
|
|
292
|
+
${x}
|
|
293
|
+
</button>
|
|
294
|
+
</social-icon-suggestions>
|
|
295
|
+
<cdtr-gallery
|
|
296
|
+
@close=${e=>e.target.opened=!1}
|
|
297
|
+
@file=${e=>{e.target.opened=!1;const i=Array.isArray(e.detail)?e.detail[0]:e.detail;i?.src&&this._update(t,{src:i.src})}}
|
|
298
|
+
></cdtr-gallery>
|
|
299
|
+
</div>
|
|
300
|
+
${this.items.length>1?o.qy`<div class="foot">
|
|
301
|
+
<button class="remove" @click=${()=>this._remove(t)}>${b("remove","Remove")}</button>
|
|
302
|
+
</div>`:null}
|
|
303
|
+
</div>`}_draftCard(){return o.qy`<div
|
|
304
|
+
class="card open draft"
|
|
305
|
+
@focusout=${e=>{e.currentTarget.contains(e.relatedTarget)||this._commitDraft()}}
|
|
306
|
+
@keydown=${e=>{"Enter"===e.key&&setTimeout(()=>this._commitDraft())}}
|
|
307
|
+
>
|
|
308
|
+
<div class="row">
|
|
309
|
+
<span class="handle"></span>
|
|
310
|
+
<button class="pick" @click=${()=>this._draft=!1}>
|
|
311
|
+
<span class="pending"></span>
|
|
312
|
+
<span class="name new">${b("new_icon","New icon")}</span>
|
|
313
|
+
${v}
|
|
314
|
+
</button>
|
|
315
|
+
</div>
|
|
316
|
+
<div class="body">
|
|
317
|
+
<div class="section">
|
|
318
|
+
<div class="label">${b("address","Address")}</div>
|
|
319
|
+
<cdtr-link-element compact .href=${""} @change=${e=>this._draftLink=e.target.value}></cdtr-link-element>
|
|
320
|
+
</div>
|
|
321
|
+
<div class="foot">
|
|
322
|
+
<button class="remove" @click=${()=>this._draft=!1}>${b("remove","Remove")}</button>
|
|
323
|
+
</div>
|
|
324
|
+
</div>
|
|
325
|
+
</div>`}render(){const e=this.items||[],t=this._draft?null:a()?.id;return o.qy`
|
|
326
|
+
<div class="list">
|
|
327
|
+
${e.map((e,i)=>{const n=e.id===t,s=C(e),r=(0,h.Ff)(e,{color:k(e),bg:"ffffff"});return o.qy`<div class="card ${n?"open":""}" data-id=${e.id}>
|
|
328
|
+
<div class="row">
|
|
329
|
+
<span class="handle">${A}</span>
|
|
330
|
+
<button class="pick" aria-expanded=${n} @click=${()=>this._toggle(e)}>
|
|
331
|
+
<img src=${r||h.Ww} alt="" />
|
|
332
|
+
<span class="name">${s?n?(e=>{const t=_(e);return t?"email"===t||"phone"===t?b(t,t[0].toUpperCase()+t.slice(1)):y[t]||t[0].toUpperCase()+t.slice(1):b("website","Website")})(s):(e=>e.replace(/^(https?:\/\/(www\.)?|mailto:|tel:)/,"").split("?")[0])(s):b("add_link","Add link")}</span>
|
|
333
|
+
${v}
|
|
334
|
+
</button>
|
|
335
|
+
</div>
|
|
336
|
+
${n?this._body(e,i):null}
|
|
337
|
+
</div>`})}
|
|
338
|
+
</div>
|
|
339
|
+
${this._draft?this._draftCard():o.qy`<button
|
|
340
|
+
class="add"
|
|
341
|
+
@click=${()=>this._openDraft()}
|
|
342
|
+
>+ ${b("add_icon","Add icon")}</button>`}
|
|
343
|
+
`}}I.properties={items:{attribute:!1},_draft:{state:!0}},I.styles=g,customElements.get("cdtr-social-icons-editor")||customElements.define("cdtr-social-icons-editor",I);var $=i(61919);const B=e=>{{const{component:t,commands:i}=e,n=()=>{let e=a();if(e||(e=t.props.items.find(e=>!e.link),!e&&t.props.items.length>0&&(e=t.props.items[0])),e){!t.props.items.find(t=>t.id===e.id)&&t.props.items.length>0&&(e=t.props.items[0])}return e};return{select:e=>{let{changeTab:t,tab:i}=e;"icons"!==i&&t("icons")},tabs:e=>(e||(e="icons"),[{text:"icons"},{text:"design"}].map(t=>({...t,selected:t.text===e}))),layout:e=>{let{tab:s}=e;const r=n(),a=[{type:"custom",active:"icons"===s.text,node:()=>o.qy`<cdtr-editor-container>
|
|
344
|
+
<cdtr-social-icons-editor
|
|
345
|
+
.items=${t.props.items}
|
|
346
|
+
@items-change=${e=>i.execCommand("items",e.detail)}
|
|
347
|
+
></cdtr-social-icons-editor>
|
|
348
|
+
</cdtr-editor-container>`},{type:"slider",title:"size",active:"design"===s.text,value:parseInt(r?.style?.width),min:10,max:80,onInput:e=>{const o=e.target.value,n=[...t.props.items];n.forEach(e=>{e.style.width=o+"px",e.style.height=o+"px"}),i.execCommand("items",n)}},{type:"colorpicker",title:"icon_color",alpha:!1,active:()=>"design"===s.text&&!!r,value:r?.fgColor?r.fgColor.startsWith("#")?r.fgColor:"#"+r.fgColor:"#000000",onChange:e=>{const o=n();if(!o)return;let s=e.target.value;s=(0,$.A)(s).toHex(),s.startsWith("#")&&(s=s.slice(1)),8===s.length&&/^[0-9a-fA-F]+$/.test(s)&&(s=s.slice(0,6));const r=t.props,a=JSON.parse(JSON.stringify(r.items));if(!0===r.applyColorToAll)a.forEach(e=>{e.fgColor=s});else{const e=a.findIndex(e=>e.id===o.id);-1!==e&&(a[e].fgColor=s)}i.execCommand("items",a)}},{type:"checkbox",title:"color_them_all",checked:!!t.props.applyColorToAll,active:()=>"design"===s.text&&!!r,onChange:e=>{const t=!!e.target.checked;i.execCommand("applyColorToAll",t)}},{type:"divider"},{type:"slider",title:"spacing",active:"design"===s.text,value:parseFloat(t.props.style.gap),min:0,max:80,onInput:e=>{const t=e.target.value;i.execCommand("style",{gap:t+"px"})}}];return a}}}};var S=i(52144);const E=()=>({set:(e,t,i)=>{switch(t){case"style":if("object"==typeof i)return e[t]=(0,S.A)(e[t],i),!0;break;case"items":if(e[t]=i,Array.isArray(i)){const e=a(),t=i.find(t=>t.id===e?.id);t&&r(t)}return!0;case"src":const o=a();if(o&&Array.isArray(e.items)){const t=[...e.items],n=t.findIndex(e=>e.id===o.id);if(-1!==n)return t[n].src=i,e.items=t,!0}break;case"applyColorToAll":return e[t]=i,!0}}});var L=i(72591),q=i.n(L),T=i(88639),W=i.n(T),F=i(88128),U=i.n(F),Q=i(30855),R=i.n(Q),N=i(93051),z=i.n(N),j=i(89820),D={};D.setAttributes=R(),D.insert=U().bind(null,"head"),D.domAPI=W(),D.insertStyleElement=z();q()(j.A,D);const J=j.A&&j.A.locals?j.A.locals:void 0;var P=i(91597);const V=()=>{const e="social";return{name:e,create:t=>{let{createElement:i,compose:o,helpers:l}=t;const c=(0,P.S)(),p=document.createElement("div"),u=document.createElement("div");u.classList.add(J.root);new d.Ay(u,{sort:!0,delay:0,delayOnTouchOnly:!1,touchStartThreshold:0,disabled:!1,store:null,animation:150,easing:"cubic-bezier(1, 0, 0, 1)",preventOnFilter:!0,draggable:".item",dataIdAttr:"data-id",ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:1,direction:"horizontal",forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,dragoverBubble:!1,removeCloneOnHide:!0,emptyInsertThreshold:5,setData:function(e,t){e.setData("Text",t.textContent)},onChoose:function(e){e.oldIndex},onUnchoose:function(e){},onStart:function(e){e.oldIndex},onEnd:function(e){const t=JSON.parse(JSON.stringify(o.props.items)),{oldIndex:i,newIndex:n}=e,[s]=t.splice(i,1);t.splice(n,0,s),o.editor.store().execCommand("items",t)},onMove:function(e,t){e.dragged,e.draggedRect,e.related,e.relatedRect,e.willInsertAfter,t.clientY},onChange:function(e){e.newIndex}});p.appendChild(u);const f=i({name:e,id:o.id,template:p,draggable:{group:"element"},droppable:{group:"element"},render:()=>{const e=o.props.items;let t=!1;const i=e.map(e=>{const i=e.url||e.link?.link||"";return!e.src&&i?(t=!0,{...e,src:(0,h.Vv)(i)}):e});t&&setTimeout(()=>o.editor.store().execCommand("items",i),0);const d=t?i:e;for(;u.firstChild;)u.removeChild(u.firstChild);l.mergeDiff(u,{style:o.props.style});const c=a();d.forEach(e=>{const t=document.createElement("img");c?.id===e.id&&t.classList.add(J.selected),t.addEventListener("click",()=>{r(e),Array.from(u.children).forEach(e=>{e.classList.remove(J.selected)}),t.classList.add(J.selected)}),t.classList.add("item"),e.id&&t.setAttribute("data-id",e.id);const i=(0,h.fm)(u);t.src=(0,h.Ff)(e,{color:e.fgColor||e.iconColor,bg:i})||h.Ww,l.mergeDiff(t,{style:e.style}),u.append(t)});const p=document.createElement("paper-button");p.classList.add(J.add),p.innerHTML="<cdtr-icon icon='add' width='18' height='18'></cdtr-icon>",u.append(p),p.addEventListener("click",()=>(n.addPending=!0,void s.forEach(e=>e())))},handleBar:!0,defaultProps:{},validator:E(),schema:o.schema,onSelect:e=>{p.classList.add(J.selectedRow);const t=a();if(t){const i=document.querySelector(`[data-id="${t.id}"]`);i?(window.___social_cdtr_item=i,i.classList.add("selected_underlined")):p.classList.add(e)}},onDeselect:e=>{a();window.___social_cdtr_item&&window.___social_cdtr_item.classList.remove("selected_underlined"),p?.classList?.remove(e,J.selectedRow)},elementProps:o,remove:()=>{p.remove()},createEditor:B});return f.app.on("update",()=>{c.run(()=>{const e=(0,h.fm)(u);if(!e)return;const t=u.querySelectorAll("img"),i=o.props.items;t.forEach((t,o)=>{const n=i[o];if(!n)return;const s=(0,h.Ff)(n,{color:n.fgColor||n.iconColor,bg:e});s&&(t.src=s)})})}),f}}}},89820(e,t,i){i.d(t,{A:()=>a});var o=i(82001),n=i.n(o),s=i(40935),r=i.n(s)()(n());r.push([e.id,'.Z7AEJu5h_9kumGVl3K4x{\n display: flex;\n position: relative;\n --add-gap: 6px;\n}\n.UA2xJ_pGYNrGNLfjkExO{\n border:1px solid var(--primary);\n}\n/* A white disc with a dark plus, a hairline border and a soft shadow: it reads\n on any background. It sits just past the row, outside it, so the icons are\n centred as they are in the sent email, and shows only on hover or selection. */\n.D_WaIFoLxhQQCNkeIkoP{\n position: absolute;\n left: 100%;\n top: 50%;\n transform: translateY(-50%);\n min-width: 0;\n padding: 0;\n margin-left: var(--add-gap);\n width: 28px;\n height: 28px;\n border-radius: 50%;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n background: #fff;\n color: #1f1b1d;\n border: 1px solid rgba(0,0,0,.18);\n box-shadow: 0 1px 3px rgba(0,0,0,.28);\n visibility: hidden;\n /* hide a beat late, so moving from the icons to the + doesn\'t lose it */\n transition: visibility 0s .3s;\n}\n/* covers the gap between the row and the +, so the row stays hovered on the way */\n.Z7AEJu5h_9kumGVl3K4x::after{\n content: "";\n position: absolute;\n left: 100%;\n top: 0;\n bottom: 0;\n width: var(--add-gap);\n}\n.Z7AEJu5h_9kumGVl3K4x:hover .D_WaIFoLxhQQCNkeIkoP,\n.hrRqnAUtaz06LTBYL5Pp .D_WaIFoLxhQQCNkeIkoP{\n visibility: visible;\n transition-delay: 0s;\n}\n',"",{version:3,sources:["webpack://./../newsletter-editors/social-editor-component-newsletter/lib/style.module.css"],names:[],mappings:"AAAA;IACI,aAAa;IACb,kBAAkB;IAClB,cAAc;AAClB;AACA;IACI,+BAA+B;AACnC;AACA;;iFAEiF;AACjF;IACI,kBAAkB;IAClB,UAAU;IACV,QAAQ;IACR,2BAA2B;IAC3B,YAAY;IACZ,UAAU;IACV,2BAA2B;IAC3B,WAAW;IACX,YAAY;IACZ,kBAAkB;IAClB,oBAAoB;IACpB,mBAAmB;IACnB,uBAAuB;IACvB,gBAAgB;IAChB,cAAc;IACd,iCAAiC;IACjC,qCAAqC;IACrC,kBAAkB;IAClB,wEAAwE;IACxE,6BAA6B;AACjC;AACA,kFAAkF;AAClF;IACI,WAAW;IACX,kBAAkB;IAClB,UAAU;IACV,MAAM;IACN,SAAS;IACT,qBAAqB;AACzB;AACA;;IAEI,mBAAmB;IACnB,oBAAoB;AACxB",sourcesContent:['.root{\n display: flex;\n position: relative;\n --add-gap: 6px;\n}\n.selected{\n border:1px solid var(--primary);\n}\n/* A white disc with a dark plus, a hairline border and a soft shadow: it reads\n on any background. It sits just past the row, outside it, so the icons are\n centred as they are in the sent email, and shows only on hover or selection. */\n.add{\n position: absolute;\n left: 100%;\n top: 50%;\n transform: translateY(-50%);\n min-width: 0;\n padding: 0;\n margin-left: var(--add-gap);\n width: 28px;\n height: 28px;\n border-radius: 50%;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n background: #fff;\n color: #1f1b1d;\n border: 1px solid rgba(0,0,0,.18);\n box-shadow: 0 1px 3px rgba(0,0,0,.28);\n visibility: hidden;\n /* hide a beat late, so moving from the icons to the + doesn\'t lose it */\n transition: visibility 0s .3s;\n}\n/* covers the gap between the row and the +, so the row stays hovered on the way */\n.root::after{\n content: "";\n position: absolute;\n left: 100%;\n top: 0;\n bottom: 0;\n width: var(--add-gap);\n}\n.root:hover .add,\n.selectedRow .add{\n visibility: visible;\n transition-delay: 0s;\n}\n'],sourceRoot:""}]),r.locals={root:"Z7AEJu5h_9kumGVl3K4x",selected:"UA2xJ_pGYNrGNLfjkExO",add:"D_WaIFoLxhQQCNkeIkoP",selectedRow:"hrRqnAUtaz06LTBYL5Pp"};const a=r}}]);
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[380],{70380(t,e,s){s.r(e),s.d(e,{default:()=>
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[380],{70380(t,e,s){s.r(e),s.d(e,{default:()=>h});var i=s(59929),n=s(21421),a=s(91597);const o="֑-߿יִ-﷽ﹰ-ﻼ",l="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",c=new RegExp("^[^"+l+"]*["+o+"]"),r=new RegExp("^[^"+o+"]*["+l+"]");var u=s(86319);const p=(0,a.S)();class h extends i.WF{constructor(){super(),this.inputRef=(0,n._)(),this.min=0,this.max=100,this.step=1,this.autofocus=!1,this.type="text",this.value="number"===this.type?"0":"",this.placeholder="",this.oldValue=this.value,this.successActive=!1,this._successTimeout=null}onSubmit(t){t.preventDefault();const e=new UIEvent("submit",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(e),this.oldValue=this.value}focus(){const t=this.inputRef.value;t.focus(),t.setSelectionRange(t.value.length,t.value.length)}onFocus(){const t=new UIEvent("focus",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(t)}onBlur(){const t=new UIEvent("blur",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(t),this.oldValue=this.value}render(){this.fullWidth&&(this.style.width="100%"),this.value||"text"!==this.type||(this.value=""),this.icon&&"string"!=typeof this.inputStyle&&(this.inputStyle="");const t=u.M.get("lang",this.placeholder)||this.placeholder||"";t&&("string"!=typeof this.inputStyle&&(this.inputStyle=""),-1===this.inputStyle.indexOf("text-align")&&(this.inputStyle+=";text-align:"+("rtl"===function(t){const e=String(t||"");return c.test(e)?"rtl":r.test(e)?"ltr":"neutral"}(t)?"right":"")));const e=this.multiline?i.qy` <textarea
|
|
2
2
|
rows=${this.row||4}
|
|
3
3
|
.disabled=${this.disabled}
|
|
4
4
|
dir="auto"
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
${"text"===this.type&&this.maxLength?i.qy`<span class="counter"
|
|
50
50
|
>${this.value.length}/${this.maxLength}</span
|
|
51
51
|
> `:null}
|
|
52
|
-
</form>`}firstUpdated(){this.autofocus&&setTimeout(()=>{this.inputRef.value&&this.inputRef.value.focus()},500),void 0===this.value&&(this.value="")}focus(){super.focus(),this.inputRef.value.focus()}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this._successTimeout&&(clearTimeout(this._successTimeout),this._successTimeout=null)}setValue(t){if(this.selectionStart=this.inputRef.value.selectionStart,!this.inputRef.value)return;const e=this.inputRef.value;if("text"===this.type&&this.max&&e.value.length>this.max)return e.value=this.value,void this.inputRef.value.focus();this.value=e.value;const s=new UIEvent(t.type,{view:window,bubbles:!0,cancelable:!0});if(this.dispatchEvent(s),"input"===t.type){const t=()=>{const t=new UIEvent("debounce",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(t)};
|
|
52
|
+
</form>`}firstUpdated(){this.autofocus&&setTimeout(()=>{this.inputRef.value&&this.inputRef.value.focus()},500),void 0===this.value&&(this.value="")}focus(){super.focus(),this.inputRef.value.focus()}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this._successTimeout&&(clearTimeout(this._successTimeout),this._successTimeout=null)}setValue(t){if(this.selectionStart=this.inputRef.value.selectionStart,!this.inputRef.value)return;const e=this.inputRef.value;if("text"===this.type&&this.max&&e.value.length>this.max)return e.value=this.value,void this.inputRef.value.focus();this.value=e.value;const s=new UIEvent(t.type,{view:window,bubbles:!0,cancelable:!0});if(this.dispatchEvent(s),"input"===t.type){const t=()=>{const t=new UIEvent("debounce",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(t)};p.run(t,500)}}success(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2e3;this._successTimeout&&(clearTimeout(this._successTimeout),this._successTimeout=null),this.successActive=!0;const e=Number(t);!Number.isFinite(e)||e<=0||(this._successTimeout=setTimeout(()=>{this.successActive=!1,this._successTimeout=null},e))}patch(t){this.value=t}}h.styles=i.AH`
|
|
53
53
|
:host {
|
|
54
54
|
display: inline-block;
|
|
55
55
|
--cdtr-input-height: 30px;
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
-webkit-appearance: none;
|
|
79
79
|
-moz-appearance: none;
|
|
80
80
|
appearance: none;
|
|
81
|
-
border-radius: 0.25rem;
|
|
81
|
+
border-radius: var(--cdtr-input-radius, 0.25rem);
|
|
82
82
|
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
|
83
83
|
margin: 0;
|
|
84
84
|
font-family: var(--font-family);
|
|
@@ -185,4 +185,4 @@
|
|
|
185
185
|
box-shadow: 0 0 10px rgba(79, 192, 111, 0.2);
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
`,
|
|
188
|
+
`,h.properties={value:{type:String,reflect:!0},step:{type:Number,reflect:!0},min:{type:Number,reflect:!0},max:{type:Number,reflect:!0},type:{type:String,reflect:!0},inputDir:{type:String},icon:{type:String,reflect:!0},placeholder:{type:String,reflect:!0},autofocus:{type:Boolean,reflect:!0},fullWidth:{type:Boolean,reflect:!0},selectionStart:{type:Number},inputStyle:{type:String,reflect:!0},maxLength:{type:Number},couchOnEmpty:{type:Boolean},disabled:{type:Boolean},multiline:{type:Boolean},row:{type:Number},successActive:{type:Boolean}},customElements.get("cdtr-input")||customElements.define("cdtr-input",h)}}]);
|
|
Binary file
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
-webkit-appearance: none;
|
|
79
79
|
-moz-appearance: none;
|
|
80
80
|
appearance: none;
|
|
81
|
-
border-radius: 0.25rem;
|
|
81
|
+
border-radius: var(--cdtr-input-radius, 0.25rem);
|
|
82
82
|
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
|
|
83
83
|
margin: 0;
|
|
84
84
|
font-family: var(--font-family);
|
|
@@ -311,10 +311,14 @@
|
|
|
311
311
|
}
|
|
312
312
|
.compact-tab cdtr-checkbox {
|
|
313
313
|
flex: none;
|
|
314
|
+
/* a light empty box; checked still turns the primary colour */
|
|
315
|
+
color: #a8a5b5;
|
|
314
316
|
}
|
|
315
317
|
/* the email/SMS extra fields are drawn 260px wide; in a tight panel they fill the space instead */
|
|
316
318
|
.compact cdtr-input {
|
|
317
319
|
width: 100% !important;
|
|
320
|
+
/* rounded like the type dropdown under it */
|
|
321
|
+
--cdtr-input-radius: 8px;
|
|
318
322
|
}
|
|
319
323
|
.compact .explain-title {
|
|
320
324
|
margin-top: 4px;
|
|
@@ -1080,8 +1084,8 @@
|
|
|
1080
1084
|
</div>
|
|
1081
1085
|
`}}}(s.WF)){constructor(){super(),this.inputRef=(0,a._)(),this.onBlur=this.onBlur.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.urlInputFocused=!1,this._urlInputRawValue="",this._lastSyncedMyHref=void 0,this._lastBodySyncHref=void 0,this.lastUrl=void 0,this.target="_blank",this.anchors=[],this.event=new UIEvent("change",{view:window,bubbles:!0,cancelable:!0}),this.options=c,this.body="",this.subject="",this.name=o.M.get("lang",c[0].text),this.initAutomations()}onDispatch(){this.event=new UIEvent("change",{view:window,bubbles:!0,cancelable:!0});const t=function(t){const{href:e,protocol:i,params:s,body:o,subject:r,target:n,dispatchEvent:a,event:l}=t;if(!e)return a(l),{dispatched:!0};const c=L(e,i,s,o,r,n);return c?{dispatched:!0,href:c.url,protocol:c.protocol,params:c.params,value:c.url,link:c.url,lastUrl:c.url}:{dispatched:!1}}({href:this.href,protocol:this.protocol,params:this.params,body:this.body,subject:this.subject,target:this.target,dispatchEvent:this.dispatchEvent.bind(this),event:this.event});if(t.dispatched){if(t.href){this.href=t.href,this.protocol=t.protocol,this.params=t.params?{...t.params}:{},this.value=t.value,this.link=t.link,this.lastUrl=t.lastUrl;const e="string"==typeof t.href?t.href:t.href?.href;this._urlInputRawValue=null!=e&&""!==e?String(e):""}this.dispatchEvent(this.event)}}onChangeLink(t){const e=t.target.value;this._urlInputRawValue=e;const i=R(e,this.protocol,this.href);null!==i?(this.href=i.href,this.protocol=i.protocol,i.clearParams&&(this.body="",this.subject=""),void 0!==i.body&&(this.body=i.body),void 0!==i.subject&&(this.subject=i.subject),i.shouldBlur&&this.onBlur()):this.href=e}onKeyDown(t){if("submit"===t.type){const t=this.inputRef?.value;void 0!==t?.value&&this.onChangeLink({target:{value:t.value}}),t&&"function"==typeof t.success&&t.success(),this.onDispatch()}}onUrlInputFocus(){const t=this.inputRef?.value?.value;null!=t&&(this._urlInputRawValue=t),this.urlInputFocused=!0}onUrlInputBlur(){this.urlInputFocused=!1,this.hasButton||this.onDispatch()}onBlur(){this.hasButton||this.onDispatch()}onClickOk(){this.onDispatch()}onChangeTarget(t){const e={target:t.target.value};this.target=e.target,t.stopPropagation(),!this.hasButton&&this.href&&this.onBlur()}resolveAnchors(){this.anchors=U()}onChangeType(t){if(t===C)return void this.onAutomationsClick();const e=function(t,e,i,s){const o=e.find(e=>e.type===t);if(!o)return{forceProtocolChange:!1};const r="anchor"===o.text,n=s!==o.type;return setTimeout(()=>{i&&i.value&&i.value.focus()},500),{protocol:o.type,forceProtocolChange:!0,shouldResolveAnchors:r,clearParams:n}}(t,this.options,this.inputRef,this.protocol);if(e.shouldResolveAnchors&&this.resolveAnchors(),this.protocol=e.protocol,this.forceProtocolChange=e.forceProtocolChange,e.clearParams&&(this.body="",this.subject=""),this.compact&&e.clearParams)return this.href="",this.params={},void(this._urlInputRawValue="");if(e.forceProtocolChange){const t=new r.A(this.href,{protocol:this.protocol});t.protocol=this.protocol,this.href=t,this.onBlur()}}connectedCallback(){super.connectedCallback(),this.href=new r.A(this.href);const t=String(this.href?.href||""),e=(0,m.r_)(t),i=this.href&&this.href.params&&this.href.params[p];(e||i)&&this.parseAutomationLink(this.href)}render(){const t=o.M.get("config","editor","configure","editorProps","linkPicker","savedVariables");this.resolveAnchors();const e=this.lastUrl!==this.href,i=new r.A(this.href,{protocol:e?null:this.protocol});this.protocol&&!e?i.protocol=this.protocol:i.protocol&&(this.protocol=i.protocol);const n=String(this.href?.href||this.href||"");if(this._lastBodySyncHref!==n){const t=void 0===this._lastBodySyncHref;this._lastBodySyncHref=n,i.params?(this.body=i.params.text||i.params.body||"",this.subject=i.params.subject||""):(this.body="",this.subject="");(0,m.r_)(n)||i.params&&i.params[p]?(this.selectedAutomation=null,this.activeAutomationId=null,this.selectedMailingLists=[],this.selectedMailingListsForAdd=[],this.selectedMailingListsForRemove=[],this.automationAction=null,this.showAutomations=!0,this.parseAutomationLink(this.href)):(this.showAutomations=!1,this.selectedAutomation=null,this.activeAutomationId=null,this.selectedMailingLists=[],this.selectedMailingListsForAdd=[],this.selectedMailingListsForRemove=[],this.automationAction=null,t&&this.openAutomations&&B().length&&this.onAutomationsClick())}const l=function(t,e,i){let s=[];return t.isEmail?s=[]:t.isPhone?s=i.filter(t=>("tel:"===t.type||"sms:"===t.type||"whatsapp:"===t.type)&&t.type!==e):-1!==t.href.indexOf("http://")&&"https:"!==e&&(s=[{type:"https:",text:o.M.get("lang","is_user_wants_https"),reccomanded:!0}]),"anchor:"===e&&(s=[]),s}(i,this.protocol,this.options);let c=i.href;const h=String(i.href||""),d=(0,m.r_)(h),g=i.params&&i.params[p];if(d)c=h;else if(g){const t=u,e=[];i.params&&Object.keys(i.params).forEach(s=>{if(!t.includes(s)){const t=i.params[s];e.push(`${s}=${encodeURIComponent(t).replace(/%24/g,"$")}`)}});const s=i.url||"";c=i.protocol?"http:"===i.protocol||"https:"===i.protocol?`${i.protocol}//${s}`:`${i.protocol}${s}`:s,e.length>0&&(c+=`?${e.join("&")}`)}const f=function(t){switch(t){case"mailto:":return"what_the_email_address";case"tel:":return"what_the_phone_number";case"sms:":case"whatsapp:":return"what_the_phone_number_to_send_msg";case"anchor:":return"what_the_anchor_name";case"file:":return"what_the_file_name";default:return"what_the_url_address"}}(this.protocol),b=[...this.options],y=b.findIndex(t=>"http:"===t.type);y>-1&&b.splice(y,1);const x=B(),v={url:i,href:this.href,protocol:this.protocol,anchors:this.anchors,body:this.body,subject:this.subject,onChangeLink:this.onChangeLink.bind(this),onBlur:this.onBlur.bind(this),onRequest:this.onRequest,updateBody:t=>{this.body=t},updateSubject:t=>{this.subject=t}},w=null!=c&&""!==c?String(c):"",$=this._urlInputRawValue!==w,k=void 0!==this._lastSyncedMyHref&&w!==this._lastSyncedMyHref,A=this.urlInputFocused&&this._urlInputRawValue&&w&&!k;$&&!A?(this._urlInputRawValue=w,this._lastSyncedMyHref=w):$||(this._lastSyncedMyHref=w);const L=this.urlInputFocused&&void 0!==this._urlInputRawValue?this._urlInputRawValue:c,R={protocol:this.protocol,url:i,autofocus:this.autofocus,inputRef:(0,a.K)(this.inputRef),onChangeLink:this.onChangeLink.bind(this),onBlur:this.onUrlInputBlur.bind(this),onFocus:this.onUrlInputFocus.bind(this),onKeyDown:this.onKeyDown.bind(this),myHref:L},U="rtl"===getComputedStyle(this).getPropertyValue("--direction-locale").trim();if(this.showAutomations)return s.qy` <div class="root ${U?"rtl":""}">${this.renderAutomationsView()}</div>`;if(this.compact){const t=!this.protocol||"https:"===this.protocol||"http:"===this.protocol;return s.qy`<div class="compact">
|
|
1082
1086
|
<div class="compact-row">
|
|
1087
|
+
${"anchor:"===this.protocol?null:S({...R,value:L,onChange:R.onChangeLink,placeholder:o.M.get("lang",f)||"",style:"width:100%;--cdtr-input-height:36px;",width:"100%",coach:!1})}
|
|
1083
1088
|
${M(b,this.protocol,this.onChangeType.bind(this),x)}
|
|
1084
|
-
${"anchor:"===this.protocol?null:S({...R,value:L,onChange:R.onChangeLink,placeholder:o.M.get("lang",f)||"",style:"width:100%;--cdtr-input-height:32px;",width:"100%",coach:!1})}
|
|
1085
1089
|
</div>
|
|
1086
1090
|
${_(this.protocol,v)}
|
|
1087
1091
|
${t?s.qy`<div
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[8758],{58758(e,t,n){n.d(t,{default:()=>x});function o(e){const t={};return e.dispatchEvent(new CustomEvent("cdtr-video-host",{bubbles:!0,composed:!0,detail:t})),"function"==typeof t.panel||"function"==typeof t.block?t:null}const l=e=>{{const{component:t,commands:n,helpers:l}=e,a=t.parent("col"),i=e=>"style"===e.text,s=(e,n)=>t.props[e]??t.props.style?.[e]??n;return{select:e=>{let{changeTab:t,tab:n}=e;n.text||t("style")},tabs:e=>{const t=[{text:"style",selected:!0},{text:"animations"},{text:"settings"}];return e?(t.forEach(t=>t.selected=t.text===e),t):t},layout:e=>{let{tab:r,changeTab:c,tabs:d}=e;const A=t.element?o(t.element):null;return[{type:"heading",level:6,text:"video",active:()=>i(r)},{type:"input",title:"add_urlAddress_from_media_site",active:()=>i(r),value:s("url",""),onChange:e=>{let t=e.target.value;if(-1!==t.indexOf("youtube.com/shorts/")){const e=t.split("/");e.length>0&&(t=`https://youtu.be/${e[e.length-1]}`)}n.execCommand("url",t)}},...A?.panel?[{type:"custom",active:()=>i(r),node:()=>A.panel()}]:[],{type:"heading",level:6,text:"playback",active:()=>i(r)},{type:"checkbox",title:"autoplay",info:"autoplayMutedInfo",active:()=>i(r),checked:!!s("playing",!1),onChange:e=>{const t=e.target.checked;n.execCommand("playing",t),t&&!s("muted",!0)&&(n.execCommand("muted",!0),c("style"))}},{type:"checkbox",title:"playInLoop",active:()=>i(r),checked:!!s("loop",!1),onChange:e=>{n.execCommand("loop",e.target.checked)}},{type:"checkbox",title:"slientMode",active:()=>i(r),checked:!!s("muted",!0),onChange:e=>{n.execCommand("muted",e.target.checked)}},{type:"checkbox",title:"showControls",active:()=>i(r),checked:!1!==s("controls",!0),onChange:e=>{n.execCommand("controls",e.target.checked)}},{type:"checkbox",title:"showAsImage",active:()=>i(r),checked:!!s("light",!1),onChange:e=>{n.execCommand("light",e.target.checked)}},{type:"checkbox",title:"playInline",active:()=>i(r),checked:!!s("playsinline",!1),onChange:e=>{n.execCommand("playsinline",e.target.checked)}},{type:"slider",title:"volume",min:0,max:100,unit:"%",active:()=>i(r),value:Math.round(100*(s("volume",.8)??.8)),onInput:e=>{n.execCommand("volume",Number(e.target.value)/100)}},{type:"heading",level:6,text:"size",active:()=>i(r)},{type:"fontSize",title:"size",min:10,active:()=>i(r),max:a?.element?.offsetWidth,value:parseInt(t.props.style.width),device:e=>{if("phone"===e.target.device){const n=t.props?.breakpoints?.sm?.style?.width||t.props.style.width;e.target.value=parseInt(n)}else e.target.value=parseInt(t.props.style.width)},onInput:e=>{const t=e.target.value;"phone"===e.target.device?n.execCommand("breakpoints",e=>{const n=e.props.breakpoints?.sm||{};return{sm:l.deepMerge(n,{style:{width:t+"px",height:9*t/16+"px"}})}}):n.execCommand("style",{width:t+"px"})}}]}}}};var a=n(52144);const i=["playing","loop","muted","controls","light","playsinline"],s=()=>({set:(e,t,n)=>{if(i.includes(t))return e[t]=Boolean(n),!0;switch(t){case"url":return e[t]=n,!0;case"volume":{const o=parseFloat(n);return!Number.isNaN(o)&&(e[t]=Math.min(1,Math.max(0,o)),!0)}case"style":if("object"==typeof n)return n.width&&(n.height=9*parseFloat(n.width)/16+"px"),e[t]=(0,a.A)(e[t],n),!0}}});var r=n(72591),c=n.n(r),d=n(88639),A=n.n(d),p=n(88128),h=n.n(p),m=n(30855),g=n.n(m),u=n(93051),C=n.n(u),y=n(51115),f={};f.setAttributes=g(),f.insert=h().bind(null,"head"),f.domAPI=A(),f.insertStyleElement=C();c()(y.A,f);const k=y.A&&y.A.locals?y.A.locals:void 0;n(15284);var v=n(86319);const b="video";const x=()=>({name:b,create:e=>{const{createElement:t,compose:n,helpers:a}=e,{arrayToString:i,mergeDiff:r}=a,c=document.createElement("div");c.classList.add(k.root);const d=document.createElement("div");d.classList.add(k.cover);const A=document.createElement("cdtr-media-player"),p=document.createElement("div");p.classList.add(k.empty),p.innerHTML='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="10"/><path d="M10 8.5l5 3.5-5 3.5z"/></svg>';const h=document.createElement("strong"),m=document.createElement("span");return p.append(h,m),c.append(A,p,d),c.addEventListener("click",()=>{A.playing=!1}),t({name:b,id:n.id,template:c,defaultProps:{url:"https://www.youtube.com/watch?v=04Or_U9OexU",playing:!1,loop:!1,muted:!0,controls:!0,light:!1,playsinline:!1,volume:.8,style:{width:"400px",height:"225px"}},draggable:{group:"element"},droppable:{group:"element"},render:e=>{const t=n.props,l=(e,n)=>t[e]??t.style?.[e]??n,a=l("url");A.url=a;const i=!String(a??"").trim();if(c.classList.toggle(k.blank,i),i){const e=o(c)?.block?.()??null;p.classList.toggle(k.hosted,!!e),e&&e.parentNode!==p&&p.append(e),e||p.querySelector(":scope > div")?.remove(),h.textContent=v.M.get("lang","video_paste_link")||"Paste a video link",m.textContent=v.M.get("lang","video_link_sources")||"YouTube, Vimeo or an MP4 file",Object.assign(p.style,{width:t.style.width,height:t.style.height})}r(A,{style:t.style}),A.width=t.style.width,A.height=t.style.height,A.playing=!!l("playing",!1),A.loop=!!l("loop",!1),A.controls=!1!==l("controls",!0),A.light=!!l("light",!1),A.playsinline=!!l("playsinline",!1);const s=l("volume",.8);A.volume="number"==typeof s?s:.8,A.muted=!0},atomElement:A,resizeable:()=>c,handleBar:!0,validator:s(),schema:n.schema,onSelect:e=>{A.classList.add(e)},onDeselect:e=>{A.classList.remove(e)},elementProps:n,remove:()=>{c.remove()},createEditor:l})}})},51115(e,t,n){n.d(t,{A:()=>s});var o=n(82001),l=n.n(o),a=n(40935),i=n.n(a)()(l());i.push([e.id,".BaT92HY5C7Gxgg9C1_pc {\n position: relative;\n max-width: 100%;\n}\n.aybkK2AXl8f2XctkkRjJ {\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n position: absolute;\n opacity: 0.6;\n}\n\n.BaT92HY5C7Gxgg9C1_pc:hover .aybkK2AXl8f2XctkkRjJ {\n display: block;\n background-color: var(--primary);\n}\n\n/* no link yet: a quiet placeholder the size of the video */\n.meCvGtDIqeqhKAtynZ3d {\n display: none;\n box-sizing: border-box;\n max-width: 100%;\n min-height: 160px;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 6px;\n border: 1px solid #dcdde3;\n border-radius: 8px;\n background: #eeeff2;\n color: #6b6880;\n font-size: 13px;\n text-align: center;\n}\n.meCvGtDIqeqhKAtynZ3d svg {\n width: 40px;\n height: 40px;\n margin-bottom: 4px;\n fill: none;\n stroke: currentColor;\n stroke-width: 1.5;\n stroke-linejoin: round;\n}\n.meCvGtDIqeqhKAtynZ3d svg path {\n fill: currentColor;\n stroke: none;\n}\n.meCvGtDIqeqhKAtynZ3d strong {\n font-size: 15px;\n font-weight: 500;\n color: #1f1d2b;\n}\n/* The page's own content (the course builder's upload) stands in for the words, with its own edge. */\n.OjkoAFfgIQWkff_cKpRf > svg,\n.OjkoAFfgIQWkff_cKpRf > strong,\n.OjkoAFfgIQWkff_cKpRf > span {\n display: none;\n}\n.meCvGtDIqeqhKAtynZ3d.OjkoAFfgIQWkff_cKpRf {\n border: 0;\n background: #fff;\n}\n.cUFSqapO5YVXlS_kCjQ_ .meCvGtDIqeqhKAtynZ3d {\n display: flex;\n}\n.cUFSqapO5YVXlS_kCjQ_ cdtr-media-player {\n display: none !important;\n}\n","",{version:3,sources:["webpack://./../web-editors/video-editor-component/lib/style.module.css"],names:[],mappings:"AAAA;EACE,kBAAkB;EAClB,eAAe;AACjB;AACA;EACE,WAAW;EACX,YAAY;EACZ,OAAO;EACP,MAAM;EACN,kBAAkB;EAClB,YAAY;AACd;;AAEA;EACE,cAAc;EACd,gCAAgC;AAClC;;AAEA,2DAA2D;AAC3D;EACE,aAAa;EACb,sBAAsB;EACtB,eAAe;EACf,iBAAiB;EACjB,sBAAsB;EACtB,mBAAmB;EACnB,uBAAuB;EACvB,QAAQ;EACR,yBAAyB;EACzB,kBAAkB;EAClB,mBAAmB;EACnB,cAAc;EACd,eAAe;EACf,kBAAkB;AACpB;AACA;EACE,WAAW;EACX,YAAY;EACZ,kBAAkB;EAClB,UAAU;EACV,oBAAoB;EACpB,iBAAiB;EACjB,sBAAsB;AACxB;AACA;EACE,kBAAkB;EAClB,YAAY;AACd;AACA;EACE,eAAe;EACf,gBAAgB;EAChB,cAAc;AAChB;AACA,qGAAqG;AACrG;;;EAGE,aAAa;AACf;AACA;EACE,SAAS;EACT,gBAAgB;AAClB;AACA;EACE,aAAa;AACf;AACA;EACE,wBAAwB;AAC1B",sourcesContent:[".root {\n position: relative;\n max-width: 100%;\n}\n.cover {\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n position: absolute;\n opacity: 0.6;\n}\n\n.root:hover .cover {\n display: block;\n background-color: var(--primary);\n}\n\n/* no link yet: a quiet placeholder the size of the video */\n.empty {\n display: none;\n box-sizing: border-box;\n max-width: 100%;\n min-height: 160px;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 6px;\n border: 1px solid #dcdde3;\n border-radius: 8px;\n background: #eeeff2;\n color: #6b6880;\n font-size: 13px;\n text-align: center;\n}\n.empty svg {\n width: 40px;\n height: 40px;\n margin-bottom: 4px;\n fill: none;\n stroke: currentColor;\n stroke-width: 1.5;\n stroke-linejoin: round;\n}\n.empty svg path {\n fill: currentColor;\n stroke: none;\n}\n.empty strong {\n font-size: 15px;\n font-weight: 500;\n color: #1f1d2b;\n}\n/* The page's own content (the course builder's upload) stands in for the words, with its own edge. */\n.hosted > svg,\n.hosted > strong,\n.hosted > span {\n display: none;\n}\n.empty.hosted {\n border: 0;\n background: #fff;\n}\n.blank .empty {\n display: flex;\n}\n.blank cdtr-media-player {\n display: none !important;\n}\n"],sourceRoot:""}]),i.locals={root:"BaT92HY5C7Gxgg9C1_pc",cover:"aybkK2AXl8f2XctkkRjJ",empty:"meCvGtDIqeqhKAtynZ3d",hosted:"OjkoAFfgIQWkff_cKpRf",blank:"cUFSqapO5YVXlS_kCjQ_"};const s=i}}]);
|
|
Binary file
|