@useinsider/guido 2.1.0-beta.01eaf27 → 2.1.0-beta.411f2a9
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/extensions/Blocks/Items/block.js +27 -25
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +153 -147
- package/dist/extensions/Blocks/Items/extension.js +8 -9
- package/dist/extensions/Blocks/Items/template.js +5 -4
- package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +16 -16
- package/dist/package.json.js +1 -1
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +8 -8
- package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +2 -1
- package/package.json +2 -2
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { useOnboardingStore as
|
|
2
|
-
import { Block as
|
|
3
|
-
import { SETTINGS_ENUMS as
|
|
4
|
-
import { getDefaultTemplate as
|
|
5
|
-
import { getItemsBlockContainer as
|
|
6
|
-
const
|
|
7
|
-
class
|
|
1
|
+
import { useOnboardingStore as d } from "../../../stores/onboarding.js";
|
|
2
|
+
import { Block as g, BlockCompositionType as f, ModificationDescription as o } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
3
|
+
import { SETTINGS_ENUMS as c, DefaultConfigValues as i } from "./enums/settingsEnums.js";
|
|
4
|
+
import { getDefaultTemplate as p } from "./template.js";
|
|
5
|
+
import { getItemsBlockContainer as u, getItemsBlockConfig as C, getDefaultItemsBlockConfig as I } from "./utils/nodeConfigUtils.js";
|
|
6
|
+
const y = "items-block";
|
|
7
|
+
class B extends g {
|
|
8
8
|
getId() {
|
|
9
|
-
return
|
|
9
|
+
return y;
|
|
10
10
|
}
|
|
11
11
|
getIcon() {
|
|
12
12
|
return "items-icon";
|
|
13
13
|
}
|
|
14
14
|
getBlockCompositionType() {
|
|
15
|
-
return
|
|
15
|
+
return f.CONTAINER;
|
|
16
16
|
}
|
|
17
17
|
getName() {
|
|
18
18
|
return this.api.translate("Items");
|
|
@@ -21,32 +21,34 @@ class S extends m {
|
|
|
21
21
|
return this.api.translate("Items lets you display personalized products based on user behavior.");
|
|
22
22
|
}
|
|
23
23
|
getTemplate() {
|
|
24
|
-
return
|
|
25
|
-
orientation:
|
|
26
|
-
itemsType:
|
|
24
|
+
return p({
|
|
25
|
+
orientation: c.ORIENTATION.VERTICAL,
|
|
26
|
+
itemsType: c.ITEMS_TYPE.CART_ITEMS,
|
|
27
27
|
itemId: "{{Abandoned Cart Item (1) Url}}",
|
|
28
|
-
currencySymbol:
|
|
29
|
-
currencyLocation:
|
|
30
|
-
formattedPrice:
|
|
28
|
+
currencySymbol: i.productPriceCurrencySymbolControlValue,
|
|
29
|
+
currencyLocation: i.productPriceCurrencyLocationControlValue,
|
|
30
|
+
formattedPrice: i.productPriceFormattedControlValue === "1"
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
allowInnerBlocksDND() {
|
|
34
34
|
return !1;
|
|
35
35
|
}
|
|
36
|
-
onCreated(
|
|
37
|
-
const
|
|
38
|
-
|
|
36
|
+
onCreated(n) {
|
|
37
|
+
const s = this.api.getDocumentModifier(), r = this.api.getDocumentRootCssNode();
|
|
38
|
+
r.querySelector('[product-attr="imageSrc"] img') || s.modifyCss(r).appendRule('[product-attr="imageSrc"] img {object-fit: contain;}');
|
|
39
|
+
const e = u(n);
|
|
40
|
+
if (!e)
|
|
39
41
|
return;
|
|
40
|
-
const
|
|
41
|
-
if (
|
|
42
|
-
|
|
42
|
+
const a = e.getNodeConfig(), l = a && Object.keys(a).length > 0, t = C(n);
|
|
43
|
+
if (t != null && t.initialized)
|
|
44
|
+
l ? t.blockInstanceId || this.api.getDocumentModifier().modifyHtml(e).setNodeConfig({ ...t, blockInstanceId: String(Date.now()) }).apply(new o("Assign block instance ID to block")) : this.api.getDocumentModifier().modifyHtml(e).setNodeConfig(t).apply(new o("Migrate legacy config to nodeConfig"));
|
|
43
45
|
else {
|
|
44
|
-
const
|
|
45
|
-
this.api.getDocumentModifier().modifyHtml(
|
|
46
|
+
const m = I();
|
|
47
|
+
this.api.getDocumentModifier().modifyHtml(e).setNodeConfig(m).apply(new o("Initialize Items block with default configuration")), d().startOnboarding("itemsOnboarding");
|
|
46
48
|
}
|
|
47
49
|
}
|
|
48
50
|
}
|
|
49
51
|
export {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
y as BLOCK_ID,
|
|
53
|
+
B as ItemsBlock
|
|
52
54
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ModificationDescription as N, UEAttr as L } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
2
|
import { CommonControl as U } from "../../common-control.js";
|
|
3
|
-
import { ItemsBlockId as
|
|
4
|
-
import { productPairs as
|
|
5
|
-
import { SETTINGS_ENUMS as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { getDefaultTemplate as
|
|
9
|
-
import { getItemsBlockConfig as
|
|
10
|
-
const
|
|
3
|
+
import { ItemsBlockId as T } from "../enums/controlEnums.js";
|
|
4
|
+
import { productPairs as y, templateFirstLine as b } from "../enums/productEnums.js";
|
|
5
|
+
import { SETTINGS_ENUMS as p, ItemTypeOptions as D, OrientationOptions as k, ItemInCartOptions as g, DefaultConfigValues as x } from "../enums/settingsEnums.js";
|
|
6
|
+
import F from "../layouts/horizontal.html.js";
|
|
7
|
+
import $ from "../layouts/vertical.html.js";
|
|
8
|
+
import { getDefaultTemplate as q } from "../template.js";
|
|
9
|
+
import { getItemsBlockConfig as h, setItemsBlockConfig as O, escapeReplacement as A } from "../utils/nodeConfigUtils.js";
|
|
10
|
+
const w = "ui-elements-items-block", m = {
|
|
11
11
|
ITEMS_TYPE: "itemsType",
|
|
12
12
|
ORIENTATION: "orientation",
|
|
13
13
|
ITEM_IDS: "itemIds"
|
|
14
14
|
};
|
|
15
|
-
class
|
|
15
|
+
class Z extends U {
|
|
16
16
|
getId() {
|
|
17
|
-
return
|
|
17
|
+
return w;
|
|
18
18
|
}
|
|
19
19
|
getTemplate() {
|
|
20
20
|
return `
|
|
@@ -26,20 +26,20 @@ class X extends U {
|
|
|
26
26
|
`;
|
|
27
27
|
}
|
|
28
28
|
onRender() {
|
|
29
|
-
const e =
|
|
29
|
+
const e = h(this.currentNode);
|
|
30
30
|
this.api.updateValues({
|
|
31
|
-
[
|
|
32
|
-
[
|
|
33
|
-
[
|
|
31
|
+
[m.ORIENTATION]: (e == null ? void 0 : e.orientation) ?? p.ORIENTATION.VERTICAL,
|
|
32
|
+
[m.ITEMS_TYPE]: (e == null ? void 0 : e.type) ?? p.ITEMS_TYPE.CART_ITEMS,
|
|
33
|
+
[m.ITEM_IDS]: (e == null ? void 0 : e.itemsSelectValue) ?? ""
|
|
34
34
|
}), this._listenToFormUpdates();
|
|
35
35
|
}
|
|
36
36
|
onTemplateNodeUpdated(e) {
|
|
37
37
|
super.onTemplateNodeUpdated(e), console.debug("Items Block Config", e.getNodeConfig()), this.handleBlockInstanceChange(() => {
|
|
38
|
-
const t =
|
|
38
|
+
const t = h(this.currentNode);
|
|
39
39
|
this.api.updateValues({
|
|
40
|
-
[
|
|
41
|
-
[
|
|
42
|
-
[
|
|
40
|
+
[m.ORIENTATION]: (t == null ? void 0 : t.orientation) ?? p.ORIENTATION.VERTICAL,
|
|
41
|
+
[m.ITEMS_TYPE]: (t == null ? void 0 : t.type) ?? p.ITEMS_TYPE.CART_ITEMS,
|
|
42
|
+
[m.ITEM_IDS]: (t == null ? void 0 : t.itemsSelectValue) ?? ""
|
|
43
43
|
}), this._initializeSelectItems();
|
|
44
44
|
});
|
|
45
45
|
}
|
|
@@ -48,10 +48,10 @@ class X extends U {
|
|
|
48
48
|
${this._GuOneColumn([
|
|
49
49
|
this._GuLabel({ text: "Item Type" }),
|
|
50
50
|
this._GuSelect({
|
|
51
|
-
name:
|
|
51
|
+
name: m.ITEMS_TYPE,
|
|
52
52
|
className: "es-100",
|
|
53
53
|
placeholder: "Select Item Type",
|
|
54
|
-
options:
|
|
54
|
+
options: D
|
|
55
55
|
})
|
|
56
56
|
])}
|
|
57
57
|
`;
|
|
@@ -61,8 +61,8 @@ class X extends U {
|
|
|
61
61
|
${this._GuTwoColumns([
|
|
62
62
|
this._GuLabel({ text: "Orientation" }),
|
|
63
63
|
this._GuRadioButton({
|
|
64
|
-
name:
|
|
65
|
-
buttons:
|
|
64
|
+
name: m.ORIENTATION,
|
|
65
|
+
buttons: k
|
|
66
66
|
})
|
|
67
67
|
])}
|
|
68
68
|
`;
|
|
@@ -72,7 +72,7 @@ class X extends U {
|
|
|
72
72
|
${this._GuTwoColumns([
|
|
73
73
|
this._GuLabel({ text: "Item in Cart" }),
|
|
74
74
|
this._GuSelect({
|
|
75
|
-
name:
|
|
75
|
+
name: m.ITEM_IDS,
|
|
76
76
|
className: "es-100",
|
|
77
77
|
placeholder: "Select Item In Cart",
|
|
78
78
|
options: []
|
|
@@ -81,213 +81,219 @@ class X extends U {
|
|
|
81
81
|
`;
|
|
82
82
|
}
|
|
83
83
|
_onOrientationChange(e) {
|
|
84
|
-
this.api.updateValues({ [
|
|
84
|
+
this.api.updateValues({ [m.ORIENTATION]: e });
|
|
85
|
+
const t = this.api.getDocumentModifier();
|
|
86
|
+
O(this.currentNode, this.api, {
|
|
85
87
|
orientation: e,
|
|
86
88
|
priceOrientation: "horizontal"
|
|
87
|
-
}), this._reOrderTemplate(), setTimeout(() => {
|
|
89
|
+
}, t), t.apply(new N("Changed orientation")), this._reOrderTemplate(), setTimeout(() => {
|
|
88
90
|
this._recalculateTrimming();
|
|
89
91
|
}, 50);
|
|
90
92
|
}
|
|
91
93
|
_onItemsTypeChange(e) {
|
|
92
|
-
const t =
|
|
94
|
+
const t = p.ITEMS_TYPE[e], r = g[e], i = r == null ? void 0 : r[0];
|
|
93
95
|
if (!t || !i)
|
|
94
96
|
return;
|
|
95
|
-
const n = i.value,
|
|
97
|
+
const n = i.value, s = i.value.replace("Url}}", "Image}}"), o = this.api.getDocumentModifier();
|
|
96
98
|
O(this.currentNode, this.api, {
|
|
97
99
|
source: t,
|
|
98
100
|
type: t,
|
|
99
101
|
itemsSelectValue: i.value,
|
|
100
|
-
imageLink:
|
|
102
|
+
imageLink: s,
|
|
101
103
|
buttonLink: n
|
|
102
|
-
}), this._updateDataTypeAttributes(t
|
|
104
|
+
}, o), this._updateDataTypeAttributes(t, o), this._initializeSelectItems();
|
|
105
|
+
const l = this._getTemplateData(t);
|
|
106
|
+
this._updateImageSrc(l.imageSrc, o), this._updateName(l.name, o), this._updatePrice(l.price, o), this._updateOriginalPrice(l.originalPrice, o), this._updateQuantity(l.quantity, t, o), o.apply(new N("Updated items type"));
|
|
103
107
|
}
|
|
104
108
|
_onItemIdsChange(e) {
|
|
105
|
-
this.api.updateValues({ [
|
|
106
|
-
const t = e, r = e.replace("Url}}", "Image}}");
|
|
109
|
+
this.api.updateValues({ [m.ITEM_IDS]: e });
|
|
110
|
+
const t = e, r = e.replace("Url}}", "Image}}"), i = this.api.getDocumentModifier();
|
|
107
111
|
O(this.currentNode, this.api, {
|
|
108
112
|
itemsSelectValue: e,
|
|
109
113
|
imageLink: r,
|
|
110
114
|
buttonLink: t
|
|
111
|
-
}), this._updateDataNumberAttributes(e
|
|
115
|
+
}, i), this._updateDataNumberAttributes(e, i);
|
|
116
|
+
const n = this._getTemplateData();
|
|
117
|
+
this._updateImageSrc(n.imageSrc, i), this._updateName(n.name, i), this._updatePrice(n.price, i), this._updateOriginalPrice(n.originalPrice, i), this._updateQuantity(n.quantity, void 0, i), i.apply(new N("Updated item selection"));
|
|
112
118
|
}
|
|
113
119
|
_initializeSelectItems() {
|
|
114
120
|
this.api.setUIEAttribute(
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
121
|
+
m.ITEMS_TYPE,
|
|
122
|
+
L.SELECTPICKER.items,
|
|
123
|
+
D
|
|
118
124
|
);
|
|
119
|
-
const e =
|
|
125
|
+
const e = h(this.currentNode), t = (e == null ? void 0 : e.type) ?? p.ITEMS_TYPE.CART_ITEMS, r = (e == null ? void 0 : e.itemsSelectValue) ?? "";
|
|
120
126
|
this.api.updateValues({
|
|
121
|
-
[
|
|
127
|
+
[m.ITEMS_TYPE]: t
|
|
122
128
|
});
|
|
123
|
-
const i =
|
|
129
|
+
const i = g[t];
|
|
124
130
|
this.api.setUIEAttribute(
|
|
125
|
-
|
|
126
|
-
|
|
131
|
+
m.ITEM_IDS,
|
|
132
|
+
L.SELECTPICKER.items,
|
|
127
133
|
i
|
|
128
134
|
), this.api.updateValues({
|
|
129
|
-
[
|
|
135
|
+
[m.ITEM_IDS]: r
|
|
130
136
|
});
|
|
131
137
|
}
|
|
132
138
|
_listenToFormUpdates() {
|
|
133
139
|
this.api.onValueChanged(
|
|
134
|
-
|
|
140
|
+
m.ITEMS_TYPE,
|
|
135
141
|
(e) => this._onItemsTypeChange(e)
|
|
136
142
|
), this.api.onValueChanged(
|
|
137
|
-
|
|
143
|
+
m.ORIENTATION,
|
|
138
144
|
(e) => this._onOrientationChange(e)
|
|
139
145
|
), this.api.onValueChanged(
|
|
140
|
-
|
|
146
|
+
m.ITEM_IDS,
|
|
141
147
|
(e) => this._onItemIdsChange(e)
|
|
142
148
|
);
|
|
143
149
|
}
|
|
144
150
|
_renderTemplate() {
|
|
145
|
-
const e =
|
|
146
|
-
this.api.getDocumentModifier().modifyHtml(this.currentNode).setInnerHtml(
|
|
151
|
+
const e = h(this.currentNode), t = (e == null ? void 0 : e.orientation) ?? p.ORIENTATION.VERTICAL, r = (e == null ? void 0 : e.type) ?? p.ITEMS_TYPE.CART_ITEMS, i = (e == null ? void 0 : e.itemsSelectValue) ?? "", n = (e == null ? void 0 : e.priceCurrencySymbol) ?? "", s = (e == null ? void 0 : e.priceCurrencyLocation) ?? "0", o = (e == null ? void 0 : e.priceFormatted) ?? !1;
|
|
152
|
+
this.api.getDocumentModifier().modifyHtml(this.currentNode).setInnerHtml(q({
|
|
147
153
|
orientation: t,
|
|
148
154
|
itemsType: r,
|
|
149
155
|
itemId: i,
|
|
150
156
|
currencySymbol: n,
|
|
151
|
-
currencyLocation:
|
|
152
|
-
formattedPrice:
|
|
153
|
-
})).apply(new
|
|
157
|
+
currencyLocation: s,
|
|
158
|
+
formattedPrice: o
|
|
159
|
+
})).apply(new N("Updated template"));
|
|
154
160
|
}
|
|
155
161
|
_getTemplateData(e) {
|
|
156
|
-
const t =
|
|
157
|
-
let
|
|
158
|
-
return
|
|
159
|
-
imageSrc:
|
|
160
|
-
name:
|
|
161
|
-
price:
|
|
162
|
-
originalPrice:
|
|
163
|
-
quantity:
|
|
164
|
-
button:
|
|
162
|
+
const t = h(this.currentNode), r = e ?? (t == null ? void 0 : t.type) ?? p.ITEMS_TYPE.CART_ITEMS, i = (t == null ? void 0 : t.itemsSelectValue) ?? "", n = (t == null ? void 0 : t.priceFormatted) ?? !1, s = (t == null ? void 0 : t.priceSinglePrice) ?? !1, o = g[r].findIndex((d) => d.value === i), l = o > -1 ? o : 0, a = y.PAIRS_FOR_EXTENSION.price[r], c = y.PAIRS_FOR_EXTENSION.originalPrice[r];
|
|
163
|
+
let I, u;
|
|
164
|
+
return s ? (I = n ? a.DEFAULT_SINGLE_PRICE_FORMATTED : a.DEFAULT_SINGLE_PRICE, u = n ? c.DEFAULT_SINGLE_PRICE_FORMATTED : c.DEFAULT_SINGLE_PRICE) : (I = n ? a.DEFAULT_PRICE_FORMATTED : a.DEFAULT_PRICE, u = n ? c.DEFAULT_PRICE_FORMATTED : c.DEFAULT_PRICE), {
|
|
165
|
+
imageSrc: y.PAIRS_FOR_EXTENSION.imageSrc[r].DEFAULT[l],
|
|
166
|
+
name: y.PAIRS_FOR_EXTENSION.name[r].DEFAULT[l],
|
|
167
|
+
price: I,
|
|
168
|
+
originalPrice: u,
|
|
169
|
+
quantity: y.PAIRS_FOR_EXTENSION.quantity[r].DEFAULT,
|
|
170
|
+
button: y.PAIRS_FOR_EXTENSION.button[r].DEFAULT_LABEL
|
|
165
171
|
};
|
|
166
172
|
}
|
|
167
|
-
_updateImageSrc(e) {
|
|
168
|
-
var
|
|
169
|
-
const
|
|
170
|
-
|
|
173
|
+
_updateImageSrc(e, t) {
|
|
174
|
+
var i;
|
|
175
|
+
const r = (i = this.currentNode) == null ? void 0 : i.querySelector(`[esd-extension-block-id="${T.IMAGE}"] img`);
|
|
176
|
+
r && t.modifyHtml(r).setAttribute("src", e);
|
|
171
177
|
}
|
|
172
|
-
_updateName(e) {
|
|
173
|
-
var
|
|
174
|
-
const
|
|
175
|
-
if (!
|
|
178
|
+
_updateName(e, t) {
|
|
179
|
+
var s;
|
|
180
|
+
const r = (s = this.currentNode) == null ? void 0 : s.querySelector(`[esd-extension-block-id="${T.NAME}"]`);
|
|
181
|
+
if (!r)
|
|
176
182
|
return;
|
|
177
|
-
const
|
|
178
|
-
let
|
|
179
|
-
|
|
183
|
+
const i = r.getInnerText().trim();
|
|
184
|
+
let n = r.getInnerHTML().trim();
|
|
185
|
+
n = n.replace(i, A(e)), t.modifyHtml(r).setInnerHtml(n);
|
|
180
186
|
}
|
|
181
|
-
_updatePrice(e) {
|
|
187
|
+
_updatePrice(e, t) {
|
|
182
188
|
var o;
|
|
183
|
-
const
|
|
184
|
-
`[esd-extension-block-id="${
|
|
185
|
-
)) || [],
|
|
186
|
-
|
|
187
|
-
const
|
|
188
|
-
if (!
|
|
189
|
+
const r = ((o = this.currentNode) == null ? void 0 : o.querySelectorAll(
|
|
190
|
+
`[esd-extension-block-id="${T.PRICE}"]`
|
|
191
|
+
)) || [], i = h(this.currentNode), n = (i == null ? void 0 : i.priceCurrencySymbol) ?? "", s = (i == null ? void 0 : i.priceCurrencyLocation) ?? "0";
|
|
192
|
+
r.forEach((l) => {
|
|
193
|
+
const a = this._getParagraphFromBlock(l);
|
|
194
|
+
if (!a)
|
|
189
195
|
return;
|
|
190
|
-
const
|
|
191
|
-
|
|
196
|
+
const c = a.getInnerHTML().trim() || "", I = a.getInnerText().trim() || "", u = (n == null ? void 0 : n.trim()) || "", d = this._removeCurrencySymbol(I, u), _ = this._replacePriceNumber(d, e), E = this._buildPriceContent(_, u, s), S = c.replace(I, A(E));
|
|
197
|
+
t.modifyHtml(a).setInnerHtml(S);
|
|
192
198
|
});
|
|
193
199
|
}
|
|
194
|
-
_updateOriginalPrice(e) {
|
|
200
|
+
_updateOriginalPrice(e, t) {
|
|
195
201
|
var o;
|
|
196
|
-
const
|
|
197
|
-
`[esd-extension-block-id="${
|
|
198
|
-
)) || [],
|
|
199
|
-
|
|
200
|
-
const
|
|
201
|
-
if (!
|
|
202
|
+
const r = ((o = this.currentNode) == null ? void 0 : o.querySelectorAll(
|
|
203
|
+
`[esd-extension-block-id="${T.ORIGINAL_PRICE}"]`
|
|
204
|
+
)) || [], i = h(this.currentNode), n = (i == null ? void 0 : i.priceCurrencySymbol) ?? "", s = (i == null ? void 0 : i.priceCurrencyLocation) ?? "0";
|
|
205
|
+
r.forEach((l) => {
|
|
206
|
+
const a = this._getParagraphFromBlock(l);
|
|
207
|
+
if (!a)
|
|
202
208
|
return;
|
|
203
|
-
const
|
|
204
|
-
if (!
|
|
209
|
+
const c = a.querySelector("s");
|
|
210
|
+
if (!c)
|
|
205
211
|
return;
|
|
206
|
-
const
|
|
207
|
-
|
|
212
|
+
const I = c.getInnerHTML().trim() || "", u = c.getInnerText().trim() || "", d = (n == null ? void 0 : n.trim()) || "", _ = this._removeCurrencySymbol(u, d), E = this._replacePriceNumber(_, e), S = this._buildPriceContent(E, d, s), R = `<s>${I.replace(u, A(S))}</s>`;
|
|
213
|
+
t.modifyHtml(a).setInnerHtml(R);
|
|
208
214
|
});
|
|
209
215
|
}
|
|
210
|
-
_updateQuantity(e, t) {
|
|
216
|
+
_updateQuantity(e, t, r) {
|
|
211
217
|
var _;
|
|
212
|
-
const
|
|
213
|
-
if (!
|
|
218
|
+
const i = h(this.currentNode), s = (t ?? (i == null ? void 0 : i.type) ?? p.ITEMS_TYPE.CART_ITEMS) !== p.ITEMS_TYPE.BROWSED_ITEMS, o = (i == null ? void 0 : i.quantityControlEnabled) !== !1, l = s && o, a = (_ = this.currentNode) == null ? void 0 : _.querySelector(`[esd-extension-block-id="${T.QUANTITY}"]`);
|
|
219
|
+
if (!a)
|
|
214
220
|
return;
|
|
215
|
-
const
|
|
216
|
-
if (!
|
|
221
|
+
const c = this._getParagraphFromBlock(a);
|
|
222
|
+
if (!c)
|
|
217
223
|
return;
|
|
218
|
-
const
|
|
219
|
-
let u =
|
|
220
|
-
function
|
|
221
|
-
return
|
|
222
|
-
new RegExp(`(>\\s*)?${
|
|
223
|
-
`$1${
|
|
224
|
+
const I = c.getInnerText().trim();
|
|
225
|
+
let u = c.getInnerHTML().trim();
|
|
226
|
+
function d(E, S, C) {
|
|
227
|
+
return E.replace(
|
|
228
|
+
new RegExp(`(>\\s*)?${S}(\\s*<)?`, "g"),
|
|
229
|
+
`$1${C}$2`
|
|
224
230
|
);
|
|
225
231
|
}
|
|
226
|
-
u =
|
|
227
|
-
const T = this.api.getDocumentModifier();
|
|
228
|
-
T.modifyHtml(s).setInnerHtml(u), T.modifyHtml(c).setStyle("display", a ? "table-cell" : "none"), T.apply(new h("Updated quantity"));
|
|
232
|
+
u = d(u, I, e), r.modifyHtml(c).setInnerHtml(u), r.modifyHtml(a).setStyle("display", l ? "table-cell" : "none");
|
|
229
233
|
}
|
|
230
|
-
_reOrderTemplate() {
|
|
231
|
-
var
|
|
232
|
-
const
|
|
233
|
-
`[esd-extension-block-id="${
|
|
234
|
-
)) || [],
|
|
235
|
-
`[esd-extension-block-id="${
|
|
236
|
-
)) || [], [
|
|
237
|
-
if (!
|
|
234
|
+
_reOrderTemplate(e) {
|
|
235
|
+
var _, E, S, C, R, M;
|
|
236
|
+
const t = (_ = this.currentNode) == null ? void 0 : _.querySelector(`[esd-extension-block-id="${T.IMAGE}"]`), r = (E = this.currentNode) == null ? void 0 : E.querySelector(`[esd-extension-block-id="${T.NAME}"]`), i = ((S = this.currentNode) == null ? void 0 : S.querySelectorAll(
|
|
237
|
+
`[esd-extension-block-id="${T.PRICE}"]`
|
|
238
|
+
)) || [], n = ((C = this.currentNode) == null ? void 0 : C.querySelectorAll(
|
|
239
|
+
`[esd-extension-block-id="${T.ORIGINAL_PRICE}"]`
|
|
240
|
+
)) || [], [s] = i, [o] = n, l = (R = this.currentNode) == null ? void 0 : R.querySelector(`[esd-extension-block-id="${T.QUANTITY}"]`), a = (M = this.currentNode) == null ? void 0 : M.querySelector(`[esd-extension-block-id="${T.BUTTON}"]`);
|
|
241
|
+
if (!t || !r || !s || !o || !l || !a)
|
|
238
242
|
return;
|
|
239
|
-
const
|
|
240
|
-
let
|
|
241
|
-
|
|
242
|
-
const
|
|
243
|
-
|
|
243
|
+
const c = h(this.currentNode), u = ((c == null ? void 0 : c.orientation) ?? p.ORIENTATION.VERTICAL) === p.ORIENTATION.VERTICAL;
|
|
244
|
+
let d = u ? $ : F;
|
|
245
|
+
setTimeout(() => {
|
|
246
|
+
const H = A(s.getOuterHTML()), f = A(o.getOuterHTML());
|
|
247
|
+
d = d.replace("{-{-TEMPLATE_FIRST_LINE-}-}", u ? b : "").replace("{-{-PRODUCT_IMAGE-}-}", t.getOuterHTML()).replace("{-{-PRODUCT_NAME-}-}", r.getOuterHTML()).replaceAll("{-{-PRODUCT_PRICE-}-}", H).replaceAll("{-{-PRODUCT_ORIGINAL_PRICE-}-}", f).replace("{-{-PRODUCT_QUANTITY-}-}", l.getOuterHTML()).replace("{-{-PRODUCT_BUTTON-}-}", a.getOuterHTML()), d = d.trim().replace(b, "").slice(0, -5);
|
|
248
|
+
const P = e ?? this.api.getDocumentModifier();
|
|
249
|
+
P.modifyHtml(t.querySelector("img")).setAttribute("width", x.productImageWidth).setAttribute("height", x.productImageWidth), P.modifyHtml(this.currentNode).setInnerHtml(d), e || P.apply(new N("Reordered template"));
|
|
244
250
|
}, 50);
|
|
245
251
|
}
|
|
246
|
-
_updateDataTypeAttributes(e) {
|
|
252
|
+
_updateDataTypeAttributes(e, t) {
|
|
247
253
|
if (!this.currentNode)
|
|
248
254
|
return;
|
|
249
|
-
const
|
|
250
|
-
|
|
251
|
-
const
|
|
252
|
-
|
|
253
|
-
})
|
|
255
|
+
const r = this.currentNode.closest(".ins-product-td");
|
|
256
|
+
r && t.modifyHtml(r).setAttribute("data-type", e), this.currentNode.querySelectorAll("[data-type]").forEach((n) => {
|
|
257
|
+
const s = n;
|
|
258
|
+
t.modifyHtml(s).setAttribute("data-type", e);
|
|
259
|
+
});
|
|
254
260
|
}
|
|
255
|
-
_updateDataNumberAttributes(e) {
|
|
261
|
+
_updateDataNumberAttributes(e, t) {
|
|
256
262
|
if (!this.currentNode)
|
|
257
263
|
return;
|
|
258
|
-
const
|
|
259
|
-
let
|
|
260
|
-
if (
|
|
261
|
-
|
|
264
|
+
const r = h(this.currentNode), i = (r == null ? void 0 : r.type) ?? p.ITEMS_TYPE.CART_ITEMS, n = g[i].findIndex((a) => a.value === e);
|
|
265
|
+
let s = "1";
|
|
266
|
+
if (n >= 0)
|
|
267
|
+
s = String(n + 1);
|
|
262
268
|
else if (e) {
|
|
263
|
-
const
|
|
264
|
-
if (
|
|
265
|
-
const [,
|
|
266
|
-
|
|
269
|
+
const a = e.match(/\((\d+)\)/);
|
|
270
|
+
if (a) {
|
|
271
|
+
const [, c] = a;
|
|
272
|
+
s = c;
|
|
267
273
|
}
|
|
268
274
|
}
|
|
269
|
-
const o = this.currentNode.closest(".ins-product-td")
|
|
270
|
-
o &&
|
|
271
|
-
const
|
|
272
|
-
|
|
273
|
-
})
|
|
275
|
+
const o = this.currentNode.closest(".ins-product-td");
|
|
276
|
+
o && t.modifyHtml(o).setAttribute("data-number", s), this.currentNode.querySelectorAll("[data-number]").forEach((a) => {
|
|
277
|
+
const c = a;
|
|
278
|
+
t.modifyHtml(c).setAttribute("data-number", s);
|
|
279
|
+
});
|
|
274
280
|
}
|
|
275
281
|
_reFillTemplate(e) {
|
|
276
|
-
const t = this._getTemplateData(e);
|
|
277
|
-
this._updateImageSrc(t.imageSrc), this._updateName(t.name), this._updatePrice(t.price), this._updateOriginalPrice(t.originalPrice), this._updateQuantity(t.quantity, e);
|
|
282
|
+
const t = this._getTemplateData(e), r = this.api.getDocumentModifier();
|
|
283
|
+
this._updateImageSrc(t.imageSrc, r), this._updateName(t.name, r), this._updatePrice(t.price, r), this._updateOriginalPrice(t.originalPrice, r), this._updateQuantity(t.quantity, e, r), r.apply(new N("Refilled template"));
|
|
278
284
|
}
|
|
279
285
|
_recalculateTrimming() {
|
|
280
|
-
var
|
|
286
|
+
var s;
|
|
281
287
|
if (!this.currentNode)
|
|
282
288
|
return;
|
|
283
|
-
const e = (
|
|
289
|
+
const e = (s = this.currentNode) == null ? void 0 : s.querySelector(`[esd-extension-block-id="${T.NAME}"]`);
|
|
284
290
|
if (!e)
|
|
285
291
|
return;
|
|
286
292
|
const t = e.querySelector("p > a");
|
|
287
293
|
if (!t)
|
|
288
294
|
return;
|
|
289
|
-
const r =
|
|
290
|
-
this.api.getDocumentModifier().modifyHtml(t).setStyle("overflow", "hidden").setStyle("white-space", n ? "nowrap" : "normal").setStyle("text-overflow", n ? "ellipsis" : "unset").setStyle("max-width", i ? "130px" : "520px").setStyle("width", i ? "130px" : "520px").apply(new
|
|
295
|
+
const r = h(this.currentNode), i = (r == null ? void 0 : r.orientation) === p.ORIENTATION.HORIZONTAL, n = (r == null ? void 0 : r.nameTrimming) ?? !0;
|
|
296
|
+
this.api.getDocumentModifier().modifyHtml(t).setStyle("overflow", "hidden").setStyle("white-space", n ? "nowrap" : "normal").setStyle("text-overflow", n ? "ellipsis" : "unset").setStyle("max-width", i ? "130px" : "520px").setStyle("width", i ? "130px" : "520px").apply(new N("Recalculated trimming after orientation change"));
|
|
291
297
|
}
|
|
292
298
|
_getParagraphFromBlock(e) {
|
|
293
299
|
return e.querySelector("p");
|
|
@@ -304,8 +310,8 @@ class X extends U {
|
|
|
304
310
|
} else {
|
|
305
311
|
const n = r.match(/([^0-9.,\s]+)/);
|
|
306
312
|
if (n && n[1]) {
|
|
307
|
-
const
|
|
308
|
-
i = r.replace(
|
|
313
|
+
const s = n[1].trim(), o = new RegExp(`\\s*${this._escapeRegex(s)}\\s*`);
|
|
314
|
+
i = r.replace(o, "").trim();
|
|
309
315
|
}
|
|
310
316
|
}
|
|
311
317
|
return i;
|
|
@@ -319,6 +325,6 @@ class X extends U {
|
|
|
319
325
|
}
|
|
320
326
|
}
|
|
321
327
|
export {
|
|
322
|
-
|
|
323
|
-
|
|
328
|
+
w as CONTROL_BLOCK_ID,
|
|
329
|
+
Z as ItemsBlockControl
|
|
324
330
|
};
|
|
@@ -3,20 +3,19 @@ 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
|
-
import { PriceCurrencySymbolControl as
|
|
10
|
-
import { PriceFormattedPriceControl as
|
|
9
|
+
import { PriceCurrencySymbolControl as g } from "./controls/price/currencySymbol.js";
|
|
10
|
+
import { PriceFormattedPriceControl as f } from "./controls/price/formattedPrice.js";
|
|
11
11
|
import { PriceHideDiscountControl as p } from "./controls/price/hideDiscount.js";
|
|
12
12
|
import { PriceOrientationControl as y } from "./controls/price/priceOrientation.js";
|
|
13
13
|
import { PriceSinglePriceControl as u } from "./controls/price/singlePrice.js";
|
|
14
14
|
import { ItemsBlockControl as P } from "./controls/settingsControl.js";
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
import b from "./
|
|
18
|
-
|
|
19
|
-
const M = new a().addBlock(i).withSettingsPanelRegistry(B).addControl(P).addControl(e).addControl(t.align).addControl(t.color).addControl(t.size).addControl(t.style).addControl(t.fontFamily).addControl(t.background).addControl(t.paddings).addControl(s).addControl(n.align).addControl(n.color).addControl(n.fontFamily).addControl(n.paddings).addControl(n.size).addControl(n.style).addControl(r.align).addControl(r.color).addControl(r.size).addControl(r.style).addControl(r.fontFamily).addControl(r.background).addControl(r.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(g).addControl(u).addControl(f).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(b).withPreviewStyles(`[esd-extension-block-id="${k.IMAGE}"] img {object-fit: contain;}`).withIconsRegistry(I).build();
|
|
15
|
+
import { ItemsIconsRegistry as k } from "./iconsRegistry.js";
|
|
16
|
+
import I from "./items.css.js";
|
|
17
|
+
import { SettingsPanel as b } from "./settingsPanel.js";
|
|
18
|
+
const j = new a().addBlock(i).withSettingsPanelRegistry(b).addControl(P).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(u).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(I).withIconsRegistry(k).build();
|
|
20
19
|
export {
|
|
21
|
-
|
|
20
|
+
j as default
|
|
22
21
|
};
|
|
@@ -2,8 +2,8 @@ import { BlockType as b, BlockAttr as N } from "../../../node_modules/@stripoinc
|
|
|
2
2
|
import { ItemsBlockId as O } from "./enums/controlEnums.js";
|
|
3
3
|
import { productPairs as A, templateFirstLine as C } from "./enums/productEnums.js";
|
|
4
4
|
import { ItemInCartOptions as Y, SETTINGS_ENUMS as x, DefaultConfigValues as D } from "./enums/settingsEnums.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import j from "./layouts/horizontal.html.js";
|
|
6
|
+
import q from "./layouts/vertical.html.js";
|
|
7
7
|
import { escapeReplacement as V } from "./utils/nodeConfigUtils.js";
|
|
8
8
|
let [g] = A.PAIRS_FOR_EXTENSION.imageSrc.CART_ITEMS.DEFAULT, [L] = A.PAIRS_FOR_EXTENSION.name.CART_ITEMS.DEFAULT, [m] = A.PAIRS_FOR_EXTENSION.price.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [S] = A.PAIRS_FOR_EXTENSION.originalPrice.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [M] = A.PAIRS_FOR_EXTENSION.quantity.CART_ITEMS.DEFAULT;
|
|
9
9
|
const U = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCase().startsWith(e.toLowerCase())).join("; ").replace(/;\s*$/, ""), F = (s) => U(s, "text-align"), w = (s, e) => {
|
|
@@ -27,6 +27,7 @@ const U = (s, e) => s.split(";").map((r) => r.trim()).filter((r) => !r.toLowerCa
|
|
|
27
27
|
target="_blank"
|
|
28
28
|
href="#!">
|
|
29
29
|
<img class="adapt-img document-node-component ng-star-inserted"
|
|
30
|
+
style="object-fit: contain;"
|
|
30
31
|
src="${g}"
|
|
31
32
|
alt="${L}"
|
|
32
33
|
width="${i}"
|
|
@@ -402,7 +403,7 @@ function Tt({
|
|
|
402
403
|
d ? (m = o ? T.DEFAULT_SINGLE_PRICE_FORMATTED : T.DEFAULT_SINGLE_PRICE, S = o ? I.DEFAULT_SINGLE_PRICE_FORMATTED : I.DEFAULT_SINGLE_PRICE) : (m = o ? T.DEFAULT_PRICE_FORMATTED : T.DEFAULT_PRICE, S = o ? I.DEFAULT_PRICE_FORMATTED : I.DEFAULT_PRICE), M = A.PAIRS_FOR_EXTENSION.quantity[e].DEFAULT;
|
|
403
404
|
const h = P || (l == null ? void 0 : l.priceOrientation) || "horizontal";
|
|
404
405
|
return s === x.ORIENTATION.VERTICAL ? z(
|
|
405
|
-
|
|
406
|
+
q,
|
|
406
407
|
e,
|
|
407
408
|
R,
|
|
408
409
|
s,
|
|
@@ -422,7 +423,7 @@ function Tt({
|
|
|
422
423
|
u,
|
|
423
424
|
d
|
|
424
425
|
) : z(
|
|
425
|
-
|
|
426
|
+
j,
|
|
426
427
|
e,
|
|
427
428
|
R,
|
|
428
429
|
s,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ModificationDescription as b } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
2
|
import { DefaultConfigValues as o, SETTINGS_ENUMS as n, ItemInCartOptions as g } from "../enums/settingsEnums.js";
|
|
3
|
-
function
|
|
3
|
+
function _() {
|
|
4
4
|
return String(Date.now() + Math.floor(Math.random() * 1e3));
|
|
5
5
|
}
|
|
6
6
|
const E = (r) => r.replace(/\$/g, "$$$$");
|
|
7
7
|
function S() {
|
|
8
8
|
return {
|
|
9
9
|
initialized: !0,
|
|
10
|
-
blockInstanceId:
|
|
10
|
+
blockInstanceId: _(),
|
|
11
11
|
source: n.ITEMS_TYPE.CART_ITEMS,
|
|
12
12
|
type: n.ITEMS_TYPE.CART_ITEMS,
|
|
13
13
|
itemsSelectValue: o.cartItemsSelectControlValue,
|
|
@@ -33,7 +33,7 @@ function S() {
|
|
|
33
33
|
buttonVisible: o.productButtonVisible === "1"
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function p(r) {
|
|
37
37
|
if (!r)
|
|
38
38
|
return null;
|
|
39
39
|
const t = r.closest(".items-block-v2");
|
|
@@ -66,16 +66,16 @@ function C(r) {
|
|
|
66
66
|
const t = r.querySelector("esd-config-block");
|
|
67
67
|
if (!t)
|
|
68
68
|
return null;
|
|
69
|
-
const e = (c,
|
|
69
|
+
const e = (c, s) => c == null ? s : c === "1" || c === "true", i = (c, s) => c || s, u = t.getAttribute("data-type"), a = m(u), d = t.getAttribute("data-cart_items_select_control_value"), l = I(d, a);
|
|
70
70
|
return {
|
|
71
71
|
initialized: e(t.getAttribute("data-initialized"), !1),
|
|
72
72
|
blockInstanceId: i(
|
|
73
73
|
t.getAttribute("data-block-instance-id"),
|
|
74
|
-
|
|
74
|
+
_()
|
|
75
75
|
),
|
|
76
|
-
source:
|
|
77
|
-
type:
|
|
78
|
-
itemsSelectValue:
|
|
76
|
+
source: a,
|
|
77
|
+
type: a,
|
|
78
|
+
itemsSelectValue: l,
|
|
79
79
|
orientation: t.getAttribute("data-card_orientation_control_value") || n.ORIENTATION.VERTICAL,
|
|
80
80
|
nameTrimming: e(
|
|
81
81
|
t.getAttribute("data-product_name_control_trim"),
|
|
@@ -150,7 +150,7 @@ function C(r) {
|
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
152
|
function y(r) {
|
|
153
|
-
const t =
|
|
153
|
+
const t = p(r);
|
|
154
154
|
if (!t)
|
|
155
155
|
return null;
|
|
156
156
|
const e = t.getNodeConfig();
|
|
@@ -159,18 +159,18 @@ function y(r) {
|
|
|
159
159
|
const i = C(t);
|
|
160
160
|
return i || null;
|
|
161
161
|
}
|
|
162
|
-
function A(r, t, e) {
|
|
163
|
-
const
|
|
164
|
-
if (!
|
|
162
|
+
function A(r, t, e, i) {
|
|
163
|
+
const u = p(r);
|
|
164
|
+
if (!u)
|
|
165
165
|
return;
|
|
166
|
-
const
|
|
167
|
-
|
|
166
|
+
const d = { ...u.getNodeConfig() || {}, ...e }, l = i ?? t.getDocumentModifier();
|
|
167
|
+
l.modifyHtml(u).setNodeConfig(d), i || l.apply(new b("Update Items block configuration"));
|
|
168
168
|
}
|
|
169
169
|
export {
|
|
170
170
|
E as escapeReplacement,
|
|
171
|
-
|
|
171
|
+
_ as generateBlockInstanceId,
|
|
172
172
|
S as getDefaultItemsBlockConfig,
|
|
173
173
|
y as getItemsBlockConfig,
|
|
174
|
-
|
|
174
|
+
p as getItemsBlockContainer,
|
|
175
175
|
A as setItemsBlockConfig
|
|
176
176
|
};
|
package/dist/package.json.js
CHANGED
|
@@ -24,14 +24,14 @@ export declare class ItemsBlockControl extends CommonControl {
|
|
|
24
24
|
quantity: string;
|
|
25
25
|
button: string;
|
|
26
26
|
};
|
|
27
|
-
_updateImageSrc(imageSrc: string): void;
|
|
28
|
-
_updateName(name: string): void;
|
|
29
|
-
_updatePrice(price: string): void;
|
|
30
|
-
_updateOriginalPrice(originalPrice: string): void;
|
|
31
|
-
_updateQuantity(quantity: string, itemsTypeOverride
|
|
32
|
-
_reOrderTemplate(): void;
|
|
33
|
-
_updateDataTypeAttributes(itemsType: ProductType): void;
|
|
34
|
-
_updateDataNumberAttributes(itemId: string): void;
|
|
27
|
+
_updateImageSrc(imageSrc: string, modifier: ReturnType<typeof this.api.getDocumentModifier>): void;
|
|
28
|
+
_updateName(name: string, modifier: ReturnType<typeof this.api.getDocumentModifier>): void;
|
|
29
|
+
_updatePrice(price: string, modifier: ReturnType<typeof this.api.getDocumentModifier>): void;
|
|
30
|
+
_updateOriginalPrice(originalPrice: string, modifier: ReturnType<typeof this.api.getDocumentModifier>): void;
|
|
31
|
+
_updateQuantity(quantity: string, itemsTypeOverride: ProductType | undefined, modifier: ReturnType<typeof this.api.getDocumentModifier>): void;
|
|
32
|
+
_reOrderTemplate(modifier?: ReturnType<typeof this.api.getDocumentModifier>): void;
|
|
33
|
+
_updateDataTypeAttributes(itemsType: ProductType, modifier: ReturnType<typeof this.api.getDocumentModifier>): void;
|
|
34
|
+
_updateDataNumberAttributes(itemId: string, modifier: ReturnType<typeof this.api.getDocumentModifier>): void;
|
|
35
35
|
_reFillTemplate(itemsType?: ProductType): void;
|
|
36
36
|
_recalculateTrimming(): void;
|
|
37
37
|
private _getParagraphFromBlock;
|
|
@@ -66,8 +66,9 @@ export declare function getItemsBlockConfig(currentNode: ImmutableHtmlNode | und
|
|
|
66
66
|
* @param currentNode - The current node from the control
|
|
67
67
|
* @param api - The API object (ControlApi or BlockApi)
|
|
68
68
|
* @param config - The configuration to set (partial update supported)
|
|
69
|
+
* @param modifier - Optional document modifier for batching updates
|
|
69
70
|
*/
|
|
70
|
-
export declare function setItemsBlockConfig(currentNode: ImmutableHtmlNode | undefined, api: ControlApi | BlockApi, config: Partial<ItemsBlockConfig>): void;
|
|
71
|
+
export declare function setItemsBlockConfig(currentNode: ImmutableHtmlNode | undefined, api: ControlApi | BlockApi, config: Partial<ItemsBlockConfig>, modifier?: ReturnType<typeof api.getDocumentModifier>): void;
|
|
71
72
|
/**
|
|
72
73
|
* Gets the block instance ID from the node config.
|
|
73
74
|
* @param currentNode - The current node from the control
|
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.411f2a9",
|
|
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",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
},
|
|
86
86
|
"guido": {
|
|
87
87
|
"stripo": {
|
|
88
|
-
"version": "2.
|
|
88
|
+
"version": "2.54.0"
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
}
|