@useinsider/guido 3.16.0-beta.c615198 → 3.16.0-beta.ff4f1bd

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 (76) hide show
  1. package/README.md +1 -0
  2. package/dist/@types/config/schemas.js +12 -6
  3. package/dist/components/Guido.vue.js +6 -6
  4. package/dist/components/Guido.vue2.js +31 -30
  5. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +18 -0
  6. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +61 -0
  7. package/dist/composables/useRecommendation.js +49 -43
  8. package/dist/config/migrator/recommendationMigrator.js +6 -4
  9. package/dist/enums/extensions/recommendationBlock.js +25 -23
  10. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +13 -11
  11. package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +26 -37
  12. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +120 -98
  13. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +106 -0
  14. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +186 -52
  15. package/dist/guido.css +1 -1
  16. package/dist/node_modules/@useinsider/design-system-organisms/dist/index-5JHlb8rM.js +524 -0
  17. package/dist/node_modules/@useinsider/design-system-organisms/dist/index.js +8450 -0
  18. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InAccordion.js +174 -0
  19. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InBasicTextInput.js +381 -0
  20. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InBox.js +236 -0
  21. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InBulkActions.js +70 -0
  22. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InButton.js +350 -0
  23. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InButtonV2.js +371 -0
  24. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InCheckBox.js +152 -0
  25. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InChips.js +141 -0
  26. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InCustomDropDown.js +1047 -0
  27. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDataTableV2.js +96050 -0
  28. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDatePicker.js +2042 -0
  29. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDrawer.js +166 -0
  30. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InDropDown.js +1098 -0
  31. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InIcons.js +55 -0
  32. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InInfoBox.js +265 -0
  33. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InLinks.js +184 -0
  34. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InLoading.js +50 -0
  35. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InModals.js +453 -0
  36. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InNoData.js +145 -0
  37. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InOnPageMessage.js +176 -0
  38. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InProgress.js +266 -0
  39. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InRadioButton.js +114 -0
  40. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InSegments.js +200 -0
  41. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InSelect.js +451 -0
  42. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InSkeleton.js +49 -0
  43. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InStatusText.js +119 -0
  44. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTabs.js +4309 -0
  45. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTagsText.js +129 -0
  46. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTextInput.js +503 -0
  47. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InToasts.js +253 -0
  48. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InToggle.js +107 -0
  49. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTooltip.js +134 -0
  50. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/InTooltipV2.js +464 -0
  51. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/_commonjsHelpers.BItOPCY9.js +28 -0
  52. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/_plugin-vue2_normalizer.WQT2Fc8L.js +23 -0
  53. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/clickOutside.qP9M0QCm.js +29 -0
  54. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/helpers.CgHNyjAJ.js +109 -0
  55. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/index.Bw_06igr.js +2339 -0
  56. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/localLocalesMixin.DYMhydo2.js +16 -0
  57. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/useLocalLocales.Ckuhy7d-.js +17 -0
  58. package/dist/node_modules/@useinsider/design-system-organisms/node_modules/@useinsider/design-system-vue/dist/chunks/vue-property-decorator.BtlM7Epa.js +188 -0
  59. package/dist/services/recommendationApi.js +77 -28
  60. package/dist/src/@types/config/schemas.d.ts +12 -0
  61. package/dist/src/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.d.ts +3 -0
  62. package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
  63. package/dist/src/composables/useConfig.d.ts +2 -0
  64. package/dist/src/composables/useRecommendation.d.ts +1 -0
  65. package/dist/src/enums/extensions/recommendationBlock.d.ts +2 -0
  66. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +6 -3
  67. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +26 -0
  68. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +199 -10
  69. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +6 -0
  70. package/dist/src/mock/api/recommendation-strategies.d.ts +41 -0
  71. package/dist/src/services/recommendationApi.d.ts +4 -1
  72. package/dist/src/stores/config.d.ts +18 -0
  73. package/dist/utils/templatePreparation.js +37 -34
  74. package/package.json +2 -1
  75. package/dist/extensions/Blocks/Recommendation/utils/productIds.js +0 -6
  76. package/dist/src/extensions/Blocks/Recommendation/utils/productIds.d.ts +0 -6
@@ -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,27 @@ 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
+ // 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,
48
51
  // Spread the default arrays so each block gets a fresh reference
49
52
  // 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,
