@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.
Files changed (80) hide show
  1. package/dist/@types/generic.d.ts +5 -0
  2. package/dist/components/Guido.vue.js +6 -6
  3. package/dist/components/Guido.vue2.js +36 -37
  4. package/dist/components/organisms/email-preview/PreviewContainer.vue.d.ts +2 -0
  5. package/dist/components/organisms/email-preview/PreviewContainer.vue.js +19 -0
  6. package/dist/components/organisms/email-preview/PreviewContainer.vue2.js +19 -0
  7. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.d.ts +4 -0
  8. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue.js +22 -0
  9. package/dist/components/organisms/email-preview/amp/AmpErrorModal.vue2.js +30 -0
  10. package/dist/components/organisms/email-preview/amp/AmpToggle.vue.d.ts +2 -0
  11. package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +19 -0
  12. package/dist/components/organisms/email-preview/amp/AmpToggle.vue2.js +29 -0
  13. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.d.ts +2 -0
  14. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +22 -0
  15. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue2.js +30 -0
  16. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.d.ts +2 -0
  17. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.js +17 -0
  18. package/dist/components/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue2.js +20 -0
  19. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.d.ts +2 -0
  20. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.js +18 -0
  21. package/dist/components/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue2.js +22 -0
  22. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.d.ts +4 -0
  23. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +19 -0
  24. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue2.js +23 -0
  25. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.d.ts +4 -0
  26. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue.js +20 -0
  27. package/dist/components/organisms/email-preview/mobile-preview/InboxView.vue2.js +21 -0
  28. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.d.ts +2 -0
  29. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue.js +17 -0
  30. package/dist/components/organisms/email-preview/mobile-preview/MobilePreview.vue2.js +22 -0
  31. package/dist/components/organisms/header/MiddleSlot.vue.js +9 -9
  32. package/dist/components/organisms/header/MiddleSlot.vue2.js +19 -14
  33. package/dist/components/organisms/header/RightSlot.vue.js +3 -3
  34. package/dist/components/organisms/header/RightSlot.vue2.js +19 -20
  35. package/dist/components/organisms/header/ViewOptions.vue.js +8 -8
  36. package/dist/components/organisms/header/ViewOptions.vue2.js +10 -8
  37. package/dist/components/wrappers/{ModalWrapper.vue.d.ts → WpModal.vue.d.ts} +37 -33
  38. package/dist/components/wrappers/WpModal.vue.js +27 -0
  39. package/dist/components/wrappers/WpModal.vue2.js +22 -0
  40. package/dist/composables/useActionsApi.d.ts +3 -2
  41. package/dist/composables/useActionsApi.js +49 -43
  42. package/dist/composables/useCodeEditorApi.d.ts +4 -0
  43. package/dist/composables/useCodeEditorApi.js +11 -0
  44. package/dist/composables/useConfig.d.ts +5 -0
  45. package/dist/composables/useConfig.js +11 -0
  46. package/dist/composables/useDebounce.d.ts +4 -0
  47. package/dist/composables/useDebounce.js +12 -0
  48. package/dist/composables/useHttp.js +21 -23
  49. package/dist/composables/usePreviewMode.d.ts +5 -0
  50. package/dist/composables/usePreviewMode.js +31 -0
  51. package/dist/composables/useResponsivePreview.d.ts +5 -0
  52. package/dist/composables/useResponsivePreview.js +86 -0
  53. package/dist/enums/defaults.js +9 -5
  54. package/dist/enums/preview.d.ts +13 -0
  55. package/dist/enums/preview.js +23 -0
  56. package/dist/guido.css +1 -1
  57. package/dist/static/assets/inbox-mockup.svg.js +4 -0
  58. package/dist/static/assets/phone-mockup.svg.js +4 -0
  59. package/dist/stores/editor.d.ts +0 -1
  60. package/dist/stores/editor.js +1 -2
  61. package/dist/stores/preview.d.ts +89 -0
  62. package/dist/stores/preview.js +63 -0
  63. package/package.json +3 -1
  64. package/dist/components/organisms/save-template/SaveTemplateModal.vue.d.ts +0 -16
  65. package/dist/components/organisms/save-template/SaveTemplateModal.vue.js +0 -20
  66. package/dist/components/organisms/save-template/SaveTemplateModal.vue2.js +0 -78
  67. package/dist/components/wrappers/ModalWrapper.vue.js +0 -19
  68. package/dist/components/wrappers/ModalWrapper.vue2.js +0 -43
  69. package/dist/composables/useSaveAsTemplate.d.ts +0 -7
  70. package/dist/composables/useSaveAsTemplate.js +0 -51
  71. package/dist/composables/useTemplateNameValidation.d.ts +0 -7
  72. package/dist/composables/useTemplateNameValidation.js +0 -33
  73. package/dist/mock/api/template-library.d.ts +0 -2
  74. package/dist/stores/template-categories.d.ts +0 -41
  75. package/dist/stores/template-categories.js +0 -91
  76. package/dist/utils/base64.d.ts +0 -2
  77. package/dist/utils/base64.js +0 -14
  78. package/dist/utils/generic.d.ts +0 -1
  79. package/dist/utils/generic.js +0 -7
  80. package/dist/utils/textUtil.d.ts +0 -2
