builder-settings-types 0.0.374 → 0.0.376
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={})
|
|
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){var r;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={});const i=(r=this.value)==null?void 0:r.$id,s=window.textElementListeners;if(i&&!s.has(i)){const h=d=>{const{type:p,data:u}=d.data||{};p==="TEXT_ELEMENT_CLICKED"&&(u==null?void 0:u.$id)===i&&this.showPopup()};window.addEventListener("message",h),s.set(i,h)}const n=w.HasExplicitCurrentLanguage(),o=n?w.CurrentLanguage():"",a=w.DefaultLanguage;this.defaultLanguage=n&&o&&t.languages.includes(o)?o:a&&t.languages.includes(a)?a:t.languages[0];const l=t.defaultValue||`Enter text in ${this.capitalizeFirstLetter(this.defaultLanguage)}`;t.languages.forEach(h=>{var d,p;h in(this.value||{})||(this.value||(this.value={}),h===this.defaultLanguage&&l?this.value[h]=((d=t.default)==null?void 0:d[h])||l:this.value[h]=((p=t.default)==null?void 0:p[h])||"")})}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;
|
|
@@ -354,7 +354,7 @@
|
|
|
354
354
|
align-items: center;
|
|
355
355
|
justify-content: center;
|
|
356
356
|
line-height: 1;
|
|
357
|
-
`,n.addEventListener("click",()=>this.closePopup()),i.appendChild(s),i.appendChild(n),e.appendChild(i);const o=document.createElement("div");return o.classList.add("multi-language-popup-content"),this.props.languages.forEach(a=>{var h;const l=((h=this.value)==null?void 0:h[a])||"",r=this.createTextareaRow(a,l);o.appendChild(r)}),e.appendChild(o),t.appendChild(e),t.addEventListener("click",a=>{a.target===t&&this.closePopup()}),t}showPopup(){this.popup||(this.popup=this.createPopup(),document.body.appendChild(this.popup))}closePopup(){this.popup&&(document.body.removeChild(this.popup),this.popup=null)}draw(){
|
|
357
|
+
`,n.addEventListener("click",()=>this.closePopup()),i.appendChild(s),i.appendChild(n),e.appendChild(i);const o=document.createElement("div");return o.classList.add("multi-language-popup-content"),this.props.languages.forEach(a=>{var h;const l=((h=this.value)==null?void 0:h[a])||"",r=this.createTextareaRow(a,l);o.appendChild(r)}),e.appendChild(o),t.appendChild(e),t.addEventListener("click",a=>{a.target===t&&this.closePopup()}),t}showPopup(){this.popup||(this.popup=this.createPopup(),document.body.appendChild(this.popup))}closePopup(){this.popup&&(document.body.removeChild(this.popup),this.popup=null)}draw(){const t=document.createElement("div");t.classList.add("simple-multi-language-wrapper");const e=document.createElement("div");e.classList.add("simple-multi-language-title"),e.style.cssText=`
|
|
358
358
|
display: flex;
|
|
359
359
|
justify-content: space-between;
|
|
360
360
|
align-items: center;
|
|
@@ -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",
|
|
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){super.setValue(t),console.log("incoming multilanguage value---------",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>
|
|
@@ -124,7 +124,7 @@ function it(c) {
|
|
|
124
124
|
}
|
|
125
125
|
return c;
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function At(c) {
|
|
128
128
|
switch (c) {
|
|
129
129
|
case "number":
|
|
130
130
|
return 0;
|
|
@@ -206,7 +206,7 @@ const I = class I {
|
|
|
206
206
|
const i = document.createElement("div");
|
|
207
207
|
i.className = t.wrapperClassName || "";
|
|
208
208
|
const s = document.createElement("input");
|
|
209
|
-
this.inputEl = s, s.value = String(t.value ||
|
|
209
|
+
this.inputEl = s, s.value = String(t.value || At(t.inputType)), s.type = t.inputType, s.placeholder = t.placeholder || "", s.className = t.inputClassName || "", this.dataPropsPath && s.setAttribute("data-test-id", this.dataPropsPath);
|
|
210
210
|
const n = (a) => {
|
|
211
211
|
const l = a.target;
|
|
212
212
|
let r = l.value;
|
|
@@ -361,7 +361,7 @@ const dt = (c, t, e) => {
|
|
|
361
361
|
return `rgba(${s}, ${n}, ${o}, ${e})`;
|
|
362
362
|
}
|
|
363
363
|
return c;
|
|
364
|
-
},
|
|
364
|
+
}, Dt = (c) => [
|
|
365
365
|
"red",
|
|
366
366
|
"green",
|
|
367
367
|
"blue",
|
|
@@ -466,7 +466,7 @@ const dt = (c, t, e) => {
|
|
|
466
466
|
"at",
|
|
467
467
|
"contain",
|
|
468
468
|
"cover"
|
|
469
|
-
].includes(t) ? !1 : /^#[0-9a-f]{3,8}$/i.test(t) || /^rgb/i.test(c) || /^hsl/i.test(c) ||
|
|
469
|
+
].includes(t) ? !1 : /^#[0-9a-f]{3,8}$/i.test(t) || /^rgb/i.test(c) || /^hsl/i.test(c) || Dt(t);
|
|
470
470
|
}, yt = (c) => {
|
|
471
471
|
const t = [];
|
|
472
472
|
return c.forEach((e, i) => {
|
|
@@ -478,7 +478,7 @@ const dt = (c, t, e) => {
|
|
|
478
478
|
const l = Nt(n);
|
|
479
479
|
l.position = Math.max(0, Math.min(100, Math.round(o))), t.push(l);
|
|
480
480
|
}), t;
|
|
481
|
-
},
|
|
481
|
+
}, D = (c) => {
|
|
482
482
|
const t = c.stops && c.stops.length ? c.stops : [{ color: "#000000", position: 0, opacity: 100 }];
|
|
483
483
|
return {
|
|
484
484
|
type: c.type && ["linear", "radial", "solid"].includes(c.type) ? c.type : "linear",
|
|
@@ -493,7 +493,7 @@ const dt = (c, t, e) => {
|
|
|
493
493
|
const t = c.replace(/;$/, "").trim();
|
|
494
494
|
if (Rt(t)) {
|
|
495
495
|
const s = Nt(t);
|
|
496
|
-
return
|
|
496
|
+
return D({ type: "solid", angle: 0, stops: [s] });
|
|
497
497
|
}
|
|
498
498
|
const e = Ct(t, "linear-gradient");
|
|
499
499
|
if (e) {
|
|
@@ -514,12 +514,12 @@ const dt = (c, t, e) => {
|
|
|
514
514
|
"to top left": 315
|
|
515
515
|
}[a] ?? 90, o = s.slice(1));
|
|
516
516
|
const l = yt(o);
|
|
517
|
-
return l.length ?
|
|
517
|
+
return l.length ? D({ type: "linear", angle: n, stops: l }) : null;
|
|
518
518
|
}
|
|
519
519
|
const i = Ct(t, "radial-gradient");
|
|
520
520
|
if (i) {
|
|
521
521
|
const s = ft(i), n = s[0] && !Gt(s[0]) ? s.slice(1) : s, o = yt(n);
|
|
522
|
-
return o.length ?
|
|
522
|
+
return o.length ? D({ type: "radial", angle: 0, stops: o }) : null;
|
|
523
523
|
}
|
|
524
524
|
return null;
|
|
525
525
|
}, T = (c) => {
|
|
@@ -1216,16 +1216,16 @@ const P = class P extends w {
|
|
|
1216
1216
|
const t = this.originalDefault;
|
|
1217
1217
|
if (typeof t == "string") {
|
|
1218
1218
|
if (t.startsWith("var(--"))
|
|
1219
|
-
return
|
|
1219
|
+
return D({
|
|
1220
1220
|
type: "solid",
|
|
1221
1221
|
angle: 0,
|
|
1222
1222
|
stops: [{ color: t, position: 0, opacity: 100 }]
|
|
1223
1223
|
});
|
|
1224
1224
|
const i = V(t);
|
|
1225
1225
|
if (i)
|
|
1226
|
-
return
|
|
1226
|
+
return D(i);
|
|
1227
1227
|
}
|
|
1228
|
-
return
|
|
1228
|
+
return D(t && typeof t == "object" ? t : {
|
|
1229
1229
|
type: "linear",
|
|
1230
1230
|
angle: 90,
|
|
1231
1231
|
stops: [
|
|
@@ -1236,11 +1236,11 @@ const P = class P extends w {
|
|
|
1236
1236
|
}
|
|
1237
1237
|
setValue(t) {
|
|
1238
1238
|
let e = null;
|
|
1239
|
-
typeof t == "string" ? t.startsWith("var(--") ? e =
|
|
1239
|
+
typeof t == "string" ? t.startsWith("var(--") ? e = D({
|
|
1240
1240
|
type: "solid",
|
|
1241
1241
|
angle: 0,
|
|
1242
1242
|
stops: [{ color: t, position: 0, opacity: 100 }]
|
|
1243
|
-
}) : e = V(t) : t && typeof t == "object" && (e =
|
|
1243
|
+
}) : e = V(t) : t && typeof t == "object" && (e = D(t)), e || (e = this.defaultValue()), this.value = e, this.setLinkedGlobalVariableFrom(t ?? e), this.updateUI(), this.isPopoverOpen && this.refreshPopoverContent(), this.triggerChange(), this.pendingSolidColor = null, this.updateUnlinkButtonVisibility();
|
|
1244
1244
|
}
|
|
1245
1245
|
updateUI() {
|
|
1246
1246
|
if (this.previewEl && this.value)
|
|
@@ -3839,12 +3839,12 @@ function Be(c) {
|
|
|
3839
3839
|
}
|
|
3840
3840
|
const e = document.createElement("div");
|
|
3841
3841
|
e.className = "upload-section";
|
|
3842
|
-
const i =
|
|
3842
|
+
const i = Ae(c);
|
|
3843
3843
|
e.appendChild(i), t.appendChild(e);
|
|
3844
3844
|
}
|
|
3845
3845
|
return t;
|
|
3846
3846
|
}
|
|
3847
|
-
function
|
|
3847
|
+
function Ae(c) {
|
|
3848
3848
|
if (c.uploadMethod === "input") {
|
|
3849
3849
|
const t = document.createElement("label");
|
|
3850
3850
|
t.className = "upload-label", t.innerHTML = `<div class="upload-placeholder">${st}<span>Click to upload image</span></div>`;
|
|
@@ -3867,7 +3867,7 @@ function De(c) {
|
|
|
3867
3867
|
}), t;
|
|
3868
3868
|
}
|
|
3869
3869
|
}
|
|
3870
|
-
function
|
|
3870
|
+
function De() {
|
|
3871
3871
|
const c = document.createElement("img");
|
|
3872
3872
|
c.className = "image-map-thumbnail-main";
|
|
3873
3873
|
const t = document.createElement("span");
|
|
@@ -3993,7 +3993,7 @@ function We(c, t, e) {
|
|
|
3993
3993
|
}
|
|
3994
3994
|
const je = `<svg xmlns="http://www.w3.org/2000/svg" width="8" height="4" viewBox="0 0 8 4" fill="none">
|
|
3995
3995
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M0 0L2.58579 2.58579C3.36684 3.36684 4.63317 3.36683 5.41421 2.58579L8 0L0 0Z" fill="#FF5630"/>
|
|
3996
|
-
</svg>`,
|
|
3996
|
+
</svg>`, A = class A extends w {
|
|
3997
3997
|
constructor(t = {}) {
|
|
3998
3998
|
var e;
|
|
3999
3999
|
super(t), this.inputType = {
|
|
@@ -4032,7 +4032,7 @@ const je = `<svg xmlns="http://www.w3.org/2000/svg" width="8" height="4" viewBox
|
|
|
4032
4032
|
const i = document.createElement("div");
|
|
4033
4033
|
i.className = "image-map-section";
|
|
4034
4034
|
const s = document.createElement("h4");
|
|
4035
|
-
s.className = "image-map-section-title", s.textContent = "Upload/Replace Map Image", i.appendChild(s), this.mainDisplayElements =
|
|
4035
|
+
s.className = "image-map-section-title", s.textContent = "Upload/Replace Map Image", i.appendChild(s), this.mainDisplayElements = De();
|
|
4036
4036
|
const n = Re(
|
|
4037
4037
|
this.mainDisplayElements.thumbnailEl,
|
|
4038
4038
|
() => {
|
|
@@ -4061,7 +4061,7 @@ const je = `<svg xmlns="http://www.w3.org/2000/svg" width="8" height="4" viewBox
|
|
|
4061
4061
|
);
|
|
4062
4062
|
}
|
|
4063
4063
|
openPopover() {
|
|
4064
|
-
|
|
4064
|
+
A.openInstance && A.openInstance !== this && A.openInstance.closePopover(), this.isPopoverOpen = !0, A.openInstance = this, this.value ? this.initialValue = JSON.parse(
|
|
4065
4065
|
JSON.stringify(this.value)
|
|
4066
4066
|
) : this.initialValue = { imageUrl: "", markers: [] }, this.value && this.historyManager.initialize(this.value.markers), this.popoverElements && (this.popoverElements.backdrop.style.display = "block", this.popoverElements.popover.style.display = "flex"), this.positionPopoverElement(), this.refreshPopoverContentAndScrollToBottom(), setTimeout(() => {
|
|
4067
4067
|
document.addEventListener("click", this.onBackgroundClick, !0);
|
|
@@ -4087,7 +4087,7 @@ const je = `<svg xmlns="http://www.w3.org/2000/svg" width="8" height="4" viewBox
|
|
|
4087
4087
|
JSON.stringify(this.initialValue)
|
|
4088
4088
|
), this.mainDisplayElements && O(this.mainDisplayElements, this.value), this.triggerChange());
|
|
4089
4089
|
}
|
|
4090
|
-
this.isPopoverOpen = !1, this.draggingMarkerId = null, this.clearErrorTooltip(), this.popoverElements && (this.popoverElements.backdrop.style.display = "none", this.popoverElements.popover.style.display = "none"), document.removeEventListener("click", this.onBackgroundClick, !0), document.removeEventListener("keydown", this.handlePopoverKeydown, !0),
|
|
4090
|
+
this.isPopoverOpen = !1, this.draggingMarkerId = null, this.clearErrorTooltip(), this.popoverElements && (this.popoverElements.backdrop.style.display = "none", this.popoverElements.popover.style.display = "none"), document.removeEventListener("click", this.onBackgroundClick, !0), document.removeEventListener("keydown", this.handlePopoverKeydown, !0), A.openInstance === this && (A.openInstance = null);
|
|
4091
4091
|
}
|
|
4092
4092
|
}
|
|
4093
4093
|
positionPopoverElement() {
|
|
@@ -4398,8 +4398,8 @@ const je = `<svg xmlns="http://www.w3.org/2000/svg" width="8" height="4" viewBox
|
|
|
4398
4398
|
)), document.removeEventListener("click", this.onBackgroundClick, !0), document.removeEventListener("keydown", this.handlePopoverKeydown, !0), Lt.unregisterHandler(this.id), this.confirmModal.cleanup();
|
|
4399
4399
|
}
|
|
4400
4400
|
};
|
|
4401
|
-
|
|
4402
|
-
let kt =
|
|
4401
|
+
A.openInstance = null;
|
|
4402
|
+
let kt = A;
|
|
4403
4403
|
class _e extends B {
|
|
4404
4404
|
constructor(t = {}) {
|
|
4405
4405
|
super({
|
|
@@ -4743,13 +4743,24 @@ class Ci extends B {
|
|
|
4743
4743
|
}
|
|
4744
4744
|
class yi extends w {
|
|
4745
4745
|
constructor(t) {
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4746
|
+
var r;
|
|
4747
|
+
super(t), this.inputType = {}, this.container = null, this.defaultLanguage = "", this.uploadSettings = /* @__PURE__ */ new Map(), this.popup = null;
|
|
4748
|
+
const e = window;
|
|
4749
|
+
e.textElementListeners || (e.textElementListeners = /* @__PURE__ */ new Map()), t.default ? this.value = t.default : this.value || (this.value = {});
|
|
4750
|
+
const i = (r = this.value) == null ? void 0 : r.$id, s = window.textElementListeners;
|
|
4751
|
+
if (i && !s.has(i)) {
|
|
4752
|
+
const h = (d) => {
|
|
4753
|
+
const { type: p, data: u } = d.data || {};
|
|
4754
|
+
p === "TEXT_ELEMENT_CLICKED" && (u == null ? void 0 : u.$id) === i && this.showPopup();
|
|
4755
|
+
};
|
|
4756
|
+
window.addEventListener("message", h), s.set(i, h);
|
|
4757
|
+
}
|
|
4758
|
+
const n = w.HasExplicitCurrentLanguage(), o = n ? w.CurrentLanguage() : "", a = w.DefaultLanguage;
|
|
4759
|
+
this.defaultLanguage = n && o && t.languages.includes(o) ? o : a && t.languages.includes(a) ? a : t.languages[0];
|
|
4760
|
+
const l = t.defaultValue || `Enter text in ${this.capitalizeFirstLetter(this.defaultLanguage)}`;
|
|
4761
|
+
t.languages.forEach((h) => {
|
|
4762
|
+
var d, p;
|
|
4763
|
+
h in (this.value || {}) || (this.value || (this.value = {}), h === this.defaultLanguage && l ? this.value[h] = ((d = t.default) == null ? void 0 : d[h]) || l : this.value[h] = ((p = t.default) == null ? void 0 : p[h]) || "");
|
|
4753
4764
|
});
|
|
4754
4765
|
}
|
|
4755
4766
|
capitalizeFirstLetter(t) {
|
|
@@ -4943,11 +4954,6 @@ class yi extends w {
|
|
|
4943
4954
|
this.popup && (document.body.removeChild(this.popup), this.popup = null);
|
|
4944
4955
|
}
|
|
4945
4956
|
draw() {
|
|
4946
|
-
if (window.testDraws = window.testDraws || [], window.testDraws.filter((l) => l == this.value.$id).length) {
|
|
4947
|
-
console.log("opaaaaaaaaaaaaa");
|
|
4948
|
-
debugger;
|
|
4949
|
-
}
|
|
4950
|
-
window.testDraws.push(this.value.$id);
|
|
4951
4957
|
const t = document.createElement("div");
|
|
4952
4958
|
t.classList.add("simple-multi-language-wrapper");
|
|
4953
4959
|
const e = document.createElement("div");
|
|
@@ -4978,29 +4984,23 @@ class yi extends w {
|
|
|
4978
4984
|
s.style.color = "#000";
|
|
4979
4985
|
}), s.addEventListener("mouseleave", () => {
|
|
4980
4986
|
s.style.color = "#666";
|
|
4981
|
-
}), s.addEventListener("click", (
|
|
4982
|
-
|
|
4983
|
-
});
|
|
4984
|
-
const n = (
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
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());
|
|
4988
|
-
};
|
|
4989
|
-
window.addEventListener("message", n), e.appendChild(i), e.appendChild(s), t.appendChild(e);
|
|
4990
|
-
const o = document.createElement("div");
|
|
4991
|
-
o.classList.add("simple-multi-language-content"), t.appendChild(o), this.container = t, this.renderContent(t), this.languageChangeUnsubscribe = w.onLanguageChange((l) => {
|
|
4992
|
-
l && this.props.languages.includes(l) && (this.defaultLanguage = l), this.container && this.renderContent(this.container);
|
|
4987
|
+
}), s.addEventListener("click", (a) => {
|
|
4988
|
+
a.preventDefault(), this.showPopup();
|
|
4989
|
+
}), e.appendChild(i), e.appendChild(s), t.appendChild(e);
|
|
4990
|
+
const n = document.createElement("div");
|
|
4991
|
+
n.classList.add("simple-multi-language-content"), t.appendChild(n), this.container = t, this.renderContent(t), this.languageChangeUnsubscribe = w.onLanguageChange((a) => {
|
|
4992
|
+
a && this.props.languages.includes(a) && (this.defaultLanguage = a), this.container && this.renderContent(this.container);
|
|
4993
4993
|
});
|
|
4994
|
-
const
|
|
4994
|
+
const o = () => {
|
|
4995
4995
|
if (!this.container) return;
|
|
4996
4996
|
this.container.querySelectorAll(
|
|
4997
4997
|
".simple-language-textarea"
|
|
4998
|
-
).forEach((
|
|
4999
|
-
const
|
|
5000
|
-
|
|
4998
|
+
).forEach((l) => {
|
|
4999
|
+
const r = l.getAttribute("data-full-placeholder") || "";
|
|
5000
|
+
r && this.adaptPlaceholderToSingleLine(l, r);
|
|
5001
5001
|
});
|
|
5002
5002
|
};
|
|
5003
|
-
return window.addEventListener("resize",
|
|
5003
|
+
return window.addEventListener("resize", o), t;
|
|
5004
5004
|
}
|
|
5005
5005
|
setValue(t) {
|
|
5006
5006
|
super.setValue(t), console.log("incoming multilanguage value---------", t), this.value.$id = t.$id, this.container && this.props.languages.forEach((e) => {
|
package/package.json
CHANGED