@useinsider/guido 1.0.0-beta.6f8286c → 1.0.0-beta.71f7f07

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 (48) hide show
  1. package/README.md +1 -6
  2. package/dist/components/Guido.vue.js +8 -8
  3. package/dist/components/Guido.vue2.js +26 -22
  4. package/dist/components/organisms/header/LeftSlot.vue.d.ts +1 -1
  5. package/dist/components/organisms/header/LeftSlot.vue.js +8 -8
  6. package/dist/components/organisms/header/LeftSlot.vue2.js +3 -5
  7. package/dist/components/organisms/header/MiddleSlot.vue.js +7 -7
  8. package/dist/components/organisms/header/MiddleSlot.vue2.js +4 -6
  9. package/dist/components/organisms/header/RightSlot.vue.d.ts +1 -1
  10. package/dist/components/organisms/header/RightSlot.vue.js +10 -7
  11. package/dist/components/organisms/header/RightSlot.vue2.js +19 -14
  12. package/dist/components/organisms/header/version-history/VersionHistory.vue.d.ts +1 -13
  13. package/dist/components/organisms/header/version-history/VersionHistory.vue.js +7 -7
  14. package/dist/components/organisms/header/version-history/VersionHistory.vue2.js +10 -13
  15. package/dist/components/organisms/save-template/SaveTemplateModal.vue.d.ts +20 -0
  16. package/dist/components/organisms/save-template/SaveTemplateModal.vue.js +21 -0
  17. package/dist/components/organisms/save-template/SaveTemplateModal.vue2.js +57 -0
  18. package/dist/composables/useCustomInterfaceAppearance.js +9 -45
  19. package/dist/composables/useStripo.js +8 -13
  20. package/dist/composables/useTemplateValidation.d.ts +13 -0
  21. package/dist/composables/useTemplateValidation.js +57 -0
  22. package/dist/guido.css +1 -1
  23. package/dist/mock/api/template-library.d.ts +2 -0
  24. package/dist/static/editor.css.js +232 -0
  25. package/dist/stores/editor.d.ts +1 -0
  26. package/dist/stores/editor.js +2 -1
  27. package/package.json +5 -5
  28. package/dist/components/organisms/header/version-history/RestoreButton.vue.d.ts +0 -2
  29. package/dist/components/organisms/header/version-history/RestoreButton.vue.js +0 -19
  30. package/dist/components/organisms/header/version-history/RestoreButton.vue2.js +0 -14
  31. package/dist/enums/displayConditions.d.ts +0 -2
  32. package/dist/enums/displayConditions.js +0 -80
  33. package/dist/static/styles/base.css.js +0 -11
  34. package/dist/static/styles/components/alert-message.css.js +0 -39
  35. package/dist/static/styles/components/amp-block.css.js +0 -18
  36. package/dist/static/styles/components/base-input.css.js +0 -47
  37. package/dist/static/styles/components/button-group.css.js +0 -54
  38. package/dist/static/styles/components/button.css.js +0 -106
  39. package/dist/static/styles/components/combobox.css.js +0 -49
  40. package/dist/static/styles/components/counter.css.js +0 -42
  41. package/dist/static/styles/components/dropdown-menu.css.js +0 -52
  42. package/dist/static/styles/components/narrow-panel.css.js +0 -38
  43. package/dist/static/styles/components/switcher.css.js +0 -11
  44. package/dist/static/styles/components/tabs.css.js +0 -97
  45. package/dist/static/styles/components/tools.css.js +0 -23
  46. package/dist/static/styles/components/version-history.css.js +0 -30
  47. package/dist/static/styles/components/wide-panel.css.js +0 -135
  48. package/dist/static/styles/variables.css.js +0 -23
