@useinsider/guido 3.16.0-beta.ff4f1bd → 3.16.1-beta.626490d

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 (73) hide show
  1. package/README.md +0 -1
  2. package/dist/@types/config/schemas.js +6 -12
  3. package/dist/components/Guido.vue.js +6 -6
  4. package/dist/components/Guido.vue2.js +30 -31
  5. package/dist/composables/useRecommendation.js +36 -43
  6. package/dist/config/migrator/recommendationMigrator.js +4 -6
  7. package/dist/enums/extensions/recommendationBlock.js +23 -25
  8. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +11 -13
  9. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +90 -112
  10. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +53 -188
  11. package/dist/guido.css +1 -1
  12. package/dist/services/recommendationApi.js +28 -77
  13. package/dist/src/@types/config/schemas.d.ts +0 -12
  14. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  15. package/dist/src/composables/useConfig.d.ts +0 -2
  16. package/dist/src/composables/useRecommendation.d.ts +0 -1
  17. package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -2
  18. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +3 -6
  19. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +10 -199
  20. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +0 -6
  21. package/dist/src/services/recommendationApi.d.ts +1 -4
  22. package/dist/src/stores/config.d.ts +0 -18
  23. package/dist/utils/templatePreparation.js +34 -37
  24. package/package.json +1 -2
  25. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +0 -18
  26. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +0 -61
  27. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +0 -106
  28. package/dist/node_modules/@useinsider/design-system-organisms/dist/index-5JHlb8rM.js +0 -524
  29. package/dist/node_modules/@useinsider/design-system-organisms/dist/index.js +0 -8450
  30. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InAccordion.js +0 -174
  31. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InBasicTextInput.js +0 -381
  32. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InBox.js +0 -236
  33. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InBulkActions.js +0 -70
  34. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InButton.js +0 -350
  35. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InButtonV2.js +0 -371
  36. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InCheckBox.js +0 -152
  37. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InChips.js +0 -141
  38. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InCustomDropDown.js +0 -1047
  39. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDataTableV2.js +0 -96050
  40. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDatePicker.js +0 -2042
  41. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDrawer.js +0 -166
  42. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDropDown.js +0 -1098
  43. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InIcons.js +0 -55
  44. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InInfoBox.js +0 -265
  45. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InLinks.js +0 -184
  46. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InLoading.js +0 -50
  47. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InModals.js +0 -453
  48. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InNoData.js +0 -145
  49. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InOnPageMessage.js +0 -176
  50. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InProgress.js +0 -266
  51. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InRadioButton.js +0 -114
  52. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InSegments.js +0 -200
  53. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InSelect.js +0 -451
  54. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InSkeleton.js +0 -49
  55. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InStatusText.js +0 -119
  56. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTabs.js +0 -4309
  57. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTagsText.js +0 -129
  58. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTextInput.js +0 -503
  59. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InToasts.js +0 -253
  60. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InToggle.js +0 -107
  61. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTooltip.js +0 -134
  62. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTooltipV2.js +0 -464
  63. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/_commonjsHelpers.BItOPCY9.js +0 -28
  64. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/_plugin-vue2_normalizer.WQT2Fc8L.js +0 -23
  65. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/clickOutside.qP9M0QCm.js +0 -29
  66. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/helpers.CgHNyjAJ.js +0 -109
  67. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/index.Bw_06igr.js +0 -2339
  68. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/localLocalesMixin.DYMhydo2.js +0 -16
  69. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/useLocalLocales.Ckuhy7d-.js +0 -17
  70. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/vue-property-decorator.BtlM7Epa.js +0 -188
  71. package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +0 -3
  72. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -26
  73. package/dist/src/mock/api/recommendation-strategies.d.ts +0 -41
@@ -104,7 +104,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
104
104
  autosave: boolean;
105
105
  allowlistEnabled: boolean;
106
106
  linkTrackingIds: boolean;
107
- reusableRecommendationStrategy: boolean;
108
107
  };
109
108
  blocks: {
110
109
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -245,7 +244,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
245
244
  autosave: boolean;
246
245
  allowlistEnabled: boolean;
247
246
  linkTrackingIds: boolean;
248
- reusableRecommendationStrategy: boolean;
249
247
  };
