@useinsider/guido 3.12.0-beta.0c5c36f → 3.12.0-beta.19da4fb

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 (72) hide show
  1. package/dist/@types/config/schemas.js +9 -4
  2. package/dist/components/Guido.vue.js +8 -8
  3. package/dist/components/Guido.vue2.js +58 -56
  4. package/dist/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue.js +38 -0
  5. package/dist/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue2.js +271 -0
  6. package/dist/components/organisms/extensions/recommendation/StrategyInfoBox.vue.js +20 -0
  7. package/dist/components/organisms/extensions/recommendation/StrategyInfoBox.vue2.js +16 -0
  8. package/dist/components/organisms/extensions/recommendation/StrategyPicker.vue.js +20 -0
  9. package/dist/components/organisms/extensions/recommendation/StrategyPicker.vue2.js +80 -0
  10. package/dist/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue.js +18 -0
  11. package/dist/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue2.js +42 -0
  12. package/dist/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue.js +20 -0
  13. package/dist/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue2.js +18 -0
  14. package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue.js +20 -0
  15. package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue2.js +60 -0
  16. package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue.js +19 -0
  17. package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue2.js +19 -0
  18. package/dist/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue.js +22 -0
  19. package/dist/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue2.js +29 -0
  20. package/dist/composables/useRecommendation.js +82 -51
  21. package/dist/composables/useStrategyFilters.js +16 -0
  22. package/dist/config/migrator/recommendationMigrator.js +7 -4
  23. package/dist/enums/date.js +4 -3
  24. package/dist/enums/extensions/filteringV2.js +1024 -0
  25. package/dist/enums/extensions/recommendationBlock.js +43 -29
  26. package/dist/enums/extensions/strategyDetail.js +148 -0
  27. package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +12 -11
  28. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +137 -119
  29. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +57 -0
  30. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +392 -112
  31. package/dist/extensions/Blocks/Recommendation/utils/strategyHumanizer.js +97 -0
  32. package/dist/extensions/Blocks/Recommendation/utils/strategyInfoBox.js +24 -0
  33. package/dist/extensions/Blocks/Recommendation/utils/strategyNavigation.js +8 -0
  34. package/dist/extensions/Blocks/Recommendation/utils/strategySummary.js +95 -0
  35. package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +24 -10
  36. package/dist/guido.css +1 -1
  37. package/dist/node_modules/@vueuse/core/index.js +48 -0
  38. package/dist/node_modules/@vueuse/shared/index.js +57 -27
  39. package/dist/services/recommendationApi.js +86 -29
  40. package/dist/src/@types/config/schemas.d.ts +10 -0
  41. package/dist/src/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue.d.ts +2 -0
  42. package/dist/src/components/organisms/extensions/recommendation/StrategyInfoBox.vue.d.ts +26 -0
  43. package/dist/src/components/organisms/extensions/recommendation/StrategyPicker.vue.d.ts +2 -0
  44. package/dist/src/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue.d.ts +43 -0
  45. package/dist/src/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue.d.ts +29 -0
  46. package/dist/src/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue.d.ts +40 -0
  47. package/dist/src/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue.d.ts +38 -0
  48. package/dist/src/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue.d.ts +51 -0
  49. package/dist/src/composables/useConfig.d.ts +2 -0
  50. package/dist/src/composables/useRecommendation.d.ts +2 -0
  51. package/dist/src/composables/useStrategyFilters.d.ts +24 -0
  52. package/dist/src/enums/extensions/filteringV2.d.ts +72 -0
  53. package/dist/src/enums/extensions/recommendationBlock.d.ts +21 -0
  54. package/dist/src/enums/extensions/strategyDetail.d.ts +90 -0
  55. package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +10 -4
  56. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +16 -0
  57. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +894 -1
  58. package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +7 -0
  59. package/dist/src/extensions/Blocks/Recommendation/utils/strategyHumanizer.d.ts +50 -0
  60. package/dist/src/extensions/Blocks/Recommendation/utils/strategyInfoBox.d.ts +33 -0
  61. package/dist/src/extensions/Blocks/Recommendation/utils/strategyNavigation.d.ts +10 -0
  62. package/dist/src/extensions/Blocks/Recommendation/utils/strategySummary.d.ts +34 -0
  63. package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +8 -1
  64. package/dist/src/mock/api/recommendation-strategies.d.ts +2 -0
  65. package/dist/src/services/recommendationApi.d.ts +8 -1
  66. package/dist/src/stores/config.d.ts +18 -0
  67. package/dist/src/utils/genericUtil.d.ts +9 -0
  68. package/dist/static/styles/base.css.js +25 -0
  69. package/dist/utils/dateUtil.js +23 -10
  70. package/dist/utils/genericUtil.js +10 -1
  71. package/dist/utils/templatePreparation.js +70 -57
  72. package/package.json +1 -1
