@useinsider/guido 1.0.0-beta.83deaec → 1.0.0-beta.8861b13

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.
Files changed (70) hide show
  1. package/README.md +17 -17
  2. package/dist/components/Guido.vue.d.ts +0 -4
  3. package/dist/components/Guido.vue.js +8 -8
  4. package/dist/components/Guido.vue2.js +18 -34
  5. package/dist/components/organisms/{header/HeaderWrapper.vue.js → top-bar/Header.vue.js} +7 -7
  6. package/dist/components/organisms/top-bar/Header.vue2.js +14 -0
  7. package/dist/components/organisms/{header/LeftSlot.vue.js → top-bar/HeaderLeftSlot.vue.js} +7 -7
  8. package/dist/components/organisms/top-bar/HeaderLeftSlot.vue2.js +11 -0
  9. package/dist/components/organisms/top-bar/HeaderMiddleSlot.vue.js +17 -0
  10. package/dist/components/organisms/top-bar/HeaderMiddleSlot.vue2.js +19 -0
  11. package/dist/components/organisms/top-bar/HeaderRightSlot.vue.js +18 -0
  12. package/dist/components/organisms/top-bar/HeaderRightSlot.vue2.js +14 -0
  13. package/dist/components/organisms/{header/ViewOptions.vue.js → top-bar/HeaderViewOptions.vue.js} +5 -5
  14. package/dist/components/organisms/{header/ViewOptions.vue2.js → top-bar/HeaderViewOptions.vue2.js} +3 -3
  15. package/dist/composables/useStripo.d.ts +2 -2
  16. package/dist/composables/useStripo.js +55 -48
  17. package/dist/composables/useToaster.d.ts +0 -1
  18. package/dist/composables/useToaster.js +16 -24
  19. package/dist/enums/defaults.d.ts +0 -2
  20. package/dist/enums/defaults.js +3 -5
  21. package/dist/guido.css +1 -1
  22. package/dist/node_modules/pinia/dist/pinia.js +314 -0
  23. package/dist/node_modules/pinia/node_modules/vue-demi/lib/index.js +11 -0
  24. package/dist/static/editor.css.js +22 -72
  25. package/dist/stores/editor.d.ts +0 -2
  26. package/dist/stores/editor.js +2 -4
  27. package/package.json +1 -1
  28. package/dist/components/organisms/base/ModalWrapper.vue.d.ts +0 -72
  29. package/dist/components/organisms/base/ModalWrapper.vue.js +0 -19
  30. package/dist/components/organisms/base/ModalWrapper.vue2.js +0 -43
  31. package/dist/components/organisms/header/HeaderWrapper.vue2.js +0 -14
  32. package/dist/components/organisms/header/LeftSlot.vue2.js +0 -11
  33. package/dist/components/organisms/header/MiddleSlot.vue.js +0 -17
  34. package/dist/components/organisms/header/MiddleSlot.vue2.js +0 -20
  35. package/dist/components/organisms/header/RightSlot.vue.d.ts +0 -2
  36. package/dist/components/organisms/header/RightSlot.vue.js +0 -20
  37. package/dist/components/organisms/header/RightSlot.vue2.js +0 -26
  38. package/dist/components/organisms/header/version-history/VersionHistory.vue.d.ts +0 -2
  39. package/dist/components/organisms/header/version-history/VersionHistory.vue.js +0 -22
  40. package/dist/components/organisms/header/version-history/VersionHistory.vue2.js +0 -15
  41. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue.d.ts +0 -16
  42. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue.js +0 -18
  43. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue2.js +0 -16
  44. package/dist/components/organisms/header/version-history/ViewOptions.vue.js +0 -18
  45. package/dist/components/organisms/header/version-history/ViewOptions.vue2.js +0 -23
  46. package/dist/components/organisms/save-template/SaveTemplateModal.vue.d.ts +0 -21
  47. package/dist/components/organisms/save-template/SaveTemplateModal.vue.js +0 -22
  48. package/dist/components/organisms/save-template/SaveTemplateModal.vue2.js +0 -81
  49. package/dist/composables/useHttp.js +0 -84
  50. package/dist/composables/usePartner.d.ts +0 -4
  51. package/dist/composables/usePartner.js +0 -16
  52. package/dist/composables/useTemplateCategories.d.ts +0 -38
  53. package/dist/composables/useTemplateCategories.js +0 -80
  54. package/dist/composables/useTemplateValidation.d.ts +0 -13
  55. package/dist/composables/useTemplateValidation.js +0 -57
  56. package/dist/composables/useVersionHistoryApi.d.ts +0 -8
  57. package/dist/composables/useVersionHistoryApi.js +0 -53
  58. package/dist/mock/api/custom-fonts.d.ts +0 -2
  59. package/dist/mock/api/template-library.d.ts +0 -2
  60. package/dist/services/stripoApi.d.ts +0 -7
  61. package/dist/services/stripoApi.js +0 -29
  62. package/dist/stores/version-history.d.ts +0 -80
  63. package/dist/stores/version-history.js +0 -28
  64. package/dist/utils/dateUtil.d.ts +0 -1
  65. package/dist/utils/dateUtil.js +0 -16
  66. /package/dist/components/organisms/{header/HeaderWrapper.vue.d.ts → top-bar/Header.vue.d.ts} +0 -0
  67. /package/dist/components/organisms/{header/LeftSlot.vue.d.ts → top-bar/HeaderLeftSlot.vue.d.ts} +0 -0
  68. /package/dist/components/organisms/{header/ViewOptions.vue.d.ts → top-bar/HeaderMiddleSlot.vue.d.ts} +0 -0
  69. /package/dist/components/organisms/{header/MiddleSlot.vue.d.ts → top-bar/HeaderRightSlot.vue.d.ts} +0 -0
  70. /package/dist/components/organisms/{header/version-history/ViewOptions.vue.d.ts → top-bar/HeaderViewOptions.vue.d.ts} +0 -0
