builder-settings-types 0.0.411 → 0.0.412

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.
@@ -30286,13 +30286,8 @@ const Zt = class Zt extends Le {
30286
30286
  const { type: i, data: s } = n.data || {};
30287
30287
  i === "TEXT_ELEMENT_CLICKED" && s.$id == this.$id && this.showPopup();
30288
30288
  };
30289
- const r = Zt.messageListeners.get(
30290
- this.instanceId
30291
- );
30292
- r && window.removeEventListener("message", r), Zt.messageListeners.set(
30293
- this.instanceId,
30294
- this.messageHandler
30295
- ), window.addEventListener("message", this.messageHandler), this.defaultLanguage = this.resolveDefaultLanguage();
30289
+ const r = Zt.messageListeners.get(this.instanceId);
30290
+ r && window.removeEventListener("message", r), Zt.messageListeners.set(this.instanceId, this.messageHandler), window.addEventListener("message", this.messageHandler), this.defaultLanguage = this.resolveDefaultLanguage();
30296
30291
  const a = e.multiImg ? e.defaultValue || "" : e.defaultValue || Hn(this.defaultLanguage);
30297
30292
  e.languages.forEach((n) => {
30298
30293
  var i, s;
@@ -30304,9 +30299,7 @@ const Zt = class Zt extends Le {
30304
30299
  }
30305
30300
  findLanguageMatch(e) {
30306
30301
  const r = this.normalizeLanguageCode(e);
30307
- return this.props.languages.find(
30308
- (a) => this.normalizeLanguageCode(a) === r
30309
- );
30302
+ return this.props.languages.find((a) => this.normalizeLanguageCode(a) === r);
30310
30303
  }
30311
30304
  resolveDefaultLanguage() {
30312
30305
  const e = this.findLanguageMatch(Le.DefaultLanguage), r = Le.HasExplicitCurrentLanguage() && Le.CurrentLanguage() ? this.findLanguageMatch(Le.CurrentLanguage()) : void 0;
@@ -30314,10 +30307,7 @@ const Zt = class Zt extends Le {
30314
30307
  }
30315
30308
  createTextareaRowForLanguage(e, r = !1) {
30316
30309
  var o;
30317
- const a = ((o = this.value) == null ? void 0 : o[e]) || "", n = Hn(
30318
- e,
30319
- this.props.placeholder || Qi
30320
- ), i = this.uploadSettings.get(e);
30310
+ const a = ((o = this.value) == null ? void 0 : o[e]) || "", n = Hn(e, this.props.placeholder || Qi), i = this.uploadSettings.get(e);
30321
30311
  if (this.props.multiImg && !i) {
30322
30312
  const l = new ai({
30323
30313
  defaultUrl: a || "",
@@ -30351,22 +30341,15 @@ const Zt = class Zt extends Le {
30351
30341
  updateOtherLanguagePlaceholders(e) {
30352
30342
  !this.container && !this.popup || this.props.languages.forEach((r) => {
30353
30343
  if (r === this.defaultLanguage) return;
30354
- const a = e || Hn(
30355
- r,
30356
- this.props.placeholder || Qi
30357
- );
30344
+ const a = e || Hn(r, this.props.placeholder || Qi);
30358
30345
  [this.container, this.popup].forEach((n) => {
30359
- const i = n == null ? void 0 : n.querySelector(
30360
- `#textarea-${r}`
30361
- );
30346
+ const i = n == null ? void 0 : n.querySelector(`#textarea-${r}`);
30362
30347
  i && (!i.value || i.value.trim() === "") && (i.setAttribute("data-full-placeholder", a), Kr(i, a));
30363
30348
  });
30364
30349
  });
30365
30350
  }
30366
30351
  renderContent(e) {
30367
- const r = e.querySelector(
30368
- ".simple-multi-language-content"
30369
- );
30352
+ const r = e.querySelector(".simple-multi-language-content");
30370
30353
  if (!r) return;
30371
30354
  r.innerHTML = "";
30372
30355
  const a = Le.HasExplicitCurrentLanguage(), n = Le.CurrentLanguage();
@@ -30378,9 +30361,7 @@ const Zt = class Zt extends Le {
30378
30361
  else {
30379
30362
  const i = this.createTextareaRowForLanguage(n, !1);
30380
30363
  r.appendChild(i);
30381
- const s = r.querySelector(
30382
- ".simple-language-textarea"
30383
- );
30364
+ const s = r.querySelector(".simple-language-textarea");
30384
30365
  if (s) {
30385
30366
  const o = s.getAttribute("data-full-placeholder") || "";
30386
30367
  o && Kr(s, o);
@@ -30412,9 +30393,7 @@ const Zt = class Zt extends Le {
30412
30393
  },
30413
30394
  uploadSettings: this.uploadSettings,
30414
30395
  dataTestPath: this.getDataPropsPath()
30415
- }), document.body.appendChild(this.popup), this.updateOtherLanguagePlaceholders(
30416
- ((e = this.value) == null ? void 0 : e[this.defaultLanguage]) || ""
30417
- ));
30396
+ }), document.body.appendChild(this.popup), this.updateOtherLanguagePlaceholders(((e = this.value) == null ? void 0 : e[this.defaultLanguage]) || ""));
30418
30397
  }
30419
30398
  closePopup() {
30420
30399
  this.popup && (document.body.removeChild(this.popup), this.popup = null);
@@ -30432,9 +30411,7 @@ const Zt = class Zt extends Le {
30432
30411
  this.container && this.renderContent(this.container);
30433
30412
  }), this.resizeHandler = () => {
30434
30413
  if (!this.container) return;
30435
- this.container.querySelectorAll(
30436
- ".simple-language-textarea"
30437
- ).forEach((i) => {
30414
+ this.container.querySelectorAll(".simple-language-textarea").forEach((i) => {
30438
30415
  const s = i.getAttribute("data-full-placeholder") || "";
30439
30416
  s && Kr(i, s);
30440
30417
  });
@@ -30445,11 +30422,17 @@ const Zt = class Zt extends Le {
30445
30422
  var a;
30446
30423
  if (this.props.multiImg) {
30447
30424
  const n = this.uploadSettings.get(r);
30448
- n && n.setValue((e == null ? void 0 : e[r]) || "");
30425
+ if (n) {
30426
+ const i = n.onChange;
30427
+ n.onChange = void 0;
30428
+ try {
30429
+ n.setValue((e == null ? void 0 : e[r]) || "");
30430
+ } finally {
30431
+ n.onChange = i;
30432
+ }
30433
+ }
30449
30434
  } else {
30450
- const n = (a = this.container) == null ? void 0 : a.querySelector(
30451
- `#textarea-${r}`
30452
- );
30435
+ const n = (a = this.container) == null ? void 0 : a.querySelector(`#textarea-${r}`);
30453
30436
  if (n) {
30454
30437
  n.value = (e == null ? void 0 : e[r]) || "", $s(n, 3);
30455
30438
  const i = n.getAttribute("data-full-placeholder") || "";
@@ -30494,10 +30477,7 @@ const Zt = class Zt extends Le {
30494
30477
  });
30495
30478
  const a = Array.from(r).sort();
30496
30479
  try {
30497
- const n = await x0.importFromExcel(
30498
- e,
30499
- a
30500
- );
30480
+ const n = await x0.importFromExcel(e, a);
30501
30481
  let i = 0;
30502
30482
  n.forEach((s) => {
30503
30483
  const o = s.id.split(" > "), l = o[0] || "";
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.411",
4
+ "version": "0.0.412",
5
5
  "type": "module",
6
6
  "main": "dist/builder-settings-types.cjs.js",
7
7
  "module": "dist/builder-settings-types.es.js",