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