@useinsider/guido 2.0.0-beta.dbde199 → 2.0.0-beta.e66a90a
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.
- package/dist/@types/config/schemas.js +53 -39
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +2 -2
- package/dist/components/organisms/header/RightSlot.vue2.js +10 -10
- package/dist/composables/useConfig.js +29 -27
- package/dist/composables/useSave.js +13 -11
- package/dist/config/migrator/recommendationMigrator.js +2 -2
- package/dist/extensions/Blocks/Recommendation/block.js +1 -1
- package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +4 -0
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +4 -0
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +11 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/index.js +64 -0
- package/dist/extensions/Blocks/Recommendation/controls/cardBackground/index.js +100 -0
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +243 -0
- package/dist/extensions/Blocks/Recommendation/controls/image/index.js +19 -0
- package/dist/extensions/Blocks/Recommendation/controls/layout/index.js +104 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +86 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/currency.js +134 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +54 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +106 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/locale.js +64 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +123 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/shuffle.js +60 -0
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +112 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/index.js +46 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +76 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/index.js +44 -0
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.js +48 -0
- package/dist/extensions/Blocks/Recommendation/controls/{omnibusDiscountTextAfterControl.js → omnibusDiscount/textAfter.js} +15 -13
- package/dist/extensions/Blocks/Recommendation/controls/{omnibusDiscountTextBeforeControl.js → omnibusDiscount/textBefore.js} +15 -13
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/index.js +48 -0
- package/dist/extensions/Blocks/Recommendation/controls/{omnibusPriceTextAfterControl.js → omnibusPrice/textAfter.js} +16 -14
- package/dist/extensions/Blocks/Recommendation/controls/{omnibusPriceTextBeforeControl.js → omnibusPrice/textBefore.js} +14 -12
- package/dist/extensions/Blocks/Recommendation/controls/price/index.js +44 -0
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +224 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +40 -19
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +5 -0
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +46 -43
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +20 -20
- package/dist/extensions/Blocks/Recommendation/templates/horizontal/elementRenderer.js +157 -0
- package/dist/extensions/Blocks/Recommendation/templates/horizontal/template.js +72 -0
- package/dist/extensions/Blocks/Recommendation/templates/index.js +12 -0
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +173 -0
- package/dist/extensions/Blocks/Recommendation/templates/vertical/elementRenderer.js +186 -0
- package/dist/extensions/Blocks/Recommendation/templates/vertical/migration.js +251 -0
- package/dist/extensions/Blocks/Recommendation/templates/vertical/template.js +61 -0
- package/dist/extensions/Blocks/Unsubscribe/extension.js +9 -9
- package/dist/extensions/Blocks/common-control.js +6 -7
- package/dist/extensions/Blocks/controlFactories.js +156 -122
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +110 -113
- package/dist/src/@types/config/index.d.ts +2 -2
- package/dist/src/@types/config/schemas.d.ts +26 -0
- package/dist/src/@types/config/types.d.ts +7 -1
- package/dist/src/composables/useConfig.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +13 -0
- package/dist/src/extensions/Blocks/Recommendation/{constants.d.ts → constants/controlIds.d.ts} +1 -33
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +11 -0
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +19 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +143 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/{cardBackgroundColorControl.d.ts → cardBackground/index.d.ts} +19 -3
- package/dist/src/extensions/Blocks/Recommendation/{cardCompositionControl.d.ts → controls/cardComposition/index.d.ts} +23 -7
- package/dist/src/extensions/Blocks/Recommendation/controls/image/index.d.ts +35 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +21 -651
- package/dist/src/extensions/Blocks/Recommendation/controls/layout/index.d.ts +34 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/algorithm.d.ts +17 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/currency.d.ts +16 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/filters.d.ts +22 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +54 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/locale.d.ts +15 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +40 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/shuffle.d.ts +15 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +81 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/index.d.ts +97 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/{nameTextTrimControl.d.ts → name/textTrim.d.ts} +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/index.d.ts +95 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.d.ts +100 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/{omnibusDiscountTextAfterControl.d.ts → omnibusDiscount/textAfter.d.ts} +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/{omnibusDiscountTextBeforeControl.d.ts → omnibusDiscount/textBefore.d.ts} +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/index.d.ts +100 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/{omnibusPriceTextAfterControl.d.ts → omnibusPrice/textAfter.d.ts} +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/{omnibusPriceTextBeforeControl.d.ts → omnibusPrice/textBefore.d.ts} +1 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/price/index.d.ts +95 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/{spacingControl.d.ts → spacing/index.d.ts} +26 -9
- package/dist/src/extensions/Blocks/Recommendation/extension.d.ts +9 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +16 -16
- package/dist/src/extensions/Blocks/Recommendation/templates/horizontal/elementRenderer.d.ts +8 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/horizontal/migration.d.ts +25 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/horizontal/template.d.ts +18 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +39 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +45 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/vertical/elementRenderer.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/vertical/migration.d.ts +23 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/vertical/template.d.ts +33 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +1 -1
- package/dist/src/stores/config.d.ts +147 -1
- package/dist/static/styles/components/button.css.js +1 -1
- package/dist/static/styles/customEditorStyle.css.js +25 -2
- package/dist/stores/config.js +7 -0
- package/package.json +1 -1
- package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +0 -193
- package/dist/extensions/Blocks/Recommendation/constants.js +0 -14
- package/dist/extensions/Blocks/Recommendation/control.js +0 -336
- package/dist/extensions/Blocks/Recommendation/controls/cardBackgroundColorControl.js +0 -68
- package/dist/extensions/Blocks/Recommendation/controls/index.js +0 -272
- package/dist/extensions/Blocks/Recommendation/controls/nameTextTrimControl.js +0 -74
- package/dist/extensions/Blocks/Recommendation/controls/priceHideControl.js +0 -60
- package/dist/extensions/Blocks/Recommendation/controls/priceInlineLayoutControl.js +0 -160
- package/dist/extensions/Blocks/Recommendation/controls/spacingControl.js +0 -188
- package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +0 -184
- package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +0 -189
- package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +0 -209
- package/dist/src/extensions/Blocks/Recommendation/control.d.ts +0 -38
- package/dist/src/extensions/Blocks/Recommendation/controls/priceHideControl.d.ts +0 -16
- package/dist/src/extensions/Blocks/Recommendation/controls/priceInlineLayoutControl.d.ts +0 -50
- package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +0 -16
- package/dist/src/extensions/Blocks/Recommendation/templates/migrationTemplate.d.ts +0 -16
- package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +0 -52
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
import { ATTR_PRODUCT_BUTTON as o, ATTR_PRODUCT_OMNIBUS_DISCOUNT as a, ATTR_PRODUCT_OMNIBUS_PRICE as s, ATTR_PRODUCT_OLD_PRICE as l, ATTR_PRODUCT_PRICE as r, ATTR_PRODUCT_NAME as c, ATTR_PRODUCT_IMAGE as d } from "../constants.js";
|
|
2
|
-
import { prepareProductRows as i } from "./templateUtils.js";
|
|
3
|
-
import { DEFAULTS as f, getDefaultProducts as k } from "./templateUtils.js";
|
|
4
|
-
const g = `
|
|
5
|
-
<td
|
|
6
|
-
align="left"
|
|
7
|
-
esd-extension-block-id="recommendation-block"
|
|
8
|
-
esd-handler-name="esd-extension-RecommendationBlock"
|
|
9
|
-
class="ins-recommendation-v3-block-v2 es-p20 esd-recommendation-block esd-extension-block esd-container-frame"
|
|
10
|
-
data-price-inline="0">
|
|
11
|
-
<table width="100%" cellpadding="0" cellspacing="0" border="0">
|
|
12
|
-
<tr>
|
|
13
|
-
<td align="center">
|
|
14
|
-
<table
|
|
15
|
-
class="container"
|
|
16
|
-
width="100%"
|
|
17
|
-
cellpadding="0"
|
|
18
|
-
cellspacing="0"
|
|
19
|
-
border="0">
|
|
20
|
-
<tbody>
|
|
21
|
-
<tr>
|
|
22
|
-
<td>
|
|
23
|
-
<table
|
|
24
|
-
width="100%"
|
|
25
|
-
cellpadding="0"
|
|
26
|
-
cellspacing="0"
|
|
27
|
-
border="0">
|
|
28
|
-
<tbody>
|
|
29
|
-
<tr>
|
|
30
|
-
{-{-TITLE-}-}
|
|
31
|
-
</tr>
|
|
32
|
-
</tbody>
|
|
33
|
-
</table>
|
|
34
|
-
</td>
|
|
35
|
-
</tr>
|
|
36
|
-
<tr>
|
|
37
|
-
<td class="spacer" style="height: 20px;"></td>
|
|
38
|
-
</tr>
|
|
39
|
-
<tr>
|
|
40
|
-
<td>
|
|
41
|
-
<table
|
|
42
|
-
class="ins-recommendation-product-container"
|
|
43
|
-
width="100%"
|
|
44
|
-
cellpadding="0"
|
|
45
|
-
cellspacing="0"
|
|
46
|
-
border="0"
|
|
47
|
-
>
|
|
48
|
-
{-{-PRODUCT_ROWS-}-}
|
|
49
|
-
</table>
|
|
50
|
-
</td>
|
|
51
|
-
</tr>
|
|
52
|
-
</tbody>
|
|
53
|
-
</table>
|
|
54
|
-
</td>
|
|
55
|
-
</tr>
|
|
56
|
-
</table>
|
|
57
|
-
</td>
|
|
58
|
-
`, p = {
|
|
59
|
-
[d]: (t) => `
|
|
60
|
-
<tr>
|
|
61
|
-
<td
|
|
62
|
-
class="esd-block-image product-image"
|
|
63
|
-
esd-extension-block-id="recommendation-block-image"
|
|
64
|
-
align="center"
|
|
65
|
-
style="font-size: 0px;">
|
|
66
|
-
<a target="_blank" href="${t.url}">
|
|
67
|
-
<img
|
|
68
|
-
src="${t.image_url}"
|
|
69
|
-
alt="${t.name}"
|
|
70
|
-
width="120"
|
|
71
|
-
style="display: block; max-width: 100%; height: auto;"
|
|
72
|
-
class="adapt-img">
|
|
73
|
-
</a>
|
|
74
|
-
</td>
|
|
75
|
-
</tr>
|
|
76
|
-
`,
|
|
77
|
-
[c]: (t) => `
|
|
78
|
-
<tr>
|
|
79
|
-
<td
|
|
80
|
-
class="esd-block-text product-name"
|
|
81
|
-
esd-extension-block-id="recommendation-block-name"
|
|
82
|
-
align="center">
|
|
83
|
-
<p
|
|
84
|
-
path="1"
|
|
85
|
-
contenteditable="false"
|
|
86
|
-
style="font-size: 16px; color: #333333; font-weight: 600; text-align: center;">
|
|
87
|
-
<strong path="1,0">${t.name}</strong>
|
|
88
|
-
</p>
|
|
89
|
-
</td>
|
|
90
|
-
</tr>
|
|
91
|
-
`,
|
|
92
|
-
[r]: () => `
|
|
93
|
-
<tr>
|
|
94
|
-
<td
|
|
95
|
-
class="esd-block-text product-price"
|
|
96
|
-
esd-extension-block-id="recommendation-block-price"
|
|
97
|
-
align="center">
|
|
98
|
-
<p
|
|
99
|
-
path="1"
|
|
100
|
-
contenteditable="false"
|
|
101
|
-
style="font-size: 16px; color: #333333; font-weight: bold; text-align: center;">
|
|
102
|
-
<strong path="1,0">18,00 TRY</strong>
|
|
103
|
-
</p>
|
|
104
|
-
</td>
|
|
105
|
-
</tr>
|
|
106
|
-
`,
|
|
107
|
-
[l]: () => `
|
|
108
|
-
<tr>
|
|
109
|
-
<td
|
|
110
|
-
class="esd-block-text product-old-price"
|
|
111
|
-
esd-extension-block-id="recommendation-block-old-price"
|
|
112
|
-
align="center">
|
|
113
|
-
<p
|
|
114
|
-
path="1"
|
|
115
|
-
contenteditable="false"
|
|
116
|
-
style="font-size: 14px; color: #999999; text-decoration: line-through; text-align: center;">
|
|
117
|
-
<s path="1,0">20,00 TRY</s>
|
|
118
|
-
</p>
|
|
119
|
-
</td>
|
|
120
|
-
</tr>
|
|
121
|
-
`,
|
|
122
|
-
[s]: () => `
|
|
123
|
-
<tr>
|
|
124
|
-
<td
|
|
125
|
-
class="esd-block-text product-omnibus-price"
|
|
126
|
-
esd-extension-block-id="recommendation-block-omnibus-price"
|
|
127
|
-
data-text-before="Lowest 30-day price: "
|
|
128
|
-
data-text-after=""
|
|
129
|
-
align="center">
|
|
130
|
-
<p
|
|
131
|
-
path="1"
|
|
132
|
-
contenteditable="false"
|
|
133
|
-
style="font-size: 14px; color: #666666; text-align: center;"><span
|
|
134
|
-
class="omnibus-text-before">Lowest 30-day price: </span><span
|
|
135
|
-
class="omnibus-price-value">17,00 TRY</span><span
|
|
136
|
-
class="omnibus-text-after"></span></p>
|
|
137
|
-
</td>
|
|
138
|
-
</tr>
|
|
139
|
-
`,
|
|
140
|
-
[a]: () => `
|
|
141
|
-
<tr>
|
|
142
|
-
<td
|
|
143
|
-
class="esd-block-text product-omnibus-discount"
|
|
144
|
-
esd-extension-block-id="recommendation-block-omnibus-discount"
|
|
145
|
-
data-text-before=""
|
|
146
|
-
data-text-after=""
|
|
147
|
-
align="center">
|
|
148
|
-
<p
|
|
149
|
-
path="1"
|
|
150
|
-
contenteditable="false"
|
|
151
|
-
style="font-size: 14px; color: #666666; text-align: center;"><span
|
|
152
|
-
class="omnibus-text-before"></span><span
|
|
153
|
-
class="omnibus-discount-value">-6%</span><span
|
|
154
|
-
class="omnibus-text-after"></span></p>
|
|
155
|
-
</td>
|
|
156
|
-
</tr>
|
|
157
|
-
`,
|
|
158
|
-
[o]: (t) => `
|
|
159
|
-
<tr>
|
|
160
|
-
<td
|
|
161
|
-
class="esd-block-button product-button"
|
|
162
|
-
esd-extension-block-id="recommendation-block-button"
|
|
163
|
-
align="center">
|
|
164
|
-
<span class="es-button-border" style="display: block;">
|
|
165
|
-
<a
|
|
166
|
-
href="${t.url}"
|
|
167
|
-
target="_blank"
|
|
168
|
-
class="es-button">
|
|
169
|
-
{-{-PRODUCT_BUTTON_TEXT-}-}
|
|
170
|
-
</a>
|
|
171
|
-
</span>
|
|
172
|
-
</td>
|
|
173
|
-
</tr>
|
|
174
|
-
`
|
|
175
|
-
};
|
|
176
|
-
function u(t, e, n) {
|
|
177
|
-
return i(
|
|
178
|
-
t,
|
|
179
|
-
e,
|
|
180
|
-
p,
|
|
181
|
-
n
|
|
182
|
-
);
|
|
183
|
-
}
|
|
184
|
-
export {
|
|
185
|
-
f as DEFAULTS,
|
|
186
|
-
g as default,
|
|
187
|
-
k as getDefaultProducts,
|
|
188
|
-
u as prepareProductRows
|
|
189
|
-
};
|
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
import { ATTR_PRODUCT_IMAGE as h, ATTR_PRODUCT_NAME as C, ATTR_PRODUCT_OLD_PRICE as D, ATTR_PRODUCT_PRICE as b, ATTR_PRODUCT_OMNIBUS_PRICE as P, ATTR_PRODUCT_OMNIBUS_DISCOUNT as U, ATTR_PRODUCT_BUTTON as N } from "../constants.js";
|
|
2
|
-
const E = {
|
|
3
|
-
TITLE: "You May Also Like!"
|
|
4
|
-
}, I = `
|
|
5
|
-
<tr>
|
|
6
|
-
<td class="spacer" style="height: 10px;"></td>
|
|
7
|
-
</tr>
|
|
8
|
-
`, A = `
|
|
9
|
-
<tr class="recommendation-product-row">
|
|
10
|
-
<td>
|
|
11
|
-
<table width="100%" height="100%" cellpadding="0" cellspacing="0" border="0">
|
|
12
|
-
{-{-PRODUCTS-}-}
|
|
13
|
-
</table>
|
|
14
|
-
</td>
|
|
15
|
-
</tr>
|
|
16
|
-
`, o = `
|
|
17
|
-
<td width="{-{-COLUMN_WIDTH-}-}" style="padding: 0 5px;" valign="top" height="100%">
|
|
18
|
-
<table
|
|
19
|
-
width="100%"
|
|
20
|
-
height="100%"
|
|
21
|
-
cellpadding="0"
|
|
22
|
-
cellspacing="0"
|
|
23
|
-
border="0"
|
|
24
|
-
class="product-card-wrapper">
|
|
25
|
-
<tr>
|
|
26
|
-
<td
|
|
27
|
-
class="product-attribute-cell"
|
|
28
|
-
valign="top">
|
|
29
|
-
<table cellpadding="0" cellspacing="0" role="presentation" width="100%">
|
|
30
|
-
<tbody>
|
|
31
|
-
{-{-PRODUCT_CONTENT-}-}
|
|
32
|
-
</tbody>
|
|
33
|
-
</table>
|
|
34
|
-
</td>
|
|
35
|
-
</tr>
|
|
36
|
-
</table>
|
|
37
|
-
</td>
|
|
38
|
-
`, Y = [
|
|
39
|
-
h,
|
|
40
|
-
C,
|
|
41
|
-
D,
|
|
42
|
-
b,
|
|
43
|
-
P,
|
|
44
|
-
U,
|
|
45
|
-
N
|
|
46
|
-
], S = {
|
|
47
|
-
[h]: !0,
|
|
48
|
-
[C]: !0,
|
|
49
|
-
[b]: !0,
|
|
50
|
-
[D]: !0,
|
|
51
|
-
[P]: !1,
|
|
52
|
-
[U]: !1,
|
|
53
|
-
[N]: !0
|
|
54
|
-
};
|
|
55
|
-
function M() {
|
|
56
|
-
return [
|
|
57
|
-
{
|
|
58
|
-
name: "Product Name",
|
|
59
|
-
image_url: "https://email-static.useinsider.com/stripo/modules/email-recommendation-v3/assets/images/image-placeholder.png",
|
|
60
|
-
price: { USD: 18 },
|
|
61
|
-
original_price: { USD: 20 },
|
|
62
|
-
discount: { USD: 2 },
|
|
63
|
-
url: "https://example.com/product/1",
|
|
64
|
-
item_id: "1",
|
|
65
|
-
in_stock: 1,
|
|
66
|
-
locale: "en",
|
|
67
|
-
product_attributes: {},
|
|
68
|
-
category: []
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
name: "Belt",
|
|
72
|
-
image_url: "https://inshoppingcart.com/ins-html/wp-content/uploads/2018/09/belt-2.jpg",
|
|
73
|
-
price: { TRY: 55 },
|
|
74
|
-
original_price: { TRY: 65 },
|
|
75
|
-
discount: { TRY: 10 },
|
|
76
|
-
url: "https://example.com/product/2",
|
|
77
|
-
item_id: "2",
|
|
78
|
-
in_stock: 1,
|
|
79
|
-
locale: "tr",
|
|
80
|
-
product_attributes: {},
|
|
81
|
-
category: []
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
name: "Beanie",
|
|
85
|
-
image_url: "https://inshoppingcart.com/ins-html/wp-content/uploads/2018/08/beanie-with-logo-1.jpg",
|
|
86
|
-
price: { TRY: 18 },
|
|
87
|
-
original_price: { TRY: 20 },
|
|
88
|
-
discount: { TRY: 2 },
|
|
89
|
-
url: "https://example.com/product/3",
|
|
90
|
-
item_id: "3",
|
|
91
|
-
in_stock: 1,
|
|
92
|
-
locale: "tr",
|
|
93
|
-
product_attributes: {},
|
|
94
|
-
category: []
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
name: "Album",
|
|
98
|
-
image_url: "https://inshoppingcart.com/ins-html/wp-content/uploads/2018/12/poster_2_up.jpg",
|
|
99
|
-
price: { TRY: 15 },
|
|
100
|
-
original_price: { TRY: 15 },
|
|
101
|
-
discount: { TRY: 0 },
|
|
102
|
-
url: "https://example.com/product/4",
|
|
103
|
-
item_id: "4",
|
|
104
|
-
in_stock: 1,
|
|
105
|
-
locale: "tr",
|
|
106
|
-
product_attributes: {},
|
|
107
|
-
category: []
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
name: "Flying Ninja with a very long product name",
|
|
111
|
-
image_url: "https://inshoppingcart.com/ins-html/wp-content/uploads/2018/09/belt-2.jpg",
|
|
112
|
-
price: { TRY: 12 },
|
|
113
|
-
original_price: { TRY: 15 },
|
|
114
|
-
discount: { TRY: 3 },
|
|
115
|
-
url: "https://example.com/product/5",
|
|
116
|
-
item_id: "5",
|
|
117
|
-
in_stock: 1,
|
|
118
|
-
locale: "tr",
|
|
119
|
-
product_attributes: {},
|
|
120
|
-
category: []
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
name: "Single",
|
|
124
|
-
image_url: "https://inshoppingcart.com/ins-html/wp-content/uploads/2018/12/poster_2_up.jpg",
|
|
125
|
-
price: { TRY: 22555 },
|
|
126
|
-
original_price: { TRY: 33989 },
|
|
127
|
-
discount: { TRY: 11434 },
|
|
128
|
-
url: "https://example.com/product/6",
|
|
129
|
-
item_id: "6",
|
|
130
|
-
in_stock: 1,
|
|
131
|
-
locale: "tr",
|
|
132
|
-
product_attributes: {},
|
|
133
|
-
category: []
|
|
134
|
-
}
|
|
135
|
-
];
|
|
136
|
-
}
|
|
137
|
-
function f(a, r, e, l = Y) {
|
|
138
|
-
const s = (100 / r).toFixed(2), p = [];
|
|
139
|
-
for (let i = 0; i < a.length; i += r)
|
|
140
|
-
p.push(a.slice(i, i + r));
|
|
141
|
-
let c = "";
|
|
142
|
-
return p.forEach((i, w) => {
|
|
143
|
-
w > 0 && (c += I);
|
|
144
|
-
let n = "", u = "", d = "", T = "", m = "", _ = "", g = "";
|
|
145
|
-
i.forEach((t) => {
|
|
146
|
-
n += o.replace(
|
|
147
|
-
"{-{-PRODUCT_CONTENT-}-}",
|
|
148
|
-
e.productImage(t)
|
|
149
|
-
), u += o.replace(
|
|
150
|
-
"{-{-PRODUCT_CONTENT-}-}",
|
|
151
|
-
e.productName(t)
|
|
152
|
-
), d += o.replace(
|
|
153
|
-
"{-{-PRODUCT_CONTENT-}-}",
|
|
154
|
-
e.productPrice(t)
|
|
155
|
-
), T += o.replace(
|
|
156
|
-
"{-{-PRODUCT_CONTENT-}-}",
|
|
157
|
-
e.productOldPrice(t)
|
|
158
|
-
), m += o.replace(
|
|
159
|
-
"{-{-PRODUCT_CONTENT-}-}",
|
|
160
|
-
e.productOmnibusPrice(t)
|
|
161
|
-
), _ += o.replace(
|
|
162
|
-
"{-{-PRODUCT_CONTENT-}-}",
|
|
163
|
-
e.productOmnibusDiscount(t)
|
|
164
|
-
), g += o.replace(
|
|
165
|
-
"{-{-PRODUCT_CONTENT-}-}",
|
|
166
|
-
e.productButton(t)
|
|
167
|
-
);
|
|
168
|
-
});
|
|
169
|
-
const R = {
|
|
170
|
-
productImage: n,
|
|
171
|
-
productName: u,
|
|
172
|
-
productPrice: d,
|
|
173
|
-
productOldPrice: T,
|
|
174
|
-
productOmnibusPrice: m,
|
|
175
|
-
productOmnibusDiscount: _,
|
|
176
|
-
productButton: g
|
|
177
|
-
}, y = l.filter((t) => !!R[t]).map((t) => {
|
|
178
|
-
const O = S[t] ?? !0;
|
|
179
|
-
return `
|
|
180
|
-
<tr class="recommendation-attribute-row"
|
|
181
|
-
data-attribute-type="${t}"
|
|
182
|
-
data-visibility="${O ? "1" : "0"}"${O ? "" : ' style="display: none;"'}>
|
|
183
|
-
${R[t]}
|
|
184
|
-
</tr>
|
|
185
|
-
`;
|
|
186
|
-
}).join("");
|
|
187
|
-
c += A.replace("{-{-PRODUCTS-}-}", y);
|
|
188
|
-
}), c.replaceAll("{-{-COLUMN_WIDTH-}-}", `${s}%`);
|
|
189
|
-
}
|
|
190
|
-
function j(a, r, e, l, s = E.TITLE, p) {
|
|
191
|
-
const c = f(
|
|
192
|
-
r,
|
|
193
|
-
e,
|
|
194
|
-
l,
|
|
195
|
-
p
|
|
196
|
-
);
|
|
197
|
-
return a.replace("{-{-TITLE-}-}", s).replace("{-{-PRODUCT_ROWS-}-}", c);
|
|
198
|
-
}
|
|
199
|
-
export {
|
|
200
|
-
E as DEFAULTS,
|
|
201
|
-
Y as DEFAULT_CARD_COMPOSITION,
|
|
202
|
-
S as DEFAULT_CARD_VISIBILITY,
|
|
203
|
-
j as generateTemplate,
|
|
204
|
-
M as getDefaultProducts,
|
|
205
|
-
f as prepareProductRows,
|
|
206
|
-
o as productCardWrapper,
|
|
207
|
-
A as productRow,
|
|
208
|
-
I as spacer
|
|
209
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { CommonControl } from '../common-control';
|
|
2
|
-
export declare const CONTROL_BLOCK_ID = "ui-elements-recommendation-block";
|
|
3
|
-
export declare class RecommendationBlockControl extends CommonControl {
|
|
4
|
-
private store;
|
|
5
|
-
private storeUnsubscription;
|
|
6
|
-
private addFilterListener;
|
|
7
|
-
private addFilterButton;
|
|
8
|
-
getId(): string;
|
|
9
|
-
getTemplate(): string;
|
|
10
|
-
onRender(): Promise<void>;
|
|
11
|
-
onDestroy(): void;
|
|
12
|
-
_setFormValues(): void;
|
|
13
|
-
_initializeSelectItems(): void;
|
|
14
|
-
_getAlgorithms(): string;
|
|
15
|
-
_getLanguages(): string;
|
|
16
|
-
_getCurrency(): string;
|
|
17
|
-
_getProductLayout(): string;
|
|
18
|
-
_getFilterStatus(): string;
|
|
19
|
-
_getShuffleProducts(): string;
|
|
20
|
-
_onFilterSelectClick(): void;
|
|
21
|
-
_onDataChange(item: string, value: string | number | string[]): void;
|
|
22
|
-
/**
|
|
23
|
-
* Get the current card composition from block data attribute or use default
|
|
24
|
-
*/
|
|
25
|
-
_getCardComposition(): string[];
|
|
26
|
-
_regenerateProductRows(): void;
|
|
27
|
-
/**
|
|
28
|
-
* Reapply spacing values after product regeneration
|
|
29
|
-
* This ensures spacing persists when products are regenerated
|
|
30
|
-
*/
|
|
31
|
-
_reapplySpacing(): void;
|
|
32
|
-
_debouncedRegenerateProductRows: import("@vueuse/shared").PromisifyFn<() => void>;
|
|
33
|
-
_onCurrencyConfigChange(item: string, value: string | number): void;
|
|
34
|
-
_onCurrencyChange(value: string): void;
|
|
35
|
-
_setProductIdsVisibility(): void;
|
|
36
|
-
_listenToFormUpdates(): void;
|
|
37
|
-
_listenStateUpdates(): void;
|
|
38
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
2
|
-
import { CommonControl } from '../../common-control';
|
|
3
|
-
/**
|
|
4
|
-
* Control for hiding the price when it's the same as the discounted price
|
|
5
|
-
* When enabled, adds an attribute hide-price="true" to the recommendation block container
|
|
6
|
-
*/
|
|
7
|
-
export declare class PriceHideControl extends CommonControl {
|
|
8
|
-
getId(): string;
|
|
9
|
-
getTemplate(): string;
|
|
10
|
-
onRender(): void;
|
|
11
|
-
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
12
|
-
_setFormValues(): void;
|
|
13
|
-
_getCurrentHideState(): boolean;
|
|
14
|
-
_onHidePriceChange(enabled: boolean): void;
|
|
15
|
-
_listenToFormUpdates(): void;
|
|
16
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
2
|
-
import { CommonControl } from '../../common-control';
|
|
3
|
-
import { RecommendationControlId } from '../constants';
|
|
4
|
-
export declare const PRICE_INLINE_LAYOUT_CONTROL_ID = RecommendationControlId.PRICE_INLINE_LAYOUT;
|
|
5
|
-
/**
|
|
6
|
-
* Price Inline Layout Control
|
|
7
|
-
*
|
|
8
|
-
* Provides a toggle to switch between inline and separate row layouts for Price and Old Price.
|
|
9
|
-
* - Toggle OFF (default): Price and Old Price in separate rows
|
|
10
|
-
* - Toggle ON: Price and Old Price side by side in the same row (inline)
|
|
11
|
-
*
|
|
12
|
-
* Uses DOM manipulation (not regeneration) to restructure the existing elements,
|
|
13
|
-
* preserving all styles and content.
|
|
14
|
-
*/
|
|
15
|
-
export declare class PriceInlineLayoutControl extends CommonControl {
|
|
16
|
-
getId(): string;
|
|
17
|
-
getTemplate(): string;
|
|
18
|
-
onRender(): void;
|
|
19
|
-
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
20
|
-
/**
|
|
21
|
-
* Reads the current price inline state from the block's data attribute
|
|
22
|
-
* and updates the toggle UI
|
|
23
|
-
* Note: Toggle ON = separate rows (next line), Toggle OFF = inline (same row)
|
|
24
|
-
*/
|
|
25
|
-
private _initializePriceInlineState;
|
|
26
|
-
/**
|
|
27
|
-
* Reads the price inline state from the block wrapper's data attribute
|
|
28
|
-
*/
|
|
29
|
-
private _readPriceInlineState;
|
|
30
|
-
/**
|
|
31
|
-
* Registers listener for toggle changes
|
|
32
|
-
*/
|
|
33
|
-
private _registerValueChangeListener;
|
|
34
|
-
/**
|
|
35
|
-
* Applies the price inline layout by restructuring the DOM
|
|
36
|
-
* When enabling inline: Merges Old Price content into Price row (side by side)
|
|
37
|
-
* When disabling inline: Separates them back into individual rows
|
|
38
|
-
*/
|
|
39
|
-
private _applyPriceInlineLayout;
|
|
40
|
-
/**
|
|
41
|
-
* Merges Old Price content into the same row as Price (inline layout)
|
|
42
|
-
* Creates a structure where both prices are side by side in one row
|
|
43
|
-
*/
|
|
44
|
-
private _mergeOldPriceIntoPrice;
|
|
45
|
-
/**
|
|
46
|
-
* Separates Old Price from Price row back into individual rows
|
|
47
|
-
* Restores the original separate row structure
|
|
48
|
-
*/
|
|
49
|
-
private _separateOldPriceFromPrice;
|
|
50
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { RecommendationProduct } from '@@/Types/recommendation';
|
|
2
|
-
import { DEFAULTS, getDefaultProducts, DEFAULT_CARD_COMPOSITION, DEFAULT_CARD_VISIBILITY } from './templateUtils';
|
|
3
|
-
declare const blockTemplate = "\n <td\n align=\"left\"\n class=\"ins-recommendation-v3-block-v2 es-p20\"\n data-price-inline=\"0\">\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr>\n <td align=\"center\">\n <table\n class=\"container\"\n width=\"100%\"\n cellpadding=\"0\"\n cellspacing=\"0\"\n border=\"0\">\n <tbody>\n <tr>\n <td>\n <table\n width=\"100%\"\n cellpadding=\"0\"\n cellspacing=\"0\"\n border=\"0\">\n <tbody>\n <BLOCK_TEXT\n class=\"es-p10t es-p10b es-p20l es-p20r\"\n align=\"center\">\n <p path=\"1\" style=\"font-size: 28px; color: #333333;\">\n <strong path=\"1,0\">{-{-TITLE-}-}</strong>\n </p>\n </BLOCK_TEXT>\n </tbody>\n </table>\n </td>\n </tr>\n \n <tr>\n <td class=\"spacer\" style=\"height: 10px;\"></td>\n </tr>\n\n <tr>\n <td>\n <table\n class=\"ins-recommendation-product-container\"\n width=\"100%\"\n cellpadding=\"0\"\n cellspacing=\"0\"\n border=\"0\"\n >\n {-{-PRODUCT_ROWS-}-}\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </table>\n </td>\n";
|
|
4
|
-
export declare function getDefaultTemplate(): string;
|
|
5
|
-
/**
|
|
6
|
-
* Generates a custom template with specified products and layout
|
|
7
|
-
* @param products - Array of products to display
|
|
8
|
-
* @param productsPerRow - Number of products per row
|
|
9
|
-
* @param title - Optional title for the block
|
|
10
|
-
* @param composition - Optional array defining order of card elements
|
|
11
|
-
* @returns Complete HTML template
|
|
12
|
-
*/
|
|
13
|
-
export declare function generateBlockTemplate(products: RecommendationProduct[], productsPerRow: number, title?: string, composition?: string[]): string;
|
|
14
|
-
export declare function prepareProductRows(products: RecommendationProduct[], productsPerRow: number, composition?: string[]): string;
|
|
15
|
-
export { DEFAULTS, DEFAULT_CARD_COMPOSITION, DEFAULT_CARD_VISIBILITY, getDefaultProducts, };
|
|
16
|
-
export default blockTemplate;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { RecommendationProduct } from '@@/Types/recommendation';
|
|
2
|
-
import { DEFAULTS, getDefaultProducts } from './templateUtils';
|
|
3
|
-
declare const migrationTemplate = "\n <td\n align=\"left\"\n esd-extension-block-id=\"recommendation-block\"\n esd-handler-name=\"esd-extension-RecommendationBlock\"\n class=\"ins-recommendation-v3-block-v2 es-p20 esd-recommendation-block esd-extension-block esd-container-frame\"\n data-price-inline=\"0\">\n <table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n <tr>\n <td align=\"center\">\n <table\n class=\"container\"\n width=\"100%\"\n cellpadding=\"0\"\n cellspacing=\"0\"\n border=\"0\">\n <tbody>\n <tr>\n <td>\n <table\n width=\"100%\"\n cellpadding=\"0\"\n cellspacing=\"0\"\n border=\"0\">\n <tbody>\n <tr>\n {-{-TITLE-}-}\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n <tr>\n <td class=\"spacer\" style=\"height: 20px;\"></td>\n </tr>\n <tr>\n <td>\n <table\n class=\"ins-recommendation-product-container\"\n width=\"100%\"\n cellpadding=\"0\"\n cellspacing=\"0\"\n border=\"0\"\n >\n {-{-PRODUCT_ROWS-}-}\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </table>\n </td>\n";
|
|
4
|
-
export declare function getMigrationTemplate(): string;
|
|
5
|
-
/**
|
|
6
|
-
* Generates a custom migration template with specified products and layout
|
|
7
|
-
* @param products - Array of products to display
|
|
8
|
-
* @param productsPerRow - Number of products per row
|
|
9
|
-
* @param title - Optional title for the block
|
|
10
|
-
* @param composition - Optional array defining order of card elements
|
|
11
|
-
* @returns Complete HTML template
|
|
12
|
-
*/
|
|
13
|
-
export declare function generateMigrationTemplate(products: RecommendationProduct[], productsPerRow: number, title?: string, composition?: string[]): string;
|
|
14
|
-
export declare function prepareProductRows(products: RecommendationProduct[], productsPerRow: number, composition?: string[]): string;
|
|
15
|
-
export { DEFAULTS, getDefaultProducts };
|
|
16
|
-
export default migrationTemplate;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { RecommendationProduct } from '@@/Types/recommendation';
|
|
2
|
-
import { ATTR_PRODUCT_IMAGE, ATTR_PRODUCT_NAME, ATTR_PRODUCT_PRICE, ATTR_PRODUCT_OLD_PRICE, ATTR_PRODUCT_OMNIBUS_PRICE, ATTR_PRODUCT_OMNIBUS_DISCOUNT, ATTR_PRODUCT_BUTTON } from '../constants';
|
|
3
|
-
export interface ElementRenderer {
|
|
4
|
-
[ATTR_PRODUCT_IMAGE]: (product: RecommendationProduct) => string;
|
|
5
|
-
[ATTR_PRODUCT_NAME]: (product: RecommendationProduct) => string;
|
|
6
|
-
[ATTR_PRODUCT_PRICE]: (product: RecommendationProduct) => string;
|
|
7
|
-
[ATTR_PRODUCT_OLD_PRICE]: (product: RecommendationProduct) => string;
|
|
8
|
-
[ATTR_PRODUCT_OMNIBUS_PRICE]: (product: RecommendationProduct) => string;
|
|
9
|
-
[ATTR_PRODUCT_OMNIBUS_DISCOUNT]: (product: RecommendationProduct) => string;
|
|
10
|
-
[ATTR_PRODUCT_BUTTON]: (product: RecommendationProduct) => string;
|
|
11
|
-
}
|
|
12
|
-
export interface TemplateConfig {
|
|
13
|
-
spacer: string;
|
|
14
|
-
blockTemplate: string;
|
|
15
|
-
productRow: string;
|
|
16
|
-
productCardWrapper: string;
|
|
17
|
-
elementRenderer: ElementRenderer;
|
|
18
|
-
}
|
|
19
|
-
export declare const DEFAULTS: {
|
|
20
|
-
TITLE: string;
|
|
21
|
-
DESCRIPTION: string;
|
|
22
|
-
};
|
|
23
|
-
export declare const spacer = "\n <tr>\n <td class=\"spacer\" style=\"height: 10px;\"></td>\n </tr>\n";
|
|
24
|
-
export declare const productRow = "\n <tr class=\"recommendation-product-row\">\n <td>\n <table width=\"100%\" height=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">\n {-{-PRODUCTS-}-}\n </table>\n </td>\n </tr>\n";
|
|
25
|
-
export declare const productCardWrapper = "\n <td width=\"{-{-COLUMN_WIDTH-}-}\" style=\"padding: 0 5px;\" valign=\"top\" height=\"100%\">\n <table\n width=\"100%\"\n height=\"100%\"\n cellpadding=\"0\"\n cellspacing=\"0\"\n border=\"0\"\n class=\"product-card-wrapper\">\n <tr>\n <td\n class=\"product-attribute-cell\"\n valign=\"top\">\n <table cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" width=\"100%\">\n <tbody>\n {-{-PRODUCT_CONTENT-}-}\n </tbody>\n </table>\n </td>\n </tr>\n </table>\n </td>\n";
|
|
26
|
-
export declare const DEFAULT_CARD_COMPOSITION: string[];
|
|
27
|
-
/**
|
|
28
|
-
* Default visibility settings for card composition elements
|
|
29
|
-
* Omnibus Price and Omnibus Discount are hidden by default
|
|
30
|
-
*/
|
|
31
|
-
export declare const DEFAULT_CARD_VISIBILITY: Record<string, boolean>;
|
|
32
|
-
export declare function getDefaultProducts(): RecommendationProduct[];
|
|
33
|
-
/**
|
|
34
|
-
* Core template generation logic that works with any element renderer
|
|
35
|
-
* @param products - Array of products to display
|
|
36
|
-
* @param productsPerRow - Number of products per row
|
|
37
|
-
* @param elementRenderer - Object with methods to render each product element
|
|
38
|
-
* @param composition - Optional array defining order of card elements
|
|
39
|
-
* @returns HTML string for product rows
|
|
40
|
-
*/
|
|
41
|
-
export declare function prepareProductRows(products: RecommendationProduct[], productsPerRow: number, elementRenderer: ElementRenderer, composition?: string[]): string;
|
|
42
|
-
/**
|
|
43
|
-
* Generates complete HTML template with dynamic products and layout
|
|
44
|
-
* @param blockTemplate - The base block template string
|
|
45
|
-
* @param products - Array of products to display
|
|
46
|
-
* @param productsPerRow - Number of products per row
|
|
47
|
-
* @param elementRenderer - Element renderer for generating product HTML
|
|
48
|
-
* @param title - Title for the block
|
|
49
|
-
* @param composition - Optional array defining order of card elements
|
|
50
|
-
* @returns Complete HTML template
|
|
51
|
-
*/
|
|
52
|
-
export declare function generateTemplate(blockTemplate: string, products: RecommendationProduct[], productsPerRow: number, elementRenderer: ElementRenderer, title?: string, composition?: string[]): string;
|