53
+ productIds: e.productIds ?? [...a.productIds],
54
+ filters: e.filters ?? [...a.filters],
55
+ shuffleProducts: e.shuffleProducts ?? a.shuffleProducts,
53
56
  currencyCode: ((r = e.currency) == null ? void 0 : r.code) ?? d.code,
54
57
  currencyAlignment: ((l = e.currency) == null ? void 0 : l.alignment) ?? d.alignment,
55
58
  currencyDecimalCount: ((g = e.currency) == null ? void 0 : g.decimalCount) ?? d.decimalCount,
56
59
  currencyDecimalSeparator: ((f = e.currency) == null ? void 0 : f.decimalSeparator) ?? d.decimalSeparator,
57
60
  currencyThousandSeparator: ((c = e.currency) == null ? void 0 : c.thousandSeparator) ?? d.thousandSeparator
58
61
  };
59
- n.seedBlockUrlConfig(o, h);
62
+ i.seedBlockUrlConfig(o, h);
60
63
  });
61
64
  try {
62
- await n.fetchRecommendationCreateData();
65
+ await i.fetchRecommendationCreateData();
63
66
  } catch (t) {
64
67
  console.warn(
65
68
  "Recommendation reference data pre-load failed; validator will skip the availability check.",
@@ -68,39 +71,39 @@ async function M(m) {
68
71
  }
69
72
  }
70
73
  const Z = () => {
71
- const m = N(), u = z(), a = _(), { getCompiledEmail: n, getTemplateData: t, updateHtmlAndCss: i } = k(), { compileHtml: o, compileAmpHtml: p } = x(), { isFeatureEnabled: e } = U();
74
+ const m = N(), u = z(), n = _(), { getCompiledEmail: i, getTemplateData: t, updateHtmlAndCss: s } = k(), { compileHtml: o, compileAmpHtml: p } = x(), { isFeatureEnabled: e } = U();
72
75
  return {
73
76
  prepareTemplateDetails: async () => {
74
77
  let { html: r, css: l, syncModulesIds: g = [] } = await t();
75
78
  if (e("linkTrackingIds"))
76
79
  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);
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);
81
84
  }
82
- const { html: f, ampHtml: c = "", ampErrors: T = [] } = await n({
85
+ const { html: f, ampHtml: c = "", ampErrors: T = [] } = await i({
83
86
  minimize: !0,
84
87
  resetDataSavedFlag: !1
85
88
  });
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);
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);
88
91
  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`
92
+ originalSize: y.originalSize,
93
+ compiledSize: y.compiledSize,
94
+ reduction: `${y.reductionPercentage.toFixed(2)}%`,
95
+ appliedRules: w,
96
+ executionTime: `${y.executionTime.toFixed(2)}ms`
94
97
  }), {
95
- dynamicContentList: P,
96
- compiledHtml: w,
98
+ dynamicContentList: E,
99
+ compiledHtml: I,
97
100
  rawHtml: r,
98
101
  css: l,
99
- ampHtml: E,
102
+ ampHtml: D,
100
103
  ampErrors: T,
101
104
  modules: g.map(Number),
102
105
  recommendation: {
103
- campaignUrls: F.recommendationCampaignUrls,
106
+ campaignUrls: P.recommendationCampaignUrls,
104
107
  configs: {}
105
108
  },
106
109
  unsubscribe: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@useinsider/guido",
3
- "version": "3.16.0-beta.c615198",
3
+ "version": "3.16.0-beta.ff4f1bd",
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.fd01ebd",
51
52
  "@useinsider/design-system-vue": "1.5.0",
52
53
  "@vueuse/core": "11.3.0",
53
54
  "lodash-es": "4.17.21",
@@ -1,6 +0,0 @@
1
- function n(t) {
2
- return t.map((i) => String(i ?? "").trim()).filter(Boolean).join(",");
3
- }
4
- export {
5
- n as sanitizeProductIds
6
- };
@@ -1,6 +0,0 @@
1
- /**
2
- * Builds the request/URL `productId` value from raw product ID segments.
3
- * Trimming happens here — NOT on input change — so the user's in-progress
4
- * text (trailing commas, spaces) is never rewritten under the caret (SD-147111).
5
- */
6
- export declare function sanitizeProductIds(ids: readonly (string | number | null | undefined)[]): string;