@useinsider/guido 2.0.0-beta.eee5ecc → 2.0.0-beta.f66b754
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/PreviewContainer.vue.js +3 -3
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.js +6 -6
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue2.js +17 -13
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +6 -6
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +14 -12
- package/dist/components/organisms/email-preview/desktop-preview/DesktopBrowserHeader.vue.js +18 -0
- package/dist/components/organisms/email-preview/desktop-preview/DesktopBrowserHeader.vue2.js +15 -0
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +16 -15
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +14 -22
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +3 -3
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +11 -10
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +12 -10
- package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.js +11 -10
- package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue2.js +15 -14
- package/dist/components/organisms/header/EditorActions.vue.js +21 -0
- package/dist/components/organisms/header/EditorActions.vue2.js +41 -0
- package/dist/components/organisms/header/EditorToolbar.vue.js +18 -0
- package/dist/components/organisms/header/EditorToolbar.vue2.js +17 -0
- package/dist/components/organisms/header/HeaderWrapper.vue.js +6 -5
- package/dist/components/organisms/header/LeftSlot.vue.js +9 -9
- package/dist/components/organisms/header/LeftSlot.vue2.js +13 -14
- package/dist/components/organisms/header/MiddleSlot.vue.js +7 -7
- package/dist/components/organisms/header/MiddleSlot.vue2.js +11 -15
- package/dist/components/organisms/header/RightSlot.vue.js +11 -14
- package/dist/components/organisms/header/RightSlot.vue2.js +13 -30
- package/dist/components/organisms/header/version-history/VersionHistory.vue.js +5 -5
- package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +15 -15
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +1 -1
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +20 -19
- package/dist/config/migrator/itemsBlockMigrator.js +72 -64
- package/dist/enums/academy.js +8 -0
- package/dist/enums/onboarding.js +1 -2
- package/dist/enums/unsubscribe.js +20 -21
- package/dist/extensions/Blocks/Items/block.js +23 -20
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +38 -32
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +69 -75
- package/dist/extensions/Blocks/Items/enums/settingsEnums.js +2 -0
- package/dist/extensions/Blocks/Items/extension.js +8 -9
- package/dist/extensions/Blocks/Items/template.js +210 -221
- package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +61 -53
- package/dist/guido.css +1 -1
- package/dist/src/components/organisms/email-preview/desktop-preview/DesktopBrowserHeader.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +4 -0
- package/dist/src/components/organisms/header/EditorToolbar.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
- package/dist/src/enums/academy.d.ts +12 -0
- package/dist/src/enums/onboarding.d.ts +0 -1
- package/dist/src/enums/unsubscribe.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/enums/settingsEnums.d.ts +2 -0
- package/dist/src/extensions/Blocks/Items/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +2 -5
- package/dist/src/stores/editor.d.ts +21 -0
- package/dist/static/assets/desktop/desktop-mockup-center.svg.js +4 -0
- package/dist/static/assets/desktop/desktop-mockup-left.svg.js +4 -0
- package/dist/static/assets/desktop/desktop-mockup-right.svg.js +4 -0
- package/dist/static/assets/mobile/email-mockup.svg.js +4 -0
- package/dist/static/assets/mobile/inbox-mockup.svg.js +4 -0
- package/dist/static/styles/components/wide-panel.css.js +1 -1
- package/dist/stores/editor.js +1 -0
- package/package.json +1 -1
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.js +0 -17
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +0 -20
- package/dist/static/assets/inbox-mockup.svg.js +0 -4
- package/dist/static/assets/phone-mockup.svg.js +0 -4
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var L = Object.defineProperty;
|
|
2
|
-
var K = (
|
|
3
|
-
var
|
|
2
|
+
var K = (r, t, o) => t in r ? L(r, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : r[t] = o;
|
|
3
|
+
var v = (r, t, o) => K(r, typeof t != "symbol" ? t + "" : t, o);
|
|
4
4
|
import { productPairs as B } from "../../extensions/Blocks/Items/enums/productEnums.js";
|
|
5
5
|
import { ItemInCartOptions as E, DefaultConfigValues as g, SETTINGS_ENUMS as _ } from "../../extensions/Blocks/Items/enums/settingsEnums.js";
|
|
6
6
|
import { getDefaultTemplate as U } from "../../extensions/Blocks/Items/template.js";
|
|
7
|
-
const
|
|
7
|
+
const q = {
|
|
8
8
|
img: {
|
|
9
9
|
pairsKey: "imageSrc",
|
|
10
10
|
defaultKey: "DEFAULT",
|
|
@@ -71,57 +71,59 @@ const w = {
|
|
|
71
71
|
isArray: !1
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
|
-
function
|
|
74
|
+
function w() {
|
|
75
75
|
return String(Date.now() + Math.floor(Math.random() * 1e3));
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
return
|
|
77
|
+
function F(r) {
|
|
78
|
+
return r ? {
|
|
79
79
|
CartItems: _.ITEMS_TYPE.CART_ITEMS,
|
|
80
80
|
BrowsedItems: _.ITEMS_TYPE.BROWSED_ITEMS,
|
|
81
81
|
PurchasedItems: _.ITEMS_TYPE.PURCHASED_ITEMS,
|
|
82
82
|
CART_ITEMS: _.ITEMS_TYPE.CART_ITEMS,
|
|
83
83
|
BROWSED_ITEMS: _.ITEMS_TYPE.BROWSED_ITEMS,
|
|
84
84
|
PURCHASED_ITEMS: _.ITEMS_TYPE.PURCHASED_ITEMS
|
|
85
|
-
}[
|
|
85
|
+
}[r] || _.ITEMS_TYPE.CART_ITEMS : _.ITEMS_TYPE.CART_ITEMS;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
88
|
-
const t = (e, a) => e == null ? a : e === "1" || e === "true",
|
|
89
|
-
let i =
|
|
87
|
+
function R(r) {
|
|
88
|
+
const t = (e, a) => e == null ? a : e === "1" || e === "true", o = (e, a) => e || a, c = r["data-type"] || r["data-source"], n = F(c);
|
|
89
|
+
let i = r["data-cart_items_select_control_value"] || g.cartItemsSelectControlValue;
|
|
90
90
|
if (i && !i.includes("{{") && /^\d+$/.test(i)) {
|
|
91
91
|
const e = parseInt(i) - 1, a = E[n];
|
|
92
92
|
a && a[e] && (i = a[e].value);
|
|
93
93
|
}
|
|
94
94
|
return {
|
|
95
95
|
initialized: !0,
|
|
96
|
-
blockInstanceId: r
|
|
96
|
+
blockInstanceId: o(r["data-block-instance-id"], w()),
|
|
97
97
|
source: n,
|
|
98
98
|
type: n,
|
|
99
99
|
itemsSelectValue: i,
|
|
100
|
-
orientation:
|
|
101
|
-
nameTrimming: t(
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
100
|
+
orientation: r["data-card_orientation_control_value"] || _.ORIENTATION.VERTICAL,
|
|
101
|
+
nameTrimming: t(r["data-product_name_control_trim"], !0),
|
|
102
|
+
nameControlEnabled: t(r["data-product_name_control_enabled"], !0),
|
|
103
|
+
priceHideDiscount: t(r["data-product_price_control_nodup"], !0),
|
|
104
|
+
priceFormatted: t(r["data-product_price_control_formated"], !0),
|
|
105
|
+
priceSinglePrice: t(r["data-product_price_control_single_price"], !1),
|
|
106
|
+
priceCurrencySymbol: o(
|
|
107
|
+
r["data-product_price_currency_symbol"],
|
|
107
108
|
g.productPriceCurrencySymbolControlValue
|
|
108
109
|
),
|
|
109
|
-
priceCurrencyLocation:
|
|
110
|
-
|
|
110
|
+
priceCurrencyLocation: o(
|
|
111
|
+
r["data-product_price_currency_location"],
|
|
111
112
|
g.productPriceCurrencyLocationControlValue
|
|
112
113
|
),
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
114
|
+
priceControlOpened: t(r["data-product_price_control_opened"], !0),
|
|
115
|
+
priceOrientation: r["data-product_original_price_control_orientation"] || "horizontal",
|
|
116
|
+
quantityControlEnabled: t(r["data-product_quantity_control_enabled"], !0),
|
|
117
|
+
buttonLink: o(r["data-product_button_link"], g.productButtonLinkControlValue),
|
|
118
|
+
imageLink: o(r["data-product_image_link"], g.productImageLinkControlValue),
|
|
119
|
+
buttonLabel: o(r["data-product_button_control_label"], "Buy"),
|
|
120
|
+
buttonFullWidth: t(r["data-product_button_control_atw"], !0),
|
|
121
|
+
imageVisible: t(r["data-product_image_control_enabled"], !0),
|
|
122
|
+
nameVisible: t(r["data-product_name_control_enabled"], !0),
|
|
123
|
+
quantityVisible: t(r["data-product_quantity_visible"], !0),
|
|
124
|
+
priceVisible: t(r["data-product_price_visible"], !0),
|
|
125
|
+
originalPriceVisible: t(r["data-product_original_price_control_enabled"], !0),
|
|
126
|
+
buttonVisible: t(r["data-product_button_visible"], !0)
|
|
125
127
|
};
|
|
126
128
|
}
|
|
127
129
|
const x = {
|
|
@@ -131,17 +133,17 @@ const x = {
|
|
|
131
133
|
};
|
|
132
134
|
class N {
|
|
133
135
|
constructor() {
|
|
134
|
-
|
|
136
|
+
v(this, "parser");
|
|
135
137
|
this.parser = new DOMParser();
|
|
136
138
|
}
|
|
137
139
|
migrate(t) {
|
|
138
140
|
try {
|
|
139
|
-
let
|
|
140
|
-
|
|
141
|
-
const c = this.parser.parseFromString(
|
|
141
|
+
let o = this.removeJinjaConditionals(t);
|
|
142
|
+
o = this.replaceTemplateVariables(o);
|
|
143
|
+
const c = this.parser.parseFromString(o, "text/html"), n = c.querySelectorAll(
|
|
142
144
|
"td.esd-cart-items-block, td.esd-browsed-items-block, td.esd-purchased-items-block"
|
|
143
145
|
);
|
|
144
|
-
return n.length === 0 ? (console.warn("ItemsBlockMigrator: No blocks found with items block selectors"),
|
|
146
|
+
return n.length === 0 ? (console.warn("ItemsBlockMigrator: No blocks found with items block selectors"), o) : (n.forEach((i) => {
|
|
145
147
|
const e = this.extractConfiguration(i), a = U({
|
|
146
148
|
orientation: e.orientation,
|
|
147
149
|
itemsType: e.itemsType,
|
|
@@ -156,20 +158,20 @@ class N {
|
|
|
156
158
|
priceStyles: e.priceStyles,
|
|
157
159
|
originalPriceStyles: e.originalPriceStyles,
|
|
158
160
|
quantityStyles: e.quantityStyles,
|
|
159
|
-
nodeConfig:
|
|
161
|
+
nodeConfig: R(e.configBlockAttributes)
|
|
160
162
|
}), l = this.parser.parseFromString(
|
|
161
163
|
`<table><tbody><tr>${a}</tr></tbody></table>`,
|
|
162
164
|
"text/html"
|
|
163
165
|
).querySelector("td");
|
|
164
166
|
if (l && i.parentNode) {
|
|
165
|
-
const f =
|
|
167
|
+
const f = R(e.configBlockAttributes);
|
|
166
168
|
l.setAttribute("esd-ext-config", JSON.stringify(f));
|
|
167
169
|
const u = l.querySelector("esd-config-block");
|
|
168
170
|
u && u.remove(), i.parentNode.replaceChild(l, i);
|
|
169
171
|
}
|
|
170
172
|
}), c.documentElement.outerHTML);
|
|
171
|
-
} catch (
|
|
172
|
-
return console.error("ItemsBlockMigrator failed:",
|
|
173
|
+
} catch (o) {
|
|
174
|
+
return console.error("ItemsBlockMigrator failed:", o), t;
|
|
173
175
|
}
|
|
174
176
|
}
|
|
175
177
|
/**
|
|
@@ -180,13 +182,13 @@ class N {
|
|
|
180
182
|
*/
|
|
181
183
|
extractConfiguration(t) {
|
|
182
184
|
var C, D, P;
|
|
183
|
-
const
|
|
185
|
+
const o = ((C = t.querySelector("[data-type]")) == null ? void 0 : C.getAttribute("data-type")) || "CART_ITEMS", c = ((D = t.querySelector("[data-number]")) == null ? void 0 : D.getAttribute("data-number")) || "1", n = parseInt(c) - 1, i = E[o], e = ((P = i == null ? void 0 : i[n]) == null ? void 0 : P.value) || i[0].value, a = t.querySelector('[product-attr="price"]'), d = (a == null ? void 0 : a.getAttribute("data-currency_symbol")) || "USD", f = ((a == null ? void 0 : a.getAttribute("data-curency")) || "before") === "after" ? "1" : "0", u = (a == null ? void 0 : a.getAttribute("data-formated")) !== "false", s = this.extractConfigBlockAttributes(t, o), b = s["data-card_orientation_control_value"];
|
|
184
186
|
let S;
|
|
185
187
|
b ? S = b === "horizontal" ? "horizontal" : "vertical" : S = t.querySelector('[colspan="2"]') !== null ? "vertical" : "horizontal";
|
|
186
|
-
const p = t.querySelector('a[product-attr="name"]'), T = (p == null ? void 0 : p.getAttribute("style")) || void 0, y = t.querySelector('a[product-attr="button"]'), m = (y == null ? void 0 : y.getAttribute("style")) || void 0,
|
|
188
|
+
const p = t.querySelector('a[product-attr="name"]'), T = (p == null ? void 0 : p.getAttribute("style")) || void 0, y = t.querySelector('a[product-attr="button"]'), m = (y == null ? void 0 : y.getAttribute("style")) || void 0, M = (a == null ? void 0 : a.getAttribute("style")) || void 0, A = t.querySelector("p.original-price"), h = (A == null ? void 0 : A.getAttribute("style")) || void 0, I = t.querySelector('[product-attr="quantity"]'), k = (I == null ? void 0 : I.getAttribute("style")) || void 0;
|
|
187
189
|
return {
|
|
188
190
|
orientation: S,
|
|
189
|
-
itemsType:
|
|
191
|
+
itemsType: o,
|
|
190
192
|
itemId: e,
|
|
191
193
|
currencySymbol: d,
|
|
192
194
|
currencyLocation: f,
|
|
@@ -194,9 +196,9 @@ class N {
|
|
|
194
196
|
configBlockAttributes: s,
|
|
195
197
|
nameStyles: T,
|
|
196
198
|
buttonStyles: m,
|
|
197
|
-
priceStyles:
|
|
198
|
-
originalPriceStyles:
|
|
199
|
-
quantityStyles:
|
|
199
|
+
priceStyles: M,
|
|
200
|
+
originalPriceStyles: h,
|
|
201
|
+
quantityStyles: k
|
|
200
202
|
};
|
|
201
203
|
}
|
|
202
204
|
/**
|
|
@@ -205,7 +207,7 @@ class N {
|
|
|
205
207
|
* @param block - The block element containing the esd-config-block
|
|
206
208
|
* @param itemsType - The type of items (CART_ITEMS, BROWSED_ITEMS, PURCHASED_ITEMS)
|
|
207
209
|
*/
|
|
208
|
-
extractConfigBlockAttributes(t,
|
|
210
|
+
extractConfigBlockAttributes(t, o) {
|
|
209
211
|
const c = t.querySelector("esd-config-block"), n = {};
|
|
210
212
|
if (!c)
|
|
211
213
|
return this.getDefaultConfigBlockAttributes();
|
|
@@ -214,7 +216,7 @@ class N {
|
|
|
214
216
|
}), n["data-cart_items_select_control_value"]) {
|
|
215
217
|
const e = n["data-cart_items_select_control_value"];
|
|
216
218
|
if (/^\d+$/.test(e)) {
|
|
217
|
-
const a = parseInt(e) - 1, d = E[
|
|
219
|
+
const a = parseInt(e) - 1, d = E[o];
|
|
218
220
|
d && d[a] && (n["data-cart_items_select_control_value"] = d[a].value);
|
|
219
221
|
}
|
|
220
222
|
}
|
|
@@ -225,7 +227,7 @@ class N {
|
|
|
225
227
|
}
|
|
226
228
|
(!n["data-product_price_currency_symbol"] || n["data-product_price_currency_symbol"].trim() === "") && (n["data-product_price_currency_symbol"] = "USD");
|
|
227
229
|
const i = { ...this.getDefaultConfigBlockAttributes(), ...n };
|
|
228
|
-
return i["data-type"] =
|
|
230
|
+
return i["data-type"] = o, i["data-source"] = o, i;
|
|
229
231
|
}
|
|
230
232
|
/**
|
|
231
233
|
* Returns default esd-config-block attributes based on the old template structure
|
|
@@ -237,19 +239,24 @@ class N {
|
|
|
237
239
|
"data-type": "CART_ITEMS",
|
|
238
240
|
"data-card_orientation_control_value": "vertical",
|
|
239
241
|
// Image settings
|
|
242
|
+
"data-product_image_control_opened": "false",
|
|
240
243
|
"data-product_image_control_image-width": "70",
|
|
241
244
|
"data-product_image_control_image-height": "70",
|
|
242
245
|
"data-product_image_control_align_button": "true",
|
|
243
246
|
"data-product_image_control_padding_mobile": "true",
|
|
244
247
|
"data-product_image_link": "{{Abandoned Cart Item (1) Image}}",
|
|
245
|
-
"data-product_image_control_enabled": "
|
|
248
|
+
"data-product_image_control_enabled": "1",
|
|
246
249
|
// Name settings
|
|
247
|
-
"data-
|
|
250
|
+
"data-product_name_control_opened": "false",
|
|
251
|
+
"data-product_name_control_enabled": "1",
|
|
248
252
|
"data-product_name_control_font_font_size": "20",
|
|
249
253
|
"data-product_name_control_trim": "1",
|
|
250
254
|
// Quantity settings
|
|
255
|
+
"data-product_quantity_control_opened": "true",
|
|
251
256
|
"data-product_quantity_control_enabled": "true",
|
|
257
|
+
"data-product_quantity_visible": "1",
|
|
252
258
|
// Price settings
|
|
259
|
+
"data-product_price_control_opened": "false",
|
|
253
260
|
"data-product_price_control_font_font_size": "20",
|
|
254
261
|
"data-product_price_control_color": "#060606",
|
|
255
262
|
"data-product_price_control_curency": "0",
|
|
@@ -258,20 +265,21 @@ class N {
|
|
|
258
265
|
"data-product_price_control_formated": "1",
|
|
259
266
|
"data-product_price_control_nodup": "1",
|
|
260
267
|
"data-product_price_control_single_price": "false",
|
|
261
|
-
"data-
|
|
268
|
+
"data-product_price_visible": "1",
|
|
262
269
|
// Original price settings
|
|
263
270
|
"data-product_original_price_control_font_font_size": "19",
|
|
264
271
|
"data-product_original_price_control_align_align_desktop": "center",
|
|
265
272
|
"data-product_original_price_control_orientation": "horizontal",
|
|
266
273
|
"data-product_original_price_control_enabled": "true",
|
|
267
274
|
// Button settings
|
|
268
|
-
"data-
|
|
275
|
+
"data-product_button_control_opened": "true",
|
|
269
276
|
"data-product_button_control_label": "Buy",
|
|
270
277
|
"data-product_button_control_font_font_size": "17",
|
|
271
278
|
"data-product_button_control_color": "#ffffff",
|
|
272
279
|
"data-product_button_control_background": "#010101",
|
|
273
280
|
"data-product_button_control_atw": "true",
|
|
274
|
-
"data-product_button_link": "{{Abandoned Cart Item (1) Url}}"
|
|
281
|
+
"data-product_button_link": "{{Abandoned Cart Item (1) Url}}",
|
|
282
|
+
"data-product_button_visible": "1"
|
|
275
283
|
};
|
|
276
284
|
}
|
|
277
285
|
/**
|
|
@@ -282,16 +290,16 @@ class N {
|
|
|
282
290
|
* - Purchased Items: purchased_item_total_product_kind, purchased_item_price_N, purchased_item_originalprice_N
|
|
283
291
|
*/
|
|
284
292
|
removeJinjaConditionals(t) {
|
|
285
|
-
let
|
|
293
|
+
let o = t.replace(
|
|
286
294
|
/\{%\s*if\s+(ins_apr|browsed_item|purchased_item)_total_product_kind\s*(>|>)\s*\d+\s*%\}/g,
|
|
287
295
|
""
|
|
288
296
|
);
|
|
289
|
-
return
|
|
297
|
+
return o = o.replace(
|
|
290
298
|
/\{%\s*if\s+(ins_apr|browsed_item|purchased_item)_price_\d+\s*(!=|!=)\s*\1_originalprice_\d+\s*%\}/g,
|
|
291
299
|
""
|
|
292
|
-
),
|
|
300
|
+
), o = o.replace(/\{%\s*endif\s*%\}/g, ""), o = o.replace(/\n\s*\n\s*\n/g, `
|
|
293
301
|
|
|
294
|
-
`),
|
|
302
|
+
`), o;
|
|
295
303
|
}
|
|
296
304
|
/**
|
|
297
305
|
* Replaces template variables with default values from productPairs
|
|
@@ -303,7 +311,7 @@ class N {
|
|
|
303
311
|
* - {{purchased_item_formattedprice_5}} → '1,490.49' (PURCHASED_ITEMS)
|
|
304
312
|
*/
|
|
305
313
|
replaceTemplateVariables(t) {
|
|
306
|
-
const { PAIRS_FOR_EXTENSION:
|
|
314
|
+
const { PAIRS_FOR_EXTENSION: o } = B;
|
|
307
315
|
return t.replace(/{{([^}]+)}}/g, (c, n) => {
|
|
308
316
|
const i = n.match(/^(ins_apr|browsed_item|purchased_item)_([a-z_]+)_(\d+)$/);
|
|
309
317
|
if (!i)
|
|
@@ -311,10 +319,10 @@ class N {
|
|
|
311
319
|
const [, e, a, d] = i, l = x[e];
|
|
312
320
|
if (!l)
|
|
313
321
|
return console.warn(`Unknown variable prefix: ${e}`), c;
|
|
314
|
-
const f =
|
|
322
|
+
const f = q[a];
|
|
315
323
|
if (!f)
|
|
316
324
|
return console.warn(`Unknown variable suffix mapping for: ${a}`), c;
|
|
317
|
-
const { pairsKey: u, defaultKey: s, isArray: b } = f, p =
|
|
325
|
+
const { pairsKey: u, defaultKey: s, isArray: b } = f, p = o[u][l];
|
|
318
326
|
if (!p)
|
|
319
327
|
return console.warn(`No data found for: ${u}.${l}`), c;
|
|
320
328
|
if (b) {
|
|
@@ -326,8 +334,8 @@ class N {
|
|
|
326
334
|
});
|
|
327
335
|
}
|
|
328
336
|
}
|
|
329
|
-
function Y(
|
|
330
|
-
return new N().migrate(
|
|
337
|
+
function Y(r) {
|
|
338
|
+
return new N().migrate(r);
|
|
331
339
|
}
|
|
332
340
|
export {
|
|
333
341
|
Y as migrateItemsBlock
|
package/dist/enums/onboarding.js
CHANGED
|
@@ -2,9 +2,8 @@ const e = [
|
|
|
2
2
|
".service-element.stacked-panel-item.ng-tns-c1014751574-3.level-bottom-0.ng-star-inserted",
|
|
3
3
|
".service-element.stacked-panel-item.ng-tns-c1014751574-3.level-bottom-1.ng-star-inserted",
|
|
4
4
|
".service-element.stacked-panel-item.ng-tns-c1014751574-3.level-bottom-2.ng-star-inserted"
|
|
5
|
-
], t = "ui-editor", n = 'button[role="tab"][aria-label="Card Composition"]', s = 'button[role="tab"][aria-label="Settings"]', o = ".in-ribbons-wrapper"
|
|
5
|
+
], t = "ui-editor", n = 'button[role="tab"][aria-label="Card Composition"]', s = 'button[role="tab"][aria-label="Settings"]', o = ".in-ribbons-wrapper";
|
|
6
6
|
export {
|
|
7
|
-
a as ACADEMY_LINK,
|
|
8
7
|
n as CARD_COMPOSITION_TAB_SELECTOR,
|
|
9
8
|
o as RIBBON_SELECTOR,
|
|
10
9
|
e as SERVICE_HOVER_SELECTORS,
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { useTranslations as
|
|
1
|
+
import { useTranslations as e } from "../composables/useTranslations.js";
|
|
2
2
|
import { getEnvironmentPrefix as R } from "../utils/environmentUtil.js";
|
|
3
|
-
const
|
|
3
|
+
const I = {
|
|
4
4
|
UNSUBSCRIBE_LINK_TYPE: 1,
|
|
5
5
|
PREFERENCES_LINK_TYPE: 3
|
|
6
|
-
},
|
|
6
|
+
}, r = {
|
|
7
7
|
UNSUBSCRIBE_LINK_REGEX: /{{ins-unsubscribe-link}}/g,
|
|
8
8
|
DATA_OGSB_BUTTON_CSS_REGEX: "\\[data-ogsb\\]\\s*\\.es-button\\.es-button-[0-9]+\\s*\\{(?:[^\\}]*)\\}",
|
|
9
9
|
GLOBAL_UNSUBSCRIBE_LINK_REGEX: /{{ins-global-unsubscribe-link}}/g,
|
|
10
10
|
PREFERENCES_UNSUBSCRIBE_LINK_REGEX: /{{ins-preferences-unsubscribe-link}}/g
|
|
11
|
-
}, s = R(),
|
|
11
|
+
}, s = R(), _ = {
|
|
12
12
|
UNSUBSCRIBE_URL: `https://mail.${s}.com/user/v1/unsub`,
|
|
13
13
|
PREFERENCES_URL: `https://mail.${s}.com/user/v1/prefs`
|
|
14
|
-
},
|
|
14
|
+
}, i = "iid", B = {
|
|
15
15
|
name: "Global Unsubscribe",
|
|
16
16
|
sendGridId: "G"
|
|
17
|
-
},
|
|
17
|
+
}, C = "/email/unsubscribe-pages", E = {
|
|
18
18
|
GLOBAL_UNSUBSCRIBE: 1,
|
|
19
19
|
GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE: 2,
|
|
20
20
|
SUBSCRIPTION_PREFERENCE_CENTER: 3,
|
|
21
21
|
SUBSCRIPTION_PREFERENCE_CONFIRMATION: 4,
|
|
22
22
|
RESUBSCRIBE: 5
|
|
23
|
-
},
|
|
23
|
+
}, t = {
|
|
24
24
|
[E.GLOBAL_UNSUBSCRIBE]: [
|
|
25
25
|
E.GLOBAL_UNSUBSCRIBE,
|
|
26
26
|
E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE,
|
|
@@ -31,29 +31,28 @@ const N = {
|
|
|
31
31
|
E.SUBSCRIPTION_PREFERENCE_CONFIRMATION
|
|
32
32
|
]
|
|
33
33
|
}, U = () => {
|
|
34
|
-
const
|
|
34
|
+
const n = e();
|
|
35
35
|
return {
|
|
36
|
-
[E.GLOBAL_UNSUBSCRIBE]:
|
|
37
|
-
[E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE]:
|
|
38
|
-
[E.RESUBSCRIBE]:
|
|
39
|
-
[E.SUBSCRIPTION_PREFERENCE_CENTER]:
|
|
40
|
-
[E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]:
|
|
36
|
+
[E.GLOBAL_UNSUBSCRIBE]: n("unsubscription-preference.type-global-unsubscribe"),
|
|
37
|
+
[E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE]: n("unsubscription-preference.type-global-unsubscription-confirmation"),
|
|
38
|
+
[E.RESUBSCRIBE]: n("unsubscription-preference.type-resubscribe"),
|
|
39
|
+
[E.SUBSCRIPTION_PREFERENCE_CENTER]: n("unsubscription-preference.type-subscription-preferences-center"),
|
|
40
|
+
[E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]: n("unsubscription-preference.type-subscription-preferences-confirmation")
|
|
41
41
|
};
|
|
42
|
-
},
|
|
42
|
+
}, c = {
|
|
43
43
|
default: "{{ins-unsubscribe-link}}",
|
|
44
44
|
[E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
|
|
45
45
|
[E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
|
|
46
46
|
};
|
|
47
47
|
export {
|
|
48
|
-
t as ACADEMY_LINK,
|
|
49
48
|
B as DEFAULT_UNSUBSCRIBE_GROUP,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
i as INSIDER_ID,
|
|
50
|
+
r as LINK_REGEXES,
|
|
51
|
+
I as LINK_TYPES,
|
|
52
|
+
c as MERGE_TAGS,
|
|
54
53
|
E as PAGE_TYPES,
|
|
55
|
-
|
|
54
|
+
t as TYPE_COLLECTIONS,
|
|
56
55
|
C as UNSUBSCRIBE_PAGES_LINK,
|
|
57
|
-
|
|
56
|
+
_ as URLS,
|
|
58
57
|
U as getTypeTranslations
|
|
59
58
|
};
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { useOnboardingStore as
|
|
2
|
-
import { Block as u, BlockCompositionType as
|
|
1
|
+
import { useOnboardingStore as d } from "../../../stores/onboarding.js";
|
|
2
|
+
import { Block as u, BlockCompositionType as p, ModificationDescription as n } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
3
|
+
import { ItemsBlockId as f } from "./enums/controlEnums.js";
|
|
3
4
|
import { SETTINGS_ENUMS as c, DefaultConfigValues as o } from "./enums/settingsEnums.js";
|
|
4
|
-
import { useItemsBlockStore as
|
|
5
|
-
import { getDefaultTemplate as
|
|
6
|
-
import { getItemsBlockContainer as
|
|
7
|
-
const
|
|
8
|
-
class
|
|
5
|
+
import { useItemsBlockStore as g } from "./store/items-block.js";
|
|
6
|
+
import { getDefaultTemplate as y } from "./template.js";
|
|
7
|
+
import { getItemsBlockContainer as C, getItemsBlockConfig as a, getDefaultItemsBlockConfig as I } from "./utils/nodeConfigUtils.js";
|
|
8
|
+
const b = "items-block";
|
|
9
|
+
class O extends u {
|
|
9
10
|
getId() {
|
|
10
|
-
return
|
|
11
|
+
return b;
|
|
11
12
|
}
|
|
12
13
|
getIcon() {
|
|
13
14
|
return "items-icon";
|
|
14
15
|
}
|
|
15
16
|
getBlockCompositionType() {
|
|
16
|
-
return
|
|
17
|
+
return p.CONTAINER;
|
|
17
18
|
}
|
|
18
19
|
getName() {
|
|
19
20
|
return this.api.translate("Items");
|
|
@@ -22,7 +23,7 @@ class B extends u {
|
|
|
22
23
|
return this.api.translate("Items lets you display personalized products based on user behavior.");
|
|
23
24
|
}
|
|
24
25
|
getTemplate() {
|
|
25
|
-
return
|
|
26
|
+
return y({
|
|
26
27
|
orientation: c.ORIENTATION.VERTICAL,
|
|
27
28
|
itemsType: c.ITEMS_TYPE.CART_ITEMS,
|
|
28
29
|
itemId: "{{Abandoned Cart Item (1) Url}}",
|
|
@@ -34,20 +35,22 @@ class B extends u {
|
|
|
34
35
|
allowInnerBlocksDND() {
|
|
35
36
|
return !1;
|
|
36
37
|
}
|
|
37
|
-
onCreated(
|
|
38
|
-
const e =
|
|
38
|
+
onCreated(i) {
|
|
39
|
+
const e = C(i);
|
|
39
40
|
if (!e)
|
|
40
41
|
return;
|
|
41
|
-
const t = e.getNodeConfig(), l = t && Object.keys(t).length > 0, r = a(
|
|
42
|
+
const t = e.getNodeConfig(), l = t && Object.keys(t).length > 0, r = a(i);
|
|
42
43
|
if (r != null && r.initialized)
|
|
43
|
-
l ? r.blockInstanceId || this.api.getDocumentModifier().modifyHtml(e).setNodeConfig({ ...r, blockInstanceId: String(Date.now()) }).apply(new
|
|
44
|
+
l ? r.blockInstanceId || this.api.getDocumentModifier().modifyHtml(e).setNodeConfig({ ...r, blockInstanceId: String(Date.now()) }).apply(new n("Assign block instance ID to block")) : this.api.getDocumentModifier().modifyHtml(e).setNodeConfig(r).apply(new n("Migrate legacy config to nodeConfig"));
|
|
44
45
|
else {
|
|
45
|
-
const
|
|
46
|
-
this.api.getDocumentModifier().modifyHtml(e).setNodeConfig(
|
|
46
|
+
const m = I();
|
|
47
|
+
this.api.getDocumentModifier().modifyHtml(e).setNodeConfig(m).apply(new n("Initialize Items block with default configuration")), d().startOnboarding("itemsOnboarding");
|
|
47
48
|
}
|
|
49
|
+
const s = `[esd-extension-block-id="${f.IMAGE}"] img`;
|
|
50
|
+
this.api.getDocumentModifier().modifyHtml(i.querySelector(s)).setStyle("object-fit", "contain").apply(new n("Updated image object-fit"));
|
|
48
51
|
}
|
|
49
|
-
onSelect(
|
|
50
|
-
const e =
|
|
52
|
+
onSelect(i) {
|
|
53
|
+
const e = g(), t = a(i);
|
|
51
54
|
t && (e.setItemsType(t.type || o.itemsType), e.setItemIds(t.itemsSelectValue || o.cartItemsSelectControlValue), e.setOrientation(t.orientation || o.cardOrientationControlValue), e.setCurrencySymbol(
|
|
52
55
|
t.priceCurrencySymbol || o.productPriceCurrencySymbolControlValue
|
|
53
56
|
), e.setCurrencyLocation(
|
|
@@ -58,6 +61,6 @@ class B extends u {
|
|
|
58
61
|
}
|
|
59
62
|
}
|
|
60
63
|
export {
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
b as BLOCK_ID,
|
|
65
|
+
O as ItemsBlock
|
|
63
66
|
};
|
|
@@ -1,76 +1,82 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { ModificationDescription as
|
|
1
|
+
var C = Object.defineProperty;
|
|
2
|
+
var A = (n, r, e) => r in n ? C(n, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[r] = e;
|
|
3
|
+
var _ = (n, r, e) => A(n, typeof r != "symbol" ? r + "" : r, e);
|
|
4
|
+
import { ModificationDescription as L, UIElementType as m, UEAttr as g } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
5
|
import { CommonControl as h } from "../../../common-control.js";
|
|
6
|
-
import { ItemsBlockControlId as
|
|
7
|
-
import { productPairs as
|
|
8
|
-
import { useItemsBlockStore as
|
|
9
|
-
import { getItemsBlockConfig as
|
|
10
|
-
const
|
|
6
|
+
import { ItemsBlockControlId as l, ItemsBlockId as D } from "../../enums/controlEnums.js";
|
|
7
|
+
import { productPairs as I } from "../../enums/productEnums.js";
|
|
8
|
+
import { useItemsBlockStore as O } from "../../store/items-block.js";
|
|
9
|
+
import { getItemsBlockConfig as u, setItemsBlockConfig as f } from "../../utils/nodeConfigUtils.js";
|
|
10
|
+
const N = l.PRICE_FORMATTED_PRICE, c = {
|
|
11
11
|
FORMATTED_PRICE: "formattedPrice"
|
|
12
12
|
};
|
|
13
|
-
class
|
|
13
|
+
class y extends h {
|
|
14
14
|
constructor() {
|
|
15
15
|
super(...arguments);
|
|
16
|
-
|
|
16
|
+
_(this, "store", O());
|
|
17
17
|
}
|
|
18
18
|
getId() {
|
|
19
|
-
return
|
|
19
|
+
return N;
|
|
20
20
|
}
|
|
21
21
|
getTemplate() {
|
|
22
22
|
return `
|
|
23
|
-
<div class="container ${
|
|
23
|
+
<div class="container ${l.PRICE_FORMATTED_PRICE}">
|
|
24
24
|
${this._getFormattedPrice()}
|
|
25
25
|
</div>
|
|
26
26
|
`;
|
|
27
27
|
}
|
|
28
28
|
onRender() {
|
|
29
|
-
this.api.updateValues({ [
|
|
29
|
+
this.api.updateValues({ [c.FORMATTED_PRICE]: this.store.formattedPrice }), this.api.onValueChanged(c.FORMATTED_PRICE, (e) => {
|
|
30
30
|
this._onFormattedPriceChange(e);
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
onTemplateNodeUpdated(e) {
|
|
34
34
|
super.onTemplateNodeUpdated(e), this.handleBlockInstanceChange(
|
|
35
35
|
() => {
|
|
36
|
-
const
|
|
37
|
-
|
|
36
|
+
const o = u(this.currentNode);
|
|
37
|
+
o && this.store.setFormattedPrice(o.priceFormatted ?? !0);
|
|
38
38
|
},
|
|
39
39
|
() => {
|
|
40
|
-
this.api.updateValues({ [
|
|
40
|
+
this.api.updateValues({ [c.FORMATTED_PRICE]: this.store.formattedPrice });
|
|
41
41
|
}
|
|
42
42
|
);
|
|
43
43
|
}
|
|
44
44
|
_onFormattedPriceChange(e) {
|
|
45
|
-
if (console.debug("Formatted price changed to: ", e), this.store.setFormattedPrice(e),
|
|
45
|
+
if (console.debug("Formatted price changed to: ", e), this.store.setFormattedPrice(e), f(this.currentNode, this.api, { priceFormatted: e }), !this.currentNode)
|
|
46
46
|
return;
|
|
47
|
-
const { itemsType:
|
|
47
|
+
const { itemsType: o, singlePrice: i } = this.store, t = I.PAIRS_FOR_EXTENSION.price[o], s = I.PAIRS_FOR_EXTENSION.originalPrice[o], [E, R] = e ? [
|
|
48
|
+
i ? t.DEFAULT_SINGLE_PRICE : t.DEFAULT_PRICE,
|
|
49
|
+
i ? t.DEFAULT_SINGLE_PRICE_FORMATTED : t.DEFAULT_PRICE_FORMATTED
|
|
50
|
+
] : [
|
|
51
|
+
i ? t.DEFAULT_SINGLE_PRICE_FORMATTED : t.DEFAULT_PRICE_FORMATTED,
|
|
52
|
+
i ? t.DEFAULT_SINGLE_PRICE : t.DEFAULT_PRICE
|
|
53
|
+
], d = i ? s.DEFAULT_SINGLE_PRICE : s.DEFAULT_PRICE, P = i ? s.DEFAULT_SINGLE_PRICE_FORMATTED : s.DEFAULT_PRICE_FORMATTED, [p, F] = e ? [d, P] : [P, d];
|
|
48
54
|
this._updatePriceBlock(
|
|
49
55
|
this.currentNode,
|
|
50
|
-
|
|
51
|
-
|
|
56
|
+
E,
|
|
57
|
+
R,
|
|
52
58
|
"price"
|
|
53
59
|
);
|
|
54
|
-
const
|
|
55
|
-
|
|
60
|
+
const a = this.currentNode.closest(".items-block"), T = a == null ? void 0 : a.querySelector(`[esd-extension-block-id="${D.ORIGINAL_PRICE}"]`);
|
|
61
|
+
T && this._updatePriceBlock(T, p, F, "original price");
|
|
56
62
|
}
|
|
57
|
-
_updatePriceBlock(e,
|
|
58
|
-
const
|
|
59
|
-
this.api.getDocumentModifier().modifyHtml(e).setInnerHtml(
|
|
63
|
+
_updatePriceBlock(e, o, i, t) {
|
|
64
|
+
const s = e.getInnerHTML().replace(o, i), E = `Updated ${t} to ${this.store.formattedPrice ? "formatted" : "unformatted"}`;
|
|
65
|
+
this.api.getDocumentModifier().modifyHtml(e).setInnerHtml(s).apply(new L(E));
|
|
60
66
|
}
|
|
61
67
|
_getFormattedPrice() {
|
|
62
68
|
return `
|
|
63
69
|
<div class="display-flex align-items-center justify-content-between">
|
|
64
|
-
<${
|
|
65
|
-
${
|
|
70
|
+
<${m.LABEL}
|
|
71
|
+
${g.LABEL.text}="${this.api.translate("Formatted Price (e.g. $9.90)")}"
|
|
66
72
|
>
|
|
67
|
-
</${
|
|
68
|
-
${this._GuToggle(
|
|
73
|
+
</${m.LABEL}>
|
|
74
|
+
${this._GuToggle(c.FORMATTED_PRICE)}
|
|
69
75
|
</div>
|
|
70
76
|
`;
|
|
71
77
|
}
|
|
72
78
|
}
|
|
73
79
|
export {
|
|
74
|
-
|
|
75
|
-
|
|
80
|
+
N as CONTROL_BLOCK_ID,
|
|
81
|
+
y as PriceFormattedPriceControl
|
|
76
82
|
};
|