builder-settings-types 0.0.382 → 0.0.383

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.
@@ -312,7 +312,7 @@
312
312
  </svg>`;class li extends ${constructor(t={}){super({...t,minValue:t.minValue??0,maxValue:t.maxValue??1e3,icon:t.icon||ai,title:t.title||"Margin Bottom",default:t.default??20,wrapperClassName:"margin-bottom-wrapper "+(t.wrapperClassName||"")}),this.inputType="number"}}const ri=`<svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
313
313
  <path d="M15.75 7.25H2.25m9.9 9h-6.3c-1.26 0-1.89 0-2.371-.245a2.25 2.25 0 0 1-.984-.983c-.245-.482-.245-1.112-.245-2.372v-6.3c0-1.26 0-1.89.245-2.371a2.25 2.25 0 0 1 .984-.984c.48-.245 1.11-.245 2.371-.245h6.3c1.26 0 1.89 0 2.371.245.424.216.768.56.984.984.245.48.245 1.11.245 2.371v6.3c0 1.26 0 1.89-.245 2.371-.216.424-.56.768-.984.984-.48.245-1.11.245-2.371.245"
314
314
  stroke="#667085" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
315
- </svg>`;class ci extends ${constructor(t={}){super({...t,minValue:t.minValue??0,maxValue:t.maxValue??1e3,icon:t.icon||ri,title:t.title||"Margin Top",default:t.default??20,wrapperClassName:"margin-top-wrapper "+(t.wrapperClassName||"")}),this.inputType="number"}}class hi extends w{constructor(t){super(t),this.inputType={},this.container=null,this.defaultLanguage="",this.uploadSettings=new Map,this.popup=null,t.default?this.value=t.default:this.value||(this.value={}),this.value.$id=this.id;const e=w.HasExplicitCurrentLanguage(),i=e?w.CurrentLanguage():"",s=w.DefaultLanguage;this.defaultLanguage=e&&i&&t.languages.includes(i)?i:s&&t.languages.includes(s)?s:t.languages[0];const n=t.defaultValue||`Enter text in ${this.capitalizeFirstLetter(this.defaultLanguage)}`;t.languages.forEach(o=>{var a,l;o in(this.value||{})||(this.value||(this.value={}),o===this.defaultLanguage&&n?this.value[o]=((a=t.default)==null?void 0:a[o])||n:this.value[o]=((l=t.default)==null?void 0:l[o])||"")})}capitalizeFirstLetter(t){return String(t).charAt(0).toUpperCase()+String(t).slice(1)}measureTextWidth(t,e){this.textMeasureCanvas||(this.textMeasureCanvas=document.createElement("canvas"));const i=this.textMeasureCanvas.getContext("2d");if(!i)return t.length*10;const s=`${e.fontStyle} ${e.fontWeight} ${e.fontSize} ${e.fontFamily}`.trim();return i.font=s,i.measureText(t).width}adaptPlaceholderToSingleLine(t,e){const i=window.getComputedStyle(t),s=parseFloat(i.paddingLeft)||0,n=parseFloat(i.paddingRight)||0,o=parseFloat(i.borderLeftWidth)||0,a=parseFloat(i.borderRightWidth)||0,l=Math.max(0,t.clientWidth-s-n-o-a);if(l<=0){t.placeholder=e;return}if(this.measureTextWidth(e,i)<=l){t.placeholder=e;return}const h="...";let d=0,p=e.length,u=0;for(;d<=p;){const m=Math.floor((d+p)/2),g=e.slice(0,m).trimEnd()+h;this.measureTextWidth(g,i)<=l?(u=m,d=m+1):p=m-1}const C=e.slice(0,u).trimEnd()+h;t.placeholder=C}autosizeTextarea(t,e=3){t.style.height="auto";const i=window.getComputedStyle(t),s=parseFloat(i.lineHeight)||20,n=parseFloat(i.paddingTop)+parseFloat(i.paddingBottom),o=parseFloat(i.borderTopWidth)+parseFloat(i.borderBottomWidth),a=s*e+n+o,l=Math.min(t.scrollHeight||44,a);t.style.height=`${l}px`,t.scrollHeight>a?t.style.overflowY="auto":t.style.overflowY="hidden"}createTextareaRow(t,e){const i=document.createElement("div");i.classList.add("simple-multi-language-row");const s=document.createElement("label");if(s.classList.add("simple-language-label"),s.textContent=t.toUpperCase(),s.setAttribute("for",`textarea-${t}`),i.appendChild(s),this.props.multiImg){const n=new lt({defaultUrl:e||"",title:"",id:`${this.id}_upload_${t}`});n.setOnChange(a=>{this.updateLanguageValue(t,a),t===this.defaultLanguage&&this.updateOtherLanguagePlaceholders(a)}),this.uploadSettings.set(t,n);const o=n.draw();o.classList.add("simple-language-upload"),i.appendChild(o)}else{const n=document.createElement("textarea");n.id=`textarea-${t}`,n.classList.add("simple-language-textarea"),n.value=e||"",n.rows=1,n.style.overflowY="hidden";let o=this.props.placeholder||"Enter text in {language}...";o.includes("{language}")&&(o=o.replace("{language}",t.toUpperCase())),n.setAttribute("data-full-placeholder",o),this.adaptPlaceholderToSingleLine(n,o),this.getDataPropsPath()&&n.setAttribute("data-test-id",`${this.getDataPropsPath()}_${t}`),n.addEventListener("input",l=>{const r=l.target;this.updateLanguageValue(t,r.value),t===this.defaultLanguage&&this.updateOtherLanguagePlaceholders(r.value),this.autosizeTextarea(r,3);const h=n.getAttribute("data-full-placeholder")||"";h&&this.adaptPlaceholderToSingleLine(n,h)}),i.appendChild(n),(l=>(typeof queueMicrotask=="function"?queueMicrotask:r=>setTimeout(r,0))(l))(()=>{this.autosizeTextarea(n,3);const l=n.getAttribute("data-full-placeholder")||"";l&&this.adaptPlaceholderToSingleLine(n,l)})}return i}updateLanguageValue(t,e){this.value||(this.value={});const i={...this.value,[t]:e};this.setValue(i)}updateOtherLanguagePlaceholders(t){this.container&&this.props.languages.forEach(e=>{var s,n;if(e===this.defaultLanguage)return;const i=(s=this.container)==null?void 0:s.querySelector(`#textarea-${e}`);if(i&&(!i.value||i.value.trim()==="")){const o=t||((n=this.props.placeholder)==null?void 0:n.replace("{language}",e.toUpperCase()))||`Enter text in ${e.toUpperCase()}...`;i.setAttribute("data-full-placeholder",o),this.adaptPlaceholderToSingleLine(i,o)}})}renderContent(t){var n;const e=t.querySelector(".simple-multi-language-content");if(!e)return;e.innerHTML="";const i=w.HasExplicitCurrentLanguage(),s=w.CurrentLanguage();if(!i||!s||!this.props.languages.includes(s))this.props.languages.forEach(o=>{var r;const a=((r=this.value)==null?void 0:r[o])||"",l=this.createTextareaRow(o,a);e.appendChild(l)});else{const o=((n=this.value)==null?void 0:n[s])||"",a=this.createTextareaRow(s,o);e.appendChild(a);const l=e.querySelector(".simple-language-textarea");if(l){const r=l.getAttribute("data-full-placeholder")||"";r&&this.adaptPlaceholderToSingleLine(l,r)}}}createPopup(){const t=document.createElement("div");t.classList.add("multi-language-popup-overlay"),t.style.cssText=`
315
+ </svg>`;class ci extends ${constructor(t={}){super({...t,minValue:t.minValue??0,maxValue:t.maxValue??1e3,icon:t.icon||ri,title:t.title||"Margin Top",default:t.default??20,wrapperClassName:"margin-top-wrapper "+(t.wrapperClassName||"")}),this.inputType="number"}}class hi extends w{constructor(t){super(t),this.inputType={},this.container=null,this.defaultLanguage="",this.uploadSettings=new Map,this.popup=null;const e=window;e.textElementListeners||(e.textElementListeners=new Map),t.default?this.value=t.default:this.value||(this.value={}),this.value.$id=this.id;const i=w.HasExplicitCurrentLanguage(),s=i?w.CurrentLanguage():"",n=w.DefaultLanguage;this.defaultLanguage=i&&s&&t.languages.includes(s)?s:n&&t.languages.includes(n)?n:t.languages[0];const o=t.defaultValue||`Enter text in ${this.capitalizeFirstLetter(this.defaultLanguage)}`;t.languages.forEach(a=>{var l,r;a in(this.value||{})||(this.value||(this.value={}),a===this.defaultLanguage&&o?this.value[a]=((l=t.default)==null?void 0:l[a])||o:this.value[a]=((r=t.default)==null?void 0:r[a])||"")})}capitalizeFirstLetter(t){return String(t).charAt(0).toUpperCase()+String(t).slice(1)}measureTextWidth(t,e){this.textMeasureCanvas||(this.textMeasureCanvas=document.createElement("canvas"));const i=this.textMeasureCanvas.getContext("2d");if(!i)return t.length*10;const s=`${e.fontStyle} ${e.fontWeight} ${e.fontSize} ${e.fontFamily}`.trim();return i.font=s,i.measureText(t).width}adaptPlaceholderToSingleLine(t,e){const i=window.getComputedStyle(t),s=parseFloat(i.paddingLeft)||0,n=parseFloat(i.paddingRight)||0,o=parseFloat(i.borderLeftWidth)||0,a=parseFloat(i.borderRightWidth)||0,l=Math.max(0,t.clientWidth-s-n-o-a);if(l<=0){t.placeholder=e;return}if(this.measureTextWidth(e,i)<=l){t.placeholder=e;return}const h="...";let d=0,p=e.length,u=0;for(;d<=p;){const m=Math.floor((d+p)/2),g=e.slice(0,m).trimEnd()+h;this.measureTextWidth(g,i)<=l?(u=m,d=m+1):p=m-1}const C=e.slice(0,u).trimEnd()+h;t.placeholder=C}autosizeTextarea(t,e=3){t.style.height="auto";const i=window.getComputedStyle(t),s=parseFloat(i.lineHeight)||20,n=parseFloat(i.paddingTop)+parseFloat(i.paddingBottom),o=parseFloat(i.borderTopWidth)+parseFloat(i.borderBottomWidth),a=s*e+n+o,l=Math.min(t.scrollHeight||44,a);t.style.height=`${l}px`,t.scrollHeight>a?t.style.overflowY="auto":t.style.overflowY="hidden"}createTextareaRow(t,e){const i=document.createElement("div");i.classList.add("simple-multi-language-row");const s=document.createElement("label");if(s.classList.add("simple-language-label"),s.textContent=t.toUpperCase(),s.setAttribute("for",`textarea-${t}`),i.appendChild(s),this.props.multiImg){const n=new lt({defaultUrl:e||"",title:"",id:`${this.id}_upload_${t}`});n.setOnChange(a=>{this.updateLanguageValue(t,a),t===this.defaultLanguage&&this.updateOtherLanguagePlaceholders(a)}),this.uploadSettings.set(t,n);const o=n.draw();o.classList.add("simple-language-upload"),i.appendChild(o)}else{const n=document.createElement("textarea");n.id=`textarea-${t}`,n.classList.add("simple-language-textarea"),n.value=e||"",n.rows=1,n.style.overflowY="hidden";let o=this.props.placeholder||"Enter text in {language}...";o.includes("{language}")&&(o=o.replace("{language}",t.toUpperCase())),n.setAttribute("data-full-placeholder",o),this.adaptPlaceholderToSingleLine(n,o),this.getDataPropsPath()&&n.setAttribute("data-test-id",`${this.getDataPropsPath()}_${t}`),n.addEventListener("input",l=>{const r=l.target;this.updateLanguageValue(t,r.value),t===this.defaultLanguage&&this.updateOtherLanguagePlaceholders(r.value),this.autosizeTextarea(r,3);const h=n.getAttribute("data-full-placeholder")||"";h&&this.adaptPlaceholderToSingleLine(n,h)}),i.appendChild(n),(l=>(typeof queueMicrotask=="function"?queueMicrotask:r=>setTimeout(r,0))(l))(()=>{this.autosizeTextarea(n,3);const l=n.getAttribute("data-full-placeholder")||"";l&&this.adaptPlaceholderToSingleLine(n,l)})}return i}updateLanguageValue(t,e){this.value||(this.value={});const i={...this.value,[t]:e};this.setValue(i)}updateOtherLanguagePlaceholders(t){this.container&&this.props.languages.forEach(e=>{var s,n;if(e===this.defaultLanguage)return;const i=(s=this.container)==null?void 0:s.querySelector(`#textarea-${e}`);if(i&&(!i.value||i.value.trim()==="")){const o=t||((n=this.props.placeholder)==null?void 0:n.replace("{language}",e.toUpperCase()))||`Enter text in ${e.toUpperCase()}...`;i.setAttribute("data-full-placeholder",o),this.adaptPlaceholderToSingleLine(i,o)}})}renderContent(t){var n;const e=t.querySelector(".simple-multi-language-content");if(!e)return;e.innerHTML="";const i=w.HasExplicitCurrentLanguage(),s=w.CurrentLanguage();if(!i||!s||!this.props.languages.includes(s))this.props.languages.forEach(o=>{var r;const a=((r=this.value)==null?void 0:r[o])||"",l=this.createTextareaRow(o,a);e.appendChild(l)});else{const o=((n=this.value)==null?void 0:n[s])||"",a=this.createTextareaRow(s,o);e.appendChild(a);const l=e.querySelector(".simple-language-textarea");if(l){const r=l.getAttribute("data-full-placeholder")||"";r&&this.adaptPlaceholderToSingleLine(l,r)}}}createPopup(){const t=document.createElement("div");t.classList.add("multi-language-popup-overlay"),t.style.cssText=`
316
316
  position: fixed;
