@useinsider/guido 1.0.3-beta.dbf4a88 → 1.0.3-beta.df46976

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 (204) hide show
  1. package/README.md +4 -0
  2. package/dist/{src/@types → @types}/generic.d.ts +5 -0
  3. package/dist/{src/components → components}/Guido.vue.d.ts +1 -0
  4. package/dist/components/Guido.vue.js +11 -9
  5. package/dist/components/Guido.vue2.js +38 -37
  6. package/dist/components/organisms/extensions/recommendation/FilterItem.vue.d.ts +19 -0
  7. package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +28 -0
  8. package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +38 -0
  9. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.js +17 -0
  10. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +37 -0
  11. package/dist/components/organisms/extensions/recommendation/Filters.vue.js +20 -0
  12. package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +44 -0
  13. package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue.d.ts +16 -0
  14. package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue.js +17 -0
  15. package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue2.js +27 -0
  16. package/dist/components/organisms/onboarding/NewVersionPopup.vue.d.ts +4 -0
  17. package/dist/components/organisms/onboarding/NewVersionPopup.vue.js +9 -9
  18. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +29 -17
  19. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.d.ts +4 -0
  20. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +12 -10
  21. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +19 -18
  22. package/dist/composables/useStripo.js +37 -36
  23. package/dist/enums/date.d.ts +13 -0
  24. package/dist/enums/date.js +16 -0
  25. package/dist/enums/defaults.js +4 -3
  26. package/dist/enums/extensions/recommendationBlock.d.ts +16 -0
  27. package/dist/enums/extensions/recommendationBlock.js +80 -0
  28. package/dist/extensions/Blocks/RadioButton/template.js +6 -6
  29. package/dist/extensions/Blocks/Recommendation/block.d.ts +10 -0
  30. package/dist/extensions/Blocks/Recommendation/block.js +27 -0
  31. package/dist/extensions/Blocks/Recommendation/control.d.ts +29 -0
  32. package/dist/extensions/Blocks/Recommendation/control.js +277 -0
  33. package/dist/extensions/Blocks/Recommendation/extension.js +10 -0
  34. package/dist/extensions/Blocks/Recommendation/iconsRegistry.d.ts +4 -0
  35. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +51 -0
  36. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +19 -0
  37. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +32 -0
  38. package/dist/extensions/Blocks/Recommendation/store/recommendation.d.ts +555 -0
  39. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +266 -0
  40. package/dist/extensions/Blocks/Recommendation/template.d.ts +6 -0
  41. package/dist/extensions/Blocks/Recommendation/template.js +200 -0
  42. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.d.ts +7 -0
  43. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +28 -0
  44. package/dist/extensions/Blocks/_Boilerplate/settingsPanel.d.ts +4 -0
  45. package/dist/extensions/Blocks/common-control.d.ts +66 -0
  46. package/dist/extensions/Blocks/common-control.js +102 -0
  47. package/dist/extensions/DynamicContent/extension.d.ts +2 -0
  48. package/dist/guido.css +1 -1
  49. package/dist/mock/api/validator.d.ts +2 -0
  50. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +83 -72
  51. package/dist/services/recommendationApi.d.ts +6 -0
  52. package/dist/services/recommendationApi.js +43 -0
  53. package/dist/{src/stores → stores}/config.d.ts +1 -0
  54. package/dist/{src/stores → stores}/editor.d.ts +21 -0
  55. package/dist/stores/editor.js +2 -1
  56. package/dist/utils/dateUtil.d.ts +2 -0
  57. package/dist/utils/dateUtil.js +7 -12
  58. package/dist/{src/utils → utils}/genericUtil.d.ts +1 -0
  59. package/dist/utils/genericUtil.js +8 -7
  60. package/package.json +2 -7
  61. package/dist/package.json.js +0 -7
  62. package/dist/src/utils/dateUtil.d.ts +0 -1
  63. /package/dist/{src/@types → @types}/events.d.ts +0 -0
  64. /package/dist/{src/@types → @types}/save-as-template.d.ts +0 -0
  65. /package/dist/{src/App.vue.d.ts → App.vue.d.ts} +0 -0
  66. /package/dist/{src/components → components}/organisms/LoadingWrapper.vue.d.ts +0 -0
  67. /package/dist/{src/components → components}/organisms/base/Toaster.vue.d.ts +0 -0
  68. /package/dist/{src/components → components}/organisms/email-preview/PreviewContainer.vue.d.ts +0 -0
  69. /package/dist/{src/components → components}/organisms/email-preview/amp/AmpErrorModal.vue.d.ts +0 -0
  70. /package/dist/{src/components → components}/organisms/email-preview/amp/AmpToggle.vue.d.ts +0 -0
  71. /package/dist/{src/components → components}/organisms/email-preview/desktop-preview/DesktopPreview.vue.d.ts +0 -0
  72. /package/dist/{src/components → components}/organisms/email-preview/desktop-preview/EmailHeaderInfo.vue.d.ts +0 -0
  73. /package/dist/{src/components → components}/organisms/email-preview/desktop-preview/EmailSizeIndicator.vue.d.ts +0 -0
  74. /package/dist/{src/components → components}/organisms/email-preview/mobile-preview/ContentView.vue.d.ts +0 -0
  75. /package/dist/{src/components → components}/organisms/email-preview/mobile-preview/InboxView.vue.d.ts +0 -0
  76. /package/dist/{src/components → components}/organisms/email-preview/mobile-preview/MobilePreview.vue.d.ts +0 -0
  77. /package/dist/{src/components/organisms/header/LeftSlot.vue.d.ts → components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.d.ts} +0 -0
  78. /package/dist/{src/components/organisms/header/MiddleSlot.vue.d.ts → components/organisms/extensions/recommendation/Filters.vue.d.ts} +0 -0
  79. /package/dist/{src/components → components}/organisms/header/HeaderWrapper.vue.d.ts +0 -0
  80. /package/dist/{src/components/organisms/header/ViewOptions.vue.d.ts → components/organisms/header/LeftSlot.vue.d.ts} +0 -0
  81. /package/dist/{src/components/organisms/header/version-history/RestoreButton.vue.d.ts → components/organisms/header/MiddleSlot.vue.d.ts} +0 -0
  82. /package/dist/{src/components → components}/organisms/header/RightSlot.vue.d.ts +0 -0
  83. /package/dist/{src/components/organisms/header/version-history → components/organisms/header}/ViewOptions.vue.d.ts +0 -0
  84. /package/dist/{src/components/organisms/onboarding/AMPOnboarding.vue.d.ts → components/organisms/header/version-history/RestoreButton.vue.d.ts} +0 -0
  85. /package/dist/{src/components → components}/organisms/header/version-history/VersionHistory.vue.d.ts +0 -0
  86. /package/dist/{src/components → components}/organisms/header/version-history/VersionHistoryItem.vue.d.ts +0 -0
  87. /package/dist/{src/components/organisms/onboarding/GenericOnboarding.vue.d.ts → components/organisms/header/version-history/ViewOptions.vue.d.ts} +0 -0
  88. /package/dist/{src/components/organisms/onboarding/NewVersionPopup.vue.d.ts → components/organisms/onboarding/AMPOnboarding.vue.d.ts} +0 -0
  89. /package/dist/{src/components/organisms/onboarding/OnboardingWrapper.vue.d.ts → components/organisms/onboarding/GenericOnboarding.vue.d.ts} +0 -0
  90. /package/dist/{src/components → components}/organisms/onboarding/TextBlockOnboarding.vue.d.ts +0 -0
  91. /package/dist/{src/components → components}/organisms/onboarding/VersionHistoryOnboarding.vue.d.ts +0 -0
  92. /package/dist/{src/components → components}/organisms/save-as-template/SaveAsTemplateDrawer.vue.d.ts +0 -0
  93. /package/dist/{src/components → components}/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.d.ts +0 -0
  94. /package/dist/{src/components → components}/organisms/unsubscribe/UnsubscribePageSelection.vue.d.ts +0 -0
  95. /package/dist/{src/components → components}/organisms/unsubscribe/UnsubscribeTypeSelection.vue.d.ts +0 -0
  96. /package/dist/{src/components → components}/organisms/unsubscribe/UnsubscribeWrapper.vue.d.ts +0 -0
  97. /package/dist/{src/components → components}/wrappers/WpDrawer.vue.d.ts +0 -0
  98. /package/dist/{src/components → components}/wrappers/WpModal.vue.d.ts +0 -0
  99. /package/dist/{src/composables → composables}/useActionsApi.d.ts +0 -0
  100. /package/dist/{src/composables → composables}/useApiExample.d.ts +0 -0
  101. /package/dist/{src/composables → composables}/useCodeEditorApi.d.ts +0 -0
  102. /package/dist/{src/composables → composables}/useConfig.d.ts +0 -0
  103. /package/dist/{src/composables → composables}/useCustomInterfaceAppearance.d.ts +0 -0
  104. /package/dist/{src/composables → composables}/useDebounce.d.ts +0 -0
  105. /package/dist/{src/composables → composables}/useExport.d.ts +0 -0
  106. /package/dist/{src/composables → composables}/useGuidoActions.d.ts +0 -0
  107. /package/dist/{src/composables → composables}/useHtmlCompiler.d.ts +0 -0
  108. /package/dist/{src/composables → composables}/useHtmlValidator.d.ts +0 -0
  109. /package/dist/{src/composables → composables}/useHttp.d.ts +0 -0
  110. /package/dist/{src/composables → composables}/usePartner.d.ts +0 -0
  111. /package/dist/{src/composables → composables}/usePreviewMode.d.ts +0 -0
  112. /package/dist/{src/composables → composables}/useProvideInject.d.ts +0 -0
  113. /package/dist/{src/composables → composables}/useRecommendation.d.ts +0 -0
  114. /package/dist/{src/composables → composables}/useResponsivePreview.d.ts +0 -0
  115. /package/dist/{src/composables → composables}/useSave.d.ts +0 -0
  116. /package/dist/{src/composables → composables}/useStripo.d.ts +0 -0
  117. /package/dist/{src/composables → composables}/useStripoEventHandler.d.ts +0 -0
  118. /package/dist/{src/composables → composables}/useToaster.d.ts +0 -0
  119. /package/dist/{src/composables → composables}/useTranslations.d.ts +0 -0
  120. /package/dist/{src/composables → composables}/useValidation.d.ts +0 -0
  121. /package/dist/{src/composables → composables}/useVersionHistoryApi.d.ts +0 -0
  122. /package/dist/{src/composables → composables}/validators/saveAsTemplate.d.ts +0 -0
  123. /package/dist/{src/config → config}/compiler/htmlCompilerRules.d.ts +0 -0
  124. /package/dist/{src/config → config}/compiler/outlookCompilerRules.d.ts +0 -0
  125. /package/dist/{src/config → config}/compiler/recommendationCompilerRules.d.ts +0 -0
  126. /package/dist/{src/config → config}/compiler/socialCompilerRules.d.ts +0 -0
  127. /package/dist/{src/config → config}/compiler/unsubscribeCompilerRules.d.ts +0 -0
  128. /package/dist/{src/config → config}/migrator/checkboxMigrator.d.ts +0 -0
  129. /package/dist/{src/config → config}/migrator/couponBlockMigrator.d.ts +0 -0
  130. /package/dist/{src/config → config}/migrator/index.d.ts +0 -0
  131. /package/dist/{src/config → config}/migrator/radioButtonMigrator.d.ts +0 -0
  132. /package/dist/{src/config → config}/migrator/unsubscribeMigrator.d.ts +0 -0
  133. /package/dist/{src/enums → enums}/defaults.d.ts +0 -0
  134. /package/dist/{src/enums → enums}/displayConditions.d.ts +0 -0
  135. /package/dist/{src/enums → enums}/html-validator.d.ts +0 -0
  136. /package/dist/{src/enums → enums}/onboarding.d.ts +0 -0
  137. /package/dist/{src/enums → enums}/preview.d.ts +0 -0
  138. /package/dist/{src/enums → enums}/recommendation.d.ts +0 -0
  139. /package/dist/{src/enums → enums}/toaster.d.ts +0 -0
  140. /package/dist/{src/enums → enums}/unsubscribe.d.ts +0 -0
  141. /package/dist/{src/extensions → extensions}/Blocks/Checkbox/block.d.ts +0 -0
  142. /package/dist/{src/extensions → extensions}/Blocks/Checkbox/control.d.ts +0 -0
  143. /package/dist/{src/extensions → extensions}/Blocks/Checkbox/extension.d.ts +0 -0
  144. /package/dist/{src/extensions → extensions}/Blocks/Checkbox/iconsRegistry.d.ts +0 -0
  145. /package/dist/{src/extensions → extensions}/Blocks/Checkbox/settingsPanel.d.ts +0 -0
  146. /package/dist/{src/extensions → extensions}/Blocks/Checkbox/template.d.ts +0 -0
  147. /package/dist/{src/extensions → extensions}/Blocks/CouponBlock/block.d.ts +0 -0
  148. /package/dist/{src/extensions → extensions}/Blocks/CouponBlock/extension.d.ts +0 -0
  149. /package/dist/{src/extensions → extensions}/Blocks/CouponBlock/iconsRegistry.d.ts +0 -0
  150. /package/dist/{src/extensions → extensions}/Blocks/CouponBlock/settingsPanel.d.ts +0 -0
  151. /package/dist/{src/extensions → extensions}/Blocks/CouponBlock/template.d.ts +0 -0
  152. /package/dist/{src/extensions → extensions}/Blocks/RadioButton/block.d.ts +0 -0
  153. /package/dist/{src/extensions → extensions}/Blocks/RadioButton/control.d.ts +0 -0
  154. /package/dist/{src/extensions → extensions}/Blocks/RadioButton/extension.d.ts +0 -0
  155. /package/dist/{src/extensions → extensions}/Blocks/RadioButton/iconsRegistry.d.ts +0 -0
  156. /package/dist/{src/extensions → extensions}/Blocks/RadioButton/settingsPanel.d.ts +0 -0
  157. /package/dist/{src/extensions → extensions}/Blocks/RadioButton/template.d.ts +0 -0
  158. /package/dist/{src/extensions/Blocks/Unsubscribe → extensions/Blocks/Recommendation}/extension.d.ts +0 -0
  159. /package/dist/{src/extensions/Blocks/Unsubscribe → extensions/Blocks/Recommendation}/settingsPanel.d.ts +0 -0
  160. /package/dist/{src/extensions → extensions}/Blocks/Unsubscribe/block.d.ts +0 -0
  161. /package/dist/{src/extensions → extensions}/Blocks/Unsubscribe/control.d.ts +0 -0
  162. /package/dist/{src/extensions → extensions}/Blocks/Unsubscribe/elements/preview.d.ts +0 -0
  163. /package/dist/{src/extensions/Blocks/_Boilerplate → extensions/Blocks/Unsubscribe}/extension.d.ts +0 -0
  164. /package/dist/{src/extensions → extensions}/Blocks/Unsubscribe/iconsRegistry.d.ts +0 -0
  165. /package/dist/{src/extensions/Blocks/_Boilerplate → extensions/Blocks/Unsubscribe}/settingsPanel.d.ts +0 -0
  166. /package/dist/{src/extensions → extensions}/Blocks/Unsubscribe/tagRegistry.d.ts +0 -0
  167. /package/dist/{src/extensions → extensions}/Blocks/Unsubscribe/template.d.ts +0 -0
  168. /package/dist/{src/extensions → extensions}/Blocks/Unsubscribe/utils/constants.d.ts +0 -0
  169. /package/dist/{src/extensions → extensions}/Blocks/Unsubscribe/utils/utils.d.ts +0 -0
  170. /package/dist/{src/extensions → extensions}/Blocks/_Boilerplate/block.d.ts +0 -0
  171. /package/dist/{src/extensions → extensions}/Blocks/_Boilerplate/control.d.ts +0 -0
  172. /package/dist/{src/extensions/DynamicContent → extensions/Blocks/_Boilerplate}/extension.d.ts +0 -0
  173. /package/dist/{src/extensions → extensions}/Blocks/_Boilerplate/iconsRegistry.d.ts +0 -0
  174. /package/dist/{src/extensions → extensions}/Blocks/_Boilerplate/template.d.ts +0 -0
  175. /package/dist/{src/extensions → extensions}/DynamicContent/dynamic-content-modal.d.ts +0 -0
  176. /package/dist/{src/extensions → extensions}/DynamicContent/dynamic-content.d.ts +0 -0
  177. /package/dist/{src/library.d.ts → library.d.ts} +0 -0
  178. /package/dist/{src/main.d.ts → main.d.ts} +0 -0
  179. /package/dist/{src/mock → mock}/api/auth.d.ts +0 -0
  180. /package/dist/{src/mock → mock}/api/custom-fonts.d.ts +0 -0
  181. /package/dist/{src/mock → mock}/api/default-template.d.ts +0 -0
  182. /package/dist/{src/mock/api/template-library.d.ts → mock/api/recommendation.d.ts} +0 -0
  183. /package/dist/{src/mock/api/unsubscribe.d.ts → mock/api/template-library.d.ts} +0 -0
  184. /package/dist/{src/mock/api/user-modal-state.d.ts → mock/api/unsubscribe.d.ts} +0 -0
  185. /package/dist/{src/mock/api/validator.d.ts → mock/api/user-modal-state.d.ts} +0 -0
  186. /package/dist/{src/mock → mock}/browser.d.ts +0 -0
  187. /package/dist/{src/mock → mock}/handlers.d.ts +0 -0
  188. /package/dist/{src/services → services}/onboardingApi.d.ts +0 -0
  189. /package/dist/{src/services → services}/stripoApi.d.ts +0 -0
  190. /package/dist/{src/services → services}/templateLibraryApi.d.ts +0 -0
  191. /package/dist/{src/services → services}/unsubscribeApi.d.ts +0 -0
  192. /package/dist/{src/stores → stores}/dynamic-content.d.ts +0 -0
  193. /package/dist/{src/stores → stores}/onboarding.d.ts +0 -0
  194. /package/dist/{src/stores → stores}/preview.d.ts +0 -0
  195. /package/dist/{src/stores → stores}/recommendation.d.ts +0 -0
  196. /package/dist/{src/stores → stores}/save-as-template.d.ts +0 -0
  197. /package/dist/{src/stores → stores}/toaster.d.ts +0 -0
  198. /package/dist/{src/stores → stores}/unsubscribe.d.ts +0 -0
  199. /package/dist/{src/stores → stores}/version-history.d.ts +0 -0
  200. /package/dist/{src/utils → utils}/arrayUtil.d.ts +0 -0
  201. /package/dist/{src/utils → utils}/base64.d.ts +0 -0
  202. /package/dist/{src/utils → utils}/htmlCompiler.d.ts +0 -0
  203. /package/dist/{src/utils → utils}/templatePreparation.d.ts +0 -0
  204. /package/dist/{src/utils → utils}/tooltipUtils.d.ts +0 -0
