@creaditor/web-starterkit 1.0.12 → 1.0.14
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/170.creaditor.bundle.js +144 -17
- package/dist/170.creaditor.bundle.js.gz +0 -0
- package/dist/211.creaditor.bundle.js +1 -1
- package/dist/211.creaditor.bundle.js.gz +0 -0
- package/dist/2590.creaditor.bundle.js +1 -1
- package/dist/2590.creaditor.bundle.js.gz +0 -0
- package/dist/2765.creaditor.bundle.js +1 -1
- package/dist/2765.creaditor.bundle.js.gz +0 -0
- package/dist/3418.creaditor.bundle.js +1 -1
- package/dist/3418.creaditor.bundle.js.gz +0 -0
- package/dist/353.creaditor.bundle.js +3 -3
- package/dist/353.creaditor.bundle.js.gz +0 -0
- package/dist/4061.creaditor.bundle.js +1 -1
- package/dist/4061.creaditor.bundle.js.gz +0 -0
- package/dist/4475.creaditor.bundle.js +1 -1
- package/dist/4475.creaditor.bundle.js.gz +0 -0
- package/dist/4639.creaditor.bundle.js +1 -1
- package/dist/4639.creaditor.bundle.js.gz +0 -0
- package/dist/4739.creaditor.bundle.js +1 -1
- package/dist/4739.creaditor.bundle.js.gz +0 -0
- package/dist/4970.creaditor.bundle.js +6 -6
- package/dist/4970.creaditor.bundle.js.gz +0 -0
- package/dist/5119.creaditor.bundle.js +5 -5
- package/dist/5119.creaditor.bundle.js.gz +0 -0
- package/dist/5379.creaditor.bundle.js +70 -0
- package/dist/5379.creaditor.bundle.js.gz +0 -0
- package/dist/5391.creaditor.bundle.js +1 -1
- package/dist/5391.creaditor.bundle.js.gz +0 -0
- package/dist/5909.creaditor.bundle.js +644 -0
- package/dist/5909.creaditor.bundle.js.gz +0 -0
- package/dist/5926.creaditor.bundle.js +26 -28
- package/dist/5926.creaditor.bundle.js.gz +0 -0
- package/dist/6151.creaditor.bundle.js +1 -1
- package/dist/6151.creaditor.bundle.js.gz +0 -0
- package/dist/7209.creaditor.bundle.js +1 -1
- package/dist/7209.creaditor.bundle.js.gz +0 -0
- package/dist/7937.creaditor.bundle.js +16 -43
- package/dist/7937.creaditor.bundle.js.gz +0 -0
- package/dist/8141.creaditor.bundle.js +2 -2
- package/dist/8141.creaditor.bundle.js.gz +0 -0
- package/dist/8250.creaditor.bundle.js +1 -1
- package/dist/8250.creaditor.bundle.js.gz +0 -0
- package/dist/9431.creaditor.bundle.js +1 -1
- package/dist/9431.creaditor.bundle.js.gz +0 -0
- package/dist/creaditor.bundle.js +2829 -2701
- 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,20 +1,30 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[170],{60170(e,t,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[170],{60170(e,t,o){o.r(t),o.d(t,{BreadCrumbs:()=>i});var r=o(59929),s=o(86319),n=o(36565);class i extends r.WF{constructor(){super(),this.crumbs=[],this._menuOpen=!1,this._menuPos={left:0,top:0},this._collapsed=!1,this._fitScheduled=!1,this.cover=function(){const e=document.createElement("div");return e.style.position="fixed",e.style.background="var(--primary)",e.style.zIndex=2,e.style.border="1px dashed black",e.style.opacity=.2,e}(),this.currectCrumb={},this._onDocMouseDown=e=>{this._menuOpen&&(e.composedPath().includes(this)||this._closeMenu())},this._onDocKeyDown=e=>{this._menuOpen&&"Escape"===e.key&&this._closeMenu()},this.onSubscribe=()=>{let e;this.crumbs=[],this._menuOpen=!1,this._collapsed=!1;const t=n.Ay.components[n.Ay.components.length-1];if(!t)return;if(e=t.element,!e)return void console.error("selectElement not found","#1ppqmvss6");let o=t.type.getElementType(),r="";t.props.as&&(r=` (${s.M.get("lang",t.props.as)||t.props.as})`),this.currectCrumb={type:o,as:r,name:t.props.name,id:t.id};if(e){let t=e;for(;t&&t.parentElement;)if(t=t.parentElement.closest("[data-type]"),t){const e=s.M.get("components",t.dataset.id);let o=!0;e&&"row"!==e.type&&("col"===e.type&&"block"!==e.parent().type&&(o=!1),o&&this.crumbs.unshift({type:e.type,name:e.props.name,id:e.id,element:e.element,compose:e}))}this.dispatchEvent(new CustomEvent("change",[...this.crumbs]))}},this.onSubscribe=this.onSubscribe.bind(this)}updated(){if(this.toggleAttribute("hidden-crumbs",0===this.crumbs.length),!this._collapsed&&this.crumbs.length>1&&!this._fitScheduled&&(this._fitScheduled=!0,requestAnimationFrame(()=>{this._fitScheduled=!1;const e=this.shadowRoot.querySelector(".row");e&&!this._collapsed&&e.scrollWidth>e.clientWidth+1&&(this._collapsed=!0)})),this._menuOpen){const e=this.shadowRoot.querySelector(".crumb-menu");if(e){const t=e.offsetWidth,o=window.innerWidth-t-8,r=Math.max(8,Math.min(this._menuPos.left,o));r!==this._menuPos.left&&(e.style.left=r+"px")}}}_openMenu(){if(this._menuOpen)return void this._closeMenu();const e=this.getBoundingClientRect();this._menuPos={left:e.left,top:e.top},this._menuOpen=!0}_closeMenu(){this._menuOpen=!1}onHover(e){if(e){const t=e.getBoundingClientRect();this.cover.style.left=t.left+"px",this.cover.style.top=t.top+"px",this.cover.style.width=t.width+"px",this.cover.style.height=t.height+"px",document.body.appendChild(this.cover)}}render(){if(0===this.crumbs.length)return"";const e=(e,t,o)=>e||`${s.M.get("lang",t)||t||""}${o||""}`,t=()=>r.qy`<span class="sepc">›</span>`,o=t=>r.qy`<span
|
|
2
|
+
@mouseout=${()=>this.cover.remove()}
|
|
3
|
+
@mouseover=${()=>this.onHover(t.element)}
|
|
4
|
+
@mousedown=${()=>this.clickBread(t)}
|
|
5
|
+
class="breadcrumb"
|
|
6
|
+
>${e(t.name,t.type)}</span>`,n=e(this.currectCrumb.name,this.currectCrumb.type,this.currectCrumb.as),i=this._collapsed,a=this.mainText?r.qy`<span
|
|
7
|
+
class="currect${i?" clickable":""}"
|
|
8
|
+
@mousedown=${()=>{i&&this._openMenu()}}
|
|
9
|
+
>${n}</span
|
|
10
|
+
>`:null,c=this._collapsed,l=r.qy`<span
|
|
11
|
+
class="breadcrumb ellipsis"
|
|
12
|
+
@mousedown=${()=>this._openMenu()}
|
|
13
|
+
>…</span>`,p=c?r.qy`${o(this.crumbs[0])}${t()}${l}${t()}${o(this.crumbs[this.crumbs.length-1])}${t()}`:r.qy`${this.crumbs.map(e=>r.qy`${o(e)}${t()}`)}`,d=this._menuOpen?r.qy`<div
|
|
14
|
+
class="crumb-menu"
|
|
15
|
+
style="left:${this._menuPos.left}px; top:${this._menuPos.top}px;"
|
|
16
|
+
>
|
|
17
|
+
<div class="menu-path">
|
|
18
|
+
${this.crumbs.map(e=>r.qy`${o(e)}<span class="sepc">›</span>`)}
|
|
19
|
+
<span class="crumb-current">${n}</span>
|
|
15
20
|
</div>
|
|
16
|
-
|
|
17
|
-
|
|
21
|
+
</div>`:null;return r.qy`
|
|
22
|
+
<div class="row ${c?"collapsed":""}">
|
|
23
|
+
${p}
|
|
24
|
+
${a}
|
|
25
|
+
</div>
|
|
26
|
+
${d}
|
|
27
|
+
`}connectedCallback(){super.connectedCallback(),n.Ay.on("select",this.onSubscribe),n.Ay.on("update",this.onSubscribe),document.addEventListener("mousedown",this._onDocMouseDown),document.addEventListener("keydown",this._onDocKeyDown)}disconnectedCallback(){super.disconnectedCallback(),this.cover.remove(),n.Ay.off("select",this.onSubscribe),n.Ay.off("update",this.onSubscribe),document.removeEventListener("mousedown",this._onDocMouseDown),document.removeEventListener("keydown",this._onDocKeyDown)}clickBread(e){this.cover.remove(),n.Ay.clean().selectComponent(e.compose)}}i.styles=r.AH`
|
|
18
28
|
:host {
|
|
19
29
|
direction: var(--direction);
|
|
20
30
|
display: block;
|
|
@@ -55,4 +65,121 @@
|
|
|
55
65
|
fill: var(--color-text-faint);
|
|
56
66
|
vertical-align: middle;
|
|
57
67
|
}
|
|
58
|
-
|
|
68
|
+
.row {
|
|
69
|
+
display: flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
gap: 2px 8px;
|
|
72
|
+
min-width: 0;
|
|
73
|
+
min-height: 32px;
|
|
74
|
+
white-space: nowrap;
|
|
75
|
+
overflow: hidden;
|
|
76
|
+
}
|
|
77
|
+
.row .breadcrumb,
|
|
78
|
+
.row .currect,
|
|
79
|
+
.sepc {
|
|
80
|
+
flex: 0 0 auto;
|
|
81
|
+
margin: 0;
|
|
82
|
+
}
|
|
83
|
+
/* Cap individual crumb width so a long custom name can't break the row. */
|
|
84
|
+
.row .breadcrumb {
|
|
85
|
+
display: inline-block;
|
|
86
|
+
max-width: 140px;
|
|
87
|
+
overflow: hidden;
|
|
88
|
+
text-overflow: ellipsis;
|
|
89
|
+
vertical-align: middle;
|
|
90
|
+
}
|
|
91
|
+
/* When collapsed, the current element is the last (rightmost) crumb; let it
|
|
92
|
+
shrink and ellipsize so a long name (e.g. "Social Networks") truncates
|
|
93
|
+
cleanly instead of hard-clipping into the panel actions. The full name is
|
|
94
|
+
always one "…" click away. */
|
|
95
|
+
.row.collapsed .currect {
|
|
96
|
+
flex: 0 1 auto;
|
|
97
|
+
min-width: 0;
|
|
98
|
+
overflow: hidden;
|
|
99
|
+
text-overflow: ellipsis;
|
|
100
|
+
}
|
|
101
|
+
/* Collapsed current crumb opens the full-path popover (to read the full,
|
|
102
|
+
possibly-truncated name), so signal it's interactive. */
|
|
103
|
+
.row .currect.clickable {
|
|
104
|
+
cursor: pointer;
|
|
105
|
+
}
|
|
106
|
+
.row .currect.clickable:hover {
|
|
107
|
+
text-decoration: underline;
|
|
108
|
+
}
|
|
109
|
+
.sepc {
|
|
110
|
+
color: var(--color-text-faint);
|
|
111
|
+
font-size: var(--text-xs);
|
|
112
|
+
}
|
|
113
|
+
.ellipsis {
|
|
114
|
+
color: var(--color-text-muted);
|
|
115
|
+
cursor: pointer;
|
|
116
|
+
max-width: none;
|
|
117
|
+
}
|
|
118
|
+
.ellipsis:hover {
|
|
119
|
+
color: var(--color-primary, var(--primary));
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/* Full-path popover. It opens positioned directly OVER the collapsed row
|
|
123
|
+
(opaque background covers it), so it reads as the breadcrumb expanding
|
|
124
|
+
in place rather than a second breadcrumb below it. Floats (fixed), so
|
|
125
|
+
the panel below never reflows; the extra line paints over the content. */
|
|
126
|
+
.crumb-menu {
|
|
127
|
+
position: fixed;
|
|
128
|
+
z-index: 1000;
|
|
129
|
+
min-width: 170px;
|
|
130
|
+
max-width: 300px;
|
|
131
|
+
background: var(--color-surface, #fff);
|
|
132
|
+
border: 1px solid var(--color-border, #e9e9e9);
|
|
133
|
+
border-radius: 6px;
|
|
134
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
|
|
135
|
+
/* Unfold from the breadcrumb's start (top-left) so it reads as the
|
|
136
|
+
row expanding in place, not a menu dropping in. */
|
|
137
|
+
transform-origin: top left;
|
|
138
|
+
animation: crumb-menu-in 140ms cubic-bezier(0.2, 0, 0, 1);
|
|
139
|
+
}
|
|
140
|
+
@keyframes crumb-menu-in {
|
|
141
|
+
from {
|
|
142
|
+
opacity: 0;
|
|
143
|
+
transform: translateY(-2px) scale(0.97);
|
|
144
|
+
}
|
|
145
|
+
to {
|
|
146
|
+
opacity: 1;
|
|
147
|
+
transform: translateY(0) scale(1);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
@media (prefers-reduced-motion: reduce) {
|
|
151
|
+
.crumb-menu {
|
|
152
|
+
animation: none;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
/* The full breadcrumb laid out horizontally, wrapping onto extra lines —
|
|
156
|
+
same visual language as the row, just complete. */
|
|
157
|
+
.crumb-menu .menu-path {
|
|
158
|
+
display: flex;
|
|
159
|
+
flex-wrap: wrap;
|
|
160
|
+
align-items: center;
|
|
161
|
+
gap: 4px 8px;
|
|
162
|
+
padding: 6px 12px 8px;
|
|
163
|
+
}
|
|
164
|
+
.crumb-menu .menu-path .breadcrumb {
|
|
165
|
+
display: inline-block;
|
|
166
|
+
max-width: 170px;
|
|
167
|
+
margin: 0;
|
|
168
|
+
overflow: hidden;
|
|
169
|
+
text-overflow: ellipsis;
|
|
170
|
+
vertical-align: middle;
|
|
171
|
+
}
|
|
172
|
+
.crumb-menu .menu-path .sepc {
|
|
173
|
+
color: var(--color-text-faint);
|
|
174
|
+
font-size: var(--text-xs);
|
|
175
|
+
}
|
|
176
|
+
.crumb-menu .menu-path .crumb-current {
|
|
177
|
+
font-size: var(--text-xs);
|
|
178
|
+
font-family: var(--font-family);
|
|
179
|
+
font-weight: 600;
|
|
180
|
+
color: var(--color-primary, var(--primary));
|
|
181
|
+
max-width: 170px;
|
|
182
|
+
overflow: hidden;
|
|
183
|
+
text-overflow: ellipsis;
|
|
184
|
+
}
|
|
185
|
+
`,i.properties={crumbs:{type:Array},mainText:{type:Boolean,reflect:!0},_menuOpen:{type:Boolean,state:!0},_menuPos:{type:Object,state:!0},_collapsed:{type:Boolean,state:!0}},customElements.define("cdtr-breadcrumbs",i)}}]);
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[211],{70211(e,t,n)
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[211],{70211(e,n,t){t.r(n),t.d(n,{ParticlesJsBackground:()=>s});var i=t(59929),a=t(21421),o=t(12106);class s extends i.WF{constructor(){super(),this.containerRef=(0,a._)(),this.containerId="particles-"+(0,o.A)(),this.config={particles:{number:{value:20},color:{value:"#ffffff"},shape:{type:"circle",stroke:{width:0,color:"#000000"},polygon:{nb_sides:5}},opacity:{value:.5,random:!1,anim:{enable:!1,speed:1,opacity_min:.1,sync:!1}},size:{value:10,random:!0,anim:{enable:!1,speed:80,size_min:.1,sync:!1}},line_linked:{enable:!0,distance:300,color:"#484554",opacity:.4,width:2},move:{enable:!0,speed:5,direction:"none",random:!1,straight:!1,out_mode:"out",bounce:!1,attract:{enable:!1,rotateX:600,rotateY:1200}}},interactivity:{detect_on:"canvas",events:{onhover:{enable:!1,mode:"repulse"},onclick:{enable:!0,mode:"push"},resize:!0},modes:{grab:{distance:800,line_linked:{opacity:1}},bubble:{distance:800,size:80,duration:2,opacity:.8,speed:3},repulse:{distance:400,duration:.4},push:{particles_nb:4},remove:{particles_nb:2}}},retina_detect:!0}}createRenderRoot(){return this}render(){return i.qy`<div id=${this.containerId} ${(0,a.K)(this.containerRef)}></div>`}connectedCallback(){super.connectedCallback(),t.e(3545).then(t.t.bind(t,5926,23)).then(()=>{setTimeout(()=>{Array.isArray(window.pJSDom)||(window.pJSDom=[]),particlesJS(this.containerId,this.config)},0)})}disconnectedCallback(){super.disconnectedCallback();try{const e=window.pJSDom||[],n=[];for(let t=0;t<e.length;t++){const i=e[t]?.pJS?.canvas?.el;i&&i.parentElement&&i.parentElement.id===this.containerId?e[t].pJS.fn.vendors.destroypJS():n.push(e[t])}window.pJSDom=n}catch(e){Array.isArray(window.pJSDom)||(window.pJSDom=[])}}}s.properties={name:{}},s.styles=i.AH``,customElements.define("cdtr-particlesjs",s)}}]);
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[2590],{2590(t,e,
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[2590],{2590(t,e,n){n.r(e),n.d(e,{TitleEditor:()=>l});var i=n(59929),s=n(86319);class l extends i.WF{constructor(){super(),this.text="",this.whiteSpace="pre"}connectedCallback(){super.connectedCallback(),this.style.fontFamily="var(--font-family)",this.bold&&(this.style.fontWeight="bold"),this._onStoreChange=()=>this.requestUpdate(),s.M.connect(["lang","theme"],this._onStoreChange)}disconnectedCallback(){this._onStoreChange&&(s.M.disconnect(this._onStoreChange),this._onStoreChange=null),super.disconnectedCallback()}render(){const t=s.M.get("theme");t&&(this.style.direction=t.direction,this.style.textAlign=this.textAlign||t.textAlign);const e=s.M.get("lang",this.text);return i.qy`<slot
|
|
2
2
|
><span
|
|
3
3
|
style="-webkit-font-smoothing: antialiased;display:inline-block;direction:var(--direction-locale);text-align:var(--text-align-locale);white-space:${this.whiteSpace}"
|
|
4
4
|
>${e||this.text}</span
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[2765],{12765(e,t,o){o.d(t,{default:()=>
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[2765],{12765(e,t,o){o.d(t,{default:()=>s});var n=o(61919);const r=e=>{{const{component:t,commands:o}=e;return{select:e=>{let{changeTab:t,tab:o}=e;o.text||t("style")},tabs:e=>{const t=[{text:"style",selected:!0},{text:"interactions"},{text:"settings"}];return e?(t.forEach(t=>t.selected=t.text===e),t):t},layout:e=>{let{tab:r}=e;const i=t.props.src.includes("img.creaditor.ai"),s=()=>"style"===r.text;return[{type:"heading",level:6,text:"icon",active:s},{type:"icons",active:s,selectedIcon:t.props.src,useIconsApi:!0,iconColor:t.props.iconColor||"000000",iconSize:parseInt(t.props.style?.width,10)||24,onChange:e=>{const n=e.detail;if(n){const e=n.urlPng||n.src;e&&o.execCommand("src",e),t.props.alt&&"icon"!==t.props.alt||o.execCommand("alt",n.name),n.size?.width&&n.size?.height&&o.execCommand("style",{width:n.size.width+"px",height:n.size.height+"px"}),null!=n.category&&null!=n.name&&(o.execCommand("iconCategory",n.category),o.execCommand("iconName",n.name));const r=(n.color??t.props.iconColor??"000000").toString().replace(/^#/,"");o.execCommand("iconColor",r)}}},{type:"input",title:"altText",active:s,value:t.props.alt||"",onChange:e=>{const t=e.target.value;o.execCommand("alt",t)}},{type:"heading",level:6,text:"size",active:s},{type:"slider",title:"size",min:8,max:256,active:s,value:parseInt(t.props.style?.width,10)||24,onInput:e=>{const t=e.target.value;o.execCommand("style",{width:t+"px",height:t+"px"})}},{type:"heading",level:6,text:"colors",active:()=>s()&&i},{type:"colorpicker",title:"icon_color",alpha:!1,active:()=>s()&&i,value:t.props.iconColor?t.props.iconColor.startsWith("#")?t.props.iconColor:"#"+t.props.iconColor:"#000000",onChange:e=>{let t=e.target.value;t=(0,n.A)(t).toHex(),t.startsWith("#")&&(t=t.slice(1)),o.execCommand("iconColor",t)}},{type:"heading",level:6,text:"link",active:()=>"interactions"===r.text},{type:"linkpicker",href:t.props.onClick?.link,protocol:t.props.onClick?.link?.protocol,target:t.props.onClick?.link?.target,autofocus:!0,active:()=>"interactions"===r.text,onChange:e=>{const t={link:e.target.value};o.execCommand("onClick",t)}}]}}}},i=e=>{let{helpers:t}=e;return{set:(e,o,n)=>{switch(o){case"style":return e[o]=t.deepMerge(e[o],n),!0;case"src":case"alt":case"iconColor":case"iconCategory":case"iconName":return e[o]=n,!0;case"onClick":if(n&&n.link)return e[o]=n,!0}}}};const s=()=>{const e="icon";return{name:e,create:t=>{const{createElement:o,compose:n,helpers:s}=t,{mergeDiff:a}=s,c=document.createElement("div"),l=document.createElement("img");c.appendChild(l);return o({name:e,id:n.id,template:c,defaultProps:{style:{height:"24px",width:"24px",display:"inline-block"},src:"",alt:"",iconColor:"000000"},draggable:{group:"element"},droppable:{group:"element"},render:()=>{a(l,{style:n.props.style});const e=function(e){const t=e.props.iconCategory,o=e.props.iconName;if(!t||!o)return null;let n=parseInt(e.props.style?.width,10)||24,r=parseInt(e.props.style?.height,10)||24;n=Math.min(512,Math.max(1,n)),r=Math.min(512,Math.max(1,r));const i=function(e){let t=(e||"000000").toString().trim();return t.startsWith("#")&&(t=t.slice(1)),3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),6!==t.length?"000000":t}(e.props.iconColor);return`https://img.creaditor.ai/icons/serve/${encodeURIComponent(t)}/${encodeURIComponent(o)}.png?${new URLSearchParams({width:String(n),height:String(r),color:i}).toString()}`}(n)||n.props.src;a(l,{src:e,alt:n.props.alt||""})},resizeable:null,handleBar:!0,validator:i({helpers:s}),schema:n.schema,onSelect:e=>{c.classList.add(e)},onDeselect:e=>{c.classList.remove(e)},elementProps:n,remove:()=>{c.remove()},createEditor:r})}}}}}]);
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[3418],{3418(e,t,n){n.d(t,{default:()=>r});const s=e=>{{const{component:t,commands:n,helpers:s}=e;return{select:e=>{let{changeTab:t,tab:n}=e;"style"!==n.text&&t("style")},tabs:e=>{const t=[{text:"style"},{text:"
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[3418],{3418(e,t,n){n.d(t,{default:()=>r});const s=e=>{{const{component:t,commands:n,helpers:s}=e;return{select:e=>{let{changeTab:t,tab:n}=e;"style"!==n.text&&t("style")},tabs:e=>{const t=[{text:"style"},{text:"interactions"}];return t.forEach(t=>t.selected=t.selected=t.text===e),t},layout:e=>{let{tab:o,changeTab:l,tabs:r}=e;return[{type:"linkpicker",active:"interactions"===o.text,protocol:t.props.onClick?.link?.protocol,target:t.props.onClick?.link?.target,href:t.props.onClick?.link?.href,onChange:e=>{const t={link:e.target.value};n.execCommand("onClick",t)}},{type:"heading",level:4,text:"typography",active:"style"===o.text},{active:"style"===o.text,type:"typography",bold:700===t.props.style.fontWeight,italic:"italic"===t.props.style.fontStyle,underline:"underline"===t.props.style.textDecoration,onChange:e=>{switch(e){case"bold":const e=700===t.props.style.fontWeight?400:700;n.execCommand("style",{fontWeight:e});break;case"italic":const s="italic"===t.props.style.fontStyle?"normal":"italic";n.execCommand("style",{fontStyle:s});break;case"underline":const o="underline"===t.props.style.textDecoration?"none":"underline";n.execCommand("style",{textDecoration:o})}}},{active:"style"===o.text,type:"fontFamily",value:t.props.style.fontFamily,weight:!0,weightValue:t.props.style.fontWeight,onChange:e=>{const t=e.target.value;n.execCommand("style",{fontFamily:t})},onWeightChange:e=>{n.execCommand("style",{fontWeight:e.detail.value})}},{active:"style"===o.text,type:"colorpicker",title:"color",value:t.props.style?.color,onChange:e=>{const t=e.target.value;n.execCommand("style",{color:t})}},{active:"style"===o.text,type:"fontSize",min:8,max:80,title:"fontSize",value:parseInt(t.props.style?.fontSize)||14,device:e=>{const n=e.target.device;e.target.value="phone"===n?parseInt(t.props?.breakpoints?.sm?.style?.fontSize)||14:parseInt(t.props.style.fontSize)||14},value:parseInt(t.props.style.fontSize)||14,onInput:e=>{const t=e.target.value;"phone"===e.target.device?n.execCommand("breakpoints",e=>{const n=e.props.breakpoints?.sm||{};return{sm:s.deepMerge(n,{style:{fontSize:t+"px"}})}}):n.execCommand("style",{fontSize:t+"px"})}},{active:"style"===o.text,type:"input",title:"prefix",value:t.props.prefix||"",onInput:e=>{const t=e.target.value;n.execCommand("prefix",t)}},{active:"style"===o.text,type:"input",title:"suffix",value:t.props.suffix||"",onInput:e=>{const t=e.target.value;n.execCommand("suffix",t)}},{active:"style"===o.text,type:"divider"},{active:"style"===o.text,type:"heading",level:4,text:"svg"},{active:"style"===o.text,type:"slider",min:10,max:600,title:"size",value:parseInt(t.props.width)||14,onInput:e=>{const t=e.target.value;n.execCommand("width",t)}},{active:"style"===o.text,type:"colorpicker",title:"svg_color",value:t.props.fill,onChange:e=>{const t=e.target.value;n.execCommand("fill",t)}},{active:"style"===o.text,type:"svgpicker",value:t.props.content,onChange:e=>{n.execCommand("content",e.svg)}}]}}}},o=["fontWeight","color","fontSize","textDecdoration","fontStyle","fontFamily"],l=e=>{let{helpers:t,template:n,svgElement:s,suffix:l,prefix:r}=e;return{set:(e,i,a)=>{switch(i){case"style":e[i]=t.deepMerge(e[i],a);for(const t in e[i])if(Object.hasOwnProperty.call(e[i],t)&&-1!==o.indexOf(t)){const s=e[i][t];n.style[t]=s}return!0;case"suffix":return e[i]=a,l(a),!0;case"prefix":return e[i]=a,r(a),!0;case"onClick":if(a.link)return e.onClick||(e.onClick={}),e.onClick={...e.onClick,...a},!0;break;case"content":return s.innerHTML=a,e[i]=a,!0;case"width":case"height":case"fill":return e[i]=a,s.setAttribute(i,a),s.style[i]=a,s.style.height="auto",!0;default:return!0}}}},r=()=>({name:"svg",create:e=>{let{createElement:t,compose:n,helpers:r}=e;"string"==typeof n.props.content&&-1!==n.props.content.indexOf("<svg")&&(n.props.content=(new DOMParser).parseFromString(n.props.content,"text/xml").firstElementChild.innerHTML);const i=document.createElement("span");i.innerHTML=n.props.prefix||"";const a=document.createElement("span");a.innerHTML=n.props.suffix||"";let p=(new DOMParser).parseFromString(`<svg\n width="30"\n height="auto"\n xmlns="http://www.w3.org/2000/svg"\n viewBox="0 0 24 24">${n.props.content}</svg>`,"text/xml").firstChild;p.setAttribute("width",n?.props?.width||n?.props?.style?.width),p.setAttribute("fill",n?.props?.fill||n.props.style.fill);const c=document.createElement("div");if(c.setAttribute("dir","auto"),c.style=n.props.style,c.style.display="flex",c.style.alignItems="center",n.props.style)for(const e in n.props.style)if(Object.hasOwnProperty.call(n.props.style,e)&&-1!==o.indexOf(e)){const t=n.props.style[e];c.style[e]=t}const y=document.createElement("cdtr-move-handle-bar");return y.for=n.id,c.append(a,p,i,y),t({name:"svg",id:n.id,template:c,defaultProps:{},draggable:{group:"elements"},validator:l({template:c,helpers:r,svgElement:p,suffix:e=>a.innerHTML=e,prefix:e=>i.innerHTML=e}),schema:n.schema,onSelect:e=>{c.classList.add(e)},onDeselect:e=>{c.classList.remove(e)},elementProps:n,remove:()=>{c.remove()},createEditor:s})}})}}]);
|
|
Binary file
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[353],{40353(e,t,s){var n=s(59929),i=s(40156),
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[353],{40353(e,t,s){s.r(t),s.d(t,{HaloBackground:()=>c});var n=s(59929),i=s(40156),o=s(21421),r=s(12106);class c extends n.WF{constructor(){super(),this.containerRef=(0,o._)(),this.renderStyles=()=>`#${this.containerId} canvas {height:100% !important;width:100% !important;}`,this.containerId="halo-"+(0,r.A)(),this.config={mouseControls:!0,touchControls:!0,gyroControls:!1,minHeight:200,minWidth:200,size:1}}createRenderRoot(){return this}render(){return n.qy`<div
|
|
2
2
|
style="height:100%;width:100%;"
|
|
3
3
|
id=${this.containerId}
|
|
4
|
-
${(0,
|
|
4
|
+
${(0,o.K)(this.containerRef)}
|
|
5
5
|
>
|
|
6
6
|
<style>
|
|
7
7
|
${this.renderStyles()}
|
|
8
8
|
</style>
|
|
9
|
-
</div>`}connectedCallback(){super.connectedCallback(),(0,i.A)("https://cdnjs.cloudflare.com/ajax/libs/three.js/r121/three.min.js",()=>{(0,i.A)("https://cdn.jsdelivr.net/npm/vanta@latest/dist/vanta.halo.min.js",()=>{setTimeout(()=>{window.VANTA&&(this.config.el=this.containerRef.value,this.effect=window.VANTA.HALO(this.config))},100)})})}disconnectedCallback(){super.disconnectedCallback()}}
|
|
9
|
+
</div>`}connectedCallback(){super.connectedCallback(),(0,i.A)("https://cdnjs.cloudflare.com/ajax/libs/three.js/r121/three.min.js",()=>{(0,i.A)("https://cdn.jsdelivr.net/npm/vanta@latest/dist/vanta.halo.min.js",()=>{setTimeout(()=>{window.VANTA&&(this.config.el=this.containerRef.value,this.effect=window.VANTA.HALO(this.config))},100)})})}disconnectedCallback(){super.disconnectedCallback(),this.effect&&"function"==typeof this.effect.destroy&&(this.effect.destroy(),this.effect=null)}}c.properties={name:{}},c.styles=n.AH``,customElements.define("cdtr-halo-preset",c)}}]);
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[4061],{84061(e,t,n){n.d(t,{default:()=>
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[4061],{84061(e,t,n){n.d(t,{default:()=>f});const r=e=>{const{component:t,commands:n}=e;return{select:e=>{let{changeTab:t,tab:n}=e;n.text||t("style")},tabs:e=>{const t=[{text:"style",selected:!0},{text:"settings"}];return e?(t.forEach(t=>t.selected=t.text===e),t):t},layout:e=>{let{tab:r}=e;return[{type:"info",text:"this_is_empty_iframe_start_add_url_link",active:()=>"style"===r.text},{type:"input",title:"urlAddress",active:()=>"style"===r.text,value:t.props.src||"",onChange:e=>{const t=e.target.value;n.execCommand("src",t)}},{type:"slider",title:"width",min:100,max:1200,active:()=>"style"===r.text,value:parseInt(t.props.style?.width,10)||400,onInput:e=>{const t=e.target.value;n.execCommand("style",{width:t+"px"})}},{type:"slider",title:"height",min:100,max:800,active:()=>"style"===r.text,value:parseInt(t.props.style?.height,10)||300,onInput:e=>{const t=e.target.value;n.execCommand("style",{height:t+"px"})}}]}}},s=e=>{let{helpers:t}=e;return{set:(e,n,r)=>{switch(n){case"style":return e[n]=t.deepMerge(e[n],r),!0;case"src":return e[n]=r,!0;default:return!1}}}};var a=n(72591),i=n.n(a),l=n(88639),o=n.n(l),A=n(88128),d=n.n(A),c=n(30855),m=n.n(c),p=n(93051),h=n.n(p),u=n(22800),C={};C.setAttributes=m(),C.insert=d().bind(null,"head"),C.domAPI=o(),C.insertStyleElement=h();i()(u.A,C);const g=u.A&&u.A.locals?u.A.locals:void 0,f=()=>{const e="iframe";return{name:e,create:t=>{const{createElement:n,compose:a,helpers:i}=t,{arrayToString:l,mergeDiff:o}=i,A=document.createElement("div");A.setAttribute("data-id",a.id),A.setAttribute("draggable-element","element"),A.setAttribute("droppable-element","element"),A.className=l("iframe-component",g.main);const d=document.createElement("div");d.style.cssText="position:relative;max-width:100%;height:100%;width:100%;",A.appendChild(d);const c=document.createElement("iframe");c.style.cssText="width:100%;height:100%;border:none;",d.appendChild(c);const m=document.createElement("div");m.className=g.emptyIframeHolder;const p=document.createElement("h1");p.setAttribute("align","center");const h=document.createElement("lang-text");h.setAttribute("text","this_is_empty_iframe_start_add_url_link"),p.appendChild(h),m.appendChild(p),d.appendChild(m);return n({name:e,id:a.id,template:A,defaultProps:{style:{display:"block",margin:"auto",width:"400px",height:"300px"},src:""},draggable:{group:"element"},droppable:{group:"element"},render:()=>{o(c,{style:a.props.style,src:a.props.src||""}),a.props.src?m.style.display="none":m.style.display="flex"},resizeable:()=>d,handleBar:!0,validator:s({helpers:i}),schema:a.schema,onSelect:e=>{A.classList.add(e)},onDeselect:e=>{A.classList.remove(e)},elementProps:a,remove:()=>{A.remove()},createEditor:r})}}}},22800(e,t,n){n.d(t,{A:()=>l});var r=n(82001),s=n.n(r),a=n(40935),i=n.n(a)()(s());i.push([e.id,'.dwbwX3rm1rCfFBXzg4l5 {\n position: relative;\n width: 100%;\n}\n\n.dwbwX3rm1rCfFBXzg4l5:hover::after {\n content: "";\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background: #000;\n background: var(--primary, #000);\n opacity: 0.1;\n z-index: 9;\n}\n\n.dwbwX3rm1rCfFBXzg4l5 iframe {\n width: 100%;\n height: 100%;\n border: none;\n}\n\n.TNFcnLszwFUVJerzzPS8 {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n z-index: 15;\n gap: 15px;\n}\n\n.TNFcnLszwFUVJerzzPS8 h1 {\n font-size: 1.2rem;\n font-weight: 500;\n color: rgba(0, 0, 0, 0.72);\n}\n',"",{version:3,sources:["webpack://./../web-editors/iframe-editor-component/lib/style.module.css"],names:[],mappings:"AAAA;EACE,kBAAkB;EAClB,WAAW;AACb;;AAEA;EACE,WAAW;EACX,kBAAkB;EAClB,OAAO;EACP,MAAM;EACN,WAAW;EACX,YAAY;EACZ,gBAAgC;EAAhC,gCAAgC;EAChC,YAAY;EACZ,UAAU;AACZ;;AAEA;EACE,WAAW;EACX,YAAY;EACZ,YAAY;AACd;;AAEA;EACE,kBAAkB;EAClB,SAAS;EACT,QAAQ;EACR,gCAAgC;EAChC,aAAa;EACb,uBAAuB;EACvB,mBAAmB;EACnB,sBAAsB;EACtB,WAAW;EACX,SAAS;AACX;;AAEA;EACE,iBAAiB;EACjB,gBAAgB;EAChB,0BAA0B;AAC5B",sourcesContent:['.main {\n position: relative;\n width: 100%;\n}\n\n.main:hover::after {\n content: "";\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background: var(--primary, #000);\n opacity: 0.1;\n z-index: 9;\n}\n\n.main iframe {\n width: 100%;\n height: 100%;\n border: none;\n}\n\n.emptyIframeHolder {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n z-index: 15;\n gap: 15px;\n}\n\n.emptyIframeHolder h1 {\n font-size: 1.2rem;\n font-weight: 500;\n color: rgba(0, 0, 0, 0.72);\n}\n'],sourceRoot:""}]),i.locals={main:"dwbwX3rm1rCfFBXzg4l5",emptyIframeHolder:"TNFcnLszwFUVJerzzPS8"};const l=i}}]);
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[4475],{44475(e,t,i){var r=i(59929);i(15284);class d extends r.WF{constructor(){super()}render(){const e=this.url||this.videoPath,t=this.width||window.innerWidth,i=this.height||window.innerWidth;return r.qy`<cdtr-media-player
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[4475],{44475(e,t,i){i.r(t),i.d(t,{VideoPreset:()=>d});var r=i(59929);i(15284);class d extends r.WF{constructor(){super()}render(){const e=this.url||this.videoPath,t=this.width||window.innerWidth,i=this.height||window.innerWidth;return r.qy`<cdtr-media-player
|
|
2
2
|
.loop=${!0}
|
|
3
3
|
.playing=${!0}
|
|
4
4
|
.controls=${!1}
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[4639],{84639(e,t,r){r.d(t,{default:()=>l});const s=e=>{const{component:t,commands:r}=e;return{select:e=>{let{changeTab:t,tab:r}=e;r.text||t("
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[4639],{84639(e,t,r){r.d(t,{default:()=>l});const s=e=>{const{component:t,commands:r}=e;return{select:e=>{let{changeTab:t,tab:r}=e;r.text||t("style")},tabs:e=>{const t=[{text:"style",selected:!0},{text:"settings"}];return e?(t.forEach(t=>t.selected=t.text===e),t):t},layout:e=>{let{tab:s}=e;return[{type:"linkpicker",href:t.props.link,protocol:t.props.link?.protocol,target:t.props.link?.target,autofocus:!0,active:()=>"style"===s.text,title:"QR link",onChange:e=>{const t=e.target.value;r.execCommand("link",t)}},{type:"slider",title:"size",min:100,max:600,active:()=>"style"===s.text,value:parseInt(t.props.size,10)||200,onInput:e=>{const t=parseInt(e.target.value,10);r.execCommand("size",t),r.execCommand("style",{width:t+"px",height:t+"px"})}}]}}},n=e=>{let{helpers:t}=e;return{set:(e,r,s)=>{switch(r){case"style":return e[r]=t.deepMerge(e[r],s),!0;case"link":case"size":return e[r]=s,!0;default:return!1}}}},a=200;const l=()=>({name:"qr",create:e=>{const{createElement:t,compose:r,helpers:l}=e,{mergeDiff:o}=l,i=document.createElement("div"),c=document.createElement("img");c.alt="QR code",i.appendChild(c);return t({name:"qr",id:r.id,template:i,defaultProps:{style:{width:a+"px",height:a+"px",display:"block"},link:"",size:a},draggable:{group:"element"},droppable:{group:"element"},render:()=>{o(c,{style:r.props.style});const e=function(e,t){if("object"==typeof e&&(e=e.fullHref||e.href),!e||"string"!=typeof e||!e.trim())return"";const r=Math.min(600,Math.max(100,parseInt(t,10)||a));return`https://img.creaditor.ai/images/qr?${new URLSearchParams({link:e.trim(),size:String(r)}).toString()}`}(r.props.link,r.props.size);o(c,{src:e})},resizeable:()=>i,handleBar:!0,validator:n({helpers:l}),schema:r.schema,onSelect:e=>{i.classList.add(e)},onDeselect:e=>{i.classList.remove(e)},elementProps:r,remove:()=>i.remove(),createEditor:s})}})}}]);
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[4739],{54739(e,t,n){n.d(t,{default:()=>k});var o=n(86319);function i(){const e="undefined"!=typeof window&&window.location.hostname||"";return/^(localhost|127\.0\.0\.1|0\.0\.0\.0|\[::1\])$/.test(e)}function a(){const e=o.M.get("config","mcpUrl");if("string"==typeof e&&e)return e;return`${i()?"http://localhost:3000":"https://api.creaditor.ai"}/v1/mcp`}const r="https://claude.ai/settings/connectors";function c(){const e="undefined"!=typeof window?window.open("about:blank","_blank"):null,t=t=>{e?e.location=t:"undefined"!=typeof window&&window.open(t,"_blank","noopener,noreferrer")};(async function(){const e=o.M.get("editor");if(!e)return null;if("function"==typeof e.studioTokenProvider)try{const t=await e.studioTokenProvider({});if("string"==typeof t&&t)return t}catch(e){}return"string"==typeof e.studioToken&&e.studioToken?e.studioToken:null})().then(async e=>{if(!e)return t(r);const n=await fetch(`${a().replace(/\/v1\/mcp\/?$/,"")}/oauth/connect/ticket`,{method:"POST",headers:{Authorization:`Bearer ${e}`}});if(!n.ok)return t(r);const{sessionUrl:o}=await n.json();t(o||r)}).catch(()=>t(r))}function s(e,t){return o.M.get("lang",e)||t}function l(e,t,n){const o=()=>{return e=t,o=n,void("undefined"!=typeof window&&"function"==typeof window.snackbar&&window.snackbar({text:s(e,o)}));var e,o};"undefined"!=typeof navigator&&navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(e).then(o).catch(()=>d(e,o)):d(e,o)}function d(e,t){try{const n=document.createElement("textarea");n.value=e,n.style.position="fixed",n.style.opacity="0",document.body.appendChild(n),n.focus(),n.select(),document.execCommand("copy"),document.body.removeChild(n),t()}catch{}}const A=e=>{const{component:t,commands:n}=e,r=t.id;return{select:e=>{let{changeTab:t,tab:n}=e;n.text||t("
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[4739],{54739(e,t,n){n.d(t,{default:()=>k});var o=n(86319);function i(){const e="undefined"!=typeof window&&window.location.hostname||"";return/^(localhost|127\.0\.0\.1|0\.0\.0\.0|\[::1\])$/.test(e)}function a(){const e=o.M.get("config","mcpUrl");if("string"==typeof e&&e)return e;return`${i()?"http://localhost:3000":"https://api.creaditor.ai"}/v1/mcp`}const r="https://claude.ai/settings/connectors";function c(){const e="undefined"!=typeof window?window.open("about:blank","_blank"):null,t=t=>{e?e.location=t:"undefined"!=typeof window&&window.open(t,"_blank","noopener,noreferrer")};(async function(){const e=o.M.get("editor");if(!e)return null;if("function"==typeof e.studioTokenProvider)try{const t=await e.studioTokenProvider({});if("string"==typeof t&&t)return t}catch(e){}return"string"==typeof e.studioToken&&e.studioToken?e.studioToken:null})().then(async e=>{if(!e)return t(r);const n=await fetch(`${a().replace(/\/v1\/mcp\/?$/,"")}/oauth/connect/ticket`,{method:"POST",headers:{Authorization:`Bearer ${e}`}});if(!n.ok)return t(r);const{sessionUrl:o}=await n.json();t(o||r)}).catch(()=>t(r))}function s(e,t){return o.M.get("lang",e)||t}function l(e,t,n){const o=()=>{return e=t,o=n,void("undefined"!=typeof window&&"function"==typeof window.snackbar&&window.snackbar({text:s(e,o)}));var e,o};"undefined"!=typeof navigator&&navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(e).then(o).catch(()=>d(e,o)):d(e,o)}function d(e,t){try{const n=document.createElement("textarea");n.value=e,n.style.position="fixed",n.style.opacity="0",document.body.appendChild(n),n.focus(),n.select(),document.execCommand("copy"),document.body.removeChild(n),t()}catch{}}const A=e=>{const{component:t,commands:n}=e,r=t.id;return{select:e=>{let{changeTab:t,tab:n}=e;n.text||t("style")},tabs:e=>{const t=[{text:"style",selected:!0},{text:"settings"}];return e?(t.forEach(t=>t.selected=t.text===e),t):t},layout:e=>{let{tab:s}=e;const d=()=>"style"===s.text;return[{type:"info",text:"ai_connect_intro",active:d},{type:"button",text:"ai_connect_btn",bgColor:"#6c47ff",color:"#ffffff",active:d,onClick:()=>{l(a(),"ai_connect_link_copied","Connection link copied — paste it in Claude's connector settings."),c()}},{type:"info",text:"ai_connect_localhost_note",active:()=>d()&&i()},{type:"input",title:"ai_connect_url_label",active:d,value:a(),onChange:e=>{e&&e.target&&(e.target.value=a())}},{type:"button",text:"ai_connect_prompt_btn",active:d,onClick:()=>{l(function(e){const t=o.M.get("app"),n=t&&t._id,i=n?`the AI element with id \`${e}\` on site \`${n}\``:`the AI element with id \`${e}\``;return[`Connect to my Creaditor site builder via its MCP connector at ${a()}.`,"",`Then use the write_element_html tool to build a complete, modern, responsive landing page into ${i}.`,"","If you're not sure what the page should be about, ask me first."].join("\n")}(r),"ai_connect_prompt_copied","Prompt copied — paste it into a Claude chat.")}},{type:"input",title:"elementId",active:d,value:r,onChange:()=>{}},{type:"slider",title:"height",min:200,max:2400,active:()=>"style"===s.text,value:parseInt(t.props.style?.height,10)||900,onInput:e=>{const t=e.target.value;n.execCommand("style",{height:t+"px"})}}]}}},p=e=>{let{helpers:t}=e;return{set:(e,n,o)=>{switch(n){case"style":return e[n]=t.deepMerge(e[n],o),!0;case"html":return e[n]=o,!0;default:return!1}}}};var u=n(72591),h=n.n(u),m=n(88639),f=n.n(m),g=n(88128),y=n.n(g),C=n(30855),b=n.n(C),E=n(93051),v=n.n(E),w=n(79646),B={};B.setAttributes=b(),B.insert=y().bind(null,"head"),B.domAPI=f(),B.insertStyleElement=v();h()(w.A,B);const x=w.A&&w.A.locals?w.A.locals:void 0,k=()=>({name:"ai",create:e=>{const{createElement:t,compose:n,helpers:o}=e,{arrayToString:i,mergeDiff:a}=o,r=document.createElement("div");r.setAttribute("data-id",n.id),r.setAttribute("draggable-element","element"),r.setAttribute("droppable-element","element"),r.className=i("ai-component",x.main);const c=document.createElement("div");c.style.cssText="position:relative;max-width:100%;height:100%;width:100%;",r.appendChild(c);const s=document.createElement("iframe");s.style.cssText="width:100%;height:100%;border:none;display:block;",c.appendChild(s);const l=document.createElement("div");l.className=x.emptyAiHolder;const d=document.createElement("h1");d.setAttribute("align","center");const u=document.createElement("lang-text");u.setAttribute("text","ai_element_empty_connect_claude"),d.appendChild(u),l.appendChild(d),c.appendChild(l);return t({name:"ai",id:n.id,template:r,defaultProps:{style:{display:"block",width:"100%",height:"100vh"},html:""},draggable:{group:"element"},droppable:{group:"element"},render:()=>{a(s,{style:n.props.style});const e=n.props.html||"";e?(s.srcdoc!==e&&(s.srcdoc=e),s.style.display="block",l.style.display="none"):(s.removeAttribute("srcdoc"),s.style.display="none",l.style.display="flex")},resizeable:()=>c,handleBar:!0,validator:p({helpers:o}),schema:n.schema,onSelect:e=>{r.classList.add(e)},onDeselect:e=>{r.classList.remove(e)},elementProps:n,remove:()=>{r.remove()},createEditor:A})}})},79646(e,t,n){n.d(t,{A:()=>c});var o=n(82001),i=n.n(o),a=n(40935),r=n.n(a)()(i());r.push([e.id,'.NBtRDhA9L9rE8tvMRYXh {\n position: relative;\n width: 100%;\n}\n\n.NBtRDhA9L9rE8tvMRYXh:hover::after {\n content: "";\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background: #000;\n background: var(--primary, #000);\n opacity: 0.1;\n z-index: 9;\n}\n\n.NBtRDhA9L9rE8tvMRYXh iframe {\n width: 100%;\n height: 100%;\n border: none;\n}\n\n.BwJnFUnLniO8YoMqBrOB {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n gap: 15px;\n z-index: 15;\n width: 100%;\n padding: 24px;\n text-align: center;\n}\n\n.BwJnFUnLniO8YoMqBrOB h1 {\n font-size: 1.2rem;\n font-weight: 500;\n color: rgba(0, 0, 0, 0.72);\n}\n',"",{version:3,sources:["webpack://./../web-editors/ai-editor-component/lib/style.module.css"],names:[],mappings:"AAAA;EACE,kBAAkB;EAClB,WAAW;AACb;;AAEA;EACE,WAAW;EACX,kBAAkB;EAClB,OAAO;EACP,MAAM;EACN,WAAW;EACX,YAAY;EACZ,gBAAgC;EAAhC,gCAAgC;EAChC,YAAY;EACZ,UAAU;AACZ;;AAEA;EACE,WAAW;EACX,YAAY;EACZ,YAAY;AACd;;AAEA;EACE,kBAAkB;EAClB,SAAS;EACT,QAAQ;EACR,gCAAgC;EAChC,aAAa;EACb,uBAAuB;EACvB,mBAAmB;EACnB,sBAAsB;EACtB,SAAS;EACT,WAAW;EACX,WAAW;EACX,aAAa;EACb,kBAAkB;AACpB;;AAEA;EACE,iBAAiB;EACjB,gBAAgB;EAChB,0BAA0B;AAC5B",sourcesContent:['.main {\n position: relative;\n width: 100%;\n}\n\n.main:hover::after {\n content: "";\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background: var(--primary, #000);\n opacity: 0.1;\n z-index: 9;\n}\n\n.main iframe {\n width: 100%;\n height: 100%;\n border: none;\n}\n\n.emptyAiHolder {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n gap: 15px;\n z-index: 15;\n width: 100%;\n padding: 24px;\n text-align: center;\n}\n\n.emptyAiHolder h1 {\n font-size: 1.2rem;\n font-weight: 500;\n color: rgba(0, 0, 0, 0.72);\n}\n'],sourceRoot:""}]),r.locals={main:"NBtRDhA9L9rE8tvMRYXh",emptyAiHolder:"BwJnFUnLniO8YoMqBrOB"};const c=r}}]);
|
|
Binary file
|
|
@@ -554,9 +554,9 @@
|
|
|
554
554
|
<cdtr-row @click=${t=>{const e=t.currentTarget;if(e){if(t.target.closest("cdtr-gallery"))return;const a=e.querySelector("cdtr-gallery");a&&(a.opened&&(a.opened=!1),setTimeout(()=>{a.opened=!0},100))}}} style="padding:0.7rem 0px;" justify="${t.justify||"center"}" alignItems="center">
|
|
555
555
|
${t.src&&t.hasPreview?r.qy`
|
|
556
556
|
<div style="position: relative; width: 100%; margin-bottom: 10px; border: 1px solid #eee; border-radius: 4px; overflow: hidden;">
|
|
557
|
-
<img
|
|
558
|
-
src="${t.src}"
|
|
559
|
-
style="width: 100%; height:
|
|
557
|
+
<img
|
|
558
|
+
src="${t.src}"
|
|
559
|
+
style="${t.previewWidth?`width: ${t.previewWidth}; max-width: 100%;`:"max-width: 100%;"} height: auto; object-fit: contain; display: block; margin: 0 auto;"
|
|
560
560
|
onerror="this.style.display='none'"
|
|
561
561
|
/>
|
|
562
562
|
${t.isDeletable?r.qy`
|
|
@@ -648,7 +648,7 @@
|
|
|
648
648
|
.target=${t.target}
|
|
649
649
|
@change=${t.onChange}
|
|
650
650
|
></cdtr-link-element
|
|
651
|
-
></cdtr-editor-container>`,
|
|
651
|
+
></cdtr-editor-container>`,W=[{name:"solid",value:"solid"},{name:"dashed",value:"dashed"},{name:"dotted",value:"dotted"},{name:"outset",value:"outset"},{name:"groove",value:"groove"},{name:"double",value:"double"},{name:"ridge",value:"ridge"}],j=t=>r.qy`<cdtr-editor-container>
|
|
652
652
|
<cdtr-row alignItems="center" jusitfyContent="space-between">
|
|
653
653
|
<cdtr-col>
|
|
654
654
|
<cdtr-title><lang-text text="type"></lang-text></cdtr-title>
|
|
@@ -662,7 +662,7 @@
|
|
|
662
662
|
><lang-text text="${t.borderType||t.value}"></lang-text>
|
|
663
663
|
</cdtr-dropdown-button>
|
|
664
664
|
<div slot="content">
|
|
665
|
-
${
|
|
665
|
+
${W.map(e=>r.qy`<cdtr-dropdown-item
|
|
666
666
|
.focused=${e.value===t.borderStyle||e.value===t.value}
|
|
667
667
|
.selected=${e.value===t.borderStyle||e.value===t.value}
|
|
668
668
|
value="${e.value}"
|
|
@@ -1167,7 +1167,7 @@
|
|
|
1167
1167
|
`:null}
|
|
1168
1168
|
</cdtr-row>
|
|
1169
1169
|
</cdtr-editor-container>
|
|
1170
|
-
`;a.e(4217).then(a.bind(a,94217));a(45888);Promise.resolve().then(a.bind(a,58691));class pt extends r.WF{constructor(){super(),this.editor={},this.tabName="",this.factory=this.factory.bind(this),this.execCommandWrapper=this.execCommandWrapper.bind(this),this.connectWith=this.connectWith.bind(this),this.changeTab=this.changeTab.bind(this),this.$select=this.$select.bind(this),this.$update=this.$update.bind(this),this.handleJustifyContent=this.handleJustifyContent.bind(this),this.handleAlignItems=this.handleAlignItems.bind(this),this._onToggleAll=this._onToggleAll.bind(this),this._sectionsExpanded=!1}$select(){this.editor&&this.editor.select&&this.editor.select({changeTab:this.changeTab,tab:this.tabName}),this.connectWith("select")}$update(){this.connectWith("update")}_onToggleAll(){this._sectionsExpanded=!this._sectionsExpanded,this.querySelectorAll("cdtr-editor-section").forEach(t=>{t.open=this._sectionsExpanded,(0,lt.Q)(t.persistKey,t.open)})}_sectionScope(){return`${this.type||""}:${this.tabName||""}`}_applyPersistedOpen(t){const e=this._sectionScope();for(const a of t)if(a&&"section"===a.type){a.persistKey=`${e}::${a.label}`;const t=(0,lt.i)(a.persistKey);void 0!==t&&(a.open=t)}return t}connectedCallback(){super.connectedCallback(),l.Ay.on("update",this.$update),l.Ay.on("select",this.$select),this.addEventListener("toggle-all-sections",this._onToggleAll),this.connectWith("load")}disconnectedCallback(){super.disconnectedCallback(),l.Ay.off("update",this.$update),l.Ay.off("select",this.$select),this.removeEventListener("toggle-all-sections",this._onToggleAll)}connectWith(){const t=new UIEvent(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"update",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(t);const e=l.Ay.components.find(t=>t.type===this.type);e&&"function"==typeof e.createEditor&&(this.component={...e},this.props=e.props,this.editor=e.createEditor(this.commandsBuilder()))}factory(t,e){if("function"==typeof t&&(t=t()),t.debug,"boolean"==typeof t.active&&!t.active)return null;if("function"==typeof t.active){if(!1===t.active())return null}const a=t.type;switch(a){case"background":return dt(t);case"datetime":return D(t);case"radius":return O(t);case"justifyContent":case"alignItems":return P(t,a);case"node":case"lit":case"custom":return t.node();case"button":return U(t);case"borderpicker":return
|
|
1170
|
+
`;a.e(4217).then(a.bind(a,94217));a(45888);Promise.resolve().then(a.bind(a,58691));class pt extends r.WF{constructor(){super(),this.editor={},this.tabName="",this.factory=this.factory.bind(this),this.execCommandWrapper=this.execCommandWrapper.bind(this),this.connectWith=this.connectWith.bind(this),this.changeTab=this.changeTab.bind(this),this.$select=this.$select.bind(this),this.$update=this.$update.bind(this),this.handleJustifyContent=this.handleJustifyContent.bind(this),this.handleAlignItems=this.handleAlignItems.bind(this),this._onToggleAll=this._onToggleAll.bind(this),this._sectionsExpanded=!1}$select(){this.editor&&this.editor.select&&this.editor.select({changeTab:this.changeTab,tab:this.tabName}),this.connectWith("select")}$update(){this.connectWith("update")}_onToggleAll(){this._sectionsExpanded=!this._sectionsExpanded,this.querySelectorAll("cdtr-editor-section").forEach(t=>{t.open=this._sectionsExpanded,(0,lt.Q)(t.persistKey,t.open)})}_sectionScope(){return`${this.type||""}:${this.tabName||""}`}_applyPersistedOpen(t){const e=this._sectionScope();for(const a of t)if(a&&"section"===a.type){a.persistKey=`${e}::${a.label}`;const t=(0,lt.i)(a.persistKey);void 0!==t&&(a.open=t)}return t}connectedCallback(){super.connectedCallback(),l.Ay.on("update",this.$update),l.Ay.on("select",this.$select),this.addEventListener("toggle-all-sections",this._onToggleAll),this.connectWith("load")}disconnectedCallback(){super.disconnectedCallback(),l.Ay.off("update",this.$update),l.Ay.off("select",this.$select),this.removeEventListener("toggle-all-sections",this._onToggleAll)}connectWith(){const t=new UIEvent(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"update",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(t);const e=l.Ay.components.find(t=>t.type===this.type);e&&"function"==typeof e.createEditor&&(this.component={...e},this.props=e.props,this.editor=e.createEditor(this.commandsBuilder()))}factory(t,e){if("function"==typeof t&&(t=t()),t.debug,"boolean"==typeof t.active&&!t.active)return null;if("function"==typeof t.active){if(!1===t.active())return null}const a=t.type;switch(a){case"background":return dt(t);case"datetime":return D(t);case"radius":return O(t);case"justifyContent":case"alignItems":return P(t,a);case"node":case"lit":case"custom":return t.node();case"button":return U(t);case"borderpicker":return j(t);case"linkpicker":return F(t);case"input":return s(t);case"dropdown":return n(t);case"fontSize":return d(t);case"fontFamily":return c(t);case"mergeTags":return G(t);case"boxShadow":return x(t);case"colorpicker":return p(t);case"slider":return h(t);case"divider":return w(t);case"heading":return v(t);case"option":return $(t);case"checkbox":return z(t);case"stringListBuilder":return _(t);case"chipsInput":return L(t);case"typography":return H(t);case"icons":return r.qy`<icons-gallery
|
|
1171
1171
|
.selectedIcon=${t.selectedIcon}
|
|
1172
1172
|
.useIconsApi=${!0===t.useIconsApi}
|
|
1173
1173
|
.iconColor=${t.iconColor??"000000"}
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5119],{15119(e,t,o){o.d(t,{default:()=>W});var n=o(96374),r=o(86319),l=o(59929);const a=e=>{{const{component:t,commands:o,helpers:a}=e;return{select:e=>{let{changeTab:t,tab:o}=e},tabs:e=>{const t=
|
|
1
|
+
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[5119],{15119(e,t,o){o.d(t,{default:()=>W});var n=o(96374),r=o(86319),l=o(59929);const a=e=>{{const{component:t,commands:o,helpers:a}=e;return{select:e=>{let{changeTab:t,tab:o}=e},tabs:e=>{const t=[{text:"style",selected:!0},{text:"interactions"},..."web"===r.M.get("config","channel")?[{text:"animations"}]:[],{text:"settings"}];return t.forEach(t=>t.selected=t.selected=t.text===e),t},layout:e=>{let{tab:a,changeTab:i,tabs:d}=e;const s=(r.M.get("components")||[]).filter(e=>e&&"block"===e.type&&e.props?.modalable),c=[{value:"",label:"modal_none"},...s.map((e,t)=>({value:e.id,label:e.props?.modalName||`modal ${t+1}`}))],p=t.props.modalBlockId||"",b=c.find(e=>e.value===p)?.label||"modal_none",u=[{type:"heading",level:6,text:"presets",active:()=>"style"===a.text&&"web"===r.M.get("config","channel")},{type:"custom",active:()=>"style"===a.text&&"web"===r.M.get("config","channel"),node:()=>{const e="web"===r.M.get("config","channel"),n={cart:"http://app.creaditor.com/assets/bullets/images/cart-icon.png",arrowRight:"http://app.creaditor.com/assets/bullets/images/1469020585_ic_keyboard_arrow_right_48px.png"},a=[{category:"Basic",presets:[{name:"Solid",style:{background:"#111111",color:"#ffffff",borderRadius:"6px",border:"none",borderWidth:null,borderColor:null,boxShadow:null}},{name:"Pill",style:{background:"#2563eb",color:"#ffffff",borderRadius:"999px",border:"none",borderWidth:null,borderColor:null,boxShadow:null}},{name:"Outline",style:{background:"transparent",color:"#111111",borderRadius:"6px",border:"1px solid #111111",borderWidth:"1px",borderColor:"#111111",boxShadow:null}},{name:"Soft",style:{background:"#eef2ff",color:"#3730a3",borderRadius:"10px",border:"none",borderWidth:null,borderColor:null,boxShadow:null}}]},{category:"Gradients",presets:[{name:"Sunset",style:{background:"linear-gradient(135deg,#ff6a00,#ee0979)",color:"#ffffff",borderRadius:"8px",border:"none",borderWidth:null,borderColor:null,boxShadow:null}},{name:"Ocean",style:{background:"linear-gradient(135deg,#2193b0,#6dd5ed)",color:"#ffffff",borderRadius:"8px",border:"none",borderWidth:null,borderColor:null,boxShadow:null}},{name:"Grape",webOnly:!0,style:{background:"linear-gradient(135deg,#7b2ff7,#f107a3)",color:"#ffffff",borderRadius:"8px",border:"none",borderWidth:null,borderColor:null,boxShadow:null}},{name:"Lime",webOnly:!0,style:{background:"linear-gradient(135deg,#11998e,#38ef7d)",color:"#ffffff",borderRadius:"8px",border:"none",borderWidth:null,borderColor:null,boxShadow:null}}]},{category:"3D blocks",presets:[{name:"Orange",webOnly:!0,style:{background:"#ed8936",color:"#ffffff",borderRadius:"10px",padding:"14px 22px",fontWeight:700,border:"none",borderWidth:null,borderColor:null,boxShadow:"0px 5px 0px 0px #b45309"}},{name:"Green",webOnly:!0,style:{background:"#38a169",color:"#ffffff",borderRadius:"10px",padding:"14px 22px",fontWeight:700,border:"none",borderWidth:null,borderColor:null,boxShadow:"0px 5px 0px 0px #276749"}},{name:"Blue",webOnly:!0,style:{background:"#3182ce",color:"#ffffff",borderRadius:"10px",padding:"14px 22px",fontWeight:700,border:"none",borderWidth:null,borderColor:null,boxShadow:"0px 5px 0px 0px #2151a1"}},{name:"Red",webOnly:!0,style:{background:"#e53e3e",color:"#ffffff",borderRadius:"10px",padding:"14px 22px",fontWeight:700,border:"none",borderWidth:null,borderColor:null,boxShadow:"0px 5px 0px 0px #9b2c2c"}},{name:"Purple",webOnly:!0,style:{background:"#805ad5",color:"#ffffff",borderRadius:"10px",padding:"14px 22px",fontWeight:700,border:"none",borderWidth:null,borderColor:null,boxShadow:"0px 5px 0px 0px #553c9a"}},{name:"Dark",webOnly:!0,style:{background:"#2d3748",color:"#ffffff",borderRadius:"10px",padding:"14px 22px",fontWeight:700,border:"none",borderWidth:null,borderColor:null,boxShadow:"0px 5px 0px 0px #1a202c"}}]},{category:"Effects",presets:[{name:"Neon",webOnly:!0,style:{background:"#0a0a0a",color:"#39ff14",borderRadius:"8px",border:"1px solid #39ff14",borderWidth:"1px",borderColor:"#39ff14",boxShadow:"0 0 10px #39ff14, 0 0 22px rgba(57,255,20,0.5)"}},{name:"Glow",webOnly:!0,style:{background:"#7b2ff7",color:"#ffffff",borderRadius:"10px",border:"none",borderWidth:null,borderColor:null,boxShadow:"0 8px 24px rgba(123,47,247,0.55)"}},{name:"Glass",webOnly:!0,style:{background:"rgba(255,255,255,0.18)",color:"#111111",borderRadius:"12px",border:"1px solid rgba(255,255,255,0.6)",borderWidth:"1px",borderColor:"rgba(255,255,255,0.6)",backdropFilter:"blur(8px)",boxShadow:"0 4px 30px rgba(0,0,0,0.1)"}},{name:"Shadow",webOnly:!0,style:{background:"#ffffff",color:"#111111",borderRadius:"12px",border:"none",borderWidth:null,borderColor:null,boxShadow:"0 10px 24px rgba(0,0,0,0.18)"}},{name:"Emboss",webOnly:!0,style:{background:"#e2e8f0",color:"#2d3748",borderRadius:"10px",border:"none",borderWidth:null,borderColor:null,boxShadow:"inset 0 2px 4px rgba(255,255,255,0.9), inset 0 -2px 4px rgba(0,0,0,0.15), 0 2px 4px rgba(0,0,0,0.1)"}}]},{category:"Premium gradients",presets:[{name:"Aurora",webOnly:!0,style:{background:"linear-gradient(135deg,#667eea,#764ba2)",color:"#ffffff",borderRadius:"10px",border:"none",borderWidth:null,borderColor:null,boxShadow:"0 8px 20px rgba(118,75,162,0.4)"}},{name:"Peach",webOnly:!0,style:{background:"linear-gradient(135deg,#ff9a9e,#fecfef)",color:"#7a2e3a",borderRadius:"10px",border:"none",borderWidth:null,borderColor:null,boxShadow:"0 8px 20px rgba(255,154,158,0.45)"}},{name:"Gold",webOnly:!0,style:{background:"linear-gradient(135deg,#f6d365,#fda085)",color:"#5a3a1a",borderRadius:"10px",border:"none",borderWidth:null,borderColor:null,boxShadow:"0 8px 20px rgba(253,160,133,0.45)"}},{name:"Midnight",webOnly:!0,style:{background:"linear-gradient(135deg,#0f2027,#203a43,#2c5364)",color:"#ffffff",borderRadius:"10px",border:"none",borderWidth:null,borderColor:null,boxShadow:"0 8px 20px rgba(15,32,39,0.5)"}},{name:"Candy",webOnly:!0,style:{background:"linear-gradient(135deg,#f093fb,#f5576c)",color:"#ffffff",borderRadius:"10px",border:"none",borderWidth:null,borderColor:null,boxShadow:"0 8px 20px rgba(245,87,108,0.45)"}}]},{category:"With icon",presets:[{name:"Buy now",icon:{src:n.cart,direction:"left",size:18},style:{background:"#16a34a",color:"#ffffff",borderRadius:"8px",border:"none",borderWidth:null,borderColor:null,boxShadow:null}},{name:"Continue",icon:{src:n.arrowRight,direction:"right",size:18},style:{background:"linear-gradient(135deg,#2563eb,#1e3a8a)",color:"#ffffff",borderRadius:"8px",border:"none",borderWidth:null,borderColor:null,boxShadow:null}}]}].map(t=>({...t,presets:t.presets.filter(t=>e||!t.webOnly)})).filter(e=>e.presets.length>0),i=t.props.text||"Button",d=e=>e.icon?l.qy`<img
|
|
2
2
|
src="${e.icon.src}"
|
|
3
3
|
style="width:16px;height:16px;object-fit:contain;vertical-align:middle;${"right"===e.icon.direction?"margin-left:6px;order:2;":"margin-right:6px;"}"
|
|
4
4
|
/>`:"",s=e=>l.qy`
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
font-weight:${e.style.fontWeight||400};
|
|
15
15
|
box-shadow:${e.style.boxShadow||"none"};"
|
|
16
16
|
>
|
|
17
|
-
${e.icon&&"right"!==e.icon.direction?
|
|
18
|
-
<span style="overflow:hidden;text-overflow:ellipsis;">${
|
|
19
|
-
${e.icon&&"right"===e.icon.direction?
|
|
17
|
+
${e.icon&&"right"!==e.icon.direction?d(e):""}
|
|
18
|
+
<span style="overflow:hidden;text-overflow:ellipsis;">${i}</span>
|
|
19
|
+
${e.icon&&"right"===e.icon.direction?d(e):""}
|
|
20
20
|
</button>
|
|
21
21
|
`;return l.qy`
|
|
22
22
|
<cdtr-editor-container pt="0">
|
|
@@ -31,4 +31,4 @@
|
|
|
31
31
|
`)}
|
|
32
32
|
</div>
|
|
33
33
|
</cdtr-editor-container>
|
|
34
|
-
`}},{type:"heading",level:6,text:"open_modal",active:()=>"modal"===a.text},{type:"info",text:s.length?"modal_pick_hint":"modal_none_hint",active:()=>"modal"===a.text},{type:"dropdown",title:"modal_block",active:()=>"modal"===a.text,value:b,selected:p,items:c,onChange:e=>{o.execCommand("modalBlockId",e.target.value)}},{type:"heading",level:6,text:"settings",active:()=>"style"===a.text},{type:"input",title:"whatTheBtnSays",mergeTags:!0,emoji:!0,active:()=>"style"===a.text,value:t.props.text||"",onInput:e=>{const t=e.target.value;o.execCommand("text",t)}},{type:"heading",level:6,text:"colors",active:()=>"style"===a.text},{type:"colorSwatchGroup",active:()=>"style"===a.text,columns:2,items:[{title:"button_background",allowGradient:!0,value:t.props.style.background||"#000000",onChange:e=>{const r=e.target.value;if(!r.includes("gradient(")){const e=(0,n.w)(t.props.style.color,r);o.execCommand("style",{color:e})}o.execCommand("style",{background:r,backgroundColor:null})}},{title:"font_color",value:t.props.style.color||"#ffffff",onChange:e=>{const t=e.target.value;o.execCommand("style",{color:t})}}]},{type:"heading",level:6,text:"typography",active:()=>"style"===a.text},{type:"typography",active:()=>"style"===a.text,bold:700===t.props.style.fontWeight,italic:"italic"===t.props.style.fontStyle,underline:"underline"===t.props.style.textDecoration,onChange:e=>{switch(e){case"bold":const e=700===t.props.style.fontWeight?400:700;o.execCommand("style",{fontWeight:e});break;case"italic":const n="italic"===t.props.style.fontStyle?"normal":"italic";o.execCommand("style",{fontStyle:n});break;case"underline":const r="underline"===t.props.style.textDecoration?"none":"underline";o.execCommand("style",{textDecoration:r})}}},{type:"fontFamily",active:()=>"style"===a.text,value:t.props.style.fontFamily,weight:"web"===r.M.get("config","channel"),weightValue:t.props.style.fontWeight,onChange:e=>{const t=e.target.value;o.execCommand("style",{fontFamily:t})},onWeightChange:e=>{o.execCommand("style",{fontWeight:e.detail.value})}},{type:"slider",title:"fontSize",step:1,min:8,max:50,active:()=>"style"===a.text,value:parseInt(t.props.style.fontSize)||14,onInput:e=>{const t=e.target.value;o.execCommand("style",{fontSize:t+"px",height:"auto"})}},{type:"heading",level:6,text:"dimensions",active:()=>"style"===a.text},{type:"slider",title:"width",min:10,max:500,active:()=>"style"===a.text,value:parseInt(t.props.style.width),onInput:e=>{const t=e.target.value;o.execCommand("style",{width:t+"px",minWidth:null})}},{type:"heading",level:6,text:"border_design",active:()=>"style"===a.text},{type:"slider",title:"radius",min:0,max:100,active:()=>"style"===a.text,value:parseInt(t.props.style.borderRadius),onInput:e=>{const t=e.target.value;o.execCommand("style",{borderRadius:t+"px"})}},{type:"borderpicker",title:"border",active:()=>"style"===a.text,value:t.props.style.border,onChange:e=>{const t=e.target.value;o.execCommand("style",{border:t})}},{type:"slider",title:"borderWidth",active:()=>"style"===a.text,value:t.props.style.borderWidth,onInput:e=>{const t=e.target.value;o.execCommand("style",{borderWidth:t+"px"})}},{type:"colorpicker",title:"borderColor",active:()=>"style"===a.text,value:t.props.style.borderColor,onChange:e=>{const t=e.target.value;o.execCommand("style",{borderColor:t})}},{type:"heading",level:6,text:"shadow",active:()=>"style"===a.text},{type:"boxShadow",active:()=>"style"===a.text,value:t.props.style.boxShadow,onChange:e=>{o.execCommand("style",{boxShadow:e})}},{type:"linkpicker",href:t.props.onClick?.link,protocol:t.props.onClick?.link?.protocol,target:t.props.onClick?.link?.target,autofocus:!0,active:()=>"link"===a.text,onChange:e=>{const t={link:e.target.value};o.execCommand("onClick",t)}},{type:"checkbox",title:"hasIcon",useIconsApi:!0,checked:!!t.props.hasIcon,active:()=>"icons"===a.text,onChange:e=>{const t=e.target.checked;o.execCommand("hasIcon",t),o.execCommand("iconDirection","left")}},{type:"dropdown",active:()=>"icons"===a.text&&!0===t.props.hasIcon,title:"iconDirection",value:t.props.iconDirection,onChange:e=>{const t=e.target.value;o.execCommand("iconDirection",t)},items:[{value:"left",label:"left"},{value:"right",label:"right"}]},{type:"slider",title:"size",min:10,max:100,active:()=>"icons"===a.text&&!0===t.props.hasIcon,value:t.props.iconSize||16,onInput:e=>{const t=e.target.value;o.execCommand("iconSize",t)}},{type:"icons",active:()=>"icons"===a.text&&!0===t.props.hasIcon,selectedIcon:t.props.iconUrl,onChange:e=>{const t=e.detail;o.execCommand("iconUrl",t.src)}},{type:"heading",level:6,text:"spacing",active:()=>"style"===a.text},{type:"spacingPicker",active:()=>"style"===a.text,hasLeft:!1,hasRight:!1,value:{top:parseInt(t.props.style.paddingTop)||0,bottom:parseInt(t.props.style.paddingBottom)||0,left:parseInt(t.props.style.paddingLeft)||0,right:parseInt(t.props.style.paddingRight)||0},onChange:e=>{e.target.value;const t=e.target.topValue,n=e.target.bottomValue,r=e.target.leftValue,l=e.target.rightValue;o.execCommand("style",{paddingTop:t+"px",paddingBottom:n+"px",paddingLeft:r+"px",paddingRight:l+"px",padding:null})}}]}}}},d=e=>{let{helpers:t,editor:o,getFocused:n}=e;return{set:(e,r,l)=>{switch(r){case"style":return e[r]=t.deepMerge(e[r],l),!0;case"text":return e.text=l,n()||o.chain().setContent(l).run(),!0;case"ripple":case"rippleColor":case"scaleOnHover":case"hasIcon":case"iconUrl":case"iconSize":case"iconDirection":case"modalBlockId":return e[r]=l,!0;case"onClick":if(l.link)return e[r]=l,!0}}}};var i=o(72591),s=o.n(i),c=o(88639),p=o.n(c),b=o(88128),u=o.n(b),x=o(30855),f=o.n(x),g=o(93051),h=o.n(g),m=o(49536),y={};y.setAttributes=f(),y.insert=u().bind(null,"head"),y.domAPI=p(),y.insertStyleElement=h();s()(m.A,y);const A=m.A&&m.A.locals?m.A.locals:void 0;var C=o(81318),w=o(1366),v=o(67291),k=o(85194),S=o(28396);const E=C.YY.create({addKeyboardShortcuts:()=>({Enter:()=>!0})});const W=()=>{const e="button";return{name:e,create:t=>{const{createElement:o,compose:n,helpers:r}=t,{arrayToString:l,mergeDiff:i}=r;let s=!1;const c=document.createElement("div"),p=document.createElement("div"),{editor:b}=function(e){let{content:t,element:o}=e;return{element:o,editor:new C.KE({element:o,extensions:[w.A,v.A,S.A,k.Ay,E],content:t})}}({content:n.props.text,element:p});c.appendChild(p);return b.view.dom.setAttribute("dir","auto"),b.on("update",e=>{let{editor:t}=e;const o=t.getText();n.editor.store().updateComponent(n,"text",o)}),b.on("focus",e=>{let{event:t,editor:o}=e;s=!0}),b.on("blur",e=>{let{event:t,editor:o}=e;s=!1}),c.className=A.button,o({name:e,id:n.id,template:c,commands:{insertContent:e=>{b.commands.insertContent(e),b.chain().focus()}},defaultProps:{style:{height:"auto",width:"200px",padding:"10px",borderRadius:"5px",fontFamily:"Arial",fontSize:"16px"},text:"button"},render:()=>{try{n.props.style.display="",n.props.style.direction=""}catch(e){console.error(e)}i(c,{style:n.props.style}),c.style.height="auto";const e=n.props.hasIcon,t=n.props.iconUrl,o=n.props.iconDirection,r=n.props.iconSize,l="icon_in_button";let a=c.querySelector(`.${l}`)||document.createElement("img");e&&t?(a.className=l,a.src=t,a.style.width=(r||16)+"px",a.style.height=(r||16)+"px",a.style.marginRight="8px",a.style.marginLeft="8px","left"===o?c.insertBefore(a,c.firstChild):c.appendChild(a)):a.remove()},draggable:{group:"element"},droppable:{group:"element"},resizeable:()=>c,handleBar:!0,validator:d({template:c,helpers:r,editor:b,getFocused:function(){return s}}),schema:n.schema,onSelect:e=>{c.classList.add(e)},onDeselect:e=>{c.classList.remove(e)},elementProps:n,destroy:()=>{b.destroy()},remove:()=>{c.remove()},createEditor:a})}}}},49536(e,t,o){o.d(t,{A:()=>d});var n=o(82001),r=o.n(n),l=o(40935),a=o.n(l)()(r());a.push([e.id,".BEr8unIfy4OEGYhlHclN {\n cursor: text !important;\n}\n.BEr8unIfy4OEGYhlHclN {\n min-width: 30px;\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: center;\n padding:10px;\n}\n.BEr8unIfy4OEGYhlHclN p {\n margin: 0;\n line-height: 1;\n}\n.cI3RTMAdk9qoZ8mu9Sm9 {\n width: 100%;\n}\n.VSumPf0Ui7b1pl8cMATP {\n position: absolute;\n z-index: 9;\n width: 3px;\n height: 90%;\n background: var(--resizer-color);\n border-radius: 20px;\n}\n.Vo2Ewnq6ekWFdNMjxBIB {\n left: -8px;\n cursor: w-resize;\n}\n.WLZC84sb1rfaRnHCDyj8 {\n left: calc(100% + 5px);\n cursor: e-resize;\n}\n\n.BEr8unIfy4OEGYhlHclN .VSumPf0Ui7b1pl8cMATP {\n display: none;\n}\n.BEr8unIfy4OEGYhlHclN.Qh20ei1Fa8QUbGinFFbw .VSumPf0Ui7b1pl8cMATP {\n display: block;\n}\n/* .handle{\n display: none;\n}\n.button.selected .handle{\n display: block;\n} */\n","",{version:3,sources:["webpack://./../web-editors/button-editor-component/lib/style.module.css"],names:[],mappings:"AAAA;EACE,uBAAuB;AAOzB;AARA;EAEE,eAAe;EACf,aAAa;EACb,uBAAuB;EACvB,mBAAmB;EACnB,kBAAkB;EAClB,YAAY;AACd;AACA;EACE,SAAS;EACT,cAAc;AAChB;AACA;EACE,WAAW;AACb;AACA;EACE,kBAAkB;EAClB,UAAU;EACV,UAAU;EACV,WAAW;EACX,gCAAgC;EAChC,mBAAmB;AACrB;AACA;EACE,UAAU;EACV,gBAAgB;AAClB;AACA;EACE,sBAAsB;EACtB,gBAAgB;AAClB;;AAEA;EACE,aAAa;AACf;AACA;EACE,cAAc;AAChB;AACA;;;;;GAKG",sourcesContent:[".button {\n cursor: text !important;\n min-width: 30px;\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: center;\n padding:10px;\n}\n.button p {\n margin: 0;\n line-height: 1;\n}\n.contentEditable {\n width: 100%;\n}\n.margin {\n position: absolute;\n z-index: 9;\n width: 3px;\n height: 90%;\n background: var(--resizer-color);\n border-radius: 20px;\n}\n.marginLeft {\n left: -8px;\n cursor: w-resize;\n}\n.marginRight {\n left: calc(100% + 5px);\n cursor: e-resize;\n}\n\n.button .margin {\n display: none;\n}\n.button.selected .margin {\n display: block;\n}\n/* .handle{\n display: none;\n}\n.button.selected .handle{\n display: block;\n} */\n"],sourceRoot:""}]),a.locals={button:"BEr8unIfy4OEGYhlHclN",contentEditable:"cI3RTMAdk9qoZ8mu9Sm9",margin:"VSumPf0Ui7b1pl8cMATP",marginLeft:"Vo2Ewnq6ekWFdNMjxBIB",marginRight:"WLZC84sb1rfaRnHCDyj8",selected:"Qh20ei1Fa8QUbGinFFbw"};const d=a},67291(e,t,o){o.d(t,{A:()=>r});var n=o(81318);const r=n.bP.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",(0,n.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}})}}]);
|
|
34
|
+
`}}];return[{type:"heading",level:6,text:"text",active:()=>"style"===a.text},{type:"input",title:"whatTheBtnSays",mergeTags:!0,emoji:!0,active:()=>"style"===a.text,value:t.props.text||"",onInput:e=>{const t=e.target.value;o.execCommand("text",t)}},{type:"heading",level:6,text:"colors",active:()=>"style"===a.text},{type:"colorSwatchGroup",active:()=>"style"===a.text,columns:2,items:[{title:"button_background",allowGradient:!0,value:t.props.style.background||"#000000",onChange:e=>{const r=e.target.value;if(!r.includes("gradient(")){const e=(0,n.w)(t.props.style.color,r);o.execCommand("style",{color:e})}o.execCommand("style",{background:r,backgroundColor:null})}},{title:"font_color",value:t.props.style.color||"#ffffff",onChange:e=>{const t=e.target.value;o.execCommand("style",{color:t})}}]},{type:"heading",level:6,text:"typography",active:()=>"style"===a.text},{type:"typography",active:()=>"style"===a.text,bold:700===t.props.style.fontWeight,italic:"italic"===t.props.style.fontStyle,underline:"underline"===t.props.style.textDecoration,onChange:e=>{switch(e){case"bold":const e=700===t.props.style.fontWeight?400:700;o.execCommand("style",{fontWeight:e});break;case"italic":const n="italic"===t.props.style.fontStyle?"normal":"italic";o.execCommand("style",{fontStyle:n});break;case"underline":const r="underline"===t.props.style.textDecoration?"none":"underline";o.execCommand("style",{textDecoration:r})}}},{type:"fontFamily",active:()=>"style"===a.text,value:t.props.style.fontFamily,weight:"web"===r.M.get("config","channel"),weightValue:t.props.style.fontWeight,onChange:e=>{const t=e.target.value;o.execCommand("style",{fontFamily:t})},onWeightChange:e=>{o.execCommand("style",{fontWeight:e.detail.value})}},{type:"slider",title:"fontSize",step:1,min:8,max:50,active:()=>"style"===a.text,value:parseInt(t.props.style.fontSize)||14,onInput:e=>{const t=e.target.value;o.execCommand("style",{fontSize:t+"px",height:"auto"})}},{type:"heading",level:6,text:"dimensions",active:()=>"style"===a.text},{type:"slider",title:"width",min:10,max:500,active:()=>"style"===a.text,value:parseInt(t.props.style.width),onInput:e=>{const t=e.target.value;o.execCommand("style",{width:t+"px",minWidth:null})}},{type:"heading",level:6,text:"border_design",active:()=>"style"===a.text},{type:"slider",title:"radius",min:0,max:100,active:()=>"style"===a.text,value:parseInt(t.props.style.borderRadius),onInput:e=>{const t=e.target.value;o.execCommand("style",{borderRadius:t+"px"})}},{type:"borderpicker",title:"border",active:()=>"style"===a.text,value:t.props.style.border,onChange:e=>{const t=e.target.value;o.execCommand("style",{border:t})}},{type:"slider",title:"borderWidth",active:()=>"style"===a.text,value:t.props.style.borderWidth,onInput:e=>{const t=e.target.value;o.execCommand("style",{borderWidth:t+"px"})}},{type:"colorpicker",title:"borderColor",active:()=>"style"===a.text,value:t.props.style.borderColor,onChange:e=>{const t=e.target.value;o.execCommand("style",{borderColor:t})}},{type:"heading",level:6,text:"shadow",active:()=>"style"===a.text},{type:"boxShadow",active:()=>"style"===a.text,value:t.props.style.boxShadow,onChange:e=>{o.execCommand("style",{boxShadow:e})}},{type:"heading",level:6,text:"link",active:()=>"interactions"===a.text},{type:"linkpicker",href:t.props.onClick?.link,protocol:t.props.onClick?.link?.protocol,target:t.props.onClick?.link?.target,autofocus:!0,active:()=>"interactions"===a.text,onChange:e=>{const t={link:e.target.value};o.execCommand("onClick",t)}},{type:"heading",level:6,text:"open_modal",active:()=>"interactions"===a.text&&"web"===r.M.get("config","channel")},{type:"info",text:s.length?"modal_pick_hint":"modal_none_hint",active:()=>"interactions"===a.text&&"web"===r.M.get("config","channel")},{type:"dropdown",title:"modal_block",active:()=>"interactions"===a.text&&"web"===r.M.get("config","channel"),value:b,selected:p,items:c,onChange:e=>{o.execCommand("modalBlockId",e.target.value)}},{type:"heading",level:6,text:"icons",active:()=>"style"===a.text},{type:"checkbox",title:"hasIcon",useIconsApi:!0,checked:!!t.props.hasIcon,active:()=>"style"===a.text,onChange:e=>{const t=e.target.checked;o.execCommand("hasIcon",t),o.execCommand("iconDirection","left")}},{type:"dropdown",active:()=>"style"===a.text&&!0===t.props.hasIcon,title:"iconDirection",value:t.props.iconDirection,onChange:e=>{const t=e.target.value;o.execCommand("iconDirection",t)},items:[{value:"left",label:"left"},{value:"right",label:"right"}]},{type:"slider",title:"size",min:10,max:100,active:()=>"style"===a.text&&!0===t.props.hasIcon,value:t.props.iconSize||16,onInput:e=>{const t=e.target.value;o.execCommand("iconSize",t)}},{type:"icons",active:()=>"style"===a.text&&!0===t.props.hasIcon,selectedIcon:t.props.iconUrl,onChange:e=>{const t=e.detail;o.execCommand("iconUrl",t.src)}},{type:"heading",level:6,text:"spacing",active:()=>"style"===a.text},{type:"spacingPicker",active:()=>"style"===a.text,hasLeft:!1,hasRight:!1,value:{top:parseInt(t.props.style.paddingTop)||0,bottom:parseInt(t.props.style.paddingBottom)||0,left:parseInt(t.props.style.paddingLeft)||0,right:parseInt(t.props.style.paddingRight)||0},onChange:e=>{e.target.value;const t=e.target.topValue,n=e.target.bottomValue,r=e.target.leftValue,l=e.target.rightValue;o.execCommand("style",{paddingTop:t+"px",paddingBottom:n+"px",paddingLeft:r+"px",paddingRight:l+"px",padding:null})}},...u]}}}},i=e=>{let{helpers:t,editor:o,getFocused:n}=e;return{set:(e,r,l)=>{switch(r){case"style":return e[r]=t.deepMerge(e[r],l),!0;case"text":return e.text=l,n()||o.chain().setContent(l).run(),!0;case"ripple":case"rippleColor":case"scaleOnHover":case"hasIcon":case"iconUrl":case"iconSize":case"iconDirection":case"modalBlockId":return e[r]=l,!0;case"onClick":if(l.link)return e[r]=l,!0}}}};var d=o(72591),s=o.n(d),c=o(88639),p=o.n(c),b=o(88128),u=o.n(b),x=o(30855),g=o.n(x),f=o(93051),h=o.n(f),y=o(49536),m={};m.setAttributes=g(),m.insert=u().bind(null,"head"),m.domAPI=p(),m.insertStyleElement=h();s()(y.A,m);const A=y.A&&y.A.locals?y.A.locals:void 0;var C=o(81318),v=o(1366),w=o(67291),k=o(85194),S=o(28396);const E=C.YY.create({addKeyboardShortcuts:()=>({Enter:()=>!0})});const W=()=>{const e="button";return{name:e,create:t=>{const{createElement:o,compose:n,helpers:r}=t,{arrayToString:l,mergeDiff:d}=r;let s=!1;const c=document.createElement("div"),p=document.createElement("div"),{editor:b}=function(e){let{content:t,element:o}=e;return{element:o,editor:new C.KE({element:o,extensions:[v.A,w.A,S.A,k.Ay,E],content:t})}}({content:n.props.text,element:p});c.appendChild(p);return b.view.dom.setAttribute("dir","auto"),b.on("update",e=>{let{editor:t}=e;const o=t.getText();n.editor.store().updateComponent(n,"text",o)}),b.on("focus",e=>{let{event:t,editor:o}=e;s=!0}),b.on("blur",e=>{let{event:t,editor:o}=e;s=!1}),c.className=A.button,o({name:e,id:n.id,template:c,commands:{insertContent:e=>{b.commands.insertContent(e),b.chain().focus()}},defaultProps:{style:{height:"auto",width:"200px",padding:"10px",borderRadius:"5px",fontFamily:"Arial",fontSize:"16px"},text:"button"},render:()=>{try{n.props.style.display="",n.props.style.direction=""}catch(e){console.error(e)}d(c,{style:n.props.style}),c.style.height="auto";const e=n.props.hasIcon,t=n.props.iconUrl,o=n.props.iconDirection,r=n.props.iconSize,l="icon_in_button";let a=c.querySelector(`.${l}`)||document.createElement("img");e&&t?(a.className=l,a.src=t,a.style.width=(r||16)+"px",a.style.height=(r||16)+"px",a.style.marginRight="8px",a.style.marginLeft="8px","left"===o?c.insertBefore(a,c.firstChild):c.appendChild(a)):a.remove()},draggable:{group:"element"},droppable:{group:"element"},resizeable:()=>c,handleBar:!0,validator:i({template:c,helpers:r,editor:b,getFocused:function(){return s}}),schema:n.schema,onSelect:e=>{c.classList.add(e)},onDeselect:e=>{c.classList.remove(e)},elementProps:n,destroy:()=>{b.destroy()},remove:()=>{c.remove()},createEditor:a})}}}},49536(e,t,o){o.d(t,{A:()=>i});var n=o(82001),r=o.n(n),l=o(40935),a=o.n(l)()(r());a.push([e.id,".BEr8unIfy4OEGYhlHclN {\n cursor: text !important;\n}\n.BEr8unIfy4OEGYhlHclN {\n min-width: 30px;\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: center;\n padding:10px;\n}\n.BEr8unIfy4OEGYhlHclN p {\n margin: 0;\n line-height: 1;\n}\n.cI3RTMAdk9qoZ8mu9Sm9 {\n width: 100%;\n}\n.VSumPf0Ui7b1pl8cMATP {\n position: absolute;\n z-index: 9;\n width: 3px;\n height: 90%;\n background: var(--resizer-color);\n border-radius: 20px;\n}\n.Vo2Ewnq6ekWFdNMjxBIB {\n left: -8px;\n cursor: w-resize;\n}\n.WLZC84sb1rfaRnHCDyj8 {\n left: calc(100% + 5px);\n cursor: e-resize;\n}\n\n.BEr8unIfy4OEGYhlHclN .VSumPf0Ui7b1pl8cMATP {\n display: none;\n}\n.BEr8unIfy4OEGYhlHclN.Qh20ei1Fa8QUbGinFFbw .VSumPf0Ui7b1pl8cMATP {\n display: block;\n}\n/* .handle{\n display: none;\n}\n.button.selected .handle{\n display: block;\n} */\n","",{version:3,sources:["webpack://./../web-editors/button-editor-component/lib/style.module.css"],names:[],mappings:"AAAA;EACE,uBAAuB;AAOzB;AARA;EAEE,eAAe;EACf,aAAa;EACb,uBAAuB;EACvB,mBAAmB;EACnB,kBAAkB;EAClB,YAAY;AACd;AACA;EACE,SAAS;EACT,cAAc;AAChB;AACA;EACE,WAAW;AACb;AACA;EACE,kBAAkB;EAClB,UAAU;EACV,UAAU;EACV,WAAW;EACX,gCAAgC;EAChC,mBAAmB;AACrB;AACA;EACE,UAAU;EACV,gBAAgB;AAClB;AACA;EACE,sBAAsB;EACtB,gBAAgB;AAClB;;AAEA;EACE,aAAa;AACf;AACA;EACE,cAAc;AAChB;AACA;;;;;GAKG",sourcesContent:[".button {\n cursor: text !important;\n min-width: 30px;\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: center;\n padding:10px;\n}\n.button p {\n margin: 0;\n line-height: 1;\n}\n.contentEditable {\n width: 100%;\n}\n.margin {\n position: absolute;\n z-index: 9;\n width: 3px;\n height: 90%;\n background: var(--resizer-color);\n border-radius: 20px;\n}\n.marginLeft {\n left: -8px;\n cursor: w-resize;\n}\n.marginRight {\n left: calc(100% + 5px);\n cursor: e-resize;\n}\n\n.button .margin {\n display: none;\n}\n.button.selected .margin {\n display: block;\n}\n/* .handle{\n display: none;\n}\n.button.selected .handle{\n display: block;\n} */\n"],sourceRoot:""}]),a.locals={button:"BEr8unIfy4OEGYhlHclN",contentEditable:"cI3RTMAdk9qoZ8mu9Sm9",margin:"VSumPf0Ui7b1pl8cMATP",marginLeft:"Vo2Ewnq6ekWFdNMjxBIB",marginRight:"WLZC84sb1rfaRnHCDyj8",selected:"Qh20ei1Fa8QUbGinFFbw"};const i=a},67291(e,t,o){o.d(t,{A:()=>r});var n=o(81318);const r=n.bP.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",(0,n.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}})}}]);
|
|
Binary file
|