@useinsider/guido 2.1.0-beta.e2d48fe → 2.1.0-beta.e717f71
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/dist/components/organisms/header/HeaderWrapper.vue.js +9 -9
- package/dist/composables/useActionsApi.js +15 -13
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +29 -29
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +29 -29
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +31 -29
- package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +0 -1
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +29 -27
- package/dist/extensions/Blocks/Items/settingsPanel.js +10 -15
- package/dist/guido.css +1 -1
- package/dist/static/styles/components/notification.css.js +1 -0
- package/dist/static/styles/components/wide-panel.css.js +15 -0
- package/package.json +2 -2
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import o from "./HeaderWrapper.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
var
|
|
3
|
+
import a from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var s = function() {
|
|
5
5
|
var t = this, r = t._self._c, e = t._self._setupProxy;
|
|
6
|
-
return r(e.InContainer, { attrs: { border: "bor-w-0 bor-b-w-1 bor-s-s bor-c-6", "border-radius": "bor-r-0" } }, [r("div", { staticClass: "header-wrapper w-1 d-f a-i-c j-c-s-b p-3" }, [r(e.LeftSlot), r(e.MiddleSlot), r(e.RightSlot, { ref: "rightSlotRef" })], 1)]);
|
|
7
|
-
},
|
|
6
|
+
return r(e.InContainer, { attrs: { border: "bor-w-0 bor-b-w-1 bor-s-s bor-c-6", "border-radius": "bor-r-0", "data-testid": "guido-header" } }, [r("div", { staticClass: "header-wrapper w-1 d-f a-i-c j-c-s-b p-3" }, [r(e.LeftSlot), r(e.MiddleSlot), r(e.RightSlot, { ref: "rightSlotRef" })], 1)]);
|
|
7
|
+
}, d = [], i = /* @__PURE__ */ a(
|
|
8
8
|
o,
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
s,
|
|
10
|
+
d,
|
|
11
11
|
!1,
|
|
12
12
|
null,
|
|
13
|
-
"
|
|
13
|
+
"5c02dcc7"
|
|
14
14
|
);
|
|
15
|
-
const
|
|
15
|
+
const p = i.exports;
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
p as default
|
|
18
18
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useToaster as w } from "./useToaster.js";
|
|
2
2
|
const v = () => {
|
|
3
|
-
const { handleError:
|
|
3
|
+
const { handleError: n } = w(), m = (t = {}) => new Promise((e, a) => {
|
|
4
4
|
const o = { ...{
|
|
5
5
|
minimize: !0,
|
|
6
6
|
utmEntity: {
|
|
@@ -21,9 +21,9 @@ const v = () => {
|
|
|
21
21
|
resetDataSavedFlag: !1,
|
|
22
22
|
disableLineHeightsReplace: !0
|
|
23
23
|
}, ...t }, s = {
|
|
24
|
-
callback: (
|
|
25
|
-
|
|
26
|
-
html:
|
|
24
|
+
callback: (l, r, d, c, u) => {
|
|
25
|
+
l ? a(l) : e({
|
|
26
|
+
html: r,
|
|
27
27
|
ampHtml: d,
|
|
28
28
|
ampErrors: c,
|
|
29
29
|
displayConditions: u
|
|
@@ -34,15 +34,15 @@ const v = () => {
|
|
|
34
34
|
window.StripoEditorApi.actionsApi.compileEmail(s);
|
|
35
35
|
});
|
|
36
36
|
return {
|
|
37
|
-
getCompiledEmail:
|
|
37
|
+
getCompiledEmail: m,
|
|
38
38
|
getTemplateData: () => new Promise((t) => {
|
|
39
|
-
const e = ({ html: a, css: i, width: o, height:
|
|
39
|
+
const e = ({ html: a, css: i, width: o, height: p, utmParams: s, syncModulesIds: l }) => t({
|
|
40
40
|
html: a,
|
|
41
41
|
css: i,
|
|
42
42
|
width: o,
|
|
43
|
-
height:
|
|
43
|
+
height: p,
|
|
44
44
|
utmParams: s,
|
|
45
|
-
syncModulesIds:
|
|
45
|
+
syncModulesIds: l
|
|
46
46
|
});
|
|
47
47
|
window.StripoEditorApi.actionsApi.getTemplateData(e);
|
|
48
48
|
}),
|
|
@@ -56,7 +56,7 @@ const v = () => {
|
|
|
56
56
|
displayConditions: a,
|
|
57
57
|
ampHtml: i = "",
|
|
58
58
|
ampErrors: o = []
|
|
59
|
-
} = await
|
|
59
|
+
} = await m({ minimize: !1, resetDataSavedFlag: !1, ...t });
|
|
60
60
|
return {
|
|
61
61
|
html: e,
|
|
62
62
|
ampHtml: i,
|
|
@@ -64,7 +64,7 @@ const v = () => {
|
|
|
64
64
|
displayConditions: a
|
|
65
65
|
};
|
|
66
66
|
} catch (e) {
|
|
67
|
-
return
|
|
67
|
+
return n(e, "Error loading preview"), {
|
|
68
68
|
html: "",
|
|
69
69
|
ampHtml: "",
|
|
70
70
|
ampErrors: [],
|
|
@@ -80,17 +80,19 @@ const v = () => {
|
|
|
80
80
|
}
|
|
81
81
|
try {
|
|
82
82
|
window.StripoEditorApi.actionsApi.updateTimerInClonedTemplate((i, o) => {
|
|
83
|
-
i ? (
|
|
83
|
+
i ? (n(i, "Failed to update timer in cloned template"), t(null)) : t(o || null);
|
|
84
84
|
});
|
|
85
85
|
} catch (i) {
|
|
86
|
-
|
|
86
|
+
n(i, "Failed to call updateTimerInClonedTemplate"), t(null);
|
|
87
87
|
}
|
|
88
88
|
}),
|
|
89
89
|
updateHtmlAndCss: (t, e) => {
|
|
90
90
|
window.StripoEditorApi.actionsApi.updateHtmlAndCss(t, e);
|
|
91
91
|
},
|
|
92
92
|
editorSave: () => {
|
|
93
|
-
window.StripoEditorApi.actionsApi.save()
|
|
93
|
+
window.StripoEditorApi.actionsApi.save((t) => {
|
|
94
|
+
t && n(t, "Failed to save template");
|
|
95
|
+
});
|
|
94
96
|
}
|
|
95
97
|
};
|
|
96
98
|
};
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { currencyLocationMaps as
|
|
2
|
-
import { UEAttr as
|
|
3
|
-
import { CommonControl as
|
|
4
|
-
import { ItemsBlockControlId as
|
|
5
|
-
import { getItemsBlockConfig as
|
|
6
|
-
const
|
|
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";
|
|
4
|
+
import { ItemsBlockControlId as m } from "../../enums/controlEnums.js";
|
|
5
|
+
import { getItemsBlockConfig as C, setItemsBlockConfig as I, escapeReplacement as T } from "../../utils/nodeConfigUtils.js";
|
|
6
|
+
const E = m.PRICE_CURRENCY_LOCATION, c = {
|
|
7
7
|
CURRENCY_LOCATION: "currencyLocation"
|
|
8
8
|
};
|
|
9
|
-
class
|
|
9
|
+
class A extends N {
|
|
10
10
|
getId() {
|
|
11
|
-
return
|
|
11
|
+
return E;
|
|
12
12
|
}
|
|
13
13
|
getTemplate() {
|
|
14
14
|
return `
|
|
15
|
-
<div class="container ${
|
|
15
|
+
<div class="container ${m.PRICE_CURRENCY_LOCATION}">
|
|
16
16
|
${this._getCurrencyLocation()}
|
|
17
17
|
</div>
|
|
18
18
|
`;
|
|
19
19
|
}
|
|
20
20
|
onRender() {
|
|
21
|
-
const e =
|
|
22
|
-
this.api.setUIEAttribute(
|
|
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) => {
|
|
23
23
|
this._onCurrencyLocationChange(t);
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
onTemplateNodeUpdated(e) {
|
|
27
27
|
super.onTemplateNodeUpdated(e), this.handleBlockInstanceChange(() => {
|
|
28
|
-
const t =
|
|
29
|
-
this.api.updateValues({ [
|
|
28
|
+
const t = C(this.currentNode);
|
|
29
|
+
this.api.updateValues({ [c.CURRENCY_LOCATION]: (t == null ? void 0 : t.priceCurrencyLocation) ?? "0" });
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
_onCurrencyLocationChange(e) {
|
|
33
|
-
if (console.debug("Currency location changed to: ", e),
|
|
33
|
+
if (console.debug("Currency location changed to: ", e), I(this.currentNode, this.api, { priceCurrencyLocation: e }), !this.currentNode)
|
|
34
34
|
return;
|
|
35
35
|
const t = this._getPriceBlocks();
|
|
36
36
|
if (!t || t.length === 0)
|
|
37
37
|
return;
|
|
38
|
-
const r =
|
|
39
|
-
t.forEach((
|
|
40
|
-
const
|
|
41
|
-
if (!
|
|
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)
|
|
42
42
|
return;
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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"}`
|
|
47
|
+
));
|
|
48
48
|
}
|
|
49
49
|
_getPriceBlocks() {
|
|
50
50
|
var e, t;
|
|
@@ -65,8 +65,8 @@ class $ extends L {
|
|
|
65
65
|
} else {
|
|
66
66
|
const o = r.match(/([^0-9.,\s]+)/);
|
|
67
67
|
if (o && o[1]) {
|
|
68
|
-
const
|
|
69
|
-
n = r.replace(
|
|
68
|
+
const i = o[1].trim(), a = new RegExp(`\\s*${this._escapeRegex(i)}\\s*`);
|
|
69
|
+
n = r.replace(a, "").trim();
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
return n;
|
|
@@ -83,15 +83,15 @@ class $ extends L {
|
|
|
83
83
|
${this._GuTwoColumns([
|
|
84
84
|
this._GuLabel({ text: "Currency Location" }),
|
|
85
85
|
this._GuSelect({
|
|
86
|
-
name:
|
|
86
|
+
name: c.CURRENCY_LOCATION,
|
|
87
87
|
placeholder: "",
|
|
88
|
-
options:
|
|
88
|
+
options: u
|
|
89
89
|
})
|
|
90
90
|
])}
|
|
91
91
|
`;
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
export {
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
E as CONTROL_BLOCK_ID,
|
|
96
|
+
A as PriceCurrencyLocationControl
|
|
97
97
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var h = (s, c, e) =>
|
|
4
|
-
import { ModificationDescription as
|
|
5
|
-
import { CommonControl as
|
|
1
|
+
var R = Object.defineProperty;
|
|
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 B } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
|
+
import { CommonControl as E } from "../../../common-control.js";
|
|
6
6
|
import { ItemsBlockControlId as y } from "../../enums/controlEnums.js";
|
|
7
|
-
import { getItemsBlockConfig as
|
|
8
|
-
const I = y.PRICE_CURRENCY_SYMBOL,
|
|
7
|
+
import { getItemsBlockConfig as p, setItemsBlockConfig as x, escapeReplacement as f } from "../../utils/nodeConfigUtils.js";
|
|
8
|
+
const I = y.PRICE_CURRENCY_SYMBOL, u = {
|
|
9
9
|
CURRENCY_SYMBOL: "currencySymbol"
|
|
10
10
|
};
|
|
11
|
-
class
|
|
11
|
+
class P extends E {
|
|
12
12
|
constructor() {
|
|
13
13
|
super(...arguments);
|
|
14
14
|
h(this, "originalPriceContents", /* @__PURE__ */ new Map());
|
|
@@ -24,8 +24,8 @@ class O extends B {
|
|
|
24
24
|
`;
|
|
25
25
|
}
|
|
26
26
|
onRender() {
|
|
27
|
-
const e =
|
|
28
|
-
this.api.updateValues({ [
|
|
27
|
+
const e = p(this.currentNode);
|
|
28
|
+
this.api.updateValues({ [u.CURRENCY_SYMBOL]: (e == null ? void 0 : e.priceCurrencySymbol) ?? "" }), this._storeOriginalContents(), this.api.onValueChanged(u.CURRENCY_SYMBOL, (t) => {
|
|
29
29
|
this._onCurrencySymbolChange(t);
|
|
30
30
|
});
|
|
31
31
|
}
|
|
@@ -34,42 +34,42 @@ class O extends B {
|
|
|
34
34
|
}
|
|
35
35
|
onTemplateNodeUpdated(e) {
|
|
36
36
|
super.onTemplateNodeUpdated(e), this.handleBlockInstanceChange(() => {
|
|
37
|
-
const t =
|
|
38
|
-
this.api.updateValues({ [
|
|
37
|
+
const t = p(this.currentNode);
|
|
38
|
+
this.api.updateValues({ [u.CURRENCY_SYMBOL]: (t == null ? void 0 : t.priceCurrencySymbol) ?? "" }), this._storeOriginalContents();
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
_onCurrencySymbolChange(e) {
|
|
42
|
-
var
|
|
42
|
+
var a;
|
|
43
43
|
console.debug("Currency symbol changed to: ", e);
|
|
44
|
-
const t =
|
|
45
|
-
if (
|
|
44
|
+
const t = p(this.currentNode), o = ((a = t == null ? void 0 : t.priceCurrencySymbol) == null ? void 0 : a.trim()) || "";
|
|
45
|
+
if (x(this.currentNode, this.api, { priceCurrencySymbol: e }), !this.currentNode)
|
|
46
46
|
return;
|
|
47
47
|
const r = this._getPriceBlocks();
|
|
48
48
|
if (!r || r.length === 0)
|
|
49
49
|
return;
|
|
50
|
-
const n = (e == null ? void 0 : e.trim()) || "", l = (t == null ? void 0 : t.priceCurrencyLocation) ?? "0";
|
|
51
|
-
r.forEach((
|
|
52
|
-
const
|
|
53
|
-
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)
|
|
54
54
|
return;
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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));
|
|
56
|
+
i.modifyHtml(m).setInnerHtml(b);
|
|
57
|
+
}), i.apply(new B(
|
|
58
|
+
`Updated currency symbol to ${n || "removed"}`
|
|
59
|
+
));
|
|
60
60
|
}
|
|
61
61
|
_storeOriginalContents() {
|
|
62
62
|
if (!this.currentNode)
|
|
63
63
|
return;
|
|
64
|
-
const e =
|
|
64
|
+
const e = p(this.currentNode);
|
|
65
65
|
this.currentNode.querySelectorAll(
|
|
66
66
|
".items-block-price"
|
|
67
67
|
).forEach((o) => {
|
|
68
68
|
var n;
|
|
69
69
|
const r = o.querySelector("p");
|
|
70
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()) || "",
|
|
72
|
-
this.originalPriceContents.set(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);
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
75
|
}
|
|
@@ -106,7 +106,7 @@ class O extends B {
|
|
|
106
106
|
${this._GuTwoColumns([
|
|
107
107
|
this._GuLabel({ text: "Currency Symbol" }),
|
|
108
108
|
this._GuTextInput({
|
|
109
|
-
name:
|
|
109
|
+
name: u.CURRENCY_SYMBOL,
|
|
110
110
|
placeholder: "Enter Currency Symbol",
|
|
111
111
|
className: "es-180w"
|
|
112
112
|
})
|
|
@@ -116,5 +116,5 @@ class O extends B {
|
|
|
116
116
|
}
|
|
117
117
|
export {
|
|
118
118
|
I as CONTROL_BLOCK_ID,
|
|
119
|
-
|
|
119
|
+
P as PriceCurrencySymbolControl
|
|
120
120
|
};
|
|
@@ -1,63 +1,65 @@
|
|
|
1
|
-
import { ModificationDescription as
|
|
2
|
-
import { CommonControl as
|
|
3
|
-
import { ItemsBlockControlId as
|
|
1
|
+
import { ModificationDescription as L, UIElementType as P, UEAttr as D } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { CommonControl as h } from "../../../common-control.js";
|
|
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 d, setItemsBlockConfig as
|
|
6
|
-
const g =
|
|
5
|
+
import { getItemsBlockConfig as d, setItemsBlockConfig as u, escapeReplacement as O } from "../../utils/nodeConfigUtils.js";
|
|
6
|
+
const g = R.PRICE_FORMATTED_PRICE, s = {
|
|
7
7
|
FORMATTED_PRICE: "formattedPrice"
|
|
8
8
|
};
|
|
9
|
-
class
|
|
9
|
+
class k extends h {
|
|
10
10
|
getId() {
|
|
11
11
|
return g;
|
|
12
12
|
}
|
|
13
13
|
getTemplate() {
|
|
14
14
|
return `
|
|
15
|
-
<div class="container ${
|
|
15
|
+
<div class="container ${R.PRICE_FORMATTED_PRICE}">
|
|
16
16
|
${this._getFormattedPrice()}
|
|
17
17
|
</div>
|
|
18
18
|
`;
|
|
19
19
|
}
|
|
20
20
|
onRender() {
|
|
21
|
-
const
|
|
22
|
-
this.api.updateValues({ [s.FORMATTED_PRICE]: (
|
|
23
|
-
this._onFormattedPriceChange(
|
|
21
|
+
const t = d(this.currentNode);
|
|
22
|
+
this.api.updateValues({ [s.FORMATTED_PRICE]: (t == null ? void 0 : t.priceFormatted) ?? !0 }), this.api.onValueChanged(s.FORMATTED_PRICE, (e) => {
|
|
23
|
+
this._onFormattedPriceChange(e);
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
-
onTemplateNodeUpdated(
|
|
27
|
-
super.onTemplateNodeUpdated(
|
|
28
|
-
const
|
|
29
|
-
this.api.updateValues({ [s.FORMATTED_PRICE]: (
|
|
26
|
+
onTemplateNodeUpdated(t) {
|
|
27
|
+
super.onTemplateNodeUpdated(t), this.handleBlockInstanceChange(() => {
|
|
28
|
+
const e = d(this.currentNode);
|
|
29
|
+
this.api.updateValues({ [s.FORMATTED_PRICE]: (e == null ? void 0 : e.priceFormatted) ?? !0 });
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
_onFormattedPriceChange(
|
|
33
|
-
if (console.debug("Formatted price changed to: ",
|
|
32
|
+
_onFormattedPriceChange(t) {
|
|
33
|
+
if (console.debug("Formatted price changed to: ", t), u(this.currentNode, this.api, { priceFormatted: t }), !this.currentNode)
|
|
34
34
|
return;
|
|
35
|
-
const
|
|
35
|
+
const e = d(this.currentNode), n = (e == null ? void 0 : e.type) ?? "CART_ITEMS", i = (e == null ? void 0 : e.priceSinglePrice) ?? !1, r = I.PAIRS_FOR_EXTENSION.price[n], c = I.PAIRS_FOR_EXTENSION.originalPrice[n], [p, m] = t ? [
|
|
36
36
|
i ? r.DEFAULT_SINGLE_PRICE : r.DEFAULT_PRICE,
|
|
37
37
|
i ? r.DEFAULT_SINGLE_PRICE_FORMATTED : r.DEFAULT_PRICE_FORMATTED
|
|
38
38
|
] : [
|
|
39
39
|
i ? r.DEFAULT_SINGLE_PRICE_FORMATTED : r.DEFAULT_PRICE_FORMATTED,
|
|
40
40
|
i ? r.DEFAULT_SINGLE_PRICE : r.DEFAULT_PRICE
|
|
41
|
-
], l = i ?
|
|
42
|
-
((c == null ? void 0 : c.querySelectorAll(
|
|
41
|
+
], l = i ? c.DEFAULT_SINGLE_PRICE : c.DEFAULT_PRICE, T = i ? c.DEFAULT_SINGLE_PRICE_FORMATTED : c.DEFAULT_PRICE_FORMATTED, [F, A] = t ? [l, T] : [T, l], o = this.currentNode.closest(".items-block"), C = (o == null ? void 0 : o.querySelectorAll(
|
|
43
42
|
`[esd-extension-block-id="${_.PRICE}"]`
|
|
44
|
-
)) || []
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
)) || [], E = this.api.getDocumentModifier();
|
|
44
|
+
C.forEach((a) => {
|
|
45
|
+
this._updatePriceBlock(E, a, p, m);
|
|
46
|
+
}), ((o == null ? void 0 : o.querySelectorAll(
|
|
47
47
|
`[esd-extension-block-id="${_.ORIGINAL_PRICE}"]`
|
|
48
48
|
)) || []).forEach((a) => {
|
|
49
|
-
this._updatePriceBlock(
|
|
50
|
-
})
|
|
49
|
+
this._updatePriceBlock(E, a, F, A);
|
|
50
|
+
}), E.apply(new L(
|
|
51
|
+
`Updated price to ${t ? "formatted" : "unformatted"}`
|
|
52
|
+
));
|
|
51
53
|
}
|
|
52
|
-
_updatePriceBlock(
|
|
53
|
-
const
|
|
54
|
-
|
|
54
|
+
_updatePriceBlock(t, e, n, i) {
|
|
55
|
+
const r = e.getInnerHTML().trim().replace(n, O(i));
|
|
56
|
+
t.modifyHtml(e).setInnerHtml(r);
|
|
55
57
|
}
|
|
56
58
|
_getFormattedPrice() {
|
|
57
59
|
return `
|
|
58
60
|
<div class="display-flex align-items-center justify-content-between">
|
|
59
61
|
<${P.LABEL}
|
|
60
|
-
${
|
|
62
|
+
${D.LABEL.text}="${this.api.translate("Formatted Price (e.g. $9.90)")}"
|
|
61
63
|
>
|
|
62
64
|
</${P.LABEL}>
|
|
63
65
|
${this._GuToggle(s.FORMATTED_PRICE)}
|
|
@@ -67,5 +69,5 @@ class $ extends L {
|
|
|
67
69
|
}
|
|
68
70
|
export {
|
|
69
71
|
g as CONTROL_BLOCK_ID,
|
|
70
|
-
|
|
72
|
+
k as PriceFormattedPriceControl
|
|
71
73
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { ModificationDescription as
|
|
2
|
-
import { CommonControl as
|
|
3
|
-
import { ItemsBlockControlId as
|
|
4
|
-
import { productPairs as
|
|
5
|
-
import { getItemsBlockConfig as I, setItemsBlockConfig as u, escapeReplacement as
|
|
6
|
-
const
|
|
1
|
+
import { ModificationDescription as m, UIElementType as _, UEAttr as A } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { CommonControl as h } from "../../../common-control.js";
|
|
3
|
+
import { ItemsBlockControlId as L, ItemsBlockId as R } from "../../enums/controlEnums.js";
|
|
4
|
+
import { productPairs as T } from "../../enums/productEnums.js";
|
|
5
|
+
import { getItemsBlockConfig as I, setItemsBlockConfig as u, escapeReplacement as N } from "../../utils/nodeConfigUtils.js";
|
|
6
|
+
const D = L.PRICE_SINGLE_PRICE, l = {
|
|
7
7
|
SINGLE_PRICE: "singlePrice"
|
|
8
8
|
};
|
|
9
|
-
class
|
|
9
|
+
class y extends h {
|
|
10
10
|
getId() {
|
|
11
|
-
return
|
|
11
|
+
return D;
|
|
12
12
|
}
|
|
13
13
|
getTemplate() {
|
|
14
14
|
return `
|
|
15
|
-
<div class="container ${
|
|
15
|
+
<div class="container ${L.PRICE_SINGLE_PRICE}">
|
|
16
16
|
${this._getSinglePrice()}
|
|
17
17
|
</div>
|
|
18
18
|
`;
|
|
@@ -32,34 +32,36 @@ class M extends m {
|
|
|
32
32
|
_onSinglePriceChange(e) {
|
|
33
33
|
if (console.debug("Single price changed to: ", e), u(this.currentNode, this.api, { priceSinglePrice: e }), !this.currentNode)
|
|
34
34
|
return;
|
|
35
|
-
const t = I(this.currentNode),
|
|
35
|
+
const t = I(this.currentNode), o = (t == null ? void 0 : t.type) ?? "CART_ITEMS", r = (t == null ? void 0 : t.priceFormatted) ?? !1, i = T.PAIRS_FOR_EXTENSION.price[o], c = T.PAIRS_FOR_EXTENSION.originalPrice[o], [P, p] = e ? [
|
|
36
36
|
r ? i.DEFAULT_PRICE_FORMATTED : i.DEFAULT_PRICE,
|
|
37
37
|
r ? i.DEFAULT_SINGLE_PRICE_FORMATTED : i.DEFAULT_SINGLE_PRICE
|
|
38
38
|
] : [
|
|
39
39
|
r ? i.DEFAULT_SINGLE_PRICE_FORMATTED : i.DEFAULT_SINGLE_PRICE,
|
|
40
40
|
r ? i.DEFAULT_PRICE_FORMATTED : i.DEFAULT_PRICE
|
|
41
|
-
],
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
this._updatePriceBlock(
|
|
46
|
-
}), ((
|
|
47
|
-
`[esd-extension-block-id="${
|
|
48
|
-
)) || []).forEach((
|
|
49
|
-
this._updatePriceBlock(
|
|
50
|
-
})
|
|
41
|
+
], s = r ? c.DEFAULT_PRICE_FORMATTED : c.DEFAULT_PRICE, d = r ? c.DEFAULT_SINGLE_PRICE_FORMATTED : c.DEFAULT_SINGLE_PRICE, [g, C] = e ? [s, d] : [d, s], n = this.currentNode.closest(".items-block"), S = (n == null ? void 0 : n.querySelectorAll(
|
|
42
|
+
`[esd-extension-block-id="${R.PRICE}"]`
|
|
43
|
+
)) || [], E = this.api.getDocumentModifier();
|
|
44
|
+
S.forEach((a) => {
|
|
45
|
+
this._updatePriceBlock(E, a, P, p, e);
|
|
46
|
+
}), ((n == null ? void 0 : n.querySelectorAll(
|
|
47
|
+
`[esd-extension-block-id="${R.ORIGINAL_PRICE}"]`
|
|
48
|
+
)) || []).forEach((a) => {
|
|
49
|
+
this._updatePriceBlock(E, a, g, C, e);
|
|
50
|
+
}), E.apply(new m(
|
|
51
|
+
`Updated price to ${e ? "single" : "total"} price`
|
|
52
|
+
));
|
|
51
53
|
}
|
|
52
|
-
_updatePriceBlock(e, t,
|
|
53
|
-
const c =
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
_updatePriceBlock(e, t, o, r, i) {
|
|
55
|
+
const c = t.getInnerHTML().trim().replace(o, N(r));
|
|
56
|
+
e.modifyHtml(t).setInnerHtml(c), t.querySelectorAll('[product-attr="price"], [product-attr="originalPrice"]').forEach((s) => {
|
|
57
|
+
e.modifyHtml(s).setAttribute("data-single_price", i ? "true" : "false");
|
|
56
58
|
});
|
|
57
59
|
}
|
|
58
60
|
_getSinglePrice() {
|
|
59
61
|
return `
|
|
60
62
|
<div class="display-flex align-items-center justify-content-between">
|
|
61
63
|
<${_.LABEL}
|
|
62
|
-
${
|
|
64
|
+
${A.LABEL.text}="${this.api.translate("Show Single Product Price")}"
|
|
63
65
|
>
|
|
64
66
|
</${_.LABEL}>
|
|
65
67
|
${this._GuToggle(l.SINGLE_PRICE)}
|
|
@@ -68,6 +70,6 @@ class M extends m {
|
|
|
68
70
|
}
|
|
69
71
|
}
|
|
70
72
|
export {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
+
D as CONTROL_BLOCK_ID,
|
|
74
|
+
y as PriceSinglePriceControl
|
|
73
75
|
};
|
|
@@ -22,6 +22,8 @@ class U extends O {
|
|
|
22
22
|
new T(
|
|
23
23
|
_.SETTINGS,
|
|
24
24
|
[
|
|
25
|
+
I.ORIGINAL_PRICE_STYLE,
|
|
26
|
+
I.ORIGINAL_PRICE_ALIGN,
|
|
25
27
|
I.PRICE_ORIENTATION,
|
|
26
28
|
I.ORIGINAL_PRICE_PADDINGS
|
|
27
29
|
]
|
|
@@ -29,17 +31,17 @@ class U extends O {
|
|
|
29
31
|
new T(
|
|
30
32
|
_.STYLES,
|
|
31
33
|
[
|
|
32
|
-
I.ORIGINAL_PRICE_STYLE,
|
|
33
|
-
I.ORIGINAL_PRICE_ALIGN,
|
|
34
|
-
I.ORIGINAL_PRICE_COLOR,
|
|
35
34
|
I.ORIGINAL_PRICE_FONT_FAMILY,
|
|
36
|
-
I.ORIGINAL_PRICE_SIZE
|
|
35
|
+
I.ORIGINAL_PRICE_SIZE,
|
|
36
|
+
I.ORIGINAL_PRICE_COLOR
|
|
37
37
|
]
|
|
38
38
|
)
|
|
39
39
|
], N[E.PRICE] = [
|
|
40
40
|
new T(
|
|
41
41
|
_.SETTINGS,
|
|
42
42
|
[
|
|
43
|
+
I.PRICE_STYLE,
|
|
44
|
+
I.PRICE_ALIGN,
|
|
43
45
|
I.PRICE_HIDE_DISCOUNT,
|
|
44
46
|
I.PRICE_FORMATTED_PRICE,
|
|
45
47
|
I.PRICE_SINGLE_PRICE,
|
|
@@ -51,11 +53,9 @@ class U extends O {
|
|
|
51
53
|
new T(
|
|
52
54
|
_.STYLES,
|
|
53
55
|
[
|
|
54
|
-
I.PRICE_STYLE,
|
|
55
|
-
I.PRICE_ALIGN,
|
|
56
|
-
I.PRICE_COLOR,
|
|
57
56
|
I.PRICE_FONT_FAMILY,
|
|
58
|
-
I.PRICE_SIZE
|
|
57
|
+
I.PRICE_SIZE,
|
|
58
|
+
I.PRICE_COLOR
|
|
59
59
|
]
|
|
60
60
|
)
|
|
61
61
|
], N[E.NAME] = [
|
|
@@ -77,17 +77,12 @@ class U extends O {
|
|
|
77
77
|
]
|
|
78
78
|
)
|
|
79
79
|
], N[E.QUANTITY] = [
|
|
80
|
-
new T(
|
|
81
|
-
_.SETTINGS,
|
|
82
|
-
[
|
|
83
|
-
I.QUANTITY_FONT_FAMILY,
|
|
84
|
-
I.QUANTITY_STYLE
|
|
85
|
-
]
|
|
86
|
-
),
|
|
87
80
|
new T(
|
|
88
81
|
_.STYLES,
|
|
89
82
|
[
|
|
83
|
+
I.QUANTITY_STYLE,
|
|
90
84
|
I.QUANTITY_ALIGN,
|
|
85
|
+
I.QUANTITY_FONT_FAMILY,
|
|
91
86
|
I.QUANTITY_SIZE,
|
|
92
87
|
I.QUANTITY_COLOR,
|
|
93
88
|
I.QUANTITY_PADDINGS
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.gap-16[data-v-6562e38c],.gap-16[data-v-1ccb6d4a]{gap:16px}[data-v-cd76c125] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-913a3417] .in-progress-wrapper__progress p span:last-child{display:none!important}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-64c52560]{gap:8px}.version-history__toolbar[data-v-64c52560]{gap:4px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.editor-actions[data-v-17dd4d8b]{gap:4px}.header-wrapper[data-v-
|
|
1
|
+
.gap-16[data-v-6562e38c],.gap-16[data-v-1ccb6d4a]{gap:16px}[data-v-cd76c125] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-913a3417] .in-progress-wrapper__progress p span:last-child{display:none!important}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-64c52560]{gap:8px}.version-history__toolbar[data-v-64c52560]{gap:4px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.editor-actions[data-v-17dd4d8b]{gap:4px}.header-wrapper[data-v-5c02dcc7]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-890b5336]{position:relative;width:100%;height:calc(100vh - 128px)}.guido-editor__container[data-v-890b5336]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-890b5336]{height:calc(100vh - 75px)}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-a86fc486]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-a86fc486]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-a86fc486]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-a86fc486]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-a86fc486]{object-fit:cover;transform:scale(1)}[data-v-43c617a7] .guido__verion-history-view-option-selection-desktop svg,[data-v-43c617a7] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-43c617a7] .in-segments-wrapper__button_selected,[data-v-43c617a7] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-988f8da6]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-988f8da6]{min-height:504px}.iframe-wrapper[data-v-e0424e99]{width:258px}.iframe-scaled[data-v-e0424e99]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-d3c52b44] .vueperslides__bullets,[data-v-dd1a237a] .vueperslides__bullets{pointer-events:none!important}[data-v-dd1a237a] .vueperslides__parallax-wrapper{height:110px!important}[data-v-a408dcea] .vueperslides__bullets{pointer-events:none!important}[data-v-a408dcea] .vueperslides__parallax-wrapper{height:110px!important}
|
|
@@ -133,6 +133,21 @@ ue-label.accent-dot:after {
|
|
|
133
133
|
font-size: 13px;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
+
.e2e-container-video-size {
|
|
137
|
+
grid-template-columns: 1fr !important;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.e2e-container-video-size .control-shadow-wrapper:not(ue-button) {
|
|
141
|
+
display: flex;
|
|
142
|
+
width: 100%;
|
|
143
|
+
justify-content: flex-end;
|
|
144
|
+
background-color: transparent !important;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.e2e-container-video-size .control-shadow-wrapper input {
|
|
148
|
+
background-color: var(--guido-color-gray-0);
|
|
149
|
+
}
|
|
150
|
+
|
|
136
151
|
.e2e-size,
|
|
137
152
|
.e2e-timer-size {
|
|
138
153
|
grid-auto-flow: row;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "2.1.0-beta.
|
|
3
|
+
"version": "2.1.0-beta.e717f71",
|
|
4
4
|
"description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
|
|
5
5
|
"main": "./dist/guido.umd.cjs",
|
|
6
6
|
"module": "./dist/library.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"license": "ISC",
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@stripoinc/ui-editor-extensions": "3.5.0",
|
|
35
|
-
"@useinsider/design-system-vue": "0.14.
|
|
35
|
+
"@useinsider/design-system-vue": "0.14.28",
|
|
36
36
|
"@vueuse/core": "11.3.0",
|
|
37
37
|
"lodash-es": "4.17.21",
|
|
38
38
|
"pinia": "2.3.1",
|