@useinsider/guido 3.17.0-beta.8dc8fbb → 3.17.0-beta.a0d17c2

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 (89) hide show
  1. package/README.md +1 -0
  2. package/dist/@types/config/schemas.js +7 -6
  3. package/dist/components/Guido.vue.js +10 -10
  4. package/dist/components/Guido.vue2.js +82 -76
  5. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +21 -0
  6. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +106 -0
  7. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.js +17 -0
  8. package/dist/components/organisms/extensions/recommendation/RemoveStrategyModal.vue2.js +57 -0
  9. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.js +19 -0
  10. package/dist/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue2.js +63 -0
  11. package/dist/composables/useCustomInterfaceAppearance.js +52 -38
  12. package/dist/composables/useRecommendation.js +41 -34
  13. package/dist/composables/useStripo.js +14 -14
  14. package/dist/config/i18n/en/labels.json.js +1 -1
  15. package/dist/config/migrator/index.js +9 -8
  16. package/dist/config/migrator/recommendation/compositionMapper.js +20 -20
  17. package/dist/config/migrator/recommendation/extractors.js +29 -24
  18. package/dist/config/migrator/recommendation/htmlBuilder.js +116 -130
  19. package/dist/config/migrator/recommendation/settingsMapper.js +17 -17
  20. package/dist/config/migrator/recommendationMigrator.js +31 -25
  21. package/dist/config/migrator/recommendationTitleMigrator.js +119 -0
  22. package/dist/enums/academy.js +2 -1
  23. package/dist/enums/date.js +5 -3
  24. package/dist/enums/extensions/recommendationBlock.js +3 -1
  25. package/dist/extensions/Blocks/Recommendation/block.js +26 -21
  26. package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +1 -1
  27. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
  28. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +29 -27
  29. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +34 -28
  30. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +309 -236
  31. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +246 -186
  32. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +124 -0
  33. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +1 -0
  34. package/dist/extensions/Blocks/Recommendation/controls/title/index.js +44 -0
  35. package/dist/extensions/Blocks/Recommendation/extension.js +31 -29
  36. package/dist/extensions/Blocks/Recommendation/services/configService.js +54 -36
  37. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +23 -4
  38. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +175 -79
  39. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +3 -3
  40. package/dist/extensions/Blocks/Recommendation/templates/titleRows.js +33 -0
  41. package/dist/extensions/Blocks/Recommendation/templates/utils.js +85 -107
  42. package/dist/extensions/Blocks/Recommendation/utils/nodeConfigWriter.js +22 -0
  43. package/dist/extensions/Blocks/common-control.js +22 -19
  44. package/dist/guido.css +1 -1
  45. package/dist/services/recommendationApi.js +69 -30
  46. package/dist/src/@types/config/schemas.d.ts +2 -0
  47. package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +3 -0
  48. package/dist/src/components/organisms/extensions/recommendation/RemoveStrategyModal.vue.d.ts +2 -0
  49. package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBoxContent.vue.d.ts +15 -0
  50. package/dist/src/composables/useConfig.d.ts +2 -0
  51. package/dist/src/composables/useRecommendation.d.ts +1 -0
  52. package/dist/src/config/migrator/recommendation/extractors.d.ts +8 -0
  53. package/dist/src/config/migrator/recommendationTitleMigrator.d.ts +5 -0
  54. package/dist/src/enums/academy.d.ts +1 -0
  55. package/dist/src/enums/date.d.ts +1 -0
  56. package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -0
  57. package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +2 -1
  58. package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +7 -0
  59. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +3 -6
  60. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +2 -2
  61. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +10 -0
  62. package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +11 -0
  63. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +1 -0
  64. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +44 -8
  65. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +16 -0
  66. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +1 -0
  67. package/dist/src/extensions/Blocks/Recommendation/controls/title/index.d.ts +86 -0
  68. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +12 -1
  69. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +176 -10
  70. package/dist/src/extensions/Blocks/Recommendation/templates/titleRows.d.ts +13 -0
  71. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +7 -0
  72. package/dist/src/extensions/Blocks/Recommendation/utils/nodeConfigWriter.d.ts +31 -0
  73. package/dist/src/extensions/Blocks/common-control.d.ts +4 -1
  74. package/dist/src/mock/api/recommendation-strategies.d.ts +2 -0
  75. package/dist/src/services/recommendationApi.d.ts +4 -1
  76. package/dist/src/stores/config.d.ts +18 -0
  77. package/dist/src/stores/save-as-template.d.ts +4 -3
  78. package/dist/src/utils/genericUtil.d.ts +5 -0
  79. package/dist/static/assets/icons/line-change.svg.js +5 -0
  80. package/dist/static/assets/icons/line-delete.svg.js +5 -0
  81. package/dist/static/assets/icons/line-plus.svg.js +5 -0
  82. package/dist/static/styles/components/recommendation-strategy.css.js +155 -0
  83. package/dist/static/styles/customEditorStyle.css.js +3 -1
  84. package/dist/utils/dateUtil.js +23 -10
  85. package/dist/utils/genericUtil.js +57 -59
  86. package/dist/utils/templatePreparation.js +35 -34
  87. package/package.json +2 -1
  88. package/dist/src/utils/liquidDynamicContent.d.ts +0 -20
  89. package/dist/utils/liquidDynamicContent.js +0 -15
