@useinsider/guido 1.0.0-beta.81c7b67 → 1.0.0-beta.83deaec

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.
@@ -2,7 +2,7 @@ interface ModalWrapperProps {
2
2
  isOpen: boolean;
3
3
  title: string;
4
4
  description?: string;
5
- size?: 'small' | 'medium' | 'large';
5
+ size?: 'small' | 'medium' | 'large' | 'extra-large';
6
6
  primaryButtonText?: string;
7
7
  primaryButtonDisabled?: boolean;
8
8
  primaryButtonLoading?: boolean;
@@ -38,7 +38,7 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
38
38
  className: string;
39
39
  }>>>, {
40
40
  className: string;
41
- size: "small" | "medium" | "large";
41
+ size: "small" | "medium" | "large" | "extra-large";
42
42
  description: string;
43
43
  primaryButtonText: string;
44
44
  primaryButtonDisabled: boolean;
@@ -1,12 +1,12 @@
1
1
  import { defineComponent as o, computed as l } from "vue";
2
- import { InDrawer as s } from "@useinsider/design-system-vue";
2
+ import { InDrawer as r } from "@useinsider/design-system-vue";
3
3
  const i = /* @__PURE__ */ o({
4
4
  __name: "ModalWrapper",
5
5
  props: {
6
6
  isOpen: { type: Boolean },
7
7
  title: null,
8
8
  description: { default: "" },
9
- size: { default: "small" },
9
+ size: { default: "medium" },
10
10
  primaryButtonText: { default: "Save" },
11
11
  primaryButtonDisabled: { type: Boolean, default: !1 },
12
12
  primaryButtonLoading: { type: Boolean, default: !1 },
@@ -35,7 +35,7 @@ const i = /* @__PURE__ */ o({
35
35
  t("save");
36
36
  }, handleCancel: () => {
37
37
  t("cancel");
38
- }, InDrawer: s };
38
+ }, InDrawer: r };
39
39
  }
40
40
  });
