@useinsider/guido 1.0.0-beta.3012b2b → 1.0.0-beta.301d25a

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 (93) hide show
  1. package/README.md +0 -11
  2. package/dist/@types/generic.d.ts +0 -7
  3. package/dist/components/Guido.vue.d.ts +6 -5
  4. package/dist/components/Guido.vue.js +11 -11
  5. package/dist/components/Guido.vue2.js +54 -59
  6. package/dist/components/organisms/header/RightSlot.vue.js +5 -5
  7. package/dist/components/organisms/header/RightSlot.vue2.js +28 -26
  8. package/dist/components/wrappers/WpModal.vue.d.ts +2 -2
  9. package/dist/composables/useActionsApi.d.ts +1 -2
  10. package/dist/composables/useActionsApi.js +36 -51
  11. package/dist/composables/useGuidoActions.d.ts +2 -2
  12. package/dist/composables/useHttp.js +21 -23
  13. package/dist/composables/usePartner.d.ts +1 -1
  14. package/dist/composables/usePartner.js +14 -9
  15. package/dist/composables/useStripo.js +29 -32
  16. package/dist/enums/defaults.d.ts +1 -4
  17. package/dist/enums/defaults.js +3 -10
  18. package/dist/guido.css +1 -1
  19. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/Extension.js +2 -2
  20. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ExtensionBuilder.js +2 -2
  21. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/Block.js +2 -2
  22. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlockRenderer.js +2 -2
  23. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlocksPanel.js +2 -2
  24. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/ContextAction.js +2 -2
  25. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js +2 -2
  26. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js +2 -2
  27. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js +2 -2
  28. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js +2 -2
  29. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js +2 -2
  30. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js +2 -2
  31. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js +2 -2
  32. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js +2 -2
  33. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js +2 -2
  34. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js +2 -2
  35. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundColorBuiltInControl.js +4 -4
  36. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundImageBuiltInControl.js +4 -4
  37. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BlockPaddingsBuiltInControl.js +4 -4
  38. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BuiltInControl.js +2 -2
  39. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonBorderBuiltInControl.js +4 -4
  40. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonColorBuiltInControl.js +4 -4
  41. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonFontColorBuiltInControl.js +4 -4
  42. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonInternalIndentsBuiltInControl.js +4 -4
  43. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonTextBuiltInControl.js +4 -4
  44. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/Control.js +2 -2
  45. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/FontFamilyBuiltInControl.js +4 -4
  46. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/LinkColorBuiltInControl.js +4 -4
  47. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelRegistry.js +2 -2
  48. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelTab.js +2 -2
  49. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructureBorderBuiltInControl.js +4 -4
  50. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructurePaddingsBuiltInControl.js +4 -4
  51. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextColorBuiltInControl.js +4 -4
  52. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextLineSpacingBuiltInControl.js +4 -4
  53. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextSizeBuiltInControl.js +4 -4
  54. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextStyleBuiltInControl.js +4 -4
  55. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/index.js +2 -2
  56. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/modifications/ModificationDescription.js +2 -2
  57. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElement.js +2 -2
  58. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElementTagRegistry.js +2 -2
  59. package/dist/node_modules/lodash-es/_baseCreate.js +2 -2
  60. package/dist/node_modules/lodash-es/_defineProperty.js +2 -2
  61. package/dist/node_modules/lodash-es/_isMasked.js +2 -2
  62. package/dist/node_modules/lodash-es/_nodeUtil.js +2 -2
  63. package/dist/node_modules/lodash-es/isArguments.js +2 -2
  64. package/dist/static/styles/components/wide-panel.css.js +0 -4
  65. package/dist/stores/editor.d.ts +0 -2
  66. package/dist/stores/editor.js +3 -5
  67. package/dist/utils/genericUtil.d.ts +0 -1
  68. package/dist/utils/genericUtil.js +3 -7
  69. package/package.json +3 -3
  70. package/dist/@types/save-as-template.d.ts +0 -29
  71. package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue.d.ts +0 -2
  72. package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue.js +0 -20
  73. package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +0 -63
  74. package/dist/components/wrappers/WpDrawer.vue.d.ts +0 -63
  75. package/dist/components/wrappers/WpDrawer.vue.js +0 -25
  76. package/dist/components/wrappers/WpDrawer.vue2.js +0 -23
  77. package/dist/composables/useValidation.d.ts +0 -56
  78. package/dist/composables/useValidation.js +0 -19
  79. package/dist/composables/validators/saveAsTemplate.d.ts +0 -31
  80. package/dist/composables/validators/saveAsTemplate.js +0 -24
  81. package/dist/mock/api/template-library.d.ts +0 -2
  82. package/dist/node_modules/@vueuse/shared/index.js +0 -45
  83. package/dist/node_modules/valibot/dist/index.js +0 -190
  84. package/dist/node_modules/vue-demi/lib/index.js +0 -7
  85. package/dist/services/templateLibraryApi.d.ts +0 -7
  86. package/dist/services/templateLibraryApi.js +0 -87
  87. package/dist/static/styles/customEditorStyle.css.js +0 -18
  88. package/dist/stores/save-as-template.d.ts +0 -73
  89. package/dist/stores/save-as-template.js +0 -48
  90. package/dist/utils/base64.d.ts +0 -1
  91. package/dist/utils/base64.js +0 -7
  92. package/dist/utils/templatePreparation.d.ts +0 -4
  93. package/dist/utils/templatePreparation.js +0 -33