@@ -1,57 +0,0 @@
1
- import { useHttp as T } from "./useHttp.js";
2
- import { useToaster as V } from "./useToaster.js";
3
- import { useTranslations as N } from "./useTranslations.js";
4
- import { ref as m, computed as u } from "vue";
5
- const c = {
6
- DEBOUNCE_TIME: 500
7
- }, I = () => {
8
- const { get: d } = T(), { handleError: p } = V(), l = N(), s = m(""), o = m(!1), r = m(null), v = (a) => a.trim() ? {
9
- isValid: !0,
10
- message: ""
11
- } : {
12
- isValid: !1,
13
- message: l("validation.required-product-name-to-continue", { product: "template" })
14
- }, f = async (a) => {
15
- try {
16
- const i = `/template-library/template-name-exists?name=${encodeURIComponent(a)}`;
17
- return (await d(i)).data.status;
18
- } catch (e) {
19
- return p(e, "Error checking template name:"), !1;
20
- }
21
- }, E = (a) => (r.value && clearTimeout(r.value), new Promise((e) => {
22
- const i = v(a);
23
- if (!i.isValid) {
24
- s.value = i.message, e(i);
25
- return;
26
- }
27
- o.value = !0, r.value = setTimeout(async () => {
28
- try {
29
- const t = await f(a.trim()), n = {
30
- isValid: !t,
31
- message: t ? l("whatsapp-business.template-name-exists") : ""
32
- };
33
- s.value = n.message, e(n);
34
- } catch (t) {
35
- const n = {
36
- isValid: !1,
37
- message: t instanceof Error ? t.message : l("validation.unknown-error")
38
- };
39
- s.value = n.message, e(n);
40
- } finally {
41
- o.value = !1;
42
- }
43
- }, c.DEBOUNCE_TIME);
44
- })), g = () => {
45
- s.value = "", o.value = !1, r.value && clearTimeout(r.value);
46
- };
47
- return {
48
- validationError: u(() => s.value),
49
- isValidating: u(() => o.value),
50
- validateTemplateName: E,
51
- clearValidation: g,
52
- VALIDATION_RULES: c
53
- };
54
- };
55
- export {
56
- I as useTemplateValidation
57
- };
@@ -1,8 +0,0 @@
1
- export declare const useVersionHistoryApi: () => {
2
- openVersionHistory: () => void;
3
- closeVersionHistory: () => void;
4
- switchToDesktopPreview: () => void;
5
- switchToMobilePreview: () => void;
6
- previewVersion: (id: string) => void;
7
- restoreVersion: (id: string) => void;
8
- };
@@ -1,53 +0,0 @@
1
- import { useVersionHistoryStore as p } from "../stores/version-history.js";
2
- import { useToaster as c } from "./useToaster.js";
3
- const l = () => {
4
- const i = p(), { showToaster: s } = c(), t = (e) => {
5
- i.$reset(), i.updateState(e);
6
- }, n = () => {
7
- i.$reset();
8
- };
9
- return {
10
- openVersionHistory: () => {
11
- window.StripoEditorApi.versionHistoryApi.openVersionHistory(t, n);
12
- },
13
- closeVersionHistory: () => {
14
- window.StripoEditorApi.versionHistoryApi.closeVersionHistory();
15
- },
16
- switchToDesktopPreview: () => {
17
- window.StripoEditorApi.versionHistoryApi.switchToDesktopPreview();
18
- },
19
- switchToMobilePreview: () => {
20
- window.StripoEditorApi.versionHistoryApi.switchToMobilePreview();
21
- },
22
- previewVersion: (e) => {
23
- window.StripoEditorApi.versionHistoryApi.previewVersion(e, (o) => {
24
- const r = o instanceof Error ? o.message : String(o);
25
- s({
26
- type: "error",
27
- message: `Error compiling email: ${r}`
28
- });
29
- });
30
- },
31
- restoreVersion: (e) => {
32
- window.StripoEditorApi.versionHistoryApi.restoreVersion(
33
- e,
34
- () => {
35
- s({
36
- type: "success",
37
- message: `${e} patch restored successfully.`
38
- });
39
- },
40
- (o) => {
41
- const r = o instanceof Error ? o.message : String(o);
42
- s({
43
- type: "error",
44
- message: `Error compiling email: ${r}`
45
- });
46
- }
47
- );
48
- }
49
- };
50
- };
51
- export {
52
- l as useVersionHistoryApi
53
- };
@@ -1,2 +0,0 @@
1
- declare const _default: import("msw").HttpHandler[];
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: import("msw").HttpHandler[];
2
- export default _default;
@@ -1,7 +0,0 @@
1
- import type { CustomFont } from '@@/Types/stripo';
2
- export declare const useStripoApi: () => {
3
- getToken: () => Promise<string>;
4
- getCustomFonts: () => Promise<(CustomFont & {
5
- active: boolean;
6
- })[]>;
7
- };
@@ -1,29 +0,0 @@
1
- import { useHttp as s } from "../composables/useHttp.js";
2
- import { useToaster as n } from "../composables/useToaster.js";
3
- const m = () => {
4
- const { get: o } = s(), { handleError: r } = n();
5
- return {
6
- getToken: async () => {
7
- try {
8
- const t = Number(localStorage.getItem("ins-guido-test-instance")), { data: e } = await o(`/stripo/get-user-token?test=${t}`);
9
- return e.body.token;
10
- } catch (t) {
11
- return r(t, "Failed to fetch token"), "";
12
- }
13
- },
14
- getCustomFonts: async () => {
15
- try {
16
- const { data: t = [] } = await o("/stripo/get-partner-custom-fonts");
17
- return t.map((e) => ({
18
- ...e,
19
- active: !0
20
- }));
21
- } catch (t) {
22
- return r(t, "Failed to fetch custom fonts"), [];
23
- }
24
- }
25
- };
26
- };
27
- export {
28
- m as useStripoApi
29
- };
@@ -1,80 +0,0 @@
1
- import type { VersionHistoryState } from '@@/Types/version-history-api';
2
- export interface StoreState extends VersionHistoryState {
3
- editorVisualMode: 'desktop' | 'mobile';
4
- }
5
- export declare const useVersionHistoryStore: import("pinia").StoreDefinition<"versionHistory", StoreState, {
6
- hasPreviousPatch: (state: {
7
- editorVisualMode: "desktop" | "mobile";
8
- previousPatch: {
9
- id: string;
10
- date: number;
11
- description: string;
12
- authorId: string;
13
- authorName: string;
14
- };
15
- currentPatch: {
16
- id: string;
17
- date: number;
18
- description: string;
19
- authorId: string;
20
- authorName: string;
21
- };
22
- nextPatch: {
23
- id: string;
24
- date: number;
25
- description: string;
26
- authorId: string;
27
- authorName: string;
28
- };
29
- } & import("pinia").PiniaCustomStateProperties<StoreState>) => boolean;
30
- hasCurrentPatch: (state: {
31
- editorVisualMode: "desktop" | "mobile";
32
- previousPatch: {
33
- id: string;
34
- date: number;
35
- description: string;
36
- authorId: string;
37
- authorName: string;
38
- };
39
- currentPatch: {
40
- id: string;
41
- date: number;
42
- description: string;
43
- authorId: string;
44
- authorName: string;
45
- };
46
- nextPatch: {
47
- id: string;
48
- date: number;
49
- description: string;
50
- authorId: string;
51
- authorName: string;
52
- };
53
- } & import("pinia").PiniaCustomStateProperties<StoreState>) => boolean;
54
- hasNextPatch: (state: {
55
- editorVisualMode: "desktop" | "mobile";
56
- previousPatch: {
57
- id: string;
58
- date: number;
59
- description: string;
60
- authorId: string;
61
- authorName: string;
62
- };
63
- currentPatch: {
64
- id: string;
65
- date: number;
66
- description: string;
67
- authorId: string;
68
- authorName: string;
69
- };
70
- nextPatch: {
71
- id: string;
72
- date: number;
73
- description: string;
74
- authorId: string;
75
- authorName: string;
76
- };
77
- } & import("pinia").PiniaCustomStateProperties<StoreState>) => boolean;
78
- }, {
79
- updateState(state: VersionHistoryState): void;
80
- }>;
@@ -1,28 +0,0 @@
1
- import { defineStore as a } from "pinia";
2
- const e = () => ({
3
- id: "",
4
- date: 0,
5
- description: "",
6
- authorId: "",
7
- authorName: ""
8
- }), r = () => ({
9
- previousPatch: e(),
10
- currentPatch: e(),
11
- nextPatch: e(),
12
- editorVisualMode: "desktop"
13
- }), o = a("versionHistory", {
14
- state: () => r(),
15
- getters: {
16
- hasPreviousPatch: (t) => !!t.previousPatch.id,
17
- hasCurrentPatch: (t) => !!t.currentPatch.id,
18
- hasNextPatch: (t) => !!t.nextPatch.id
19
- },
20
- actions: {
21
- updateState(t) {
22
- t.previousPatch && (this.previousPatch = t.previousPatch), t.currentPatch && (this.currentPatch = t.currentPatch), t.nextPatch && (this.nextPatch = t.nextPatch);
23
- }
24
- }
25
- });
26
- export {
27
- o as useVersionHistoryStore
28
- };
@@ -1 +0,0 @@
1
- export declare const formatPatchDate: (timestamp: number) => string;
@@ -1,16 +0,0 @@
1
- const o = (t) => {
2
- if (!t)
3
- return "";
4
- const e = new Date(t);
5
- return new Intl.DateTimeFormat("en-US", {
6
- month: "short",
7
- day: "numeric",
8
- hour: "2-digit",
9
- minute: "2-digit",
10
- second: "2-digit",
11
- hour12: !1
12
- }).format(e);
13
- };
14
- export {
15
- o as formatPatchDate
16
- };