@useinsider/guido 3.26.0-beta.8251afd → 3.26.0-beta.a188943
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/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +46 -45
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +5 -6
- package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +19 -18
- package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +5 -5
- package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +15 -15
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue.js +6 -6
- package/dist/components/organisms/onboarding/ItemsOnboarding.vue2.js +28 -27
- package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.js +3 -3
- package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue2.js +42 -27
- package/dist/composables/useCustomInterfaceAppearance.js +50 -50
- package/dist/composables/useFullStoryBridge.js +10 -9
- package/dist/composables/useSave.js +17 -19
- package/dist/composables/useSaveValidation.js +249 -142
- package/dist/composables/useTranslations.js +9 -14
- package/dist/enums/save-validation.js +1 -1
- package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +14 -14
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +52 -40
- package/dist/extensions/Blocks/Recommendation/controls/syncInfoMessage.js +15 -15
- package/dist/extensions/Blocks/Recommendation/utils/priceFormatter.js +17 -15
- package/dist/extensions/Blocks/common-control.js +25 -25
- package/dist/extensions/DynamicContent/dynamic-content.js +15 -17
- package/dist/guido.css +1 -1
- package/dist/node_modules/valibot/dist/index.js +122 -184
- package/dist/package.json.js +1 -1
- package/dist/src/composables/useSaveValidation.d.ts +2 -2
- package/dist/src/enums/save-validation.d.ts +14 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +2 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +1 -1
- package/dist/src/stores/onboarding.d.ts +1 -0
- package/dist/src/utils/editorShadowRoot.d.ts +1 -0
- package/dist/stores/onboarding.js +4 -1
- package/dist/utils/editorShadowRoot.js +8 -0
- package/package.json +11 -3
- package/dist/@types/email-be/html-validation.js +0 -24
- package/dist/enums/email-be.js +0 -27
- package/dist/services/emailBe/errors/ApiError.js +0 -50
- package/dist/services/emailBe/errors/handleApiError.js +0 -31
- package/dist/services/emailBe/errors/toApiError.js +0 -71
- package/dist/services/emailBe/html/HtmlValidationService.js +0 -35
- package/dist/services/emailBe/html/index.js +0 -6
- package/dist/services/emailBe/http/HttpManager.js +0 -68
- package/dist/services/emailBe/http/RetryStack.js +0 -23
- package/dist/services/emailBe/http/client.js +0 -61
- package/dist/services/emailBe/http/index.js +0 -10
- package/dist/services/emailBe/http/transportErrors.js +0 -20
- package/dist/src/@types/email-be/html-validation.d.ts +0 -35
- package/dist/src/enums/email-be.d.ts +0 -26
- package/dist/src/extensions/Blocks/_Boilerplate/block.d.ts +0 -11
- package/dist/src/extensions/Blocks/_Boilerplate/constants/controlIds.d.ts +0 -7
- package/dist/src/extensions/Blocks/_Boilerplate/constants/index.d.ts +0 -10
- package/dist/src/extensions/Blocks/_Boilerplate/constants/selectors.d.ts +0 -16
- package/dist/src/extensions/Blocks/_Boilerplate/control.d.ts +0 -17
- package/dist/src/extensions/Blocks/_Boilerplate/controls/blockBackground/index.d.ts +0 -15
- package/dist/src/extensions/Blocks/_Boilerplate/extension.d.ts +0 -2
- package/dist/src/extensions/Blocks/_Boilerplate/iconsRegistry.d.ts +0 -4
- package/dist/src/extensions/Blocks/_Boilerplate/settingsPanel.d.ts +0 -4
- package/dist/src/extensions/Blocks/_Boilerplate/template.d.ts +0 -6
- package/dist/src/services/emailBe/errors/ApiError.d.ts +0 -40
- package/dist/src/services/emailBe/errors/handleApiError.d.ts +0 -11
- package/dist/src/services/emailBe/errors/toApiError.d.ts +0 -2
- package/dist/src/services/emailBe/html/HtmlValidationService.d.ts +0 -8
- package/dist/src/services/emailBe/html/index.d.ts +0 -2
- package/dist/src/services/emailBe/http/HttpManager.d.ts +0 -13
- package/dist/src/services/emailBe/http/RetryStack.d.ts +0 -6
- package/dist/src/services/emailBe/http/client.d.ts +0 -3
- package/dist/src/services/emailBe/http/index.d.ts +0 -2
- package/dist/src/services/emailBe/http/transportErrors.d.ts +0 -15
- package/dist/src/services/emailBe/http/types.d.ts +0 -46
|
@@ -1,182 +1,289 @@
|
|
|
1
|
-
import { getIgnoredRecommendationBlockIds as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
1
|
+
import { getIgnoredRecommendationBlockIds as Y } from "../config/compiler/utils/recommendationIgnoreUtils.js";
|
|
2
|
+
import { CanNotMakeAnyChangesForRunningKey as k, DISPLAY_CONDITIONS_REGEX as U, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as M } from "../enums/html-validator.js";
|
|
3
|
+
import { SaveValidationRule as o } from "../enums/save-validation.js";
|
|
4
|
+
import { ToasterTypeOptions as r } from "../enums/toaster.js";
|
|
5
|
+
import { BLOCK_ROOT_SELECTOR as x } from "../extensions/Blocks/Checkbox/constants/selectors.js";
|
|
6
|
+
import { itemsBlockDynamicVariables as W } from "../extensions/Blocks/Items/enums/productEnums.js";
|
|
7
|
+
import { BLOCK_ROOT_SELECTOR as G } from "../extensions/Blocks/RadioButton/constants/selectors.js";
|
|
8
|
+
import { useRecommendationExtensionStore as P } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
9
|
+
import { getInvalidFields as q, STRATEGY_FIELD_KEY as H, RecommendationAssignStrategyKey as V, RecommendationRequiredFieldsKey as X } from "../extensions/Blocks/Recommendation/validation/requiredFields.js";
|
|
10
|
+
import { useConfigStore as j } from "../stores/config.js";
|
|
11
|
+
import { useDynamicContentStore as z } from "../stores/dynamic-content.js";
|
|
12
|
+
import { useRecommendationStore as $ } from "../stores/recommendation.js";
|
|
13
|
+
import { base64EncodeWithSpecialChars as T } from "../utils/base64.js";
|
|
14
|
+
import { escapeHtml as Q } from "../utils/htmlEscape.js";
|
|
15
|
+
import { useTemplatePreparation as Z } from "../utils/templatePreparation.js";
|
|
16
|
+
import { useActionsApi as J } from "./useActionsApi.js";
|
|
17
|
+
import { useConfig as ee } from "./useConfig.js";
|
|
18
|
+
import { useHtmlCompiler as te } from "./useHtmlCompiler.js";
|
|
19
|
+
import { buildPartnerAttributeNameSet as ne, getInvalidDynamicContentTags as ie, getRecommendationBlockIds as oe, findInvalidCustomFields as re } from "./useHtmlValidator.js";
|
|
20
|
+
import { useHttp as se } from "./useHttp.js";
|
|
21
|
+
import { useTranslations as ae } from "./useTranslations.js";
|
|
22
|
+
import { findInvalidCouponBlocks as ce, COUPON_TAG_MODIFIED_KEY as le } from "./validators/useCouponBlockValidator.js";
|
|
23
|
+
import { hasInsiderUnsubscribeCode as ue, EXTERNALLY_MANAGED_UNSUBSCRIBE_KEY as me, findDuplicateUnsubPageTypes as de, countUnsubBlocksWithoutPage as pe, EMPTY_BLOCK_KEY as ge } from "./validators/useUnsubscribeBlockValidator.js";
|
|
24
|
+
const fe = "newsletter.html-content-is-empty", ye = "custom-fields.missing-closing-braces", Ee = "custom-fields.missing-opening-braces", S = "custom-fields.invalid-custom-fields", Ie = "newsletter.display-conditions-invalid-syntax", Se = "custom-conditions.wrong-equality-operators", _e = "custom-conditions.missing-if-endif-tag", Ce = "custom-conditions.no-space-after-braces", he = "custom-conditions.no-braces-inside-if-tag", ke = "newsletter.fill-all-necessary-fields", Te = "newsletter.invalid-image-type", Fe = "unsubscribe-templates.select-checkbox-groups", be = "unsubscribe-templates.select-radio-button-groups", F = "newsletter.invalid-url-link-for-toaster", b = "journey-builder.liquid-validation-failed", Re = "/newsletter/template-library/check-template-html-body", Le = /src="[^"]*\.(svg|pst)"/gm, L = /({%(.*?)%})/g, Ne = ["if", "endif", "else", "elif", "now"], Oe = (t) => !Ne.includes(t.toLowerCase()), Ae = (t) => ["if", "endif"].includes(t.toLowerCase());
|
|
25
|
+
function De(t) {
|
|
26
|
+
return ce(t).map((i) => ({
|
|
27
|
+
rule: o.CouponTagModified,
|
|
28
|
+
type: r.Warning,
|
|
29
|
+
key: le,
|
|
30
|
+
detail: i
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
function ve(t) {
|
|
34
|
+
return de(t).map((i) => ({
|
|
35
|
+
rule: o.DuplicateUnsubBlock,
|
|
36
|
+
type: r.Error,
|
|
37
|
+
key: i.messageKey
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
function Ke(t) {
|
|
41
|
+
return Array.from({ length: pe(t) }, () => ({
|
|
42
|
+
rule: o.UnsubBlockMissingTemplate,
|
|
43
|
+
type: r.Warning,
|
|
44
|
+
key: ge
|
|
45
|
+
}));
|
|
35
46
|
}
|
|
36
|
-
function
|
|
37
|
-
return
|
|
38
|
-
rule:
|
|
39
|
-
type:
|
|
40
|
-
key:
|
|
47
|
+
function Be(t) {
|
|
48
|
+
return ue(t) ? [{
|
|
49
|
+
rule: o.ExternallyManagedUnsubscribe,
|
|
50
|
+
type: r.Warning,
|
|
51
|
+
key: me
|
|
41
52
|
}] : [];
|
|
42
53
|
}
|
|
43
|
-
function
|
|
44
|
-
const
|
|
45
|
-
if (!
|
|
54
|
+
function we(t, i) {
|
|
55
|
+
const n = t.match(L);
|
|
56
|
+
if (!n)
|
|
46
57
|
return [];
|
|
47
|
-
const
|
|
48
|
-
return
|
|
49
|
-
const
|
|
50
|
-
if (
|
|
51
|
-
const [
|
|
52
|
-
|
|
53
|
-
rule:
|
|
54
|
-
type:
|
|
55
|
-
key:
|
|
56
|
-
detail:
|
|
58
|
+
const u = [];
|
|
59
|
+
return n.forEach((m) => {
|
|
60
|
+
const c = m.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
|
|
61
|
+
if (c && c.length > 0) {
|
|
62
|
+
const [d] = c;
|
|
63
|
+
Oe(d) && !i.includes(d) && u.push({
|
|
64
|
+
rule: o.CustomFieldScript,
|
|
65
|
+
type: r.Warning,
|
|
66
|
+
key: S,
|
|
67
|
+
detail: d
|
|
57
68
|
});
|
|
58
69
|
}
|
|
59
|
-
}),
|
|
70
|
+
}), u;
|
|
60
71
|
}
|
|
61
|
-
function
|
|
62
|
-
return
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
72
|
+
function Ye(t) {
|
|
73
|
+
return t.length > 0 ? [] : [{ rule: o.EmptyHtml, type: r.Warning, key: fe }];
|
|
74
|
+
}
|
|
75
|
+
function Ue(t) {
|
|
76
|
+
const i = (t.match(/{/gm) || []).length, n = (t.match(/}/gm) || []).length;
|
|
77
|
+
return i > n ? [{
|
|
78
|
+
rule: o.MismatchedBraces,
|
|
79
|
+
type: r.Warning,
|
|
80
|
+
key: ye
|
|
81
|
+
}] : i < n ? [{
|
|
82
|
+
rule: o.MismatchedBraces,
|
|
83
|
+
type: r.Warning,
|
|
84
|
+
key: Ee
|
|
85
|
+
}] : [];
|
|
86
|
+
}
|
|
87
|
+
function Me(t) {
|
|
88
|
+
return ie(t).map((i) => ({
|
|
89
|
+
rule: o.InvalidDynamicTag,
|
|
90
|
+
type: r.Warning,
|
|
91
|
+
key: S,
|
|
92
|
+
detail: i
|
|
67
93
|
}));
|
|
68
94
|
}
|
|
69
|
-
function
|
|
70
|
-
const
|
|
71
|
-
return
|
|
72
|
-
rule:
|
|
73
|
-
type:
|
|
74
|
-
key:
|
|
75
|
-
detail:
|
|
95
|
+
function xe(t, i, n, u) {
|
|
96
|
+
const m = oe(t);
|
|
97
|
+
return re(t, i, m, n, u).map((c) => ({
|
|
98
|
+
rule: o.InvalidCustomField,
|
|
99
|
+
type: r.Error,
|
|
100
|
+
key: S,
|
|
101
|
+
detail: c
|
|
76
102
|
}));
|
|
77
103
|
}
|
|
78
|
-
function
|
|
79
|
-
const
|
|
80
|
-
|
|
104
|
+
function We(t) {
|
|
105
|
+
const i = t.match(/{%(.*?)%}/g), n = [], u = [];
|
|
106
|
+
if (i && i.forEach((m) => {
|
|
107
|
+
const c = m.match(U), d = m.match(M), I = (c == null ? void 0 : c.join("")) || "";
|
|
108
|
+
(!c || m !== I) && !d && u.push({
|
|
109
|
+
rule: o.ConditionsSyntax,
|
|
110
|
+
type: r.Error,
|
|
111
|
+
key: Ie,
|
|
112
|
+
detail: m
|
|
113
|
+
}), c && c.forEach((g) => {
|
|
114
|
+
g.trim() === "=" && u.push({
|
|
115
|
+
rule: o.WrongEqualityOperator,
|
|
116
|
+
type: r.Error,
|
|
117
|
+
key: Se
|
|
118
|
+
}), (g.match(/^[a-zA-Z]*$/g) ?? []).forEach((f) => {
|
|
119
|
+
Ae(f) && n.push(f);
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
}), n.length) {
|
|
123
|
+
const m = n.filter((d) => d === "if").length, c = n.filter((d) => d === "endif").length;
|
|
124
|
+
m !== c && u.push({
|
|
125
|
+
rule: o.MissingIfEndif,
|
|
126
|
+
type: r.Error,
|
|
127
|
+
key: _e
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
return u;
|
|
131
|
+
}
|
|
132
|
+
function Ge(t) {
|
|
133
|
+
const i = (t.match(/{% /gm) || []).length, n = (t.match(/ %}/gm) || []).length;
|
|
134
|
+
return i === n ? [] : [{
|
|
135
|
+
rule: o.ConditionTagSpacing,
|
|
136
|
+
type: r.Warning,
|
|
137
|
+
key: Ce
|
|
138
|
+
}];
|
|
139
|
+
}
|
|
140
|
+
function Pe(t) {
|
|
141
|
+
return (t.match(L) || []).filter((n) => n.includes("if")).map((n) => (n.match(/{{.*}}/gm) || []).length).reduce((n, u) => n + u, 0) === 0 ? [] : [{
|
|
142
|
+
rule: o.BracesInsideIfTag,
|
|
143
|
+
type: r.Warning,
|
|
144
|
+
key: he
|
|
145
|
+
}];
|
|
146
|
+
}
|
|
147
|
+
function qe(t) {
|
|
148
|
+
return (t.match(Le) ?? []).map((i) => ({
|
|
149
|
+
rule: o.InvalidImageType,
|
|
150
|
+
type: r.Error,
|
|
151
|
+
key: Te,
|
|
152
|
+
detail: i
|
|
153
|
+
}));
|
|
81
154
|
}
|
|
82
|
-
function
|
|
83
|
-
const
|
|
84
|
-
return Array.from(
|
|
85
|
-
var
|
|
86
|
-
return !((
|
|
87
|
-
}).map(() => ({ rule:
|
|
155
|
+
function R(t, i, n, u) {
|
|
156
|
+
const m = new DOMParser().parseFromString(t, "text/html");
|
|
157
|
+
return Array.from(m.querySelectorAll(i)).filter((c) => {
|
|
158
|
+
var d;
|
|
159
|
+
return !((d = c.id) != null && d.trim());
|
|
160
|
+
}).map(() => ({ rule: n, type: r.Error, key: u }));
|
|
88
161
|
}
|
|
89
|
-
const
|
|
90
|
-
const { config: t, isFeatureEnabled:
|
|
162
|
+
const ft = () => {
|
|
163
|
+
const { config: t, isFeatureEnabled: i } = ee(), n = ae(), { post: u } = se(), { getCompiledEmail: m, getTemplateData: c } = J(), { compileHtml: d } = te(), { hydrateRecommendationStore: I } = Z(), g = z(), f = $(), y = P(), N = j(), O = (e) => ({
|
|
91
164
|
rule: e.rule,
|
|
92
165
|
type: e.type,
|
|
93
166
|
detail: e.detail,
|
|
94
|
-
message: "key" in e ?
|
|
95
|
-
}),
|
|
167
|
+
message: "key" in e ? n(e.key) : Q(e.message)
|
|
168
|
+
}), A = async (e) => {
|
|
96
169
|
if (e.size === 0)
|
|
97
170
|
return /* @__PURE__ */ new Set();
|
|
98
171
|
try {
|
|
99
|
-
await
|
|
172
|
+
await y.fetchRecommendationFilters();
|
|
100
173
|
} catch {
|
|
101
174
|
return null;
|
|
102
175
|
}
|
|
103
|
-
return
|
|
176
|
+
return ne(y.filterList);
|
|
104
177
|
}, D = async (e) => {
|
|
105
|
-
|
|
106
|
-
html: e,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
178
|
+
try {
|
|
179
|
+
const a = await u(Re, { html: T(e) }), { status: s, message: l } = a.data, p = [], E = s === void 0 && !!l && l !== n(F);
|
|
180
|
+
return s || p.push({
|
|
181
|
+
rule: o.InvalidLinks,
|
|
182
|
+
type: r.Error,
|
|
183
|
+
...E ? { message: l } : { key: F }
|
|
184
|
+
}), l === n(k) && p.push({
|
|
185
|
+
rule: o.LinkCheckInProgress,
|
|
186
|
+
type: r.Error,
|
|
187
|
+
key: k
|
|
188
|
+
}), p;
|
|
189
|
+
} catch (a) {
|
|
190
|
+
return console.warn("Link-check collector failed; skipping the link rule.", a), [];
|
|
191
|
+
}
|
|
110
192
|
}, v = async (e) => {
|
|
111
193
|
try {
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
194
|
+
const a = await u("/newsletter/contents/validate-syntax", [{
|
|
195
|
+
identifier: "default",
|
|
196
|
+
syntax: "liquid",
|
|
197
|
+
contents: {
|
|
198
|
+
subject: null,
|
|
199
|
+
preheader: null,
|
|
200
|
+
html: T(e),
|
|
201
|
+
ampHtml: null
|
|
202
|
+
}
|
|
203
|
+
}]);
|
|
204
|
+
if (!Array.isArray(a.data)) {
|
|
205
|
+
const l = a.data;
|
|
206
|
+
return [{
|
|
207
|
+
rule: o.LiquidSyntax,
|
|
208
|
+
type: r.Warning,
|
|
209
|
+
message: l.message ?? n(b)
|
|
210
|
+
}];
|
|
211
|
+
}
|
|
212
|
+
const [s] = a.data;
|
|
213
|
+
return Object.values((s == null ? void 0 : s.errors) ?? {}).map((l) => ({
|
|
214
|
+
rule: o.LiquidSyntax,
|
|
215
|
+
type: r.Warning,
|
|
216
|
+
message: l.replace(/^line \d+:\s*/, "")
|
|
217
|
+
}));
|
|
218
|
+
} catch (a) {
|
|
219
|
+
if (a != null && a.authReported)
|
|
220
|
+
throw a;
|
|
221
|
+
return [{
|
|
222
|
+
rule: o.LiquidSyntax,
|
|
223
|
+
type: r.Error,
|
|
224
|
+
message: n(b)
|
|
117
225
|
}];
|
|
118
|
-
} catch (r) {
|
|
119
|
-
return console.warn("Link-check collector failed; skipping the running-campaign rule.", r), [];
|
|
120
226
|
}
|
|
121
|
-
},
|
|
122
|
-
const e = Object.values(
|
|
123
|
-
const
|
|
227
|
+
}, K = () => {
|
|
228
|
+
const e = Object.values(y.blockStates).map((s) => q(s.recommendationConfigs, y)).filter((s) => s.length > 0).map((s) => {
|
|
229
|
+
const l = s.every((p) => p === H);
|
|
124
230
|
return {
|
|
125
|
-
rule:
|
|
126
|
-
type:
|
|
127
|
-
key:
|
|
231
|
+
rule: o.RecommendationRequiredFields,
|
|
232
|
+
type: l ? r.Warning : r.Error,
|
|
233
|
+
key: l ? V : X
|
|
128
234
|
};
|
|
129
|
-
}),
|
|
130
|
-
rule:
|
|
131
|
-
type:
|
|
132
|
-
key:
|
|
235
|
+
}), a = (f.recommendationConfigs ?? []).filter((s) => s.filters.some((l) => l.value === "")).map(() => ({
|
|
236
|
+
rule: o.RecommendationFilters,
|
|
237
|
+
type: r.Error,
|
|
238
|
+
key: ke
|
|
133
239
|
}));
|
|
134
|
-
return [...e, ...
|
|
135
|
-
},
|
|
136
|
-
var
|
|
137
|
-
const
|
|
138
|
-
...
|
|
139
|
-
...
|
|
140
|
-
...((
|
|
141
|
-
],
|
|
240
|
+
return [...e, ...a];
|
|
241
|
+
}, B = async (e, a) => {
|
|
242
|
+
var C, h;
|
|
243
|
+
const s = [
|
|
244
|
+
...a.map((w) => w.value),
|
|
245
|
+
...W,
|
|
246
|
+
...((h = (C = t.value) == null ? void 0 : C.template) == null ? void 0 : h.customFieldAttributes) ?? []
|
|
247
|
+
], l = Y(e), p = await A(l), { isTransactional: E } = N;
|
|
142
248
|
return [
|
|
143
|
-
...await
|
|
144
|
-
...
|
|
145
|
-
...
|
|
146
|
-
...
|
|
147
|
-
...
|
|
148
|
-
...
|
|
149
|
-
...
|
|
249
|
+
...await D(e),
|
|
250
|
+
...E ? [] : we(e, s),
|
|
251
|
+
...Ye(e),
|
|
252
|
+
...Ue(e),
|
|
253
|
+
...Me(e),
|
|
254
|
+
...E ? [] : xe(e, s, l, p),
|
|
255
|
+
...We(e),
|
|
256
|
+
...Ge(e),
|
|
257
|
+
...Pe(e),
|
|
258
|
+
...K(),
|
|
259
|
+
...qe(e),
|
|
260
|
+
...R(
|
|
150
261
|
e,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
262
|
+
x,
|
|
263
|
+
o.CheckboxUnsubGroup,
|
|
264
|
+
Fe
|
|
154
265
|
),
|
|
155
|
-
...
|
|
266
|
+
...R(
|
|
156
267
|
e,
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
268
|
+
G,
|
|
269
|
+
o.RadioButtonUnsubGroup,
|
|
270
|
+
be
|
|
160
271
|
)
|
|
161
272
|
];
|
|
162
|
-
},
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
const { html: e } = await d();
|
|
175
|
-
await _(e);
|
|
176
|
-
const { html: r } = await o({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: i } = u(r);
|
|
177
|
-
return E(i, R.getSelectedDynamicContentList, e);
|
|
273
|
+
}, _ = async (e, a, s) => [
|
|
274
|
+
...De(e),
|
|
275
|
+
...i("blockUnsubscribeLinks") ? Be(s) : [],
|
|
276
|
+
...ve(e),
|
|
277
|
+
...Ke(e),
|
|
278
|
+
...i("liquidSyntax") ? await v(e) : await B(e, a)
|
|
279
|
+
].map(O);
|
|
280
|
+
return { collectSaveValidationErrors: _, validateCurrentTemplate: async () => {
|
|
281
|
+
const { html: e } = await c();
|
|
282
|
+
await I(e);
|
|
283
|
+
const { html: a } = await m({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: s } = d(a);
|
|
284
|
+
return _(s, g.getSelectedDynamicContentList, e);
|
|
178
285
|
} };
|
|
179
286
|
};
|
|
180
287
|
export {
|
|
181
|
-
|
|
288
|
+
ft as useSaveValidation
|
|
182
289
|
};
|
|
@@ -4,20 +4,15 @@ import memoize from "../node_modules/lodash-es/memoize.js";
|
|
|
4
4
|
import { ref } from "vue";
|
|
5
5
|
import { useConfig } from "./useConfig.js";
|
|
6
6
|
const useTranslations = () => {
|
|
7
|
-
var
|
|
8
|
-
const { config } = useConfig(), translationsPath = ((
|
|
9
|
-
var
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return o.replace(e, (f, l, c) => String(
|
|
17
|
-
n[l ?? c]
|
|
18
|
-
));
|
|
19
|
-
}
|
|
20
|
-
return o;
|
|
7
|
+
var o, e;
|
|
8
|
+
const { config } = useConfig(), translationsPath = ((e = (o = config.value) == null ? void 0 : o.editor) == null ? void 0 : e.translationsPath) || DEFAULT_EDITOR.translationsPath, translations = ref(eval(translationsPath)), trans = (t, n) => {
|
|
9
|
+
var s;
|
|
10
|
+
const r = (s = translations.value) == null ? void 0 : s[t];
|
|
11
|
+
return r ? n ? Object.entries(n).reduce(
|
|
12
|
+
// A function replacer keeps `$&`, `$$` and `$1` in the value literal.
|
|
13
|
+
(i, [a, l]) => i.replace(new RegExp(`{${a}}`, "g"), () => String(l)),
|
|
14
|
+
r
|
|
15
|
+
) : r : (console.warn(`Translation key not found: ${t}`), t);
|
|
21
16
|
};
|
|
22
17
|
return memoize(
|
|
23
18
|
trans,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var n = /* @__PURE__ */ ((
|
|
1
|
+
var n = /* @__PURE__ */ ((s) => (s.CouponTagModified = "coupon-tag-modified", s.DuplicateUnsubBlock = "duplicate-unsub-block", s.UnsubBlockMissingTemplate = "unsub-block-missing-template", s.LiquidSyntax = "liquid-syntax", s.InvalidLinks = "invalid-links", s.LinkCheckInProgress = "link-check-in-progress", s.CustomFieldScript = "custom-field-script", s.EmptyHtml = "empty-html", s.MismatchedBraces = "mismatched-braces", s.InvalidDynamicTag = "invalid-dynamic-tag", s.InvalidCustomField = "invalid-custom-field", s.ConditionsSyntax = "conditions-syntax", s.WrongEqualityOperator = "wrong-equality-operator", s.MissingIfEndif = "missing-if-endif", s.ConditionTagSpacing = "condition-tag-spacing", s.BracesInsideIfTag = "braces-inside-if-tag", s.RecommendationRequiredFields = "recommendation-required-fields", s.RecommendationFilters = "recommendation-filters", s.InvalidImageType = "invalid-image-type", s.CheckboxUnsubGroup = "checkbox-unsub-group", s.RadioButtonUnsubGroup = "radio-button-unsub-group", s.ExternallyManagedUnsubscribe = "externally-managed-unsubscribe", s))(n || {});
|
|
2
2
|
export {
|
|
3
3
|
n as SaveValidationRule
|
|
4
4
|
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var r = (i, e, t) =>
|
|
4
|
-
import { CommonControl as
|
|
5
|
-
import { useRecommendationExtensionStore as
|
|
6
|
-
const
|
|
1
|
+
var o = Object.defineProperty;
|
|
2
|
+
var s = (i, e, t) => e in i ? o(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
|
+
var r = (i, e, t) => s(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { CommonControl as l } from "../../../common-control.js";
|
|
5
|
+
import { useRecommendationExtensionStore as d } from "../../store/recommendation.js";
|
|
6
|
+
const a = "recommendation-filters-control", u = {
|
|
7
7
|
FILTERS: "filterStatus"
|
|
8
8
|
};
|
|
9
|
-
class
|
|
9
|
+
class m extends l {
|
|
10
10
|
constructor() {
|
|
11
11
|
super(...arguments);
|
|
12
|
-
r(this, "store",
|
|
12
|
+
r(this, "store", d());
|
|
13
13
|
r(this, "addFilterListener", () => {
|
|
14
14
|
});
|
|
15
15
|
r(this, "addFilterButton", null);
|
|
16
16
|
}
|
|
17
17
|
getId() {
|
|
18
|
-
return
|
|
18
|
+
return a;
|
|
19
19
|
}
|
|
20
20
|
getTemplate() {
|
|
21
21
|
return `
|
|
@@ -23,7 +23,7 @@ class h extends s {
|
|
|
23
23
|
${this._GuTwoColumns([
|
|
24
24
|
this._GuLabel({ text: this.api.translate("Filters") }),
|
|
25
25
|
this._GuButton({
|
|
26
|
-
name:
|
|
26
|
+
name: u.FILTERS,
|
|
27
27
|
label: this.api.translate("Add Filter"),
|
|
28
28
|
id: "guido__btn-add-filter"
|
|
29
29
|
})
|
|
@@ -42,11 +42,11 @@ class h extends s {
|
|
|
42
42
|
this.store.openFilterDrawer();
|
|
43
43
|
}
|
|
44
44
|
_setupButtonListener() {
|
|
45
|
-
var t;
|
|
46
|
-
this.addFilterListener = this._onFilterSelectClick.bind(this), this.addFilterButton = this.getContainer().querySelector("#guido__btn-add-filter"), (
|
|
45
|
+
var t, n;
|
|
46
|
+
this.addFilterListener = this._onFilterSelectClick.bind(this), this.addFilterButton = (t = this.getContainer()) == null ? void 0 : t.querySelector("#guido__btn-add-filter"), (n = this.addFilterButton) == null || n.addEventListener("click", this.addFilterListener);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
export {
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
a as FILTERS_CONTROL_ID,
|
|
51
|
+
m as FiltersControl
|
|
52
52
|
};
|