@useinsider/guido 3.30.0-beta.64ede62 → 3.30.0-beta.6972d4f

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 (25) hide show
  1. package/dist/components/organisms/email-preview/desktop-preview/DesktopPreview.vue.js +16 -11
  2. package/dist/components/organisms/email-preview/mobile-preview/ContentView.vue.js +11 -11
  3. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +51 -51
  4. package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +3 -3
  5. package/dist/composables/useAutoSave.js +13 -13
  6. package/dist/composables/useExport.js +7 -8
  7. package/dist/composables/useHtmlValidator.js +100 -102
  8. package/dist/composables/useToaster.js +10 -11
  9. package/dist/composables/useVersionHistoryApi.js +21 -22
  10. package/dist/composables/validators/useLiquidValidator.js +24 -26
  11. package/dist/config/migrator/itemsBlockMigrator.js +164 -161
  12. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +59 -64
  13. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +39 -40
  14. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +32 -33
  15. package/dist/extensions/Blocks/Recommendation/templates/utils.js +78 -79
  16. package/dist/extensions/Blocks/Recommendation/utils/compositionKeys.js +41 -50
  17. package/dist/guido.css +1 -1
  18. package/dist/package.json.js +4 -4
  19. package/dist/src/extensions/Blocks/Recommendation/utils/compositionKeys.d.ts +0 -2
  20. package/dist/src/stores/preview.d.ts +0 -3
  21. package/dist/stores/preview.js +15 -21
  22. package/dist/utils/pairProductVariables.js +98 -108
  23. package/package.json +1 -1
  24. package/dist/src/utils/ampPreviewSanitizer.d.ts +0 -5
  25. package/dist/utils/ampPreviewSanitizer.js +0 -46
@@ -1,18 +1,23 @@
1
- import t from "./DesktopPreview.vue2.js";
1
+ import o from "./DesktopPreview.vue2.js";
2
2
  /* empty css */
