@useinsider/guido 3.30.0-beta.06d87f9 → 3.30.0-beta.1360af2

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