@useinsider/guido 3.26.0-beta.d0b09c0 → 3.26.0-beta.eba5834
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +26 -25
- package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.js +1 -1
- package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue2.js +43 -25
- package/dist/config/migrator/unsubscribeMigrator.js +100 -114
- package/dist/extensions/Blocks/Unsubscribe/block.js +96 -104
- package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +3 -4
- package/dist/guido.css +1 -1
- package/dist/package.json.js +2 -2
- package/dist/src/extensions/Blocks/Unsubscribe/utils/constants.d.ts +0 -1
- package/dist/src/stores/onboarding.d.ts +1 -0
- package/dist/stores/onboarding.js +9 -6
- package/package.json +1 -1
- package/dist/extensions/Blocks/Unsubscribe/utils/swapMergeTagInHref.js +0 -5
- package/dist/src/extensions/Blocks/Unsubscribe/utils/swapMergeTagInHref.d.ts +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as ye, defineAsyncComponent as a, ref as W, computed as l, watch as G, onMounted as be, onUnmounted as ve } from "vue";
|
|
2
2
|
import { useCortexBlueprintBridge as Se } from "../composables/useCortexBlueprintBridge.js";
|
|
3
3
|
import { useEditorLock as he } from "../composables/useEditorLock.js";
|
|
4
4
|
import { startEditorOpenMetrics as Ee } from "../composables/useEditorOpenMetrics.js";
|
|
@@ -9,10 +9,10 @@ import { useSaveValidationRollout as Te } from "../composables/useSaveValidation
|
|
|
9
9
|
import { useStripo as ke } from "../composables/useStripo.js";
|
|
10
10
|
import { useTimerClone as Fe } from "../composables/useTimerClone.js";
|
|
11
11
|
import { useToaster as Ie } from "../composables/useToaster.js";
|
|
12
|
-
import { useTranslations as
|
|
13
|
-
import { migrate as
|
|
12
|
+
import { useTranslations as Le } from "../composables/useTranslations.js";
|
|
13
|
+
import { migrate as Me } from "../config/migrator/index.js";
|
|
14
14
|
import { ModuleFolderDefaults as $ } from "../enums/defaults.js";
|
|
15
|
-
import { RIBBON_SELECTOR as
|
|
15
|
+
import { RIBBON_SELECTOR as Re } from "../enums/onboarding.js";
|
|
16
16
|
import { ToasterTypeOptions as Ue } from "../enums/toaster.js";
|
|
17
17
|
import { useRecommendationExtensionStore as z, disposeStrategyPageReturnListeners as Oe } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
18
18
|
import { disposeUnsubscribeListeners as Ne } from "../extensions/Blocks/Unsubscribe/block.js";
|
|
@@ -30,12 +30,13 @@ import { useStripoApi as ze } from "../services/stripoApi.js";
|
|
|
30
30
|
import { useConfigStore as qe } from "../stores/config.js";
|
|
31
31
|
import { useDynamicContentStore as Ke } from "../stores/dynamic-content.js";
|
|
32
32
|
import { useEditorStore as C } from "../stores/editor.js";
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
33
|
+
import { useOnboardingStore as je } from "../stores/onboarding.js";
|
|
34
|
+
import { usePreviewStore as Je } from "../stores/preview.js";
|
|
35
|
+
import { useSaveValidationStore as Qe } from "../stores/save-validation.js";
|
|
36
|
+
import { useTemplateStore as Xe } from "../stores/template.js";
|
|
37
|
+
import { useUnsubscribeStore as Ye } from "../stores/unsubscribe.js";
|
|
37
38
|
import { readTrackFloor as q } from "../utils/linkTrackingIds.js";
|
|
38
|
-
const
|
|
39
|
+
const Pt = /* @__PURE__ */ ye({
|
|
39
40
|
__name: "Guido",
|
|
40
41
|
props: {
|
|
41
42
|
config: null,
|
|
@@ -57,9 +58,9 @@ const _t = /* @__PURE__ */ ge({
|
|
|
57
58
|
() => import("./organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js")
|
|
58
59
|
), te = a(
|
|
59
60
|
() => import("./organisms/unsubscribe/LegacyUnsubscribeConvertedModal.vue.js")
|
|
60
|
-
),
|
|
61
|
+
), g = W(), y = Ke(), w = Ye(), o = qe();
|
|
61
62
|
c.ready && o.init(c.config);
|
|
62
|
-
const d = C(), oe =
|
|
63
|
+
const d = C(), oe = Je(), p = l(() => d.hasChanges), { isTestPartner: ne } = we(), { isEnabled: re, loadRollout: T } = Te(), { showToaster: k } = Ie(), F = Le(), I = () => {
|
|
63
64
|
var t;
|
|
64
65
|
if (d.isVersionHistoryOpen) {
|
|
65
66
|
console.debug("guido:save:silent:blocked", { isVersionHistoryOpen: !0 }), k({
|
|
@@ -69,7 +70,7 @@ const _t = /* @__PURE__ */ ge({
|
|
|
69
70
|
return;
|
|
70
71
|
}
|
|
71
72
|
return (t = D.value) == null ? void 0 : t.saveSilent();
|
|
72
|
-
},
|
|
73
|
+
}, L = (t) => {
|
|
73
74
|
d.loadingStatus = t;
|
|
74
75
|
};
|
|
75
76
|
Se(), De();
|
|
@@ -83,7 +84,7 @@ const _t = /* @__PURE__ */ ge({
|
|
|
83
84
|
savedModulesFolderName: ((t = o.editor) == null ? void 0 : t.savedModulesFolderName) || $.SAVED_MODULES,
|
|
84
85
|
defaultModulesFolderName: ((e = o.editor) == null ? void 0 : e.defaultModulesFolderName) || $.DEFAULT_MODULES
|
|
85
86
|
};
|
|
86
|
-
}, { initPlugin:
|
|
87
|
+
}, { initPlugin: M, preloadRuntime: R } = ke(r), { runExclusive: U, beginMount: O, isCurrentMount: v } = he();
|
|
87
88
|
let f = 0;
|
|
88
89
|
const { getDefaultTemplate: N } = ze(), { cloneTimersOnSave: _, hasTimerBlocks: A } = Fe(), se = l(() => {
|
|
89
90
|
var t;
|
|
@@ -109,7 +110,7 @@ const _t = /* @__PURE__ */ ge({
|
|
|
109
110
|
}
|
|
110
111
|
});
|
|
111
112
|
const P = (t) => {
|
|
112
|
-
console.debug("dynamic-content:close", t),
|
|
113
|
+
console.debug("dynamic-content:close", t), y.setSelectedDynamicContent(t), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: t }));
|
|
113
114
|
}, x = () => {
|
|
114
115
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
115
116
|
};
|
|
@@ -123,8 +124,8 @@ const _t = /* @__PURE__ */ ge({
|
|
|
123
124
|
let m = null;
|
|
124
125
|
const h = () => {
|
|
125
126
|
var e;
|
|
126
|
-
const t = document.querySelector(
|
|
127
|
-
(e =
|
|
127
|
+
const t = document.querySelector(Re);
|
|
128
|
+
(e = g.value) == null || e.style.setProperty("--ribbon-offset", `${(t == null ? void 0 : t.offsetHeight) ?? 0}px`);
|
|
128
129
|
}, E = async () => {
|
|
129
130
|
var t;
|
|
130
131
|
r.mark("host_ready");
|
|
@@ -143,9 +144,9 @@ const _t = /* @__PURE__ */ ge({
|
|
|
143
144
|
rrsEnabled: o.isFeatureEnabled("reusableRecommendationStrategy")
|
|
144
145
|
}, ue = {
|
|
145
146
|
itemsPriceFormatting: o.isFeatureEnabled("itemsPriceFormatting")
|
|
146
|
-
}, V = (
|
|
147
|
+
}, V = (ge) => r.timed(
|
|
147
148
|
"migration",
|
|
148
|
-
() =>
|
|
149
|
+
() => Me(ge, me, le, ue)
|
|
149
150
|
);
|
|
150
151
|
let n = {
|
|
151
152
|
html: i && await V(i),
|
|
@@ -160,16 +161,16 @@ const _t = /* @__PURE__ */ ge({
|
|
|
160
161
|
console.debug("guido:ready"), s("ready");
|
|
161
162
|
}
|
|
162
163
|
};
|
|
163
|
-
f = O(), await
|
|
164
|
+
f = O(), await M(n, b(), fe, n.html !== i), y.selectedDynamicContentList = B;
|
|
164
165
|
} catch (e) {
|
|
165
166
|
console.error("Failed to initialize Stripo editor:", e), r.markFailed();
|
|
166
167
|
}
|
|
167
168
|
};
|
|
168
169
|
return be(async () => {
|
|
169
170
|
var e;
|
|
170
|
-
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), z().$reset(), C().$reset(),
|
|
171
|
-
const t = (e =
|
|
172
|
-
if (t && (m = new ResizeObserver(h), m.observe(t)),
|
|
171
|
+
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow"), z().$reset(), C().$reset(), Xe().$reset(), Qe().$reset(), je().forgetSessionClose("recommendationLegacyStrategyOnboarding"), T(), h();
|
|
172
|
+
const t = (e = g.value) == null ? void 0 : e.parentElement;
|
|
173
|
+
if (t && (m = new ResizeObserver(h), m.observe(t)), R(), c.ready)
|
|
173
174
|
await E();
|
|
174
175
|
else {
|
|
175
176
|
const i = G(() => c.ready, (u) => {
|
|
@@ -202,10 +203,10 @@ const _t = /* @__PURE__ */ ge({
|
|
|
202
203
|
},
|
|
203
204
|
hasChanges: p,
|
|
204
205
|
saveSilent: I,
|
|
205
|
-
setLoading:
|
|
206
|
-
}), { __sfc: !0, openMetrics: r, PreviewContainer: J, OnboardingWrapper: Q, AssignStrategyDrawer: X, RemoveStrategyModal: Y, DisplayConditionsHost: Z, autoSaveControllerRef: D, LegacyStrategyUpdatedModal: ee, LegacyUnsubscribeConvertedModal: te, wrapperRef:
|
|
206
|
+
setLoading: L
|
|
207
|
+
}), { __sfc: !0, openMetrics: r, PreviewContainer: J, OnboardingWrapper: Q, AssignStrategyDrawer: X, RemoveStrategyModal: Y, DisplayConditionsHost: Z, autoSaveControllerRef: D, LegacyStrategyUpdatedModal: ee, LegacyUnsubscribeConvertedModal: te, wrapperRef: g, dynamicContentStore: y, unsubscribeStore: w, props: c, configStore: o, editorStore: d, previewStore: oe, hasChanges: p, isTestPartner: ne, isSaveValidationEnabled: re, loadRollout: T, showToaster: k, trans: F, saveSilent: I, setLoading: L, emit: s, buildMetadata: b, initPlugin: M, preloadRuntime: R, runExclusive: U, beginMount: O, isCurrentMount: v, mountGeneration: f, getDefaultTemplate: N, cloneTimersOnSave: _, hasTimerBlocks: A, noHeader: se, isRrsEnabled: ie, isExternalDisplayConditionsEnabled: ae, isLegacyUnsubscribeConversionEnabled: ce, hasAssignedStrategy: de, insertDynamicContent: P, closeDynamicContent: x, handleDynamicContentOpen: S, ribbonObserver: m, updateRibbonOffset: h, startEditor: E, AutoSaveController: Ae, AuthErrorModal: Pe, Toaster: xe, FilterSelectionDrawer: Be, HeaderWrapper: He, LoadingWrapper: Ve, SaveAsTemplateDrawer: We, UnsubscribeWrapper: Ge, ValidationErrorDrawer: $e };
|
|
207
208
|
}
|
|
208
209
|
});
|
|
209
210
|
export {
|
|
210
|
-
|
|
211
|
+
Pt as default
|
|
211
212
|
};
|
|
@@ -1,46 +1,64 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useRibbonOffset as
|
|
3
|
-
import { useTranslations as
|
|
4
|
-
import { ACADEMY_LINKS as
|
|
5
|
-
import { useOnboardingStore as
|
|
6
|
-
import { InOnboard as
|
|
7
|
-
const
|
|
1
|
+
import { defineComponent as _, computed as E, watch as L, onBeforeUnmount as O } from "vue";
|
|
2
|
+
import { useRibbonOffset as S } from "../../../composables/useRibbonOffset.js";
|
|
3
|
+
import { useTranslations as C } from "../../../composables/useTranslations.js";
|
|
4
|
+
import { ACADEMY_LINKS as h } from "../../../enums/academy.js";
|
|
5
|
+
import { useOnboardingStore as k } from "../../../stores/onboarding.js";
|
|
6
|
+
import { InOnboard as v } from "@useinsider/design-system-vue";
|
|
7
|
+
const D = /* @__PURE__ */ _({
|
|
8
8
|
__name: "RecommendationLegacyStrategyOnboarding",
|
|
9
|
-
setup(
|
|
10
|
-
const
|
|
9
|
+
setup(B) {
|
|
10
|
+
const a = "recommendationLegacyStrategyOnboarding", l = "#guido__btn-update-legacy-strategy", r = C(), t = k(), { getTopPosition: m } = S(), u = `<a href="${h.EMAIL_RECOMMENDATION_BLOCK}" target="_blank" rel="noopener noreferrer">${r("action-builder.visit-academy")}</a>`, g = () => [
|
|
11
11
|
{
|
|
12
12
|
classes: "guido-recommendation-legacy-strategy-onboarding",
|
|
13
13
|
right: "40px",
|
|
14
|
-
top:
|
|
14
|
+
top: m(485),
|
|
15
15
|
position: "Top Right",
|
|
16
|
-
title:
|
|
17
|
-
description:
|
|
18
|
-
academyLink:
|
|
16
|
+
title: r("email-editor.onboarding-recommendation-strategy-legacy-title"),
|
|
17
|
+
description: r("email-editor.onboarding-recommendation-strategy-legacy-description", {
|
|
18
|
+
academyLink: u
|
|
19
19
|
}),
|
|
20
20
|
imageSource: "",
|
|
21
21
|
backButtonClick: () => {
|
|
22
22
|
},
|
|
23
23
|
nextButtonType: "text",
|
|
24
|
-
nextButtonText:
|
|
24
|
+
nextButtonText: r("action-builder.ok"),
|
|
25
25
|
nextButtonClick: () => {
|
|
26
|
-
t.close(
|
|
26
|
+
t.close(a);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
],
|
|
29
|
+
], f = E(
|
|
30
30
|
() => t.onboardings.recommendationLegacyStrategyOnboarding.config.length > 0 && t.onboardings.recommendationLegacyStrategyOnboarding.isActive
|
|
31
|
-
),
|
|
32
|
-
var
|
|
33
|
-
(
|
|
31
|
+
), b = () => {
|
|
32
|
+
var n, y;
|
|
33
|
+
(y = (n = t.getRecommendationLegacyStrategyCurrentCard) == null ? void 0 : n.nextButtonClick) == null || y.call(n);
|
|
34
34
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
(
|
|
38
|
-
|
|
35
|
+
let e = null;
|
|
36
|
+
const c = ({ target: n }) => {
|
|
37
|
+
n instanceof Element && n.closest("ue-control-panel") && t.closeForSession(a);
|
|
38
|
+
};
|
|
39
|
+
let o = null;
|
|
40
|
+
const d = () => {
|
|
41
|
+
var n;
|
|
42
|
+
return !!((n = e == null ? void 0 : e.querySelector(l)) != null && n.getClientRects().length);
|
|
43
|
+
}, i = ({ target: n }) => {
|
|
44
|
+
!(n instanceof Element) || !n.closest("ue-control-panel") || o !== null || (o = requestAnimationFrame(() => {
|
|
45
|
+
o = null, d() || t.closeForSession(a);
|
|
46
|
+
}));
|
|
47
|
+
}, s = () => {
|
|
48
|
+
e == null || e.removeEventListener("scroll", c, !0), e == null || e.removeEventListener("click", i, !0), e == null || e.removeEventListener("keyup", i, !0), e = null, o !== null && (cancelAnimationFrame(o), o = null);
|
|
49
|
+
}, p = () => {
|
|
50
|
+
var n;
|
|
51
|
+
e = ((n = document.querySelector("ui-editor")) == null ? void 0 : n.shadowRoot) ?? null, e == null || e.addEventListener("scroll", c, !0), e == null || e.addEventListener("click", i, !0), e == null || e.addEventListener("keyup", i, !0);
|
|
52
|
+
};
|
|
53
|
+
return L(
|
|
54
|
+
() => t.isActive(a),
|
|
55
|
+
(n) => {
|
|
56
|
+
n ? (t.setConfig(a, g()), p()) : s();
|
|
39
57
|
},
|
|
40
58
|
{ immediate: !0 }
|
|
41
|
-
), { __sfc: !0, ONBOARDING_TYPE:
|
|
59
|
+
), O(s), { __sfc: !0, ONBOARDING_TYPE: a, UPDATE_BUTTON_SELECTOR: l, trans: r, onboardingStore: t, getTopPosition: m, academyLink: u, buildOnboardingCards: g, isVisible: f, handleNext: b, editorRoot: e, handlePanelScroll: c, pendingCheck: o, isUpdateButtonVisible: d, handlePanelInteraction: i, stopWatchingPanel: s, startWatchingPanel: p, InOnboard: v };
|
|
42
60
|
}
|
|
43
61
|
});
|
|
44
62
|
export {
|
|
45
|
-
|
|
63
|
+
D as default
|
|
46
64
|
};
|
|
@@ -1,160 +1,146 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { MERGE_TAGS as
|
|
5
|
-
import { UNSUBSCRIBE_BLOCK_SELECTOR as
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
import { useUnsubscribeStore as M } from "../../stores/unsubscribe.js";
|
|
9
|
-
import { escapeHtml as A } from "../../utils/htmlEscape.js";
|
|
10
|
-
const S = "unsubscribe", N = "You can ", R = " from our emails, if you need to.", C = "{-{-UNSUBSCRIBE-LINK-}-}";
|
|
11
|
-
class H {
|
|
1
|
+
var x = Object.defineProperty;
|
|
2
|
+
var B = (c, e, r) => e in c ? x(c, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : c[e] = r;
|
|
3
|
+
var A = (c, e, r) => B(c, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import { MERGE_TAGS as f, PAGE_TYPES as p } from "../../enums/unsubscribe.js";
|
|
5
|
+
import { UNSUBSCRIBE_BLOCK_SELECTOR as h, DATA_ATTRIBUTES as k } from "../../extensions/Blocks/Unsubscribe/utils/constants.js";
|
|
6
|
+
import { useUnsubscribeStore as C } from "../../stores/unsubscribe.js";
|
|
7
|
+
class $ {
|
|
12
8
|
constructor() {
|
|
13
|
-
|
|
9
|
+
A(this, "parser");
|
|
14
10
|
this.parser = new DOMParser();
|
|
15
11
|
}
|
|
16
12
|
async migrate(e) {
|
|
17
13
|
try {
|
|
18
|
-
const
|
|
19
|
-
if (
|
|
20
|
-
const
|
|
21
|
-
await
|
|
14
|
+
const r = this.parser.parseFromString(e, "text/html"), t = r.querySelectorAll("td.unsubscribe-block");
|
|
15
|
+
if (t.length) {
|
|
16
|
+
const s = C();
|
|
17
|
+
await s.fetchTemplates(), this.migrateLegacyBlocks(t, s);
|
|
22
18
|
}
|
|
23
|
-
const
|
|
24
|
-
return !
|
|
25
|
-
} catch (
|
|
26
|
-
return console.error("UnsubscribeMigrator failed:",
|
|
19
|
+
const n = this.repairUnsubscribeLinks(r);
|
|
20
|
+
return !t.length && !n ? e : r.documentElement.outerHTML;
|
|
21
|
+
} catch (r) {
|
|
22
|
+
return console.error("UnsubscribeMigrator failed:", r), e;
|
|
27
23
|
}
|
|
28
24
|
}
|
|
29
|
-
migrateLegacyBlocks(e,
|
|
30
|
-
e.forEach((
|
|
31
|
-
const
|
|
25
|
+
migrateLegacyBlocks(e, r) {
|
|
26
|
+
e.forEach((t) => {
|
|
27
|
+
const n = t.getAttribute("id"), s = this.extractPaddingClass(t), l = t.getAttribute("bgcolor") || "", a = this.extractUnsubscribeContent(t), o = this.getCollectionTypeFromMergeTag(a.linkHref), b = r.getSelectedUnsubscribePagesByCollection(o);
|
|
32
28
|
console.debug("[UnsubscribeMigrator]", {
|
|
33
29
|
mergeTag: a.linkHref,
|
|
34
|
-
collectionType:
|
|
35
|
-
pageIds:
|
|
36
|
-
paddingClass:
|
|
37
|
-
bgColor:
|
|
30
|
+
collectionType: o,
|
|
31
|
+
pageIds: b,
|
|
32
|
+
paddingClass: s,
|
|
33
|
+
bgColor: l
|
|
38
34
|
});
|
|
39
|
-
const
|
|
35
|
+
const u = this.buildUnsubscribeBlock(
|
|
40
36
|
a,
|
|
37
|
+
o,
|
|
41
38
|
b,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
`<table id="tempDoc"><tbody><tr>${l}</tr></tbody></table>`,
|
|
39
|
+
s,
|
|
40
|
+
l
|
|
41
|
+
), i = this.parser.parseFromString(
|
|
42
|
+
`<table id="tempDoc"><tbody><tr>${u}</tr></tbody></table>`,
|
|
47
43
|
"text/html"
|
|
48
|
-
).querySelector(
|
|
49
|
-
|
|
44
|
+
).querySelector(h);
|
|
45
|
+
i && t.parentNode && (i.setAttribute("id", n || ""), t.parentNode.replaceChild(i, t));
|
|
50
46
|
});
|
|
51
47
|
}
|
|
52
|
-
// The compiler resolves a typed tag only through a block that lists pages, so a page-less block carries no tag.
|
|
53
|
-
collectBlockTags(e, t) {
|
|
54
|
-
const r = /* @__PURE__ */ new Set();
|
|
55
|
-
return e.querySelectorAll(y).forEach((s) => {
|
|
56
|
-
var a, b, u;
|
|
57
|
-
if (!P(s.getAttribute(d.PAGE_LIST) || "").length)
|
|
58
|
-
return;
|
|
59
|
-
const i = Number(s.getAttribute(d.PAGE_TYPE)), n = c[i];
|
|
60
|
-
if (n) {
|
|
61
|
-
r.add(n);
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
const o = (u = (b = (a = this.findLinkCandidates(s).primary) == null ? void 0 : a.getAttribute("href")) == null ? void 0 : b.match(h)) == null ? void 0 : u[0];
|
|
65
|
-
o && r.add(c[this.getCollectionTypeFromMergeTag(o)]);
|
|
66
|
-
}), e.querySelectorAll("td.unsubscribe-block").forEach((s) => {
|
|
67
|
-
const i = this.getCollectionTypeFromMergeTag(this.getLegacyLinkTag(s));
|
|
68
|
-
t.getSelectedUnsubscribePagesByCollection(i).length && r.add(c[i]);
|
|
69
|
-
}), r;
|
|
70
|
-
}
|
|
71
|
-
// Mirrors extractUnsubscribeContent: without a <p> the block migrates on the default tag.
|
|
72
|
-
getLegacyLinkTag(e) {
|
|
73
|
-
var r, s;
|
|
74
|
-
const { primary: t } = this.findLinkCandidates(e);
|
|
75
|
-
return !t || !(t.closest("p") || e.querySelector("p")) ? c.default : ((s = (r = t.getAttribute("href")) == null ? void 0 : r.match(h)) == null ? void 0 : s[0]) ?? c.default;
|
|
76
|
-
}
|
|
77
48
|
// Re-derives the typed merge tag from data-unsubscribe-page-type for any v2
|
|
78
49
|
// block whose anchor href is missing or the legacy default. Returns true when
|
|
79
50
|
// at least one href was rewritten. Typed tags and custom URLs are left intact.
|
|
80
51
|
repairUnsubscribeLinks(e) {
|
|
81
|
-
const
|
|
82
|
-
let
|
|
83
|
-
return
|
|
84
|
-
const
|
|
85
|
-
if (!
|
|
52
|
+
const r = e.querySelectorAll(`${h}[${k.PAGE_TYPE}]`);
|
|
53
|
+
let t = !1;
|
|
54
|
+
return r.forEach((n) => {
|
|
55
|
+
const s = n.querySelector('a[data-unsubscribe-link="true"], a.unsubscribe-link');
|
|
56
|
+
if (!s)
|
|
86
57
|
return;
|
|
87
|
-
const
|
|
88
|
-
if (
|
|
58
|
+
const l = s.getAttribute("href") || "";
|
|
59
|
+
if (l && l !== f.default)
|
|
89
60
|
return;
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
}),
|
|
61
|
+
const a = Number(n.getAttribute(k.PAGE_TYPE)), o = f[a];
|
|
62
|
+
o && (s.setAttribute("href", o), t = !0);
|
|
63
|
+
}), t;
|
|
93
64
|
}
|
|
94
65
|
extractPaddingClass(e) {
|
|
95
|
-
const
|
|
96
|
-
return
|
|
97
|
-
}
|
|
98
|
-
hasVisibleContent(e) {
|
|
99
|
-
var t;
|
|
100
|
-
return !!((t = e.textContent) != null && t.trim() || e.querySelector("img"));
|
|
66
|
+
const t = (e.getAttribute("class") || "").match(/\bes-p\d+\b/);
|
|
67
|
+
return t ? t[0] : "";
|
|
101
68
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
69
|
+
extractUnsubscribeContent(e) {
|
|
70
|
+
var d;
|
|
71
|
+
const r = e.querySelector("a.unsubscribe-link") || e.querySelector('a[href*="unsubscribe"]'), t = (r == null ? void 0 : r.closest("p")) || e.querySelector("p");
|
|
72
|
+
if (!t)
|
|
73
|
+
return {
|
|
74
|
+
textBefore: "You can ",
|
|
75
|
+
linkText: "unsubscribe",
|
|
76
|
+
linkHref: "{{ins-unsubscribe-link}}",
|
|
77
|
+
linkStyle: "",
|
|
78
|
+
textAfter: " from our emails, if you need to.",
|
|
79
|
+
isBold: !1,
|
|
80
|
+
isItalic: !1,
|
|
81
|
+
align: "center",
|
|
82
|
+
paragraphStyle: ""
|
|
83
|
+
};
|
|
84
|
+
const n = e.getAttribute("align") || t.getAttribute("align") || "center", s = t.getAttribute("style") || "";
|
|
85
|
+
if (!r)
|
|
86
|
+
return {
|
|
87
|
+
textBefore: "You can ",
|
|
88
|
+
linkText: "unsubscribe",
|
|
89
|
+
linkHref: "{{ins-unsubscribe-link}}",
|
|
90
|
+
linkStyle: "",
|
|
91
|
+
textAfter: " from our emails, if you need to.",
|
|
92
|
+
isBold: !1,
|
|
93
|
+
isItalic: !1,
|
|
94
|
+
align: n,
|
|
95
|
+
paragraphStyle: s
|
|
96
|
+
};
|
|
97
|
+
const l = ((d = r.textContent) == null ? void 0 : d.trim()) || "unsubscribe", a = r.getAttribute("href") || "{{ins-unsubscribe-link}}", o = r.getAttribute("style") || "", b = t.textContent || "", u = b.indexOf(l), g = u >= 0 ? b.substring(0, u).trim() : "You can ", i = u >= 0 ? b.substring(u + l.length).trim() : " from our emails, if you need to.", m = !!t.querySelector("b, strong"), y = !!t.querySelector("i, em");
|
|
98
|
+
return {
|
|
99
|
+
textBefore: g,
|
|
100
|
+
linkText: l,
|
|
101
|
+
linkHref: this.normalizeUnsubscribeHref(a),
|
|
102
|
+
linkStyle: o,
|
|
103
|
+
textAfter: i,
|
|
104
|
+
isBold: m,
|
|
105
|
+
isItalic: y,
|
|
106
|
+
align: n,
|
|
107
|
+
paragraphStyle: s
|
|
117
108
|
};
|
|
118
|
-
if (!o || (a.align = e.getAttribute("align") || o.getAttribute("align") || "center", n || (a.paragraphStyle = o.getAttribute("style") || ""), !i))
|
|
119
|
-
return a;
|
|
120
|
-
if (a.linkText = this.hasVisibleContent(i) ? i.innerHTML.trim() : S, a.linkHref = this.normalizeUnsubscribeHref(i.getAttribute("href") || c.default), a.linkStyle = i.getAttribute("style") || "", n) {
|
|
121
|
-
const b = this.getCollectionTypeFromMergeTag(a.linkHref), u = c[b];
|
|
122
|
-
r.querySelectorAll("a[href]").forEach((l) => {
|
|
123
|
-
var m;
|
|
124
|
-
const p = l.getAttribute("href") || "", g = (m = p.match(h)) == null ? void 0 : m[0];
|
|
125
|
-
g && l.setAttribute("href", B(p, t.has(g) ? g : u));
|
|
126
|
-
}), s.filter((l) => l !== i && !this.hasVisibleContent(l)).forEach((l) => l.replaceWith(...Array.from(l.childNodes))), i.replaceWith(r.ownerDocument.createTextNode(C)), a.footerHtml = r.innerHTML.trim();
|
|
127
|
-
}
|
|
128
|
-
return a;
|
|
129
109
|
}
|
|
130
|
-
buildUnsubscribeBlock(e, t,
|
|
131
|
-
const
|
|
110
|
+
buildUnsubscribeBlock(e, r, t, n, s) {
|
|
111
|
+
const l = e.linkStyle ? ` style="${e.linkStyle}"` : "", u = `<a ${`href="${Object.values(f).includes(e.linkHref) ? f[r] : e.linkHref}" class="unsubscribe-link" target="_blank" data-unsubscribe-link="true"`}${l}>${e.linkText}</a>`, g = [];
|
|
112
|
+
e.textBefore && g.push(e.textBefore), g.push(u), e.textAfter && g.push(e.textAfter);
|
|
113
|
+
let i = g.join(" ");
|
|
114
|
+
e.isBold && e.isItalic ? i = `<strong path="1,0"><em path="1,0,0">${i}</em></strong>` : e.isBold ? i = `<strong path="1,0">${i}</strong>` : e.isItalic && (i = `<em path="1,0">${i}</em>`);
|
|
115
|
+
const m = e.align ? ` align="${e.align}"` : "", y = s ? ` bgcolor="${s}"` : "", d = e.paragraphStyle ? ` style="${e.paragraphStyle}"` : "", T = t.length > 0 ? ` ${k.PAGE_LIST}="${t.join(",")}"` : "", E = ` ${k.PAGE_TYPE}="${r}"`, S = "esd-block-text unsubscribe-block-v2 esd-block-unsubscribe esd-unsubscribe-block esd-extension-block";
|
|
132
116
|
return `
|
|
133
117
|
<td
|
|
134
118
|
data-migration="true"
|
|
135
119
|
esd-extension-block-id="unsubscribe-block"
|
|
136
|
-
class="${
|
|
137
|
-
${
|
|
120
|
+
class="${n ? `${S} ${n}` : S}"
|
|
121
|
+
${m}${y}${E}${T}
|
|
138
122
|
>
|
|
139
|
-
${
|
|
123
|
+
<p path="1"${d}>
|
|
124
|
+
${i}
|
|
125
|
+
</p>
|
|
140
126
|
</td>
|
|
141
127
|
`;
|
|
142
128
|
}
|
|
143
129
|
getCollectionTypeFromMergeTag(e) {
|
|
144
|
-
return e ===
|
|
130
|
+
return e === f[p.SUBSCRIPTION_PREFERENCE_CENTER] ? p.SUBSCRIPTION_PREFERENCE_CENTER : e === f[p.GLOBAL_UNSUBSCRIBE] ? p.GLOBAL_UNSUBSCRIBE : p.GLOBAL_UNSUBSCRIBE;
|
|
145
131
|
}
|
|
146
132
|
normalizeUnsubscribeHref(e) {
|
|
147
|
-
if (Object.values(
|
|
133
|
+
if (Object.values(f).includes(e))
|
|
148
134
|
return e;
|
|
149
|
-
const
|
|
150
|
-
return
|
|
135
|
+
const t = e.match(/{{ins-(?:global-)?(?:preferences-)?unsubscribe-link}}/);
|
|
136
|
+
return t ? t[0] : e.includes("unsubscribe") || e.includes("unsub") ? (console.warn(
|
|
151
137
|
`[UnsubscribeMigrator] Unrecognized unsubscribe href format: "${e}". Defaulting to {{ins-unsubscribe-link}}`
|
|
152
138
|
), "{{ins-unsubscribe-link}}") : e;
|
|
153
139
|
}
|
|
154
140
|
}
|
|
155
|
-
async function
|
|
156
|
-
return new
|
|
141
|
+
async function M(c) {
|
|
142
|
+
return new $().migrate(c);
|
|
157
143
|
}
|
|
158
144
|
export {
|
|
159
|
-
|
|
145
|
+
M as migrateUnsubscribe
|
|
160
146
|
};
|
|
@@ -1,49 +1,48 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { useToaster as
|
|
5
|
-
import { ToasterTypeOptions as
|
|
6
|
-
import { PAGE_TYPES as
|
|
7
|
-
import { useEditorStore as
|
|
8
|
-
import { useUnsubscribeStore as
|
|
9
|
-
import { Block as
|
|
10
|
-
import { getDefaultTemplate as
|
|
11
|
-
import { UNSUBSCRIBE_BLOCK_SELECTOR as
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
[
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
N(), U();
|
|
1
|
+
var y = Object.defineProperty;
|
|
2
|
+
var I = (c, o, e) => o in c ? y(c, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[o] = e;
|
|
3
|
+
var g = (c, o, e) => I(c, typeof o != "symbol" ? o + "" : o, e);
|
|
4
|
+
import { useToaster as L } from "../../../composables/useToaster.js";
|
|
5
|
+
import { ToasterTypeOptions as C } from "../../../enums/toaster.js";
|
|
6
|
+
import { PAGE_TYPES as m } from "../../../enums/unsubscribe.js";
|
|
7
|
+
import { useEditorStore as N } from "../../../stores/editor.js";
|
|
8
|
+
import { useUnsubscribeStore as a } from "../../../stores/unsubscribe.js";
|
|
9
|
+
import { Block as U, BlockCompositionType as R, ContextActionType as f, ModificationDescription as u, BlockType as v } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
10
|
+
import { getDefaultTemplate as D } from "./template.js";
|
|
11
|
+
import { UNSUBSCRIBE_BLOCK_SELECTOR as B, DATA_ATTRIBUTES as n, UNSUBSCRIBE_EVENTS as h } from "./utils/constants.js";
|
|
12
|
+
import { parsePageList as S } from "./utils/utils.js";
|
|
13
|
+
const w = "unsubscribe-block", E = 'a[data-unsubscribe-link="true"]', P = "{{ins-unsubscribe-link}}", x = "https://academy.insiderone.com/docs/adding-unsubscribe-pages-into-emails", G = "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.", M = {
|
|
14
|
+
[m.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
|
|
15
|
+
[m.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
|
|
16
|
+
}, O = 3;
|
|
17
|
+
let d = null, p = null;
|
|
18
|
+
const A = () => {
|
|
19
|
+
d && (document.removeEventListener(h.SELECT, d), d = null);
|
|
20
|
+
}, T = () => {
|
|
21
|
+
p && (document.removeEventListener(h.CANCEL, p), p = null);
|
|
22
|
+
}, q = () => {
|
|
23
|
+
A(), T();
|
|
25
24
|
};
|
|
26
|
-
class
|
|
25
|
+
class J extends U {
|
|
27
26
|
constructor() {
|
|
28
27
|
super();
|
|
29
|
-
|
|
28
|
+
g(this, "currentNode");
|
|
30
29
|
// Per-block "did this instance have a link last time we saw it?" tracking.
|
|
31
30
|
// Keyed by the stable `data-unsubscribe-block-id` we assign, because
|
|
32
31
|
// ImmutableHtmlNode instances are recreated on every document mutation and
|
|
33
32
|
// can't be used as Map keys directly. A singleton boolean here would be
|
|
34
33
|
// polluted across blocks since Stripo fires onDocumentChanged per-instance.
|
|
35
|
-
|
|
34
|
+
g(this, "linkStateByBlockId", /* @__PURE__ */ new Map());
|
|
36
35
|
// Per-block prepend retry counter for the leading text guard (SD-143097).
|
|
37
|
-
|
|
36
|
+
g(this, "guardAttemptsByBlockId", /* @__PURE__ */ new Map());
|
|
38
37
|
}
|
|
39
38
|
getId() {
|
|
40
|
-
return
|
|
39
|
+
return w;
|
|
41
40
|
}
|
|
42
41
|
getIcon() {
|
|
43
42
|
return "unsubscribe-icon";
|
|
44
43
|
}
|
|
45
44
|
getBlockCompositionType() {
|
|
46
|
-
return
|
|
45
|
+
return R.BLOCK;
|
|
47
46
|
}
|
|
48
47
|
getName() {
|
|
49
48
|
return this.api.translate("Unsubscribe Block");
|
|
@@ -52,16 +51,16 @@ class se extends P {
|
|
|
52
51
|
return this.api.translate("Unsubscribe Block Description");
|
|
53
52
|
}
|
|
54
53
|
getTemplate() {
|
|
55
|
-
return
|
|
54
|
+
return D();
|
|
56
55
|
}
|
|
57
56
|
getContextActionsIds() {
|
|
58
|
-
return [
|
|
57
|
+
return [f.MOVE, f.REMOVE];
|
|
59
58
|
}
|
|
60
59
|
onSelect(e) {
|
|
61
|
-
if (this.currentNode = e,
|
|
60
|
+
if (this.currentNode = e, N().isPreviewModeOpen)
|
|
62
61
|
return;
|
|
63
62
|
const t = this._getOrAssignBlockId(e);
|
|
64
|
-
t && this.linkStateByBlockId.set(t, this._hasUnsubscribeLink(e)), this._setupSelectEventListener(), this._setupCancelEventListener(t), !("getAttribute" in e && e.getAttribute("data-migration")) && (this._resetStoreState(), t && (
|
|
63
|
+
t && this.linkStateByBlockId.set(t, this._hasUnsubscribeLink(e)), this._setupSelectEventListener(), this._setupCancelEventListener(t), !("getAttribute" in e && e.getAttribute("data-migration")) && (this._resetStoreState(), t && (a().pendingBlockId = t), this._loadBlockState(e), this._checkExistingBlocks(), this._openDrawer());
|
|
65
64
|
}
|
|
66
65
|
onCreated(e) {
|
|
67
66
|
this._ensureLeadingTextGuard(e);
|
|
@@ -69,7 +68,7 @@ class se extends P {
|
|
|
69
68
|
onDocumentInit() {
|
|
70
69
|
try {
|
|
71
70
|
const e = this.api.getDocumentRoot();
|
|
72
|
-
e && "querySelectorAll" in e && e.querySelectorAll(
|
|
71
|
+
e && "querySelectorAll" in e && e.querySelectorAll(B).forEach((t) => {
|
|
73
72
|
this._ensureLeadingTextGuard(t);
|
|
74
73
|
});
|
|
75
74
|
} catch {
|
|
@@ -80,11 +79,11 @@ class se extends P {
|
|
|
80
79
|
const t = this._getOrAssignBlockId(e);
|
|
81
80
|
if (!t)
|
|
82
81
|
return;
|
|
83
|
-
const
|
|
84
|
-
this.linkStateByBlockId.get(t) === !0 && !
|
|
82
|
+
const s = this._hasUnsubscribeLink(e);
|
|
83
|
+
this.linkStateByBlockId.get(t) === !0 && !s && this._warnLinkRemoved(), this.linkStateByBlockId.set(t, s);
|
|
85
84
|
}
|
|
86
85
|
onDelete(e) {
|
|
87
|
-
|
|
86
|
+
q(), this._removeBlockTemplatesFromStore(e), this._resetStoreState();
|
|
88
87
|
const t = this._readBlockId(e);
|
|
89
88
|
t && (this.linkStateByBlockId.delete(t), this.guardAttemptsByBlockId.delete(t));
|
|
90
89
|
}
|
|
@@ -96,38 +95,38 @@ class se extends P {
|
|
|
96
95
|
_ensureLeadingTextGuard(e) {
|
|
97
96
|
if (!("querySelector" in e))
|
|
98
97
|
return;
|
|
99
|
-
const t = e.querySelector(
|
|
98
|
+
const t = e.querySelector(E);
|
|
100
99
|
if (!t)
|
|
101
100
|
return;
|
|
102
|
-
let
|
|
101
|
+
let s = t, r = s.parent();
|
|
103
102
|
for (; r && "getTagName" in r && r.getTagName().toLowerCase() !== "p"; )
|
|
104
|
-
|
|
103
|
+
s = r, r = r.parent();
|
|
105
104
|
if (!r || !("getTagName" in r) || r.getTagName().toLowerCase() !== "p")
|
|
106
105
|
return;
|
|
107
|
-
const
|
|
108
|
-
if (!!(
|
|
109
|
-
const
|
|
110
|
-
|
|
106
|
+
const i = s.previousSibling();
|
|
107
|
+
if (!!(i && i.getType() === "text" && i.getTextContent())) {
|
|
108
|
+
const b = this._readBlockId(e);
|
|
109
|
+
b && this.guardAttemptsByBlockId.delete(b);
|
|
111
110
|
return;
|
|
112
111
|
}
|
|
113
|
-
const
|
|
114
|
-
if (!
|
|
112
|
+
const k = this._getOrAssignBlockId(e);
|
|
113
|
+
if (!k)
|
|
115
114
|
return;
|
|
116
|
-
const
|
|
117
|
-
if (!(
|
|
118
|
-
this.guardAttemptsByBlockId.set(
|
|
115
|
+
const _ = this.guardAttemptsByBlockId.get(k) ?? 0;
|
|
116
|
+
if (!(_ >= O)) {
|
|
117
|
+
this.guardAttemptsByBlockId.set(k, _ + 1);
|
|
119
118
|
try {
|
|
120
|
-
this.api.getDocumentModifier().modifyHtml(r).prepend(" ").apply(new
|
|
121
|
-
} catch (
|
|
122
|
-
console.warn("[UnsubscribeBlock] Failed to ensure link text guard:",
|
|
119
|
+
this.api.getDocumentModifier().modifyHtml(r).prepend(" ").apply(new u("Ensure unsubscribe link text guard"));
|
|
120
|
+
} catch (b) {
|
|
121
|
+
console.warn("[UnsubscribeBlock] Failed to ensure link text guard:", b);
|
|
123
122
|
}
|
|
124
123
|
}
|
|
125
124
|
}
|
|
126
125
|
_hasUnsubscribeLink(e) {
|
|
127
|
-
return "querySelector" in e ? !!e.querySelector(
|
|
126
|
+
return "querySelector" in e ? !!e.querySelector(E) : !1;
|
|
128
127
|
}
|
|
129
128
|
_readBlockId(e) {
|
|
130
|
-
return "getAttribute" in e ? e.getAttribute(
|
|
129
|
+
return "getAttribute" in e ? e.getAttribute(n.BLOCK_ID) : null;
|
|
131
130
|
}
|
|
132
131
|
/**
|
|
133
132
|
* Returns the block's stable id, assigning one via the document modifier if
|
|
@@ -141,13 +140,13 @@ class se extends P {
|
|
|
141
140
|
return t;
|
|
142
141
|
if (!("getAttribute" in e))
|
|
143
142
|
return null;
|
|
144
|
-
const
|
|
143
|
+
const s = this._generateNextBlockId();
|
|
145
144
|
try {
|
|
146
|
-
this.api.getDocumentModifier().modifyHtml(e).setAttribute(
|
|
145
|
+
this.api.getDocumentModifier().modifyHtml(e).setAttribute(n.BLOCK_ID, s).apply(new u(`Assign unsubscribe block id ${s}`));
|
|
147
146
|
} catch (r) {
|
|
148
147
|
return console.warn("[UnsubscribeBlock] Failed to assign block id:", r), null;
|
|
149
148
|
}
|
|
150
|
-
return
|
|
149
|
+
return s;
|
|
151
150
|
}
|
|
152
151
|
/**
|
|
153
152
|
* Generates a unique id by scanning the document for the highest existing
|
|
@@ -158,10 +157,10 @@ class se extends P {
|
|
|
158
157
|
let e = 0;
|
|
159
158
|
try {
|
|
160
159
|
const t = this.api.getDocumentRoot();
|
|
161
|
-
t && "querySelectorAll" in t && t.querySelectorAll(
|
|
160
|
+
t && "querySelectorAll" in t && t.querySelectorAll(B).forEach((r) => {
|
|
162
161
|
if ("getAttribute" in r) {
|
|
163
|
-
const
|
|
164
|
-
|
|
162
|
+
const i = r.getAttribute(n.BLOCK_ID), l = i ? parseInt(i) : 0;
|
|
163
|
+
l > e && (e = l);
|
|
165
164
|
}
|
|
166
165
|
});
|
|
167
166
|
} catch {
|
|
@@ -170,14 +169,14 @@ class se extends P {
|
|
|
170
169
|
}
|
|
171
170
|
_warnLinkRemoved() {
|
|
172
171
|
try {
|
|
173
|
-
const { showToaster: e } =
|
|
172
|
+
const { showToaster: e } = L();
|
|
174
173
|
e({
|
|
175
|
-
type:
|
|
176
|
-
message: this.api.translate(
|
|
174
|
+
type: C.Warning,
|
|
175
|
+
message: this.api.translate(G),
|
|
177
176
|
actionButton: {
|
|
178
177
|
text: this.api.translate("Visit Academy"),
|
|
179
178
|
onClick: () => {
|
|
180
|
-
window.open(
|
|
179
|
+
window.open(x, "_blank", "noopener,noreferrer");
|
|
181
180
|
}
|
|
182
181
|
}
|
|
183
182
|
});
|
|
@@ -186,62 +185,55 @@ class se extends P {
|
|
|
186
185
|
}
|
|
187
186
|
}
|
|
188
187
|
_setupSelectEventListener() {
|
|
189
|
-
|
|
190
|
-
const t = e, { collectionType:
|
|
191
|
-
this._updateBlock(
|
|
192
|
-
}, document.addEventListener(
|
|
188
|
+
A(), d = (e) => {
|
|
189
|
+
const t = e, { collectionType: s, selectedPages: r } = t.detail;
|
|
190
|
+
this._updateBlock(s, r.join(","));
|
|
191
|
+
}, document.addEventListener(h.SELECT, d);
|
|
193
192
|
}
|
|
194
193
|
_setupCancelEventListener(e) {
|
|
195
|
-
|
|
196
|
-
const { detail:
|
|
197
|
-
((
|
|
198
|
-
}, document.addEventListener(
|
|
194
|
+
T(), p = (t) => {
|
|
195
|
+
const { detail: s } = t;
|
|
196
|
+
((s == null ? void 0 : s.blockId) ?? null) === e && this._handleCancel();
|
|
197
|
+
}, document.addEventListener(h.CANCEL, p);
|
|
199
198
|
}
|
|
200
199
|
_handleCancel() {
|
|
201
200
|
try {
|
|
202
201
|
if (!this.currentNode)
|
|
203
202
|
return;
|
|
204
|
-
this.api.getDocumentModifier().modifyHtml(this.currentNode).replaceWith(`<${
|
|
203
|
+
this.api.getDocumentModifier().modifyHtml(this.currentNode).replaceWith(`<${v.EMPTY_CONTAINER}/>`).apply(new u("Removed unsubscribe block due to cancel"));
|
|
205
204
|
} catch (e) {
|
|
206
205
|
console.warn("[UnsubscribeBlock] Failed to remove unsubscribe block:", e);
|
|
207
206
|
}
|
|
208
207
|
}
|
|
209
208
|
_updateBlock(e, t) {
|
|
210
|
-
var a;
|
|
211
209
|
if (!this.currentNode || !("querySelector" in this.currentNode))
|
|
212
210
|
return;
|
|
213
|
-
const
|
|
214
|
-
if (!
|
|
211
|
+
const s = this.currentNode.querySelector(E);
|
|
212
|
+
if (!s)
|
|
215
213
|
return;
|
|
216
|
-
const r = this._getMergeTag(e)
|
|
217
|
-
|
|
218
|
-
var T;
|
|
219
|
-
if (!("getAttribute" in m) || m.getAttribute("data-unsubscribe-link") === "true")
|
|
220
|
-
return;
|
|
221
|
-
const S = m.getAttribute("href") ?? "", A = (T = S.match(I)) == null ? void 0 : T[0];
|
|
222
|
-
A && p.includes(A) && s.modifyHtml(m).setAttribute("href", q(S, r));
|
|
223
|
-
}), s.modifyHtml(this.currentNode).setAttribute(o.PAGE_TYPE, e.toString()).setAttribute(o.PAGE_LIST, t), s.apply(new k(`Updated unsubscribe link to ${r}`));
|
|
214
|
+
const r = this._getMergeTag(e);
|
|
215
|
+
this.api.getDocumentModifier().modifyHtml(s).setAttribute("href", r).apply(new u(`Updated unsubscribe link to ${r}`)), this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute(n.PAGE_TYPE, e.toString()).setAttribute(n.PAGE_LIST, t).apply(new u("Updated unsubscribe block metadata"));
|
|
224
216
|
}
|
|
225
217
|
_getMergeTag(e) {
|
|
226
|
-
return
|
|
218
|
+
return M[e] ?? P;
|
|
227
219
|
}
|
|
228
220
|
_openDrawer() {
|
|
229
221
|
if (!(this.currentNode && this.currentNode.getAttribute("data-unsubscribe-page-type")))
|
|
230
222
|
try {
|
|
231
|
-
const e =
|
|
223
|
+
const e = a();
|
|
232
224
|
e.typeSelectionDrawerStatus = !0;
|
|
233
225
|
} catch (e) {
|
|
234
226
|
console.error("[UnsubscribeBlock] Failed to open drawer:", e);
|
|
235
227
|
}
|
|
236
228
|
}
|
|
237
229
|
_checkExistingBlocks() {
|
|
238
|
-
const e =
|
|
239
|
-
e.isGlobalUnsubscribeDisabled = !1, e.isSubscriptionPreferencesCenterDisabled = !1, this.api.getDocumentRoot().querySelectorAll(
|
|
240
|
-
if ("getAttribute" in
|
|
241
|
-
const r =
|
|
230
|
+
const e = a();
|
|
231
|
+
e.isGlobalUnsubscribeDisabled = !1, e.isSubscriptionPreferencesCenterDisabled = !1, this.api.getDocumentRoot().querySelectorAll(B).forEach((s) => {
|
|
232
|
+
if ("getAttribute" in s) {
|
|
233
|
+
const r = s.getAttribute(n.PAGE_TYPE);
|
|
242
234
|
if (r) {
|
|
243
|
-
const
|
|
244
|
-
|
|
235
|
+
const i = Number(r);
|
|
236
|
+
i === m.GLOBAL_UNSUBSCRIBE ? e.isGlobalUnsubscribeDisabled = !0 : i === m.SUBSCRIPTION_PREFERENCE_CENTER && (e.isSubscriptionPreferencesCenterDisabled = !0);
|
|
245
237
|
}
|
|
246
238
|
}
|
|
247
239
|
});
|
|
@@ -249,27 +241,27 @@ class se extends P {
|
|
|
249
241
|
async _loadBlockState(e) {
|
|
250
242
|
if (!("getAttribute" in e))
|
|
251
243
|
return;
|
|
252
|
-
const t = e.getAttribute(
|
|
253
|
-
if (!t || !
|
|
244
|
+
const t = e.getAttribute(n.PAGE_TYPE), s = e.getAttribute(n.PAGE_LIST);
|
|
245
|
+
if (!t || !s)
|
|
254
246
|
return;
|
|
255
|
-
const r =
|
|
256
|
-
await r.fetchTemplates(), r.setCollectionWithoutAutoSelection(
|
|
247
|
+
const r = a(), i = Number(t), l = S(s);
|
|
248
|
+
await r.fetchTemplates(), r.setCollectionWithoutAutoSelection(i), r.loadSelectedTemplates(l);
|
|
257
249
|
}
|
|
258
250
|
_resetStoreState() {
|
|
259
|
-
|
|
251
|
+
a().$reset();
|
|
260
252
|
}
|
|
261
253
|
_removeBlockTemplatesFromStore(e) {
|
|
262
254
|
if (!("getAttribute" in e))
|
|
263
255
|
return;
|
|
264
|
-
const t = e.getAttribute(
|
|
256
|
+
const t = e.getAttribute(n.PAGE_LIST);
|
|
265
257
|
if (!t)
|
|
266
258
|
return;
|
|
267
|
-
const
|
|
268
|
-
|
|
259
|
+
const s = a(), r = S(t);
|
|
260
|
+
s.removeUnsubscribePages(r);
|
|
269
261
|
}
|
|
270
262
|
}
|
|
271
263
|
export {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
264
|
+
w as UNSUBSCRIBE_BLOCK_ID,
|
|
265
|
+
J as UnsubscribeBlock,
|
|
266
|
+
q as disposeUnsubscribeListeners
|
|
275
267
|
};
|
|
@@ -5,11 +5,10 @@ const s = {
|
|
|
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", u = 'a[data-unsubscribe-link="true"], a.unsubscribe-link';
|
|
9
9
|
export {
|
|
10
10
|
b as DATA_ATTRIBUTES,
|
|
11
|
-
|
|
11
|
+
c as UNSUBSCRIBE_BLOCK_SELECTOR,
|
|
12
12
|
s as UNSUBSCRIBE_EVENTS,
|
|
13
|
-
|
|
14
|
-
E as UNSUBSCRIBE_MERGE_TAG_REGEX
|
|
13
|
+
u as UNSUBSCRIBE_LINK_SELECTOR
|
|
15
14
|
};
|
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-9d988e4b] .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}.color-vision-select__dropdown[data-v-64cb50da]{z-index:20;width:387px}.accessibility-toolbar[data-v-391019bc]{gap:16px}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button svg{margin-right:0}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button .clearfix:after{content:none}.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}.editor-actions-menu__dropdown[data-v-bdb3b37a]{z-index:20;width:222px}.editor-actions[data-v-9a028d08]{gap:16px}.editor-actions__divider[data-v-9a028d08]{width:1px;height:40px;background-color:#e1e1e1}.right-slot[data-v-77451c9a]{gap:16px}.header-wrapper[data-v-3c713746]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[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-9d988e4b] .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}.color-vision-select__dropdown[data-v-64cb50da]{z-index:20;width:387px}.accessibility-toolbar[data-v-391019bc]{gap:16px}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button svg{margin-right:0}.accessibility-toolbar[data-v-391019bc] .in-segments-wrapper__button .clearfix:after{content:none}.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}.editor-actions-menu__dropdown[data-v-bdb3b37a]{z-index:20;width:222px}.editor-actions[data-v-9a028d08]{gap:16px}.editor-actions__divider[data-v-9a028d08]{width:1px;height:40px;background-color:#e1e1e1}.right-slot[data-v-77451c9a]{gap:16px}.header-wrapper[data-v-3c713746]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-ce88cbf5]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-ce88cbf5]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-ce88cbf5]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-eaf8e461]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-eaf8e461]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-eaf8e461]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-eaf8e461]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-eaf8e461]{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}.guido-tab-bar-onboarding[data-v-219b4f7c]{z-index:21}[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-70c9d7d5] .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}.guido-display-condition-create__separator[data-v-929822bc]{height:1px;margin:0 0 24px;background-image:linear-gradient(to right,currentColor 1px,transparent 1px);background-size:5px 1px}.guido-display-condition-create__methods[data-v-929822bc]{gap:16px}.guido-display-condition-select-root[data-v-0d740001] .in-drawer__footer{justify-content:flex-start}.guido-display-condition-select__delete-modal[data-v-0d740001]{position:relative;z-index:145}.guido-display-condition-select__delete-modal[data-v-0d740001] .in-modal-v2-wrapper__header-title{margin-bottom:0}.guido-display-condition-select-root[data-v-0d740001] .in-drawer__content>div{display:flex;flex-direction:column;min-height:100%}.guido-display-condition-select__list[data-v-0d740001]{display:flex;flex-direction:column;gap:24px;margin:0;padding:0;list-style:none}.guido-display-condition-card__header[data-v-0d740001]{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px}.guido-display-condition-card__text[data-v-0d740001]{min-width:0}.guido-display-condition-card__name[data-v-0d740001],.guido-display-condition-card__description[data-v-0d740001]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.guido-display-condition-card__actions[data-v-0d740001]{display:flex;flex-shrink:0;align-items:center;gap:16px}.guido-display-condition-card__split[data-v-0d740001]{position:relative;display:flex;gap:1px}.guido-display-condition-card__menu[data-v-0d740001]{z-index:2;min-width:115px}.guido-display-condition-card__divider[data-v-0d740001]{width:1px;height:24px}.guido-display-condition-card__code[data-v-0d740001]{margin:1px 15px 15px;padding:8px;font-family:inherit;white-space:pre-wrap;word-break:break-word}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}
|
package/dist/package.json.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const o = "3.26.0-beta.
|
|
1
|
+
const o = "3.26.0-beta.eba5834", s = { stripo: { version: "2.83.1" } }, e = {
|
|
2
2
|
version: o,
|
|
3
3
|
guido: s
|
|
4
4
|
};
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
e as default,
|
|
7
7
|
s as guido,
|
|
8
8
|
o as version
|
|
9
9
|
};
|
|
@@ -9,5 +9,4 @@ export declare const DATA_ATTRIBUTES: {
|
|
|
9
9
|
readonly BLOCK_ID: "data-unsubscribe-block-id";
|
|
10
10
|
};
|
|
11
11
|
export declare const UNSUBSCRIBE_BLOCK_SELECTOR = ".unsubscribe-block-v2";
|
|
12
|
-
export declare const UNSUBSCRIBE_MERGE_TAG_REGEX: RegExp;
|
|
13
12
|
export declare const UNSUBSCRIBE_LINK_SELECTOR = "a[data-unsubscribe-link=\"true\"], a.unsubscribe-link";
|
|
@@ -3120,6 +3120,7 @@ export declare const useOnboardingStore: import("pinia").StoreDefinition<"guidoO
|
|
|
3120
3120
|
start(type: OnboardingType): void;
|
|
3121
3121
|
startOnboarding(type: OnboardingType): void;
|
|
3122
3122
|
closeForSession(type: OnboardingType): void;
|
|
3123
|
+
forgetSessionClose(type: OnboardingType): void;
|
|
3123
3124
|
close(type: OnboardingType): Promise<void>;
|
|
3124
3125
|
next(type: OnboardingType): void;
|
|
3125
3126
|
previous(type: OnboardingType): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useOnboardingApi as
|
|
2
|
-
import { defineStore as
|
|
1
|
+
import { useOnboardingApi as s } from "../services/onboardingApi.js";
|
|
2
|
+
import { defineStore as t } from "pinia";
|
|
3
3
|
const e = () => ({
|
|
4
4
|
cardIndex: 0,
|
|
5
5
|
isActive: !1,
|
|
@@ -20,7 +20,7 @@ const e = () => ({
|
|
|
20
20
|
userModalState: {},
|
|
21
21
|
isFetched: !1,
|
|
22
22
|
closedThisSession: []
|
|
23
|
-
}), g =
|
|
23
|
+
}), g = t("guidoOnboarding", {
|
|
24
24
|
state: () => a(),
|
|
25
25
|
getters: {
|
|
26
26
|
/** @deprecated Components use the type-specific getters. Slated for deletion, see the SD-667788 dead-code ledger. */
|
|
@@ -86,11 +86,14 @@ const e = () => ({
|
|
|
86
86
|
this.closeOtherOnboardings(n), this.onboardings[n].cardIndex = 0, this.onboardings[n].isActive = !0;
|
|
87
87
|
},
|
|
88
88
|
startOnboarding(n) {
|
|
89
|
-
this.shouldShowOnboarding(n) && !this.isActive(n) && this.start(n);
|
|
89
|
+
this.shouldShowOnboarding(n) && !this.isActive(n) && !this.closedThisSession.includes(n) && this.start(n);
|
|
90
90
|
},
|
|
91
91
|
closeForSession(n) {
|
|
92
92
|
this.closedThisSession.includes(n) || this.closedThisSession.push(n), this.onboardings[n].isActive = !1, this.onboardings[n].cardIndex = 0, this.onboardings[n].config = [], this.onboardings[n].cardOffset = 0;
|
|
93
93
|
},
|
|
94
|
+
forgetSessionClose(n) {
|
|
95
|
+
this.closedThisSession = this.closedThisSession.filter((o) => o !== n);
|
|
96
|
+
},
|
|
94
97
|
async close(n) {
|
|
95
98
|
this.closeForSession(n);
|
|
96
99
|
try {
|
|
@@ -133,7 +136,7 @@ const e = () => ({
|
|
|
133
136
|
async fetchUserModalState() {
|
|
134
137
|
if (this.isFetched)
|
|
135
138
|
return;
|
|
136
|
-
const { fetchUserModalState: n } =
|
|
139
|
+
const { fetchUserModalState: n } = s();
|
|
137
140
|
try {
|
|
138
141
|
const o = await n();
|
|
139
142
|
this.userModalState = o, this.isFetched = !0;
|
|
@@ -141,7 +144,7 @@ const e = () => ({
|
|
|
141
144
|
}
|
|
142
145
|
},
|
|
143
146
|
async setUserModalState(n, o, i) {
|
|
144
|
-
const { setUserModalState: r } =
|
|
147
|
+
const { setUserModalState: r } = s();
|
|
145
148
|
await r(n, o, i), this.isFetched = !1, await this.fetchUserModalState();
|
|
146
149
|
}
|
|
147
150
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.26.0-beta.
|
|
3
|
+
"version": "3.26.0-beta.eba5834",
|
|
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",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const swapMergeTagInHref: (href: string, mergeTag: string) => string;
|