@useinsider/guido 3.19.0-beta.892c3ca → 3.19.0-beta.93d5923

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 (103) hide show
  1. package/README.md +0 -1
  2. package/dist/@types/config/schemas.js +118 -107
  3. package/dist/components/Guido.vue.js +9 -9
  4. package/dist/components/Guido.vue2.js +77 -69
  5. package/dist/components/organisms/AutoSaveController.vue2.js +8 -9
  6. package/dist/components/organisms/base/AuthErrorModal.vue.js +18 -0
  7. package/dist/components/organisms/base/AuthErrorModal.vue2.js +42 -0
  8. package/dist/components/organisms/header/EditorActions.vue.js +2 -2
  9. package/dist/components/organisms/header/EditorActions.vue2.js +55 -90
  10. package/dist/components/organisms/header/LeftSlot.vue.js +5 -5
  11. package/dist/components/organisms/header/LeftSlot.vue2.js +12 -16
  12. package/dist/components/wrappers/WpDrawer.vue.js +7 -9
  13. package/dist/components/wrappers/WpDrawer.vue2.js +1 -1
  14. package/dist/components/wrappers/WpModal.vue.js +1 -1
  15. package/dist/components/wrappers/WpModal.vue2.js +4 -3
  16. package/dist/composables/useAuthError.js +52 -0
  17. package/dist/composables/useAutoSave.js +11 -11
  18. package/dist/composables/useCortexBlueprintBridge.js +122 -54
  19. package/dist/composables/useEmailTemplateApplier.js +111 -50
  20. package/dist/composables/useHtmlCompiler.js +26 -37
  21. package/dist/composables/useHtmlValidator.js +0 -2
  22. package/dist/composables/useHttp.js +64 -54
  23. package/dist/composables/useLegacyStrategyConversion.js +23 -19
  24. package/dist/composables/useSave.js +45 -90
  25. package/dist/composables/useStripo.js +24 -20
  26. package/dist/composables/useToaster.js +17 -15
  27. package/dist/composables/validators/useCouponBlockValidator.js +21 -24
  28. package/dist/composables/validators/useLiquidValidator.js +15 -15
  29. package/dist/composables/validators/useUnsubscribeBlockValidator.js +27 -34
  30. package/dist/config/compiler/itemsCompilerRules.js +13 -6
  31. package/dist/config/compiler/utils/itemsCompilerUtils.js +34 -17
  32. package/dist/config/migrator/index.js +14 -13
  33. package/dist/config/migrator/itemsBlockMigrator.js +236 -248
  34. package/dist/config/migrator/recommendationMigrator.js +28 -21
  35. package/dist/config/migrator/recommendationPartnerMigrator.js +56 -0
  36. package/dist/enums/extensions/recommendationBlock.js +30 -29
  37. package/dist/extensions/Blocks/Items/constants/cardLayout.js +20 -0
  38. package/dist/extensions/Blocks/Items/controls/name/trimming.js +18 -17
  39. package/dist/extensions/Blocks/Items/controls/settingsControl.js +114 -105
  40. package/dist/extensions/Blocks/Items/enums/productEnums.js +14 -9
  41. package/dist/extensions/Blocks/Items/layouts/horizontal.html.js +11 -9
  42. package/dist/extensions/Blocks/Items/template.js +219 -204
  43. package/dist/extensions/Blocks/Recommendation/block.js +15 -14
  44. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +45 -38
  45. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +72 -49
  46. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +30 -29
  47. package/dist/extensions/Blocks/Recommendation/utils/partnerCustomizations.js +3 -1
  48. package/dist/extensions/Blocks/Recommendation/utils/partnerScope.js +25 -0
  49. package/dist/guido.css +1 -1
  50. package/dist/src/@types/config/schemas.d.ts +16 -4
  51. package/dist/src/components/Guido.vue.d.ts +1 -17
  52. package/dist/src/components/organisms/header/EditorActions.vue.d.ts +1 -17
  53. package/dist/src/components/organisms/header/HeaderWrapper.vue.d.ts +1 -17
  54. package/dist/src/components/organisms/header/RightSlot.vue.d.ts +1 -17
  55. package/dist/src/components/wrappers/WpDrawer.vue.d.ts +3 -4
  56. package/dist/src/components/wrappers/WpModal.vue.d.ts +5 -1
  57. package/dist/src/composables/useAuthError.d.ts +12 -0
  58. package/dist/src/composables/useConfig.d.ts +2 -2
  59. package/dist/src/composables/useCortexBlueprintBridge.d.ts +2 -3
  60. package/dist/src/composables/useEmailTemplateApplier.d.ts +18 -5
  61. package/dist/src/composables/useGuidoActions.d.ts +2 -0
  62. package/dist/src/composables/useHtmlValidator.d.ts +0 -21
  63. package/dist/src/composables/useHttp.d.ts +2 -0
  64. package/dist/src/composables/useSave.d.ts +1 -6
  65. package/dist/src/composables/validators/useCouponBlockValidator.d.ts +0 -3
  66. package/dist/src/composables/validators/useUnsubscribeBlockValidator.d.ts +0 -10
  67. package/dist/src/config/compiler/utils/itemsCompilerUtils.d.ts +5 -0
  68. package/dist/src/config/migrator/index.d.ts +2 -1
  69. package/dist/src/config/migrator/recommendationPartnerMigrator.d.ts +19 -0
  70. package/dist/src/enums/extensions/recommendationBlock.d.ts +1 -1
  71. package/dist/src/extensions/Blocks/Items/constants/cardLayout.d.ts +44 -0
  72. package/dist/src/extensions/Blocks/Items/enums/productEnums.d.ts +3 -0
  73. package/dist/src/extensions/Blocks/Items/template.d.ts +19 -0
  74. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
  75. package/dist/src/extensions/Blocks/Recommendation/utils/partnerScope.d.ts +33 -0
  76. package/dist/src/mock/cortexChatStore.d.ts +12 -0
  77. package/dist/src/stores/config.d.ts +20 -32
  78. package/dist/src/stores/guido-email-editor.d.ts +20 -10
  79. package/dist/src/stores/onboarding.d.ts +4 -0
  80. package/dist/src/stores/recommendation.d.ts +5 -0
  81. package/dist/src/utils/dateUtil.d.ts +10 -0
  82. package/dist/src/utils/genericUtil.d.ts +3 -0
  83. package/dist/src/utils/templatePreparation.d.ts +0 -30
  84. package/dist/static/styles/components/recommendation-strategy.css.js +9 -0
  85. package/dist/static/styles/components/version-history.css.js +2 -6
  86. package/dist/stores/config.js +67 -84
  87. package/dist/stores/guido-email-editor.js +3 -1
  88. package/dist/stores/onboarding.js +4 -0
  89. package/dist/utils/pairProductVariables.js +71 -71
  90. package/dist/utils/templatePreparation.js +36 -39
  91. package/package.json +1 -1
  92. package/dist/components/organisms/validation/ValidationErrorDrawer.vue.js +0 -20
  93. package/dist/components/organisms/validation/ValidationErrorDrawer.vue2.js +0 -49
  94. package/dist/composables/useSaveValidation.js +0 -282
  95. package/dist/composables/useSaveValidationRollout.js +0 -9
  96. package/dist/enums/save-validation.js +0 -4
  97. package/dist/src/@types/save-validation.d.ts +0 -19
  98. package/dist/src/composables/useSaveValidation.d.ts +0 -6
  99. package/dist/src/composables/useSaveValidationRollout.d.ts +0 -3
  100. package/dist/src/enums/save-validation.d.ts +0 -27
  101. package/dist/src/stores/save-validation.d.ts +0 -22
  102. package/dist/stores/save-validation.js +0 -30
  103. /package/dist/src/components/organisms/{validation/ValidationErrorDrawer.vue.d.ts → base/AuthErrorModal.vue.d.ts} +0 -0
