@creaditor/newsletter-starterkit 1.0.53 → 1.0.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/1260.creaditor.bundle.js +297 -128
- package/dist/1260.creaditor.bundle.js.gz +0 -0
- package/dist/1271.creaditor.bundle.js +1 -439
- package/dist/1271.creaditor.bundle.js.gz +0 -0
- package/dist/1403.creaditor.bundle.js +110 -0
- package/dist/1403.creaditor.bundle.js.gz +0 -0
- package/dist/1529.creaditor.bundle.js +1 -1
- package/dist/1529.creaditor.bundle.js.gz +0 -0
- package/dist/1565.creaditor.bundle.js +338 -138
- package/dist/1565.creaditor.bundle.js.gz +0 -0
- package/dist/168.creaditor.bundle.js +4 -4
- package/dist/168.creaditor.bundle.js.gz +0 -0
- package/dist/170.creaditor.bundle.js +11 -5
- package/dist/170.creaditor.bundle.js.gz +0 -0
- package/dist/2384.creaditor.bundle.js +56 -8
- package/dist/2384.creaditor.bundle.js.gz +0 -0
- package/dist/2590.creaditor.bundle.js +1 -2
- package/dist/2590.creaditor.bundle.js.gz +0 -0
- package/dist/3095.creaditor.bundle.js +91 -58
- package/dist/3095.creaditor.bundle.js.gz +0 -0
- package/dist/3521.creaditor.bundle.js +11 -9
- package/dist/3521.creaditor.bundle.js.gz +0 -0
- package/dist/3553.creaditor.bundle.js +1 -1
- package/dist/3553.creaditor.bundle.js.gz +0 -0
- package/dist/3932.creaditor.bundle.js +3 -3
- package/dist/3932.creaditor.bundle.js.gz +0 -0
- package/dist/4114.creaditor.bundle.js +1 -0
- package/dist/4114.creaditor.bundle.js.gz +0 -0
- package/dist/4186.creaditor.bundle.js +1 -1
- package/dist/4186.creaditor.bundle.js.gz +0 -0
- package/dist/453.creaditor.bundle.js +1 -1
- package/dist/453.creaditor.bundle.js.gz +0 -0
- package/dist/4569.creaditor.bundle.js +30 -190
- package/dist/4569.creaditor.bundle.js.gz +0 -0
- package/dist/4819.creaditor.bundle.js +198 -235
- package/dist/4819.creaditor.bundle.js.gz +0 -0
- package/dist/5340.creaditor.bundle.js +126 -36
- package/dist/5340.creaditor.bundle.js.gz +0 -0
- package/dist/574.creaditor.bundle.js +5 -5
- package/dist/574.creaditor.bundle.js.gz +0 -0
- package/dist/589.creaditor.bundle.js +9 -9
- package/dist/589.creaditor.bundle.js.gz +0 -0
- package/dist/5926.creaditor.bundle.js +24 -31
- package/dist/5926.creaditor.bundle.js.gz +0 -0
- package/dist/638.creaditor.bundle.js +3 -3
- package/dist/638.creaditor.bundle.js.gz +0 -0
- package/dist/6713.creaditor.bundle.js +151 -0
- package/dist/6713.creaditor.bundle.js.gz +0 -0
- package/dist/7209.creaditor.bundle.js +2 -3
- package/dist/7209.creaditor.bundle.js.gz +0 -0
- package/dist/7238.creaditor.bundle.js +3 -3
- package/dist/7238.creaditor.bundle.js.gz +0 -0
- package/dist/752.creaditor.bundle.js +3 -7
- package/dist/752.creaditor.bundle.js.gz +0 -0
- package/dist/763.creaditor.bundle.js +1 -1
- package/dist/763.creaditor.bundle.js.gz +0 -0
- package/dist/7789.creaditor.bundle.js +25 -0
- package/dist/7789.creaditor.bundle.js.LICENSE.txt +32 -0
- package/dist/7789.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/7789.creaditor.bundle.js.gz +0 -0
- package/dist/7937.creaditor.bundle.js +63 -115
- package/dist/7937.creaditor.bundle.js.gz +0 -0
- package/dist/8173.creaditor.bundle.js +1 -1
- package/dist/8173.creaditor.bundle.js.gz +0 -0
- package/dist/8305.creaditor.bundle.js +6 -6
- package/dist/8305.creaditor.bundle.js.gz +0 -0
- package/dist/8516.creaditor.bundle.js +1 -1
- package/dist/8516.creaditor.bundle.js.gz +0 -0
- package/dist/8676.creaditor.bundle.js +1 -0
- package/dist/8676.creaditor.bundle.js.gz +0 -0
- package/dist/8916.creaditor.bundle.js +4 -4
- package/dist/8916.creaditor.bundle.js.gz +0 -0
- package/dist/9041.creaditor.bundle.js +1 -1
- package/dist/9041.creaditor.bundle.js.gz +0 -0
- package/dist/9158.creaditor.bundle.js +613 -0
- package/dist/9158.creaditor.bundle.js.LICENSE.txt +10 -0
- package/dist/9158.creaditor.bundle.js.LICENSE.txt.gz +0 -0
- package/dist/9158.creaditor.bundle.js.gz +0 -0
- package/dist/9162.creaditor.bundle.js +4 -3
- package/dist/9162.creaditor.bundle.js.gz +0 -0
- package/dist/9694.creaditor.bundle.js +1 -1
- package/dist/9694.creaditor.bundle.js.gz +0 -0
- package/dist/creaditor.bundle.js +2795 -874
- package/dist/creaditor.bundle.js.gz +0 -0
- package/dist/service-worker.js +1 -1
- package/dist/service-worker.js.gz +0 -0
- package/package.json +1 -1
|
@@ -1,38 +1,100 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5340],{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5340],{12258(e,t,o){o.d(t,{A:()=>c});var n=o(59929),s=o(40648);class i extends n.WF{constructor(){super(),this.label="",this.open=!0,this.persistKey=""}toggle(){this.open=!this.open,(0,s.Q)(this.persistKey,this.open)}render(){return n.qy`
|
|
2
|
+
<div class="section">
|
|
3
|
+
<div class="header" @click=${this.toggle}>
|
|
4
|
+
<span class="title"><lang-text text="${this.label}"></lang-text></span>
|
|
5
|
+
<svg class="chevron ${this.open?"open":""}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
6
|
+
<polyline points="6 9 12 15 18 9"></polyline>
|
|
7
|
+
</svg>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="content ${this.open?"open":""}">
|
|
10
|
+
<div class="content-inner">
|
|
11
|
+
<slot></slot>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
`}}i.styles=n.AH`
|
|
16
|
+
:host {
|
|
17
|
+
display: block;
|
|
18
|
+
direction: var(--direction-locale, ltr);
|
|
19
|
+
--editor-container-inline-padding: 0;
|
|
20
|
+
}
|
|
21
|
+
.section {
|
|
22
|
+
border-bottom: 1px solid #eaeaee;
|
|
23
|
+
}
|
|
24
|
+
.header {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: space-between;
|
|
28
|
+
padding: 12px 16px;
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
user-select: none;
|
|
31
|
+
}
|
|
32
|
+
.title {
|
|
33
|
+
font-size: 12.5px;
|
|
34
|
+
font-weight: 600;
|
|
35
|
+
color: #222;
|
|
36
|
+
letter-spacing: 0.01em;
|
|
37
|
+
}
|
|
38
|
+
.chevron {
|
|
39
|
+
width: 16px;
|
|
40
|
+
height: 16px;
|
|
41
|
+
transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.15s ease;
|
|
42
|
+
color: #ccc;
|
|
43
|
+
}
|
|
44
|
+
.header:hover .chevron {
|
|
45
|
+
color: #888;
|
|
46
|
+
}
|
|
47
|
+
.chevron.open {
|
|
48
|
+
transform: rotate(180deg);
|
|
49
|
+
}
|
|
50
|
+
.content {
|
|
51
|
+
overflow: hidden;
|
|
52
|
+
transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
|
|
53
|
+
max-height: 0;
|
|
54
|
+
opacity: 0;
|
|
55
|
+
}
|
|
56
|
+
.content.open {
|
|
57
|
+
max-height: 1200px;
|
|
58
|
+
opacity: 1;
|
|
59
|
+
}
|
|
60
|
+
.content-inner {
|
|
61
|
+
padding: 0 16px 12px 16px;
|
|
62
|
+
}
|
|
63
|
+
`,i.properties={label:{type:String},open:{type:Boolean},persistKey:{type:String}},customElements.define("cdtr-editor-section",i);const c=(e,t)=>n.qy`
|
|
64
|
+
<cdtr-editor-section
|
|
65
|
+
.label=${e.label}
|
|
66
|
+
.open=${!1!==e.open}
|
|
67
|
+
.persistKey=${e.persistKey||""}
|
|
68
|
+
>
|
|
69
|
+
${t}
|
|
70
|
+
</cdtr-editor-section>
|
|
71
|
+
`},40648(e,t,o){o.d(t,{Q:()=>c,i:()=>i});const n="cdtr:section-open";function s(){try{const e=localStorage.getItem(n);return e?JSON.parse(e):{}}catch(e){return{}}}function i(e){if(!e)return;const t=s();return Object.prototype.hasOwnProperty.call(t,e)?!!t[e]:void 0}function c(e,t){if(!e)return;const o=s();o[e]=!!t,function(e){try{localStorage.setItem(n,JSON.stringify(e))}catch(e){}}(o)}},45340(e,t,o){o.r(t),o.d(t,{SettingEditor:()=>r});var n=o(59929),s=o(86319),i=o(36565),c=(o(12258),o(79307));class r extends n.WF{constructor(){super(),this.onInspect=this.onInspect.bind(this),this.name="",this.element_ID=" ",this.cmds={onToggleDisplayMode:(e,t)=>{i.Ay.store().execCommand(`show_on_${e}`,t),this[`show_on_${e}`]=t},onChangeElementID(e){i.Ay.store().execCommand("element_ID",e.target.value)},onChangeName(e){i.Ay.store().execCommand("name",e.target.value)}}}onInspect(){if(i.Ay.components.length>0){const e=i.Ay.components[0].props;this.show_on_desktop=!!e.show_on_desktop,this.show_on_tablet=!!e.show_on_tablet,this.show_on_mobile=!!e.show_on_mobile,this.name=e.name||"",this.element_ID=e.element_ID||""}}connectedCallback(){super.connectedCallback(),i.Ay.on("select",this.onInspect),i.Ay.on("update",this.onInspect),this.onInspect()}disconnectedCallback(){super.disconnectedCallback(),i.Ay.off("select",this.onInspect),i.Ay.off("update",this.onInspect)}render(){const e="block"===i.Ay.getSelectedComponent()[0].type,t="web"===s.M.get("config","channel");return n.qy`
|
|
72
|
+
${e&&t?n.qy`<cdtr-editor-section label="display_mode" .open=${!0}>
|
|
73
|
+
<div class="device-toggle-row">
|
|
74
|
+
<div
|
|
75
|
+
class="device-toggle-btn ${this.show_on_desktop?"active":""}"
|
|
76
|
+
@click=${()=>this.cmds.onToggleDisplayMode("desktop",!this.show_on_desktop)}
|
|
8
77
|
>
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<cdtr-checkbox
|
|
16
|
-
.checked=${this.show_on_tablet}
|
|
17
|
-
@change="${t=>this.cmds.onToggleDisplayMode("tablet",!t.target.checked)}"
|
|
78
|
+
<svg width="14" height="14" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">${c.oe}</svg>
|
|
79
|
+
<lang-text text="desktop"></lang-text>
|
|
80
|
+
</div>
|
|
81
|
+
<div
|
|
82
|
+
class="device-toggle-btn ${this.show_on_tablet?"active":""}"
|
|
83
|
+
@click=${()=>this.cmds.onToggleDisplayMode("tablet",!this.show_on_tablet)}
|
|
18
84
|
>
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
.checked=${this.show_on_mobile}
|
|
26
|
-
@change="${t=>this.cmds.onToggleDisplayMode("mobile",!t.target.checked)}"
|
|
85
|
+
<svg width="14" height="14" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">${c.kN}</svg>
|
|
86
|
+
<lang-text text="tablet"></lang-text>
|
|
87
|
+
</div>
|
|
88
|
+
<div
|
|
89
|
+
class="device-toggle-btn ${this.show_on_mobile?"active":""}"
|
|
90
|
+
@click=${()=>this.cmds.onToggleDisplayMode("mobile",!this.show_on_mobile)}
|
|
27
91
|
>
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
</
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<cdtr-accordion-item isOpen="true" label="properties">
|
|
35
|
-
<cdtr-editor-container>
|
|
92
|
+
<svg width="14" height="14" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">${c.S9}</svg>
|
|
93
|
+
<lang-text text="mobile"></lang-text>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
</cdtr-editor-section>`:n.qy``}
|
|
97
|
+
<cdtr-editor-section label="properties" .open=${!0}>
|
|
36
98
|
<cdtr-row mt="1">
|
|
37
99
|
<cdtr-title><lang-text text="name"></lang-text></cdtr-title>
|
|
38
100
|
</cdtr-row>
|
|
@@ -57,10 +119,38 @@
|
|
|
57
119
|
style="width:100%"
|
|
58
120
|
></cdtr-input>
|
|
59
121
|
</cdtr-row>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
`}}s.properties={name:{},element_ID:{},show_on_desktop:{},show_on_tablet:{},show_on_mobile:{}},s.styles=n.AH`
|
|
122
|
+
</cdtr-editor-section>
|
|
123
|
+
`}}r.properties={name:{},element_ID:{},show_on_desktop:{},show_on_tablet:{},show_on_mobile:{}},r.styles=n.AH`
|
|
63
124
|
:host {
|
|
64
125
|
direction: var(--direction-locale);
|
|
65
126
|
}
|
|
66
|
-
|
|
127
|
+
.device-toggle-row {
|
|
128
|
+
display: flex;
|
|
129
|
+
gap: 6px;
|
|
130
|
+
}
|
|
131
|
+
.device-toggle-btn {
|
|
132
|
+
display: flex;
|
|
133
|
+
align-items: center;
|
|
134
|
+
gap: 4px;
|
|
135
|
+
padding: 7px 8px;
|
|
136
|
+
border: none;
|
|
137
|
+
border-radius: 6px;
|
|
138
|
+
cursor: pointer;
|
|
139
|
+
color: #bbb;
|
|
140
|
+
background: #f4f4f6;
|
|
141
|
+
transition: all 0.15s;
|
|
142
|
+
font-size: 12px;
|
|
143
|
+
}
|
|
144
|
+
.device-toggle-btn:hover {
|
|
145
|
+
background: #eaeaed;
|
|
146
|
+
color: #888;
|
|
147
|
+
}
|
|
148
|
+
.device-toggle-btn svg {
|
|
149
|
+
fill: currentColor;
|
|
150
|
+
flex-shrink: 0;
|
|
151
|
+
}
|
|
152
|
+
.device-toggle-btn.active {
|
|
153
|
+
background: color-mix(in srgb, var(--accent, #5B5FC7) 12%, transparent);
|
|
154
|
+
color: var(--accent, #5B5FC7);
|
|
155
|
+
}
|
|
156
|
+
`,customElements.define("cdtr-setting-editor",r)}}]);
|
|
Binary file
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! For license information please see 574.creaditor.bundle.js.LICENSE.txt */
|
|
2
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[574],{
|
|
2
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[574],{50574(e,t,n){var i=n(69130),o=n(35915),a=(n(12479),n(19)),r=n(95586),s=n(53874),l=n(47351);(0,r.b)({_template:l.q`
|
|
3
3
|
<style>
|
|
4
4
|
:host {
|
|
5
5
|
@apply --layout-inline;
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
display: none;
|
|
21
21
|
}
|
|
22
22
|
</style>
|
|
23
|
-
`,is:"iron-icon",properties:{icon:{type:String},theme:{type:String},src:{type:String},_meta:{value:i.C6.create("iron-meta",{type:"iconset"})}},observers:["_updateIcon(_meta, isAttached)","_updateIcon(theme, isAttached)","_srcChanged(src, isAttached)","_iconChanged(icon, isAttached)"],_DEFAULT_ICONSET:"icons",_iconChanged:function(e){var t=(e||"").split(":");this._iconName=t.pop(),this._iconsetName=t.pop()||this._DEFAULT_ICONSET,this._updateIcon()},_srcChanged:function(e){this._updateIcon()},_usesIconset:function(){return this.icon||!this.src},_updateIcon:function(){this._usesIconset()?(this._img&&this._img.parentNode&&(0,s.tT)(this.root).removeChild(this._img),""===this._iconName?this._iconset&&this._iconset.removeIcon(this):this._iconsetName&&this._meta&&(this._iconset=this._meta.byKey(this._iconsetName),this._iconset?(this._iconset.applyIcon(this,this._iconName,this.theme),this.unlisten(window,"iron-iconset-added","_updateIcon")):this.listen(window,"iron-iconset-added","_updateIcon"))):(this._iconset&&this._iconset.removeIcon(this),this._img||(this._img=document.createElement("img"),this._img.style.width="100%",this._img.style.height="100%",this._img.draggable=!1),this._img.src=this.src,(0,s.tT)(this.root).appendChild(this._img))}});n(
|
|
23
|
+
`,is:"iron-icon",properties:{icon:{type:String},theme:{type:String},src:{type:String},_meta:{value:i.C6.create("iron-meta",{type:"iconset"})}},observers:["_updateIcon(_meta, isAttached)","_updateIcon(theme, isAttached)","_srcChanged(src, isAttached)","_iconChanged(icon, isAttached)"],_DEFAULT_ICONSET:"icons",_iconChanged:function(e){var t=(e||"").split(":");this._iconName=t.pop(),this._iconsetName=t.pop()||this._DEFAULT_ICONSET,this._updateIcon()},_srcChanged:function(e){this._updateIcon()},_usesIconset:function(){return this.icon||!this.src},_updateIcon:function(){this._usesIconset()?(this._img&&this._img.parentNode&&(0,s.tT)(this.root).removeChild(this._img),""===this._iconName?this._iconset&&this._iconset.removeIcon(this):this._iconsetName&&this._meta&&(this._iconset=this._meta.byKey(this._iconsetName),this._iconset?(this._iconset.applyIcon(this,this._iconName,this.theme),this.unlisten(window,"iron-iconset-added","_updateIcon")):this.listen(window,"iron-iconset-added","_updateIcon"))):(this._iconset&&this._iconset.removeIcon(this),this._img||(this._img=document.createElement("img"),this._img.style.width="100%",this._img.style.height="100%",this._img.draggable=!1),this._img.src=this.src,(0,s.tT)(this.root).appendChild(this._img))}});n(9158);var p=n(90703),c=n(68876),d=n(74396);(0,r.b)({_template:l.q`
|
|
24
24
|
<style>
|
|
25
25
|
:host {
|
|
26
26
|
position: fixed;
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
<div id="contentWrapper">
|
|
40
40
|
<slot id="content" name="dropdown-content"></slot>
|
|
41
41
|
</div>
|
|
42
|
-
`,is:"iron-dropdown",behaviors:[
|
|
42
|
+
`,is:"iron-dropdown",behaviors:[p.x,o.D,c.r,d.L],properties:{horizontalAlign:{type:String,value:"left",reflectToAttribute:!0},verticalAlign:{type:String,value:"top",reflectToAttribute:!0},openAnimationConfig:{type:Object},closeAnimationConfig:{type:Object},focusTarget:{type:Object},noAnimations:{type:Boolean,value:!1},allowOutsideScroll:{type:Boolean,value:!1,observer:"_allowOutsideScrollChanged"}},listeners:{"neon-animation-finish":"_onNeonAnimationFinish"},observers:["_updateOverlayPosition(positionTarget, verticalAlign, horizontalAlign, verticalOffset, horizontalOffset)"],get containedElement(){for(var e=(0,s.tT)(this.$.content).getDistributedNodes(),t=0,n=e.length;t<n;t++)if(e[t].nodeType===Node.ELEMENT_NODE)return e[t]},ready:function(){this.scrollAction||(this.scrollAction=this.allowOutsideScroll?"refit":"lock"),this._readied=!0},attached:function(){this.sizingTarget&&this.sizingTarget!==this||(this.sizingTarget=this.containedElement||this)},detached:function(){this.cancelAnimation()},_openedChanged:function(){this.opened&&this.disabled?this.cancel():(this.cancelAnimation(),this._updateAnimationConfig(),c.N._openedChanged.apply(this,arguments))},_renderOpened:function(){!this.noAnimations&&this.animationConfig.open?(this.$.contentWrapper.classList.add("animating"),this.playAnimation("open")):c.N._renderOpened.apply(this,arguments)},_renderClosed:function(){!this.noAnimations&&this.animationConfig.close?(this.$.contentWrapper.classList.add("animating"),this.playAnimation("close")):c.N._renderClosed.apply(this,arguments)},_onNeonAnimationFinish:function(){this.$.contentWrapper.classList.remove("animating"),this.opened?this._finishRenderOpened():this._finishRenderClosed()},_updateAnimationConfig:function(){for(var e=this.containedElement,t=[].concat(this.openAnimationConfig||[]).concat(this.closeAnimationConfig||[]),n=0;n<t.length;n++)t[n].node=e;this.animationConfig={open:this.openAnimationConfig,close:this.closeAnimationConfig}},_updateOverlayPosition:function(){this.isAttached&&this.notifyResize()},_allowOutsideScrollChanged:function(e){this._readied&&(e?this.scrollAction&&"lock"!==this.scrollAction||(this.scrollAction="refit"):this.scrollAction="lock")},_applyFocus:function(){var e=this.focusTarget||this.containedElement;e&&this.opened&&!this.noAutoFocus?e.focus():c.N._applyFocus.apply(this,arguments)}});const h={properties:{animationTiming:{type:Object,value:function(){return{duration:500,easing:"cubic-bezier(0.4, 0, 0.2, 1)",fill:"both"}}}},isNeonAnimation:!0,created:function(){document.body.animate||console.warn("No web animations detected. This element will not function without a web animations polyfill.")},timingFromConfig:function(e){if(e.timing)for(var t in e.timing)this.animationTiming[t]=e.timing[t];return this.animationTiming},setPrefixedProperty:function(e,t,n){for(var i,o={transform:["webkitTransform"],transformOrigin:["mozTransformOrigin","webkitTransformOrigin"]}[t],a=0;i=o[a];a++)e.style[i]=n;e.style[t]=n},complete:function(e){}};(0,r.b)({is:"fade-in-animation",behaviors:[h],configure:function(e){var t=e.node;return this._effect=new KeyframeEffect(t,[{opacity:"0"},{opacity:"1"}],this.timingFromConfig(e)),this._effect}}),(0,r.b)({is:"fade-out-animation",behaviors:[h],configure:function(e){var t=e.node;return this._effect=new KeyframeEffect(t,[{opacity:"1"},{opacity:"0"}],this.timingFromConfig(e)),this._effect}});n(45611),n(48176);(0,r.b)({is:"paper-menu-grow-height-animation",_template:null,behaviors:[h],configure:function(e){var t=e.node,n=t.getBoundingClientRect().height;return this._effect=new KeyframeEffect(t,[{height:n/2+"px"},{height:n+"px"}],this.timingFromConfig(e)),this._effect}}),(0,r.b)({is:"paper-menu-grow-width-animation",_template:null,behaviors:[h],configure:function(e){var t=e.node,n=t.getBoundingClientRect().width;return this._effect=new KeyframeEffect(t,[{width:n/2+"px"},{width:n+"px"}],this.timingFromConfig(e)),this._effect}}),(0,r.b)({is:"paper-menu-shrink-width-animation",_template:null,behaviors:[h],configure:function(e){var t=e.node,n=t.getBoundingClientRect().width;return this._effect=new KeyframeEffect(t,[{width:n+"px"},{width:n-n/20+"px"}],this.timingFromConfig(e)),this._effect}}),(0,r.b)({is:"paper-menu-shrink-height-animation",_template:null,behaviors:[h],configure:function(e){var t=e.node,n=t.getBoundingClientRect().height;return this.setPrefixedProperty(t,"transformOrigin","0 0"),this._effect=new KeyframeEffect(t,[{height:n+"px",transform:"translateY(0)"},{height:n/2+"px",transform:"translateY(-20px)"}],this.timingFromConfig(e)),this._effect}});var u={ANIMATION_CUBIC_BEZIER:"cubic-bezier(.3,.95,.5,1)",MAX_ANIMATION_TIME_MS:400};const m=(0,r.b)({_template:l.q`
|
|
43
43
|
<style>
|
|
44
44
|
:host {
|
|
45
45
|
display: inline-block;
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
<slot id="content" name="dropdown-content"></slot>
|
|
98
98
|
</div>
|
|
99
99
|
</iron-dropdown>
|
|
100
|
-
`,is:"paper-menu-button",behaviors:[o.D,
|
|
100
|
+
`,is:"paper-menu-button",behaviors:[o.D,p.x],properties:{opened:{type:Boolean,value:!1,notify:!0,observer:"_openedChanged"},horizontalAlign:{type:String,value:"left",reflectToAttribute:!0},verticalAlign:{type:String,value:"top",reflectToAttribute:!0},dynamicAlign:{type:Boolean},horizontalOffset:{type:Number,value:0,notify:!0},verticalOffset:{type:Number,value:0,notify:!0},noOverlap:{type:Boolean},noAnimations:{type:Boolean,value:!1},ignoreSelect:{type:Boolean,value:!1},closeOnActivate:{type:Boolean,value:!1},openAnimationConfig:{type:Object,value:function(){return[{name:"fade-in-animation",timing:{delay:100,duration:200}},{name:"paper-menu-grow-width-animation",timing:{delay:100,duration:150,easing:u.ANIMATION_CUBIC_BEZIER}},{name:"paper-menu-grow-height-animation",timing:{delay:100,duration:275,easing:u.ANIMATION_CUBIC_BEZIER}}]}},closeAnimationConfig:{type:Object,value:function(){return[{name:"fade-out-animation",timing:{duration:150}},{name:"paper-menu-shrink-width-animation",timing:{delay:100,duration:50,easing:u.ANIMATION_CUBIC_BEZIER}},{name:"paper-menu-shrink-height-animation",timing:{duration:200,easing:"ease-in"}}]}},allowOutsideScroll:{type:Boolean,value:!1},restoreFocusOnClose:{type:Boolean,value:!0},expandSizingTargetForScrollbars:{type:Boolean,value:!1},_dropdownContent:{type:Object}},hostAttributes:{role:"group","aria-haspopup":"true"},listeners:{"iron-activate":"_onIronActivate","iron-select":"_onIronSelect"},get contentElement(){for(var e=(0,s.tT)(this.$.content).getDistributedNodes(),t=0,n=e.length;t<n;t++)if(e[t].nodeType===Node.ELEMENT_NODE)return e[t]},toggle:function(){this.opened?this.close():this.open()},open:function(){this.disabled||this.$.dropdown.open()},close:function(){this.$.dropdown.close()},_onIronSelect:function(e){this.ignoreSelect||this.close()},_onIronActivate:function(e){this.closeOnActivate&&this.close()},_openedChanged:function(e,t){e?(this._dropdownContent=this.contentElement,this.fire("paper-dropdown-open")):null!=t&&this.fire("paper-dropdown-close")},_disabledChanged:function(e){p.x._disabledChanged.apply(this,arguments),e&&this.opened&&this.close()},__onIronOverlayCanceled:function(e){var t=e.detail,n=this.$.trigger;(0,s.tT)(t).path.indexOf(n)>-1&&e.preventDefault()}});Object.keys(u).forEach(function(e){m[e]=u[e]});n(82491);(0,r.b)({is:"iron-iconset-svg",properties:{name:{type:String,observer:"_nameChanged"},size:{type:Number,value:24},rtlMirroring:{type:Boolean,value:!1},useGlobalRtlAttribute:{type:Boolean,value:!1}},created:function(){this._meta=new a.s({type:"iconset",key:null,value:null})},attached:function(){this.style.display="none"},getIconNames:function(){return this._icons=this._createIconMap(),Object.keys(this._icons).map(function(e){return this.name+":"+e},this)},applyIcon:function(e,t){this.removeIcon(e);var n=this._cloneIcon(t,this.rtlMirroring&&this._targetIsRTL(e));if(n){var i=(0,s.tT)(e.root||e);return i.insertBefore(n,i.childNodes[0]),e._svgIcon=n}return null},removeIcon:function(e){e._svgIcon&&((0,s.tT)(e.root||e).removeChild(e._svgIcon),e._svgIcon=null)},_targetIsRTL:function(e){if(null==this.__targetIsRTL)if(this.useGlobalRtlAttribute){var t=document.body&&document.body.hasAttribute("dir")?document.body:document.documentElement;this.__targetIsRTL="rtl"===t.getAttribute("dir")}else e&&e.nodeType!==Node.ELEMENT_NODE&&(e=e.host),this.__targetIsRTL=e&&"rtl"===window.getComputedStyle(e).direction;return this.__targetIsRTL},_nameChanged:function(){this._meta.value=null,this._meta.key=this.name,this._meta.value=this,this.async(function(){this.fire("iron-iconset-added",this,{node:window})})},_createIconMap:function(){var e=Object.create(null);return(0,s.tT)(this).querySelectorAll("[id]").forEach(function(t){e[t.id]=t}),e},_cloneIcon:function(e,t){return this._icons=this._icons||this._createIconMap(),this._prepareSvgClone(this._icons[e],this.size,t)},_prepareSvgClone:function(e,t,n){if(e){var i=e.cloneNode(!0),o=document.createElementNS("http://www.w3.org/2000/svg","svg"),a=i.getAttribute("viewBox")||"0 0 "+t+" "+t,r="pointer-events: none; display: block; width: 100%; height: 100%;";return n&&i.hasAttribute("mirror-in-rtl")&&(r+="-webkit-transform:scale(-1,1);transform:scale(-1,1);transform-origin:center;"),o.setAttribute("viewBox",a),o.setAttribute("preserveAspectRatio","xMidYMid meet"),o.setAttribute("focusable","false"),o.style.cssText=r,o.appendChild(i).removeAttribute("id"),o}return null}});const g=document.createElement("template");g.setAttribute("style","display: none;"),g.innerHTML='<iron-iconset-svg name="paper-dropdown-menu" size="24">\n<svg><defs>\n<g id="arrow-drop-down"><path d="M7 10l5 5 5-5z"></path></g>\n</defs></svg>\n</iron-iconset-svg>',document.head.appendChild(g.content);const f=document.createElement("template");f.setAttribute("style","display: none;"),f.innerHTML='<dom-module id="paper-dropdown-menu-shared-styles">\n <template>\n <style>\n :host {\n display: inline-block;\n position: relative;\n text-align: left;\n\n /* NOTE(cdata): Both values are needed, since some phones require the\n * value to be `transparent`.\n */\n -webkit-tap-highlight-color: rgba(0,0,0,0);\n -webkit-tap-highlight-color: transparent;\n\n --paper-input-container-input: {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n max-width: 100%;\n box-sizing: border-box;\n cursor: pointer;\n };\n\n @apply --paper-dropdown-menu;\n }\n\n /* paper-dropdown-menu and paper-dropdown-menu-light both delegate focus\n * to other internal elements which manage focus styling. */\n :host(:focus) {\n outline: none;\n }\n\n :host(:dir(rtl)) {\n text-align: right;\n\n @apply(--paper-dropdown-menu);\n }\n\n :host([disabled]) {\n @apply --paper-dropdown-menu-disabled;\n }\n\n :host([noink]) paper-ripple {\n display: none;\n }\n\n :host([no-label-float]) paper-ripple {\n top: 8px;\n }\n\n paper-ripple {\n top: 12px;\n left: 0px;\n bottom: 8px;\n right: 0px;\n\n @apply --paper-dropdown-menu-ripple;\n }\n\n paper-menu-button {\n display: block;\n padding: 0;\n\n @apply --paper-dropdown-menu-button;\n }\n\n paper-input {\n @apply --paper-dropdown-menu-input;\n }\n\n iron-icon {\n color: var(--disabled-text-color);\n\n @apply --paper-dropdown-menu-icon;\n }\n </style>\n </template>\n</dom-module>',document.head.appendChild(f.content);var y=n(71920),v=n(19911),_=n(18811),b=n(94794),w=n(15055),A=n(13107);const C=(0,b.r)(HTMLElement);(0,r.b)({_template:l.q`
|
|
101
101
|
<style include="paper-dropdown-menu-shared-styles"></style>
|
|
102
102
|
|
|
103
103
|
<paper-menu-button id="menuButton" vertical-align="[[verticalAlign]]" horizontal-align="[[horizontalAlign]]" dynamic-align="[[dynamicAlign]]" vertical-offset="[[_computeMenuVerticalOffset(noLabelFloat, verticalOffset)]]" disabled="[[disabled]]" no-animations="[[noAnimations]]" on-iron-select="_onIronSelect" on-iron-deselect="_onIronDeselect" opened="{{opened}}" close-on-activate allow-outside-scroll="[[allowOutsideScroll]]" restore-focus-on-close="[[restoreFocusOnClose]]" expand-sizing-target-for-scrollbars="[[expandSizingTargetForScrollbars]]">
|
|
@@ -112,4 +112,4 @@
|
|
|
112
112
|
</div>
|
|
113
113
|
<slot id="content" name="dropdown-content" slot="dropdown-content"></slot>
|
|
114
114
|
</paper-menu-button>
|
|
115
|
-
`,is:"paper-dropdown-menu",behaviors:[
|
|
115
|
+
`,is:"paper-dropdown-menu",behaviors:[y.a,p.x,v.x,_.Q],properties:{selectedItemLabel:{type:String,notify:!0,readOnly:!0},selectedItem:{type:Object,notify:!0,readOnly:!0},value:{type:String,notify:!0},label:{type:String},placeholder:{type:String},errorMessage:{type:String},opened:{type:Boolean,notify:!0,value:!1,observer:"_openedChanged"},allowOutsideScroll:{type:Boolean,value:!1},noLabelFloat:{type:Boolean,value:!1,reflectToAttribute:!0},alwaysFloatLabel:{type:Boolean,value:!1},noAnimations:{type:Boolean,value:!1},horizontalAlign:{type:String,value:"right"},verticalAlign:{type:String,value:"top"},verticalOffset:Number,dynamicAlign:{type:Boolean},restoreFocusOnClose:{type:Boolean,value:!0},expandSizingTargetForScrollbars:{type:Boolean,value:!1}},listeners:{tap:"_onTap"},keyBindings:{"up down":"open",esc:"close"},observers:["_selectedItemChanged(selectedItem)"],_attachDom(e){const t=(0,A.L)(this);return t.attachShadow({mode:"open",delegatesFocus:!0,shadyUpgradeFragment:e}),t.shadowRoot.appendChild(e),C.prototype._attachDom.call(this,e)},focus(){this.$.input._focusableElement.focus()},attached:function(){var e=this.contentElement;e&&e.selectedItem&&this._setSelectedItem(e.selectedItem)},get contentElement(){for(var e=(0,s.tT)(this.$.content).getDistributedNodes(),t=0,n=e.length;t<n;t++)if(e[t].nodeType===Node.ELEMENT_NODE)return e[t]},open:function(){this.$.menuButton.open()},close:function(){this.$.menuButton.close()},_onIronSelect:function(e){this._setSelectedItem(e.detail.item)},_onIronDeselect:function(e){this._setSelectedItem(null)},_onTap:function(e){w.Ix(e)===this&&this.open()},_selectedItemChanged:function(e){var t="";t=e?e.label||e.getAttribute("label")||e.textContent.trim():"",this.value=t,this._setSelectedItemLabel(t)},_computeMenuVerticalOffset:function(e,t){return t||(e?-4:8)},_getValidity:function(e){return this.disabled||!this.required||this.required&&!!this.value},_openedChanged:function(){var e=this.opened?"true":"false",t=this.contentElement;t&&t.setAttribute("aria-expanded",e)}})}}]);
|
|
Binary file
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[589],{589(e,t,r){r.d(t,{default:()=>
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[589],{589(e,t,r){r.d(t,{default:()=>Q});var n=r(12106),s=r(59929);let i={};function o(e){i.selected=e}function c(e){return i.selected}const l="https://img.creaditor.ai",a=[{type:"youtube",src:`${l}/icons/serve/Logos/youtube-line.png?width=34&height=34`},{type:"whatsapp",src:`${l}/icons/serve/Logos/whatsapp-line.png?width=34&height=34`},{type:"snapchat",src:`${l}/icons/serve/Logos/snapchat-line.png?width=34&height=34`},{type:"instagram",src:`${l}/icons/serve/Logos/instagram-line.png?width=34&height=34`},{type:"telegram",src:`${l}/icons/serve/Logos/telegram-line.png?width=34&height=34`},{type:"facebook",src:`${l}/icons/serve/Logos/facebook-line.png?width=34&height=34`},{type:"vimeo",src:`${l}/icons/serve/Logos/vimeo-line.png?width=34&height=34`},{type:"x",src:`${l}/icons/serve/Logos/twitter-x-line.png?width=34&height=34`},{type:"linkedin",src:`${l}/icons/serve/Logos/linkedin-box-line.png?width=34&height=34`},{type:"tiktok",src:`${l}/icons/serve/Logos/tiktok-line.png?width=34&height=34`},{type:"reddit",src:`${l}/icons/serve/Logos/reddit-line.png?width=34&height=34`},{type:"twitch",src:`${l}/icons/serve/Logos/twitch-line.png?width=34&height=34`},{type:"messenger",src:`${l}/icons/serve/Logos/messenger-line.png?width=34&height=34`},{type:"pinterest",src:`${l}/icons/serve/Logos/pinterest-line.png?width=34&height=34`},{type:"discord",src:`${l}/icons/serve/Logos/discord-line.png?width=34&height=34`},{type:"skype",src:`${l}/icons/serve/Logos/skype-line.png?width=34&height=34`},{type:"wechat",src:`${l}/icons/serve/Logos/wechat-2-line.png?width=34&height=34`},{type:"email",src:`${l}/icons/serve/Business/mail-line.png?width=34&height=34`},{type:"phone",src:`${l}/icons/serve/Device/phone-line.png?width=34&height=34`},{type:"home",src:`${l}/icons/serve/Buildings/home-line.png?width=34&height=34`},{type:"website",src:`${l}/icons/serve/Map/globe-line.png?width=34&height=34`},{type:"link",src:`${l}/icons/serve/Editor/link.png?width=34&height=34`},{type:"contact",src:`${l}/icons/serve/Business/customer-service-2-line.png?width=34&height=34`},{type:"address",src:`${l}/icons/serve/Map/map-pin-line.png?width=34&height=34`},{type:"send",src:`${l}/icons/serve/Business/send-plane-line.png?width=34&height=34`}],d={twitter:"x","t.co":"x","x.com":"x",youtu:"youtube","youtu.be":"youtube","fb.com":"facebook","fb.me":"facebook","m.me":"messenger","wa.me":"whatsapp","t.me":"telegram","ig.me":"instagram","lnkd.in":"linkedin"};function p(e,t){if(!t||"string"!=typeof t)return;const r=t.toLowerCase().trim();if(r.startsWith("mailto:"))return"email";if(r.startsWith("tel:"))return"phone";try{const n=(r.startsWith("http")?new URL(t):new URL(`https://${t}`)).hostname.replace("www.",""),s=n.split(".")[0];for(const[e,t]of Object.entries(d))if(n.includes(e)||e===n)return t;const i=e.find(e=>{const t=e.type.toLowerCase();return n.includes(t)||t.includes(s)||s.includes(t)});return i?i.type:e.find(e=>r.includes(e.type.toLowerCase()))?.type}catch(t){return e.find(e=>r.includes(e.type.toLowerCase()))?.type}}function h(e){let t=(e||"000000").toString().trim();return t.startsWith("#")&&(t=t.slice(1)),8===t.length&&/^[0-9a-fA-F]+$/.test(t)&&(t=t.slice(0,6)),3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),6===t.length?t:"000000"}function u(e,t){if(!e||!e.includes("https://img.creaditor.ai"))return e;const r=h(t||function(e){if(!e||"string"!=typeof e)return null;const t=e.match(/[?&]color=(?:%23|#)?([0-9a-fA-F]{3,8})/);return t?h(t[1]):null}(e));try{const t=new URL(e);return t.searchParams.set("color",r),t.toString()}catch(t){const n=e.includes("?")?"&":"?";return`${e}${n}color=${r}`}}function g(e){const t=parseInt(e,16);return[t>>16&255,t>>8&255,255&t]}function m(e){let[t,r,n]=e;const[s,i,o]=[t,r,n].map(e=>{const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)});return.2126*s+.7152*i+.0722*o}function f(e,t){const r=m(g(e)),n=m(g(t));return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}function y(e){if(!e)return null;const t=e.trim();if("transparent"===t||"initial"===t||"inherit"===t||""===t)return null;if(t.startsWith("#"))return h(t);const r=t.match(/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/);if(r){if(0===parseFloat(r[4]))return null;const[,e,t,n]=r;return[e,t,n].map(e=>Number(e).toString(16).padStart(2,"0")).join("")}const n=t.match(/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/);if(n){const[,e,t,r]=n;return[e,t,r].map(e=>Number(e).toString(16).padStart(2,"0")).join("")}return null}function w(e){let t=e?.parentElement;for(;t;){const e=y(t.style?.backgroundColor||t.getAttribute?.("bgcolor")||t.getAttribute?.("data-bgcolor"));if(e)return e;const r=t.ownerDocument?.defaultView?.getComputedStyle?.(t);if(r){const e=y(r.backgroundColor);if(e)return e}t=t.parentElement}return null}function b(e,t){if(!t)return e;const r=h(e);if(!function(e){const t=m(g(e));return t<=.05||t>=.95}(r))return r;if(f(r,t)>=3)return r;const n=f("000000",t);return f("ffffff",t)>=n?"ffffff":"000000"}const v="https://img.creaditor.ai";function x(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=t.width??24,n=t.height??24;let s=t.color??"000000";s.startsWith("#")&&(s=s.slice(1));return u(`${v}/icons/serve/${encodeURIComponent(e.category)}/${encodeURIComponent(e.name)}.png?width=${r}&height=${n}`,s)}class C extends s.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"}),r=await fetch(`${v}/icons/search?${t.toString()}`);if(!r.ok)throw new Error(r.statusText);const n=await r.json();this._icons=n.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(/^#/,""),r=Number(this.iconSize)||34,n=x(e,{width:r,height:r,color:t});this.dispatchEvent(new CustomEvent("icon-selected",{detail:{src:n,icon:e},bubbles:!0,composed:!0}))}render(){if(!this.searchQuery?.trim())return s.qy``;if(this._loading)return s.qy`<div class="loading"><cdtr-loader></cdtr-loader></div>`;if(this._error)return s.qy`<div class="error">${this._error}</div>`;if(!this._icons.length)return s.qy``;const e=(this.iconColor||"000000").replace(/^#/,"");return s.qy`
|
|
2
2
|
|
|
3
3
|
<div class="grid">
|
|
4
|
-
${this._icons.map(t=>{const r=x(t,{width:24,height:24,color:e}),
|
|
4
|
+
${this._icons.map(t=>{const r=x(t,{width:24,height:24,color:e}),n=this.selectedSrc&&(this.selectedSrc.includes(t.name)||this.selectedSrc===r);return s.qy`
|
|
5
5
|
<button
|
|
6
6
|
type="button"
|
|
7
|
-
class="icon-wrap ${
|
|
7
|
+
class="icon-wrap ${n?"selected":""}"
|
|
8
8
|
title="${t.name}"
|
|
9
9
|
@click=${()=>this._onSelect(t)}
|
|
10
10
|
>
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
</button>
|
|
13
13
|
`})}
|
|
14
14
|
</div>
|
|
15
|
-
`}}C.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}},C.styles=
|
|
15
|
+
`}}C.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}},C.styles=s.AH`
|
|
16
16
|
:host {
|
|
17
17
|
display: block;
|
|
18
18
|
font-size: 12px;
|
|
@@ -60,15 +60,15 @@
|
|
|
60
60
|
.error {
|
|
61
61
|
color: var(--error-color, #c00);
|
|
62
62
|
}
|
|
63
|
-
`,customElements.define("social-icon-suggestions",C);var k=r(61919);const A=e=>{{const{component:t,commands:r}=e,
|
|
63
|
+
`,customElements.define("social-icon-suggestions",C);var k=r(61919);const A=e=>{{const{component:t,commands:r}=e,n=()=>{let e=c();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:r}=e;"link"!==r&&t("link")},tabs:e=>{e||(e="link");const t=[{text:"image"},{text:"design"},{text:"link",selected:!0}];return t.forEach(t=>t.selected=t.selected=t.text===e),t},layout:e=>{let{tab:i,changeTab:o,tabs:c}=e;const l=n(),d=[{type:"node",node:()=>s.qy`<img
|
|
64
64
|
style="padding:10px;display:block;margin:auto"
|
|
65
65
|
width="52"
|
|
66
66
|
height="52"
|
|
67
|
-
src=${l?.src?
|
|
68
|
-
/>`},{type:"button",text:"delete",bgColor:"#df381d",color:"#fff",icon:"deleteBin",active:!0,onClick:e=>{const n
|
|
67
|
+
src=${l?.src?u(l.src,l.fgColor||l.iconColor):""}
|
|
68
|
+
/>`},{type:"button",text:"delete",bgColor:"#df381d",color:"#fff",icon:"deleteBin",active:!0,onClick:e=>{const s=n();if(!s)return;const i=[...t.props.items];if(i.length<2)return;const o=i.findIndex(e=>e.id===s.id);-1!==o&&(i.splice(o,1),r.execCommand("items",i))}},{type:"divider"},{type:"gallery",active:"image"===i.text,src:l?.src,hasPreview:!0,text:"open_gallery",justify:"flex-start",onChange:e=>{const s=n();if(!s)return;let i=e.detail;Array.isArray(i)&&(i=i[0]);const o=t.props,c=JSON.parse(JSON.stringify(o.items)),l=c.findIndex(e=>e.id===s.id);-1!==l&&(c[l].src=i.src,r.execCommand("items",c))}},{type:"custom",active:()=>{const e=l?.link?.href||l?.url,t=e?p(a,e):null;return("link"===i.text||"image"===i.text)&&!!t},node:()=>{const e=l?.link?.href||l?.url,i=e&&p(a,e)||"";return s.qy`<cdtr-editor-container><social-icon-suggestions
|
|
69
69
|
.searchQuery=${i}
|
|
70
70
|
.iconColor=${l?.fgColor||l?.iconColor||"000000"}
|
|
71
71
|
.iconSize=${parseInt(l?.style?.width,10)||34}
|
|
72
72
|
.selectedSrc=${l?.src||""}
|
|
73
|
-
@icon-selected=${e=>{const n
|
|
74
|
-
></social-icon-suggestions></cdtr-editor-container>`}},{type:"divider"},{type:"linkpicker",href:l?.link||l?.url,active:()=>"link"===i.text&&!!l,onChange:e=>{const n
|
|
73
|
+
@icon-selected=${e=>{const s=n();if(!s)return;const i=t.props,o=JSON.parse(JSON.stringify(i.items)),c=o.findIndex(e=>e.id===s.id);-1!==c&&(o[c].src=e.detail.src,r.execCommand("items",o))}}
|
|
74
|
+
></social-icon-suggestions></cdtr-editor-container>`}},{type:"divider"},{type:"linkpicker",href:l?.link||l?.url,active:()=>"link"===i.text&&!!l,onChange:e=>{const s=n();if(!s)return;const i=e.target.value,o=t.props,c=JSON.parse(JSON.stringify(o.items)),l=c.findIndex(e=>e.id===s.id);if(-1!==l){const e=c[l].fgColor||c[l].iconColor,t=function(e,t){const r=p(a,e),n=r?a.find(e=>e.type===r):null,s=n?n.src:null;return s?u(s,t):null}(i.href,e);t&&(c[l].src=t),c[l].url=i.href,c[l].link=i,r.execCommand("items",c)}}},{type:"slider",title:"size",active:"design"===i.text,value:parseInt(l?.style?.width),min:10,max:80,onInput:e=>{const n=e.target.value,s=[...t.props.items];s.forEach(e=>{e.style.width=n+"px",e.style.height=n+"px"}),r.execCommand("items",s)}},{type:"colorpicker",title:"icon_color",alpha:!1,active:()=>"design"===i.text&&!!l,value:l?.fgColor?l.fgColor.startsWith("#")?l.fgColor:"#"+l.fgColor:"#000000",onChange:e=>{const s=n();if(!s)return;let i=e.target.value;i=(0,k.A)(i).toHex(),i.startsWith("#")&&(i=i.slice(1)),8===i.length&&/^[0-9a-fA-F]+$/.test(i)&&(i=i.slice(0,6));const o=t.props,c=JSON.parse(JSON.stringify(o.items));if(!0===o.applyColorToAll)c.forEach(e=>{e.fgColor=i});else{const e=c.findIndex(e=>e.id===s.id);-1!==e&&(c[e].fgColor=i)}r.execCommand("items",c)}},{type:"checkbox",title:"color_them_all",checked:!!t.props.applyColorToAll,active:()=>"design"===i.text&&!!l,onChange:e=>{const t=!!e.target.checked;r.execCommand("applyColorToAll",t)}},{type:"divider"},{type:"slider",title:"spacing",active:"design"===i.text,value:parseFloat(t.props.style.gap),min:0,max:80,onInput:e=>{const t=e.target.value;r.execCommand("style",{gap:t+"px"})}}];return d}}}};var $=r(52144);const _=()=>({set:(e,t,r)=>{switch(t){case"style":if("object"==typeof r)return e[t]=(0,$.A)(e[t],r),!0;break;case"items":if(e[t]=r,Array.isArray(r)){const e=c(),t=r.find(t=>t.id===e?.id);t&&o(t)}return!0;case"src":const n=c();if(n&&Array.isArray(e.items)){const t=[...e.items],s=t.findIndex(e=>e.id===n.id);if(-1!==s)return t[s].src=r,e.items=t,!0}break;case"applyColorToAll":return e[t]=r,!0}}});var S=r(72591),L=r.n(S),I=r(88639),E=r.n(I),N=r(88128),O=r.n(N),T=r(30855),J=r.n(T),B=r(93051),j=r.n(B),q=r(89820),U={};U.setAttributes=J(),U.insert=O().bind(null,"head"),U.domAPI=E(),U.insertStyleElement=j();L()(q.A,U);const W=q.A&&q.A.locals?q.A.locals:void 0;var z=r(23571),F=r(91597);const Q=()=>{const e="social";return{name:e,create:t=>{let{createElement:r,compose:s,helpers:i}=t;const l=(0,F.S)(),d=document.createElement("div"),h=document.createElement("div");h.classList.add(W.root);new z.Ay(h,{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(s.props.items)),{oldIndex:r,newIndex:n}=e,[i]=t.splice(r,1);t.splice(n,0,i),s.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}});d.appendChild(h);const g=r({name:e,id:s.id,template:d,draggable:{group:"element"},droppable:{group:"element"},render:()=>{const e=s.props.items;let t=!1;const r=e.map(e=>{const r=e.url||e.link?.link||"";if(!e.src&&r){const n=p(a,r),s=n?a.find(e=>e.type===n):null;if(s)return t=!0,{...e,src:s.src}}return e});t&&setTimeout(()=>s.editor.store().execCommand("items",r),0);const l=t?r:e;for(;h.firstChild;)h.removeChild(h.firstChild);i.mergeDiff(h,{style:s.props.style});const d=c();l.forEach(e=>{const t=document.createElement("img");d?.id===e.id&&t.classList.add(W.selected),t.addEventListener("click",()=>{o(e),Array.from(h.children).forEach(e=>{e.classList.remove(W.selected)}),t.classList.add(W.selected)}),t.classList.add("item"),e.id&&t.setAttribute("data-id",e.id);let r=e.fgColor||e.iconColor;const n=w(h);n&&(r=b(r,n)),t.src=u(e.src,r),i.mergeDiff(t,{style:e.style}),h.append(t)});const g=document.createElement("paper-button");g.style.minWidth="0",g.style.padding=0,g.innerHTML="<cdtr-icon icon='add'></cdtr-icon>",h.append(g),g.addEventListener("click",()=>{setTimeout(()=>{const e=s.props.items[s.props.items.length-1],t={id:(0,n.A)(),fgColor:"",bgColor:"",style:e.style,url:"",src:"https://render.creaditor.ai/media/social-icons/broken-link-black-circle.png"},r=[...s.props.items];r.push(t),o(t),s.editor.store().execCommand("items",r)},200)})},handleBar:!0,defaultProps:{},validator:_(),schema:s.schema,onSelect:e=>{const t=c();if(t){const r=document.querySelector(`[data-id="${t.id}"]`);r?(window.___social_cdtr_item=r,r.classList.add("selected_underlined")):d.classList.add(e)}},onDeselect:e=>{c();window.___social_cdtr_item&&window.___social_cdtr_item.classList.remove("selected_underlined"),d?.classList?.remove(e)},elementProps:s,remove:()=>{d.remove()},createEditor:A});return g.app.on("update",()=>{l.run(()=>{const e=w(h);if(!e)return;const t=h.querySelectorAll("img"),r=s.props.items;t.forEach((t,n)=>{const s=r[n];if(!s)return;let i=s.fgColor||s.iconColor;i=b(i,e),t.src=u(s.src,i)})})}),g}}}},89820(e,t,r){r.d(t,{A:()=>c});var n=r(82001),s=r.n(n),i=r(40935),o=r.n(i)()(s());o.push([e.id,".Z7AEJu5h_9kumGVl3K4x{\n display: flex;\n}\n.UA2xJ_pGYNrGNLfjkExO{\n border:1px solid var(--primary);\n}","",{version:3,sources:["webpack://./../newsletter-editors/social-editor-component-newsletter/lib/style.module.css"],names:[],mappings:"AAAA;IACI,aAAa;AACjB;AACA;IACI,+BAA+B;AACnC",sourcesContent:[".root{\n display: flex;\n}\n.selected{\n border:1px solid var(--primary);\n}"],sourceRoot:""}]),o.locals={root:"Z7AEJu5h_9kumGVl3K4x",selected:"UA2xJ_pGYNrGNLfjkExO"};const c=o}}]);
|
|
Binary file
|
|
@@ -1,25 +1,16 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5926],{83545(t,e,
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5926],{83545(t,e,i){i.r(e),i.d(e,{EditorTabs:()=>s});var n=i(59929),o=i(36565);i.e(7937).then(i.bind(i,67937));class s extends n.WF{constructor(){super(),this.onConnected=this.onConnected.bind(this),this.onArrowNavigation=this.onArrowNavigation.bind(this),this.tabs=[]}onClickItem(t){let{target:e}=t;const i=this.value=e.value,n=[...this.tabs],o=n.findIndex(t=>t.text===i);-1!==o&&(n.forEach(t=>{t.selected=!1}),n[o].selected=!0),this.tabs=n;const s=new UIEvent("tabChanged",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(s)}firstUpdated(){super.firstUpdated()}onConnected(t){let{name:e}=t;this.onClickItem({target:{value:e}})}onArrowNavigation(t){const{key:e,currentIcon:i}=t.detail,n=this.tabs.findIndex(t=>t.text===i);if(-1===n)return;let o=n;switch(e){case"ArrowUp":case"ArrowLeft":o=n>0?n-1:this.tabs.length-1;break;case"ArrowDown":case"ArrowRight":o=n<this.tabs.length-1?n+1:0;break;default:return}const s=this.tabs[o];s&&(this.onClickItem({target:{value:s.text}}),this.updateComplete.then(()=>{const t=this.shadowRoot.querySelector(`cdtr-editor-tab-item[icon="${s.text}"]`);t&&t.focus()}))}connectedCallback(){super.connectedCallback(),o.Ay.on("editor-tabs",this.onConnected)}disconnectedCallback(){super.disconnectedCallback(),o.Ay.off("editor-tabs",this.onConnected)}renderContent(){switch(this.value){case"animations":return i.e(3553).then(i.bind(i,3553)),n.qy`<cdtr-animations-editor>
|
|
2
2
|
<cdtr-block-loader></cdtr-block-loader
|
|
3
|
-
></cdtr-animations-editor>`;case"settings":case"setting":return
|
|
3
|
+
></cdtr-animations-editor>`;case"settings":case"setting":return i.e(5340).then(i.bind(i,45340)),n.qy`<cdtr-setting-editor>
|
|
4
4
|
<cdtr-block-loader></cdtr-block-loader
|
|
5
|
-
></cdtr-setting-editor>`;default:return n.qy`<slot name="content"></slot>`}}render(){return n.qy`<cdtr-row
|
|
6
|
-
<div
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
${this.tabs.map(t=>n.qy`<cdtr-editor-tab-item
|
|
15
|
-
tabindex="0"
|
|
16
|
-
@change=${this.onClickItem}
|
|
17
|
-
.labelMode=${this.labelMode}
|
|
18
|
-
icon=${t.text}
|
|
19
|
-
text=${t.text}
|
|
20
|
-
.selected=${t.selected}
|
|
21
|
-
></cdtr-editor-tab-item>`)}
|
|
22
|
-
</cdtr-row>
|
|
5
|
+
></cdtr-setting-editor>`;default:return n.qy`<slot name="content"></slot>`}}render(){return this.tabs.length>0&&!this.tabs.some(t=>t.selected)&&(this.tabs[0].selected=!0,this.value=this.tabs[0].text),n.qy`<cdtr-row class="main">
|
|
6
|
+
<div class="icon-tabs" @arrow-navigation=${this.onArrowNavigation}>
|
|
7
|
+
${this.tabs.map(t=>n.qy`<cdtr-editor-tab-item
|
|
8
|
+
tabindex="0"
|
|
9
|
+
@change=${this.onClickItem}
|
|
10
|
+
icon=${t.text}
|
|
11
|
+
text=${t.text}
|
|
12
|
+
.selected=${t.selected}
|
|
13
|
+
></cdtr-editor-tab-item>`)}
|
|
23
14
|
</div>
|
|
24
15
|
<cdtr-col class="content"> ${this.renderContent()} </cdtr-col>
|
|
25
16
|
</cdtr-row>`}}s.styles=n.AH`
|
|
@@ -32,23 +23,25 @@
|
|
|
32
23
|
overflow: hidden;
|
|
33
24
|
}
|
|
34
25
|
cdtr-editor-tab-item:focus {
|
|
35
|
-
background: #e1e1e1;
|
|
36
26
|
outline: none;
|
|
37
27
|
}
|
|
38
28
|
cdtr-editor-tab-item {
|
|
39
29
|
width: 100%;
|
|
40
30
|
}
|
|
41
31
|
.icon-tabs {
|
|
42
|
-
padding
|
|
43
|
-
background: #
|
|
44
|
-
width:
|
|
32
|
+
padding: 10px 0;
|
|
33
|
+
background: #fafafa;
|
|
34
|
+
width: 52px;
|
|
45
35
|
height: 100%;
|
|
46
36
|
min-height: 400px;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
37
|
+
border-left: 1px solid #eaeaee;
|
|
38
|
+
direction: ltr;
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
align-items: center;
|
|
42
|
+
gap: 2px;
|
|
50
43
|
}
|
|
51
|
-
|
|
44
|
+
|
|
52
45
|
.main {
|
|
53
46
|
height: 100%;
|
|
54
47
|
direction: rtl;
|
|
@@ -56,8 +49,8 @@
|
|
|
56
49
|
.content {
|
|
57
50
|
overflow-y: auto;
|
|
58
51
|
overflow-x: hidden;
|
|
59
|
-
max-height:
|
|
52
|
+
max-height: calc(100vh - 130px);
|
|
60
53
|
min-height: 80%;
|
|
61
|
-
padding-top:
|
|
54
|
+
padding-top: 12px;
|
|
62
55
|
}
|
|
63
|
-
`,s.properties={tabs:{type:Array},
|
|
56
|
+
`,s.properties={tabs:{type:Array},value:{type:String}},customElements.define("cdtr-editor-tabs",s)}}]);
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[638],{638(e,t,i){i.r(t),i.d(t,{DevicePicker:()=>
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[638],{638(e,t,i){i.r(t),i.d(t,{DevicePicker:()=>h});var o,r,c,n,d=i(59088),s=i(36936),p=i(59929);let h=(o=(0,i(49410).MZ)({type:String}),(n=class extends p.WF{constructor(){super(),(0,d.A)(this,"device",c,this),this.device="desktop"}choose(e){this.device=e}render(){return p.qy` <cdtr-row alignItems="center">
|
|
2
2
|
<paper-button @click=${()=>this.choose("phone")}>
|
|
3
3
|
<cdtr-tooltip content="design_for_phone">
|
|
4
4
|
<cdtr-icon
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
width="18"
|
|
16
16
|
icon="desktop"
|
|
17
17
|
></cdtr-icon></cdtr-tooltip></paper-button
|
|
18
|
-
></cdtr-row>`}}).styles=
|
|
18
|
+
></cdtr-row>`}}).styles=p.AH`
|
|
19
19
|
paper-button {
|
|
20
20
|
padding: 0;
|
|
21
21
|
min-width: 0;
|
|
22
22
|
}
|
|
23
|
-
`,r=n,c=(0,
|
|
23
|
+
`,r=n,c=(0,s.A)(r.prototype,"device",[o],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),r);customElements.define("cdtr-device-picker",h)}}]);
|
|
Binary file
|