@useinsider/guido 2.1.0-beta.42f5dfa → 2.1.0-beta.4bcb91b

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 (149) hide show
  1. package/README.md +3 -1
  2. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +14 -15
  3. package/dist/components/organisms/header/HeaderWrapper.vue.js +9 -9
  4. package/dist/composables/useHtmlValidator.js +84 -106
  5. package/dist/composables/useRecommendation.js +21 -54
  6. package/dist/composables/useSave.js +16 -12
  7. package/dist/composables/useStripo.js +58 -54
  8. package/dist/composables/useStripoEventHandler.js +27 -12
  9. package/dist/composables/useSyncModuleExtractor.js +33 -0
  10. package/dist/config/compiler/recommendationCompilerRules.js +39 -45
  11. package/dist/config/migrator/recommendationMigrator.js +2 -2
  12. package/dist/enums/extensions/recommendationBlock.js +1 -1
  13. package/dist/enums/recommendation.js +15 -16
  14. package/dist/enums/unsubscribe.js +25 -21
  15. package/dist/extensions/Blocks/Recommendation/block.js +9 -130
  16. package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +187 -0
  17. package/dist/extensions/Blocks/Recommendation/constants.js +13 -0
  18. package/dist/extensions/Blocks/Recommendation/control.js +336 -0
  19. package/dist/extensions/Blocks/Recommendation/controls/cardBackgroundColorControl.js +68 -0
  20. package/dist/extensions/Blocks/Recommendation/controls/index.js +245 -0
  21. package/dist/extensions/Blocks/Recommendation/controls/nameTextTrimControl.js +74 -0
  22. package/dist/extensions/Blocks/Recommendation/controls/{omnibusDiscount/textAfter.js → omnibusDiscountTextAfterControl.js} +14 -16
  23. package/dist/extensions/Blocks/Recommendation/controls/{omnibusDiscount/textBefore.js → omnibusDiscountTextBeforeControl.js} +14 -16
  24. package/dist/extensions/Blocks/Recommendation/controls/{omnibusPrice/textAfter.js → omnibusPriceTextAfterControl.js} +14 -16
  25. package/dist/extensions/Blocks/Recommendation/controls/{omnibusPrice/textBefore.js → omnibusPriceTextBeforeControl.js} +12 -14
  26. package/dist/extensions/Blocks/Recommendation/controls/spacingControl.js +188 -0
  27. package/dist/extensions/Blocks/Recommendation/extension.js +17 -40
  28. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +3 -19
  29. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +4 -13
  30. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +10 -21
  31. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +193 -230
  32. package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +181 -0
  33. package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +189 -0
  34. package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +209 -0
  35. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +9 -9
  36. package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +15 -26
  37. package/dist/extensions/Blocks/controlFactories.js +93 -125
  38. package/dist/guido.css +1 -1
  39. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +169 -223
  40. package/dist/services/recommendationApi.js +9 -10
  41. package/dist/services/stripoApi.js +50 -14
  42. package/dist/services/templateLibraryApi.js +13 -16
  43. package/dist/src/@types/events.d.ts +34 -2
  44. package/dist/src/components/wrappers/WpDrawer.vue.d.ts +1 -1
  45. package/dist/src/composables/useRecommendation.d.ts +0 -1
  46. package/dist/src/composables/useSyncModuleExtractor.d.ts +4 -0
  47. package/dist/src/enums/unsubscribe.d.ts +3 -0
  48. package/dist/src/extensions/Blocks/Recommendation/block.d.ts +0 -67
  49. package/dist/src/extensions/Blocks/Recommendation/{controls/cardComposition/index.d.ts → cardCompositionControl.d.ts} +3 -23
  50. package/dist/src/extensions/Blocks/Recommendation/{constants/controlIds.d.ts → constants.d.ts} +24 -0
  51. package/dist/src/extensions/Blocks/Recommendation/control.d.ts +38 -0
  52. package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +589 -21
  53. package/dist/src/extensions/Blocks/Recommendation/controls/nameTextTrimControl.d.ts +16 -0
  54. package/dist/src/extensions/Blocks/Recommendation/extension.d.ts +0 -9
  55. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +468 -131
  56. package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +16 -0
  57. package/dist/src/extensions/Blocks/Recommendation/templates/{grid/migration.d.ts → migrationTemplate.d.ts} +4 -11
  58. package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +52 -0
  59. package/dist/src/mock/api/settings.d.ts +2 -0
  60. package/dist/src/services/stripoApi.d.ts +5 -0
  61. package/dist/src/stores/editor.d.ts +23 -0
  62. package/dist/static/styles/components/notification.css.js +1 -0
  63. package/dist/static/styles/components/version-history.css.js +10 -2
  64. package/dist/static/styles/components/wide-panel.css.js +18 -2
  65. package/dist/static/styles/customEditorStyle.css.js +2 -25
  66. package/dist/stores/editor.js +2 -1
  67. package/dist/utils/pairProductVariables.js +56 -57
  68. package/dist/utils/templatePreparation.js +14 -15
  69. package/package.json +1 -1
  70. package/dist/config/compiler/utils/recommendationCompilerUtils.js +0 -116
  71. package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +0 -4
  72. package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +0 -4
  73. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +0 -65
  74. package/dist/extensions/Blocks/Recommendation/constants/layout.js +0 -20
  75. package/dist/extensions/Blocks/Recommendation/constants/selectors.js +0 -19
  76. package/dist/extensions/Blocks/Recommendation/controls/button/index.js +0 -64
  77. package/dist/extensions/Blocks/Recommendation/controls/cardBackground/index.js +0 -80
  78. package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +0 -232
  79. package/dist/extensions/Blocks/Recommendation/controls/image/index.js +0 -19
  80. package/dist/extensions/Blocks/Recommendation/controls/layout/index.js +0 -92
  81. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +0 -102
  82. package/dist/extensions/Blocks/Recommendation/controls/main/currency.js +0 -209
  83. package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +0 -52
  84. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +0 -217
  85. package/dist/extensions/Blocks/Recommendation/controls/main/locale.js +0 -70
  86. package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +0 -110
  87. package/dist/extensions/Blocks/Recommendation/controls/main/shuffle.js +0 -67
  88. package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +0 -286
  89. package/dist/extensions/Blocks/Recommendation/controls/name/index.js +0 -46
  90. package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +0 -108
  91. package/dist/extensions/Blocks/Recommendation/controls/oldPrice/index.js +0 -44
  92. package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.js +0 -48
  93. package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/index.js +0 -48
  94. package/dist/extensions/Blocks/Recommendation/controls/price/index.js +0 -44
  95. package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +0 -222
  96. package/dist/extensions/Blocks/Recommendation/services/configService.js +0 -240
  97. package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +0 -233
  98. package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +0 -251
  99. package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +0 -69
  100. package/dist/extensions/Blocks/Recommendation/templates/index.js +0 -12
  101. package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +0 -174
  102. package/dist/extensions/Blocks/Recommendation/templates/list/template.js +0 -73
  103. package/dist/extensions/Blocks/Recommendation/templates/utils.js +0 -122
  104. package/dist/extensions/Blocks/Recommendation/types/nodeConfig.js +0 -6
  105. package/dist/extensions/Blocks/Recommendation/utils/priceFormatter.js +0 -29
  106. package/dist/extensions/Blocks/Recommendation/utils/tagName.js +0 -46
  107. package/dist/src/config/compiler/utils/recommendationCompilerUtils.d.ts +0 -17
  108. package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +0 -13
  109. package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +0 -49
  110. package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +0 -13
  111. package/dist/src/extensions/Blocks/Recommendation/constants/layout.d.ts +0 -35
  112. package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +0 -31
  113. package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +0 -143
  114. package/dist/src/extensions/Blocks/Recommendation/controls/cardBackground/index.d.ts +0 -31
  115. package/dist/src/extensions/Blocks/Recommendation/controls/image/index.d.ts +0 -35
  116. package/dist/src/extensions/Blocks/Recommendation/controls/layout/index.d.ts +0 -37
  117. package/dist/src/extensions/Blocks/Recommendation/controls/main/algorithm.d.ts +0 -29
  118. package/dist/src/extensions/Blocks/Recommendation/controls/main/currency.d.ts +0 -52
  119. package/dist/src/extensions/Blocks/Recommendation/controls/main/filters.d.ts +0 -22
  120. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +0 -68
  121. package/dist/src/extensions/Blocks/Recommendation/controls/main/locale.d.ts +0 -24
  122. package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +0 -42
  123. package/dist/src/extensions/Blocks/Recommendation/controls/main/shuffle.d.ts +0 -23
  124. package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +0 -214
  125. package/dist/src/extensions/Blocks/Recommendation/controls/name/index.d.ts +0 -97
  126. package/dist/src/extensions/Blocks/Recommendation/controls/name/textTrim.d.ts +0 -34
  127. package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/index.d.ts +0 -95
  128. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.d.ts +0 -100
  129. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.d.ts +0 -15
  130. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.d.ts +0 -15
  131. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/index.d.ts +0 -100
  132. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.d.ts +0 -15
  133. package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.d.ts +0 -15
  134. package/dist/src/extensions/Blocks/Recommendation/controls/price/index.d.ts +0 -95
  135. package/dist/src/extensions/Blocks/Recommendation/controls/spacing/index.d.ts +0 -83
  136. package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +0 -151
  137. package/dist/src/extensions/Blocks/Recommendation/services/index.d.ts +0 -6
  138. package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.d.ts +0 -20
  139. package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +0 -33
  140. package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +0 -39
  141. package/dist/src/extensions/Blocks/Recommendation/templates/list/elementRenderer.d.ts +0 -8
  142. package/dist/src/extensions/Blocks/Recommendation/templates/list/migration.d.ts +0 -25
  143. package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +0 -18
  144. package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +0 -57
  145. package/dist/src/extensions/Blocks/Recommendation/types/index.d.ts +0 -7
  146. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +0 -160
  147. package/dist/src/extensions/Blocks/Recommendation/utils/priceFormatter.d.ts +0 -33
  148. package/dist/src/extensions/Blocks/Recommendation/utils/stylePreserver.d.ts +0 -113
  149. package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +0 -77
