@useinsider/guido 3.7.1-beta.4622f87 → 3.7.1-beta.748af43
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/unsubscribe/UnsubscribePageSelection.vue.js +2 -2
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +24 -22
- package/dist/composables/useHtmlValidator.js +79 -73
- package/dist/enums/html-validator.js +13 -5
- package/dist/enums/toaster.js +1 -1
- package/dist/extensions/Blocks/Items/block.js +48 -29
- package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +62 -45
- package/dist/extensions/Blocks/Recommendation/block.js +35 -16
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +35 -30
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +62 -50
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +208 -193
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +18 -17
- package/dist/extensions/Blocks/Recommendation/useRecommendationBlockWarning.js +16 -0
- package/dist/extensions/Blocks/Recommendation/utils/recommendationBlockCount.js +9 -0
- package/dist/extensions/Blocks/Unsubscribe/block.js +122 -72
- package/dist/extensions/Blocks/Unsubscribe/control.js +33 -26
- package/dist/extensions/Blocks/Unsubscribe/template.js +4 -4
- package/dist/guido.css +1 -1
- package/dist/src/enums/html-validator.d.ts +4 -0
- package/dist/src/enums/toaster.d.ts +2 -1
- package/dist/src/extensions/Blocks/Items/block.d.ts +8 -0
- package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +13 -0
- package/dist/src/extensions/Blocks/Recommendation/block.test.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/useRecommendationBlockWarning.d.ts +12 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/recommendationBlockCount.d.ts +28 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/recommendationBlockCount.test.d.ts +1 -0
- package/dist/src/extensions/Blocks/Unsubscribe/block.d.ts +9 -0
- package/dist/src/extensions/Blocks/Unsubscribe/control.d.ts +1 -0
- package/dist/static/styles/components/base-input.css.js +5 -0
- package/dist/stores/autosave.js +6 -6
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import a from "./UnsubscribePageSelection.vue2.js";
|
|
|
3
3
|
import n from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
4
|
var o = function() {
|
|
5
5
|
var r = this, e = r._self._c, t = r._self._setupProxy;
|
|
6
|
-
return e(t.WpDrawer, { attrs: { id: "unsubscribe-modal", "description-status": "", size: "large", "footer-button-group-options": t.footerButtonGroupOptions, status: t.unsubscribeStore.pageSelectionDrawerStatus, "title-text": t.trans("newsletter.select-a-template") }, on: { cancelOrBackButtonEvent: t.handleBack, onCloseEvent: t.
|
|
6
|
+
return e(t.WpDrawer, { attrs: { id: "unsubscribe-modal", "description-status": "", size: "large", "footer-button-group-options": t.footerButtonGroupOptions, status: t.unsubscribeStore.pageSelectionDrawerStatus, "title-text": t.trans("newsletter.select-a-template") }, on: { cancelOrBackButtonEvent: t.handleBack, onCloseEvent: t.handleClose, primaryButtonEvent: t.handleSave }, scopedSlots: r._u([{ key: "headerBottomSlot", fn: function() {
|
|
7
7
|
return [e(t.UnsubscribeBreadcrumb, { staticClass: "px-5 py-3" })];
|
|
8
8
|
}, proxy: !0 }]) }, [e("div", { staticClass: "d-g templates-wrapper" }, r._l(t.unsubscribeStore.getTemplatesByActiveType, function(s) {
|
|
9
9
|
return e("div", { key: s.id, staticClass: "template-wrapper", on: { click: function(u) {
|
|
@@ -16,7 +16,7 @@ var o = function() {
|
|
|
16
16
|
i,
|
|
17
17
|
!1,
|
|
18
18
|
null,
|
|
19
|
-
"
|
|
19
|
+
"f6a8cb4c"
|
|
20
20
|
);
|
|
21
21
|
const _ = c.exports;
|
|
22
22
|
export {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useToaster as
|
|
1
|
+
import { defineComponent as y, ref as S, computed as a, watch as T } from "vue";
|
|
2
|
+
import v from "../../wrappers/WpDrawer.vue.js";
|
|
3
|
+
import { useToaster as C } from "../../../composables/useToaster.js";
|
|
4
4
|
import { useTranslations as B } from "../../../composables/useTranslations.js";
|
|
5
|
-
import { ToasterTypeOptions as
|
|
6
|
-
import { useUnsubscribeStore as
|
|
7
|
-
import { InContainer as
|
|
8
|
-
import
|
|
9
|
-
const
|
|
5
|
+
import { ToasterTypeOptions as w } from "../../../enums/toaster.js";
|
|
6
|
+
import { useUnsubscribeStore as h } from "../../../stores/unsubscribe.js";
|
|
7
|
+
import { InContainer as U } from "@useinsider/design-system-vue";
|
|
8
|
+
import P from "./UnsubscribeBreadcrumb.vue.js";
|
|
9
|
+
const L = /* @__PURE__ */ y({
|
|
10
10
|
__name: "UnsubscribePageSelection",
|
|
11
|
-
setup(
|
|
12
|
-
const s = B(), e =
|
|
11
|
+
setup(_) {
|
|
12
|
+
const s = B(), e = h(), { showToaster: r } = C(), o = S(!1), c = a(() => e.isActiveTypeLastInCollection ? o.value ? s("unsubscription-preference.applying-changes") : s("statistics.apply") : s("products.select-and-continue")), i = a(() => e.pageSelectionUpdateStatus && e.isActiveTypeFirstInCollection ? s("products.cancel") : s("newsletter.back")), u = a(() => ({
|
|
13
13
|
primaryButton: {
|
|
14
14
|
styling: "solid",
|
|
15
15
|
type: "primary",
|
|
@@ -23,42 +23,44 @@ const F = /* @__PURE__ */ g({
|
|
|
23
23
|
labelText: i.value,
|
|
24
24
|
disabledStatus: o.value
|
|
25
25
|
}
|
|
26
|
-
})), p = (t) => e.getSelectedTemplateByActiveType === t ? "bor-w-3 bor-s-s bor-c-7" : "bor-w-1 bor-s-s bor-c-6",
|
|
26
|
+
})), p = (t) => e.getSelectedTemplateByActiveType === t ? "bor-w-3 bor-s-s bor-c-7" : "bor-w-1 bor-s-s bor-c-6", n = (t) => {
|
|
27
27
|
e.pageSelectionDrawerStatus = !1, t && setTimeout(() => {
|
|
28
28
|
t();
|
|
29
29
|
}, 500);
|
|
30
30
|
}, d = () => {
|
|
31
|
+
n(), e.pageSelectionUpdateStatus || document.dispatchEvent(new CustomEvent("unsubscribe:cancel"));
|
|
32
|
+
}, m = () => {
|
|
31
33
|
if (e.isActiveTypeFirstInCollection) {
|
|
32
|
-
|
|
34
|
+
n(), e.pageSelectionUpdateStatus || (e.typeSelectionDrawerStatus = !0);
|
|
33
35
|
return;
|
|
34
36
|
}
|
|
35
37
|
e.setPreviousType();
|
|
36
|
-
},
|
|
38
|
+
}, b = () => {
|
|
37
39
|
if (e.isActiveTypeLastInCollection) {
|
|
38
40
|
o.value = !0;
|
|
39
|
-
const t = e.selectedCollectionType, l = e.getSelectedTemplatesByCollection(t),
|
|
40
|
-
e.removeUnsubscribePages(
|
|
41
|
+
const t = e.selectedCollectionType, l = e.getSelectedTemplatesByCollection(t), g = e.getSelectedUnsubscribePagesByCollection(t);
|
|
42
|
+
e.removeUnsubscribePages(g), e.addUnsubscribePages(l), document.dispatchEvent(new CustomEvent("unsubscribe:select", {
|
|
41
43
|
detail: {
|
|
42
44
|
collectionType: t,
|
|
43
45
|
selectedPages: l
|
|
44
46
|
}
|
|
45
|
-
})),
|
|
46
|
-
o.value = !1,
|
|
47
|
-
type:
|
|
47
|
+
})), n(() => {
|
|
48
|
+
o.value = !1, r({
|
|
49
|
+
type: w.Success,
|
|
48
50
|
message: s("global-unsubscribe.pages-were-attached")
|
|
49
51
|
});
|
|
50
52
|
});
|
|
51
53
|
return;
|
|
52
54
|
}
|
|
53
55
|
e.setNextType();
|
|
54
|
-
},
|
|
56
|
+
}, f = (t) => {
|
|
55
57
|
e.setSelectedTemplate(t);
|
|
56
58
|
};
|
|
57
|
-
return
|
|
59
|
+
return T(() => e.pageSelectionDrawerStatus, (t) => {
|
|
58
60
|
t && e.pageSelectionUpdateStatus && e.fetchTemplates();
|
|
59
|
-
}), { __sfc: !0, trans: s, unsubscribeStore: e, showToaster:
|
|
61
|
+
}), { __sfc: !0, trans: s, unsubscribeStore: e, showToaster: r, isApplying: o, getPrimaryButtonText: c, getCancelOrBackButtonText: i, footerButtonGroupOptions: u, getBorderClass: p, closeModal: n, handleClose: d, handleBack: m, handleSave: b, selectTemplate: f, WpDrawer: v, InContainer: U, UnsubscribeBreadcrumb: P };
|
|
60
62
|
}
|
|
61
63
|
});
|
|
62
64
|
export {
|
|
63
|
-
|
|
65
|
+
L as default
|
|
64
66
|
};
|
|
@@ -1,86 +1,92 @@
|
|
|
1
|
-
import { useConfig as
|
|
2
|
-
import { TemplateTypes as
|
|
3
|
-
import { DISPLAY_CONDITIONS_REGEX as
|
|
1
|
+
import { useConfig as V } from "./useConfig.js";
|
|
2
|
+
import { TemplateTypes as G } from "../enums/defaults.js";
|
|
3
|
+
import { DISPLAY_CONDITIONS_REGEX as H, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as M, CampaignCouldNotBeSavedKey as X, CanNotMakeAnyChangesForRunningKey as P, DATA_ATTRIBUTE_REGEX as Y, DYNAMIC_CONTENT_TAG_REGEX as $, ALLOWED_DYNAMIC_SYSTEM_TOKENS as q, VALID_DYNAMIC_VARIABLE_REGEX as K } from "../enums/html-validator.js";
|
|
4
4
|
import { ToasterTypeOptions as c } from "../enums/toaster.js";
|
|
5
|
-
import { itemsBlockDynamicVariables as
|
|
6
|
-
import { useRecommendationExtensionStore as
|
|
7
|
-
import { RecommendationRequiredFieldsKey as
|
|
8
|
-
import { useRecommendationStore as
|
|
9
|
-
import { base64EncodeWithSpecialChars as
|
|
10
|
-
import { useHttp as
|
|
11
|
-
import { useToaster as
|
|
12
|
-
import { useTranslations as
|
|
13
|
-
const
|
|
14
|
-
function
|
|
15
|
-
return [...
|
|
5
|
+
import { itemsBlockDynamicVariables as j } from "../extensions/Blocks/Items/enums/productEnums.js";
|
|
6
|
+
import { useRecommendationExtensionStore as U } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
7
|
+
import { RecommendationRequiredFieldsKey as z } from "../extensions/Blocks/Recommendation/validation/requiredFields.js";
|
|
8
|
+
import { useRecommendationStore as Z } from "../stores/recommendation.js";
|
|
9
|
+
import { base64EncodeWithSpecialChars as J } from "../utils/base64.js";
|
|
10
|
+
import { useHttp as Q } from "./useHttp.js";
|
|
11
|
+
import { useToaster as ee } from "./useToaster.js";
|
|
12
|
+
import { useTranslations as te } from "./useTranslations.js";
|
|
13
|
+
const se = /recommendation-id="(\d+)"/g;
|
|
14
|
+
function ne(i) {
|
|
15
|
+
return [...i.matchAll(se)].map((d) => d[1]);
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
return
|
|
17
|
+
function ie(i, d) {
|
|
18
|
+
return d.some((g) => i.startsWith(`${g}_`));
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
function oe(i) {
|
|
21
|
+
return (i.replace(Y, "$1").match($) ?? []).filter((r) => {
|
|
22
|
+
const u = r.slice(2, -2), f = u.indexOf("|"), p = (f === -1 ? u : u.slice(0, f)).trim();
|
|
23
|
+
return q.includes(p) ? !1 : K.test(p) ? f !== -1 && u.slice(f + 1).trim() === "" : !0;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
const Ce = () => {
|
|
27
|
+
var h, v;
|
|
28
|
+
const { showToaster: i } = ee(), { post: d } = Q(), { config: g } = V(), r = te(), u = Z(), f = U(), p = ((v = (h = g.value) == null ? void 0 : h.partner) == null ? void 0 : v.messageType) === G.transactional, A = async (e) => {
|
|
29
|
+
const t = await d(
|
|
24
30
|
"/newsletter/template-library/check-template-html-body",
|
|
25
|
-
{ html:
|
|
31
|
+
{ html: J(e) }
|
|
26
32
|
), { status: n, message: l } = t.data;
|
|
27
|
-
return n ||
|
|
33
|
+
return n || i({
|
|
28
34
|
type: c.Alert,
|
|
29
35
|
message: n === void 0 ? l : r("newsletter.invalid-url-link-for-toaster")
|
|
30
|
-
}), r(
|
|
36
|
+
}), r(X), l === r(P) && i({
|
|
31
37
|
type: c.Alert,
|
|
32
38
|
message: r("newsletter.already-in-progress")
|
|
33
39
|
}), n;
|
|
34
|
-
},
|
|
40
|
+
}, S = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), b = (e) => ["if", "endif"].includes(e.toLowerCase()), I = (e, s) => {
|
|
35
41
|
const t = e.match(/({%(.*?)%})/g);
|
|
36
42
|
let n = !0;
|
|
37
43
|
return t !== null && !p && t.forEach((l) => {
|
|
38
44
|
const o = l.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
|
|
39
45
|
if (o && o.length > 0) {
|
|
40
|
-
const [
|
|
41
|
-
|
|
46
|
+
const [a] = o;
|
|
47
|
+
S(a) && !s.includes(a) && (i({
|
|
42
48
|
type: c.Warning,
|
|
43
49
|
message: r("custom-fields.invalid-custom-fields")
|
|
44
50
|
}), n = !1);
|
|
45
51
|
}
|
|
46
52
|
}), n;
|
|
47
|
-
},
|
|
48
|
-
const n = t ? await
|
|
49
|
-
return
|
|
50
|
-
},
|
|
53
|
+
}, T = async (e, s, t) => {
|
|
54
|
+
const n = t ? await A(e) : !0;
|
|
55
|
+
return I(e, s) && n;
|
|
56
|
+
}, w = (e) => e.length > 0 ? !0 : (i({
|
|
51
57
|
type: c.Warning,
|
|
52
58
|
message: r("newsletter.html-content-is-empty")
|
|
53
|
-
}), !1),
|
|
59
|
+
}), !1), x = (e) => {
|
|
54
60
|
const s = (e.match(/{/gm) || []).length, t = (e.match(/}/gm) || []).length;
|
|
55
|
-
return s > t &&
|
|
61
|
+
return s > t && i({
|
|
56
62
|
type: c.Warning,
|
|
57
63
|
message: r("custom-fields.missing-closing-braces")
|
|
58
|
-
}), s < t &&
|
|
64
|
+
}), s < t && i({
|
|
59
65
|
type: c.Warning,
|
|
60
66
|
message: r("custom-fields.missing-opening-braces")
|
|
61
67
|
}), s === t;
|
|
62
|
-
},
|
|
63
|
-
const s = e.
|
|
64
|
-
return s ||
|
|
68
|
+
}, _ = (e) => {
|
|
69
|
+
const s = oe(e).length === 0;
|
|
70
|
+
return s || i({
|
|
65
71
|
type: c.Warning,
|
|
66
72
|
message: r("custom-fields.invalid-custom-fields")
|
|
67
73
|
}), s;
|
|
68
|
-
},
|
|
74
|
+
}, k = (e, s) => {
|
|
69
75
|
const t = e.match(/{{([a-zA-Z0-9_\s]*)}}/gm);
|
|
70
76
|
if (t && !p) {
|
|
71
|
-
const n = new Set(s.map((
|
|
72
|
-
if (t.forEach((
|
|
73
|
-
const m =
|
|
74
|
-
(!n.has(m) || m === "") && !
|
|
77
|
+
const n = new Set(s.map((a) => a.toLowerCase())), l = ne(e), o = [];
|
|
78
|
+
if (t.forEach((a) => {
|
|
79
|
+
const m = a.slice(2, -2).trim().toLowerCase();
|
|
80
|
+
(!n.has(m) || m === "") && !ie(m, l) && o.push(m);
|
|
75
81
|
}), o.length > 0) {
|
|
76
|
-
const
|
|
82
|
+
const a = `
|
|
77
83
|
<ul>
|
|
78
84
|
${o.map((m) => `<li>${m}</li>`).join("")}
|
|
79
85
|
</ul>
|
|
80
86
|
`;
|
|
81
|
-
return
|
|
87
|
+
return i({
|
|
82
88
|
type: c.Alert,
|
|
83
|
-
message: r("custom-fields.invalid-custom-fields") +
|
|
89
|
+
message: r("custom-fields.invalid-custom-fields") + a
|
|
84
90
|
}), !1;
|
|
85
91
|
}
|
|
86
92
|
}
|
|
@@ -89,78 +95,78 @@ const ge = () => {
|
|
|
89
95
|
const s = e.match(/{%(.*?)%}/g), t = [];
|
|
90
96
|
let n = !0;
|
|
91
97
|
if (s && s.forEach((l) => {
|
|
92
|
-
const o = l.match(
|
|
93
|
-
(!o || l !== m) && !
|
|
98
|
+
const o = l.match(H), a = l.match(M), m = (o == null ? void 0 : o.join("")) || "";
|
|
99
|
+
(!o || l !== m) && !a && (i({
|
|
94
100
|
type: c.Alert,
|
|
95
101
|
message: r("newsletter.display-conditions-invalid-syntax")
|
|
96
|
-
}), n = !1), o && o.forEach((
|
|
97
|
-
|
|
102
|
+
}), n = !1), o && o.forEach((y) => {
|
|
103
|
+
y.trim() === "=" && (i({
|
|
98
104
|
type: c.Alert,
|
|
99
105
|
message: r("custom-conditions.wrong-equality-operators")
|
|
100
106
|
}), n = !1);
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
E
|
|
107
|
+
const C = y.match(/^[a-zA-Z]*$/g);
|
|
108
|
+
C && C.forEach((E) => {
|
|
109
|
+
b(E) && t.push(E);
|
|
104
110
|
});
|
|
105
111
|
});
|
|
106
112
|
}), t.length) {
|
|
107
|
-
const l = t.filter((
|
|
108
|
-
l.length !== o.length && (
|
|
113
|
+
const l = t.filter((a) => a === "if"), o = t.filter((a) => a === "endif");
|
|
114
|
+
l.length !== o.length && (i({
|
|
109
115
|
type: c.Alert,
|
|
110
116
|
message: r("custom-conditions.missing-if-endif-tag")
|
|
111
117
|
}), n = !1);
|
|
112
118
|
}
|
|
113
119
|
return n;
|
|
114
|
-
},
|
|
120
|
+
}, N = (e) => {
|
|
115
121
|
const s = (e.match(/{% /gm) || []).length, t = (e.match(/ %}/gm) || []).length, n = s === t;
|
|
116
|
-
return n ||
|
|
122
|
+
return n || i({
|
|
117
123
|
type: c.Warning,
|
|
118
124
|
message: r("custom-conditions.no-space-after-braces")
|
|
119
125
|
}), n;
|
|
120
|
-
},
|
|
126
|
+
}, D = (e) => (e.match(/({%(.*?)%})/g) || []).filter((t) => t.includes("if")).map((t) => (t.match(/{{.*}}/gm) || []).length).reduce((t, n) => t + n, 0) > 0 ? (i({
|
|
121
127
|
type: c.Warning,
|
|
122
128
|
message: r("custom-conditions.no-braces-inside-if-tag")
|
|
123
|
-
}), !1) : !0,
|
|
129
|
+
}), !1) : !0, F = () => f.hasInvalidBlock() ? (i({
|
|
124
130
|
type: c.Alert,
|
|
125
|
-
message: r(
|
|
126
|
-
}), !1) : !0, O = () =>
|
|
131
|
+
message: r(z)
|
|
132
|
+
}), !1) : !0, O = () => u.recommendationConfigs && Object.values(u.recommendationConfigs).find((s) => s.filters.find((t) => t.value === "")) !== void 0 ? (i({
|
|
127
133
|
type: c.Alert,
|
|
128
134
|
message: r("newsletter.fill-all-necessary-fields")
|
|
129
|
-
}), !1) : !0,
|
|
135
|
+
}), !1) : !0, B = (e) => {
|
|
130
136
|
const s = /src="[^"]*\.(svg|pst)"/gm;
|
|
131
|
-
return e.match(s) === null ? !0 : (
|
|
137
|
+
return e.match(s) === null ? !0 : (i({
|
|
132
138
|
type: c.Alert,
|
|
133
139
|
message: r("newsletter.invalid-image-type")
|
|
134
140
|
}), !1);
|
|
135
141
|
}, L = (e) => {
|
|
136
142
|
const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".checkbox-block-v2");
|
|
137
143
|
return Array.from(n).find((o) => {
|
|
138
|
-
var
|
|
139
|
-
return !((
|
|
140
|
-
}) ? (
|
|
144
|
+
var a;
|
|
145
|
+
return !((a = o.id) != null && a.trim());
|
|
146
|
+
}) ? (i({
|
|
141
147
|
type: c.Alert,
|
|
142
148
|
message: r("unsubscribe-templates.select-checkbox-groups")
|
|
143
149
|
}), !1) : !0;
|
|
144
|
-
},
|
|
150
|
+
}, W = (e) => {
|
|
145
151
|
const n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(".radio-button-v2");
|
|
146
152
|
return Array.from(n).find((o) => {
|
|
147
|
-
var
|
|
148
|
-
return !((
|
|
149
|
-
}) ? (
|
|
153
|
+
var a;
|
|
154
|
+
return !((a = o.id) != null && a.trim());
|
|
155
|
+
}) ? (i({
|
|
150
156
|
type: c.Alert,
|
|
151
157
|
message: r("unsubscribe-templates.select-radio-button-groups")
|
|
152
158
|
}), !1) : !0;
|
|
153
159
|
};
|
|
154
160
|
return { validateHtml: async (e, s, t = !1) => {
|
|
155
|
-
var o,
|
|
161
|
+
var o, a;
|
|
156
162
|
const n = [
|
|
157
163
|
...s.map((m) => m.value),
|
|
158
|
-
...
|
|
159
|
-
...((
|
|
164
|
+
...j,
|
|
165
|
+
...((a = (o = g.value) == null ? void 0 : o.template) == null ? void 0 : a.customFieldAttributes) ?? []
|
|
160
166
|
];
|
|
161
|
-
return await
|
|
167
|
+
return await T(e, n, t) && w(e) && x(e) && _(e) && k(e, n) && R(e) && N(e) && D(e) && F() && O() && B(e) && L(e) && W(e);
|
|
162
168
|
} };
|
|
163
169
|
};
|
|
164
170
|
export {
|
|
165
|
-
|
|
171
|
+
Ce as useHtmlValidator
|
|
166
172
|
};
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
const
|
|
1
|
+
const n = "newsletter.already-in-progress", e = "newsletter.campaign-could-not-be-saved", s = / (==|<=|>=|!=|>|<|in) | (if|elif|endif|else|and|or) |("[\S ]+")|('[\S ]+')|([^”\s\n]+)|(({%)|( %}))/gm, o = /{%( )*now( )(".*")( )*%}/gm, E = /\{\{[^{}]+\}\}/g, i = /(\s)data-[\w-]+=(?:"[^"]*"|'[^']*')/g, t = /^[A-Za-z0-9_.]+$/, _ = [
|
|
2
|
+
"ins-unsubscribe-link",
|
|
3
|
+
"ins-global-unsubscribe-link",
|
|
4
|
+
"ins-preferences-unsubscribe-link"
|
|
5
|
+
];
|
|
2
6
|
export {
|
|
3
|
-
|
|
4
|
-
e as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
_ as ALLOWED_DYNAMIC_SYSTEM_TOKENS,
|
|
8
|
+
e as CampaignCouldNotBeSavedKey,
|
|
9
|
+
n as CanNotMakeAnyChangesForRunningKey,
|
|
10
|
+
i as DATA_ATTRIBUTE_REGEX,
|
|
11
|
+
o as DISPLAY_CONDITIONS_EXCEPTIONS_REGEX,
|
|
12
|
+
s as DISPLAY_CONDITIONS_REGEX,
|
|
13
|
+
E as DYNAMIC_CONTENT_TAG_REGEX,
|
|
14
|
+
t as VALID_DYNAMIC_VARIABLE_REGEX
|
|
7
15
|
};
|
package/dist/enums/toaster.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var c = /* @__PURE__ */ ((r) => (r.Success = "success", r.Warning = "warning", r.Alert = "alert", r))(c || {});
|
|
1
|
+
var c = /* @__PURE__ */ ((r) => (r.Success = "success", r.Warning = "warning", r.Alert = "alert", r.Dark = "dark", r))(c || {});
|
|
2
2
|
export {
|
|
3
3
|
c as ToasterTypeOptions
|
|
4
4
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { BlockId as
|
|
1
|
+
import { BlockId as u } from "../../../enums/block.js";
|
|
2
2
|
import { useOnboardingStore as p } from "../../../stores/onboarding.js";
|
|
3
|
-
import { getMigrationBannerHtml as
|
|
4
|
-
import { Block as
|
|
5
|
-
import { SETTINGS_ENUMS as
|
|
6
|
-
import { getDefaultTemplate as
|
|
7
|
-
import { getItemsBlockContainer as
|
|
8
|
-
const
|
|
9
|
-
class E extends
|
|
3
|
+
import { getMigrationBannerHtml as C } from "../../../utils/migrationBannerHtml.js";
|
|
4
|
+
import { Block as I, BlockCompositionType as y, ModificationDescription as s } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
|
+
import { SETTINGS_ENUMS as c, DefaultConfigValues as a } from "./enums/settingsEnums.js";
|
|
6
|
+
import { getDefaultTemplate as h } from "./template.js";
|
|
7
|
+
import { getItemsBlockContainer as l, getItemsBlockConfig as m, getDefaultItemsBlockConfig as b } from "./utils/nodeConfigUtils.js";
|
|
8
|
+
const d = u.Items;
|
|
9
|
+
class E extends I {
|
|
10
10
|
getId() {
|
|
11
|
-
return
|
|
11
|
+
return d;
|
|
12
12
|
}
|
|
13
13
|
getIcon() {
|
|
14
14
|
return "items-icon";
|
|
15
15
|
}
|
|
16
16
|
getBlockCompositionType() {
|
|
17
|
-
return
|
|
17
|
+
return y.CONTAINER;
|
|
18
18
|
}
|
|
19
19
|
getName() {
|
|
20
20
|
return this.api.translate("Items");
|
|
@@ -23,41 +23,60 @@ class E extends u {
|
|
|
23
23
|
return this.api.translate("Items lets you display personalized products based on user behavior.");
|
|
24
24
|
}
|
|
25
25
|
getSettingsPanelTitleHtml() {
|
|
26
|
-
return
|
|
27
|
-
|
|
26
|
+
return C(
|
|
27
|
+
d,
|
|
28
28
|
this.api.translate("Items"),
|
|
29
29
|
this.api.translate("This block is switched from the Old Version to the New Version. We recommend you check the Items block and test your message to ensure it works properly.")
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
32
|
getTemplate() {
|
|
33
|
-
return
|
|
34
|
-
orientation:
|
|
35
|
-
itemsType:
|
|
33
|
+
return h({
|
|
34
|
+
orientation: c.ORIENTATION.VERTICAL,
|
|
35
|
+
itemsType: c.ITEMS_TYPE.CART_ITEMS,
|
|
36
36
|
itemId: "{{Abandoned Cart Item (1) Url}}",
|
|
37
|
-
currencySymbol:
|
|
38
|
-
currencyLocation:
|
|
39
|
-
formattedPrice:
|
|
37
|
+
currencySymbol: a.productPriceCurrencySymbolControlValue,
|
|
38
|
+
currencyLocation: a.productPriceCurrencyLocationControlValue,
|
|
39
|
+
formattedPrice: a.productPriceFormattedControlValue === "1"
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
allowInnerBlocksDND() {
|
|
43
43
|
return !1;
|
|
44
44
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
canBeSavedAsModule() {
|
|
46
|
+
return !0;
|
|
47
|
+
}
|
|
48
|
+
onCreated(i) {
|
|
49
|
+
const n = this.api.getDocumentModifier(), r = this.api.getDocumentRootCssNode();
|
|
50
|
+
r.querySelector('[product-attr="imageSrc"] img') || n.modifyCss(r).appendRule('[product-attr="imageSrc"] img {object-fit: contain;}');
|
|
51
|
+
const t = l(i);
|
|
52
|
+
if (!t)
|
|
50
53
|
return;
|
|
51
|
-
const
|
|
52
|
-
if (
|
|
53
|
-
|
|
54
|
+
const e = t.getNodeConfig(), g = e && Object.keys(e).length > 0, o = m(i);
|
|
55
|
+
if (o != null && o.initialized)
|
|
56
|
+
g ? o.blockInstanceId || this.api.getDocumentModifier().modifyHtml(t).setNodeConfig({ ...o, blockInstanceId: String(Date.now()) }).apply(new s("Assign block instance ID to block")) : this.api.getDocumentModifier().modifyHtml(t).setNodeConfig(o).apply(new s("Migrate legacy config to nodeConfig"));
|
|
54
57
|
else {
|
|
55
|
-
const
|
|
56
|
-
this.api.getDocumentModifier().modifyHtml(
|
|
58
|
+
const f = b();
|
|
59
|
+
this.api.getDocumentModifier().modifyHtml(t).setNodeConfig(f).apply(new s("Initialize Items block with default configuration")), p().startOnboarding("itemsOnboarding");
|
|
57
60
|
}
|
|
58
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Re-seeds nodeConfig from the persisted esd-ext-config when a saved module
|
|
64
|
+
* surfaces via document load. Stripo strips esd-ext-config and never restores it
|
|
65
|
+
* into nodeConfig, so without this a reused module would reset to defaults.
|
|
66
|
+
* Guarded to the nodeConfig-empty case so it runs once and never loops.
|
|
67
|
+
*/
|
|
68
|
+
onDocumentChanged(i) {
|
|
69
|
+
const n = l(i);
|
|
70
|
+
if (!n)
|
|
71
|
+
return;
|
|
72
|
+
const r = n.getNodeConfig();
|
|
73
|
+
if (r && Object.keys(r).length > 0)
|
|
74
|
+
return;
|
|
75
|
+
const e = m(i);
|
|
76
|
+
e != null && e.initialized && this.api.getDocumentModifier().modifyHtml(n).setNodeConfig(e).apply(new s("Recover Items block config from saved module"));
|
|
77
|
+
}
|
|
59
78
|
}
|
|
60
79
|
export {
|
|
61
|
-
|
|
80
|
+
d as BLOCK_ID,
|
|
62
81
|
E as ItemsBlock
|
|
63
82
|
};
|