@useinsider/guido 3.30.0-beta.1360af2 → 3.30.0-beta.164f54b

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 (27) 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/useExport.js +7 -8
  6. package/dist/composables/useHtmlValidator.js +100 -102
  7. package/dist/composables/useToaster.js +10 -11
  8. package/dist/composables/useVersionHistoryApi.js +21 -22
  9. package/dist/composables/validators/useLiquidValidator.js +24 -26
  10. package/dist/config/migrator/itemsBlockMigrator.js +164 -161
  11. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +141 -148
  12. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +53 -53
  13. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +39 -40
  14. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +26 -27
  15. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +32 -33
  16. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +22 -23
  17. package/dist/extensions/Blocks/Recommendation/templates/utils.js +78 -79
  18. package/dist/extensions/Blocks/Recommendation/utils/compositionKeys.js +41 -50
  19. package/dist/guido.css +1 -1
  20. package/dist/package.json.js +1 -1
  21. package/dist/src/extensions/Blocks/Recommendation/utils/compositionKeys.d.ts +0 -2
  22. package/dist/src/stores/preview.d.ts +0 -3
  23. package/dist/stores/preview.js +15 -21
  24. package/dist/utils/pairProductVariables.js +98 -108
  25. package/package.json +1 -1
  26. package/dist/src/utils/ampPreviewSanitizer.d.ts +0 -5
  27. package/dist/utils/ampPreviewSanitizer.js +0 -46
@@ -1,30 +1,29 @@
1
1
  import { ToasterTypeOptions as T } from "../enums/toaster.js";
