@useinsider/guido 1.0.0-beta.491c3c2 → 1.0.0-beta.4f67368

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 (98) hide show
  1. package/dist/@types/generic.d.ts +0 -6
  2. package/dist/components/Guido.vue.d.ts +6 -5
  3. package/dist/components/Guido.vue.js +4 -4
  4. package/dist/components/Guido.vue2.js +54 -58
  5. package/dist/components/organisms/base/Toaster.vue.js +17 -0
  6. package/dist/components/organisms/base/Toaster.vue2.js +12 -0
  7. package/dist/components/organisms/header/RightSlot.vue.js +5 -5
  8. package/dist/components/organisms/header/RightSlot.vue2.js +28 -26
  9. package/dist/components/wrappers/WpModal.vue.d.ts +2 -2
  10. package/dist/composables/useActionsApi.d.ts +1 -2
  11. package/dist/composables/useActionsApi.js +36 -51
  12. package/dist/composables/useExport.js +6 -6
  13. package/dist/composables/useGuidoActions.d.ts +2 -2
  14. package/dist/composables/useHttp.js +21 -23
  15. package/dist/composables/usePartner.d.ts +1 -1
  16. package/dist/composables/usePartner.js +14 -9
  17. package/dist/composables/useStripo.js +12 -16
  18. package/dist/composables/useToaster.d.ts +1 -16
  19. package/dist/composables/useToaster.js +23 -30
  20. package/dist/composables/useVersionHistoryApi.js +4 -4
  21. package/dist/enums/defaults.d.ts +1 -4
  22. package/dist/enums/defaults.js +2 -8
  23. package/dist/guido.css +1 -1
  24. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/Extension.js +2 -2
  25. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ExtensionBuilder.js +2 -2
  26. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/Block.js +2 -2
  27. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlockRenderer.js +2 -2
  28. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlocksPanel.js +2 -2
  29. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/ContextAction.js +2 -2
  30. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js +2 -2
  31. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js +2 -2
  32. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js +2 -2
  33. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js +2 -2
  34. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js +2 -2
  35. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js +2 -2
  36. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js +2 -2
  37. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js +2 -2
  38. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js +2 -2
  39. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js +2 -2
  40. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundColorBuiltInControl.js +4 -4
  41. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundImageBuiltInControl.js +4 -4
  42. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BlockPaddingsBuiltInControl.js +4 -4
  43. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BuiltInControl.js +2 -2
  44. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonBorderBuiltInControl.js +4 -4
  45. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonColorBuiltInControl.js +4 -4
  46. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonFontColorBuiltInControl.js +4 -4
  47. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonInternalIndentsBuiltInControl.js +4 -4
  48. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonTextBuiltInControl.js +4 -4
  49. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/Control.js +2 -2
  50. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/FontFamilyBuiltInControl.js +4 -4
  51. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/LinkColorBuiltInControl.js +4 -4
  52. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelRegistry.js +2 -2
  53. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelTab.js +2 -2
  54. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructureBorderBuiltInControl.js +4 -4
  55. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructurePaddingsBuiltInControl.js +4 -4
  56. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextColorBuiltInControl.js +4 -4
  57. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextLineSpacingBuiltInControl.js +4 -4
  58. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextSizeBuiltInControl.js +4 -4
  59. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextStyleBuiltInControl.js +4 -4
  60. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/index.js +2 -2
  61. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/modifications/ModificationDescription.js +2 -2
  62. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElement.js +2 -2
  63. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElementTagRegistry.js +2 -2
  64. package/dist/node_modules/lodash-es/_baseCreate.js +2 -2
  65. package/dist/node_modules/lodash-es/_defineProperty.js +2 -2
  66. package/dist/node_modules/lodash-es/_isMasked.js +2 -2
  67. package/dist/node_modules/lodash-es/_nodeUtil.js +2 -2
  68. package/dist/node_modules/lodash-es/isArguments.js +2 -2
  69. package/dist/stores/editor.d.ts +0 -2
  70. package/dist/stores/editor.js +3 -5
  71. package/dist/stores/toaster.d.ts +17 -0
  72. package/dist/stores/toaster.js +25 -0
  73. package/dist/utils/genericUtil.d.ts +0 -1
  74. package/dist/utils/genericUtil.js +3 -7
  75. package/package.json +3 -3
  76. package/dist/@types/save-as-template.d.ts +0 -29
  77. package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue.js +0 -20
  78. package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +0 -63
  79. package/dist/components/wrappers/WpDrawer.vue.d.ts +0 -63
  80. package/dist/components/wrappers/WpDrawer.vue.js +0 -25
  81. package/dist/components/wrappers/WpDrawer.vue2.js +0 -23
  82. package/dist/composables/useValidation.d.ts +0 -56
  83. package/dist/composables/useValidation.js +0 -19
  84. package/dist/composables/validators/saveAsTemplate.d.ts +0 -31
  85. package/dist/composables/validators/saveAsTemplate.js +0 -24
  86. package/dist/mock/api/template-library.d.ts +0 -2
  87. package/dist/node_modules/@vueuse/shared/index.js +0 -45
  88. package/dist/node_modules/valibot/dist/index.js +0 -190
  89. package/dist/node_modules/vue-demi/lib/index.js +0 -7
  90. package/dist/services/templateLibraryApi.d.ts +0 -7
  91. package/dist/services/templateLibraryApi.js +0 -87
  92. package/dist/stores/save-as-template.d.ts +0 -73
  93. package/dist/stores/save-as-template.js +0 -48
  94. package/dist/utils/base64.d.ts +0 -1
  95. package/dist/utils/base64.js +0 -7
  96. package/dist/utils/templatePreparation.d.ts +0 -4
  97. package/dist/utils/templatePreparation.js +0 -33
  98. /package/dist/components/organisms/{save-as-template/SaveAsTemplateDrawer.vue.d.ts → base/Toaster.vue.d.ts} +0 -0
