@useinsider/guido 1.0.0-beta.f57520c → 1.0.0-beta.f7c239e

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 (184) hide show
  1. package/README.md +21 -386
  2. package/dist/@types/generic.d.ts +25 -7
  3. package/dist/@types/http.d.ts +19 -0
  4. package/dist/App.vue.d.ts +1 -1
  5. package/dist/components/Guido.vue.d.ts +3 -17
  6. package/dist/components/Guido.vue.js +7 -7
  7. package/dist/components/Guido.vue2.js +23 -63
  8. package/dist/components/organisms/header/LeftSlot.vue.d.ts +1 -1
  9. package/dist/components/organisms/header/LeftSlot.vue.js +9 -9
  10. package/dist/components/organisms/header/LeftSlot.vue2.js +6 -10
  11. package/dist/components/organisms/header/MiddleSlot.vue.js +7 -7
  12. package/dist/components/organisms/header/MiddleSlot.vue2.js +4 -6
  13. package/dist/components/organisms/header/RightSlot.vue.js +10 -7
  14. package/dist/components/organisms/header/RightSlot.vue2.js +17 -30
  15. package/dist/components/organisms/header/ViewOptions.vue.d.ts +1 -1
  16. package/dist/components/organisms/header/version-history/VersionHistory.vue.d.ts +1 -13
  17. package/dist/components/organisms/header/version-history/VersionHistory.vue.js +7 -7
  18. package/dist/components/organisms/header/version-history/VersionHistory.vue2.js +10 -13
  19. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue.d.ts +1 -1
  20. package/dist/components/organisms/header/version-history/VersionHistoryItem.vue.js +1 -1
  21. package/dist/components/organisms/header/version-history/ViewOptions.vue.d.ts +1 -1
  22. package/dist/composables/useActionsApi.d.ts +0 -1
  23. package/dist/composables/useActionsApi.js +12 -14
  24. package/dist/composables/useApiExample.d.ts +4 -6
  25. package/dist/composables/useCustomInterfaceAppearance.js +9 -45
  26. package/dist/composables/useExport.d.ts +1 -1
  27. package/dist/composables/useExport.js +20 -35
  28. package/dist/composables/useHttp.d.ts +1 -19
  29. package/dist/composables/useStripo.js +28 -49
  30. package/dist/composables/useTemplates.d.ts +5 -0
  31. package/dist/composables/useTemplates.js +27 -0
  32. package/dist/composables/useToaster.d.ts +1 -9
  33. package/dist/composables/useTranslations.d.ts +1 -4
  34. package/dist/guido.css +1 -1
  35. package/dist/services/stripoApi.d.ts +7 -6
  36. package/dist/services/stripoApi.js +23 -44
  37. package/dist/static/editor.css.js +232 -0
  38. package/dist/static/templates/default/index.html.js +5 -0
  39. package/dist/static/templates/default/style.css.js +119 -0
  40. package/dist/stores/editor.d.ts +0 -2
  41. package/dist/stores/editor.js +3 -5
  42. package/package.json +5 -7
  43. package/dist/@types/save-as-template.d.ts +0 -11
  44. package/dist/_virtual/AddCustomFont.js +0 -4
  45. package/dist/_virtual/AiAssistantValueType.js +0 -4
  46. package/dist/_virtual/BackgroundColorBuiltInControl.js +0 -4
  47. package/dist/_virtual/BackgroundImageBuiltInControl.js +0 -4
  48. package/dist/_virtual/Block.js +0 -4
  49. package/dist/_virtual/BlockAttributes.js +0 -4
  50. package/dist/_virtual/BlockCompositionType.js +0 -4
  51. package/dist/_virtual/BlockPaddingsBuiltInControl.js +0 -4
  52. package/dist/_virtual/BlockRenderer.js +0 -4
  53. package/dist/_virtual/BlockType.js +0 -4
  54. package/dist/_virtual/BlocksPanel.js +0 -4
  55. package/dist/_virtual/BuiltInControl.js +0 -4
  56. package/dist/_virtual/BuiltInControlTypes.js +0 -4
  57. package/dist/_virtual/ButtonBorderBuiltInControl.js +0 -4
  58. package/dist/_virtual/ButtonColorBuiltInControl.js +0 -4
  59. package/dist/_virtual/ButtonFontColorBuiltInControl.js +0 -4
  60. package/dist/_virtual/ButtonInternalIndentsBuiltInControl.js +0 -4
  61. package/dist/_virtual/ButtonTextBuiltInControl.js +0 -4
  62. package/dist/_virtual/ContextAction.js +0 -4
  63. package/dist/_virtual/ContextActionType.js +0 -4
  64. package/dist/_virtual/Control.js +0 -4
  65. package/dist/_virtual/EditorStatePropertyType.js +0 -4
  66. package/dist/_virtual/Extension.js +0 -4
  67. package/dist/_virtual/ExtensionBuilder.js +0 -4
  68. package/dist/_virtual/FontFamilyBuiltInControl.js +0 -4
  69. package/dist/_virtual/LinkColorBuiltInControl.js +0 -4
  70. package/dist/_virtual/ModificationDescription.js +0 -4
  71. package/dist/_virtual/PanelPosition.js +0 -4
  72. package/dist/_virtual/PreviewDeviceMode.js +0 -4
  73. package/dist/_virtual/SettingsPanelRegistry.js +0 -4
  74. package/dist/_virtual/SettingsPanelTab.js +0 -4
  75. package/dist/_virtual/SettingsTab.js +0 -4
  76. package/dist/_virtual/StructureBorderBuiltInControl.js +0 -4
  77. package/dist/_virtual/StructurePaddingsBuiltInControl.js +0 -4
  78. package/dist/_virtual/TextColorBuiltInControl.js +0 -4
  79. package/dist/_virtual/TextLineSpacingBuiltInControl.js +0 -4
  80. package/dist/_virtual/TextSizeBuiltInControl.js +0 -4
  81. package/dist/_virtual/TextStyleBuiltInControl.js +0 -4
  82. package/dist/_virtual/UIElement.js +0 -4
  83. package/dist/_virtual/UIElementTagRegistry.js +0 -4
  84. package/dist/_virtual/UIElementType.js +0 -4
  85. package/dist/_virtual/UIElementsAttributes.js +0 -4
  86. package/dist/_virtual/index.js +0 -5
  87. package/dist/_virtual/index2.js +0 -4
  88. package/dist/components/organisms/header/version-history/RestoreButton.vue.d.ts +0 -2
  89. package/dist/components/organisms/header/version-history/RestoreButton.vue.js +0 -19
  90. package/dist/components/organisms/header/version-history/RestoreButton.vue2.js +0 -14
  91. package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue.d.ts +0 -2
  92. package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue.js +0 -20
  93. package/dist/components/organisms/save-as-template/SaveAsTemplateDrawer.vue2.js +0 -58
  94. package/dist/components/wrappers/WpDrawer.vue.d.ts +0 -63
  95. package/dist/components/wrappers/WpDrawer.vue.js +0 -25
  96. package/dist/components/wrappers/WpDrawer.vue2.js +0 -23
  97. package/dist/composables/useGuidoActions.d.ts +0 -46
  98. package/dist/composables/useGuidoActions.js +0 -37
  99. package/dist/composables/useHtmlCompiler.d.ts +0 -4
  100. package/dist/composables/useHtmlCompiler.js +0 -16
  101. package/dist/composables/useProvideInject.d.ts +0 -14
  102. package/dist/composables/useProvideInject.js +0 -17
  103. package/dist/composables/useValidation.d.ts +0 -30
  104. package/dist/composables/useValidation.js +0 -19
  105. package/dist/composables/validators/saveAsTemplate.d.ts +0 -26
  106. package/dist/composables/validators/saveAsTemplate.js +0 -21
  107. package/dist/config/compiler/htmlCompilerRules.d.ts +0 -2
  108. package/dist/config/compiler/htmlCompilerRules.js +0 -145
  109. package/dist/config/compiler/outlookCompilerRules.d.ts +0 -0
  110. package/dist/enums/displayConditions.d.ts +0 -2
  111. package/dist/enums/displayConditions.js +0 -80
  112. package/dist/extensions/DynamicContent/dynamic-content-modal.d.ts +0 -6
  113. package/dist/extensions/DynamicContent/dynamic-content-modal.js +0 -27
  114. package/dist/extensions/DynamicContent/dynamic-content.css.js +0 -24
  115. package/dist/extensions/DynamicContent/dynamic-content.d.ts +0 -16
  116. package/dist/extensions/DynamicContent/dynamic-content.js +0 -63
  117. package/dist/extensions/DynamicContent/extension.d.ts +0 -2
  118. package/dist/extensions/DynamicContent/extension.js +0 -11
  119. package/dist/mock/api/default-template.d.ts +0 -2
  120. package/dist/mock/api/template-library.d.ts +0 -2
  121. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/Extension.js +0 -51
  122. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ExtensionBuilder.js +0 -52
  123. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/Block.js +0 -41
  124. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlockRenderer.js +0 -18
  125. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/BlocksPanel.js +0 -32
  126. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/ContextAction.js +0 -18
  127. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AddCustomFont.js +0 -8
  128. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js +0 -13
  129. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockAttributes.js +0 -34
  130. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js +0 -13
  131. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js +0 -13
  132. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js +0 -104
  133. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js +0 -13
  134. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js +0 -13
  135. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js +0 -13
  136. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js +0 -13
  137. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js +0 -13
  138. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js +0 -13
  139. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementsAttributes.js +0 -45
  140. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundColorBuiltInControl.js +0 -43
  141. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BackgroundImageBuiltInControl.js +0 -46
  142. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BlockPaddingsBuiltInControl.js +0 -44
  143. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/BuiltInControl.js +0 -22
  144. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonBorderBuiltInControl.js +0 -46
  145. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonColorBuiltInControl.js +0 -46
  146. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonFontColorBuiltInControl.js +0 -45
  147. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonInternalIndentsBuiltInControl.js +0 -45
  148. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/ButtonTextBuiltInControl.js +0 -45
  149. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/Control.js +0 -20
  150. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/FontFamilyBuiltInControl.js +0 -43
  151. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/LinkColorBuiltInControl.js +0 -45
  152. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelRegistry.js +0 -18
  153. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelTab.js +0 -32
  154. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructureBorderBuiltInControl.js +0 -46
  155. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/StructurePaddingsBuiltInControl.js +0 -44
  156. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextColorBuiltInControl.js +0 -43
  157. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextLineSpacingBuiltInControl.js +0 -43
  158. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextSizeBuiltInControl.js +0 -45
  159. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/TextStyleBuiltInControl.js +0 -43
  160. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/index.js +0 -266
  161. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/modifications/ModificationDescription.js +0 -26
  162. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElement.js +0 -22
  163. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElementTagRegistry.js +0 -18
  164. package/dist/node_modules/valibot/dist/index.js +0 -157
  165. package/dist/static/styles/base.css.js +0 -11
  166. package/dist/static/styles/components/alert-message.css.js +0 -39
  167. package/dist/static/styles/components/amp-block.css.js +0 -18
  168. package/dist/static/styles/components/base-input.css.js +0 -47
  169. package/dist/static/styles/components/button-group.css.js +0 -54
  170. package/dist/static/styles/components/button.css.js +0 -106
  171. package/dist/static/styles/components/combobox.css.js +0 -49
  172. package/dist/static/styles/components/counter.css.js +0 -42
  173. package/dist/static/styles/components/dropdown-menu.css.js +0 -52
  174. package/dist/static/styles/components/narrow-panel.css.js +0 -38
  175. package/dist/static/styles/components/switcher.css.js +0 -11
  176. package/dist/static/styles/components/tabs.css.js +0 -97
  177. package/dist/static/styles/components/tools.css.js +0 -23
  178. package/dist/static/styles/components/version-history.css.js +0 -30
  179. package/dist/static/styles/components/wide-panel.css.js +0 -135
  180. package/dist/static/styles/variables.css.js +0 -23
  181. package/dist/stores/save-as-template.d.ts +0 -25
  182. package/dist/stores/save-as-template.js +0 -44
  183. package/dist/utils/htmlCompiler.d.ts +0 -12
  184. package/dist/utils/htmlCompiler.js +0 -70
