@useinsider/guido 3.7.1 → 3.7.2-beta.0bf502c
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/composables/useSave.js +17 -16
- package/dist/composables/useStripo.js +68 -54
- package/dist/composables/validators/useUnsubscribeBlockValidator.js +32 -0
- package/dist/config/i18n/en/toasters.json.js +1 -0
- package/dist/extensions/Blocks/Unsubscribe/block.js +16 -16
- package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +4 -3
- package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +3 -0
- package/dist/src/extensions/Blocks/Unsubscribe/utils/constants.d.ts +1 -0
- package/package.json +10 -1
- package/dist/src/extensions/Blocks/Recommendation/block.test.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/utils/recommendationBlockCount.test.d.ts +0 -1
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
import { useActionsApi as x } from "./useActionsApi.js";
|
|
2
2
|
import { useConfig as y } from "./useConfig.js";
|
|
3
|
-
import { useSaveStart as w, useSaveComplete as
|
|
4
|
-
import { useSyncModuleExtractor as
|
|
5
|
-
import { useStripoApi as
|
|
6
|
-
import { useTemplatePreparation as
|
|
7
|
-
import { useHtmlValidator as
|
|
3
|
+
import { useSaveStart as w, useSaveComplete as H } from "./useGuidoActions.js";
|
|
4
|
+
import { useSyncModuleExtractor as q } from "./useSyncModuleExtractor.js";
|
|
5
|
+
import { useStripoApi as C } from "../services/stripoApi.js";
|
|
6
|
+
import { useTemplatePreparation as E } from "../utils/templatePreparation.js";
|
|
7
|
+
import { useHtmlValidator as k } from "./useHtmlValidator.js";
|
|
8
8
|
import { useCouponBlockValidator as L } from "./validators/useCouponBlockValidator.js";
|
|
9
9
|
import { useLiquidValidator as P } from "./validators/useLiquidValidator.js";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
import { useUnsubscribeBlockValidator as B } from "./validators/useUnsubscribeBlockValidator.js";
|
|
11
|
+
const J = () => {
|
|
12
|
+
const o = w(), s = H(), { validateHtml: r } = k(), { validateLiquidSyntax: n } = P(), { validateCouponBlockTags: l } = L(), { validateUnsubscribeBlockUniqueness: d } = B(), { callbacks: i, isFeatureEnabled: u } = y(), { extractSyncModuleData: c } = q(), { setSyncModuleUnsubscriptionPages: m } = C(), { editorSave: p } = x();
|
|
13
|
+
return { save: async (f = !1, v = !1) => {
|
|
14
|
+
var a;
|
|
14
15
|
o();
|
|
15
|
-
const { prepareTemplateDetails:
|
|
16
|
-
if (!l(t.compiledHtml))
|
|
16
|
+
const { prepareTemplateDetails: S } = E(), t = await S();
|
|
17
|
+
if (!l(t.compiledHtml) || !d(t.compiledHtml))
|
|
17
18
|
return;
|
|
18
|
-
if (
|
|
19
|
+
if (u("liquidSyntax")) {
|
|
19
20
|
if (!await n(t.compiledHtml))
|
|
20
21
|
return;
|
|
21
22
|
} else if (!await r(t.compiledHtml, t.dynamicContentList, !0))
|
|
22
23
|
return;
|
|
23
|
-
if ((
|
|
24
|
+
if ((a = i.value) != null && a.externalValidation && !await i.value.externalValidation(t) || !await p())
|
|
24
25
|
return;
|
|
25
|
-
const { unsubscribePayload:
|
|
26
|
-
return await
|
|
26
|
+
const { unsubscribePayload: V, stripoModules: b } = c(t.rawHtml);
|
|
27
|
+
return await m(V), t.modules = b, f || s({ ...t, silent: v }), t;
|
|
27
28
|
} };
|
|
28
29
|
};
|
|
29
30
|
export {
|
|
30
|
-
|
|
31
|
+
J as useSave
|
|
31
32
|
};
|
|
@@ -1,27 +1,29 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useBlocksConfig as
|
|
3
|
-
import { useConfig as
|
|
4
|
-
import { useCustomInterfaceAppearance as
|
|
5
|
-
import { useFullStoryBridge as
|
|
1
|
+
import { useActionsApi as I } from "./useActionsApi.js";
|
|
2
|
+
import { useBlocksConfig as U } from "./useBlocksConfig.js";
|
|
3
|
+
import { useConfig as R } from "./useConfig.js";
|
|
4
|
+
import { useCustomInterfaceAppearance as x } from "./useCustomInterfaceAppearance.js";
|
|
5
|
+
import { useFullStoryBridge as O } from "./useFullStoryBridge.js";
|
|
6
6
|
import { useStripoEventHandler as q } from "./useStripoEventHandler.js";
|
|
7
|
-
import { useToaster as
|
|
8
|
-
import { localePatch as
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
import { useToaster as H } from "./useToaster.js";
|
|
8
|
+
import { localePatch as z } from "../config/i18n/index.js";
|
|
9
|
+
import { en as h } from "../config/i18n/en/index.js";
|
|
10
|
+
import { ToasterTypeOptions as L } from "../enums/toaster.js";
|
|
11
|
+
import { useStripoApi as $ } from "../services/stripoApi.js";
|
|
12
|
+
import G from "../static/styles/customEditorStyle.css.js";
|
|
13
|
+
import { useEditorStore as C } from "../stores/editor.js";
|
|
14
|
+
import { dynamicContentToMergeTags as J } from "../utils/genericUtil.js";
|
|
15
|
+
import N from "../package.json.js";
|
|
16
|
+
const ce = (E, l) => {
|
|
17
|
+
const { features: c, template: w, isFeatureEnabled: u } = R(), { handleError: m, showToaster: b } = H(), { getToken: T, getCustomFonts: k, getSyncModulesStatus: B } = $(), { handleEvent: F } = q(), { getStripoBlocksConfig: v } = U(), V = async (s, r = [], i = !1) => {
|
|
16
18
|
var g, S, y;
|
|
17
|
-
const e =
|
|
18
|
-
window.UIEditor.initEditor(
|
|
19
|
+
const e = C(), { html: p, css: a } = s, { baseBlocks: t, extensions: d } = await v(), f = ((g = c.value) == null ? void 0 : g.displayConditions) ?? !0, A = ((S = c.value) == null ? void 0 : S.modulesDisabled) ?? !1, M = ((y = w.value) == null ? void 0 : y.forceRecreate) ?? !1;
|
|
20
|
+
await window.UIEditor.initEditor(
|
|
19
21
|
document.querySelector("#guido-editor"),
|
|
20
22
|
{
|
|
21
|
-
metadata:
|
|
23
|
+
metadata: E,
|
|
22
24
|
html: p,
|
|
23
25
|
css: a,
|
|
24
|
-
forceRecreate:
|
|
26
|
+
forceRecreate: M,
|
|
25
27
|
locale: "en",
|
|
26
28
|
undoButtonSelector: "#guido__undo-button",
|
|
27
29
|
redoButtonSelector: "#guido__redo-button",
|
|
@@ -31,12 +33,12 @@ const se = (C, l) => {
|
|
|
31
33
|
customAppearanceMergetags: !u("liquidSyntax"),
|
|
32
34
|
customAppearanceMergetagsBorderColor: "#f1f3fe",
|
|
33
35
|
customAppearanceMergetagsBackgroundColor: "#f1f3fe",
|
|
34
|
-
customViewStyles:
|
|
36
|
+
customViewStyles: G,
|
|
35
37
|
conditionsEnabled: f,
|
|
36
38
|
customConditionsEnabled: f,
|
|
37
39
|
enableXSSSecurity: !0,
|
|
38
|
-
modulesDisabled:
|
|
39
|
-
syncModulesEnabled:
|
|
40
|
+
modulesDisabled: A,
|
|
41
|
+
syncModulesEnabled: i,
|
|
40
42
|
messageSettingsEnabled: !0,
|
|
41
43
|
displayGmailAnnotations: !0,
|
|
42
44
|
displayHiddenPreheader: !1,
|
|
@@ -45,7 +47,7 @@ const se = (C, l) => {
|
|
|
45
47
|
selectElementAfterDrop: !0,
|
|
46
48
|
sameFontSizeForOutlook: !0,
|
|
47
49
|
allowedScriptSourceDomains: "https://email-static.useinsider.com https://edge.fullstory.com https://rs.fullstory.com",
|
|
48
|
-
...
|
|
50
|
+
...t ? { baseBlocks: t } : {},
|
|
49
51
|
editorFonts: {
|
|
50
52
|
showDefaultStandardFonts: !0,
|
|
51
53
|
showDefaultNotStandardFonts: !0,
|
|
@@ -53,38 +55,38 @@ const se = (C, l) => {
|
|
|
53
55
|
},
|
|
54
56
|
mergeTags: [
|
|
55
57
|
{
|
|
56
|
-
entries:
|
|
58
|
+
entries: J(
|
|
57
59
|
l.preselectedDynamicContentList,
|
|
58
60
|
u("liquidSyntax")
|
|
59
61
|
)
|
|
60
62
|
}
|
|
61
63
|
],
|
|
62
|
-
async onTokenRefreshRequest(
|
|
64
|
+
async onTokenRefreshRequest(o) {
|
|
63
65
|
try {
|
|
64
|
-
const n = await
|
|
65
|
-
|
|
66
|
+
const n = await T();
|
|
67
|
+
o(n);
|
|
66
68
|
} catch (n) {
|
|
67
69
|
m(n, "Failed to refresh token");
|
|
68
70
|
}
|
|
69
71
|
},
|
|
70
72
|
onTemplateLoaded() {
|
|
71
73
|
try {
|
|
72
|
-
const { importCss:
|
|
73
|
-
|
|
74
|
+
const { importCss: o } = x(), { activateCustomViewStyles: n, updateTimerInClonedTemplate: P } = I(), { injectFullStory: D } = O();
|
|
75
|
+
o(), n(), D(), P(), l.onReady(), e.isStripoInitialized = !0, e.loadingStatus = !1, setTimeout(() => {
|
|
74
76
|
e.hasChanges = !1;
|
|
75
77
|
}, 1e3);
|
|
76
|
-
} catch (
|
|
77
|
-
m(
|
|
78
|
+
} catch (o) {
|
|
79
|
+
m(o, "Failed to load custom interface appearance");
|
|
78
80
|
}
|
|
79
81
|
},
|
|
80
|
-
onCodeEditorVisibilityChanged(
|
|
81
|
-
e.isCodeEditorOpen =
|
|
82
|
+
onCodeEditorVisibilityChanged(o) {
|
|
83
|
+
e.isCodeEditorOpen = o;
|
|
82
84
|
},
|
|
83
|
-
onEditorVisualModeChanged(
|
|
84
|
-
e.editorVisualMode =
|
|
85
|
+
onEditorVisualModeChanged(o) {
|
|
86
|
+
e.editorVisualMode = o.toLowerCase();
|
|
85
87
|
},
|
|
86
|
-
onVersionHistoryVisibilityChanged(
|
|
87
|
-
e.isVersionHistoryOpen =
|
|
88
|
+
onVersionHistoryVisibilityChanged(o) {
|
|
89
|
+
e.isVersionHistoryOpen = o;
|
|
88
90
|
},
|
|
89
91
|
onDataChanged() {
|
|
90
92
|
e.hasChanges = !0;
|
|
@@ -96,32 +98,44 @@ const se = (C, l) => {
|
|
|
96
98
|
".in-drawer__container"
|
|
97
99
|
],
|
|
98
100
|
extensions: d,
|
|
99
|
-
localePatch:
|
|
101
|
+
localePatch: z
|
|
100
102
|
}
|
|
101
103
|
);
|
|
102
|
-
},
|
|
104
|
+
}, _ = (s) => new Promise((r, i) => {
|
|
103
105
|
var d;
|
|
104
106
|
if (document.getElementById("UiEditorScript")) {
|
|
105
|
-
|
|
107
|
+
Promise.resolve(s()).then(r, i);
|
|
106
108
|
return;
|
|
107
109
|
}
|
|
108
|
-
const e =
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
}, document.body.appendChild(
|
|
110
|
+
const e = N.guido, a = `https://email-static.useinsider.com/guido/${(d = e == null ? void 0 : e.stripo) == null ? void 0 : d.version}/UIEditor.js`, t = document.createElement("script");
|
|
111
|
+
t.id = "UiEditorScript", t.type = "module", t.src = a, t.onload = () => {
|
|
112
|
+
Promise.resolve(s()).then(r, i);
|
|
113
|
+
}, t.onerror = () => {
|
|
114
|
+
i(new Error(`Failed to load Stripo UIEditor script from S3: ${a}`));
|
|
115
|
+
}, document.body.appendChild(t);
|
|
114
116
|
});
|
|
115
|
-
return { initPlugin: async (
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
117
|
+
return { initPlugin: async (s) => {
|
|
118
|
+
const r = C();
|
|
119
|
+
try {
|
|
120
|
+
await _(async () => {
|
|
121
|
+
const [i, e] = await Promise.all([
|
|
122
|
+
k(),
|
|
123
|
+
B()
|
|
124
|
+
]);
|
|
125
|
+
r.syncModulesEnabled = e, await V(s, i, e);
|
|
126
|
+
});
|
|
127
|
+
} catch {
|
|
128
|
+
r.loadingStatus = !1, b({
|
|
129
|
+
type: L.Alert,
|
|
130
|
+
message: h["An error has occurred. Please report the error code to support."],
|
|
131
|
+
actionButton: {
|
|
132
|
+
text: h["Reload page"],
|
|
133
|
+
onClick: () => window.location.reload()
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
}
|
|
123
137
|
} };
|
|
124
138
|
};
|
|
125
139
|
export {
|
|
126
|
-
|
|
140
|
+
ce as useStripo
|
|
127
141
|
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ToasterTypeOptions as i } from "../../enums/toaster.js";
|
|
2
|
+
import { PAGE_TYPES as n } from "../../enums/unsubscribe.js";
|
|
3
|
+
import { UNSUBSCRIBE_BLOCK_SELECTOR as u, DATA_ATTRIBUTES as l } from "../../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
4
|
+
import { useToaster as T } from "../useToaster.js";
|
|
5
|
+
import { useTranslations as E } from "../useTranslations.js";
|
|
6
|
+
const m = [
|
|
7
|
+
{
|
|
8
|
+
pageType: n.GLOBAL_UNSUBSCRIBE,
|
|
9
|
+
messageKey: "unsubscription-preference.duplicate-global-unsub"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
pageType: n.SUBSCRIPTION_PREFERENCE_CENTER,
|
|
13
|
+
messageKey: "unsubscription-preference.duplicate-pref-center"
|
|
14
|
+
}
|
|
15
|
+
], g = "unsubscription-preference.duplicate-both", y = () => {
|
|
16
|
+
const { showToaster: o } = T(), a = E();
|
|
17
|
+
return { validateUnsubscribeBlockUniqueness: (c) => {
|
|
18
|
+
const p = new DOMParser().parseFromString(c, "text/html"), t = /* @__PURE__ */ new Map();
|
|
19
|
+
p.querySelectorAll(u).forEach((e) => {
|
|
20
|
+
const r = Number(e.getAttribute(l.PAGE_TYPE));
|
|
21
|
+
t.set(r, (t.get(r) ?? 0) + 1);
|
|
22
|
+
});
|
|
23
|
+
const s = m.filter((e) => (t.get(e.pageType) ?? 0) > 1).map((e) => e.messageKey);
|
|
24
|
+
return s.length ? (o({
|
|
25
|
+
type: i.Alert,
|
|
26
|
+
message: a(s.length > 1 ? g : s[0])
|
|
27
|
+
}), !1) : !0;
|
|
28
|
+
} };
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
y as useUnsubscribeBlockValidator
|
|
32
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const e = "Your version has been restored successfully.", o = "Restore Image", t = "Cancel", a = {
|
|
2
|
+
"Reload page": "Reload page",
|
|
2
3
|
"The image has been deleted.": "The image has been deleted successfully.",
|
|
3
4
|
"Aim for the drop zone!": "Drag and drop your image inside the upload area to continue.",
|
|
4
5
|
"Image processing": "The image upload is in progress. This may take some time.",
|
|
@@ -7,9 +7,9 @@ import { PAGE_TYPES as h } from "../../../enums/unsubscribe.js";
|
|
|
7
7
|
import { useUnsubscribeStore as u } from "../../../stores/unsubscribe.js";
|
|
8
8
|
import { Block as y, BlockCompositionType as T, ContextActionType as k, ModificationDescription as d, BlockType as I } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
9
9
|
import { getDefaultTemplate as v } from "./template.js";
|
|
10
|
-
import { DATA_ATTRIBUTES as n, UNSUBSCRIBE_EVENTS as
|
|
10
|
+
import { UNSUBSCRIBE_BLOCK_SELECTOR as m, DATA_ATTRIBUTES as n, UNSUBSCRIBE_EVENTS as b } from "./utils/constants.js";
|
|
11
11
|
import { parsePageList as B } from "./utils/utils.js";
|
|
12
|
-
const C = "unsubscribe-block",
|
|
12
|
+
const C = "unsubscribe-block", E = 'a[data-unsubscribe-link="true"]', N = "{{ins-unsubscribe-link}}", U = "https://academy.insiderone.com/docs/adding-unsubscribe-pages-into-emails", R = "Removing the unsubscribe text leaves an empty block, but an active unsubscribe link is required. Undo your last action to restore the text, or delete the unsubscribe block entirely.", D = {
|
|
13
13
|
[h.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
|
|
14
14
|
[h.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
|
|
15
15
|
}, w = 3;
|
|
@@ -60,7 +60,7 @@ class H extends y {
|
|
|
60
60
|
onDocumentInit() {
|
|
61
61
|
try {
|
|
62
62
|
const e = this.api.getDocumentRoot();
|
|
63
|
-
e && "querySelectorAll" in e && e.querySelectorAll(
|
|
63
|
+
e && "querySelectorAll" in e && e.querySelectorAll(m).forEach((t) => {
|
|
64
64
|
this._ensureLeadingTextGuard(t);
|
|
65
65
|
});
|
|
66
66
|
} catch {
|
|
@@ -90,7 +90,7 @@ class H extends y {
|
|
|
90
90
|
_ensureLeadingTextGuard(e) {
|
|
91
91
|
if (!("querySelector" in e))
|
|
92
92
|
return;
|
|
93
|
-
const t = e.querySelector(
|
|
93
|
+
const t = e.querySelector(E);
|
|
94
94
|
if (!t)
|
|
95
95
|
return;
|
|
96
96
|
let s = t, r = s.parent();
|
|
@@ -100,8 +100,8 @@ class H extends y {
|
|
|
100
100
|
return;
|
|
101
101
|
const i = s.previousSibling();
|
|
102
102
|
if (!!(i && i.getType() === "text" && i.getTextContent())) {
|
|
103
|
-
const
|
|
104
|
-
|
|
103
|
+
const p = this._readBlockId(e);
|
|
104
|
+
p && this.guardAttemptsByBlockId.delete(p);
|
|
105
105
|
return;
|
|
106
106
|
}
|
|
107
107
|
const g = this._getOrAssignBlockId(e);
|
|
@@ -112,13 +112,13 @@ class H extends y {
|
|
|
112
112
|
this.guardAttemptsByBlockId.set(g, _ + 1);
|
|
113
113
|
try {
|
|
114
114
|
this.api.getDocumentModifier().modifyHtml(r).prepend(" ").apply(new d("Ensure unsubscribe link text guard"));
|
|
115
|
-
} catch (
|
|
116
|
-
console.warn("[UnsubscribeBlock] Failed to ensure link text guard:",
|
|
115
|
+
} catch (p) {
|
|
116
|
+
console.warn("[UnsubscribeBlock] Failed to ensure link text guard:", p);
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
_hasUnsubscribeLink(e) {
|
|
121
|
-
return "querySelector" in e ? !!e.querySelector(
|
|
121
|
+
return "querySelector" in e ? !!e.querySelector(E) : !1;
|
|
122
122
|
}
|
|
123
123
|
_readBlockId(e) {
|
|
124
124
|
return "getAttribute" in e ? e.getAttribute(n.BLOCK_ID) : null;
|
|
@@ -152,7 +152,7 @@ class H extends y {
|
|
|
152
152
|
let e = 0;
|
|
153
153
|
try {
|
|
154
154
|
const t = this.api.getDocumentRoot();
|
|
155
|
-
t && "querySelectorAll" in t && t.querySelectorAll(
|
|
155
|
+
t && "querySelectorAll" in t && t.querySelectorAll(m).forEach((r) => {
|
|
156
156
|
if ("getAttribute" in r) {
|
|
157
157
|
const i = r.getAttribute(n.BLOCK_ID), l = i ? parseInt(i) : 0;
|
|
158
158
|
l > e && (e = l);
|
|
@@ -183,18 +183,18 @@ class H extends y {
|
|
|
183
183
|
this._removeSelectEventListener(), this.selectEventListener = (e) => {
|
|
184
184
|
const t = e, { collectionType: s, selectedPages: r } = t.detail;
|
|
185
185
|
this._updateBlock(s, r.join(","));
|
|
186
|
-
}, document.addEventListener(
|
|
186
|
+
}, document.addEventListener(b.SELECT, this.selectEventListener);
|
|
187
187
|
}
|
|
188
188
|
_removeSelectEventListener() {
|
|
189
|
-
this.selectEventListener && (document.removeEventListener(
|
|
189
|
+
this.selectEventListener && (document.removeEventListener(b.SELECT, this.selectEventListener), this.selectEventListener = null);
|
|
190
190
|
}
|
|
191
191
|
_setupCancelEventListener() {
|
|
192
192
|
this._removeCancelEventListener(), this.cancelEventListener = () => {
|
|
193
193
|
this._handleCancel();
|
|
194
|
-
}, document.addEventListener(
|
|
194
|
+
}, document.addEventListener(b.CANCEL, this.cancelEventListener);
|
|
195
195
|
}
|
|
196
196
|
_removeCancelEventListener() {
|
|
197
|
-
this.cancelEventListener && (document.removeEventListener(
|
|
197
|
+
this.cancelEventListener && (document.removeEventListener(b.CANCEL, this.cancelEventListener), this.cancelEventListener = null);
|
|
198
198
|
}
|
|
199
199
|
_handleCancel() {
|
|
200
200
|
try {
|
|
@@ -211,7 +211,7 @@ class H extends y {
|
|
|
211
211
|
_updateBlock(e, t) {
|
|
212
212
|
if (!this.currentNode || !("querySelector" in this.currentNode))
|
|
213
213
|
return;
|
|
214
|
-
const s = this.currentNode.querySelector(
|
|
214
|
+
const s = this.currentNode.querySelector(E);
|
|
215
215
|
if (!s)
|
|
216
216
|
return;
|
|
217
217
|
const r = this._getMergeTag(e);
|
|
@@ -231,7 +231,7 @@ class H extends y {
|
|
|
231
231
|
}
|
|
232
232
|
_checkExistingBlocks() {
|
|
233
233
|
const e = u();
|
|
234
|
-
e.isGlobalUnsubscribeDisabled = !1, e.isSubscriptionPreferencesCenterDisabled = !1, this.api.getDocumentRoot().querySelectorAll(
|
|
234
|
+
e.isGlobalUnsubscribeDisabled = !1, e.isSubscriptionPreferencesCenterDisabled = !1, this.api.getDocumentRoot().querySelectorAll(m).forEach((s) => {
|
|
235
235
|
if ("getAttribute" in s) {
|
|
236
236
|
const r = s.getAttribute(n.PAGE_TYPE);
|
|
237
237
|
if (r) {
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
const s = {
|
|
2
2
|
SELECT: "unsubscribe:select",
|
|
3
3
|
CANCEL: "unsubscribe:cancel"
|
|
4
|
-
},
|
|
4
|
+
}, b = {
|
|
5
5
|
PAGE_TYPE: "data-unsubscribe-page-type",
|
|
6
6
|
PAGE_LIST: "data-unsubscribe-page-list",
|
|
7
7
|
BLOCK_ID: "data-unsubscribe-block-id"
|
|
8
|
-
};
|
|
8
|
+
}, c = ".unsubscribe-block-v2";
|
|
9
9
|
export {
|
|
10
|
-
|
|
10
|
+
b as DATA_ATTRIBUTES,
|
|
11
|
+
c as UNSUBSCRIBE_BLOCK_SELECTOR,
|
|
11
12
|
s as UNSUBSCRIBE_EVENTS
|
|
12
13
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.2-beta.0bf502c",
|
|
4
4
|
"description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
|
|
5
5
|
"main": "./dist/guido.umd.cjs",
|
|
6
6
|
"module": "./dist/library.js",
|
|
@@ -27,6 +27,8 @@
|
|
|
27
27
|
"test": "vitest run --coverage",
|
|
28
28
|
"test:watch": "vitest",
|
|
29
29
|
"test:visual-update": "npx playwright test --update-snapshots --reporter html",
|
|
30
|
+
"test:e2e:coverage": "E2E_COVERAGE=true playwright test",
|
|
31
|
+
"coverage:e2e:report": "nyc report --reporter=lcov --reporter=text-summary --report-dir=coverage/e2e",
|
|
30
32
|
"prepare": "husky",
|
|
31
33
|
"preinstall": "rm -rf ./node_modules/.vite"
|
|
32
34
|
},
|
|
@@ -74,10 +76,12 @@
|
|
|
74
76
|
"happy-dom": "15.11.7",
|
|
75
77
|
"husky": "9.1.7",
|
|
76
78
|
"msw": "2.10.3",
|
|
79
|
+
"nyc": "17.1.0",
|
|
77
80
|
"sass": "1.69.7",
|
|
78
81
|
"typescript": "5.5.4",
|
|
79
82
|
"typescript-eslint": "8.26.0",
|
|
80
83
|
"vite-plugin-dts": "4.5.4",
|
|
84
|
+
"vite-plugin-istanbul": "7.0.0",
|
|
81
85
|
"vitest": "2.1.9",
|
|
82
86
|
"vue-tsc": "2.2.10"
|
|
83
87
|
},
|
|
@@ -90,6 +94,11 @@
|
|
|
90
94
|
"msw": {
|
|
91
95
|
"workerDirectory": "public"
|
|
92
96
|
},
|
|
97
|
+
"nyc": {
|
|
98
|
+
"report-dir": "coverage/e2e",
|
|
99
|
+
"reporter": ["lcov", "text-summary"],
|
|
100
|
+
"all": false
|
|
101
|
+
},
|
|
93
102
|
"guido": {
|
|
94
103
|
"stripo": {
|
|
95
104
|
"version": "2.65.0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|