builder-settings-types 0.0.57 → 0.0.58

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.
@@ -1,21 +1,8 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let x=(l=21)=>{let t="",e=crypto.getRandomValues(new Uint8Array(l|=0));for(;l--;)t+=E[e[l]&63];return t};function H(l,t){for(const e in l)if(l.hasOwnProperty(e)){const i=l[e];t(e,i)}}class g{constructor(t){this.id=t.id||x(),this.title=t.title,this.settings=t.settings,Object.assign(this,t.settings)}setOnChange(t){return this.onChange=t,H(this.settings,(e,i)=>{i.setOnChange(t)}),this}getValues(t){if(t===void 0){const e={};for(const i in this.settings)if(this.settings.hasOwnProperty(i)){const n=this.settings[i];n instanceof g?e[i]=n.getValues():e[i]=n.value}return e}else{const e=this.settings[t];return e?e instanceof g?e.getValues():e.value:void 0}}draw(){const t=document.createElement("div");t.className="setting-group";const e=document.createElement("div");e.className="setting-group-title";const i=document.createElement("h3");i.textContent=this.title;const n=document.createElement("span");n.className="setting-group-arrow",n.innerHTML=`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let H=(l=21)=>{let t="",e=crypto.getRandomValues(new Uint8Array(l|=0));for(;l--;)t+=L[e[l]&63];return t};function E(l,t){for(const e in l)if(l.hasOwnProperty(e)){const i=l[e];t(e,i)}}class p{constructor(t){this.id=t.id||H(),this.title=t.title,this.settings=t.settings,Object.assign(this,t.settings)}setOnChange(t){return this.onChange=t,E(this.settings,(e,i)=>{i.setOnChange(t)}),this}getValues(t){if(t===void 0){const e={};for(const i in this.settings)if(this.settings.hasOwnProperty(i)){const n=this.settings[i];n instanceof p?e[i]=n.getValues():e[i]=n.value}return e}else{const e=this.settings[t];return e?e instanceof p?e.getValues():e.value:void 0}}draw(){const t=document.createElement("div");t.className="setting-group";const e=document.createElement("div");e.className="setting-group-title";const i=document.createElement("h3");i.textContent=this.title;const n=document.createElement("span");n.className="setting-group-arrow",n.innerHTML=`
2
2
  <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
3
3
  <path d="M5 7.5L10 12.5L15 7.5" stroke="#344054" stroke-width="1.66667" stroke-linecap="round" stroke-linejoin="round"/>
4
4
  </svg>
5
- `,e.onclick=()=>{const o=t.querySelector(".setting-group-content");o&&(o.classList.toggle("collapsed"),n.classList.toggle("rotated"))},e.appendChild(i),e.appendChild(n);const s=document.createElement("div");s.className="setting-group-content";for(const o in this.settings)if(this.settings.hasOwnProperty(o)){const a=this.settings[o];s.appendChild(a.draw())}return t.appendChild(e),t.appendChild(s),t}}function L(l){switch(l){case"number":return 0;case"text":return"";case"select":return null;case"color":return"#000000";case"date":return new Date().toISOString().split("T")[0];case"button":return"";default:return""}}class d{constructor(t={}){this.props=t,this.id=t.id||x(),this.value=this.props.default,this.title=t.title||""}setOnChange(t){return this.onChange=t,this}setValue(t){this.value=t,this.inputEl&&(this.inputEl.value=String(t)),this.onChange&&this.onChange(t)}createInput(t){t={...this.props.inputProps,...t};const e=document.createElement("div");if(e.className=t.wrapperClassName||"",t.title||t.icon){const s=document.createElement("div");if(s.className="icon-container",t.icon){const o=this.createIcon(t.icon,t.iconClassName);s.appendChild(o)}if(t.title){const o=this.createLabel(t.title,t.labelClassName);s.appendChild(o)}e.appendChild(s)}const i=document.createElement("div");i.className=t.wrapperClassName||"";const n=document.createElement("input");return this.inputEl=n,n.value=String(t.value||L(t.inputType)),n.type=t.inputType,n.placeholder=t.placeholder||"",n.className=t.inputClassName||"",n.oninput=s=>{const o=s.target;let a=o.value;t.inputType==="number"?a=Number(o.value):(t.inputType==="color"||t.inputType==="date")&&(a=o.value),this.value=a,this.onChange&&this.onChange(this.value)},t.inputCustomizer&&t.inputCustomizer(n),i.appendChild(n),e.appendChild(i),e}createLabel(t,e){const i=document.createElement("span");return i.textContent=t,i.className="input-label "+(e||""),i}createIcon(t,e){const i=document.createElement("span");return i.className="input-icon "+(e||""),i.innerHTML=t,i}}class w extends d{constructor(t){super({...t,default:t.default!==void 0?t.default:"auto"}),this.inputType="number",this.value=t.default!==void 0?t.default:"auto"}draw(){const t=this.value==="auto"?"text":"number",e=a=>{this.value!=="auto"&&(this.props.minValue!==void 0&&(a.min=String(this.props.minValue)),this.props.maxValue!==void 0&&(a.max=String(this.props.maxValue)),this.props.className&&a.classList.add(this.props.className),a.addEventListener("input",()=>{const r=this.props.minValue??Number.MIN_SAFE_INTEGER,u=this.props.maxValue??Number.MAX_SAFE_INTEGER;let h=Number(a.value);h<r&&(h=r),h>u&&(h=u),a.value=String(h)}))},i=this.createInput({value:this.value,inputType:t,title:this.props.title,icon:this.props.icon,inputClassName:"number-setting-input "+(this.props.inputClassName||""),wrapperClassName:"number-setting-wrapper "+(this.props.wrapperClassName||""),inputCustomizer:e,placeholder:this.value==="auto"?"auto":""});if(!this.props.suffix||this.props.suffix==="none")return i;i.classList.add("suffix-wrapper");const n=i.querySelector("input.number-setting-input");n&&(n.style.paddingRight="35px");const s=document.createElement("span");s.className="suffix-label",s.textContent=this.props.suffix,i.appendChild(s);const o=i.querySelector("input");return o&&(o.oninput=a=>{const r=a.target.value.trim();if(r.toLowerCase()==="auto")this.value="auto";else{const u=Number(r);isNaN(u)||(this.value=u)}this.onChange&&this.onChange(this.value)}),i}}class S extends g{constructor(t){super({title:"Margins",settings:{marginTop:new w({title:"Top",icon:y,suffix:"px",default:(t==null?void 0:t.marginTop)??"auto"}),marginRight:new w({title:"Right",icon:V,suffix:"px",default:(t==null?void 0:t.marginRight)??0}),marginBottom:new w({title:"Bottom",icon:T,suffix:"px",default:(t==null?void 0:t.marginBottom)??0}),marginLeft:new w({title:"Left",icon:I,suffix:"px",default:(t==null?void 0:t.marginLeft)??0})}})}getCssCode(){const t=typeof this.settings.marginTop.value=="number"?`${this.settings.marginTop.value}px`:this.settings.marginTop.value,e=typeof this.settings.marginRight.value=="number"?`${this.settings.marginRight.value}px`:this.settings.marginRight.value,i=typeof this.settings.marginBottom.value=="number"?`${this.settings.marginBottom.value}px`:this.settings.marginBottom.value,n=typeof this.settings.marginLeft.value=="number"?`${this.settings.marginLeft.value}px`:this.settings.marginLeft.value;return`
6
- margin-top: ${t};
7
- margin-right: ${e};
8
- margin-bottom: ${i};
9
- margin-left: ${n};
10
- `}}const y=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
11
- <path d="M2.25 16.25H2.2575M2.25 9.5H2.2575M2.25 12.875H2.2575M2.25 6.125H2.2575M5.625 16.25H5.6325M5.625 9.5H5.6325M12.375 16.25H12.3825M12.375 9.5H12.3825M9 16.25H9.0075M9 9.5H9.0075M9 12.875H9.0075M9 6.125H9.0075M15.75 16.25H15.7575M15.75 9.5H15.7575M15.75 12.875H15.7575M15.75 6.125H15.7575M15.75 2.75H2.25" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
12
- </svg>`,V=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
13
- <path d="M5.625 2.75H5.6325M5.625 9.5H5.6325M5.625 16.25H5.6325M12.375 2.75H12.3825M12.375 9.5H12.3825M12.375 16.25H12.3825M9 2.75H9.0075M9 9.5H9.0075M9 16.25H9.0075M9 12.875H9.0075M9 6.125H9.0075M2.25 2.75H2.2575M2.25 9.5H2.2575M2.25 16.25H2.2575M2.25 12.875H2.2575M2.25 6.125H2.2575M15.75 16.25V2.75" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
14
- </svg>`,T=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
15
- <path d="M2.25 2.75H2.2575M2.25 9.5H2.2575M2.25 12.875H2.2575M2.25 6.125H2.2575M5.625 2.75H5.6325M5.625 9.5H5.6325M12.375 2.75H12.3825M12.375 9.5H12.3825M9 2.75H9.0075M9 9.5H9.0075M9 12.875H9.0075M9 6.125H9.0075M15.75 2.75H15.7575M15.75 9.5H15.7575M15.75 12.875H15.7575M15.75 6.125H15.7575M15.75 16.25H2.25" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
16
- </svg>`,I=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
17
- <path d="M5.625 2.75H5.6325M5.625 9.5H5.6325M5.625 16.25H5.6325M12.375 2.75H12.3825M12.375 9.5H12.3825M12.375 16.25H12.3825M9 2.75H9.0075M9 9.5H9.0075M9 16.25H9.0075M9 12.875H9.0075M9 6.125H9.0075M15.75 2.75H15.7575M15.75 9.5H15.7575M15.75 16.25H15.7575M15.75 12.875H15.7575M15.75 6.125H15.7575M2.25 16.25V2.75" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
18
- </svg>`;class k extends d{constructor(t={}){super(t),this.inputType="text"}draw(){const t=e=>{this.props.maxLength!==void 0&&(e.maxLength=this.props.maxLength),this.props.className&&e.classList.add(this.props.className)};return this.createInput({value:this.value,inputType:this.inputType,title:this.props.title,placeholder:this.props.placeholder,icon:this.props.icon,inputClassName:"string-setting-input "+(this.props.inputClassName||""),wrapperClassName:"string-setting-wrapper "+(this.props.wrapperClassName||""),inputCustomizer:t})}}const M="<svg xmlns='http://www.w3.org/2000/svg' width='18' height='19' viewBox='0 0 18 19' fill='none'><path d='M8.99999 15.8542C9.79613 16.5667 10.8475 17 12 17C14.4853 17 16.5 14.9853 16.5 12.5C16.5 10.4248 15.0953 8.67769 13.1849 8.15763M4.81513 8.15762C2.9047 8.67768 1.5 10.4248 1.5 12.5C1.5 14.9853 3.51472 17 6 17C8.48528 17 10.5 14.9853 10.5 12.5C10.5 11.9146 10.3882 11.3554 10.1849 10.8424M13.5 6.5C13.5 8.98528 11.4853 11 9 11C6.51472 11 4.5 8.98528 4.5 6.5C4.5 4.01472 6.51472 2 9 2C11.4853 2 13.5 4.01472 13.5 6.5Z' stroke='#667085' stroke-linecap='round' stroke-linejoin='round'/></svg>";class N extends k{constructor(t){super({...t,icon:t.icon||M,title:t.title||"Color"}),this.inputType="color"}draw(){const t=document.createElement("div");t.className="color-setting-wrapper";const e=document.createElement("div");e.className="icon-container";const i=this.createIcon(this.props.icon||M),n=this.createLabel(this.title||"Color");e.appendChild(i),e.appendChild(n);const s=document.createElement("div");s.className="color-input-wrapper";const o=/^([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,a=p=>{const c=p.value.startsWith("#")?p.value.slice(1):p.value;return o.test(c)?(p.style.border="",!0):(p.style.border="1px solid red",!1)},r=document.createElement("div");r.className="color-preview",r.style.backgroundColor=this.value||"";const u=this.createInput({value:this.value,inputType:"text",inputClassName:"color-text-input"}),h=u.querySelector("input"),m=this.createInput({value:this.value,inputType:this.inputType,inputClassName:"color-picker"}),f=m.querySelector("input");return h.oninput=p=>{var v;let c=p.target.value.trim();c.charAt(0)!=="#"&&(c="#"+c,h.value=c),a(h)&&(this.value=c,(v=this.onChange)==null||v.call(this,c),f.value=c,r.style.backgroundColor=c)},f.oninput=p=>{var v;let c=p.target.value;c.charAt(0)!=="#"&&(c="#"+c,f.value=c),this.value=c,(v=this.onChange)==null||v.call(this,c),h.value=c,r.style.backgroundColor=c,a(h)},s.appendChild(r),s.appendChild(m),s.appendChild(u),t.appendChild(e),t.appendChild(s),t}}class C extends d{constructor(t={}){super(t),this.inputType="number"}draw(){const t=s=>{this.props.minValue!==void 0&&(s.min=String(this.props.minValue)),this.props.maxValue!==void 0&&(s.max=String(this.props.maxValue)),this.props.className&&s.classList.add(this.props.className),s.addEventListener("input",()=>{const o=this.props.minValue??Number.MIN_SAFE_INTEGER,a=this.props.maxValue??Number.MAX_SAFE_INTEGER;let r=Number(s.value);r<o&&(r=o),r>a&&(r=a),s.value=String(r)})},e=this.createInput({value:this.value,inputType:this.inputType,title:this.props.title,icon:this.props.icon,inputClassName:"number-setting-input "+(this.props.inputClassName||""),wrapperClassName:"number-setting-wrapper "+(this.props.wrapperClassName||""),inputCustomizer:t});if(!this.props.suffix||this.props.suffix==="none")return e;e.classList.add("suffix-wrapper");const i=e.querySelector("input.number-setting-input");i&&(i.style.paddingRight="35px");const n=document.createElement("span");return n.className="suffix-label",n.textContent=this.props.suffix,e.appendChild(n),e}}class b extends C{constructor(t){super({...t,minValue:0,maxValue:100,icon:t.icon||B,title:t.title||"Opacity"}),this.inputType="number"}}const B=`
5
+ `,e.onclick=()=>{const o=t.querySelector(".setting-group-content");o&&(o.classList.toggle("collapsed"),n.classList.toggle("rotated"))},e.appendChild(i),e.appendChild(n);const s=document.createElement("div");s.className="setting-group-content";for(const o in this.settings)if(this.settings.hasOwnProperty(o)){const a=this.settings[o];s.appendChild(a.draw())}return t.appendChild(e),t.appendChild(s),t}}function V(l){switch(l){case"number":return 0;case"text":return"";case"select":return null;case"color":return"#000000";case"date":return new Date().toISOString().split("T")[0];case"button":return"";default:return""}}class g{constructor(t={}){this.props=t,this.id=t.id||H(),this.value=this.props.default,this.title=t.title||""}setOnChange(t){return this.onChange=t,this}setValue(t){this.value=t,this.inputEl&&(this.inputEl.value=String(t)),this.onChange&&this.onChange(t)}createInput(t){t={...this.props.inputProps,...t};const e=document.createElement("div");if(e.className=t.wrapperClassName||"",t.title||t.icon){const s=document.createElement("div");if(s.className="icon-container",t.icon){const o=this.createIcon(t.icon,t.iconClassName);s.appendChild(o)}if(t.title){const o=this.createLabel(t.title,t.labelClassName);s.appendChild(o)}e.appendChild(s)}const i=document.createElement("div");i.className=t.wrapperClassName||"";const n=document.createElement("input");return this.inputEl=n,n.value=String(t.value||V(t.inputType)),n.type=t.inputType,n.placeholder=t.placeholder||"",n.className=t.inputClassName||"",n.oninput=s=>{const o=s.target;let a=o.value;t.inputType==="number"?a=Number(o.value):(t.inputType==="color"||t.inputType==="date")&&(a=o.value),this.value=a,this.onChange&&this.onChange(this.value)},t.inputCustomizer&&t.inputCustomizer(n),i.appendChild(n),e.appendChild(i),e}createLabel(t,e){const i=document.createElement("span");return i.textContent=t,i.className="input-label "+(e||""),i}createIcon(t,e){const i=document.createElement("span");return i.className="input-icon "+(e||""),i.innerHTML=t,i}}class b extends g{constructor(t={}){super(t),this.inputType="text"}draw(){const t=e=>{this.props.maxLength!==void 0&&(e.maxLength=this.props.maxLength),this.props.className&&e.classList.add(this.props.className)};return this.createInput({value:this.value,inputType:this.inputType,title:this.props.title,placeholder:this.props.placeholder,icon:this.props.icon,inputClassName:"string-setting-input "+(this.props.inputClassName||""),wrapperClassName:"string-setting-wrapper "+(this.props.wrapperClassName||""),inputCustomizer:t})}}const y="<svg xmlns='http://www.w3.org/2000/svg' width='18' height='19' viewBox='0 0 18 19' fill='none'><path d='M8.99999 15.8542C9.79613 16.5667 10.8475 17 12 17C14.4853 17 16.5 14.9853 16.5 12.5C16.5 10.4248 15.0953 8.67769 13.1849 8.15763M4.81513 8.15762C2.9047 8.67768 1.5 10.4248 1.5 12.5C1.5 14.9853 3.51472 17 6 17C8.48528 17 10.5 14.9853 10.5 12.5C10.5 11.9146 10.3882 11.3554 10.1849 10.8424M13.5 6.5C13.5 8.98528 11.4853 11 9 11C6.51472 11 4.5 8.98528 4.5 6.5C4.5 4.01472 6.51472 2 9 2C11.4853 2 13.5 4.01472 13.5 6.5Z' stroke='#667085' stroke-linecap='round' stroke-linejoin='round'/></svg>";class x extends b{constructor(t){super({...t,icon:t.icon||y,title:t.title||"Color"}),this.inputType="color"}draw(){const t=document.createElement("div");t.className="color-setting-wrapper";const e=document.createElement("div");e.className="icon-container";const i=this.createIcon(this.props.icon||y),n=this.createLabel(this.title||"Color");e.appendChild(i),e.appendChild(n);const s=document.createElement("div");s.className="color-input-wrapper";const o=/^([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,a=d=>{const c=d.value.startsWith("#")?d.value.slice(1):d.value;return o.test(c)?(d.style.border="",!0):(d.style.border="1px solid red",!1)},r=document.createElement("div");r.className="color-preview",r.style.backgroundColor=this.value||"";const u=this.createInput({value:this.value,inputType:"text",inputClassName:"color-text-input"}),h=u.querySelector("input"),v=this.createInput({value:this.value,inputType:this.inputType,inputClassName:"color-picker"}),C=v.querySelector("input");return h.oninput=d=>{var w;let c=d.target.value.trim();c.charAt(0)!=="#"&&(c="#"+c,h.value=c),a(h)&&(this.value=c,(w=this.onChange)==null||w.call(this,c),C.value=c,r.style.backgroundColor=c)},C.oninput=d=>{var w;let c=d.target.value;c.charAt(0)!=="#"&&(c="#"+c,C.value=c),this.value=c,(w=this.onChange)==null||w.call(this,c),h.value=c,r.style.backgroundColor=c,a(h)},s.appendChild(r),s.appendChild(v),s.appendChild(u),t.appendChild(e),t.appendChild(s),t}}class m extends g{constructor(t={}){super(t),this.inputType="number"}draw(){const t=s=>{this.props.minValue!==void 0&&(s.min=String(this.props.minValue)),this.props.maxValue!==void 0&&(s.max=String(this.props.maxValue)),this.props.className&&s.classList.add(this.props.className),s.addEventListener("input",()=>{const o=this.props.minValue??Number.MIN_SAFE_INTEGER,a=this.props.maxValue??Number.MAX_SAFE_INTEGER;let r=Number(s.value);r<o&&(r=o),r>a&&(r=a),s.value=String(r)})},e=this.createInput({value:this.value,inputType:this.inputType,title:this.props.title,icon:this.props.icon,inputClassName:"number-setting-input "+(this.props.inputClassName||""),wrapperClassName:"number-setting-wrapper "+(this.props.wrapperClassName||""),inputCustomizer:t});if(!this.props.suffix||this.props.suffix==="none")return e;e.classList.add("suffix-wrapper");const i=e.querySelector("input.number-setting-input");i&&(i.style.paddingRight="35px");const n=document.createElement("span");return n.className="suffix-label",n.textContent=this.props.suffix,e.appendChild(n),e}}class f extends m{constructor(t){super({...t,minValue:0,maxValue:100,icon:t.icon||T,title:t.title||"Opacity"}),this.inputType="number"}}const T=`
19
6
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
20
7
  <path d="M3.69749 15.365C3.54749 15.365 3.40502 15.305 3.30002 15.2C1.77752 13.6775 0.9375 11.6525 0.9375 9.5C0.9375 5.0525 4.5525 1.4375 9 1.4375C11.1525 1.4375 13.1775 2.2775 14.7 3.8C14.805 3.905 14.865 4.0475 14.865 4.1975C14.865 4.3475 14.805 4.49 14.7 4.595L4.09502 15.2C3.99002 15.305 3.84749 15.365 3.69749 15.365ZM9 2.5625C5.175 2.5625 2.0625 5.675 2.0625 9.5C2.0625 11.165 2.64751 12.74 3.71251 13.9925L13.4925 4.2125C12.24 3.1475 10.665 2.5625 9 2.5625Z" fill="#667085"/>
21
8
  <path d="M9.00014 17.5623C6.84764 17.5623 4.82266 16.7223 3.30016 15.1998C3.19516 15.0948 3.13513 14.9523 3.13513 14.8023C3.13513 14.6523 3.19516 14.5098 3.30016 14.4048L13.9051 3.79984C14.1226 3.58234 14.4826 3.58234 14.7001 3.79984C16.2226 5.32234 17.0626 7.34734 17.0626 9.49984C17.0626 13.9473 13.4476 17.5623 9.00014 17.5623ZM4.50764 14.7873C5.76014 15.8523 7.33514 16.4373 9.00014 16.4373C12.8251 16.4373 15.9376 13.3248 15.9376 9.49984C15.9376 7.83484 15.3526 6.25984 14.2876 5.00734L4.50764 14.7873Z" fill="#667085"/>
@@ -23,20 +10,7 @@
23
10
  <path d="M13.4025 15.5225C13.26 15.5225 13.1175 15.47 13.005 15.3575L8.06999 10.4225C7.85249 10.205 7.85249 9.84498 8.06999 9.62748C8.28749 9.40998 8.64748 9.40998 8.86498 9.62748L13.8 14.5625C14.0175 14.78 14.0175 15.14 13.8 15.3575C13.6875 15.47 13.545 15.5225 13.4025 15.5225Z" fill="#667085"/>
24
11
  <path d="M15.84 12.6648C15.6975 12.6648 15.555 12.6123 15.4425 12.4998L10.725 7.78234C10.5075 7.56484 10.5075 7.20484 10.725 6.98734C10.9425 6.76984 11.3025 6.76984 11.52 6.98734L16.2375 11.7048C16.455 11.9223 16.455 12.2823 16.2375 12.4998C16.1325 12.6048 15.99 12.6648 15.84 12.6648Z" fill="#667085"/>
25
12
  </svg>
26
- `,R=`
27
- <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
28
- <path d="M5.625 9.5H5.6325M12.375 9.5H12.3825M9 9.5H9.0075M9 12.875H9.0075M9 6.125H9.0075M2.25 6.35L2.25 12.65C2.25 13.9101 2.25 14.5402 2.49524 15.0215C2.71095 15.4448 3.05516 15.789 3.47852 16.0048C3.95982 16.25 4.58988 16.25 5.85 16.25H12.15C13.4101 16.25 14.0402 16.25 14.5215 16.0048C14.9448 15.789 15.289 15.4448 15.5048 15.0215C15.75 14.5402 15.75 13.9101 15.75 12.65V6.35C15.75 5.08988 15.75 4.45982 15.5048 3.97852C15.289 3.55516 14.9448 3.21095 14.5215 2.99524C14.0402 2.75 13.4101 2.75 12.15 2.75L5.85 2.75C4.58988 2.75 3.95982 2.75 3.47852 2.99524C3.05516 3.21095 2.71095 3.55516 2.49524 3.97852C2.25 4.45982 2.25 5.08988 2.25 6.35Z" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
29
- </svg>
30
- `,O=`
31
- <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
32
- <path d="M6 2.75H5.85C4.58988 2.75 3.95982 2.75 3.47852 2.99524C3.05516 3.21095 2.71095 3.55516 2.49524 3.97852C2.25 4.45982 2.25 5.08988 2.25 6.35V6.5M6 16.25H5.85C4.58988 16.25 3.95982 16.25 3.47852 16.0048C3.05516 15.789 2.71095 15.4448 2.49524 15.0215C2.25 14.5402 2.25 13.9101 2.25 12.65V12.5M15.75 6.5V6.35C15.75 5.08988 15.75 4.45982 15.5048 3.97852C15.289 3.55516 14.9448 3.21095 14.5215 2.99524C14.0402 2.75 13.4101 2.75 12.15 2.75H12M15.75 12.5V12.65C15.75 13.9101 15.75 14.5402 15.5048 15.0215C15.289 15.4448 14.9448 15.789 14.5215 16.0048C14.0402 16.25 13.4101 16.25 12.15 16.25H12" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
33
- </svg>
34
- `;class j extends g{constructor(t){super({title:"Border",settings:{color:new N({title:"Color",default:(t==null?void 0:t.color)??"#00141E"}),opacity:new b({title:"Opacity",default:(t==null?void 0:t.opacity)??100,minValue:0,maxValue:100}),radius:new C({title:"Radius",icon:R,default:(t==null?void 0:t.radius)??12,suffix:"px"}),size:new C({title:"Size",icon:O,default:(t==null?void 0:t.size)??0,suffix:"px"})}})}getCssCode(){const t=this.settings.color.value??"#000000",e=this.settings.opacity.value??100,i=this.settings.radius.value??0,n=this.settings.size.value??0;return`
35
- border-color: ${t};
36
- border-width: ${n}px;
37
- border-radius: ${i}px;
38
- opacity: ${e/100};
39
- `}}class A extends d{constructor(t={}){super(t),this.inputType="select",this._options=[],t.options&&(this._options=[...t.options]),t.getOptions&&this._options.push(...t.getOptions()),t.getOptionsAsync&&t.getOptionsAsync().then(e=>{this._options.push(...e),this.selectNode&&e.forEach((i,n)=>{const s=this._options.length-e.length+n;this.selectNode.appendChild(this.createOption(i,s))})}).catch(e=>{console.error("Failed to fetch async options:",e)})}createOption(t,e){const i=document.createElement("option");return i.value=String(e),i.textContent=t.name,i}draw(){const t=document.createElement("div");if(t.classList.add("select-container"),this.props.icon||this.props.title){const i=document.createElement("div");if(i.className="icon-container",this.props.icon){const n=this.createIcon(this.props.icon);i.appendChild(n)}if(this.props.title){const n=this.createLabel(this.props.title);i.appendChild(n)}t.appendChild(i)}const e=document.createElement("select");if(this.selectNode=e,e.classList.add("select"),this._options.forEach((i,n)=>{const s=this.createOption(i,n);e.appendChild(s)}),this.value!==void 0){const i=this._options.findIndex(n=>n.value===this.value);i>=0&&(e.value=String(i))}return e.onchange=i=>{var o;const n=Number(i.target.value),s=this._options[n];s&&(this.value=s.value,(o=this.onChange)==null||o.call(this,this.value))},t.appendChild(e),t}}class Z extends d{constructor(t={}){super(t),this.inputType="button",this.value||(this.value="center")}draw(){const t=document.createElement("div");t.className="align-setting-wrapper";const e=document.createElement("label");e.className="align-setting-label",e.textContent=this.title||"Align",t.appendChild(e);const i=document.createElement("div");return i.className="align-options-container",[{name:"left",icon:`
13
+ `;class k extends g{constructor(t={}){super(t),this.inputType="select",this._options=[],t.options&&(this._options=[...t.options]),t.getOptions&&this._options.push(...t.getOptions()),t.getOptionsAsync&&t.getOptionsAsync().then(e=>{this._options.push(...e),this.selectNode&&e.forEach((i,n)=>{const s=this._options.length-e.length+n;this.selectNode.appendChild(this.createOption(i,s))})}).catch(e=>{console.error("Failed to fetch async options:",e)})}createOption(t,e){const i=document.createElement("option");return i.value=String(e),i.textContent=t.name,i}draw(){const t=document.createElement("div");if(t.classList.add("select-container"),this.props.icon||this.props.title){const i=document.createElement("div");if(i.className="icon-container",this.props.icon){const n=this.createIcon(this.props.icon);i.appendChild(n)}if(this.props.title){const n=this.createLabel(this.props.title);i.appendChild(n)}t.appendChild(i)}const e=document.createElement("select");if(this.selectNode=e,e.classList.add("select"),this._options.forEach((i,n)=>{const s=this.createOption(i,n);e.appendChild(s)}),this.value!==void 0){const i=this._options.findIndex(n=>n.value===this.value);i>=0&&(e.value=String(i))}return e.onchange=i=>{var o;const n=Number(i.target.value),s=this._options[n];s&&(this.value=s.value,(o=this.onChange)==null||o.call(this,this.value))},t.appendChild(e),t}}class N extends g{constructor(t={}){super(t),this.inputType="button",this.value||(this.value="center")}draw(){const t=document.createElement("div");t.className="align-setting-wrapper";const e=document.createElement("label");e.className="align-setting-label",e.textContent=this.title||"Align",t.appendChild(e);const i=document.createElement("div");return i.className="align-options-container",[{name:"left",icon:`
40
14
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
41
15
  <path d="M10.5 7.5C11.1989 7.5 11.5484 7.5 11.824 7.38582C12.1916 7.23358 12.4836 6.94157 12.6358 6.57402C12.75 6.29837 12.75 5.94891 12.75 5.25C12.75 4.55109 12.75 4.20163 12.6358 3.92598C12.4836 3.55843 12.1916 3.26642 11.824 3.11418C11.5484 3 11.1989 3 10.5 3L4.5 3C3.80109 3 3.45163 3 3.17598 3.11418C2.80843 3.26642 2.51642 3.55843 2.36418 3.92597C2.25 4.20163 2.25 4.55109 2.25 5.25C2.25 5.94891 2.25 6.29837 2.36418 6.57402C2.51642 6.94157 2.80843 7.23358 3.17598 7.38582C3.45163 7.5 3.80109 7.5 4.5 7.5L10.5 7.5Z"
42
16
  stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
@@ -57,7 +31,7 @@
57
31
  <path d="M13.5 15C14.1989 15 14.5484 15 14.824 14.8858C15.1916 14.7336 15.4836 14.4416 15.6358 14.074C15.75 13.7984 15.75 13.4489 15.75 12.75C15.75 12.0511 15.75 11.7016 15.6358 11.426C15.4836 11.0584 15.1916 10.7664 14.824 10.6142C14.5484 10.5 14.1989 10.5 13.5 10.5H4.5C3.80109 10.5 3.45163 10.5 3.17598 10.6142C2.80843 10.7664 2.51642 11.0584 2.36418 11.426C2.25 11.7016 2.25 12.0511 2.25 12.75C2.25 13.4489 2.25 13.7984 2.36418 14.074C2.51642 14.4416 2.80843 14.7336 3.17597 14.8858C3.45163 15 3.80109 15 4.5 15L13.5 15Z"
58
32
  stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
59
33
  </svg>
60
- `}].forEach(s=>{const o=document.createElement("button");o.className="align-option-button",o.innerHTML=s.icon,this.value===s.name&&o.classList.add("selected"),o.addEventListener("click",()=>{var a;i.querySelectorAll(".align-option-button").forEach(r=>r.classList.remove("selected")),o.classList.add("selected"),this.value=s.name,(a=this.onChange)==null||a.call(this,this.value)}),i.appendChild(o)}),t.appendChild(i),t}}class U extends d{constructor(t){super(t),this.inputType="button"}draw(){const t=document.createElement("button");t.className="button-setting "+(this.props.className||""),t.textContent=this.props.label,t.addEventListener("click",()=>{this.props.onClick&&this.props.onClick()});const e=document.createElement("div");return e.className="button-setting-wrapper "+(this.props.wrapperClassName||""),e.appendChild(t),e}}class _ extends d{constructor(t={}){super(t),this.inputType={width:"number",height:"number"},this.isUpdating=!1,this.value||(this.value={width:100,height:100}),this.locked=t.locked??!1,this.value.height===0&&(this.value.height=1),this.aspectRatio=this.value.width/this.value.height,this.widthSetting=new C({title:"Width",default:this.value.width,suffix:"px",minValue:t.minWidth??1,maxValue:t.maxWidth,icon:$}),this.heightSetting=new C({title:"Height",default:this.value.height,suffix:"px",minValue:t.minHeight??1,maxValue:t.maxHeight,icon:W}),this.widthSetting.setOnChange(e=>{var s;if(this.isUpdating||isNaN(e)||e<1)return;this.isUpdating=!0;let i=e,n=this.value.height;this.locked&&isFinite(this.aspectRatio)&&!isNaN(this.aspectRatio)&&(n=Math.round(i/this.aspectRatio),n<1&&(n=1)),this.value={width:i,height:n},n!==0&&(this.aspectRatio=i/n),(s=this.onChange)==null||s.call(this,this.value),this.heightSetting.setValue(n),this.isUpdating=!1}),this.heightSetting.setOnChange(e=>{var s;if(this.isUpdating||isNaN(e)||e<1)return;this.isUpdating=!0;let i=e,n=this.value.width;this.locked&&isFinite(this.aspectRatio)&&!isNaN(this.aspectRatio)&&(n=Math.round(i*this.aspectRatio),n<1&&(n=1)),this.value={width:n,height:i},i!==0&&(this.aspectRatio=n/i),(s=this.onChange)==null||s.call(this,this.value),this.widthSetting.setValue(n),this.isUpdating=!1})}toggleLock(t){if(this.locked=!this.locked,this.locked){const e=this.value.width,i=this.value.height;i!==0&&(this.aspectRatio=e/i)}t.innerHTML=this.getLockSVG(this.locked)}getLockSVG(t){return t?`
34
+ `}].forEach(s=>{const o=document.createElement("button");o.className="align-option-button",o.innerHTML=s.icon,this.value===s.name&&o.classList.add("selected"),o.addEventListener("click",()=>{var a;i.querySelectorAll(".align-option-button").forEach(r=>r.classList.remove("selected")),o.classList.add("selected"),this.value=s.name,(a=this.onChange)==null||a.call(this,this.value)}),i.appendChild(o)}),t.appendChild(i),t}}class I extends g{constructor(t){super(t),this.inputType="button"}draw(){const t=document.createElement("button");t.className="button-setting "+(this.props.className||""),t.textContent=this.props.label,t.addEventListener("click",()=>{this.props.onClick&&this.props.onClick()});const e=document.createElement("div");return e.className="button-setting-wrapper "+(this.props.wrapperClassName||""),e.appendChild(t),e}}class B extends g{constructor(t={}){super(t),this.inputType={width:"number",height:"number"},this.isUpdating=!1,this.value||(this.value={width:100,height:100}),this.locked=t.locked??!1,this.value.height===0&&(this.value.height=1),this.aspectRatio=this.value.width/this.value.height,this.widthSetting=new m({title:"Width",default:this.value.width,suffix:"px",minValue:t.minWidth??1,maxValue:t.maxWidth,icon:O}),this.heightSetting=new m({title:"Height",default:this.value.height,suffix:"px",minValue:t.minHeight??1,maxValue:t.maxHeight,icon:R}),this.widthSetting.setOnChange(e=>{var s;if(this.isUpdating||isNaN(e)||e<1)return;this.isUpdating=!0;let i=e,n=this.value.height;this.locked&&isFinite(this.aspectRatio)&&!isNaN(this.aspectRatio)&&(n=Math.round(i/this.aspectRatio),n<1&&(n=1)),this.value={width:i,height:n},n!==0&&(this.aspectRatio=i/n),(s=this.onChange)==null||s.call(this,this.value),this.heightSetting.setValue(n),this.isUpdating=!1}),this.heightSetting.setOnChange(e=>{var s;if(this.isUpdating||isNaN(e)||e<1)return;this.isUpdating=!0;let i=e,n=this.value.width;this.locked&&isFinite(this.aspectRatio)&&!isNaN(this.aspectRatio)&&(n=Math.round(i*this.aspectRatio),n<1&&(n=1)),this.value={width:n,height:i},i!==0&&(this.aspectRatio=n/i),(s=this.onChange)==null||s.call(this,this.value),this.widthSetting.setValue(n),this.isUpdating=!1})}toggleLock(t){if(this.locked=!this.locked,this.locked){const e=this.value.width,i=this.value.height;i!==0&&(this.aspectRatio=e/i)}t.innerHTML=this.getLockSVG(this.locked)}getLockSVG(t){return t?`
61
35
  <svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 10 10" fill="none">
62
36
  <path d="M2.91663 4.58333V3.33333C2.91663 2.18274 3.84937 1.25 4.99996 1.25C6.00786 1.25 6.84859 1.96573 7.04162 2.91667M3.66663 8.75H6.33329C7.03336 8.75 7.38339 8.75 7.65078 8.61376C7.88598 8.49392 8.07721 8.30269 8.19705 8.06749C8.33329 7.8001 8.33329 7.45007 8.33329 6.75V6.58333C8.33329 5.88327 8.33329 5.53323 8.19705 5.26584C8.07721 5.03064 7.88598 4.83942 7.65078 4.71958C7.38339 4.58333 7.03336 4.58333 6.33329 4.58333H3.66663C2.96656 4.58333 2.61653 4.58333 2.34914 4.71958C2.11394 4.83942 1.92271 5.03064 1.80287 5.26584C1.66663 5.53323 1.66663 5.88327 1.66663 6.58333V6.75C1.66663 7.45007 1.66663 7.8001 1.80287 8.06749C1.92271 8.30269 2.11394 8.49392 2.34914 8.61376C2.61653 8.75 2.96656 8.75 3.66663 8.75Z" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
63
37
  </svg>
@@ -65,15 +39,89 @@
65
39
  <svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 10 10" fill="none">
66
40
  <path d="M2.91663 4.58333V3.33333C2.91663 2.18274 3.84937 1.25 4.99996 1.25M3.66663 8.75H6.33329C7.03336 8.75 7.38339 8.75 7.65078 8.61376C7.88598 8.49392 8.07721 8.30269 8.19705 8.06749C8.33329 7.8001 8.33329 7.45007 8.33329 6.75V6.58333C8.33329 5.88327 8.33329 5.53323 8.19705 5.26584C8.07721 5.03064 7.88598 4.83942 7.65078 4.71958C7.38339 4.58333 7.03336 4.58333 6.33329 4.58333H3.66663C2.96656 4.58333 2.61653 4.58333 2.34914 4.71958C2.11394 4.83942 1.92271 5.03064 1.80287 5.26584C1.66663 5.53323 1.66663 5.88327 1.66663 6.58333V6.75C1.66663 7.45007 1.66663 7.8001 1.80287 8.06749C1.92271 8.30269 2.11394 8.49392 2.34914 8.61376C2.61653 8.75 2.96656 8.75 3.66663 8.75Z" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
67
41
  </svg>
68
- `}draw(){const t=document.createElement("div");t.className="dimension-setting-container";const e=this.widthSetting.draw(),i=this.heightSetting.draw(),n=document.createElement("div");n.className="dimension-bracket";const s=document.createElement("span");return s.className="dimension-lock-icon",s.innerHTML=this.getLockSVG(this.locked),s.onclick=()=>this.toggleLock(s),n.appendChild(s),t.appendChild(e),t.appendChild(n),t.appendChild(i),t}}const $=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
42
+ `}draw(){const t=document.createElement("div");t.className="dimension-setting-container";const e=this.widthSetting.draw(),i=this.heightSetting.draw(),n=document.createElement("div");n.className="dimension-bracket";const s=document.createElement("span");return s.className="dimension-lock-icon",s.innerHTML=this.getLockSVG(this.locked),s.onclick=()=>this.toggleLock(s),n.appendChild(s),t.appendChild(e),t.appendChild(n),t.appendChild(i),t}}const O=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
69
43
  <path d="M4.5 9.5H13.5M4.5 9.5L6 7.25M4.5 9.5L6 11.75M13.5 9.5L12 7.25M13.5 9.5L12 11.75M15.75 16.25V2.75M2.25 16.25V2.75" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
