@useinsider/guido 1.0.3-beta.367d151 → 1.0.3-beta.3757462

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 (111) hide show
  1. package/dist/@types/generic.d.ts +0 -14
  2. package/dist/components/Guido.vue.d.ts +2 -3
  3. package/dist/components/Guido.vue.js +9 -11
  4. package/dist/components/Guido.vue2.js +69 -75
  5. package/dist/components/organisms/onboarding/NewVersionPopup.vue.d.ts +1 -3
  6. package/dist/components/organisms/onboarding/NewVersionPopup.vue.js +9 -9
  7. package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +17 -30
  8. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.d.ts +1 -3
  9. package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +10 -12
  10. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +18 -19
  11. package/dist/components/wrappers/WpDrawer.vue.d.ts +4 -6
  12. package/dist/components/wrappers/WpDrawer.vue.js +4 -6
  13. package/dist/composables/useStripo.js +18 -26
  14. package/dist/config/compiler/unsubscribeCompilerRules.js +29 -42
  15. package/dist/config/migrator/index.d.ts +1 -1
  16. package/dist/config/migrator/index.js +6 -7
  17. package/dist/enums/defaults.js +0 -4
  18. package/dist/enums/unsubscribe.d.ts +0 -23
  19. package/dist/enums/unsubscribe.js +6 -43
  20. package/dist/extensions/Blocks/Checkbox/control.js +54 -53
  21. package/dist/extensions/Blocks/RadioButton/control.js +45 -44
  22. package/dist/extensions/Blocks/RadioButton/template.js +6 -6
  23. package/dist/guido.css +1 -1
  24. package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +71 -83
  25. package/dist/stores/editor.d.ts +0 -21
  26. package/dist/stores/editor.js +1 -2
  27. package/dist/stores/unsubscribe.d.ts +5 -253
  28. package/dist/stores/unsubscribe.js +6 -126
  29. package/dist/utils/dateUtil.d.ts +0 -4
  30. package/dist/utils/dateUtil.js +12 -8
  31. package/dist/utils/genericUtil.d.ts +0 -1
  32. package/dist/utils/genericUtil.js +7 -8
  33. package/dist/utils/templatePreparation.js +16 -17
  34. package/package.json +2 -2
  35. package/dist/components/organisms/extensions/recommendation/FilterItem.vue.d.ts +0 -19
  36. package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +0 -28
  37. package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +0 -38
  38. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.d.ts +0 -2
  39. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.js +0 -17
  40. package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +0 -37
  41. package/dist/components/organisms/extensions/recommendation/Filters.vue.d.ts +0 -2
  42. package/dist/components/organisms/extensions/recommendation/Filters.vue.js +0 -20
  43. package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +0 -44
  44. package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue.d.ts +0 -16
  45. package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue.js +0 -17
  46. package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue2.js +0 -27
  47. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.d.ts +0 -2
  48. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue.js +0 -18
  49. package/dist/components/organisms/unsubscribe/UnsubscribeBreadcrumb.vue2.js +0 -16
  50. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.d.ts +0 -2
  51. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +0 -24
  52. package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +0 -64
  53. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.d.ts +0 -2
  54. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +0 -18
  55. package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +0 -107
  56. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.d.ts +0 -2
  57. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue.js +0 -18
  58. package/dist/components/organisms/unsubscribe/UnsubscribeWrapper.vue2.js +0 -12
  59. package/dist/config/migrator/unsubscribeMigrator.d.ts +0 -1
  60. package/dist/config/migrator/unsubscribeMigrator.js +0 -124
  61. package/dist/enums/date.d.ts +0 -13
  62. package/dist/enums/date.js +0 -16
  63. package/dist/enums/extensions/recommendationBlock.d.ts +0 -16
  64. package/dist/enums/extensions/recommendationBlock.js +0 -80
  65. package/dist/extensions/Blocks/Recommendation/block.d.ts +0 -10
  66. package/dist/extensions/Blocks/Recommendation/block.js +0 -27
  67. package/dist/extensions/Blocks/Recommendation/control.d.ts +0 -29
  68. package/dist/extensions/Blocks/Recommendation/control.js +0 -277
  69. package/dist/extensions/Blocks/Recommendation/extension.d.ts +0 -2
  70. package/dist/extensions/Blocks/Recommendation/extension.js +0 -10
  71. package/dist/extensions/Blocks/Recommendation/iconsRegistry.d.ts +0 -4
  72. package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +0 -51
  73. package/dist/extensions/Blocks/Recommendation/recommendation.css.js +0 -19
  74. package/dist/extensions/Blocks/Recommendation/settingsPanel.d.ts +0 -4
  75. package/dist/extensions/Blocks/Recommendation/settingsPanel.js +0 -32
  76. package/dist/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -555
  77. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +0 -266
  78. package/dist/extensions/Blocks/Recommendation/template.d.ts +0 -6
  79. package/dist/extensions/Blocks/Recommendation/template.js +0 -200
  80. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.d.ts +0 -7
  81. package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +0 -28
  82. package/dist/extensions/Blocks/Unsubscribe/block.d.ts +0 -32
  83. package/dist/extensions/Blocks/Unsubscribe/block.js +0 -131
  84. package/dist/extensions/Blocks/Unsubscribe/control.d.ts +0 -29
  85. package/dist/extensions/Blocks/Unsubscribe/control.js +0 -167
  86. package/dist/extensions/Blocks/Unsubscribe/elements/preview.d.ts +0 -11
  87. package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +0 -42
  88. package/dist/extensions/Blocks/Unsubscribe/extension.d.ts +0 -2
  89. package/dist/extensions/Blocks/Unsubscribe/extension.js +0 -21
  90. package/dist/extensions/Blocks/Unsubscribe/iconsRegistry.d.ts +0 -4
  91. package/dist/extensions/Blocks/Unsubscribe/iconsRegistry.js +0 -21
  92. package/dist/extensions/Blocks/Unsubscribe/settingsPanel.d.ts +0 -4
  93. package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +0 -35
  94. package/dist/extensions/Blocks/Unsubscribe/styles.css.js +0 -42
  95. package/dist/extensions/Blocks/Unsubscribe/tagRegistry.d.ts +0 -4
  96. package/dist/extensions/Blocks/Unsubscribe/tagRegistry.js +0 -10
  97. package/dist/extensions/Blocks/Unsubscribe/template.d.ts +0 -12
  98. package/dist/extensions/Blocks/Unsubscribe/template.js +0 -22
  99. package/dist/extensions/Blocks/Unsubscribe/utils/constants.d.ts +0 -9
  100. package/dist/extensions/Blocks/Unsubscribe/utils/constants.js +0 -11
  101. package/dist/extensions/Blocks/Unsubscribe/utils/utils.d.ts +0 -7
  102. package/dist/extensions/Blocks/Unsubscribe/utils/utils.js +0 -6
  103. package/dist/extensions/Blocks/common-control.d.ts +0 -66
  104. package/dist/extensions/Blocks/common-control.js +0 -102
  105. package/dist/mock/api/recommendation.d.ts +0 -2
  106. package/dist/services/recommendationApi.d.ts +0 -6
  107. package/dist/services/recommendationApi.js +0 -43
  108. package/dist/services/unsubscribeApi.d.ts +0 -4
  109. package/dist/services/unsubscribeApi.js +0 -16
  110. package/dist/stores/config.d.ts +0 -97
  111. package/dist/stores/config.js +0 -17