@@ -1,7 +1,7 @@
1
- import { useHttp as a } from "../composables/useHttp.js";
2
- import { URLS as s } from "../enums/extensions/recommendationBlock.js";
3
- const u = () => {
4
- const { get: o } = a();
1
+ import { useHttp as c } from "../composables/useHttp.js";
2
+ import { URLS as a } from "../enums/extensions/recommendationBlock.js";
3
+ const R = () => {
4
+ const { get: o } = c();
5
5
  return {
6
6
  fetchRecommendationCreateData: async () => {
7
7
  try {
@@ -18,15 +18,14 @@ const u = () => {
18
18
  throw console.error("fetchRecommendationFilters error:", e), e;
19
19
  }
20
20
  },
21
- fetchRecommendationProducts: async (e, c) => {
22
- var n;
21
+ fetchRecommendationProducts: async (e, n) => {
23
22
  try {
24
- const t = decodeURIComponent(new URLSearchParams(Object.entries(c)).toString());
23
+ const t = decodeURIComponent(new URLSearchParams(Object.entries(n)).toString());
25
24
  console.debug("🏁 Recommendation API Query:", t);
26
25
  const r = await o(
27
- `${s.RECOMMENDATION_API_URL}/v2/${e}?${t}`
26
+ `${a.RECOMMENDATION_API_URL}/v2/${e}?${t}`
28
27
  );
29
- return ((n = r == null ? void 0 : r.data) == null ? void 0 : n.data) ?? [];
28
+ return (r == null ? void 0 : r.data) ?? [];
30
29
  } catch (t) {
31
30
  throw console.error("fetchRecommendationProducts error:", t), t;
32
31
  }
@@ -34,5 +33,5 @@ const u = () => {
34
33
  };
35
34
  };
36
35
  export {
37
- u as useRecommendationApi
36
+ R as useRecommendationApi
38
37
  };
@@ -1,26 +1,26 @@
1
- import { useHttp as m } from "../composables/useHttp.js";
2
- import { useToaster as i } from "../composables/useToaster.js";
1
+ import { useHttp as l } from "../composables/useHttp.js";
2
+ import { useToaster as d } from "../composables/useToaster.js";
3
3
  import { MAX_DEFAULT_TEMPLATE_ID as p } from "../enums/defaults.js";
4
- const y = () => {
5
- const { get: r } = m(), { handleError: o } = i();
4
+ const b = () => {
5
+ const { get: s, post: c } = l(), { handleError: r } = d();
6
6
  return {
7
7
  getToken: async () => {
8
8
  try {
9
- const t = Number(localStorage.getItem("ins-guido-test-instance")), { data: e } = await r(`/stripo/get-user-token?test=${t}`);
9
+ const t = Number(localStorage.getItem("ins-guido-test-instance")), { data: e } = await s(`/stripo/get-user-token?test=${t}`);
10
10
  return e.body.token;
11
11
  } catch (t) {
12
- return o(t, "Failed to fetch token"), "";
12
+ return r(t, "Failed to fetch token"), "";
13
13
  }
14
14
  },
15
15
  getCustomFonts: async () => {
16
16
  try {
17
- const { data: t = [] } = await r("/stripo/get-partner-custom-fonts");
17
+ const { data: t = [] } = await s("/stripo/get-partner-custom-fonts");
18
18
  return t.map((e) => ({
19
19
  ...e,
20
20
  active: !0
21
21
  }));
22
22
  } catch (t) {
23
- return o(t, "Failed to fetch custom fonts"), [];
23
+ return r(t, "Failed to fetch custom fonts"), [];
24
24
  }
25
25
  },
26
26
  getDefaultTemplate: async () => {
@@ -29,16 +29,52 @@ const y = () => {
29
29
  css: ""
30
30
  };
31
31
  try {
32
- const c = new URLSearchParams(window.location.search).get("default-template"), s = c ? parseInt(c) : 0, l = s >= 1 && s <= p ? s : 0, { data: n } = await r(
33
- `/stripo/default-template/${l}`
34
- ), a = typeof n == "string" ? JSON.parse(n) : n;
35
- return !a || typeof a != "object" || !("html" in a) || !("css" in a) ? t : a;
32
+ const u = new URLSearchParams(window.location.search).get("default-template"), a = u ? parseInt(u) : 0, i = a >= 1 && a <= p ? a : 0, { data: n } = await s(
33
+ `/stripo/default-template/${i}`
34
+ ), o = typeof n == "string" ? JSON.parse(n) : n;
35
+ return !o || typeof o != "object" || !("html" in o) || !("css" in o) ? t : o;
36
36
  } catch (e) {
37
- return o(e, "Failed to fetch default template"), t;
37
+ return r(e, "Failed to fetch default template"), t;
38
+ }
39
+ },
40
+ getSyncModulesStatus: async () => {
41
+ try {
42
+ const { data: t } = await s("/newsletter/settings/synchronisation-in-modules-status");
43
+ return t.status;
44
+ } catch (t) {
45
+ return r(t, "Failed to fetch sync modules status"), !1;
46
+ }
47
+ },
48
+ updateSyncModule: async (t) => {
49
+ try {
50
+ return await c(`/stripo/stripo-modules/${t.moduleId}/update`, t), !0;
51
+ } catch (e) {
52
+ return r(e, "Failed to update sync module"), !1;
53
+ }
54
+ },
55
+ getSyncModule: async (t) => {
56
+ try {
57
+ const { data: e } = await s(`/stripo/stripo-modules/${t}/get`);
58
+ return e;
59
+ } catch (e) {
60
+ return r(e, "Failed to get sync module"), {
61
+ id: 0,
62
+ stripoId: 0,
63
+ unsubscriptionPreferencePages: []
64
+ };
65
+ }
66
+ },
67
+ setSyncModuleUnsubscriptionPages: async (t) => {
68
+ if (t.length === 0)
69
+ return !0;
70
+ try {
71
+ return await c("/stripo/stripo-modules/set-unsubscription-preference-pages", t), !0;
72
+ } catch (e) {
73
+ return r(e, "Failed to set unsubscription preference pages"), !1;
38
74
  }
39
75
  }
40
76
  };
41
77
  };
42
78
  export {
43
- y as useStripoApi
79
+ b as useStripoApi
44
80
  };
@@ -3,30 +3,29 @@ import { useHttp as f } from "../composables/useHttp.js";
3
3
  import { useToaster as w } from "../composables/useToaster.js";
4
4
  import { useTranslations as b } from "../composables/useTranslations.js";
5
5
  import { EditorType as h } from "../enums/defaults.js";
6
- import { useRecommendationExtensionStore as C } from "../extensions/Blocks/Recommendation/store/recommendation.js";
7
- import { useSaveAsTemplateStore as v } from "../stores/save-as-template.js";
6
+ import { useSaveAsTemplateStore as C } from "../stores/save-as-template.js";
8
7
  import { base64EncodeWithSpecialChars as a } from "../utils/base64.js";
9
- import { useTemplatePreparation as S } from "../utils/templatePreparation.js";
10
- const R = () => {
11
- const { get: n, post: c } = f(), { handleError: o, showToaster: i } = w(), { config: l } = T(), p = b();
8
+ import { useTemplatePreparation as v } from "../utils/templatePreparation.js";
9
+ const L = () => {
10
+ const { get: m, post: n } = f(), { handleError: o, showToaster: i } = w(), { config: l } = T(), p = b();
12
11
  return {
13
12
  getCategories: async () => {
14
13
  try {
15
- const { data: e = [] } = await n("/newsletter/template-library/get-template-categories");
14
+ const { data: e = [] } = await m("/newsletter/template-library/get-template-categories");
16
15
  return e;
17
16
  } catch (e) {
18
17
  return o(e, "Failed to fetch template categories"), [];
19
18
  }
20
19
  },
21
20
  checkTemplateNameAvailability: async (e) => {
22
- const { data: { status: t = !1 } } = await n(
21
+ const { data: { status: t = !1 } } = await m(
23
22
  `/newsletter/template-library/template-name-exists?name=${e}`
24
23
  );
25
24
  return !t;
26
25
  },
27
26
  createCategory: async (e) => {
28
27
  try {
29
- const { data: { id: t } } = await c(
28
+ const { data: { id: t } } = await n(
30
29
  "/newsletter/template-library/create-category",
31
30
  { name: e }
32
31
  );
@@ -38,7 +37,7 @@ const R = () => {
38
37
  createTemplate: async () => {
39
38
  var e, t, g, y;
40
39
  try {
41
- const { prepareTemplateDetails: m } = S(), r = v(), s = await m(), u = {
40
+ const { prepareTemplateDetails: c } = v(), r = C(), s = await c(), u = {
42
41
  name: r.getTemplateName,
43
42
  categories: r.getSelectedCategoryIds,
44
43
  productId: ((t = (e = l.value) == null ? void 0 : e.partner) == null ? void 0 : t.productType) || 0,
@@ -48,9 +47,7 @@ const R = () => {
48
47
  css: a(s.css),
49
48
  unsubscriptionPreferencePageStatus: !1,
50
49
  unsubscriptionPreferencePages: [],
51
- recommendationCampaignUrls: a(
52
- C().recommendationCampaignUrls
53
- ),
50
+ recommendationCampaignUrls: a({}),
54
51
  recommendationConfigs: a({}),
55
52
  isGuido: !0,
56
53
  stripoConfig: a({
@@ -58,7 +55,7 @@ const R = () => {
58
55
  html: s.rawHtml,
59
56
  css: s.css
60
57
  })
61
- }, { data: { type: d } } = await c(
58
+ }, { data: { type: d } } = await n(
62
59
  "/newsletter/template-library/create-template",
63
60
  u
64
61
  );
@@ -79,12 +76,12 @@ const R = () => {
79
76
  ),
80
77
  type: "success"
81
78
  });
82
- } catch (m) {
83
- o(m, "Failed to create template");
79
+ } catch (c) {
80
+ o(c, "Failed to create template");
84
81
  }
85
82
  }
86
83
  };
87
84
  };
88
85
  export {
89
- R as useTemplateLibraryApi
86
+ L as useTemplateLibraryApi
90
87
  };
@@ -1,6 +1,38 @@
1
- export type StripoEventType = 'save' | 'export' | 'close' | 'autosave' | 'publish' | 'export:requested' | 'export:ready';
1
+ export type StripoEventType = 'save' | 'export' | 'close' | 'autosave' | 'publish' | 'export:requested' | 'export:ready' | 'module_updated' | 'module_dropped';
2
+ export interface ModuleUpdatedParams {
3
+ target: string;
4
+ blockType: string;
5
+ moduleId: number;
6
+ moduleCategory: string | null;
7
+ syncModule: boolean;
8
+ }
9
+ export interface ModuleDroppedParams {
10
+ target: string;
11
+ blockType: string;
12
+ moduleId: number;
13
+ syncModule: boolean;
14
+ }
15
+ export interface SyncModuleUnsubscribePayload {
16
+ stripoModuleId: string;
17
+ unsubscriptionPreferencePages: number[];
18
+ type: string;
19
+ }
20
+ export interface SyncModuleResponse {
21
+ id: number;
22
+ stripoId: number;
23
+ unsubscriptionPreferencePages: UnsubscriptionPreferencePage[];
24
+ }
25
+ export interface UnsubscriptionPreferencePage {
26
+ id: number;
27
+ name: string;
28
+ type: number;
29
+ status: number;
30
+ isVisible: number;
31
+ thumbnail: string;
32
+ createdAt: string;
33
+ }
2
34
  export interface EventHandler {
3
- (params: Record<string, string>): void | Promise<void>;
35
+ (params: Record<string, unknown>): void | Promise<void>;
4
36
  }
5
37
  export interface EventHandlers {
6
38
  [eventType: string]: EventHandler;
@@ -33,8 +33,8 @@ declare const __VLS_component: import("vue").DefineComponent<__VLS_WithDefaults<
33
33
  descriptionStatus: boolean;
34
34
  descriptionText: string;
35
35
  }>>>, {
36
- size: "small" | "medium" | "large";
37
36
  className: string;
37
+ size: "small" | "medium" | "large";
38
38
  closeOnOutsideClick: boolean;
39
39
  descriptionStatus: boolean;
40
40
  descriptionText: string;
@@ -15,6 +15,5 @@ interface CampaignData extends CardWidthParams {
15
15
  export declare const useRecommendation: () => {
16
16
  calculateCardWidth: ({ mobileLeftPadding, mobileRightPadding, cardsInRow, unresponsive, }: CardWidthParams) => number;
17
17
  getRecommendationCampaignData: (id: string) => CampaignData;
18
- buildCampaignUrl: (campaignId: string) => string;
19
18
  };
20
19
  export {};
@@ -0,0 +1,4 @@
1
+ import type { SyncModuleUnsubscribePayload } from '@@/Types/events';
2
+ export declare const useSyncModuleExtractor: () => {
3
+ extractSyncModuleUnsubscribeData: (html: string) => SyncModuleUnsubscribePayload[];
4
+ };
@@ -25,6 +25,9 @@ export declare const PAGE_TYPES: {
25
25
  SUBSCRIPTION_PREFERENCE_CONFIRMATION: number;
26
26
  RESUBSCRIBE: number;
27
27
  };
28
+ export declare const UNSUBSCRIBE_SYNC_MODULE_TYPES: {
29
+ [x: number]: string;
30
+ };
28
31
  export declare const TYPE_COLLECTIONS: {
29
32
  [x: number]: number[];
30
33
  };
@@ -1,78 +1,11 @@
1
- /**
2
- * Recommendation Block
3
- *
4
- * Main block class for the Recommendation extension.
5
- * Handles block lifecycle including configuration initialization and migration.
6
- * Supports multiple block instances with unique recommendation-id attributes.
7
- */
8
- import type { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
9
1
  import { Block, BlockCompositionType } from '@stripoinc/ui-editor-extensions';
10
2
  export declare const BLOCK_ID = "recommendation-block";
11
3
  export declare class RecommendationBlock extends Block {
12
- /**
13
- * Stores the ID generated in getTemplate() so onCreated() can reuse it.
14
- * This avoids generating a new (different) ID in onCreated().
15
- */
16
- private _pendingBlockId;
17
4
  constructor();
18
5
  getId(): string;
19
6
  getIcon(): string;
20
7
  getBlockCompositionType(): BlockCompositionType;
21
8
  getName(): string;
22
9
  getDescription(): string;
23
- /**
24
- * Returns the template HTML for a new recommendation block.
25
- * Generates a unique recommendation ID and embeds the instance class
26
- * (ins-recommendation-v3-block-{id}) directly in the template HTML.
27
- * This is necessary because Stripo's Angular rendering manages the class
28
- * attribute and overwrites dynamically added classes via setAttribute.
29
- */
30
10
  getTemplate(): string;
31
- /**
32
- * Called when a new block is dropped into the template
33
- *
34
- * Uses the ID from getTemplate() (which already embedded the instance class)
35
- * and assigns the recommendation-id attribute + initializes configuration.
36
- * @param node - The newly created block node
37
- */
38
- onCreated(node: ImmutableHtmlNode): void;
39
- /**
40
- * Called when the document changes or template is loaded
41
- *
42
- * Handles migration from legacy templates that don't have node config
43
- * and assigns recommendation-id to legacy blocks that lack one.
44
- * @param node - The block node that may need migration
45
- */
46
- onDocumentChanged(node: ImmutableHtmlNode): void;
47
- /**
48
- * Called when a block is deleted from the template
49
- *
50
- * Cleans up the per-block state from the Pinia store.
51
- * @param node - The block node being deleted
52
- */
53
- onDelete(node: ImmutableHtmlNode): void;
54
- /**
55
- * Generates the next unique recommendation ID by scanning all existing blocks
56
- * in the document and finding the maximum existing ID + 1.
57
- */
58
- private _generateNextId;
59
- /**
60
- * Assigns a recommendation-id attribute to the block element.
61
- * The instance class (ins-recommendation-v3-block-{id}) is embedded in the template
62
- * HTML by getTemplate(), since Stripo's Angular rendering overwrites dynamically
63
- * added classes via setAttribute.
64
- */
65
- private _assignRecommendationId;
66
- /**
67
- * Gets the recommendation-id from a block node
68
- */
69
- private _getRecommendationId;
70
- /**
71
- * Gets the block element (the element with BLOCK_CLASS)
72
- */
73
- private _getBlockElement;
74
- /**
75
- * Migrate configuration from legacy format
76
- */
77
- private _migrateFromLegacy;
78
11
  }
@@ -1,5 +1,5 @@
1
1
  import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
2
- import { CommonControl } from '../../../common-control';
2
+ import { CommonControl } from '../common-control';
3
3
  export declare const COMPOSITION_CONTROL_BLOCK_ID = "ui-elements-recommendation-card-composition";
4
4
  export interface CardCompositionItem {
5
5
  key: string;
@@ -7,8 +7,6 @@ export interface CardCompositionItem {
7
7
  visible: boolean;
8
8
  }
9
9
  export declare class RecommendationCardCompositionControl extends CommonControl {
10
- private store;
11
- private unsubscribeOrientation;
12
10
  getId(): string;
13
11
  getTemplate(): string;
14
12
  onRender(): void;
@@ -59,12 +57,10 @@ export declare class RecommendationCardCompositionControl extends CommonControl
59
57
  /**
60
58
  * Apply the reordered composition to the block's HTML structure
61
59
  * Updates the data-card-composition attribute and reorders product attributes
62
- * Note: Reordering is only applied for grid layout
63
60
  */
64
61
  private _applyCompositionToBlock;
65
62
  /**
66
- * Reorders attribute rows within each product card based on composition order
67
- * Targets the tbody inside each product-attribute-cell to preserve card structure
63
+ * Reorders attribute rows within each product row based on composition order
68
64
  */
69
65
  private _reorderProductAttributes;
70
66
  /**
@@ -73,23 +69,7 @@ export declare class RecommendationCardCompositionControl extends CommonControl
73
69
  private _buildCompositionHtml;
74
70
  /**
75
71
  * Apply visibility changes to the block's HTML structure
76
- * Updates display style and data-visibility attribute for all matching elements
77
- * - <tr> elements: use display: none / table-row
78
- * - <td> elements: use display: none / table-cell
72
+ * Updates display style and data-visibility attribute for all matching rows
79
73
  */
80
74
  private _applyVisibilityToBlock;
81
- /**
82
- * Gets the current layout orientation from store or DOM
83
- */
84
- private _getCurrentLayout;
85
- /**
86
- * Updates orderable state based on layout orientation
87
- * Adds/removes disabled class to hide drag icons for list layout
88
- */
89
- private _updateOrderableState;
90
- /**
91
- * Subscribe to store orientation changes
92
- * Updates orderable state when layout changes via the layout control
93
- */
94
- private _subscribeToOrientationChanges;
95
75
  }
@@ -1,3 +1,27 @@
1
+ /**
2
+ * Attribute type constants used in templates
3
+ * These are used as keys in ElementRenderer and composition arrays
4
+ */
5
+ export declare const ATTR_PRODUCT_IMAGE = "productImage";
6
+ export declare const ATTR_PRODUCT_NAME = "productName";
7
+ export declare const ATTR_PRODUCT_PRICE = "productPrice";
8
+ export declare const ATTR_PRODUCT_OLD_PRICE = "productOldPrice";
9
+ export declare const ATTR_PRODUCT_OMNIBUS_PRICE = "productOmnibusPrice";
10
+ export declare const ATTR_PRODUCT_OMNIBUS_DISCOUNT = "productOmnibusDiscount";
11
+ export declare const ATTR_PRODUCT_BUTTON = "productButton";
12
+ /**
13
+ * Block IDs used in the Recommendation Extension
14
+ * These IDs are used in the esd-extension-block-id attribute to identify specific blocks
15
+ */
16
+ export declare enum RecommendationBlockId {
17
+ BUTTON = "recommendation-block-button",
18
+ NAME = "recommendation-block-name",
19
+ PRICE = "recommendation-block-price",
20
+ OLD_PRICE = "recommendation-block-old-price",
21
+ OMNIBUS_PRICE = "recommendation-block-omnibus-price",
22
+ OMNIBUS_DISCOUNT = "recommendation-block-omnibus-discount",
23
+ IMAGE = "recommendation-block-image"
24
+ }
1
25
  /**
2
26
  * Control IDs used in the Recommendation Extension
3
27
  * These IDs are returned by the getId() method of each control
@@ -0,0 +1,38 @@
1
+ import { CommonControl } from '../common-control';
2
+ export declare const CONTROL_BLOCK_ID = "ui-elements-recommendation-block";
3
+ export declare class RecommendationBlockControl extends CommonControl {
4
+ private store;
5
+ private storeUnsubscription;
6
+ private addFilterListener;
7
+ private addFilterButton;
8
+ getId(): string;
9
+ getTemplate(): string;
10
+ onRender(): Promise<void>;
11
+ onDestroy(): void;
12
+ _setFormValues(): void;
13
+ _initializeSelectItems(): void;
14
+ _getAlgorithms(): string;
15
+ _getLanguages(): string;
16
+ _getCurrency(): string;
17
+ _getProductLayout(): string;
18
+ _getFilterStatus(): string;
19
+ _getShuffleProducts(): string;
20
+ _onFilterSelectClick(): void;
21
+ _onDataChange(item: string, value: string | number | string[]): void;
22
+ /**
23
+ * Get the current card composition from block data attribute or use default
24
+ */
25
+ _getCardComposition(): string[];
26
+ _regenerateProductRows(): void;
27
+ /**
28
+ * Reapply spacing values after product regeneration
29
+ * This ensures spacing persists when products are regenerated
30
+ */
31
+ _reapplySpacing(): void;
32
+ _debouncedRegenerateProductRows: import("@vueuse/shared").PromisifyFn<() => void>;
33
+ _onCurrencyConfigChange(item: string, value: string | number): void;
34
+ _onCurrencyChange(value: string): void;
35
+ _setProductIdsVisibility(): void;
36
+ _listenToFormUpdates(): void;
37
+ _listenStateUpdates(): void;
38
+ }