70
- </svg>`,W=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
44
+ </svg>`,R=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
71
45
  <path d="M9 14L9 5M9 14L6.75 12.5M9 14L11.25 12.5M9 5L6.75 6.5M9 5L11.25 6.5M15.75 2.75H2.25M15.75 16.25H2.25" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
72
- </svg>`,F=`
46
+ </svg>`,j=`
73
47
  <svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16" fill="none">
74
48
  <path d="M5 10.5L7.5 8M7.5 8L10 10.5M7.5 8V13.625M12.5 10.9643C13.2634 10.3338 13.75 9.37996 13.75 8.3125C13.75 6.41402 12.211 4.875 10.3125 4.875C10.1759 4.875 10.0482 4.80375 9.97882 4.68609C9.16379 3.30302 7.65902 2.375 5.9375 2.375C3.34867 2.375 1.25 4.47367 1.25 7.0625C1.25 8.35381 1.77215 9.52317 2.61684 10.371" stroke="#475467" stroke-linecap="round" stroke-linejoin="round"/>
75
49
  </svg>
76
- `;class z extends d{constructor(t={}){super(t),this.inputType="button",!this.value&&t.defaultUrl&&(this.value=t.defaultUrl)}draw(){const t=document.createElement("div");t.className="upload-setting-wrapper";const e=document.createElement("img");e.className="upload-preview",e.src=this.value||this.props.defaultUrl||"";const i=document.createElement("button");i.className="upload-button",i.innerHTML=`
77
- <span class="upload-icon">${F}</span>
50
+ `;class S extends g{constructor(t={}){super(t),this.inputType="button",!this.value&&t.defaultUrl&&(this.value=t.defaultUrl)}draw(){const t=document.createElement("div");t.className="upload-setting-wrapper";const e=document.createElement("img");e.className="upload-preview",e.src=this.value||this.props.defaultUrl||"";const i=document.createElement("button");i.className="upload-button",i.innerHTML=`
51
+ <span class="upload-icon">${j}</span>
78
52
  <span class="upload-label">Upload</span>