@@ -1,266 +0,0 @@
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
- };
@@ -1,6 +0,0 @@
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;
@@ -1,200 +0,0 @@
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
- };
@@ -1,7 +0,0 @@
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;
@@ -1,28 +0,0 @@
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
- };
@@ -1,32 +0,0 @@
1
- import type { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
2
- import { Block, BlockCompositionType } from '@stripoinc/ui-editor-extensions';
3
- export declare const UNSUBSCRIBE_BLOCK_ID = "unsubscribe-block";
4
- export declare class UnsubscribeBlock extends Block {
5
- private selectEventListener;
6
- private cancelEventListener;
7
- private currentNode?;
8
- constructor();
9
- getId(): string;
10
- getIcon(): string;
11
- getBlockCompositionType(): BlockCompositionType;
12
- getName(): string;
13
- getDescription(): string;
14
- getTemplate(): string;
15
- onCreated(node: ImmutableHtmlNode): void;
16
- onSelect(node: ImmutableHtmlNode): undefined;
17
- onDelete(node: ImmutableHtmlNode): undefined;
18
- onDestroy(): void;
19
- private _setupSelectEventListener;
20
- private _removeSelectEventListener;
21
- private _setupCancelEventListener;
22
- private _removeCancelEventListener;
23
- private _handleCancel;
24
- private _removeEventListeners;
25
- private _updateBlock;
26
- private _getMergeTag;
27
- private _openDrawer;
28
- private _checkExistingBlocks;
29
- private _loadBlockState;
30
- private _resetStoreState;
31
- private _removeBlockTemplatesFromStore;
32
- }
@@ -1,131 +0,0 @@
1
- var _ = Object.defineProperty;
2
- var d = (n, i, e) => i in n ? _(n, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[i] = e;
3
- var u = (n, i, e) => d(n, typeof i != "symbol" ? i + "" : i, e);
4
- import { PAGE_TYPES as E } from "../../../enums/unsubscribe.js";
5
- import { useUnsubscribeStore as c } from "../../../stores/unsubscribe.js";
6
- import { Block as S, BlockCompositionType as h, ModificationDescription as b } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
7
- import { getDefaultTemplate as L } from "./template.js";
8
- import { UNSUBSCRIBE_EVENTS as a, DATA_ATTRIBUTES as o } from "./utils/constants.js";
9
- import { parsePageList as m } from "./utils/utils.js";
10
- const v = "unsubscribe-block", g = 'a[data-unsubscribe-link="true"]', B = ".unsubscribe-block-v2", f = "{{ins-unsubscribe-link}}", C = {
11
- [E.GLOBAL_UNSUBSCRIBE]: "{{ins-global-unsubscribe-link}}",
12
- [E.SUBSCRIPTION_PREFERENCE_CENTER]: "{{ins-preferences-unsubscribe-link}}"
13
- };
14
- class D extends S {
15
- constructor() {
16
- super();
17
- u(this, "selectEventListener", null);
18
- u(this, "cancelEventListener", null);
19
- u(this, "currentNode");
20
- }
21
- getId() {
22
- return v;
23
- }
24
- getIcon() {
25
- return "unsubscribe-icon";
26
- }
27
- getBlockCompositionType() {
28
- return h.BLOCK;
29
- }
30
- getName() {
31
- return this.api.translate("Unsubscribe Block");
32
- }
33
- getDescription() {
34
- return this.api.translate("Unsubscribe Block Description");
35
- }
36
- getTemplate() {
37
- return L();
38
- }
39
- onCreated(e) {
40
- "getAttribute" in e && e.getAttribute("data-migration") || (this.currentNode = e, this._resetStoreState(), this._setupSelectEventListener(), this._setupCancelEventListener(), this._checkExistingBlocks(), this._openDrawer());
41
- }
42
- onSelect(e) {
43
- this.currentNode = e, this._resetStoreState(), this._loadBlockState(e), this._setupSelectEventListener();
44
- }
45
- onDelete(e) {
46
- this._removeEventListeners(), this._removeBlockTemplatesFromStore(e), this._resetStoreState();
47
- }
48
- onDestroy() {
49
- this._removeEventListeners(), this.currentNode = void 0;
50
- }
51
- _setupSelectEventListener() {
52
- this._removeSelectEventListener(), this.selectEventListener = (e) => {
53
- const r = e, { collectionType: t, selectedPages: s } = r.detail;
54
- this._updateBlock(t, s.join(","));
55
- }, document.addEventListener(a.SELECT, this.selectEventListener);
56
- }
57
- _removeSelectEventListener() {
58
- this.selectEventListener && (document.removeEventListener(a.SELECT, this.selectEventListener), this.selectEventListener = null);
59
- }
60
- _setupCancelEventListener() {
61
- this._removeCancelEventListener(), this.cancelEventListener = () => {
62
- this._handleCancel();
63
- }, document.addEventListener(a.CANCEL, this.cancelEventListener);
64
- }
65
- _removeCancelEventListener() {
66
- this.cancelEventListener && (document.removeEventListener(a.CANCEL, this.cancelEventListener), this.cancelEventListener = null);
67
- }
68
- _handleCancel() {
69
- this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).delete().apply(new b("Removed unsubscribe block due to cancel"));
70
- }
71
- _removeEventListeners() {
72
- this._removeSelectEventListener(), this._removeCancelEventListener();
73
- }
74
- _updateBlock(e, r) {
75
- if (!this.currentNode || !("querySelector" in this.currentNode))
76
- return;
77
- const t = this.currentNode.querySelector(g);
78
- if (!t)
79
- return;
80
- const s = this._getMergeTag(e);
81
- this.api.getDocumentModifier().modifyHtml(t).setAttribute("href", s).apply(new b(`Updated unsubscribe link to ${s}`)), this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute(o.PAGE_TYPE, e.toString()).setAttribute(o.PAGE_LIST, r).apply(new b("Updated unsubscribe block metadata"));
82
- }
83
- _getMergeTag(e) {
84
- return C[e] ?? f;
85
- }
86
- _openDrawer() {
87
- try {
88
- const e = c();
89
- e.typeSelectionDrawerStatus = !0;
90
- } catch (e) {
91
- console.error("[UnsubscribeBlock] Failed to open drawer:", e);
92
- }
93
- }
94
- _checkExistingBlocks() {
95
- const e = c();
96
- e.isGlobalUnsubscribeDisabled = !1, e.isSubscriptionPreferencesCenterDisabled = !1, this.api.getDocumentRoot().querySelectorAll(B).forEach((t) => {
97
- if ("getAttribute" in t) {
98
- const s = t.getAttribute(o.PAGE_TYPE);
99
- if (s) {
100
- const l = Number(s);
101
- l === E.GLOBAL_UNSUBSCRIBE ? e.isGlobalUnsubscribeDisabled = !0 : l === E.SUBSCRIPTION_PREFERENCE_CENTER && (e.isSubscriptionPreferencesCenterDisabled = !0);
102
- }
103
- }
104
- });
105
- }
106
- _loadBlockState(e) {
107
- if (!("getAttribute" in e))
108
- return;
109
- const r = e.getAttribute(o.PAGE_TYPE), t = e.getAttribute(o.PAGE_LIST);
110
- if (!r || !t)
111
- return;
112
- const s = c(), l = Number(r), p = m(t);
113
- s.setCollectionWithoutAutoSelection(l), s.loadSelectedTemplates(p);
114
- }
115
- _resetStoreState() {
116
- c().$reset();
117
- }
118
- _removeBlockTemplatesFromStore(e) {
119
- if (!("getAttribute" in e))
120
- return;
121
- const r = e.getAttribute(o.PAGE_LIST);
122
- if (!r)
123
- return;
124
- const t = c(), s = m(r);
125
- t.removeUnsubscribePages(s);
126
- }
127
- }
128
- export {
129
- v as UNSUBSCRIBE_BLOCK_ID,
130
- D as UnsubscribeBlock
131
- };