3
- import o from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
- var i = function() {
5
- var s = this, e = s._self._c, r = s._self._setupProxy;
6
- return e("div", { staticClass: "desktop-preview-wrapper" }, [e("p", { staticClass: "f-s-1 f-w-600 l-h-1 t-t-u t-c-53 mb-6 l-s-5" }, [s._v(" " + s._s(r.trans("email-editor.desktop-preview")) + " ")]), e("div", { ref: "containerRef", staticClass: "desktop-preview d-f f-d-c o-h s-1" }, [e(r.DesktopBrowserHeader), e("div", { staticClass: "desktop-preview__content d-f f-g-1 o-h b-c-5 min-h-0" }, [e("div", { staticClass: "f-g-1 h-1 o-h b-c-4 min-w-0" }, [r.isContainerReady ? e("iframe", { key: r.previewStore.previewSandbox, staticClass: "desktop-preview__iframe d-b w-1 h-1 b-c-4 bor-s-n", attrs: { sandbox: r.previewStore.previewSandbox, srcdoc: r.previewStore.previewHtml }, on: { load: r.onIframeLoad } }) : s._e()])])], 1)]);
7
- }, a = [], n = /* @__PURE__ */ o(
8
- t,
9
- i,
3
+ import r from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var a = function() {
5
+ var s = this, e = s._self._c, t = s._self._setupProxy;
6
+ return e("div", { staticClass: "desktop-preview-wrapper" }, [e("p", { staticClass: "f-s-1 f-w-600 l-h-1 t-t-u t-c-53 mb-6 l-s-5" }, [s._v(" " + s._s(t.trans("email-editor.desktop-preview")) + " ")]), e("div", { ref: "containerRef", staticClass: "desktop-preview d-f f-d-c o-h s-1" }, [e(t.DesktopBrowserHeader), e("div", { staticClass: "desktop-preview__content d-f f-g-1 o-h b-c-5 min-h-0" }, [e("div", { staticClass: "f-g-1 h-1 o-h b-c-4 min-w-0" }, [t.isContainerReady ? e("iframe", { staticClass: "desktop-preview__iframe d-b w-1 h-1 b-c-4 bor-s-n", attrs: { sandbox: `
7
+ allow-same-origin
8
+ allow-popups
9
+ allow-forms
10
+ allow-scripts
11
+ allow-popups-to-escape-sandbox`, srcdoc: t.previewStore.previewHtml }, on: { load: t.onIframeLoad } }) : s._e()])])], 1)]);
12
+ }, i = [], n = /* @__PURE__ */ r(
13
+ o,
10
14
  a,
15
+ i,
11
16
  !1,
12
17
  null,
13
- "f5ff6219"
18
+ "cf946232"
14
19
  );
15
- const _ = n.exports;
20
+ const f = n.exports;
16
21
  export {
17
- _ as default
22
+ f as default
18
23
  };
@@ -1,20 +1,20 @@
1
- import a from "./ContentView.vue2.js";
1
+ import e from "./ContentView.vue2.js";
2
2
  /* empty css */
3
- import r from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
- var n = function() {
5
- var t = this, s = t._self._c, e = t._self._setupProxy;
3
+ import n from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
+ var o = function() {
5
+ var t = this, s = t._self._c, a = t._self._setupProxy;
6
6
  return s("div", { staticClass: "w-1 h-1 b-c-4 d-f f-d-c" }, [s("div", { staticClass: "d-f j-c-s-b a-i-c p-2 h-6-s" }, [s("div", { staticClass: "d-f a-i-c cur-p", on: { click: function(l) {
7
7
  return t.$emit("back-to-inbox");
8
- } } }, [s(e.InIcons, { staticClass: "f-s-3 i-c-7", attrs: { name: "line-chevron-left" } }), s("span", { staticClass: "ml-2 f-s-1 f-w-400 l-h-1 t-c-7" }, [t._v(t._s(e.trans("newsletter.inbox")))])], 1), s("div", { staticClass: "d-f a-i-c" }, [s(e.InIcons, { staticClass: "i-c-52", attrs: { name: "line-chevron-down" } }), s(e.InIcons, { staticClass: "ml-1 i-c-52", attrs: { name: "line-chevron-up" } })], 1)]), s("div", { staticClass: "iframe-wrapper f-g-1 o-h" }, [s("iframe", { key: e.previewStore.previewSandbox, ref: "iframeRef", staticClass: "iframe-scaled d-b b-c-4 bor-s-n", attrs: { sandbox: e.previewStore.previewSandbox, srcdoc: e.previewStore.previewHtml }, on: { load: e.onLoad } })])]);
9
- }, i = [], c = /* @__PURE__ */ r(
10
- a,
11
- n,
8
+ } } }, [s(a.InIcons, { staticClass: "f-s-3 i-c-7", attrs: { name: "line-chevron-left" } }), s("span", { staticClass: "ml-2 f-s-1 f-w-400 l-h-1 t-c-7" }, [t._v(t._s(a.trans("newsletter.inbox")))])], 1), s("div", { staticClass: "d-f a-i-c" }, [s(a.InIcons, { staticClass: "i-c-52", attrs: { name: "line-chevron-down" } }), s(a.InIcons, { staticClass: "ml-1 i-c-52", attrs: { name: "line-chevron-up" } })], 1)]), s("div", { staticClass: "iframe-wrapper f-g-1 o-h" }, [s("iframe", { ref: "iframeRef", staticClass: "iframe-scaled d-b b-c-4 bor-s-n", attrs: { sandbox: "allow-same-origin allow-popups allow-forms allow-scripts allow-popups-to-escape-sandbox", srcdoc: a.previewStore.previewHtml }, on: { load: a.onLoad } })])]);
9
+ }, i = [], r = /* @__PURE__ */ n(
10
+ e,
11
+ o,
12
12
  i,
13
13
  !1,
14
14
  null,
15
- "a7102458"
15
+ "f255b2bb"
16
16
  );
17
- const p = c.exports;
17
+ const d = r.exports;
18
18
  export {
19
- p as default
19
+ d as default
20
20
  };
@@ -1,51 +1,51 @@
1
- import { defineComponent as N, defineAsyncComponent as E, ref as D, computed as o, watch as R } from "vue";
1
+ import { defineComponent as b, defineAsyncComponent as T, ref as w, computed as o, watch as N } from "vue";
2
2
  import "@useinsider/design-system-organisms/style";