79
- `;const n=document.createElement("input");return n.type="file",n.accept="image/*",n.style.display="none",i.onclick=()=>{n.click()},n.onchange=()=>{var o;const s=(o=n.files)==null?void 0:o[0];if(s){const a=new FileReader;a.onload=r=>{var h,m;const u=(h=r.target)==null?void 0:h.result;this.value=u,e.src=u,(m=this.onChange)==null||m.call(this,u)},a.readAsDataURL(s)}},t.appendChild(e),t.appendChild(i),t.appendChild(n),t}}exports.AlignSetting=Z;exports.BorderSettingSet=j;exports.ButtonSetting=U;exports.ColorSetting=N;exports.DimensionSetting=_;exports.MarginSettingGroup=S;exports.NumberSetting=C;exports.OpacitySetting=b;exports.SelectSetting=A;exports.Setting=d;exports.SettingGroup=g;exports.StringSetting=k;exports.UploadSetting=z;exports.iterateSettings=H;
53
+ `;const n=document.createElement("input");return n.type="file",n.accept="image/*",n.style.display="none",i.onclick=()=>{n.click()},n.onchange=async()=>{var o,a;const s=(o=n.files)==null?void 0:o[0];if(s)try{const r=new FormData;r.append("File",s,s.name);const u=this.props.token||"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxIiwiZW1haWwiOiJzdXBlcmFkbWluQHRlc3QuY29tIiwianRpIjoiMjI1MzFmZDUtN2QyMy00OGFiLWI4MDItZTBiZmJhNTEyYjNkIiwiaWF0IjoxNzQxMTg2MDMxLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3JvbGUiOiJTdXBlclJvbGUiLCJuYmYiOjE3NDExODYwMzAsImV4cCI6MTc0MTI3MjQzMCwiaXNzIjoib25haW0tYWRtaW4tYXBpIiwiYXVkIjoiKiJ9.RtHb41tUgQpunHy1-zceiSdYhlDKL1bxuPrun4yOtF4",v=await(await fetch("https://st-admapi.onaim.io/api/File/UploadImage",{method:"POST",body:r,headers:{Authorization:`Bearer ${u}`,accept:"text/plain"}})).json();if(v.succeeded){const C=v.data.url;this.value=C,e.src=C,(a=this.onChange)==null||a.call(this,C)}else console.error("Upload failed:",v)}catch(r){console.error("Error uploading file:",r)}},t.appendChild(e),t.appendChild(i),t.appendChild(n),t}}const A=`
54
+ <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
55
+ <path d="M5.625 9.5H5.6325M12.375 9.5H12.3825M9 9.5H9.0075M9 12.875H9.0075M9 6.125H9.0075M2.25 6.35L2.25 12.65C2.25 13.9101 2.25 14.5402 2.49524 15.0215C2.71095 15.4448 3.05516 15.789 3.47852 16.0048C3.95982 16.25 4.58988 16.25 5.85 16.25H12.15C13.4101 16.25 14.0402 16.25 14.5215 16.0048C14.9448 15.789 15.289 15.4448 15.5048 15.0215C15.75 14.5402 15.75 13.9101 15.75 12.65V6.35C15.75 5.08988 15.75 4.45982 15.5048 3.97852C15.289 3.55516 14.9448 3.21095 14.5215 2.99524C14.0402 2.75 13.4101 2.75 12.15 2.75L5.85 2.75C4.58988 2.75 3.95982 2.75 3.47852 2.99524C3.05516 3.21095 2.71095 3.55516 2.49524 3.97852C2.25 4.45982 2.25 5.08988 2.25 6.35Z" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
56
+ </svg>
57
+ `,W=`
58
+ <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
59
+ <path d="M6 2.75H5.85C4.58988 2.75 3.95982 2.75 3.47852 2.99524C3.05516 3.21095 2.71095 3.55516 2.49524 3.97852C2.25 4.45982 2.25 5.08988 2.25 6.35V6.5M6 16.25H5.85C4.58988 16.25 3.95982 16.25 3.47852 16.0048C3.05516 15.789 2.71095 15.4448 2.49524 15.0215C2.25 14.5402 2.25 13.9101 2.25 12.65V12.5M15.75 6.5V6.35C15.75 5.08988 15.75 4.45982 15.5048 3.97852C15.289 3.55516 14.9448 3.21095 14.5215 2.99524C14.0402 2.75 13.4101 2.75 12.15 2.75H12M15.75 12.5V12.65C15.75 13.9101 15.75 14.5402 15.5048 15.0215C15.289 15.4448 14.9448 15.789 14.5215 16.0048C14.0402 16.25 13.4101 16.25 12.15 16.25H12" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
60
+ </svg>
61
+ `;class $ extends p{constructor(t){super({title:"Border",settings:{color:new x({default:(t==null?void 0:t.color)??"#00141E"}),opacity:new f({default:(t==null?void 0:t.opacity)??100,minValue:0,maxValue:100}),radius:new m({title:"Radius",icon:A,default:(t==null?void 0:t.radius)??12,suffix:"px"}),size:new m({title:"Size",icon:W,default:(t==null?void 0:t.size)??0,suffix:"px"})}})}getCssCode(){const t=this.settings.color.value??"#000000",e=this.settings.opacity.value??100,i=this.settings.radius.value??0,n=this.settings.size.value??0;return`
62
+ border-color: ${t};
63
+ border-width: ${n}px;
64
+ border-radius: ${i}px;
65
+ opacity: ${e/100};
66
+ `}}const z=`
67
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="13" viewBox="0 0 14 13" fill="none">
68
+ <path d="M1 2.75C1 2.05109 1 1.70163 1.11418 1.42597C1.26642 1.05843 1.55843 0.766422 1.92597 0.614181C2.20163 0.5 2.55109 0.5 3.25 0.5H10.75C11.4489 0.5 11.7984 0.5 12.074 0.614181C12.4416 0.766422 12.7336 1.05843 12.8858 1.42597C13 1.70163 13 2.05109 13 2.75M4.75 12.5H9.25M7 0.5V12.5" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
69
+ </svg>
70
+ `,G=`
71
+ <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
72
+ <path d="M3 5.75C3 5.05109 3 4.70163 3.11418 4.42597C3.26642 4.05843 3.55843 3.76642 3.92597 3.61418C4.20163 3.5 4.55109 3.5 5.25 3.5H12.75C13.4489 3.5 13.7984 3.5 14.074 3.61418C14.4416 3.76642 14.7336 4.05843 14.8858 4.42597C15 4.70163 15 5.05109 15 5.75M6 15.5H12M7.6875 3.5V15.5M10.3125 3.5V15.5" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
73
+ </svg>
74
+ `,F=`
75
+ <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
76
+ <path d="M6 5.75H12M9 5.75V13.25M5.85 16.25H12.15C13.4101 16.25 14.0402 16.25 14.5215 16.0048C14.9448 15.789 15.289 15.4448 15.5048 15.0215C15.75 14.5402 15.75 13.9101 15.75 12.65V6.35C15.75 5.08988 15.75 4.45982 15.5048 3.97852C15.289 3.55516 14.9448 3.21095 14.5215 2.99524C14.0402 2.75 13.4101 2.75 12.15 2.75H5.85C4.58988 2.75 3.95982 2.75 3.47852 2.99524C3.05516 3.21095 2.71095 3.55516 2.49524 3.97852C2.25 4.45982 2.25 5.08988 2.25 6.35V12.65C2.25 13.9101 2.25 14.5402 2.49524 15.0215C2.71095 15.4448 3.05516 15.789 3.47852 16.0048C3.95982 16.25 4.58988 16.25 5.85 16.25Z" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
77
+ </svg>
78
+ `;class Z extends p{constructor(t={}){super({title:"Header Typography",settings:{color:new x({default:t.colorDefault??"#00141E"}),opacity:new f({default:t.colorOpacityDefault??100}),fontFamily:new k({title:"Font",icon:z,default:t.fontFamilyDefault??"Satoshi",options:t.fontFamilyOptions??[{name:"Satoshi",value:"Satoshi"},{name:"Arial",value:"Arial"},{name:"Roboto",value:"Roboto"}],getOptions:t.fontFamilyGetOptions,getOptionsAsync:t.fontFamilyGetOptionsAsync}),fontWeight:new k({title:"Weight",icon:G,default:t.fontWeightDefault??"bold",options:t.fontWeightOptions??[{name:"Regular",value:"regular"},{name:"Medium",value:"medium"},{name:"Bold",value:"bold"}],getOptions:t.fontWeightGetOptions,getOptionsAsync:t.fontWeightGetOptionsAsync}),fontSize:new m({title:"Size",icon:F,default:t.fontSizeDefault??12,suffix:"px"}),align:new N({title:"Align",default:t.alignDefault??"center"})}})}getCssCode(){const t=this.settings.color.value??"#000000",e=this.settings.opacity.value??100,i=this.settings.fontFamily.value??"Satoshi",n=this.settings.fontWeight.value??"bold",s=this.settings.fontSize.value??12,o=this.settings.align.value??"left";return`
79
+ color: ${t};
80
+ opacity: ${e/100};
81
+ font-family: ${i};
82
+ font-weight: ${n};
83
+ font-size: ${s}px;
84
+ text-align: ${o};
85
+ `}}class M extends g{constructor(t){super({...t,default:t.default!==void 0?t.default:"auto"}),this.inputType="number",this.value=t.default!==void 0?t.default:"auto"}draw(){const t=this.value==="auto"?"text":"number",e=a=>{this.value!=="auto"&&(this.props.minValue!==void 0&&(a.min=String(this.props.minValue)),this.props.maxValue!==void 0&&(a.max=String(this.props.maxValue)),this.props.className&&a.classList.add(this.props.className),a.addEventListener("input",()=>{const r=this.props.minValue??Number.MIN_SAFE_INTEGER,u=this.props.maxValue??Number.MAX_SAFE_INTEGER;let h=Number(a.value);h<r&&(h=r),h>u&&(h=u),a.value=String(h)}))},i=this.createInput({value:this.value,inputType:t,title:this.props.title,icon:this.props.icon,inputClassName:"number-setting-input "+(this.props.inputClassName||""),wrapperClassName:"number-setting-wrapper "+(this.props.wrapperClassName||""),inputCustomizer:e,placeholder:this.value==="auto"?"auto":""});if(!this.props.suffix||this.props.suffix==="none")return i;i.classList.add("suffix-wrapper");const n=i.querySelector("input.number-setting-input");n&&(n.style.paddingRight="35px");const s=document.createElement("span");s.className="suffix-label",s.textContent=this.props.suffix,i.appendChild(s);const o=i.querySelector("input");return o&&(o.oninput=a=>{const r=a.target.value.trim();if(r.toLowerCase()==="auto")this.value="auto";else{const u=Number(r);isNaN(u)||(this.value=u)}this.onChange&&this.onChange(this.value)}),i}}class D extends p{constructor(t){super({title:"Margins",settings:{marginTop:new M({title:"Top",icon:U,suffix:"px",default:(t==null?void 0:t.marginTop)??"auto"}),marginRight:new M({title:"Right",icon:_,suffix:"px",default:(t==null?void 0:t.marginRight)??0}),marginBottom:new M({title:"Bottom",icon:q,suffix:"px",default:(t==null?void 0:t.marginBottom)??0}),marginLeft:new M({title:"Left",icon:J,suffix:"px",default:(t==null?void 0:t.marginLeft)??0})}})}getCssCode(){const t=typeof this.settings.marginTop.value=="number"?`${this.settings.marginTop.value}px`:this.settings.marginTop.value,e=typeof this.settings.marginRight.value=="number"?`${this.settings.marginRight.value}px`:this.settings.marginRight.value,i=typeof this.settings.marginBottom.value=="number"?`${this.settings.marginBottom.value}px`:this.settings.marginBottom.value,n=typeof this.settings.marginLeft.value=="number"?`${this.settings.marginLeft.value}px`:this.settings.marginLeft.value;return`
86
+ margin-top: ${t};
87
+ margin-right: ${e};
88
+ margin-bottom: ${i};
89
+ margin-left: ${n};
90
+ `}}const U=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
91
+ <path d="M2.25 16.25H2.2575M2.25 9.5H2.2575M2.25 12.875H2.2575M2.25 6.125H2.2575M5.625 16.25H5.6325M5.625 9.5H5.6325M12.375 16.25H12.3825M12.375 9.5H12.3825M9 16.25H9.0075M9 9.5H9.0075M9 12.875H9.0075M9 6.125H9.0075M15.75 16.25H15.7575M15.75 9.5H15.7575M15.75 12.875H15.7575M15.75 6.125H15.7575M15.75 2.75H2.25" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
92
+ </svg>`,_=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
93
+ <path d="M5.625 2.75H5.6325M5.625 9.5H5.6325M5.625 16.25H5.6325M12.375 2.75H12.3825M12.375 9.5H12.3825M12.375 16.25H12.3825M9 2.75H9.0075M9 9.5H9.0075M9 16.25H9.0075M9 12.875H9.0075M9 6.125H9.0075M2.25 2.75H2.2575M2.25 9.5H2.2575M2.25 16.25H2.2575M2.25 12.875H2.2575M2.25 6.125H2.2575M15.75 16.25V2.75" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
94
+ </svg>`,q=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
95
+ <path d="M2.25 2.75H2.2575M2.25 9.5H2.2575M2.25 12.875H2.2575M2.25 6.125H2.2575M5.625 2.75H5.6325M5.625 9.5H5.6325M12.375 2.75H12.3825M12.375 9.5H12.3825M9 2.75H9.0075M9 9.5H9.0075M9 12.875H9.0075M9 6.125H9.0075M15.75 2.75H15.7575M15.75 9.5H15.7575M15.75 12.875H15.7575M15.75 6.125H15.7575M15.75 16.25H2.25" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
96
+ </svg>`,J=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
97
+ <path d="M5.625 2.75H5.6325M5.625 9.5H5.6325M5.625 16.25H5.6325M12.375 2.75H12.3825M12.375 9.5H12.3825M12.375 16.25H12.3825M9 2.75H9.0075M9 9.5H9.0075M9 16.25H9.0075M9 12.875H9.0075M9 6.125H9.0075M15.75 2.75H15.7575M15.75 9.5H15.7575M15.75 16.25H15.7575M15.75 12.875H15.7575M15.75 6.125H15.7575M2.25 16.25V2.75" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
98
+ </svg>`;class Y extends p{constructor(t,e){super({title:`Tab ${t+1}`,settings:{name:new b({title:"Tab Name",default:`Tab ${t+1}`}),content:new b({title:"Content",default:""})}}),this.onDeleteCallback=e}draw(){const t=super.draw(),e=t.querySelector(".setting-group-arrow");e&&e.parentElement&&e.parentElement.removeChild(e);const i=t.querySelector(".setting-group-title");if(i){const n=document.createElement("div");n.className="tab-delete-container";const s=document.createElement("button");s.className="tab-delete-button",s.innerHTML=`
99
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#f87171" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="trash-icon">
100
+ <polyline points="3 6 5 6 21 6"></polyline>
101
+ <path d="M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6"></path>
102
+ <path d="M10 11v6"></path>
103
+ <path d="M14 11v6"></path>
104
+ <path d="M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2"></path>
105
+ </svg>
106
+ `,s.onclick=()=>{var a;return(a=this.onDeleteCallback)==null?void 0:a.call(this)},n.appendChild(s);const o=i.querySelector("h3");o?o.insertAdjacentElement("afterend",n):i.appendChild(n)}return t}}class X extends p{constructor(){super({title:"Tabs",settings:{}}),this.tabs=[],this._el=null,this.addTab()}addTab(){const t=this.tabs.length,e=new Y(t,()=>this.removeTab(e));this.tabs.push(e),this.settings[`Tab ${t+1}`]=e}removeTab(t){const e=this.tabs.indexOf(t);e>=0&&(this.tabs.splice(e,1),delete this.settings[`Tab ${e+1}`],this.relabelTabs(),this.rerender())}relabelTabs(){this.settings={},this.tabs.forEach((t,e)=>{t.title=`Tab ${e+1}`,this.settings[`Tab ${e+1}`]=t})}draw(){const t=super.draw();this._el=t;const e=document.createElement("div");e.className="tabs-add-btn-container";const i=document.createElement("button");return i.className="tabs-add-button",i.innerHTML=`
107
+ <span class="add-icon">
108
+ <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="#667085">
109
+ <g id="SVGRepo_bgCarrier" stroke-width="0"></g>
110
+ <g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
111
+ <g id="SVGRepo_iconCarrier">
112
+ <g id="Edit / Add_Plus">
113
+ <path id="Vector" d="M6 12H12M12 12H18M12 12V18M12 12V6" stroke="#667085" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
114
+ </g>
115
+ </g>
116
+ </svg>
117
+ </span>
118
+ <span class="add-label">Add Tab</span>
119
+ `,i.onclick=()=>{this.addTab(),this.rerender()},e.appendChild(i),t.appendChild(e),t}rerender(){if(!this._el)return;const t=this._el.querySelector(".setting-group-content");t&&(t.innerHTML="",Object.keys(this.settings).forEach(e=>{const i=this.settings[e];t.appendChild(i.draw())}))}}class Q extends p{constructor(t){super({title:"Background Image",settings:{backgroundImage:new S({default:(t==null?void 0:t.backgroundImage)??""}),opacity:new f({default:(t==null?void 0:t.opacity)??100}),backgroundColor:new x({default:(t==null?void 0:t.backgroundColor)??"#00141E"}),opacityBG:new f({default:(t==null?void 0:t.opacityBG)??100})}})}draw(){const t=super.draw(),e=t.querySelector(".setting-group-content");if(!e)return t;const i=Array.from(e.children),[n,s,o,a]=i;e.innerHTML="",e.appendChild(n),e.appendChild(s);const r=document.createElement("div");return r.className="bgset-or-label",r.textContent="OR",e.appendChild(r),e.appendChild(o),e.appendChild(a),t}getCssCode(){const t=this.settings.backgroundImage.value||"",e=this.settings.opacity.value??100,i=this.settings.backgroundColor.value||"#00141E",n=this.settings.opacityBG.value??100;return t?`
120
+ background-image: url("${t}");
121
+ background-size: cover;
122
+ background-position: center;
123
+ opacity: ${e/100};
124
+ `:`
125
+ background-color: ${i};
126
+ opacity: ${n/100};
127
+ `}}exports.AlignSetting=N;exports.BackgroundSettingSet=Q;exports.BorderSettingSet=$;exports.ButtonSetting=I;exports.ColorSetting=x;exports.DimensionSetting=B;exports.HeaderTypographySettingSet=Z;exports.MarginSettingGroup=D;exports.NumberSetting=m;exports.OpacitySetting=f;exports.SelectSetting=k;exports.Setting=g;exports.SettingGroup=p;exports.StringSetting=b;exports.TabsContainerGroup=X;exports.UploadSetting=S;exports.iterateSettings=E;
@@ -1,23 +1,23 @@
1
- const H = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
2
- let x = (l = 21) => {
1
+ const E = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
2
+ let y = (l = 21) => {
3
3
  let t = "", e = crypto.getRandomValues(new Uint8Array(l |= 0));
4
4
  for (; l--; )
5
- t += H[e[l] & 63];
5
+ t += E[e[l] & 63];
6
6
  return t;
7
7
  };
8
- function k(l, t) {
8
+ function N(l, t) {
9
9
  for (const e in l)
10
10
  if (l.hasOwnProperty(e)) {
11
11
  const i = l[e];
12
12
  t(e, i);
13
13
  }
14
14
  }
15
- class m {
15
+ class d {
16
16
  constructor(t) {
17
- this.id = t.id || x(), this.title = t.title, this.settings = t.settings, Object.assign(this, t.settings);
17
+ this.id = t.id || y(), this.title = t.title, this.settings = t.settings, Object.assign(this, t.settings);
18
18
  }
19
19
  setOnChange(t) {
20
- return this.onChange = t, k(this.settings, (e, i) => {
20
+ return this.onChange = t, N(this.settings, (e, i) => {
21
21
  i.setOnChange(t);
22
22
  }), this;
23
23
  }
@@ -31,12 +31,12 @@ class m {
31
31
  for (const i in this.settings)
32
32
  if (this.settings.hasOwnProperty(i)) {
33
33
  const n = this.settings[i];
34
- n instanceof m ? e[i] = n.getValues() : e[i] = n.value;
34
+ n instanceof d ? e[i] = n.getValues() : e[i] = n.value;
35
35
  }
36
36
  return e;
37
37
  } else {
38
38
  const e = this.settings[t];
39
- return e ? e instanceof m ? e.getValues() : e.value : void 0;
39
+ return e ? e instanceof d ? e.getValues() : e.value : void 0;
40
40
  }
41
41
  }
42
42
  draw() {
@@ -65,7 +65,7 @@ class m {
65
65
  return t.appendChild(e), t.appendChild(s), t;
66
66
  }
67
67
  }
68
- function N(l) {
68
+ function L(l) {
69
69
  switch (l) {
70
70
  case "number":
71
71
  return 0;
@@ -83,9 +83,9 @@ function N(l) {
83
83
  return "";
84
84
  }
85
85
  }
86
- class d {
86
+ class g {
87
87
  constructor(t = {}) {
88
- this.props = t, this.id = t.id || x(), this.value = this.props.default, this.title = t.title || "";
88
+ this.props = t, this.id = t.id || y(), this.value = this.props.default, this.title = t.title || "";
89
89
  }
90
90
  setOnChange(t) {
91
91
  return this.onChange = t, this;
@@ -111,7 +111,7 @@ class d {
111
111
  const i = document.createElement("div");
112
112
  i.className = t.wrapperClassName || "";
113
113
  const n = document.createElement("input");
114
- return this.inputEl = n, n.value = String(t.value || N(t.inputType)), n.type = t.inputType, n.placeholder = t.placeholder || "", n.className = t.inputClassName || "", n.oninput = (s) => {
114
+ return this.inputEl = n, n.value = String(t.value || L(t.inputType)), n.type = t.inputType, n.placeholder = t.placeholder || "", n.className = t.inputClassName || "", n.oninput = (s) => {
115
115
  const o = s.target;
116
116
  let a = o.value;
117
117
  t.inputType === "number" ? a = Number(o.value) : (t.inputType === "color" || t.inputType === "date") && (a = o.value), this.value = a, this.onChange && this.onChange(this.value);
@@ -126,104 +126,7 @@ class d {
126
126
  return i.className = "input-icon " + (e || ""), i.innerHTML = t, i;
127
127
  }
128
128
  }
129
- class w extends d {
130
- constructor(t) {
131
- super({
132
- ...t,
133
- default: t.default !== void 0 ? t.default : "auto"
134
- }), this.inputType = "number", this.value = t.default !== void 0 ? t.default : "auto";
135
- }
136
- draw() {
137
- const t = this.value === "auto" ? "text" : "number", e = (a) => {
138
- this.value !== "auto" && (this.props.minValue !== void 0 && (a.min = String(this.props.minValue)), this.props.maxValue !== void 0 && (a.max = String(this.props.maxValue)), this.props.className && a.classList.add(this.props.className), a.addEventListener("input", () => {
139
- const r = this.props.minValue ?? Number.MIN_SAFE_INTEGER, u = this.props.maxValue ?? Number.MAX_SAFE_INTEGER;
140
- let h = Number(a.value);
141
- h < r && (h = r), h > u && (h = u), a.value = String(h);
142
- }));
143
- }, i = this.createInput({
144
- value: this.value,
145
- inputType: t,
146
- title: this.props.title,
147
- icon: this.props.icon,
148
- inputClassName: "number-setting-input " + (this.props.inputClassName || ""),
149
- wrapperClassName: "number-setting-wrapper " + (this.props.wrapperClassName || ""),
150
- inputCustomizer: e,
151
- placeholder: this.value === "auto" ? "auto" : ""
152
- });
153
- if (!this.props.suffix || this.props.suffix === "none")
154
- return i;
155
- i.classList.add("suffix-wrapper");
156
- const n = i.querySelector(
157
- "input.number-setting-input"
158
- );
159
- n && (n.style.paddingRight = "35px");
160
- const s = document.createElement("span");
161
- s.className = "suffix-label", s.textContent = this.props.suffix, i.appendChild(s);
162
- const o = i.querySelector("input");
163
- return o && (o.oninput = (a) => {
164
- const r = a.target.value.trim();
165
- if (r.toLowerCase() === "auto")
166
- this.value = "auto";
167
- else {
168
- const u = Number(r);
169
- isNaN(u) || (this.value = u);
170
- }
171
- this.onChange && this.onChange(this.value);
172
- }), i;
173
- }
174
- }
175
- class Z extends m {
176
- constructor(t) {
177
- super({
178
- title: "Margins",
179
- settings: {
180
- marginTop: new w({
181
- title: "Top",
182
- icon: b,
183
- suffix: "px",
184
- default: (t == null ? void 0 : t.marginTop) ?? "auto"
185
- }),
186
- marginRight: new w({
187
- title: "Right",
188
- icon: E,
189
- suffix: "px",
190
- default: (t == null ? void 0 : t.marginRight) ?? 0
191
- }),
192
- marginBottom: new w({
193
- title: "Bottom",
194
- icon: L,
195
- suffix: "px",
196
- default: (t == null ? void 0 : t.marginBottom) ?? 0
197
- }),
198
- marginLeft: new w({
199
- title: "Left",
200
- icon: y,
201
- suffix: "px",
202
- default: (t == null ? void 0 : t.marginLeft) ?? 0
203
- })
204
- }
205
- });
206
- }
207
- getCssCode() {
208
- const t = typeof this.settings.marginTop.value == "number" ? `${this.settings.marginTop.value}px` : this.settings.marginTop.value, e = typeof this.settings.marginRight.value == "number" ? `${this.settings.marginRight.value}px` : this.settings.marginRight.value, i = typeof this.settings.marginBottom.value == "number" ? `${this.settings.marginBottom.value}px` : this.settings.marginBottom.value, n = typeof this.settings.marginLeft.value == "number" ? `${this.settings.marginLeft.value}px` : this.settings.marginLeft.value;
209
- return `
210
- margin-top: ${t};
211
- margin-right: ${e};
212
- margin-bottom: ${i};
213
- margin-left: ${n};
214
- `;
215
- }
216
- }
217
- const b = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
218
- <path d="M2.25 16.25H2.2575M2.25 9.5H2.2575M2.25 12.875H2.2575M2.25 6.125H2.2575M5.625 16.25H5.6325M5.625 9.5H5.6325M12.375 16.25H12.3825M12.375 9.5H12.3825M9 16.25H9.0075M9 9.5H9.0075M9 12.875H9.0075M9 6.125H9.0075M15.75 16.25H15.7575M15.75 9.5H15.7575M15.75 12.875H15.7575M15.75 6.125H15.7575M15.75 2.75H2.25" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
219
- </svg>`, E = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
220
- <path d="M5.625 2.75H5.6325M5.625 9.5H5.6325M5.625 16.25H5.6325M12.375 2.75H12.3825M12.375 9.5H12.3825M12.375 16.25H12.3825M9 2.75H9.0075M9 9.5H9.0075M9 16.25H9.0075M9 12.875H9.0075M9 6.125H9.0075M2.25 2.75H2.2575M2.25 9.5H2.2575M2.25 16.25H2.2575M2.25 12.875H2.2575M2.25 6.125H2.2575M15.75 16.25V2.75" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
221
- </svg>`, L = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
222
- <path d="M2.25 2.75H2.2575M2.25 9.5H2.2575M2.25 12.875H2.2575M2.25 6.125H2.2575M5.625 2.75H5.6325M5.625 9.5H5.6325M12.375 2.75H12.3825M12.375 9.5H12.3825M9 2.75H9.0075M9 9.5H9.0075M9 12.875H9.0075M9 6.125H9.0075M15.75 2.75H15.7575M15.75 9.5H15.7575M15.75 12.875H15.7575M15.75 6.125H15.7575M15.75 16.25H2.25" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
223
- </svg>`, y = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
224
- <path d="M5.625 2.75H5.6325M5.625 9.5H5.6325M5.625 16.25H5.6325M12.375 2.75H12.3825M12.375 9.5H12.3825M12.375 16.25H12.3825M9 2.75H9.0075M9 9.5H9.0075M9 16.25H9.0075M9 12.875H9.0075M9 6.125H9.0075M15.75 2.75H15.7575M15.75 9.5H15.7575M15.75 16.25H15.7575M15.75 12.875H15.7575M15.75 6.125H15.7575M2.25 16.25V2.75" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
225
- </svg>`;
226
- class V extends d {
129
+ class x extends g {
227
130
  constructor(t = {}) {
228
131
  super(t), this.inputType = "text";
229
132
  }
@@ -243,12 +146,12 @@ class V extends d {
243
146
  });
244
147
  }
245
148
  }
246
- const M = "<svg xmlns='http://www.w3.org/2000/svg' width='18' height='19' viewBox='0 0 18 19' fill='none'><path d='M8.99999 15.8542C9.79613 16.5667 10.8475 17 12 17C14.4853 17 16.5 14.9853 16.5 12.5C16.5 10.4248 15.0953 8.67769 13.1849 8.15763M4.81513 8.15762C2.9047 8.67768 1.5 10.4248 1.5 12.5C1.5 14.9853 3.51472 17 6 17C8.48528 17 10.5 14.9853 10.5 12.5C10.5 11.9146 10.3882 11.3554 10.1849 10.8424M13.5 6.5C13.5 8.98528 11.4853 11 9 11C6.51472 11 4.5 8.98528 4.5 6.5C4.5 4.01472 6.51472 2 9 2C11.4853 2 13.5 4.01472 13.5 6.5Z' stroke='#667085' stroke-linecap='round' stroke-linejoin='round'/></svg>";
247
- class S extends V {
149
+ const k = "<svg xmlns='http://www.w3.org/2000/svg' width='18' height='19' viewBox='0 0 18 19' fill='none'><path d='M8.99999 15.8542C9.79613 16.5667 10.8475 17 12 17C14.4853 17 16.5 14.9853 16.5 12.5C16.5 10.4248 15.0953 8.67769 13.1849 8.15763M4.81513 8.15762C2.9047 8.67768 1.5 10.4248 1.5 12.5C1.5 14.9853 3.51472 17 6 17C8.48528 17 10.5 14.9853 10.5 12.5C10.5 11.9146 10.3882 11.3554 10.1849 10.8424M13.5 6.5C13.5 8.98528 11.4853 11 9 11C6.51472 11 4.5 8.98528 4.5 6.5C4.5 4.01472 6.51472 2 9 2C11.4853 2 13.5 4.01472 13.5 6.5Z' stroke='#667085' stroke-linecap='round' stroke-linejoin='round'/></svg>";
150
+ class b extends x {
248
151
  constructor(t) {
249
152
  super({
250
153
  ...t,
251
- icon: t.icon || M,
154
+ icon: t.icon || k,
252
155
  title: t.title || "Color"
253
156
  }), this.inputType = "color";
254
157
  }
@@ -257,7 +160,7 @@ class S extends V {
257
160
  t.className = "color-setting-wrapper";
258
161
  const e = document.createElement("div");
259
162
  e.className = "icon-container";
260
- const i = this.createIcon(this.props.icon || M), n = this.createLabel(this.title || "Color");
163
+ const i = this.createIcon(this.props.icon || k), n = this.createLabel(this.title || "Color");
261
164
  e.appendChild(i), e.appendChild(n);
262
165
  const s = document.createElement("div");
263
166
  s.className = "color-input-wrapper";
@@ -272,25 +175,25 @@ class S extends V {
272
175
  inputClassName: "color-text-input"
273
176
  }), h = u.querySelector(
274
177
  "input"
275
- ), g = this.createInput({
178
+ ), m = this.createInput({
276
179
  value: this.value,
277
180
  inputType: this.inputType,
278
181
  inputClassName: "color-picker"
279
- }), f = g.querySelector(
182
+ }), C = m.querySelector(
280
183
  "input"
281
184
  );
282
185
  return h.oninput = (p) => {
283
- var C;
186
+ var w;
284
187
  let c = p.target.value.trim();
285
- c.charAt(0) !== "#" && (c = "#" + c, h.value = c), a(h) && (this.value = c, (C = this.onChange) == null || C.call(this, c), f.value = c, r.style.backgroundColor = c);
286
- }, f.oninput = (p) => {
287
- var C;
188
+ c.charAt(0) !== "#" && (c = "#" + c, h.value = c), a(h) && (this.value = c, (w = this.onChange) == null || w.call(this, c), C.value = c, r.style.backgroundColor = c);
189
+ }, C.oninput = (p) => {
190
+ var w;
288
191
  let c = p.target.value;
289
- c.charAt(0) !== "#" && (c = "#" + c, f.value = c), this.value = c, (C = this.onChange) == null || C.call(this, c), h.value = c, r.style.backgroundColor = c, a(h);
290
- }, s.appendChild(r), s.appendChild(g), s.appendChild(u), t.appendChild(e), t.appendChild(s), t;
192
+ c.charAt(0) !== "#" && (c = "#" + c, C.value = c), this.value = c, (w = this.onChange) == null || w.call(this, c), h.value = c, r.style.backgroundColor = c, a(h);
193
+ }, s.appendChild(r), s.appendChild(m), s.appendChild(u), t.appendChild(e), t.appendChild(s), t;
291
194
  }
292
195
  }
293
- class v extends d {
196
+ class v extends g {
294
197
  constructor(t = {}) {
295
198
  super(t), this.inputType = "number";
296
199
  }
@@ -321,18 +224,18 @@ class v extends d {
321
224
  return n.className = "suffix-label", n.textContent = this.props.suffix, e.appendChild(n), e;
322
225
  }
323
226
  }
324
- class T extends v {
227
+ class M extends v {
325
228
  constructor(t) {
326
229
  super({
327
230
  ...t,
328
231
  minValue: 0,
329
232
  maxValue: 100,
330
- icon: t.icon || I,
233
+ icon: t.icon || V,
331
234
  title: t.title || "Opacity"
332
235
  }), this.inputType = "number";
333
236
  }
334
237
  }
335
- const I = `
238
+ const V = `
336
239
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
337
240
  <path d="M3.69749 15.365C3.54749 15.365 3.40502 15.305 3.30002 15.2C1.77752 13.6775 0.9375 11.6525 0.9375 9.5C0.9375 5.0525 4.5525 1.4375 9 1.4375C11.1525 1.4375 13.1775 2.2775 14.7 3.8C14.805 3.905 14.865 4.0475 14.865 4.1975C14.865 4.3475 14.805 4.49 14.7 4.595L4.09502 15.2C3.99002 15.305 3.84749 15.365 3.69749 15.365ZM9 2.5625C5.175 2.5625 2.0625 5.675 2.0625 9.5C2.0625 11.165 2.64751 12.74 3.71251 13.9925L13.4925 4.2125C12.24 3.1475 10.665 2.5625 9 2.5625Z" fill="#667085"/>
338
241
  <path d="M9.00014 17.5623C6.84764 17.5623 4.82266 16.7223 3.30016 15.1998C3.19516 15.0948 3.13513 14.9523 3.13513 14.8023C3.13513 14.6523 3.19516 14.5098 3.30016 14.4048L13.9051 3.79984C14.1226 3.58234 14.4826 3.58234 14.7001 3.79984C16.2226 5.32234 17.0626 7.34734 17.0626 9.49984C17.0626 13.9473 13.4476 17.5623 9.00014 17.5623ZM4.50764 14.7873C5.76014 15.8523 7.33514 16.4373 9.00014 16.4373C12.8251 16.4373 15.9376 13.3248 15.9376 9.49984C15.9376 7.83484 15.3526 6.25984 14.2876 5.00734L4.50764 14.7873Z" fill="#667085"/>
@@ -340,59 +243,8 @@ const I = `
340
243
  <path d="M13.4025 15.5225C13.26 15.5225 13.1175 15.47 13.005 15.3575L8.06999 10.4225C7.85249 10.205 7.85249 9.84498 8.06999 9.62748C8.28749 9.40998 8.64748 9.40998 8.86498 9.62748L13.8 14.5625C14.0175 14.78 14.0175 15.14 13.8 15.3575C13.6875 15.47 13.545 15.5225 13.4025 15.5225Z" fill="#667085"/>
341
244
  <path d="M15.84 12.6648C15.6975 12.6648 15.555 12.6123 15.4425 12.4998L10.725 7.78234C10.5075 7.56484 10.5075 7.20484 10.725 6.98734C10.9425 6.76984 11.3025 6.76984 11.52 6.98734L16.2375 11.7048C16.455 11.9223 16.455 12.2823 16.2375 12.4998C16.1325 12.6048 15.99 12.6648 15.84 12.6648Z" fill="#667085"/>
342
245
  </svg>
343
- `, R = `
344
- <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
345
- <path d="M5.625 9.5H5.6325M12.375 9.5H12.3825M9 9.5H9.0075M9 12.875H9.0075M9 6.125H9.0075M2.25 6.35L2.25 12.65C2.25 13.9101 2.25 14.5402 2.49524 15.0215C2.71095 15.4448 3.05516 15.789 3.47852 16.0048C3.95982 16.25 4.58988 16.25 5.85 16.25H12.15C13.4101 16.25 14.0402 16.25 14.5215 16.0048C14.9448 15.789 15.289 15.4448 15.5048 15.0215C15.75 14.5402 15.75 13.9101 15.75 12.65V6.35C15.75 5.08988 15.75 4.45982 15.5048 3.97852C15.289 3.55516 14.9448 3.21095 14.5215 2.99524C14.0402 2.75 13.4101 2.75 12.15 2.75L5.85 2.75C4.58988 2.75 3.95982 2.75 3.47852 2.99524C3.05516 3.21095 2.71095 3.55516 2.49524 3.97852C2.25 4.45982 2.25 5.08988 2.25 6.35Z" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
346
- </svg>
347
- `, B = `
348
- <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
349
- <path d="M6 2.75H5.85C4.58988 2.75 3.95982 2.75 3.47852 2.99524C3.05516 3.21095 2.71095 3.55516 2.49524 3.97852C2.25 4.45982 2.25 5.08988 2.25 6.35V6.5M6 16.25H5.85C4.58988 16.25 3.95982 16.25 3.47852 16.0048C3.05516 15.789 2.71095 15.4448 2.49524 15.0215C2.25 14.5402 2.25 13.9101 2.25 12.65V12.5M15.75 6.5V6.35C15.75 5.08988 15.75 4.45982 15.5048 3.97852C15.289 3.55516 14.9448 3.21095 14.5215 2.99524C14.0402 2.75 13.4101 2.75 12.15 2.75H12M15.75 12.5V12.65C15.75 13.9101 15.75 14.5402 15.5048 15.0215C15.289 15.4448 14.9448 15.789 14.5215 16.0048C14.0402 16.25 13.4101 16.25 12.15 16.25H12" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
350
- </svg>
351
- `;
352
- class U extends m {
353
- constructor(t) {
354
- super({
355
- title: "Border",
356
- settings: {
357
- color: new S({
358
- title: "Color",
359
- default: (t == null ? void 0 : t.color) ?? "#00141E"
360
- }),
361
- opacity: new T({
362
- title: "Opacity",
363
- default: (t == null ? void 0 : t.opacity) ?? 100,
364
- minValue: 0,
365
- maxValue: 100
366
- }),
367
- radius: new v({
368
- title: "Radius",
369
- icon: R,
370
- default: (t == null ? void 0 : t.radius) ?? 12,
371
- suffix: "px"
372
- }),
373
- size: new v({
374
- title: "Size",
375
- icon: B,
376
- default: (t == null ? void 0 : t.size) ?? 0,
377
- suffix: "px"
378
- })
379
- }
380
- });
381
- }
382
- /**
383
- * Optional helper to generate CSS from the current settings.
384
- */
385
- getCssCode() {
386
- const t = this.settings.color.value ?? "#000000", e = this.settings.opacity.value ?? 100, i = this.settings.radius.value ?? 0, n = this.settings.size.value ?? 0;
387
- return `
388
- border-color: ${t};
389
- border-width: ${n}px;
390
- border-radius: ${i}px;
391
- opacity: ${e / 100};
392
- `;
393
- }
394
- }
395
- class _ extends d {
246
+ `;
247
+ class H extends g {
396
248
  constructor(t = {}) {
397
249
  super(t), this.inputType = "select", this._options = [], t.options && (this._options = [...t.options]), t.getOptions && this._options.push(...t.getOptions()), t.getOptionsAsync && t.getOptionsAsync().then((e) => {
398
250
  this._options.push(...e), this.selectNode && e.forEach((i, n) => {
@@ -436,7 +288,7 @@ class _ extends d {
436
288
  }, t.appendChild(e), t;
437
289
  }
438
290
  }
439
- class $ extends d {
291
+ class S extends g {
440
292
  constructor(t = {}) {
441
293
  super(t), this.inputType = "button", this.value || (this.value = "center");
442
294
  }
@@ -489,7 +341,7 @@ class $ extends d {
489
341
  }), t.appendChild(i), t;
490
342
  }
491
343
  }
492
- class W extends d {
344
+ class D extends g {
493
345
  constructor(t) {
494
346
  super(t), this.inputType = "button";
495
347
  }
@@ -502,7 +354,7 @@ class W extends d {
502
354
  return e.className = "button-setting-wrapper " + (this.props.wrapperClassName || ""), e.appendChild(t), e;
503
355
  }
504
356
  }
505
- class F extends d {
357
+ class U extends g {
506
358
  constructor(t = {}) {
507
359
  super(t), this.inputType = { width: "number", height: "number" }, this.isUpdating = !1, this.value || (this.value = { width: 100, height: 100 }), this.locked = t.locked ?? !1, this.value.height === 0 && (this.value.height = 1), this.aspectRatio = this.value.width / this.value.height, this.widthSetting = new v({
508
360
  title: "Width",
@@ -511,7 +363,7 @@ class F extends d {
511
363
  // Display "px" as the unit.
512
364
  minValue: t.minWidth ?? 1,
513
365
  maxValue: t.maxWidth,
514
- icon: O
366
+ icon: T
515
367
  // SVG icon defined at the bottom.
516
368
  }), this.heightSetting = new v({
517
369
  title: "Height",
@@ -519,7 +371,7 @@ class F extends d {
519
371
  suffix: "px",
520
372
  minValue: t.minHeight ?? 1,
521
373
  maxValue: t.maxHeight,
522
- icon: j
374
+ icon: I
523
375
  }), this.widthSetting.setOnChange((e) => {
524
376
  var s;
525
377
  if (this.isUpdating || isNaN(e) || e < 1) return;
@@ -575,16 +427,16 @@ class F extends d {
575
427
  return s.className = "dimension-lock-icon", s.innerHTML = this.getLockSVG(this.locked), s.onclick = () => this.toggleLock(s), n.appendChild(s), t.appendChild(e), t.appendChild(n), t.appendChild(i), t;
576
428
  }
577
429
  }
578
- const O = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
430
+ const T = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
579
431
  <path d="M4.5 9.5H13.5M4.5 9.5L6 7.25M4.5 9.5L6 11.75M13.5 9.5L12 7.25M13.5 9.5L12 11.75M15.75 16.25V2.75M2.25 16.25V2.75" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
580
- </svg>`, j = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
432
+ </svg>`, I = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
581
433
  <path d="M9 14L9 5M9 14L6.75 12.5M9 14L11.25 12.5M9 5L6.75 6.5M9 5L11.25 6.5M15.75 2.75H2.25M15.75 16.25H2.25" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
582
- </svg>`, A = `
434
+ </svg>`, O = `
583
435
  <svg xmlns="http://www.w3.org/2000/svg" width="15" height="16" viewBox="0 0 15 16" fill="none">
584
436
  <path d="M5 10.5L7.5 8M7.5 8L10 10.5M7.5 8V13.625M12.5 10.9643C13.2634 10.3338 13.75 9.37996 13.75 8.3125C13.75 6.41402 12.211 4.875 10.3125 4.875C10.1759 4.875 10.0482 4.80375 9.97882 4.68609C9.16379 3.30302 7.65902 2.375 5.9375 2.375C3.34867 2.375 1.25 4.47367 1.25 7.0625C1.25 8.35381 1.77215 9.52317 2.61684 10.371" stroke="#475467" stroke-linecap="round" stroke-linejoin="round"/>
585
437
  </svg>
586
438
  `;
587
- class z extends d {
439
+ class B extends g {
588
440
  constructor(t = {}) {
589
441
  super(t), this.inputType = "button", !this.value && t.defaultUrl && (this.value = t.defaultUrl);
590
442
  }
@@ -595,39 +447,423 @@ class z extends d {
595
447
  e.className = "upload-preview", e.src = this.value || this.props.defaultUrl || "";
596
448
  const i = document.createElement("button");
597
449
  i.className = "upload-button", i.innerHTML = `
598
- <span class="upload-icon">${A}</span>
450
+ <span class="upload-icon">${O}</span>
599
451
  <span class="upload-label">Upload</span>
600
452
  `;
601
453
  const n = document.createElement("input");
602
454
  return n.type = "file", n.accept = "image/*", n.style.display = "none", i.onclick = () => {
603
455
  n.click();
604
- }, n.onchange = () => {
605
- var o;
456
+ }, n.onchange = async () => {
457
+ var o, a;
606
458
  const s = (o = n.files) == null ? void 0 : o[0];
607
- if (s) {
608
- const a = new FileReader();
609
- a.onload = (r) => {
610
- var h, g;
611
- const u = (h = r.target) == null ? void 0 : h.result;
612
- this.value = u, e.src = u, (g = this.onChange) == null || g.call(this, u);
613
- }, a.readAsDataURL(s);
614
- }
459
+ if (s)
460
+ try {
461
+ const r = new FormData();
462
+ r.append("File", s, s.name);
463
+ const u = this.props.token || "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxIiwiZW1haWwiOiJzdXBlcmFkbWluQHRlc3QuY29tIiwianRpIjoiMjI1MzFmZDUtN2QyMy00OGFiLWI4MDItZTBiZmJhNTEyYjNkIiwiaWF0IjoxNzQxMTg2MDMxLCJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL3dzLzIwMDgvMDYvaWRlbnRpdHkvY2xhaW1zL3JvbGUiOiJTdXBlclJvbGUiLCJuYmYiOjE3NDExODYwMzAsImV4cCI6MTc0MTI3MjQzMCwiaXNzIjoib25haW0tYWRtaW4tYXBpIiwiYXVkIjoiKiJ9.RtHb41tUgQpunHy1-zceiSdYhlDKL1bxuPrun4yOtF4", m = await (await fetch(
464
+ "https://st-admapi.onaim.io/api/File/UploadImage",
465
+ {
466
+ method: "POST",
467
+ body: r,
468
+ headers: {
469
+ Authorization: `Bearer ${u}`,
470
+ accept: "text/plain"
471
+ }
472
+ }
473
+ )).json();
474
+ if (m.succeeded) {
475
+ const C = m.data.url;
476
+ this.value = C, e.src = C, (a = this.onChange) == null || a.call(this, C);
477
+ } else
478
+ console.error("Upload failed:", m);
479
+ } catch (r) {
480
+ console.error("Error uploading file:", r);
481
+ }
615
482
  }, t.appendChild(e), t.appendChild(i), t.appendChild(n), t;
616
483
  }
617
484
  }
485
+ const R = `
486
+ <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
487
+ <path d="M5.625 9.5H5.6325M12.375 9.5H12.3825M9 9.5H9.0075M9 12.875H9.0075M9 6.125H9.0075M2.25 6.35L2.25 12.65C2.25 13.9101 2.25 14.5402 2.49524 15.0215C2.71095 15.4448 3.05516 15.789 3.47852 16.0048C3.95982 16.25 4.58988 16.25 5.85 16.25H12.15C13.4101 16.25 14.0402 16.25 14.5215 16.0048C14.9448 15.789 15.289 15.4448 15.5048 15.0215C15.75 14.5402 15.75 13.9101 15.75 12.65V6.35C15.75 5.08988 15.75 4.45982 15.5048 3.97852C15.289 3.55516 14.9448 3.21095 14.5215 2.99524C14.0402 2.75 13.4101 2.75 12.15 2.75L5.85 2.75C4.58988 2.75 3.95982 2.75 3.47852 2.99524C3.05516 3.21095 2.71095 3.55516 2.49524 3.97852C2.25 4.45982 2.25 5.08988 2.25 6.35Z" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
488
+ </svg>
489
+ `, j = `
490
+ <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
491
+ <path d="M6 2.75H5.85C4.58988 2.75 3.95982 2.75 3.47852 2.99524C3.05516 3.21095 2.71095 3.55516 2.49524 3.97852C2.25 4.45982 2.25 5.08988 2.25 6.35V6.5M6 16.25H5.85C4.58988 16.25 3.95982 16.25 3.47852 16.0048C3.05516 15.789 2.71095 15.4448 2.49524 15.0215C2.25 14.5402 2.25 13.9101 2.25 12.65V12.5M15.75 6.5V6.35C15.75 5.08988 15.75 4.45982 15.5048 3.97852C15.289 3.55516 14.9448 3.21095 14.5215 2.99524C14.0402 2.75 13.4101 2.75 12.15 2.75H12M15.75 12.5V12.65C15.75 13.9101 15.75 14.5402 15.5048 15.0215C15.289 15.4448 14.9448 15.789 14.5215 16.0048C14.0402 16.25 13.4101 16.25 12.15 16.25H12" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
492
+ </svg>
493
+ `;
494
+ class q extends d {
495
+ constructor(t) {
496
+ super({
497
+ title: "Border",
498
+ settings: {
499
+ color: new b({
500
+ default: (t == null ? void 0 : t.color) ?? "#00141E"
501
+ }),
502
+ opacity: new M({
503
+ default: (t == null ? void 0 : t.opacity) ?? 100,
504
+ minValue: 0,
505
+ maxValue: 100
506
+ }),
507
+ radius: new v({
508
+ title: "Radius",
509
+ icon: R,
510
+ default: (t == null ? void 0 : t.radius) ?? 12,
511
+ suffix: "px"
512
+ }),
513
+ size: new v({
514
+ title: "Size",
515
+ icon: j,
516
+ default: (t == null ? void 0 : t.size) ?? 0,
517
+ suffix: "px"
518
+ })
519
+ }
520
+ });
521
+ }
522
+ /**
523
+ * Optional helper to generate CSS from the current settings.
524
+ */
525
+ getCssCode() {
526
+ const t = this.settings.color.value ?? "#000000", e = this.settings.opacity.value ?? 100, i = this.settings.radius.value ?? 0, n = this.settings.size.value ?? 0;
527
+ return `
528
+ border-color: ${t};
529
+ border-width: ${n}px;
530
+ border-radius: ${i}px;
531
+ opacity: ${e / 100};
532
+ `;
533
+ }
534
+ }
535
+ const A = `
536
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="13" viewBox="0 0 14 13" fill="none">
537
+ <path d="M1 2.75C1 2.05109 1 1.70163 1.11418 1.42597C1.26642 1.05843 1.55843 0.766422 1.92597 0.614181C2.20163 0.5 2.55109 0.5 3.25 0.5H10.75C11.4489 0.5 11.7984 0.5 12.074 0.614181C12.4416 0.766422 12.7336 1.05843 12.8858 1.42597C13 1.70163 13 2.05109 13 2.75M4.75 12.5H9.25M7 0.5V12.5" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
538
+ </svg>
539
+ `, W = `
540
+ <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
541
+ <path d="M3 5.75C3 5.05109 3 4.70163 3.11418 4.42597C3.26642 4.05843 3.55843 3.76642 3.92597 3.61418C4.20163 3.5 4.55109 3.5 5.25 3.5H12.75C13.4489 3.5 13.7984 3.5 14.074 3.61418C14.4416 3.76642 14.7336 4.05843 14.8858 4.42597C15 4.70163 15 5.05109 15 5.75M6 15.5H12M7.6875 3.5V15.5M10.3125 3.5V15.5" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
542
+ </svg>
543
+ `, $ = `
544
+ <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
545
+ <path d="M6 5.75H12M9 5.75V13.25M5.85 16.25H12.15C13.4101 16.25 14.0402 16.25 14.5215 16.0048C14.9448 15.789 15.289 15.4448 15.5048 15.0215C15.75 14.5402 15.75 13.9101 15.75 12.65V6.35C15.75 5.08988 15.75 4.45982 15.5048 3.97852C15.289 3.55516 14.9448 3.21095 14.5215 2.99524C14.0402 2.75 13.4101 2.75 12.15 2.75H5.85C4.58988 2.75 3.95982 2.75 3.47852 2.99524C3.05516 3.21095 2.71095 3.55516 2.49524 3.97852C2.25 4.45982 2.25 5.08988 2.25 6.35V12.65C2.25 13.9101 2.25 14.5402 2.49524 15.0215C2.71095 15.4448 3.05516 15.789 3.47852 16.0048C3.95982 16.25 4.58988 16.25 5.85 16.25Z" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
546
+ </svg>
547
+ `;
548
+ class J extends d {
549
+ constructor(t = {}) {
550
+ super({
551
+ title: "Header Typography",
552
+ settings: {
553
+ color: new b({
554
+ default: t.colorDefault ?? "#00141E"
555
+ }),
556
+ opacity: new M({
557
+ default: t.colorOpacityDefault ?? 100
558
+ }),
559
+ fontFamily: new H({
560
+ title: "Font",
561
+ icon: A,
562
+ default: t.fontFamilyDefault ?? "Satoshi",
563
+ options: t.fontFamilyOptions ?? [
564
+ { name: "Satoshi", value: "Satoshi" },
565
+ { name: "Arial", value: "Arial" },
566
+ { name: "Roboto", value: "Roboto" }
567
+ ],
568
+ getOptions: t.fontFamilyGetOptions,
569
+ getOptionsAsync: t.fontFamilyGetOptionsAsync
570
+ }),
571
+ fontWeight: new H({
572
+ title: "Weight",
573
+ icon: W,
574
+ default: t.fontWeightDefault ?? "bold",
575
+ options: t.fontWeightOptions ?? [
576
+ { name: "Regular", value: "regular" },
577
+ { name: "Medium", value: "medium" },
578
+ { name: "Bold", value: "bold" }
579
+ ],
580
+ getOptions: t.fontWeightGetOptions,
581
+ getOptionsAsync: t.fontWeightGetOptionsAsync
582
+ }),
583
+ fontSize: new v({
584
+ title: "Size",
585
+ icon: $,
586
+ default: t.fontSizeDefault ?? 12,
587
+ suffix: "px"
588
+ }),
589
+ align: new S({
590
+ title: "Align",
591
+ default: t.alignDefault ?? "center"
592
+ })
593
+ }
594
+ });
595
+ }
596
+ getCssCode() {
597
+ const t = this.settings.color.value ?? "#000000", e = this.settings.opacity.value ?? 100, i = this.settings.fontFamily.value ?? "Satoshi", n = this.settings.fontWeight.value ?? "bold", s = this.settings.fontSize.value ?? 12, o = this.settings.align.value ?? "left";
598
+ return `
599
+ color: ${t};
600
+ opacity: ${e / 100};
601
+ font-family: ${i};
602
+ font-weight: ${n};
603
+ font-size: ${s}px;
604
+ text-align: ${o};
605
+ `;
606
+ }
607
+ }
608
+ class f extends g {
609
+ constructor(t) {
610
+ super({
611
+ ...t,
612
+ default: t.default !== void 0 ? t.default : "auto"
613
+ }), this.inputType = "number", this.value = t.default !== void 0 ? t.default : "auto";
614
+ }
615
+ draw() {
616
+ const t = this.value === "auto" ? "text" : "number", e = (a) => {
617
+ this.value !== "auto" && (this.props.minValue !== void 0 && (a.min = String(this.props.minValue)), this.props.maxValue !== void 0 && (a.max = String(this.props.maxValue)), this.props.className && a.classList.add(this.props.className), a.addEventListener("input", () => {
618
+ const r = this.props.minValue ?? Number.MIN_SAFE_INTEGER, u = this.props.maxValue ?? Number.MAX_SAFE_INTEGER;
619
+ let h = Number(a.value);
620
+ h < r && (h = r), h > u && (h = u), a.value = String(h);
621
+ }));
622
+ }, i = this.createInput({
623
+ value: this.value,
624
+ inputType: t,
625
+ title: this.props.title,
626
+ icon: this.props.icon,
627
+ inputClassName: "number-setting-input " + (this.props.inputClassName || ""),
628
+ wrapperClassName: "number-setting-wrapper " + (this.props.wrapperClassName || ""),
629
+ inputCustomizer: e,
630
+ placeholder: this.value === "auto" ? "auto" : ""
631
+ });
632
+ if (!this.props.suffix || this.props.suffix === "none")
633
+ return i;
634
+ i.classList.add("suffix-wrapper");
635
+ const n = i.querySelector(
636
+ "input.number-setting-input"
637
+ );
638
+ n && (n.style.paddingRight = "35px");
639
+ const s = document.createElement("span");
640
+ s.className = "suffix-label", s.textContent = this.props.suffix, i.appendChild(s);
641
+ const o = i.querySelector("input");
642
+ return o && (o.oninput = (a) => {
643
+ const r = a.target.value.trim();
644
+ if (r.toLowerCase() === "auto")
645
+ this.value = "auto";
646
+ else {
647
+ const u = Number(r);
648
+ isNaN(u) || (this.value = u);
649
+ }
650
+ this.onChange && this.onChange(this.value);
651
+ }), i;
652
+ }
653
+ }
654
+ class Y extends d {
655
+ constructor(t) {
656
+ super({
657
+ title: "Margins",
658
+ settings: {
659
+ marginTop: new f({
660
+ title: "Top",
661
+ icon: z,
662
+ suffix: "px",
663
+ default: (t == null ? void 0 : t.marginTop) ?? "auto"
664
+ }),
665
+ marginRight: new f({
666
+ title: "Right",
667
+ icon: F,
668
+ suffix: "px",
669
+ default: (t == null ? void 0 : t.marginRight) ?? 0
670
+ }),
671
+ marginBottom: new f({
672
+ title: "Bottom",
673
+ icon: G,
674
+ suffix: "px",
675
+ default: (t == null ? void 0 : t.marginBottom) ?? 0
676
+ }),
677
+ marginLeft: new f({
678
+ title: "Left",
679
+ icon: Z,
680
+ suffix: "px",
681
+ default: (t == null ? void 0 : t.marginLeft) ?? 0
682
+ })
683
+ }
684
+ });
685
+ }
686
+ getCssCode() {
687
+ const t = typeof this.settings.marginTop.value == "number" ? `${this.settings.marginTop.value}px` : this.settings.marginTop.value, e = typeof this.settings.marginRight.value == "number" ? `${this.settings.marginRight.value}px` : this.settings.marginRight.value, i = typeof this.settings.marginBottom.value == "number" ? `${this.settings.marginBottom.value}px` : this.settings.marginBottom.value, n = typeof this.settings.marginLeft.value == "number" ? `${this.settings.marginLeft.value}px` : this.settings.marginLeft.value;
688
+ return `
689
+ margin-top: ${t};
690
+ margin-right: ${e};
691
+ margin-bottom: ${i};
692
+ margin-left: ${n};
693
+ `;
694
+ }
695
+ }
696
+ const z = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
697
+ <path d="M2.25 16.25H2.2575M2.25 9.5H2.2575M2.25 12.875H2.2575M2.25 6.125H2.2575M5.625 16.25H5.6325M5.625 9.5H5.6325M12.375 16.25H12.3825M12.375 9.5H12.3825M9 16.25H9.0075M9 9.5H9.0075M9 12.875H9.0075M9 6.125H9.0075M15.75 16.25H15.7575M15.75 9.5H15.7575M15.75 12.875H15.7575M15.75 6.125H15.7575M15.75 2.75H2.25" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
698
+ </svg>`, F = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
699
+ <path d="M5.625 2.75H5.6325M5.625 9.5H5.6325M5.625 16.25H5.6325M12.375 2.75H12.3825M12.375 9.5H12.3825M12.375 16.25H12.3825M9 2.75H9.0075M9 9.5H9.0075M9 16.25H9.0075M9 12.875H9.0075M9 6.125H9.0075M2.25 2.75H2.2575M2.25 9.5H2.2575M2.25 16.25H2.2575M2.25 12.875H2.2575M2.25 6.125H2.2575M15.75 16.25V2.75" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
700
+ </svg>`, G = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
701
+ <path d="M2.25 2.75H2.2575M2.25 9.5H2.2575M2.25 12.875H2.2575M2.25 6.125H2.2575M5.625 2.75H5.6325M5.625 9.5H5.6325M12.375 2.75H12.3825M12.375 9.5H12.3825M9 2.75H9.0075M9 9.5H9.0075M9 12.875H9.0075M9 6.125H9.0075M15.75 2.75H15.7575M15.75 9.5H15.7575M15.75 12.875H15.7575M15.75 6.125H15.7575M15.75 16.25H2.25" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
702
+ </svg>`, Z = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
703
+ <path d="M5.625 2.75H5.6325M5.625 9.5H5.6325M5.625 16.25H5.6325M12.375 2.75H12.3825M12.375 9.5H12.3825M12.375 16.25H12.3825M9 2.75H9.0075M9 9.5H9.0075M9 16.25H9.0075M9 12.875H9.0075M9 6.125H9.0075M15.75 2.75H15.7575M15.75 9.5H15.7575M15.75 16.25H15.7575M15.75 12.875H15.7575M15.75 6.125H15.7575M2.25 16.25V2.75" stroke="#667085" stroke-linecap="round" stroke-linejoin="round"/>
704
+ </svg>`;
705
+ class _ extends d {
706
+ constructor(t, e) {
707
+ super({
708
+ title: `Tab ${t + 1}`,
709
+ settings: {
710
+ name: new x({
711
+ title: "Tab Name",
712
+ default: `Tab ${t + 1}`
713
+ }),
714
+ content: new x({
715
+ title: "Content",
716
+ default: ""
717
+ })
718
+ }
719
+ }), this.onDeleteCallback = e;
720
+ }
721
+ draw() {
722
+ const t = super.draw(), e = t.querySelector(".setting-group-arrow");
723
+ e && e.parentElement && e.parentElement.removeChild(e);
724
+ const i = t.querySelector(".setting-group-title");
725
+ if (i) {
726
+ const n = document.createElement("div");
727
+ n.className = "tab-delete-container";
728
+ const s = document.createElement("button");
729
+ s.className = "tab-delete-button", s.innerHTML = `
730
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#f87171" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="trash-icon">
731
+ <polyline points="3 6 5 6 21 6"></polyline>
732
+ <path d="M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6"></path>
733
+ <path d="M10 11v6"></path>
734
+ <path d="M14 11v6"></path>
735
+ <path d="M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2"></path>
736
+ </svg>
737
+ `, s.onclick = () => {
738
+ var a;
739
+ return (a = this.onDeleteCallback) == null ? void 0 : a.call(this);
740
+ }, n.appendChild(s);
741
+ const o = i.querySelector("h3");
742
+ o ? o.insertAdjacentElement("afterend", n) : i.appendChild(n);
743
+ }
744
+ return t;
745
+ }
746
+ }
747
+ class X extends d {
748
+ // Store the rendered element
749
+ constructor() {
750
+ super({ title: "Tabs", settings: {} }), this.tabs = [], this._el = null, this.addTab();
751
+ }
752
+ /** Adds a new tab. */
753
+ addTab() {
754
+ const t = this.tabs.length, e = new _(t, () => this.removeTab(e));
755
+ this.tabs.push(e), this.settings[`Tab ${t + 1}`] = e;
756
+ }
757
+ /** Removes a specific tab. */
758
+ removeTab(t) {
759
+ const e = this.tabs.indexOf(t);
760
+ e >= 0 && (this.tabs.splice(e, 1), delete this.settings[`Tab ${e + 1}`], this.relabelTabs(), this.rerender());
761
+ }
762
+ /** Relabels tabs sequentially after removal. */
763
+ relabelTabs() {
764
+ this.settings = {}, this.tabs.forEach((t, e) => {
765
+ t.title = `Tab ${e + 1}`, this.settings[`Tab ${e + 1}`] = t;
766
+ });
767
+ }
768
+ /**
769
+ * Override draw() so we can store the created DOM element
770
+ * and add the "Add Tab" button in a container positioned at the bottom-right.
771
+ */
772
+ draw() {
773
+ const t = super.draw();
774
+ this._el = t;
775
+ const e = document.createElement("div");
776
+ e.className = "tabs-add-btn-container";
777
+ const i = document.createElement("button");
778
+ return i.className = "tabs-add-button", i.innerHTML = `
779
+ <span class="add-icon">
780
+ <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="#667085">
781
+ <g id="SVGRepo_bgCarrier" stroke-width="0"></g>
782
+ <g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
783
+ <g id="SVGRepo_iconCarrier">
784
+ <g id="Edit / Add_Plus">
785
+ <path id="Vector" d="M6 12H12M12 12H18M12 12V18M12 12V6" stroke="#667085" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path>
786
+ </g>
787
+ </g>
788
+ </svg>
789
+ </span>
790
+ <span class="add-label">Add Tab</span>
791
+ `, i.onclick = () => {
792
+ this.addTab(), this.rerender();
793
+ }, e.appendChild(i), t.appendChild(e), t;
794
+ }
795
+ /**
796
+ * Re-renders the inner settings content based on the current tabs.
797
+ */
798
+ rerender() {
799
+ if (!this._el) return;
800
+ const t = this._el.querySelector(".setting-group-content");
801
+ t && (t.innerHTML = "", Object.keys(this.settings).forEach((e) => {
802
+ const i = this.settings[e];
803
+ t.appendChild(i.draw());
804
+ }));
805
+ }
806
+ }
807
+ class Q extends d {
808
+ constructor(t) {
809
+ super({
810
+ title: "Background Image",
811
+ settings: {
812
+ backgroundImage: new B({
813
+ default: (t == null ? void 0 : t.backgroundImage) ?? ""
814
+ }),
815
+ opacity: new M({
816
+ default: (t == null ? void 0 : t.opacity) ?? 100
817
+ }),
818
+ backgroundColor: new b({
819
+ default: (t == null ? void 0 : t.backgroundColor) ?? "#00141E"
820
+ }),
821
+ opacityBG: new M({
822
+ default: (t == null ? void 0 : t.opacityBG) ?? 100
823
+ })
824
+ }
825
+ });
826
+ }
827
+ /**
828
+ * Override draw() to reorder the child settings and insert an "OR" label in between.
829
+ */
830
+ draw() {
831
+ const t = super.draw(), e = t.querySelector(".setting-group-content");
832
+ if (!e) return t;
833
+ const i = Array.from(e.children), [n, s, o, a] = i;
834
+ e.innerHTML = "", e.appendChild(n), e.appendChild(s);
835
+ const r = document.createElement("div");
836
+ return r.className = "bgset-or-label", r.textContent = "OR", e.appendChild(r), e.appendChild(o), e.appendChild(a), t;
837
+ }
838
+ getCssCode() {
839
+ const t = this.settings.backgroundImage.value || "", e = this.settings.opacity.value ?? 100, i = this.settings.backgroundColor.value || "#00141E", n = this.settings.opacityBG.value ?? 100;
840
+ return t ? `
841
+ background-image: url("${t}");
842
+ background-size: cover;
843
+ background-position: center;
844
+ opacity: ${e / 100};
845
+ ` : `
846
+ background-color: ${i};
847
+ opacity: ${n / 100};
848
+ `;
849
+ }
850
+ }
618
851
  export {
619
- $ as AlignSetting,
620
- U as BorderSettingSet,
621
- W as ButtonSetting,
622
- S as ColorSetting,
623
- F as DimensionSetting,
624
- Z as MarginSettingGroup,
852
+ S as AlignSetting,
853
+ Q as BackgroundSettingSet,
854
+ q as BorderSettingSet,
855
+ D as ButtonSetting,
856
+ b as ColorSetting,
857
+ U as DimensionSetting,
858
+ J as HeaderTypographySettingSet,
859
+ Y as MarginSettingGroup,
625
860
  v as NumberSetting,
626
- T as OpacitySetting,
627
- _ as SelectSetting,
628
- d as Setting,
629
- m as SettingGroup,
630
- V as StringSetting,
631
- z as UploadSetting,
632
- k as iterateSettings
861
+ M as OpacitySetting,
862
+ H as SelectSetting,
863
+ g as Setting,
864
+ d as SettingGroup,
865
+ x as StringSetting,
866
+ X as TabsContainerGroup,
867
+ B as UploadSetting,
868
+ N as iterateSettings
633
869
  };
package/dist/index.css CHANGED
@@ -1 +1 @@
1
- @import"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap";.setting-group{padding:16px;display:flex;flex-direction:column;gap:8px;border-bottom:solid 1px var(--color-border);border-radius:8px;background-color:var(--color-bg)}.setting-group .setting-group{background-color:var(--color-white)!important;padding:12px;border-bottom:unset;border:1px solid var(--color-border-secondary);box-shadow:0 12px 16px -4px #10182814,0 4px 6px -2px #10182808}.setting-group-title{display:flex;align-items:center;justify-content:space-between;cursor:pointer}.setting-group-title h3{font-size:14px;font-weight:700;line-height:24px}.setting-group-arrow{display:flex;transition:transform .3s ease-in-out}.setting-group-arrow.rotated{transform:rotate(180deg)}.setting-group-content{flex-direction:column;gap:8px;max-height:fit-content;display:flex;transition:max-height .3s ease-in-out,display .2s ease-in-out}.setting-group-content.collapsed{max-height:0;display:none}.icon-container{display:flex;align-items:center;gap:4px}.input-icon{display:flex;align-items:center;justify-content:center;color:var(--color-text)}.input-label{color:var(--color-text)}.input-container{display:inline-flex;align-items:center;position:relative}.with-suffix{flex:1;padding-right:36px}.input-suffix{position:absolute;right:8px;top:50%;transform:translateY(-50%);color:#666;pointer-events:none;font-size:.9em}.string-setting-wrapper{display:flex;justify-content:space-between;align-items:center}.string-setting-input{max-width:120px;padding:8px;font-size:14px;border-radius:8px;color:var(--color-input-text);border:1px solid var(--color-border);background:var(--color-bg)}.color-setting-wrapper{display:flex;align-items:center;justify-content:space-between;gap:2px}.color-input-wrapper{position:relative;padding:8px 8px 8px 4px;width:120px;height:33px;display:flex;align-items:center;gap:4px;border:1px solid var(--color-border);border-radius:8px;background-color:var(--color-bg)}.color-text-input{border:none;outline:none;width:65px;color:var(--color-input-text);font-size:14px;text-align:center;background:transparent}.color-picker{position:absolute;left:0;top:0;width:25px;height:25px;opacity:0;cursor:pointer}.color-preview{width:25px;height:25px;border-radius:4px}.number-setting-wrapper{display:flex;align-items:center;justify-content:space-between}.number-setting-input{width:120px;padding:8px;font-size:14px;border-radius:8px;color:var(--color-input-text);border:1px solid var(--color-border);background:var(--color-bg);box-sizing:border-box}.suffix-wrapper{position:relative;display:inline-flex;align-items:center}.suffix-label{position:absolute;right:8px;padding-left:8px;top:50%;transform:translateY(-50%);border-left:1px solid var(--color-divider);font-size:12px;color:var(--color-text)}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}.select-container{display:flex;align-items:center;gap:4px;justify-content:space-between}.select{width:120px;padding:8px;font-size:14px;border-radius:8px;border:1px solid var(--color-border);background:var(--color-bg);cursor:pointer}.select:focus{outline:none}.align-setting-wrapper{display:flex;align-items:center;justify-content:space-between}.align-setting-label{font-size:12px;color:var(--color-text)}.align-options-container{width:120px;color:#0006;background-color:#f5f6f7;border-radius:9999px;padding:4px 13px;display:flex;gap:8px}.align-option-button{display:flex;align-items:center;justify-content:center;width:26px;height:26px;background:transparent;border:none;cursor:pointer;border-radius:50%;transition:background-color .2s,color .2s}.align-option-button:hover{background-color:#fff}.align-option-button.selected{background-color:var(--color-white);color:var(--color-black)}.button-setting-wrapper{display:flex;justify-content:center}.button-setting{padding:8px 16px;background-color:var(--button-bg, #007bff);color:var(--button-color, #fff);border:none;border-radius:4px;cursor:pointer;font-size:14px}.button-setting:hover{background-color:var(--button-bg-hover, #0056b3)}.dimension-setting-container{display:flex;flex-direction:column;gap:8px;position:relative}.dimension-bracket{width:18px;height:42px;position:absolute;top:16px;right:122px;display:flex;align-items:center;justify-content:center}.dimension-bracket:before{content:"";position:absolute;width:13px;height:14px;background:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='15' viewBox='0 0 14 15' fill='none'><path d='M14 1H5C2.79086 1 1 2.79086 1 5V15' stroke='%23667085'/></svg>") no-repeat center center;background-size:contain;top:0;right:1px}.dimension-bracket:after{content:"";position:absolute;width:13px;height:14px;background:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='15' viewBox='0 0 14 15' fill='none'><path d='M14 14H5C2.79086 14 1 12.2091 1 10V4.76837e-07' stroke='%23667085'/></svg>") no-repeat center center;background-size:contain;bottom:0;right:1px}.dimension-lock-icon{width:24px;height:24px;background:none;cursor:pointer;display:inline-flex;align-items:center;color:#667085;z-index:1}.dimension-lock-icon:hover{color:#000}.upload-setting-wrapper{display:flex;align-items:center;justify-content:space-between}.upload-preview{width:91px;height:71px;object-fit:cover;border-radius:4px}.upload-button{display:inline-flex;align-items:center;gap:4px;padding:5px 4px;background-color:var(--color-white);border:1px solid var(--color-border-secondary);border-radius:8px;cursor:pointer;transition:transform .15s ease,box-shadow .15s ease}.upload-icon{padding:7px 8px 8px 7px;display:flex;align-items:center;justify-content:center;background-color:var(--color-bg-icon);border-radius:28px}.upload-label{display:inline-block;font-size:12px;font-weight:600;color:var(--color-btn-text);transition:transform .15s ease}.upload-button:hover{transform:scale(1.02);box-shadow:0 2px 6px #0000001a}:root{--color-border: #d0d5dd;--color-bg: #f8f8f8;--color-border-secondary: #eaecf0;--color-text: #667085;--color-title: #344054;--color-input-text: #292b2e;--color-white: #fff;--color-black: #000;--color-divider: #dcdcdc;--color-btn-text: #4b4b4b;--color-bg-icon: #f2f4f7}*{padding:0;margin:0;border:none}*,*:before,*:after{box-sizing:border-box}a,a:link,a:visited,a:hover{text-decoration:none}body{font-family:Inter,serif;font-weight:400;font-size:12px;line-height:18px}aside,nav,footer,header,section,main{display:block}h1,h2,h3,h4,h5,h6,p{font-size:inherit;font-weight:inherit}ul,ul li{list-style:none}img{vertical-align:top}img,svg{max-width:100%;height:auto}address{font-style:normal}input,textarea,button,select{font-family:inherit;font-size:inherit;color:inherit;background-color:transparent}input::-ms-clear{display:none}button,input[type=submit]{display:inline-block;box-shadow:none;background-color:transparent;background:none;cursor:pointer}input:focus,input:active,button:focus,button:active{outline:none}button::-moz-focus-inner{padding:0;border:0}label{cursor:pointer}legend{display:block}
1
+ @import"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap";.setting-group{padding:16px;display:flex;flex-direction:column;gap:8px;border-bottom:solid 1px var(--color-border);border-radius:8px;background-color:var(--color-bg)}.setting-group .setting-group{background-color:var(--color-white)!important;padding:12px;border-bottom:unset;border:1px solid var(--color-border-secondary);box-shadow:0 12px 16px -4px #10182814,0 4px 6px -2px #10182808}.setting-group-title{display:flex;align-items:center;justify-content:space-between;cursor:pointer}.setting-group-title h3{font-size:14px;font-weight:700;line-height:24px}.setting-group-arrow{display:flex;transition:transform .3s ease-in-out}.setting-group-arrow.rotated{transform:rotate(180deg)}.setting-group-content{flex-direction:column;gap:8px;max-height:fit-content;display:flex;transition:max-height .3s ease-in-out,display .2s ease-in-out}.setting-group-content.collapsed{max-height:0;display:none}.icon-container{display:flex;align-items:center;gap:4px}.input-icon{display:flex;align-items:center;justify-content:center;color:var(--color-text)}.input-label{color:var(--color-text)}.input-container{display:inline-flex;align-items:center;position:relative}.with-suffix{flex:1;padding-right:36px}.input-suffix{position:absolute;right:8px;top:50%;transform:translateY(-50%);color:#666;pointer-events:none;font-size:.9em}.string-setting-wrapper{display:flex;justify-content:space-between;align-items:center}.string-setting-input{max-width:120px;padding:8px;font-size:14px;border-radius:8px;color:var(--color-input-text);border:1px solid var(--color-border);background:var(--color-bg)}.color-setting-wrapper{display:flex;align-items:center;justify-content:space-between;gap:2px}.color-input-wrapper{position:relative;padding:8px 8px 8px 4px;width:120px;height:33px;display:flex;align-items:center;gap:4px;border:1px solid var(--color-border);border-radius:8px;background-color:var(--color-bg)}.color-text-input{border:none;outline:none;width:65px;color:var(--color-input-text);font-size:14px;text-align:center;background:transparent}.color-picker{position:absolute;left:0;top:0;width:25px;height:25px;opacity:0;cursor:pointer}.color-preview{width:25px;height:25px;border-radius:4px}.number-setting-wrapper{display:flex;align-items:center;justify-content:space-between}.number-setting-input{width:120px;padding:8px;font-size:14px;border-radius:8px;color:var(--color-input-text);border:1px solid var(--color-border);background:var(--color-bg);box-sizing:border-box}.suffix-wrapper{position:relative;display:inline-flex;align-items:center}.suffix-label{position:absolute;right:8px;padding-left:8px;top:50%;transform:translateY(-50%);border-left:1px solid var(--color-divider);font-size:12px;color:var(--color-text)}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}.select-container{display:flex;align-items:center;gap:4px;justify-content:space-between}.select{width:120px;padding:8px;font-size:14px;border-radius:8px;border:1px solid var(--color-border);background:var(--color-bg);cursor:pointer}.select:focus{outline:none}.align-setting-wrapper{display:flex;align-items:center;justify-content:space-between}.align-setting-label{font-size:12px;color:var(--color-text)}.align-options-container{width:120px;color:#0006;background-color:#f5f6f7;border-radius:9999px;padding:4px 13px;display:flex;gap:8px}.align-option-button{display:flex;align-items:center;justify-content:center;width:26px;height:26px;background:transparent;border:none;cursor:pointer;border-radius:50%;transition:background-color .2s,color .2s}.align-option-button:hover{background-color:#fff}.align-option-button.selected{background-color:var(--color-white);color:var(--color-black)}.button-setting-wrapper{display:flex;justify-content:center}.button-setting{padding:8px 16px;background-color:var(--button-bg, #007bff);color:var(--button-color, #fff);border:none;border-radius:4px;cursor:pointer;font-size:14px}.button-setting:hover{background-color:var(--button-bg-hover, #0056b3)}.dimension-setting-container{display:flex;flex-direction:column;gap:8px;position:relative}.dimension-bracket{width:18px;height:42px;position:absolute;top:16px;right:122px;display:flex;align-items:center;justify-content:center}.dimension-bracket:before{content:"";position:absolute;width:13px;height:14px;background:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='15' viewBox='0 0 14 15' fill='none'><path d='M14 1H5C2.79086 1 1 2.79086 1 5V15' stroke='%23667085'/></svg>") no-repeat center center;background-size:contain;top:0;right:1px}.dimension-bracket:after{content:"";position:absolute;width:13px;height:14px;background:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='15' viewBox='0 0 14 15' fill='none'><path d='M14 14H5C2.79086 14 1 12.2091 1 10V4.76837e-07' stroke='%23667085'/></svg>") no-repeat center center;background-size:contain;bottom:0;right:1px}.dimension-lock-icon{width:24px;height:24px;background:none;cursor:pointer;display:inline-flex;align-items:center;color:#667085;z-index:1}.dimension-lock-icon:hover{color:#000}.upload-setting-wrapper{display:flex;align-items:center;justify-content:space-between}.upload-preview{width:91px;height:71px;object-fit:cover;border-radius:4px}.upload-button{display:inline-flex;align-items:center;gap:4px;padding:5px 4px;background-color:var(--color-white);border:1px solid var(--color-border-secondary);border-radius:8px;cursor:pointer;transition:transform .15s ease,box-shadow .15s ease}.upload-icon{padding:7px 8px 8px 7px;display:flex;align-items:center;justify-content:center;background-color:var(--color-bg-icon);border-radius:28px}.upload-label{display:inline-block;font-size:12px;font-weight:600;color:var(--color-btn-text);transition:transform .15s ease}.upload-button:hover{transform:scale(1.02);box-shadow:0 2px 6px #0000001a}.tab-delete-button{background:transparent;border:none;cursor:pointer;padding:2px 4px}.tab-delete-button svg{width:16px;height:16px}.tabs-add-btn-container{display:flex;justify-content:flex-end}.tabs-add-button{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border-radius:6px;cursor:pointer;font-size:14px;color:#667085;transition:transform .15s ease,box-shadow .3s ease}.tabs-add-button:hover{transform:scale(1);box-shadow:0 2px 6px #0000001a}.add-icon{display:flex;align-items:center;width:18px}.add-label{display:inline-block}.bgset-or-label{margin:8px 0;text-align:center;font-weight:500;color:#667085}:root{--color-border: #d0d5dd;--color-bg: #f8f8f8;--color-border-secondary: #eaecf0;--color-text: #667085;--color-title: #344054;--color-input-text: #292b2e;--color-white: #fff;--color-black: #000;--color-divider: #dcdcdc;--color-btn-text: #4b4b4b;--color-bg-icon: #f2f4f7}*{padding:0;margin:0;border:none}*,*:before,*:after{box-sizing:border-box}a,a:link,a:visited,a:hover{text-decoration:none}body{font-family:Inter,serif;font-weight:400;font-size:12px;line-height:18px}aside,nav,footer,header,section,main{display:block}h1,h2,h3,h4,h5,h6,p{font-size:inherit;font-weight:inherit}ul,ul li{list-style:none}img{vertical-align:top}img,svg{max-width:100%;height:auto}address{font-style:normal}input,textarea,button,select{font-family:inherit;font-size:inherit;color:inherit;background-color:transparent}input::-ms-clear{display:none}button,input[type=submit]{display:inline-block;box-shadow:none;background-color:transparent;background:none;cursor:pointer}input:focus,input:active,button:focus,button:active{outline:none}button::-moz-focus-inner{padding:0;border:0}label{cursor:pointer}legend{display:block}
package/dist/index.d.ts CHANGED
@@ -10,6 +10,25 @@ export declare interface AlignSettingProps extends SettingProps<AlignValue> {
10
10
 
11
11
  export declare type AlignValue = 'left' | 'center' | 'right';
12
12
 
13
+ export declare class BackgroundSettingSet extends SettingGroup<{
14
+ backgroundImage: UploadSetting;
15
+ opacity: OpacitySetting;
16
+ backgroundColor: ColorSetting;
17
+ opacityBG: OpacitySetting;
18
+ }> {
19
+ constructor(defaults?: {
20
+ backgroundImage?: string;
21
+ opacity?: number;
22
+ backgroundColor?: string;
23
+ opacityBG?: number;
24
+ });
25
+ /**
26
+ * Override draw() to reorder the child settings and insert an "OR" label in between.
27
+ */
28
+ draw(): HTMLElement;
29
+ getCssCode(): string;
30
+ }
31
+
13
32
  /**
14
33
  * A SettingGroup for configuring "Border" settings.
15
34
  * It includes child settings for color, opacity, radius, and size.
@@ -17,7 +36,7 @@ export declare type AlignValue = 'left' | 'center' | 'right';
17
36
  */
18
37
  export declare class BorderSettingSet extends SettingGroup<{
19
38
  color: ColorSetting;
20
- opacity: NumberSetting;
39
+ opacity: OpacitySetting;
21
40
  radius: NumberSetting;
22
41
  size: NumberSetting;
23
42
  }> {
@@ -113,6 +132,33 @@ export declare interface DimensionValue {
113
132
  height: number;
114
133
  }
115
134
 
135
+ declare interface HeaderTypographySettings {
136
+ colorDefault?: string;
137
+ colorOpacityDefault?: number;
138
+ fontFamilyDefault?: string;
139
+ fontFamilyOptions?: SelectOption[];
140
+ fontFamilyGetOptions?: () => SelectOption[];
141
+ fontFamilyGetOptionsAsync?: () => Promise<SelectOption[]>;
142
+ fontWeightDefault?: string;
143
+ fontWeightOptions?: SelectOption[];
144
+ fontWeightGetOptions?: () => SelectOption[];
145
+ fontWeightGetOptionsAsync?: () => Promise<SelectOption[]>;
146
+ fontSizeDefault?: number;
147
+ alignDefault?: AlignValue;
148
+ }
149
+
150
+ export declare class HeaderTypographySettingSet extends SettingGroup<{
151
+ color: ColorSetting;
152
+ opacity: OpacitySetting;
153
+ fontFamily: SelectSetting<string>;
154
+ fontWeight: SelectSetting<string>;
155
+ fontSize: NumberSetting;
156
+ align: AlignSetting_2;
157
+ }> {
158
+ constructor(props?: HeaderTypographySettings);
159
+ getCssCode(): string;
160
+ }
161
+
116
162
  export declare interface IChangable<T> {
117
163
  setOnChange(onChange: (value: T) => void): void;
118
164
  }
@@ -277,10 +323,39 @@ export declare interface StringSettingsProps extends SettingProps<string> {
277
323
  wrapperClassName?: string;
278
324
  }
279
325
 
326
+ export declare class TabsContainerGroup extends SettingGroup<Record<string, TabSettingGroup>> {
327
+ private tabs;
328
+ private _el;
329
+ constructor();
330
+ /** Adds a new tab. */
331
+ addTab(): void;
332
+ /** Removes a specific tab. */
333
+ removeTab(tab: TabSettingGroup): void;
334
+ /** Relabels tabs sequentially after removal. */
335
+ private relabelTabs;
336
+ /**
337
+ * Override draw() so we can store the created DOM element
338
+ * and add the "Add Tab" button in a container positioned at the bottom-right.
339
+ */
340
+ draw(): HTMLElement;
341
+ /**
342
+ * Re-renders the inner settings content based on the current tabs.
343
+ */
344
+ rerender(): void;
345
+ }
346
+
347
+ declare class TabSettingGroup extends SettingGroup<{
348
+ name: StringSetting;
349
+ content: StringSetting;
350
+ }> {
351
+ private onDeleteCallback?;
352
+ constructor(index: number, onDelete: () => void);
353
+ draw(): HTMLElement;
354
+ }
355
+
280
356
  /**
281
- * A Setting subclass that displays an image preview (if any)
282
- * and an "Upload" button with an icon. The user can select a file,
283
- * which updates this.value with a data URL of the image.
357
+ * A Setting subclass that uploads the selected image file to the remote endpoint.
358
+ * The API returns a JSON object containing the final URL, which is then stored in this.value.
284
359
  */
285
360
  export declare class UploadSetting extends Setting<string, UploadSettingProps> {
286
361
  inputType: InputTypes;
@@ -289,8 +364,8 @@ export declare class UploadSetting extends Setting<string, UploadSettingProps> {
289
364
  }
290
365
 
291
366
  export declare interface UploadSettingProps extends SettingProps<string> {
292
- /** Optional placeholder image or default URL */
293
367
  defaultUrl?: string;
368
+ token?: string;
294
369
  }
295
370
 
296
371
  export { }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "builder-settings-types",
3
3
  "description": "builder settings",
4
- "version": "0.0.57",
4
+ "version": "0.0.58",
5
5
  "type": "module",
6
6
  "main": "dist/builder-settings-types.cjs.js",
7
7
  "module": "dist/builder-settings-types.es.js",