@useinsider/guido 1.0.2-beta.b3c5fc9 → 1.0.2-beta.b6e86c0
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 +12 -0
- package/dist/@types/events.d.ts +6 -0
- package/dist/@types/generic.d.ts +1 -0
- package/dist/components/Guido.vue.d.ts +1 -0
- package/dist/components/Guido.vue.js +11 -11
- package/dist/components/Guido.vue2.js +59 -51
- package/dist/components/organisms/LoadingWrapper.vue.d.ts +2 -0
- package/dist/components/organisms/LoadingWrapper.vue.js +18 -0
- package/dist/components/organisms/LoadingWrapper.vue2.js +12 -0
- package/dist/components/organisms/email-preview/PreviewContainer.vue.js +12 -12
- package/dist/components/organisms/email-preview/PreviewContainer.vue2.js +7 -8
- package/dist/components/organisms/header/LeftSlot.vue.js +10 -9
- package/dist/components/organisms/header/MiddleSlot.vue.js +6 -6
- package/dist/components/organisms/header/MiddleSlot.vue2.js +15 -16
- package/dist/components/organisms/header/RightSlot.vue.js +3 -3
- package/dist/components/organisms/header/RightSlot.vue2.js +25 -26
- package/dist/components/organisms/header/ViewOptions.vue.js +11 -11
- package/dist/components/organisms/header/ViewOptions.vue2.js +14 -15
- 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.d.ts +2 -0
- package/dist/components/organisms/onboarding/AMPOnboarding.vue.js +20 -0
- package/dist/components/organisms/onboarding/AMPOnboarding.vue2.js +37 -0
- package/dist/components/organisms/onboarding/GenericOnboarding.vue.d.ts +2 -0
- package/dist/components/organisms/onboarding/GenericOnboarding.vue.js +21 -0
- package/dist/components/organisms/onboarding/GenericOnboarding.vue2.js +83 -0
- package/dist/components/organisms/onboarding/NewVersionPopup.vue.d.ts +2 -0
- package/dist/components/organisms/onboarding/NewVersionPopup.vue.js +17 -0
- package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +30 -0
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue.d.ts +2 -0
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +19 -0
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +43 -0
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.d.ts +2 -0
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue.js +21 -0
- package/dist/components/organisms/onboarding/TextBlockOnboarding.vue2.js +62 -0
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.d.ts +2 -0
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue.js +20 -0
- package/dist/components/organisms/onboarding/VersionHistoryOnboarding.vue2.js +37 -0
- package/dist/composables/useCustomInterfaceAppearance.js +15 -13
- package/dist/composables/usePartner.d.ts +1 -0
- package/dist/composables/usePartner.js +16 -9
- package/dist/composables/usePreviewMode.js +13 -13
- package/dist/composables/useStripo.js +49 -48
- package/dist/composables/useStripoEventHandler.d.ts +3 -0
- package/dist/composables/useStripoEventHandler.js +20 -0
- package/dist/enums/defaults.d.ts +1 -0
- package/dist/enums/defaults.js +42 -9
- package/dist/enums/onboarding.d.ts +1 -0
- package/dist/enums/onboarding.js +8 -0
- package/dist/guido.css +1 -1
- package/dist/mock/api/user-modal-state.d.ts +2 -0
- package/dist/services/onboardingApi.d.ts +4 -0
- package/dist/services/onboardingApi.js +23 -0
- package/dist/static/assets/onboarding-img.svg.js +4 -0
- package/dist/static/styles/components/loader.css.js +10 -0
- package/dist/static/styles/components/wide-panel.css.js +11 -2
- package/dist/static/styles/customEditorStyle.css.js +18 -0
- package/dist/stores/editor.d.ts +194 -1
- package/dist/stores/editor.js +18 -2
- package/dist/stores/onboarding.d.ts +1068 -0
- package/dist/stores/onboarding.js +95 -0
- package/dist/stores/preview.d.ts +0 -8
- package/dist/stores/preview.js +12 -20
- package/package.json +4 -2
|
@@ -0,0 +1,95 @@
|
|
|
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(),
|
|
19
|
+
getters: {
|
|
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
|
+
},
|
|
26
|
+
getGenericCurrentCard: (n) => {
|
|
27
|
+
const { genericOnboarding: o } = n.onboardings;
|
|
28
|
+
return o.config[o.cardIndex];
|
|
29
|
+
},
|
|
30
|
+
getTextBlockCurrentCard: (n) => {
|
|
31
|
+
const { textBlockOnboarding: o } = n.onboardings;
|
|
32
|
+
return o.config[o.cardIndex];
|
|
33
|
+
},
|
|
34
|
+
getVersionHistoryCurrentCard: (n) => {
|
|
35
|
+
const { versionHistoryOnboarding: o } = n.onboardings;
|
|
36
|
+
return o.config[o.cardIndex];
|
|
37
|
+
},
|
|
38
|
+
getAmpCurrentCard: (n) => {
|
|
39
|
+
const { ampOnboarding: o } = n.onboardings;
|
|
40
|
+
return o.config[o.cardIndex];
|
|
41
|
+
},
|
|
42
|
+
shouldShowOnboarding: (n) => (o) => {
|
|
43
|
+
const i = n.userModalState.Guido;
|
|
44
|
+
return o === "newVersionPopup" && (i != null && i.genericOnboarding) ? !1 : i ? !i[o] : !0;
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
actions: {
|
|
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 = []);
|
|
52
|
+
});
|
|
53
|
+
},
|
|
54
|
+
start(n) {
|
|
55
|
+
this.closeOtherOnboardings(n), this.onboardings[n].cardIndex = 0, this.onboardings[n].isActive = !0;
|
|
56
|
+
},
|
|
57
|
+
async close(n) {
|
|
58
|
+
await this.setUserModalState(n, "true", "Guido"), this.onboardings[n].isActive = !1, this.onboardings[n].cardIndex = 0, this.onboardings[n].config = [];
|
|
59
|
+
},
|
|
60
|
+
next(n) {
|
|
61
|
+
this.onboardings[n].cardIndex < this.onboardings[n].config.length - 1 && this.onboardings[n].cardIndex++;
|
|
62
|
+
},
|
|
63
|
+
previous(n) {
|
|
64
|
+
this.onboardings[n].cardIndex > 0 && this.onboardings[n].cardIndex--;
|
|
65
|
+
},
|
|
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
|
+
},
|
|
69
|
+
async onDiscoverNowClicked() {
|
|
70
|
+
await this.setUserModalState("newVersionPopup", "true", "Guido"), await this.setUserModalState("genericOnboarding", "true", "Guido"), this.start("genericOnboarding");
|
|
71
|
+
},
|
|
72
|
+
onRemindMeLater() {
|
|
73
|
+
sessionStorage.setItem("newVersionPopupDismissed", "true");
|
|
74
|
+
},
|
|
75
|
+
async onNewVersionPopupClose() {
|
|
76
|
+
await this.setUserModalState("newVersionPopup", "true", "Guido");
|
|
77
|
+
},
|
|
78
|
+
isOnboardingActive() {
|
|
79
|
+
return Object.values(this.onboardings).some((n) => n.isActive);
|
|
80
|
+
},
|
|
81
|
+
async fetchUserModalState() {
|
|
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();
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
export {
|
|
94
|
+
g as useOnboardingStore
|
|
95
|
+
};
|
package/dist/stores/preview.d.ts
CHANGED
|
@@ -5,10 +5,8 @@ export declare const usePreviewStore: import("pinia").StoreDefinition<"preview",
|
|
|
5
5
|
ampHtml: string;
|
|
6
6
|
ampErrors: string[];
|
|
7
7
|
templateHtml: string;
|
|
8
|
-
isLoading: boolean;
|
|
9
8
|
isLoaded: boolean;
|
|
10
9
|
isAMPErrorModalVisible: boolean;
|
|
11
|
-
isPreviewModeOpen: boolean;
|
|
12
10
|
} & import("pinia").PiniaCustomStateProperties<PreviewState>) => boolean;
|
|
13
11
|
previewHtml(): string;
|
|
14
12
|
hasAMP: (state: {
|
|
@@ -16,20 +14,16 @@ export declare const usePreviewStore: import("pinia").StoreDefinition<"preview",
|
|
|
16
14
|
ampHtml: string;
|
|
17
15
|
ampErrors: string[];
|
|
18
16
|
templateHtml: string;
|
|
19
|
-
isLoading: boolean;
|
|
20
17
|
isLoaded: boolean;
|
|
21
18
|
isAMPErrorModalVisible: boolean;
|
|
22
|
-
isPreviewModeOpen: boolean;
|
|
23
19
|
} & import("pinia").PiniaCustomStateProperties<PreviewState>) => boolean;
|
|
24
20
|
hasAMPErrors: (state: {
|
|
25
21
|
emailFormat: EmailFormat;
|
|
26
22
|
ampHtml: string;
|
|
27
23
|
ampErrors: string[];
|
|
28
24
|
templateHtml: string;
|
|
29
|
-
isLoading: boolean;
|
|
30
25
|
isLoaded: boolean;
|
|
31
26
|
isAMPErrorModalVisible: boolean;
|
|
32
|
-
isPreviewModeOpen: boolean;
|
|
33
27
|
} & import("pinia").PiniaCustomStateProperties<PreviewState>) => boolean;
|
|
34
28
|
showAMPErrorButton(): boolean;
|
|
35
29
|
isAMPResponsive(): boolean;
|
|
@@ -41,6 +35,4 @@ export declare const usePreviewStore: import("pinia").StoreDefinition<"preview",
|
|
|
41
35
|
setEmailFormat(format: EmailFormat): void;
|
|
42
36
|
closeErrorModal(): void;
|
|
43
37
|
openErrorModal(): void;
|
|
44
|
-
openPreviewMode(): void;
|
|
45
|
-
closePreviewMode(): void;
|
|
46
38
|
}>;
|
package/dist/stores/preview.js
CHANGED
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
import { defineStore as
|
|
1
|
+
import { defineStore as e } from "pinia";
|
|
2
2
|
const s = () => ({
|
|
3
3
|
emailFormat: "html",
|
|
4
4
|
ampHtml: "",
|
|
5
5
|
ampErrors: [],
|
|
6
6
|
templateHtml: "",
|
|
7
|
-
isLoading: !1,
|
|
8
7
|
isLoaded: !1,
|
|
9
|
-
isAMPErrorModalVisible: !1
|
|
10
|
-
|
|
11
|
-
}), o = t("preview", {
|
|
8
|
+
isAMPErrorModalVisible: !1
|
|
9
|
+
}), a = e("preview", {
|
|
12
10
|
state: () => s(),
|
|
13
11
|
getters: {
|
|
14
|
-
isAMPModeEnabled: (
|
|
12
|
+
isAMPModeEnabled: (t) => t.emailFormat === "AMP",
|
|
15
13
|
previewHtml() {
|
|
16
14
|
return this.isAMPModeEnabled ? this.ampHtml : this.templateHtml;
|
|
17
15
|
},
|
|
18
|
-
hasAMP: (
|
|
16
|
+
hasAMP: (t) => {
|
|
19
17
|
var r;
|
|
20
|
-
return !!((r =
|
|
18
|
+
return !!((r = t.ampHtml) != null && r.trim());
|
|
21
19
|
},
|
|
22
|
-
hasAMPErrors: (
|
|
20
|
+
hasAMPErrors: (t) => t.ampErrors.length > 0,
|
|
23
21
|
showAMPErrorButton() {
|
|
24
22
|
return this.isAMPModeEnabled && this.hasAMPErrors;
|
|
25
23
|
},
|
|
@@ -28,26 +26,20 @@ const s = () => ({
|
|
|
28
26
|
}
|
|
29
27
|
},
|
|
30
28
|
actions: {
|
|
31
|
-
updateAMPData(
|
|
32
|
-
this.ampHtml =
|
|
29
|
+
updateAMPData(t) {
|
|
30
|
+
this.ampHtml = t.ampHtml ?? "", this.ampErrors = t.ampErrors ?? [], this.emailFormat = t.ampHtml ? "AMP" : "html";
|
|
33
31
|
},
|
|
34
|
-
setEmailFormat(
|
|
35
|
-
this.emailFormat =
|
|
32
|
+
setEmailFormat(t) {
|
|
33
|
+
this.emailFormat = t;
|
|
36
34
|
},
|
|
37
35
|
closeErrorModal() {
|
|
38
36
|
this.isAMPErrorModalVisible = !1;
|
|
39
37
|
},
|
|
40
38
|
openErrorModal() {
|
|
41
39
|
this.isAMPErrorModalVisible = !0;
|
|
42
|
-
},
|
|
43
|
-
openPreviewMode() {
|
|
44
|
-
this.isPreviewModeOpen = !0;
|
|
45
|
-
},
|
|
46
|
-
closePreviewMode() {
|
|
47
|
-
this.isPreviewModeOpen = !1;
|
|
48
40
|
}
|
|
49
41
|
}
|
|
50
42
|
});
|
|
51
43
|
export {
|
|
52
|
-
|
|
44
|
+
a as usePreviewStore
|
|
53
45
|
};
|
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.b6e86c0",
|
|
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",
|