250
248
  blocks: {
251
249
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -386,7 +384,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
386
384
  autosave: boolean;
387
385
  allowlistEnabled: boolean;
388
386
  linkTrackingIds: boolean;
389
- reusableRecommendationStrategy: boolean;
390
387
  };
391
388
  blocks: {
392
389
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -527,7 +524,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
527
524
  autosave: boolean;
528
525
  allowlistEnabled: boolean;
529
526
  linkTrackingIds: boolean;
530
- reusableRecommendationStrategy: boolean;
531
527
  };
532
528
  blocks: {
533
529
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -668,7 +664,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
668
664
  autosave: boolean;
669
665
  allowlistEnabled: boolean;
670
666
  linkTrackingIds: boolean;
671
- reusableRecommendationStrategy: boolean;
672
667
  };
673
668
  blocks: {
674
669
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -809,7 +804,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
809
804
  autosave: boolean;
810
805
  allowlistEnabled: boolean;
811
806
  linkTrackingIds: boolean;
812
- reusableRecommendationStrategy: boolean;
813
807
  };
814
808
  blocks: {
815
809
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -950,7 +944,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
950
944
  autosave: boolean;
951
945
  allowlistEnabled: boolean;
952
946
  linkTrackingIds: boolean;
953
- reusableRecommendationStrategy: boolean;
954
947
  };
955
948
  blocks: {
956
949
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -1091,7 +1084,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1091
1084
  autosave: boolean;
1092
1085
  allowlistEnabled: boolean;
1093
1086
  linkTrackingIds: boolean;
1094
- reusableRecommendationStrategy: boolean;
1095
1087
  };
1096
1088
  blocks: {
1097
1089
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -1232,7 +1224,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1232
1224
  autosave: boolean;
1233
1225
  allowlistEnabled: boolean;
1234
1226
  linkTrackingIds: boolean;
1235
- reusableRecommendationStrategy: boolean;
1236
1227
  };
1237
1228
  blocks: {
1238
1229
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -1373,7 +1364,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1373
1364
  autosave: boolean;
1374
1365
  allowlistEnabled: boolean;
1375
1366
  linkTrackingIds: boolean;
1376
- reusableRecommendationStrategy: boolean;
1377
1367
  };
1378
1368
  blocks: {
1379
1369
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -1514,7 +1504,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1514
1504
  autosave: boolean;
1515
1505
  allowlistEnabled: boolean;
1516
1506
  linkTrackingIds: boolean;
1517
- reusableRecommendationStrategy: boolean;
1518
1507
  };
1519
1508
  blocks: {
1520
1509
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -1655,7 +1644,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1655
1644
  autosave: boolean;
1656
1645
  allowlistEnabled: boolean;
1657
1646
  linkTrackingIds: boolean;
1658
- reusableRecommendationStrategy: boolean;
1659
1647
  };
1660
1648
  blocks: {
1661
1649
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -1796,7 +1784,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1796
1784
  autosave: boolean;
1797
1785
  allowlistEnabled: boolean;
1798
1786
  linkTrackingIds: boolean;
1799
- reusableRecommendationStrategy: boolean;
1800
1787
  };
1801
1788
  blocks: {
1802
1789
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -1937,7 +1924,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
1937
1924
  autosave: boolean;
1938
1925
  allowlistEnabled: boolean;
1939
1926
  linkTrackingIds: boolean;
1940
- reusableRecommendationStrategy: boolean;
1941
1927
  };
1942
1928
  blocks: {
1943
1929
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -2078,7 +2064,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2078
2064
  autosave: boolean;
2079
2065
  allowlistEnabled: boolean;
2080
2066
  linkTrackingIds: boolean;
2081
- reusableRecommendationStrategy: boolean;
2082
2067
  };
2083
2068
  blocks: {
2084
2069
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -2219,7 +2204,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2219
2204
  autosave: boolean;
2220
2205
  allowlistEnabled: boolean;
2221
2206
  linkTrackingIds: boolean;
2222
- reusableRecommendationStrategy: boolean;
2223
2207
  };
2224
2208
  blocks: {
2225
2209
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -2360,7 +2344,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2360
2344
  autosave: boolean;
2361
2345
  allowlistEnabled: boolean;
2362
2346
  linkTrackingIds: boolean;
2363
- reusableRecommendationStrategy: boolean;
2364
2347
  };
