@useinsider/guido 3.0.0-beta.7d3a300 → 3.0.0-beta.952fc1f

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.
Files changed (58) hide show
  1. package/dist/config/i18n/en/tooltips.json.js +1 -2
  2. package/dist/extensions/Blocks/Recommendation/block.js +56 -38
  3. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  4. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +36 -34
  5. package/dist/extensions/Blocks/Recommendation/controls/cardBackground/index.js +4 -4
  6. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +15 -15
  7. package/dist/extensions/Blocks/Recommendation/controls/main/currency.js +24 -24
  8. package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +2 -2
  9. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +107 -78
  10. package/dist/extensions/Blocks/Recommendation/controls/{layout/index.js → main/layoutOrientation.js} +35 -27
  11. package/dist/extensions/Blocks/Recommendation/controls/main/locale.js +2 -2
  12. package/dist/extensions/Blocks/Recommendation/controls/main/productCount.js +58 -0
  13. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +150 -64
  14. package/dist/extensions/Blocks/Recommendation/controls/main/shuffle.js +2 -2
  15. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +198 -204
  16. package/dist/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.js +25 -8
  17. package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +6 -5
  18. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.js +8 -8
  19. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.js +21 -21
  20. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.js +13 -13
  21. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.js +17 -17
  22. package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +134 -142
  23. package/dist/extensions/Blocks/Recommendation/controls/syncInfoMessage.js +65 -0
  24. package/dist/extensions/Blocks/Recommendation/extension.js +13 -13
  25. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +35 -0
  26. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +21 -15
  27. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +1 -0
  28. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +27 -27
  29. package/dist/extensions/Blocks/Recommendation/utils/tagName.js +6 -6
  30. package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +17 -16
  31. package/dist/extensions/Blocks/common-control.js +90 -41
  32. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +218 -324
  33. package/dist/package.json.js +1 -1
  34. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +2 -1
  35. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +2 -2
  36. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +5 -1
  37. package/dist/src/extensions/Blocks/Recommendation/controls/{layout/index.d.ts → main/layoutOrientation.d.ts} +3 -3
  38. package/dist/src/extensions/Blocks/Recommendation/controls/main/productCount.d.ts +28 -0
  39. package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +38 -20
  40. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +4 -2
  41. package/dist/src/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.d.ts +23 -1
  42. package/dist/src/extensions/Blocks/Recommendation/controls/spacing/index.d.ts +8 -18
  43. package/dist/src/extensions/Blocks/Recommendation/controls/syncInfoMessage.d.ts +34 -0
  44. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -0
  45. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +13 -0
  46. package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +3 -3
  47. package/dist/src/extensions/Blocks/common-control.d.ts +24 -2
  48. package/dist/static/styles/components/button.css.js +7 -13
  49. package/dist/static/styles/components/narrow-panel.css.js +0 -52
  50. package/dist/static/styles/components/wide-panel.css.js +1 -0
  51. package/dist/static/styles/customEditorStyle.css.js +9 -0
  52. package/package.json +3 -3
  53. package/dist/src/extensions/Blocks/Recommendation/controls/cardBackgroundColorControl.d.ts +0 -25
  54. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscountTextAfterControl.d.ts +0 -15
  55. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscountTextBeforeControl.d.ts +0 -15
  56. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPriceTextAfterControl.d.ts +0 -15
  57. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPriceTextBeforeControl.d.ts +0 -15
  58. package/dist/src/extensions/Blocks/Recommendation/controls/spacingControl.d.ts +0 -60
@@ -1,20 +1,21 @@
1
1
  import { ModificationDescription as a } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { CommonControl as c } from "../../../common-control.js";
2
+ import { CommonControl as d } from "../../../common-control.js";
3
3
  import { RecommendationBlockId as l } from "../../constants/blockIds.js";
4
4
  import { RecommendationControlId as m } from "../../constants/controlIds.js";
5
5
  import { BLOCK_ROOT_SELECTOR as u } from "../../constants/selectors.js";
