@useinsider/guido 3.23.0-beta.9f6bfbf → 3.23.0-beta.a35efcf
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.
- package/README.md +9 -1
- package/dist/@types/config/schemas.js +26 -26
- package/dist/components/Guido.vue.js +5 -5
- package/dist/components/Guido.vue2.js +88 -86
- package/dist/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js +17 -0
- package/dist/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue2.js +30 -0
- package/dist/composables/useModuleRepair.js +30 -23
- package/dist/config/migrator/index.js +16 -16
- package/dist/config/migrator/legacyUnsubscribeTextMigrator.js +16 -0
- package/dist/enums/academy.js +2 -1
- package/dist/extensions/Blocks/Items/block.js +77 -115
- package/dist/extensions/Blocks/Items/constants/currency.js +14 -59
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +22 -33
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +51 -62
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +17 -18
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +31 -42
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +120 -141
- package/dist/extensions/Blocks/Items/enums/controlEnums.js +1 -1
- package/dist/extensions/Blocks/Items/extension.js +8 -9
- package/dist/extensions/Blocks/Items/items.css.js +0 -19
- package/dist/extensions/Blocks/Items/settingsPanel.js +25 -34
- package/dist/extensions/Blocks/Items/template.js +212 -250
- package/dist/extensions/Blocks/Recommendation/utils/priceFormatter.js +0 -1
- package/dist/guido.css +1 -1
- package/dist/package.json.js +2 -2
- package/dist/src/@types/config/schemas.d.ts +4 -4
- package/dist/src/components/organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.d.ts +2 -0
- package/dist/src/composables/useConfig.d.ts +2 -2
- package/dist/src/composables/useModuleRepair.d.ts +2 -11
- package/dist/src/config/migrator/index.d.ts +1 -4
- package/dist/src/config/migrator/legacyUnsubscribeTextMigrator.d.ts +1 -0
- package/dist/src/enums/academy.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/block.d.ts +9 -6
- package/dist/src/extensions/Blocks/Items/constants/currency.d.ts +0 -32
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/template.d.ts +1 -4
- package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +0 -3
- package/dist/src/extensions/Blocks/Recommendation/utils/priceFormatter.d.ts +0 -12
- package/dist/src/stores/config.d.ts +20 -20
- package/dist/src/stores/editor.d.ts +25 -0
- package/dist/src/utils/itemsCurrencyRepair.d.ts +1 -5
- package/dist/src/utils/legacyUnsubscribeConversion.d.ts +10 -0
- package/dist/static/stripo-runtime-manifest.json.js +1 -1
- package/dist/stores/editor.js +15 -14
- package/dist/utils/itemsCurrencyRepair.js +24 -29
- package/dist/utils/legacyUnsubscribeConversion.js +49 -0
- package/dist/utils/pairProductVariables.js +99 -119
- package/package.json +2 -2
- package/dist/config/migrator/itemsPriceFormatMigrator.js +0 -20
- package/dist/extensions/Blocks/Items/controls/priceFormat.js +0 -145
- package/dist/extensions/Blocks/Items/utils/priceFormatOps.js +0 -185
- package/dist/src/config/migrator/itemsPriceFormatMigrator.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/priceFormat.d.ts +0 -23
- package/dist/src/extensions/Blocks/Items/utils/priceFormatOps.d.ts +0 -61
|
@@ -1,28 +1,25 @@
|
|
|
1
1
|
var R = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
import { isNewPriceFormatBlock as L, applyPriceFormatChange as M } from "../priceFormat.js";
|
|
11
|
-
const Y = d.PRICE_CURRENCY_SYMBOL, u = {
|
|
2
|
+
var N = (s, c, e) => c in s ? R(s, c, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[c] = e;
|
|
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 f } from "../../../common-control.js";
|
|
6
|
+
import { ITEMS_CURRENCY_ATTR as B } from "../../constants/currency.js";
|
|
7
|
+
import { ItemsBlockControlId as y } from "../../enums/controlEnums.js";
|
|
8
|
+
import { getItemsBlockConfig as p, setItemsBlockConfig as T, escapeReplacement as x } from "../../utils/nodeConfigUtils.js";
|
|
9
|
+
const I = y.PRICE_CURRENCY_SYMBOL, u = {
|
|
12
10
|
CURRENCY_SYMBOL: "currencySymbol"
|
|
13
11
|
};
|
|
14
|
-
class
|
|
12
|
+
class $ extends f {
|
|
15
13
|
constructor() {
|
|
16
14
|
super(...arguments);
|
|
17
|
-
|
|
15
|
+
h(this, "originalPriceContents", /* @__PURE__ */ new Map());
|
|
18
16
|
}
|
|
19
17
|
getId() {
|
|
20
|
-
return
|
|
18
|
+
return I;
|
|
21
19
|
}
|
|
22
20
|
getTemplate() {
|
|
23
|
-
const e = E().isFeatureEnabled("itemsPriceFormatting") ? " no-separator" : "";
|
|
24
21
|
return `
|
|
25
|
-
<div class="container ${
|
|
22
|
+
<div class="container ${y.PRICE_CURRENCY_SYMBOL}">
|
|
26
23
|
${this._getCurrencySymbol()}
|
|
27
24
|
</div>
|
|
28
25
|
`;
|
|
@@ -37,36 +34,28 @@ class A extends P {
|
|
|
37
34
|
}
|
|
38
35
|
onTemplateNodeUpdated(e) {
|
|
39
36
|
super.onTemplateNodeUpdated(e), this.handleBlockInstanceChange(() => {
|
|
40
|
-
const
|
|
41
|
-
this.api.updateValues({ [u.CURRENCY_SYMBOL]: (
|
|
37
|
+
const t = p(this.currentNode);
|
|
38
|
+
this.api.updateValues({ [u.CURRENCY_SYMBOL]: (t == null ? void 0 : t.priceCurrencySymbol) ?? "" }), this._storeOriginalContents();
|
|
42
39
|
});
|
|
43
40
|
}
|
|
44
41
|
_onCurrencySymbolChange(e) {
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
this.api,
|
|
50
|
-
{ priceCurrencySymbol: e },
|
|
51
|
-
`Updated currency symbol to ${(e == null ? void 0 : e.trim()) || "removed"}`
|
|
52
|
-
);
|
|
42
|
+
var a;
|
|
43
|
+
console.debug("Currency symbol changed to: ", e);
|
|
44
|
+
const t = p(this.currentNode), o = ((a = t == null ? void 0 : t.priceCurrencySymbol) == null ? void 0 : a.trim()) || "";
|
|
45
|
+
if (T(this.currentNode, this.api, { priceCurrencySymbol: e }), !this.currentNode)
|
|
53
46
|
return;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if (x(this.currentNode, this.api, { priceCurrencySymbol: e }), !this.currentNode)
|
|
57
|
-
return;
|
|
58
|
-
const t = this._getPriceBlocks();
|
|
59
|
-
if (!t || t.length === 0)
|
|
47
|
+
const r = this._getPriceBlocks();
|
|
48
|
+
if (!r || r.length === 0)
|
|
60
49
|
return;
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
if (!
|
|
50
|
+
const n = (e == null ? void 0 : e.trim()) || "", l = (t == null ? void 0 : t.priceCurrencyLocation) ?? "0", i = this.api.getDocumentModifier();
|
|
51
|
+
r.forEach((d) => {
|
|
52
|
+
const m = this._getParagraph(d);
|
|
53
|
+
if (!m)
|
|
65
54
|
return;
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
}),
|
|
69
|
-
`Updated currency symbol to ${
|
|
55
|
+
const g = m.getInnerHTML().trim() || "", C = m.getInnerText().trim() || "", _ = this._removeCurrencySymbol(C, o), S = this._buildPriceContent(_, n, l), b = g.replace(C, x(S));
|
|
56
|
+
i.modifyHtml(m).setInnerHtml(b).setAttribute(B.SYMBOL, n);
|
|
57
|
+
}), i.apply(new E(
|
|
58
|
+
`Updated currency symbol to ${n || "removed"}`
|
|
70
59
|
));
|
|
71
60
|
}
|
|
72
61
|
_storeOriginalContents() {
|
|
@@ -75,18 +64,18 @@ class A extends P {
|
|
|
75
64
|
const e = p(this.currentNode);
|
|
76
65
|
this.currentNode.querySelectorAll(
|
|
77
66
|
".items-block-price"
|
|
78
|
-
).forEach((
|
|
79
|
-
var
|
|
80
|
-
const
|
|
81
|
-
if (
|
|
82
|
-
const
|
|
83
|
-
this.originalPriceContents.set(
|
|
67
|
+
).forEach((o) => {
|
|
68
|
+
var n;
|
|
69
|
+
const r = o.querySelector("p");
|
|
70
|
+
if (r && !this.originalPriceContents.has(r)) {
|
|
71
|
+
const l = r.getInnerText() || "", i = ((n = e == null ? void 0 : e.priceCurrencySymbol) == null ? void 0 : n.trim()) || "", a = this._removeCurrencySymbol(l, i);
|
|
72
|
+
this.originalPriceContents.set(r, a);
|
|
84
73
|
}
|
|
85
74
|
});
|
|
86
75
|
}
|
|
87
76
|
_getPriceBlocks() {
|
|
88
|
-
var e,
|
|
89
|
-
return ((
|
|
77
|
+
var e, t;
|
|
78
|
+
return ((t = (e = this.currentNode) == null ? void 0 : e.closest(".items-block")) == null ? void 0 : t.querySelectorAll(".items-block-price")) || [];
|
|
90
79
|
}
|
|
91
80
|
_getParagraph(e) {
|
|
92
81
|
return e.querySelector("p");
|
|
@@ -94,23 +83,23 @@ class A extends P {
|
|
|
94
83
|
_escapeRegex(e) {
|
|
95
84
|
return e.replace(/[-\\^$*+?().|[\]{}]/g, "\\$&");
|
|
96
85
|
}
|
|
97
|
-
_removeCurrencySymbol(e,
|
|
98
|
-
const
|
|
99
|
-
let
|
|
100
|
-
if (
|
|
101
|
-
const
|
|
102
|
-
|
|
86
|
+
_removeCurrencySymbol(e, t) {
|
|
87
|
+
const o = e || "";
|
|
88
|
+
let r = o;
|
|
89
|
+
if (t) {
|
|
90
|
+
const n = new RegExp(`\\s*${this._escapeRegex(t)}\\s*`);
|
|
91
|
+
r = o.replace(n, "").trim();
|
|
103
92
|
} else {
|
|
104
|
-
const
|
|
105
|
-
if (
|
|
106
|
-
const
|
|
107
|
-
|
|
93
|
+
const n = o.match(/([^0-9.,\s]+)/);
|
|
94
|
+
if (n && n[1]) {
|
|
95
|
+
const l = n[1].trim(), i = new RegExp(`\\s*${this._escapeRegex(l)}\\s*`);
|
|
96
|
+
r = o.replace(i, "").trim();
|
|
108
97
|
}
|
|
109
98
|
}
|
|
110
|
-
return
|
|
99
|
+
return r;
|
|
111
100
|
}
|
|
112
|
-
_buildPriceContent(e,
|
|
113
|
-
return
|
|
101
|
+
_buildPriceContent(e, t, o) {
|
|
102
|
+
return t ? o === "1" ? `${e} ${t}` : `${t} ${e}` : e;
|
|
114
103
|
}
|
|
115
104
|
_getCurrencySymbol() {
|
|
116
105
|
return `
|
|
@@ -126,6 +115,6 @@ class A extends P {
|
|
|
126
115
|
}
|
|
127
116
|
}
|
|
128
117
|
export {
|
|
129
|
-
|
|
130
|
-
|
|
118
|
+
I as CONTROL_BLOCK_ID,
|
|
119
|
+
$ as PriceCurrencySymbolControl
|
|
131
120
|
};
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { ModificationDescription as C, UIElementType as T, UEAttr as L } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
2
|
import { CommonControl as g } from "../../../common-control.js";
|
|
3
|
-
import { ItemsBlockControlId as
|
|
3
|
+
import { ItemsBlockControlId as R, ItemsBlockId as _ } from "../../enums/controlEnums.js";
|
|
4
4
|
import { productPairs as I } from "../../enums/productEnums.js";
|
|
5
|
-
import { getItemsBlockConfig as
|
|
6
|
-
|
|
7
|
-
const N = p.PRICE_FORMATTED_PRICE, d = {
|
|
5
|
+
import { getItemsBlockConfig as p, setItemsBlockConfig as D, escapeReplacement as h } from "../../utils/nodeConfigUtils.js";
|
|
6
|
+
const O = R.PRICE_FORMATTED_PRICE, d = {
|
|
8
7
|
FORMATTED_PRICE: "formattedPrice"
|
|
9
8
|
};
|
|
10
|
-
class
|
|
9
|
+
class k extends g {
|
|
11
10
|
getId() {
|
|
12
|
-
return
|
|
11
|
+
return O;
|
|
13
12
|
}
|
|
14
13
|
getTemplate() {
|
|
15
14
|
return `
|
|
16
|
-
<div class="container ${
|
|
15
|
+
<div class="container ${R.PRICE_FORMATTED_PRICE}">
|
|
17
16
|
${this._getFormattedPrice()}
|
|
18
17
|
</div>
|
|
19
18
|
`;
|
|
@@ -25,14 +24,14 @@ class G extends g {
|
|
|
25
24
|
}
|
|
26
25
|
onTemplateNodeUpdated(e) {
|
|
27
26
|
super.onTemplateNodeUpdated(e), this.handleBlockInstanceChange(() => {
|
|
28
|
-
const t =
|
|
27
|
+
const t = p(this.currentNode);
|
|
29
28
|
this.api.updateValues({ [d.FORMATTED_PRICE]: (t == null ? void 0 : t.priceFormatted) ?? !0 });
|
|
30
29
|
});
|
|
31
30
|
}
|
|
32
31
|
_onFormattedPriceChange(e) {
|
|
33
|
-
if (console.debug("Formatted price changed to: ", e), !this.currentNode
|
|
32
|
+
if (console.debug("Formatted price changed to: ", e), !this.currentNode)
|
|
34
33
|
return;
|
|
35
|
-
const t =
|
|
34
|
+
const t = p(this.currentNode), c = (t == null ? void 0 : t.type) ?? "CART_ITEMS", o = (t == null ? void 0 : t.priceSinglePrice) ?? !1, r = I.PAIRS_FOR_EXTENSION.price[c], i = I.PAIRS_FOR_EXTENSION.originalPrice[c], [a, m] = e ? [
|
|
36
35
|
o ? r.DEFAULT_SINGLE_PRICE : r.DEFAULT_PRICE,
|
|
37
36
|
o ? r.DEFAULT_SINGLE_PRICE_FORMATTED : r.DEFAULT_PRICE_FORMATTED
|
|
38
37
|
] : [
|
|
@@ -40,12 +39,12 @@ class G extends g {
|
|
|
40
39
|
o ? r.DEFAULT_SINGLE_PRICE : r.DEFAULT_PRICE
|
|
41
40
|
], l = o ? i.DEFAULT_SINGLE_PRICE : i.DEFAULT_PRICE, P = o ? i.DEFAULT_SINGLE_PRICE_FORMATTED : i.DEFAULT_PRICE_FORMATTED, [F, A] = e ? [l, P] : [P, l], s = this.api.getDocumentModifier();
|
|
42
41
|
D(this.currentNode, this.api, { priceFormatted: e }, s);
|
|
43
|
-
const
|
|
44
|
-
((
|
|
42
|
+
const n = this.currentNode.closest(".items-block");
|
|
43
|
+
((n == null ? void 0 : n.querySelectorAll(
|
|
45
44
|
`[esd-extension-block-id="${_.PRICE}"]`
|
|
46
45
|
)) || []).forEach((E) => {
|
|
47
|
-
this._updatePriceBlock(s, E, a,
|
|
48
|
-
}), ((
|
|
46
|
+
this._updatePriceBlock(s, E, a, m, e);
|
|
47
|
+
}), ((n == null ? void 0 : n.querySelectorAll(
|
|
49
48
|
`[esd-extension-block-id="${_.ORIGINAL_PRICE}"]`
|
|
50
49
|
)) || []).forEach((E) => {
|
|
51
50
|
this._updatePriceBlock(s, E, F, A, e);
|
|
@@ -53,8 +52,8 @@ class G extends g {
|
|
|
53
52
|
`Updated price to ${e ? "formatted" : "unformatted"}`
|
|
54
53
|
));
|
|
55
54
|
}
|
|
56
|
-
_updatePriceBlock(e, t,
|
|
57
|
-
const i = `data-formated="${r ? "true" : "false"}"`, a = t.getInnerHTML().trim().replace(
|
|
55
|
+
_updatePriceBlock(e, t, c, o, r) {
|
|
56
|
+
const i = `data-formated="${r ? "true" : "false"}"`, a = t.getInnerHTML().trim().replace(c, h(o)).replace(/data-formated=(?:"[^"]*"|'[^']*')/g, i);
|
|
58
57
|
e.modifyHtml(t).setInnerHtml(a);
|
|
59
58
|
}
|
|
60
59
|
_getFormattedPrice() {
|
|
@@ -70,6 +69,6 @@ class G extends g {
|
|
|
70
69
|
}
|
|
71
70
|
}
|
|
72
71
|
export {
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
O as CONTROL_BLOCK_ID,
|
|
73
|
+
k as PriceFormattedPriceControl
|
|
75
74
|
};
|
|
@@ -1,85 +1,74 @@
|
|
|
1
|
-
import { ModificationDescription as S, UIElementType as _, UEAttr as
|
|
2
|
-
import { CommonControl as
|
|
3
|
-
import { ItemsBlockControlId as
|
|
4
|
-
import { productPairs as
|
|
5
|
-
import { getItemsBlockConfig as
|
|
6
|
-
|
|
7
|
-
const f = L.PRICE_SINGLE_PRICE, P = {
|
|
1
|
+
import { ModificationDescription as S, UIElementType as _, UEAttr as m } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { CommonControl as A } from "../../../common-control.js";
|
|
3
|
+
import { ItemsBlockControlId as T, ItemsBlockId as d } from "../../enums/controlEnums.js";
|
|
4
|
+
import { productPairs as p } from "../../enums/productEnums.js";
|
|
5
|
+
import { getItemsBlockConfig as g, setItemsBlockConfig as N, escapeReplacement as h } from "../../utils/nodeConfigUtils.js";
|
|
6
|
+
const u = T.PRICE_SINGLE_PRICE, a = {
|
|
8
7
|
SINGLE_PRICE: "singlePrice"
|
|
9
8
|
};
|
|
10
|
-
class
|
|
9
|
+
class k extends A {
|
|
11
10
|
getId() {
|
|
12
|
-
return
|
|
11
|
+
return u;
|
|
13
12
|
}
|
|
14
13
|
getTemplate() {
|
|
15
14
|
return `
|
|
16
|
-
<div class="container ${
|
|
15
|
+
<div class="container ${T.PRICE_SINGLE_PRICE}">
|
|
17
16
|
${this._getSinglePrice()}
|
|
18
17
|
</div>
|
|
19
18
|
`;
|
|
20
19
|
}
|
|
21
20
|
onRender() {
|
|
22
|
-
this.forgetLastPanelNode(), this.api.onValueChanged(
|
|
21
|
+
this.forgetLastPanelNode(), this.api.onValueChanged(a.SINGLE_PRICE, (e) => {
|
|
23
22
|
this._onSinglePriceChange(e);
|
|
24
23
|
});
|
|
25
24
|
}
|
|
26
25
|
onTemplateNodeUpdated(e) {
|
|
27
26
|
super.onTemplateNodeUpdated(e), this.handleBlockInstanceChange(() => {
|
|
28
|
-
const
|
|
29
|
-
this.api.updateValues({ [
|
|
27
|
+
const t = g(this.currentNode);
|
|
28
|
+
this.api.updateValues({ [a.SINGLE_PRICE]: (t == null ? void 0 : t.priceSinglePrice) ?? !1 });
|
|
30
29
|
});
|
|
31
30
|
}
|
|
32
31
|
_onSinglePriceChange(e) {
|
|
33
|
-
|
|
34
|
-
if (console.debug("Single price changed to: ", e), u(this.currentNode)) {
|
|
35
|
-
((I = a(this.currentNode)) == null ? void 0 : I.priceSinglePrice) !== e && D(
|
|
36
|
-
this.currentNode,
|
|
37
|
-
this.api,
|
|
38
|
-
{ priceSinglePrice: e },
|
|
39
|
-
`Updated price to ${e ? "single" : "total"} price`
|
|
40
|
-
);
|
|
32
|
+
if (console.debug("Single price changed to: ", e), !this.currentNode)
|
|
41
33
|
return;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const i = a(this.currentNode), c = (i == null ? void 0 : i.type) ?? "CART_ITEMS", r = (i == null ? void 0 : i.priceFormatted) ?? !1, t = T.PAIRS_FOR_EXTENSION.price[c], n = T.PAIRS_FOR_EXTENSION.originalPrice[c], [l, R] = e ? [
|
|
46
|
-
r ? t.DEFAULT_PRICE_FORMATTED : t.DEFAULT_PRICE,
|
|
47
|
-
r ? t.DEFAULT_SINGLE_PRICE_FORMATTED : t.DEFAULT_SINGLE_PRICE
|
|
34
|
+
const t = g(this.currentNode), c = (t == null ? void 0 : t.type) ?? "CART_ITEMS", r = (t == null ? void 0 : t.priceFormatted) ?? !1, i = p.PAIRS_FOR_EXTENSION.price[c], n = p.PAIRS_FOR_EXTENSION.originalPrice[c], [l, L] = e ? [
|
|
35
|
+
r ? i.DEFAULT_PRICE_FORMATTED : i.DEFAULT_PRICE,
|
|
36
|
+
r ? i.DEFAULT_SINGLE_PRICE_FORMATTED : i.DEFAULT_SINGLE_PRICE
|
|
48
37
|
] : [
|
|
49
|
-
r ?
|
|
50
|
-
r ?
|
|
51
|
-
],
|
|
52
|
-
|
|
38
|
+
r ? i.DEFAULT_SINGLE_PRICE_FORMATTED : i.DEFAULT_SINGLE_PRICE,
|
|
39
|
+
r ? i.DEFAULT_PRICE_FORMATTED : i.DEFAULT_PRICE
|
|
40
|
+
], I = r ? n.DEFAULT_PRICE_FORMATTED : n.DEFAULT_PRICE, P = r ? n.DEFAULT_SINGLE_PRICE_FORMATTED : n.DEFAULT_SINGLE_PRICE, [R, C] = e ? [I, P] : [P, I], s = this.api.getDocumentModifier();
|
|
41
|
+
N(this.currentNode, this.api, { priceSinglePrice: e }, s);
|
|
53
42
|
const o = this.currentNode.closest(".items-block");
|
|
54
43
|
((o == null ? void 0 : o.querySelectorAll(
|
|
55
|
-
`[esd-extension-block-id="${
|
|
44
|
+
`[esd-extension-block-id="${d.PRICE}"]`
|
|
56
45
|
)) || []).forEach((E) => {
|
|
57
|
-
this._updatePriceBlock(s, E, l,
|
|
46
|
+
this._updatePriceBlock(s, E, l, L, e);
|
|
58
47
|
}), ((o == null ? void 0 : o.querySelectorAll(
|
|
59
|
-
`[esd-extension-block-id="${
|
|
48
|
+
`[esd-extension-block-id="${d.ORIGINAL_PRICE}"]`
|
|
60
49
|
)) || []).forEach((E) => {
|
|
61
|
-
this._updatePriceBlock(s, E,
|
|
50
|
+
this._updatePriceBlock(s, E, R, C, e);
|
|
62
51
|
}), s.apply(new S(
|
|
63
52
|
`Updated price to ${e ? "single" : "total"} price`
|
|
64
53
|
));
|
|
65
54
|
}
|
|
66
|
-
_updatePriceBlock(e,
|
|
67
|
-
const n = `data-single_price="${
|
|
68
|
-
e.modifyHtml(
|
|
55
|
+
_updatePriceBlock(e, t, c, r, i) {
|
|
56
|
+
const n = `data-single_price="${i ? "true" : "false"}"`, l = t.getInnerHTML().trim().replace(c, h(r)).replace(/data-single_price=(?:"[^"]*"|'[^']*')/g, n);
|
|
57
|
+
e.modifyHtml(t).setInnerHtml(l);
|
|
69
58
|
}
|
|
70
59
|
_getSinglePrice() {
|
|
71
60
|
return `
|
|
72
61
|
<div class="display-flex align-items-center justify-content-between">
|
|
73
62
|
<${_.LABEL}
|
|
74
|
-
${
|
|
63
|
+
${m.LABEL.text}="${this.api.translate("Show Single Product Price")}"
|
|
75
64
|
>
|
|
76
65
|
</${_.LABEL}>
|
|
77
|
-
${this._GuToggle(
|
|
66
|
+
${this._GuToggle(a.SINGLE_PRICE)}
|
|
78
67
|
</div>
|
|
79
68
|
`;
|
|
80
69
|
}
|
|
81
70
|
}
|
|
82
71
|
export {
|
|
83
|
-
|
|
84
|
-
|
|
72
|
+
u as CONTROL_BLOCK_ID,
|
|
73
|
+
k as PriceSinglePriceControl
|
|
85
74
|
};
|