package/README.md CHANGED
@@ -145,16 +145,6 @@ interface GuidoConfig {
145
145
  translationsPath: string;
146
146
  htmlCompilerRules?: CompilerRule[];
147
147
  ignoreDefaultHtmlCompilerRules?: boolean;
148
- useHeader: boolean
149
- emailHeader: {
150
- senderName: string;
151
- subject: string;
152
- };
153
- partner: {
154
- partnerName: string;
155
- productType: number;
156
- messageType: number;
157
- };
158
148
  features: {
159
149
  dynamicContent: boolean;
160
150
  saveAsTemplate: boolean;
@@ -168,7 +158,6 @@ interface GuidoConfig {
168
158
  | `translationsPath` | `string` | `'window.trans.en'` | JavaScript path to the translations object |
169
159
  | `htmlCompilerRules` | `CompilerRule[]` | `[]` | Additional compiler rules to apply to HTML content. See [HTML Compiler Rules](#-html-compiler-rules) section below |
170
160
  | `ignoreDefaultHtmlCompilerRules` | `boolean` | `false` | Skip default compiler rules and only use custom rules. Default rules: `src/config/compiler/htmlCompilerRules.ts` |
171
- | `useHeader` | `boolean` | `true` | Adds extra spaces to height for adjusting. If you don't use Inone Page header, override as `false` |
172
161
  | `features` | `Features` | `{ dynamicContent: true, saveAsTemplate: true, versionHistory: true }` | Feature flags to enable/disable editor functionality |
173
162
  | `features.dynamicContent` | `boolean` | `true` | Enable dynamic content insertion feature |
174
163
  | `features.saveAsTemplate` | `boolean` | `true` | Enable save as template feature |
@@ -4,18 +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
- useHeader?: boolean;
17
11
  emailHeader: EmailHeader;
18
- partner?: Partner;
19
12
  features?: Features;
20
13
  };
21
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;
@@ -1,18 +1,18 @@
1
- import i from "./Guido.vue2.js";
1
+ import o from "./Guido.vue2.js";
2
2
  /* empty css */
3
- import s from "../_virtual/_plugin-vue2_normalizer.js";
4
- var a = function() {
5
- var o = this, r = o._self._c, e = o._self._setupProxy;
6
- return r("div", { staticClass: "guido-editor__wrapper", class: { "guido-editor__no-header": !e.guidoConfig.useHeader } }, [r(e.HeaderWrapper), e.previewStore.isPreviewModeOpen ? r(e.PreviewContainer) : o._e(), r("div", { directives: [{ name: "show", rawName: "v-show", value: !e.previewStore.isPreviewModeOpen, expression: "!previewStore.isPreviewModeOpen" }], staticClass: "guido-editor__container", class: { "guido-editor__no-header": !e.guidoConfig.useHeader }, attrs: { id: "guido-editor" } }), r(e.Toaster), r(e.SaveAsTemplateDrawer)], 1);
7
- }, t = [], d = /* @__PURE__ */ s(
8
- i,
3
+ import t from "../_virtual/_plugin-vue2_normalizer.js";
4
+ var s = function() {
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.Toaster)], 1);
7
+ }, a = [], n = /* @__PURE__ */ t(
8
+ o,
9
+ s,
9
10
  a,
10
- t,
11
11
  !1,
12
12
  null,
13
- "9fa9554d"
13
+ "09c28ccc"
14
14
  );
15
- const u = d.exports;
15
+ const v = n.exports;
16
16
  export {
17
- u as default
17
+ v as default
18
18
  };
@@ -1,22 +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/base/Toaster.vue.js";
7
- import B from "./organisms/header/HeaderWrapper.vue.js";
8
- import F from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
9
- import { useStripoApi as H } from "../services/stripoApi.js";
10
- import { useDynamicContentStore as K } from "../stores/dynamic-content.js";
11
- import { useEditorStore as R } from "../stores/editor.js";
12
- import { usePreviewStore as j } from "../stores/preview.js";
13
- import q from "../node_modules/lodash-es/merge.js";
14
- const se = /* @__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({
15
13
  __name: "Guido",
16
14
  props: {
17
15
  templateId: null,
18
16
  userId: null,
19
- messageType: null,
20
17
  partnerName: null,
21
18
  productType: null,
22
19
  username: null,
@@ -26,34 +23,29 @@ const se = /* @__PURE__ */ I({
26
23
  guidoConfig: null
27
24
  },
28
25
  emits: ["dynamic-content:open", "back", "save:start", "save:complete"],
29
- setup(b, { expose: E, emit: t }) {
30
- const o = b, T = P(
26
+ setup(S, { expose: b, emit: t }) {
27
+ const o = S, w = E(
31
28
  () => import("./organisms/email-preview/PreviewContainer.vue.js")
32
- ), n = K(), c = R(), a = _(() => c.hasChanges), r = o.preselectedDynamicContentList || [], { getPartnerName: m, getProductType: d } = N(), G = j(), {
33
- templateId: l,
34
- userId: u,
35
- guidoConfig: p,
36
- html: f = "",
37
- css: g = "",
38
- partnerName: s = m(),
39
- productType: i = d(),
40
- messageType: y = M,
41
- 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
42
38
  } = o;
43
- window.GuidoConfig = q(W, p), window.GuidoConfig.partner = {
44
- partnerName: s,
45
- productType: i,
46
- messageType: y
47
- };
48
- const { initPlugin: v } = U({
49
- emailId: l,
50
- userId: u,
51
- username: C,
52
- partnerName: s,
53
- productType: i,
54
- preselectedDynamicContentList: r
55
- }), { getDefaultTemplate: w } = H();
56
- 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
+ _({
57
49
  onBack: () => {
58
50
  console.debug("guido:back"), t("back");
59
51
  },
@@ -61,42 +53,45 @@ const se = /* @__PURE__ */ I({
61
53
  console.debug("guido:save:start"), t("save:start");
62
54
  },
63
55
  onSaveComplete: (e) => {
64
- 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
+ });
65
63
  }
66
64
  });
67
- const D = (e) => {
65
+ const C = (e) => {
68
66
  console.debug("dynamic-content:close", e), n.setSelectedDynamicContent(e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
69
- }, S = () => {
67
+ }, v = () => {
70
68
  console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
71
69
  };
72
- return L(async () => {
70
+ return P(async () => {
73
71
  console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
74
72
  try {
75
73
  let e = {
76
- html: f,
77
- css: g,
74
+ html: d,
75
+ css: l,
78
76
  forceRecreate: !0
79
77
  // TODO: It should be false for old templates. We will communicate with Stripo
80
78
  };
81
- e.html || (e = await w()), await v(e), n.selectedDynamicContentList = r;
79
+ e.html || (e = await g()), await f(e), n.selectedDynamicContentList = c;
82
80
  } catch (e) {
83
81
  console.error("Failed to initialize Stripo editor:", e);
84
82
  }
85
83
  document.addEventListener("dynamic-content:open", (e) => {
86
- const h = e;
87
- 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);
88
86
  });
89
- }), k(() => {
90
- window.UIEditor.removeEditor();
91
- }), E({
87
+ }), b({
92
88
  dynamicContent: {
93
- insert: D,
94
- close: S
95
- },
96
- hasChanges: a
97
- }), { __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: f, css: g, partnerName: s, productType: i, messageType: y, username: C, emit: t, initPlugin: v, getDefaultTemplate: w, insertDynamicContent: D, closeDynamicContent: S, Toaster: z, HeaderWrapper: B, SaveAsTemplateDrawer: F };
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 };
98
93
  }
99
94
  });
100
95
  export {
101
- se as default
96
+ V as default
102
97
  };
@@ -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,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
  };
@@ -1,11 +1,16 @@
1
- import { DefaultProductType as e, ProductIds as o } from "../enums/defaults.js";
2
- const c = () => ({
3
- getPartnerName: () => window.location.hostname.split(".")[0] || "",
4
- getProductType: () => {
5
- const t = window.location.pathname.split("/").filter(Boolean)[0] || e;
6
- return o[t] || 0;
7
- }
8
- });
1
+ import { DefaultProductType as o } from "../enums/defaults.js";
2
+ const p = () => {
3
+ const e = {
4
+ email: "newsletter"
5
+ };
6
+ return {
7
+ getPartnerName: () => window.location.hostname.split(".")[0] || "",
8
+ getProductType: () => {
9
+ const t = window.location.pathname.split("/").filter(Boolean)[0] || o;
10
+ return e[t] || t;
11
+ }
12
+ };
13
+ };
9
14
  export {
10
- c as usePartner
15
+ p as usePartner
11
16
  };