builder-settings-types 0.0.368 → 0.0.370

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.
@@ -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",l=>{l.preventDefault(),this.showPopup()});const n=l=>{var d;const{type:r,data:h}=l.data||{};r==="TEXT_ELEMENT_CLICKED"&&h.$id==((d=this.value)==null?void 0:d.$id)&&this.showPopup()};window.addEventListener("message",n),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.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=`
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=l=>{var d;const{type:r,data:h}=l.data||{};r==="TEXT_ELEMENT_CLICKED"&&(console.log((d=this.value)==null?void 0:d.$id),this.value.$id!=null&&h.$id==this.value.$id&&this.showPopup())};window.addEventListener("message",n),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=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>
@@ -4979,7 +4979,7 @@ class yi extends w {
4979
4979
  const n = (l) => {
4980
4980
  var d;
4981
4981
  const { type: r, data: h } = l.data || {};
4982
- r === "TEXT_ELEMENT_CLICKED" && h.$id == ((d = this.value) == null ? void 0 : d.$id) && this.showPopup();
4982
+ r === "TEXT_ELEMENT_CLICKED" && (console.log((d = this.value) == null ? void 0 : d.$id), this.value.$id != null && h.$id == this.value.$id && this.showPopup());
4983
4983
  };
4984
4984
  window.addEventListener("message", n), e.appendChild(i), e.appendChild(s), t.appendChild(e);
4985
4985
  const o = document.createElement("div");
@@ -4998,7 +4998,7 @@ class yi extends w {
4998
4998
  return window.addEventListener("resize", a), t;
4999
4999
  }
5000
5000
  setValue(t) {
5001
- super.setValue(t), this.container && this.props.languages.forEach((e) => {
5001
+ super.setValue(t), this.value.$id = t.$id, this.container && this.props.languages.forEach((e) => {
5002
5002
  var i;
5003
5003
  if (this.props.multiImg) {
5004
5004
  const s = this.uploadSettings.get(e);
@@ -1,6 +1,6 @@
1
1
  import { Setting, SettingProps } from '../../base/settings';
2
2
  export interface MultiLanguageValue {
3
- [languageCode: string]: string;
3
+ [languageCode: string | '$id']: string;
4
4
  }
5
5
  export interface MultiLanguageSettingsProps extends SettingProps<MultiLanguageValue> {
6
6
  languages: string[];
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.368",
4
+ "version": "0.0.370",
5
5
  "type": "module",
6
6
  "main": "dist/builder-settings-types.cjs.js",
7
7
  "module": "dist/builder-settings-types.es.js",