@@ -1,17 +1,17 @@
1
- import s from "./MiddleSlot.vue2.js";
2
- import i from "../../../_virtual/_plugin-vue2_normalizer.js";
1
+ import i from "./MiddleSlot.vue2.js";
2
+ import s from "../../../_virtual/_plugin-vue2_normalizer.js";
3
3
  var n = function() {
4
- var e = this, o = e._self._c, t = e._self._setupProxy;
5
- return t.editorStore.isVersionHistoryOpen ? o("div", { staticClass: "d-f" }, [o(t.VersionHistory), o(t.VersionHistoryViewOptions)], 1) : o("div", { staticClass: "d-f" }, [o(t.InButtonV2, { attrs: { id: "guido__undo-button", "left-icon": "line-undo", styling: "ghost", type: "secondary", "label-text-status": !1 } }), o(t.InButtonV2, { attrs: { id: "guido__redo-button", "left-icon": "line-redo", styling: "ghost", type: "secondary", "label-text-status": !1 } }), o(t.InButtonV2, { attrs: { id: "guido__code-button", "data-testid": "Code Editor", "left-icon": "line-code", styling: "ghost", "tooltip-text": "Code Editor", type: "secondary", "label-text-status": !1, "selected-status": t.editorStore.isCodeEditorOpen, "tooltip-options": t.getTooltipOptions("guido__code-button") } }), o(t.InButtonV2, { attrs: { id: "guido__preview-button", "left-icon": "line-show-on", styling: "ghost", type: "secondary", "label-text-status": !1, "tooltip-options": t.getTooltipOptions("guido__preview-button"), "tooltip-text": t.trans("newsletter.email-preview") } }), o(t.ViewOptions, { staticClass: "ml-3" })], 1);
6
- }, l = [], r = /* @__PURE__ */ i(
7
- s,
4
+ var o = this, e = o._self._c, t = o._self._setupProxy;
5
+ return t.editorStore.isVersionHistoryOpen ? e("div", { staticClass: "d-f" }, [e(t.VersionHistory), e(t.VersionHistoryViewOptions)], 1) : e("div", { staticClass: "d-f" }, [e(t.InButtonV2, { attrs: { id: "guido__undo-button", "left-icon": "line-undo", styling: "ghost", type: "secondary", "disabled-status": t.previewStore.isPreviewModeOpen, "label-text-status": !1 } }), e(t.InButtonV2, { attrs: { id: "guido__redo-button", "left-icon": "line-redo", styling: "ghost", type: "secondary", "disabled-status": t.previewStore.isPreviewModeOpen, "label-text-status": !1 } }), e(t.InButtonV2, { attrs: { id: "guido__code-button", "data-testid": "Code Editor", "left-icon": "line-code", styling: "ghost", "tooltip-text": "Code Editor", type: "secondary", "disabled-status": t.previewStore.isPreviewModeOpen, "label-text-status": !1, "selected-status": t.editorStore.isCodeEditorOpen, "tooltip-options": t.getTooltipOptions("guido__code-button") } }), e(t.InButtonV2, { attrs: { id: "guido__preview-button", "left-icon": "line-show-on", styling: "ghost", type: "secondary", "label-text-status": !1, "selected-status": t.previewStore.isPreviewModeOpen, "tooltip-options": t.getTooltipOptions("guido__preview-button"), "tooltip-text": t.previewTooltipText }, on: { click: t.handlePreviewToggle } }), e(t.ViewOptions, { staticClass: "ml-3" }), t.previewStore.isPreviewModeOpen ? e(t.AmpToggle) : o._e()], 1);
6
+ }, r = [], d = /* @__PURE__ */ s(
7
+ i,
8
8
  n,
9
- l,
9
+ r,
10
10
  !1,
11
11
  null,
12
12
  null
13
13
  );