@@ -1,13 +1,13 @@
1
- import { ToasterTypeOptions as a } from "../../enums/toaster.js";
1
+ import { ToasterTypeOptions as r } from "../../enums/toaster.js";
2
2
  import { base64EncodeWithSpecialChars as u } from "../../utils/base64.js";
3
3
  import { useHttp as d } from "../useHttp.js";
4
- import { useToaster as c } from "../useToaster.js";
5
- import { useTranslations as p } from "../useTranslations.js";
4
+ import { useToaster as p } from "../useToaster.js";
5
+ import { useTranslations as c } from "../useTranslations.js";
6
6
  const v = () => {
7
- const { post: i } = d(), { showToaster: e } = c(), s = p();
7
+ const { post: i } = d(), { showToaster: t } = p(), s = c();
8
8
  return { validateLiquidSyntax: async (o) => {
9
9
  try {
10
- const t = await i("/newsletter/contents/validate-syntax", [{
10
+ const e = await i("/newsletter/contents/validate-syntax", [{
11
11
  identifier: "default",
12
12
  syntax: "liquid",
13
13
  contents: {
@@ -17,21 +17,21 @@ const v = () => {
17
17
  ampHtml: null
18
18
  }
19
19
  }]);
20
- if (!Array.isArray(t.data)) {
21
- const l = t.data;
22
- return e({
23
- type: a.Warning,
20
+ if (!Array.isArray(e.data)) {
21
+ const l = e.data;
22
+ return t({
23
+ type: r.Warning,
24
24
  message: l.message ?? s("journey-builder.liquid-validation-failed")
25
25
  }), !1;
26
26
  }
27
- const [r] = t.data, n = Object.values((r == null ? void 0 : r.errors) ?? {});
28
- return n.length ? (e({
29
- type: a.Warning,
27
+ const [a] = e.data, n = Object.values((a == null ? void 0 : a.errors) ?? {});
28
+ return n.length ? (t({
29
+ type: r.Warning,
30
30
  message: n[0].replace(/^line \d+:\s*/, "")
31
31
  }), !1) : !0;
32
- } catch {
33
- return e({
34
- type: a.Error,
32
+ } catch (e) {
33
+ return e != null && e.authReported || t({
34
+ type: r.Error,
35
35
  message: s("journey-builder.liquid-validation-failed")
36
36
  }), !1;
37
37
  }
@@ -1,8 +1,8 @@
1
- import { ToasterTypeOptions as c } from "../../enums/toaster.js";
1
+ import { ToasterTypeOptions as i } from "../../enums/toaster.js";
2
2
  import { PAGE_TYPES as u } from "../../enums/unsubscribe.js";
3
- import { UNSUBSCRIBE_BLOCK_SELECTOR as i, DATA_ATTRIBUTES as a } from "../../extensions/Blocks/Unsubscribe/utils/constants.js";
4
- import { useToaster as p } from "../useToaster.js";
5
- import { useTranslations as l } from "../useTranslations.js";
3
+ import { UNSUBSCRIBE_BLOCK_SELECTOR as l, DATA_ATTRIBUTES as a } from "../../extensions/Blocks/Unsubscribe/utils/constants.js";
4
+ import { useToaster as E } from "../useToaster.js";
5
+ import { useTranslations as m } from "../useTranslations.js";
6
6
  const T = [
7
7
  {
8
8
  pageType: u.GLOBAL_UNSUBSCRIBE,
@@ -12,37 +12,30 @@ const T = [
12
12
  pageType: u.SUBSCRIPTION_PREFERENCE_CENTER,
13
13
  messageKey: "unsubscription-preference.duplicate-pref-center"
14
14
  }
15
- ], g = "unsubscription-preference.duplicate-both", E = "unsubscription-preference.select-page-to-continue";
16
- function m(r) {
17
- const s = new DOMParser().parseFromString(r, "text/html"), t = /* @__PURE__ */ new Map();
18
- return s.querySelectorAll(i).forEach((n) => {
19
- const e = Number(n.getAttribute(a.PAGE_TYPE));
20
- t.set(e, (t.get(e) ?? 0) + 1);
21
- }), T.filter((n) => (t.get(n.pageType) ?? 0) > 1);
22
- }
23
- function b(r) {
24
- const s = new DOMParser().parseFromString(r, "text/html");
25
- return Array.from(s.querySelectorAll(i)).filter((t) => {
26
- const n = t.getAttribute(a.PAGE_TYPE), e = t.getAttribute(a.PAGE_LIST);
27
- return !n || !e;
28
- }).length;
29
- }
30
- const y = () => {
31
- const { showToaster: r } = p(), s = l();
32
- return { validateUnsubscribeBlockUniqueness: (e) => {
33
- const o = m(e);
34
- return o.length ? (r({
35
- type: c.Error,
36
- message: s(o.length > 1 ? g : o[0].messageKey)
15
+ ], g = "unsubscription-preference.duplicate-both", b = "unsubscription-preference.select-page-to-continue", P = () => {
16
+ const { showToaster: c } = E(), p = m();
17
+ return { validateUnsubscribeBlockUniqueness: (n) => {
18
+ const o = new DOMParser().parseFromString(n, "text/html"), r = /* @__PURE__ */ new Map();
19
+ o.querySelectorAll(l).forEach((e) => {
20
+ const s = Number(e.getAttribute(a.PAGE_TYPE));
21
+ r.set(s, (r.get(s) ?? 0) + 1);
22
+ });
23
+ const t = T.filter((e) => (r.get(e.pageType) ?? 0) > 1).map((e) => e.messageKey);
24
+ return t.length ? (c({
25
+ type: i.Error,
26
+ message: p(t.length > 1 ? g : t[0])
37
27
  }), !1) : !0;
38
- }, validateUnsubscribeBlockHasTemplate: (e) => b(e) === 0 ? !0 : (r({
39
- type: c.Warning,
40
- message: s(E)
41
- }), !1) };
28
+ }, validateUnsubscribeBlockHasTemplate: (n) => {
29
+ const o = new DOMParser().parseFromString(n, "text/html");
30
+ return Array.from(o.querySelectorAll(l)).some((t) => {
31
+ const e = t.getAttribute(a.PAGE_TYPE), s = t.getAttribute(a.PAGE_LIST);
32
+ return !e || !s;
33
+ }) ? (c({
34
+ type: i.Warning,
35
+ message: p(b)
36
+ }), !1) : !0;
37
+ } };
42
38
  };
43
39
  export {
44
- E as EMPTY_BLOCK_KEY,
45
- b as countUnsubBlocksWithoutPage,
46
- m as findDuplicateUnsubPageTypes,
47
- y as useUnsubscribeBlockValidator
40
+ P as useUnsubscribeBlockValidator
48
41
  };
@@ -1,11 +1,11 @@
1
- import { pairProductVariables as o } from "../../utils/pairProductVariables.js";
2
- import { wrapHiddenPriceTdsForOutlook as r, MSO_ITEMS_HIDE_START as e, MSO_ITEMS_HIDE_END as t } from "./utils/itemsCompilerUtils.js";
3
- const a = [
1
+ import { pairProductVariables as i } from "../../utils/pairProductVariables.js";
2
+ import { wrapHiddenPriceTdsForOutlook as r, lockHorizontalItemImageWidths as t, MSO_ITEMS_HIDE_START as e, MSO_ITEMS_HIDE_END as s } from "./utils/itemsCompilerUtils.js";
3
+ const c = [
4
4
  {
5
5
  id: "pair-product-variables",
6
6
  description: "Replace product default values with template variables",
7
7
  type: "custom",
8
- processor: o,
8
+ processor: i,
9
9
  priority: 60
10
10
  // After recommendation rules (priority 50-53)
11
11
  },
@@ -20,16 +20,23 @@ const a = [
20
20
  priority: 65
21
21
  // After pair-product-variables (60), before outlook rules (70+)
22
22
  },
23
+ {
24
+ id: "lock-horizontal-item-image-widths",
25
+ description: "Pin horizontal Items thumbnails to their width so narrow rows cannot collapse them",
26
+ type: "custom",
27
+ processor: t,
28
+ priority: 66
29
+ },
23
30
  {
24
31
  id: "swap-items-mso-markers",
25
32
  // Injecting the delicate `<!-- -->` ghost token LAST (after reco minify P99
26
33
  // and reco swap P100) keeps it out of every whitespace/comment-mangling pass.
27
34
  description: "Swap Items MSO markers into [if !mso] conditional comments",
28
35
  type: "custom",
29
- processor: (i) => i.replaceAll(`<!--${e}-->`, "<!--[if !mso]><!-- -->").replaceAll(`<!--${t}-->`, "<!--<![endif]-->"),
36
+ processor: (o) => o.replaceAll(`<!--${e}-->`, "<!--[if !mso]><!-- -->").replaceAll(`<!--${s}-->`, "<!--<![endif]-->"),
30
37
  priority: 101
31
38
  }
32
39
  ];
33
40
  export {
34
- a as itemsCompilerRules
41
+ c as itemsCompilerRules
35
42
  };
@@ -1,28 +1,45 @@
1
- const p = "MSO_ITEMS_HIDE_START", E = "MSO_ITEMS_HIDE_END", u = "mso-hide:all; max-height:0; overflow:hidden; font-size:0; line-height:0;", _ = ".ins-product-cart td.horizontal-price, .ins-product-cart td.vertical-price";
2
- function T(t) {
1
+ import { DefaultConfigValues as m } from "../../../extensions/Blocks/Items/enums/settingsEnums.js";
2
+ const u = "MSO_ITEMS_HIDE_START", f = "MSO_ITEMS_HIDE_END", _ = "mso-hide:all; max-height:0; overflow:hidden; font-size:0; line-height:0;", T = ".ins-product-cart td.horizontal-price, .ins-product-cart td.vertical-price", A = ".ins-product-td td.product-image-class img[width]", I = Number(m.productImageWidth), p = (t) => t.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->");
3
+ function E(t, n) {
4
+ const r = t.match(/<!DOCTYPE[^>]*>/i);
5
+ return ((r ? `${r[0]}
6
+ ` : "") + n.documentElement.outerHTML).replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("&lt;!--{%", "{%").replaceAll("%}--&gt;", "%}");
7
+ }
8
+ function h(t) {
3
9
  if (!t.includes("vertical-price") || !t.includes("ins-product-cart"))
4
10
  return t;
5
- const i = t.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), r = new DOMParser().parseFromString(i, "text/html");
6
- let n = !1;
7
- if (r.querySelectorAll(_).forEach((e) => {
8
- var s, a;
11
+ const n = p(t), r = new DOMParser().parseFromString(n, "text/html");
12
+ let c = !1;
13
+ return r.querySelectorAll(T).forEach((e) => {
14
+ var s, l;
9
15
  const o = e.getAttribute("style") || "";
10
16
  if (!/display\s*:\s*none/i.test(o))
11
17
  return;
12
- const c = e.previousSibling;
13
- if (((c == null ? void 0 : c.nodeType) !== Node.COMMENT_NODE || c.data !== p) && ((s = e.parentNode) == null || s.insertBefore(r.createComment(p), e), (a = e.parentNode) == null || a.insertBefore(r.createComment(E), e.nextSibling)), !/mso-hide/i.test(o)) {
18
+ const i = e.previousSibling;
19
+ if (((i == null ? void 0 : i.nodeType) !== Node.COMMENT_NODE || i.data !== u) && ((s = e.parentNode) == null || s.insertBefore(r.createComment(u), e), (l = e.parentNode) == null || l.insertBefore(r.createComment(f), e.nextSibling)), !/mso-hide/i.test(o)) {
14
20
  const d = o.trim().endsWith(";") ? " " : "; ";
15
- e.setAttribute("style", `${o}${d}${u}`);
21
+ e.setAttribute("style", `${o}${d}${_}`);
16
22
  }
17
- n = !0;
18
- }), !n)
23
+ c = !0;
24
+ }), c ? E(n, r) : t;
25
+ }
26
+ function D(t) {
27
+ if (!t.includes("product-image-class"))
19
28
  return t;
20
- const l = i.match(/<!DOCTYPE[^>]*>/i);
21
- return ((l ? `${l[0]}
22
- ` : "") + r.documentElement.outerHTML).replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("&lt;!--{%", "{%").replaceAll("%}--&gt;", "%}");
29
+ const n = p(t), r = new DOMParser().parseFromString(n, "text/html");
30
+ let c = !1;
31
+ return r.querySelectorAll(A).forEach((e) => {
32
+ var d, a;
33
+ const o = ((d = e.getAttribute("width")) == null ? void 0 : d.trim()) ?? "", i = ((a = e.getAttribute("style")) == null ? void 0 : a.trim()) ?? "";
34
+ if (!/^\d+$/.test(o) || /(^|;)\s*min-width\s*:/i.test(i))
35
+ return;
36
+ const s = i && !i.endsWith(";") ? ";" : "", l = Math.min(Number(o), I);
37
+ e.setAttribute("style", `${i}${s}min-width:${l}px;max-width:${o}px`), c = !0;
38
+ }), c ? E(n, r) : t;
23
39
  }
24
40
  export {
25
- E as MSO_ITEMS_HIDE_END,
26
- p as MSO_ITEMS_HIDE_START,
27
- T as wrapHiddenPriceTdsForOutlook
41
+ f as MSO_ITEMS_HIDE_END,
42
+ u as MSO_ITEMS_HIDE_START,
43
+ D as lockHorizontalItemImageWidths,
44
+ h as wrapHiddenPriceTdsForOutlook
28
45
  };
@@ -1,16 +1,17 @@
1
- import { migrateCheckbox as t } from "./checkboxMigrator.js";
2
- import { migrateCouponBlock as i } from "./couponBlockMigrator.js";
3
- import { migrateItemsBlock as e } from "./itemsBlockMigrator.js";
4
- import { migrateProductNameLink as a } from "./productNameLinkMigrator.js";
5
- import { migrateRadioButton as n } from "./radioButtonMigrator.js";
6
- import { migrateRecommendation as c } from "./recommendationMigrator.js";
7
- import { migrateRecommendationTitle as g } from "./recommendationTitleMigrator.js";
8
- import { migrateSocialIcons as p } from "./socialIconMigrator.js";
9
- import { migrateUnsubscribe as f } from "./unsubscribeMigrator.js";
10
- const C = async (o, r = {}) => {
11
- let m = o;
12
- return m = t(m), m = n(m), m = await f(m), m = i(m), m = c(m, r), m = g(m), m = e(m), m = a(m), m = p(m), m;
1
+ import { migrateCheckbox as i } from "./checkboxMigrator.js";
2
+ import { migrateCouponBlock as e } from "./couponBlockMigrator.js";
3
+ import { migrateItemsBlock as a } from "./itemsBlockMigrator.js";
4
+ import { migrateProductNameLink as n } from "./productNameLinkMigrator.js";
5
+ import { migrateRadioButton as c } from "./radioButtonMigrator.js";
6
+ import { migrateRecommendation as g } from "./recommendationMigrator.js";
7
+ import { migrateRecommendationPartnerScope as f } from "./recommendationPartnerMigrator.js";
8
+ import { migrateRecommendationTitle as p } from "./recommendationTitleMigrator.js";
9
+ import { migrateSocialIcons as d } from "./socialIconMigrator.js";
10
+ import { migrateUnsubscribe as l } from "./unsubscribeMigrator.js";
11
+ const h = async (r, t = {}, o) => {
12
+ let m = r;
13
+ return m = i(m), m = c(m), m = await l(m), m = e(m), m = g(m, t), o && (m = f(m, o)), m = p(m), m = a(m), m = n(m), m = d(m), m;
13
14
  };
14
15
  export {
15
- C as migrate
16
+ h as migrate
16
17
  };