2
- import { useToasterStore as c } from "../stores/toaster.js";
3
- import { escapeHtml as u } from "../utils/htmlEscape.js";
4
- import { nextTick as d } from "vue";
5
- const s = /* @__PURE__ */ new WeakMap(), l = () => {
6
- const t = c(), o = () => {
2
+ import { useToasterStore as u } from "../stores/toaster.js";
3
+ import { nextTick as c } from "vue";
4
+ const s = /* @__PURE__ */ new WeakMap(), p = () => {
5
+ const t = u(), o = () => {
7
6
  const e = s.get(t);
8
7
  e && (clearTimeout(e), s.delete(t));
9
8
  };
10
9
  function i(e = { message: "" }) {
11
- o(), t.hideToaster(), d(() => {
10
+ o(), t.hideToaster(), c(() => {
12
11
  t.showToaster(e), t.shouldAutoHide && s.set(t, setTimeout(() => {
13
12
  t.hideToaster(), o();
14
13
  }, 6e3));
15
14
  });
16
15
  }
17
- function a() {
16
+ function n() {
18
17
  o(), t.hideToaster();
19
18
  }
20
- function n(e, r) {
19
+ function a(e, r) {
21
20
  if (e != null && e.authReported)
22
21
  return;
23
22
  const m = e instanceof Error ? e.message : String(e);
24
- i({ type: T.Error, message: `${r}: ${u(m)}` });
23
+ i({ type: T.Error, message: `${r}: ${m}` });
25
24
  }
26
- return { showToaster: i, hideToaster: a, handleError: n };
25
+ return { showToaster: i, hideToaster: n, handleError: a };
27
26
  };
28
27
  export {
29
- l as useToaster
28
+ p as useToaster
30
29
  };
@@ -1,46 +1,45 @@
1
1
  import { ToasterTypeOptions as t } from "../enums/toaster.js";
2
- import { useVersionHistoryStore as w } from "../stores/version-history.js";
3
- import { escapeHtml as p } from "../utils/htmlEscape.js";
4
- import { findEditorApi as y, EDITOR_NOT_READY_MESSAGE as V } from "../utils/stripoEditorApi.js";
5
- import { useToaster as l } from "./useToaster.js";
6
- const P = () => {
7
- const n = w(), { showToaster: i } = l(), s = (e) => {
8
- var o;
9
- const r = (o = y()) == null ? void 0 : o.versionHistoryApi;
2
+ import { useVersionHistoryStore as m } from "../stores/version-history.js";
3
+ import { findEditorApi as w, EDITOR_NOT_READY_MESSAGE as y } from "../utils/stripoEditorApi.js";
4
+ import { useToaster as V } from "./useToaster.js";
5
+ const d = () => {
6
+ const n = m(), { showToaster: i } = V(), o = (e) => {
7
+ var s;
8
+ const r = (s = w()) == null ? void 0 : s.versionHistoryApi;
10
9
  if (!r) {
11
- i({ type: t.Error, message: V });
10
+ i({ type: t.Error, message: y });
12
11
  return;
13
12
  }
14
13
  e(r);
15
- }, m = (e) => {
14
+ }, p = (e) => {
16
15
  n.$reset(), n.updateState(e);
17
16
  }, a = () => {
18
17
  n.$reset();
19
18
  };
20
19
  return {
21
20
  openVersionHistory: () => {
22
- s((e) => e.openVersionHistory(m, a));
21
+ o((e) => e.openVersionHistory(p, a));
23
22
  },
24
23
  closeVersionHistory: () => {
25
- s((e) => e.closeVersionHistory());
24
+ o((e) => e.closeVersionHistory());
26
25
  },
27
26
  switchToDesktopPreview: () => {
28
- s((e) => e.switchToDesktopPreview());
27
+ o((e) => e.switchToDesktopPreview());
29
28
  },
30
29
  switchToMobilePreview: () => {
31
- s((e) => e.switchToMobilePreview());
30
+ o((e) => e.switchToMobilePreview());
32
31
  },
33
32
  previewVersion: (e) => {
34
- s((r) => r.previewVersion(e, (o) => {
35
- const c = o instanceof Error ? o.message : String(o);
33
+ o((r) => r.previewVersion(e, (s) => {
34
+ const c = s instanceof Error ? s.message : String(s);
36
35
  i({
37
36
  type: t.Error,
38
- message: `Error compiling email: ${p(c)}`
37
+ message: `Error compiling email: ${c}`
39
38
  });
40
39
  }));
41
40
  },
42
41
  restoreVersion: (e) => {
43
- s((r) => r.restoreVersion(
42
+ o((r) => r.restoreVersion(
44
43
  e,
45
44
  () => {
46
45
  i({
@@ -48,11 +47,11 @@ const P = () => {
48
47
  message: "Your version has been restored successfully."
49
48
  });
50
49
  },
51
- (o) => {
52
- const c = o instanceof Error ? o.message : String(o);
50
+ (s) => {
51
+ const c = s instanceof Error ? s.message : String(s);
53
52
  i({
54
53
  type: t.Error,
55
- message: `Error compiling email: ${p(c)}`
54
+ message: `Error compiling email: ${c}`
56
55
  });
57
56
  }
58
57
  ));
@@ -60,5 +59,5 @@ const P = () => {
60
59
  };
61
60
  };
62
61
  export {
63
- P as useVersionHistoryApi
62
+ d as useVersionHistoryApi
64
63
  };
@@ -1,44 +1,42 @@
1
- import { ToasterTypeOptions as s } from "../../enums/toaster.js";
2
- import { base64EncodeWithSpecialChars as d } from "../../utils/base64.js";
3
- import { asText as m } from "../../utils/genericUtil.js";
4
- import { escapeHtml as o } from "../../utils/htmlEscape.js";
5
- import { useHttp as p } from "../useHttp.js";
6
- import { useToaster as c } from "../useToaster.js";
7
- import { useTranslations as f } from "../useTranslations.js";
8
- const j = () => {
9
- const { post: l } = p(), { showToaster: a } = c(), i = f();
10
- return { validateLiquidSyntax: async (u) => {
1
+ import { ToasterTypeOptions as r } from "../../enums/toaster.js";
2
+ import { base64EncodeWithSpecialChars as u } from "../../utils/base64.js";
3
+ import { useHttp as d } from "../useHttp.js";
4
+ import { useToaster as p } from "../useToaster.js";
5
+ import { useTranslations as c } from "../useTranslations.js";
6
+ const v = () => {
7
+ const { post: i } = d(), { showToaster: t } = p(), s = c();
8
+ return { validateLiquidSyntax: async (o) => {
11
9
  try {
12
- const t = await l("/newsletter/contents/validate-syntax", [{
10
+ const e = await i("/newsletter/contents/validate-syntax", [{
13
11
  identifier: "default",
14
12
  syntax: "liquid",
15
13
  contents: {
16
14
  subject: null,
17
15
  preheader: null,
18
- html: d(u),
16
+ html: u(o),
19
17
  ampHtml: null
20
18
  }
21
19
  }]);
22
- if (!Array.isArray(t.data)) {
23
- const e = t.data;
24
- return a({
25
- type: s.Warning,
26
- message: typeof (e == null ? void 0 : e.message) == "string" ? o(e.message) : i("journey-builder.liquid-validation-failed")
20
+ if (!Array.isArray(e.data)) {
21
+ const l = e.data;
22
+ return t({
23
+ type: r.Warning,
24
+ message: l.message ?? s("journey-builder.liquid-validation-failed")
27
25
  }), !1;
28
26
  }
29
- const [r] = t.data, n = Object.values((r == null ? void 0 : r.errors) ?? {});
30
- return n.length ? (a({
31
- type: s.Warning,
32
- message: o(m(n[0]).replace(/^line \d+:\s*/, ""))
27
+ const [a] = e.data, n = Object.values((a == null ? void 0 : a.errors) ?? {});
28
+ return n.length ? (t({
29
+ type: r.Warning,
30
+ message: n[0].replace(/^line \d+:\s*/, "")
33
31
  }), !1) : !0;
34
- } catch (t) {
35
- return t != null && t.authReported || a({
36
- type: s.Error,
37
- message: i("journey-builder.liquid-validation-failed")
32
+ } catch (e) {
33
+ return e != null && e.authReported || t({
34
+ type: r.Error,
35
+ message: s("journey-builder.liquid-validation-failed")
38
36
  }), !1;
39
37
  }
40
38
  } };
41
39
  };
42
40
  export {
43
- j as useLiquidValidator
41
+ v as useLiquidValidator
44
42
  };