3
- import { useToaster as P } from "../../../../composables/useToaster.js";
4
- import { useTranslations as U } from "../../../../composables/useTranslations.js";
5
- import { DOTTED_DATE_LOCALE as G } from "../../../../enums/date.js";
6
- import { URLS as M } from "../../../../enums/extensions/recommendationBlock.js";
7
- import { ToasterTypeOptions as p } from "../../../../enums/toaster.js";
8
- import { useRecommendationExtensionStore as $ } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
9
- import { commitStrategyChange as O } from "../../../../extensions/Blocks/Recommendation/utils/strategyCommit.js";
10
- import z from "./StrategyInfoBoxContent.vue.js";
11
- import { formatShortDate as H } from "../../../../utils/dateUtil.js";
12
- import { asText as g } from "../../../../utils/genericUtil.js";
13
- import { escapeHtml as f } from "../../../../utils/htmlEscape.js";
14
- import { InSkeleton as I } from "@useinsider/design-system-vue";
15
- const it = /* @__PURE__ */ N({
3
+ import { useToaster as R } from "../../../../composables/useToaster.js";
4
+ import { useTranslations as P } from "../../../../composables/useTranslations.js";
5
+ import { DOTTED_DATE_LOCALE as U } from "../../../../enums/date.js";
6
+ import { URLS as G } from "../../../../enums/extensions/recommendationBlock.js";
7
+ import { ToasterTypeOptions as u } from "../../../../enums/toaster.js";
8
+ import { useRecommendationExtensionStore as M } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
9
+ import { commitStrategyChange as E } from "../../../../extensions/Blocks/Recommendation/utils/strategyCommit.js";
10
+ import $ from "./StrategyInfoBoxContent.vue.js";
11
+ import { formatShortDate as z } from "../../../../utils/dateUtil.js";
12
+ import { asText as D } from "../../../../utils/genericUtil.js";
13
+ import { escapeHtml as H } from "../../../../utils/htmlEscape.js";
14
+ import { InSkeleton as O } from "@useinsider/design-system-vue";
15
+ const it = /* @__PURE__ */ b({
16
16
  __name: "AssignStrategyDrawer",
17
17
  setup(F) {
18
- const d = () => import("@useinsider/design-system-organisms"), S = (t, r) => ({
19
- render: (s) => s(I, { props: { sizing: { width: t, height: r } } })
20
- }), h = E({
21
- loader: async () => (await d()).OrgStrategyDetailModal,
22
- loadingComponent: S(480, 240),
18
+ const g = () => import("@useinsider/design-system-organisms"), p = (t, r) => ({
19
+ render: (s) => s(O, { props: { sizing: { width: t, height: r } } })
20
+ }), I = T({
21
+ loader: async () => (await g()).OrgStrategyDetailModal,
22
+ loadingComponent: p(480, 240),
23
23
  delay: 0
24
- }), x = E({
25
- loader: async () => (await d()).OrgStrategyDropdown
26
- }), i = "guido-edit-strategy-", A = { width: 480, height: 42 }, a = U(), e = $(), { showToaster: c } = P(), n = D(null), m = "legacy", l = D(!1), C = o(() => e.strategiesLoading || e.legacyConversionLoading), L = o(() => e.assignStrategyDrawerStatus ? a("email-editor.assign-strategy-description", { url: M.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : "");
27
- R(() => e.assignStrategyDrawerStatus, (t) => {
24
+ }), h = T({
25
+ loader: async () => (await g()).OrgStrategyDropdown
26
+ }), i = "guido-edit-strategy-", x = { width: 480, height: 42 }, a = P(), e = M(), { showToaster: c } = R(), n = w(null), d = "legacy", l = w(!1), A = o(() => e.strategiesLoading || e.legacyConversionLoading), C = o(() => e.assignStrategyDrawerStatus ? a("email-editor.assign-strategy-description", { url: G.RECOMMENDATION_STRATEGIES_PANEL_PATH }) : "");
27
+ N(() => e.assignStrategyDrawerStatus, (t) => {
28
28
  if (!t)
29
29
  return;
30
30
  const { strategyId: r } = e.recommendationConfigs;
31
- n.value = r || (e.isLegacyStrategyBlock ? m : null), l.value = !1, e.invalidateStrategies(), e.fetchStrategies().catch(() => {
31
+ n.value = r || (e.isLegacyStrategyBlock ? d : null), l.value = !1, e.invalidateStrategies(), e.fetchStrategies().catch(() => {
32
32
  c({
33
- type: p.Error,
33
+ type: u.Error,
34
34
  message: a("discovery-strategy.error-description")
35
35
  });
36
36
  });
37
37
  });
38
- const v = (t) => {
39
- const r = g(t.updated_at || t.created_at);
38
+ const f = (t) => {
39
+ const r = D(t.updated_at || t.created_at);
40
40
  if (!r)
41
41
  return "";
42
- const s = H(r, G);
42
+ const s = z(r, U);
43
43
  return a("recommendation-strategy.last-updated-on", { value: s });
44
- }, _ = o(() => ({
44
+ }, S = o(() => ({
45
45
  text: a("ds-steps.legacy-strategy"),
46
- value: m,
46
+ value: d,
47
47
  hidden: !0
48
- })), y = o(() => e.strategies.map((t) => ({
48
+ })), m = o(() => e.strategies.map((t) => ({
49
49
  text: t.name,
50
50
  value: t.strategy_id,
51
51
  infoBoxProps: {
@@ -54,10 +54,10 @@ const it = /* @__PURE__ */ N({
54
54
  variant: "information",
55
55
  size: "small",
56
56
  class: "assign-strategy-info-box",
57
- titleText: f(g(t.name)),
57
+ titleText: H(D(t.name)),
58
58
  descriptionStatus: !0,
59
- descriptionText: v(t),
60
- slot: z,
59
+ descriptionText: f(t),
60
+ slot: $,
61
61
  slotProps: { strategy: t },
62
62
  // The info box drops the option's value/text, so the id is the only channel
63
63
  // that can carry the strategy back to the click handler.
@@ -70,17 +70,17 @@ const it = /* @__PURE__ */ N({
70
70
  icon: "line-open-website"
71
71
  }]
72
72
  }
73
- }))), B = o(() => e.isLegacyStrategyBlock ? [_.value, ...y.value] : y.value), k = (t) => {
74
- var w;
75
- const r = (w = t == null ? void 0 : t.id) != null && w.startsWith(i) ? t.id.slice(i.length) : "";
73
+ }))), L = o(() => e.isLegacyStrategyBlock ? [S.value, ...m.value] : m.value), B = (t) => {
74
+ var _;
75
+ const r = (_ = t == null ? void 0 : t.id) != null && _.startsWith(i) ? t.id.slice(i.length) : "";
76
76
  if (!r)
77
77
  return;
78
- const s = e.currentRecommendationId, u = e.recommendationConfigs.strategyId === r;
79
- e.openStrategyEdit(r) && (String(n.value ?? "") === r && (n.value = null), u && (e.removeStrategy(), s !== null && O(s, "Removed recommendation strategy")));
80
- }, T = o(() => {
78
+ const s = e.currentRecommendationId, y = e.recommendationConfigs.strategyId === r;
79
+ e.openStrategyEdit(r) && (String(n.value ?? "") === r && (n.value = null), y && (e.removeStrategy(), s !== null && E(s, "Removed recommendation strategy")));
80
+ }, v = o(() => {
81
81
  const t = e.strategies.find((r) => String(r.strategy_id) === String(n.value ?? ""));
82
82
  return t ? { ...t, fallback_config: null } : null;
83
- }), b = o(() => ({
83
+ }), k = o(() => ({
84
84
  primaryButton: {
85
85
  styling: "solid",
86
86
  type: "primary",
@@ -92,10 +92,10 @@ const it = /* @__PURE__ */ N({
92
92
  labelText: a("products.cancel")
93
93
  }
94
94
  }));
95
- return { __sfc: !0, loadOrganisms: d, skeleton: S, OrgStrategyDetailModal: h, OrgStrategyDropdown: x, EDIT_BUTTON_ID_PREFIX: i, SELECT_SKELETON_SIZING: A, trans: a, store: e, showToaster: c, selectedStrategyId: n, LEGACY_OPTION_VALUE: m, showSelectionError: l, strategiesLoading: C, drawerDescription: L, lastUpdatedText: v, legacyStrategyOption: _, remoteStrategyOptions: y, strategyOptions: B, onInfoBoxButtonClick: k, selectedStrategy: T, footerButtonGroupOptions: b, closeDrawer: () => {
95
+ return { __sfc: !0, loadOrganisms: g, skeleton: p, OrgStrategyDetailModal: I, OrgStrategyDropdown: h, EDIT_BUTTON_ID_PREFIX: i, SELECT_SKELETON_SIZING: x, trans: a, store: e, showToaster: c, selectedStrategyId: n, LEGACY_OPTION_VALUE: d, showSelectionError: l, strategiesLoading: A, drawerDescription: C, lastUpdatedText: f, legacyStrategyOption: S, remoteStrategyOptions: m, strategyOptions: L, onInfoBoxButtonClick: B, selectedStrategy: v, footerButtonGroupOptions: k, closeDrawer: () => {
96
96
  e.closeAssignStrategyDrawer();
97
97
  }, assignStrategy: async () => {
98
- const t = T.value;
98
+ const t = v.value;
99
99
  if (!t) {
100
100
  l.value = !0;
101
101
  return;
@@ -103,24 +103,24 @@ const it = /* @__PURE__ */ N({
103
103
  let r = "";
104
104
  try {
105
105
  r = await e.resolveStrategyUrlTemplate(t, e.recommendationConfigs.currencySettings.value);
106
- } catch (u) {
107
- console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", u);
106
+ } catch (y) {
107
+ console.error("[AssignStrategyDrawer] resolveStrategyUrlTemplate failed", y);
108
108
  }
109
109
  if (!r) {
110
110
  c({
111
- type: p.Error,
112
- message: a("email-editor.strategy-assign-failed", { strategyName: f(g(t.name)) })
111
+ type: u.Error,
112
+ message: a("email-editor.strategy-assign-failed", { strategyName: t.name })
113
113
  });
114
114
  return;
115
115
  }
116
116
  const s = e.currentRecommendationId;
117
117
  e.assignStrategy(t), c({
118
- type: p.Success,
119
- message: a("email-editor.strategy-assigned-success", { strategyName: f(g(t.name)) })
120
- }), e.closeAssignStrategyDrawer(), s !== null && await O(s, "Assigned recommendation strategy");
118
+ type: u.Success,
119
+ message: a("email-editor.strategy-assigned-success", { strategyName: t.name })
120
+ }), e.closeAssignStrategyDrawer(), s !== null && await E(s, "Assigned recommendation strategy");
121
121
  }, onSelect: (t) => {
122
122
  n.value = t.value, l.value = !1;
123
- }, InSkeleton: I };
123
+ }, InSkeleton: O };
124
124
  }
125
125
  });
126
126
  export {
@@ -12,9 +12,9 @@ var i = function() {
12
12
  l,
13
13
  !1,
14
14
  null,
15
- "c8351f74"
15
+ "e48cebe9"
16
16
  );
17
- const u = d.exports;
17
+ const f = d.exports;
18
18
  export {
19
- u as default
19
+ f as default
20
20
  };
@@ -3,9 +3,9 @@ import { useEditorLock as y } from "./useEditorLock.js";
3
3
  import { useAutosaveStore as I, AUTOSAVE_STATUS as a } from "../stores/autosave.js";
4
4
  import { useEditorStore as L } from "../stores/editor.js";
5
5
  import { computed as w, watch as V, onUnmounted as k } from "vue";
6
- const D = 18e4, b = 6e4, _ = (g, { clearsChanges: h = () => !0 } = {}) => {
6
+ const D = 18e4, b = 6e4, U = (g, { clearsChanges: h = () => !0 } = {}) => {
7
7
  const { isFeatureEnabled: m } = p(), s = L(), t = I(), { isEditorBusy: f } = y();
8
- let o = null, l = 0, u = -1;
8
+ let i = null, l = 0, u = -1;
9
9
  const d = w(
10
10
  () => m("autosave") && t.isOn
11
11
  ), A = () => s.hasChanges && s.isInSaveableState && s.changeSeq !== u, E = () => ({
@@ -30,43 +30,43 @@ const D = 18e4, b = 6e4, _ = (g, { clearsChanges: h = () => !0 } = {}) => {
30
30
  return;
31
31
  }
32
32
  e === "visibility" && (l = Date.now()), console.debug("guido:autosave:save-start", { trigger: e }), t.status = a.SAVING;
33
- const n = s.changeSeq;
33
+ const o = s.changeSeq;
34
34
  try {
35
35
  if (await g() === void 0) {
36
36
  console.debug("guido:autosave:blocked", { trigger: e, reason: "save-returned-undefined" }), t.status = a.ERROR;
37
37
  return;
38
38
  }
39
- u = n, h() && (s.hasChanges = !1), t.status = a.SAVED, t.lastSavedAt = /* @__PURE__ */ new Date(), console.debug("guido:autosave:save-complete", { trigger: e, at: t.lastSavedAt });
39
+ u = o, h() && s.changeSeq === o && (s.hasChanges = !1), t.status = a.SAVED, t.lastSavedAt = /* @__PURE__ */ new Date(), console.debug("guido:autosave:save-complete", { trigger: e, at: t.lastSavedAt });
40
40
  } catch (S) {
41
41
  console.debug("guido:autosave:error", { trigger: e, error: S }), t.status = a.ERROR;
42
42
  }
43
- }, i = () => {
43
+ }, n = () => {
44
44
  const { visibilityState: e } = document;
45
45
  if (console.debug("guido:autosave:visibility-change", {
46
46
  visibilityState: e,
47
47
  isActive: d.value
48
48
  }), e !== "hidden")
49
49
  return;
50
- const n = Date.now() - l;
51
- if (n < b) {
50
+ const o = Date.now() - l;
51
+ if (o < b) {
52
52
  console.debug("guido:autosave:visibility-debounced", {
53
- sinceLastMs: n,
53
+ sinceLastMs: o,
54
54
  debounceMs: b
55
55
  });
56
56
  return;
57
57
  }
58
58
  r("visibility");
59
59
  }, c = () => {
60
- o && (clearInterval(o), o = null);
60
+ i && (clearInterval(i), i = null);
61
61
  }, v = () => {
62
- document.removeEventListener("visibilitychange", i), window.removeEventListener("pagehide", i);
62
+ document.removeEventListener("visibilitychange", n), window.removeEventListener("pagehide", n);
63
63
  };
64
64
  V(
65
65
  d,
66
66
  (e) => {
67
- console.debug("guido:autosave:active-changed", { active: e }), e ? (c(), o = setInterval(() => {
67
+ console.debug("guido:autosave:active-changed", { active: e }), e ? (c(), i = setInterval(() => {
68
68
  console.debug("guido:autosave:interval-tick"), r("interval");
69
- }, D), document.addEventListener("visibilitychange", i), window.addEventListener("pagehide", i)) : (c(), v(), t.status = a.IDLE);
69
+ }, D), document.addEventListener("visibilitychange", n), window.addEventListener("pagehide", n)) : (c(), v(), t.status = a.IDLE);
70
70
  },
71
71
  { immediate: !0 }
72
72
  ), k(() => {
@@ -74,5 +74,5 @@ const D = 18e4, b = 6e4, _ = (g, { clearsChanges: h = () => !0 } = {}) => {
74
74
  });
75
75
  };
76
76
  export {
77
- _ as useAutoSave
77
+ U as useAutoSave
78
78
  };
@@ -1,9 +1,8 @@
1
1
  import { ToasterTypeOptions as a } from "../enums/toaster.js";
2
- import { escapeHtml as m } from "../utils/htmlEscape.js";
3
- import { useActionsApi as p } from "./useActionsApi.js";
4
- import { useHtmlCompiler as d } from "./useHtmlCompiler.js";
5
- import { useToaster as u } from "./useToaster.js";
6
- const x = () => {
2
+ import { useActionsApi as m } from "./useActionsApi.js";
3
+ import { useHtmlCompiler as p } from "./useHtmlCompiler.js";
4
+ import { useToaster as d } from "./useToaster.js";
5
+ const H = () => {
7
6
  const c = (s, o, n) => {
8
7
  const i = new Blob([s], { type: n }), t = URL.createObjectURL(i), e = document.createElement("a");
9
8
  e.href = t, e.download = o, document.body.appendChild(e), e.click(), document.body.removeChild(e), URL.revokeObjectURL(t);
@@ -12,7 +11,7 @@ const x = () => {
12
11
  return `${s}_${n}-${i}-${t}_${e}-${r}.html`;
13
12
  };
14
13
  return { exportHtml: async (s = !0) => {
15
- const { getCompiledEmail: o } = p(), { showToaster: n } = u(), { compileHtml: i } = d();
14
+ const { getCompiledEmail: o } = m(), { showToaster: n } = d(), { compileHtml: i } = p();
16
15
  try {
17
16
  const { html: t } = await o();
18
17
  if (t) {
@@ -37,11 +36,11 @@ const x = () => {
37
36
  const e = t instanceof Error ? t.message : String(t);
38
37
  n({
39
38
  type: a.Error,
40
- message: `Error compiling email: ${m(e)}`
39
+ message: `Error compiling email: ${e}`
41
40
  });
42
41
  }
43
42
  } };
44
43
  };
45
44
  export {
46
- x as useExport
45
+ H as useExport
47
46
  };