@useinsider/guido 3.17.0-beta.ab974c6 → 3.17.0-beta.bc6e089

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.
@@ -1,30 +1,20 @@
1
- var D = Object.defineProperty;
2
- var S = (m, u, e) => u in m ? D(m, u, { enumerable: !0, configurable: !0, writable: !0, value: e }) : m[u] = e;
3
- var I = (m, u, e) => S(m, typeof u != "symbol" ? u + "" : u, e);
4
- import { BlockId as _ } from "../../../enums/block.js";
5
- import { useOnboardingStore as N } from "../../../stores/onboarding.js";
6
- import { getMigrationBannerHtml as T } from "../../../utils/migrationBannerHtml.js";
7
- import { Block as A, BlockCompositionType as M, ModificationDescription as f } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
8
- import { isCustomCurrencySymbol as R, ITEMS_CURRENCY_ATTR as y, currencyPositionFromLocation as H } from "./constants/currency.js";
9
- import { ItemsBlockId as O } from "./enums/controlEnums.js";
10
- import { SETTINGS_ENUMS as h, DefaultConfigValues as C } from "./enums/settingsEnums.js";
11
- import { getDefaultTemplate as E } from "./template.js";
12
- import { getItemsBlockContainer as b, getItemsBlockConfig as g, deriveItemNumber as B, getDefaultItemsBlockConfig as P } from "./utils/nodeConfigUtils.js";
13
- const k = _.Items, w = "Reconcile Items currency DOM attributes";
14
- class K extends A {
15
- constructor() {
16
- super(...arguments);
17
- /** Block instances whose currency attrs were already self-healed this session (SD-147588 — undo-safe). */
18
- I(this, "_currencyHealed", /* @__PURE__ */ new Set());
19
- }
1
+ import { BlockId as g } from "../../../enums/block.js";
2
+ import { useOnboardingStore as y } from "../../../stores/onboarding.js";
3
+ import { getMigrationBannerHtml as I } from "../../../utils/migrationBannerHtml.js";
4
+ import { Block as C, BlockCompositionType as b, ModificationDescription as c } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
+ import { SETTINGS_ENUMS as l, DefaultConfigValues as d } from "./enums/settingsEnums.js";
6
+ import { getDefaultTemplate as h } from "./template.js";
7
+ import { getItemsBlockContainer as u, getItemsBlockConfig as f, deriveItemNumber as D, getDefaultItemsBlockConfig as N } from "./utils/nodeConfigUtils.js";
8
+ const p = g.Items;
9
+ class E extends C {
20
10
  getId() {
21
- return k;
11
+ return p;
22
12
  }
23
13
  getIcon() {
24
14
  return "items-icon";
25
15
  }
26
16
  getBlockCompositionType() {
27
- return M.CONTAINER;
17
+ return b.CONTAINER;
28
18
  }
29
19
  getName() {
30
20
  return this.api.translate("Items");
@@ -33,20 +23,20 @@ class K extends A {
33
23
  return this.api.translate("Items lets you display personalized products based on user behavior.");
34
24
  }
35
25
  getSettingsPanelTitleHtml() {
36
- return T(
37
- k,
26
+ return I(
27
+ p,
38
28
  this.api.translate("Items"),
39
29
  this.api.translate("This block is switched from the Old Version to the New Version. We recommend you check the Items block and test your message to ensure it works properly.")
40
30
  );
41
31
  }
42
32
  getTemplate() {
43
- return E({
44
- orientation: h.ORIENTATION.VERTICAL,
45
- itemsType: h.ITEMS_TYPE.CART_ITEMS,
33
+ return h({
34
+ orientation: l.ORIENTATION.VERTICAL,
35
+ itemsType: l.ITEMS_TYPE.CART_ITEMS,
46
36
  itemId: "{{Abandoned Cart Item (1) Url}}",
47
- currencySymbol: C.productPriceCurrencySymbolControlValue,
48
- currencyLocation: C.productPriceCurrencyLocationControlValue,
49
- formattedPrice: C.productPriceFormattedControlValue === "1"
37
+ currencySymbol: d.productPriceCurrencySymbolControlValue,
38
+ currencyLocation: d.productPriceCurrencyLocationControlValue,
39
+ formattedPrice: d.productPriceFormattedControlValue === "1"
50
40
  });
51
41
  }
52
42
  allowInnerBlocksDND() {
@@ -55,27 +45,24 @@ class K extends A {
55
45
  canBeSavedAsModule() {
56
46
  return !0;
57
47
  }
58
- onCreated(e) {
59
- const r = this.api.getDocumentModifier(), s = this.api.getDocumentRootCssNode();
60
- s.querySelector('[product-attr="imageSrc"] img') || r.modifyCss(s).appendRule('[product-attr="imageSrc"] img {object-fit: contain;}');
61
- const o = b(e);
62
- if (!o)
48
+ onCreated(n) {
49
+ const t = this.api.getDocumentModifier(), a = this.api.getDocumentRootCssNode();
50
+ a.querySelector('[product-attr="imageSrc"] img') || t.modifyCss(a).appendRule('[product-attr="imageSrc"] img {object-fit: contain;}');
51
+ const e = u(n);
52
+ if (!e)
63
53
  return;
64
- const i = o.getNodeConfig(), n = i && Object.keys(i).length > 0, t = g(e);
65
- if (t != null && t.initialized) {
66
- if (!n) {
67
- const c = this.api.getDocumentModifier();
68
- c.modifyHtml(o).setNodeConfig(t), this._stampProductTdDomAttributes(o, t, c), this._shouldReconcileCurrency(t) && this._reconcileCurrencyDomAttributes(o, t, c), c.apply(new f("Migrate legacy config to nodeConfig")), this._markCurrencyHealed(t.blockInstanceId);
69
- return;
54
+ const o = e.getNodeConfig(), r = o && Object.keys(o).length > 0, i = f(n);
55
+ if (i != null && i.initialized)
56
+ if (r)
57
+ i.blockInstanceId || this.api.getDocumentModifier().modifyHtml(e).setNodeConfig({ ...i, blockInstanceId: String(Date.now()) }).apply(new c("Assign block instance ID to block"));
58
+ else {
59
+ const s = this.api.getDocumentModifier();
60
+ s.modifyHtml(e).setNodeConfig(i), this._stampProductTdDomAttributes(e, i, s), s.apply(new c("Migrate legacy config to nodeConfig"));
70
61
  }
71
- } else {
72
- const c = P(), p = this.api.getDocumentModifier();
73
- p.modifyHtml(o).setNodeConfig(c), this._stampProductTdDomAttributes(o, c, p, !0), p.apply(new f("Initialize Items block with default configuration")), N().startOnboarding("itemsOnboarding");
74
- return;
62
+ else {
63
+ const s = N(), m = this.api.getDocumentModifier();
64
+ m.modifyHtml(e).setNodeConfig(s), this._stampProductTdDomAttributes(e, s, m, !0), m.apply(new c("Initialize Items block with default configuration")), y().startOnboarding("itemsOnboarding");
75
65
  }
76
- const a = t.blockInstanceId || String(Date.now()), d = this.api.getDocumentModifier();
77
- let l = !1;
78
- t.blockInstanceId || (d.modifyHtml(o).setNodeConfig({ ...t, blockInstanceId: a }), l = !0), this._shouldReconcileCurrency(t) && this._reconcileCurrencyDomAttributes(o, t, d) && (l = !0), l && d.apply(new f("Assign Items block instance ID and reconcile currency")), this._markCurrencyHealed(a);
79
66
  }
80
67
  /**
81
68
  * Re-seeds nodeConfig from the persisted esd-ext-config when a saved module
@@ -83,24 +70,18 @@ class K extends A {
83
70
  * into nodeConfig, so without this a reused module would reset to defaults.
84
71
  * Guarded to the nodeConfig-empty case so it runs once and never loops.
85
72
  */
86
- onDocumentChanged(e) {
87
- const r = b(e);
88
- if (!r)
73
+ onDocumentChanged(n) {
74
+ const t = u(n);
75
+ if (!t)
89
76
  return;
90
- const s = r.getNodeConfig();
91
- if (s && Object.keys(s).length > 0) {
92
- const t = g(e);
93
- if (t != null && t.initialized && this._shouldReconcileCurrency(t)) {
94
- const a = this.api.getDocumentModifier();
95
- this._reconcileCurrencyDomAttributes(r, t, a) && a.apply(new f(w)), this._markCurrencyHealed(t.blockInstanceId);
96
- }
77
+ const a = t.getNodeConfig();
78
+ if (a && Object.keys(a).length > 0)
97
79
  return;
98
- }
99
- const i = g(e);
100
- if (!(i != null && i.initialized))
80
+ const o = f(n);
81
+ if (!(o != null && o.initialized))
101
82
  return;
102
- const n = this.api.getDocumentModifier();
103
- n.modifyHtml(r).setNodeConfig(i), this._stampProductTdDomAttributes(r, i, n), this._shouldReconcileCurrency(i) && this._reconcileCurrencyDomAttributes(r, i, n), n.apply(new f("Recover Items block config from saved module")), this._markCurrencyHealed(i.blockInstanceId);
83
+ const r = this.api.getDocumentModifier();
84
+ r.modifyHtml(t).setNodeConfig(o), this._stampProductTdDomAttributes(t, o, r), r.apply(new c("Recover Items block config from saved module"));
104
85
  }
105
86
  /**
106
87
  * Bakes the compiler-read DOM attributes (`data-type`, `data-number`, `data-nodup`) onto the
@@ -110,51 +91,14 @@ class K extends A {
110
91
  * restored before export. The name `<a>` carries no data-type/data-number of its own and
111
92
  * relies on this td-level fallback in pairProductVariables.
112
93
  */
113
- _stampProductTdDomAttributes(e, r, s, o = !1) {
114
- const i = B(r.itemsSelectValue, r.type), n = (t, a) => {
115
- o && e.getAttribute(t) || s.modifyHtml(e).setAttribute(t, a);
94
+ _stampProductTdDomAttributes(n, t, a, e = !1) {
95
+ const o = D(t.itemsSelectValue, t.type), r = (i, s) => {
96
+ e && n.getAttribute(i) || a.modifyHtml(n).setAttribute(i, s);
116
97
  };
117
- n("data-type", r.type), n("data-number", i), n("data-nodup", String(r.priceHideDiscount));
118
- }
119
- /**
120
- * Whether a currency self-heal pass should run for this block (SD-147588). The only gate here is
121
- * once-per-session: heal each instance at most once, so the auto-fix can't fight undo (undo
122
- * re-drifts the attr, which would otherwise re-trigger the heal forever). The position-vs-symbol
123
- * authority split lives in `_reconcileCurrencyDomAttributes` — position is always authoritative,
124
- * the symbol write alone is skipped for the 'USD' sentinel — so we must NOT gate the whole pass
125
- * on symbol customization here, or a default-symbol block with a toggled location never heals.
126
- */
127
- _shouldReconcileCurrency(e) {
128
- return !e.blockInstanceId || !this._currencyHealed.has(e.blockInstanceId);
129
- }
130
- /** Marks a block instance's currency as reconciled so it is not healed again (undo-safe). */
131
- _markCurrencyHealed(e) {
132
- e && this._currencyHealed.add(e);
133
- }
134
- /**
135
- * Stamps the export-read currency attrs onto every price `<p>` from config, so a template whose
136
- * attrs drifted (e.g. a location toggle before the sync fix) self-heals to match the editor.
137
- * Config is the source of truth — never derive from visible text.
138
- *
139
- * Position and symbol differ in authority (SD-147588):
140
- * - `data-curency` (position) comes from `priceCurrencyLocation`, captured independently of the
141
- * symbol, so it is ALWAYS authoritative and healed whenever it drifts — even with a default
142
- * symbol (otherwise the default-symbol + toggled-location case stays broken on export).
143
- * - `data-currency_symbol` is stamped only for a customized symbol; the 'USD' sentinel may be a
144
- * migrator default, so we trust the DOM's real value over it and never overwrite.
145
- *
146
- * Returns true only when an attr actually changed, so the caller can skip an empty apply that
147
- * would otherwise re-trigger onDocumentChanged and loop.
148
- */
149
- _reconcileCurrencyDomAttributes(e, r, s) {
150
- const o = r.priceCurrencyLocation, i = o != null && String(o).trim() !== "", n = H(o), t = (r.priceCurrencySymbol ?? "").trim(), a = R(t), d = e.querySelectorAll(`.${O.PRICE} p`);
151
- let l = !1;
152
- return d.forEach((c) => {
153
- i && c.getAttribute(y.POSITION) !== n && (s.modifyHtml(c).setAttribute(y.POSITION, n), l = !0), a && c.getAttribute(y.SYMBOL) !== t && (s.modifyHtml(c).setAttribute(y.SYMBOL, t), l = !0);
154
- }), l;
98
+ r("data-type", t.type), r("data-number", o), r("data-nodup", String(t.priceHideDiscount));
155
99
  }
156
100
  }
157
101
  export {
158
- k as BLOCK_ID,
159
- K as ItemsBlock
102
+ p as BLOCK_ID,
103
+ E as ItemsBlock
160
104
  };
@@ -0,0 +1,20 @@
1
+ import { SETTINGS_ENUMS as L } from "../enums/settingsEnums.js";
2
+ const c = "130px", O = "100%", t = (e) => e === L.ORIENTATION.HORIZONTAL ? c : O, n = {
3
+ VERTICAL: "es-p5b es-p5t",
4
+ HORIZONTAL: "es-p5l es-p5r"
5
+ }, o = "data-items-cell-pad", R = (e) => `${o}="${e ? "v" : "h"}"`, E = (e) => e ? ` ${n.VERTICAL}` : ` ${n.HORIZONTAL}`, N = (e, A) => {
6
+ if (!e.includes(o))
7
+ return e;
8
+ const T = A ? n.HORIZONTAL : n.VERTICAL, s = A ? n.VERTICAL : n.HORIZONTAL, I = A ? "v" : "h";
9
+ return e.replace(T, s).replace(new RegExp(`${o}="[hv]"`), `${o}="${I}"`);
10
+ };
11
+ export {
12
+ n as BLOCK_CELL_PADDING,
13
+ o as BLOCK_CELL_PAD_ATTR,
14
+ c as NAME_HORIZONTAL_MAX_WIDTH,
15
+ O as NAME_VERTICAL_MAX_WIDTH,
16
+ R as blockCellPadMarker,
17
+ E as blockCellPaddingFor,
18
+ t as nameMaxWidthFor,
19
+ N as reorientBlockCellPadding
20
+ };
@@ -1,14 +1,15 @@
1
- import { ModificationDescription as l, UIElementType as s, UEAttr as d } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
- import { CommonControl as p } from "../../../common-control.js";
1
+ import { ModificationDescription as d, UIElementType as s, UEAttr as p } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
2
+ import { CommonControl as T } from "../../../common-control.js";
3
+ import { nameMaxWidthFor as h } from "../../constants/cardLayout.js";
3
4
  import { ItemsBlockControlId as a } from "../../enums/controlEnums.js";
4
- import { findNameTextNode as T } from "../../utils/nameNode.js";
5
- import { getItemsBlockConfig as r, setItemsBlockConfig as c } from "../../utils/nodeConfigUtils.js";
6
- const g = a.NAME_TRIMMING, i = {
5
+ import { findNameTextNode as c } from "../../utils/nameNode.js";
6
+ import { getItemsBlockConfig as r, setItemsBlockConfig as g } from "../../utils/nodeConfigUtils.js";
7
+ const I = a.NAME_TRIMMING, n = {
7
8
  TRIMMING: "trimming"
8
9
  };
9
- class y extends p {
10
+ class E extends T {
10
11
  getId() {
11
- return g;
12
+ return I;
12
13
  }
13
14
  getTemplate() {
14
15
  return `
@@ -19,39 +20,39 @@ class y extends p {
19
20
  }
20
21
  onRender() {
21
22
  const e = r(this.currentNode);
22
- this.api.updateValues({ [i.TRIMMING]: (e == null ? void 0 : e.nameTrimming) ?? !0 }), this.api.onValueChanged(i.TRIMMING, (t) => {
23
+ this.api.updateValues({ [n.TRIMMING]: (e == null ? void 0 : e.nameTrimming) ?? !0 }), this.api.onValueChanged(n.TRIMMING, (t) => {
23
24
  this._onTrimmingChange(t);
24
25
  });
25
26
  }
26
27
  onTemplateNodeUpdated(e) {
27
28
  super.onTemplateNodeUpdated(e), this.handleBlockInstanceChange(() => {
28
29
  const t = r(this.currentNode);
29
- this.api.updateValues({ [i.TRIMMING]: (t == null ? void 0 : t.nameTrimming) ?? !0 });
30
+ this.api.updateValues({ [n.TRIMMING]: (t == null ? void 0 : t.nameTrimming) ?? !0 });
30
31
  });
31
32
  }
32
33
  _onTrimmingChange(e) {
33
- c(this.currentNode, this.api, { nameTrimming: e }), this.api.updateValues({ [i.TRIMMING]: e }), this._applyTrimmingStyles(e);
34
+ g(this.currentNode, this.api, { nameTrimming: e }), this.api.updateValues({ [n.TRIMMING]: e }), this._applyTrimmingStyles(e);
34
35
  }
35
36
  _applyTrimmingStyles(e) {
36
- const t = T(this.currentNode);
37
+ const t = c(this.currentNode);
37
38
  if (!t)
38
39
  return;
39
- const n = r(this.currentNode), m = e !== void 0 ? e : (n == null ? void 0 : n.nameTrimming) ?? !0, o = this.api.getDocumentModifier().modifyHtml(t);
40
- m ? o.setStyle("white-space", "nowrap").setStyle("overflow", "hidden").setStyle("text-overflow", "ellipsis") : o.removeStyle("white-space").removeStyle("overflow").removeStyle("text-overflow"), o.setStyle("max-width", "100%").apply(new l(`Text Trimming ${m ? "Enabled" : "Disabled"}`));
40
+ const i = r(this.currentNode), m = e !== void 0 ? e : (i == null ? void 0 : i.nameTrimming) ?? !0, l = h(i == null ? void 0 : i.orientation), o = this.api.getDocumentModifier().modifyHtml(t);
41
+ m ? o.setStyle("white-space", "nowrap").setStyle("overflow", "hidden").setStyle("text-overflow", "ellipsis") : o.removeStyle("white-space").removeStyle("overflow").removeStyle("text-overflow"), o.setStyle("max-width", l).apply(new d(`Text Trimming ${m ? "Enabled" : "Disabled"}`));
41
42
  }
42
43
  _getTextTrimming() {
43
44
  return `
44
45
  <div class="display-flex align-items-center justify-content-between">
45
46
  <${s.LABEL}
46
- ${d.LABEL.text}="${this.api.translate("Text Trimming")}"
47
+ ${p.LABEL.text}="${this.api.translate("Text Trimming")}"
47
48
  >
48
49
  </${s.LABEL}>
49
- ${this._GuToggle(i.TRIMMING)}
50
+ ${this._GuToggle(n.TRIMMING)}
50
51
  </div>
51
52
  `;
52
53
  }
53
54
  }
54
55
  export {
55
- g as CONTROL_BLOCK_ID,
56
- y as NameTrimmingControl
56
+ I as CONTROL_BLOCK_ID,
57
+ E as NameTrimmingControl
57
58
  };
@@ -1,15 +1,14 @@
1
- import { currencyLocationMaps as p } from "../../../../../enums/extensions/recommendationBlock.js";
2
- import { UEAttr as N, ModificationDescription as I } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
3
- import { CommonControl as L } from "../../../common-control.js";
4
- import { ITEMS_CURRENCY_ATTR as T, currencyPositionFromLocation as E } from "../../constants/currency.js";
1
+ import { currencyLocationMaps as u } from "../../../../../enums/extensions/recommendationBlock.js";
2
+ import { UEAttr as R, ModificationDescription as L } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
3
+ import { CommonControl as N } from "../../../common-control.js";
5
4
  import { ItemsBlockControlId as m } from "../../enums/controlEnums.js";
6
- import { getItemsBlockConfig as l, setItemsBlockConfig as O, escapeReplacement as f } from "../../utils/nodeConfigUtils.js";
7
- const b = m.PRICE_CURRENCY_LOCATION, c = {
5
+ import { getItemsBlockConfig as C, setItemsBlockConfig as I, escapeReplacement as T } from "../../utils/nodeConfigUtils.js";
6
+ const E = m.PRICE_CURRENCY_LOCATION, c = {
8
7
  CURRENCY_LOCATION: "currencyLocation"
9
8
  };
10
- class Y extends L {
9
+ class A extends N {
11
10
  getId() {
12
- return b;
11
+ return E;
13
12
  }
14
13
  getTemplate() {
15
14
  return `
@@ -19,32 +18,32 @@ class Y extends L {
19
18
  `;
20
19
  }
21
20
  onRender() {
22
- const e = l(this.currentNode);
23
- this.api.setUIEAttribute(c.CURRENCY_LOCATION, N.SELECTPICKER.items, p), this.api.updateValues({ [c.CURRENCY_LOCATION]: (e == null ? void 0 : e.priceCurrencyLocation) ?? "0" }), this.api.onValueChanged(c.CURRENCY_LOCATION, (t) => {
21
+ const e = C(this.currentNode);
22
+ this.api.setUIEAttribute(c.CURRENCY_LOCATION, R.SELECTPICKER.items, u), this.api.updateValues({ [c.CURRENCY_LOCATION]: (e == null ? void 0 : e.priceCurrencyLocation) ?? "0" }), this.api.onValueChanged(c.CURRENCY_LOCATION, (t) => {
24
23
  this._onCurrencyLocationChange(t);
25
24
  });
26
25
  }
27
26
  onTemplateNodeUpdated(e) {
28
27
  super.onTemplateNodeUpdated(e), this.handleBlockInstanceChange(() => {
29
- const t = l(this.currentNode);
28
+ const t = C(this.currentNode);
30
29
  this.api.updateValues({ [c.CURRENCY_LOCATION]: (t == null ? void 0 : t.priceCurrencyLocation) ?? "0" });
31
30
  });
32
31
  }
33
32
  _onCurrencyLocationChange(e) {
34
- if (console.debug("Currency location changed to: ", e), O(this.currentNode, this.api, { priceCurrencyLocation: e }), !this.currentNode)
33
+ if (console.debug("Currency location changed to: ", e), I(this.currentNode, this.api, { priceCurrencyLocation: e }), !this.currentNode)
35
34
  return;
36
35
  const t = this._getPriceBlocks();
37
36
  if (!t || t.length === 0)
38
37
  return;
39
- const r = l(this.currentNode), n = e || "0", o = (r == null ? void 0 : r.priceCurrencySymbol) ?? "", i = E(n), s = this.api.getDocumentModifier();
40
- t.forEach((h) => {
41
- const a = this._getParagraph(h);
42
- if (!a)
38
+ const r = C(this.currentNode), n = e || "0", o = (r == null ? void 0 : r.priceCurrencySymbol) ?? "", i = this.api.getDocumentModifier();
39
+ t.forEach((a) => {
40
+ const s = this._getParagraph(a);
41
+ if (!s)
43
42
  return;
44
- const d = a.getInnerHTML().trim() || "", C = a.getInnerText().trim() || "", u = (o == null ? void 0 : o.trim()) || "", _ = this._removeCurrencySymbol(C, u), g = this._detectSymbolInText(C) || u, R = this._buildPriceContent(_, g, n), y = d.replace(C, f(R));
45
- s.modifyHtml(a).setInnerHtml(y).setAttribute(T.POSITION, i);
46
- }), s.apply(new I(
47
- `Updated currency location to ${i}`
43
+ const h = s.getInnerHTML().trim() || "", l = s.getInnerText().trim() || "", p = (o == null ? void 0 : o.trim()) || "", d = this._removeCurrencySymbol(l, p), g = this._detectSymbolInText(l) || p, _ = this._buildPriceContent(d, g, n), y = h.replace(l, T(_));
44
+ i.modifyHtml(s).setInnerHtml(y);
45
+ }), i.apply(new L(
46
+ `Updated currency location to ${n === "1" ? "after" : "before"}`
48
47
  ));
49
48
  }
50
49
  _getPriceBlocks() {
@@ -66,8 +65,8 @@ class Y extends L {
66
65
  } else {
67
66
  const o = r.match(/([^0-9.,\s]+)/);
68
67
  if (o && o[1]) {
69
- const i = o[1].trim(), s = new RegExp(`\\s*${this._escapeRegex(i)}\\s*`);
70
- n = r.replace(s, "").trim();
68
+ const i = o[1].trim(), a = new RegExp(`\\s*${this._escapeRegex(i)}\\s*`);
69
+ n = r.replace(a, "").trim();
71
70
  }
72
71
  }
73
72
  return n;
@@ -86,13 +85,13 @@ class Y extends L {
86
85
  this._GuSelect({
87
86
  name: c.CURRENCY_LOCATION,
88
87
  placeholder: "",
89
- options: p
88
+ options: u
90
89
  })
91
90
  ])}
92
91
  `;
93
92
  }
94
93
  }
95
94
  export {
96
- b as CONTROL_BLOCK_ID,
97
- Y as PriceCurrencyLocationControl
95
+ E as CONTROL_BLOCK_ID,
96
+ A as PriceCurrencyLocationControl
98
97
  };
@@ -1,21 +1,20 @@
1
1
  var R = Object.defineProperty;
2
2
  var N = (s, c, e) => c in s ? R(s, c, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[c] = e;
3
3
  var h = (s, c, e) => N(s, typeof c != "symbol" ? c + "" : c, e);
4
- import { ModificationDescription as E } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
- import { CommonControl as B } from "../../../common-control.js";
6
- import { ITEMS_CURRENCY_ATTR as T } from "../../constants/currency.js";
4
+ import { ModificationDescription as B } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
+ import { CommonControl as E } from "../../../common-control.js";
7
6
  import { ItemsBlockControlId as y } from "../../enums/controlEnums.js";
8
- import { getItemsBlockConfig as p, setItemsBlockConfig as Y, escapeReplacement as f } from "../../utils/nodeConfigUtils.js";
9
- const x = y.PRICE_CURRENCY_SYMBOL, u = {
7
+ import { getItemsBlockConfig as p, setItemsBlockConfig as x, escapeReplacement as f } from "../../utils/nodeConfigUtils.js";
8
+ const I = y.PRICE_CURRENCY_SYMBOL, u = {
10
9
  CURRENCY_SYMBOL: "currencySymbol"
11
10
  };
12
- class $ extends B {
11
+ class P extends E {
13
12
  constructor() {
14
13
  super(...arguments);
15
14
  h(this, "originalPriceContents", /* @__PURE__ */ new Map());
16
15
  }
17
16
  getId() {
18
- return x;
17
+ return I;
19
18
  }
20
19
  getTemplate() {
21
20
  return `
@@ -43,7 +42,7 @@ class $ extends B {
43
42
  var a;
44
43
  console.debug("Currency symbol changed to: ", e);
45
44
  const t = p(this.currentNode), o = ((a = t == null ? void 0 : t.priceCurrencySymbol) == null ? void 0 : a.trim()) || "";
46
- if (Y(this.currentNode, this.api, { priceCurrencySymbol: e }), !this.currentNode)
45
+ if (x(this.currentNode, this.api, { priceCurrencySymbol: e }), !this.currentNode)
47
46
  return;
48
47
  const r = this._getPriceBlocks();
49
48
  if (!r || r.length === 0)
@@ -54,8 +53,8 @@ class $ extends B {
54
53
  if (!m)
55
54
  return;
56
55
  const g = m.getInnerHTML().trim() || "", C = m.getInnerText().trim() || "", _ = this._removeCurrencySymbol(C, o), S = this._buildPriceContent(_, n, l), b = g.replace(C, f(S));
57
- i.modifyHtml(m).setInnerHtml(b).setAttribute(T.SYMBOL, n);
58
- }), i.apply(new E(
56
+ i.modifyHtml(m).setInnerHtml(b).setAttribute("data-currency_symbol", n);
57
+ }), i.apply(new B(
59
58
  `Updated currency symbol to ${n || "removed"}`
60
59
  ));
61
60
  }
@@ -116,6 +115,6 @@ class $ extends B {
116
115
  }
117
116
  }
118
117
  export {
119
- x as CONTROL_BLOCK_ID,
120
- $ as PriceCurrencySymbolControl
118
+ I as CONTROL_BLOCK_ID,
119
+ P as PriceCurrencySymbolControl
121
120
  };