@useinsider/guido 3.15.1-beta.6da4177 → 3.16.0-beta.20cd2fe
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/@types/config/schemas.js +118 -100
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +78 -75
- package/dist/components/organisms/header/AutoSaveStatus.vue.js +17 -0
- package/dist/components/organisms/header/AutoSaveStatus.vue2.js +21 -0
- package/dist/components/organisms/header/EditorActions.vue.js +11 -11
- package/dist/components/organisms/header/EditorActions.vue2.js +34 -50
- package/dist/components/organisms/header/EditorActionsMenu.vue.js +20 -0
- package/dist/components/organisms/header/EditorActionsMenu.vue2.js +39 -0
- package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue2.js +28 -23
- package/dist/components/organisms/header/MiddleSlot.vue.js +4 -4
- package/dist/components/organisms/header/MiddleSlot.vue2.js +8 -7
- package/dist/components/organisms/header/RightSlot.vue.js +6 -6
- package/dist/components/organisms/header/RightSlot.vue2.js +17 -15
- package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue.js +18 -0
- package/dist/components/organisms/header/accessibility/AccessibilityToolbar.vue2.js +37 -0
- package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue.js +24 -0
- package/dist/components/organisms/header/accessibility/ColorVisionSelect.vue2.js +48 -0
- package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue.js +18 -0
- package/dist/components/organisms/onboarding/EditorTabBarOnboarding.vue2.js +74 -0
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +43 -34
- package/dist/composables/useAccessibilityApi.js +31 -0
- package/dist/composables/useActionsApi.js +30 -22
- package/dist/composables/useEmailTemplateApplier.js +25 -23
- package/dist/composables/useHtmlValidator.js +85 -83
- package/dist/composables/useTimerClone.js +21 -19
- package/dist/config/i18n/en/labels.json.js +28 -4
- package/dist/config/migrator/checkboxMigrator.js +20 -19
- package/dist/config/migrator/radioButtonMigrator.js +26 -25
- package/dist/extensions/Blocks/Checkbox/constants/controlIds.js +4 -0
- package/dist/extensions/Blocks/Checkbox/constants/selectors.js +6 -0
- package/dist/extensions/Blocks/Checkbox/controls/blockBackground/index.js +10 -0
- package/dist/extensions/Blocks/Checkbox/extension.js +6 -5
- package/dist/extensions/Blocks/Checkbox/settingsPanel.js +15 -14
- package/dist/extensions/Blocks/Checkbox/template.js +10 -9
- package/dist/extensions/Blocks/Items/block.js +44 -42
- package/dist/extensions/Blocks/Items/template.js +86 -86
- package/dist/extensions/Blocks/RadioButton/constants/controlIds.js +4 -0
- package/dist/extensions/Blocks/RadioButton/constants/selectors.js +6 -0
- package/dist/extensions/Blocks/RadioButton/controls/blockBackground/index.js +10 -0
- package/dist/extensions/Blocks/RadioButton/extension.js +5 -4
- package/dist/extensions/Blocks/RadioButton/settingsPanel.js +12 -11
- package/dist/extensions/Blocks/RadioButton/template.js +16 -9
- package/dist/extensions/Blocks/Recommendation/controls/cardBackground/index.js +5 -9
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +98 -113
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +21 -0
- package/dist/extensions/Blocks/controlFactories.js +117 -115
- package/dist/guido.css +1 -1
- package/dist/library.js +11 -7
- package/dist/node_modules/@vueuse/core/index.js +102 -0
- package/dist/node_modules/@vueuse/shared/index.js +40 -28
- package/dist/node_modules/valibot/dist/index.js +230 -216
- package/dist/public/trackingIds.js +8 -0
- package/dist/src/@types/config/schemas.d.ts +24 -0
- package/dist/src/components/organisms/header/EditorActionsMenu.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/accessibility/AccessibilityToolbar.vue.d.ts +2 -0
- package/dist/src/components/organisms/header/accessibility/ColorVisionSelect.vue.d.ts +2 -0
- package/dist/src/components/organisms/onboarding/EditorTabBarOnboarding.vue.d.ts +2 -0
- package/dist/src/composables/useAccessibilityApi.d.ts +15 -0
- package/dist/src/composables/useActionsApi.d.ts +3 -3
- package/dist/src/composables/useConfig.d.ts +6 -0
- package/dist/src/extensions/Blocks/Checkbox/constants/controlIds.d.ts +7 -0
- package/dist/src/extensions/Blocks/Checkbox/constants/index.d.ts +10 -0
- package/dist/src/extensions/Blocks/Checkbox/constants/selectors.d.ts +16 -0
- package/dist/src/extensions/Blocks/Checkbox/controls/blockBackground/index.d.ts +14 -0
- package/dist/src/extensions/Blocks/RadioButton/constants/controlIds.d.ts +7 -0
- package/dist/src/extensions/Blocks/RadioButton/constants/index.d.ts +10 -0
- package/dist/src/extensions/Blocks/RadioButton/constants/selectors.d.ts +16 -0
- package/dist/src/extensions/Blocks/RadioButton/controls/blockBackground/index.d.ts +14 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/spacing/index.d.ts +5 -0
- package/dist/src/extensions/Blocks/_Boilerplate/constants/controlIds.d.ts +7 -0
- package/dist/src/extensions/Blocks/_Boilerplate/constants/index.d.ts +10 -0
- package/dist/src/extensions/Blocks/_Boilerplate/constants/selectors.d.ts +16 -0
- package/dist/src/extensions/Blocks/_Boilerplate/controls/blockBackground/index.d.ts +14 -0
- package/dist/src/library.d.ts +1 -0
- package/dist/src/public/trackingIds.d.ts +9 -0
- package/dist/src/stores/config.d.ts +54 -0
- package/dist/src/stores/editor.d.ts +132 -0
- package/dist/src/stores/onboarding.d.ts +377 -0
- package/dist/src/stores/version-history.d.ts +1 -1
- package/dist/src/utils/linkTrackingIds.d.ts +30 -0
- package/dist/src/utils/timeUtil.d.ts +10 -0
- package/dist/stores/editor.js +9 -2
- package/dist/stores/onboarding.js +23 -14
- package/dist/utils/linkTrackingIds.js +56 -0
- package/dist/utils/pairProductVariables.js +105 -99
- package/dist/utils/templatePreparation.js +72 -61
- package/dist/utils/timeUtil.js +6 -17
- package/package.json +5 -1
- package/dist/components/organisms/header/AutoSaveToggle.vue.js +0 -22
- package/dist/components/organisms/header/AutoSaveToggle.vue2.js +0 -19
- /package/dist/src/components/organisms/header/{AutoSaveToggle.vue.d.ts → AutoSaveStatus.vue.d.ts} +0 -0
|
@@ -1,64 +1,66 @@
|
|
|
1
1
|
import { useConfig as V } from "./useConfig.js";
|
|
2
2
|
import { getIgnoredRecommendationBlockIds as M } from "../config/compiler/utils/recommendationIgnoreUtils.js";
|
|
3
3
|
import { TemplateTypes as W } from "../enums/defaults.js";
|
|
4
|
-
import { DISPLAY_CONDITIONS_REGEX as G, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as H, CampaignCouldNotBeSavedKey as P, CanNotMakeAnyChangesForRunningKey as X, DATA_ATTRIBUTE_REGEX as $, DYNAMIC_CONTENT_TAG_REGEX as
|
|
4
|
+
import { DISPLAY_CONDITIONS_REGEX as G, DISPLAY_CONDITIONS_EXCEPTIONS_REGEX as H, CampaignCouldNotBeSavedKey as P, CanNotMakeAnyChangesForRunningKey as X, DATA_ATTRIBUTE_REGEX as $, DYNAMIC_CONTENT_TAG_REGEX as K, ALLOWED_DYNAMIC_SYSTEM_TOKENS as Y, VALID_DYNAMIC_VARIABLE_REGEX as U } from "../enums/html-validator.js";
|
|
5
5
|
import { ToasterTypeOptions as c } from "../enums/toaster.js";
|
|
6
|
+
import { BLOCK_ROOT_SELECTOR as j } from "../extensions/Blocks/Checkbox/constants/selectors.js";
|
|
6
7
|
import { itemsBlockDynamicVariables as q } from "../extensions/Blocks/Items/enums/productEnums.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
8
|
+
import { BLOCK_ROOT_SELECTOR as z } from "../extensions/Blocks/RadioButton/constants/selectors.js";
|
|
9
|
+
import { RECOMMENDATION_VARIABLE_BUILTIN_ATTRIBUTES as Z } from "../extensions/Blocks/Recommendation/constants/selectors.js";
|
|
10
|
+
import { useRecommendationExtensionStore as J } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
11
|
+
import { filterToProductAttrValue as Q } from "../extensions/Blocks/Recommendation/utils/compositionKeys.js";
|
|
12
|
+
import { RecommendationRequiredFieldsKey as ee } from "../extensions/Blocks/Recommendation/validation/requiredFields.js";
|
|
13
|
+
import { useRecommendationStore as te } from "../stores/recommendation.js";
|
|
14
|
+
import { base64EncodeWithSpecialChars as ne } from "../utils/base64.js";
|
|
15
|
+
import { computed as se } from "vue";
|
|
16
|
+
import { useHttp as re } from "./useHttp.js";
|
|
17
|
+
import { useToaster as oe } from "./useToaster.js";
|
|
18
|
+
import { useTranslations as ie } from "./useTranslations.js";
|
|
19
|
+
const ae = /recommendation-id="(\d+)"/g;
|
|
20
|
+
function ce(s) {
|
|
21
|
+
return [...s.matchAll(ae)].map((l) => l[1]);
|
|
20
22
|
}
|
|
21
|
-
function
|
|
22
|
-
return
|
|
23
|
+
function me(s, l) {
|
|
24
|
+
return l.some((f) => s.startsWith(`${f}_`));
|
|
23
25
|
}
|
|
24
|
-
const
|
|
25
|
-
function
|
|
26
|
-
const
|
|
27
|
-
return
|
|
26
|
+
const le = /^(\d+)_\d+_(.+)$/;
|
|
27
|
+
function ue(s) {
|
|
28
|
+
const l = s.match(le);
|
|
29
|
+
return l ? { recoId: l[1], attribute: l[2] } : null;
|
|
28
30
|
}
|
|
29
|
-
function
|
|
30
|
-
const
|
|
31
|
+
function de(s) {
|
|
32
|
+
const l = new Set(Z);
|
|
31
33
|
return Object.values(s).forEach((f) => {
|
|
32
|
-
|
|
33
|
-
}),
|
|
34
|
+
l.add(Q(f).toLowerCase());
|
|
35
|
+
}), l;
|
|
34
36
|
}
|
|
35
|
-
function
|
|
37
|
+
function fe(s, l, f, o, d) {
|
|
36
38
|
const u = s.match(/{{([a-zA-Z0-9_.\s]*)}}/gm);
|
|
37
39
|
if (!u)
|
|
38
40
|
return [];
|
|
39
|
-
const g = new Set(
|
|
40
|
-
return u.forEach((
|
|
41
|
-
const p =
|
|
41
|
+
const g = new Set(l.map((C) => C.toLowerCase())), E = [];
|
|
42
|
+
return u.forEach((C) => {
|
|
43
|
+
const p = C.slice(2, -2).trim().toLowerCase();
|
|
42
44
|
if (p !== "" && g.has(p))
|
|
43
45
|
return;
|
|
44
|
-
const
|
|
45
|
-
if (
|
|
46
|
-
if (!d || d.has(
|
|
46
|
+
const h = ue(p);
|
|
47
|
+
if (h && o.has(h.recoId)) {
|
|
48
|
+
if (!d || d.has(h.attribute))
|
|
47
49
|
return;
|
|
48
50
|
E.push(p);
|
|
49
51
|
return;
|
|
50
52
|
}
|
|
51
|
-
|
|
53
|
+
me(p, f) || p.includes(".") || E.push(p);
|
|
52
54
|
}), E;
|
|
53
55
|
}
|
|
54
|
-
function
|
|
55
|
-
return (s.replace($, "$1").match(
|
|
56
|
+
function pe(s) {
|
|
57
|
+
return (s.replace($, "$1").match(K) ?? []).filter((o) => {
|
|
56
58
|
const d = o.slice(2, -2), u = d.indexOf("|"), g = (u === -1 ? d : d.slice(0, u)).trim();
|
|
57
|
-
return
|
|
59
|
+
return Y.includes(g) ? !1 : U.test(g) ? u !== -1 && d.slice(u + 1).trim() === "" : !0;
|
|
58
60
|
});
|
|
59
61
|
}
|
|
60
|
-
const
|
|
61
|
-
const { showToaster: s } =
|
|
62
|
+
const De = () => {
|
|
63
|
+
const { showToaster: s } = oe(), { post: l } = re(), { config: f } = V(), o = ie(), d = te(), u = J(), g = se(
|
|
62
64
|
() => {
|
|
63
65
|
var e, t;
|
|
64
66
|
return ((t = (e = f.value) == null ? void 0 : e.partner) == null ? void 0 : t.messageType) === W.transactional;
|
|
@@ -71,11 +73,11 @@ const xe = () => {
|
|
|
71
73
|
} catch {
|
|
72
74
|
return null;
|
|
73
75
|
}
|
|
74
|
-
return
|
|
75
|
-
},
|
|
76
|
-
const n = await
|
|
76
|
+
return de(u.filterList);
|
|
77
|
+
}, C = async (e) => {
|
|
78
|
+
const n = await l(
|
|
77
79
|
"/newsletter/template-library/check-template-html-body",
|
|
78
|
-
{ html:
|
|
80
|
+
{ html: ne(e) }
|
|
79
81
|
), { status: r, message: a } = n.data;
|
|
80
82
|
return r || s({
|
|
81
83
|
type: c.Error,
|
|
@@ -84,26 +86,26 @@ const xe = () => {
|
|
|
84
86
|
type: c.Error,
|
|
85
87
|
message: o("newsletter.already-in-progress")
|
|
86
88
|
}), r;
|
|
87
|
-
}, p = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()),
|
|
89
|
+
}, p = (e) => !["if", "endif", "else", "elif", "now"].includes(e.toLowerCase()), h = (e) => ["if", "endif"].includes(e.toLowerCase()), T = (e, t) => {
|
|
88
90
|
const n = e.match(/({%(.*?)%})/g);
|
|
89
91
|
let r = !0;
|
|
90
92
|
return n !== null && !g.value && n.forEach((a) => {
|
|
91
93
|
const i = a.slice(2, -2).trim().match(/(".*?"|[^"\s]+)(?=\s*|\s*$)/g);
|
|
92
94
|
if (i && i.length > 0) {
|
|
93
|
-
const [
|
|
94
|
-
p(
|
|
95
|
+
const [m] = i;
|
|
96
|
+
p(m) && !t.includes(m) && (s({
|
|
95
97
|
type: c.Warning,
|
|
96
98
|
message: o("custom-fields.invalid-custom-fields")
|
|
97
99
|
}), r = !1);
|
|
98
100
|
}
|
|
99
101
|
}), r;
|
|
100
|
-
},
|
|
101
|
-
const r = n ? await
|
|
102
|
-
return
|
|
103
|
-
},
|
|
102
|
+
}, R = async (e, t, n) => {
|
|
103
|
+
const r = n ? await C(e) : !0;
|
|
104
|
+
return T(e, t) && r;
|
|
105
|
+
}, b = (e) => e.length > 0 ? !0 : (s({
|
|
104
106
|
type: c.Warning,
|
|
105
107
|
message: o("newsletter.html-content-is-empty")
|
|
106
|
-
}), !1),
|
|
108
|
+
}), !1), A = (e) => {
|
|
107
109
|
const t = (e.match(/{/gm) || []).length, n = (e.match(/}/gm) || []).length;
|
|
108
110
|
return t > n && s({
|
|
109
111
|
type: c.Warning,
|
|
@@ -112,26 +114,26 @@ const xe = () => {
|
|
|
112
114
|
type: c.Warning,
|
|
113
115
|
message: o("custom-fields.missing-opening-braces")
|
|
114
116
|
}), t === n;
|
|
115
|
-
},
|
|
116
|
-
const t =
|
|
117
|
+
}, _ = (e) => {
|
|
118
|
+
const t = pe(e).length === 0;
|
|
117
119
|
return t || s({
|
|
118
120
|
type: c.Warning,
|
|
119
121
|
message: o("custom-fields.invalid-custom-fields")
|
|
120
122
|
}), t;
|
|
121
|
-
},
|
|
123
|
+
}, O = (e, t, n, r) => {
|
|
122
124
|
if (g.value)
|
|
123
125
|
return !0;
|
|
124
|
-
const a =
|
|
126
|
+
const a = fe(
|
|
125
127
|
e,
|
|
126
128
|
t,
|
|
127
|
-
|
|
129
|
+
ce(e),
|
|
128
130
|
n,
|
|
129
131
|
r
|
|
130
132
|
);
|
|
131
133
|
if (a.length > 0) {
|
|
132
134
|
const i = `
|
|
133
135
|
<ul>
|
|
134
|
-
${a.map((
|
|
136
|
+
${a.map((m) => `<li>${m}</li>`).join("")}
|
|
135
137
|
</ul>
|
|
136
138
|
`;
|
|
137
139
|
return s({
|
|
@@ -140,45 +142,45 @@ const xe = () => {
|
|
|
140
142
|
}), !1;
|
|
141
143
|
}
|
|
142
144
|
return !0;
|
|
143
|
-
},
|
|
145
|
+
}, w = (e) => {
|
|
144
146
|
const t = e.match(/{%(.*?)%}/g), n = [];
|
|
145
147
|
let r = !0;
|
|
146
148
|
if (t && t.forEach((a) => {
|
|
147
|
-
const i = a.match(G),
|
|
148
|
-
(!i || a !==
|
|
149
|
+
const i = a.match(G), m = a.match(H), v = (i == null ? void 0 : i.join("")) || "";
|
|
150
|
+
(!i || a !== v) && !m && (s({
|
|
149
151
|
type: c.Error,
|
|
150
152
|
message: o("newsletter.display-conditions-invalid-syntax")
|
|
151
|
-
}), r = !1), i && i.forEach((
|
|
152
|
-
|
|
153
|
+
}), r = !1), i && i.forEach((y) => {
|
|
154
|
+
y.trim() === "=" && (s({
|
|
153
155
|
type: c.Error,
|
|
154
156
|
message: o("custom-conditions.wrong-equality-operators")
|
|
155
157
|
}), r = !1);
|
|
156
|
-
const I =
|
|
157
|
-
I && I.forEach((
|
|
158
|
-
|
|
158
|
+
const I = y.match(/^[a-zA-Z]*$/g);
|
|
159
|
+
I && I.forEach((S) => {
|
|
160
|
+
h(S) && n.push(S);
|
|
159
161
|
});
|
|
160
162
|
});
|
|
161
163
|
}), n.length) {
|
|
162
|
-
const a = n.filter((
|
|
164
|
+
const a = n.filter((m) => m === "if"), i = n.filter((m) => m === "endif");
|
|
163
165
|
a.length !== i.length && (s({
|
|
164
166
|
type: c.Error,
|
|
165
167
|
message: o("custom-conditions.missing-if-endif-tag")
|
|
166
168
|
}), r = !1);
|
|
167
169
|
}
|
|
168
170
|
return r;
|
|
169
|
-
},
|
|
171
|
+
}, L = (e) => {
|
|
170
172
|
const t = (e.match(/{% /gm) || []).length, n = (e.match(/ %}/gm) || []).length, r = t === n;
|
|
171
173
|
return r || s({
|
|
172
174
|
type: c.Warning,
|
|
173
175
|
message: o("custom-conditions.no-space-after-braces")
|
|
174
176
|
}), r;
|
|
175
|
-
},
|
|
177
|
+
}, N = (e) => (e.match(/({%(.*?)%})/g) || []).filter((n) => n.includes("if")).map((n) => (n.match(/{{.*}}/gm) || []).length).reduce((n, r) => n + r, 0) > 0 ? (s({
|
|
176
178
|
type: c.Warning,
|
|
177
179
|
message: o("custom-conditions.no-braces-inside-if-tag")
|
|
178
|
-
}), !1) : !0,
|
|
180
|
+
}), !1) : !0, B = () => u.hasInvalidBlock() ? (s({
|
|
179
181
|
type: c.Error,
|
|
180
|
-
message: o(
|
|
181
|
-
}), !1) : !0,
|
|
182
|
+
message: o(ee)
|
|
183
|
+
}), !1) : !0, x = () => d.recommendationConfigs && Object.values(d.recommendationConfigs).find((t) => t.filters.find((n) => n.value === "")) !== void 0 ? (s({
|
|
182
184
|
type: c.Error,
|
|
183
185
|
message: o("newsletter.fill-all-necessary-fields")
|
|
184
186
|
}), !1) : !0, D = (e) => {
|
|
@@ -188,37 +190,37 @@ const xe = () => {
|
|
|
188
190
|
message: o("newsletter.invalid-image-type")
|
|
189
191
|
}), !1);
|
|
190
192
|
}, F = (e) => {
|
|
191
|
-
const r = new DOMParser().parseFromString(e, "text/html").querySelectorAll(
|
|
193
|
+
const r = new DOMParser().parseFromString(e, "text/html").querySelectorAll(j);
|
|
192
194
|
return Array.from(r).find((i) => {
|
|
193
|
-
var
|
|
194
|
-
return !((
|
|
195
|
+
var m;
|
|
196
|
+
return !((m = i.id) != null && m.trim());
|
|
195
197
|
}) ? (s({
|
|
196
198
|
type: c.Error,
|
|
197
199
|
message: o("unsubscribe-templates.select-checkbox-groups")
|
|
198
200
|
}), !1) : !0;
|
|
199
|
-
},
|
|
200
|
-
const r = new DOMParser().parseFromString(e, "text/html").querySelectorAll(
|
|
201
|
+
}, k = (e) => {
|
|
202
|
+
const r = new DOMParser().parseFromString(e, "text/html").querySelectorAll(z);
|
|
201
203
|
return Array.from(r).find((i) => {
|
|
202
|
-
var
|
|
203
|
-
return !((
|
|
204
|
+
var m;
|
|
205
|
+
return !((m = i.id) != null && m.trim());
|
|
204
206
|
}) ? (s({
|
|
205
207
|
type: c.Error,
|
|
206
208
|
message: o("unsubscribe-templates.select-radio-button-groups")
|
|
207
209
|
}), !1) : !0;
|
|
208
210
|
};
|
|
209
211
|
return { validateHtml: async (e, t, n = !1) => {
|
|
210
|
-
var
|
|
212
|
+
var v, y;
|
|
211
213
|
const r = [
|
|
212
214
|
...t.map((I) => I.value),
|
|
213
215
|
...q,
|
|
214
|
-
...((
|
|
216
|
+
...((y = (v = f.value) == null ? void 0 : v.template) == null ? void 0 : y.customFieldAttributes) ?? []
|
|
215
217
|
], a = M(e), i = await E(a);
|
|
216
|
-
return await
|
|
218
|
+
return await R(e, r, n) && b(e) && A(e) && _(e) && O(e, r, a, i) && w(e) && L(e) && N(e) && B() && x() && D(e) && F(e) && k(e);
|
|
217
219
|
} };
|
|
218
220
|
};
|
|
219
221
|
export {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
222
|
+
de as buildPartnerAttributeNameSet,
|
|
223
|
+
fe as findInvalidCustomFields,
|
|
224
|
+
ue as parseRecommendationVariable,
|
|
225
|
+
De as useHtmlValidator
|
|
224
226
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useActionsApi as f } from "./useActionsApi.js";
|
|
2
|
-
import { useHttp as
|
|
3
|
-
import { useToaster as
|
|
4
|
-
import { useStripoApi as
|
|
5
|
-
const
|
|
6
|
-
const { handleError: c } =
|
|
2
|
+
import { useHttp as H } from "./useHttp.js";
|
|
3
|
+
import { useToaster as h } from "./useToaster.js";
|
|
4
|
+
import { useStripoApi as k } from "../services/stripoApi.js";
|
|
5
|
+
const S = () => {
|
|
6
|
+
const { handleError: c } = h(), { getToken: l } = k(), { post: p } = H(), { updateHtmlAndCss: u } = f(), s = (t) => /esd-timer-id="(\d+)"/.test(t), i = async (t, e) => {
|
|
7
7
|
try {
|
|
8
|
-
return (await
|
|
8
|
+
return (await p(
|
|
9
9
|
"https://plugins.stripo.email/api/v1/timers/clone",
|
|
10
10
|
{ html: t },
|
|
11
11
|
{
|
|
@@ -25,29 +25,31 @@ const O = () => {
|
|
|
25
25
|
cloneTimersOnSave: async (t) => {
|
|
26
26
|
if (!s(t))
|
|
27
27
|
return t;
|
|
28
|
-
const e = await
|
|
28
|
+
const e = await l();
|
|
29
29
|
return e && await i(t, e) || t;
|
|
30
30
|
},
|
|
31
31
|
updateTimersOnLoad: async (t) => {
|
|
32
|
-
var e, r,
|
|
32
|
+
var e, r, n, d;
|
|
33
33
|
try {
|
|
34
|
-
const
|
|
35
|
-
if (!
|
|
34
|
+
const o = (r = (e = window.UIEditor) == null ? void 0 : e.getHtml) == null ? void 0 : r.call(e);
|
|
35
|
+
if (!o || !s(o))
|
|
36
36
|
return;
|
|
37
|
-
const
|
|
38
|
-
if (!
|
|
37
|
+
const m = await t();
|
|
38
|
+
if (!m)
|
|
39
39
|
return;
|
|
40
|
-
const a = await i(
|
|
41
|
-
if (!a || a ===
|
|
40
|
+
const a = await i(o, m);
|
|
41
|
+
if (!a || a === o)
|
|
42
42
|
return;
|
|
43
|
-
const T = ((
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
const T = ((d = (n = window.UIEditor) == null ? void 0 : n.getCss) == null ? void 0 : d.call(n)) || "";
|
|
44
|
+
u(a, T).catch((w) => {
|
|
45
|
+
console.warn("Editor did not acknowledge the timer-block update.", w);
|
|
46
|
+
});
|
|
47
|
+
} catch (o) {
|
|
48
|
+
c(o, "Failed to update timer blocks");
|
|
47
49
|
}
|
|
48
50
|
}
|
|
49
51
|
};
|
|
50
52
|
};
|
|
51
53
|
export {
|
|
52
|
-
|
|
54
|
+
S as useTimerClone
|
|
53
55
|
};
|
|
@@ -1,19 +1,43 @@
|
|
|
1
|
-
const e = "Items", o = "Default",
|
|
1
|
+
const e = "Items", o = "Default", i = "Custom", t = {
|
|
2
2
|
"Global Styles & Layout": "Global Styles and Layout",
|
|
3
3
|
"Structures & Modules": "Structures and Modules",
|
|
4
4
|
"Recommendation Block": "Recommendation",
|
|
5
5
|
Items: e,
|
|
6
6
|
"This block is switched from the Old Version to the New Version. We recommend you check the Recommendation block and test your message to ensure it works properly.": "This block is switched from the Old Version to the New Version. We recommend you check the Recommendation block and test your message to ensure it works properly.",
|
|
7
7
|
"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.": "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.",
|
|
8
|
+
"email-editor.a11y-hide-images": "Hide images",
|
|
9
|
+
"email-editor.a11y-show-images": "Show images",
|
|
10
|
+
"email-editor.cvd-none": "No Color Deficiency",
|
|
11
|
+
"email-editor.cvd-protanopia": "Protanopia",
|
|
12
|
+
"email-editor.cvd-protanopia-description": "Causes red-green confusion and makes reds appear darker.",
|
|
13
|
+
"email-editor.cvd-deuteranopia": "Deuteranopia",
|
|
14
|
+
"email-editor.cvd-deuteranopia-description": "Causes red-green confusion.",
|
|
15
|
+
"email-editor.cvd-tritanopia": "Tritanopia",
|
|
16
|
+
"email-editor.cvd-tritanopia-description": "Causes blue-yellow confusion.",
|
|
17
|
+
"email-editor.cvd-achromatopsia": "Achromatopsia",
|
|
18
|
+
"email-editor.cvd-achromatopsia-description": "Causes complete color blindness.",
|
|
19
|
+
"email-editor.more-actions": "More actions",
|
|
20
|
+
"email-editor.preferences": "Preferences",
|
|
21
|
+
"email-editor.actions": "Actions",
|
|
22
|
+
"email-editor.accessibility-test": "Accessibility Test",
|
|
23
|
+
"email-editor.autosaved-at-today": "Autosaved at {time}, Today",
|
|
24
|
+
"email-editor.autosaved-at-date": "Autosaved at {date}",
|
|
25
|
+
"email-editor.export-html": "Export HTML",
|
|
26
|
+
"email-editor.onboarding-kebab-title": "Discover Preferences and Actions",
|
|
27
|
+
"email-editor.onboarding-kebab-description": "You can now access your Preferences and Actions easily such as Autosave, Export HTML, Version History, Accessibility Test and Save As Template.",
|
|
28
|
+
"email-editor.onboarding-autosave-title": "Autosave Your Design",
|
|
29
|
+
"email-editor.onboarding-autosave-description": "You can save your design automatically by enabling Autosave without losing your work.",
|
|
30
|
+
"email-editor.onboarding-accessibility-title": "Test Accessibility of Your Design",
|
|
31
|
+
"email-editor.onboarding-accessibility-description": "You can test the accessibility of your design to see the Failed, Passed items and update the Failed ones accordingly.",
|
|
8
32
|
"Pixel Tracking Opt-in": "Pixel Tracking Opt-in",
|
|
9
33
|
"OPT-IN SELECTION": "OPT-IN SELECTION",
|
|
10
34
|
"UNSUBSCRIBE GROUPS": "UNSUBSCRIBE GROUPS",
|
|
11
35
|
Default: o,
|
|
12
|
-
Custom:
|
|
36
|
+
Custom: i
|
|
13
37
|
};
|
|
14
38
|
export {
|
|
15
|
-
|
|
39
|
+
i as Custom,
|
|
16
40
|
o as Default,
|
|
17
41
|
e as Items,
|
|
18
|
-
|
|
42
|
+
t as default
|
|
19
43
|
};
|
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import f from "../../extensions/Blocks/Checkbox/
|
|
5
|
-
import
|
|
6
|
-
|
|
1
|
+
var g = Object.defineProperty;
|
|
2
|
+
var x = (r, t, e) => t in r ? g(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
|
|
3
|
+
var m = (r, t, e) => x(r, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { CSS_CLASS_CHECKBOX_BLOCK as b, CSS_CLASS_CHECKBOX_BLOCK_V2 as T, BLOCK_ROOT_SELECTOR as f } from "../../extensions/Blocks/Checkbox/constants/selectors.js";
|
|
5
|
+
import h from "../../extensions/Blocks/Checkbox/template.js";
|
|
6
|
+
import { extractTextFromElement as p, buildTextBlock as C } from "./textBlockMigration.js";
|
|
7
|
+
class O {
|
|
7
8
|
constructor() {
|
|
8
|
-
|
|
9
|
+
m(this, "parser");
|
|
9
10
|
this.parser = new DOMParser();
|
|
10
11
|
}
|
|
11
12
|
migrate(t) {
|
|
12
13
|
try {
|
|
13
|
-
const e = this.parser.parseFromString(t, "text/html"),
|
|
14
|
-
if (
|
|
14
|
+
const e = this.parser.parseFromString(t, "text/html"), i = e.querySelectorAll(`td.${b}`);
|
|
15
|
+
if (i.length === 0)
|
|
15
16
|
return t;
|
|
16
|
-
let
|
|
17
|
-
return
|
|
18
|
-
if (o.classList.contains(
|
|
17
|
+
let s = !1;
|
|
18
|
+
return i.forEach((o) => {
|
|
19
|
+
if (o.classList.contains(T))
|
|
19
20
|
return;
|
|
20
|
-
const
|
|
21
|
+
const l = o.getAttribute("id"), c = p(o, "ins-title"), a = p(o, "ins-description"), u = C(c, c.containerClass), S = C(a, a.containerClass), d = h.replace("{-{-TITLE-}-}", u).replace("{-{-DESCRIPTION-}-}", S), n = this.parser.parseFromString(
|
|
21
22
|
`<table id="tempDoc"><tbody><tr>${d}</tr></tbody></table>`,
|
|
22
23
|
"text/html"
|
|
23
|
-
).querySelector(
|
|
24
|
-
|
|
25
|
-
}),
|
|
24
|
+
).querySelector(f);
|
|
25
|
+
n && o.parentNode && (n.setAttribute("id", l || ""), o.parentNode.replaceChild(n, o), s = !0);
|
|
26
|
+
}), s ? e.documentElement.outerHTML : t;
|
|
26
27
|
} catch (e) {
|
|
27
28
|
return console.error("CheckboxMigrator failed:", e), t;
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
|
-
function
|
|
32
|
-
return new
|
|
32
|
+
function D(r) {
|
|
33
|
+
return new O().migrate(r);
|
|
33
34
|
}
|
|
34
35
|
export {
|
|
35
|
-
|
|
36
|
+
D as migrateCheckbox
|
|
36
37
|
};
|
|
@@ -1,53 +1,54 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var g = (
|
|
1
|
+
var R = Object.defineProperty;
|
|
2
|
+
var b = (n, t, e) => t in n ? R(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
|
+
var g = (n, t, e) => b(n, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { CSS_CLASS_RADIO_BUTTON_BLOCK as C, CSS_CLASS_RADIO_BUTTON_BLOCK_V2 as T, BLOCK_ROOT_SELECTOR as A } from "../../extensions/Blocks/RadioButton/constants/selectors.js";
|
|
4
5
|
import N from "../../extensions/Blocks/RadioButton/template.js";
|
|
5
|
-
import { extractTextFromElement as
|
|
6
|
-
class
|
|
6
|
+
import { extractTextFromElement as S, buildTextBlock as f } from "./textBlockMigration.js";
|
|
7
|
+
class _ {
|
|
7
8
|
constructor() {
|
|
8
9
|
g(this, "parser");
|
|
9
10
|
this.parser = new DOMParser();
|
|
10
11
|
}
|
|
11
12
|
migrate(t) {
|
|
12
13
|
try {
|
|
13
|
-
const e = this.parser.parseFromString(t, "text/html"),
|
|
14
|
-
if (
|
|
14
|
+
const e = this.parser.parseFromString(t, "text/html"), o = e.querySelectorAll(`td.${C}`), a = e.querySelectorAll(`td.${T}`);
|
|
15
|
+
if (o.length === 0 && a.length === 0)
|
|
15
16
|
return t;
|
|
16
|
-
let
|
|
17
|
-
return
|
|
18
|
-
if (r.classList.contains(
|
|
17
|
+
let s = !1;
|
|
18
|
+
return o.forEach((r) => {
|
|
19
|
+
if (r.classList.contains(T))
|
|
19
20
|
return;
|
|
20
|
-
const
|
|
21
|
-
`<table id="tempDoc"><tbody><tr>${
|
|
21
|
+
const i = r.getAttribute("id"), c = S(r, "ins-title"), p = S(r, "ins-description"), l = S(r, "ins-subscribe"), u = S(r, "ins-unsubscribe"), d = f(c, c.containerClass), m = f(p, p.containerClass), h = f(l), L = f(u), O = N.replace("{-{-TITLE-}-}", d).replace("{-{-DESCRIPTION-}-}", m).replace("{-{-YES-}-}", h).replace("{-{-NO-}-}", L), y = this.parser.parseFromString(
|
|
22
|
+
`<table id="tempDoc"><tbody><tr>${O}</tr></tbody></table>`,
|
|
22
23
|
"text/html"
|
|
23
|
-
).querySelector(
|
|
24
|
-
y && r.parentNode && (y.setAttribute("id",
|
|
25
|
-
}),
|
|
24
|
+
).querySelector(A);
|
|
25
|
+
y && r.parentNode && (y.setAttribute("id", i || ""), r.parentNode.replaceChild(y, r), s = !0);
|
|
26
|
+
}), s = this.healRadioButtonV2(e) || s, s ? e.documentElement.outerHTML : t;
|
|
26
27
|
} catch (e) {
|
|
27
28
|
return console.error("RadioButtonMigrator failed:", e), t;
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
healRadioButtonV2(t) {
|
|
31
32
|
let e = !1;
|
|
32
|
-
return t.querySelectorAll(
|
|
33
|
+
return t.querySelectorAll(`td.${T}`).forEach((o) => {
|
|
33
34
|
var m;
|
|
34
|
-
|
|
35
|
-
const a =
|
|
36
|
-
if (!a || !
|
|
35
|
+
o.classList.contains(C) || (o.classList.add(C), e = !0);
|
|
36
|
+
const a = o.querySelector("input#radioYes"), s = o.querySelector("input#radioNo");
|
|
37
|
+
if (!a || !s)
|
|
37
38
|
return;
|
|
38
39
|
const r = ((m = a.parentElement) == null ? void 0 : m.querySelector(":scope > p")) || null;
|
|
39
40
|
if (!r && !a.hasAttribute("align"))
|
|
40
41
|
return;
|
|
41
|
-
const
|
|
42
|
-
if (!
|
|
42
|
+
const i = a.closest("tr"), c = s.closest("tr");
|
|
43
|
+
if (!i || !c || i === c || !i.parentNode)
|
|
43
44
|
return;
|
|
44
|
-
const
|
|
45
|
-
|
|
45
|
+
const p = (r == null ? void 0 : r.innerHTML.trim()) || "Yes", l = c.cloneNode(!0), u = l.querySelector("input#radioNo"), d = l.querySelector("p");
|
|
46
|
+
u && (u.setAttribute("id", "radioYes"), u.removeAttribute("align")), d && (d.innerHTML = p), i.parentNode.replaceChild(l, i), e = !0;
|
|
46
47
|
}), e;
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
|
-
function w(
|
|
50
|
-
return new
|
|
50
|
+
function w(n) {
|
|
51
|
+
return new _().migrate(n);
|
|
51
52
|
}
|
|
52
53
|
export {
|
|
53
54
|
w as migrateRadioButton
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createBlockBackgroundColorControl as o } from "../../../controlFactories.js";
|
|
2
|
+
import { CheckboxControlId as r } from "../../constants/controlIds.js";
|
|
3
|
+
import { BLOCK_ROOT_SELECTOR as C } from "../../constants/selectors.js";
|
|
4
|
+
const k = o(
|
|
5
|
+
r.BLOCK_BACKGROUND,
|
|
6
|
+
C
|
|
7
|
+
);
|
|
8
|
+
export {
|
|
9
|
+
k as CheckboxBlockBackgroundControl
|
|
10
|
+
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ExtensionBuilder as o } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
2
|
import { CheckboxBlock as t } from "./block.js";
|
|
3
|
-
import { CheckboxControl as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
3
|
+
import { CheckboxControl as r } from "./control.js";
|
|
4
|
+
import { CheckboxBlockBackgroundControl as e } from "./controls/blockBackground/index.js";
|
|
5
|
+
import { CheckboxIconsRegistry as i } from "./iconsRegistry.js";
|
|
6
|
+
import { CheckboxBlockSettings as n } from "./settingsPanel.js";
|
|
7
|
+
const C = new o().addBlock(t).withSettingsPanelRegistry(n).addControl(r).addControl(e).withIconsRegistry(i).build();
|
|
7
8
|
export {
|
|
8
|
-
|
|
9
|
+
C as default
|
|
9
10
|
};
|