package/README.md CHANGED
@@ -211,12 +211,7 @@ ISC License
211
211
  - [@useinsider/design-system-vue](https://github.com/useinsider/design-system-vue) - Insider's Vue design system
212
212
 
213
213
  ## 🎯 TODO:
214
- - CSS part should be optimized with variables & `sass-loader`.
214
+ - [editor.css](src/static/editor.css) should be optimized with variables & `sass-loader`.
215
215
  - Master Version Generator should be fixed.
216
216
  - Playwright integration
217
217
  - Commitlint & Precommit Hooks integration
218
- - We need to emit save event and we should return template config to it
219
- - Default template should be same with production
220
- - Open Guido with saved template
221
- - Get User ID, Email and Unique Template ID as dynamic from props
222
- - Get Pre-built display conditions from API
@@ -1,18 +1,18 @@
1
1
  import o from "./Guido.vue2.js";
2
2
  /* empty css */
3
- import i from "../_virtual/_plugin-vue2_normalizer.js";
3
+ import a from "../_virtual/_plugin-vue2_normalizer.js";
4
4
  var s = function() {
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(
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(
8
8
  o,
9
9
  s,
10
- _,
10
+ i,
11
11
  !1,
12
12
  null,
13
- "8e229594"
13
+ "f20b186e"
14
14
  );
15
- const f = a.exports;
15
+ const c = n.exports;
16
16
  export {
17
- f as default
17
+ c as default
18
18
  };
@@ -1,10 +1,12 @@
1
- import { defineComponent as f, onMounted as c } from "vue";
2
- import { usePartner as g } from "../composables/usePartner.js";
3
- import { useStripo as _ } from "../composables/useStripo.js";
4
- import { useTemplates as y } from "../composables/useTemplates.js";
5
- import { DefaultUsername as C, DefaultGuidoConfig as T } from "../enums/defaults.js";
6
- import w from "./organisms/header/HeaderWrapper.vue.js";
7
- const h = /* @__PURE__ */ f({
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({
8
10
  __name: "Guido",
9
11
  props: {
10
12
  emailId: null,
@@ -14,30 +16,32 @@ const h = /* @__PURE__ */ f({
14
16
  username: null,
15
17
  guidoConfig: null
16
18
  },
17
- setup(d) {
18
- const o = d, { getPartnerName: r, getProductType: t } = g(), {
19
- emailId: n,
20
- userId: i,
21
- guidoConfig: a,
22
- partnerName: u = r(),
23
- productType: p = t(),
24
- username: m = C
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
25
27
  } = o;
26
28
  window.GuidoConfig = {
27
- ...T,
28
- ...a
29
+ ...w,
30
+ ...i
29
31
  };
30
- const { initPlugin: l } = _({ emailId: n, userId: i, username: m, partnerName: u, productType: p }), { getDefaultTemplate: s } = y();
31
- return c(async () => {
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 () => {
32
36
  try {
33
37
  const e = await s();
34
- await l(e);
38
+ await u(e);
35
39
  } catch (e) {
36
40
  console.error("Failed to initialize Stripo editor:", e);
37
41
  }
38
- }), { __sfc: !0, props: o, getPartnerName: r, getProductType: t, emailId: n, userId: i, guidoConfig: a, partnerName: u, productType: p, username: m, initPlugin: l, getDefaultTemplate: s, HeaderWrapper: w };
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 };
39
43
  }
40
44
  });
41
45
  export {
42
- h as default
46
+ F as default
43
47
  };
@@ -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,17 +1,17 @@
1
1
  import r from "./LeftSlot.vue2.js";
2
2
  import o from "../../../_virtual/_plugin-vue2_normalizer.js";
3
- var n = function() {
4
- var t = this, e = t._self._c, s = t._self._setupProxy;
5
- return e("div", { staticClass: "d-f a-i-c" }, [e(s.InButtonV2, { staticClass: "p-2", attrs: { id: "guido__back-button", "label-text": "Back", "left-icon": "line-arrow-left", styling: "text", type: "secondary" } }), s.editorStore.isVersionHistoryOpen ? e(s.RestoreButton, { staticClass: "ml-3" }) : t._e()], 1);
6
- }, a = [], i = /* @__PURE__ */ o(
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
7
  r,
8
- n,
9
- a,
8
+ _,
9
+ s,
10
10
  !1,
11
11
  null,
12
12
  null
13
13
  );
14
- const f = i.exports;
14
+ const i = a.exports;
15
15
  export {
16
- f as default
16
+ i as default
17
17
  };
@@ -1,11 +1,9 @@
1
1
  import { defineComponent as t } from "vue";
2
- import { useEditorStore as o } from "../../../stores/editor.js";
3
- import { InButtonV2 as r } from "@useinsider/design-system-vue";
4
- import e from "./version-history/RestoreButton.vue.js";
2
+ import { InButtonV2 as o } from "@useinsider/design-system-vue";
5
3
  const _ = /* @__PURE__ */ t({
6
4
  __name: "LeftSlot",
7
- setup(m) {
8
- return { __sfc: !0, editorStore: o(), InButtonV2: r, RestoreButton: e };
5
+ setup(e) {
6
+ return { __sfc: !0, InButtonV2: o };
9
7
  }
10
8
  });
11
9
  export {
@@ -1,17 +1,17 @@
1
1
  import s from "./MiddleSlot.vue2.js";
2
- import i from "../../../_virtual/_plugin-vue2_normalizer.js";
3
- var n = function() {
2
+ import n from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var i = function() {
4
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(
5
+ return t.editorStore.isVersionHistoryOpen ? o(t.VersionHistory) : 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", "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") } })], 1);
6
+ }, l = [], r = /* @__PURE__ */ n(
7
7
  s,
8
- n,
8
+ i,
9
9
  l,
10
10
  !1,
11
11
  null,
12
12
  null
13
13
  );
14
- const p = r.exports;
14
+ const _ = r.exports;
15
15
  export {
16
- p as default
16
+ _ as default
17
17
  };
@@ -3,20 +3,18 @@ import { useTranslations as s } from "../../../composables/useTranslations.js";
3
3
  import { useEditorStore as n } from "../../../stores/editor.js";
4
4
  import { InButtonV2 as e } from "@useinsider/design-system-vue";
5
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({
6
+ const _ = /* @__PURE__ */ r({
9
7
  __name: "MiddleSlot",
10
- setup(a) {
8
+ setup(p) {
11
9
  const o = n(), t = s();
12
10
  return { __sfc: !0, editorStore: o, trans: t, getTooltipOptions: (i) => ({
13
11
  id: `${i}-tooltip`,
14
12
  dynamicPosition: !1,
15
13
  staticPosition: "bottom center",
16
14
  iconStatus: !1
17
- }), InButtonV2: e, VersionHistory: m, VersionHistoryViewOptions: p, ViewOptions: f };
15
+ }), InButtonV2: e, VersionHistory: m };
18
16
  }
19
17
  });
20
18
  export {
21
- y as default
19
+ _ as default
22
20
  };
@@ -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,20 @@
1
1
  import o from "./RightSlot.vue2.js";
2
+ /* empty css */
2
3
  import i from "../../../_virtual/_plugin-vue2_normalizer.js";
3
- var n = function() {
4
+ var r = 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 } }), 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
- }, r = [], a = /* @__PURE__ */ i(
6
+ return e("div", [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 }, 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 } })], 1), t.editorStore.isVersionHistoryOpen ? e(t.InButtonV2, { attrs: { id: "guido__restore-button", "label-text": "Restore" }, on: { click: function(d) {
7
+ return t.restoreVersion(t.versionHistoryStore.currentPatch.id);
8
+ } } }) : e(t.InButtonV2, { attrs: { id: "guido__save-button", "label-text": "Save" } })], 1)]);
9
+ }, n = [], a = /* @__PURE__ */ i(
7
10
  o,
8
- n,
9
11
  r,
12
+ n,
10
13
  !1,
11
14
  null,
12
- null
15
+ "0318cf78"
13
16
  );
