@useinsider/guido 1.0.3-beta.901ea7e → 1.0.3-beta.90a7855
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 +3 -0
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/organisms/LoadingWrapper.vue.js +1 -1
- package/dist/components/organisms/header/RightSlot.vue2.js +13 -13
- package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +92 -0
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +36 -36
- package/dist/extensions/Blocks/Items/enums/controlEnums.js +2 -2
- package/dist/extensions/Blocks/Items/enums/productEnums.js +3 -2
- package/dist/extensions/Blocks/Items/extension.js +7 -6
- package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +2 -2
- package/dist/extensions/Blocks/Items/layouts/vertical.html.js +17 -5
- package/dist/extensions/Blocks/Items/settingsPanel.js +25 -24
- package/dist/extensions/Blocks/Items/store/items-block.js +7 -3
- package/dist/extensions/Blocks/Items/template.js +32 -30
- package/dist/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.js +35 -26
- package/dist/extensions/Blocks/Items/utils/updateAttributes.js +29 -27
- package/dist/extensions/Blocks/Unsubscribe/block.js +34 -30
- package/dist/guido.css +1 -1
- package/dist/src/extensions/Blocks/Items/controls/price/priceOrientation.d.ts +15 -0
- package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +2 -0
- package/dist/src/extensions/Blocks/Items/utils/syncAttributesFromConfigBlock.d.ts +6 -0
- package/dist/src/extensions/Blocks/Unsubscribe/block.d.ts +3 -4
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -600,6 +600,9 @@ Create a `.env` file with the following variables: (You can get env variables fr
|
|
|
600
600
|
VITE_STRIPO_PLUGIN_ID=your_plugin_id
|
|
601
601
|
VITE_STRIPO_SECRET_KEY=your_secret_key
|
|
602
602
|
VITE_STRIPO_ROLE=your_role
|
|
603
|
+
|
|
604
|
+
# Playwright Test Configuration (Optional - for local debugging only)
|
|
605
|
+
HEADED=false # Set to 'true' to run tests with visible browser
|
|
603
606
|
```
|
|
604
607
|
|
|
605
608
|
### Project Structure
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as H, ref as
|
|
1
|
+
import { defineComponent as H, ref as m, computed as _ } from "vue";
|
|
2
2
|
import { useConfig as h } from "../../../composables/useConfig.js";
|
|
3
3
|
import { useExport as V } from "../../../composables/useExport.js";
|
|
4
4
|
import { useTestEmailClick as x } from "../../../composables/useGuidoActions.js";
|
|
@@ -10,25 +10,25 @@ import { getTooltipOptions as O } from "../../../utils/tooltipUtils.js";
|
|
|
10
10
|
import { InButtonV2 as A } from "@useinsider/design-system-vue";
|
|
11
11
|
const J = /* @__PURE__ */ H({
|
|
12
12
|
__name: "RightSlot",
|
|
13
|
-
setup(k, { expose:
|
|
14
|
-
const { config:
|
|
15
|
-
if (
|
|
13
|
+
setup(k, { expose: c }) {
|
|
14
|
+
const { config: u } = h(), { exportHtml: r } = V(), { save: n } = E(), { openVersionHistory: i, closeVersionHistory: a } = w(), o = C(), t = T(), e = m(!1), s = m(!1), f = x(), v = () => {
|
|
15
|
+
if (o.isVersionHistoryOpen) {
|
|
16
16
|
a();
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
19
|
i();
|
|
20
|
-
},
|
|
20
|
+
}, d = async () => {
|
|
21
21
|
e.value = !0, await r(), e.value = !1;
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
s.value = !0,
|
|
26
|
-
const g = await n(
|
|
27
|
-
return s.value = !1,
|
|
22
|
+
}, y = () => {
|
|
23
|
+
o.isSaveAsTemplateDrawerOpen = !0;
|
|
24
|
+
}, S = _(() => o.isVersionHistoryOpen ? t("newsletter.close-version-history") : t("newsletter.version-history")), l = async (p) => {
|
|
25
|
+
s.value = !0, o.loadingStatus = !0;
|
|
26
|
+
const g = await n(p);
|
|
27
|
+
return s.value = !1, p && (o.loadingStatus = !1), g;
|
|
28
28
|
};
|
|
29
|
-
return
|
|
29
|
+
return c({
|
|
30
30
|
handleSave: l
|
|
31
|
-
}), { __sfc: !0, config:
|
|
31
|
+
}), { __sfc: !0, config: u, exportHtml: r, save: n, openVersionHistory: i, closeVersionHistory: a, editorStore: o, trans: t, isExporting: e, isSaving: s, testEmailClick: f, handleVersionHistory: v, handleExport: d, handleSaveAs: y, versionHistoryTooltipText: S, handleSave: l, getTooltipOptions: O, InButtonV2: A };
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
export {
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
var I = Object.defineProperty;
|
|
2
|
+
var y = (n, o, t) => o in n ? I(n, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[o] = t;
|
|
3
|
+
var m = (n, o, t) => y(n, typeof o != "symbol" ? o + "" : o, t);
|
|
4
|
+
import { ModificationDescription as h } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
|
+
import { CommonControl as E } from "../../../common-control.js";
|
|
6
|
+
import { ItemsBlockControlId as O } from "../../enums/controlEnums.js";
|
|
7
|
+
import { SETTINGS_ENUMS as N } from "../../enums/settingsEnums.js";
|
|
8
|
+
import { useItemsBlockStore as f } from "../../store/items-block.js";
|
|
9
|
+
import { syncPriceOrientationFromAttributes as T } from "../../utils/syncAttributesFromConfigBlock.js";
|
|
10
|
+
import { updateConfigBlockAttributes as P } from "../../utils/updateAttributes.js";
|
|
11
|
+
const _ = O.PRICE_ORIENTATION, p = {
|
|
12
|
+
PRICE_ORIENTATION: "priceOrientation"
|
|
13
|
+
}, C = [
|
|
14
|
+
{ icon: "vertical-orientation", value: "vertical" },
|
|
15
|
+
{ icon: "horizontal-orientation", value: "horizontal" }
|
|
16
|
+
];
|
|
17
|
+
class v extends E {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments);
|
|
20
|
+
m(this, "store", f());
|
|
21
|
+
}
|
|
22
|
+
getId() {
|
|
23
|
+
return _;
|
|
24
|
+
}
|
|
25
|
+
getTemplate() {
|
|
26
|
+
return `
|
|
27
|
+
<div class="${O.PRICE_ORIENTATION}">
|
|
28
|
+
${this._getPriceOrientation()}
|
|
29
|
+
</div>
|
|
30
|
+
`;
|
|
31
|
+
}
|
|
32
|
+
onRender() {
|
|
33
|
+
this.api.updateValues({ [p.PRICE_ORIENTATION]: this.store.priceOrientation }), this.api.onValueChanged(p.PRICE_ORIENTATION, (t) => {
|
|
34
|
+
this._onPriceOrientationChange(t);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
onTemplateNodeUpdated(t) {
|
|
38
|
+
super.onTemplateNodeUpdated(t), this.handleBlockInstanceChange(
|
|
39
|
+
() => {
|
|
40
|
+
T(this.currentNode);
|
|
41
|
+
},
|
|
42
|
+
() => {
|
|
43
|
+
this.api.updateValues({ [p.PRICE_ORIENTATION]: this.store.priceOrientation });
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
_onPriceOrientationChange(t) {
|
|
48
|
+
if (console.debug("Price orientation changed to: ", t), this.store.setPriceOrientation(t), P(this.currentNode, this.api), !this.currentNode)
|
|
49
|
+
return;
|
|
50
|
+
const { orientation: i } = this.store, r = i === N.ORIENTATION.VERTICAL, e = t === "horizontal";
|
|
51
|
+
r ? this._updateVerticalLayout(e) : this._updateHorizontalLayout(e);
|
|
52
|
+
}
|
|
53
|
+
_updateHorizontalLayout(t) {
|
|
54
|
+
var c, l, d, a;
|
|
55
|
+
const i = ((l = (c = this.currentNode) == null ? void 0 : c.closest(".ins-product-td")) == null ? void 0 : l.querySelectorAll(".product-price-class")) || [], r = ((a = (d = this.currentNode) == null ? void 0 : d.closest(".ins-product-td")) == null ? void 0 : a.querySelectorAll(".product-original-price-class")) || [];
|
|
56
|
+
if (!i || !r)
|
|
57
|
+
return;
|
|
58
|
+
const e = t ? "50%" : "100%", s = this.api.getDocumentModifier();
|
|
59
|
+
i.forEach((u) => {
|
|
60
|
+
s.modifyHtml(u).setAttribute("width", e).setStyle("width", e);
|
|
61
|
+
}), r.forEach((u) => {
|
|
62
|
+
s.modifyHtml(u).setAttribute("width", e).setStyle("width", e);
|
|
63
|
+
}), s.apply(new h(`Updated original price element width to ${e}`));
|
|
64
|
+
}
|
|
65
|
+
_updateVerticalLayout(t) {
|
|
66
|
+
var s, c, l, d;
|
|
67
|
+
const i = ((c = (s = this.currentNode) == null ? void 0 : s.closest(".ins-product-td")) == null ? void 0 : c.querySelectorAll(".horizontal-price")) || [], r = (d = (l = this.currentNode) == null ? void 0 : l.closest(".ins-product-td")) == null ? void 0 : d.querySelector(".vertical-price");
|
|
68
|
+
if (!i || !r || i.length === 0)
|
|
69
|
+
return;
|
|
70
|
+
const e = this.api.getDocumentModifier();
|
|
71
|
+
t ? (i.forEach((a) => {
|
|
72
|
+
e.modifyHtml(a).setStyle("display", "table-cell");
|
|
73
|
+
}), e.modifyHtml(r).setStyle("display", "none").apply(new h("Hide vertical price element"))) : (i.forEach((a) => {
|
|
74
|
+
e.modifyHtml(a).setStyle("display", "none");
|
|
75
|
+
}), e.modifyHtml(r).setStyle("display", "table-cell").apply(new h("Show vertical price element")));
|
|
76
|
+
}
|
|
77
|
+
_getPriceOrientation() {
|
|
78
|
+
return `
|
|
79
|
+
${this._GuTwoColumns([
|
|
80
|
+
this._GuLabel({ text: "Price Orientation" }),
|
|
81
|
+
this._GuRadioButton({
|
|
82
|
+
name: p.PRICE_ORIENTATION,
|
|
83
|
+
buttons: C
|
|
84
|
+
})
|
|
85
|
+
])}
|
|
86
|
+
`;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
export {
|
|
90
|
+
_ as CONTROL_BLOCK_ID,
|
|
91
|
+
v as PriceOrientationControl
|
|
92
|
+
};
|
|
@@ -12,7 +12,7 @@ import { useItemsBlockStore as $ } from "../store/items-block.js";
|
|
|
12
12
|
import { getDefaultTemplate as q } from "../template.js";
|
|
13
13
|
import { syncCurrencySymbolFromAttributes as k, syncCurrencyLocationFromAttributes as w, syncFormattedPriceFromAttributes as B } from "../utils/syncAttributesFromConfigBlock.js";
|
|
14
14
|
import { updateConfigBlockAttributes as f } from "../utils/updateAttributes.js";
|
|
15
|
-
const G = "ui-elements-items-block",
|
|
15
|
+
const G = "ui-elements-items-block", s = {
|
|
16
16
|
ITEMS_TYPE: "itemsType",
|
|
17
17
|
ORIENTATION: "orientation",
|
|
18
18
|
ITEM_IDS: "itemIds"
|
|
@@ -36,9 +36,9 @@ class te extends x {
|
|
|
36
36
|
}
|
|
37
37
|
onRender() {
|
|
38
38
|
this.api.updateValues({
|
|
39
|
-
[
|
|
40
|
-
[
|
|
41
|
-
[
|
|
39
|
+
[s.ORIENTATION]: this.store.orientation,
|
|
40
|
+
[s.ITEMS_TYPE]: this.store.itemsType,
|
|
41
|
+
[s.ITEM_IDS]: this.store.itemIds
|
|
42
42
|
}), this._listenToFormUpdates();
|
|
43
43
|
}
|
|
44
44
|
onTemplateNodeUpdated(e) {
|
|
@@ -48,9 +48,9 @@ class te extends x {
|
|
|
48
48
|
},
|
|
49
49
|
() => {
|
|
50
50
|
this.api.updateValues({
|
|
51
|
-
[
|
|
52
|
-
[
|
|
53
|
-
[
|
|
51
|
+
[s.ORIENTATION]: this.store.orientation,
|
|
52
|
+
[s.ITEMS_TYPE]: this.store.itemsType,
|
|
53
|
+
[s.ITEM_IDS]: this.store.itemIds
|
|
54
54
|
}), this._initializeSelectItems();
|
|
55
55
|
}
|
|
56
56
|
);
|
|
@@ -64,7 +64,7 @@ class te extends x {
|
|
|
64
64
|
${this._GuOneColumn([
|
|
65
65
|
this._GuLabel({ text: "Item Type" }),
|
|
66
66
|
this._GuSelect({
|
|
67
|
-
name:
|
|
67
|
+
name: s.ITEMS_TYPE,
|
|
68
68
|
className: "es-100",
|
|
69
69
|
placeholder: "Select Item Type",
|
|
70
70
|
options: P
|
|
@@ -77,7 +77,7 @@ class te extends x {
|
|
|
77
77
|
${this._GuTwoColumns([
|
|
78
78
|
this._GuLabel({ text: "Orientation" }),
|
|
79
79
|
this._GuRadioButton({
|
|
80
|
-
name:
|
|
80
|
+
name: s.ORIENTATION,
|
|
81
81
|
buttons: L
|
|
82
82
|
})
|
|
83
83
|
])}
|
|
@@ -88,7 +88,7 @@ class te extends x {
|
|
|
88
88
|
${this._GuTwoColumns([
|
|
89
89
|
this._GuLabel({ text: "Item in Cart" }),
|
|
90
90
|
this._GuSelect({
|
|
91
|
-
name:
|
|
91
|
+
name: s.ITEM_IDS,
|
|
92
92
|
className: "es-100",
|
|
93
93
|
placeholder: "Select Item In Cart",
|
|
94
94
|
options: []
|
|
@@ -97,7 +97,7 @@ class te extends x {
|
|
|
97
97
|
`;
|
|
98
98
|
}
|
|
99
99
|
_onOrientationChange(e) {
|
|
100
|
-
console.debug("Orientation changed to: ", e), this.store.setOrientation(e), this.api.updateValues({ [
|
|
100
|
+
console.debug("Orientation changed to: ", e), this.store.setOrientation(e), this.store.setPriceOrientation("horizontal"), this.api.updateValues({ [s.ORIENTATION]: e }), f(this.currentNode, this.api), this._reOrderTemplate(), setTimeout(() => {
|
|
101
101
|
this._recalculateTrimming();
|
|
102
102
|
}, 50);
|
|
103
103
|
}
|
|
@@ -106,36 +106,36 @@ class te extends x {
|
|
|
106
106
|
!i || !r || (this.store.setItemsType(i), this.store.setItemIds(r.value), f(this.currentNode, this.api), this._updateDataTypeAttributes(i), this._initializeSelectItems(), this._reFillTemplate());
|
|
107
107
|
}
|
|
108
108
|
_onItemIdsChange(e) {
|
|
109
|
-
console.debug("Item ids changed to: ", e), this.store.setItemIds(e), this.api.updateValues({ [
|
|
109
|
+
console.debug("Item ids changed to: ", e), this.store.setItemIds(e), this.api.updateValues({ [s.ITEM_IDS]: e }), f(this.currentNode, this.api), this._updateDataNumberAttributes(e), this._reFillTemplate();
|
|
110
110
|
}
|
|
111
111
|
_initializeSelectItems() {
|
|
112
112
|
this.api.setUIEAttribute(
|
|
113
|
-
|
|
113
|
+
s.ITEMS_TYPE,
|
|
114
114
|
A.SELECTPICKER.items,
|
|
115
115
|
P
|
|
116
116
|
);
|
|
117
117
|
const { itemsType: e, itemIds: i } = this.store;
|
|
118
118
|
this.api.updateValues({
|
|
119
|
-
[
|
|
119
|
+
[s.ITEMS_TYPE]: e
|
|
120
120
|
});
|
|
121
121
|
const t = N[e];
|
|
122
122
|
this.api.setUIEAttribute(
|
|
123
|
-
|
|
123
|
+
s.ITEM_IDS,
|
|
124
124
|
A.SELECTPICKER.items,
|
|
125
125
|
t
|
|
126
126
|
), this.api.updateValues({
|
|
127
|
-
[
|
|
127
|
+
[s.ITEM_IDS]: i
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
130
|
_listenToFormUpdates() {
|
|
131
131
|
this.api.onValueChanged(
|
|
132
|
-
|
|
132
|
+
s.ITEMS_TYPE,
|
|
133
133
|
(e) => this._onItemsTypeChange(e)
|
|
134
134
|
), this.api.onValueChanged(
|
|
135
|
-
|
|
135
|
+
s.ORIENTATION,
|
|
136
136
|
(e) => this._onOrientationChange(e)
|
|
137
137
|
), this.api.onValueChanged(
|
|
138
|
-
|
|
138
|
+
s.ITEM_IDS,
|
|
139
139
|
(e) => this._onItemIdsChange(e)
|
|
140
140
|
);
|
|
141
141
|
}
|
|
@@ -146,7 +146,7 @@ class te extends x {
|
|
|
146
146
|
itemIds: t,
|
|
147
147
|
currencySymbol: r,
|
|
148
148
|
currencyLocation: n,
|
|
149
|
-
formattedPrice:
|
|
149
|
+
formattedPrice: o
|
|
150
150
|
} = this.store;
|
|
151
151
|
this.api.getDocumentModifier().modifyHtml(this.currentNode).setInnerHtml(q({
|
|
152
152
|
orientation: e,
|
|
@@ -154,11 +154,11 @@ class te extends x {
|
|
|
154
154
|
itemId: t,
|
|
155
155
|
currencySymbol: r,
|
|
156
156
|
currencyLocation: n,
|
|
157
|
-
formattedPrice:
|
|
157
|
+
formattedPrice: o
|
|
158
158
|
})).apply(new d("Updated template"));
|
|
159
159
|
}
|
|
160
160
|
_getTemplateData() {
|
|
161
|
-
const { itemsType: e, itemIds: i, formattedPrice: t } = this.store, r = N[e].findIndex((
|
|
161
|
+
const { itemsType: e, itemIds: i, formattedPrice: t } = this.store, r = N[e].findIndex((o) => o.value === i), n = r > -1 ? r : 0;
|
|
162
162
|
return {
|
|
163
163
|
imageSrc: T.PAIRS_FOR_EXTENSION.imageSrc[e].DEFAULT[n],
|
|
164
164
|
name: T.PAIRS_FOR_EXTENSION.name[e].DEFAULT[n],
|
|
@@ -190,7 +190,7 @@ class te extends x {
|
|
|
190
190
|
const t = this._getParagraphFromBlock(i);
|
|
191
191
|
if (!t)
|
|
192
192
|
return;
|
|
193
|
-
const r = t.getInnerHTML() || "", n = t.getInnerText() || "", { currencySymbol:
|
|
193
|
+
const r = t.getInnerHTML() || "", n = t.getInnerText() || "", { currencySymbol: o, currencyLocation: a } = this.store, c = (o == null ? void 0 : o.trim()) || "", m = this._removeCurrencySymbol(n, c), u = this._replacePriceNumber(m, e), I = this._buildPriceContent(u, c, a), _ = r.replace(n, I);
|
|
194
194
|
this.api.getDocumentModifier().modifyHtml(t).setInnerHtml(_).apply(new d("Updated price"));
|
|
195
195
|
}
|
|
196
196
|
_updateOriginalPrice(e) {
|
|
@@ -206,7 +206,7 @@ class te extends x {
|
|
|
206
206
|
const r = t.querySelector("s");
|
|
207
207
|
if (!r)
|
|
208
208
|
return;
|
|
209
|
-
const n = r.getInnerHTML() || "",
|
|
209
|
+
const n = r.getInnerHTML() || "", o = r.getInnerText() || "", { currencySymbol: a, currencyLocation: c } = this.store, m = (a == null ? void 0 : a.trim()) || "", u = this._removeCurrencySymbol(o, m), I = this._replacePriceNumber(u, e), _ = this._buildPriceContent(I, m, c), E = `<s>${n.replace(o, _)}</s>`;
|
|
210
210
|
this.api.getDocumentModifier().modifyHtml(t).setInnerHtml(E).apply(new d("Updated original price"));
|
|
211
211
|
}
|
|
212
212
|
_updateQuantity(e) {
|
|
@@ -215,8 +215,8 @@ class te extends x {
|
|
|
215
215
|
if (!t)
|
|
216
216
|
return;
|
|
217
217
|
const r = t.getStyle("display") === "none", n = t.getInnerText().trim();
|
|
218
|
-
let
|
|
219
|
-
|
|
218
|
+
let o = t.getInnerHTML();
|
|
219
|
+
o = o.replace(n, e), this.api.getDocumentModifier().modifyHtml(t).setInnerHtml(o).setStyle("display", i && !r ? "table-cell" : "none").apply(new d("Updated quantity"));
|
|
220
220
|
}
|
|
221
221
|
/**
|
|
222
222
|
* @todo Optimize template reordering for performance.
|
|
@@ -226,13 +226,13 @@ class te extends x {
|
|
|
226
226
|
var I, _, g, E, y, O, C;
|
|
227
227
|
const e = (I = this.currentNode) == null ? void 0 : I.querySelector(`[esd-extension-block-id="${l.IMAGE}"]`), i = (_ = this.currentNode) == null ? void 0 : _.querySelector(`[esd-extension-block-id="${l.NAME}"]`), t = (g = this.currentNode) == null ? void 0 : g.querySelector(`[esd-extension-block-id="${l.PRICE}"]`), r = (E = this.currentNode) == null ? void 0 : E.querySelector(
|
|
228
228
|
`[esd-extension-block-id="${l.ORIGINAL_PRICE}"]`
|
|
229
|
-
), n = (y = this.currentNode) == null ? void 0 : y.querySelector(`[esd-extension-block-id="${l.QUANTITY}"]`),
|
|
230
|
-
if (!e || !i || !t || !r || !n || !
|
|
229
|
+
), n = (y = this.currentNode) == null ? void 0 : y.querySelector(`[esd-extension-block-id="${l.QUANTITY}"]`), o = (O = this.currentNode) == null ? void 0 : O.querySelector(`[esd-extension-block-id="${l.BUTTON}"]`), a = (C = this.currentNode) == null ? void 0 : C.querySelector("esd-config-block");
|
|
230
|
+
if (!e || !i || !t || !r || !n || !o || !a)
|
|
231
231
|
return;
|
|
232
232
|
const { orientation: c } = this.store, m = c === S.ORIENTATION.VERTICAL;
|
|
233
233
|
let u = m ? F : U;
|
|
234
234
|
this.api.getDocumentModifier().modifyHtml(e.querySelector("img")).setAttribute("width", H.productImageWidth).apply(new d("Updated image width")), setTimeout(() => {
|
|
235
|
-
u = u.replace("{-{-TEMPLATE_FIRST_LINE-}-}", m ? R : "").replace("{-{-PRODUCT_IMAGE-}-}", e.getOuterHTML()).replace("{-{-PRODUCT_NAME-}-}", i.getOuterHTML()).
|
|
235
|
+
u = u.replace("{-{-TEMPLATE_FIRST_LINE-}-}", m ? R : "").replace("{-{-PRODUCT_IMAGE-}-}", e.getOuterHTML()).replace("{-{-PRODUCT_NAME-}-}", i.getOuterHTML()).replaceAll("{-{-PRODUCT_PRICE-}-}", t.getOuterHTML()).replaceAll("{-{-PRODUCT_ORIGINAL_PRICE-}-}", r.getOuterHTML()).replace("{-{-PRODUCT_QUANTITY-}-}", n.getOuterHTML()).replace("{-{-PRODUCT_BUTTON-}-}", o.getOuterHTML()).replace("{-{-CONFIG_BLOCK-}-}", a.getOuterHTML()), u = u.trim().replace(R, "").slice(0, -5), this.api.getDocumentModifier().modifyHtml(this.currentNode).setInnerHtml(u).apply(new d("Reordered template"));
|
|
236
236
|
}, 50);
|
|
237
237
|
}
|
|
238
238
|
_updateDataTypeAttributes(e) {
|
|
@@ -240,8 +240,8 @@ class te extends x {
|
|
|
240
240
|
return;
|
|
241
241
|
const i = this.currentNode.closest(".ins-product-td"), t = this.api.getDocumentModifier();
|
|
242
242
|
i && t.modifyHtml(i).setAttribute("data-type", e), this.currentNode.querySelectorAll("[data-type]").forEach((n) => {
|
|
243
|
-
const
|
|
244
|
-
t.modifyHtml(
|
|
243
|
+
const o = n;
|
|
244
|
+
t.modifyHtml(o).setAttribute("data-type", e);
|
|
245
245
|
}), t.apply(new d("Updated data-type attribute"));
|
|
246
246
|
}
|
|
247
247
|
_updateDataNumberAttributes(e) {
|
|
@@ -258,11 +258,11 @@ class te extends x {
|
|
|
258
258
|
r = m;
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
|
-
const n = this.currentNode.closest(".ins-product-td"),
|
|
262
|
-
n &&
|
|
261
|
+
const n = this.currentNode.closest(".ins-product-td"), o = this.api.getDocumentModifier();
|
|
262
|
+
n && o.modifyHtml(n).setAttribute("data-number", r), this.currentNode.querySelectorAll("[data-number]").forEach((c) => {
|
|
263
263
|
const m = c;
|
|
264
|
-
|
|
265
|
-
}),
|
|
264
|
+
o.modifyHtml(m).setAttribute("data-number", r);
|
|
265
|
+
}), o.apply(new d("Updated data-number attribute"));
|
|
266
266
|
}
|
|
267
267
|
_reFillTemplate() {
|
|
268
268
|
const e = this._getTemplateData();
|
|
@@ -296,7 +296,7 @@ class te extends x {
|
|
|
296
296
|
} else {
|
|
297
297
|
const n = t.match(/([^0-9.,\s]+)/);
|
|
298
298
|
if (n && n[1]) {
|
|
299
|
-
const
|
|
299
|
+
const o = n[1].trim(), a = new RegExp(`\\s*${this._escapeRegex(o)}\\s*`);
|
|
300
300
|
r = t.replace(a, "").trim();
|
|
301
301
|
}
|
|
302
302
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var c = /* @__PURE__ */ ((i) => (i.BUTTON = "items-block-button", i.IMAGE = "items-block-image", i.ORIGINAL_PRICE = "items-block-original-price", i.PRICE = "items-block-price", i.QUANTITY = "items-block-quantity", i.NAME = "items-block-name", i))(c || {}),
|
|
1
|
+
var c = /* @__PURE__ */ ((i) => (i.BUTTON = "items-block-button", i.IMAGE = "items-block-image", i.ORIGINAL_PRICE = "items-block-original-price", i.PRICE = "items-block-price", i.QUANTITY = "items-block-quantity", i.NAME = "items-block-name", i))(c || {}), t = /* @__PURE__ */ ((i) => (i.BUTTON_ALIGN = "items-block-button-align-control", i.BUTTON_BORDER = "items-block-button-border-control", i.BUTTON_BORDER_RADIUS = "items-block-button-border-radius-control", i.BUTTON_COLOR = "items-block-button-color-control", i.BUTTON_FIT_TO_CONTENT = "items-block-button-fit-to-content-control", i.BUTTON_FONT_FAMILY = "items-block-button-font-family-control", i.BUTTON_MARGINS = "items-block-button-margins-control", i.BUTTON_PADDINGS = "items-block-button-paddings-control", i.BUTTON_TEXT = "items-block-button-text-control", i.BUTTON_TEXT_SIZE = "items-block-button-text-size-control", i.BUTTON_TEXT_STYLE_AND_FONT_COLOR = "items-block-button-text-style-and-font-color-control", i.BUTTON_LINK = "items-block-button-link-control", i.IMAGE_SIZE = "items-block-image-size-control", i.IMAGE_MARGINS = "items-block-image-margins-control", i.IMAGE_LINK = "items-block-image-link-control", i.ORIGINAL_PRICE_ALIGN = "items-block-original-price-align-control", i.ORIGINAL_PRICE_COLOR = "items-block-original-price-color-control", i.ORIGINAL_PRICE_SIZE = "items-block-original-price-size-control", i.ORIGINAL_PRICE_STYLE = "items-block-original-price-style-control", i.ORIGINAL_PRICE_FONT_FAMILY = "items-block-original-price-font-family-control", i.ORIGINAL_PRICE_BACKGROUND = "items-block-original-price-background-control", i.ORIGINAL_PRICE_PADDINGS = "items-block-original-price-paddings-control", i.PRICE_ALIGN = "items-block-price-align-control", i.PRICE_COLOR = "items-block-price-color-control", i.PRICE_SIZE = "items-block-price-size-control", i.PRICE_STYLE = "items-block-price-style-control", i.PRICE_FONT_FAMILY = "items-block-price-font-family-control", i.PRICE_BACKGROUND = "items-block-price-background-control", i.PRICE_PADDINGS = "items-block-price-paddings-control", i.PRICE_HIDE_DISCOUNT = "items-block-price-hide-discount-control", i.PRICE_FORMATTED_PRICE = "items-block-price-formatted-price-control", i.PRICE_CURRENCY_SYMBOL = "items-block-price-currency-symbol-control", i.PRICE_CURRENCY_LOCATION = "items-block-price-currency-location-control", i.PRICE_ORIENTATION = "items-block-price-orientation-control", i.NAME_ALIGN = "items-block-name-align-control", i.NAME_COLOR = "items-block-name-color-control", i.NAME_SIZE = "items-block-name-size-control", i.NAME_STYLE = "items-block-name-style-control", i.NAME_FONT_FAMILY = "items-block-name-font-family-control", i.NAME_BACKGROUND = "items-block-name-background-control", i.NAME_TRIMMING = "items-block-name-trimming-control", i.NAME_PADDINGS = "items-block-name-paddings-control", i.QUANTITY_ALIGN = "items-block-quantity-align-control", i.QUANTITY_COLOR = "items-block-quantity-color-control", i.QUANTITY_FONT_FAMILY = "items-block-quantity-font-family-control", i.QUANTITY_PADDINGS = "items-block-quantity-paddings-control", i.QUANTITY_SIZE = "items-block-quantity-size-control", i.QUANTITY_STYLE = "items-block-quantity-style-control", i))(t || {});
|
|
2
2
|
export {
|
|
3
|
-
|
|
3
|
+
t as ItemsBlockControlId,
|
|
4
4
|
c as ItemsBlockId
|
|
5
5
|
};
|
|
@@ -9,6 +9,7 @@ const o = '<td align="center" class="ins-product-td items-block items-block-v2">
|
|
|
9
9
|
PRODUCT_PRICE_FORMATTED: "data-product_price_formatted",
|
|
10
10
|
PRODUCT_PRICE_CURRENCY_SYMBOL: "data-product_price_currency_symbol",
|
|
11
11
|
PRODUCT_PRICE_CURRENCY_LOCATION: "data-product_price_currency_location",
|
|
12
|
+
PRODUCT_ORIGINAL_PRICE_CONTROL_ORIENTATION: "data-product_original_price_control_orientation",
|
|
12
13
|
PRODUCT_BUTTON_LINK: "data-product_button_link",
|
|
13
14
|
PRODUCT_IMAGE_LINK: "data-product_image_link",
|
|
14
15
|
PRODUCT_NAME_CONTROL_VALUE: "data-product_name_control_value",
|
|
@@ -214,7 +215,7 @@ const o = '<td align="center" class="ins-product-td items-block items-block-v2">
|
|
|
214
215
|
function m(e, a = 8) {
|
|
215
216
|
return i(1, a + 1).map((s) => `${e}_${s}`);
|
|
216
217
|
}
|
|
217
|
-
function
|
|
218
|
+
function r() {
|
|
218
219
|
const { PAIRS_FOR_EXTENSION: e } = t, a = [];
|
|
219
220
|
return a.push(
|
|
220
221
|
e.imageSrc.CART_ITEMS.ATTR,
|
|
@@ -262,7 +263,7 @@ function E() {
|
|
|
262
263
|
), a;
|
|
263
264
|
}
|
|
264
265
|
const p = _(
|
|
265
|
-
|
|
266
|
+
r(),
|
|
266
267
|
(e) => m(e)
|
|
267
268
|
);
|
|
268
269
|
export {
|
|
@@ -3,17 +3,18 @@ import { ItemsBlock as i } from "./block.js";
|
|
|
3
3
|
import { ButtonLinkControl as C } from "./controls/button/link.js";
|
|
4
4
|
import { ItemsBlockCardCompositionControl as e } from "./controls/cardComposition.js";
|
|
5
5
|
import { ImageLinkControl as m } from "./controls/image/link.js";
|
|
6
|
-
import { NameControls as
|
|
6
|
+
import { NameControls as r, QuantityControls as n, OriginalPriceControls as t, PriceControls as d, ImageControls as l, ButtonControls as o } from "./controls/index.js";
|
|
7
7
|
import { NameTrimmingControl as s } from "./controls/name/trimming.js";
|
|
8
8
|
import { PriceCurrencyLocationControl as c } from "./controls/price/currencyLocation.js";
|
|
9
9
|
import { PriceCurrencySymbolControl as g } from "./controls/price/currencySymbol.js";
|
|
10
10
|
import { PriceFormattedPriceControl as f } from "./controls/price/formattedPrice.js";
|
|
11
11
|
import { PriceHideDiscountControl as p } from "./controls/price/hideDiscount.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
12
|
+
import { PriceOrientationControl as y } from "./controls/price/priceOrientation.js";
|
|
13
|
+
import { ItemsBlockControl as u } from "./controls/settingsControl.js";
|
|
14
|
+
import { ItemsIconsRegistry as P } from "./iconsRegistry.js";
|
|
14
15
|
import k from "./items.css.js";
|
|
15
|
-
import { SettingsPanel as
|
|
16
|
-
const
|
|
16
|
+
import { SettingsPanel as I } from "./settingsPanel.js";
|
|
17
|
+
const H = new a().addBlock(i).withSettingsPanelRegistry(I).addControl(u).addControl(e).addControl(r.align).addControl(r.color).addControl(r.size).addControl(r.style).addControl(r.fontFamily).addControl(r.background).addControl(r.paddings).addControl(s).addControl(n.align).addControl(n.color).addControl(n.fontFamily).addControl(n.paddings).addControl(n.size).addControl(n.style).addControl(t.align).addControl(t.color).addControl(t.size).addControl(t.style).addControl(t.fontFamily).addControl(t.background).addControl(t.paddings).addControl(d.align).addControl(d.color).addControl(d.size).addControl(d.style).addControl(d.fontFamily).addControl(d.background).addControl(d.paddings).addControl(p).addControl(f).addControl(g).addControl(c).addControl(y).addControl(m).addControl(l.size).addControl(l.margins).addControl(C).addControl(o.align).addControl(o.border).addControl(o.borderRadius).addControl(o.color).addControl(o.fontFamily).addControl(o.margins).addControl(o.paddings).addControl(o.text).addControl(o.textSize).addControl(o.textStyleAndFontColor).addControl(o.fitToContent).addStyles(k).withIconsRegistry(P).build();
|
|
17
18
|
export {
|
|
18
|
-
|
|
19
|
+
H as default
|
|
19
20
|
};
|
|
@@ -33,7 +33,7 @@ const t = `{-{-TEMPLATE_FIRST_LINE-}-}
|
|
|
33
33
|
</td>
|
|
34
34
|
</tr>
|
|
35
35
|
<tr>
|
|
36
|
-
<td width="100%">
|
|
36
|
+
<td width="100%" class="product-quantity-class" data-slot-3>
|
|
37
37
|
<table width="100%">
|
|
38
38
|
<tbody>
|
|
39
39
|
{-{-PRODUCT_QUANTITY-}-}
|
|
@@ -42,7 +42,7 @@ const t = `{-{-TEMPLATE_FIRST_LINE-}-}
|
|
|
42
42
|
</td>
|
|
43
43
|
</tr>
|
|
44
44
|
<tr>
|
|
45
|
-
<td width="100%">
|
|
45
|
+
<td width="100%" class="product-button-class" data-slot-6>
|
|
46
46
|
<table width="100%">
|
|
47
47
|
<tbody>
|
|
48
48
|
{-{-PRODUCT_BUTTON-}-}
|
|
@@ -10,8 +10,8 @@ const t = `{-{-TEMPLATE_FIRST_LINE-}-}
|
|
|
10
10
|
<td class="product-image-class" data-slot-1>
|
|
11
11
|
{-{-PRODUCT_IMAGE-}-}
|
|
12
12
|
</td>
|
|
13
|
-
<td class="product-name-class" data-slot-2
|
|
14
|
-
<table
|
|
13
|
+
<td class="product-name-class" data-slot-2>
|
|
14
|
+
<table>
|
|
15
15
|
<tbody>
|
|
16
16
|
{-{-PRODUCT_NAME-}-}
|
|
17
17
|
</tbody>
|
|
@@ -24,21 +24,33 @@ const t = `{-{-TEMPLATE_FIRST_LINE-}-}
|
|
|
24
24
|
</tbody>
|
|
25
25
|
</table>
|
|
26
26
|
</td>
|
|
27
|
-
<td class="product-price-class" data-slot-4>
|
|
28
|
-
|
|
27
|
+
<td class="product-price-class horizontal-price" data-slot-4>
|
|
29
28
|
<table width="100%">
|
|
30
29
|
<tbody>
|
|
31
30
|
{-{-PRODUCT_PRICE-}-}
|
|
32
31
|
</tbody>
|
|
33
32
|
</table>
|
|
34
33
|
</td>
|
|
35
|
-
<td class="product-original-price-class" data-slot-5>
|
|
34
|
+
<td class="product-original-price-class horizontal-price" data-slot-5>
|
|
36
35
|
<table width="100%">
|
|
37
36
|
<tbody>
|
|
38
37
|
{-{-PRODUCT_ORIGINAL_PRICE-}-}
|
|
39
38
|
</tbody>
|
|
40
39
|
</table>
|
|
41
40
|
</td>
|
|
41
|
+
<td class="product-price-container vertical-price" data-slot-4 style="display: none;">
|
|
42
|
+
<table class="product-price-class" width="100%" data-slot-4>
|
|
43
|
+
<tbody>
|
|
44
|
+
{-{-PRODUCT_PRICE-}-}
|
|
45
|
+
</tbody>
|
|
46
|
+
</table>
|
|
47
|
+
<table class="product-original-price-class product-original-price-container"
|
|
48
|
+
width="100%" data-slot-5>
|
|
49
|
+
<tbody>
|
|
50
|
+
{-{-PRODUCT_ORIGINAL_PRICE-}-}
|
|
51
|
+
</tbody>
|
|
52
|
+
</table>
|
|
53
|
+
</td>
|
|
42
54
|
<td class="product-button-class" data-slot-6>
|
|
43
55
|
<table width="100%">
|
|
44
56
|
<tbody>
|