@useinsider/guido 2.0.0-beta.ecd6540 → 2.0.0-beta.eee5ecc
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/email-preview/amp/AmpToggle.vue.js +2 -2
- package/dist/composables/useActionsApi.js +33 -30
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +74 -68
- package/dist/extensions/Blocks/Items/template.js +43 -42
- package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +8 -6
- package/dist/extensions/Blocks/common-control.js +1 -2
- package/dist/guido.css +1 -1
- package/dist/src/composables/useActionsApi.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +5 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +1 -1
- package/dist/utils/templatePreparation.js +17 -17
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import o from "./AmpToggle.vue2.js";
|
|
|
3
3
|
import n from "../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var s = function() {
|
|
5
5
|
var r = this, t = r._self._c, e = r._self._setupProxy;
|
|
6
|
-
return t("div", [t("div", { staticClass: "d-f a-i-c ml-3" }, [t(e.InSegments, { attrs: { id: "guido__amp-toggle", "segment-list": e.segmentList, selected: e.previewStore.emailFormat }, on: { click: e.handleFormatChange } }), e.previewStore.showAMPErrorButton ? t(e.InButtonV2, { staticClass: "ml-
|
|
6
|
+
return t("div", [t("div", { staticClass: "d-f a-i-c ml-3" }, [t(e.InSegments, { attrs: { id: "guido__amp-toggle", "segment-list": e.segmentList, selected: e.previewStore.emailFormat }, on: { click: e.handleFormatChange } }), e.previewStore.showAMPErrorButton ? t(e.InButtonV2, { staticClass: "ml-3 d-f a-i-c b-c-11 b-c-h-11 t-c-4 t-c-h-4 i-c-4 bor-w-1 bor-s-s bor-c-11 bor-r-2", attrs: { id: "guido__amp-error-button", "left-icon": "line-error-box", type: "danger", "label-text-status": !1 }, on: { click: function(l) {
|
|
7
7
|
return e.previewStore.openErrorModal();
|
|
8
8
|
} } }) : r._e()], 1)]);
|
|
9
9
|
}, a = [], i = /* @__PURE__ */ n(
|
|
@@ -12,7 +12,7 @@ var s = function() {
|
|
|
12
12
|
a,
|
|
13
13
|
!1,
|
|
14
14
|
null,
|
|
15
|
-
"
|
|
15
|
+
"5196584c"
|
|
16
16
|
);
|
|
17
17
|
const d = i.exports;
|
|
18
18
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useToaster as w } from "./useToaster.js";
|
|
2
|
-
const
|
|
3
|
-
const { handleError: l } = w(),
|
|
4
|
-
const
|
|
2
|
+
const v = () => {
|
|
3
|
+
const { handleError: l } = w(), r = (t = {}) => new Promise((e, a) => {
|
|
4
|
+
const o = { ...{
|
|
5
5
|
minimize: !0,
|
|
6
6
|
utmEntity: {
|
|
7
7
|
utmSource: "",
|
|
@@ -20,29 +20,29 @@ const S = () => {
|
|
|
20
20
|
forceAmp: !1,
|
|
21
21
|
resetDataSavedFlag: !1,
|
|
22
22
|
disableLineHeightsReplace: !0
|
|
23
|
-
}, ...t },
|
|
24
|
-
callback: (
|
|
25
|
-
|
|
23
|
+
}, ...t }, s = {
|
|
24
|
+
callback: (n, p, d, c, u) => {
|
|
25
|
+
n ? a(n) : e({
|
|
26
26
|
html: p,
|
|
27
27
|
ampHtml: d,
|
|
28
28
|
ampErrors: c,
|
|
29
29
|
displayConditions: u
|
|
30
30
|
});
|
|
31
31
|
},
|
|
32
|
-
...
|
|
32
|
+
...o
|
|
33
33
|
};
|
|
34
|
-
window.StripoEditorApi.actionsApi.compileEmail(
|
|
34
|
+
window.StripoEditorApi.actionsApi.compileEmail(s);
|
|
35
35
|
});
|
|
36
36
|
return {
|
|
37
|
-
getCompiledEmail:
|
|
37
|
+
getCompiledEmail: r,
|
|
38
38
|
getTemplateData: () => new Promise((t) => {
|
|
39
|
-
const e = ({ html:
|
|
40
|
-
html:
|
|
41
|
-
css:
|
|
42
|
-
width:
|
|
43
|
-
height:
|
|
44
|
-
utmParams:
|
|
45
|
-
syncModulesIds:
|
|
39
|
+
const e = ({ html: a, css: i, width: o, height: m, utmParams: s, syncModulesIds: n }) => t({
|
|
40
|
+
html: a,
|
|
41
|
+
css: i,
|
|
42
|
+
width: o,
|
|
43
|
+
height: m,
|
|
44
|
+
utmParams: s,
|
|
45
|
+
syncModulesIds: n
|
|
46
46
|
});
|
|
47
47
|
window.StripoEditorApi.actionsApi.getTemplateData(e);
|
|
48
48
|
}),
|
|
@@ -53,15 +53,15 @@ const S = () => {
|
|
|
53
53
|
try {
|
|
54
54
|
const {
|
|
55
55
|
html: e,
|
|
56
|
-
displayConditions:
|
|
57
|
-
ampHtml:
|
|
58
|
-
ampErrors:
|
|
59
|
-
} = await
|
|
56
|
+
displayConditions: a,
|
|
57
|
+
ampHtml: i = "",
|
|
58
|
+
ampErrors: o = []
|
|
59
|
+
} = await r({ minimize: !1, resetDataSavedFlag: !1, ...t });
|
|
60
60
|
return {
|
|
61
61
|
html: e,
|
|
62
|
-
ampHtml:
|
|
63
|
-
ampErrors:
|
|
64
|
-
displayConditions:
|
|
62
|
+
ampHtml: i,
|
|
63
|
+
ampErrors: o,
|
|
64
|
+
displayConditions: a
|
|
65
65
|
};
|
|
66
66
|
} catch (e) {
|
|
67
67
|
return l(e, "Error loading preview"), {
|
|
@@ -73,24 +73,27 @@ const S = () => {
|
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
75
|
updateTimerInClonedTemplate: () => new Promise((t) => {
|
|
76
|
-
var e,
|
|
77
|
-
if (typeof ((
|
|
76
|
+
var e, a;
|
|
77
|
+
if (typeof ((a = (e = window.StripoEditorApi) == null ? void 0 : e.actionsApi) == null ? void 0 : a.updateTimerInClonedTemplate) != "function") {
|
|
78
78
|
t(null);
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
81
|
try {
|
|
82
|
-
window.StripoEditorApi.actionsApi.updateTimerInClonedTemplate((
|
|
83
|
-
|
|
82
|
+
window.StripoEditorApi.actionsApi.updateTimerInClonedTemplate((i, o) => {
|
|
83
|
+
i ? (l(i, "Failed to update timer in cloned template"), t(null)) : t(o || null);
|
|
84
84
|
});
|
|
85
|
-
} catch (
|
|
86
|
-
l(
|
|
85
|
+
} catch (i) {
|
|
86
|
+
l(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
|
+
},
|
|
92
|
+
editorSave: () => {
|
|
93
|
+
window.StripoEditorApi.actionsApi.save();
|
|
91
94
|
}
|
|
92
95
|
};
|
|
93
96
|
};
|
|
94
97
|
export {
|
|
95
|
-
|
|
98
|
+
v as useActionsApi
|
|
96
99
|
};
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var O = (
|
|
4
|
-
import { UEAttr as C, ModificationDescription as
|
|
5
|
-
import { CommonControl as
|
|
1
|
+
var x = Object.defineProperty;
|
|
2
|
+
var H = (I, h, e) => h in I ? x(I, h, { enumerable: !0, configurable: !0, writable: !0, value: e }) : I[h] = e;
|
|
3
|
+
var O = (I, h, e) => H(I, typeof h != "symbol" ? h + "" : h, e);
|
|
4
|
+
import { UEAttr as C, ModificationDescription as p } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
|
+
import { CommonControl as k } from "../../common-control.js";
|
|
6
6
|
import { ItemsBlockId as m } from "../enums/controlEnums.js";
|
|
7
|
-
import { productPairs as
|
|
8
|
-
import { ItemTypeOptions as R, OrientationOptions as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { useItemsBlockStore as
|
|
12
|
-
import { getDefaultTemplate as
|
|
13
|
-
import { getItemsBlockConfig as
|
|
14
|
-
const
|
|
7
|
+
import { productPairs as T, templateFirstLine as b } from "../enums/productEnums.js";
|
|
8
|
+
import { ItemTypeOptions as R, OrientationOptions as U, ItemInCartOptions as N, SETTINGS_ENUMS as S, DefaultConfigValues as P } from "../enums/settingsEnums.js";
|
|
9
|
+
import F from "../layouts/horizontal.html.js";
|
|
10
|
+
import $ from "../layouts/vertical.html.js";
|
|
11
|
+
import { useItemsBlockStore as q } from "../store/items-block.js";
|
|
12
|
+
import { getDefaultTemplate as w } from "../template.js";
|
|
13
|
+
import { getItemsBlockConfig as A, setItemsBlockConfig as f, escapeReplacement as L } from "../utils/nodeConfigUtils.js";
|
|
14
|
+
const B = "ui-elements-items-block", a = {
|
|
15
15
|
ITEMS_TYPE: "itemsType",
|
|
16
16
|
ORIENTATION: "orientation",
|
|
17
17
|
ITEM_IDS: "itemIds"
|
|
18
18
|
};
|
|
19
|
-
class
|
|
19
|
+
class J extends k {
|
|
20
20
|
constructor() {
|
|
21
21
|
super(...arguments);
|
|
22
|
-
O(this, "store",
|
|
22
|
+
O(this, "store", q());
|
|
23
23
|
}
|
|
24
24
|
getId() {
|
|
25
|
-
return
|
|
25
|
+
return B;
|
|
26
26
|
}
|
|
27
27
|
getTemplate() {
|
|
28
28
|
return `
|
|
@@ -43,7 +43,7 @@ class K extends D {
|
|
|
43
43
|
onTemplateNodeUpdated(e) {
|
|
44
44
|
super.onTemplateNodeUpdated(e), console.debug("Items Block Config", e.getNodeConfig()), this.handleBlockInstanceChange(
|
|
45
45
|
() => {
|
|
46
|
-
const t =
|
|
46
|
+
const t = A(this.currentNode);
|
|
47
47
|
t && (this.store.setItemsType(t.type), this.store.setItemIds(t.itemsSelectValue), this.store.setOrientation(t.orientation), this.store.setCurrencySymbol(t.priceCurrencySymbol), this.store.setCurrencyLocation(t.priceCurrencyLocation), this.store.setFormattedPrice(t.priceFormatted), this.store.setImageLink(t.imageLink), this.store.setButtonLink(t.buttonLink));
|
|
48
48
|
},
|
|
49
49
|
() => {
|
|
@@ -78,7 +78,7 @@ class K extends D {
|
|
|
78
78
|
this._GuLabel({ text: "Orientation" }),
|
|
79
79
|
this._GuRadioButton({
|
|
80
80
|
name: a.ORIENTATION,
|
|
81
|
-
buttons:
|
|
81
|
+
buttons: U
|
|
82
82
|
})
|
|
83
83
|
])}
|
|
84
84
|
`;
|
|
@@ -159,32 +159,32 @@ class K extends D {
|
|
|
159
159
|
itemIds: i,
|
|
160
160
|
currencySymbol: r,
|
|
161
161
|
currencyLocation: n,
|
|
162
|
-
formattedPrice:
|
|
162
|
+
formattedPrice: o
|
|
163
163
|
} = this.store;
|
|
164
|
-
this.api.getDocumentModifier().modifyHtml(this.currentNode).setInnerHtml(
|
|
164
|
+
this.api.getDocumentModifier().modifyHtml(this.currentNode).setInnerHtml(w({
|
|
165
165
|
orientation: e,
|
|
166
166
|
itemsType: t,
|
|
167
167
|
itemId: i,
|
|
168
168
|
currencySymbol: r,
|
|
169
169
|
currencyLocation: n,
|
|
170
|
-
formattedPrice:
|
|
171
|
-
})).apply(new
|
|
170
|
+
formattedPrice: o
|
|
171
|
+
})).apply(new p("Updated template"));
|
|
172
172
|
}
|
|
173
173
|
_getTemplateData() {
|
|
174
|
-
const { itemsType: e, itemIds: t, formattedPrice: i } = this.store, r = N[e].findIndex((
|
|
174
|
+
const { itemsType: e, itemIds: t, formattedPrice: i } = this.store, r = N[e].findIndex((o) => o.value === t), n = r > -1 ? r : 0;
|
|
175
175
|
return {
|
|
176
|
-
imageSrc:
|
|
177
|
-
name:
|
|
178
|
-
price: i ?
|
|
179
|
-
originalPrice: i ?
|
|
180
|
-
quantity:
|
|
181
|
-
button:
|
|
176
|
+
imageSrc: T.PAIRS_FOR_EXTENSION.imageSrc[e].DEFAULT[n],
|
|
177
|
+
name: T.PAIRS_FOR_EXTENSION.name[e].DEFAULT[n],
|
|
178
|
+
price: i ? T.PAIRS_FOR_EXTENSION.price[e].DEFAULT_PRICE_FORMATTED : T.PAIRS_FOR_EXTENSION.price[e].DEFAULT_PRICE,
|
|
179
|
+
originalPrice: i ? T.PAIRS_FOR_EXTENSION.originalPrice[e].DEFAULT_PRICE_FORMATTED : T.PAIRS_FOR_EXTENSION.originalPrice[e].DEFAULT_PRICE,
|
|
180
|
+
quantity: T.PAIRS_FOR_EXTENSION.quantity[e].DEFAULT,
|
|
181
|
+
button: T.PAIRS_FOR_EXTENSION.button[e].DEFAULT_LABEL
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
184
|
_updateImageSrc(e) {
|
|
185
185
|
var i;
|
|
186
186
|
const t = (i = this.currentNode) == null ? void 0 : i.querySelector(`[esd-extension-block-id="${m.IMAGE}"] img`);
|
|
187
|
-
t && this.api.getDocumentModifier().modifyHtml(t).setAttribute("src", e).apply(new
|
|
187
|
+
t && this.api.getDocumentModifier().modifyHtml(t).setAttribute("src", e).apply(new p("Updated image src"));
|
|
188
188
|
}
|
|
189
189
|
_updateName(e) {
|
|
190
190
|
var n;
|
|
@@ -193,7 +193,7 @@ class K extends D {
|
|
|
193
193
|
return;
|
|
194
194
|
const i = t.getInnerText().trim();
|
|
195
195
|
let r = t.getInnerHTML();
|
|
196
|
-
r = r.replace(i, e), this.api.getDocumentModifier().modifyHtml(t).setInnerHtml(r).apply(new
|
|
196
|
+
r = r.replace(i, e), this.api.getDocumentModifier().modifyHtml(t).setInnerHtml(r).apply(new p("Updated name"));
|
|
197
197
|
}
|
|
198
198
|
_updatePrice(e) {
|
|
199
199
|
var g;
|
|
@@ -203,12 +203,12 @@ class K extends D {
|
|
|
203
203
|
const i = this._getParagraphFromBlock(t);
|
|
204
204
|
if (!i)
|
|
205
205
|
return;
|
|
206
|
-
const r = i.getInnerHTML() || "", n = i.getInnerText() || "", { currencySymbol:
|
|
207
|
-
this.api.getDocumentModifier().modifyHtml(i).setInnerHtml(_).apply(new
|
|
206
|
+
const r = i.getInnerHTML() || "", n = i.getInnerText() || "", { currencySymbol: o, currencyLocation: l } = this.store, c = (o == null ? void 0 : o.trim()) || "", s = this._removeCurrencySymbol(n, c), u = this._replacePriceNumber(s, e), d = this._buildPriceContent(u, c, l), _ = r.replace(n, d);
|
|
207
|
+
this.api.getDocumentModifier().modifyHtml(i).setInnerHtml(_).apply(new p("Updated price"));
|
|
208
208
|
}
|
|
209
209
|
_updateOriginalPrice(e) {
|
|
210
|
-
var
|
|
211
|
-
const t = (
|
|
210
|
+
var y;
|
|
211
|
+
const t = (y = this.currentNode) == null ? void 0 : y.querySelector(
|
|
212
212
|
`[esd-extension-block-id="${m.ORIGINAL_PRICE}"]`
|
|
213
213
|
);
|
|
214
214
|
if (!t)
|
|
@@ -219,29 +219,35 @@ class K extends D {
|
|
|
219
219
|
const r = i.querySelector("s");
|
|
220
220
|
if (!r)
|
|
221
221
|
return;
|
|
222
|
-
const n = r.getInnerHTML() || "",
|
|
223
|
-
this.api.getDocumentModifier().modifyHtml(i).setInnerHtml(
|
|
222
|
+
const n = r.getInnerHTML() || "", o = r.getInnerText() || "", { currencySymbol: l, currencyLocation: c } = this.store, s = (l == null ? void 0 : l.trim()) || "", u = this._removeCurrencySymbol(o, s), d = this._replacePriceNumber(u, e), _ = this._buildPriceContent(d, s, c), E = `<s>${n.replace(o, _)}</s>`;
|
|
223
|
+
this.api.getDocumentModifier().modifyHtml(i).setInnerHtml(E).apply(new p("Updated original price"));
|
|
224
224
|
}
|
|
225
225
|
_updateQuantity(e) {
|
|
226
|
-
var
|
|
227
|
-
const t = this.store.itemsType !== S.ITEMS_TYPE.BROWSED_ITEMS, i =
|
|
228
|
-
if (!
|
|
226
|
+
var d;
|
|
227
|
+
const t = this.store.itemsType !== S.ITEMS_TYPE.BROWSED_ITEMS, i = A(this.currentNode), r = (i == null ? void 0 : i.quantityControlEnabled) !== !1, n = t && r, o = (d = this.currentNode) == null ? void 0 : d.querySelector(`[esd-extension-block-id="${m.QUANTITY}"]`);
|
|
228
|
+
if (!o)
|
|
229
229
|
return;
|
|
230
|
-
const l =
|
|
231
|
-
|
|
232
|
-
|
|
230
|
+
const l = this._getParagraphFromBlock(o);
|
|
231
|
+
if (!l)
|
|
232
|
+
return;
|
|
233
|
+
const c = l.getInnerText().trim();
|
|
234
|
+
let s = l.getInnerHTML();
|
|
235
|
+
s = s.replace(c, e);
|
|
236
|
+
const u = this.api.getDocumentModifier();
|
|
237
|
+
u.modifyHtml(l).setInnerHtml(s), u.modifyHtml(o).setStyle("display", n ? "table-cell" : "none"), u.apply(new p("Updated quantity"));
|
|
233
238
|
}
|
|
234
239
|
_reOrderTemplate() {
|
|
235
|
-
var
|
|
236
|
-
const e = (
|
|
240
|
+
var u, d, _, g, E, y;
|
|
241
|
+
const e = (u = this.currentNode) == null ? void 0 : u.querySelector(`[esd-extension-block-id="${m.IMAGE}"]`), t = (d = this.currentNode) == null ? void 0 : d.querySelector(`[esd-extension-block-id="${m.NAME}"]`), i = (_ = this.currentNode) == null ? void 0 : _.querySelector(`[esd-extension-block-id="${m.PRICE}"]`), r = (g = this.currentNode) == null ? void 0 : g.querySelector(
|
|
237
242
|
`[esd-extension-block-id="${m.ORIGINAL_PRICE}"]`
|
|
238
|
-
), n = (
|
|
239
|
-
if (!e || !t || !i || !r || !n || !
|
|
243
|
+
), n = (E = this.currentNode) == null ? void 0 : E.querySelector(`[esd-extension-block-id="${m.QUANTITY}"]`), o = (y = this.currentNode) == null ? void 0 : y.querySelector(`[esd-extension-block-id="${m.BUTTON}"]`);
|
|
244
|
+
if (!e || !t || !i || !r || !n || !o)
|
|
240
245
|
return;
|
|
241
|
-
const { orientation: l } = this.store,
|
|
242
|
-
let
|
|
243
|
-
this.api.getDocumentModifier().modifyHtml(e.querySelector("img")).setAttribute("width",
|
|
244
|
-
|
|
246
|
+
const { orientation: l } = this.store, c = l === S.ORIENTATION.VERTICAL;
|
|
247
|
+
let s = c ? $ : F;
|
|
248
|
+
this.api.getDocumentModifier().modifyHtml(e.querySelector("img")).setAttribute("width", P.productImageWidth).setAttribute("height", P.productImageWidth).apply(new p("Updated image width")), setTimeout(() => {
|
|
249
|
+
const M = L(i.getOuterHTML()), D = L(r.getOuterHTML());
|
|
250
|
+
s = s.replace("{-{-TEMPLATE_FIRST_LINE-}-}", c ? b : "").replace("{-{-PRODUCT_IMAGE-}-}", e.getOuterHTML()).replace("{-{-PRODUCT_NAME-}-}", t.getOuterHTML()).replaceAll("{-{-PRODUCT_PRICE-}-}", M).replaceAll("{-{-PRODUCT_ORIGINAL_PRICE-}-}", D).replace("{-{-PRODUCT_QUANTITY-}-}", n.getOuterHTML()).replace("{-{-PRODUCT_BUTTON-}-}", o.getOuterHTML()), s = s.trim().replace(b, "").slice(0, -5), this.api.getDocumentModifier().modifyHtml(this.currentNode).setInnerHtml(s).apply(new p("Reordered template"));
|
|
245
251
|
}, 50);
|
|
246
252
|
}
|
|
247
253
|
_updateDataTypeAttributes(e) {
|
|
@@ -249,29 +255,29 @@ class K extends D {
|
|
|
249
255
|
return;
|
|
250
256
|
const t = this.currentNode.closest(".ins-product-td"), i = this.api.getDocumentModifier();
|
|
251
257
|
t && i.modifyHtml(t).setAttribute("data-type", e), this.currentNode.querySelectorAll("[data-type]").forEach((n) => {
|
|
252
|
-
const
|
|
253
|
-
i.modifyHtml(
|
|
254
|
-
}), i.apply(new
|
|
258
|
+
const o = n;
|
|
259
|
+
i.modifyHtml(o).setAttribute("data-type", e);
|
|
260
|
+
}), i.apply(new p("Updated data-type attribute"));
|
|
255
261
|
}
|
|
256
262
|
_updateDataNumberAttributes(e) {
|
|
257
263
|
if (!this.currentNode)
|
|
258
264
|
return;
|
|
259
|
-
const { itemsType: t } = this.store, i = N[t].findIndex((
|
|
265
|
+
const { itemsType: t } = this.store, i = N[t].findIndex((c) => c.value === e);
|
|
260
266
|
let r = "1";
|
|
261
267
|
if (i >= 0)
|
|
262
268
|
r = String(i + 1);
|
|
263
269
|
else if (e) {
|
|
264
|
-
const
|
|
265
|
-
if (
|
|
266
|
-
const [,
|
|
267
|
-
r =
|
|
270
|
+
const c = e.match(/\((\d+)\)/);
|
|
271
|
+
if (c) {
|
|
272
|
+
const [, s] = c;
|
|
273
|
+
r = s;
|
|
268
274
|
}
|
|
269
275
|
}
|
|
270
|
-
const n = this.currentNode.closest(".ins-product-td"),
|
|
271
|
-
n &&
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
}),
|
|
276
|
+
const n = this.currentNode.closest(".ins-product-td"), o = this.api.getDocumentModifier();
|
|
277
|
+
n && o.modifyHtml(n).setAttribute("data-number", r), this.currentNode.querySelectorAll("[data-number]").forEach((c) => {
|
|
278
|
+
const s = c;
|
|
279
|
+
o.modifyHtml(s).setAttribute("data-number", r);
|
|
280
|
+
}), o.apply(new p("Updated data-number attribute"));
|
|
275
281
|
}
|
|
276
282
|
_reFillTemplate() {
|
|
277
283
|
const e = this._getTemplateData();
|
|
@@ -288,7 +294,7 @@ class K extends D {
|
|
|
288
294
|
if (!t)
|
|
289
295
|
return;
|
|
290
296
|
const i = this.store.orientation === S.ORIENTATION.HORIZONTAL, r = this.store.nameTrimming;
|
|
291
|
-
this.api.getDocumentModifier().modifyHtml(t).setStyle("overflow", "hidden").setStyle("white-space", r ? "nowrap" : "normal").setStyle("text-overflow", r ? "ellipsis" : "unset").setStyle("max-width", i ? "130px" : "520px").setStyle("width", i ? "130px" : "520px").apply(new
|
|
297
|
+
this.api.getDocumentModifier().modifyHtml(t).setStyle("overflow", "hidden").setStyle("white-space", r ? "nowrap" : "normal").setStyle("text-overflow", r ? "ellipsis" : "unset").setStyle("max-width", i ? "130px" : "520px").setStyle("width", i ? "130px" : "520px").apply(new p("Recalculated trimming after orientation change"));
|
|
292
298
|
}
|
|
293
299
|
_getParagraphFromBlock(e) {
|
|
294
300
|
return e.querySelector("p");
|
|
@@ -305,7 +311,7 @@ class K extends D {
|
|
|
305
311
|
} else {
|
|
306
312
|
const n = i.match(/([^0-9.,\s]+)/);
|
|
307
313
|
if (n && n[1]) {
|
|
308
|
-
const
|
|
314
|
+
const o = n[1].trim(), l = new RegExp(`\\s*${this._escapeRegex(o)}\\s*`);
|
|
309
315
|
r = i.replace(l, "").trim();
|
|
310
316
|
}
|
|
311
317
|
}
|
|
@@ -320,6 +326,6 @@ class K extends D {
|
|
|
320
326
|
}
|
|
321
327
|
}
|
|
322
328
|
export {
|
|
323
|
-
|
|
324
|
-
|
|
329
|
+
B as CONTROL_BLOCK_ID,
|
|
330
|
+
J as ItemsBlockControl
|
|
325
331
|
};
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { BlockType as O, BlockAttr as N } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
2
|
import { ItemsBlockId as I } from "./enums/controlEnums.js";
|
|
3
|
-
import { productPairs as R, templateFirstLine as
|
|
4
|
-
import { ItemInCartOptions as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import { productPairs as R, templateFirstLine as H } from "./enums/productEnums.js";
|
|
4
|
+
import { ItemInCartOptions as C, SETTINGS_ENUMS as w, DefaultConfigValues as F } from "./enums/settingsEnums.js";
|
|
5
|
+
import Y from "./layouts/horizontal.html.js";
|
|
6
|
+
import q from "./layouts/vertical.html.js";
|
|
7
|
+
import { escapeReplacement as g } from "./utils/nodeConfigUtils.js";
|
|
8
|
+
let [M] = R.PAIRS_FOR_EXTENSION.imageSrc.CART_ITEMS.DEFAULT, [L] = R.PAIRS_FOR_EXTENSION.name.CART_ITEMS.DEFAULT, [x] = R.PAIRS_FOR_EXTENSION.price.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [S] = R.PAIRS_FOR_EXTENSION.originalPrice.CART_ITEMS.DEFAULT_PRICE_FORMATTED, [D] = R.PAIRS_FOR_EXTENSION.quantity.CART_ITEMS.DEFAULT;
|
|
9
|
+
const j = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCase().startsWith(e.toLowerCase())).join("; ").replace(/;\s*$/, ""), U = (s) => j(s, "text-align"), m = (s, e) => {
|
|
9
10
|
const l = new RegExp(`${e}\\s*:\\s*([^;]+)`, "i"), a = s.match(l);
|
|
10
11
|
return a ? a[1].trim() : null;
|
|
11
|
-
},
|
|
12
|
+
}, v = (s, e, l) => new RegExp(`(${e}\\s*:\\s*)[^;]+`, "gi").test(s) ? s.replace(
|
|
12
13
|
new RegExp(`(${e}\\s*:\\s*)[^;]+`, "gi"),
|
|
13
14
|
`$1${l}`
|
|
14
|
-
) : s,
|
|
15
|
+
) : s, Z = (s, e, l, a) => {
|
|
15
16
|
const c = l || F.productImageHeight, n = (a == null ? void 0 : a.imageVisible) === !1 ? "display: none; " : "";
|
|
16
17
|
return `
|
|
17
18
|
<td class="esd-block-image document-node-component default-block-component selectable ng-star-inserted"
|
|
@@ -27,16 +28,16 @@ const q = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
|
|
|
27
28
|
href="#!">
|
|
28
29
|
<img class="adapt-img document-node-component ng-star-inserted"
|
|
29
30
|
src="${M}"
|
|
30
|
-
alt="${
|
|
31
|
+
alt="${L}"
|
|
31
32
|
width="${c}"
|
|
32
33
|
height="${c}">
|
|
33
34
|
</a>
|
|
34
35
|
</td>
|
|
35
36
|
`;
|
|
36
|
-
},
|
|
37
|
+
}, J = (s, e) => `
|
|
37
38
|
<${O.BLOCK_IMAGE}
|
|
38
39
|
${N.BLOCK_IMAGE.src}="${M}"
|
|
39
|
-
${N.BLOCK_IMAGE.alt}="${
|
|
40
|
+
${N.BLOCK_IMAGE.alt}="${L}"
|
|
40
41
|
${N.BLOCK_IMAGE.href}="#!"
|
|
41
42
|
${N.BLOCK_IMAGE.width}="${F.productImageWidth}"
|
|
42
43
|
${N.BLOCK_IMAGE.height}="${F.productImageWidth}"
|
|
@@ -46,7 +47,7 @@ const q = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
|
|
|
46
47
|
data-type="${s}"
|
|
47
48
|
data-number="${e}"
|
|
48
49
|
/>
|
|
49
|
-
`,
|
|
50
|
+
`, tt = (s, e, l, a, c) => {
|
|
50
51
|
const d = `
|
|
51
52
|
text-decoration:none;
|
|
52
53
|
font-size: inherit;
|
|
@@ -62,11 +63,11 @@ const q = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
|
|
|
62
63
|
text-overflow: ellipsis;
|
|
63
64
|
`;
|
|
64
65
|
if (e) {
|
|
65
|
-
const i =
|
|
66
|
+
const i = m(a || "", "text-align") || "center", r = U(a || d), o = m(r, "color"), t = m(r, "font-size"), p = [
|
|
66
67
|
o ? `color: ${o}` : "",
|
|
67
68
|
t ? `font-size: ${t}` : ""
|
|
68
|
-
].filter(Boolean).join("; "), T =
|
|
69
|
-
|
|
69
|
+
].filter(Boolean).join("; "), T = v(
|
|
70
|
+
v(r, "color", "inherit"),
|
|
70
71
|
"font-size",
|
|
71
72
|
"inherit"
|
|
72
73
|
), u = (c == null ? void 0 : c.nameVisible) === !1 ? "display: none;" : "display: table-cell;";
|
|
@@ -84,7 +85,7 @@ const q = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
|
|
|
84
85
|
product-attr="name"
|
|
85
86
|
data-slot-2
|
|
86
87
|
width="100%">
|
|
87
|
-
${
|
|
88
|
+
${L}
|
|
88
89
|
</a>
|
|
89
90
|
</p>
|
|
90
91
|
</td>
|
|
@@ -117,12 +118,12 @@ const q = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
|
|
|
117
118
|
product-attr="name"
|
|
118
119
|
data-slot-2
|
|
119
120
|
width="100%">
|
|
120
|
-
${
|
|
121
|
+
${L}
|
|
121
122
|
</a>
|
|
122
123
|
</p>
|
|
123
124
|
</${O.BLOCK_TEXT}>
|
|
124
125
|
`;
|
|
125
|
-
},
|
|
126
|
+
}, et = (s, e, l, a, c, n, d, i, r, o) => {
|
|
126
127
|
let t = x;
|
|
127
128
|
if (a && a.trim()) {
|
|
128
129
|
const E = `${a.trim()}`;
|
|
@@ -173,7 +174,7 @@ const q = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
|
|
|
173
174
|
</p>
|
|
174
175
|
</${O.BLOCK_TEXT}>
|
|
175
176
|
`;
|
|
176
|
-
},
|
|
177
|
+
}, at = (s, e, l, a, c, n, d = !0, i, r, o) => {
|
|
177
178
|
let t = S;
|
|
178
179
|
if (a && a.trim()) {
|
|
179
180
|
const E = `${a.trim()}`;
|
|
@@ -227,7 +228,7 @@ const q = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
|
|
|
227
228
|
</p>
|
|
228
229
|
</${O.BLOCK_TEXT}>
|
|
229
230
|
`;
|
|
230
|
-
},
|
|
231
|
+
}, st = (s = !0, e, l) => {
|
|
231
232
|
const a = s ? "" : 'style="display: none;"';
|
|
232
233
|
if (e) {
|
|
233
234
|
const n = l || "text-align: center; font-size: 14px;";
|
|
@@ -263,9 +264,9 @@ const q = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
|
|
|
263
264
|
</p>
|
|
264
265
|
</${O.BLOCK_TEXT}>
|
|
265
266
|
`;
|
|
266
|
-
},
|
|
267
|
+
}, lt = (s, e, l = "Buy", a, c, n = !0, d = !0) => {
|
|
267
268
|
if (a) {
|
|
268
|
-
const i =
|
|
269
|
+
const i = m(c || "", "background") || m(c || "", "background-color"), r = i ? `border-width: 0px; background: ${i};` : "border-width: 0px;", o = n ? "es-fw" : "es-il", t = (c || "").replace("border-width: 0;", "");
|
|
269
270
|
return `
|
|
270
271
|
<td class="esd-block-button ins-button default-block-component selectable"
|
|
271
272
|
align="center" width="100%" name="buy-button" caption="${l}"
|
|
@@ -298,7 +299,7 @@ const q = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
|
|
|
298
299
|
>${l}
|
|
299
300
|
</${O.BLOCK_BUTTON}>
|
|
300
301
|
`;
|
|
301
|
-
},
|
|
302
|
+
}, rt = (s, e, l, a = !0, c = !0) => {
|
|
302
303
|
const n = e === w.ORIENTATION.VERTICAL, d = l === "horizontal";
|
|
303
304
|
if (n) {
|
|
304
305
|
const i = !d, r = i || !c ? "100%" : "50%", o = i || !a ? "100%" : "50%";
|
|
@@ -318,16 +319,16 @@ const q = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
|
|
|
318
319
|
/<td\s+[^>]*class="[^"]*vertical-price[^"]*"[^>]*>/gi,
|
|
319
320
|
(i) => i.replace(/display:\s*none;?/gi, "display: table-cell;")
|
|
320
321
|
);
|
|
321
|
-
},
|
|
322
|
+
}, it = (s) => s ? `<td align="center"
|
|
322
323
|
esd-extension-block-id="items-block" width="560"
|
|
323
324
|
data-number="4"
|
|
324
|
-
class="ins-product-td items-block items-block-v2 esd-items-block esd-extension-block esd-container-frame">` :
|
|
325
|
+
class="ins-product-td items-block items-block-v2 esd-items-block esd-extension-block esd-container-frame">` : H, z = (s, e, l, a, c, n, d, i, r, o, t, p, T, u = "horizontal", P, $, b, _) => {
|
|
325
326
|
const y = `${`data-type="${e}" data-number="${l}"`} data-orientation="${a}"`, A = s.replace(
|
|
326
327
|
/<td([^>]*class="[^"]*ins-product-td[^"]*"[^>]*)>/,
|
|
327
328
|
`<td$1 ${y}>`
|
|
328
|
-
),
|
|
329
|
+
), X = r == null ? void 0 : r["data-product_image_control_image-height"], G = n ? Z(e, l, X, t) : J(e, l), K = (t == null ? void 0 : t.buttonLabel) || "Buy", f = (t == null ? void 0 : t.buttonFullWidth) !== void 0 ? t.buttonFullWidth : !0, B = e === w.ITEMS_TYPE.BROWSED_ITEMS ? !1 : t == null ? void 0 : t.quantityControlEnabled, W = (t == null ? void 0 : t.buttonVisible) !== void 0 ? t.buttonVisible : (r == null ? void 0 : r["data-product_button_control_enabled"]) !== "false", k = (t == null ? void 0 : t.priceVisible) !== void 0 ? t.priceVisible : (r == null ? void 0 : r["data-product_price_control_enabled"]) !== "false", V = (t == null ? void 0 : t.originalPriceVisible) !== void 0 ? t.originalPriceVisible : (r == null ? void 0 : r["data-product_original_price_control_enabled"]) !== "false", Q = A.replace("{-{-TEMPLATE_FIRST_LINE-}-}", it(n)).replace("{-{-PRODUCT_IMAGE-}-}", G).replace("{-{-PRODUCT_NAME-}-}", tt(e, n, a, p, t)).replaceAll(
|
|
329
330
|
"{-{-PRODUCT_PRICE-}-}",
|
|
330
|
-
|
|
331
|
+
g(et(
|
|
331
332
|
e,
|
|
332
333
|
l,
|
|
333
334
|
c,
|
|
@@ -338,10 +339,10 @@ const q = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
|
|
|
338
339
|
_,
|
|
339
340
|
a,
|
|
340
341
|
k
|
|
341
|
-
)
|
|
342
|
+
))
|
|
342
343
|
).replaceAll(
|
|
343
344
|
"{-{-PRODUCT_ORIGINAL_PRICE-}-}",
|
|
344
|
-
|
|
345
|
+
g(at(
|
|
345
346
|
e,
|
|
346
347
|
l,
|
|
347
348
|
c,
|
|
@@ -352,20 +353,20 @@ const q = (s, e) => s.split(";").map((l) => l.trim()).filter((l) => !l.toLowerCa
|
|
|
352
353
|
$,
|
|
353
354
|
_,
|
|
354
355
|
a
|
|
355
|
-
)
|
|
356
|
-
).replace("{-{-PRODUCT_QUANTITY-}-}",
|
|
356
|
+
))
|
|
357
|
+
).replace("{-{-PRODUCT_QUANTITY-}-}", st(B, n, b)).replace(
|
|
357
358
|
"{-{-PRODUCT_BUTTON-}-}",
|
|
358
|
-
|
|
359
|
+
lt(e, l, K, n, T, f, W)
|
|
359
360
|
);
|
|
360
|
-
return
|
|
361
|
-
|
|
361
|
+
return rt(
|
|
362
|
+
Q,
|
|
362
363
|
a,
|
|
363
364
|
u,
|
|
364
365
|
k,
|
|
365
366
|
V
|
|
366
367
|
);
|
|
367
368
|
};
|
|
368
|
-
function
|
|
369
|
+
function Tt({
|
|
369
370
|
orientation: s,
|
|
370
371
|
itemsType: e = w.ITEMS_TYPE.CART_ITEMS,
|
|
371
372
|
itemId: l,
|
|
@@ -382,7 +383,7 @@ function $t({
|
|
|
382
383
|
quantityStyles: u,
|
|
383
384
|
priceOrientation: P
|
|
384
385
|
}) {
|
|
385
|
-
const $ =
|
|
386
|
+
const $ = C[e].findIndex((A) => A.value === l);
|
|
386
387
|
let b = "1";
|
|
387
388
|
if ($ >= 0)
|
|
388
389
|
b = String($ + 1);
|
|
@@ -391,12 +392,12 @@ function $t({
|
|
|
391
392
|
A && A[1] && ([, b] = A);
|
|
392
393
|
}
|
|
393
394
|
const _ = (r == null ? void 0 : r.priceSinglePrice) ?? (i == null ? void 0 : i["data-product_price_control_single_price"]) === "1" ?? !1;
|
|
394
|
-
M = R.PAIRS_FOR_EXTENSION.imageSrc[e].DEFAULT[$ >= 0 ? $ : 0],
|
|
395
|
+
M = R.PAIRS_FOR_EXTENSION.imageSrc[e].DEFAULT[$ >= 0 ? $ : 0], L = R.PAIRS_FOR_EXTENSION.name[e].DEFAULT[$ >= 0 ? $ : 0];
|
|
395
396
|
const E = R.PAIRS_FOR_EXTENSION.price[e], h = R.PAIRS_FOR_EXTENSION.originalPrice[e];
|
|
396
397
|
_ ? (x = d ? E.DEFAULT_SINGLE_PRICE_FORMATTED : E.DEFAULT_SINGLE_PRICE, S = d ? h.DEFAULT_SINGLE_PRICE_FORMATTED : h.DEFAULT_SINGLE_PRICE) : (x = d ? E.DEFAULT_PRICE_FORMATTED : E.DEFAULT_PRICE, S = d ? h.DEFAULT_PRICE_FORMATTED : h.DEFAULT_PRICE), D = R.PAIRS_FOR_EXTENSION.quantity[e].DEFAULT;
|
|
397
398
|
const y = P || (r == null ? void 0 : r.priceOrientation) || "horizontal";
|
|
398
|
-
return s === w.ORIENTATION.VERTICAL ?
|
|
399
|
-
|
|
399
|
+
return s === w.ORIENTATION.VERTICAL ? z(
|
|
400
|
+
q,
|
|
400
401
|
e,
|
|
401
402
|
b,
|
|
402
403
|
s,
|
|
@@ -415,8 +416,8 @@ function $t({
|
|
|
415
416
|
T,
|
|
416
417
|
u,
|
|
417
418
|
_
|
|
418
|
-
) :
|
|
419
|
-
|
|
419
|
+
) : z(
|
|
420
|
+
Y,
|
|
420
421
|
e,
|
|
421
422
|
b,
|
|
422
423
|
s,
|
|
@@ -438,5 +439,5 @@ function $t({
|
|
|
438
439
|
);
|
|
439
440
|
}
|
|
440
441
|
export {
|
|
441
|
-
|
|
442
|
+
Tt as getDefaultTemplate
|
|
442
443
|
};
|
|
@@ -3,7 +3,8 @@ import { DefaultConfigValues as i, SETTINGS_ENUMS as n, ItemInCartOptions as g }
|
|
|
3
3
|
function d() {
|
|
4
4
|
return String(Date.now() + Math.floor(Math.random() * 1e3));
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
const E = (o) => o.replace(/\$/g, "$$$$");
|
|
7
|
+
function S() {
|
|
7
8
|
return {
|
|
8
9
|
initialized: !0,
|
|
9
10
|
blockInstanceId: d(),
|
|
@@ -148,7 +149,7 @@ function C(o) {
|
|
|
148
149
|
)
|
|
149
150
|
};
|
|
150
151
|
}
|
|
151
|
-
function
|
|
152
|
+
function y(o) {
|
|
152
153
|
const t = s(o);
|
|
153
154
|
if (!t)
|
|
154
155
|
return null;
|
|
@@ -158,7 +159,7 @@ function S(o) {
|
|
|
158
159
|
const r = C(t);
|
|
159
160
|
return r || null;
|
|
160
161
|
}
|
|
161
|
-
function
|
|
162
|
+
function A(o, t, e) {
|
|
162
163
|
const r = s(o);
|
|
163
164
|
if (!r)
|
|
164
165
|
return;
|
|
@@ -166,9 +167,10 @@ function y(o, t, e) {
|
|
|
166
167
|
t.getDocumentModifier().modifyHtml(r).setNodeConfig(u).apply(new b("Update Items block configuration"));
|
|
167
168
|
}
|
|
168
169
|
export {
|
|
170
|
+
E as escapeReplacement,
|
|
169
171
|
d as generateBlockInstanceId,
|
|
170
|
-
|
|
171
|
-
|
|
172
|
+
S as getDefaultItemsBlockConfig,
|
|
173
|
+
y as getItemsBlockConfig,
|
|
172
174
|
s as getItemsBlockContainer,
|
|
173
|
-
|
|
175
|
+
A as setItemsBlockConfig
|
|
174
176
|
};
|
|
@@ -51,10 +51,9 @@ class _ extends O {
|
|
|
51
51
|
const o = E !== this.lastBlockInstanceId;
|
|
52
52
|
return o ? (this.currentNode && e(this.currentNode), n(), this.lastBlockInstanceId = E) : n(), o;
|
|
53
53
|
}
|
|
54
|
-
_GuLabel({ text: e, name: n = ""
|
|
54
|
+
_GuLabel({ text: e, name: n = "" }) {
|
|
55
55
|
return `
|
|
56
56
|
<${t.LABEL}
|
|
57
|
-
style="${E === "top" ? "margin-bottom: 8px;" : ""}"
|
|
58
57
|
${$.LABEL.text}="${e}"
|
|
59
58
|
${$.LABEL.name}="${n || `${e} Label`}">
|
|
60
59
|
</${t.LABEL}>
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.gap-16[data-v-6562e38c],.gap-16[data-v-1ccb6d4a]{gap:16px}[data-v-3bf5c743] .in-button-v2__wrapper{line-height:0}[data-v-
|
|
1
|
+
.gap-16[data-v-6562e38c],.gap-16[data-v-1ccb6d4a]{gap:16px}[data-v-3bf5c743] .in-button-v2__wrapper{line-height:0}[data-v-5196584c] .in-segments-wrapper .in-tooltip-wrapper__box{text-align:left}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}.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}.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}.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-bb3bb07c] .guido__verion-history-view-option-selection-desktop svg,[data-v-bb3bb07c] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-bb3bb07c] .in-segments-wrapper__button_selected,[data-v-bb3bb07c] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-7a09985c]{gap:16px}[data-v-c2adc57d] .in-progress-wrapper__progress p span:last-child{display:none!important}.desktop-preview-container[data-v-b37f3f6d],[data-v-b37f3f6d] .desktop-preview-container .in-container{min-height:720px!important;height:100%}.cropped-text[data-v-4b876c1b]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[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}
|
|
@@ -7,4 +7,5 @@ export declare const useActionsApi: () => {
|
|
|
7
7
|
getPreviewData: (options?: CompileEmailOptions) => Promise<CompiledEmailResult>;
|
|
8
8
|
updateTimerInClonedTemplate: () => Promise<string | null>;
|
|
9
9
|
updateHtmlAndCss: (html: string, css: string) => void;
|
|
10
|
+
editorSave: () => void;
|
|
10
11
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ItemsBlockConfig } from './utils/nodeConfigUtils';
|
|
2
2
|
declare const migrationTemplate = "ADD YOUR MIGRATION HERE";
|
|
3
3
|
type ProductType = 'CART_ITEMS' | 'BROWSED_ITEMS' | 'PURCHASED_ITEMS';
|
|
4
4
|
type OrientationType = 'vertical' | 'horizontal';
|
|
@@ -35,6 +35,11 @@ export interface ItemsBlockConfig {
|
|
|
35
35
|
* Generates a unique block instance ID.
|
|
36
36
|
*/
|
|
37
37
|
export declare function generateBlockInstanceId(): string;
|
|
38
|
+
/**
|
|
39
|
+
* Escapes $ characters in a string for safe use in String.replace/replaceAll.
|
|
40
|
+
* Prevents currency symbols like "$", "R$", "HK$" from being interpreted as special replacement patterns.
|
|
41
|
+
*/
|
|
42
|
+
export declare const escapeReplacement: (str: string) => string;
|
|
38
43
|
/**
|
|
39
44
|
* Returns default ItemsBlockConfig values.
|
|
40
45
|
* These are used when initializing a new block or when migrating from legacy format.
|
|
@@ -74,7 +74,7 @@ export declare abstract class CommonControl extends Control {
|
|
|
74
74
|
* @returns true if block instance changed, false otherwise
|
|
75
75
|
*/
|
|
76
76
|
protected handleBlockInstanceChange(syncFunction: (node: ImmutableHtmlNode) => void, updateUI: () => void): boolean;
|
|
77
|
-
_GuLabel({ text, name
|
|
77
|
+
_GuLabel({ text, name }: LabelProps): string;
|
|
78
78
|
_GuToggle(name: string): string;
|
|
79
79
|
_GuSelectItem({ text, value }: {
|
|
80
80
|
text: string;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useHtmlCompiler as
|
|
3
|
-
import { useDynamicContentStore as
|
|
4
|
-
import { useUnsubscribeStore as
|
|
5
|
-
const
|
|
6
|
-
const i =
|
|
1
|
+
import { useActionsApi as b } from "../composables/useActionsApi.js";
|
|
2
|
+
import { useHtmlCompiler as f } from "../composables/useHtmlCompiler.js";
|
|
3
|
+
import { useDynamicContentStore as C } from "../stores/dynamic-content.js";
|
|
4
|
+
import { useUnsubscribeStore as T } from "../stores/unsubscribe.js";
|
|
5
|
+
const P = () => {
|
|
6
|
+
const i = C(), t = T(), { getCompiledEmail: o, getTemplateData: s, editorSave: n } = b(), { compileHtml: a } = f();
|
|
7
7
|
return {
|
|
8
8
|
prepareTemplateDetails: async () => {
|
|
9
|
-
const { html:
|
|
9
|
+
const { html: r, ampHtml: m = "", ampErrors: c = [] } = await o({
|
|
10
10
|
minimize: !0,
|
|
11
11
|
resetDataSavedFlag: !1
|
|
12
|
-
}), { html:
|
|
13
|
-
return console.debug("HTML Compilation Stats:", {
|
|
12
|
+
}), { html: l, css: p, syncModulesIds: u = [] } = await s(), { compiledHtml: d, stats: e, appliedRules: g } = a(r), S = i.getSelectedDynamicContentList;
|
|
13
|
+
return n(), console.debug("HTML Compilation Stats:", {
|
|
14
14
|
originalSize: e.originalSize,
|
|
15
15
|
compiledSize: e.compiledSize,
|
|
16
16
|
reduction: `${e.reductionPercentage.toFixed(2)}%`,
|
|
17
|
-
appliedRules:
|
|
17
|
+
appliedRules: g,
|
|
18
18
|
executionTime: `${e.executionTime.toFixed(2)}ms`
|
|
19
19
|
}), {
|
|
20
|
-
dynamicContentList:
|
|
21
|
-
compiledHtml:
|
|
22
|
-
rawHtml:
|
|
23
|
-
css:
|
|
20
|
+
dynamicContentList: S,
|
|
21
|
+
compiledHtml: d,
|
|
22
|
+
rawHtml: l,
|
|
23
|
+
css: p,
|
|
24
24
|
ampHtml: m,
|
|
25
|
-
ampErrors:
|
|
26
|
-
modules:
|
|
25
|
+
ampErrors: c,
|
|
26
|
+
modules: u,
|
|
27
27
|
recommendation: {
|
|
28
28
|
campaignUrls: {},
|
|
29
29
|
configs: {}
|
|
@@ -37,5 +37,5 @@ const z = () => {
|
|
|
37
37
|
};
|
|
38
38
|
};
|
|
39
39
|
export {
|
|
40
|
-
|
|
40
|
+
P as useTemplatePreparation
|
|
41
41
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.eee5ecc",
|
|
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",
|