14
- const c = a.exports;
17
+ const p = a.exports;
15
18
  export {
16
- c as default
19
+ p as default
17
20
  };
@@ -1,21 +1,26 @@
1
- import { defineComponent as s } from "vue";
2
- import { useExport as i } from "../../../composables/useExport.js";
3
- import { useVersionHistoryApi as n } from "../../../composables/useVersionHistoryApi.js";
4
- import { useEditorStore as p } from "../../../stores/editor.js";
5
- import { InButtonV2 as m } from "@useinsider/design-system-vue";
6
- const d = /* @__PURE__ */ s({
1
+ import { defineComponent as n } from "vue";
2
+ import { useExport as p } from "../../../composables/useExport.js";
3
+ import { useVersionHistoryApi as m } from "../../../composables/useVersionHistoryApi.js";
4
+ import { useEditorStore as a } from "../../../stores/editor.js";
5
+ import { useVersionHistoryStore as f } from "../../../stores/version-history.js";
6
+ import { InButtonV2 as l } from "@useinsider/design-system-vue";
7
+ import V from "./version-history/ViewOptions.vue.js";
8
+ import c from "./ViewOptions.vue.js";
9
+ const T = /* @__PURE__ */ n({
7
10
  __name: "RightSlot",
8
- setup(f) {
9
- const { exportHtml: e } = i(), { openVersionHistory: o, closeVersionHistory: r } = n(), t = p();
10
- return { __sfc: !0, exportHtml: e, openVersionHistory: o, closeVersionHistory: r, editorStore: t, handleVersionHistory: () => {
11
- if (t.isVersionHistoryOpen) {
12
- r();
11
+ setup(u) {
12
+ const { exportHtml: t } = p(), { openVersionHistory: r, closeVersionHistory: e, restoreVersion: s } = m(), o = a(), i = f();
13
+ return { __sfc: !0, exportHtml: t, openVersionHistory: r, closeVersionHistory: e, restoreVersion: s, editorStore: o, versionHistoryStore: i, handleVersionHistory: () => {
14
+ if (o.isVersionHistoryOpen) {
15
+ e();
13
16
  return;
14
17
  }
15
- o();
16
- }, InButtonV2: m };
18
+ r();
19
+ }, handleSaveAsTemplate: async () => {
20
+ o.isSaveTemplateModalOpen = !0;
21
+ }, InButtonV2: l, VersionHistoryViewOptions: V, ViewOptions: c };
17
22
  }
18
23
  });
19
24
  export {
20
- d as default
25
+ T as default
21
26
  };
@@ -1,14 +1,2 @@
1
- type __VLS_Props = {
2
- itemStatus?: boolean;
3
- };
4
- declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
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<{}>>, {}>;
5
2
  export default _default;
6
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
7
- type __VLS_TypePropsToOption<T> = {
8
- [K in keyof T]-?: {} extends Pick<T, K> ? {
9
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
10
- } : {
11
- type: import('vue').PropType<T[K]>;
12
- required: true;
13
- };
14
- };
@@ -2,21 +2,21 @@ import o from "./VersionHistory.vue2.js";
2
2
  /* empty css */
3
3
  import i from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
4
  var n = function() {
5
- var s = this, e = s._self._c, t = s._self._setupProxy;
6
- return e("div", { staticClass: "version-history-wrapper d-f a-i-c f-g-1 mx-3" }, [t.itemStatus ? e(t.VersionHistoryItem, { attrs: { "text-align": "right", date: t.versionHistoryStore.previousPatch.date, description: t.versionHistoryStore.previousPatch.description } }) : s._e(), 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(r) {
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) {
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(r) {
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) {
9
9
  return t.previewVersion(t.versionHistoryStore.nextPatch.id);
10
- } } })], 1), t.itemStatus ? e(t.VersionHistoryItem, { attrs: { "text-align": "left", date: t.versionHistoryStore.nextPatch.date, description: t.versionHistoryStore.nextPatch.description } }) : s._e()], 1);
10
+ } } })], 1), e(t.VersionHistoryItem, { attrs: { "text-align": "left", date: t.versionHistoryStore.nextPatch.date, description: t.versionHistoryStore.nextPatch.description } })], 1);
11
11
  }, a = [], c = /* @__PURE__ */ i(
12
12
  o,
13
13
  n,
14
14
  a,
15
15
  !1,
16
16
  null,
17
- "52a77eec"
17
+ "187d41fa"
18
18
  );