@@ -0,0 +1,155 @@
1
+ const n = `.strategy-control-header {
2
+ padding: 16px 16px 0;
3
+ }
4
+
5
+ .strategy-control-title {
6
+ margin: 0;
7
+ color: var(--guido-color-gray-800);
8
+ font-size: 16px;
9
+ font-weight: 600;
10
+ line-height: 24px;
11
+ }
12
+
13
+ .strategy-control-description-row {
14
+ padding: 8px 16px 16px;
15
+ }
16
+
17
+ .strategy-control-description {
18
+ margin: 0;
19
+ color: var(--guido-color-gray-600);
20
+ font-size: 13px;
21
+ line-height: 16px;
22
+ }
23
+
24
+ .strategy-control-description a {
25
+ color: var(--guido-color-primary-500);
26
+ text-decoration: underline;
27
+ }
28
+
29
+ .recommendation-controls-container .container.strategy-control-cta-row {
30
+ grid-template-columns: repeat(2, minmax(0, 180px));
31
+ justify-content: start;
32
+ gap: 16px;
33
+ padding: 0 16px 16px;
34
+ }
35
+
36
+ .strategy-control-cta {
37
+ width: 100%;
38
+ }
39
+
40
+ .strategy-control-cta > .button {
41
+ display: flex;
42
+ gap: 8px;
43
+ justify-content: center;
44
+ width: 100%;
45
+ border: none;
46
+ font-size: 15px;
47
+ font-weight: 400;
48
+ line-height: 24px;
49
+ white-space: nowrap;
50
+ }
51
+
52
+ .strategy-control-cta.primary > .button:disabled,
53
+ .strategy-control-cta.primary > .button.disabled {
54
+ opacity: 1;
55
+ color: var(--guido-color-gray-800);
56
+ cursor: default;
57
+ }
58
+
59
+ .strategy-control-name-band {
60
+ display: flex;
61
+ align-items: center;
62
+ min-height: 48px;
63
+ padding: 0 16px;
64
+ background-color: var(--guido-color-gray-0);
65
+ }
66
+
67
+ .strategy-control-name {
68
+ color: var(--guido-color-gray-800);
69
+ font-size: 15px;
70
+ font-weight: 600;
71
+ line-height: 24px;
72
+ }
73
+
74
+ .strategy-control-actions {
75
+ display: flex;
76
+ align-items: center;
77
+ padding: 16px;
78
+ }
79
+
80
+ .strategy-control-action {
81
+ display: inline-flex;
82
+ align-items: center;
83
+ padding: 0;
84
+ border: none;
85
+ background: none;
86
+ font-size: 15px;
87
+ font-weight: 400;
88
+ line-height: 24px;
89
+ cursor: pointer;
90
+ }
91
+
92
+ .strategy-control-action > span {
93
+ padding: 0 8px;
94
+ }
95
+
96
+ .strategy-control-action::before,
97
+ .strategy-control-cta.on > .button::before {
98
+ content: '';
99
+ flex: none;
100
+ width: 24px;
101
+ height: 24px;
102
+ background-color: currentcolor;
103
+ mask-repeat: no-repeat;
104
+ mask-position: center;
105
+ mask-size: 24px 24px;
106
+ }
107
+
108
+ .strategy-control-action--change::before {
109
+ mask-image: var(--guido-icon-line-change);
110
+ }
111
+
112
+ .strategy-control-action--remove::before {
113
+ mask-image: var(--guido-icon-line-delete);
114
+ }
115
+
116
+ .strategy-control-cta.on > .button::before {
117
+ mask-image: var(--guido-icon-line-plus);
118
+ }
119
+
120
+ .strategy-control-action--change {
121
+ color: var(--guido-color-primary-500);
122
+ }
123
+
124
+ .strategy-control-action--remove {
125
+ color: var(--guido-color-danger-500);
126
+ }
127
+
128
+ .strategy-control-action:hover {
129
+ text-decoration: underline;
130
+ }
131
+
132
+ .recommendation-controls-container:not(.strategy-block) .strategy-control-container,
133
+ .recommendation-controls-container.strategy-block .product-count-control-container,
134
+ .recommendation-controls-container.strategy-block .algorithm-control-container,
135
+ .recommendation-controls-container.strategy-block .filters-control-container,
136
+ .recommendation-controls-container.strategy-block .shuffle-control-container {
137
+ display: none;
138
+ }
139
+
140
+ .recommendation-controls-container.strategy-block {
141
+ display: flex;
142
+ flex-direction: column;
143
+ }
144
+
145
+ .recommendation-controls-container.strategy-block .price-placement-control-container {
146
+ order: 1;
147
+ }
148
+
149
+ .recommendation-controls-container.strategy-block .product-layout-control-container {
150
+ order: 2;
151
+ }
152
+ `;
153
+ export {
154
+ n as default
155
+ };
@@ -43,7 +43,9 @@ const n = `.esd-x,
43
43
  .recommendation-block-v2 .product-omnibus-discount ue-node-actions,
44
44
  .recommendation-block-v2 .product-omnibus-discount ue-node-panel,
45
45
  .recommendation-block-v2 .product-button ue-node-actions,
46
- .recommendation-block-v2 .product-button ue-node-panel {
46
+ .recommendation-block-v2 .product-button ue-node-panel,
47
+ .recommendation-block-v2 .ins-recommendation-title ue-node-actions,
48
+ .recommendation-block-v2 .ins-recommendation-title ue-node-panel {
47
49
  display: none !important;
48
50
  }
49
51
 
@@ -1,10 +1,19 @@
1
- import { DEFAULT_LOCALE as r, DEFAULT as o } from "../enums/date.js";
2
- const c = () => {
1
+ import { DEFAULT_LOCALE as n, DEFAULT as a, DEFAULT_TZ as c } from "../enums/date.js";
2
+ const m = (t) => t ? t instanceof Date ? t : typeof t == "string" ? t.length === 10 && !Number.isNaN(Number(t)) ? new Date(Number(t) * 1e3) : new Date(t) : typeof t == "number" ? t.toString().length === 10 ? new Date(t * 1e3) : new Date(t) : /* @__PURE__ */ new Date() : /* @__PURE__ */ new Date(), s = () => {
3
3
  const t = window.l10n;
4
- return (t == null ? void 0 : t.locale) === o ? r : (t == null ? void 0 : t.locale) || r;
5
- };
6
- new Intl.DateTimeFormat().resolvedOptions().timeZone;
7
- const i = (t) => {
4
+ return (t == null ? void 0 : t.locale) === a ? n : (t == null ? void 0 : t.locale) || n;
5
+ }, u = new Intl.DateTimeFormat().resolvedOptions().timeZone, f = () => {
6
+ const t = window.l10n;
7
+ return (t == null ? void 0 : t.timezone) || u || c;
8
+ }, D = (t, e = s(), r = f()) => {
9
+ const o = {
10
+ year: "numeric",
11
+ month: "2-digit",
12
+ day: "2-digit",
13
+ timeZone: r
14
+ }, i = m(t);
15
+ return new Intl.DateTimeFormat(e, o).format(i);
16
+ }, T = (t) => {
8
17
  if (!t)
9
18
  return "";
10
19
  const e = new Date(t);
@@ -16,9 +25,13 @@ const i = (t) => {
16
25
  second: "2-digit",
17
26
  hour12: !1
18
27
  }).format(e);
19
- }, m = (t) => t ? Math.floor(Date.now() / 1e3) >= t : !1;
28
+ }, h = (t) => t ? Math.floor(Date.now() / 1e3) >= t : !1;
20
29
  export {
21
- i as formatPatchDate,
22
- m as isAfterDate,
23
- c as locale
30
+ m as convertToDateObject,
31
+ T as formatPatchDate,
32
+ D as formatShortDate,
33
+ h as isAfterDate,
34
+ u as localTz,
35
+ s as locale,
36
+ f as timezone
24
37
  };
@@ -1,71 +1,69 @@
1
- import { formatToLiquidFilter as v, quoteArgument as b, liquidFilterToFormat as h } from "./liquidDynamicContent.js";
2
- const k = (a) => {
3
- if (!a.includes("="))
4
- return null;
5
- const [e, t] = a.split("=");
6
- return { key: e.trim(), value: t.trim() };
7
- }, c = "default:", f = (a) => {
8
- if (!a.startsWith(c))
9
- return a;
10
- const e = a.slice(c.length).trim(), t = (r) => e.length >= 2 && e.startsWith(r) && e.endsWith(r);
11
- return t('"') || t("'") ? e.slice(1, -1) : e;
12
- }, d = (a) => {
13
- const t = a.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((l) => l.trim()), [r] = t, s = {
14
- text: a.label,
15
- value: r || ""
1
+ const o = (t) => {
2
+ const a = t.value.match(/\{\{([^}]+)\}\}/)[1].split("|").map((l) => l.trim()), [s] = a, r = {
3
+ text: t.label,
4
+ value: s || ""
16
5
  };
17
- if (t.length >= 2) {
18
- const [, l, n] = t;
19
- if (l.startsWith(c))
20
- s.fallback = f(l);
21
- else {
22
- const u = h(l) ?? k(l);
23
- u ? s.format = u : n || (s.fallback = l), n && (s.fallback = f(n));
6
+ if (a.length >= 2) {
7
+ const [, l, e] = a;
8
+ if (l.startsWith("default:")) {
9
+ let n = l.slice(8).trim();
10
+ n.startsWith('"') && n.endsWith('"') && (n = n.slice(1, -1)), r.fallback = n;
11
+ } else {
12
+ const n = l.includes("=") ? { key: l.split("=")[0].trim(), value: l.split("=")[1].trim() } : null;
13
+ n ? r.format = n : e || (r.fallback = l), e && (r.fallback = e);
24
14
  }
25
15
  }
26
- return s;
27
- }, m = (a) => {
28
- const t = !Number.isNaN(Number(a)) && a.trim() !== "" ? a : b(a);
29
- return t === null ? null : `${c} ${t}`;
30
- }, g = (a) => {
31
- const e = a.format ? v(a.format) : null, t = a.fallback ? m(a.fallback) : null, r = [a.value, e, t].filter(Boolean);
16
+ return r;
17
+ }, f = (t, c = !1) => t.map((a) => {
18
+ if (a.format)
19
+ return {
20
+ label: `${a.text} | ${a.format.key}=${a.format.value}`,
21
+ value: `{{${a.value}|${a.format.key}=${a.format.value}}}`
22
+ };
23
+ if (c) {
24
+ if (!a.fallback)
25
+ return {
26
+ label: a.text,
27
+ value: `{{ ${a.value} }}`
28
+ };
29
+ const r = !Number.isNaN(Number(a.fallback)) && a.fallback.trim() !== "" ? a.fallback : `"${a.fallback}"`;
30
+ return {
31
+ label: `${a.text} | ${a.fallback}`,
32
+ value: `{{ ${a.value} | default: ${r} }}`
33
+ };
34
+ }
32
35
  return {
33
- label: [a.text, e, t && a.fallback].filter(Boolean).join(" | "),
34
- value: `{{ ${r.join(" | ")} }}`
36
+ label: a.fallback ? `${a.text} | ${a.fallback}` : a.text,
37
+ value: a.fallback ? `{{${a.value}|${a.fallback}}}` : `{{${a.value}}}`
35
38
  };
36
- }, i = (a, e = !1) => a.map((t) => e ? g(t) : t.format ? {
37
- label: `${t.text} | ${t.format.key}=${t.format.value}`,
38
- value: `{{${t.value}|${t.format.key}=${t.format.value}}}`
39
- } : {
40
- label: t.fallback ? `${t.text} | ${t.fallback}` : t.text,
41
- value: t.fallback ? `{{${t.value}|${t.fallback}}}` : `{{${t.value}}}`
42
- }), y = (a) => {
43
- const e = [], t = /* @__PURE__ */ new Set(), r = (l) => {
44
- Array.isArray(l) && l.forEach((n) => {
45
- const u = [...n.children ?? [], ...n.select_items ?? []];
46
- if (u.length > 0) {
47
- r(u);
39
+ }), b = (t) => {
40
+ const c = [], a = /* @__PURE__ */ new Set(), s = (l) => {
41
+ Array.isArray(l) && l.forEach((e) => {
42
+ const n = [...e.children ?? [], ...e.select_items ?? []];
43
+ if (n.length > 0) {
44
+ s(n);
48
45
  return;
49
46
  }
50
- const o = n.text || n.tag_text;
51
- o && n.value && !t.has(n.value) && (t.add(n.value), e.push({ text: o, value: n.value }));
47
+ const u = e.text || e.tag_text;
48
+ u && e.value && !a.has(e.value) && (a.add(e.value), c.push({ text: u, value: e.value }));
52
49
  });
53
- }, [s] = Object.values(a ?? {});
54
- return r(s), e;
55
- }, p = (a, e, t = !1) => {
56
- const r = new Set(a.map((l) => l.value)), s = e.filter((l) => r.has(l.value) ? !1 : (r.add(l.value), !0));
50
+ }, [r] = Object.values(t ?? {});
51
+ return s(r), c;
52
+ }, i = (t, c, a = !1) => {
53
+ const s = new Set(t.map((l) => l.value)), r = c.filter((l) => s.has(l.value) ? !1 : (s.add(l.value), !0));
57
54
  return [
58
- ...i(a, t),
59
- ...i(s, t)
55
+ ...f(t, a),
56
+ ...f(r, a)
60
57
  ];
61
- }, F = () => {
62
- var a;
63
- return ((a = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : a.getAttribute("content")) ?? "";
64
- };
58
+ }, v = () => {
59
+ var t;
60
+ return ((t = document.head.querySelector('meta[name="csrf-token"]')) == null ? void 0 : t.getAttribute("content")) ?? "";
61
+ }, k = (t) => typeof t == "string" ? t : typeof t == "number" ? String(t) : "";
65
62
  export {
66
- p as buildMergeTagEntries,
67
- i as dynamicContentToMergeTags,
68
- y as flattenDynamicContentList,
69
- F as getCsrfToken,
70
- d as mergeTagToDynamicContent
63
+ k as asText,
64
+ i as buildMergeTagEntries,
65
+ f as dynamicContentToMergeTags,
66
+ b as flattenDynamicContentList,
67
+ v as getCsrfToken,
68
+ o as mergeTagToDynamicContent
71
69
  };
@@ -1,7 +1,7 @@
1
1
  import { useActionsApi as k } from "../composables/useActionsApi.js";
2
2
  import { useConfig as U } from "../composables/useConfig.js";
3
3
  import { useHtmlCompiler as x } from "../composables/useHtmlCompiler.js";
4
- import { DEFAULT_CURRENCY as d, DEFAULT_NODE_CONFIG as s } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
4
+ import { DEFAULT_CURRENCY as d, DEFAULT_NODE_CONFIG as a } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
5
5
  import { useRecommendationExtensionStore as C } from "../extensions/Blocks/Recommendation/store/recommendation.js";
6
6
  import { mapLegacyStrategy as L } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMap.js";
7
7
  import { DATA_ATTRIBUTES as A } from "../extensions/Blocks/Unsubscribe/utils/constants.js";
@@ -11,20 +11,20 @@ import { useEditorStore as z } from "../stores/editor.js";
11
11
  import { useUnsubscribeStore as _ } from "../stores/unsubscribe.js";
12
12
  import { assignTrackingIds as v } from "./linkTrackingIds.js";
13
13
  function O(m) {
14
- const n = new DOMParser().parseFromString(m, "text/html").querySelectorAll(`[${A.PAGE_LIST}]`), t = [];
15
- return n.forEach((i) => {
16
- const o = i.getAttribute(A.PAGE_LIST);
14
+ const i = new DOMParser().parseFromString(m, "text/html").querySelectorAll(`[${A.PAGE_LIST}]`), t = [];
15
+ return i.forEach((s) => {
16
+ const o = s.getAttribute(A.PAGE_LIST);
17
17
  o && t.push(...R(o));
18
18
  }), [...new Set(t)];
19
19
  }
20
20
  async function M(m) {
21
- const a = new DOMParser().parseFromString(m, "text/html").querySelectorAll(".recommendation-block-v2");
22
- if (a.length === 0)
21
+ const n = new DOMParser().parseFromString(m, "text/html").querySelectorAll(".recommendation-block-v2");
22
+ if (n.length === 0)
23
23
  return;
24
- const n = C();
25
- a.forEach((t) => {
24
+ const i = C();
25
+ n.forEach((t) => {
26
26
  var r, l, g, f, c;
27
- const i = t.getAttribute("recommendation-id"), o = i ? Number(i) : NaN;
27
+ const s = t.getAttribute("recommendation-id"), o = s ? Number(s) : NaN;
28
28
  if (!Number.isFinite(o))
29
29
  return;
30
30
  const p = t.getAttribute("esd-ext-config");
@@ -42,24 +42,25 @@ async function M(m) {
42
42
  // Normalize legacy strategy keys (e.g. `mostViewed` → `mostPopular`) so
43
43
  // already-saved blocks that never re-run the migrator don't emit a
44
44
  // strategy-less campaign URL. `||` also catches '' / undefined (SD-144882).
45
- strategy: L(e.strategy) || s.strategy,
46
- language: e.language ?? s.language,
47
- size: e.size ?? s.size,
45
+ strategy: L(e.strategy) || a.strategy,
46
+ strategyId: e.strategyId ?? a.strategyId,
47
+ language: e.language ?? a.language,
48
+ size: e.size ?? a.size,
48
49
  // Spread the default arrays so each block gets a fresh reference
49
50
  // instead of sharing the singleton in DEFAULT_NODE_CONFIG.
50
- productIds: e.productIds ?? [...s.productIds],
51
- filters: e.filters ?? [...s.filters],
52
- shuffleProducts: e.shuffleProducts ?? s.shuffleProducts,
51
+ productIds: e.productIds ?? [...a.productIds],
52
+ filters: e.filters ?? [...a.filters],
53
+ shuffleProducts: e.shuffleProducts ?? a.shuffleProducts,
53
54
  currencyCode: ((r = e.currency) == null ? void 0 : r.code) ?? d.code,
54
55
  currencyAlignment: ((l = e.currency) == null ? void 0 : l.alignment) ?? d.alignment,
55
56
  currencyDecimalCount: ((g = e.currency) == null ? void 0 : g.decimalCount) ?? d.decimalCount,
56
57
  currencyDecimalSeparator: ((f = e.currency) == null ? void 0 : f.decimalSeparator) ?? d.decimalSeparator,
57
58
  currencyThousandSeparator: ((c = e.currency) == null ? void 0 : c.thousandSeparator) ?? d.thousandSeparator
58
59
  };
59
- n.seedBlockUrlConfig(o, h);
60
+ i.seedBlockUrlConfig(o, h);
60
61
  });
61
62
  try {
62
- await n.fetchRecommendationCreateData();
63
+ await i.fetchRecommendationCreateData();
63
64
  } catch (t) {
64
65
  console.warn(
65
66
  "Recommendation reference data pre-load failed; validator will skip the availability check.",
@@ -68,39 +69,39 @@ async function M(m) {
68
69
  }
69
70
  }
70
71
  const Z = () => {
71
- const m = N(), u = z(), a = _(), { getCompiledEmail: n, getTemplateData: t, updateHtmlAndCss: i } = k(), { compileHtml: o, compileAmpHtml: p } = x(), { isFeatureEnabled: e } = U();
72
+ const m = N(), u = z(), n = _(), { getCompiledEmail: i, getTemplateData: t, updateHtmlAndCss: s } = k(), { compileHtml: o, compileAmpHtml: p } = x(), { isFeatureEnabled: e } = U();
72
73
  return {
73
74
  prepareTemplateDetails: async () => {
74
75
  let { html: r, css: l, syncModulesIds: g = [] } = await t();
75
76
  if (e("linkTrackingIds"))
76
77
  try {
77
- const { html: y, changed: H, nextSeq: I } = v(r, u.trackIdSessionFloor);
78
- u.trackIdSessionFloor = I, H && (r = y, await i(y, l));
79
- } catch (y) {
80
- console.error("Tracking-id step failed, saving anyway:", y);
78
+ const { html: S, changed: F, nextSeq: H } = v(r, u.trackIdSessionFloor);
79
+ u.trackIdSessionFloor = H, F && (r = S, await s(S, l));
80
+ } catch (S) {
81
+ console.error("Tracking-id step failed, saving anyway:", S);
81
82
  }
82
- const { html: f, ampHtml: c = "", ampErrors: T = [] } = await n({
83
+ const { html: f, ampHtml: c = "", ampErrors: T = [] } = await i({
83
84
  minimize: !0,
84
85
  resetDataSavedFlag: !1
85
86
  });
86
- a.selectedUnsubscribePages.length && await a.fetchTemplates(), await M(r);
87
- const { compiledHtml: w, stats: S, appliedRules: D } = o(f), E = c && p(c).compiledHtml, P = m.getSelectedDynamicContentList, F = C(), b = O(r);
87
+ n.selectedUnsubscribePages.length && await n.fetchTemplates(), await M(r);
88
+ const { compiledHtml: I, stats: y, appliedRules: w } = o(f), D = c && p(c).compiledHtml, E = m.getSelectedDynamicContentList, P = C(), b = O(r);
88
89
  return console.debug("HTML Compilation Stats:", {
89
- originalSize: S.originalSize,
90
- compiledSize: S.compiledSize,
91
- reduction: `${S.reductionPercentage.toFixed(2)}%`,
92
- appliedRules: D,
93
- executionTime: `${S.executionTime.toFixed(2)}ms`
90
+ originalSize: y.originalSize,
91
+ compiledSize: y.compiledSize,
92
+ reduction: `${y.reductionPercentage.toFixed(2)}%`,
93
+ appliedRules: w,
94
+ executionTime: `${y.executionTime.toFixed(2)}ms`
94
95
  }), {
95
- dynamicContentList: P,
96
- compiledHtml: w,
96
+ dynamicContentList: E,
97
+ compiledHtml: I,
97
98
  rawHtml: r,
98
99
  css: l,
99
- ampHtml: E,
100
+ ampHtml: D,
100
101
  ampErrors: T,
101
102
  modules: g.map(Number),
102
103
  recommendation: {
103
- campaignUrls: F.recommendationCampaignUrls,
104
+ campaignUrls: P.recommendationCampaignUrls,
104
105
  configs: {}
105
106
  },
106
107
  unsubscribe: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.17.0-beta.8dc8fbb",
3
+ "version": "3.17.0-beta.a0d17c2",
4
4
  "description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
5
5
  "main": "./dist/guido.umd.cjs",
6
6
  "module": "./dist/library.js",
@@ -48,6 +48,7 @@
48
48
  "license": "ISC",
49
49
  "dependencies": {
50
50
  "@stripoinc/ui-editor-extensions": "3.9.0",
51
+ "@useinsider/design-system-organisms": "0.0.3-beta.d816f06",
51
52
  "@useinsider/design-system-vue": "1.5.0",
52
53
  "@vueuse/core": "11.3.0",
53
54
  "lodash-es": "4.17.21",
@@ -1,20 +0,0 @@
1
- import type { BaseDynamicContent } from '@@/Types/generic';
2
- export type DynamicContentFormat = NonNullable<BaseDynamicContent['format']>;
3
- /** Format key the dynamic-content picker sends for a custom date/time format. */
4
- export declare const TIME_FORMAT_KEY = "time-format";
5
- /** Wraps a Liquid filter argument in whichever quote style the value itself does not use. */
6
- export declare const quoteArgument: (value: string) => string | null;
7
- /**
8
- * `{ key: 'time-format', value: '%Y-%m-%d' }` -> `date: "%Y-%m-%d"`.
9
- *
10
- * Only a custom date/time strftime pattern has a Liquid equivalent. Anything else returns null so
11
- * the caller emits a plain tag rather than one that silently lost — or literally printed — its
12
- * format.
13
- * @example formatToLiquidFilter({ key: 'time-format', value: '%b %-d, %Y' }) -> date: "%b %-d, %Y"
14
- */
15
- export declare const formatToLiquidFilter: (format: DynamicContentFormat) => string | null;
16
- /**
17
- * Inverse of `formatToLiquidFilter` — reads the picker format back out of one filter segment, so a
18
- * reopened tag restores its selection in the host's format dropdown.
19
- */
20
- export declare const liquidFilterToFormat: (segment: string) => DynamicContentFormat | null;
@@ -1,15 +0,0 @@
1
- const E = "time-format", r = "date", u = new RegExp(`^${r}\\s*:\\s*(?:"([^"]*)"|'([^']*)')$`), s = /%[-_0^#]?\d*[a-zA-Z%]/, c = new RegExp(s, "g"), l = /\b(?:Y{2,4}|M{2,4}|D{1,4}|d{3,4}|H{2}|h{2}|m{2}|s{2}|S{1,3}|A|a)\b/, T = (t) => t.includes('"') ? t.includes("'") ? null : `'${t}'` : `"${t}"`, i = (t) => s.test(t) && !l.test(t.replace(c, "")), R = (t) => {
2
- if (t.key !== E || !i(t.value ?? ""))
3
- return null;
4
- const n = T(t.value);
5
- return n === null ? null : `${r}: ${n}`;
6
- }, _ = (t) => {
7
- const [, n, o] = t.match(u) ?? [], e = n ?? o;
8
- return e ? { key: E, value: e } : null;
9
- };
10
- export {
11
- E as TIME_FORMAT_KEY,
12
- R as formatToLiquidFilter,
13
- _ as liquidFilterToFormat,
14
- T as quoteArgument
15
- };