@useinsider/guido 1.0.0-beta.c2acdd4 → 1.0.0-beta.c798ebe
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/@types/generic.d.ts +5 -0
- package/dist/components/Guido.vue.js +6 -6
- package/dist/components/Guido.vue2.js +36 -37
- package/dist/components/organisms/email-preview/PreviewContainer.vue.d.ts +2 -0
- package/dist/components/organisms/email-preview/PreviewContainer.vue.js +19 -0
- package/dist/components/organisms/email-preview/PreviewContainer.vue2.js +19 -0
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.d.ts +4 -0
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.js +22 -0
- package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue2.js +30 -0
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue.d.ts +2 -0
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +19 -0
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +29 -0
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.d.ts +2 -0
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +22 -0
- package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +30 -0
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.d.ts +2 -0
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.js +17 -0
- package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +20 -0
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.d.ts +2 -0
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +18 -0
- package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +22 -0
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.d.ts +4 -0
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +19 -0
- package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +23 -0
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.d.ts +4 -0
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +20 -0
- package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +21 -0
- package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.d.ts +2 -0
- package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.js +17 -0
- package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue2.js +22 -0
- package/dist/components/organisms/header/MiddleSlot.vue.js +9 -9
- package/dist/components/organisms/header/MiddleSlot.vue2.js +19 -14
- package/dist/components/organisms/header/RightSlot.vue.js +3 -3
- package/dist/components/organisms/header/RightSlot.vue2.js +19 -20
- package/dist/components/organisms/header/ViewOptions.vue.js +8 -8
- package/dist/components/organisms/header/ViewOptions.vue2.js +10 -8
- package/dist/components/wrappers/{ModalWrapper.vue.d.ts → WpModal.vue.d.ts} +37 -33
- package/dist/components/wrappers/WpModal.vue.js +27 -0
- package/dist/components/wrappers/WpModal.vue2.js +22 -0
- package/dist/composables/useActionsApi.d.ts +3 -2
- package/dist/composables/useActionsApi.js +49 -43
- package/dist/composables/useCodeEditorApi.d.ts +4 -0
- package/dist/composables/useCodeEditorApi.js +11 -0
- package/dist/composables/useConfig.d.ts +5 -0
- package/dist/composables/useConfig.js +11 -0
- package/dist/composables/useDebounce.d.ts +4 -0
- package/dist/composables/useDebounce.js +12 -0
- package/dist/composables/useHttp.js +21 -23
- package/dist/composables/usePreviewMode.d.ts +5 -0
- package/dist/composables/usePreviewMode.js +31 -0
- package/dist/composables/useResponsivePreview.d.ts +5 -0
- package/dist/composables/useResponsivePreview.js +86 -0
- package/dist/enums/defaults.js +9 -5
- package/dist/enums/preview.d.ts +13 -0
- package/dist/enums/preview.js +23 -0
- package/dist/guido.css +1 -1
- package/dist/static/assets/inbox-mockup.svg.js +4 -0
- package/dist/static/assets/phone-mockup.svg.js +4 -0
- package/dist/stores/editor.d.ts +0 -1
- package/dist/stores/editor.js +1 -2
- package/dist/stores/preview.d.ts +89 -0
- package/dist/stores/preview.js +63 -0
- package/package.json +3 -1
- package/dist/components/organisms/save-template/SaveTemplateModal.vue.d.ts +0 -16
- package/dist/components/organisms/save-template/SaveTemplateModal.vue.js +0 -20
- package/dist/components/organisms/save-template/SaveTemplateModal.vue2.js +0 -78
- package/dist/components/wrappers/ModalWrapper.vue.js +0 -19
- package/dist/components/wrappers/ModalWrapper.vue2.js +0 -43
- package/dist/composables/useSaveAsTemplate.d.ts +0 -7
- package/dist/composables/useSaveAsTemplate.js +0 -51
- package/dist/composables/useTemplateNameValidation.d.ts +0 -7
- package/dist/composables/useTemplateNameValidation.js +0 -33
- package/dist/mock/api/template-library.d.ts +0 -2
- package/dist/stores/template-categories.d.ts +0 -41
- package/dist/stores/template-categories.js +0 -91
- package/dist/utils/base64.d.ts +0 -2
- package/dist/utils/base64.js +0 -14
- package/dist/utils/generic.d.ts +0 -1
- package/dist/utils/generic.js +0 -7
- package/dist/utils/textUtil.d.ts +0 -2
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { useHttp as m } from "./useHttp.js";
|
|
2
|
-
import { base64EncodeWithSpecialChars as t } from "../utils/base64.js";
|
|
3
|
-
import { reactive as a } from "vue";
|
|
4
|
-
const u = () => {
|
|
5
|
-
const { post: o } = m(), n = a({
|
|
6
|
-
saving: !1
|
|
7
|
-
});
|
|
8
|
-
return {
|
|
9
|
-
state: n,
|
|
10
|
-
saveTemplate: async (e) => {
|
|
11
|
-
n.saving = !0;
|
|
12
|
-
const i = {
|
|
13
|
-
editor: "stripo",
|
|
14
|
-
html: t(e.htmlContent),
|
|
15
|
-
css: t(e.css)
|
|
16
|
-
}, c = t(JSON.stringify(i ?? ""));
|
|
17
|
-
try {
|
|
18
|
-
const s = {
|
|
19
|
-
name: e.name,
|
|
20
|
-
categories: e.categoryIds,
|
|
21
|
-
productId: 60,
|
|
22
|
-
editorType: 2,
|
|
23
|
-
messageType: 2,
|
|
24
|
-
stripoConfig: c,
|
|
25
|
-
content: t(e.htmlContent),
|
|
26
|
-
unsubscriptionPreferencePages: [],
|
|
27
|
-
unsubscriptionPreferencePageStatus: !1
|
|
28
|
-
};
|
|
29
|
-
e.css && (s.css = t(e.css)), e.stripoConfig && (s.stripoConfig = t(
|
|
30
|
-
JSON.stringify(e.stripoConfig)
|
|
31
|
-
)), e.recommendationConfigs && (s.recommendationConfigs = t(
|
|
32
|
-
JSON.stringify(e.recommendationConfigs)
|
|
33
|
-
)), e.recommendationCampaignUrls && (s.recommendationCampaignUrls = t(
|
|
34
|
-
JSON.stringify(e.recommendationCampaignUrls)
|
|
35
|
-
));
|
|
36
|
-
const r = await o(
|
|
37
|
-
"/newsletter/template-library/create-template",
|
|
38
|
-
s
|
|
39
|
-
);
|
|
40
|
-
return !(!r.data || r.data.type === "error");
|
|
41
|
-
} catch {
|
|
42
|
-
return !1;
|
|
43
|
-
} finally {
|
|
44
|
-
n.saving = !1;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
|
-
export {
|
|
50
|
-
u as useSaveAsTemplate
|
|
51
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { ref as r } from "vue";
|
|
2
|
-
import { useHttp as i } from "./useHttp.js";
|
|
3
|
-
import { useTranslations as m } from "./useTranslations.js";
|
|
4
|
-
const o = 255;
|
|
5
|
-
function h() {
|
|
6
|
-
const n = r(""), e = r(""), t = m();
|
|
7
|
-
return {
|
|
8
|
-
templateName: n,
|
|
9
|
-
getValidationMessage: () => e.value,
|
|
10
|
-
hasError: () => !!e.value.length,
|
|
11
|
-
validateInputs: async () => {
|
|
12
|
-
const a = n.value.trim();
|
|
13
|
-
if (!a)
|
|
14
|
-
return e.value = t("whatsapp-business.template-name-required"), !1;
|
|
15
|
-
if (a.length > o)
|
|
16
|
-
return e.value = t("validations.enter-up-to-x-characters", {
|
|
17
|
-
article: "a",
|
|
18
|
-
field: t("products.template-name"),
|
|
19
|
-
max: o
|
|
20
|
-
}), !1;
|
|
21
|
-
const l = encodeURIComponent(a), { data: s = {} } = await i().get(
|
|
22
|
-
`/newsletter/template-library/template-name-exists?name=${l}`
|
|
23
|
-
);
|
|
24
|
-
return s != null && s.status ? (e.value = t("whatsapp-business.template-name-exists"), !1) : !0;
|
|
25
|
-
},
|
|
26
|
-
resetValidation: () => {
|
|
27
|
-
e.value = "";
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
export {
|
|
32
|
-
h as useTemplateNameValidation
|
|
33
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { TemplateCategory } from '@@/Types/save-as-template';
|
|
2
|
-
export interface MappedCategory {
|
|
3
|
-
value: string;
|
|
4
|
-
text: string;
|
|
5
|
-
}
|
|
6
|
-
export interface TemplateCategoriesState {
|
|
7
|
-
categories: TemplateCategory[];
|
|
8
|
-
mappedCategories: MappedCategory[];
|
|
9
|
-
selectedCategories: MappedCategory[];
|
|
10
|
-
loading: boolean;
|
|
11
|
-
loadingCreate: boolean;
|
|
12
|
-
}
|
|
13
|
-
export declare const useTemplateCategoriesStore: import("pinia").StoreDefinition<"templateCategories", TemplateCategoriesState, {
|
|
14
|
-
getSelectedCategoryIds: (state: {
|
|
15
|
-
categories: {
|
|
16
|
-
id: number;
|
|
17
|
-
name: string;
|
|
18
|
-
partnerId: number;
|
|
19
|
-
isStripo: boolean;
|
|
20
|
-
templatesCount: number;
|
|
21
|
-
}[];
|
|
22
|
-
mappedCategories: {
|
|
23
|
-
value: string;
|
|
24
|
-
text: string;
|
|
25
|
-
}[];
|
|
26
|
-
selectedCategories: {
|
|
27
|
-
value: string;
|
|
28
|
-
text: string;
|
|
29
|
-
}[];
|
|
30
|
-
loading: boolean;
|
|
31
|
-
loadingCreate: boolean;
|
|
32
|
-
} & import("pinia").PiniaCustomStateProperties<TemplateCategoriesState>) => number[];
|
|
33
|
-
}, {
|
|
34
|
-
fetchCategories(): Promise<void>;
|
|
35
|
-
checkCategoryNameExists(name: string): Promise<boolean>;
|
|
36
|
-
createCategory(name: string): Promise<void>;
|
|
37
|
-
setSelectedCategories(categories: MappedCategory[]): void;
|
|
38
|
-
selectCategory(category: MappedCategory): void;
|
|
39
|
-
resetSelection(): void;
|
|
40
|
-
resetStore(): void;
|
|
41
|
-
}>;
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { useHttp as c } from "../composables/useHttp.js";
|
|
2
|
-
import { useToaster as r } from "../composables/useToaster.js";
|
|
3
|
-
import { defineStore as g } from "pinia";
|
|
4
|
-
const l = () => ({
|
|
5
|
-
categories: [],
|
|
6
|
-
mappedCategories: [],
|
|
7
|
-
selectedCategories: [],
|
|
8
|
-
loading: !1,
|
|
9
|
-
loadingCreate: !1
|
|
10
|
-
}), m = g("templateCategories", {
|
|
11
|
-
state: () => l(),
|
|
12
|
-
getters: {
|
|
13
|
-
getSelectedCategoryIds: (e) => e.selectedCategories.map((s) => parseInt(s.value))
|
|
14
|
-
},
|
|
15
|
-
actions: {
|
|
16
|
-
async fetchCategories() {
|
|
17
|
-
this.loading = !0;
|
|
18
|
-
const { get: e } = c();
|
|
19
|
-
try {
|
|
20
|
-
const t = (await e("/newsletter/template-library/get-template-categories")).data || [];
|
|
21
|
-
this.categories = t, this.mappedCategories = t.map((a) => ({
|
|
22
|
-
value: a.id.toString(),
|
|
23
|
-
text: a.name
|
|
24
|
-
}));
|
|
25
|
-
} catch (s) {
|
|
26
|
-
const { handleError: t } = r();
|
|
27
|
-
t(s, "Error fetching template categories:"), this.categories = [], this.mappedCategories = [];
|
|
28
|
-
} finally {
|
|
29
|
-
this.loading = !1;
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
async checkCategoryNameExists(e) {
|
|
33
|
-
const { get: s } = c();
|
|
34
|
-
try {
|
|
35
|
-
const a = `/newsletter/template-library/category-name-exists?name=${encodeURIComponent(e)}`;
|
|
36
|
-
return (await s(a)).data.status;
|
|
37
|
-
} catch (t) {
|
|
38
|
-
const { handleError: a } = r();
|
|
39
|
-
return a(t, "Error checking category name:"), !1;
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
async createCategory(e) {
|
|
43
|
-
this.loadingCreate = !0;
|
|
44
|
-
const { post: s } = c(), { showToaster: t } = r();
|
|
45
|
-
try {
|
|
46
|
-
if (await this.checkCategoryNameExists(e)) {
|
|
47
|
-
t({
|
|
48
|
-
type: "error",
|
|
49
|
-
message: "Category name already exists"
|
|
50
|
-
});
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
const i = (await s("/newsletter/template-library/create-category", { name: e })).data;
|
|
54
|
-
if (i) {
|
|
55
|
-
this.categories.push(i);
|
|
56
|
-
const n = {
|
|
57
|
-
value: i.id.toString(),
|
|
58
|
-
text: e
|
|
59
|
-
};
|
|
60
|
-
this.mappedCategories.push(n), this.selectedCategories.push(n), t({
|
|
61
|
-
type: "success",
|
|
62
|
-
message: "Category created successfully"
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
} catch (a) {
|
|
66
|
-
const { handleError: o } = r();
|
|
67
|
-
o(a, "Error creating category:");
|
|
68
|
-
} finally {
|
|
69
|
-
this.loadingCreate = !1;
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
setSelectedCategories(e) {
|
|
73
|
-
this.selectedCategories = [...e];
|
|
74
|
-
},
|
|
75
|
-
selectCategory(e) {
|
|
76
|
-
const s = this.selectedCategories.findIndex(
|
|
77
|
-
(t) => t.value === e.value
|
|
78
|
-
);
|
|
79
|
-
s === -1 ? this.selectedCategories.push(e) : this.selectedCategories.splice(s, 1);
|
|
80
|
-
},
|
|
81
|
-
resetSelection() {
|
|
82
|
-
this.selectedCategories = [];
|
|
83
|
-
},
|
|
84
|
-
resetStore() {
|
|
85
|
-
Object.assign(this, l());
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
export {
|
|
90
|
-
m as useTemplateCategoriesStore
|
|
91
|
-
};
|
package/dist/utils/base64.d.ts
DELETED
package/dist/utils/base64.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const c = (e) => {
|
|
2
|
-
try {
|
|
3
|
-
const n = new TextEncoder().encode(e);
|
|
4
|
-
let o = "";
|
|
5
|
-
return n.forEach((r) => {
|
|
6
|
-
o += String.fromCharCode(r);
|
|
7
|
-
}), window.btoa(o);
|
|
8
|
-
} catch {
|
|
9
|
-
return window.btoa(unescape(encodeURIComponent(e)));
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
export {
|
|
13
|
-
c as base64EncodeWithSpecialChars
|
|
14
|
-
};
|
package/dist/utils/generic.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getCsrfToken: () => string;
|
package/dist/utils/generic.js
DELETED
package/dist/utils/textUtil.d.ts
DELETED