@@ -1,11 +1,23 @@
1
1
  import { useTranslations as r } from "../../composables/useTranslations.js";
2
- const l = {
2
+ const c = {
3
3
  RECOMMENDATION_API_URL: "https://recommendationv2.api.useinsider.com",
4
4
  // Relative path → same-origin as the embedding inone dashboard.
5
- PRODUCT_ATTRIBUTES_PATH: "/product-attributes/get-attributes"
6
- }, c = {
7
- CLIENT_ID: "clientId"
8
- }, d = () => {
5
+ PRODUCT_ATTRIBUTES_PATH: "/product-attributes/get-attributes",
6
+ // Reusable Recommendation Strategies (RRS), also same-origin on inone.
7
+ RECOMMENDATION_STRATEGIES_PATH: "/api/recommendation-strategies",
8
+ STRATEGY_RECOMMENDATION_URL_PATH: "/api/recommendation-strategies/strategy-recommendation-url",
9
+ // POST, no body. Answers `{ status, message, strategyId }` — the new id only,
10
+ // never the copy's name, so the listing has to be fetched again to display it.
11
+ STRATEGY_DUPLICATE_PATH: "/api/recommendation-strategies/{{id}}/duplicate"
12
+ }, l = {
13
+ LISTING: "/discovery/recommendation-strategies",
14
+ CREATE: "/discovery/recommendation-strategies/create",
15
+ EDIT: "/discovery/recommendation-strategies/{{id}}/edit"
16
+ }, d = {
17
+ CLIENT_ID: "clientId",
18
+ STRATEGY_ID: "strategy_id",
19
+ FILTERS: "filters"
20
+ }, m = "[sr_strategies.status][=][active]*[sr_strategies.suitable_channels][~][EMAIL]", p = () => {
9
21
  const e = r();
10
22
  return [
11
23
  {
@@ -69,14 +81,14 @@ const l = {
69
81
  path: "top-sellers"
70
82
  }
71
83
  ];
72
- }, m = ["discount", "omnibus_price", "omnibus_discount", "price", "original_price"], p = [
84
+ }, v = ["discount", "omnibus_price", "omnibus_discount", "price", "original_price"], h = [
73
85
  { text: "before the amount", value: "0" },
74
86
  { text: "after the amount", value: "1" }
75
- ], v = [
87
+ ], g = [
76
88
  { text: "dot(.)", value: "." },
77
89
  { text: "comma(,)", value: "," },
78
90
  { text: "space( )", value: " " }
79
- ], h = [
91
+ ], x = [
80
92
  { text: "0", value: "0" },
81
93
  { text: "1", value: "1" },
82
94
  { text: "2", value: "2" },
@@ -88,54 +100,56 @@ const l = {
88
100
  { text: "contains", value: "~" },
89
101
  { text: "does not contain", value: "!~" },
90
102
  { text: "any of", value: a }
91
- ], n = [
103
+ ], s = [
92
104
  { text: "is exactly", value: "=" },
93
105
  { text: "is not exactly", value: "!==" },
94
106
  { text: "contains", value: "~" },
95
107
  { text: "does not contain", value: "!~" },
96
108
  { text: "any of", value: a }
97
- ], o = [
109
+ ], i = [
98
110
  { text: "is equal to", value: "=" },
99
111
  { text: "is greater than", value: ">" },
100
112
  { text: "is less than", value: "<" }
101
- ], s = [
113
+ ], n = [
102
114
  { text: "is equal to", value: "=" },
103
115
  { text: "after", value: ">" },
104
116
  { text: "before", value: "<" }
105
- ], i = [
117
+ ], o = [
106
118
  { text: "true", value: "==" },
107
119
  { text: "false", value: "!=" }
108
- ], x = (e) => {
120
+ ], T = (e) => {
109
121
  if (!e)
110
122
  return t;
111
123
  switch (e) {
112
124
  case "Boolean":
113
- return i;
125
+ return o;
114
126
  case "Date":
115
- return s;
127
+ return n;
116
128
  case "Number":
117
- return o;
129
+ return i;
118
130
  case "String":
119
131
  return t;
120
132
  case "Strings":
121
- return n;
133
+ return s;
122
134
  default:
123
135
  return t;
124
136
  }
125
137
  };
126
138
  export {
127
139
  a as OP_ANY_OF,
128
- m as PriceAttributes,
129
- c as QUERY_PARAMS,
130
- l as URLS,
131
- h as currencyDecimalCounts,
132
- p as currencyLocationMaps,
133
- v as currencyOperators,
134
- x as getOperatorOptions,
135
- d as getRecommendationFeedSourceMaps,
136
- n as operatorOptionsForArrayOfStrings,
137
- i as operatorOptionsForBooleans,
138
- s as operatorOptionsForDates,
139
- o as operatorOptionsForNumbers,
140
+ v as PriceAttributes,
141
+ d as QUERY_PARAMS,
142
+ m as RRS_EMAIL_ACTIVE_FILTER,
143
+ l as STRATEGY_PAGES,
144
+ c as URLS,
145
+ x as currencyDecimalCounts,
146
+ h as currencyLocationMaps,
147
+ g as currencyOperators,
148
+ T as getOperatorOptions,
149
+ p as getRecommendationFeedSourceMaps,
150
+ s as operatorOptionsForArrayOfStrings,
151
+ o as operatorOptionsForBooleans,
152
+ n as operatorOptionsForDates,
153
+ i as operatorOptionsForNumbers,
140
154
  t as operatorOptionsForStrings
141
155
  };
@@ -0,0 +1,148 @@
1
+ const a = "TIME", r = "COUNT", o = {
2
+ OPERATOR: {
3
+ IN_LAST: "in-last",
4
+ IN_BETWEEN: "is-between",
5
+ IN: "in",
6
+ NOT_IN: "not-in"
7
+ }
8
+ }, e = [
9
+ { value: "is-exactly", text: "campaign-builder.exactly", operator: "=" },
10
+ { value: "is-not-exactly", text: "action-builder.is-not-exactly", operator: "!=" },
11
+ { value: "contains", text: "campaign-builder.contains", operator: "~" },
12
+ { value: "does-not-contain", text: "campaign-builder.does-not-contain", operator: "!~" },
13
+ { value: "in", text: "smart-recommender.in", operator: "=" },
14
+ { value: "not-in", text: "campaign-builder.not-in", operator: "!=" },
15
+ { value: "matches-with", text: "discovery-strategy-filtering.matches-with", operator: "=" },
16
+ { value: "does-not-match-with", text: "discovery-strategy-filtering.does-not-match-with", operator: "!=" },
17
+ { value: "contains-user-context", text: "campaign-builder.contains", operator: "~" },
18
+ { value: "does-not-contain-user-context", text: "campaign-builder.does-not-contain", operator: "!~" }
19
+ ], t = [
20
+ { value: "is-equal-to", text: "campaign-builder.equal-to", operator: "=" },
21
+ { value: "is-not-equal-to", text: "smart-recommender.is-not-equal-to", operator: "!=" },
22
+ { value: "is-greater-than", text: "campaign-builder.greater-than", operator: ">" },
23
+ { value: "is-less-than", text: "campaign-builder.less-than", operator: "<" },
24
+ { value: "is-greater-than-or-equal", text: "campaign-builder.greater-than-or-equal-to", operator: ">=" },
25
+ { value: "is-less-than-or-equal", text: "campaign-builder.less-than-or-equal-to", operator: "<=" },
26
+ { value: "is-between", text: "smart-recommender.in-between", operator: "><" },
27
+ { value: "in", text: "smart-recommender.in", operator: "=" },
28
+ { value: "not-in", text: "campaign-builder.not-in", operator: "!=" },
29
+ { value: "is-exactly", text: "campaign-builder.exactly", operator: "=" }
30
+ ], i = {
31
+ Number: [
32
+ ...t,
33
+ { value: "matches-with", text: "discovery-strategy-filtering.matches-with", operator: "=" },
34
+ { value: "does-not-match-with", text: "discovery-strategy-filtering.does-not-match-with", operator: "!=" },
35
+ { value: "is-greater-than-user-context", text: "campaign-builder.greater-than", operator: ">" },
36
+ { value: "is-less-than-user-context", text: "campaign-builder.less-than", operator: "<" },
37
+ {
38
+ value: "is-greater-than-or-equal-user-context",
39
+ text: "campaign-builder.greater-than-or-equal-to",
40
+ operator: ">="
41
+ },
42
+ {
43
+ value: "is-less-than-or-equal-user-context",
44
+ text: "campaign-builder.less-than-or-equal-to",
45
+ operator: "<="
46
+ },
47
+ {
48
+ value: "is-more-than-currently-viewing-item-page-context",
49
+ text: "discovery-strategy-filtering.in-range-greater-than",
50
+ operator: "><"
51
+ },
52
+ {
53
+ value: "is-less-than-currently-viewing-item-page-context",
54
+ text: "discovery-strategy-filtering.in-range-less-than",
55
+ operator: "><"
56
+ },
57
+ {
58
+ value: "is-more-or-less-than-currently-viewing-item-page-context",
59
+ text: "discovery-strategy-filtering.in-range-less-or-greater-than",
60
+ operator: "><"
61
+ }
62
+ ],
63
+ String: e,
64
+ "Array[String]": e,
65
+ Array: e,
66
+ Strings: e,
67
+ Numbers: e,
68
+ Booleans: e,
69
+ Dates: [
70
+ { value: "is-exactly", text: "campaign-builder.exactly", operator: "=" },
71
+ { value: "is-not-exactly", text: "action-builder.is-not-exactly", operator: "!=" },
72
+ { value: "contains", text: "campaign-builder.contains", operator: "~" },
73
+ { value: "does-not-contain", text: "campaign-builder.does-not-contain", operator: "!~" },
74
+ { value: "in", text: "smart-recommender.in", operator: "=" },
75
+ { value: "not-in", text: "campaign-builder.not-in", operator: "!=" }
76
+ ],
77
+ Boolean: [
78
+ { value: "true", text: "smart-recommender.is-true", operator: "=" },
79
+ { value: "false", text: "smart-recommender.is-false", operator: "=" }
80
+ ],
81
+ Image: [
82
+ { value: "is-equal-to", text: "campaign-builder.exactly", operator: "=" },
83
+ { value: "contains", text: "campaign-builder.contains", operator: "~" },
84
+ { value: "does-not-contain", text: "campaign-builder.does-not-contain", operator: "!~" },
85
+ { value: "is-empty", text: "condition.empty", operator: "?" },
86
+ { value: "is-not-empty", text: "condition.not-empty", operator: "!?" }
87
+ ],
88
+ Date: [
89
+ { value: "after", text: "campaign-builder.after", operator: ">" },
90
+ { value: "before", text: "campaign-builder.before", operator: "<" },
91
+ { value: "is", text: "campaign-builder.is", operator: "=" },
92
+ { value: "is-not", text: "campaign-builder.is-not", operator: "!=" },
93
+ { value: "in-last", text: "purchase-history.in-last", operator: "<=" },
94
+ { value: "matches-with", text: "discovery-strategy-filtering.matches-with", operator: "=" },
95
+ { value: "does-not-match-with", text: "discovery-strategy-filtering.does-not-match-with", operator: "!=" },
96
+ { value: "after-user-context", text: "campaign-builder.after", operator: ">" },
97
+ { value: "before-user-context", text: "campaign-builder.before", operator: "<" }
98
+ ],
99
+ Object: t
100
+ }, n = {
101
+ STRING: "String",
102
+ DATE: "Date"
103
+ }, s = ["Strings", "String", "Array"], l = {
104
+ IS_EXACTLY: "is-exactly",
105
+ IS_NOT_EXACTLY: "is-not-exactly",
106
+ CONTAINS: "contains",
107
+ NOT_CONTAINS: "does-not-contain"
108
+ }, c = {
109
+ USER_CONTEXT_FILTER: "userContextFilter",
110
+ USER_ATTRIBUTE_FILTER: "userAttributeFilter",
111
+ USER_EVENT_FILTER: "userEventFilter",
112
+ EVENT_BASED_FILTER: "eventBasedFilter"
113
+ }, u = {
114
+ CURRENTLY_VIEWED_ITEM: "page",
115
+ LEGACY_CURRENTLY_VIEWED_ITEM: "currentlyViewedItem"
116
+ }, p = [
117
+ { value: "lastViewed", text: "discovery-strategy-filtering.users-last-viewed" },
118
+ { value: "lastPurchased", text: "discovery-strategy-filtering.users-last-purchased" },
119
+ { value: "lastAddedToCart", text: "discovery-strategy-filtering.users-last-added-to-cart" },
120
+ { value: "lastRemovedFromCart", text: "discovery-strategy-filtering.users-last-removed-from-cart" },
121
+ { value: "lastAddedToWishlist", text: "discovery-strategy-filtering.users-last-added-to-wishlist" },
122
+ { value: "lastRemovedFromWishlist", text: "discovery-strategy-filtering.users-last-removed-from-wishlist" },
123
+ { value: "page", text: "discovery-strategy-filtering.currently-viewed-item-on-page" },
124
+ { value: "currentlyViewedItem", text: "discovery-strategy-filtering.currently-viewed-item-on-page" }
125
+ ], d = "email", g = {
126
+ CATEGORY: "products.category-pages",
127
+ PRODUCT: "products.product-article-pages",
128
+ CART: "products.cart-pages",
129
+ ALL_PAGES: "products.all-pages"
130
+ }, v = {
131
+ GENERAL: "general",
132
+ OTHER: "other"
133
+ };
134
+ export {
135
+ r as COUNT,
136
+ n as DataTypes,
137
+ v as DetailTabs,
138
+ d as EMAIL_CHANNEL,
139
+ c as FilterTypeNames,
140
+ s as MultiSelectDataTypes,
141
+ o as OperatorAbbreviations,
142
+ l as OperatorNames,
143
+ i as Operators,
144
+ g as PageTypeTranslationKeys,
145
+ a as TIME,
146
+ u as UserEventKeys,
147
+ p as UserEvents
148
+ };
@@ -1,16 +1,16 @@
1
- import { DEFAULT_COLUMN_SPACING as n, DEFAULT_ROW_SPACING as s, DEFAULT_MOBILE_ROW_SPACING as R, DEFAULT_MOBILE_COLUMN_SPACING as U, DEFAULT_MOBILE_CARDS_IN_ROW as e, DEFAULT_CARDS_IN_ROW as C } from "./layout.js";
1
+ import { DEFAULT_COLUMN_SPACING as n, DEFAULT_ROW_SPACING as s, DEFAULT_MOBILE_ROW_SPACING as R, DEFAULT_MOBILE_COLUMN_SPACING as U, DEFAULT_MOBILE_CARDS_IN_ROW as e, DEFAULT_CARDS_IN_ROW as a } from "./layout.js";
2
2
  import { ATTR_PRODUCT_IMAGE as o, ATTR_PRODUCT_NAME as t, ATTR_PRODUCT_OLD_PRICE as _, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_OMNIBUS_PRICE as r, ATTR_PRODUCT_OMNIBUS_DISCOUNT as i, ATTR_PRODUCT_BUTTON as I } from "./selectors.js";
3
- const D = {
3
+ const C = {
4
4
  code: "USD",
5
5
  symbol: "USD",
6
6
  alignment: "after",
7
7
  decimalCount: 2,
8
8
  decimalSeparator: ".",
9
9
  thousandSeparator: ","
10
- }, O = {
10
+ }, D = {
11
11
  textBefore: "",
12
12
  textAfter: ""
13
- }, a = {
13
+ }, O = {
14
14
  textBefore: "",
15
15
  textAfter: ""
16
16
  }, A = [
@@ -32,15 +32,16 @@ const D = {
32
32
  }, l = {
33
33
  // Settings
34
34
  strategy: "mostPopular",
35
+ strategyId: "",
35
36
  productIds: [],
36
37
  size: "6",
37
38
  shuffleProducts: !1,
38
39
  language: "en_US",
39
- currency: D,
40
+ currency: C,
40
41
  filters: [],
41
42
  // Layout
42
43
  layout: "grid",
43
- cardsInRow: C,
44
+ cardsInRow: a,
44
45
  mobileCardsInRow: e,
45
46
  mobileLayoutEnabled: !1,
46
47
  previousMobileCardsInRow: e,
@@ -52,8 +53,8 @@ const D = {
52
53
  composition: A,
53
54
  visibility: c,
54
55
  // Element settings
55
- omnibusPrice: O,
56
- omnibusDiscount: a,
56
+ omnibusPrice: D,
57
+ omnibusDiscount: O,
57
58
  textTrimming: !1,
58
59
  // Price placement (block-level, affects all cards)
59
60
  // Default ON = current stacked look, so existing templates are unaffected.
@@ -71,10 +72,10 @@ const D = {
71
72
  export {
72
73
  m as CURRENT_CONFIG_VERSION,
73
74
  A as DEFAULT_COMPOSITION,
74
- D as DEFAULT_CURRENCY,
75
+ C as DEFAULT_CURRENCY,
75
76
  l as DEFAULT_NODE_CONFIG,
76
- a as DEFAULT_OMNIBUS_DISCOUNT,
77
- O as DEFAULT_OMNIBUS_PRICE,
77
+ O as DEFAULT_OMNIBUS_DISCOUNT,
78
+ D as DEFAULT_OMNIBUS_PRICE,
78
79
  c as DEFAULT_VISIBILITY,
79
80
  N as EXCLUDED_ALGORITHM_IDS
80
81
  };