317
317
  top: 0;
318
318
  left: 0;
@@ -373,7 +373,7 @@
373
373
  justify-content: center;
374
374
  color: #666;
375
375
  transition: color 0.2s;
376
- `,s.addEventListener("mouseenter",()=>{s.style.color="#000"}),s.addEventListener("mouseleave",()=>{s.style.color="#666"}),s.addEventListener("click",a=>{a.preventDefault(),this.showPopup()}),e.appendChild(i),e.appendChild(s),t.appendChild(e);const n=document.createElement("div");n.classList.add("simple-multi-language-content"),t.appendChild(n),this.container=t,this.renderContent(t),this.languageChangeUnsubscribe=w.onLanguageChange(a=>{a&&this.props.languages.includes(a)&&(this.defaultLanguage=a),this.container&&this.renderContent(this.container)});const o=()=>{if(!this.container)return;this.container.querySelectorAll(".simple-language-textarea").forEach(l=>{const r=l.getAttribute("data-full-placeholder")||"";r&&this.adaptPlaceholderToSingleLine(l,r)})};return window.addEventListener("resize",o),t}setValue(t){var n;super.setValue(t),this.value.$id=this.value.$id||t.$id;const e=window;e.textElementListeners||(e.textElementListeners=new Map);const i=(n=this.value)==null?void 0:n.$id,s=window.textElementListeners;if(i&&!s.has(i)){const o=a=>{const{type:l,data:r}=a.data||{};l==="TEXT_ELEMENT_CLICKED"&&(r==null?void 0:r.$id)===i&&this.showPopup()};window.addEventListener("message",o),s.set(i,o)}this.container&&this.props.languages.forEach(o=>{var a;if(this.props.multiImg){const l=this.uploadSettings.get(o);l&&l.setValue((t==null?void 0:t[o])||"")}else{const l=(a=this.container)==null?void 0:a.querySelector(`#textarea-${o}`);if(l){l.value=(t==null?void 0:t[o])||"",this.autosizeTextarea(l,3);const r=l.getAttribute("data-full-placeholder")||"";r&&this.adaptPlaceholderToSingleLine(l,r)}}})}}class di extends w{constructor(t={}){super(t),this.inputType="select";const e=[{name:"None",value:"none"},{name:"Fade",value:"fade 1.5s ease-in-out infinite"},{name:"Slide",value:"slide 1.5s ease-in-out infinite"},{name:"Zoom",value:"zoom 1.5s ease-in-out infinite"},{name:"Bounce",value:"bounce 1.5s ease-in-out infinite"},{name:"Pulse",value:"pulse 1.5s ease-in-out infinite"}];this.selectSetting=new st({title:this.title||"Animation",options:e,default:this.props.default||"none"}),this.selectSetting.onChange=i=>{var s;this.value=i,(s=this.onChange)==null||s.call(this,i)}}draw(){return this.selectSetting.draw()}destroy(){this.selectSetting.destroy(),super.destroy()}}const pi=`
376
+ `,s.addEventListener("mouseenter",()=>{s.style.color="#000"}),s.addEventListener("mouseleave",()=>{s.style.color="#666"}),s.addEventListener("click",l=>{l.preventDefault(),this.showPopup()});const n=window.textElementListeners;if(this.id&&!n.has(this.id)){const l=r=>{var p;const{type:h,data:d}=r.data||{};h==="TEXT_ELEMENT_CLICKED"&&d.$id&&(d==null?void 0:d.$id)===((p=this.value)==null?void 0:p.$id)&&this.showPopup()};window.addEventListener("message",l),n.set(this.id,l)}e.appendChild(i),e.appendChild(s),t.appendChild(e);const o=document.createElement("div");o.classList.add("simple-multi-language-content"),t.appendChild(o),this.container=t,this.renderContent(t),this.languageChangeUnsubscribe=w.onLanguageChange(l=>{l&&this.props.languages.includes(l)&&(this.defaultLanguage=l),this.container&&this.renderContent(this.container)});const a=()=>{if(!this.container)return;this.container.querySelectorAll(".simple-language-textarea").forEach(r=>{const h=r.getAttribute("data-full-placeholder")||"";h&&this.adaptPlaceholderToSingleLine(r,h)})};return window.addEventListener("resize",a),t}setValue(t){super.setValue(t),this.value.$id=this.value.$id||t.$id,this.container&&this.props.languages.forEach(e=>{var i;if(this.props.multiImg){const s=this.uploadSettings.get(e);s&&s.setValue((t==null?void 0:t[e])||"")}else{const s=(i=this.container)==null?void 0:i.querySelector(`#textarea-${e}`);if(s){s.value=(t==null?void 0:t[e])||"",this.autosizeTextarea(s,3);const n=s.getAttribute("data-full-placeholder")||"";n&&this.adaptPlaceholderToSingleLine(s,n)}}})}}class di extends w{constructor(t={}){super(t),this.inputType="select";const e=[{name:"None",value:"none"},{name:"Fade",value:"fade 1.5s ease-in-out infinite"},{name:"Slide",value:"slide 1.5s ease-in-out infinite"},{name:"Zoom",value:"zoom 1.5s ease-in-out infinite"},{name:"Bounce",value:"bounce 1.5s ease-in-out infinite"},{name:"Pulse",value:"pulse 1.5s ease-in-out infinite"}];this.selectSetting=new st({title:this.title||"Animation",options:e,default:this.props.default||"none"}),this.selectSetting.onChange=i=>{var s;this.value=i,(s=this.onChange)==null||s.call(this,i)}}draw(){return this.selectSetting.draw()}destroy(){this.selectSetting.destroy(),super.destroy()}}const pi=`
377
377
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="19" viewBox="0 0 18 19" fill="none">
378
378
  <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"/>
