@useinsider/guido 1.0.2-beta.4dd4c2c → 1.0.2-beta.4e8474b
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 +43 -1
- package/dist/@types/events.d.ts +6 -0
- package/dist/@types/generic.d.ts +5 -0
- package/dist/components/Guido.vue.d.ts +3 -0
- package/dist/components/Guido.vue.js +10 -10
- package/dist/components/Guido.vue2.js +80 -63
- package/dist/components/organisms/LoadingWrapper.vue.js +1 -1
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +3 -2
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +14 -15
- package/dist/components/organisms/header/HeaderWrapper.vue.d.ts +3 -1
- package/dist/components/organisms/header/HeaderWrapper.vue.js +6 -6
- package/dist/components/organisms/header/HeaderWrapper.vue2.js +15 -9
- package/dist/components/organisms/header/RightSlot.vue.d.ts +3 -1
- package/dist/components/organisms/header/RightSlot.vue.js +5 -3
- package/dist/components/organisms/header/RightSlot.vue2.js +25 -27
- package/dist/components/organisms/header/ViewOptions.vue.js +11 -11
- package/dist/components/organisms/header/ViewOptions.vue2.js +5 -5
- package/dist/components/organisms/header/version-history/ViewOptions.vue.js +11 -11
- package/dist/components/organisms/header/version-history/ViewOptions.vue2.js +5 -5
- package/dist/components/organisms/onboarding/AMPOnboarding.vue.js +13 -13
- package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +21 -23
- package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +14 -14
- package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +26 -28
- package/dist/components/organisms/onboarding/NewVersionPopup.vue.js +1 -1
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +11 -9
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +37 -14
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +13 -13
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +38 -28
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.js +14 -14
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +21 -23
- package/dist/components/wrappers/WpDrawer.vue.d.ts +1 -1
- package/dist/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/composables/useCustomInterfaceAppearance.js +22 -18
- package/dist/composables/useHtmlCompiler.js +17 -9
- package/dist/composables/useHtmlValidator.d.ts +3 -0
- package/dist/composables/useHtmlValidator.js +120 -0
- package/dist/composables/usePartner.d.ts +1 -0
- package/dist/composables/usePartner.js +16 -9
- package/dist/composables/usePreviewMode.js +14 -15
- package/dist/composables/useRecommendation.d.ts +19 -0
- package/dist/composables/useRecommendation.js +27 -0
- package/dist/composables/useSave.d.ts +4 -0
- package/dist/composables/useSave.js +15 -0
- package/dist/composables/useStripo.js +32 -31
- package/dist/composables/useStripoEventHandler.js +8 -8
- package/dist/composables/useToaster.js +17 -17
- package/dist/config/compiler/outlookCompilerRules.d.ts +2 -0
- package/dist/config/compiler/outlookCompilerRules.js +36 -0
- package/dist/config/compiler/recommendationCompilerRules.d.ts +2 -0
- package/dist/config/compiler/recommendationCompilerRules.js +83 -0
- package/dist/config/compiler/socialCompilerRules.d.ts +2 -0
- package/dist/config/compiler/socialCompilerRules.js +21 -0
- package/dist/config/compiler/unsubscribeCompilerRules.d.ts +2 -0
- package/dist/config/compiler/unsubscribeCompilerRules.js +64 -0
- package/dist/enums/defaults.d.ts +6 -1
- package/dist/enums/defaults.js +47 -10
- package/dist/enums/html-validator.d.ts +6 -0
- package/dist/enums/html-validator.js +7 -0
- package/dist/enums/recommendation.d.ts +54 -0
- package/dist/enums/recommendation.js +56 -0
- package/dist/enums/unsubscribe.d.ts +15 -0
- package/dist/enums/unsubscribe.js +17 -0
- package/dist/guido.css +1 -1
- package/dist/mock/api/validator.d.ts +2 -0
- package/dist/services/onboardingApi.d.ts +4 -0
- package/dist/services/onboardingApi.js +23 -0
- package/dist/static/styles/components/alert-message.css.js +32 -2
- package/dist/static/styles/components/button.css.js +32 -2
- package/dist/static/styles/components/notification.css.js +55 -0
- package/dist/static/styles/components/popup.css.js +68 -0
- package/dist/static/styles/components/wide-panel.css.js +13 -0
- package/dist/static/styles/customEditorStyle.css.js +24 -0
- package/dist/static/styles/variables.css.js +10 -0
- package/dist/stores/dynamic-content.d.ts +12 -0
- package/dist/stores/dynamic-content.js +7 -6
- package/dist/stores/onboarding.d.ts +98 -1028
- package/dist/stores/onboarding.js +54 -67
- package/dist/stores/preview.js +6 -14
- package/dist/stores/recommendation.d.ts +10 -0
- package/dist/stores/recommendation.js +9 -0
- package/dist/stores/unsubscribe.d.ts +8 -0
- package/dist/stores/unsubscribe.js +9 -0
- package/dist/utils/genericUtil.js +9 -6
- package/dist/utils/templatePreparation.js +21 -14
- package/package.json +4 -2
- package/dist/composables/useOnboardingApi.d.ts +0 -4
- package/dist/composables/useOnboardingApi.js +0 -23
|
@@ -1,79 +1,73 @@
|
|
|
1
|
-
import { useOnboardingApi as
|
|
2
|
-
import { defineStore as
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
1
|
+
import { useOnboardingApi as t } from "../services/onboardingApi.js";
|
|
2
|
+
import { defineStore as s } from "pinia";
|
|
3
|
+
const e = () => ({
|
|
4
|
+
cardIndex: 0,
|
|
5
|
+
isActive: !1,
|
|
6
|
+
config: []
|
|
7
|
+
}), a = () => ({
|
|
8
|
+
onboardings: {
|
|
9
|
+
newVersionPopup: e(),
|
|
10
|
+
genericOnboarding: e(),
|
|
11
|
+
textBlockOnboarding: e(),
|
|
12
|
+
versionHistoryOnboarding: e(),
|
|
13
|
+
ampOnboarding: e()
|
|
14
|
+
},
|
|
15
|
+
userModalState: {},
|
|
16
|
+
isFetched: !1
|
|
17
|
+
}), g = s("onboarding", {
|
|
18
|
+
state: () => a(),
|
|
15
19
|
getters: {
|
|
16
|
-
|
|
20
|
+
getOnboarding: (n) => (o) => n.onboardings[o],
|
|
17
21
|
isActive: (n) => (o) => n.onboardings[o].isActive,
|
|
18
22
|
getCurrentCard: (n) => (o) => {
|
|
19
|
-
const
|
|
20
|
-
return
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
versionHistoryOnboarding: (n) => n.onboardings.versionHistoryOnboarding,
|
|
25
|
-
ampOnboarding: (n) => n.onboardings.ampOnboarding,
|
|
26
|
-
genericCurrentCard: (n) => {
|
|
27
|
-
const o = n.onboardings.genericOnboarding;
|
|
23
|
+
const i = n.onboardings[o];
|
|
24
|
+
return i.config[i.cardIndex];
|
|
25
|
+
},
|
|
26
|
+
getGenericCurrentCard: (n) => {
|
|
27
|
+
const { genericOnboarding: o } = n.onboardings;
|
|
28
28
|
return o.config[o.cardIndex];
|
|
29
29
|
},
|
|
30
|
-
|
|
31
|
-
const o = n.onboardings
|
|
30
|
+
getTextBlockCurrentCard: (n) => {
|
|
31
|
+
const { textBlockOnboarding: o } = n.onboardings;
|
|
32
32
|
return o.config[o.cardIndex];
|
|
33
33
|
},
|
|
34
|
-
|
|
35
|
-
const o = n.onboardings
|
|
34
|
+
getVersionHistoryCurrentCard: (n) => {
|
|
35
|
+
const { versionHistoryOnboarding: o } = n.onboardings;
|
|
36
36
|
return o.config[o.cardIndex];
|
|
37
37
|
},
|
|
38
|
-
|
|
39
|
-
const o = n.onboardings
|
|
38
|
+
getAmpCurrentCard: (n) => {
|
|
39
|
+
const { ampOnboarding: o } = n.onboardings;
|
|
40
40
|
return o.config[o.cardIndex];
|
|
41
41
|
},
|
|
42
42
|
shouldShowOnboarding: (n) => (o) => {
|
|
43
|
-
const
|
|
44
|
-
return
|
|
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
|
-
|
|
49
|
-
Object.keys(this.onboardings).forEach((
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
r.isActive && (r.isActive = !1, r.cardIndex = 0, r.config = []);
|
|
53
|
-
}
|
|
48
|
+
closeOtherOnboardings(n) {
|
|
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 = []);
|
|
54
52
|
});
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
},
|
|
54
|
+
start(n) {
|
|
55
|
+
this.closeOtherOnboardings(n), this.onboardings[n].cardIndex = 0, this.onboardings[n].isActive = !0;
|
|
57
56
|
},
|
|
58
57
|
async close(n) {
|
|
59
|
-
await this.setUserModalState(n, "true", "Guido");
|
|
60
|
-
const o = this.onboardings[n];
|
|
61
|
-
o.isActive = !1, o.cardIndex = 0, o.config = [];
|
|
58
|
+
await this.setUserModalState(n, "true", "Guido"), this.onboardings[n].isActive = !1, this.onboardings[n].cardIndex = 0, this.onboardings[n].config = [];
|
|
62
59
|
},
|
|
63
60
|
next(n) {
|
|
64
|
-
|
|
65
|
-
o.cardIndex < o.config.length - 1 && o.cardIndex++;
|
|
61
|
+
this.onboardings[n].cardIndex < this.onboardings[n].config.length - 1 && this.onboardings[n].cardIndex++;
|
|
66
62
|
},
|
|
67
63
|
previous(n) {
|
|
68
|
-
|
|
69
|
-
o.cardIndex > 0 && o.cardIndex--;
|
|
64
|
+
this.onboardings[n].cardIndex > 0 && this.onboardings[n].cardIndex--;
|
|
70
65
|
},
|
|
71
66
|
setConfig(n, o) {
|
|
72
|
-
|
|
73
|
-
e.config = o ?? [], e.cardIndex >= e.config.length && (e.cardIndex = 0);
|
|
67
|
+
this.onboardings[n].config = o ?? [], this.onboardings[n].cardIndex >= this.onboardings[n].config.length && (this.onboardings[n].cardIndex = 0);
|
|
74
68
|
},
|
|
75
|
-
onDiscoverNowClicked() {
|
|
76
|
-
this.start("genericOnboarding");
|
|
69
|
+
async onDiscoverNowClicked() {
|
|
70
|
+
await this.setUserModalState("newVersionPopup", "true", "Guido"), await this.setUserModalState("genericOnboarding", "true", "Guido"), this.start("genericOnboarding");
|
|
77
71
|
},
|
|
78
72
|
onRemindMeLater() {
|
|
79
73
|
sessionStorage.setItem("newVersionPopupDismissed", "true");
|
|
@@ -85,24 +79,17 @@ const c = t("onboarding", {
|
|
|
85
79
|
return Object.values(this.onboardings).some((n) => n.isActive);
|
|
86
80
|
},
|
|
87
81
|
async fetchUserModalState() {
|
|
88
|
-
if (
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
async setUserModalState(n, o, e) {
|
|
97
|
-
try {
|
|
98
|
-
const { setUserModalState: r } = i();
|
|
99
|
-
(await r(n, o, e)).data === 1 && (this.userModalState[e] || (this.userModalState[e] = {}), this.userModalState[e][n] = o === "true");
|
|
100
|
-
} catch (r) {
|
|
101
|
-
console.error("Failed to set user modal state:", r);
|
|
102
|
-
}
|
|
82
|
+
if (this.isFetched)
|
|
83
|
+
return;
|
|
84
|
+
const { fetchUserModalState: n } = t(), o = await n();
|
|
85
|
+
this.userModalState = o, this.isFetched = !0;
|
|
86
|
+
},
|
|
87
|
+
async setUserModalState(n, o, i) {
|
|
88
|
+
const { setUserModalState: r } = t();
|
|
89
|
+
await r(n, o, i), this.isFetched = !1, await this.fetchUserModalState();
|
|
103
90
|
}
|
|
104
91
|
}
|
|
105
92
|
});
|
|
106
93
|
export {
|
|
107
|
-
|
|
94
|
+
g as useOnboardingStore
|
|
108
95
|
};
|
package/dist/stores/preview.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
const m = () => ({
|
|
1
|
+
import { defineStore as e } from "pinia";
|
|
2
|
+
const s = () => ({
|
|
4
3
|
emailFormat: "html",
|
|
5
4
|
ampHtml: "",
|
|
6
5
|
ampErrors: [],
|
|
7
6
|
templateHtml: "",
|
|
8
7
|
isLoaded: !1,
|
|
9
8
|
isAMPErrorModalVisible: !1
|
|
10
|
-
}),
|
|
11
|
-
state: () =>
|
|
9
|
+
}), a = e("preview", {
|
|
10
|
+
state: () => s(),
|
|
12
11
|
getters: {
|
|
13
12
|
isAMPModeEnabled: (t) => t.emailFormat === "AMP",
|
|
14
13
|
previewHtml() {
|
|
@@ -28,14 +27,7 @@ const m = () => ({
|
|
|
28
27
|
},
|
|
29
28
|
actions: {
|
|
30
29
|
updateAMPData(t) {
|
|
31
|
-
|
|
32
|
-
const r = !!((s = this.ampHtml) != null && s.trim());
|
|
33
|
-
this.ampHtml = t.ampHtml ?? "", this.ampErrors = t.ampErrors ?? [];
|
|
34
|
-
const o = t.ampHtml ? "AMP" : "html";
|
|
35
|
-
if (this.emailFormat = o, !r && o === "AMP") {
|
|
36
|
-
const e = i();
|
|
37
|
-
e.shouldShowOnboarding("ampOnboarding") && e.start("ampOnboarding");
|
|
38
|
-
}
|
|
30
|
+
this.ampHtml = t.ampHtml ?? "", this.ampErrors = t.ampErrors ?? [], this.emailFormat = t.ampHtml ? "AMP" : "html";
|
|
39
31
|
},
|
|
40
32
|
setEmailFormat(t) {
|
|
41
33
|
this.emailFormat = t;
|
|
@@ -49,5 +41,5 @@ const m = () => ({
|
|
|
49
41
|
}
|
|
50
42
|
});
|
|
51
43
|
export {
|
|
52
|
-
|
|
44
|
+
a as usePreviewStore
|
|
53
45
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type RecommendationConfig = {
|
|
2
|
+
filters: {
|
|
3
|
+
value: string;
|
|
4
|
+
}[];
|
|
5
|
+
};
|
|
6
|
+
interface StoreState {
|
|
7
|
+
recommendationConfigs: RecommendationConfig[];
|
|
8
|
+
}
|
|
9
|
+
export declare const useRecommendationStore: import("pinia").StoreDefinition<"recommendation", StoreState, {}, {}>;
|
|
10
|
+
export {};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
const
|
|
1
|
+
const e = (l) => l.map((a) => a.format ? {
|
|
2
|
+
label: `${a.text} | ${a.format.key}=${a.format.value}`,
|
|
3
|
+
value: `{{${a.value}|${a.format.key}=${a.format.value}}}`
|
|
4
|
+
} : {
|
|
2
5
|
label: a.fallback ? `${a.text} | ${a.fallback}` : a.text,
|
|
3
6
|
value: a.fallback ? `{{${a.value}|${a.fallback}}}` : `{{${a.value}}}`
|
|
4
|
-
})
|
|
5
|
-
var
|
|
6
|
-
return ((
|
|
7
|
+
}), r = () => {
|
|
8
|
+
var l;
|
|
9
|
+
return ((l = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : l.getAttribute("content")) ?? "";
|
|
7
10
|
};
|
|
8
11
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
e as dynamicContentToMergeTags,
|
|
13
|
+
r as getCsrfToken
|
|
11
14
|
};
|
|
@@ -1,21 +1,28 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { useActionsApi as g } from "../composables/useActionsApi.js";
|
|
2
|
+
import { useHtmlCompiler as S } from "../composables/useHtmlCompiler.js";
|
|
3
|
+
import { useDynamicContentStore as f } from "../stores/dynamic-content.js";
|
|
4
|
+
const H = () => {
|
|
5
|
+
const t = f(), { getCompiledEmail: i, getTemplateData: o } = g(), { compileHtml: n } = S();
|
|
5
6
|
return {
|
|
6
7
|
prepareTemplateDetails: async () => {
|
|
7
|
-
const { html:
|
|
8
|
+
const { html: a, ampHtml: s = "", ampErrors: m = [] } = await i({
|
|
8
9
|
minimize: !0,
|
|
9
10
|
resetDataSavedFlag: !1
|
|
10
|
-
}), { html:
|
|
11
|
-
return {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
}), { html: r, css: c, syncModulesIds: l = [] } = await o(), { compiledHtml: p, stats: e, appliedRules: d } = n(a), u = t.getSelectedDynamicContentList;
|
|
12
|
+
return console.debug("HTML Compilation Stats:", {
|
|
13
|
+
originalSize: e.originalSize,
|
|
14
|
+
compiledSize: e.compiledSize,
|
|
15
|
+
reduction: `${e.reductionPercentage.toFixed(2)}%`,
|
|
16
|
+
appliedRules: d,
|
|
17
|
+
executionTime: `${e.executionTime.toFixed(2)}ms`
|
|
18
|
+
}), {
|
|
19
|
+
dynamicContentList: u,
|
|
20
|
+
compiledHtml: p,
|
|
21
|
+
rawHtml: r,
|
|
22
|
+
css: c,
|
|
16
23
|
ampHtml: s,
|
|
17
|
-
ampErrors:
|
|
18
|
-
modules:
|
|
24
|
+
ampErrors: m,
|
|
25
|
+
modules: l,
|
|
19
26
|
recommendation: {
|
|
20
27
|
campaignUrls: {},
|
|
21
28
|
configs: {}
|
|
@@ -29,5 +36,5 @@ const y = () => {
|
|
|
29
36
|
};
|
|
30
37
|
};
|
|
31
38
|
export {
|
|
32
|
-
|
|
39
|
+
H as useTemplatePreparation
|
|
33
40
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "1.0.2-beta.
|
|
3
|
+
"version": "1.0.2-beta.4e8474b",
|
|
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",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
"lint": "NODE_OPTIONS=--max-old-space-size=2048 eslint ./ && bun run type-check",
|
|
25
25
|
"lint:fix": "NODE_OPTIONS=--max-old-space-size=2048 eslint --fix ./",
|
|
26
26
|
"type-check": "vue-tsc --noEmit --project tsconfig.config.json && vue-tsc --noEmit --project tsconfig.app.json",
|
|
27
|
-
"test:visual-update": "npx playwright test --update-snapshots --reporter html"
|
|
27
|
+
"test:visual-update": "npx playwright test --update-snapshots --reporter html",
|
|
28
|
+
"prepare": "husky"
|
|
28
29
|
},
|
|
29
30
|
"keywords": [],
|
|
30
31
|
"author": "",
|
|
@@ -65,6 +66,7 @@
|
|
|
65
66
|
"eslint-plugin-vue": "10.1.0",
|
|
66
67
|
"eslint-plugin-vue-scoped-css": "2.6.1",
|
|
67
68
|
"globals": "16.0.0",
|
|
69
|
+
"husky": "9.1.7",
|
|
68
70
|
"msw": "2.10.3",
|
|
69
71
|
"sass": "1.69.7",
|
|
70
72
|
"typescript": "5.5.4",
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const useOnboardingApi: () => {
|
|
2
|
-
fetchUserModalState: () => Promise<import("@@/Composables/useHttp").HttpResponse<unknown>>;
|
|
3
|
-
setUserModalState: (modal: string, state: string, page: string) => Promise<import("@@/Composables/useHttp").HttpResponse<unknown>>;
|
|
4
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { useHttp as a } from "./useHttp.js";
|
|
2
|
-
const d = () => {
|
|
3
|
-
const { get: r } = a();
|
|
4
|
-
return {
|
|
5
|
-
fetchUserModalState: async () => {
|
|
6
|
-
try {
|
|
7
|
-
return await r("/user-modal-state/get");
|
|
8
|
-
} catch (e) {
|
|
9
|
-
throw console.error("fetchUserModalState error:", e), e;
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
setUserModalState: async (e, o, s) => {
|
|
13
|
-
try {
|
|
14
|
-
return await r(`/user-modal-state/set?modal=${e}&state=${o}&page=${s}`);
|
|
15
|
-
} catch (t) {
|
|
16
|
-
throw console.error("setUserModalState error:", t), t;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
export {
|
|
22
|
-
d as useOnboardingApi
|
|
23
|
-
};
|