@useinsider/guido 3.20.1-beta.f34075e → 3.20.1-beta.f69c15d
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 +3 -3
- package/dist/components/Guido.vue2.js +58 -57
- package/dist/components/organisms/AutoSaveController.vue2.js +9 -10
- package/dist/components/organisms/header/EditorActions.vue.js +4 -4
- package/dist/components/organisms/header/EditorActions.vue2.js +51 -53
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +3 -3
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +22 -23
- package/dist/composables/useAutoSave.js +44 -46
- package/dist/composables/useLegacyStrategyConversion.js +16 -16
- package/dist/composables/useSave.js +23 -26
- package/dist/composables/useSaveValidation.js +114 -113
- package/dist/composables/useSaveValidationRollout.js +6 -17
- package/dist/composables/useStripo.js +3 -4
- package/dist/extensions/Blocks/Items/block.js +42 -43
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +223 -296
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +205 -219
- package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +36 -51
- package/dist/extensions/Blocks/Recommendation/utils/strategyCommit.js +35 -31
- package/dist/extensions/Blocks/Unsubscribe/block.js +70 -75
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +192 -271
- package/dist/package.json.js +1 -1
- package/dist/src/components/Guido.vue.d.ts +1 -1
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -1
- package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -1
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -1
- package/dist/src/composables/useAutoSave.d.ts +1 -4
- package/dist/src/composables/useSaveValidationRollout.d.ts +0 -1
- package/dist/src/extensions/Blocks/Checkbox/controls/blockBackground/index.d.ts +0 -1
- package/dist/src/extensions/Blocks/CouponBlock/controls/index.d.ts +0 -8
- package/dist/src/extensions/Blocks/Items/controls/index.d.ts +0 -40
- package/dist/src/extensions/Blocks/RadioButton/controls/blockBackground/index.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/blockBackground/index.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +0 -11
- package/dist/src/extensions/Blocks/Recommendation/controls/customAttribute/index.d.ts +0 -7
- package/dist/src/extensions/Blocks/Recommendation/controls/image/index.d.ts +0 -2
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +3 -18
- package/dist/src/extensions/Blocks/Recommendation/controls/name/index.d.ts +0 -7
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/index.d.ts +0 -7
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.d.ts +0 -7
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/index.d.ts +0 -7
- package/dist/src/extensions/Blocks/Recommendation/controls/price/index.d.ts +0 -7
- package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +0 -7
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -8
- package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +0 -7
- package/dist/src/extensions/Blocks/Unsubscribe/block.d.ts +1 -6
- package/dist/src/extensions/Blocks/_Boilerplate/controls/blockBackground/index.d.ts +0 -1
- package/dist/src/extensions/Blocks/controlFactories.d.ts +0 -22
- package/dist/static/styles/components/button.css.js +0 -5
- package/package.json +3 -3
- package/dist/extensions/Blocks/Recommendation/utils/blockRefresh.js +0 -19
- package/dist/services/settingsApi.js +0 -11
- package/dist/src/extensions/Blocks/Recommendation/utils/blockRefresh.d.ts +0 -17
- package/dist/src/services/settingsApi.d.ts +0 -6
- package/dist/src/stores/setup-settings.d.ts +0 -4
- package/dist/stores/setup-settings.js +0 -10
|
@@ -1,164 +1,164 @@
|
|
|
1
|
-
import { getIgnoredRecommendationBlockIds as
|
|
2
|
-
import { CanNotMakeAnyChangesForRunningKey as k, DISPLAY_CONDITIONS_REGEX as
|
|
1
|
+
import { getIgnoredRecommendationBlockIds as B } from "../config/compiler/utils/recommendationIgnoreUtils.js";
|
|
2
|
+
import { CanNotMakeAnyChangesForRunningKey as k, DISPLAY_CONDITIONS_REGEX as Y, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as x } from "../enums/html-validator.js";
|
|
3
3
|
import { SaveValidationRule as o } from "../enums/save-validation.js";
|
|
4
4
|
import { ToasterTypeOptions as r } from "../enums/toaster.js";
|
|
5
|
-
import { BLOCK_ROOT_SELECTOR as
|
|
6
|
-
import { itemsBlockDynamicVariables as
|
|
7
|
-
import { BLOCK_ROOT_SELECTOR as
|
|
8
|
-
import { useRecommendationExtensionStore as
|
|
9
|
-
import { getInvalidFields as
|
|
10
|
-
import { useConfigStore as
|
|
11
|
-
import { useDynamicContentStore as
|
|
12
|
-
import { useRecommendationStore as
|
|
5
|
+
import { BLOCK_ROOT_SELECTOR as M } from "../extensions/Blocks/Checkbox/constants/selectors.js";
|
|
6
|
+
import { itemsBlockDynamicVariables as U } from "../extensions/Blocks/Items/enums/productEnums.js";
|
|
7
|
+
import { BLOCK_ROOT_SELECTOR as P } from "../extensions/Blocks/RadioButton/constants/selectors.js";
|
|
8
|
+
import { useRecommendationExtensionStore as W } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
9
|
+
import { getInvalidFields as G, STRATEGY_FIELD_KEY as q, RecommendationAssignStrategyKey as H, RecommendationRequiredFieldsKey as V } from "../extensions/Blocks/Recommendation/validation/requiredFields.js";
|
|
10
|
+
import { useConfigStore as X } from "../stores/config.js";
|
|
11
|
+
import { useDynamicContentStore as j } from "../stores/dynamic-content.js";
|
|
12
|
+
import { useRecommendationStore as z } from "../stores/recommendation.js";
|
|
13
13
|
import { base64EncodeWithSpecialChars as T } from "../utils/base64.js";
|
|
14
|
-
import { escapeHtml as
|
|
15
|
-
import { useTemplatePreparation as
|
|
16
|
-
import { useActionsApi as
|
|
17
|
-
import { useConfig as
|
|
18
|
-
import { useHtmlCompiler as
|
|
19
|
-
import { buildPartnerAttributeNameSet as
|
|
20
|
-
import { useHttp as
|
|
21
|
-
import { useTranslations as
|
|
22
|
-
import { findInvalidCouponBlocks as
|
|
23
|
-
import { findDuplicateUnsubPageTypes as
|
|
24
|
-
const
|
|
14
|
+
import { escapeHtml as $ } from "../utils/htmlEscape.js";
|
|
15
|
+
import { useTemplatePreparation as Q } from "../utils/templatePreparation.js";
|
|
16
|
+
import { useActionsApi as Z } from "./useActionsApi.js";
|
|
17
|
+
import { useConfig as J } from "./useConfig.js";
|
|
18
|
+
import { useHtmlCompiler as ee } from "./useHtmlCompiler.js";
|
|
19
|
+
import { buildPartnerAttributeNameSet as te, getInvalidDynamicContentTags as ne, getRecommendationBlockIds as ie, findInvalidCustomFields as oe } from "./useHtmlValidator.js";
|
|
20
|
+
import { useHttp as re } from "./useHttp.js";
|
|
21
|
+
import { useTranslations as se } from "./useTranslations.js";
|
|
22
|
+
import { findInvalidCouponBlocks as ae, COUPON_TAG_MODIFIED_KEY as ce } from "./validators/useCouponBlockValidator.js";
|
|
23
|
+
import { findDuplicateUnsubPageTypes as le, countUnsubBlocksWithoutPage as me, EMPTY_BLOCK_KEY as ue } from "./validators/useUnsubscribeBlockValidator.js";
|
|
24
|
+
const de = "newsletter.html-content-is-empty", pe = "custom-fields.missing-closing-braces", ge = "custom-fields.missing-opening-braces", I = "custom-fields.invalid-custom-fields", fe = "newsletter.display-conditions-invalid-syntax", ye = "custom-conditions.wrong-equality-operators", Ee = "custom-conditions.missing-if-endif-tag", Ie = "custom-conditions.no-space-after-braces", Se = "custom-conditions.no-braces-inside-if-tag", _e = "newsletter.fill-all-necessary-fields", Ce = "newsletter.invalid-image-type", he = "unsubscribe-templates.select-checkbox-groups", ke = "unsubscribe-templates.select-radio-button-groups", Te = "newsletter.invalid-url-link-for-toaster", F = "journey-builder.liquid-validation-failed", Fe = "/newsletter/template-library/check-template-html-body", Oe = /src="[^"]*\.(svg|pst)"/gm, R = /({%(.*?)%})/g, Re = ["if", "endif", "else", "elif", "now"], Le = (t) => !Re.includes(t.toLowerCase()), Ne = (t) => ["if", "endif"].includes(t.toLowerCase());
|
|
25
25
|
function be(t) {
|
|
26
|
-
return
|
|
26
|
+
return ae(t).map((i) => ({
|
|
27
27
|
rule: o.CouponTagModified,
|
|
28
28
|
type: r.Warning,
|
|
29
|
-
key:
|
|
29
|
+
key: ce,
|
|
30
30
|
detail: i
|
|
31
31
|
}));
|
|
32
32
|
}
|
|
33
33
|
function Ae(t) {
|
|
34
|
-
return
|
|
34
|
+
return le(t).map((i) => ({
|
|
35
35
|
rule: o.DuplicateUnsubBlock,
|
|
36
36
|
type: r.Error,
|
|
37
37
|
key: i.messageKey
|
|
38
38
|
}));
|
|
39
39
|
}
|
|
40
40
|
function ve(t) {
|
|
41
|
-
return Array.from({ length:
|
|
41
|
+
return Array.from({ length: me(t) }, () => ({
|
|
42
42
|
rule: o.UnsubBlockMissingTemplate,
|
|
43
43
|
type: r.Warning,
|
|
44
|
-
key:
|
|
44
|
+
key: ue
|
|
45
45
|
}));
|
|
46
46
|
}
|
|
47
47
|
function De(t, i) {
|
|
48
|
-
const n = t.match(
|
|
48
|
+
const n = t.match(R);
|
|
49
49
|
if (!n)
|
|
50
50
|
return [];
|
|
51
|
-
const
|
|
51
|
+
const c = [];
|
|
52
52
|
return n.forEach((u) => {
|
|
53
|
-
const
|
|
54
|
-
if (
|
|
55
|
-
const [d] =
|
|
56
|
-
Le(d) && !i.includes(d) &&
|
|
53
|
+
const a = u.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
|
|
54
|
+
if (a && a.length > 0) {
|
|
55
|
+
const [d] = a;
|
|
56
|
+
Le(d) && !i.includes(d) && c.push({
|
|
57
57
|
rule: o.CustomFieldScript,
|
|
58
58
|
type: r.Warning,
|
|
59
|
-
key:
|
|
59
|
+
key: I,
|
|
60
60
|
detail: d
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
|
-
}),
|
|
63
|
+
}), c;
|
|
64
64
|
}
|
|
65
65
|
function Ke(t) {
|
|
66
|
-
return t.length > 0 ? [] : [{ rule: o.EmptyHtml, type: r.Warning, key:
|
|
66
|
+
return t.length > 0 ? [] : [{ rule: o.EmptyHtml, type: r.Warning, key: de }];
|
|
67
67
|
}
|
|
68
68
|
function we(t) {
|
|
69
69
|
const i = (t.match(/{/gm) || []).length, n = (t.match(/}/gm) || []).length;
|
|
70
70
|
return i > n ? [{
|
|
71
71
|
rule: o.MismatchedBraces,
|
|
72
72
|
type: r.Warning,
|
|
73
|
-
key:
|
|
73
|
+
key: pe
|
|
74
74
|
}] : i < n ? [{
|
|
75
75
|
rule: o.MismatchedBraces,
|
|
76
76
|
type: r.Warning,
|
|
77
|
-
key:
|
|
77
|
+
key: ge
|
|
78
78
|
}] : [];
|
|
79
79
|
}
|
|
80
80
|
function Be(t) {
|
|
81
|
-
return
|
|
81
|
+
return ne(t).map((i) => ({
|
|
82
82
|
rule: o.InvalidDynamicTag,
|
|
83
83
|
type: r.Warning,
|
|
84
|
-
key:
|
|
84
|
+
key: I,
|
|
85
85
|
detail: i
|
|
86
86
|
}));
|
|
87
87
|
}
|
|
88
|
-
function Ye(t, i, n,
|
|
89
|
-
const u =
|
|
90
|
-
return
|
|
88
|
+
function Ye(t, i, n, c) {
|
|
89
|
+
const u = ie(t);
|
|
90
|
+
return oe(t, i, u, n, c).map((a) => ({
|
|
91
91
|
rule: o.InvalidCustomField,
|
|
92
92
|
type: r.Error,
|
|
93
|
-
key:
|
|
94
|
-
detail:
|
|
93
|
+
key: I,
|
|
94
|
+
detail: a
|
|
95
95
|
}));
|
|
96
96
|
}
|
|
97
97
|
function xe(t) {
|
|
98
|
-
const i = t.match(/{%(.*?)%}/g), n = [],
|
|
98
|
+
const i = t.match(/{%(.*?)%}/g), n = [], c = [];
|
|
99
99
|
if (i && i.forEach((u) => {
|
|
100
|
-
const
|
|
101
|
-
(!
|
|
100
|
+
const a = u.match(Y), d = u.match(x), E = (a == null ? void 0 : a.join("")) || "";
|
|
101
|
+
(!a || u !== E) && !d && c.push({
|
|
102
102
|
rule: o.ConditionsSyntax,
|
|
103
103
|
type: r.Error,
|
|
104
|
-
key:
|
|
104
|
+
key: fe,
|
|
105
105
|
detail: u
|
|
106
|
-
}),
|
|
107
|
-
g.trim() === "=" &&
|
|
106
|
+
}), a && a.forEach((g) => {
|
|
107
|
+
g.trim() === "=" && c.push({
|
|
108
108
|
rule: o.WrongEqualityOperator,
|
|
109
109
|
type: r.Error,
|
|
110
|
-
key:
|
|
110
|
+
key: ye
|
|
111
111
|
}), (g.match(/^[a-zA-Z]*$/g) ?? []).forEach((f) => {
|
|
112
112
|
Ne(f) && n.push(f);
|
|
113
113
|
});
|
|
114
114
|
});
|
|
115
115
|
}), n.length) {
|
|
116
|
-
const u = n.filter((d) => d === "if").length,
|
|
117
|
-
u !==
|
|
116
|
+
const u = n.filter((d) => d === "if").length, a = n.filter((d) => d === "endif").length;
|
|
117
|
+
u !== a && c.push({
|
|
118
118
|
rule: o.MissingIfEndif,
|
|
119
119
|
type: r.Error,
|
|
120
|
-
key:
|
|
120
|
+
key: Ee
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
|
-
return
|
|
123
|
+
return c;
|
|
124
124
|
}
|
|
125
125
|
function Me(t) {
|
|
126
126
|
const i = (t.match(/{% /gm) || []).length, n = (t.match(/ %}/gm) || []).length;
|
|
127
127
|
return i === n ? [] : [{
|
|
128
128
|
rule: o.ConditionTagSpacing,
|
|
129
129
|
type: r.Warning,
|
|
130
|
-
key:
|
|
130
|
+
key: Ie
|
|
131
131
|
}];
|
|
132
132
|
}
|
|
133
133
|
function Ue(t) {
|
|
134
|
-
return (t.match(
|
|
134
|
+
return (t.match(R) || []).filter((n) => n.includes("if")).map((n) => (n.match(/{{.*}}/gm) || []).length).reduce((n, c) => n + c, 0) === 0 ? [] : [{
|
|
135
135
|
rule: o.BracesInsideIfTag,
|
|
136
136
|
type: r.Warning,
|
|
137
|
-
key:
|
|
137
|
+
key: Se
|
|
138
138
|
}];
|
|
139
139
|
}
|
|
140
140
|
function Pe(t) {
|
|
141
|
-
return (t.match(
|
|
141
|
+
return (t.match(Oe) ?? []).map((i) => ({
|
|
142
142
|
rule: o.InvalidImageType,
|
|
143
143
|
type: r.Error,
|
|
144
|
-
key:
|
|
144
|
+
key: Ce,
|
|
145
145
|
detail: i
|
|
146
146
|
}));
|
|
147
147
|
}
|
|
148
|
-
function O(t, i, n,
|
|
148
|
+
function O(t, i, n, c) {
|
|
149
149
|
const u = new DOMParser().parseFromString(t, "text/html");
|
|
150
|
-
return Array.from(u.querySelectorAll(i)).filter((
|
|
150
|
+
return Array.from(u.querySelectorAll(i)).filter((a) => {
|
|
151
151
|
var d;
|
|
152
|
-
return !((d =
|
|
153
|
-
}).map(() => ({ rule: n, type: r.Error, key:
|
|
152
|
+
return !((d = a.id) != null && d.trim());
|
|
153
|
+
}).map(() => ({ rule: n, type: r.Error, key: c }));
|
|
154
154
|
}
|
|
155
155
|
const dt = () => {
|
|
156
|
-
const { config: t, isFeatureEnabled: i } =
|
|
156
|
+
const { config: t, isFeatureEnabled: i } = J(), n = se(), { post: c } = re(), { getCompiledEmail: u, getTemplateData: a } = Z(), { compileHtml: d } = ee(), { hydrateRecommendationStore: E } = Q(), g = j(), f = z(), y = W(), L = X(), N = (e) => ({
|
|
157
157
|
rule: e.rule,
|
|
158
158
|
type: e.type,
|
|
159
159
|
detail: e.detail,
|
|
160
|
-
message: "key" in e ? n(e.key) :
|
|
161
|
-
}),
|
|
160
|
+
message: "key" in e ? n(e.key) : $(e.message)
|
|
161
|
+
}), b = async (e) => {
|
|
162
162
|
if (e.size === 0)
|
|
163
163
|
return /* @__PURE__ */ new Set();
|
|
164
164
|
try {
|
|
@@ -166,25 +166,28 @@ const dt = () => {
|
|
|
166
166
|
} catch {
|
|
167
167
|
return null;
|
|
168
168
|
}
|
|
169
|
-
return
|
|
170
|
-
},
|
|
169
|
+
return te(y.filterList);
|
|
170
|
+
}, A = async (e) => {
|
|
171
171
|
try {
|
|
172
|
-
const
|
|
173
|
-
return
|
|
172
|
+
const l = await c(Fe, { html: T(e) }), { status: s, message: m } = l.data, p = [];
|
|
173
|
+
return s || p.push({
|
|
174
174
|
rule: o.InvalidLinks,
|
|
175
175
|
type: r.Error,
|
|
176
|
-
|
|
176
|
+
// status===undefined means a bare message instead of a boolean; surface it,
|
|
177
|
+
// but fall back to the canned key when it's missing so a malformed body
|
|
178
|
+
// never renders a literal 'undefined' row (SD-147430).
|
|
179
|
+
...s === void 0 && m ? { message: m } : { key: Te }
|
|
177
180
|
}), m === n(k) && p.push({
|
|
178
181
|
rule: o.LinkCheckInProgress,
|
|
179
182
|
type: r.Error,
|
|
180
183
|
key: k
|
|
181
184
|
}), p;
|
|
182
|
-
} catch (
|
|
183
|
-
return console.warn("Link-check collector failed; skipping the link rule.",
|
|
185
|
+
} catch (l) {
|
|
186
|
+
return console.warn("Link-check collector failed; skipping the link rule.", l), [];
|
|
184
187
|
}
|
|
185
|
-
},
|
|
188
|
+
}, v = async (e) => {
|
|
186
189
|
try {
|
|
187
|
-
const
|
|
190
|
+
const l = await c("/newsletter/contents/validate-syntax", [{
|
|
188
191
|
identifier: "default",
|
|
189
192
|
syntax: "liquid",
|
|
190
193
|
contents: {
|
|
@@ -194,86 +197,84 @@ const dt = () => {
|
|
|
194
197
|
ampHtml: null
|
|
195
198
|
}
|
|
196
199
|
}]);
|
|
197
|
-
if (!Array.isArray(
|
|
198
|
-
const m =
|
|
200
|
+
if (!Array.isArray(l.data)) {
|
|
201
|
+
const m = l.data;
|
|
199
202
|
return [{
|
|
200
203
|
rule: o.LiquidSyntax,
|
|
201
204
|
type: r.Warning,
|
|
202
|
-
message: m.message ?? n(
|
|
205
|
+
message: m.message ?? n(F)
|
|
203
206
|
}];
|
|
204
207
|
}
|
|
205
|
-
const [
|
|
206
|
-
return Object.values((
|
|
208
|
+
const [s] = l.data;
|
|
209
|
+
return Object.values((s == null ? void 0 : s.errors) ?? {}).map((m) => ({
|
|
207
210
|
rule: o.LiquidSyntax,
|
|
208
211
|
type: r.Warning,
|
|
209
212
|
message: m.replace(/^line \d+:\s*/, "")
|
|
210
213
|
}));
|
|
211
|
-
} catch
|
|
212
|
-
if (s != null && s.authReported)
|
|
213
|
-
throw s;
|
|
214
|
+
} catch {
|
|
214
215
|
return [{
|
|
215
216
|
rule: o.LiquidSyntax,
|
|
216
217
|
type: r.Error,
|
|
217
|
-
message: n(
|
|
218
|
+
message: n(F)
|
|
218
219
|
}];
|
|
219
220
|
}
|
|
220
|
-
},
|
|
221
|
-
const e = Object.values(y.blockStates).map((
|
|
222
|
-
const m =
|
|
221
|
+
}, D = () => {
|
|
222
|
+
const e = Object.values(y.blockStates).map((s) => G(s.recommendationConfigs, y)).filter((s) => s.length > 0).map((s) => {
|
|
223
|
+
const m = s.every((p) => p === q);
|
|
223
224
|
return {
|
|
224
225
|
rule: o.RecommendationRequiredFields,
|
|
225
226
|
type: m ? r.Warning : r.Error,
|
|
226
|
-
key: m ?
|
|
227
|
+
key: m ? H : V
|
|
227
228
|
};
|
|
228
|
-
}),
|
|
229
|
+
}), l = (f.recommendationConfigs ?? []).filter((s) => s.filters.some((m) => m.value === "")).map(() => ({
|
|
229
230
|
rule: o.RecommendationFilters,
|
|
230
231
|
type: r.Error,
|
|
231
|
-
key:
|
|
232
|
+
key: _e
|
|
232
233
|
}));
|
|
233
|
-
return [...e, ...
|
|
234
|
-
},
|
|
234
|
+
return [...e, ...l];
|
|
235
|
+
}, K = async (e, l) => {
|
|
235
236
|
var C, h;
|
|
236
|
-
const
|
|
237
|
-
...
|
|
238
|
-
...
|
|
237
|
+
const s = [
|
|
238
|
+
...l.map((w) => w.value),
|
|
239
|
+
...U,
|
|
239
240
|
...((h = (C = t.value) == null ? void 0 : C.template) == null ? void 0 : h.customFieldAttributes) ?? []
|
|
240
|
-
], m =
|
|
241
|
+
], m = B(e), p = await b(m), { isTransactional: _ } = L;
|
|
241
242
|
return [
|
|
242
|
-
...await
|
|
243
|
-
...
|
|
243
|
+
...await A(e),
|
|
244
|
+
..._ ? [] : De(e, s),
|
|
244
245
|
...Ke(e),
|
|
245
246
|
...we(e),
|
|
246
247
|
...Be(e),
|
|
247
|
-
...
|
|
248
|
+
..._ ? [] : Ye(e, s, m, p),
|
|
248
249
|
...xe(e),
|
|
249
250
|
...Me(e),
|
|
250
251
|
...Ue(e),
|
|
251
|
-
...
|
|
252
|
+
...D(),
|
|
252
253
|
...Pe(e),
|
|
253
254
|
...O(
|
|
254
255
|
e,
|
|
255
|
-
|
|
256
|
+
M,
|
|
256
257
|
o.CheckboxUnsubGroup,
|
|
257
|
-
|
|
258
|
+
he
|
|
258
259
|
),
|
|
259
260
|
...O(
|
|
260
261
|
e,
|
|
261
|
-
|
|
262
|
+
P,
|
|
262
263
|
o.RadioButtonUnsubGroup,
|
|
263
|
-
|
|
264
|
+
ke
|
|
264
265
|
)
|
|
265
266
|
];
|
|
266
|
-
},
|
|
267
|
+
}, S = async (e, l) => [
|
|
267
268
|
...be(e),
|
|
268
269
|
...Ae(e),
|
|
269
270
|
...ve(e),
|
|
270
|
-
...i("liquidSyntax") ? await
|
|
271
|
-
].map(
|
|
272
|
-
return { collectSaveValidationErrors:
|
|
273
|
-
const { html: e } = await
|
|
274
|
-
await
|
|
275
|
-
const { html:
|
|
276
|
-
return
|
|
271
|
+
...i("liquidSyntax") ? await v(e) : await K(e, l)
|
|
272
|
+
].map(N);
|
|
273
|
+
return { collectSaveValidationErrors: S, validateCurrentTemplate: async () => {
|
|
274
|
+
const { html: e } = await a();
|
|
275
|
+
await E(e);
|
|
276
|
+
const { html: l } = await u({ minimize: !0, resetDataSavedFlag: !1 }), { compiledHtml: s } = d(l);
|
|
277
|
+
return S(s, g.getSelectedDynamicContentList);
|
|
277
278
|
} };
|
|
278
279
|
};
|
|
279
280
|
export {
|
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const t = s();
|
|
7
|
-
return { isEnabled: a(() => t.isEmailAutoSaveEnabled), loadRollout: () => t.isLoaded ? Promise.resolve() : (o ?? (o = l().getSetupSettings().then(({ isEmailAutoSaveEnabled: e }) => {
|
|
8
|
-
t.$patch({
|
|
9
|
-
isEmailAutoSaveEnabled: !!Number(e ?? 0),
|
|
10
|
-
isLoaded: !0
|
|
11
|
-
});
|
|
12
|
-
}).catch((e) => {
|
|
13
|
-
console.warn("Failed to load setup settings; soft-save stays off.", e);
|
|
14
|
-
}).finally(() => {
|
|
15
|
-
o = null;
|
|
16
|
-
})), o) };
|
|
1
|
+
import { useConfigStore as t } from "../stores/config.js";
|
|
2
|
+
import { computed as o } from "vue";
|
|
3
|
+
const n = ["newsletteruatcamp", "newsletterqacamp"], c = () => {
|
|
4
|
+
const e = t();
|
|
5
|
+
return { isEnabled: o(() => n.includes(e.partnerName)) };
|
|
17
6
|
};
|
|
18
7
|
export {
|
|
19
|
-
|
|
8
|
+
c as useSaveValidationRollout
|
|
20
9
|
};
|
|
@@ -31,13 +31,13 @@ const he = () => {
|
|
|
31
31
|
n = null;
|
|
32
32
|
}), n), D = async (r, s, o, a = [], i = !1) => {
|
|
33
33
|
var y, E, h, C;
|
|
34
|
-
const e = k(), { html: d, css:
|
|
34
|
+
const e = k(), { html: d, css: R } = r, { baseBlocks: g, extensions: P } = await V(), S = ((y = c.value) == null ? void 0 : y.displayConditions) ?? !0, U = ((E = c.value) == null ? void 0 : E.modulesDisabled) ?? !1, I = !!d || (((h = u.value) == null ? void 0 : h.forceRecreate) ?? !1), q = "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com";
|
|
35
35
|
w().importCss(), await window.UIEditor.initEditor(
|
|
36
36
|
document.querySelector("#guido-editor"),
|
|
37
37
|
{
|
|
38
38
|
metadata: s,
|
|
39
39
|
html: d,
|
|
40
|
-
css:
|
|
40
|
+
css: R,
|
|
41
41
|
forceRecreate: I,
|
|
42
42
|
locale: "en",
|
|
43
43
|
undoButtonSelector: "#guido__undo-button",
|
|
@@ -60,7 +60,6 @@ const he = () => {
|
|
|
60
60
|
keepModuleStylesEnabled: !0,
|
|
61
61
|
displayTitle: !1,
|
|
62
62
|
displayUTM: !1,
|
|
63
|
-
copyPasteEnabled: !1,
|
|
64
63
|
selectElementAfterDrop: !0,
|
|
65
64
|
sameFontSizeForOutlook: !0,
|
|
66
65
|
allowedScriptSourceDomains: q,
|
|
@@ -121,7 +120,7 @@ const he = () => {
|
|
|
121
120
|
".in-modal-v2-wrapper",
|
|
122
121
|
".in-toasts-wrapper"
|
|
123
122
|
],
|
|
124
|
-
extensions:
|
|
123
|
+
extensions: P,
|
|
125
124
|
localePatch: J
|
|
126
125
|
}
|
|
127
126
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var k = Object.defineProperty;
|
|
2
|
-
var S = (d, l,
|
|
3
|
-
var g = (d, l,
|
|
2
|
+
var S = (d, l, e) => l in d ? k(d, l, { enumerable: !0, configurable: !0, writable: !0, value: e }) : d[l] = e;
|
|
3
|
+
var g = (d, l, e) => S(d, typeof l != "symbol" ? l + "" : l, e);
|
|
4
4
|
import { BlockId as D } from "../../../enums/block.js";
|
|
5
5
|
import { useOnboardingStore as T } from "../../../stores/onboarding.js";
|
|
6
6
|
import { getMigrationBannerHtml as N } from "../../../utils/migrationBannerHtml.js";
|
|
@@ -58,15 +58,15 @@ class $ extends H {
|
|
|
58
58
|
canBeSavedAsModule() {
|
|
59
59
|
return !0;
|
|
60
60
|
}
|
|
61
|
-
onCreated(
|
|
62
|
-
const
|
|
63
|
-
c.querySelector('[product-attr="imageSrc"] img') ||
|
|
64
|
-
const r = _(
|
|
61
|
+
onCreated(e) {
|
|
62
|
+
const t = this.api.getDocumentModifier(), c = this.api.getDocumentRootCssNode();
|
|
63
|
+
c.querySelector('[product-attr="imageSrc"] img') || t.modifyCss(c).appendRule('[product-attr="imageSrc"] img {object-fit: contain;}');
|
|
64
|
+
const r = _(e);
|
|
65
65
|
if (!r)
|
|
66
66
|
return;
|
|
67
|
-
const o = r.getNodeConfig(),
|
|
67
|
+
const o = r.getNodeConfig(), s = o && Object.keys(o).length > 0, i = C(e);
|
|
68
68
|
if (i != null && i.initialized) {
|
|
69
|
-
if (!
|
|
69
|
+
if (!s) {
|
|
70
70
|
const a = this.api.getDocumentModifier();
|
|
71
71
|
a.modifyHtml(r).setNodeConfig(i), this._stampProductTdDomAttributes(r, i, a), this._healCollapsedWidths(r, a), this._shouldReconcileCurrency(i) && this._reconcileCurrencyDomAttributes(r, i, a), a.apply(new u("Migrate legacy config to nodeConfig")), this._markCurrencyHealed(i.blockInstanceId);
|
|
72
72
|
return;
|
|
@@ -76,9 +76,9 @@ class $ extends H {
|
|
|
76
76
|
I.modifyHtml(r).setNodeConfig(a), this._stampProductTdDomAttributes(r, a, I, !0), I.apply(new u("Initialize Items block with default configuration")), T().startOnboarding("itemsOnboarding");
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
|
-
const
|
|
79
|
+
const n = this._resolveInstanceId(i.blockInstanceId), f = this.api.getDocumentModifier();
|
|
80
80
|
let h = !1;
|
|
81
|
-
|
|
81
|
+
n !== i.blockInstanceId && (f.modifyHtml(r).setNodeConfig({ ...i, blockInstanceId: n }), h = !0), !this._currencyHealed.has(n) && this._reconcileCurrencyDomAttributes(r, i, f) && (h = !0), this._healCollapsedWidths(r, f) && (h = !0), h && f.apply(new u("Assign Items block instance ID and reconcile currency")), this._markCurrencyHealed(n);
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
84
|
* Re-seeds nodeConfig from the persisted esd-ext-config when a saved module
|
|
@@ -86,24 +86,24 @@ class $ extends H {
|
|
|
86
86
|
* into nodeConfig, so without this a reused module would reset to defaults.
|
|
87
87
|
* Guarded to the nodeConfig-empty case so it runs once and never loops.
|
|
88
88
|
*/
|
|
89
|
-
onDocumentChanged(
|
|
90
|
-
const
|
|
91
|
-
if (!
|
|
89
|
+
onDocumentChanged(e) {
|
|
90
|
+
const t = _(e);
|
|
91
|
+
if (!t)
|
|
92
92
|
return;
|
|
93
|
-
const c =
|
|
93
|
+
const c = t.getNodeConfig();
|
|
94
94
|
if (c && Object.keys(c).length > 0) {
|
|
95
|
-
const i = C(
|
|
95
|
+
const i = C(e);
|
|
96
96
|
if (i != null && i.initialized && this._shouldReconcileCurrency(i)) {
|
|
97
|
-
const
|
|
98
|
-
this._reconcileCurrencyDomAttributes(
|
|
97
|
+
const n = this.api.getDocumentModifier();
|
|
98
|
+
this._reconcileCurrencyDomAttributes(t, i, n) && n.apply(new u(V)), this._markCurrencyHealed(i.blockInstanceId);
|
|
99
99
|
}
|
|
100
100
|
return;
|
|
101
101
|
}
|
|
102
|
-
const o = C(
|
|
102
|
+
const o = C(e);
|
|
103
103
|
if (!(o != null && o.initialized))
|
|
104
104
|
return;
|
|
105
|
-
const
|
|
106
|
-
|
|
105
|
+
const s = this.api.getDocumentModifier();
|
|
106
|
+
s.modifyHtml(t).setNodeConfig(o), this._stampProductTdDomAttributes(t, o, s), this._healCollapsedWidths(t, s), this._shouldReconcileCurrency(o) && this._reconcileCurrencyDomAttributes(t, o, s), s.apply(new u("Recover Items block config from saved module")), this._markCurrencyHealed(o.blockInstanceId);
|
|
107
107
|
}
|
|
108
108
|
/**
|
|
109
109
|
* Bakes the compiler-read DOM attributes (`data-type`, `data-number`, `data-nodup`) onto the
|
|
@@ -113,21 +113,20 @@ class $ extends H {
|
|
|
113
113
|
* restored before export. The name `<a>` carries no data-type/data-number of its own and
|
|
114
114
|
* relies on this td-level fallback in pairProductVariables.
|
|
115
115
|
*/
|
|
116
|
-
_stampProductTdDomAttributes(
|
|
117
|
-
const o = B(
|
|
118
|
-
r &&
|
|
116
|
+
_stampProductTdDomAttributes(e, t, c, r = !1) {
|
|
117
|
+
const o = B(t.itemsSelectValue, t.type), s = (i, n) => {
|
|
118
|
+
r && e.getAttribute(i) || c.modifyHtml(e).setAttribute(i, n);
|
|
119
119
|
};
|
|
120
|
-
|
|
120
|
+
s("data-type", t.type), s("data-number", o), s("data-nodup", String(t.priceHideDiscount));
|
|
121
121
|
}
|
|
122
122
|
/**
|
|
123
123
|
* Repairs a saved module's collapsed card into the state the load migrator produces. Acts only
|
|
124
124
|
* on a zero width, so Stripo's non-zero drop-time width never triggers it and a healed block no-ops.
|
|
125
125
|
*/
|
|
126
|
-
_healCollapsedWidths(
|
|
127
|
-
const r =
|
|
128
|
-
return !m(
|
|
129
|
-
|
|
130
|
-
(n === null || m(n)) && e.modifyHtml(o).setAttribute("width", "100%"), m(o.getStyle("width")) && e.modifyHtml(o).setStyle("width", "100%");
|
|
126
|
+
_healCollapsedWidths(e, t) {
|
|
127
|
+
const r = e.querySelectorAll(M).filter((o) => m(o.getAttribute("width")) || m(o.getStyle("width")));
|
|
128
|
+
return !m(e.getAttribute("width")) && !r.length ? !1 : (e.hasClass("esd-container-frame") && t.modifyHtml(e).removeClass("esd-container-frame"), e.getAttribute("width") !== null && t.modifyHtml(e).removeAttribute("width"), r.forEach((o) => {
|
|
129
|
+
m(o.getAttribute("width")) && t.modifyHtml(o).setAttribute("width", "100%"), m(o.getStyle("width")) && t.modifyHtml(o).setStyle("width", "100%");
|
|
131
130
|
}), !0);
|
|
132
131
|
}
|
|
133
132
|
/**
|
|
@@ -138,12 +137,12 @@ class $ extends H {
|
|
|
138
137
|
* the symbol write alone is skipped for the 'USD' sentinel — so we must NOT gate the whole pass
|
|
139
138
|
* on symbol customization here, or a default-symbol block with a toggled location never heals.
|
|
140
139
|
*/
|
|
141
|
-
_shouldReconcileCurrency(
|
|
142
|
-
return !
|
|
140
|
+
_shouldReconcileCurrency(e) {
|
|
141
|
+
return !e.blockInstanceId || !this._currencyHealed.has(e.blockInstanceId);
|
|
143
142
|
}
|
|
144
143
|
/** Marks a block instance's currency as reconciled so it is not healed again (undo-safe). */
|
|
145
|
-
_markCurrencyHealed(
|
|
146
|
-
|
|
144
|
+
_markCurrencyHealed(e) {
|
|
145
|
+
e && this._currencyHealed.add(e);
|
|
147
146
|
}
|
|
148
147
|
/**
|
|
149
148
|
* Resolves the id for a just-created block to one that is unique per live instance.
|
|
@@ -152,13 +151,13 @@ class $ extends H {
|
|
|
152
151
|
* currency heal guard and settings-panel switch detection. Mint a fresh id on absence
|
|
153
152
|
* or collision, otherwise keep the existing one. Registers the result as claimed.
|
|
154
153
|
*/
|
|
155
|
-
_resolveInstanceId(
|
|
156
|
-
let
|
|
157
|
-
if (!
|
|
154
|
+
_resolveInstanceId(e) {
|
|
155
|
+
let t = e;
|
|
156
|
+
if (!t || this._seenInstanceIds.has(t))
|
|
158
157
|
do
|
|
159
|
-
|
|
160
|
-
while (this._seenInstanceIds.has(
|
|
161
|
-
return this._seenInstanceIds.add(
|
|
158
|
+
t = P();
|
|
159
|
+
while (this._seenInstanceIds.has(t));
|
|
160
|
+
return this._seenInstanceIds.add(t), t;
|
|
162
161
|
}
|
|
163
162
|
/**
|
|
164
163
|
* Stamps the export-read currency attrs onto every price `<p>` from config, so a template whose
|
|
@@ -171,11 +170,11 @@ class $ extends H {
|
|
|
171
170
|
* Returns true only when an attr actually changed, so the caller can skip an empty apply that
|
|
172
171
|
* would otherwise re-trigger onDocumentChanged and loop.
|
|
173
172
|
*/
|
|
174
|
-
_reconcileCurrencyDomAttributes(
|
|
175
|
-
const { position: r, symbol: o } = w(
|
|
173
|
+
_reconcileCurrencyDomAttributes(e, t, c) {
|
|
174
|
+
const { position: r, symbol: o } = w(t), s = e.querySelectorAll(`.${E.PRICE} p`);
|
|
176
175
|
let i = !1;
|
|
177
|
-
return
|
|
178
|
-
r !== void 0 &&
|
|
176
|
+
return s.forEach((n) => {
|
|
177
|
+
r !== void 0 && n.getAttribute(y.POSITION) !== r && (c.modifyHtml(n).setAttribute(y.POSITION, r), i = !0), o !== void 0 && n.getAttribute(y.SYMBOL) !== o && (c.modifyHtml(n).setAttribute(y.SYMBOL, o), i = !0);
|
|
179
178
|
}), i;
|
|
180
179
|
}
|
|
181
180
|
}
|