2365
2348
  blocks: {
2366
2349
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -2503,7 +2486,6 @@ export declare const useConfigStore: import("pinia").StoreDefinition<"guido-conf
2503
2486
  autosave: boolean;
2504
2487
  allowlistEnabled: boolean;
2505
2488
  linkTrackingIds: boolean;
2506
- reusableRecommendationStrategy: boolean;
2507
2489
  };
2508
2490
  blocks: {
2509
2491
  excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
@@ -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 a } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
4
+ import { DEFAULT_CURRENCY as d, DEFAULT_NODE_CONFIG as s } 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 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);
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);
17
17
  o && t.push(...R(o));
18
18
  }), [...new Set(t)];
19
19
  }
20
20
  async function M(m) {
21
- const n = new DOMParser().parseFromString(m, "text/html").querySelectorAll(".recommendation-block-v2");
22
- if (n.length === 0)
21
+ const a = new DOMParser().parseFromString(m, "text/html").querySelectorAll(".recommendation-block-v2");
22
+ if (a.length === 0)
23
23
  return;
24
- const i = C();
25
- n.forEach((t) => {
24
+ const n = C();
25
+ a.forEach((t) => {
26
26
  var r, l, g, f, c;
27
- const s = t.getAttribute("recommendation-id"), o = s ? Number(s) : NaN;
27
+ const i = t.getAttribute("recommendation-id"), o = i ? Number(i) : NaN;
28
28
  if (!Number.isFinite(o))
29
29
  return;
30
30
  const p = t.getAttribute("esd-ext-config");
@@ -42,27 +42,24 @@ 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) || a.strategy,
46
- // esd-ext-config is the source of truth for the assigned RRS —
47
- // a strategy-backed block must survive save/reopen from it alone.
48
- strategyId: e.strategyId ?? a.strategyId,
49
- language: e.language ?? a.language,
50
- size: e.size ?? a.size,
45
+ strategy: L(e.strategy) || s.strategy,
46
+ language: e.language ?? s.language,
47
+ size: e.size ?? s.size,
51
48
  // Spread the default arrays so each block gets a fresh reference
52
49
  // instead of sharing the singleton in DEFAULT_NODE_CONFIG.
53
- productIds: e.productIds ?? [...a.productIds],
54
- filters: e.filters ?? [...a.filters],
55
- shuffleProducts: e.shuffleProducts ?? a.shuffleProducts,
50
+ productIds: e.productIds ?? [...s.productIds],
51
+ filters: e.filters ?? [...s.filters],
52
+ shuffleProducts: e.shuffleProducts ?? s.shuffleProducts,
56
53
  currencyCode: ((r = e.currency) == null ? void 0 : r.code) ?? d.code,
57
54
  currencyAlignment: ((l = e.currency) == null ? void 0 : l.alignment) ?? d.alignment,
58
55
  currencyDecimalCount: ((g = e.currency) == null ? void 0 : g.decimalCount) ?? d.decimalCount,
59
56
  currencyDecimalSeparator: ((f = e.currency) == null ? void 0 : f.decimalSeparator) ?? d.decimalSeparator,
60
57
  currencyThousandSeparator: ((c = e.currency) == null ? void 0 : c.thousandSeparator) ?? d.thousandSeparator
61
58
  };
62
- i.seedBlockUrlConfig(o, h);
59
+ n.seedBlockUrlConfig(o, h);
63
60
  });
64
61
  try {
65
- await i.fetchRecommendationCreateData();
62
+ await n.fetchRecommendationCreateData();
66
63
  } catch (t) {
67
64
  console.warn(
68
65
  "Recommendation reference data pre-load failed; validator will skip the availability check.",
@@ -71,39 +68,39 @@ async function M(m) {
71
68
  }
72
69
  }
73
70
  const Z = () => {
74
- const m = N(), u = z(), n = _(), { getCompiledEmail: i, getTemplateData: t, updateHtmlAndCss: s } = k(), { compileHtml: o, compileAmpHtml: p } = x(), { isFeatureEnabled: e } = U();
71
+ const m = N(), u = z(), a = _(), { getCompiledEmail: n, getTemplateData: t, updateHtmlAndCss: i } = k(), { compileHtml: o, compileAmpHtml: p } = x(), { isFeatureEnabled: e } = U();
75
72
  return {
76
73
  prepareTemplateDetails: async () => {
77
74
  let { html: r, css: l, syncModulesIds: g = [] } = await t();
78
75
  if (e("linkTrackingIds"))
79
76
  try {
80
- const { html: S, changed: F, nextSeq: H } = v(r, u.trackIdSessionFloor);
81
- u.trackIdSessionFloor = H, F && (r = S, await s(S, l));
82
- } catch (S) {
83
- console.error("Tracking-id step failed, saving anyway:", S);
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);
84
81
  }
85
- const { html: f, ampHtml: c = "", ampErrors: T = [] } = await i({
82
+ const { html: f, ampHtml: c = "", ampErrors: T = [] } = await n({
86
83
  minimize: !0,
87
84
  resetDataSavedFlag: !1
88
85
  });
89
- n.selectedUnsubscribePages.length && await n.fetchTemplates(), await M(r);
90
- const { compiledHtml: I, stats: y, appliedRules: w } = o(f), D = c && p(c).compiledHtml, E = m.getSelectedDynamicContentList, P = C(), b = O(r);
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);
91
88
  return console.debug("HTML Compilation Stats:", {
92
- originalSize: y.originalSize,
93
- compiledSize: y.compiledSize,
94
- reduction: `${y.reductionPercentage.toFixed(2)}%`,
95
- appliedRules: w,
96
- executionTime: `${y.executionTime.toFixed(2)}ms`
89
+ originalSize: S.originalSize,
90
+ compiledSize: S.compiledSize,
91
+ reduction: `${S.reductionPercentage.toFixed(2)}%`,
92
+ appliedRules: D,
93
+ executionTime: `${S.executionTime.toFixed(2)}ms`
97
94
  }), {
98
- dynamicContentList: E,
99
- compiledHtml: I,
95
+ dynamicContentList: P,
96
+ compiledHtml: w,
100
97
  rawHtml: r,
101
98
  css: l,
102
- ampHtml: D,
99
+ ampHtml: E,
103
100
  ampErrors: T,
104
101
  modules: g.map(Number),
105
102
  recommendation: {
106
- campaignUrls: P.recommendationCampaignUrls,
103
+ campaignUrls: F.recommendationCampaignUrls,
107
104
  configs: {}
108
105
  },
109
106
  unsubscribe: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.16.0-beta.ff4f1bd",
3
+ "version": "3.16.1-beta.626490d",
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,7 +48,6 @@
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.fd01ebd",
52
51
  "@useinsider/design-system-vue": "1.5.0",
53
52
  "@vueuse/core": "11.3.0",
54
53
  "lodash-es": "4.17.21",
@@ -1,18 +0,0 @@
1
- import s from "./AssignStrategyDrawer.vue2.js";
2
- /* empty css */
3
- import a from "../../../../_virtual/_plugin-vue2_normalizer.js";
4
- var o = function() {
5
- var r = this, e = r._self._c, t = r._self._setupProxy;
6
- return e(t.WpDrawer, { attrs: { id: "assign-strategy-drawer", "description-status": "", size: "medium", "description-text": t.drawerDescription, "footer-button-group-options": t.footerButtonGroupOptions, status: t.store.assignStrategyDrawerStatus, "title-text": t.trans("gpt-app-builder.assign-recommendation-strategy") }, on: { cancelOrBackButtonEvent: t.closeDrawer, onCloseEvent: t.closeDrawer, primaryButtonEvent: t.assignStrategy } }, [t.store.assignStrategyDrawerStatus ? e("div", { staticClass: "assign-strategy-drawer-content" }, [e(t.OrgStrategyDropdown, { attrs: { "create-button-visible": !1, loading: t.store.strategiesLoading, "selected-strategy-id": t.selectedStrategyId, strategies: t.strategyOptions }, on: { select: t.onSelect } }), t.selectedStrategy ? e("div", { key: String(t.selectedStrategy.strategy_id), staticClass: "assign-strategy-detail" }, [e(t.OrgStrategyDetailModal, { attrs: { show: "", "footer-status": !1, strategy: t.selectedStrategy } })], 1) : r._e()], 1) : r._e()]);
7
- }, n = [], i = /* @__PURE__ */ a(
8
- s,
9
- o,
10
- n,
11
- !1,
12
- null,
13
- "3a49b374"
14
- );
15
- const p = i.exports;
16
- export {
17
- p as default
18
- };
@@ -1,61 +0,0 @@
1
- import { defineComponent as S, ref as g, computed as o, watch as f } from "vue";
2
- /* empty css */
3
- import v from "../../../wrappers/WpDrawer.vue.js";
4
- import { useToaster as _ } from "../../../../composables/useToaster.js";
5
- import { useTranslations as w } from "../../../../composables/useTranslations.js";
6
- import { ToasterTypeOptions as D } from "../../../../enums/toaster.js";
7
- import { useRecommendationExtensionStore as T } from "../../../../extensions/Blocks/Recommendation/store/recommendation.js";
8
- import { OrgStrategyDropdown as h, OrgStrategyDetailModal as x } from "../../../../node_modules/@useinsider/design-system-organisms/dist/index.js";
9
- const $ = /* @__PURE__ */ S({
10
- __name: "AssignStrategyDrawer",
11
- setup(O) {
12
- const i = "/discovery/recommendation-strategies", s = w(), e = T(), { showToaster: l, handleError: c } = _(), a = g(null), r = g(!1), d = o(() => e.assignStrategyDrawerStatus ? s("email-editor.assign-strategy-description", { url: i }) : "");
13
- f(() => e.assignStrategyDrawerStatus, (t) => {
14
- if (!t)
15
- return;
16
- const { strategyId: p } = e.recommendationConfigs;
17
- a.value = p || null, e.fetchStrategies().catch((y) => {
18
- c(y, "Failed to load recommendation strategies");
19
- });
20
- });
21
- const m = o(() => e.strategies.map((t) => ({
22
- text: t.name,
23
- value: t.strategy_id,
24
- infoBoxProps: {
25
- id: `strategy-info-${t.strategy_id}`,
26
- theme: "light",
27
- variant: "information",
28
- titleText: t.name,
29
- descriptionText: [t.algorithm, t.size ? `${t.size} products` : ""].filter(Boolean).join(" · ")
30
- }
31
- }))), n = o(() => e.strategies.find((t) => String(t.strategy_id) === String(a.value ?? "")) ?? null), u = o(() => ({
32
- primaryButton: {
33
- styling: "solid",
34
- type: "primary",
35
- labelText: s("products.assign-btn"),
36
- loadingStatus: r.value,
37
- disabledStatus: !n.value
38
- },
39
- cancelOrBackButton: {
40
- styling: "ghost",
41
- type: "secondary",
42
- labelText: s("products.cancel"),
43
- disabledStatus: r.value
44
- }
45
- }));
46
- return { __sfc: !0, RRS_PANEL_PATH: i, trans: s, store: e, showToaster: l, handleError: c, selectedStrategyId: a, isAssigning: r, drawerDescription: d, strategyOptions: m, selectedStrategy: n, footerButtonGroupOptions: u, closeDrawer: () => {
47
- e.closeAssignStrategyDrawer();
48
- }, assignStrategy: () => {
49
- const t = n.value;
50
- t && (r.value = !0, e.assignStrategy(t), l({
51
- type: D.Success,
52
- message: s("email-editor.strategy-assigned-success", { strategyName: t.name })
53
- }), e.closeAssignStrategyDrawer(), r.value = !1);
54
- }, onSelect: (t) => {
55
- a.value = t.value;
56
- }, WpDrawer: v, OrgStrategyDetailModal: x, OrgStrategyDropdown: h };
57
- }
58
- });
59
- export {
60
- $ as default
61
- };
@@ -1,106 +0,0 @@
1
- var d = Object.defineProperty;
2
- var l = (a, e, t) => e in a ? d(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
3
- var o = (a, e, t) => l(a, typeof e != "symbol" ? e + "" : e, t);
4
- import { CommonControl as m } from "../../../common-control.js";
5
- import { useRecommendationExtensionStore as y } from "../../store/recommendation.js";
6
- const h = "recommendation-strategy-control", u = "https://academy.insiderone.com/docs/new-editor-email-recommendation-block", c = {
7
- ASSIGN: "assignStrategy",
8
- CHANGE: "changeStrategy",
9
- REMOVE: "removeStrategy"
10
- };
11
- class b extends m {
12
- constructor() {
13
- super(...arguments);
14
- o(this, "store", y());
15
- o(this, "storeUnsubscription", () => {
16
- });
17
- o(this, "listeners", []);
18
- }
19
- getId() {
20
- return h;
21
- }
22
- getTemplate() {
23
- const t = this.api.translate(
24
- "You can assign a recommendation strategy by selecting an existing one or creating a new one to show specific content."
25
- ), s = this.api.translate("For more information, you can"), n = this.api.translate("visit Academy");
26
- return `
27
- <div class="strategy-control-container">
28
- ${this._GuOneColumn([
29
- this._GuLabel({ text: this.api.translate("Recommendation Strategy") })
30
- ])}
31
- <div class="container">
32
- <p class="strategy-control-description">
33
- ${t}
34
- ${s}
35
- <!-- cspell:disable-next-line -->
36
- <a href="${u}" target="_blank" rel="noopener noreferrer">${n}</a>.
37
- </p>
38
- </div>
39
- <div data-strategy-empty-state>
40
- ${this._GuOneColumn([
41
- this._GuButton({
42
- name: c.ASSIGN,
43
- label: this.api.translate("+ Assign Strategy"),
44
- id: "guido__btn-assign-strategy"
45
- })
46
- ])}
47
- <!-- Create round-trip ships in a later phase; kept visible-but-disabled per design -->
48
- <div style="pointer-events: none; opacity: 0.5;">
49
- ${this._GuOneColumn([
50
- this._GuButton({
51
- name: "createStrategy",
52
- label: this.api.translate("Create New Strategy"),
53
- id: "guido__btn-create-strategy"
54
- })
55
- ])}
56
- </div>
57
- </div>
58
- <div data-strategy-assigned-state style="display: none;">
59
- ${this._GuTwoColumns([
60
- '<span class="strategy-control-name" data-strategy-name></span>',
61
- `${this._GuButton({
62
- name: c.CHANGE,
63
- label: this.api.translate("Change"),
64
- id: "guido__btn-change-strategy"
65
- })}
66
- ${this._GuButton({
67
- name: c.REMOVE,
68
- label: this.api.translate("Remove"),
69
- id: "guido__btn-remove-strategy"
70
- })}`
71
- ])}
72
- </div>
73
- </div>
74
- `;
75
- }
76
- onRender() {
77
- this._setupButtonListeners(), this._renderState(), this.storeUnsubscription = this.store.$subscribe(() => {
78
- this._renderState();
79
- }), this.store.recommendationConfigs.strategyId && !this.store.strategies.length && this.store.fetchStrategies().catch(() => {
80
- });
81
- }
82
- onDestroy() {
83
- this.storeUnsubscription(), this.listeners.forEach(({ element: t, handler: s }) => t.removeEventListener("click", s)), this.listeners = [];
84
- }
85
- _setupButtonListeners() {
86
- const t = (s, n) => {
87
- const i = this.getContainer().querySelector(s);
88
- i && (i.addEventListener("click", n), this.listeners.push({ element: i, handler: n }));
89
- };
90
- t("#guido__btn-assign-strategy", () => this.store.openAssignStrategyDrawer()), t("#guido__btn-change-strategy", () => this.store.openAssignStrategyDrawer()), t("#guido__btn-remove-strategy", () => this.store.removeStrategy());
91
- }
92
- /**
93
- * Toggles empty vs assigned state from the store's current block config.
94
- * Display name comes from the listing; falls back to the raw id while the
95
- * listing loads (or when the strategy is no longer listed).
96
- */
97
- _renderState() {
98
- var g;
99
- const t = this.getContainer(), s = t.querySelector("[data-strategy-empty-state]"), n = t.querySelector("[data-strategy-assigned-state]"), i = t.querySelector("[data-strategy-name]"), { strategyId: r } = this.store.recommendationConfigs;
100
- !s || !n || (s.style.display = r ? "none" : "", n.style.display = r ? "" : "none", i && r && (i.textContent = ((g = this.store.assignedStrategy) == null ? void 0 : g.name) ?? `#${r}`));
101
- }
102
- }
103
- export {
104
- h as STRATEGY_CONTROL_ID,
105
- b as StrategyControl
106
- };