19
- const _ = c.exports;
19
+ const p = c.exports;
20
20
  export {
21
- _ as default
21
+ p as default
22
22
  };
@@ -1,18 +1,15 @@
1
- import { defineComponent as i } from "vue";
2
- import { useVersionHistoryApi as n } from "../../../../composables/useVersionHistoryApi.js";
3
- import { useVersionHistoryStore as m } from "../../../../stores/version-history.js";
4
- import { InButtonV2 as p } from "@useinsider/design-system-vue";
5
- import f from "./VersionHistoryItem.vue.js";
6
- const _ = /* @__PURE__ */ i({
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({
7
7
  __name: "VersionHistory",
8
- props: {
9
- itemStatus: { type: Boolean }
10
- },
11
- setup(t) {
12
- const o = t, r = m(), { previewVersion: e } = n(), { itemStatus: s = !1 } = o;
13
- return { __sfc: !0, versionHistoryStore: r, previewVersion: e, props: o, itemStatus: s, InButtonV2: p, VersionHistoryItem: f };
8
+ setup(m) {
9
+ const o = s(), { previewVersion: r } = e();
10
+ return { __sfc: !0, versionHistoryStore: o, previewVersion: r, InButtonV2: i, VersionHistoryItem: n };
14
11
  }
15
12
  });
16
13
  export {
17
- _ as default
14
+ c as default
18
15
  };
@@ -0,0 +1,20 @@
1
+ interface TemplateModalProps {
2
+ isOpen: boolean;
3
+ }
4
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<TemplateModalProps>, {}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {
5
+ close: () => void;
6
+ save: (data: {
7
+ templateName: string;
8
+ htmlData: string;
9
+ }) => void;
10
+ }, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<TemplateModalProps>>>, {}>;
11
+ export default _default;
12
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
13
+ type __VLS_TypePropsToOption<T> = {
14
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
15
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
16
+ } : {
17
+ type: import('vue').PropType<T[K]>;
18
+ required: true;
19
+ };
20
+ };
@@ -0,0 +1,21 @@
1
+ import r from "./SaveTemplateModal.vue2.js";
2
+ import o from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var s = function() {
4
+ var t = this, n = t._self._c, e = t._self._setupProxy;
5
+ return n(e.InDrawer, { attrs: { id: "save-template-modal", size: "medium", "description-text": e.trans("newsletter.save-template-description"), "footer-button-group-options": e.drawerFooterOptions, status: e.props.isOpen, "title-text": e.trans("products.save-template") }, on: { cancelOrBackButtonEvent: e.closeModal, onCloseEvent: e.closeModal, primaryButtonEvent: e.saveTemplate }, scopedSlots: t._u([{ key: "contentSlot", fn: function() {
6
+ return [n(e.InTextInput, { staticClass: "mb-5 w-1", attrs: { id: "template-name-input", "with-label": "", name: "templateName", disabled: e.isSaving, invalid: !!e.validationError, "invalid-message": e.validationError, label: e.trans("products.template-name"), placeholder: e.trans("newsletter.enter-template-name") }, model: { value: e.templateNameInput, callback: function(a) {
7
+ e.templateNameInput = typeof a == "string" ? a.trim() : a;
8
+ }, expression: "templateNameInput" } })];
9
+ }, proxy: !0 }]) });
10
+ }, l = [], p = /* @__PURE__ */ o(
11
+ r,
12
+ s,
13
+ l,
14
+ !1,
15
+ null,
16
+ null
17
+ );
18
+ const u = p.exports;
19
+ export {
20
+ u as default
21
+ };
@@ -0,0 +1,57 @@
1
+ import { defineComponent as T, ref as m, computed as g, watch as v } from "vue";
2
+ import { useTemplateValidation as _ } from "../../../composables/useTemplateValidation.js";
3
+ import { useToaster as w } from "../../../composables/useToaster.js";
4
+ import { useTranslations as h } from "../../../composables/useTranslations.js";
5
+ import { InTextInput as x, InDrawer as B } from "@useinsider/design-system-vue";
6
+ const M = /* @__PURE__ */ T({
7
+ __name: "SaveTemplateModal",
8
+ props: {
9
+ isOpen: { type: Boolean }
10
+ },
11
+ emits: ["close", "save"],
12
+ setup(d, { emit: n }) {
13
+ const i = d, s = h(), { handleError: p } = w(), a = m(""), t = m(!1), {
14
+ validationError: l,
15
+ isValidating: c,
16
+ validateTemplateName: o,
17
+ clearValidation: r
18
+ } = _(), f = g(() => ({
19
+ primaryButton: {
20
+ styling: "solid",
21
+ type: "primary",
22
+ labelText: s(t.value ? "newsletter.saving" : "products.save"),
23
+ disabled: t.value || c.value || !l.value
24
+ },
25
+ cancelOrBackButton: {
26
+ type: "secondary",
27
+ styling: "ghost",
28
+ labelText: s("products.cancel")
29
+ }
30
+ })), u = () => {
31
+ a.value = "", r(), n("close");
32
+ }, y = async () => {
33
+ if (!l.value) {
34
+ await o(a.value);
35
+ return;
36
+ }
37
+ t.value = !0;
38
+ try {
39
+ if (!(await o(a.value)).isValid)
40
+ return;
41
+ u();
42
+ } catch (e) {
43
+ p(e, "Error saving template:");
44
+ } finally {
45
+ t.value = !1;
46
+ }
47
+ };
48
+ return v(a, (e) => {
49
+ e.trim() ? o(e) : r();
50
+ }), v(() => i.isOpen, (e) => {
51
+ e || (a.value = "", r());
52
+ }), { __sfc: !0, props: i, emit: n, trans: s, handleError: p, templateNameInput: a, isSaving: t, validationError: l, isValidating: c, validateTemplateName: o, clearValidation: r, drawerFooterOptions: f, closeModal: u, saveTemplate: y, InDrawer: B, InTextInput: x };
53
+ }
54
+ });
55
+ export {
56
+ M as default
57
+ };
@@ -1,49 +1,13 @@
1
- import S from "../static/styles/base.css.js";
2
- import e from "../static/styles/components/alert-message.css.js";
3
- import m from "../static/styles/components/amp-block.css.js";
4
- import i from "../static/styles/components/base-input.css.js";
5
- import p from "../static/styles/components/button-group.css.js";
6
- import n from "../static/styles/components/button.css.js";
7
- import s from "../static/styles/components/combobox.css.js";
8
- import C from "../static/styles/components/counter.css.js";
9
- import f from "../static/styles/components/dropdown-menu.css.js";
10
- import a from "../static/styles/components/narrow-panel.css.js";
11
- import u from "../static/styles/components/switcher.css.js";
12
- import c from "../static/styles/components/tabs.css.js";
13
- import d from "../static/styles/components/tools.css.js";
14
- import l from "../static/styles/components/version-history.css.js";
15
- import h from "../static/styles/components/wide-panel.css.js";
16
- import w from "../static/styles/variables.css.js";
17
- const y = [
18
- w,
19
- // Must be on top
20
- S,
21
- // Must be on top
22
- e,
23
- m,
24
- i,
25
- p,
26
- n,
27
- s,
28
- C,
29
- f,
30
- a,
31
- u,
32
- c,
33
- d,
34
- l,
35
- h
36
- ].join(`
37
-
38
- `), N = () => ({ importCss: () => {
39
- const o = new CSSStyleSheet();
40
- o.replaceSync(y);
41
- const r = document.querySelector("ui-editor");
42
- if (!r)
1
+ import r from "../static/editor.css.js";
2
+ const c = () => ({ importCss: () => {
3
+ const e = new CSSStyleSheet();
4
+ e.replaceSync(r);
5
+ const t = document.querySelector("ui-editor");
6
+ if (!t)
43
7
  return;
44
- const t = r.shadowRoot;
45
- t && (t.adoptedStyleSheets = [o]);
8
+ const o = t.shadowRoot;
9
+ o && (o.adoptedStyleSheets = [e]);
46
10
  } });
47
11
  export {
48
- N as useCustomInterfaceAppearance
12
+ c as useCustomInterfaceAppearance
49
13
  };
@@ -1,11 +1,10 @@
1
1
  import { useCustomInterfaceAppearance as m } from "./useCustomInterfaceAppearance.js";
2
2
  import { useToaster as g } from "./useToaster.js";
3
- import { displayConditions as E } from "../enums/displayConditions.js";
4
- import { useStripoApi as S } from "../services/stripoApi.js";
5
- import { useEditorStore as w } from "../stores/editor.js";
6
- const F = (c) => {
7
- const { handleError: d } = g(), { getToken: a, getCustomFonts: u } = S(), l = (e, i = []) => {
8
- const r = w(), { html: t, css: n } = e;
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;
9
8
  window.UIEditor.initEditor(
10
9
  document.querySelector("#guido-editor"),
11
10
  {
@@ -18,10 +17,6 @@ const F = (c) => {
18
17
  mobileViewButtonSelector: ".guido__view-option-selection-mobile",
19
18
  desktopViewButtonSelector: ".guido__view-option-selection-desktop",
20
19
  codeEditorButtonSelector: "#guido__code-button",
21
- conditionsEnabled: !0,
22
- customConditionsEnabled: !0,
23
- conditionCategories: E,
24
- messageSettingsEnabled: !1,
25
20
  editorFonts: {
26
21
  showDefaultStandardFonts: !0,
27
22
  showDefaultNotStandardFonts: !0,
@@ -29,7 +24,7 @@ const F = (c) => {
29
24
  },
30
25
  async onTokenRefreshRequest(o) {
31
26
  try {
32
- const s = await a();
27
+ const s = await u();
33
28
  o(s);
34
29
  } catch (s) {
35
30
  d(s, "Failed to refresh token");
@@ -69,11 +64,11 @@ const F = (c) => {
69
64
  });
70
65
  return { initPlugin: async (e) => {
71
66
  await p(async () => {
72
- const i = await u();
67
+ const i = await a();
73
68
  l(e, i);
74
69
  });
75
70
  } };
76
71
  };
77
72
  export {
78
- F as useStripo
73
+ _ as useStripo
79
74
  };
@@ -0,0 +1,13 @@
1
+ export interface ValidationResult {
2
+ isValid: boolean;
3
+ message: string;
4
+ }
5
+ export declare const useTemplateValidation: () => {
6
+ validationError: import("vue").ComputedRef<string>;
7
+ isValidating: import("vue").ComputedRef<boolean>;
8
+ validateTemplateName: (name: string) => Promise<ValidationResult>;
9
+ clearValidation: () => void;
10
+ VALIDATION_RULES: {
11
+ readonly DEBOUNCE_TIME: 500;
12
+ };
13
+ };