@useinsider/guido 3.19.0-beta.cd75ff0 → 3.19.0-beta.cf43946
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/README.md +0 -1
- package/dist/@types/config/schemas.js +37 -39
- package/dist/components/Guido.vue.js +8 -8
- package/dist/components/Guido.vue2.js +65 -68
- package/dist/components/organisms/AutoSaveController.vue2.js +8 -10
- package/dist/components/organisms/header/EditorActions.vue.js +5 -5
- package/dist/components/organisms/header/EditorActions.vue2.js +46 -83
- package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
- package/dist/components/organisms/header/LeftSlot.vue2.js +12 -16
- package/dist/components/wrappers/WpDrawer.vue.js +7 -9
- package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
- package/dist/composables/useAutoSave.js +44 -46
- package/dist/composables/useHtmlCompiler.js +26 -37
- package/dist/composables/useHtmlValidator.js +0 -2
- package/dist/composables/useSave.js +45 -92
- package/dist/composables/validators/useCouponBlockValidator.js +21 -24
- package/dist/composables/validators/useUnsubscribeBlockValidator.js +27 -34
- package/dist/config/migrator/recommendationMigrator.js +28 -21
- package/dist/config/migrator/recommendationPartnerMigrator.js +36 -30
- package/dist/guido.css +1 -1
- package/dist/src/@types/config/schemas.d.ts +0 -4
- package/dist/src/components/Guido.vue.d.ts +1 -17
- package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -17
- package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -17
- package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -17
- package/dist/src/components/wrappers/WpDrawer.vue.d.ts +3 -4
- package/dist/src/composables/useAutoSave.d.ts +1 -4
- package/dist/src/composables/useConfig.d.ts +0 -2
- package/dist/src/composables/useGuidoActions.d.ts +2 -0
- package/dist/src/composables/useHtmlValidator.d.ts +0 -21
- package/dist/src/composables/useSave.d.ts +1 -6
- package/dist/src/composables/validators/useCouponBlockValidator.d.ts +0 -3
- package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +0 -10
- package/dist/src/mock/cortexChatStore.d.ts +12 -0
- package/dist/src/stores/config.d.ts +0 -32
- package/dist/src/stores/onboarding.d.ts +4 -0
- package/dist/src/stores/recommendation.d.ts +5 -0
- package/dist/src/utils/dateUtil.d.ts +10 -0
- package/dist/src/utils/genericUtil.d.ts +3 -0
- package/dist/src/utils/templatePreparation.d.ts +0 -30
- package/dist/static/styles/components/version-history.css.js +2 -6
- package/dist/stores/config.js +67 -84
- package/dist/stores/onboarding.js +4 -0
- package/dist/utils/templatePreparation.js +36 -39
- package/package.json +1 -1
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +0 -20
- package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +0 -50
- package/dist/composables/useSaveValidation.js +0 -284
- package/dist/composables/useSaveValidationRollout.js +0 -20
- package/dist/enums/save-validation.js +0 -4
- package/dist/services/settingsApi.js +0 -11
- package/dist/src/@types/save-validation.d.ts +0 -19
- package/dist/src/components/organisms/validation/ValidationErrorDrawer.vue.d.ts +0 -2
- package/dist/src/composables/useSaveValidation.d.ts +0 -6
- package/dist/src/composables/useSaveValidationRollout.d.ts +0 -4
- package/dist/src/enums/save-validation.d.ts +0 -27
- package/dist/src/services/settingsApi.d.ts +0 -6
- package/dist/src/stores/save-validation.d.ts +0 -22
- package/dist/src/stores/setup-settings.d.ts +0 -4
- package/dist/stores/save-validation.js +0 -30
- package/dist/stores/setup-settings.js +0 -10
|
@@ -1,102 +1,55 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
1
|
+
import { useActionsApi as T } from "./useActionsApi.js";
|
|
2
2
|
import { useConfig as q } from "./useConfig.js";
|
|
3
|
-
import { useEditorLock as
|
|
4
|
-
import { useSaveStart as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const r = D(), p = F(), { validateHtml: v } = _(), { validateLiquidSyntax: S } = et(), { validateCouponBlockTags: y } = tt(), { validateUnsubscribeBlockUniqueness: w, validateUnsubscribeBlockHasTemplate: E } = st(), { validateSyncModuleBlocks: n } = ot(), { callbacks: a, isFeatureEnabled: m } = q(), { extractSyncModuleData: b } = G(), { setSyncModuleUnsubscriptionPages: g } = J(), { editorSave: H, getTemplateData: V } = R(), { showToaster: x } = $(), { getBlockedDomains: k, resolveToast: C } = Z(), { prepareTemplateDetails: d } = X(), { collectSaveValidationErrors: B } = j(), { isEnabled: h } = z(), T = Q(), P = N(), f = K(), { runExclusive: l } = O(), c = async (t, e, o) => {
|
|
23
|
-
if (!m("allowlistEnabled"))
|
|
24
|
-
return !1;
|
|
25
|
-
const i = await k(t, e);
|
|
26
|
-
if (!i.length)
|
|
27
|
-
return !1;
|
|
28
|
-
if (!o) {
|
|
29
|
-
const s = await C(i);
|
|
30
|
-
s != null && s.message && x({
|
|
31
|
-
type: I.Warning,
|
|
32
|
-
message: s.message,
|
|
33
|
-
actionButton: s.actionButton
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
return !0;
|
|
37
|
-
}, L = async (t) => !y(t.compiledHtml) || !w(t.compiledHtml) || !E(t.compiledHtml) ? !1 : m("liquidSyntax") ? S(t.compiledHtml) : v(t.compiledHtml, t.dynamicContentList, !0), u = async (t, e) => {
|
|
38
|
-
if (!await H())
|
|
3
|
+
import { useEditorLock as C } from "./useEditorLock.js";
|
|
4
|
+
import { useSaveStart as L, useSaveComplete as M } from "./useGuidoActions.js";
|
|
5
|
+
import { useSyncModuleExtractor as D } from "./useSyncModuleExtractor.js";
|
|
6
|
+
import { ToasterTypeOptions as P } from "../enums/toaster.js";
|
|
7
|
+
import { useStripoApi as U } from "../services/stripoApi.js";
|
|
8
|
+
import { useTemplatePreparation as A } from "../utils/templatePreparation.js";
|
|
9
|
+
import { useAllowlist as h } from "./useAllowlist.js";
|
|
10
|
+
import { useHtmlValidator as F } from "./useHtmlValidator.js";
|
|
11
|
+
import { useToaster as O } from "./useToaster.js";
|
|
12
|
+
import { useCouponBlockValidator as W } from "./validators/useCouponBlockValidator.js";
|
|
13
|
+
import { useLiquidValidator as j } from "./validators/useLiquidValidator.js";
|
|
14
|
+
import { useSyncModuleBlockValidator as z } from "./validators/useSyncModuleBlockValidator.js";
|
|
15
|
+
import { useUnsubscribeBlockValidator as G } from "./validators/useUnsubscribeBlockValidator.js";
|
|
16
|
+
const rt = () => {
|
|
17
|
+
const n = L(), c = M(), { validateHtml: d } = F(), { validateLiquidSyntax: m } = j(), { validateCouponBlockTags: u } = W(), { validateUnsubscribeBlockUniqueness: p, validateUnsubscribeBlockHasTemplate: f } = G(), { validateSyncModuleBlocks: v } = z(), { callbacks: s, isFeatureEnabled: r } = q(), { extractSyncModuleData: S } = D(), { setSyncModuleUnsubscriptionPages: b } = U(), { editorSave: w } = T(), { showToaster: V } = O(), { getBlockedDomains: y, resolveToast: k } = h(), { runExclusive: x } = C(), H = async (a, o) => {
|
|
18
|
+
var l;
|
|
19
|
+
n();
|
|
20
|
+
const { prepareTemplateDetails: B } = A(), t = await B();
|
|
21
|
+
if (!v(t.rawHtml, o) || !u(t.compiledHtml) || !p(t.compiledHtml) || !f(t.compiledHtml))
|
|
39
22
|
return;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const W = e.blankCompiled ? { compiledHtml: "", ampHtml: "" } : {};
|
|
43
|
-
p({ ...t, ...W, silent: e.silent });
|
|
44
|
-
}
|
|
45
|
-
return t;
|
|
46
|
-
}, U = async (t, e) => {
|
|
47
|
-
var i;
|
|
48
|
-
r();
|
|
49
|
-
const o = await d();
|
|
50
|
-
if (n(o.rawHtml, e)) {
|
|
51
|
-
if (h.value && !e) {
|
|
52
|
-
const s = await B(
|
|
53
|
-
o.compiledHtml,
|
|
54
|
-
o.dynamicContentList
|
|
55
|
-
);
|
|
56
|
-
if (s.length) {
|
|
57
|
-
T.open(s, "save");
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
} else if (!await L(o))
|
|
23
|
+
if (r("liquidSyntax")) {
|
|
24
|
+
if (!await m(t.compiledHtml))
|
|
61
25
|
return;
|
|
62
|
-
|
|
63
|
-
return u(o, { silent: e, suppress: t });
|
|
64
|
-
}
|
|
65
|
-
}, A = async () => {
|
|
66
|
-
var e;
|
|
67
|
-
if (!f.allowSaveWithErrors)
|
|
68
|
-
return;
|
|
69
|
-
r();
|
|
70
|
-
const t = await d();
|
|
71
|
-
if (n(t.rawHtml, !1) && !((e = a.value) != null && e.externalValidation && !await a.value.externalValidation(t)) && !await c(t.compiledHtml, t.css, !1))
|
|
72
|
-
return u(t, { silent: !1, blankCompiled: !0 });
|
|
73
|
-
}, M = async () => {
|
|
74
|
-
if (!f.allowSaveWithErrors)
|
|
26
|
+
} else if (!await d(t.compiledHtml, t.dynamicContentList, !0))
|
|
75
27
|
return;
|
|
76
|
-
|
|
77
|
-
const { html: t, css: e } = await V();
|
|
78
|
-
if (!n(t, !0) || await c(t, e, !0))
|
|
28
|
+
if ((l = s.value) != null && l.externalValidation && !await s.value.externalValidation(t))
|
|
79
29
|
return;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
30
|
+
if (r("allowlistEnabled")) {
|
|
31
|
+
const i = await y(t.compiledHtml, t.css);
|
|
32
|
+
if (i.length) {
|
|
33
|
+
if (!o) {
|
|
34
|
+
const e = await k(i);
|
|
35
|
+
e != null && e.message && V({
|
|
36
|
+
type: P.Warning,
|
|
37
|
+
message: e.message,
|
|
38
|
+
actionButton: e.actionButton
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return;
|
|
92
42
|
}
|
|
93
|
-
}
|
|
94
|
-
|
|
43
|
+
}
|
|
44
|
+
if (!await w())
|
|
45
|
+
return;
|
|
46
|
+
const { unsubscribePayload: E, stripoModules: g } = S(t.rawHtml);
|
|
47
|
+
return await b(E), t.modules = g, a || c({ ...t, silent: o }), t;
|
|
95
48
|
};
|
|
96
|
-
return { save: (
|
|
97
|
-
() =>
|
|
98
|
-
)
|
|
49
|
+
return { save: (a = !1, o = !1) => x(
|
|
50
|
+
() => H(a, o)
|
|
51
|
+
) };
|
|
99
52
|
};
|
|
100
53
|
export {
|
|
101
|
-
|
|
54
|
+
rt as useSave
|
|
102
55
|
};
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
import { ToasterTypeOptions as
|
|
2
|
-
import { COUPON_PLACEHOLDER_DEFAULT as
|
|
3
|
-
import { useToaster as
|
|
4
|
-
import { useTranslations as
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
]),
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}), !1) : !0 };
|
|
1
|
+
import { ToasterTypeOptions as c } from "../../enums/toaster.js";
|
|
2
|
+
import { COUPON_PLACEHOLDER_DEFAULT as i, COUPON_PLACEHOLDER_LIQUID as l } from "../../extensions/Blocks/CouponBlock/template.js";
|
|
3
|
+
import { useToaster as m } from "../useToaster.js";
|
|
4
|
+
import { useTranslations as p } from "../useTranslations.js";
|
|
5
|
+
const u = /* @__PURE__ */ new Set([
|
|
6
|
+
i,
|
|
7
|
+
l
|
|
8
|
+
]), A = () => {
|
|
9
|
+
const { showToaster: t } = m(), r = p();
|
|
10
|
+
return { validateCouponBlockTags: (e) => {
|
|
11
|
+
const n = new DOMParser().parseFromString(e, "text/html");
|
|
12
|
+
return Array.from(n.querySelectorAll(".coupon-block")).find((s) => {
|
|
13
|
+
var o;
|
|
14
|
+
const a = ((o = s.textContent) == null ? void 0 : o.trim()) ?? "";
|
|
15
|
+
return !u.has(a);
|
|
16
|
+
}) ? (t({
|
|
17
|
+
type: c.Warning,
|
|
18
|
+
message: r("newsletter.coupon-tag-modified")
|
|
19
|
+
}), !1) : !0;
|
|
20
|
+
} };
|
|
22
21
|
};
|
|
23
22
|
export {
|
|
24
|
-
|
|
25
|
-
u as findInvalidCouponBlocks,
|
|
26
|
-
T as useCouponBlockValidator
|
|
23
|
+
A as useCouponBlockValidator
|
|
27
24
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ToasterTypeOptions as
|
|
1
|
+
import { ToasterTypeOptions as i } from "../../enums/toaster.js";
|
|
2
2
|
import { PAGE_TYPES as u } from "../../enums/unsubscribe.js";
|
|
3
|
-
import { UNSUBSCRIBE_BLOCK_SELECTOR as
|
|
4
|
-
import { useToaster as
|
|
5
|
-
import { useTranslations as
|
|
3
|
+
import { UNSUBSCRIBE_BLOCK_SELECTOR as l, DATA_ATTRIBUTES as a } from "../../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
4
|
+
import { useToaster as E } from "../useToaster.js";
|
|
5
|
+
import { useTranslations as m } from "../useTranslations.js";
|
|
6
6
|
const T = [
|
|
7
7
|
{
|
|
8
8
|
pageType: u.GLOBAL_UNSUBSCRIBE,
|
|
@@ -12,37 +12,30 @@ const T = [
|
|
|
12
12
|
pageType: u.SUBSCRIPTION_PREFERENCE_CENTER,
|
|
13
13
|
messageKey: "unsubscription-preference.duplicate-pref-center"
|
|
14
14
|
}
|
|
15
|
-
], g = "unsubscription-preference.duplicate-both",
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return !n || !e;
|
|
28
|
-
}).length;
|
|
29
|
-
}
|
|
30
|
-
const y = () => {
|
|
31
|
-
const { showToaster: r } = p(), s = l();
|
|
32
|
-
return { validateUnsubscribeBlockUniqueness: (e) => {
|
|
33
|
-
const o = m(e);
|
|
34
|
-
return o.length ? (r({
|
|
35
|
-
type: c.Error,
|
|
36
|
-
message: s(o.length > 1 ? g : o[0].messageKey)
|
|
15
|
+
], g = "unsubscription-preference.duplicate-both", b = "unsubscription-preference.select-page-to-continue", P = () => {
|
|
16
|
+
const { showToaster: c } = E(), p = m();
|
|
17
|
+
return { validateUnsubscribeBlockUniqueness: (n) => {
|
|
18
|
+
const o = new DOMParser().parseFromString(n, "text/html"), r = /* @__PURE__ */ new Map();
|
|
19
|
+
o.querySelectorAll(l).forEach((e) => {
|
|
20
|
+
const s = Number(e.getAttribute(a.PAGE_TYPE));
|
|
21
|
+
r.set(s, (r.get(s) ?? 0) + 1);
|
|
22
|
+
});
|
|
23
|
+
const t = T.filter((e) => (r.get(e.pageType) ?? 0) > 1).map((e) => e.messageKey);
|
|
24
|
+
return t.length ? (c({
|
|
25
|
+
type: i.Error,
|
|
26
|
+
message: p(t.length > 1 ? g : t[0])
|
|
37
27
|
}), !1) : !0;
|
|
38
|
-
}, validateUnsubscribeBlockHasTemplate: (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
28
|
+
}, validateUnsubscribeBlockHasTemplate: (n) => {
|
|
29
|
+
const o = new DOMParser().parseFromString(n, "text/html");
|
|
30
|
+
return Array.from(o.querySelectorAll(l)).some((t) => {
|
|
31
|
+
const e = t.getAttribute(a.PAGE_TYPE), s = t.getAttribute(a.PAGE_LIST);
|
|
32
|
+
return !e || !s;
|
|
33
|
+
}) ? (c({
|
|
34
|
+
type: i.Warning,
|
|
35
|
+
message: p(b)
|
|
36
|
+
}), !1) : !0;
|
|
37
|
+
} };
|
|
42
38
|
};
|
|
43
39
|
export {
|
|
44
|
-
|
|
45
|
-
b as countUnsubBlocksWithoutPage,
|
|
46
|
-
m as findDuplicateUnsubPageTypes,
|
|
47
|
-
y as useUnsubscribeBlockValidator
|
|
40
|
+
P as useUnsubscribeBlockValidator
|
|
48
41
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BlockId as f } from "../../enums/block.js";
|
|
2
|
-
import { DEFAULT_NODE_CONFIG as
|
|
3
|
-
import { ATTR_RECOMMENDATION_TITLE as
|
|
2
|
+
import { DEFAULT_NODE_CONFIG as y } from "../../extensions/Blocks/Recommendation/constants/defaultConfig.js";
|
|
3
|
+
import { ATTR_RECOMMENDATION_TITLE as b } from "../../extensions/Blocks/Recommendation/constants/selectors.js";
|
|
4
4
|
import { useTemplateStore as T } from "../../stores/template.js";
|
|
5
5
|
import { mapComposition as v } from "./recommendation/compositionMapper.js";
|
|
6
6
|
import { extractCurrencyFromBlock as C, extractTitleText as M, hasVisibleTitle as R, extractCardBgColor as S, isPartnerManagedBlock as h } from "./recommendation/extractors.js";
|
|
@@ -8,28 +8,28 @@ import { buildBlockHtml as w } from "./recommendation/htmlBuilder.js";
|
|
|
8
8
|
import { parseRecommendationId as x, parseLegacyConfig as E } from "./recommendation/parseLegacyConfig.js";
|
|
9
9
|
import { mapSettings as A } from "./recommendation/settingsMapper.js";
|
|
10
10
|
const H = 'td[esd-dev-product-config][class*="ins-recommendation-v3-block-"]:not(.recommendation-block-v2), td.product-block[esd-handler-name*="EmailRecommendationV3"][esd-dev-product-config]:not(.recommendation-block-v2)';
|
|
11
|
-
function B(n, t,
|
|
11
|
+
function B(n, t, c) {
|
|
12
12
|
var l;
|
|
13
|
-
const
|
|
14
|
-
if (
|
|
13
|
+
const r = x(t);
|
|
14
|
+
if (r === null)
|
|
15
15
|
return console.warn(
|
|
16
16
|
"[RecommendationMigrator] Skipping block — missing/invalid `ins-recommendation-v3-campaign-id`"
|
|
17
17
|
), !1;
|
|
18
|
-
const
|
|
19
|
-
if (!
|
|
18
|
+
const o = E(t);
|
|
19
|
+
if (!o)
|
|
20
20
|
return console.warn(
|
|
21
|
-
`[RecommendationMigrator] Aborting block id=${
|
|
21
|
+
`[RecommendationMigrator] Aborting block id=${r} — \`esd-dev-product-config\` missing or unable to be parsed`
|
|
22
22
|
), !1;
|
|
23
|
-
const
|
|
23
|
+
const a = c[String(r)] ?? {
|
|
24
24
|
currencySettings: C(t)
|
|
25
|
-
},
|
|
26
|
-
e.titleVariable || (e.visibility[
|
|
25
|
+
}, i = A(a, o, r), e = v((l = o.composition) == null ? void 0 : l.variables), d = M(t);
|
|
26
|
+
e.titleVariable || (e.visibility[b] = R(t));
|
|
27
27
|
const p = S(t), g = {
|
|
28
|
-
...
|
|
28
|
+
...i,
|
|
29
29
|
strategyId: "",
|
|
30
30
|
composition: e.composition,
|
|
31
31
|
visibility: e.visibility,
|
|
32
|
-
previousTitleHtml:
|
|
32
|
+
previousTitleHtml: y.previousTitleHtml,
|
|
33
33
|
textTrimming: e.anyTextTrimming
|
|
34
34
|
}, m = h(t), u = `
|
|
35
35
|
<table>
|
|
@@ -56,30 +56,37 @@ function B(n, t, a) {
|
|
|
56
56
|
</table>
|
|
57
57
|
`, s = n.parseFromString(u, "text/html").querySelector("td.esd-structure");
|
|
58
58
|
return !s || !t.parentNode ? (console.warn(
|
|
59
|
-
`[RecommendationMigrator] Aborting block id=${
|
|
59
|
+
`[RecommendationMigrator] Aborting block id=${r} — failed to construct new HTML element`
|
|
60
60
|
), !1) : (t.parentNode.replaceChild(s, t), !0);
|
|
61
61
|
}
|
|
62
62
|
function G(n, t = {}) {
|
|
63
|
-
const
|
|
63
|
+
const c = new DOMParser();
|
|
64
|
+
let r;
|
|
65
|
+
try {
|
|
66
|
+
r = c.parseFromString(n, "text/html");
|
|
67
|
+
} catch (i) {
|
|
68
|
+
return console.error("[RecommendationMigrator] Failed to parse template:", i), n;
|
|
69
|
+
}
|
|
70
|
+
const o = Array.from(r.querySelectorAll(H));
|
|
64
71
|
try {
|
|
65
72
|
T().$patch((e) => {
|
|
66
73
|
e.migrations = {
|
|
67
74
|
...e.migrations,
|
|
68
|
-
[f.Recommendation]:
|
|
75
|
+
[f.Recommendation]: o.length
|
|
69
76
|
};
|
|
70
77
|
});
|
|
71
78
|
} catch {
|
|
72
79
|
}
|
|
73
|
-
if (
|
|
80
|
+
if (o.length === 0)
|
|
74
81
|
return n;
|
|
75
|
-
let
|
|
76
|
-
return
|
|
82
|
+
let a = 0;
|
|
83
|
+
return o.forEach((i) => {
|
|
77
84
|
try {
|
|
78
|
-
B(
|
|
85
|
+
B(c, i, t) && (a += 1);
|
|
79
86
|
} catch (e) {
|
|
80
87
|
console.error("[RecommendationMigrator] Unexpected error migrating block:", e);
|
|
81
88
|
}
|
|
82
|
-
}),
|
|
89
|
+
}), a > 0 && console.info(`[RecommendationMigrator] Migrated ${a} legacy Recommendation block(s)`), r.documentElement.outerHTML;
|
|
83
90
|
}
|
|
84
91
|
export {
|
|
85
92
|
G as migrateRecommendation
|
|
@@ -1,50 +1,56 @@
|
|
|
1
|
-
import { RECOMMENDATION_ID_ATTR as
|
|
2
|
-
import { carriesForeignPartnerConfig as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
const
|
|
6
|
-
if (!
|
|
1
|
+
import { RECOMMENDATION_ID_ATTR as a, SELECTOR_ATTRIBUTE_ROW as f, ATTR_DATA_ATTRIBUTE_TYPE as _, ATTR_CUSTOM_PREFIX as g, ATTR_DATA_CARD_COMPOSITION as m, ATTR_DATA_CUSTOM_ATTRIBUTES as R } from "../../extensions/Blocks/Recommendation/constants/selectors.js";
|
|
2
|
+
import { carriesForeignPartnerConfig as O, canJudgeUnstampedBlock as d, withoutCustomAttributes as l } from "../../extensions/Blocks/Recommendation/utils/partnerScope.js";
|
|
3
|
+
const E = ".recommendation-block-v2[esd-ext-config]", T = "esd-ext-config";
|
|
4
|
+
function S(t) {
|
|
5
|
+
const r = t.getAttribute(T);
|
|
6
|
+
if (!r)
|
|
7
7
|
return null;
|
|
8
8
|
try {
|
|
9
|
-
const
|
|
10
|
-
return
|
|
9
|
+
const e = JSON.parse(r);
|
|
10
|
+
return e && typeof e == "object" && !Array.isArray(e) ? e : null;
|
|
11
11
|
} catch {
|
|
12
12
|
return null;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
const
|
|
17
|
-
t.querySelectorAll(
|
|
18
|
-
var
|
|
19
|
-
(
|
|
20
|
-
}), t.setAttribute(
|
|
21
|
-
...
|
|
15
|
+
function p(t, r, e) {
|
|
16
|
+
const s = l(r.composition ?? []);
|
|
17
|
+
t.querySelectorAll(f).forEach((o) => {
|
|
18
|
+
var u;
|
|
19
|
+
(u = o.getAttribute(_)) != null && u.startsWith(g) && o.remove();
|
|
20
|
+
}), t.setAttribute(m, s.join(",")), t.setAttribute(R, "[]"), t.setAttribute(T, JSON.stringify({
|
|
21
|
+
...r,
|
|
22
22
|
strategyId: "",
|
|
23
23
|
strategy: "",
|
|
24
24
|
filters: [],
|
|
25
25
|
productIds: [],
|
|
26
|
-
composition:
|
|
27
|
-
partnerName:
|
|
26
|
+
composition: s,
|
|
27
|
+
partnerName: e
|
|
28
28
|
}));
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
if (!
|
|
30
|
+
function I(t, { partnerName: r, campaignUrls: e, rrsEnabled: s }) {
|
|
31
|
+
if (!r)
|
|
32
32
|
return t;
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
let o;
|
|
34
|
+
try {
|
|
35
|
+
o = new DOMParser().parseFromString(t, "text/html");
|
|
36
|
+
} catch (n) {
|
|
37
|
+
return console.error("[RecommendationPartnerMigrator] Failed to parse template:", n), t;
|
|
38
|
+
}
|
|
39
|
+
const u = Array.from(o.querySelectorAll(E));
|
|
40
|
+
if (u.length === 0)
|
|
35
41
|
return t;
|
|
36
|
-
let
|
|
37
|
-
return
|
|
38
|
-
const
|
|
39
|
-
if (!(!
|
|
40
|
-
if (
|
|
41
|
-
|
|
42
|
+
let c = 0;
|
|
43
|
+
return u.forEach((n) => {
|
|
44
|
+
const i = S(n), A = Number(n.getAttribute(a));
|
|
45
|
+
if (!(!i || !Number.isFinite(A))) {
|
|
46
|
+
if (O({ config: i, blockId: A, partnerName: r, campaignUrls: e, rrsEnabled: s })) {
|
|
47
|
+
p(n, i, r), c += 1;
|
|
42
48
|
return;
|
|
43
49
|
}
|
|
44
|
-
|
|
50
|
+
i.partnerName || !d({ config: i, campaignUrls: e, rrsEnabled: s }) || (n.setAttribute(T, JSON.stringify({ ...i, partnerName: r })), c += 1);
|
|
45
51
|
}
|
|
46
|
-
}),
|
|
52
|
+
}), c > 0 ? o.documentElement.outerHTML : t;
|
|
47
53
|
}
|
|
48
54
|
export {
|
|
49
|
-
|
|
55
|
+
I as migrateRecommendationPartnerScope
|
|
50
56
|
};
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-
|
|
1
|
+
@charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-73199fa4] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-c61cc8ea]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.guido-editor__wrapper[data-v-926b01f5]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-926b01f5]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-926b01f5]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-91a26acd]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-91a26acd]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-91a26acd]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-91a26acd]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-91a26acd]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-19d8cb42] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-skeleton{width:100%!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}
|
|
@@ -411,8 +411,6 @@ export declare const FeaturesSchema: v.ObjectSchema<{
|
|
|
411
411
|
readonly allowlistEnabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
412
412
|
/** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
|
|
413
413
|
readonly linkTrackingIds: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
414
|
-
/** Allow persisting a template that still has validation errors (drawer "Save and Continue" soft-save). Host sets false for transactional + unsubscribe. */
|
|
415
|
-
readonly allowSaveWithErrors: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
416
414
|
readonly reusableRecommendationStrategy: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
417
415
|
}, undefined>;
|
|
418
416
|
/**
|
|
@@ -829,8 +827,6 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
829
827
|
readonly allowlistEnabled: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
830
828
|
/** Enable persistent link tracking-id assignment for the click heatmap (opt-in) */
|
|
831
829
|
readonly linkTrackingIds: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
832
|
-
/** Allow persisting a template that still has validation errors (drawer "Save and Continue" soft-save). Host sets false for transactional + unsubscribe. */
|
|
833
|
-
readonly allowSaveWithErrors: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
834
830
|
readonly reusableRecommendationStrategy: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
835
831
|
}, undefined>, {}>;
|
|
836
832
|
/** Block configuration */
|
|
@@ -15,23 +15,7 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
15
15
|
close: () => void;
|
|
16
16
|
};
|
|
17
17
|
hasChanges: import("vue").ComputedRef<boolean>;
|
|
18
|
-
saveSilent: () => Promise<
|
|
19
|
-
dynamicContentList: import("@@/Types/generic").DynamicContent[];
|
|
20
|
-
compiledHtml: string;
|
|
21
|
-
rawHtml: string;
|
|
22
|
-
css: string;
|
|
23
|
-
ampHtml: string;
|
|
24
|
-
ampErrors: string[];
|
|
25
|
-
modules: number[];
|
|
26
|
-
recommendation: {
|
|
27
|
-
campaignUrls: Record<string, import("../@types/recommendation").RecommendationCampaignUrlValue>;
|
|
28
|
-
configs: Record<string, string>;
|
|
29
|
-
};
|
|
30
|
-
unsubscribe: {
|
|
31
|
-
status: boolean;
|
|
32
|
-
config: number[];
|
|
33
|
-
};
|
|
34
|
-
} | undefined> | undefined;
|
|
18
|
+
saveSilent: () => Promise<Omit<SavedTemplateDetails, "metadata" | "silent"> | undefined> | undefined;
|
|
35
19
|
setLoading: (value: boolean) => void;
|
|
36
20
|
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
|
|
37
21
|
"dynamic-content:open": (detail: {
|
|
@@ -1,20 +1,4 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
-
handleSave: (isSilent: boolean) => Promise<
|
|
3
|
-
dynamicContentList: import("../../../@types/generic.js").DynamicContent[];
|
|
4
|
-
compiledHtml: string;
|
|
5
|
-
rawHtml: string;
|
|
6
|
-
css: string;
|
|
7
|
-
ampHtml: string;
|
|
8
|
-
ampErrors: string[];
|
|
9
|
-
modules: number[];
|
|
10
|
-
recommendation: {
|
|
11
|
-
campaignUrls: Record<string, import("../../../@types/recommendation.js").RecommendationCampaignUrlValue>;
|
|
12
|
-
configs: Record<string, string>;
|
|
13
|
-
};
|
|
14
|
-
unsubscribe: {
|
|
15
|
-
status: boolean;
|
|
16
|
-
config: number[];
|
|
17
|
-
};
|
|
18
|
-
} | undefined> | undefined;
|
|
2
|
+
handleSave: (isSilent: boolean) => Promise<Omit<import("../../../@types/stripo.js").SavedTemplateDetails, "metadata" | "silent"> | undefined> | undefined;
|
|
19
3
|
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
20
4
|
export default _default;
|
|
@@ -1,20 +1,4 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
-
handleSave: (isSilent: boolean) => Promise<
|
|
3
|
-
dynamicContentList: import("../../../@types/generic.js").DynamicContent[];
|
|
4
|
-
compiledHtml: string;
|
|
5
|
-
rawHtml: string;
|
|
6
|
-
css: string;
|
|
7
|
-
ampHtml: string;
|
|
8
|
-
ampErrors: string[];
|
|
9
|
-
modules: number[];
|
|
10
|
-
recommendation: {
|
|
11
|
-
campaignUrls: Record<string, import("../../../@types/recommendation.js").RecommendationCampaignUrlValue>;
|
|
12
|
-
configs: Record<string, string>;
|
|
13
|
-
};
|
|
14
|
-
unsubscribe: {
|
|
15
|
-
status: boolean;
|
|
16
|
-
config: number[];
|
|
17
|
-
};
|
|
18
|
-
} | undefined> | undefined;
|
|
2
|
+
handleSave: (isSilent: boolean) => Promise<Omit<import("../../../@types/stripo.js").SavedTemplateDetails, "metadata" | "silent"> | undefined> | undefined;
|
|
19
3
|
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
20
4
|
export default _default;
|
|
@@ -1,20 +1,4 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{}, {
|
|
2
|
-
handleSave: (isSilent: boolean) => Promise<
|
|
3
|
-
dynamicContentList: import("../../../@types/generic.js").DynamicContent[];
|
|
4
|
-
compiledHtml: string;
|
|
5
|
-
rawHtml: string;
|
|
6
|
-
css: string;
|
|
7
|
-
ampHtml: string;
|
|
8
|
-
ampErrors: string[];
|
|
9
|
-
modules: number[];
|
|
10
|
-
recommendation: {
|
|
11
|
-
campaignUrls: Record<string, import("../../../@types/recommendation.js").RecommendationCampaignUrlValue>;
|
|
12
|
-
configs: Record<string, string>;
|
|
13
|
-
};
|
|
14
|
-
unsubscribe: {
|
|
15
|
-
status: boolean;
|
|
16
|
-
config: number[];
|
|
17
|
-
};
|
|
18
|
-
} | undefined> | undefined;
|
|
2
|
+
handleSave: (isSilent: boolean) => Promise<Omit<import("../../../@types/stripo.js").SavedTemplateDetails, "metadata" | "silent"> | undefined> | undefined;
|
|
19
3
|
}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
20
4
|
export default _default;
|
|
@@ -10,11 +10,11 @@ interface Props {
|
|
|
10
10
|
status: boolean;
|
|
11
11
|
titleText: string;
|
|
12
12
|
}
|
|
13
|
-
declare var
|
|
13
|
+
declare var __VLS_12: {}, __VLS_14: {};
|
|
14
14
|
type __VLS_Slots = {} & {
|
|
15
|
-
headerBottomSlot?: (props: typeof
|
|
15
|
+
headerBottomSlot?: (props: typeof __VLS_12) => any;
|
|
16
16
|
} & {
|
|
17
|
-
default?: (props: typeof
|
|
17
|
+
default?: (props: typeof __VLS_14) => any;
|
|
18
18
|
};
|
|
19
19
|
declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
20
20
|
className: string;
|
|
@@ -26,7 +26,6 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
|
|
|
26
26
|
cancelOrBackButtonEvent: () => void;
|
|
27
27
|
onCloseEvent: () => void;
|
|
28
28
|
primaryButtonEvent: () => void;
|
|
29
|
-
secondaryButtonEvent: () => void;
|
|
30
29
|
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<Props>, {
|
|
31
30
|
className: string;
|
|
32
31
|
size: string;
|