@useinsider/guido 1.0.3-beta.80f253d → 1.0.3-beta.81b84f8
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 +1 -0
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +36 -33
- package/dist/components/organisms/header/RightSlot.vue.js +1 -1
- package/dist/components/organisms/header/RightSlot.vue2.js +23 -22
- package/dist/composables/useGuidoActions.js +19 -9
- package/dist/config/compiler/unsubscribeCompilerRules.js +33 -28
- package/dist/enums/environment.js +5 -0
- package/dist/enums/unsubscribe.js +27 -25
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +1 -1
- package/dist/guido.css +1 -1
- package/dist/package.json.js +1 -1
- package/dist/src/components/Guido.vue.d.ts +1 -0
- package/dist/src/composables/useGuidoActions.d.ts +9 -0
- package/dist/src/enums/environment.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -1
- package/dist/src/stores/config.d.ts +1 -1
- package/dist/src/stores/dynamic-content.d.ts +1 -1
- 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 +8 -0
- package/dist/stores/config.js +5 -5
- package/dist/stores/dynamic-content.js +1 -1
- 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 +6 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -167,6 +167,7 @@ export default {
|
|
|
167
167
|
| `on-change` | void | It Fires once for managing leave modal etc. |
|
|
168
168
|
| `ready` | void | Fired when the editor is ready and template is loaded |
|
|
169
169
|
| `onboarding-finished` | void | Fired when the onboarding popup is dismissed or completed, allowing parent applications to track onboarding state |
|
|
170
|
+
| `test-email:click` | - | Fired when user clicks the test email button in the header |
|
|
170
171
|
|
|
171
172
|
### Guido Exposed Methods
|
|
172
173
|
```typescript
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as R, defineAsyncComponent as
|
|
1
|
+
import { defineComponent as R, defineAsyncComponent as G, ref as x, computed as I, watch as M, onMounted as z, onUnmounted as B } from "vue";
|
|
2
2
|
import { provideGuidoActions as K } from "../composables/useGuidoActions.js";
|
|
3
3
|
import { usePartner as O } from "../composables/usePartner.js";
|
|
4
4
|
import { useStripo as j } from "../composables/useStripo.js";
|
|
5
|
-
import { migrate as
|
|
5
|
+
import { migrate as U } from "../config/migrator/index.js";
|
|
6
6
|
import { DefaultUsername as q, DefaultMessageType as J, DefaultGuidoConfig as Q } from "../enums/defaults.js";
|
|
7
7
|
import V from "./organisms/base/Toaster.vue.js";
|
|
8
8
|
import X from "./organisms/extensions/recommendation/FilterSelectionDrawer.vue.js";
|
|
@@ -14,10 +14,10 @@ import { useStripoApi as oe } from "../services/stripoApi.js";
|
|
|
14
14
|
import { useConfigStore as te } from "../stores/config.js";
|
|
15
15
|
import { useDynamicContentStore as ne } from "../stores/dynamic-content.js";
|
|
16
16
|
import { useEditorStore as re } from "../stores/editor.js";
|
|
17
|
-
import { usePreviewStore as
|
|
18
|
-
import { useUnsubscribeStore as
|
|
19
|
-
import
|
|
20
|
-
const
|
|
17
|
+
import { usePreviewStore as ie } from "../stores/preview.js";
|
|
18
|
+
import { useUnsubscribeStore as se } from "../stores/unsubscribe.js";
|
|
19
|
+
import ae from "../node_modules/lodash-es/merge.js";
|
|
20
|
+
const ke = /* @__PURE__ */ R({
|
|
21
21
|
__name: "Guido",
|
|
22
22
|
props: {
|
|
23
23
|
templateId: null,
|
|
@@ -31,81 +31,84 @@ const Ge = /* @__PURE__ */ R({
|
|
|
31
31
|
guidoConfig: null,
|
|
32
32
|
templateConfig: null
|
|
33
33
|
},
|
|
34
|
-
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished"],
|
|
35
|
-
setup(
|
|
36
|
-
const
|
|
34
|
+
emits: ["dynamic-content:open", "back", "save:start", "save:complete", "on-change", "ready", "onboarding:finished", "test-email:click"],
|
|
35
|
+
setup(W, { expose: _, emit: o }) {
|
|
36
|
+
const l = W, L = G(
|
|
37
37
|
() => import("./organisms/email-preview/PreviewContainer.vue.js")
|
|
38
|
-
), A =
|
|
38
|
+
), A = G(
|
|
39
39
|
() => import("./organisms/onboarding/OnboardingWrapper.vue.js")
|
|
40
|
-
),
|
|
40
|
+
), u = x(), i = ne(), p = se(), g = te(), s = re(), N = ie(), n = I(() => s.hasChanges), { getPartnerName: f, getProductType: y, isTestPartner: F } = O(), v = () => {
|
|
41
41
|
var e;
|
|
42
|
-
return (e =
|
|
42
|
+
return (e = u.value) == null ? void 0 : e.handleSave(!0);
|
|
43
43
|
}, {
|
|
44
|
-
templateId:
|
|
44
|
+
templateId: a,
|
|
45
45
|
userId: b,
|
|
46
46
|
guidoConfig: C,
|
|
47
|
-
templateConfig:
|
|
47
|
+
templateConfig: t,
|
|
48
48
|
html: r = "",
|
|
49
49
|
css: h = "",
|
|
50
50
|
partnerName: c = f(),
|
|
51
51
|
productType: d = y(),
|
|
52
52
|
messageType: S = J,
|
|
53
53
|
username: w = q
|
|
54
|
-
} =
|
|
55
|
-
|
|
54
|
+
} = l, m = (t == null ? void 0 : t.preselectedDynamicContentList) || [];
|
|
55
|
+
s.templateId = a, window.GuidoConfig = ae(Q, C), window.GuidoConfig.partner = {
|
|
56
56
|
partnerName: c,
|
|
57
57
|
productType: d,
|
|
58
58
|
messageType: S
|
|
59
|
-
}, g.templateConfig =
|
|
59
|
+
}, g.templateConfig = t;
|
|
60
60
|
const { initPlugin: D } = j({
|
|
61
|
-
emailId:
|
|
61
|
+
emailId: a,
|
|
62
62
|
userId: b,
|
|
63
63
|
username: w,
|
|
64
64
|
partnerName: c,
|
|
65
65
|
productType: d,
|
|
66
66
|
preselectedDynamicContentList: m,
|
|
67
67
|
onReady: () => {
|
|
68
|
-
console.debug("guido:ready"),
|
|
68
|
+
console.debug("guido:ready"), o("ready");
|
|
69
69
|
}
|
|
70
|
-
}), { getDefaultTemplate: T } = oe(), H =
|
|
70
|
+
}), { getDefaultTemplate: T } = oe(), H = I(() => {
|
|
71
71
|
var e;
|
|
72
72
|
return !((e = window.GuidoConfig) != null && e.useHeader);
|
|
73
73
|
});
|
|
74
74
|
K({
|
|
75
75
|
onBack: () => {
|
|
76
|
-
console.debug("guido:back"),
|
|
76
|
+
console.debug("guido:back"), o("back");
|
|
77
77
|
},
|
|
78
78
|
onSaveStart: () => {
|
|
79
|
-
console.debug("guido:save:start"),
|
|
79
|
+
console.debug("guido:save:start"), o("save:start");
|
|
80
80
|
},
|
|
81
81
|
onSaveComplete: (e) => {
|
|
82
|
-
console.debug("guido:save:complete", e),
|
|
82
|
+
console.debug("guido:save:complete", e), o("save:complete", e);
|
|
83
|
+
},
|
|
84
|
+
onTestEmailClick: () => {
|
|
85
|
+
console.debug("guido:test-email:click"), o("test-email:click");
|
|
83
86
|
}
|
|
84
87
|
});
|
|
85
88
|
const E = (e) => {
|
|
86
|
-
console.debug("dynamic-content:close", e),
|
|
89
|
+
console.debug("dynamic-content:close", e), i.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
|
|
87
90
|
}, P = () => {
|
|
88
91
|
console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
|
|
89
92
|
};
|
|
90
93
|
return M(() => n.value, () => {
|
|
91
|
-
|
|
94
|
+
o("on-change", n.value);
|
|
92
95
|
}), z(async () => {
|
|
93
96
|
console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
|
|
94
97
|
try {
|
|
95
|
-
p.selectedUnsubscribePages = (
|
|
98
|
+
p.selectedUnsubscribePages = (t == null ? void 0 : t.selectedUnsubscribePages) || [];
|
|
96
99
|
let e = {
|
|
97
|
-
html: r && await
|
|
100
|
+
html: r && await U(r),
|
|
98
101
|
css: h,
|
|
99
102
|
forceRecreate: !0
|
|
100
103
|
// TODO: It should be false for old templates. We will communicate with Stripo
|
|
101
104
|
};
|
|
102
|
-
e.html || (e = await T(), e.html = await
|
|
105
|
+
e.html || (e = await T(), e.html = await U(e.html)), await D(e), i.selectedDynamicContentList = m;
|
|
103
106
|
} catch (e) {
|
|
104
107
|
console.error("Failed to initialize Stripo editor:", e);
|
|
105
108
|
}
|
|
106
109
|
document.addEventListener("dynamic-content:open", (e) => {
|
|
107
|
-
const
|
|
108
|
-
console.debug("dynamic-content:open",
|
|
110
|
+
const k = e;
|
|
111
|
+
console.debug("dynamic-content:open", k.detail), o("dynamic-content:open", k.detail);
|
|
109
112
|
});
|
|
110
113
|
}), B(() => {
|
|
111
114
|
try {
|
|
@@ -113,16 +116,16 @@ const Ge = /* @__PURE__ */ R({
|
|
|
113
116
|
} catch {
|
|
114
117
|
console.debug("Failed to remove Stripo editor: No editor found");
|
|
115
118
|
}
|
|
116
|
-
}),
|
|
119
|
+
}), _({
|
|
117
120
|
dynamicContent: {
|
|
118
121
|
insert: E,
|
|
119
122
|
close: P
|
|
120
123
|
},
|
|
121
124
|
hasChanges: n,
|
|
122
125
|
saveSilent: v
|
|
123
|
-
}), { __sfc: !0, PreviewContainer:
|
|
126
|
+
}), { __sfc: !0, PreviewContainer: L, OnboardingWrapper: A, headerWrapperRef: u, dynamicContentStore: i, unsubscribeStore: p, props: l, configStore: g, editorStore: s, previewStore: N, hasChanges: n, getPartnerName: f, getProductType: y, isTestPartner: F, saveSilent: v, templateId: a, userId: b, guidoConfig: C, templateConfig: t, html: r, css: h, partnerName: c, productType: d, messageType: S, username: w, preselectedDynamicContentList: m, emit: o, initPlugin: D, getDefaultTemplate: T, noHeader: H, insertDynamicContent: E, closeDynamicContent: P, Toaster: V, FilterSelectionDrawer: X, HeaderWrapper: Y, LoadingWrapper: Z, SaveAsTemplateDrawer: $, UnsubscribeWrapper: ee };
|
|
124
127
|
}
|
|
125
128
|
});
|
|
126
129
|
export {
|
|
127
|
-
|
|
130
|
+
ke as default
|
|
128
131
|
};
|
|
@@ -3,7 +3,7 @@ import l from "../../../_virtual/_plugin-vue2_normalizer.js";
|
|
|
3
3
|
var r = function() {
|
|
4
4
|
var o, i, n;
|
|
5
5
|
var s = this, e = s._self._c, t = s._self._setupProxy;
|
|
6
|
-
return e("div", { staticClass: "d-f" }, [(o = t.config.features) != null && o.versionHistory ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : s._e(), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isExportButtonDisabled, "label-text-status": !1, "loading-status": t.isExporting, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.handleExport } }), (i = t.config.features) != null && i.saveAsTemplate ? e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isSaveAsButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : s._e(), (n = t.config.features) != null && n.testMessage ? e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button"), "tooltip-text": t.trans("newsletter.test-email") } }) : s._e(), e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "loading-status": t.isSaving }, on: { click: function(
|
|
6
|
+
return e("div", { staticClass: "d-f" }, [(o = t.config.features) != null && o.versionHistory ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryButtonDisabled, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : s._e(), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isExportButtonDisabled, "label-text-status": !1, "loading-status": t.isExporting, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.handleExport } }), (i = t.config.features) != null && i.saveAsTemplate ? e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isSaveAsButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : s._e(), (n = t.config.features) != null && n.testMessage ? e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isTestButtonDisabled, "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__test-button"), "tooltip-text": t.trans("newsletter.test-email") }, on: { click: t.testEmailClick } }) : s._e(), e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": !t.isSaving && t.editorStore.isSaveButtonDisabled, "loading-status": t.isSaving }, on: { click: function(c) {
|
|
7
7
|
return t.handleSave(!1);
|
|
8
8
|
} } })], 1);
|
|
9
9
|
}, u = [], d = /* @__PURE__ */ l(
|
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useConfig as
|
|
3
|
-
import { useExport as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { defineComponent as H, ref as p, computed as _ } from "vue";
|
|
2
|
+
import { useConfig as h } from "../../../composables/useConfig.js";
|
|
3
|
+
import { useExport as V } from "../../../composables/useExport.js";
|
|
4
|
+
import { useTestEmailClick as x } from "../../../composables/useGuidoActions.js";
|
|
5
|
+
import { useSave as E } from "../../../composables/useSave.js";
|
|
6
|
+
import { useTranslations as T } from "../../../composables/useTranslations.js";
|
|
6
7
|
import { useVersionHistoryApi as w } from "../../../composables/useVersionHistoryApi.js";
|
|
7
|
-
import { useEditorStore as
|
|
8
|
-
import { getTooltipOptions as
|
|
9
|
-
import { InButtonV2 as
|
|
10
|
-
const
|
|
8
|
+
import { useEditorStore as C } from "../../../stores/editor.js";
|
|
9
|
+
import { getTooltipOptions as O } from "../../../utils/tooltipUtils.js";
|
|
10
|
+
import { InButtonV2 as A } from "@useinsider/design-system-vue";
|
|
11
|
+
const J = /* @__PURE__ */ H({
|
|
11
12
|
__name: "RightSlot",
|
|
12
|
-
setup(
|
|
13
|
-
const { config:
|
|
14
|
-
if (
|
|
13
|
+
setup(k, { expose: m }) {
|
|
14
|
+
const { config: c } = h(), { exportHtml: r } = V(), { save: n } = E(), { openVersionHistory: i, closeVersionHistory: a } = w(), t = C(), o = T(), e = p(!1), s = p(!1), u = x(), f = () => {
|
|
15
|
+
if (t.isVersionHistoryOpen) {
|
|
15
16
|
a();
|
|
16
17
|
return;
|
|
17
18
|
}
|
|
18
19
|
i();
|
|
19
|
-
},
|
|
20
|
+
}, v = async () => {
|
|
20
21
|
e.value = !0, await r(), e.value = !1;
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
s.value = !0,
|
|
25
|
-
const
|
|
26
|
-
return s.value = !1,
|
|
22
|
+
}, d = () => {
|
|
23
|
+
t.isSaveAsTemplateDrawerOpen = !0;
|
|
24
|
+
}, y = _(() => t.isVersionHistoryOpen ? o("newsletter.close-version-history") : o("newsletter.version-history")), l = async (S) => {
|
|
25
|
+
s.value = !0, t.loadingStatus = !0;
|
|
26
|
+
const g = await n(S);
|
|
27
|
+
return s.value = !1, t.loadingStatus = !1, g;
|
|
27
28
|
};
|
|
28
29
|
return m({
|
|
29
|
-
handleSave:
|
|
30
|
-
}), { __sfc: !0, config:
|
|
30
|
+
handleSave: l
|
|
31
|
+
}), { __sfc: !0, config: c, exportHtml: r, save: n, openVersionHistory: i, closeVersionHistory: a, editorStore: t, trans: o, isExporting: e, isSaving: s, testEmailClick: u, handleVersionHistory: f, handleExport: v, handleSaveAs: d, versionHistoryTooltipText: y, handleSave: l, getTooltipOptions: O, InButtonV2: A };
|
|
31
32
|
}
|
|
32
33
|
});
|
|
33
34
|
export {
|
|
34
|
-
|
|
35
|
+
J as default
|
|
35
36
|
};
|
|
@@ -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,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
|
};
|
|
@@ -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(), I = {
|
|
12
|
+
UNSUBSCRIBE_URL: `https://${s}.mail.useinsider.com/user/v1/unsub`,
|
|
13
|
+
PREFERENCES_URL: `https://${s}.mail.useinsider.com/user/v1/prefs`
|
|
14
|
+
}, _ = "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
|
+
_ 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
|
+
I as URLS
|
|
54
56
|
};
|
|
@@ -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("recommendationExtension", {
|
|
137
137
|
state: () => d(),
|
|
138
138
|
getters: {
|
|
139
139
|
hasFilters: (e) => !!e.recommendationConfigs.filters.length,
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.gap-16[data-v-6562e38c],.gap-16[data-v-1ccb6d4a]{gap:16px}[data-v-0502bceb] .in-button-v2__wrapper{line-height:0}[data-v-b5997368] .in-segments-wrapper .in-tooltip-wrapper__box{text-align:left}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.guido-loading__wrapper[data-v-dced5582]{height:100%;top:75px}.guido-editor__wrapper[data-v-
|
|
1
|
+
.gap-16[data-v-6562e38c],.gap-16[data-v-1ccb6d4a]{gap:16px}[data-v-0502bceb] .in-button-v2__wrapper{line-height:0}[data-v-b5997368] .in-segments-wrapper .in-tooltip-wrapper__box{text-align:left}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history-wrapper[data-v-52a77eec]{gap:8px}.view-options-wrapper[data-v-d405ca59]{position:relative;display:inline-block}.new-tag[data-v-d405ca59]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-d405ca59] .guido__verion-history-view-option-selection-desktop svg,[data-v-d405ca59] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-d405ca59] .in-segments-wrapper__button_selected,[data-v-d405ca59] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-d405ca59] .in-tooltip-wrapper__icon{cursor:pointer}.view-options-wrapper[data-v-195ab6d4]{position:relative;display:inline-block}.new-tag[data-v-195ab6d4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-195ab6d4] .guido__view-option-selection-desktop svg,[data-v-195ab6d4] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-195ab6d4] .in-segments-wrapper__button_selected,[data-v-195ab6d4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-195ab6d4] .in-tooltip-wrapper__icon{cursor:pointer}.guido-loading__wrapper[data-v-dced5582]{height:100%;top:75px}.guido-editor__wrapper[data-v-e299731b],.guido-editor__container[data-v-e299731b]{width:100%;height:calc(100vh - 128px)}.guido-editor__no-header[data-v-e299731b]{height:calc(100vh - 75px)}[data-v-70835920] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-a86fc486]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-a86fc486]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-a86fc486]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-a86fc486]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-a86fc486]{object-fit:cover;transform:scale(1)}[data-v-dd57102d] .guido__verion-history-view-option-selection-desktop svg,[data-v-dd57102d] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-dd57102d] .in-segments-wrapper__button_selected,[data-v-dd57102d] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-7a09985c]{gap:16px}[data-v-c2adc57d] .in-progress-wrapper__progress p span:last-child{display:none!important}.desktop-preview-container[data-v-2dd60b0c],[data-v-2dd60b0c] .desktop-preview-container .in-container{min-height:720px!important;height:100%}.cropped-text[data-v-f20b3a9b]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}[data-v-d3c52b44] .vueperslides__bullets,[data-v-a408dcea] .vueperslides__bullets{pointer-events:none!important}[data-v-a408dcea] .vueperslides__parallax-wrapper{height:110px!important}
|
package/dist/package.json.js
CHANGED
|
@@ -27,6 +27,7 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__
|
|
|
27
27
|
"on-change": (hasChanges: boolean) => void;
|
|
28
28
|
ready: () => void;
|
|
29
29
|
"onboarding:finished": () => void;
|
|
30
|
+
"test-email:click": () => void;
|
|
30
31
|
}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
|
|
31
32
|
export default _default;
|
|
32
33
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -3,9 +3,11 @@ import type { InjectionKey } from 'vue';
|
|
|
3
3
|
export type BackHandler = () => void;
|
|
4
4
|
export type SaveStartHandler = () => void;
|
|
5
5
|
export type SaveCompleteHandler = (template: Omit<SavedTemplateDetails, 'forceRecreate'>) => void;
|
|
6
|
+
export type TestEmailClickHandler = () => void;
|
|
6
7
|
export declare const BACK_KEY: InjectionKey<BackHandler>;
|
|
7
8
|
export declare const SAVE_START_KEY: InjectionKey<SaveStartHandler>;
|
|
8
9
|
export declare const SAVE_COMPLETE_KEY: InjectionKey<SaveCompleteHandler>;
|
|
10
|
+
export declare const TEST_EMAIL_CLICK_KEY: InjectionKey<TestEmailClickHandler>;
|
|
9
11
|
/**
|
|
10
12
|
* Provides Guido action handlers to child components
|
|
11
13
|
*/
|
|
@@ -13,6 +15,7 @@ export declare const provideGuidoActions: (actions: {
|
|
|
13
15
|
onBack: BackHandler;
|
|
14
16
|
onSaveStart: SaveStartHandler;
|
|
15
17
|
onSaveComplete: SaveCompleteHandler;
|
|
18
|
+
onTestEmailClick: TestEmailClickHandler;
|
|
16
19
|
}) => void;
|
|
17
20
|
/**
|
|
18
21
|
* Provides individual Guido action handlers
|
|
@@ -35,6 +38,11 @@ export declare const useSaveStart: () => SaveStartHandler;
|
|
|
35
38
|
* @returns Save complete function
|
|
36
39
|
*/
|
|
37
40
|
export declare const useSaveComplete: () => SaveCompleteHandler;
|
|
41
|
+
/**
|
|
42
|
+
* Hook to use the test email click handler
|
|
43
|
+
* @returns Test email click function
|
|
44
|
+
*/
|
|
45
|
+
export declare const useTestEmailClick: () => TestEmailClickHandler;
|
|
38
46
|
/**
|
|
39
47
|
* Convenience hook to get all Guido actions
|
|
40
48
|
* @returns Object containing all action handlers
|
|
@@ -43,4 +51,5 @@ export declare const useGuidoActions: () => {
|
|
|
43
51
|
back: BackHandler;
|
|
44
52
|
saveStart: SaveStartHandler;
|
|
45
53
|
saveComplete: SaveCompleteHandler;
|
|
54
|
+
testEmailClick: TestEmailClickHandler;
|
|
46
55
|
};
|
|
@@ -34,7 +34,7 @@ interface StoreState {
|
|
|
34
34
|
filterList: FiltersResponse;
|
|
35
35
|
filterGroup: number;
|
|
36
36
|
}
|
|
37
|
-
export declare const useRecommendationExtensionStore: import("pinia").StoreDefinition<"
|
|
37
|
+
export declare const useRecommendationExtensionStore: import("pinia").StoreDefinition<"recommendationExtension", StoreState, {
|
|
38
38
|
hasFilters: (state: {
|
|
39
39
|
recommendationCampaignUrls: Record<string, string>;
|
|
40
40
|
recommendationConfigs: {
|
|
@@ -3,7 +3,7 @@ interface StoreState {
|
|
|
3
3
|
guidoConfig: GuidoConfig;
|
|
4
4
|
templateConfig?: TemplateConfig;
|
|
5
5
|
}
|
|
6
|
-
export declare const useConfigStore: import("pinia").StoreDefinition<"
|
|
6
|
+
export declare const useConfigStore: import("pinia").StoreDefinition<"config", StoreState, {
|
|
7
7
|
getVariationId: (state: {
|
|
8
8
|
guidoConfig: {
|
|
9
9
|
translationsPath: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DynamicContent } from '@@/Types/generic';
|
|
2
|
-
export declare const useDynamicContentStore: import("pinia").StoreDefinition<"
|
|
2
|
+
export declare const useDynamicContentStore: import("pinia").StoreDefinition<"dynamicContent", {
|
|
3
3
|
selectedDynamicContent: DynamicContent;
|
|
4
4
|
selectedDynamicContentList: DynamicContent[];
|
|
5
5
|
}, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { OnboardingCardConfig, OnboardingType, OnboardingStoreState } from '@@/Types/onboarding';
|
|
2
|
-
export declare const useOnboardingStore: import("pinia").StoreDefinition<"
|
|
2
|
+
export declare const useOnboardingStore: import("pinia").StoreDefinition<"onboarding", OnboardingStoreState, {
|
|
3
3
|
getOnboarding: (state: {
|
|
4
4
|
onboardings: {
|
|
5
5
|
newVersionPopup: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PreviewState, EmailFormat } from '@@/Types/preview';
|
|
2
|
-
export declare const usePreviewStore: import("pinia").StoreDefinition<"
|
|
2
|
+
export declare const usePreviewStore: import("pinia").StoreDefinition<"preview", PreviewState, {
|
|
3
3
|
isAMPModeEnabled: (state: {
|
|
4
4
|
emailFormat: EmailFormat;
|
|
5
5
|
ampHtml: string;
|
|
@@ -6,5 +6,5 @@ type RecommendationConfig = {
|
|
|
6
6
|
interface StoreState {
|
|
7
7
|
recommendationConfigs: RecommendationConfig[];
|
|
8
8
|
}
|
|
9
|
-
export declare const useRecommendationStore: import("pinia").StoreDefinition<"
|
|
9
|
+
export declare const useRecommendationStore: import("pinia").StoreDefinition<"recommendation", StoreState, {}, {}>;
|
|
10
10
|
export {};
|
|
@@ -17,7 +17,7 @@ interface StoreState {
|
|
|
17
17
|
message: number;
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
export declare const useSaveAsTemplateStore: import("pinia").StoreDefinition<"
|
|
20
|
+
export declare const useSaveAsTemplateStore: import("pinia").StoreDefinition<"saveAsTemplate", StoreState, {
|
|
21
21
|
getTemplateName: (state: {
|
|
22
22
|
templateName: string;
|
|
23
23
|
categories: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ToasterState, ToasterOptions } from '@@/Types/toaster';
|
|
2
|
-
export declare const useToasterStore: import("pinia").StoreDefinition<"
|
|
2
|
+
export declare const useToasterStore: import("pinia").StoreDefinition<"toaster", ToasterState, {
|
|
3
3
|
shouldAutoHide: (s: {
|
|
4
4
|
status: boolean;
|
|
5
5
|
type: import("@@/Types/toaster").ToasterType;
|
|
@@ -11,7 +11,7 @@ interface StoreState {
|
|
|
11
11
|
isGlobalUnsubscribeDisabled: boolean;
|
|
12
12
|
isSubscriptionPreferencesCenterDisabled: boolean;
|
|
13
13
|
}
|
|
14
|
-
export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"
|
|
14
|
+
export declare const useUnsubscribeStore: import("pinia").StoreDefinition<"unsubscribe", StoreState, {
|
|
15
15
|
getSelectedCollection: (state: {
|
|
16
16
|
templates: {
|
|
17
17
|
id: number;
|
|
@@ -2,7 +2,7 @@ import type { VersionHistoryState } from '@@/Types/version-history-api';
|
|
|
2
2
|
export interface StoreState extends VersionHistoryState {
|
|
3
3
|
editorVisualMode: 'desktop' | 'mobile';
|
|
4
4
|
}
|
|
5
|
-
export declare const useVersionHistoryStore: import("pinia").StoreDefinition<"
|
|
5
|
+
export declare const useVersionHistoryStore: import("pinia").StoreDefinition<"versionHistory", StoreState, {
|
|
6
6
|
hasPreviousPatch: (state: {
|
|
7
7
|
editorVisualMode: "desktop" | "mobile";
|
|
8
8
|
previousPatch: {
|
package/dist/stores/config.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { DefaultGuidoConfig as
|
|
2
|
-
import { defineStore as
|
|
3
|
-
const
|
|
1
|
+
import { DefaultGuidoConfig as e } from "../enums/defaults.js";
|
|
2
|
+
import { defineStore as i } from "pinia";
|
|
3
|
+
const r = i("config", {
|
|
4
4
|
state: () => ({
|
|
5
|
-
guidoConfig:
|
|
5
|
+
guidoConfig: e,
|
|
6
6
|
templateConfig: {}
|
|
7
7
|
}),
|
|
8
8
|
getters: {
|
|
@@ -13,5 +13,5 @@ const n = e("guidoConfig", {
|
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
r as useConfigStore
|
|
17
17
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { removeDuplicatesFromArray as n } from "../utils/arrayUtil.js";
|
|
2
2
|
import { defineStore as a } from "pinia";
|
|
3
|
-
const s = a("
|
|
3
|
+
const s = a("dynamicContent", {
|
|
4
4
|
state: () => ({
|
|
5
5
|
selectedDynamicContent: { text: "", value: "", fallback: "" },
|
|
6
6
|
selectedDynamicContentList: []
|
package/dist/stores/editor.js
CHANGED
|
@@ -14,41 +14,41 @@ const e = () => ({
|
|
|
14
14
|
},
|
|
15
15
|
userModalState: {},
|
|
16
16
|
isFetched: !1
|
|
17
|
-
}),
|
|
17
|
+
}), g = s("onboarding", {
|
|
18
18
|
state: () => a(),
|
|
19
19
|
getters: {
|
|
20
|
-
getOnboarding: (n) => (
|
|
21
|
-
isActive: (n) => (
|
|
22
|
-
getCurrentCard: (n) => (
|
|
23
|
-
const
|
|
24
|
-
return
|
|
20
|
+
getOnboarding: (n) => (o) => n.onboardings[o],
|
|
21
|
+
isActive: (n) => (o) => n.onboardings[o].isActive,
|
|
22
|
+
getCurrentCard: (n) => (o) => {
|
|
23
|
+
const i = n.onboardings[o];
|
|
24
|
+
return i.config[i.cardIndex];
|
|
25
25
|
},
|
|
26
26
|
getGenericCurrentCard: (n) => {
|
|
27
|
-
const { genericOnboarding:
|
|
28
|
-
return
|
|
27
|
+
const { genericOnboarding: o } = n.onboardings;
|
|
28
|
+
return o.config[o.cardIndex];
|
|
29
29
|
},
|
|
30
30
|
getTextBlockCurrentCard: (n) => {
|
|
31
|
-
const { textBlockOnboarding:
|
|
32
|
-
return
|
|
31
|
+
const { textBlockOnboarding: o } = n.onboardings;
|
|
32
|
+
return o.config[o.cardIndex];
|
|
33
33
|
},
|
|
34
34
|
getVersionHistoryCurrentCard: (n) => {
|
|
35
|
-
const { versionHistoryOnboarding:
|
|
36
|
-
return
|
|
35
|
+
const { versionHistoryOnboarding: o } = n.onboardings;
|
|
36
|
+
return o.config[o.cardIndex];
|
|
37
37
|
},
|
|
38
38
|
getAmpCurrentCard: (n) => {
|
|
39
|
-
const { ampOnboarding:
|
|
40
|
-
return
|
|
39
|
+
const { ampOnboarding: o } = n.onboardings;
|
|
40
|
+
return o.config[o.cardIndex];
|
|
41
41
|
},
|
|
42
|
-
shouldShowOnboarding: (n) => (
|
|
43
|
-
const
|
|
44
|
-
return
|
|
42
|
+
shouldShowOnboarding: (n) => (o) => {
|
|
43
|
+
const i = n.userModalState.Guido;
|
|
44
|
+
return o === "newVersionPopup" && (i != null && i.genericOnboarding) ? !1 : i ? !i[o] : !0;
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
actions: {
|
|
48
48
|
closeOtherOnboardings(n) {
|
|
49
|
-
Object.keys(this.onboardings).forEach((
|
|
50
|
-
const
|
|
51
|
-
|
|
49
|
+
Object.keys(this.onboardings).forEach((o) => {
|
|
50
|
+
const i = o;
|
|
51
|
+
i !== n && this.onboardings[i].isActive && (this.onboardings[i].isActive = !1, this.onboardings[i].cardIndex = 0, this.onboardings[i].config = []);
|
|
52
52
|
});
|
|
53
53
|
},
|
|
54
54
|
start(n) {
|
|
@@ -63,8 +63,8 @@ const e = () => ({
|
|
|
63
63
|
previous(n) {
|
|
64
64
|
this.onboardings[n].cardIndex > 0 && this.onboardings[n].cardIndex--;
|
|
65
65
|
},
|
|
66
|
-
setConfig(n,
|
|
67
|
-
this.onboardings[n].config =
|
|
66
|
+
setConfig(n, o) {
|
|
67
|
+
this.onboardings[n].config = o ?? [], this.onboardings[n].cardIndex >= this.onboardings[n].config.length && (this.onboardings[n].cardIndex = 0);
|
|
68
68
|
},
|
|
69
69
|
async onDiscoverNowClicked() {
|
|
70
70
|
await this.setUserModalState("newVersionPopup", "true", "Guido"), await this.setUserModalState("genericOnboarding", "true", "Guido"), this.start("genericOnboarding");
|
|
@@ -81,15 +81,15 @@ const e = () => ({
|
|
|
81
81
|
async fetchUserModalState() {
|
|
82
82
|
if (this.isFetched)
|
|
83
83
|
return;
|
|
84
|
-
const { fetchUserModalState: n } = t(),
|
|
85
|
-
this.userModalState =
|
|
84
|
+
const { fetchUserModalState: n } = t(), o = await n();
|
|
85
|
+
this.userModalState = o, this.isFetched = !0;
|
|
86
86
|
},
|
|
87
|
-
async setUserModalState(n,
|
|
87
|
+
async setUserModalState(n, o, i) {
|
|
88
88
|
const { setUserModalState: r } = t();
|
|
89
|
-
await r(n,
|
|
89
|
+
await r(n, o, i), this.isFetched = !1, await this.fetchUserModalState();
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
93
|
export {
|
|
94
|
-
|
|
94
|
+
g as useOnboardingStore
|
|
95
95
|
};
|
package/dist/stores/preview.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineStore as e } from "pinia";
|
|
2
|
-
const
|
|
2
|
+
const t = () => ({
|
|
3
3
|
recommendationConfigs: []
|
|
4
|
-
}), n = e("
|
|
5
|
-
state: () =>
|
|
4
|
+
}), n = e("recommendation", {
|
|
5
|
+
state: () => t()
|
|
6
6
|
});
|
|
7
7
|
export {
|
|
8
8
|
n as useRecommendationStore
|
|
@@ -17,7 +17,7 @@ const r = () => ({
|
|
|
17
17
|
editor: 2,
|
|
18
18
|
message: 1
|
|
19
19
|
}
|
|
20
|
-
}),
|
|
20
|
+
}), n = i("saveAsTemplate", {
|
|
21
21
|
state: () => r(),
|
|
22
22
|
getters: {
|
|
23
23
|
getTemplateName: (e) => e.templateName.trim(),
|
|
@@ -44,5 +44,5 @@ const r = () => ({
|
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
46
|
export {
|
|
47
|
-
|
|
47
|
+
n as useSaveAsTemplateStore
|
|
48
48
|
};
|
package/dist/stores/toaster.js
CHANGED
|
@@ -12,7 +12,7 @@ const p = () => ({
|
|
|
12
12
|
typeSelectionDrawerStatus: !1,
|
|
13
13
|
isGlobalUnsubscribeDisabled: !1,
|
|
14
14
|
isSubscriptionPreferencesCenterDisabled: !1
|
|
15
|
-
}), g = d("
|
|
15
|
+
}), g = d("unsubscribe", {
|
|
16
16
|
state: () => p(),
|
|
17
17
|
getters: {
|
|
18
18
|
getSelectedCollection: (e) => i[e.selectedCollectionType],
|
|
@@ -5,13 +5,13 @@ const e = () => ({
|
|
|
5
5
|
description: "",
|
|
6
6
|
authorId: "",
|
|
7
7
|
authorName: ""
|
|
8
|
-
}),
|
|
8
|
+
}), r = () => ({
|
|
9
9
|
previousPatch: e(),
|
|
10
10
|
currentPatch: e(),
|
|
11
11
|
nextPatch: e(),
|
|
12
12
|
editorVisualMode: "desktop"
|
|
13
|
-
}),
|
|
14
|
-
state: () =>
|
|
13
|
+
}), o = a("versionHistory", {
|
|
14
|
+
state: () => r(),
|
|
15
15
|
getters: {
|
|
16
16
|
hasPreviousPatch: (t) => !!t.previousPatch.id,
|
|
17
17
|
hasCurrentPatch: (t) => !!t.currentPatch.id,
|
|
@@ -24,5 +24,5 @@ const e = () => ({
|
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
export {
|
|
27
|
-
|
|
27
|
+
o as useVersionHistoryStore
|
|
28
28
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "1.0.3-beta.
|
|
3
|
+
"version": "1.0.3-beta.81b84f8",
|
|
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",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
},
|
|
84
84
|
"guido": {
|
|
85
85
|
"stripo": {
|
|
86
|
-
"version": "2.
|
|
86
|
+
"version": "2.46.0"
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
}
|