6
6
  const i = {
7
7
  TEXT_TRIM_ENABLED: "textTrimEnabled"
8
- }, o = "text-trim-enabled", d = `.${o}`, T = `.${o} p`, _ = `.${o} { max-width: 0; }`, f = `.${o} p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; display: block; }`;
9
- class N extends c {
8
+ }, o = "text-trim-enabled", c = `.${o}`, T = `.${o} p`, p = `.${o} { max-width: 0; }`, _ = `.${o} p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; display: block; }`;
9
+ class N extends d {
10
10
  getId() {
11
11
  return m.NAME_TEXT_TRIM;
12
12
  }
13
13
  getTemplate() {
14
14
  return `
15
+ <hr style="margin: 0; border: none; border-top: 1px solid #e0e0e0;" />
15
16
  <div class="name-text-trim-control-container">
16
17
  ${this._GuTwoColumns([
17
- this._GuLabel({ text: "Trim Long Text" }),
18
+ this._GuLabel({ text: this.api.translate("Trim Long Text") }),
18
19
  this._GuToggle(i.TEXT_TRIM_ENABLED)
19
20
  ])}
20
21
  </div>
@@ -74,7 +75,7 @@ class N extends c {
74
75
  return;
75
76
  const t = this.api.getDocumentModifier();
76
77
  let s = !1;
77
- this._findCssRule(d) || (t.modifyCss(e).appendRule(_), s = !0), this._hasParagraphRule() || (t.modifyCss(e).appendRule(f), s = !0), s && t.apply(new a("Add text trim CSS rules"));
78
+ this._findCssRule(c) || (t.modifyCss(e).appendRule(p), s = !0), this._hasParagraphRule() || (t.modifyCss(e).appendRule(_), s = !0), s && t.apply(new a("Add text trim CSS rules"));
78
79
  }
79
80
  _onTextTrimChange(e) {
80
81
  if (!this.currentNode || !("closest" in this.currentNode))
@@ -1,11 +1,11 @@
1
- import { ModificationDescription as c } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { CommonControl as a } from "../../../common-control.js";
1
+ import { ModificationDescription as m } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { CommonControl as c } from "../../../common-control.js";
3
3
  import { RecommendationBlockId as l } from "../../constants/blockIds.js";
4
4
  import { RecommendationControlId as d } from "../../constants/controlIds.js";
5
5
  import { BLOCK_ROOT_SELECTOR as T } from "../../constants/selectors.js";
6
6
  import { preserveTextStyles as f } from "../../utils/preserveTextStyles.js";
7
7
  const i = "data-text-after", u = "", p = ".omnibus-text-after";
8
- class g extends a {
8
+ class g extends c {
9
9
  getId() {
10
10
  return d.OMNIBUS_DISCOUNT_TEXT_AFTER;
11
11
  }
@@ -13,10 +13,10 @@ class g extends a {
13
13
  return `
14
14
  <div class="omnibus-discount-text-after-control-container">
15
15
  ${this._GuTwoColumns([
16
- this._GuLabel({ text: "Text After" }),
16
+ this._GuLabel({ text: this.api.translate("Text After") }),
17
17
  this._GuTextInput({
18
18
  name: "omnibusDiscountTextAfter",
19
- placeholder: "e.g., off!",
19
+ placeholder: this.api.translate("e.g., off!"),
20
20
  className: "es-180w"
21
21
  })
22
22
  ])}
@@ -57,10 +57,10 @@ class g extends a {
57
57
  o.modifyHtml(s).setAttribute(i, t);
58
58
  const r = s.querySelector(p);
59
59
  if (r) {
60
- const m = f(r, t);
61
- o.modifyHtml(r).setInnerHtml(m);
60
+ const a = f(r, t);
61
+ o.modifyHtml(r).setInnerHtml(a);
62
62
  }
63
- }), o.apply(new c("Update omnibus discount text after"));
63
+ }), o.apply(new m("Update omnibus discount text after"));
64
64
  }