14
- const p = r.exports;
14
+ const u = d.exports;
15
15
  export {
16
- p as default
16
+ u as default
17
17
  };
@@ -1,22 +1,27 @@
1
- import { defineComponent as r } from "vue";
2
- import { useTranslations as s } from "../../../composables/useTranslations.js";
3
- import { useEditorStore as n } from "../../../stores/editor.js";
4
- import { InButtonV2 as e } from "@useinsider/design-system-vue";
5
- import m from "./version-history/VersionHistory.vue.js";
6
- import p from "./version-history/ViewOptions.vue.js";
7
- import f from "./ViewOptions.vue.js";
8
- const y = /* @__PURE__ */ r({
1
+ import { defineComponent as p, computed as m } from "vue";
2
+ import { usePreviewMode as l } from "../../../composables/usePreviewMode.js";
3
+ import { useTranslations as c } from "../../../composables/useTranslations.js";
4
+ import f from "../email-preview/amp/AmpToggle.vue.js";
5
+ import { useEditorStore as a } from "../../../stores/editor.js";
6
+ import { usePreviewStore as d } from "../../../stores/preview.js";
7
+ import { InButtonV2 as w } from "@useinsider/design-system-vue";
8
+ import v from "./version-history/VersionHistory.vue.js";
9
+ import u from "./version-history/ViewOptions.vue.js";
10
+ import P from "./ViewOptions.vue.js";
11
+ const B = /* @__PURE__ */ p({
9
12
  __name: "MiddleSlot",
10
- setup(a) {
11
- const o = n(), t = s();
12
- return { __sfc: !0, editorStore: o, trans: t, getTooltipOptions: (i) => ({
13
- id: `${i}-tooltip`,
13
+ setup(g) {
14
+ const r = a(), o = c(), e = d(), { openPreviewMode: t, closePreviewMode: i } = l(), s = m(() => o(e.isPreviewModeOpen ? "newsletter.close-email-preview" : "newsletter.email-preview"));
15
+ return { __sfc: !0, editorStore: r, trans: o, previewStore: e, openPreviewMode: t, closePreviewMode: i, previewTooltipText: s, getTooltipOptions: (n) => ({
16
+ id: `${n}-tooltip`,
14
17
  dynamicPosition: !1,
15
18
  staticPosition: "bottom center",
16
19
  iconStatus: !1
17
- }), InButtonV2: e, VersionHistory: m, VersionHistoryViewOptions: p, ViewOptions: f };
20
+ }), handlePreviewToggle: () => {
21
+ e.isPreviewModeOpen ? i() : t();
22
+ }, AmpToggle: f, InButtonV2: w, VersionHistory: v, VersionHistoryViewOptions: u, ViewOptions: P };
18
23
  }
19
24
  });
20
25
  export {
21
- y as default
26
+ B as default
22
27
  };
@@ -2,7 +2,7 @@ import o from "./RightSlot.vue2.js";
2
2
  import i from "../../../_virtual/_plugin-vue2_normalizer.js";
3
3
  var n = function() {
4
4
  var s = this, e = s._self._c, t = s._self._setupProxy;
5
- return e("div", { staticClass: "d-f" }, [e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen }, on: { click: t.handleVersionHistory } }), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 }, on: { click: t.exportHtml } }), e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 }, on: { click: t.handleSaveAsTemplate } }), e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 } }), e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": t.editorStore.isVersionHistoryOpen }, on: { click: t.handleSave } })], 1);
5
+ return e("div", { staticClass: "d-f" }, [e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.previewStore.isPreviewModeOpen, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen }, on: { click: t.handleVersionHistory } }), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 }, on: { click: t.exportHtml } }), e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 } }), e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 } }), e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": t.isSaveButtonDisabled }, on: { click: t.handleSave } })], 1);
6
6
  }, a = [], r = /* @__PURE__ */ i(
7
7
  o,
8
8
  n,
@@ -11,7 +11,7 @@ var n = function() {
11
11
  null,
12
12
  null
13
13
  );
14
- const u = r.exports;
14
+ const c = r.exports;
15
15
  export {
16
- u as default
16
+ c as default
17
17
  };
@@ -1,26 +1,24 @@
1
- import { defineComponent as m } from "vue";
2
- import { useActionsApi as p } from "../../../composables/useActionsApi.js";
3
- import { useExport as l } from "../../../composables/useExport.js";
4
- import { useSaveStart as c, useSaveComplete as d } from "../../../composables/useGuidoActions.js";
5
- import { useVersionHistoryApi as f } from "../../../composables/useVersionHistoryApi.js";
6
- import { useEditorStore as u } from "../../../stores/editor.js";
7
- import { InButtonV2 as S } from "@useinsider/design-system-vue";
8
- const T = /* @__PURE__ */ m({
1
+ import { defineComponent as u, computed as f } from "vue";
2
+ import { useActionsApi as d } from "../../../composables/useActionsApi.js";
3
+ import { useExport as S } from "../../../composables/useExport.js";
4
+ import { useSaveStart as v, useSaveComplete as y } from "../../../composables/useGuidoActions.js";
5
+ import { useVersionHistoryApi as _ } from "../../../composables/useVersionHistoryApi.js";
6
+ import { useEditorStore as H } from "../../../stores/editor.js";
7
+ import { usePreviewStore as V } from "../../../stores/preview.js";
8
+ import { InButtonV2 as h } from "@useinsider/design-system-vue";
9
+ const b = /* @__PURE__ */ u({
9
10
  __name: "RightSlot",
10
- setup(h) {
11
- const { exportHtml: i } = l(), { getCompiledEmail: o } = p(), r = c(), s = d(), { openVersionHistory: n, closeVersionHistory: a } = f(), e = u();
12
- return { __sfc: !0, exportHtml: i, getCompiledEmail: o, saveStart: r, saveComplete: s, openVersionHistory: n, closeVersionHistory: a, editorStore: e, handleVersionHistory: () => {
13
- if (e.isVersionHistoryOpen) {
14
- a();
11
+ setup(w) {
12
+ const { exportHtml: p } = S(), { getCompiledEmail: e } = d(), r = v(), s = y(), { openVersionHistory: i, closeVersionHistory: n } = _(), o = H(), m = V(), a = () => {
13
+ if (o.isVersionHistoryOpen) {
14
+ n();
15
15
  return;
16
16
  }
17
- n();
18
- }, handleSaveAsTemplate: async () => {
19
- e.isSaveTemplateModalOpen = !0;
20
- }, handleSave: async () => {
17
+ i();
18
+ }, c = async () => {
21
19
  r();
22
20
  try {
23
- const { html: t } = await o();
21
+ const { html: t } = await e();
24
22
  s({
25
23
  html: t || "",
26
24
  css: ""
@@ -29,9 +27,10 @@ const T = /* @__PURE__ */ m({
29
27
  } catch (t) {
30
28
  console.error("Failed to get template data for save:", t);
31
29
  }
32
- }, InButtonV2: S };
30
+ }, l = f(() => o.isVersionHistoryOpen || m.isPreviewModeOpen);
31
+ return { __sfc: !0, exportHtml: p, getCompiledEmail: e, saveStart: r, saveComplete: s, openVersionHistory: i, closeVersionHistory: n, editorStore: o, previewStore: m, handleVersionHistory: a, handleSave: c, isSaveButtonDisabled: l, InButtonV2: h };
33
32
  }
34
33
  });
35
34
  export {
36
- T as default
35
+ b as default
37
36
  };
@@ -1,18 +1,18 @@
1
1
  import r from "./ViewOptions.vue2.js";
2
2
  /* empty css */
3
- import s from "../../../_virtual/_plugin-vue2_normalizer.js";
4
- var n = function() {
3
+ import i from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var s = function() {
5
5
  var t = this, o = t._self._c, e = t._self._setupProxy;
6
- return o(e.InSegments, { attrs: { id: "guido__view-option-selection", "with-icon": "", "segment-list": e.segmentList, selected: e.editorStore.editorVisualMode } });
7
- }, i = [], _ = /* @__PURE__ */ s(
6
+ return o(e.InSegments, { attrs: { id: "guido__view-option-selection", "with-icon": "", disable: e.previewStore.isPreviewModeOpen, "segment-list": e.segmentList, selected: e.editorStore.editorVisualMode } });
7
+ }, n = [], _ = /* @__PURE__ */ i(
8
8
  r,
9
+ s,
9
10
  n,
10
- i,
11
11
  !1,
12
12
  null,
13
- "0fff376c"
13
+ "c4fe2637"
14
14
  );
15
- const l = _.exports;
15
+ const d = _.exports;
16
16
  export {
17
- l as default
17
+ d as default
18
18
  };
@@ -1,15 +1,17 @@
1
- import { defineComponent as e } from "vue";
2
- import { useEditorStore as t } from "../../../stores/editor.js";
3
- import { InSegments as o } from "@useinsider/design-system-vue";
4
- const u = /* @__PURE__ */ e({
1
+ import { defineComponent as r } from "vue";
2
+ import { useEditorStore as i } from "../../../stores/editor.js";
3
+ import { usePreviewStore as n } from "../../../stores/preview.js";
4
+ import { InSegments as s } from "@useinsider/design-system-vue";
5
+ const _ = /* @__PURE__ */ r({
5
6
  __name: "ViewOptions",
6
- setup(n) {
7
- return { __sfc: !0, editorStore: t(), segmentList: [
7
+ setup(m) {
8
+ const e = i(), t = [
8
9
  { text: "", icon: "line-desktop", value: "desktop" },
9
10
  { text: "", icon: "line-menu-mobileapp", value: "mobile" }
10
- ], InSegments: o };
11
+ ], o = n();
12
+ return { __sfc: !0, editorStore: e, segmentList: t, previewStore: o, InSegments: s };
11
13
  }
12
14
  });
13
15
  export {
14
- u as default
16
+ _ as default
15
17
  };
@@ -1,50 +1,54 @@
1
- interface ModalWrapperProps {
2
- isOpen: boolean;
1
+ interface FooterButtonGroup {
2
+ primaryButton?: {
3
+ type: string;
4
+ labelText: string;
5
+ disabledStatus?: boolean;
6
+ };
7
+ cancelOrBackButton?: {
8
+ type: string;
9
+ labelText: string;
10
+ styling: string;
11
+ };
12
+ }
13
+ type __VLS_Props = {
14
+ id: string;
3
15
  title: string;
4
16
  description?: string;
5
17
  size?: 'small' | 'medium' | 'large';
6
- primaryButtonText?: string;
7
- primaryButtonDisabled?: boolean;
8
- primaryButtonLoading?: boolean;
9
- cancelButtonText?: string;
10
- showCancelButton?: boolean;
11
- className?: string;
12
- }
13
- declare var __VLS_12: {};
18
+ footerButtonOptions?: FooterButtonGroup;
19
+ closeButtonStatus?: boolean;
20
+ closeOnOutsideClick?: boolean;
21
+ footerStatus?: boolean;
22
+ };
23
+ declare var __VLS_13: {};
14
24
  type __VLS_Slots = {} & {
15
- default?: (props: typeof __VLS_12) => any;
25
+ default?: (props: typeof __VLS_13) => any;
16
26
  };
17
- declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<ModalWrapperProps>, {
27
+ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
18
28
  description: string;
19
29
  size: string;
20
- primaryButtonText: string;
21
- primaryButtonDisabled: boolean;
22
- primaryButtonLoading: boolean;
23
- cancelButtonText: string;
24
- showCancelButton: boolean;
25
- className: string;
30
+ footerButtonOptions: undefined;
31
+ closeButtonStatus: boolean;
32
+ closeOnOutsideClick: boolean;
33
+ footerStatus: boolean;
26
34
  }>, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
27
35
  close: () => void;
28
- save: () => void;
29
- cancel: () => void;
30
- }, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<ModalWrapperProps>, {
36
+ "primary-action": () => void;
37
+ "secondary-action": () => void;
38
+ }, string, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
31
39
  description: string;
32
40
  size: string;
33
- primaryButtonText: string;
34
- primaryButtonDisabled: boolean;
35
- primaryButtonLoading: boolean;
36
- cancelButtonText: string;
37
- showCancelButton: boolean;
38
- className: string;
41
+ footerButtonOptions: undefined;
42
+ closeButtonStatus: boolean;
43
+ closeOnOutsideClick: boolean;
44
+ footerStatus: boolean;
39
45
  }>>>, {
40
- className: string;
41
46
  size: "small" | "medium" | "large";
42
47
  description: string;
43
- primaryButtonText: string;
44
- primaryButtonDisabled: boolean;
45
- primaryButtonLoading: boolean;
46
- cancelButtonText: string;
47
- showCancelButton: boolean;
48
+ footerButtonOptions: FooterButtonGroup;
49
+ closeButtonStatus: boolean;
50
+ closeOnOutsideClick: boolean;
51
+ footerStatus: boolean;
48
52
  }>;
49
53
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
50
54
  export default _default;
@@ -0,0 +1,27 @@
1
+ import r from "./WpModal.vue2.js";
2
+ import s from "../../_virtual/_plugin-vue2_normalizer.js";
3
+ var i = function() {
4
+ var t = this, o = t._self._c, e = t._self._setupProxy;
5
+ return o(e.InModalV2, { attrs: { id: t.id, "description-status": "", status: "", "close-button-status": t.closeButtonStatus, "close-on-outside-click": t.closeOnOutsideClick, "description-text": t.description, "footer-button-group-options": t.footerButtonOptions, "footer-status": t.footerStatus, size: t.size, "title-text": t.title }, on: { cancelOrBackButtonEvent: function(n) {
6
+ return e.emit("close");
7
+ }, onCloseEvent: function(n) {
8
+ return e.emit("close");
9
+ }, primaryButtonEvent: function(n) {
10
+ return e.emit("primary-action");
11
+ }, secondaryButtonEvent: function(n) {
12
+ return e.emit("secondary-action");
13
+ } }, scopedSlots: t._u([{ key: "contentSlot", fn: function() {
14
+ return [t._t("default")];
15
+ }, proxy: !0 }], null, !0) });
16
+ }, u = [], c = /* @__PURE__ */ s(
17
+ r,
18
+ i,
19
+ u,
20
+ !1,
21
+ null,
22
+ null
23
+ );
24
+ const p = c.exports;
25
+ export {
26
+ p as default
27
+ };
@@ -0,0 +1,22 @@
1
+ import { defineComponent as e } from "vue";
2
+ import { InModalV2 as o } from "@useinsider/design-system-vue";
3
+ const u = /* @__PURE__ */ e({
4
+ __name: "WpModal",
5
+ props: {
6
+ id: null,
7
+ title: null,
8
+ description: { default: "" },
9
+ size: { default: "small" },
10
+ footerButtonOptions: { default: void 0 },
11
+ closeButtonStatus: { type: Boolean, default: !0 },
12
+ closeOnOutsideClick: { type: Boolean, default: !0 },
13
+ footerStatus: { type: Boolean, default: !0 }
14
+ },
15
+ emits: ["close", "primary-action", "secondary-action"],
16
+ setup(l, { emit: t }) {
17
+ return { __sfc: !0, emit: t, InModalV2: o };
18
+ }
19
+ });
20
+ export {
21
+ u as default
22
+ };
@@ -1,6 +1,7 @@
1
- import { GetCompiledEmailOptions, CompiledEmailResult, TemplateDataResult } from '@@/Types/actions-api';
1
+ import type { CompileEmailOptions } from '@@/Types/actions-api';
2
+ import { GetCompiledEmailOptions, CompiledEmailResult } from '@@/Types/actions-api';
2
3
  export declare const useActionsApi: () => {
3
4
  getCompiledEmail: (options?: GetCompiledEmailOptions) => Promise<CompiledEmailResult>;
4
- getRawTemplateData: () => Promise<TemplateDataResult>;
5
5
  activateCustomViewStyles: (isActive?: boolean) => void;
6
+ getPreviewData: (options?: CompileEmailOptions) => Promise<CompiledEmailResult>;
6
7
  };
@@ -1,48 +1,54 @@
1
- const g = () => ({
2
- getCompiledEmail: (t = {}) => new Promise((e, a) => {
3
- const o = {
4
- ...{ ...{
5
- minimize: !0,
6
- utmEntity: {
7
- utmSource: "",
8
- utmMedium: "",
9
- utmCampaign: "",
10
- utmContent: "",
11
- utmTerm: "",
12
- customUtms: [
13
- {
14
- name1: "val1",
15
- name2: "val2"
16
- }
17
- ]
18
- },
19
- mergeTags: ["Tag1", "Tag2"],
20
- forseAmp: !1,
21
- resetDataSavedFlag: !1,
22
- disableLineHeightsReplace: !0
23
- }, ...t },
24
- callback: (i, s, m, n, l) => {
25
- i ? a(i) : e({
26
- html: s,
27
- ampHtml: m,
28
- ampErrors: n,
29
- displayConditions: l
1
+ const w = () => {
2
+ const s = (t = {}) => new Promise((e, a) => {
3
+ const i = { ...{
4
+ minimize: !0,
5
+ utmEntity: {
6
+ utmSource: "",
7
+ utmMedium: "",
8
+ utmCampaign: "",
9
+ utmContent: "",
10
+ utmTerm: "",
11
+ customUtms: [
12
+ {
13
+ name1: "val1",
14
+ name2: "val2"
15
+ }
16
+ ]
17
+ },
18
+ mergeTags: ["Tag1", "Tag2"],
19
+ forseAmp: !1,
20
+ resetDataSavedFlag: !1,
21
+ disableLineHeightsReplace: !0
22
+ }, ...t }, n = {
23
+ callback: (m, l, c, r, p) => {
24
+ m ? a(m) : e({
25
+ html: l,
26
+ ampHtml: c,
27
+ ampErrors: r,
28
+ displayConditions: p
30
29
  });
31
- }
30
+ },
31
+ ...i
32
32
  };
33
- window.StripoEditorApi.actionsApi.compileEmail(o);
34
- }),
35
- getRawTemplateData: () => new Promise((t) => {
36
- window.StripoEditorApi.actionsApi.getTemplateData(
37
- (e) => {
38
- t(e);
39
- }
40
- );
41
- }),
42
- activateCustomViewStyles: (t = !0) => {
33
+ window.StripoEditorApi.actionsApi.compileEmail(n);
34
+ });
35
+ return { getCompiledEmail: s, activateCustomViewStyles: (t = !0) => {
43
36
  window.StripoEditorApi.actionsApi.activateCustomViewStyles(t);
44
- }
45
- });
37
+ }, getPreviewData: async (t) => {
38
+ const {
39
+ html: e,
40
+ displayConditions: a,
41
+ ampHtml: o = "",
42
+ ampErrors: i = []
43
+ } = await s({ minimize: !1, resetDataSavedFlag: !1, ...t });
44
+ return {
45
+ html: e,
46
+ ampHtml: o,
47
+ ampErrors: i,
48
+ displayConditions: a
49
+ };
50
+ } };
51
+ };
46
52
  export {
47
- g as useActionsApi
53
+ w as useActionsApi
48
54
  };
@@ -0,0 +1,4 @@
1
+ export declare const useCodeEditorApi: () => {
2
+ openCodeEditor: () => void;
3
+ closeCodeEditor: () => void;
4
+ };
@@ -0,0 +1,11 @@
1
+ const i = () => ({
2
+ openCodeEditor: () => {
3
+ window.StripoEditorApi.codeEditorApi.openCodeEditor();
4
+ },
5
+ closeCodeEditor: () => {
6
+ window.StripoEditorApi.codeEditorApi.closeCodeEditor();
7
+ }
8
+ });
9
+ export {
10
+ i as useCodeEditorApi
11
+ };
@@ -0,0 +1,5 @@
1
+ import type { GuidoConfig } from '@@/Types/generic';
2
+ export declare const useConfig: () => {
3
+ config: GuidoConfig;
4
+ getConfig: () => GuidoConfig;
5
+ };
@@ -0,0 +1,11 @@
1
+ import { DefaultGuidoConfig as n } from "../enums/defaults.js";
2
+ const t = () => {
3
+ const o = () => typeof window > "u" ? n : window.GuidoConfig || n;
4
+ return {
5
+ config: o(),
6
+ getConfig: o
7
+ };
8
+ };
9
+ export {
10
+ t as useConfig
11
+ };
@@ -0,0 +1,4 @@
1
+ export declare const useDebounce: () => {
2
+ debounce: (fn: () => void, ms?: number) => void;
3
+ clearDebounce: () => void;
4
+ };
@@ -0,0 +1,12 @@
1
+ import { ref as c } from "vue";
2
+ const r = () => {
3
+ const e = c(void 0);
4
+ return { debounce: (o, u = 150) => {
5
+ e.value && window.clearTimeout(e.value), e.value = window.setTimeout(o, u);
6
+ }, clearDebounce: () => {
7
+ e.value && (window.clearTimeout(e.value), e.value = void 0);
8
+ } };
9
+ };
10
+ export {
11
+ r as useDebounce
12
+ };
@@ -1,20 +1,18 @@
1
- import { ref as p, computed as T } from "vue";
2
- import { getCsrfToken as H } from "../utils/generic.js";
3
- const k = (b = {}) => {
4
- const h = p(!1), a = p(null), u = p(null), g = T(() => h.value), y = T(() => a.value !== null), v = {
1
+ import { ref as p, computed as v } from "vue";
2
+ const j = (y = {}) => {
3
+ const h = p(!1), a = p(null), u = p(null), E = v(() => h.value), g = v(() => a.value !== null), T = {
5
4
  baseURL: "",
6
5
  timeout: 1e4,
7
6
  retry: 0,
8
7
  retryDelay: 1e3,
9
8
  headers: {
10
- "Content-Type": "application/json",
11
- "X-CSRF-TOKEN": H()
9
+ "Content-Type": "application/json"
12
10
  },
13
- ...b
11
+ ...y
14
12
  }, w = (e, s) => {
15
13
  if (e.startsWith("http://") || e.startsWith("https://"))
16
14
  return e;
17
- const t = s || v.baseURL || "";
15
+ const t = s || T.baseURL || "";
18
16
  return t.endsWith("/") && e.startsWith("/") ? `${t}${e.slice(1)}` : t.endsWith("/") || e.startsWith("/") ? `${t}${e}` : `${t}/${e}`;
19
17
  }, P = (e) => new Promise((s, t) => {
20
18
  setTimeout(() => {
@@ -24,20 +22,20 @@ const k = (b = {}) => {
24
22
  setTimeout(s, e);
25
23
  }), i = async (e, s, t, D = {}) => {
26
24
  a.value = null, h.value = !0, u.value = new AbortController();
27
- const n = { ...v, ...D }, L = w(s, n.baseURL), c = {
25
+ const n = { ...T, ...D }, L = w(s, n.baseURL), c = {
28
26
  method: e,
29
27
  headers: { ...n.headers },
30
28
  signal: u.value.signal,
31
29
  ...n
32
30
  };
33
31
  t && ["POST", "PUT", "PATCH"].includes(e) && (t instanceof FormData ? (delete c.headers["Content-Type"], c.body = t) : c.body = JSON.stringify(t));
34
- const E = async (m = 0) => {
32
+ const b = async (m = 0) => {
35
33
  try {
36
34
  const o = [fetch(L, c)];
37
35
  n.timeout && o.push(P(n.timeout));
38
36
  const r = await Promise.race(o);
39
37
  if (!r.ok) {
40
- const O = `HTTP Error: ${r.status} ${r.statusText}`, d = new Error(O);
38
+ const H = `HTTP Error: ${r.status} ${r.statusText}`, d = new Error(H);
41
39
  throw d.status = r.status, d.statusText = r.statusText, d.response = r, d;
42
40
  }
43
41
  let f;
@@ -51,36 +49,36 @@ const k = (b = {}) => {
51
49
  } catch (o) {
52
50
  const r = o instanceof Error && o.name === "AbortError";
53
51
  if (m < (n.retry || 0) && !r)
54
- return await x(n.retryDelay || 1e3), E(m + 1);
52
+ return await x(n.retryDelay || 1e3), b(m + 1);
55
53
  throw o instanceof Error ? o.name === "AbortError" ? a.value = { message: "Request was cancelled" } : a.value = { message: o.message } : a.value = o, o;
56
54
  }
57
55
  };
58
56
  try {
59
- return await E();
57
+ return await b();
60
58
  } finally {
61
59
  h.value = !1, u.value = null;
62
60
  }
63
- }, C = (e, s) => i("GET", e, void 0, s), $ = (e, s, t) => i("POST", e, s, t), R = (e, s, t) => i("PUT", e, s, t), U = (e, s, t) => i("PATCH", e, s, t), A = (e, s) => i("DELETE", e, void 0, s), W = (e) => {
61
+ }, $ = (e, s) => i("GET", e, void 0, s), C = (e, s, t) => i("POST", e, s, t), U = (e, s, t) => i("PUT", e, s, t), A = (e, s, t) => i("PATCH", e, s, t), R = (e, s) => i("DELETE", e, void 0, s), W = (e) => {
64
62
  u.value && u.value.abort(e);
65
63
  }, q = () => {
66
64
  a.value = null;
67
65
  };
68
66
  return {
69
67
  // State
70
- loading: g,
71
- error: T(() => a.value),
72
- hasError: y,
68
+ loading: E,
69
+ error: v(() => a.value),
70
+ hasError: g,
73
71
  // Methods
74
72
  request: i,
75
- get: C,
76
- post: $,
77
- put: R,
78
- patch: U,
79
- delete: A,
73
+ get: $,
74
+ post: C,
75
+ put: U,
76
+ patch: A,
77
+ delete: R,
80
78
  cancel: W,
81
79
  clearError: q
82
80
  };
83
81
  };
84
82
  export {
85
- k as useHttp
83
+ j as useHttp
86
84
  };
@@ -0,0 +1,5 @@
1
+ export declare const usePreviewMode: () => {
2
+ closePreviewMode: () => void;
3
+ openPreviewMode: () => void;
4
+ loadPreviewData: () => Promise<void>;
5
+ };