@useinsider/guido 1.0.0-beta.080866c → 1.0.0-beta.0c35e01

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 (57) hide show
  1. package/README.md +18 -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/RightSlot.vue.d.ts +1 -1
  6. package/dist/components/organisms/header/RightSlot.vue.js +5 -4
  7. package/dist/components/organisms/header/RightSlot.vue2.js +14 -14
  8. package/dist/components/organisms/header/ViewOptions.vue.js +18 -0
  9. package/dist/components/organisms/header/ViewOptions.vue2.js +15 -0
  10. package/dist/components/organisms/header/version-history/VersionHistory.vue.d.ts +1 -1
  11. package/dist/components/organisms/header/version-history/VersionHistory.vue.js +9 -9
  12. package/dist/components/organisms/header/version-history/VersionHistory.vue2.js +9 -10
  13. package/dist/components/organisms/header/version-history/ViewOptions.vue.js +18 -0
  14. package/dist/components/organisms/header/version-history/ViewOptions.vue2.js +23 -0
  15. package/dist/composables/useStripo.d.ts +2 -2
  16. package/dist/composables/useStripo.js +56 -47
  17. package/dist/composables/useToaster.d.ts +0 -1
  18. package/dist/composables/useToaster.js +16 -24
  19. package/dist/composables/useVersionHistoryApi.d.ts +0 -1
  20. package/dist/composables/useVersionHistoryApi.js +13 -31
  21. package/dist/enums/defaults.d.ts +0 -2
  22. package/dist/enums/defaults.js +3 -5
  23. package/dist/guido.css +1 -1
  24. package/dist/node_modules/pinia/dist/pinia.js +317 -0
  25. package/dist/node_modules/pinia/node_modules/vue-demi/lib/index.js +11 -0
  26. package/dist/static/editor.css.js +22 -72
  27. package/dist/stores/editor.d.ts +0 -1
  28. package/dist/stores/editor.js +2 -3
  29. package/dist/stores/version-history.d.ts +24 -80
  30. package/dist/stores/version-history.js +26 -24
  31. package/package.json +1 -1
  32. package/dist/components/organisms/base/ModalWrapper.vue.d.ts +0 -72
  33. package/dist/components/organisms/base/ModalWrapper.vue.js +0 -19
  34. package/dist/components/organisms/base/ModalWrapper.vue2.js +0 -43
  35. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue.d.ts +0 -16
  36. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue.js +0 -18
  37. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue2.js +0 -16
  38. package/dist/components/organisms/save-template/SaveTemplateModal.vue.d.ts +0 -16
  39. package/dist/components/organisms/save-template/SaveTemplateModal.vue.js +0 -22
  40. package/dist/components/organisms/save-template/SaveTemplateModal.vue2.js +0 -86
  41. package/dist/composables/useHttp.js +0 -84
  42. package/dist/composables/usePartner.d.ts +0 -4
  43. package/dist/composables/usePartner.js +0 -16
  44. package/dist/composables/useSaveAsTemplate.d.ts +0 -17
  45. package/dist/composables/useSaveAsTemplate.js +0 -44
  46. package/dist/composables/useTemplateCategories.d.ts +0 -35
  47. package/dist/composables/useTemplateCategories.js +0 -78
  48. package/dist/composables/useTemplateNameValidation.d.ts +0 -13
  49. package/dist/composables/useTemplateNameValidation.js +0 -57
  50. package/dist/mock/api/custom-fonts.d.ts +0 -2
  51. package/dist/mock/api/template-library.d.ts +0 -2
  52. package/dist/services/stripoApi.d.ts +0 -7
  53. package/dist/services/stripoApi.js +0 -29
  54. package/dist/utils/base64.d.ts +0 -1
  55. package/dist/utils/base64.js +0 -14
  56. package/dist/utils/dateUtil.d.ts +0 -1
  57. package/dist/utils/dateUtil.js +0 -16
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,24 @@ 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
+ │ └── header/ # Header components
145
+ │ └── version-history/ # Version History components
146
+ ...
147
+ ├── composables/
148
+ │ ├── useStripo.ts # Stripo integration
149
+ │ └── useTranslations.ts # Translation management
150
+ ├── @types/
151
+ │ ├── generic.ts # Generic types
152
+ │ ├── stripo.d.ts # Stripo-specific types
153
+ │ └── events.ts # Event types
154
+ ├── static/
155
+ │ ├── editor.css # Custom editor styles
156
+ │ └── templates/
157
+ │ └── default/ # Default email template
158
+ └── library.ts # Main export for library
158
159
  ```
159
160
 
160
161
  ## 🌐 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.HeaderWrapper), 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
+ "3da1d904"
14
14
  );
15
- const c = n.exports;
15
+ const f = a.exports;
16
16
  export {
17
- c as default
17
+ f 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 p } from "../composables/useStripo.js";
3
+ import { useTemplates as m } from "../composables/useTemplates.js";
4
+ import { DefaultGuidoConfig as u } from "../enums/defaults.js";
5
+ import l from "./organisms/header/HeaderWrapper.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: e } = p(o.emailId), { getDefaultTemplate: i } = m();
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 i();
22
+ await e(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: e, getDefaultTemplate: i, HeaderWrapper: l };
43
27
  }
44
28
  });
45
29
  export {
46
- F as default
30
+ _ as default
47
31
  };
@@ -1,2 +1,2 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
2
  export default _default;
@@ -1,17 +1,18 @@
1
1
  import o from "./RightSlot.vue2.js";
2
+ /* empty css */
2
3
  import i from "../../../_virtual/_plugin-vue2_normalizer.js";
3
4
  var n = function() {
4
5
  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 } })], 1);
6
+ return e("div", { staticClass: "d-f header-right-slot" }, [e("div", { staticClass: "d-f" }, [t.editorStore.isVersionHistoryOpen ? e(t.VersionHistoryViewOptions) : e(t.ViewOptions)], 1), 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 } }), 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 } })], 1), e(t.InButtonV2, { attrs: { id: "guido__save-button", "label-text": "Save" } })], 1);
6
7
  }, r = [], a = /* @__PURE__ */ i(
7
8
  o,
8
9
  n,
9
10
  r,
10
11
  !1,
11
12
  null,
12
- null
13
+ "66b167a9"
13
14
  );
14
- const c = a.exports;
15
+ const _ = a.exports;
15
16
  export {
16
- c as default
17
+ _ as default
17
18
  };
@@ -1,23 +1,23 @@
1
- import { defineComponent as s } from "vue";
2
- import { useExport as n } from "../../../composables/useExport.js";
3
- import { useVersionHistoryApi as i } from "../../../composables/useVersionHistoryApi.js";
1
+ import { defineComponent as e } from "vue";
2
+ import { useExport as s } from "../../../composables/useExport.js";
3
+ import { useVersionHistoryApi as n } from "../../../composables/useVersionHistoryApi.js";
4
4
  import { useEditorStore as p } from "../../../stores/editor.js";
5
5
  import { InButtonV2 as m } from "@useinsider/design-system-vue";
6
- const H = /* @__PURE__ */ s({
6
+ import f from "./version-history/ViewOptions.vue.js";
7
+ import V from "./ViewOptions.vue.js";
8
+ const x = /* @__PURE__ */ e({
7
9
  __name: "RightSlot",
8
- setup(a) {
9
- const { exportHtml: r } = n(), { openVersionHistory: e, closeVersionHistory: t } = i(), o = p();
10
- return { __sfc: !0, exportHtml: r, openVersionHistory: e, closeVersionHistory: t, editorStore: o, handleVersionHistory: () => {
11
- if (o.isVersionHistoryOpen) {
12
- t();
10
+ setup(u) {
11
+ const { exportHtml: i } = s(), { openVersionHistory: o, closeVersionHistory: r } = n(), t = p();
12
+ return { __sfc: !0, exportHtml: i, openVersionHistory: o, closeVersionHistory: r, editorStore: t, handleVersionHistory: () => {
13
+ if (t.isVersionHistoryOpen) {
14
+ r();
13
15
  return;
14
16
  }
15
- e();
16
- }, handleSaveAsTemplate: async () => {
17
- o.isSaveTemplateModalOpen = !0;
18
- }, InButtonV2: m };
17
+ o();
18
+ }, InButtonV2: m, VersionHistoryViewOptions: f, ViewOptions: V };
19
19
  }
20
20
  });
21
21
  export {
22
- H as default
22
+ x as default
23
23
  };
@@ -0,0 +1,18 @@
1
+ import r from "./ViewOptions.vue2.js";
2
+ /* empty css */
3
+ import s from "../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var n = function() {
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(
8
+ r,
9
+ n,
10
+ i,
11
+ !1,
12
+ null,
13
+ "378010db"
14
+ );
15
+ const l = _.exports;
16
+ export {
17
+ l as default
18
+ };
@@ -0,0 +1,15 @@
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({
5
+ __name: "ViewOptions",
6
+ setup(n) {
7
+ return { __sfc: !0, editorStore: t(), segmentList: [
8
+ { text: "", icon: "line-desktop", value: "desktop" },
9
+ { text: "", icon: "line-menu-mobileapp", value: "mobile" }
10
+ ], InSegments: o };
11
+ }
12
+ });
13
+ export {
14
+ u as default
15
+ };
@@ -1,2 +1,2 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
2
  export default _default;
@@ -1,22 +1,22 @@
1
1
  import o from "./VersionHistory.vue2.js";
2
2
  /* empty css */
3
- import i from "../../../../_virtual/_plugin-vue2_normalizer.js";
3
+ import r from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
4
  var n = function() {
5
- var r = this, e = r._self._c, t = r._self._setupProxy;
6
- return e("div", { staticClass: "version-history-wrapper d-f a-i-c f-g-1 mx-2" }, [e(t.VersionHistoryItem, { attrs: { "text-align": "right", date: t.versionHistoryStore.previousPatch.date, description: t.versionHistoryStore.previousPatch.description } }), e("div", { staticClass: "d-f" }, [e(t.InButtonV2, { attrs: { id: "guido__undo-button", "left-icon": "line-undo", styling: "ghost", type: "secondary", "disabled-status": !t.versionHistoryStore.hasPreviousPatch, "label-text-status": !1 }, on: { click: function(s) {
5
+ var e = this, s = e._self._c, t = e._self._setupProxy;
6
+ return s("div", { staticClass: "version-history-wrapper d-f f-g-1 mx-2" }, [s("div", { staticClass: "version-history-item f-g-1" }, [t.hasPreviousPatch ? s("div", { staticClass: "d-f f-d-c t-a-r" }, [s("div", { staticClass: "t-o-e o-h w-s-n-w", domProps: { innerHTML: e._s(t.versionHistoryStore.previousPatch.description) } }), s("div", [e._v(e._s(t.versionHistoryStore.previousPatch.date))])]) : e._e()]), s("div", { staticClass: "d-f" }, [s(t.InButtonV2, { attrs: { id: "guido__undo-button", "left-icon": "line-undo", styling: "ghost", type: "secondary", "disabled-status": !t.hasPreviousPatch, "label-text-status": !1 }, on: { click: function(i) {
7
7
  return t.previewVersion(t.versionHistoryStore.previousPatch.id);
8
- } } }), e(t.InButtonV2, { attrs: { id: "guido__redo-button", "left-icon": "line-redo", styling: "ghost", type: "secondary", "disabled-status": !t.versionHistoryStore.hasNextPatch, "label-text-status": !1 }, on: { click: function(s) {
8
+ } } }), s(t.InButtonV2, { attrs: { id: "guido__redo-button", "left-icon": "line-redo", styling: "ghost", type: "secondary", "disabled-status": !t.hasNextPatch, "label-text-status": !1 }, on: { click: function(i) {
9
9
  return t.previewVersion(t.versionHistoryStore.nextPatch.id);
10
- } } })], 1), e(t.VersionHistoryItem, { attrs: { "text-align": "left", date: t.versionHistoryStore.nextPatch.date, description: t.versionHistoryStore.nextPatch.description } })], 1);
11
- }, a = [], c = /* @__PURE__ */ i(
10
+ } } })], 1), s("div", { staticClass: "version-history-item f-g-1" }, [t.hasNextPatch ? s("div", { staticClass: "d-f f-d-c" }, [s("div", { staticClass: "t-o-e o-h w-s-n-w", domProps: { innerHTML: e._s(t.versionHistoryStore.nextPatch.description) } }), s("div", [e._v(e._s(t.versionHistoryStore.nextPatch.date))])]) : e._e()])]);
11
+ }, a = [], d = /* @__PURE__ */ r(
12
12
  o,
13
13
  n,
14
14
  a,
15
15
  !1,
16
16
  null,
17
- "187d41fa"
17
+ "843533fe"
18
18
  );
19
- const p = c.exports;
19
+ const u = d.exports;
20
20
  export {
21
- p as default
21
+ u as default
22
22
  };
@@ -1,15 +1,14 @@
1
- import { defineComponent as t } from "vue";
2
- import { useVersionHistoryApi as e } from "../../../../composables/useVersionHistoryApi.js";
3
- import { useVersionHistoryStore as s } from "../../../../stores/version-history.js";
4
- import { InButtonV2 as i } from "@useinsider/design-system-vue";
5
- import n from "./VersionHistoryItem.vue.js";
6
- const c = /* @__PURE__ */ t({
1
+ import { defineComponent as i, computed as t } from "vue";
2
+ import { useVersionHistoryApi as n } from "../../../../composables/useVersionHistoryApi.js";
3
+ import { useVersionHistoryStore as p } from "../../../../stores/version-history.js";
4
+ import { InButtonV2 as a } from "@useinsider/design-system-vue";
5
+ const h = /* @__PURE__ */ i({
7
6
  __name: "VersionHistory",
8
- setup(m) {
9
- const o = s(), { previewVersion: r } = e();
10
- return { __sfc: !0, versionHistoryStore: o, previewVersion: r, InButtonV2: i, VersionHistoryItem: n };
7
+ setup(c) {
8
+ const o = p(), { previewVersion: e } = n(), r = t(() => !!o.previousPatch.id), s = t(() => !!o.nextPatch.id);
9
+ return { __sfc: !0, versionHistoryStore: o, previewVersion: e, hasPreviousPatch: r, hasNextPatch: s, InButtonV2: a };
11
10
  }
12
11
  });
13
12
  export {
14
- c as default
13
+ h as default
15
14
  };
@@ -0,0 +1,18 @@
1
+ import s from "./ViewOptions.vue2.js";
2
+ /* empty css */
3
+ import i from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var r = function() {
5
+ var t = this, o = t._self._c, e = t._self._setupProxy;
6
+ return o(e.InSegments, { attrs: { id: "guido__verion-history-view-option-selection", "with-icon": "", "segment-list": e.segmentList, selected: e.versionHistoryStore.editorVisualMode }, on: { click: e.changeVisualMode } });
7
+ }, n = [], _ = /* @__PURE__ */ i(
8
+ s,
9
+ r,
10
+ n,
11
+ !1,
12
+ null,
13
+ "f23cc933"
14
+ );
15
+ const f = _.exports;
16
+ export {
17
+ f as default
18
+ };
@@ -0,0 +1,23 @@
1
+ import { defineComponent as s } from "vue";
2
+ import { useVersionHistoryApi as n } from "../../../../composables/useVersionHistoryApi.js";
3
+ import { useVersionHistoryStore as r } from "../../../../stores/version-history.js";
4
+ import { InSegments as m } from "@useinsider/design-system-vue";
5
+ const d = /* @__PURE__ */ s({
6
+ __name: "ViewOptions",
7
+ setup(p) {
8
+ const e = r(), { switchToDesktopPreview: o, switchToMobilePreview: t } = n();
9
+ return { __sfc: !0, versionHistoryStore: e, switchToDesktopPreview: o, switchToMobilePreview: t, segmentList: [
10
+ { text: "", icon: "line-desktop", value: "desktop" },
11
+ { text: "", icon: "line-menu-mobileapp", value: "mobile" }
12
+ ], changeVisualMode: (i) => {
13
+ if (e.editorVisualMode = i, i === "mobile") {
14
+ t();
15
+ return;
16
+ }
17
+ o();
18
+ }, InSegments: m };
19
+ }
20
+ });
21
+ export {
22
+ d as default
23
+ };
@@ -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,83 @@
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 a } 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-user-token", {
14
+ method: "POST",
15
+ headers: t,
16
+ body: r,
17
+ redirect: "follow"
18
+ }).then((o) => o.json());
19
+ }, d = (t) => {
20
+ const r = a(), i = 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: i,
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",
19
38
  codeEditorButtonSelector: "#guido__code-button",
20
- editorFonts: {
21
- showDefaultStandardFonts: !0,
22
- showDefaultNotStandardFonts: !0,
23
- customFonts: i
24
- },
25
- async onTokenRefreshRequest(o) {
39
+ async onTokenRefreshRequest(e) {
26
40
  try {
27
- const s = await u();
28
- o(s);
29
- } catch (s) {
30
- d(s, "Failed to refresh token");
41
+ const n = await c();
42
+ e(n.token);
43
+ } catch (n) {
44
+ console.error("Failed to refresh token:", n);
31
45
  }
32
46
  },
33
47
  onTemplateLoaded() {
34
48
  try {
35
- const { importCss: o } = m();
36
- o();
37
- } catch (o) {
38
- d(o, "Failed to load custom interface appearance");
49
+ const { importCss: e } = u();
50
+ e();
51
+ } catch (e) {
52
+ console.error("Failed to load custom interface appearance:", e);
39
53
  }
40
54
  },
41
- onCodeEditorVisibilityChanged(o) {
42
- r.isCodeEditorOpen = o;
55
+ onCodeEditorVisibilityChanged(e) {
56
+ r.isCodeEditorOpen = e;
43
57
  },
44
- onEditorVisualModeChanged(o) {
45
- r.editorVisualMode = o.toLowerCase();
58
+ onEditorVisualModeChanged(e) {
59
+ r.editorVisualMode = e.toLowerCase();
46
60
  },
47
- onVersionHistoryVisibilityChanged(o) {
48
- r.isVersionHistoryOpen = o;
61
+ onVersionHistoryVisibilityChanged(e) {
62
+ r.isVersionHistoryOpen = e;
49
63
  }
50
64
  }
51
65
  );
52
- }, p = (e) => new Promise((i, r) => {
66
+ };
67
+ return { initPlugin: (t) => new Promise((r, i) => {
53
68
  if (document.getElementById("UiEditorScript")) {
54
- e(), i();
69
+ d(t), r();
55
70
  return;
56
71
  }
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
- } };
72
+ const o = document.createElement("script");
73
+ o.id = "UiEditorScript", o.type = "module", o.src = "https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js", o.onload = () => {
74
+ d(t), r();
75
+ }, o.onerror = () => {
76
+ const e = new Error("Failed to load Stripo UIEditor script");
77
+ i(e);
78
+ }, document.body.appendChild(o);
79
+ }) };
71
80
  };
72
81
  export {
73
- _ as useStripo
82
+ g as useStripo
74
83
  };
@@ -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
  };
@@ -4,5 +4,4 @@ export declare const useVersionHistoryApi: () => {
4
4
  switchToDesktopPreview: () => void;
5
5
  switchToMobilePreview: () => void;
6
6
  previewVersion: (id: string) => void;
7
- restoreVersion: (id: string) => void;
8
7
  };