65
65
  _listenToFormUpdates() {
66
66
  this.api.onValueChanged("omnibusDiscountTextAfter", (t) => {
@@ -1,11 +1,11 @@
1
- import { ModificationDescription as c } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { CommonControl as l } from "../../../common-control.js";
3
- import { RecommendationBlockId as a } from "../../constants/blockIds.js";
1
+ import { ModificationDescription as a } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { CommonControl as c } from "../../../common-control.js";
3
+ import { RecommendationBlockId as l } from "../../constants/blockIds.js";
4
4
  import { RecommendationControlId as d } from "../../constants/controlIds.js";
5
5
  import { BLOCK_ROOT_SELECTOR as T } from "../../constants/selectors.js";
6
6
  import { preserveTextStyles as f } from "../../utils/preserveTextStyles.js";
7
7
  const i = "data-text-before", u = "", p = ".omnibus-text-before";
8
- class g extends l {
8
+ class g extends c {
9
9
  getId() {
10
10
  return d.OMNIBUS_DISCOUNT_TEXT_BEFORE;
11
11
  }
@@ -13,10 +13,10 @@ class g extends l {
13
13
  return `
14
14
  <div class="omnibus-discount-text-before-control-container">
15
15
  ${this._GuTwoColumns([
16
- this._GuLabel({ text: "Text Before" }),
16
+ this._GuLabel({ text: this.api.translate("Text Before") }),
17
17
  this._GuTextInput({
18
18
  name: "omnibusDiscountTextBefore",
19
- placeholder: "e.g., Save ",
19
+ placeholder: this.api.translate("e.g., Save "),
20
20
  className: "es-180w"
21
21
  })
22
22
  ])}
@@ -26,45 +26,45 @@ class g extends l {
26
26
  onRender() {
27
27
  this._setFormValues(), this._listenToFormUpdates();
28
28
  }
29
- onTemplateNodeUpdated(e) {
30
- super.onTemplateNodeUpdated(e), this._setFormValues();
29
+ onTemplateNodeUpdated(t) {
30
+ super.onTemplateNodeUpdated(t), this._setFormValues();
31
31
  }
32
32
  _setFormValues() {
33
- const e = this._getCurrentText();
33
+ const t = this._getCurrentText();
34
34
  this.api.updateValues({
35
- omnibusDiscountTextBefore: e
35
+ omnibusDiscountTextBefore: t
36
36
  });
37
37
  }
38
38
  _getCurrentText() {
39
39
  if (!this.currentNode || !("getAttribute" in this.currentNode))
40
40
  return u;
41
- const e = this.currentNode.getAttribute(i);
42
- return e === null ? u : e;
41
+ const t = this.currentNode.getAttribute(i);
42
+ return t === null ? u : t;
43
43
  }
44
- _onTextChange(e) {
44
+ _onTextChange(t) {
45
45
  if (!this.currentNode || !("closest" in this.currentNode))
46
46
  return;
47
- const t = this.currentNode.closest(T);
48
- if (!t || !("querySelectorAll" in t))
47
+ const e = this.currentNode.closest(T);
48
+ if (!e || !("querySelectorAll" in e))
49
49
  return;
50
50
  const n = Array.from(
51
- t.querySelectorAll(`[esd-extension-block-id="${a.OMNIBUS_DISCOUNT}"]`)
51
+ e.querySelectorAll(`[esd-extension-block-id="${l.OMNIBUS_DISCOUNT}"]`)
52
52
  );
53
53
  if (!n.length)
54
54
  return;
55
55
  const o = this.api.getDocumentModifier();
56
56
  n.forEach((s) => {
57
- o.modifyHtml(s).setAttribute(i, e);
57
+ o.modifyHtml(s).setAttribute(i, t);
58
58
  const r = s.querySelector(p);
59
59
  if (r) {
60
- const m = f(r, e);
60
+ const m = f(r, t);
61
61
  o.modifyHtml(r).setInnerHtml(m);
62
62
  }
63
- }), o.apply(new c("Update omnibus discount text before"));
63
+ }), o.apply(new a("Update omnibus discount text before"));
64
64
  }
65
65
  _listenToFormUpdates() {
66
- this.api.onValueChanged("omnibusDiscountTextBefore", (e) => {
67
- typeof e == "string" && this._onTextChange(e);
66
+ this.api.onValueChanged("omnibusDiscountTextBefore", (t) => {
67
+ typeof t == "string" && this._onTextChange(t);
68
68
  });
69
69
  }
70
70
  }
@@ -1,11 +1,11 @@
1
- import { ModificationDescription as c } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { CommonControl as a } from "../../../common-control.js";
1
+ import { ModificationDescription as u } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { CommonControl as c } from "../../../common-control.js";
3
3
  import { RecommendationBlockId as l } from "../../constants/blockIds.js";
4
4
  import { RecommendationControlId as d } from "../../constants/controlIds.js";
5
5
  import { BLOCK_ROOT_SELECTOR as T } from "../../constants/selectors.js";
6
- import { preserveTextStyles as f } from "../../utils/preserveTextStyles.js";
7
- const s = "data-text-after", m = "", p = ".omnibus-text-after";
8
- class g extends a {
6
+ import { preserveTextStyles as p } from "../../utils/preserveTextStyles.js";
7
+ const s = "data-text-after", a = "", f = ".omnibus-text-after";
8
+ class g extends c {
9
9
  getId() {
10
10
  return d.OMNIBUS_PRICE_TEXT_AFTER;
11
11
  }
@@ -13,10 +13,10 @@ class g extends a {
13
13
  return `
14
14
  <div class="omnibus-price-text-after-control-container">
15
15
  ${this._GuTwoColumns([
16
- this._GuLabel({ text: "Text After" }),
16
+ this._GuLabel({ text: this.api.translate("Text After") }),
17
17
  this._GuTextInput({
18
18
  name: "omnibusPriceTextAfter",
19
- placeholder: "e.g., (incl. VAT)",
19
+ placeholder: this.api.translate("e.g., (incl. VAT)"),
20
20
  className: "es-180w"
21
21
  })
22
22
  ])}
@@ -37,9 +37,9 @@ class g extends a {
37
37
  }
38
38
  _getCurrentText() {
39
39
  if (!this.currentNode || !("getAttribute" in this.currentNode))
40
- return m;
40
+ return a;
41
41
  const t = this.currentNode.getAttribute(s);
42
- return t === null ? m : t;
42
+ return t === null ? a : t;
43
43
  }
44
44
  _onTextChange(t) {
45
45
  if (!this.currentNode || !("closest" in this.currentNode))
@@ -55,12 +55,12 @@ class g extends a {
55
55
  const r = this.api.getDocumentModifier();
56
56
  n.forEach((i) => {
57
57
  r.modifyHtml(i).setAttribute(s, t);
58
- const o = i.querySelector(p);
58
+ const o = i.querySelector(f);
59
59
  if (o) {
60
- const u = f(o, t);
61
- r.modifyHtml(o).setInnerHtml(u);
60
+ const m = p(o, t);
61
+ r.modifyHtml(o).setInnerHtml(m);
62
62
  }
63
- }), r.apply(new c("Update omnibus price text after"));
63
+ }), r.apply(new u("Update omnibus price text after"));
64
64
  }
65
65
  _listenToFormUpdates() {
66
66
  this.api.onValueChanged("omnibusPriceTextAfter", (t) => {
@@ -1,11 +1,11 @@
1
- import { ModificationDescription as c } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { CommonControl as l } from "../../../common-control.js";
3
- import { RecommendationBlockId as a } from "../../constants/blockIds.js";
1
+ import { ModificationDescription as u } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { CommonControl as c } from "../../../common-control.js";
3
+ import { RecommendationBlockId as l } from "../../constants/blockIds.js";
4
4
  import { RecommendationControlId as d } from "../../constants/controlIds.js";
5
- import { BLOCK_ROOT_SELECTOR as T } from "../../constants/selectors.js";
6
- import { preserveTextStyles as f } from "../../utils/preserveTextStyles.js";
7
- const s = "data-text-before", m = "", p = ".omnibus-text-before";
8
- class g extends l {
5
+ import { BLOCK_ROOT_SELECTOR as p } from "../../constants/selectors.js";
6
+ import { preserveTextStyles as T } from "../../utils/preserveTextStyles.js";
7
+ const s = "data-text-before", a = "", f = ".omnibus-text-before";
8
+ class g extends c {
9
9
  getId() {
10
10
  return d.OMNIBUS_PRICE_TEXT_BEFORE;
11
11
  }
@@ -13,10 +13,10 @@ class g extends l {
13
13
  return `
14
14
  <div class="omnibus-price-text-before-control-container">
15
15
  ${this._GuTwoColumns([
16
- this._GuLabel({ text: "Text Before" }),
16
+ this._GuLabel({ text: this.api.translate("Text Before") }),
17
17
  this._GuTextInput({
18
18
  name: "omnibusPriceTextBefore",
19
- placeholder: "e.g., Lowest 30-day price: ",
19
+ placeholder: this.api.translate("e.g., Lowest 30-day price: "),
20
20
  className: "es-180w"
21
21
  })
22
22
  ])}
@@ -37,30 +37,30 @@ class g extends l {
37
37
  }
38
38
  _getCurrentText() {
39
39
  if (!this.currentNode || !("getAttribute" in this.currentNode))
40
- return m;
40
+ return a;
41
41
  const e = this.currentNode.getAttribute(s);
42
- return e === null ? m : e;
42
+ return e === null ? a : e;
43
43
  }
44
44
  _onTextChange(e) {
45
45
  if (!this.currentNode || !("closest" in this.currentNode))
46
46
  return;
47
- const t = this.currentNode.closest(T);
47
+ const t = this.currentNode.closest(p);
48
48
  if (!t || !("querySelectorAll" in t))
49
49
  return;
50
50
  const n = Array.from(
51
- t.querySelectorAll(`[esd-extension-block-id="${a.OMNIBUS_PRICE}"]`)
51
+ t.querySelectorAll(`[esd-extension-block-id="${l.OMNIBUS_PRICE}"]`)
52
52
  );
53
53
  if (!n.length)
54
54
  return;
55
55
  const o = this.api.getDocumentModifier();
56
56
  n.forEach((i) => {
57
57
  o.modifyHtml(i).setAttribute(s, e);
58
- const r = i.querySelector(p);
58
+ const r = i.querySelector(f);
59
59
  if (r) {
60
- const u = f(r, e);
61
- o.modifyHtml(r).setInnerHtml(u);
60
+ const m = T(r, e);
61
+ o.modifyHtml(r).setInnerHtml(m);
62
62
  }
63
- }), o.apply(new c("Update omnibus price text before"));
63
+ }), o.apply(new u("Update omnibus price text before"));
64
64
  }
65
65
  _listenToFormUpdates() {
66
66
  this.api.onValueChanged("omnibusPriceTextBefore", (e) => {