379
379
  </svg>
@@ -4743,13 +4743,15 @@ class Ci extends B {
4743
4743
  }
4744
4744
  class yi extends w {
4745
4745
  constructor(t) {
4746
- super(t), this.inputType = {}, this.container = null, this.defaultLanguage = "", this.uploadSettings = /* @__PURE__ */ new Map(), this.popup = null, t.default ? this.value = t.default : this.value || (this.value = {}), this.value.$id = this.id;
4747
- const e = w.HasExplicitCurrentLanguage(), i = e ? w.CurrentLanguage() : "", s = w.DefaultLanguage;
4748
- this.defaultLanguage = e && i && t.languages.includes(i) ? i : s && t.languages.includes(s) ? s : t.languages[0];
4749
- const n = t.defaultValue || `Enter text in ${this.capitalizeFirstLetter(this.defaultLanguage)}`;
4750
- t.languages.forEach((o) => {
4751
- var a, l;
4752
- o in (this.value || {}) || (this.value || (this.value = {}), o === this.defaultLanguage && n ? this.value[o] = ((a = t.default) == null ? void 0 : a[o]) || n : this.value[o] = ((l = t.default) == null ? void 0 : l[o]) || "");
4746
+ super(t), this.inputType = {}, this.container = null, this.defaultLanguage = "", this.uploadSettings = /* @__PURE__ */ new Map(), this.popup = null;
4747
+ const e = window;
4748
+ e.textElementListeners || (e.textElementListeners = /* @__PURE__ */ new Map()), t.default ? this.value = t.default : this.value || (this.value = {}), this.value.$id = this.id;
4749
+ const i = w.HasExplicitCurrentLanguage(), s = i ? w.CurrentLanguage() : "", n = w.DefaultLanguage;
4750
+ this.defaultLanguage = i && s && t.languages.includes(s) ? s : n && t.languages.includes(n) ? n : t.languages[0];
4751
+ const o = t.defaultValue || `Enter text in ${this.capitalizeFirstLetter(this.defaultLanguage)}`;
4752
+ t.languages.forEach((a) => {
4753
+ var l, r;
4754
+ a in (this.value || {}) || (this.value || (this.value = {}), a === this.defaultLanguage && o ? this.value[a] = ((l = t.default) == null ? void 0 : l[a]) || o : this.value[a] = ((r = t.default) == null ? void 0 : r[a]) || "");
4753
4755
  });
4754
4756
  }
4755
4757
  capitalizeFirstLetter(t) {
@@ -4973,50 +4975,48 @@ class yi extends w {
4973
4975
  s.style.color = "#000";
4974
4976
  }), s.addEventListener("mouseleave", () => {
4975
4977
  s.style.color = "#666";
4976
- }), s.addEventListener("click", (a) => {
4977
- a.preventDefault(), this.showPopup();
4978
- }), e.appendChild(i), e.appendChild(s), t.appendChild(e);
4979
- const n = document.createElement("div");
4980
- n.classList.add("simple-multi-language-content"), t.appendChild(n), this.container = t, this.renderContent(t), this.languageChangeUnsubscribe = w.onLanguageChange((a) => {
4981
- a && this.props.languages.includes(a) && (this.defaultLanguage = a), this.container && this.renderContent(this.container);
4978
+ }), s.addEventListener("click", (l) => {
4979
+ l.preventDefault(), this.showPopup();
4980
+ });
4981
+ const n = window.textElementListeners;
4982
+ if (this.id && !n.has(this.id)) {
4983
+ const l = (r) => {
4984
+ var p;
4985
+ const { type: h, data: d } = r.data || {};
4986
+ h === "TEXT_ELEMENT_CLICKED" && d.$id && (d == null ? void 0 : d.$id) === ((p = this.value) == null ? void 0 : p.$id) && this.showPopup();
4987
+ };
4988
+ window.addEventListener("message", l), n.set(this.id, l);
4989
+ }
4990
+ e.appendChild(i), e.appendChild(s), t.appendChild(e);
4991
+ const o = document.createElement("div");
4992
+ o.classList.add("simple-multi-language-content"), t.appendChild(o), this.container = t, this.renderContent(t), this.languageChangeUnsubscribe = w.onLanguageChange((l) => {
4993
+ l && this.props.languages.includes(l) && (this.defaultLanguage = l), this.container && this.renderContent(this.container);
4982
4994
  });
4983
- const o = () => {
4995
+ const a = () => {
4984
4996
  if (!this.container) return;
4985
4997
  this.container.querySelectorAll(
4986
4998
  ".simple-language-textarea"
4987
- ).forEach((l) => {
4988
- const r = l.getAttribute("data-full-placeholder") || "";
4989
- r && this.adaptPlaceholderToSingleLine(l, r);
4999
+ ).forEach((r) => {
5000
+ const h = r.getAttribute("data-full-placeholder") || "";
5001
+ h && this.adaptPlaceholderToSingleLine(r, h);
4990
5002
  });
4991
5003
  };
4992
- return window.addEventListener("resize", o), t;
5004
+ return window.addEventListener("resize", a), t;
4993
5005
  }
4994
5006
  setValue(t) {
4995
- var n;
4996
- super.setValue(t), this.value.$id = this.value.$id || t.$id;
4997
- const e = window;
4998
- e.textElementListeners || (e.textElementListeners = /* @__PURE__ */ new Map());
4999
- const i = (n = this.value) == null ? void 0 : n.$id, s = window.textElementListeners;
5000
- if (i && !s.has(i)) {
5001
- const o = (a) => {
5002
- const { type: l, data: r } = a.data || {};
5003
- l === "TEXT_ELEMENT_CLICKED" && (r == null ? void 0 : r.$id) === i && this.showPopup();
5004
- };
5005
- window.addEventListener("message", o), s.set(i, o);
5006
- }
5007
- this.container && this.props.languages.forEach((o) => {
5008
- var a;
5007
+ super.setValue(t), this.value.$id = this.value.$id || t.$id, this.container && this.props.languages.forEach((e) => {
5008
+ var i;
5009
5009
  if (this.props.multiImg) {
5010
- const l = this.uploadSettings.get(o);
5011
- l && l.setValue((t == null ? void 0 : t[o]) || "");
5010
+ const s = this.uploadSettings.get(e);
5011
+ s && s.setValue((t == null ? void 0 : t[e]) || "");
5012
5012
  } else {
5013
- const l = (a = this.container) == null ? void 0 : a.querySelector(
5014
- `#textarea-${o}`
5013
+ const s = (i = this.container) == null ? void 0 : i.querySelector(
5014
+ `#textarea-${e}`
5015
5015
  );
5016
- if (l) {
5017
- l.value = (t == null ? void 0 : t[o]) || "", this.autosizeTextarea(l, 3);
5018
- const r = l.getAttribute("data-full-placeholder") || "";
5019
- r && this.adaptPlaceholderToSingleLine(l, r);
5016
+ if (s) {
5017
+ s.value = (t == null ? void 0 : t[e]) || "", this.autosizeTextarea(s, 3);
5018
+ const n = s.getAttribute("data-full-placeholder") || "";
5019
+ n && this.adaptPlaceholderToSingleLine(s, n);
5020
5020
  }
5021
5021
  }
5022
5022
  });
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.382",
4
+ "version": "0.0.383",
5
5
  "type": "module",
6
6
  "main": "dist/builder-settings-types.cjs.js",
7
7
  "module": "dist/builder-settings-types.es.js",