@@ -1,83 +1,43 @@
1
- import { defineComponent as w, computed as D, onMounted as E } 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 P from "./organisms/header/HeaderWrapper.vue.js";
7
- import A from "./organisms/save-as-template/SaveAsTemplateDrawer.vue.js";
8
- import { useStripoApi as N } from "../services/stripoApi.js";
9
- import { useEditorStore as x } from "../stores/editor.js";
10
- const U = /* @__PURE__ */ w({
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({
11
8
  __name: "Guido",
12
9
  props: {
13
- templateId: null,
10
+ emailId: null,
14
11
  userId: null,
15
12
  partnerName: null,
16
13
  productType: null,
17
14
  username: null,
18
- html: null,
19
- css: null,
20
15
  guidoConfig: null
21
16
  },
22
- emits: ["dynamic-content:open", "back", "save:start", "save:complete"],
23
- setup(b, { expose: S, emit: t }) {
24
- const o = b, n = x(), a = D(() => n.hasChanges), { getPartnerName: c, getProductType: s } = G(), {
25
- templateId: r,
17
+ setup(d) {
18
+ const o = d, { getPartnerName: r, getProductType: t } = g(), {
19
+ emailId: n,
26
20
  userId: i,
27
- guidoConfig: d,
28
- html: l = "",
29
- css: u = "",
30
- partnerName: m = c(),
31
- productType: p = s(),
32
- username: g = T
21
+ guidoConfig: a,
22
+ partnerName: u = r(),
23
+ productType: p = t(),
24
+ username: m = C
33
25
  } = o;
34
26
  window.GuidoConfig = {
35
- ...k,
36
- ...d
27
+ ...T,
28
+ ...a
37
29
  };
38
- const { initPlugin: f } = I({ emailId: r, userId: i, username: g, partnerName: m, productType: p }), { getDefaultTemplate: y } = N();
39
- _({
40
- onBack: () => {
41
- console.debug("guido:back"), t("back");
42
- },
43
- onSaveStart: () => {
44
- console.debug("guido:save:start"), t("save:start");
45
- },
46
- onSaveComplete: (e) => {
47
- console.debug("guido:save:complete", e), t("save:complete", e);
48
- }
49
- });
50
- const v = (e) => {
51
- console.debug("dynamic-content:close", e), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: e }));
52
- }, C = () => {
53
- console.debug("dynamic-content:close", "Without Data"), document.dispatchEvent(new CustomEvent("dynamic-content:close", { detail: { text: "", value: "" } }));
54
- };
55
- return E(async () => {
56
- console.debug("Guido says happy coding 🎉"), console.debug("🚗 Ka-Chow");
30
+ const { initPlugin: l } = _({ emailId: n, userId: i, username: m, partnerName: u, productType: p }), { getDefaultTemplate: s } = y();
31
+ return c(async () => {
57
32
  try {
58
- let e = {
59
- html: l,
60
- css: u,
61
- forceRecreate: !0
62
- // TODO: It should be false for old templates. We will communicate with Stripo
63
- };
64
- e.html || (e = await y()), await f(e);
33
+ const e = await s();
34
+ await l(e);
65
35
  } catch (e) {
66
36
  console.error("Failed to initialize Stripo editor:", e);
67
37
  }
68
- document.addEventListener("dynamic-content:open", (e) => {
69
- const h = e;
70
- console.debug("dynamic-content:open", h.detail), t("dynamic-content:open", h.detail);
71
- });
72
- }), S({
73
- dynamicContent: {
74
- insert: v,
75
- close: C
76
- },
77
- hasChanges: a
78
- }), { __sfc: !0, props: o, editorStore: n, hasChanges: a, getPartnerName: c, getProductType: s, templateId: r, userId: i, guidoConfig: d, html: l, css: u, partnerName: m, productType: p, username: g, emit: t, initPlugin: f, getDefaultTemplate: y, insertDynamicContent: v, closeDynamicContent: C, HeaderWrapper: P, SaveAsTemplateDrawer: A };
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 };
79
39
  }
80
40
  });
81
41
  export {
82
- U as default
42
+ h as default
83
43
  };
@@ -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
- import n from "./LeftSlot.vue2.js";
1
+ import r from "./LeftSlot.vue2.js";
2
2
  import o from "../../../_virtual/_plugin-vue2_normalizer.js";
3
- var r = function() {
4
- var e = this, s = e._self._c, t = e._self._setupProxy;
5
- return s("div", { staticClass: "d-f a-i-c" }, [s(t.InButtonV2, { staticClass: "p-2", attrs: { id: "guido__back-button", "label-text": "Back", "left-icon": "line-arrow-left", styling: "text", type: "secondary" }, on: { click: t.handleBack } }), t.editorStore.isVersionHistoryOpen ? s(t.RestoreButton, { staticClass: "ml-3" }) : e._e()], 1);
6
- }, a = [], i = /* @__PURE__ */ o(
7
- n,
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(
8
7
  r,
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,15 +1,11 @@
1
- import { defineComponent as r } from "vue";
2
- import { useBack as e } from "../../../composables/useGuidoActions.js";
3
- import { useEditorStore as m } from "../../../stores/editor.js";
4
- import { InButtonV2 as n } from "@useinsider/design-system-vue";
5
- import s from "./version-history/RestoreButton.vue.js";
6
- const c = /* @__PURE__ */ r({
1
+ import { defineComponent as t } from "vue";
2
+ import { InButtonV2 as o } from "@useinsider/design-system-vue";
3
+ const _ = /* @__PURE__ */ t({
7
4
  __name: "LeftSlot",
8
- setup(f) {
9
- const o = m(), t = e();
10
- return { __sfc: !0, editorStore: o, handleBack: t, InButtonV2: n, RestoreButton: s };
5
+ setup(e) {
6
+ return { __sfc: !0, InButtonV2: o };
11
7
  }
12
8
  });
13
9
  export {
14
- c as default
10
+ _ as default
15
11
  };
@@ -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,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 }, on: { click: t.handleSaveAs } }), 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 }, on: { click: t.handleSave } })], 1);
6
- }, r = [], a = /* @__PURE__ */ i(
6
+ return e("div", { staticClass: "d-f header-right-slot" }, [e("div", { staticClass: "d-f" }, [t.editorStore.isVersionHistoryOpen ? e(t.VersionHistoryViewOptions) : e(t.ViewOptions)], 1), e("div", { staticClass: "d-f" }, [e(t.InButtonV2, { attrs: { id: "guido__history-button", "left-icon": "line-architect-version-history", styling: "ghost", type: "secondary", "label-text-status": !1, "selected-status": t.editorStore.isVersionHistoryOpen }, on: { click: t.handleVersionHistory } }), e(t.InButtonV2, { attrs: { id: "guido__export-button", "left-icon": "line-export", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 }, on: { click: t.exportHtml } }), e(t.InButtonV2, { attrs: { id: "guido__save-as-button", "left-icon": "line-newsletter-save-as-template", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 } }), e(t.InButtonV2, { attrs: { id: "guido__test-button", "left-icon": "line-architect-test-journey", styling: "ghost", type: "secondary", "disabled-status": t.editorStore.isVersionHistoryOpen, "label-text-status": !1 } })], 1), 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
+ "fefca98f"
13
16
  );
14
- const u = a.exports;
17
+ const f = a.exports;
15
18
  export {
16
- u as default
19
+ f as default
17
20
  };
@@ -1,37 +1,24 @@
1
- import { defineComponent as m } from "vue";
2
- import { useActionsApi as p } from "../../../composables/useActionsApi.js";
3
- import { useExport as c } from "../../../composables/useExport.js";
4
- import { useSaveStart as l, useSaveComplete as d } from "../../../composables/useGuidoActions.js";
5
- import { useVersionHistoryApi as f } from "../../../composables/useVersionHistoryApi.js";
6
- import { useEditorStore as u } from "../../../stores/editor.js";
7
- import { InButtonV2 as S } from "@useinsider/design-system-vue";
8
- const w = /* @__PURE__ */ m({
1
+ import { defineComponent as n } from "vue";
2
+ import { useExport as m } from "../../../composables/useExport.js";
3
+ import { useVersionHistoryApi as p } from "../../../composables/useVersionHistoryApi.js";
4
+ import { useEditorStore as f } from "../../../stores/editor.js";
5
+ import { useVersionHistoryStore as V } from "../../../stores/version-history.js";
6
+ import { InButtonV2 as u } from "@useinsider/design-system-vue";
7
+ import H from "./version-history/ViewOptions.vue.js";
8
+ import c from "./ViewOptions.vue.js";
9
+ const E = /* @__PURE__ */ n({
9
10
  __name: "RightSlot",
10
- setup(h) {
11
- const { exportHtml: a } = c(), { getCompiledEmail: o } = p(), r = l(), s = d(), { openVersionHistory: n, closeVersionHistory: i } = f(), e = u();
12
- return { __sfc: !0, exportHtml: a, getCompiledEmail: o, saveStart: r, saveComplete: s, openVersionHistory: n, closeVersionHistory: i, editorStore: e, handleVersionHistory: () => {
13
- if (e.isVersionHistoryOpen) {
14
- i();
11
+ setup(y) {
12
+ const { exportHtml: e } = m(), { openVersionHistory: o, closeVersionHistory: r, restoreVersion: i } = p(), t = f(), s = V();
13
+ return { __sfc: !0, exportHtml: e, openVersionHistory: o, closeVersionHistory: r, restoreVersion: i, editorStore: t, versionHistoryStore: s, handleVersionHistory: () => {
14
+ if (t.isVersionHistoryOpen) {
15
+ r();
15
16
  return;
16
17
  }
17
- n();
18
- }, handleSaveAs: () => {
19
- e.isSaveAsTemplateDrawerOpen = !0;
20
- }, handleSave: async () => {
21
- r();
22
- try {
23
- const { html: t } = await o();
24
- s({
25
- html: t || "",
26
- css: ""
27
- // CSS is embedded in HTML from Stripo
28
- });
29
- } catch (t) {
30
- console.error("Failed to get template data for save:", t);
31
- }
32
- }, InButtonV2: S };
18
+ o();
19
+ }, InButtonV2: u, VersionHistoryViewOptions: H, ViewOptions: c };
33
20
  }
34
21
  });
35
22
  export {
36
- w as default
23
+ E as default
37
24
  };
@@ -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,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
  };
@@ -3,7 +3,7 @@ type __VLS_Props = {
3
3
  date: number;
4
4
  textAlign: string;
5
5
  };
6
- 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>>>, {}>;
6
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, {}, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}>;
7
7
  export default _default;
8
8
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
9
9
  type __VLS_TypePropsToOption<T> = {
@@ -10,7 +10,7 @@ var i = function() {
10
10
  a,
11
11
  !1,
12
12
  null,
13
- "ee4b9c3f"
13
+ "0e2ff42d"
14
14
  );
15
15
  const d = n.exports;
16
16
  export {
@@ -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,5 +1,4 @@
1
1
  import { GetCompiledEmailOptions, CompiledEmailResult } from '@@/Types/actions-api';
2
2
  export declare const useActionsApi: () => {
3
3
  getCompiledEmail: (options?: GetCompiledEmailOptions) => Promise<CompiledEmailResult>;
4
- activateCustomViewStyles: (isActive?: boolean) => void;
5
4
  };
@@ -1,5 +1,5 @@
1
- const g = () => ({ getCompiledEmail: (t = {}) => new Promise((i, a) => {
2
- const s = { ...{
1
+ const d = () => ({ getCompiledEmail: (t = {}) => new Promise((a, i) => {
2
+ const m = { ...{
3
3
  minimize: !0,
4
4
  utmEntity: {
5
5
  utmSource: "",
@@ -18,21 +18,19 @@ const g = () => ({ getCompiledEmail: (t = {}) => new Promise((i, a) => {
18
18
  forseAmp: !1,
19
19
  resetDataSavedFlag: !1,
20
20
  disableLineHeightsReplace: !0
21
- }, ...t }, o = {
22
- callback: (e, m, l, n, c) => {
23
- e ? a(e) : i({
24
- html: m,
25
- ampHtml: l,
26
- ampErrors: n,
21
+ }, ...t }, s = {
22
+ callback: (e, l, n, o, c) => {
23
+ e ? i(e) : a({
24
+ html: l,
25
+ ampHtml: n,
26
+ ampErrors: o,
27
27
  displayConditions: c
28
28
  });
29
29
  },
30
- ...s
30
+ ...m
31
31
  };
32
- window.StripoEditorApi.actionsApi.compileEmail(o);
33
- }), activateCustomViewStyles: (t = !0) => {
34
- window.StripoEditorApi.actionsApi.activateCustomViewStyles(t);
35
- } });
32
+ window.StripoEditorApi.actionsApi.compileEmail(s);
33
+ }) });
36
34
  export {
37
- g as useActionsApi
35
+ d as useActionsApi
38
36
  };
@@ -1,8 +1,7 @@
1
- interface User {
2
- id: number;
3
- name: string;
4
- email: string;
5
- }
1
+ /**
2
+ * @deprecated - It's added for example purposes.
3
+ */
4
+ import type { User } from '../@types/generic';
6
5
  export declare const useApiExample: () => {
7
6
  loading: import("vue").ComputedRef<boolean>;
8
7
  error: import("vue").ComputedRef<{
@@ -60,4 +59,3 @@ export declare const useApiExample: () => {
60
59
  uploadFile: (file: File) => Promise<string>;
61
60
  clearError: () => void;
62
61
  };
63
- export {};
@@ -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,3 +1,3 @@
1
1
  export declare const useExport: () => {
2
- exportHtml: (compile?: boolean) => Promise<void>;
2
+ exportHtml: () => Promise<void>;
3
3
  };
@@ -1,45 +1,30 @@
1
1
  import { useActionsApi as l } from "./useActionsApi.js";
2
- import { useHtmlCompiler as m } from "./useHtmlCompiler.js";
3
- import { useToaster as d } from "./useToaster.js";
4
- const h = () => {
5
- const a = (s, o, r) => {
6
- const i = new Blob([s], { type: r }), t = URL.createObjectURL(i), e = document.createElement("a");
7
- e.href = t, e.download = o, document.body.appendChild(e), e.click(), document.body.removeChild(e), URL.revokeObjectURL(t);
8
- }, c = (s) => {
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
- return `${s}_${r}-${i}-${t}_${e}-${n}.html`;
2
+ import { useToaster as m } from "./useToaster.js";
3
+ const u = () => {
4
+ const a = (r, t, e) => {
5
+ const n = new Blob([r], { type: e }), s = URL.createObjectURL(n), o = document.createElement("a");
6
+ o.href = s, o.download = t, document.body.appendChild(o), o.click(), document.body.removeChild(o), URL.revokeObjectURL(s);
7
+ }, c = (r) => {
8
+ const t = /* @__PURE__ */ new Date(), e = String(t.getDate()).padStart(2, "0"), n = String(t.getMonth() + 1).padStart(2, "0"), s = t.getFullYear(), o = String(t.getHours()).padStart(2, "0"), i = String(t.getMinutes()).padStart(2, "0");
9
+ return `${r}_${e}-${n}-${s}_${o}-${i}.html`;
11
10
  };
12
- return { exportHtml: async (s = !0) => {
13
- const { getCompiledEmail: o } = l(), { showToaster: r } = d(), { compileHtml: i } = m();
11
+ return { exportHtml: async () => {
12
+ const { getCompiledEmail: r } = l(), { showToaster: t } = m();
14
13
  try {
15
- const { html: t } = await o();
16
- if (t) {
17
- let e = t;
18
- if (s) {
19
- const n = i(t);
20
- e = n.compiledHtml, console.debug("HTML Compilation Stats:", {
21
- originalSize: n.stats.originalSize,
22
- compiledSize: n.stats.compiledSize,
23
- reduction: `${n.stats.reductionPercentage.toFixed(2)}%`,
24
- appliedRules: n.appliedRules,
25
- executionTime: `${n.stats.executionTime.toFixed(2)}ms`
26
- });
27
- }
28
- a(e, c("HTML"), "text/html");
29
- } else
30
- r({
31
- type: "error",
32
- message: "No HTML content to download"
33
- });
34
- } catch (t) {
35
- const e = t instanceof Error ? t.message : String(t);
36
- r({
14
+ const { html: e } = await r();
15
+ e ? a(e, c("HTML"), "text/html") : t({
37
16
  type: "error",
38
- message: `Error compiling email: ${e}`
17
+ message: "No HTML content to download"
18
+ });
19
+ } catch (e) {
20
+ const n = e instanceof Error ? e.message : String(e);
21
+ t({
22
+ type: "error",
23
+ message: `Error compiling email: ${n}`
39
24
  });
40
25
  }
41
26
  } };
42
27
  };
43
28
  export {
44
- h as useExport
29
+ u as useExport
45
30
  };