@@ -0,0 +1,266 @@
1
+ import { RecommendationFeedSourceMaps as s, PriceAttributes as l } from "../../../../enums/extensions/recommendationBlock.js";
2
+ import { useRecommendationApi as c } from "../../../../services/recommendationApi.js";
3
+ import { defineStore as p } from "pinia";
4
+ import { generateCompleteFilterQuery as m } from "../utils/filterUtil.js";
5
+ const a = c(), d = () => ({
6
+ recommendationCampaignUrls: {},
7
+ recommendationProducts: [],
8
+ recommendationConfigs: {
9
+ cardsInRow: 3,
10
+ currencySettings: {
11
+ name: "USD",
12
+ value: "USD",
13
+ symbol: "USD",
14
+ alignment: "1",
15
+ decimalCount: "2",
16
+ decimalSeparator: ",",
17
+ thousandSeparator: "."
18
+ },
19
+ filters: [
20
+ {
21
+ type: "standardFilter",
22
+ attribute: "product_attributes.rating_star",
23
+ operatorReplace: "=",
24
+ operator: "=",
25
+ innerGroupOperator: "*",
26
+ outerGroupOperator: "*",
27
+ value: "5",
28
+ filterGroup: 1,
29
+ filterNumber: 1,
30
+ isValid: !0
31
+ },
32
+ {
33
+ type: "standardFilter",
34
+ attribute: "gender",
35
+ operatorReplace: "=",
36
+ operator: "=",
37
+ innerGroupOperator: "|",
38
+ outerGroupOperator: "*",
39
+ value: "male",
40
+ filterGroup: 1,
41
+ filterNumber: 2,
42
+ isValid: !0
43
+ },
44
+ {
45
+ type: "standardFilter",
46
+ attribute: "size",
47
+ operatorReplace: "=",
48
+ operator: "=",
49
+ innerGroupOperator: "*",
50
+ outerGroupOperator: "*",
51
+ value: "L",
52
+ filterGroup: 1,
53
+ filterNumber: 3,
54
+ isValid: !0
55
+ },
56
+ {
57
+ type: "standardFilter",
58
+ attribute: "price.USD",
59
+ operatorReplace: ">",
60
+ operator: ">",
61
+ innerGroupOperator: "*",
62
+ outerGroupOperator: "*",
63
+ value: "20",
64
+ filterGroup: 2,
65
+ filterNumber: 1,
66
+ isValid: !0
67
+ },
68
+ {
69
+ type: "standardFilter",
70
+ attribute: "url",
71
+ operatorReplace: "~",
72
+ operator: "~",
73
+ innerGroupOperator: "|",
74
+ outerGroupOperator: "*",
75
+ value: "user",
76
+ filterGroup: 2,
77
+ filterNumber: 2,
78
+ isValid: !0
79
+ },
80
+ {
81
+ type: "standardFilter",
82
+ attribute: "category",
83
+ operatorReplace: "!~",
84
+ operator: "!~",
85
+ innerGroupOperator: "*",
86
+ outerGroupOperator: "|",
87
+ value: "t-shirt",
88
+ filterGroup: 3,
89
+ filterNumber: 1,
90
+ isValid: !0
91
+ },
92
+ {
93
+ type: "standardFilter",
94
+ attribute: "omnibus_price.USD",
95
+ operatorReplace: ">",
96
+ operator: ">",
97
+ innerGroupOperator: "*",
98
+ outerGroupOperator: "|",
99
+ value: "31",
100
+ filterGroup: 3,
101
+ filterNumber: 2,
102
+ isValid: !0
103
+ },
104
+ {
105
+ type: "standardFilter",
106
+ attribute: "omnibus_discount.USD",
107
+ operatorReplace: "<",
108
+ operator: "%3C",
109
+ innerGroupOperator: "|",
110
+ outerGroupOperator: "|",
111
+ value: "20",
112
+ filterGroup: 3,
113
+ filterNumber: 3,
114
+ isValid: !0
115
+ }
116
+ ],
117
+ productIds: ["22", "12"],
118
+ id: 1,
119
+ language: "tr_TR",
120
+ orientation: "vertical",
121
+ recommendedProducts: [],
122
+ sendProductRequestFlag: !1,
123
+ shuffleProducts: !1,
124
+ strategy: "mostPopular",
125
+ textTrimming: !0,
126
+ unresponsive: !1,
127
+ size: "9"
128
+ },
129
+ activePredictiveAlgorithms: [],
130
+ languages: {},
131
+ currencyList: [],
132
+ filterStatus: !1,
133
+ filterSelectionDrawerStatus: !1,
134
+ filterList: {},
135
+ filterGroup: 1
136
+ }), G = p("recommendationExtension", {
137
+ state: () => d(),
138
+ getters: {
139
+ hasFilters: (e) => !!e.recommendationConfigs.filters.length,
140
+ getFilterGroupCount: (e) => {
141
+ const { filters: t } = e.recommendationConfigs;
142
+ return t.length && t[t.length - 1].filterGroup || 0;
143
+ },
144
+ getActivePredictiveAlgorithms: (e) => {
145
+ const t = [];
146
+ return e.activePredictiveAlgorithms.forEach((r) => {
147
+ t.push(...s.filter((i) => i.id === r));
148
+ }), t.map((r) => ({
149
+ text: r.name,
150
+ value: r.key
151
+ }));
152
+ },
153
+ getLanguages: (e) => Object.entries(e.languages).map(([t, r]) => ({
154
+ text: r,
155
+ value: t
156
+ })),
157
+ getCurrencySymbolList: (e) => e.currencyList.map((t) => ({
158
+ text: t.text,
159
+ value: t.text
160
+ })),
161
+ getFilterList: (e) => Object.values(e.filterList).map((t) => {
162
+ const r = t.type === "defaultAttribute", i = l.includes(t.attributeName);
163
+ let o = r ? t.attributeName : `product_attributes.${t.attributeName}`;
164
+ return o = i ? `${o}.${e.recommendationConfigs.currencySettings.value}` : o, {
165
+ text: t.displayName,
166
+ value: o,
167
+ type: t.attributeType
168
+ };
169
+ }),
170
+ getSelectedFilterGroup: (e) => (t) => [...e.recommendationConfigs.filters].filter((r) => r.filterGroup === t)
171
+ },
172
+ actions: {
173
+ async fetchRecommendationCreateData() {
174
+ if (this.activePredictiveAlgorithms.length)
175
+ return;
176
+ const {
177
+ activePredictiveAlgorithms: e,
178
+ languages: t,
179
+ currencies: r
180
+ } = await a.fetchRecommendationCreateData();
181
+ this.activePredictiveAlgorithms = e, this.languages = t;
182
+ const [i] = r;
183
+ this.recommendationConfigs.currencySettings.name = i.text, this.recommendationConfigs.currencySettings.value = i.value, this.currencyList = r, this.filterStatus = !!this.recommendationConfigs.filters.length;
184
+ },
185
+ async fetchRecommendationFilters() {
186
+ const e = await a.fetchRecommendationFilters();
187
+ this.filterList = e;
188
+ },
189
+ addFilterGroup(e) {
190
+ this.recommendationConfigs.filters.push({
191
+ type: "standardFilter",
192
+ attribute: "",
193
+ operatorReplace: "",
194
+ operator: "",
195
+ innerGroupOperator: "",
196
+ outerGroupOperator: "",
197
+ value: "",
198
+ filterNumber: 1,
199
+ isValid: !0,
200
+ filterGroup: e
201
+ });
202
+ },
203
+ updateFilter(e) {
204
+ const t = this.recommendationConfigs.filters.findIndex((r) => r.filterNumber === e.filterNumber && r.filterGroup === e.filterGroup);
205
+ if (t !== -1) {
206
+ const r = [...this.recommendationConfigs.filters];
207
+ r[t] = e, e.value.length && e.operator && e.attribute && e.innerGroupOperator && e.outerGroupOperator ? r[t].isValid = !0 : r[t].isValid = !1, this.$patch({
208
+ recommendationConfigs: {
209
+ filters: r
210
+ }
211
+ });
212
+ }
213
+ },
214
+ deleteFilter(e) {
215
+ const t = [...this.recommendationConfigs.filters].findIndex((r) => r.filterNumber === e.filterNumber && r.filterGroup === e.filterGroup);
216
+ if (t !== -1) {
217
+ const r = [...this.recommendationConfigs.filters];
218
+ r.splice(t, 1), this.$patch({
219
+ recommendationConfigs: {
220
+ filters: r
221
+ }
222
+ });
223
+ }
224
+ },
225
+ addFilter(e) {
226
+ const t = [...this.recommendationConfigs.filters], r = t.findLastIndex((i) => i.filterGroup === e.filterGroup);
227
+ r !== -1 ? t.splice(r + 1, 0, {
228
+ ...e,
229
+ filterNumber: r + 2
230
+ }) : t.push({
231
+ ...e,
232
+ filterNumber: 1
233
+ }), this.$patch({
234
+ recommendationConfigs: {
235
+ filters: t
236
+ }
237
+ });
238
+ },
239
+ generateFilterQuery() {
240
+ return m(this.recommendationConfigs.filters);
241
+ },
242
+ async fetchRecommendationProducts() {
243
+ var i, o, n;
244
+ const e = this.generateFilterQuery(), t = ((i = s.find((u) => u.key === this.recommendationConfigs.strategy)) == null ? void 0 : i.path) || "", r = await a.fetchRecommendationProducts(
245
+ t,
246
+ {
247
+ // TODO: Here will be optimized and filled carefully
248
+ locale: this.recommendationConfigs.language,
249
+ currency: this.recommendationConfigs.currencySettings.value,
250
+ partnerName: ((n = (o = window.GuidoConfig) == null ? void 0 : o.partner) == null ? void 0 : n.partnerName) || "",
251
+ productId: this.recommendationConfigs.strategy === "manualMerchandising" ? this.recommendationConfigs.productIds.join(",") : "{itemId}",
252
+ size: this.recommendationConfigs.size,
253
+ details: !0,
254
+ campaignId: "{campaignId}",
255
+ filter: e
256
+ }
257
+ );
258
+ this.$patch({
259
+ recommendationProducts: r
260
+ });
261
+ }
262
+ }
263
+ });
264
+ export {
265
+ G as useRecommendationExtensionStore
266
+ };
@@ -0,0 +1,6 @@
1
+ declare const migrationTemplate = "ADD YOUR MIGRATION HERE";
2
+ /**
3
+ * @returns The template for the default checkbox block
4
+ */
5
+ export declare function getDefaultTemplate(): string;
6
+ export default migrationTemplate;
@@ -0,0 +1,200 @@
1
+ const g = {
2
+ TITLE: "You May Also Like!"
3
+ }, h = `
4
+ <td align="left" class="ins-recommendation-v3-block-v2 esd-block-recommendation-v3-block">
5
+ <table width="100%" cellpadding="0" cellspacing="0" border="0">
6
+ <tr>
7
+ <td align="center" style="padding: 20px 0;">
8
+ <!-- Email Content Container -->
9
+ <table class="container"
10
+ width="600"
11
+ cellpadding="0"
12
+ cellspacing="0"
13
+ border="0"
14
+ style="max-width: 600px; width: 100%; background-color: #ffffff;">
15
+ <!-- Heading -->
16
+ <tr>
17
+ <td class="heading"
18
+ style="
19
+ font-size: 28px;
20
+ font-weight: bold;
21
+ color: #333333;
22
+ text-align: center;
23
+ padding: 30px 20px;">
24
+ {-{-TITLE-}-}
25
+ </td>
26
+ </tr>
27
+
28
+ <!-- Product Rows -->
29
+ {-{-PRODUCT_ROWS-}-}
30
+ </table>
31
+ <!-- End Email Content Container -->
32
+ </td>
33
+ </tr>
34
+ </table>
35
+ </td>
36
+ `, u = `
37
+ <tr>
38
+ <td style="padding: 0 20px;">
39
+ <table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0">
40
+ {-{-PRODUCTS-}-}
41
+ </table>
42
+ </td>
43
+ </tr>
44
+ `, m = `
45
+ <td width="{-{-COLUMN_WIDTH-}-}" style="padding: 0 5px;" valign="top" height="100%">
46
+ <table width="100%"
47
+ height="100%"
48
+ cellpadding="0"
49
+ cellspacing="0"
50
+ border="0"
51
+ class="product-card-wrapper"
52
+ style="background-color: #f8f8f8;">
53
+ <tr>
54
+ <td class="product-image-cell"
55
+ valign="top"
56
+ style="background-color: #e8f0f2; padding: 30px; text-align: center;">
57
+ <img src="{-{-PRODUCT_IMAGE-}-}"
58
+ alt="{-{-PRODUCT_NAME-}-}" width="120" style="max-width: 100%; height: auto; margin: 0 auto;">
59
+ </td>
60
+ </tr>
61
+ </table>
62
+ </td>
63
+ `, b = `
64
+ <td width="{-{-COLUMN_WIDTH-}-}" style="padding: 0 5px;" valign="top" height="100%">
65
+ <table width="100%"
66
+ height="100%"
67
+ cellpadding="0"
68
+ cellspacing="0"
69
+ border="0"
70
+ class="product-card-wrapper"
71
+ style="background-color: #f8f8f8;">
72
+ <tr>
73
+ <td class="product-name-cell"
74
+ valign="top"
75
+ style="font-size: 16px; color: #333333; font-weight: 600; padding: 15px 10px; text-align: center;">
76
+ {-{-PRODUCT_NAME-}-}
77
+ </td>
78
+ </tr>
79
+ </table>
80
+ </td>
81
+ `, x = `
82
+ <td width="{-{-COLUMN_WIDTH-}-}" style="padding: 0 5px;" valign="top" height="100%">
83
+ <table width="100%"
84
+ height="100%"
85
+ cellpadding="0"
86
+ cellspacing="0"
87
+ border="0"
88
+ class="product-card-wrapper"
89
+ style="background-color: #f8f8f8;">
90
+ <tr>
91
+ <td class="price-cell" valign="top" style="padding: 10px; text-align: center;">
92
+ <span class="current-price" style="font-size: 16px; color: #333333; font-weight: bold;">
93
+ 18,00 TRY
94
+ </span>
95
+ <span class="old-price" style="font-size: 14px; color: #999999; text-decoration: line-through;">
96
+ 20,00 TRY
97
+ </span>
98
+ </td>
99
+ </tr>
100
+ </table>
101
+ </td>
102
+ `, w = `
103
+ <td width="{-{-COLUMN_WIDTH-}-}" style="padding: 0 5px;" valign="top" height="100%">
104
+ <table width="100%"
105
+ height="100%"
106
+ cellpadding="0"
107
+ cellspacing="0"
108
+ border="0"
109
+ class="product-card-wrapper"
110
+ style="background-color: #f8f8f8;">
111
+ <tr>
112
+ <td class="button-cell" valign="top" style="padding: 15px 10px 20px 10px; text-align: center;">
113
+ <a href="#"
114
+ class="buy-button"
115
+ style="
116
+ display: inline-block;
117
+ width: 90%;
118
+ max-width: 150px;
119
+ padding: 12px 20px;
120
+ background-color: #ffffff;
121
+ color: #333333;
122
+ text-decoration: none;
123
+ border: 2px solid #cccccc;
124
+ font-size: 16px;
125
+ box-sizing: border-box;">
126
+ Buy
127
+ </a>
128
+ </td>
129
+ </tr>
130
+ </table>
131
+ </td>
132
+ `, f = `
133
+ <tr>
134
+ <td class="spacer" style="height: 20px;"></td>
135
+ </tr>
136
+ `;
137
+ function T() {
138
+ const c = [
139
+ {
140
+ name: "Beanie with Logo",
141
+ image: "https://inshoppingcart.com/ins-html/wp-content/uploads/2018/08/beanie-with-logo-1.jpg",
142
+ price: "18,00 TRY",
143
+ oldPrice: "20,00 TRY",
144
+ url: "https://example.com/product/1"
145
+ },
146
+ {
147
+ name: "Belt",
148
+ image: "https://inshoppingcart.com/ins-html/wp-content/uploads/2018/09/belt-2.jpg",
149
+ price: "55,00 TRY",
150
+ oldPrice: "65,00 TRY",
151
+ url: "https://example.com/product/2"
152
+ },
153
+ {
154
+ name: "Beanie",
155
+ image: "https://inshoppingcart.com/ins-html/wp-content/uploads/2018/08/beanie-with-logo-1.jpg",
156
+ price: "18,00 TRY",
157
+ oldPrice: "20,00 TRY",
158
+ url: "https://example.com/product/3"
159
+ },
160
+ {
161
+ name: "Album",
162
+ image: "https://inshoppingcart.com/ins-html/wp-content/uploads/2018/12/poster_2_up.jpg",
163
+ price: "15,00 TRY",
164
+ oldPrice: "15,00 TRY",
165
+ url: "https://example.com/product/4"
166
+ },
167
+ {
168
+ name: "Flying Ninja with a very long product name",
169
+ image: "https://inshoppingcart.com/ins-html/wp-content/uploads/2018/09/belt-2.jpg",
170
+ price: "12,00 TRY",
171
+ oldPrice: "15,00 TRY",
172
+ url: "https://example.com/product/5"
173
+ },
174
+ {
175
+ name: "Single",
176
+ image: "https://inshoppingcart.com/ins-html/wp-content/uploads/2018/12/poster_2_up.jpg",
177
+ price: "22.555,00 TRY",
178
+ oldPrice: "33.989,00 TRY",
179
+ url: "https://example.com/product/6"
180
+ }
181
+ ], l = 3, d = (100 / l).toFixed(2), a = [];
182
+ for (let t = 0; t < c.length; t += l)
183
+ a.push(c.slice(t, t + l));
184
+ let e = "";
185
+ return a.forEach((t, s) => {
186
+ s > 0 && (e += f);
187
+ let p = "", r = "", n = "", i = "";
188
+ t.forEach((o) => {
189
+ p += m.replace("{-{-PRODUCT_IMAGE-}-}", o.image).replace("{-{-PRODUCT_NAME-}-}", o.name), r += b.replace("{-{-PRODUCT_NAME-}-}", o.name), n += x, i += w;
190
+ }), e += u.replace("{-{-PRODUCTS-}-}", `
191
+ <tr>${p}</tr>
192
+ <tr>${r}</tr>
193
+ <tr>${n}</tr>
194
+ <tr>${i}</tr>
195
+ `), e = e.replaceAll("{-{-COLUMN_WIDTH-}-}", `${d}%`);
196
+ }), h.replace("{-{-TITLE-}-}", g.TITLE).replace("{-{-PRODUCT_ROWS-}-}", e);
197
+ }
198
+ export {
199
+ T as getDefaultTemplate
200
+ };
@@ -0,0 +1,7 @@
1
+ import type { Filter } from '@@/Types/recommendation';
2
+ /**
3
+ * Generates the complete query with outer group operators
4
+ * @param filters Array of Filter objects
5
+ * @returns Complete query string with outer operators
6
+ */
7
+ export declare function generateCompleteFilterQuery(filters: Filter[]): string;
@@ -0,0 +1,28 @@
1
+ function l(t) {
2
+ if (t.length === 0)
3
+ return "";
4
+ const o = t.sort((r, e) => r.filterNumber - e.filterNumber), n = o.map((r) => `[${r.attribute}][${r.operatorReplace}][${r.value}]`), [s, ...p] = n;
5
+ let u = s;
6
+ for (let r = 0; r < p.length; r++) {
7
+ const e = o[r + 1].innerGroupOperator;
8
+ u += `${e}${p[r]}`;
9
+ }
10
+ return `(${u})`;
11
+ }
12
+ function m(t) {
13
+ if (!t || t.length === 0)
14
+ return "";
15
+ const o = t.reduce((r, e) => (r[e.filterGroup] || (r[e.filterGroup] = []), r[e.filterGroup].push(e), r), {}), n = Object.keys(o).map(Number).sort((r, e) => r - e), s = n.map((r) => {
16
+ const e = o[r];
17
+ return l(e);
18
+ }), [p, ...u] = s;
19
+ let i = p;
20
+ for (let r = 0; r < u.length; r++) {
21
+ const e = n[r + 1], c = o[e][0].outerGroupOperator;
22
+ i += `${c}${u[r]}`;
23
+ }
24
+ return console.debug("🎉 Complete query generated:", i), i.trim();
25
+ }
26
+ export {
27
+ m as generateCompleteFilterQuery
28
+ };
@@ -0,0 +1,4 @@
1
+ import { SettingsPanelRegistry, SettingsPanelTab } from '@stripoinc/ui-editor-extensions';
2
+ export declare class SettingsPanel extends SettingsPanelRegistry {
3
+ registerBlockControls(blockControlsMap: Record<string, SettingsPanelTab[]>): void;
4
+ }
@@ -0,0 +1,66 @@
1
+ import { Control, ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
2
+ interface TextInputProps {
3
+ name: string;
4
+ placeholder?: string;
5
+ className?: string;
6
+ }
7
+ interface LabelProps {
8
+ text: string;
9
+ name?: string;
10
+ position?: 'top' | 'left';
11
+ }
12
+ interface IconButtonProps {
13
+ name: string;
14
+ icon: string;
15
+ className?: string;
16
+ }
17
+ interface SelectProps {
18
+ name: string;
19
+ placeholder: string;
20
+ options: {
21
+ text: string;
22
+ value: string;
23
+ }[];
24
+ className?: string;
25
+ }
26
+ interface CounterProps {
27
+ name: string;
28
+ maxValue: number;
29
+ minValue?: number;
30
+ step?: number;
31
+ }
32
+ interface ButtonProps {
33
+ name: string;
34
+ label: string;
35
+ id?: string;
36
+ }
37
+ /**
38
+ * Common control for all blocks which includes common UI Elements.
39
+ * If you need to add a new UI Element, you can add it here.
40
+ */
41
+ export declare abstract class CommonControl extends Control {
42
+ currentNode?: ImmutableHtmlNode;
43
+ abstract getId(): string;
44
+ abstract getTemplate(): string;
45
+ abstract onRender(): Promise<void> | void;
46
+ getContainer(): ShadowRoot;
47
+ onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
48
+ _GuLabel({ text, name, position }: LabelProps): string;
49
+ _GuToggle(name: string): string;
50
+ _GuSelectItem({ text, value }: {
51
+ text: string;
52
+ value: string;
53
+ }): string;
54
+ _GuSelect({ name, placeholder, options, className }: SelectProps): string;
55
+ _GuTextInput({ name, placeholder, className }: TextInputProps): string;
56
+ _GuCounter({ name, maxValue, minValue, step }: CounterProps): string;
57
+ _GuButton({ name, label, id }: ButtonProps): string;
58
+ /**
59
+ *
60
+ * @param param0
61
+ * @returns It returns a button with an icon.
62
+ */
63
+ _GuIconButton({ name, icon, className }: IconButtonProps): string;
64
+ _GuTwoColumns(children: string[]): string;
65
+ }
66
+ export {};
@@ -0,0 +1,102 @@
1
+ var l = Object.defineProperty;
2
+ var C = (E, o, e) => o in E ? l(E, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : E[o] = e;
3
+ var u = (E, o, e) => C(E, typeof o != "symbol" ? o + "" : o, e);
4
+ import { Control as c, UIElementType as $, UEAttr as t } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
5
+ class L extends c {
6
+ constructor() {
7
+ super(...arguments);
8
+ u(this, "currentNode");
9
+ }
10
+ getContainer() {
11
+ var e;
12
+ return (e = document.querySelector("ui-editor")) == null ? void 0 : e.shadowRoot;
13
+ }
14
+ onTemplateNodeUpdated(e) {
15
+ this.currentNode = e;
16
+ }
17
+ _GuLabel({ text: e, name: T = "", position: n = "top" }) {
18
+ return `
19
+ <${$.LABEL}
20
+ style="${n === "top" ? "margin-bottom: 8px;" : ""}"
21
+ ${t.LABEL.text}="${e}"
22
+ ${t.LABEL.name}="${T || `${e} Label`}">
23
+ </${$.LABEL}>
24
+ `;
25
+ }
26
+ _GuToggle(e) {
27
+ return `
28
+ <${$.SWITCHER}
29
+ ${t.SWITCHER.name}="${e}">
30
+ </${$.SWITCHER}>
31
+ `;
32
+ }
33
+ _GuSelectItem({ text: e, value: T }) {
34
+ return `
35
+ <${$.SELECT_ITEM}
36
+ ${t.SELECT_ITEM.text}="${e}"
37
+ ${t.SELECT_ITEM.value}="${T}">
38
+ </${$.SELECT_ITEM}>`;
39
+ }
40
+ _GuSelect({ name: e, placeholder: T, options: n, className: r = "es-180w" }) {
41
+ return `
42
+ <${$.SELECTPICKER}
43
+ class="${r}"
44
+ ${t.SELECTPICKER.name}="${e}"
45
+ ${t.SELECTPICKER.placeholder}="${T}">
46
+ ${n.map((a) => this._GuSelectItem(a)).join("")}
47
+ </${$.SELECTPICKER}>
48
+ `;
49
+ }
50
+ _GuTextInput({ name: e, placeholder: T, className: n = "" }) {
51
+ return `
52
+ <${$.TEXT}
53
+ class=${n}
54
+ ${t.TEXT.name}="${e}"
55
+ placeholder="${T || e}">
56
+ </${$.TEXT}>
57
+ `;
58
+ }
59
+ _GuCounter({ name: e, maxValue: T, minValue: n = 1, step: r = 1 }) {
60
+ return `
61
+ <${$.COUNTER}
62
+ ${t.COUNTER.name}="${e}"
63
+ ${t.COUNTER.minValue}="${n}"
64
+ ${t.COUNTER.maxValue}="${T}"
65
+ ${t.COUNTER.step}="${r}">
66
+ </${$.COUNTER}>
67
+ `;
68
+ }
69
+ _GuButton({ name: e, label: T, id: n = "" }) {
70
+ return `
71
+ <${$.BUTTON}
72
+ ${t.BUTTON.name}="${e}"
73
+ ${n ? `id="${n}"` : ""}
74
+ ${t.BUTTON.caption}="${T}"}>
75
+ </${$.BUTTON}>
76
+ `;
77
+ }
78
+ /**
79
+ *
80
+ * @param param0
81
+ * @returns It returns a button with an icon.
82
+ */
83
+ _GuIconButton({ name: e, icon: T, className: n = "" }) {
84
+ return `
85
+ <${$.BUTTON}
86
+ class="${n}"
87
+ ${t.BUTTON.name}="${e}"
88
+ ${t.BUTTON.icon}="${T}">
89
+ </${$.BUTTON}>
90
+ `;
91
+ }
92
+ _GuTwoColumns(e) {
93
+ return `
94
+ <div class="checkbox-select-container container two-columns">
95
+ ${e.join("")}
96
+ </div>
97
+ `;
98
+ }
99
+ }
100
+ export {
101
+ L as CommonControl
102
+ };
@@ -0,0 +1,2 @@
1
+ declare const _default: import("@stripoinc/ui-editor-extensions").Extension;
2
+ export default _default;