@@ -4,17 +4,11 @@ type Features = {
4
4
  saveAsTemplate?: boolean;
5
5
  versionHistory?: boolean;
6
6
  };
7
- type Partner = {
8
- partnerName: string;
9
- productType: number;
10
- messageType: number;
11
- };
12
7
  export type GuidoConfig = {
13
8
  translationsPath: string;
14
9
  htmlCompilerRules?: CompilerRule[];
15
10
  ignoreDefaultHtmlCompilerRules?: boolean;
16
11
  emailHeader: EmailHeader;
17
- partner?: Partner;
18
12
  features?: Features;
19
13
  };
20
14
  export type DynamicContent = {
@@ -1,11 +1,10 @@
1
1
  import type { DynamicContent, GuidoConfig } from '@@/Types/generic';
2
- import type { SavedTemplateDetails } from '@@/Types/stripo';
2
+ import type { Template } from '@@/Types/stripo';
3
3
  type __VLS_Props = {
4
4
  templateId: string;
5
5
  userId: string;
6
- messageType?: number;
7
6
  partnerName?: string;
8
- productType?: number;
7
+ productType?: string;
9
8
  username?: string;
10
9
  html?: string;
11
10
  css?: string;
@@ -17,12 +16,14 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__
17
16
  insert: (data: DynamicContent) => void;
18
17
  close: () => void;
19
18
  };
20
- hasChanges: import("vue").ComputedRef<boolean>;
21
19
  }, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {
22
20
  "dynamic-content:open": (detail: DynamicContent | null) => void;
23
21
  back: () => void;
24
22
  "save:start": () => void;
25
- "save:complete": (data: Omit<SavedTemplateDetails, "forceRecreate">) => void;
23
+ "save:complete": (data: {
24
+ template: Omit<Template, "forceRecreate">;
25
+ dynamicContentList: DynamicContent[];
26
+ }) => void;
26
27
  }, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
27
28
  export default _default;
28
29
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -3,16 +3,16 @@ import o from "./Guido.vue2.js";
3
3
  import t from "../_virtual/_plugin-vue2_normalizer.js";
4
4
  var s = function() {
5
5
  var i = this, e = i._self._c, r = i._self._setupProxy;
6
- return e("div", { staticClass: "guido-editor__wrapper" }, [e(r.HeaderWrapper), r.previewStore.isPreviewModeOpen ? e(r.PreviewContainer) : i._e(), e("div", { directives: [{ name: "show", rawName: "v-show", value: !r.previewStore.isPreviewModeOpen, expression: "!previewStore.isPreviewModeOpen" }], staticClass: "guido-editor__container", attrs: { id: "guido-editor" } }), e(r.SaveAsTemplateDrawer)], 1);
6
+ return e("div", { staticClass: "guido-editor__wrapper" }, [e(r.HeaderWrapper), r.previewStore.isPreviewModeOpen ? e(r.PreviewContainer) : i._e(), e("div", { directives: [{ name: "show", rawName: "v-show", value: !r.previewStore.isPreviewModeOpen, expression: "!previewStore.isPreviewModeOpen" }], staticClass: "guido-editor__container", attrs: { id: "guido-editor" } }), e(r.Toaster)], 1);
7
7
  }, a = [], n = /* @__PURE__ */ t(
8
8
  o,
9
9
  s,
10
10
  a,
11
11
  !1,
12
12
  null,
13
- "25dc4026"
13
+ "09c28ccc"
14
14
  );
15
- const c = n.exports;
15
+ const v = n.exports;
16
16
  export {
17
- c as default
17
+ v as default
18
18
  };
