@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
package/README.md CHANGED
@@ -24,7 +24,6 @@ npm install @useinsider/guido
24
24
  <div>
25
25
  <Guido
26
26
  :email-id="emailId"
27
- :user-id="userId"
28
27
  :guido-config="guidoConfig"
29
28
  />
30
29
  </div>
@@ -40,7 +39,6 @@ export default {
40
39
  data() {
41
40
  return {
42
41
  emailId: 'abc123',
43
- userId: '12345',
44
42
  guidoConfig: {
45
43
  translationsPath: 'window.trans.en'
46
44
  }
@@ -57,10 +55,6 @@ export default {
57
55
  | Prop | Type | Required | Default | Description |
58
56
  |------|------|----------|---------|-------------|
59
57
  | `emailId` | `string` | ✅ | - | Unique identifier for the email draft |
60
- | `userId` | `string` | ✅ | - | Unique identifier for the user draft |
61
- | `username` | `string` | ⚪ | Guido User | User name |
62
- | `partnerName` | `string` | ⚪ | Getting from URL host | Unique identifier for the partner draft |
63
- | `productType` | `string` | ⚪ | Getting from URL path | Unique identifier for the product draft |
64
58
  | `guidoConfig` | `GuidoConfig` | ✅ | - | Configuration object for the editor |
65
59
 
66
60
  ### GuidoConfig Interface
@@ -144,17 +138,23 @@ VITE_STRIPO_ROLE=your_role
144
138
 
145
139
  ```
146
140
  src/
147
- ├── components/ # Vue components
148
- ├── composables/ # Vue composables & business logic
149
- ├── services/ # API layer
150
- ├── stores/ # State management
151
- ├── @types/ # TypeScript definitions
152
- ├── static/ # Static assets & templates
153
- ├── utils/ # Utility functions
154
- ├── enums/ # Constants & enums
155
- ├── mock/ # Mock data for development
156
- ├── plugins/ # Vue plugins
157
- └── library.ts # Main export
141
+ ├── components/
142
+ │ ├── Guido.vue # Main component
143
+ │ └── organisms/
144
+ │ └── top-bar/ # Header components
145
+ ...
146
+ ├── composables/
147
+ │ ├── useStripo.ts # Stripo integration
148
+ │ └── useTranslations.ts # Translation management
149
+ ├── @types/
150
+ │ ├── generic.ts # Generic types
151
+ │ ├── stripo.d.ts # Stripo-specific types
152
+ │ └── events.ts # Event types
153
+ ├── static/
154
+ │ ├── editor.css # Custom editor styles
155
+ │ └── templates/
156
+ │ └── default/ # Default email template
157
+ └── library.ts # Main export for library
158
158
  ```
159
159
 
160
160
  ## 🌐 i18n
@@ -1,10 +1,6 @@
1
1
  import type { GuidoConfig } from '@@/Types/generic';
2
2
  type __VLS_Props = {
3
3
  emailId: string;
4
- userId: string;
5
- partnerName?: string;
6
- productType?: string;
7
- username?: string;
8
4
  guidoConfig: GuidoConfig;
9
5
  };
10
6
  declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
@@ -1,18 +1,18 @@
1
1
  import o from "./Guido.vue2.js";
2
2
  /* empty css */
3
- import a from "../_virtual/_plugin-vue2_normalizer.js";
3
+ import i from "../_virtual/_plugin-vue2_normalizer.js";
4
4
  var s = function() {
5
- var t = this, e = t._self._c, r = t._self._setupProxy;
6
- return e("div", { staticClass: "guido-editor__wrapper" }, [e(r.HeaderWrapper), e("div", { staticClass: "guido-editor__container", attrs: { id: "guido-editor" } }), e(r.SaveTemplateModal, { attrs: { "is-open": r.editorStore.isSaveTemplateModalOpen }, on: { close: r.handleCloseSaveTemplateModal } })], 1);
7
- }, i = [], n = /* @__PURE__ */ a(
5
+ var e = this, r = e._self._c, t = e._self._setupProxy;
6
+ return r("div", { staticClass: "guido-editor__wrapper" }, [r(t.Header), r("div", { staticClass: "guido-editor__container", attrs: { id: "guido-editor" } })], 1);
7
+ }, _ = [], a = /* @__PURE__ */ i(
8
8
  o,
9
9
  s,
10
- i,
10
+ _,
11
11
  !1,
12
12
  null,
13
- "f20b186e"
13
+ "ef4897b1"
14
14
  );
15
- const c = n.exports;
15
+ const p = a.exports;
16
16
  export {
17
- c as default
17
+ p as default
18
18
  };
@@ -1,47 +1,31 @@
1
- import { defineComponent as g, onMounted as T } from "vue";
2
- import { usePartner as S } from "../composables/usePartner.js";
3
- import { useStripo as C } from "../composables/useStripo.js";
4
- import { useTemplates as _ } from "../composables/useTemplates.js";
5
- import { DefaultUsername as y, DefaultGuidoConfig as w } from "../enums/defaults.js";
6
- import I from "./organisms/header/HeaderWrapper.vue.js";
7
- import M from "./organisms/save-template/SaveTemplateModal.vue.js";
8
- import { useEditorStore as P } from "../stores/editor.js";
9
- const F = /* @__PURE__ */ g({
1
+ import { defineComponent as n, onMounted as a } from "vue";
2
+ import { useStripo as m } from "../composables/useStripo.js";
3
+ import { useTemplates as p } from "../composables/useTemplates.js";
4
+ import { DefaultGuidoConfig as u } from "../enums/defaults.js";
5
+ import l from "./organisms/top-bar/Header.vue.js";
6
+ const _ = /* @__PURE__ */ n({
10
7
  __name: "Guido",
11
8
  props: {
12
9
  emailId: null,
13
- userId: null,
14
- partnerName: null,
15
- productType: null,
16
- username: null,
17
10
  guidoConfig: null
18
11
  },
19
- setup(f) {
20
- const o = f, { getPartnerName: t, getProductType: r } = S(), {
21
- emailId: a,
22
- userId: n,
23
- guidoConfig: i,
24
- partnerName: l = t(),
25
- productType: m = r(),
26
- username: p = y
27
- } = o;
12
+ setup(r) {
13
+ const o = r;
28
14
  window.GuidoConfig = {
29
- ...w,
30
- ...i
15
+ ...u,
16
+ ...o.guidoConfig
31
17
  };
32
- const { initPlugin: u } = C({ emailId: a, userId: n, username: p, partnerName: l, productType: m }), { getDefaultTemplate: s } = _(), d = P(), c = () => {
33
- d.isSaveTemplateModalOpen = !1;
34
- };
35
- return T(async () => {
18
+ const { initPlugin: i } = m(o.emailId), { getDefaultTemplate: e } = p();
19
+ return a(async () => {
36
20
  try {
37
- const e = await s();
38
- await u(e);
39
- } catch (e) {
40
- console.error("Failed to initialize Stripo editor:", e);
21
+ const t = await e();
22
+ await i(t);
23
+ } catch (t) {
24
+ console.error("Failed to initialize Stripo editor:", t);
41
25
  }
42
- }), { __sfc: !0, props: o, getPartnerName: t, getProductType: r, emailId: a, userId: n, guidoConfig: i, partnerName: l, productType: m, username: p, initPlugin: u, getDefaultTemplate: s, editorStore: d, handleCloseSaveTemplateModal: c, HeaderWrapper: I, SaveTemplateModal: M };
26
+ }), { __sfc: !0, props: o, initPlugin: i, getDefaultTemplate: e, Header: l };
43
27
  }
44
28
  });
45
29
  export {
46
- F as default
30
+ _ as default
47
31
  };
@@ -1,17 +1,17 @@
1
- import t from "./HeaderWrapper.vue2.js";
1
+ import t from "./Header.vue2.js";
2
2
  import s from "../../../_virtual/_plugin-vue2_normalizer.js";
3
- var n = function() {
3
+ var a = function() {
4
4
  var o = this, r = o._self._c, e = o._self._setupProxy;
5
- return r(e.InContainer, { attrs: { border: "bor-w-0 bor-b-w-1 bor-s-s bor-c-6", "border-radius": "bor-r-0" } }, [r("div", { staticClass: "w-1 d-f a-i-c j-c-s-b p-3" }, [r(e.LeftSlot), r(e.MiddleSlot), r(e.RightSlot)], 1)]);
6
- }, a = [], _ = /* @__PURE__ */ s(
5
+ return r(e.InContainer, { attrs: { border: "bor-w-0 bor-b-w-1 bor-s-s bor-c-6", "border-radius": "bor-r-0" } }, [r("div", { staticClass: "w-1 d-f a-i-c j-c-s-b p-3" }, [r(e.HeaderLeftSlot), r(e.HeaderMiddleSlot), r(e.HeaderRightSlot)], 1)]);
6
+ }, n = [], _ = /* @__PURE__ */ s(
7
7
  t,
8
- n,
9
8
  a,
9
+ n,
10
10
  !1,
11
11
  null,
12
12
  null
13
13
  );
14
- const d = _.exports;
14
+ const c = _.exports;
15
15
  export {
16
- d as default
16
+ c as default
17
17
  };
@@ -0,0 +1,14 @@
1
+ import { defineComponent as e } from "vue";
2
+ import { InContainer as r } from "@useinsider/design-system-vue";
3
+ import o from "./HeaderLeftSlot.vue.js";
4
+ import t from "./HeaderMiddleSlot.vue.js";
5
+ import m from "./HeaderRightSlot.vue.js";
6
+ const _ = /* @__PURE__ */ e({
7
+ __name: "Header",
8
+ setup(f) {
9
+ return { __sfc: !0, InContainer: r, HeaderLeftSlot: o, HeaderMiddleSlot: t, HeaderRightSlot: m };
10
+ }
11
+ });
12
+ export {
13
+ _ as default
14
+ };
@@ -1,17 +1,17 @@
1
- import r from "./LeftSlot.vue2.js";
1
+ import n from "./HeaderLeftSlot.vue2.js";
2
2
  import o from "../../../_virtual/_plugin-vue2_normalizer.js";
3
3
  var _ = function() {
4
- var t = this, e = t._self._c, n = t._self._setupProxy;
5
- return e("div", [e(n.InButtonV2, { attrs: { id: "guido__back-button", "label-text": "Back", "left-icon": "line-arrow-left", styling: "text", type: "secondary" } })], 1);
6
- }, s = [], a = /* @__PURE__ */ o(
7
- r,
4
+ var t = this, e = t._self._c, r = t._self._setupProxy;
5
+ return e("div", [e(r.InButtonV2, { attrs: { id: "guido__back-button", "label-text": "Back", "left-icon": "line-arrow-left", styling: "text", type: "secondary" } })], 1);
6
+ }, a = [], s = /* @__PURE__ */ o(
7
+ n,
8
8
  _,
9
- s,
9
+ a,
10
10
  !1,
11
11
  null,
12
12
  null
13
13
  );
14
- const i = a.exports;
14
+ const i = s.exports;
15
15
  export {
16
16
  i as default
17
17
  };
@@ -0,0 +1,11 @@
1
+ import { defineComponent as t } from "vue";
2
+ import { InButtonV2 as e } from "@useinsider/design-system-vue";
3
+ const _ = /* @__PURE__ */ t({
4
+ __name: "HeaderLeftSlot",
5
+ setup(o) {
6
+ return { __sfc: !0, InButtonV2: e };
7
+ }
8
+ });
9
+ export {
10
+ _ as default
11
+ };
@@ -0,0 +1,17 @@
1
+ import n from "./HeaderMiddleSlot.vue2.js";
2
+ import s from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var i = function() {
4
+ var o = this, e = o._self._c, t = o._self._setupProxy;
5
+ return e("div", { staticClass: "d-f" }, [e(t.InButtonV2, { attrs: { id: "guido__undo-button", "left-icon": "line-undo", styling: "ghost", type: "secondary", "label-text-status": !1 } }), e(t.InButtonV2, { attrs: { id: "guido__redo-button", "left-icon": "line-redo", styling: "ghost", type: "secondary", "label-text-status": !1 } }), e(t.InButtonV2, { attrs: { id: "guido__code-button", "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") } }), e(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") } })], 1);
6
+ }, l = [], r = /* @__PURE__ */ s(
7
+ n,
8
+ i,
9
+ l,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const _ = r.exports;
15
+ export {
16
+ _ as default
17
+ };
@@ -0,0 +1,19 @@
1
+ import { defineComponent as i } from "vue";
2
+ import { useTranslations as n } from "../../../composables/useTranslations.js";
3
+ import { useEditorStore as s } from "../../../stores/editor.js";
4
+ import { InButtonV2 as r } from "@useinsider/design-system-vue";
5
+ const l = /* @__PURE__ */ i({
6
+ __name: "HeaderMiddleSlot",
7
+ setup(p) {
8
+ const t = s(), o = n();
9
+ return { __sfc: !0, editorStore: t, trans: o, getTooltipOptions: (e) => ({
10
+ id: `${e}-tooltip`,
11
+ dynamicPosition: !1,
12
+ staticPosition: "bottom center",
13
+ iconStatus: !1
14
+ }), InButtonV2: r };
15
+ }
16
+ });
17
+ export {
18
+ l as default
19
+ };
@@ -0,0 +1,18 @@
1
+ import o from "./HeaderRightSlot.vue2.js";
2
+ /* empty css */
3
+ import n from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var a = function() {
5
+ var s = this, t = s._self._c, e = s._self._setupProxy;
6
+ return t("div", { staticClass: "d-f header-right-slot" }, [t("div", { staticClass: "d-f" }, [t(e.HeaderViewOptions)], 1), t("div", { staticClass: "d-f" }, [t(e.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "label-text-status": !1 } }), t(e.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "label-text-status": !1 }, on: { click: e.exportHtml } }), t(e.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "label-text-status": !1 } }), t(e.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "label-text-status": !1 } })], 1), t(e.InButtonV2, { attrs: { id: "guido__save-button", "label-text": "Save" } })], 1);
7
+ }, i = [], r = /* @__PURE__ */ n(
8
+ o,
9
+ a,
10
+ i,
11
+ !1,
12
+ null,
13
+ "28200d25"
14
+ );
15
+ const u = r.exports;
16
+ export {
17
+ u as default
18
+ };
@@ -0,0 +1,14 @@
1
+ import { defineComponent as o } from "vue";
2
+ import { useExport as r } from "../../../composables/useExport.js";
3
+ import { InButtonV2 as e } from "@useinsider/design-system-vue";
4
+ import m from "./HeaderViewOptions.vue.js";
5
+ const _ = /* @__PURE__ */ o({
6
+ __name: "HeaderRightSlot",
7
+ setup(p) {
8
+ const { exportHtml: t } = r();
9
+ return { __sfc: !0, exportHtml: t, InButtonV2: e, HeaderViewOptions: m };
10
+ }
11
+ });
12
+ export {
13
+ _ as default
14
+ };
@@ -1,5 +1,5 @@
1
- import r from "./ViewOptions.vue2.js";
2
- /* empty css */
1
+ import r from "./HeaderViewOptions.vue2.js";
2
+ /* empty css */
3
3
  import s from "../../../_virtual/_plugin-vue2_normalizer.js";
4
4
  var n = function() {
5
5
  var t = this, o = t._self._c, e = t._self._setupProxy;
@@ -10,9 +10,9 @@ var n = function() {
10
10
  i,
11
11
  !1,
12
12
  null,
13
- "0fff376c"
13
+ "f67c82be"
14
14
  );
15
- const l = _.exports;
15
+ const f = _.exports;
16
16
  export {
17
- l as default
17
+ f as default
18
18
  };
@@ -1,8 +1,8 @@
1
1
  import { defineComponent as e } from "vue";
2
2
  import { useEditorStore as t } from "../../../stores/editor.js";
3
3
  import { InSegments as o } from "@useinsider/design-system-vue";
4
- const u = /* @__PURE__ */ e({
5
- __name: "ViewOptions",
4
+ const a = /* @__PURE__ */ e({
5
+ __name: "HeaderViewOptions",
6
6
  setup(n) {
7
7
  return { __sfc: !0, editorStore: t(), segmentList: [
8
8
  { text: "", icon: "line-desktop", value: "desktop" },
@@ -11,5 +11,5 @@ const u = /* @__PURE__ */ e({
11
11
  }
12
12
  });
13
13
  export {
14
- u as default
14
+ a as default
15
15
  };
@@ -1,4 +1,4 @@
1
- import type { Metadata, Template } from '@@/Types/stripo';
2
- export declare const useStripo: (metadata: Metadata) => {
1
+ import type { Template } from '@@/Types/stripo';
2
+ export declare const useStripo: (emailId: string) => {
3
3
  initPlugin: (template: Template) => Promise<void>;
4
4
  };
@@ -1,74 +1,81 @@
1
- import { useCustomInterfaceAppearance as m } from "./useCustomInterfaceAppearance.js";
2
- import { useToaster as g } from "./useToaster.js";
3
- import { useStripoApi as E } from "../services/stripoApi.js";
4
- import { useEditorStore as S } from "../stores/editor.js";
5
- const _ = (c) => {
6
- const { handleError: d } = g(), { getToken: u, getCustomFonts: a } = E(), l = (e, i = []) => {
7
- const r = S(), { html: t, css: n } = e;
1
+ import { useCustomInterfaceAppearance as u } from "./useCustomInterfaceAppearance.js";
2
+ import { useEditorStore as l } from "../stores/editor.js";
3
+ const g = (s) => {
4
+ const c = () => {
5
+ const t = new Headers();
6
+ t.append("Content-Type", "application/json");
7
+ const r = JSON.stringify({
8
+ pluginId: void 0,
9
+ secretKey: void 0,
10
+ role: void 0,
11
+ userId: s
12
+ });
13
+ return fetch("/v2/stripo/get-token", {
14
+ method: "POST",
15
+ headers: t,
16
+ body: r,
17
+ redirect: "follow"
18
+ }).then((o) => o.json());
19
+ }, d = (t) => {
20
+ const r = l(), n = t.html, o = t.css;
8
21
  window.UIEditor.initEditor(
9
22
  document.querySelector("#guido-editor"),
10
23
  {
11
- metadata: c,
12
- html: t,
13
- css: n,
24
+ metadata: {
25
+ emailId: s,
26
+ userId: "1",
27
+ username: "Plugin Demo User"
28
+ },
29
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
30
+ html: n,
31
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
32
+ css: o,
14
33
  locale: "en",
15
34
  undoButtonSelector: "#guido__undo-button",
16
35
  redoButtonSelector: "#guido__redo-button",
17
36
  mobileViewButtonSelector: ".guido__view-option-selection-mobile",
18
37
  desktopViewButtonSelector: ".guido__view-option-selection-desktop",
38
+ versionHistoryButtonSelector: "#guido__history-button",
19
39
  codeEditorButtonSelector: "#guido__code-button",
20
- editorFonts: {
21
- showDefaultStandardFonts: !0,
22
- showDefaultNotStandardFonts: !0,
23
- customFonts: i
24
- },
25
- async onTokenRefreshRequest(o) {
40
+ async onTokenRefreshRequest(e) {
26
41
  try {
27
- const s = await u();
28
- o(s);
29
- } catch (s) {
30
- d(s, "Failed to refresh token");
42
+ const i = await c();
43
+ e(i.token);
44
+ } catch (i) {
45
+ console.error("Failed to refresh token:", i);
31
46
  }
32
47
  },
33
48
  onTemplateLoaded() {
34
49
  try {
35
- const { importCss: o } = m();
36
- o();
37
- } catch (o) {
38
- d(o, "Failed to load custom interface appearance");
50
+ const { importCss: e } = u();
51
+ e();
52
+ } catch (e) {
53
+ console.error("Failed to load custom interface appearance:", e);
39
54
  }
40
55
  },
41
- onCodeEditorVisibilityChanged(o) {
42
- r.isCodeEditorOpen = o;
56
+ onCodeEditorVisibilityChanged(e) {
57
+ r.isCodeEditorOpen = e;
43
58
  },
44
- onEditorVisualModeChanged(o) {
45
- r.editorVisualMode = o.toLowerCase();
46
- },
47
- onVersionHistoryVisibilityChanged(o) {
48
- r.isVersionHistoryOpen = o;
59
+ onEditorVisualModeChanged(e) {
60
+ r.editorVisualMode = e.toLowerCase();
49
61
  }
50
62
  }
51
63
  );
52
- }, p = (e) => new Promise((i, r) => {
64
+ };
65
+ return { initPlugin: (t) => new Promise((r, n) => {
53
66
  if (document.getElementById("UiEditorScript")) {
54
- e(), i();
67
+ d(t), r();
55
68
  return;
56
69
  }
57
- const t = document.createElement("script");
58
- t.id = "UiEditorScript", t.type = "module", t.src = "https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js", t.onload = () => {
59
- e(), i();
60
- }, t.onerror = () => {
61
- const n = new Error("Failed to load Stripo UIEditor script");
62
- r(n);
63
- }, document.body.appendChild(t);
64
- });
65
- return { initPlugin: async (e) => {
66
- await p(async () => {
67
- const i = await a();
68
- l(e, i);
69
- });
70
- } };
70
+ const o = document.createElement("script");
71
+ o.id = "UiEditorScript", o.type = "module", o.src = "https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js", o.onload = () => {
72
+ d(t), r();
73
+ }, o.onerror = () => {
74
+ const e = new Error("Failed to load Stripo UIEditor script");
75
+ n(e);
76
+ }, document.body.appendChild(o);
77
+ }) };
71
78
  };
72
79
  export {
73
- _ as useStripo
80
+ g as useStripo
74
81
  };
@@ -17,5 +17,4 @@ export declare const useToaster: () => {
17
17
  } | undefined)[]>;
18
18
  showToaster: (options?: ToasterOptions) => void;
19
19
  hideToaster: () => void;
20
- handleError: (error: unknown, context: string) => void;
21
20
  };
@@ -1,37 +1,29 @@
1
- import { ref as o, watch as T } from "vue";
2
- const v = () => {
3
- const t = o(!1), s = o(""), c = o("success"), n = o([]);
1
+ import { ref as u, watch as f } from "vue";
2
+ const T = () => {
3
+ const t = u(!1), s = u(""), r = u("success"), o = u([]);
4
4
  let a = null;
5
- function i() {
5
+ function l() {
6
6
  a && (clearTimeout(a), a = null);
7
7
  }
8
- function u() {
9
- t.value = !1, n.value = [], s.value = "";
8
+ function c() {
9
+ t.value = !1, o.value = [], s.value = "";
10
10
  }
11
- function l(e = { message: "" }) {
12
- u(), s.value = e.message, c.value = e.type || "success", n.value = e.actionButton ? [e.actionButton] : [], t.value = !0;
11
+ function n(e = { message: "" }) {
12
+ c(), s.value = e.message, r.value = e.type || "success", o.value = e.actionButton ? [e.actionButton] : [], t.value = !0;
13
13
  }
14
- function f(e, r) {
15
- const m = e instanceof Error ? e.message : String(e);
16
- l({
17
- type: "error",
18
- message: `${r}: ${m}`
19
- });
20
- }
21
- return T([t, s], ([e, r]) => {
22
- i(), e && r && (a = setTimeout(() => {
23
- u();
14
+ return f([t, s], ([e, i]) => {
15
+ l(), e && i && (a = setTimeout(() => {
16
+ c();
24
17
  }, 6e3));
25
18
  }), {
26
19
  isToasterVisible: t,
27
20
  toasterMessage: s,
28
- toasterType: c,
29
- toasterActionButton: n,
30
- showToaster: l,
31
- hideToaster: u,
32
- handleError: f
21
+ toasterType: r,
22
+ toasterActionButton: o,
23
+ showToaster: n,
24
+ hideToaster: c
33
25
  };
34
26
  };
35
27
  export {
36
- v as useToaster
28
+ T as useToaster
37
29
  };
@@ -1,4 +1,2 @@
1
1
  import type { GuidoConfig } from '@@/Types/generic';
2
2
  export declare const DefaultGuidoConfig: GuidoConfig;
3
- export declare const DefaultProductType = "newsletter";
4
- export declare const DefaultUsername = "Guido User";
@@ -1,8 +1,6 @@
1
- const t = {
1
+ const n = {
2
2
  translationsPath: "window.trans.en"
3
- }, e = "newsletter", n = "Guido User";
3
+ };
4
4
  export {
5
- t as DefaultGuidoConfig,
6
- e as DefaultProductType,
7
- n as DefaultUsername
5
+ n as DefaultGuidoConfig
8
6
  };
package/dist/guido.css CHANGED
@@ -1 +1 @@
1
- .version-history-item[data-v-0e2ff42d]{flex-basis:200px}.version-history-wrapper[data-v-187d41fa]{gap:8px}[data-v-6a2bde67] .guido__verion-history-view-option-selection-desktop svg,[data-v-6a2bde67] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6a2bde67] .in-segments-wrapper__button_selected,[data-v-6a2bde67] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-0fff376c] .guido__view-option-selection-desktop svg,[data-v-0fff376c] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-0fff376c] .in-segments-wrapper__button_selected,[data-v-0fff376c] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.header-right-slot[data-v-78791c47]{gap:16px}.guido-editor__wrapper[data-v-f20b186e],.guido-editor__container[data-v-f20b186e]{width:100%;height:100vh}
1
+ [data-v-f67c82be] .guido__view-option-selection-desktop svg,[data-v-f67c82be] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}.header-right-slot[data-v-28200d25]{gap:16px}.guido-editor__wrapper[data-v-ef4897b1],.guido-editor__container[data-v-ef4897b1]{width:100%;height:100vh}