@useinsider/guido 1.0.3-beta.46b1cdf → 1.0.3-beta.47364b3
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 +140 -3
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +79 -73
- package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
- package/dist/components/organisms/header/LeftSlot.vue2.js +16 -15
- package/dist/components/organisms/header/RightSlot.vue.js +11 -11
- package/dist/components/organisms/header/RightSlot.vue2.js +23 -22
- package/dist/composables/useBlocksConfig.js +49 -0
- package/dist/composables/useGuidoActions.js +19 -9
- package/dist/composables/useStripo.js +49 -58
- package/dist/config/compiler/unsubscribeCompilerRules.js +33 -28
- package/dist/enums/defaults.js +16 -9
- package/dist/enums/unsubscribe.js +27 -25
- package/dist/extensions/Blocks/Checkbox/extension.js +2 -2
- package/dist/extensions/Blocks/CouponBlock/extension.js +2 -2
- package/dist/extensions/Blocks/Recommendation/extension.js +4 -4
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +1 -1
- package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +4 -4
- package/dist/extensions/DynamicContent/dynamic-content-modal.js +25 -19
- package/dist/extensions/DynamicContent/dynamic-content.js +128 -33
- package/dist/guido.css +1 -1
- package/dist/package.json.js +1 -1
- package/dist/services/stripoApi.js +1 -1
- package/dist/src/@types/generic.d.ts +36 -6
- package/dist/src/components/Guido.vue.d.ts +3 -2
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/composables/useBlocksConfig.d.ts +11 -0
- package/dist/src/composables/useGuidoActions.d.ts +9 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -1
- package/dist/src/extensions/DynamicContent/dynamic-content-modal.d.ts +9 -2
- package/dist/src/extensions/DynamicContent/dynamic-content.d.ts +52 -2
- package/dist/src/stores/config.d.ts +9 -2
- package/dist/src/stores/dynamic-content.d.ts +3 -3
- package/dist/src/stores/editor.d.ts +1 -1
- package/dist/src/stores/onboarding.d.ts +1 -1
- package/dist/src/stores/preview.d.ts +1 -1
- package/dist/src/stores/recommendation.d.ts +1 -1
- package/dist/src/stores/save-as-template.d.ts +1 -1
- package/dist/src/stores/toaster.d.ts +1 -1
- package/dist/src/stores/unsubscribe.d.ts +1 -1
- package/dist/src/stores/version-history.d.ts +1 -1
- package/dist/src/utils/environmentUtil.d.ts +5 -0
- package/dist/src/utils/genericUtil.d.ts +1 -0
- package/dist/static/styles/components/narrow-panel.css.js +10 -0
- package/dist/stores/config.js +5 -5
- package/dist/stores/dynamic-content.js +2 -2
- package/dist/stores/editor.js +1 -1
- package/dist/stores/onboarding.js +27 -27
- package/dist/stores/preview.js +1 -1
- package/dist/stores/recommendation.js +3 -3
- package/dist/stores/save-as-template.js +2 -2
- package/dist/stores/toaster.js +1 -1
- package/dist/stores/unsubscribe.js +1 -1
- package/dist/stores/version-history.js +4 -4
- package/dist/utils/environmentUtil.js +4 -0
- package/dist/utils/genericUtil.js +20 -9
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { provideValue as o, useInjectedValue as t } from "./useProvideInject.js";
|
|
2
|
-
const r = Symbol.for("guido.back"), n = Symbol.for("guido.save.start"),
|
|
3
|
-
o(r, e.onBack), o(n, e.onSaveStart), o(
|
|
2
|
+
const r = Symbol.for("guido.back"), n = Symbol.for("guido.save.start"), c = Symbol.for("guido.save.complete"), a = Symbol.for("guido.test.email.click"), i = (e) => {
|
|
3
|
+
o(r, e.onBack), o(n, e.onSaveStart), o(c, e.onSaveComplete), o(a, e.onTestEmailClick);
|
|
4
4
|
}, u = () => {
|
|
5
5
|
try {
|
|
6
6
|
return t(r);
|
|
@@ -9,7 +9,7 @@ const r = Symbol.for("guido.back"), n = Symbol.for("guido.save.start"), a = Symb
|
|
|
9
9
|
"useBack: No back handler provided. Make sure Guido component is in the component tree."
|
|
10
10
|
);
|
|
11
11
|
}
|
|
12
|
-
},
|
|
12
|
+
}, l = () => {
|
|
13
13
|
try {
|
|
14
14
|
return t(n);
|
|
15
15
|
} catch {
|
|
@@ -17,21 +17,31 @@ const r = Symbol.for("guido.back"), n = Symbol.for("guido.save.start"), a = Symb
|
|
|
17
17
|
"useSaveStart: No save start handler provided. Make sure Guido component is in the component tree."
|
|
18
18
|
);
|
|
19
19
|
}
|
|
20
|
-
},
|
|
20
|
+
}, d = () => {
|
|
21
21
|
try {
|
|
22
|
-
return t(
|
|
22
|
+
return t(c);
|
|
23
23
|
} catch {
|
|
24
24
|
throw new Error(
|
|
25
25
|
"useSaveComplete: No save complete handler provided. Make sure Guido component is in the component tree."
|
|
26
26
|
);
|
|
27
27
|
}
|
|
28
|
+
}, m = () => {
|
|
29
|
+
try {
|
|
30
|
+
return t(a);
|
|
31
|
+
} catch {
|
|
32
|
+
throw new Error(
|
|
33
|
+
"useTestEmailClick: No test email click handler provided. Make sure Guido component is in the component tree."
|
|
34
|
+
);
|
|
35
|
+
}
|
|
28
36
|
};
|
|
29
37
|
export {
|
|
30
38
|
r as BACK_KEY,
|
|
31
|
-
|
|
39
|
+
c as SAVE_COMPLETE_KEY,
|
|
32
40
|
n as SAVE_START_KEY,
|
|
33
|
-
|
|
41
|
+
a as TEST_EMAIL_CLICK_KEY,
|
|
42
|
+
i as provideGuidoActions,
|
|
34
43
|
u as useBack,
|
|
35
|
-
|
|
36
|
-
|
|
44
|
+
d as useSaveComplete,
|
|
45
|
+
l as useSaveStart,
|
|
46
|
+
m as useTestEmailClick
|
|
37
47
|
};
|
|
@@ -1,29 +1,26 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const G = (a) => {
|
|
18
|
-
const { handleError: d } = C(), { getToken: u, getCustomFonts: m } = B(), { handleEvent: p } = S(), l = (r, i = []) => {
|
|
19
|
-
const t = F(), { html: n, css: c, forceRecreate: s } = r;
|
|
1
|
+
import { useActionsApi as h } from "./useActionsApi.js";
|
|
2
|
+
import { useBlocksConfig as b } from "./useBlocksConfig.js";
|
|
3
|
+
import { useConfig as k } from "./useConfig.js";
|
|
4
|
+
import { useCustomInterfaceAppearance as B } from "./useCustomInterfaceAppearance.js";
|
|
5
|
+
import { useStripoEventHandler as V } from "./useStripoEventHandler.js";
|
|
6
|
+
import { useToaster as _ } from "./useToaster.js";
|
|
7
|
+
import { displayConditions as F } from "../enums/displayConditions.js";
|
|
8
|
+
import { useStripoApi as A } from "../services/stripoApi.js";
|
|
9
|
+
import T from "../static/styles/customEditorStyle.css.js";
|
|
10
|
+
import { useEditorStore as v } from "../stores/editor.js";
|
|
11
|
+
import { dynamicContentToMergeTags as I } from "../utils/genericUtil.js";
|
|
12
|
+
import M from "../package.json.js";
|
|
13
|
+
const N = (d) => {
|
|
14
|
+
const { config: u } = k(), { handleError: l } = _(), { getToken: f, getCustomFonts: S } = A(), { handleEvent: C } = V(), { getStripoBlocksConfig: y } = b(), E = async (i, r = []) => {
|
|
15
|
+
var m, g;
|
|
16
|
+
const t = v(), { html: n, css: p, forceRecreate: a } = i, { baseBlocks: e, extensions: c } = await y();
|
|
20
17
|
window.UIEditor.initEditor(
|
|
21
18
|
document.querySelector("#guido-editor"),
|
|
22
19
|
{
|
|
23
|
-
metadata:
|
|
20
|
+
metadata: d,
|
|
24
21
|
html: n,
|
|
25
|
-
css:
|
|
26
|
-
forceRecreate:
|
|
22
|
+
css: p,
|
|
23
|
+
forceRecreate: a,
|
|
27
24
|
locale: "en",
|
|
28
25
|
undoButtonSelector: "#guido__undo-button",
|
|
29
26
|
redoButtonSelector: "#guido__redo-button",
|
|
@@ -33,39 +30,40 @@ const G = (a) => {
|
|
|
33
30
|
customAppearanceMergetags: !0,
|
|
34
31
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
35
32
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
36
|
-
customViewStyles:
|
|
37
|
-
conditionsEnabled: !0,
|
|
38
|
-
customConditionsEnabled: !0,
|
|
39
|
-
conditionCategories:
|
|
33
|
+
customViewStyles: T,
|
|
34
|
+
conditionsEnabled: ((m = u.features) == null ? void 0 : m.displayConditions) ?? !0,
|
|
35
|
+
customConditionsEnabled: ((g = u.features) == null ? void 0 : g.displayConditions) ?? !0,
|
|
36
|
+
conditionCategories: F,
|
|
40
37
|
enableXSSSecurity: !0,
|
|
41
38
|
messageSettingsEnabled: !1,
|
|
42
39
|
selectBlockAfterDropFromSettingsPanel: !0,
|
|
40
|
+
...e ? { baseBlocks: e } : {},
|
|
43
41
|
editorFonts: {
|
|
44
42
|
showDefaultStandardFonts: !0,
|
|
45
43
|
showDefaultNotStandardFonts: !0,
|
|
46
|
-
customFonts:
|
|
44
|
+
customFonts: r
|
|
47
45
|
},
|
|
48
46
|
mergeTags: [
|
|
49
47
|
{
|
|
50
|
-
entries:
|
|
48
|
+
entries: I(d.preselectedDynamicContentList)
|
|
51
49
|
}
|
|
52
50
|
],
|
|
53
51
|
async onTokenRefreshRequest(o) {
|
|
54
52
|
try {
|
|
55
|
-
const
|
|
56
|
-
o(
|
|
57
|
-
} catch (
|
|
58
|
-
|
|
53
|
+
const s = await f();
|
|
54
|
+
o(s);
|
|
55
|
+
} catch (s) {
|
|
56
|
+
l(s, "Failed to refresh token");
|
|
59
57
|
}
|
|
60
58
|
},
|
|
61
59
|
onTemplateLoaded() {
|
|
62
60
|
try {
|
|
63
|
-
const { importCss: o } =
|
|
64
|
-
o(),
|
|
61
|
+
const { importCss: o } = B(), { activateCustomViewStyles: s } = h();
|
|
62
|
+
o(), s(), d.onReady(), t.isStripoInitialized = !0, t.loadingStatus = !1, setTimeout(() => {
|
|
65
63
|
t.hasChanges = !1;
|
|
66
64
|
}, 1e3);
|
|
67
65
|
} catch (o) {
|
|
68
|
-
|
|
66
|
+
l(o, "Failed to load custom interface appearance");
|
|
69
67
|
}
|
|
70
68
|
},
|
|
71
69
|
onCodeEditorVisibilityChanged(o) {
|
|
@@ -80,42 +78,35 @@ const G = (a) => {
|
|
|
80
78
|
onDataChanged() {
|
|
81
79
|
t.hasChanges = !0;
|
|
82
80
|
},
|
|
83
|
-
onEvent:
|
|
81
|
+
onEvent: C,
|
|
84
82
|
ignoreClickOutsideSelectors: [
|
|
85
83
|
"#guido-dynamic-content-modal",
|
|
86
84
|
".in-on-board-wrapper",
|
|
87
85
|
".in-drawer__container"
|
|
88
86
|
],
|
|
89
|
-
extensions:
|
|
90
|
-
k,
|
|
91
|
-
h,
|
|
92
|
-
b,
|
|
93
|
-
V,
|
|
94
|
-
_,
|
|
95
|
-
w
|
|
96
|
-
]
|
|
87
|
+
extensions: c
|
|
97
88
|
}
|
|
98
89
|
);
|
|
99
|
-
},
|
|
100
|
-
var
|
|
90
|
+
}, w = (i) => new Promise((r, t) => {
|
|
91
|
+
var c;
|
|
101
92
|
if (document.getElementById("UiEditorScript")) {
|
|
102
|
-
|
|
93
|
+
i(), r();
|
|
103
94
|
return;
|
|
104
95
|
}
|
|
105
|
-
const n =
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
},
|
|
109
|
-
t(new Error(`Failed to load Stripo UIEditor script from S3: ${
|
|
110
|
-
}, document.body.appendChild(
|
|
96
|
+
const n = M.guido, a = `https://email-static.useinsider.com/guido/${(c = n == null ? void 0 : n.stripo) == null ? void 0 : c.version}/UIEditor.js`, e = document.createElement("script");
|
|
97
|
+
e.id = "UiEditorScript", e.type = "module", e.src = a, e.onload = () => {
|
|
98
|
+
i(), r();
|
|
99
|
+
}, e.onerror = () => {
|
|
100
|
+
t(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
|
|
101
|
+
}, document.body.appendChild(e);
|
|
111
102
|
});
|
|
112
|
-
return { initPlugin: async (
|
|
113
|
-
await
|
|
114
|
-
const
|
|
115
|
-
|
|
103
|
+
return { initPlugin: async (i) => {
|
|
104
|
+
await w(async () => {
|
|
105
|
+
const r = await S();
|
|
106
|
+
await E(i, r);
|
|
116
107
|
});
|
|
117
108
|
} };
|
|
118
109
|
};
|
|
119
110
|
export {
|
|
120
|
-
|
|
111
|
+
N as useStripo
|
|
121
112
|
};
|
|
@@ -1,36 +1,41 @@
|
|
|
1
|
-
import { usePartner as
|
|
2
|
-
import { LINK_REGEXES as l, LINK_TYPES as
|
|
3
|
-
import { parsePageList as
|
|
4
|
-
import { useConfigStore as
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { usePartner as N } from "../../composables/usePartner.js";
|
|
2
|
+
import { LINK_REGEXES as l, LINK_TYPES as g, INSIDER_ID as f, URLS as S } from "../../enums/unsubscribe.js";
|
|
3
|
+
import { parsePageList as U } from "../../extensions/Blocks/Unsubscribe/utils/utils.js";
|
|
4
|
+
import { useConfigStore as B } from "../../stores/config.js";
|
|
5
|
+
import { useDynamicContentStore as y } from "../../stores/dynamic-content.js";
|
|
6
|
+
import { useUnsubscribeStore as L } from "../../stores/unsubscribe.js";
|
|
7
|
+
const D = [
|
|
7
8
|
{
|
|
8
9
|
id: "add-unsubscribe-link-values",
|
|
9
10
|
description: "Adding unsubscribe link values",
|
|
10
11
|
type: "custom",
|
|
11
12
|
processor: (t) => {
|
|
12
|
-
const { getPartnerName: i } =
|
|
13
|
-
if (!
|
|
13
|
+
const { getPartnerName: i } = N(), c = B(), n = y(), u = L(), a = c.getVariationId;
|
|
14
|
+
if (!a)
|
|
14
15
|
return t;
|
|
15
|
-
let
|
|
16
|
-
const
|
|
17
|
-
return new DOMParser().parseFromString(
|
|
18
|
-
var
|
|
19
|
-
const
|
|
20
|
-
if (!
|
|
16
|
+
let e = t;
|
|
17
|
+
const r = `/${i()}/email/${a}?user={{iid}}`;
|
|
18
|
+
return new DOMParser().parseFromString(e, "text/html").querySelectorAll(".unsubscribe-block-v2[data-unsubscribe-page-list]").forEach((p) => {
|
|
19
|
+
var b;
|
|
20
|
+
const m = p.getAttribute("data-unsubscribe-page-list");
|
|
21
|
+
if (!m)
|
|
21
22
|
return;
|
|
22
|
-
const
|
|
23
|
-
(
|
|
24
|
-
)) ?? [],
|
|
23
|
+
const R = U(m), d = ((b = u.templates) == null ? void 0 : b.filter(
|
|
24
|
+
(o) => R.includes(o.id)
|
|
25
|
+
)) ?? [], _ = d.some((o) => o.type === g.UNSUBSCRIBE_LINK_TYPE), I = d.some((o) => o.type === g.PREFERENCES_LINK_TYPE), E = p.outerHTML;
|
|
25
26
|
let s = E;
|
|
26
|
-
|
|
27
|
+
_ && (n.selectedDynamicContentList.push({
|
|
28
|
+
text: f,
|
|
29
|
+
value: f,
|
|
30
|
+
fallback: ""
|
|
31
|
+
}), s = s.replace(
|
|
27
32
|
l.GLOBAL_UNSUBSCRIBE_LINK_REGEX,
|
|
28
|
-
|
|
29
|
-
)),
|
|
33
|
+
S.UNSUBSCRIBE_URL + r
|
|
34
|
+
)), I && (s = s.replace(
|
|
30
35
|
l.PREFERENCES_UNSUBSCRIBE_LINK_REGEX,
|
|
31
|
-
|
|
32
|
-
)), s = s.replace(l.UNSUBSCRIBE_LINK_REGEX, ""),
|
|
33
|
-
}),
|
|
36
|
+
S.PREFERENCES_URL + r
|
|
37
|
+
)), s = s.replace(l.UNSUBSCRIBE_LINK_REGEX, ""), e = e.replace(E, s);
|
|
38
|
+
}), e;
|
|
34
39
|
},
|
|
35
40
|
priority: 60
|
|
36
41
|
},
|
|
@@ -56,16 +61,16 @@ const T = [
|
|
|
56
61
|
type: "custom",
|
|
57
62
|
processor: (t) => {
|
|
58
63
|
let i = t;
|
|
59
|
-
const
|
|
60
|
-
return
|
|
64
|
+
const c = i.match(/<a[^>]+>(.*?)<\/a>/gm);
|
|
65
|
+
return c && c.forEach((n) => {
|
|
61
66
|
if (n.includes("insEmail=1"))
|
|
62
67
|
return;
|
|
63
68
|
if (n.match(/<a\s+(?:[^>]*?\s+)?href=(["'`”])(.*?)\1\s+(?:[^>]*?\s+)?universal=(["'`”])true\3/gm)) {
|
|
64
|
-
const
|
|
69
|
+
const a = n.replace(/href=(["'`”])(.*?)\1/gm, (e) => {
|
|
65
70
|
const r = e.slice(6, e.length - 1).trim();
|
|
66
71
|
return e.includes("?") || e.includes("#") ? r.slice(-1) === "&" ? e.replace(r, `${r}insEmail=1`) : e.replace(r, `${r}&insEmail=1`) : e.replace(r, `${r}?insEmail=1`);
|
|
67
72
|
});
|
|
68
|
-
i = i.replace(n,
|
|
73
|
+
i = i.replace(n, a);
|
|
69
74
|
}
|
|
70
75
|
}), i;
|
|
71
76
|
},
|
|
@@ -73,5 +78,5 @@ const T = [
|
|
|
73
78
|
}
|
|
74
79
|
];
|
|
75
80
|
export {
|
|
76
|
-
|
|
81
|
+
D as unsubscribeCompilerRules
|
|
77
82
|
};
|
package/dist/enums/defaults.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const e = {
|
|
2
2
|
translationsPath: "window.trans.en",
|
|
3
3
|
migrationDate: 1759696858,
|
|
4
4
|
emailHeader: {
|
|
@@ -8,18 +8,25 @@ const a = {
|
|
|
8
8
|
extensions: {
|
|
9
9
|
unsubscribe: !0
|
|
10
10
|
},
|
|
11
|
+
blocks: {
|
|
12
|
+
excludeDefaults: [],
|
|
13
|
+
includeCustoms: []
|
|
14
|
+
},
|
|
11
15
|
features: {
|
|
12
16
|
dynamicContent: !0,
|
|
13
17
|
saveAsTemplate: !0,
|
|
14
|
-
versionHistory: !0
|
|
18
|
+
versionHistory: !0,
|
|
19
|
+
testMessage: !0,
|
|
20
|
+
displayConditions: !0
|
|
15
21
|
},
|
|
16
22
|
useHeader: !0
|
|
17
23
|
}, t = {
|
|
18
24
|
promotional: 1,
|
|
19
25
|
transactional: 2
|
|
20
|
-
},
|
|
26
|
+
}, a = "email", o = "Guido User", s = t.promotional, n = 2, i = {
|
|
21
27
|
email: 60,
|
|
22
|
-
architect: 49
|
|
28
|
+
architect: 49,
|
|
29
|
+
unsubscribePages: 97
|
|
23
30
|
}, u = [
|
|
24
31
|
"alfredtesting",
|
|
25
32
|
"electio",
|
|
@@ -53,12 +60,12 @@ const a = {
|
|
|
53
60
|
"stripoeditorlivetest"
|
|
54
61
|
];
|
|
55
62
|
export {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
63
|
+
e as DefaultGuidoConfig,
|
|
64
|
+
s as DefaultMessageType,
|
|
65
|
+
a as DefaultProductType,
|
|
59
66
|
o as DefaultUsername,
|
|
60
|
-
|
|
61
|
-
|
|
67
|
+
n as EditorType,
|
|
68
|
+
i as ProductIds,
|
|
62
69
|
u as TEST_PARTNER_LIST,
|
|
63
70
|
t as TemplateTypes
|
|
64
71
|
};
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { useTranslations as
|
|
2
|
-
|
|
1
|
+
import { useTranslations as n } from "../composables/useTranslations.js";
|
|
2
|
+
import { getEnvironmentPrefix as R } from "../utils/environmentUtil.js";
|
|
3
|
+
const e = n(), I = {
|
|
3
4
|
UNSUBSCRIBE_LINK_TYPE: 1,
|
|
4
5
|
PREFERENCES_LINK_TYPE: 3
|
|
5
|
-
},
|
|
6
|
+
}, r = {
|
|
6
7
|
UNSUBSCRIBE_LINK_REGEX: /{{ins-unsubscribe-link}}/g,
|
|
7
8
|
DATA_OGSB_BUTTON_CSS_REGEX: "\\[data-ogsb\\]\\s*\\.es-button\\.es-button-[0-9]+\\s*\\{(?:[^\\}]*)\\}",
|
|
8
9
|
GLOBAL_UNSUBSCRIBE_LINK_REGEX: /{{ins-global-unsubscribe-link}}/g,
|
|
9
10
|
PREFERENCES_UNSUBSCRIBE_LINK_REGEX: /{{ins-preferences-unsubscribe-link}}/g
|
|
10
|
-
},
|
|
11
|
-
UNSUBSCRIBE_URL:
|
|
12
|
-
PREFERENCES_URL:
|
|
13
|
-
},
|
|
11
|
+
}, s = R(), _ = {
|
|
12
|
+
UNSUBSCRIBE_URL: `https://mail.${s}.com/user/v1/unsub`,
|
|
13
|
+
PREFERENCES_URL: `https://mail.${s}.com/user/v1/prefs`
|
|
14
|
+
}, i = "iid", B = {
|
|
14
15
|
name: "Global Unsubscribe",
|
|
15
16
|
sendGridId: "G"
|
|
16
|
-
},
|
|
17
|
+
}, C = "https://academy.useinsider.com/docs/global-unsubscribe-preference-center", c = "/email/unsubscribe-pages", E = {
|
|
17
18
|
GLOBAL_UNSUBSCRIBE: 1,
|
|
18
19
|
GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE: 2,
|
|
19
20
|
SUBSCRIPTION_PREFERENCE_CENTER: 3,
|
|
20
21
|
SUBSCRIPTION_PREFERENCE_CONFIRMATION: 4,
|
|
21
22
|
RESUBSCRIBE: 5
|
|
22
|
-
},
|
|
23
|
+
}, t = {
|
|
23
24
|
[E.GLOBAL_UNSUBSCRIBE]: [
|
|
24
25
|
E.GLOBAL_UNSUBSCRIBE,
|
|
25
26
|
E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE,
|
|
@@ -29,26 +30,27 @@ const s = e(), R = {
|
|
|
29
30
|
E.SUBSCRIPTION_PREFERENCE_CENTER,
|
|
30
31
|
E.SUBSCRIPTION_PREFERENCE_CONFIRMATION
|
|
31
32
|
]
|
|
32
|
-
},
|
|
33
|
-
[E.GLOBAL_UNSUBSCRIBE]:
|
|
34
|
-
[E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE]:
|
|
35
|
-
[E.RESUBSCRIBE]:
|
|
36
|
-
[E.SUBSCRIPTION_PREFERENCE_CENTER]:
|
|
37
|
-
[E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]:
|
|
38
|
-
},
|
|
33
|
+
}, U = {
|
|
34
|
+
[E.GLOBAL_UNSUBSCRIBE]: e("unsubscription-preference.type-global-unsubscribe"),
|
|
35
|
+
[E.GLOBAL_UNSUBSCRIBE_CONFIRMATION_PAGE]: e("unsubscription-preference.type-global-unsubscription-confirmation"),
|
|
36
|
+
[E.RESUBSCRIBE]: e("unsubscription-preference.type-resubscribe"),
|
|
37
|
+
[E.SUBSCRIPTION_PREFERENCE_CENTER]: e("unsubscription-preference.type-subscription-preferences-center"),
|
|
38
|
+
[E.SUBSCRIPTION_PREFERENCE_CONFIRMATION]: e("unsubscription-preference.type-subscription-preferences-confirmation")
|
|
39
|
+
}, o = {
|
|
39
40
|
default: "{{ins-unsubscribe-link}}",
|
|
40
41
|
[E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
|
|
41
42
|
[E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
|
|
42
43
|
};
|
|
43
44
|
export {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
C as ACADEMY_LINK,
|
|
46
|
+
B as DEFAULT_UNSUBSCRIBE_GROUP,
|
|
47
|
+
i as INSIDER_ID,
|
|
48
|
+
r as LINK_REGEXES,
|
|
49
|
+
I as LINK_TYPES,
|
|
50
|
+
o as MERGE_TAGS,
|
|
49
51
|
E as PAGE_TYPES,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
t as TYPE_COLLECTIONS,
|
|
53
|
+
U as TYPE_TRANSLATIONS,
|
|
54
|
+
c as UNSUBSCRIBE_PAGES_LINK,
|
|
55
|
+
_ as URLS
|
|
54
56
|
};
|
|
@@ -3,7 +3,7 @@ import { CheckboxBlock as t } from "./block.js";
|
|
|
3
3
|
import { CheckboxControl as e } from "./control.js";
|
|
4
4
|
import { CheckboxIconsRegistry as r } from "./iconsRegistry.js";
|
|
5
5
|
import { CheckboxBlockSettings as i } from "./settingsPanel.js";
|
|
6
|
-
const
|
|
6
|
+
const d = new o().addBlock(t).withSettingsPanelRegistry(i).addControl(e).withIconsRegistry(r).build();
|
|
7
7
|
export {
|
|
8
|
-
|
|
8
|
+
d as default
|
|
9
9
|
};
|
|
@@ -2,7 +2,7 @@ import { ExtensionBuilder as o } from "../../../node_modules/@stripoinc/ui-edito
|
|
|
2
2
|
import { CouponBlock as t } from "./block.js";
|
|
3
3
|
import { CouponIconsRegistry as i } from "./iconsRegistry.js";
|
|
4
4
|
import { CouponBlockSettings as n } from "./settingsPanel.js";
|
|
5
|
-
const
|
|
5
|
+
const p = new o().addBlock(t).withSettingsPanelRegistry(n).withIconsRegistry(i).build();
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
p as default
|
|
8
8
|
};
|
|
@@ -31,15 +31,15 @@ import { OldPriceSizeControl as I } from "./controls/oldPrice/size.js";
|
|
|
31
31
|
import { OldPriceStyleControl as T } from "./controls/oldPrice/style.js";
|
|
32
32
|
import { PriceAlignControl as w } from "./controls/price/align.js";
|
|
33
33
|
import { PriceBackgroundControl as h } from "./controls/price/background.js";
|
|
34
|
-
import { PriceColorControl as
|
|
35
|
-
import { PriceFontFamilyControl as
|
|
36
|
-
import { PricePaddingsControl as
|
|
34
|
+
import { PriceColorControl as M } from "./controls/price/color.js";
|
|
35
|
+
import { PriceFontFamilyControl as b } from "./controls/price/fontFamily.js";
|
|
36
|
+
import { PricePaddingsControl as E } from "./controls/price/paddings.js";
|
|
37
37
|
import { PriceSizeControl as j } from "./controls/price/size.js";
|
|
38
38
|
import { PriceStyleControl as q } from "./controls/price/style.js";
|
|
39
39
|
import { RecommendationIconsRegistry as v } from "./iconsRegistry.js";
|
|
40
40
|
import D from "./recommendation.css.js";
|
|
41
41
|
import { SettingsPanel as G } from "./settingsPanel.js";
|
|
42
|
-
const Io = new o().addBlock(r).withSettingsPanelRegistry(G).addControl(n).addControl(d).addControl(l).addControl(m).addControl(i).addControl(C).addControl(a).addControl(e).addControl(p).addControl(f).addControl(c).addControl(s).addControl(g).addControl(B).addControl(P).addControl(u).addControl(y).addControl(S).addControl(F).addControl(R).addControl(N).addControl(O).addControl(k).addControl(x).addControl(z).addControl(A).addControl(I).addControl(T).addControl(w).addControl(h).addControl(
|
|
42
|
+
const Io = new o().addBlock(r).withSettingsPanelRegistry(G).addControl(n).addControl(d).addControl(l).addControl(m).addControl(i).addControl(C).addControl(a).addControl(e).addControl(p).addControl(f).addControl(c).addControl(s).addControl(g).addControl(B).addControl(P).addControl(u).addControl(y).addControl(S).addControl(F).addControl(R).addControl(N).addControl(O).addControl(k).addControl(x).addControl(z).addControl(A).addControl(I).addControl(T).addControl(w).addControl(h).addControl(M).addControl(b).addControl(E).addControl(j).addControl(q).addControl(t).addStyles(D).withIconsRegistry(v).build();
|
|
43
43
|
export {
|
|
44
44
|
Io as default
|
|
45
45
|
};
|
|
@@ -133,7 +133,7 @@ const a = c(), d = () => ({
|
|
|
133
133
|
filterSelectionDrawerStatus: !1,
|
|
134
134
|
filterList: {},
|
|
135
135
|
filterGroup: 1
|
|
136
|
-
}), G = p("
|
|
136
|
+
}), G = p("guidoRecommendationExtension", {
|
|
137
137
|
state: () => d(),
|
|
138
138
|
getters: {
|
|
139
139
|
hasFilters: (e) => !!e.recommendationConfigs.filters.length,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BlockType as t, BlockAttr as n } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
2
|
import { RecommendationBlockId as o } from "../constants.js";
|
|
3
|
-
import {
|
|
3
|
+
import { generateTemplate as l, prepareProductRows as s, spacer as d, DEFAULTS as p, getDefaultProducts as i } from "./templateUtils.js";
|
|
4
4
|
import { DEFAULT_CARD_COMPOSITION as $ } from "./templateUtils.js";
|
|
5
5
|
const g = `
|
|
6
6
|
<td align="left" class="ins-recommendation-v3-block-v2 esd-block-recommendation-v3-block es-p20">
|
|
@@ -33,7 +33,7 @@ const g = `
|
|
|
33
33
|
</table>
|
|
34
34
|
</td>
|
|
35
35
|
</tr>
|
|
36
|
-
${
|
|
36
|
+
${d}
|
|
37
37
|
<tr>
|
|
38
38
|
<td>
|
|
39
39
|
<table
|
|
@@ -134,7 +134,7 @@ const g = `
|
|
|
134
134
|
};
|
|
135
135
|
function x() {
|
|
136
136
|
const e = i();
|
|
137
|
-
return
|
|
137
|
+
return l(
|
|
138
138
|
g,
|
|
139
139
|
e,
|
|
140
140
|
3,
|
|
@@ -143,7 +143,7 @@ function x() {
|
|
|
143
143
|
);
|
|
144
144
|
}
|
|
145
145
|
function f(e, r, c) {
|
|
146
|
-
return
|
|
146
|
+
return s(
|
|
147
147
|
e,
|
|
148
148
|
r,
|
|
149
149
|
a,
|
|
@@ -1,27 +1,33 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
class
|
|
1
|
+
var d = Object.defineProperty;
|
|
2
|
+
var m = (t, e, n) => e in t ? d(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var c = (t, e, n) => m(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
class C {
|
|
5
5
|
constructor() {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
c(this, "selectedDynamicContent", null);
|
|
7
|
+
c(this, "dataSelectCallback", () => {
|
|
8
8
|
});
|
|
9
|
+
c(this, "closeDynamicContentHandler", null);
|
|
9
10
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Opens the merge tags library modal
|
|
13
|
+
* @param dynamicContent - Currently selected dynamic content (if any)
|
|
14
|
+
* @param onDataSelectCallback - Callback invoked when user selects a merge tag
|
|
15
|
+
* @param position - Optional position data to place the modal
|
|
16
|
+
*/
|
|
17
|
+
openMergeTagsLibrary(e, n, l) {
|
|
18
|
+
this.closeDynamicContentHandler && (document.removeEventListener("dynamic-content:close", this.closeDynamicContentHandler), this.closeDynamicContentHandler = null), this.dataSelectCallback = n, this.selectedDynamicContent = e;
|
|
19
|
+
const o = {
|
|
20
|
+
attribute: e,
|
|
21
|
+
position: l
|
|
22
|
+
}, s = new CustomEvent("dynamic-content:open", {
|
|
23
|
+
detail: o
|
|
16
24
|
});
|
|
17
|
-
document.dispatchEvent(s)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
document.addEventListener("dynamic-content:close", o);
|
|
25
|
+
document.dispatchEvent(s), this.closeDynamicContentHandler = (i) => {
|
|
26
|
+
const a = i.detail;
|
|
27
|
+
this.selectedDynamicContent = a, a.text && a.value && this.dataSelectCallback(a);
|
|
28
|
+
}, document.addEventListener("dynamic-content:close", this.closeDynamicContentHandler);
|
|
23
29
|
}
|
|
24
30
|
}
|
|
25
31
|
export {
|
|
26
|
-
|
|
32
|
+
C as ExternalMergeTagsLibrary
|
|
27
33
|
};
|