@@ -1,21 +1,19 @@
1
- import { defineComponent as I, defineAsyncComponent as P, computed as _, onMounted as L, onUnmounted as k } from "vue";
2
- import { provideGuidoActions as A } from "../composables/useGuidoActions.js";
3
- import { usePartner as N } from "../composables/usePartner.js";
4
- import { useStripo as U } from "../composables/useStripo.js";
5
- import { DefaultUsername as x, DefaultMessageType as M, DefaultGuidoConfig as W } from "../enums/defaults.js";
6
- import z from "./organisms/header/HeaderWrapper.vue.js";
7
- import B from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
8
- import { useStripoApi as F } from "../services/stripoApi.js";
9
- import { useDynamicContentStore as H } from "../stores/dynamic-content.js";
10
- import { useEditorStore as K } from "../stores/editor.js";
11
- import { usePreviewStore as R } from "../stores/preview.js";
12
- import j from "../node_modules/lodash-es/merge.js";
13
- const ne = /* @__PURE__ */ I({
1
+ import { defineComponent as L, defineAsyncComponent as E, onMounted as P } from "vue";
2
+ import { provideGuidoActions as _ } from "../composables/useGuidoActions.js";
3
+ import { usePartner as G } from "../composables/usePartner.js";
4
+ import { useStripo as I } from "../composables/useStripo.js";
5
+ import { DefaultUsername as T, DefaultGuidoConfig as k } from "../enums/defaults.js";
6
+ import A from "./organisms/base/Toaster.vue.js";
7
+ import N from "./organisms/header/HeaderWrapper.vue.js";
8
+ import { useStripoApi as x } from "../services/stripoApi.js";
9
+ import { useDynamicContentStore as W } from "../stores/dynamic-content.js";
10
+ import { usePreviewStore as z } from "../stores/preview.js";
11
+ import B from "../node_modules/lodash-es/merge.js";
12
+ const V = /* @__PURE__ */ L({
14
13
  __name: "Guido",
15
14
  props: {
16
15
  templateId: null,
17
16
  userId: null,
18
- messageType: null,
19
17
  partnerName: null,
20
18
  productType: null,
21
19
  username: null,
@@ -25,34 +23,29 @@ const ne = /* @__PURE__ */ I({
25
23
  guidoConfig: null
26
24
  },
27
25
  emits: ["dynamic-content:open", "back", "save:start", "save:complete"],
28
- setup(b, { expose: E, emit: t }) {
29
- const o = b, T = P(
26
+ setup(S, { expose: b, emit: t }) {
27
+ const o = S, w = E(
30
28
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
31
- ), n = H(), c = K(), a = _(() => c.hasChanges), r = o.preselectedDynamicContentList || [], { getPartnerName: m, getProductType: d } = N(), G = R(), {
32
- templateId: l,
33
- userId: u,
34
- guidoConfig: p,
35
- html: g = "",
36
- css: y = "",
37
- partnerName: s = m(),
38
- productType: i = d(),
39
- messageType: f = M,
40
- username: C = x
29
+ ), n = W(), c = o.preselectedDynamicContentList || [], { getPartnerName: i, getProductType: s } = G(), h = z(), {
30
+ templateId: r,
31
+ userId: a,
32
+ guidoConfig: m,
33
+ html: d = "",
34
+ css: l = "",
35
+ partnerName: u = i(),
36
+ productType: p = s(),
37
+ username: y = T
41
38
  } = o;
42
- window.GuidoConfig = j(W, p), window.GuidoConfig.partner = {
43
- partnerName: s,
44
- productType: i,
45
- messageType: f
46
- };
47
- const { initPlugin: v } = U({
48
- emailId: l,
49
- userId: u,
50
- username: C,
51
- partnerName: s,
52
- productType: i,
53
- preselectedDynamicContentList: r
54
- }), { getDefaultTemplate: w } = F();
55
- A({
39
+ window.GuidoConfig = B(k, m);
40
+ const { initPlugin: f } = I({
41
+ emailId: r,
42
+ userId: a,
43
+ username: y,
44
+ partnerName: u,
45
+ productType: p,
46
+ preselectedDynamicContentList: c
47
+ }), { getDefaultTemplate: g } = x();
48
+ _({
56
49
  onBack: () => {
57
50
  console.debug("guido:back"), t("back");
58
51
  },
@@ -60,42 +53,45 @@ const ne = /* @__PURE__ */ I({
60
53
  console.debug("guido:save:start"), t("save:start");
61
54
  },
62
55
  onSaveComplete: (e) => {
63
- console.debug("guido:save:complete", e), t("save:complete", e);
56
+ console.debug("guido:save:complete", {
57
+ template: e,
58
+ dynamicContentList: n.getSelectedDynamicContentList
59
+ }), t("save:complete", {
60
+ template: e,
61
+ dynamicContentList: n.getSelectedDynamicContentList
62
+ });
64
63
  }
65
64
  });
66
- const D = (e) => {
65
+ const C = (e) => {
67
66
  console.debug("dynamic-content:close", e), n.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
68
- }, S = () => {
67
+ }, v = () => {
69
68
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
70
69
  };
71
- return L(async () => {
70
+ return P(async () => {
72
71
  console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
73
72
  try {
74
73
  let e = {
75
- html: g,
76
- css: y,
74
+ html: d,
75
+ css: l,
77
76
  forceRecreate: !0
78
77
  // TODO: It should be false for old templates. We will communicate with Stripo
79
78
  };
80
- e.html || (e = await w()), await v(e), n.selectedDynamicContentList = r;
79
+ e.html || (e = await g()), await f(e), n.selectedDynamicContentList = c;
81
80
  } catch (e) {
82
81
  console.error("Failed to initialize Stripo editor:", e);
83
82
  }
84
83
  document.addEventListener("dynamic-content:open", (e) => {
85
- const h = e;
86
- console.debug("dynamic-content:open", h.detail), t("dynamic-content:open", h.detail);
84
+ const D = e;
85
+ console.debug("dynamic-content:open", D.detail), t("dynamic-content:open", D.detail);
87
86
  });
88
- }), k(() => {
89
- window.UIEditor.removeEditor();
90
- }), E({
87
+ }), b({
91
88
  dynamicContent: {
92
- insert: D,
93
- close: S
94
- },
95
- hasChanges: a
96
- }), { __sfc: !0, PreviewContainer: T, dynamicContentStore: n, props: o, editorStore: c, hasChanges: a, preselectedDynamicContentList: r, getPartnerName: m, getProductType: d, previewStore: G, templateId: l, userId: u, guidoConfig: p, html: g, css: y, partnerName: s, productType: i, messageType: f, username: C, emit: t, initPlugin: v, getDefaultTemplate: w, insertDynamicContent: D, closeDynamicContent: S, HeaderWrapper: z, SaveAsTemplateDrawer: B };
89
+ insert: C,
90
+ close: v
91
+ }
92
+ }), { __sfc: !0, PreviewContainer: w, dynamicContentStore: n, props: o, preselectedDynamicContentList: c, getPartnerName: i, getProductType: s, previewStore: h, templateId: r, userId: a, guidoConfig: m, html: d, css: l, partnerName: u, productType: p, username: y, emit: t, initPlugin: f, getDefaultTemplate: g, insertDynamicContent: C, closeDynamicContent: v, Toaster: A, HeaderWrapper: N };
97
93
  }
98
94
  });
99
95
  export {
100
- ne as default
96
+ V as default
101
97
  };
@@ -0,0 +1,17 @@
1
+ import r from "./Toaster.vue2.js";
2
+ import o from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var n = function() {
4
+ var e = this, s = e._self._c, t = e._self._setupProxy;
5
+ return s("div", [s(t.InToasts, { attrs: { status: t.store.status, text: t.store.text, type: t.store.type } })], 1);
6
+ }, _ = [], a = /* @__PURE__ */ o(
7
+ r,
8
+ n,
9
+ _,
10
+ !1,
11
+ null,
12
+ null
13
+ );
14
+ const l = a.exports;
15
+ export {
16
+ l as default
17
+ };
@@ -0,0 +1,12 @@
1
+ import { defineComponent as o } from "vue";
2
+ import { useToasterStore as t } from "../../../stores/toaster.js";
3
+ import { InToasts as r } from "@useinsider/design-system-vue";
4
+ const _ = /* @__PURE__ */ o({
5
+ __name: "Toaster",
6
+ setup(e) {
7
+ return { __sfc: !0, store: t(), InToasts: r };
8
+ }
9
+ });
10
+ export {
11
+ _ as default
12
+ };
@@ -1,13 +1,13 @@
1
1
  import n from "./RightSlot.vue2.js";
2
- import a from "../../../_virtual/_plugin-vue2_normalizer.js";
3
- var l = function() {
2
+ import r from "../../../_virtual/_plugin-vue2_normalizer.js";
3
+ var a = function() {
4
4
  var s, i;
5
5
  var o = this, e = o._self._c, t = o._self._setupProxy;
6
- return e("div", { staticClass: "d-f" }, [(s = t.config.features) != null && s.versionHistory ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.previewStore.isPreviewModeOpen, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : o._e(), 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, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.exportHtml } }), (i = t.config.features) != null && i.saveAsTemplate ? 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, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") }, on: { click: t.handleSaveAs } }) : o._e(), 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, "tooltip-options": t.getTooltipOptions("guido__test-button"), "tooltip-text": t.trans("newsletter.test-email") } }), e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": t.isSaveButtonDisabled }, on: { click: t.handleSave } })], 1);
7
- }, r = [], p = /* @__PURE__ */ a(
6
+ return e("div", { staticClass: "d-f" }, [(s = t.config.features) != null && s.versionHistory ? e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "disabled-status": t.previewStore.isPreviewModeOpen, "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen, "tooltip-options": t.getTooltipOptions("guido__history-button"), "tooltip-text": t.versionHistoryTooltipText }, on: { click: t.handleVersionHistory } }) : o._e(), 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, "tooltip-options": t.getTooltipOptions("guido__export-button"), "tooltip-text": t.trans("newsletter.export") }, on: { click: t.exportHtml } }), (i = t.config.features) != null && i.saveAsTemplate ? 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, "tooltip-options": t.getTooltipOptions("guido__save-as-button"), "tooltip-text": t.trans("newsletter.save-templates") } }) : o._e(), 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, "tooltip-options": t.getTooltipOptions("guido__test-button"), "tooltip-text": t.trans("newsletter.test-email") } }), e(t.InButtonV2, { staticClass: "ml-3", attrs: { id: "guido__save-button", "label-text": "Save", "disabled-status": t.isSaveButtonDisabled }, on: { click: t.handleSave } })], 1);
7
+ }, l = [], p = /* @__PURE__ */ r(
8
8
  n,
9
+ a,
9
10
  l,
10
- r,
11
11
  !1,
12
12
  null,
13
13
  null
@@ -1,37 +1,39 @@
1
- import { defineComponent as y, computed as p } from "vue";
1
+ import { defineComponent as y, computed as a } from "vue";
2
+ import { useActionsApi as S } from "../../../composables/useActionsApi.js";
2
3
  import { useConfig as H } from "../../../composables/useConfig.js";
3
- import { useExport as V } from "../../../composables/useExport.js";
4
- import { useSaveStart as _, useSaveComplete as h } from "../../../composables/useGuidoActions.js";
5
- import { useTranslations as w } from "../../../composables/useTranslations.js";
6
- import { useVersionHistoryApi as T } from "../../../composables/useVersionHistoryApi.js";
7
- import { useEditorStore as O } from "../../../stores/editor.js";
8
- import { usePreviewStore as g } from "../../../stores/preview.js";
9
- import { useTemplatePreparation as x } from "../../../utils/templatePreparation.js";
10
- import { getTooltipOptions as C } from "../../../utils/tooltipUtils.js";
11
- import { InButtonV2 as D } from "@useinsider/design-system-vue";
12
- const z = /* @__PURE__ */ y({
4
+ import { useExport as h } from "../../../composables/useExport.js";
5
+ import { useSaveStart as V, useSaveComplete as _ } from "../../../composables/useGuidoActions.js";
6
+ import { useTranslations as g } from "../../../composables/useTranslations.js";
7
+ import { useVersionHistoryApi as w } from "../../../composables/useVersionHistoryApi.js";
8
+ import { useEditorStore as C } from "../../../stores/editor.js";
9
+ import { usePreviewStore as O } from "../../../stores/preview.js";
10
+ import { getTooltipOptions as x } from "../../../utils/tooltipUtils.js";
11
+ import { InButtonV2 as T } from "@useinsider/design-system-vue";
12
+ const q = /* @__PURE__ */ y({
13
13
  __name: "RightSlot",
14
14
  setup(A) {
15
- const { config: m } = H(), { exportHtml: c } = V(), r = _(), s = h(), { openVersionHistory: i, closeVersionHistory: n } = T(), e = O(), o = w(), a = g(), l = () => {
16
- if (e.isVersionHistoryOpen) {
17
- n();
15
+ const { config: c } = H(), { exportHtml: l } = h(), { getCompiledEmail: r } = S(), s = V(), i = _(), { openVersionHistory: n, closeVersionHistory: m } = w(), o = C(), t = g(), p = O(), f = () => {
16
+ if (o.isVersionHistoryOpen) {
17
+ m();
18
18
  return;
19
19
  }
20
- i();
21
- }, f = () => {
22
- e.isSaveAsTemplateDrawerOpen = !0;
23
- }, u = p(() => e.isVersionHistoryOpen ? o("newsletter.close-version-history") : o("newsletter.version-history")), v = async () => {
24
- r();
20
+ n();
21
+ }, u = a(() => o.isVersionHistoryOpen ? t("newsletter.close-version-history") : t("newsletter.version-history")), v = async () => {
22
+ s();
25
23
  try {
26
- const { prepareTemplateDetails: t } = x(), d = await t();
27
- s(d);
28
- } catch (t) {
29
- console.error("Failed to get template data for save:", t);
24
+ const { html: e } = await r();
25
+ i({
26
+ html: e || "",
27
+ css: ""
28
+ // CSS is embedded in HTML from Stripo
29
+ });
30
+ } catch (e) {
31
+ console.error("Failed to get template data for save:", e);
30
32
  }
31
- }, S = p(() => e.isVersionHistoryOpen || a.isPreviewModeOpen);
32
- return { __sfc: !0, config: m, exportHtml: c, saveStart: r, saveComplete: s, openVersionHistory: i, closeVersionHistory: n, editorStore: e, trans: o, previewStore: a, handleVersionHistory: l, handleSaveAs: f, versionHistoryTooltipText: u, handleSave: v, isSaveButtonDisabled: S, getTooltipOptions: C, InButtonV2: D };
33
+ }, d = a(() => o.isVersionHistoryOpen || p.isPreviewModeOpen);
34
+ return { __sfc: !0, config: c, exportHtml: l, getCompiledEmail: r, saveStart: s, saveComplete: i, openVersionHistory: n, closeVersionHistory: m, editorStore: o, trans: t, previewStore: p, handleVersionHistory: f, versionHistoryTooltipText: u, handleSave: v, isSaveButtonDisabled: d, getTooltipOptions: x, InButtonV2: T };
33
35
  }
34
36
  });
35
37
  export {
36
- z as default
38
+ q as default
37
39
  };
@@ -32,11 +32,11 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
32
32
  closeOnOutsideClick: boolean;
33
33
  footerStatus: boolean;
34
34
  }>>>, {
35
- description: string;
36
35
  size: "small" | "medium" | "large";
37
- closeOnOutsideClick: boolean;
36
+ description: string;
38
37
  footerButtonOptions: FooterButtonGroup;
39
38
  closeButtonStatus: boolean;
39
+ closeOnOutsideClick: boolean;
40
40
  footerStatus: boolean;
41
41
  }>;
42
42
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
@@ -1,8 +1,7 @@
1
1
  import type { CompileEmailOptions } from '@@/Types/actions-api';
2
- import { GetCompiledEmailOptions, CompiledEmailResult, TemplateData } from '@@/Types/actions-api';
2
+ import { GetCompiledEmailOptions, CompiledEmailResult } from '@@/Types/actions-api';
3
3
  export declare const useActionsApi: () => {
4
4
  getCompiledEmail: (options?: GetCompiledEmailOptions) => Promise<CompiledEmailResult>;
5
- getTemplateData: () => Promise<TemplateData>;
6
5
  activateCustomViewStyles: (isActive?: boolean) => void;
7
6
  getPreviewData: (options?: CompileEmailOptions) => Promise<CompiledEmailResult>;
8
7
  };
@@ -1,6 +1,6 @@
1
- import { useToaster as g } from "./useToaster.js";
2
- const A = () => {
3
- const { handleError: l } = g(), n = (t = {}) => new Promise((e, a) => {
1
+ import { useToaster as d } from "./useToaster.js";
2
+ const E = () => {
3
+ const { handleError: m } = d(), s = (t = {}) => new Promise((e, a) => {
4
4
  const i = { ...{
5
5
  minimize: !0,
6
6
  utmEntity: {
@@ -20,60 +20,45 @@ const A = () => {
20
20
  forseAmp: !1,
21
21
  resetDataSavedFlag: !1,
22
22
  disableLineHeightsReplace: !0
23
- }, ...t }, m = {
24
- callback: (s, c, p, u, d) => {
25
- s ? a(s) : e({
26
- html: c,
27
- ampHtml: p,
28
- ampErrors: u,
29
- displayConditions: d
23
+ }, ...t }, n = {
24
+ callback: (r, l, c, p, u) => {
25
+ r ? a(r) : e({
26
+ html: l,
27
+ ampHtml: c,
28
+ ampErrors: p,
29
+ displayConditions: u
30
30
  });
31
31
  },
32
32
  ...i
33
33
  };
34
- window.StripoEditorApi.actionsApi.compileEmail(m);
34
+ window.StripoEditorApi.actionsApi.compileEmail(n);
35
35
  });
36
- return {
37
- getCompiledEmail: n,
38
- getTemplateData: () => new Promise((t) => {
39
- const e = ({ html: a, css: o, width: i, height: r, utmParams: m, syncModulesIds: s }) => t({
40
- html: a,
41
- css: o,
42
- width: i,
43
- height: r,
44
- utmParams: m,
45
- syncModulesIds: s
46
- });
47
- window.StripoEditorApi.actionsApi.getTemplateData(e);
48
- }),
49
- activateCustomViewStyles: (t = !0) => {
50
- window.StripoEditorApi.actionsApi.activateCustomViewStyles(t);
51
- },
52
- getPreviewData: async (t) => {
53
- try {
54
- const {
55
- html: e,
56
- displayConditions: a,
57
- ampHtml: o = "",
58
- ampErrors: i = []
59
- } = await n({ minimize: !1, resetDataSavedFlag: !1, ...t });
60
- return {
61
- html: e,
62
- ampHtml: o,
63
- ampErrors: i,
64
- displayConditions: a
65
- };
66
- } catch (e) {
67
- return l(e, "Error loading preview"), {
68
- html: "",
69
- ampHtml: "",
70
- ampErrors: [],
71
- displayConditions: []
72
- };
73
- }
36
+ return { getCompiledEmail: s, activateCustomViewStyles: (t = !0) => {
37
+ window.StripoEditorApi.actionsApi.activateCustomViewStyles(t);
38
+ }, getPreviewData: async (t) => {
39
+ try {
40
+ const {
41
+ html: e,
42
+ displayConditions: a,
43
+ ampHtml: o = "",
44
+ ampErrors: i = []
45
+ } = await s({ minimize: !1, resetDataSavedFlag: !1, ...t });
46
+ return {
47
+ html: e,
48
+ ampHtml: o,
49
+ ampErrors: i,
50
+ displayConditions: a
51
+ };
52
+ } catch (e) {
53
+ return m(e, "Error loading preview"), {
54
+ html: "",
55
+ ampHtml: "",
56
+ ampErrors: [],
57
+ displayConditions: []
58
+ };
74
59
  }
75
- };
60
+ } };
76
61
  };
77
62
  export {
78
- A as useActionsApi
63
+ E as useActionsApi
79
64
  };
@@ -1,16 +1,16 @@
1
- import { useActionsApi as l } from "./useActionsApi.js";
1
+ import { useActionsApi as c } from "./useActionsApi.js";
2
2
  import { useHtmlCompiler as m } from "./useHtmlCompiler.js";
3
3
  import { useToaster as d } from "./useToaster.js";
4
4
  const h = () => {
5
5
  const a = (s, o, r) => {
6
6
  const i = new Blob([s], { type: r }), t = URL.createObjectURL(i), e = document.createElement("a");
7
7
  e.href = t, e.download = o, document.body.appendChild(e), e.click(), document.body.removeChild(e), URL.revokeObjectURL(t);
8
- }, c = (s) => {
8
+ }, l = (s) => {
9
9
  const o = /* @__PURE__ */ new Date(), r = String(o.getDate()).padStart(2, "0"), i = String(o.getMonth() + 1).padStart(2, "0"), t = o.getFullYear(), e = String(o.getHours()).padStart(2, "0"), n = String(o.getMinutes()).padStart(2, "0");
10
10
  return `${s}_${r}-${i}-${t}_${e}-${n}.html`;
11
11
  };
12
12
  return { exportHtml: async (s = !0) => {
13
- const { getCompiledEmail: o } = l(), { showToaster: r } = d(), { compileHtml: i } = m();
13
+ const { getCompiledEmail: o } = c(), { showToaster: r } = d(), { compileHtml: i } = m();
14
14
  try {
15
15
  const { html: t } = await o();
16
16
  if (t) {
@@ -25,16 +25,16 @@ const h = () => {
25
25
  executionTime: `${n.stats.executionTime.toFixed(2)}ms`
26
26
  });
27
27
  }
28
- a(e, c("HTML"), "text/html");
28
+ a(e, l("HTML"), "text/html");
29
29
  } else
30
30
  r({
31
- type: "error",
31
+ type: "alert",
32
32
  message: "No HTML content to download"
33
33
  });
34
34
  } catch (t) {
35
35
  const e = t instanceof Error ? t.message : String(t);
36
36
  r({
37
- type: "error",
37
+ type: "alert",
38
38
  message: `Error compiling email: ${e}`
39
39
  });
40
40
  }
@@ -1,8 +1,8 @@
1
- import type { SavedTemplateDetails } from '@@/Types/stripo';
1
+ import type { Template } from '@@/Types/stripo';
2
2
  import type { InjectionKey } from 'vue';
3
3
  export type BackHandler = () => void;
4
4
  export type SaveStartHandler = () => void;
5
- export type SaveCompleteHandler = (template: Omit<SavedTemplateDetails, 'forceRecreate'>) => void;
5
+ export type SaveCompleteHandler = (template: Omit<Template, 'forceRecreate'>) => void;
6
6
  export declare const BACK_KEY: InjectionKey<BackHandler>;
7
7
  export declare const SAVE_START_KEY: InjectionKey<SaveStartHandler>;
8
8
  export declare const SAVE_COMPLETE_KEY: InjectionKey<SaveCompleteHandler>;
@@ -1,20 +1,18 @@
1
- import { getCsrfToken as H } from "../utils/genericUtil.js";
2
- import { ref as p, computed as T } from "vue";
3
- const k = (b = {}) => {
4
- const h = p(!1), a = p(null), u = p(null), g = T(() => h.value), y = T(() => a.value !== null), v = {
1
+ import { ref as p, computed as v } from "vue";
2
+ const j = (y = {}) => {
3
+ const h = p(!1), a = p(null), u = p(null), E = v(() => h.value), g = v(() => a.value !== null), T = {
5
4
  baseURL: "",
6
5
  timeout: 1e4,
7
6
  retry: 0,
8
7
  retryDelay: 1e3,
9
8
  headers: {
10
- "Content-Type": "application/json",
11
- "X-CSRF-TOKEN": H()
9
+ "Content-Type": "application/json"
12
10
  },
13
- ...b
11
+ ...y
14
12
  }, w = (e, s) => {
15
13
  if (e.startsWith("http://") || e.startsWith("https://"))
16
14
  return e;
17
- const t = s || v.baseURL || "";
15
+ const t = s || T.baseURL || "";
18
16
  return t.endsWith("/") && e.startsWith("/") ? `${t}${e.slice(1)}` : t.endsWith("/") || e.startsWith("/") ? `${t}${e}` : `${t}/${e}`;
19
17
  }, P = (e) => new Promise((s, t) => {
20
18
  setTimeout(() => {
@@ -24,20 +22,20 @@ const k = (b = {}) => {
24
22
  setTimeout(s, e);
25
23
  }), i = async (e, s, t, D = {}) => {
26
24
  a.value = null, h.value = !0, u.value = new AbortController();
27
- const n = { ...v, ...D }, L = w(s, n.baseURL), c = {
25
+ const n = { ...T, ...D }, L = w(s, n.baseURL), c = {
28
26
  method: e,
29
27
  headers: { ...n.headers },
30
28
  signal: u.value.signal,
31
29
  ...n
32
30
  };
33
31
  t && ["POST", "PUT", "PATCH"].includes(e) && (t instanceof FormData ? (delete c.headers["Content-Type"], c.body = t) : c.body = JSON.stringify(t));
34
- const E = async (m = 0) => {
32
+ const b = async (m = 0) => {
35
33
  try {
36
34
  const o = [fetch(L, c)];
37
35
  n.timeout && o.push(P(n.timeout));
38
36
  const r = await Promise.race(o);
39
37
  if (!r.ok) {
40
- const O = `HTTP Error: ${r.status} ${r.statusText}`, d = new Error(O);
38
+ const H = `HTTP Error: ${r.status} ${r.statusText}`, d = new Error(H);
41
39
  throw d.status = r.status, d.statusText = r.statusText, d.response = r, d;
42
40
  }
43
41
  let f;
@@ -51,36 +49,36 @@ const k = (b = {}) => {
51
49
  } catch (o) {
52
50
  const r = o instanceof Error && o.name === "AbortError";
53
51
  if (m < (n.retry || 0) && !r)
54
- return await x(n.retryDelay || 1e3), E(m + 1);
52
+ return await x(n.retryDelay || 1e3), b(m + 1);
55
53
  throw o instanceof Error ? o.name === "AbortError" ? a.value = { message: "Request was cancelled" } : a.value = { message: o.message } : a.value = o, o;
56
54
  }
57
55
  };
58
56
  try {
59
- return await E();
57
+ return await b();
60
58
  } finally {
61
59
  h.value = !1, u.value = null;
62
60
  }
63
- }, C = (e, s) => i("GET", e, void 0, s), $ = (e, s, t) => i("POST", e, s, t), R = (e, s, t) => i("PUT", e, s, t), U = (e, s, t) => i("PATCH", e, s, t), A = (e, s) => i("DELETE", e, void 0, s), W = (e) => {
61
+ }, $ = (e, s) => i("GET", e, void 0, s), C = (e, s, t) => i("POST", e, s, t), U = (e, s, t) => i("PUT", e, s, t), A = (e, s, t) => i("PATCH", e, s, t), R = (e, s) => i("DELETE", e, void 0, s), W = (e) => {
64
62
  u.value && u.value.abort(e);
65
63
  }, q = () => {
66
64
  a.value = null;
67
65
  };
68
66
  return {
69
67
  // State
70
- loading: g,
71
- error: T(() => a.value),
72
- hasError: y,
68
+ loading: E,
69
+ error: v(() => a.value),
70
+ hasError: g,
73
71
  // Methods
74
72
  request: i,
75
- get: C,
76
- post: $,
77
- put: R,
78
- patch: U,
79
- delete: A,
73
+ get: $,
74
+ post: C,
75
+ put: U,
76
+ patch: A,
77
+ delete: R,
80
78
  cancel: W,
81
79
  clearError: q
82
80
  };
83
81
  };
84
82
  export {
85
- k as useHttp
83
+ j as useHttp
86
84
  };
@@ -1,4 +1,4 @@
1
1
  export declare const usePartner: () => {
2
2
  getPartnerName: () => string;
3
- getProductType: () => number;
3
+ getProductType: () => string;
4
4
  };