41
41
  export {
@@ -1,78 +1,79 @@
1
- import { defineComponent as O, ref as s, watch as S } from "vue";
2
- import { useActionsApi as b } from "../../../composables/useActionsApi.js";
3
- import { useTemplateCategories as j } from "../../../composables/useTemplateCategories.js";
4
- import { useTemplateValidation as x } from "../../../composables/useTemplateValidation.js";
5
- import { useToaster as A } from "../../../composables/useToaster.js";
6
- import { useTranslations as E } from "../../../composables/useTranslations.js";
7
- import L from "../base/ModalWrapper.vue.js";
8
- import { InMultiSelect as R, InTextInput as V } from "@useinsider/design-system-vue";
9
- const J = /* @__PURE__ */ O({
1
+ import { defineComponent as N, ref as r, watch as C } from "vue";
2
+ import { useActionsApi as D } from "../../../composables/useActionsApi.js";
3
+ import { useTemplateCategories as O } from "../../../composables/useTemplateCategories.js";
4
+ import { useTemplateValidation as b } from "../../../composables/useTemplateValidation.js";
5
+ import { useToaster as x } from "../../../composables/useToaster.js";
6
+ import { useTranslations as A } from "../../../composables/useTranslations.js";
7
+ import R from "../base/ModalWrapper.vue.js";
8
+ import { InMultiSelect as V, InTextInput as W } from "@useinsider/design-system-vue";
9
+ const J = /* @__PURE__ */ N({
10
10
  __name: "SaveTemplateModal",
11
11
  props: {
12
12
  isOpen: { type: Boolean }
13
13
  },
14
14
  emits: ["close", "save"],
15
- setup(I, { emit: o }) {
16
- const p = I, l = E(), { showToaster: r } = A(), { getCompiledEmail: d } = b(), {
17
- data: _,
15
+ setup(E, { emit: l }) {
16
+ const p = E, M = A(), { handleError: o } = x(), { getCompiledEmail: u } = D(), {
17
+ data: S,
18
18
  fetchCategories: f,
19
19
  createCategory: v,
20
- setSelectedCategories: y,
20
+ setSelectedCategories: d,
21
21
  resetSelection: g,
22
- getSelectedCategoryIds: h
23
- } = j(), t = s(""), n = s(!1), i = s(!1), a = s(""), w = 40, {
24
- validationError: M,
25
- validateTemplateName: c,
26
- clearValidation: m
27
- } = x(), u = () => {
28
- t.value = "", g(), m(), a.value = "";
29
- }, C = () => {
30
- u(), o("close");
31
- }, D = async () => {
32
- if (t.value.trim()) {
33
- n.value = !0;
22
+ getSelectedCategoryIds: y
23
+ } = O(), a = r(""), s = r(!1), n = r(!1), t = r(""), I = 40, {
24
+ validationError: w,
25
+ validateTemplateName: i,
26
+ clearValidation: c
27
+ } = b(), m = () => {
28
+ a.value = "", g(), c(), t.value = "";
29
+ }, h = () => {
30
+ m(), l("close");
31
+ }, H = async () => {
32
+ if (a.value.trim()) {
33
+ s.value = !0;
34
34
  try {
35
- if (!(await c(t.value)).isValid)
35
+ if (!(await i(a.value)).isValid)
36
36
  return;
37
- o("save", {
38
- templateName: t.value,
39
- htmlData: a.value,
40
- categoryIds: h.value
41
- }), r({ message: l(
42
- "journey-builder.template-saved-successfully",
43
- { name: t.value }
44
- ) }), C();
45
- } catch {
46
- r({ message: l("journey-builder.template-save-error", { name: t.value }) });
37
+ if (!t.value) {
38
+ o(new Error("No HTML data available"), "Error saving template:");
39
+ return;
40
+ }
41
+ l("save", {
42
+ templateName: a.value,
43
+ htmlData: t.value,
44
+ categoryIds: y.value
45
+ }), h();
46
+ } catch (e) {
47
+ o(e, "Error saving template:");
47
48
  } finally {
48
- n.value = !1;
49
+ s.value = !1;
49
50
  }
50
51
  }
51
52
  };
52
- S(t, (e) => {
53
- e.trim() ? c(e) : m();
53
+ C(a, (e) => {
54
+ e.trim() ? i(e) : c();
54
55
  });
55
56
  const T = async () => {
56
- i.value = !0;
57
+ n.value = !0;
57
58
  try {
58
- const { html: e } = await d();
59
- a.value = e || "";
60
- } catch {
61
- a.value = "";
59
+ const { html: e } = await u();
60
+ t.value = e || "", e || o(new Error("No HTML content available"), "Warning:");
61
+ } catch (e) {
62
+ o(e, "Error fetching HTML data:"), t.value = "";
62
63
  } finally {
63
- i.value = !1;
64
+ n.value = !1;
64
65
  }
65
- }, H = (e) => {
66
- y(e);
67
- }, N = async (e) => {
66
+ }, _ = (e) => {
67
+ d(e);
68
+ }, L = async (e) => {
68
69
  await v(e);
69
70
  };
70
- return S(() => p.isOpen, async (e) => {
71
+ return C(() => p.isOpen, async (e) => {
71
72
  e ? await Promise.all([
72
73
  T(),
73
74
  f()
74
- ]) : u();
75
- }), { __sfc: !0, props: p, emit: o, trans: l, showToaster: r, getCompiledEmail: d, categoriesData: _, fetchCategories: f, createCategory: v, setSelectedCategories: y, resetSelection: g, getSelectedCategoryIds: h, templateNameInput: t, isSaving: n, isLoadingHtml: i, htmlData: a, templateCategorySearchInputLimit: w, validationError: M, validateTemplateName: c, clearValidation: m, resetModalState: u, closeModal: C, saveTemplate: D, fetchHtmlData: T, categoryChangeHandler: H, addOption: N, ModalWrapper: L, InTextInput: V, InMultiSelect: R };
75
+ ]) : m();
76
+ }), { __sfc: !0, props: p, emit: l, trans: M, handleError: o, getCompiledEmail: u, categoriesData: S, fetchCategories: f, createCategory: v, setSelectedCategories: d, resetSelection: g, getSelectedCategoryIds: y, templateNameInput: a, isSaving: s, isLoadingHtml: n, htmlData: t, templateCategorySearchInputLimit: I, validationError: w, validateTemplateName: i, clearValidation: c, resetModalState: m, closeModal: h, saveTemplate: H, fetchHtmlData: T, categoryChangeHandler: _, addOption: L, ModalWrapper: R, InTextInput: W, InMultiSelect: V };
76
77
  }
77
78
  });
78
79
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "1.0.0-beta.81c7b67",
3
+ "version": "1.0.0-beta.83deaec",
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",