builder-settings-types 0.0.419 → 0.0.420

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.
@@ -27418,7 +27418,7 @@ const si = class si {
27418
27418
  draw() {
27419
27419
  var c;
27420
27420
  const e = document.createElement("div");
27421
- e.className = "setting-group", e.id = `setting-group-${this.id}`, si.hiddenElements.add(e), this.hide && (e.style.display = "none"), this.isMain && e.classList.add("main-group"), this.custom && e.classList.add("custom_class"), Bn(e, this.nestingLevel);
27421
+ e.className = "setting-group", e.id = `setting-group-${this.id}`, e.setAttribute("data-setting-$id", this.$id), si.hiddenElements.add(e), this.hide && (e.style.display = "none"), this.isMain && e.classList.add("main-group"), this.custom && e.classList.add("custom_class"), Bn(e, this.nestingLevel);
27422
27422
  const r = document.createElement("div");
27423
27423
  r.className = "setting-group-title", this.isCollapsed && r.classList.add("collapsed-view"), r.setAttribute("role", "button"), r.setAttribute(
27424
27424
  "aria-expanded",
@@ -30386,13 +30386,8 @@ const Qt = class Qt extends Ae {
30386
30386
  const { type: i, data: s } = n.data || {};
30387
30387
  i === "TEXT_ELEMENT_CLICKED" && s.$id == this.$id && this.showPopup();
30388
30388
  };
30389
- const r = Qt.messageListeners.get(
30390
- this.instanceId
30391
- );
30392
- r && window.removeEventListener("message", r), Qt.messageListeners.set(
30393
- this.instanceId,
30394
- this.messageHandler
30395
- ), window.addEventListener("message", this.messageHandler), this.defaultLanguage = this.resolveDefaultLanguage();
30389
+ const r = Qt.messageListeners.get(this.instanceId);
30390
+ r && window.removeEventListener("message", r), Qt.messageListeners.set(this.instanceId, this.messageHandler), window.addEventListener("message", this.messageHandler), this.defaultLanguage = this.resolveDefaultLanguage();
30396
30391
  const a = e.multiImg ? e.defaultValue || "" : e.defaultValue || Un(this.defaultLanguage);
30397
30392
  e.languages.forEach((n) => {
30398
30393
  var i, s;
@@ -30404,9 +30399,7 @@ const Qt = class Qt extends Ae {
30404
30399
  }
30405
30400
  findLanguageMatch(e) {
30406
30401
  const r = this.normalizeLanguageCode(e);
30407
- return this.props.languages.find(
30408
- (a) => this.normalizeLanguageCode(a) === r
30409
- );
30402
+ return this.props.languages.find((a) => this.normalizeLanguageCode(a) === r);
30410
30403
  }
30411
30404
  resolveDefaultLanguage() {
30412
30405
  const e = this.findLanguageMatch(Ae.DefaultLanguage), r = Ae.HasExplicitCurrentLanguage() && Ae.CurrentLanguage() ? this.findLanguageMatch(Ae.CurrentLanguage()) : void 0;
@@ -30414,10 +30407,7 @@ const Qt = class Qt extends Ae {
30414
30407
  }
30415
30408
  createTextareaRowForLanguage(e, r = !1) {
30416
30409
  var o;
30417
- const a = ((o = this.value) == null ? void 0 : o[e]) || "", n = Un(
30418
- e,
30419
- this.props.placeholder || Qi
30420
- ), i = this.uploadSettings.get(e);
30410
+ const a = ((o = this.value) == null ? void 0 : o[e]) || "", n = Un(e, this.props.placeholder || Qi), i = this.uploadSettings.get(e);
30421
30411
  if (this.props.multiImg && !i) {
30422
30412
  const l = new ai({
30423
30413
  defaultUrl: a || "",
@@ -30451,22 +30441,15 @@ const Qt = class Qt extends Ae {
30451
30441
  updateOtherLanguagePlaceholders(e) {
30452
30442
  !this.container && !this.popup || this.props.languages.forEach((r) => {
30453
30443
  if (r === this.defaultLanguage) return;
30454
- const a = e || Un(
30455
- r,
30456
- this.props.placeholder || Qi
30457
- );
30444
+ const a = e || Un(r, this.props.placeholder || Qi);
30458
30445
  [this.container, this.popup].forEach((n) => {
30459
- const i = n == null ? void 0 : n.querySelector(
30460
- `#textarea-${r}`
30461
- );
30446
+ const i = n == null ? void 0 : n.querySelector(`#textarea-${r}`);
30462
30447
  i && (!i.value || i.value.trim() === "") && (i.setAttribute("data-full-placeholder", a), Kr(i, a));
30463
30448
  });
30464
30449
  });
30465
30450
  }
30466
30451
  renderContent(e) {
30467
- const r = e.querySelector(
30468
- ".simple-multi-language-content"
30469
- );
30452
+ const r = e.querySelector(".simple-multi-language-content");
30470
30453
  if (!r) return;
30471
30454
  r.innerHTML = "";
30472
30455
  const a = Ae.HasExplicitCurrentLanguage(), n = Ae.CurrentLanguage();
@@ -30478,9 +30461,7 @@ const Qt = class Qt extends Ae {
30478
30461
  else {
30479
30462
  const i = this.createTextareaRowForLanguage(n, !1);
30480
30463
  r.appendChild(i);
30481
- const s = r.querySelector(
30482
- ".simple-language-textarea"
30483
- );
30464
+ const s = r.querySelector(".simple-language-textarea");
30484
30465
  if (s) {
30485
30466
  const o = s.getAttribute("data-full-placeholder") || "";
30486
30467
  o && Kr(s, o);
@@ -30512,9 +30493,7 @@ const Qt = class Qt extends Ae {
30512
30493
  },
30513
30494
  uploadSettings: this.uploadSettings,
30514
30495
  dataTestPath: this.getDataPropsPath()
30515
- }), document.body.appendChild(this.popup), this.updateOtherLanguagePlaceholders(
30516
- ((e = this.value) == null ? void 0 : e[this.defaultLanguage]) || ""
30517
- ));
30496
+ }), document.body.appendChild(this.popup), this.updateOtherLanguagePlaceholders(((e = this.value) == null ? void 0 : e[this.defaultLanguage]) || ""));
30518
30497
  }
30519
30498
  closePopup() {
30520
30499
  this.popup && (document.body.removeChild(this.popup), this.popup = null);
@@ -30532,9 +30511,7 @@ const Qt = class Qt extends Ae {
30532
30511
  this.container && this.renderContent(this.container);
30533
30512
  }), this.resizeHandler = () => {
30534
30513
  if (!this.container) return;
30535
- this.container.querySelectorAll(
30536
- ".simple-language-textarea"
30537
- ).forEach((i) => {
30514
+ this.container.querySelectorAll(".simple-language-textarea").forEach((i) => {
30538
30515
  const s = i.getAttribute("data-full-placeholder") || "";
30539
30516
  s && Kr(i, s);
30540
30517
  });
@@ -30606,10 +30583,7 @@ const Qt = class Qt extends Ae {
30606
30583
  });
30607
30584
  const a = Array.from(r).sort();
30608
30585
  try {
30609
- const n = await x0.importFromExcel(
30610
- e,
30611
- a
30612
- );
30586
+ const n = await x0.importFromExcel(e, a);
30613
30587
  let i = 0;
30614
30588
  n.forEach((s) => {
30615
30589
  const o = s.id.split(" > "), l = o[0] || "";
@@ -30621,10 +30595,7 @@ const Qt = class Qt extends Ae {
30621
30595
  const p = `${l} > ${f}`;
30622
30596
  u = this.instances.get(p);
30623
30597
  }
30624
- u || (u = this.findInstanceByComponentAndTitle(
30625
- l,
30626
- c
30627
- )), u || (u = this.findInstanceByLeaf(f || c)), u ? (u.setValue(s.value), i++) : console.warn(
30598
+ u || (u = this.findInstanceByComponentAndTitle(l, c)), u || (u = this.findInstanceByLeaf(f || c)), u ? (u.setValue(s.value), i++) : console.warn(
30628
30599
  `No matching component found for translation "${l} > ${c}". Ensure the Excel uses the setting title or full component path.`
30629
30600
  );
30630
30601
  }), console.log(`Successfully imported ${i} translations`);
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.419",
4
+ "version": "0.0.420",
5
5
  "type": "module",
6
6
  "main": "dist/builder-settings-types.cjs.js",
7
7
  "module": "dist/builder-settings-types.es.js",