@useinsider/guido 3.12.0-beta.60e4757 → 3.12.0-beta.841bb6a
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/extensions/Blocks/Recommendation/constants/controlIds.js +1 -1
- package/dist/extensions/Blocks/Recommendation/extension.js +21 -23
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +40 -41
- package/dist/extensions/Blocks/controlFactories.js +75 -125
- package/dist/src/extensions/Blocks/Recommendation/constants/controlIds.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +0 -1
- package/dist/src/extensions/Blocks/controlFactories.d.ts +0 -36
- package/dist/utils/pairProductVariables.js +44 -43
- package/package.json +1 -1
- package/dist/extensions/Blocks/Recommendation/controls/blockBackground/index.js +0 -10
- package/dist/src/extensions/Blocks/Recommendation/controls/blockBackground/index.d.ts +0 -14
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var o = /* @__PURE__ */ ((c) => (c.
|
|
1
|
+
var o = /* @__PURE__ */ ((c) => (c.BUTTON_ALIGN = "recommendation-block-button-align-control", c.BUTTON_BORDER = "recommendation-block-button-border-control", c.BUTTON_BORDER_RADIUS = "recommendation-block-button-border-radius-control", c.BUTTON_COLOR = "recommendation-block-button-color-control", c.BUTTON_FIT_TO_CONTENT = "recommendation-block-button-fit-to-content-control", c.BUTTON_FONT_FAMILY = "recommendation-block-button-font-family-control", c.BUTTON_MARGINS = "recommendation-block-button-margins-control", c.BUTTON_PADDINGS = "recommendation-block-button-paddings-control", c.BUTTON_TEXT = "recommendation-block-button-text-control", c.BUTTON_TEXT_SIZE = "recommendation-block-button-text-size-control", c.BUTTON_TEXT_STYLE_AND_FONT_COLOR = "recommendation-block-button-text-style-and-font-color-control", c.NAME_ALIGN = "recommendation-block-name-align-control", c.NAME_BACKGROUND = "recommendation-block-name-background-control", c.NAME_COLOR = "recommendation-block-name-color-control", c.NAME_FONT_FAMILY = "recommendation-block-name-font-family-control", c.NAME_PADDINGS = "recommendation-block-name-paddings-control", c.NAME_SIZE = "recommendation-block-name-size-control", c.NAME_STYLE = "recommendation-block-name-style-control", c.NAME_TEXT_TRIM = "recommendation-block-name-text-trim-control", c.PRICE_ALIGN = "recommendation-block-price-align-control", c.PRICE_BACKGROUND = "recommendation-block-price-background-control", c.PRICE_COLOR = "recommendation-block-price-color-control", c.PRICE_FONT_FAMILY = "recommendation-block-price-font-family-control", c.PRICE_PADDINGS = "recommendation-block-price-paddings-control", c.PRICE_SIZE = "recommendation-block-price-size-control", c.PRICE_STYLE = "recommendation-block-price-style-control", c.OLD_PRICE_ALIGN = "recommendation-block-old-price-align-control", c.OLD_PRICE_BACKGROUND = "recommendation-block-old-price-background-control", c.OLD_PRICE_COLOR = "recommendation-block-old-price-color-control", c.OLD_PRICE_FONT_FAMILY = "recommendation-block-old-price-font-family-control", c.OLD_PRICE_PADDINGS = "recommendation-block-old-price-paddings-control", c.OLD_PRICE_SIZE = "recommendation-block-old-price-size-control", c.OLD_PRICE_STYLE = "recommendation-block-old-price-style-control", c.OMNIBUS_PRICE_ALIGN = "recommendation-block-omnibus-price-align-control", c.OMNIBUS_PRICE_BACKGROUND = "recommendation-block-omnibus-price-background-control", c.OMNIBUS_PRICE_COLOR = "recommendation-block-omnibus-price-color-control", c.OMNIBUS_PRICE_FONT_FAMILY = "recommendation-block-omnibus-price-font-family-control", c.OMNIBUS_PRICE_PADDINGS = "recommendation-block-omnibus-price-paddings-control", c.OMNIBUS_PRICE_SIZE = "recommendation-block-omnibus-price-size-control", c.OMNIBUS_PRICE_STYLE = "recommendation-block-omnibus-price-style-control", c.OMNIBUS_PRICE_TEXT_BEFORE = "recommendation-block-omnibus-price-text-before-control", c.OMNIBUS_PRICE_TEXT_AFTER = "recommendation-block-omnibus-price-text-after-control", c.OMNIBUS_DISCOUNT_ALIGN = "recommendation-block-omnibus-discount-align-control", c.OMNIBUS_DISCOUNT_BACKGROUND = "recommendation-block-omnibus-discount-background-control", c.OMNIBUS_DISCOUNT_COLOR = "recommendation-block-omnibus-discount-color-control", c.OMNIBUS_DISCOUNT_FONT_FAMILY = "recommendation-block-omnibus-discount-font-family-control", c.OMNIBUS_DISCOUNT_PADDINGS = "recommendation-block-omnibus-discount-paddings-control", c.OMNIBUS_DISCOUNT_SIZE = "recommendation-block-omnibus-discount-size-control", c.OMNIBUS_DISCOUNT_STYLE = "recommendation-block-omnibus-discount-style-control", c.OMNIBUS_DISCOUNT_TEXT_BEFORE = "recommendation-block-omnibus-discount-text-before-control", c.OMNIBUS_DISCOUNT_TEXT_AFTER = "recommendation-block-omnibus-discount-text-after-control", c.IMAGE_SIZE = "recommendation-block-image-size-control", c.IMAGE_MARGINS = "recommendation-block-image-margins-control", c.CUSTOM_ATTR_ALIGN = "recommendation-block-custom-attr-align-control", c.CUSTOM_ATTR_BACKGROUND = "recommendation-block-custom-attr-background-control", c.CUSTOM_ATTR_COLOR = "recommendation-block-custom-attr-color-control", c.CUSTOM_ATTR_FONT_FAMILY = "recommendation-block-custom-attr-font-family-control", c.CUSTOM_ATTR_PADDINGS = "recommendation-block-custom-attr-paddings-control", c.CUSTOM_ATTR_SIZE = "recommendation-block-custom-attr-size-control", c.CUSTOM_ATTR_STYLE = "recommendation-block-custom-attr-style-control", c.CUSTOM_ATTR_TEXT_TRIM = "recommendation-block-custom-attr-text-trim-control", c.SYNC_INFO_MESSAGE = "recommendation-block-sync-info-message", c))(o || {});
|
|
2
2
|
export {
|
|
3
3
|
o as RecommendationControlId
|
|
4
4
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExtensionBuilder as
|
|
1
|
+
import { ExtensionBuilder as r } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
2
|
import { RecommendationBlock as m } from "./block.js";
|
|
3
3
|
import n from "./canvasPreview.css.js";
|
|
4
4
|
import { RecommendationBlockControl as i } from "./controls/main/index.js";
|
|
@@ -6,44 +6,42 @@ import "./constants/selectors.js";
|
|
|
6
6
|
import "./store/recommendation.js";
|
|
7
7
|
import "./utils/captureStyleTemplates.js";
|
|
8
8
|
import { NameControls as e } from "./controls/name/index.js";
|
|
9
|
-
import { PriceControls as
|
|
10
|
-
import { OldPriceControls as
|
|
9
|
+
import { PriceControls as s } from "./controls/price/index.js";
|
|
10
|
+
import { OldPriceControls as l } from "./controls/oldPrice/index.js";
|
|
11
11
|
import { OmnibusPriceControls as p } from "./controls/omnibusPrice/index.js";
|
|
12
12
|
import { OmnibusDiscountControls as a } from "./controls/omnibusDiscount/index.js";
|
|
13
13
|
import { ButtonControls as c } from "./controls/button/index.js";
|
|
14
|
-
import { ImageControls as
|
|
15
|
-
import { CustomAttributeControls as
|
|
14
|
+
import { ImageControls as f } from "./controls/image/index.js";
|
|
15
|
+
import { CustomAttributeControls as C } from "./controls/customAttribute/index.js";
|
|
16
16
|
import { SpacingControl as d } from "./controls/spacing/index.js";
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import { SyncInfoMessageControl as B } from "./controls/syncInfoMessage.js";
|
|
17
|
+
import { CardBackgroundColorControl as u } from "./controls/cardBackground/index.js";
|
|
18
|
+
import { RecommendationCardCompositionControl as g } from "./controls/cardComposition/index.js";
|
|
19
|
+
import { SyncInfoMessageControl as y } from "./controls/syncInfoMessage.js";
|
|
21
20
|
import { RecommendationIconsRegistry as P } from "./iconsRegistry.js";
|
|
22
21
|
import R from "./recommendation.css.js";
|
|
23
22
|
import { SettingsPanel as S } from "./settingsPanel.js";
|
|
24
|
-
const
|
|
23
|
+
const w = [
|
|
25
24
|
e,
|
|
26
|
-
l,
|
|
27
25
|
s,
|
|
26
|
+
l,
|
|
28
27
|
p,
|
|
29
28
|
a,
|
|
30
29
|
c,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
],
|
|
30
|
+
f,
|
|
31
|
+
C
|
|
32
|
+
], B = [
|
|
34
33
|
i,
|
|
35
34
|
u,
|
|
36
|
-
g,
|
|
37
35
|
d,
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
g,
|
|
37
|
+
y
|
|
40
38
|
], b = [
|
|
41
|
-
...
|
|
42
|
-
...
|
|
43
|
-
],
|
|
44
|
-
(o,
|
|
45
|
-
new
|
|
39
|
+
...B,
|
|
40
|
+
...w.flatMap((o) => Object.values(o))
|
|
41
|
+
], U = b.reduce(
|
|
42
|
+
(o, t) => o.addControl(t),
|
|
43
|
+
new r().addBlock(m).withSettingsPanelRegistry(S)
|
|
46
44
|
).addStyles(R).withPreviewStyles(n).withIconsRegistry(P).build();
|
|
47
45
|
export {
|
|
48
|
-
|
|
46
|
+
U as default
|
|
49
47
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { SettingsPanelRegistry as E, SettingsPanelTab as _, SettingsTab as
|
|
2
|
-
import { BLOCK_ID as
|
|
1
|
+
import { SettingsPanelRegistry as E, SettingsPanelTab as _, SettingsTab as O, ContainerControls as C, TextControls as R } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { BLOCK_ID as U } from "./block.js";
|
|
3
3
|
import { RecommendationBlockId as S } from "./constants/blockIds.js";
|
|
4
4
|
import { RecommendationControlId as T } from "./constants/controlIds.js";
|
|
5
5
|
import "./constants/selectors.js";
|
|
6
|
-
import { CONTROL_BLOCK_ID as
|
|
6
|
+
import { CONTROL_BLOCK_ID as A } from "./controls/main/index.js";
|
|
7
7
|
import "./store/recommendation.js";
|
|
8
8
|
import "./utils/captureStyleTemplates.js";
|
|
9
9
|
import "./controls/name/index.js";
|
|
@@ -13,38 +13,37 @@ import "./controls/omnibusPrice/index.js";
|
|
|
13
13
|
import "./controls/omnibusDiscount/index.js";
|
|
14
14
|
import "./controls/button/index.js";
|
|
15
15
|
import "./controls/image/index.js";
|
|
16
|
-
import { SPACING_CONTROL_ID as
|
|
17
|
-
import "./controls/
|
|
18
|
-
import {
|
|
19
|
-
import { COMPOSITION_CONTROL_BLOCK_ID as D } from "./controls/cardComposition/index.js";
|
|
16
|
+
import { SPACING_CONTROL_ID as L } from "./controls/spacing/index.js";
|
|
17
|
+
import { CARD_BACKGROUND_COLOR_CONTROL_ID as D } from "./controls/cardBackground/index.js";
|
|
18
|
+
import { COMPOSITION_CONTROL_BLOCK_ID as B } from "./controls/cardComposition/index.js";
|
|
20
19
|
import { SYNC_INFO_MESSAGE_CONTROL_ID as N } from "./controls/syncInfoMessage.js";
|
|
21
|
-
class
|
|
22
|
-
registerBlockControls(
|
|
23
|
-
|
|
20
|
+
class d extends E {
|
|
21
|
+
registerBlockControls(I) {
|
|
22
|
+
I[U] = [
|
|
24
23
|
new _(
|
|
25
|
-
|
|
24
|
+
O.SETTINGS,
|
|
26
25
|
[
|
|
27
|
-
|
|
26
|
+
A,
|
|
28
27
|
C.EXTERNAL_INDENTS
|
|
29
28
|
]
|
|
30
29
|
),
|
|
31
30
|
new _(
|
|
32
|
-
|
|
31
|
+
O.STYLES,
|
|
33
32
|
[
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
R.TEXT_BLOCK_BACKGROUND_COLOR,
|
|
34
|
+
D,
|
|
35
|
+
L
|
|
37
36
|
]
|
|
38
37
|
),
|
|
39
38
|
new _(
|
|
40
39
|
"Card Composition",
|
|
41
40
|
[
|
|
42
|
-
|
|
41
|
+
B
|
|
43
42
|
]
|
|
44
43
|
).withLabel(this.api.translate("Card Composition"))
|
|
45
|
-
],
|
|
44
|
+
], I[S.NAME] = [
|
|
46
45
|
new _(
|
|
47
|
-
|
|
46
|
+
O.SETTINGS,
|
|
48
47
|
[
|
|
49
48
|
N,
|
|
50
49
|
T.NAME_STYLE,
|
|
@@ -54,7 +53,7 @@ class s extends E {
|
|
|
54
53
|
]
|
|
55
54
|
),
|
|
56
55
|
new _(
|
|
57
|
-
|
|
56
|
+
O.STYLES,
|
|
58
57
|
[
|
|
59
58
|
T.NAME_BACKGROUND,
|
|
60
59
|
T.NAME_FONT_FAMILY,
|
|
@@ -62,9 +61,9 @@ class s extends E {
|
|
|
62
61
|
T.NAME_COLOR
|
|
63
62
|
]
|
|
64
63
|
)
|
|
65
|
-
],
|
|
64
|
+
], I[S.PRICE] = [
|
|
66
65
|
new _(
|
|
67
|
-
|
|
66
|
+
O.SETTINGS,
|
|
68
67
|
[
|
|
69
68
|
N,
|
|
70
69
|
T.PRICE_STYLE,
|
|
@@ -73,7 +72,7 @@ class s extends E {
|
|
|
73
72
|
]
|
|
74
73
|
),
|
|
75
74
|
new _(
|
|
76
|
-
|
|
75
|
+
O.STYLES,
|
|
77
76
|
[
|
|
78
77
|
T.PRICE_BACKGROUND,
|
|
79
78
|
T.PRICE_FONT_FAMILY,
|
|
@@ -81,9 +80,9 @@ class s extends E {
|
|
|
81
80
|
T.PRICE_COLOR
|
|
82
81
|
]
|
|
83
82
|
)
|
|
84
|
-
],
|
|
83
|
+
], I[S.OLD_PRICE] = [
|
|
85
84
|
new _(
|
|
86
|
-
|
|
85
|
+
O.SETTINGS,
|
|
87
86
|
[
|
|
88
87
|
N,
|
|
89
88
|
T.OLD_PRICE_STYLE,
|
|
@@ -92,7 +91,7 @@ class s extends E {
|
|
|
92
91
|
]
|
|
93
92
|
),
|
|
94
93
|
new _(
|
|
95
|
-
|
|
94
|
+
O.STYLES,
|
|
96
95
|
[
|
|
97
96
|
T.OLD_PRICE_BACKGROUND,
|
|
98
97
|
T.OLD_PRICE_FONT_FAMILY,
|
|
@@ -100,9 +99,9 @@ class s extends E {
|
|
|
100
99
|
T.OLD_PRICE_COLOR
|
|
101
100
|
]
|
|
102
101
|
)
|
|
103
|
-
],
|
|
102
|
+
], I[S.OMNIBUS_PRICE] = [
|
|
104
103
|
new _(
|
|
105
|
-
|
|
104
|
+
O.SETTINGS,
|
|
106
105
|
[
|
|
107
106
|
N,
|
|
108
107
|
T.OMNIBUS_PRICE_TEXT_BEFORE,
|
|
@@ -113,7 +112,7 @@ class s extends E {
|
|
|
113
112
|
]
|
|
114
113
|
),
|
|
115
114
|
new _(
|
|
116
|
-
|
|
115
|
+
O.STYLES,
|
|
117
116
|
[
|
|
118
117
|
T.OMNIBUS_PRICE_BACKGROUND,
|
|
119
118
|
T.OMNIBUS_PRICE_FONT_FAMILY,
|
|
@@ -121,9 +120,9 @@ class s extends E {
|
|
|
121
120
|
T.OMNIBUS_PRICE_COLOR
|
|
122
121
|
]
|
|
123
122
|
)
|
|
124
|
-
],
|
|
123
|
+
], I[S.OMNIBUS_DISCOUNT] = [
|
|
125
124
|
new _(
|
|
126
|
-
|
|
125
|
+
O.SETTINGS,
|
|
127
126
|
[
|
|
128
127
|
N,
|
|
129
128
|
T.OMNIBUS_DISCOUNT_TEXT_BEFORE,
|
|
@@ -134,7 +133,7 @@ class s extends E {
|
|
|
134
133
|
]
|
|
135
134
|
),
|
|
136
135
|
new _(
|
|
137
|
-
|
|
136
|
+
O.STYLES,
|
|
138
137
|
[
|
|
139
138
|
T.OMNIBUS_DISCOUNT_BACKGROUND,
|
|
140
139
|
T.OMNIBUS_DISCOUNT_FONT_FAMILY,
|
|
@@ -142,9 +141,9 @@ class s extends E {
|
|
|
142
141
|
T.OMNIBUS_DISCOUNT_COLOR
|
|
143
142
|
]
|
|
144
143
|
)
|
|
145
|
-
],
|
|
144
|
+
], I[S.BUTTON] = [
|
|
146
145
|
new _(
|
|
147
|
-
|
|
146
|
+
O.SETTINGS,
|
|
148
147
|
[
|
|
149
148
|
N,
|
|
150
149
|
T.BUTTON_TEXT,
|
|
@@ -154,7 +153,7 @@ class s extends E {
|
|
|
154
153
|
]
|
|
155
154
|
),
|
|
156
155
|
new _(
|
|
157
|
-
|
|
156
|
+
O.STYLES,
|
|
158
157
|
[
|
|
159
158
|
T.BUTTON_COLOR,
|
|
160
159
|
T.BUTTON_FONT_FAMILY,
|
|
@@ -165,9 +164,9 @@ class s extends E {
|
|
|
165
164
|
T.BUTTON_BORDER
|
|
166
165
|
]
|
|
167
166
|
)
|
|
168
|
-
],
|
|
167
|
+
], I[S.CUSTOM_ATTRIBUTE] = [
|
|
169
168
|
new _(
|
|
170
|
-
|
|
169
|
+
O.SETTINGS,
|
|
171
170
|
[
|
|
172
171
|
T.CUSTOM_ATTR_STYLE,
|
|
173
172
|
T.CUSTOM_ATTR_ALIGN,
|
|
@@ -176,7 +175,7 @@ class s extends E {
|
|
|
176
175
|
]
|
|
177
176
|
),
|
|
178
177
|
new _(
|
|
179
|
-
|
|
178
|
+
O.STYLES,
|
|
180
179
|
[
|
|
181
180
|
T.CUSTOM_ATTR_BACKGROUND,
|
|
182
181
|
T.CUSTOM_ATTR_FONT_FAMILY,
|
|
@@ -184,9 +183,9 @@ class s extends E {
|
|
|
184
183
|
T.CUSTOM_ATTR_COLOR
|
|
185
184
|
]
|
|
186
185
|
)
|
|
187
|
-
],
|
|
186
|
+
], I[S.IMAGE] = [
|
|
188
187
|
new _(
|
|
189
|
-
|
|
188
|
+
O.SETTINGS,
|
|
190
189
|
[
|
|
191
190
|
N,
|
|
192
191
|
T.IMAGE_SIZE,
|
|
@@ -197,5 +196,5 @@ class s extends E {
|
|
|
197
196
|
}
|
|
198
197
|
}
|
|
199
198
|
export {
|
|
200
|
-
|
|
199
|
+
d as SettingsPanel
|
|
201
200
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { TextAlignBuiltInControl as
|
|
2
|
-
const
|
|
3
|
-
function
|
|
4
|
-
return class extends
|
|
1
|
+
import { TextAlignBuiltInControl as a, TextColorBuiltInControl as g, TextSizeBuiltInControl as f, TextStyleBuiltInControl as x, TextFontFamilyBuiltInControl as C, ButtonBackgroundColorBuiltInControl as T, TextPaddingsBuiltInControl as B, ImageSizeBuiltInControl as m, ImageMarginsBuiltInControl as y, ButtonAlignBuiltInControl as I, ButtonBorderBuiltInControl as S, ButtonBorderRadiusBuiltInControl as A, ButtonColorBuiltInControl as b, ButtonFontFamilyBuiltInControl as N, ButtonMarginsBuiltInControl as q, ButtonPaddingsBuiltInControl as $, ButtonTextBuiltInControl as k, ButtonTextSizeBuiltInControl as p, ButtonTextStyleAndFontColorBuiltInControl as h, ButtonFitToContainerBuiltInControl as F, TextLineSpacingBuiltInControl as M } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
const R = "buttonTextStyleForm", _ = "backgroundColor", E = /* @__PURE__ */ new Set(["", "transparent", "rgba(0, 0, 0, 0)"]);
|
|
3
|
+
function z(o, n, r) {
|
|
4
|
+
return class extends a {
|
|
5
5
|
getId() {
|
|
6
6
|
return o;
|
|
7
7
|
}
|
|
@@ -13,8 +13,8 @@ function P(o, n, r) {
|
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
return class extends
|
|
16
|
+
function v(o, n, r) {
|
|
17
|
+
return class extends g {
|
|
18
18
|
getId() {
|
|
19
19
|
return o;
|
|
20
20
|
}
|
|
@@ -26,8 +26,8 @@ function H(o, n, r) {
|
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
return class extends
|
|
29
|
+
function P(o, n, r) {
|
|
30
|
+
return class extends f {
|
|
31
31
|
getId() {
|
|
32
32
|
return o;
|
|
33
33
|
}
|
|
@@ -39,8 +39,8 @@ function U(o, n, r) {
|
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
return class extends
|
|
42
|
+
function D(o, n, r) {
|
|
43
|
+
return class extends x {
|
|
44
44
|
getId() {
|
|
45
45
|
return o;
|
|
46
46
|
}
|
|
@@ -52,8 +52,8 @@ function Y(o, n, r) {
|
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
return class extends
|
|
55
|
+
function K(o, n, r) {
|
|
56
|
+
return class extends C {
|
|
57
57
|
getId() {
|
|
58
58
|
return o;
|
|
59
59
|
}
|
|
@@ -65,8 +65,8 @@ function G(o, n, r) {
|
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
return class extends
|
|
68
|
+
function L(o, n, r) {
|
|
69
|
+
return class extends T {
|
|
70
70
|
getId() {
|
|
71
71
|
return o;
|
|
72
72
|
}
|
|
@@ -89,65 +89,16 @@ function V(o, n, r) {
|
|
|
89
89
|
const t = this.getTargetNodes(e);
|
|
90
90
|
if (!t.length)
|
|
91
91
|
return;
|
|
92
|
-
const
|
|
92
|
+
const s = this.api.getValues()[_], i = !s || E.has(s), c = this.api.getDocumentModifier();
|
|
93
93
|
return t.forEach((u) => {
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
}),
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
function K(o) {
|
|
101
|
-
const n = _.find((e) => e in o);
|
|
102
|
-
if (!n)
|
|
103
|
-
return;
|
|
104
|
-
const r = o[n];
|
|
105
|
-
return typeof r == "string" ? r : "";
|
|
106
|
-
}
|
|
107
|
-
function L(o, n) {
|
|
108
|
-
return n.startsWith(".") && "hasClass" in o && o.hasClass(n.slice(1));
|
|
109
|
-
}
|
|
110
|
-
function z(o, n) {
|
|
111
|
-
try {
|
|
112
|
-
return L(o, n) ? o : o.closest(n) ?? void 0;
|
|
113
|
-
} catch {
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
function w(o, n) {
|
|
118
|
-
return class extends d {
|
|
119
|
-
getId() {
|
|
120
|
-
return o;
|
|
121
|
-
}
|
|
122
|
-
/** The parent control renders its own generic title; restore the block-level wording. */
|
|
123
|
-
getLabels() {
|
|
124
|
-
return { title: this.api.translate("Block Background Color") };
|
|
125
|
-
}
|
|
126
|
-
/** Guard: redirect the borrowed button parent onto the block `<td>` so it never paints the Buy buttons. */
|
|
127
|
-
getTargetNodes(r) {
|
|
128
|
-
const e = z(r, n);
|
|
129
|
-
return e ? [e] : [];
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Writes the picked background onto the block as an inline style plus a `bgcolor`
|
|
133
|
-
* attribute. This is the whole mechanism, not a mirror: the parent control's own
|
|
134
|
-
* write never reaches the block element (verified at runtime). `bgcolor` is the
|
|
135
|
-
* channel Outlook honours on a `<td>`, and matches what the migrator emits.
|
|
136
|
-
*/
|
|
137
|
-
getAdditionalModifications(r) {
|
|
138
|
-
const [e] = this.getTargetNodes(r);
|
|
139
|
-
if (!e)
|
|
140
|
-
return;
|
|
141
|
-
const t = K(this.api.getValues());
|
|
142
|
-
if (t === void 0)
|
|
143
|
-
return;
|
|
144
|
-
const i = !t || g.has(t), l = this.api.getDocumentModifier(), s = l.modifyHtml(e);
|
|
145
|
-
return i ? s.removeStyle("background-color").removeAttribute("bgcolor") : (s.setStyle("background-color", t), E.test(t) ? s.setAttribute("bgcolor", t) : s.removeAttribute("bgcolor")), l;
|
|
94
|
+
const l = c.modifyHtml(u);
|
|
95
|
+
i ? l.removeStyle("background-color") : l.setStyle("background-color", s);
|
|
96
|
+
}), c;
|
|
146
97
|
}
|
|
147
98
|
};
|
|
148
99
|
}
|
|
149
|
-
function
|
|
150
|
-
return class extends
|
|
100
|
+
function U(o, n, r) {
|
|
101
|
+
return class extends B {
|
|
151
102
|
getId() {
|
|
152
103
|
return o;
|
|
153
104
|
}
|
|
@@ -159,7 +110,7 @@ function W(o, n, r) {
|
|
|
159
110
|
}
|
|
160
111
|
};
|
|
161
112
|
}
|
|
162
|
-
function
|
|
113
|
+
function Y(o, n, r) {
|
|
163
114
|
return class extends M {
|
|
164
115
|
getId() {
|
|
165
116
|
return o;
|
|
@@ -169,8 +120,8 @@ function X(o, n, r) {
|
|
|
169
120
|
}
|
|
170
121
|
};
|
|
171
122
|
}
|
|
172
|
-
function
|
|
173
|
-
return class extends
|
|
123
|
+
function w(o, n, r = ".ins-recommendation-product-container") {
|
|
124
|
+
return class extends I {
|
|
174
125
|
getId() {
|
|
175
126
|
return o;
|
|
176
127
|
}
|
|
@@ -180,8 +131,8 @@ function j(o, n, r = ".ins-recommendation-product-container") {
|
|
|
180
131
|
}
|
|
181
132
|
};
|
|
182
133
|
}
|
|
183
|
-
function
|
|
184
|
-
return class extends
|
|
134
|
+
function G(o, n, r = ".ins-recommendation-product-container") {
|
|
135
|
+
return class extends b {
|
|
185
136
|
getId() {
|
|
186
137
|
return o;
|
|
187
138
|
}
|
|
@@ -191,8 +142,8 @@ function J(o, n, r = ".ins-recommendation-product-container") {
|
|
|
191
142
|
}
|
|
192
143
|
};
|
|
193
144
|
}
|
|
194
|
-
function
|
|
195
|
-
return class extends
|
|
145
|
+
function H(o, n, r = ".ins-recommendation-product-container") {
|
|
146
|
+
return class extends S {
|
|
196
147
|
getId() {
|
|
197
148
|
return o;
|
|
198
149
|
}
|
|
@@ -202,8 +153,8 @@ function Q(o, n, r = ".ins-recommendation-product-container") {
|
|
|
202
153
|
}
|
|
203
154
|
};
|
|
204
155
|
}
|
|
205
|
-
function
|
|
206
|
-
return class extends
|
|
156
|
+
function V(o, n, r = ".ins-recommendation-product-container") {
|
|
157
|
+
return class extends A {
|
|
207
158
|
getId() {
|
|
208
159
|
return o;
|
|
209
160
|
}
|
|
@@ -213,8 +164,8 @@ function Z(o, n, r = ".ins-recommendation-product-container") {
|
|
|
213
164
|
}
|
|
214
165
|
};
|
|
215
166
|
}
|
|
216
|
-
function
|
|
217
|
-
return class extends
|
|
167
|
+
function W(o, n, r = ".ins-recommendation-product-container") {
|
|
168
|
+
return class extends N {
|
|
218
169
|
getId() {
|
|
219
170
|
return o;
|
|
220
171
|
}
|
|
@@ -224,8 +175,8 @@ function tt(o, n, r = ".ins-recommendation-product-container") {
|
|
|
224
175
|
}
|
|
225
176
|
};
|
|
226
177
|
}
|
|
227
|
-
function
|
|
228
|
-
return class extends
|
|
178
|
+
function X(o, n, r = ".ins-recommendation-product-container") {
|
|
179
|
+
return class extends q {
|
|
229
180
|
getId() {
|
|
230
181
|
return o;
|
|
231
182
|
}
|
|
@@ -235,7 +186,7 @@ function et(o, n, r = ".ins-recommendation-product-container") {
|
|
|
235
186
|
}
|
|
236
187
|
};
|
|
237
188
|
}
|
|
238
|
-
function
|
|
189
|
+
function j(o, n, r = ".ins-recommendation-product-container") {
|
|
239
190
|
return class extends $ {
|
|
240
191
|
getId() {
|
|
241
192
|
return o;
|
|
@@ -246,8 +197,8 @@ function nt(o, n, r = ".ins-recommendation-product-container") {
|
|
|
246
197
|
}
|
|
247
198
|
};
|
|
248
199
|
}
|
|
249
|
-
function
|
|
250
|
-
return class extends
|
|
200
|
+
function J(o, n, r = ".ins-recommendation-product-container") {
|
|
201
|
+
return class extends k {
|
|
251
202
|
getId() {
|
|
252
203
|
return o;
|
|
253
204
|
}
|
|
@@ -257,8 +208,8 @@ function rt(o, n, r = ".ins-recommendation-product-container") {
|
|
|
257
208
|
}
|
|
258
209
|
};
|
|
259
210
|
}
|
|
260
|
-
function
|
|
261
|
-
return class extends
|
|
211
|
+
function Q(o, n, r = ".ins-recommendation-product-container") {
|
|
212
|
+
return class extends p {
|
|
262
213
|
getId() {
|
|
263
214
|
return o;
|
|
264
215
|
}
|
|
@@ -268,8 +219,8 @@ function ot(o, n, r = ".ins-recommendation-product-container") {
|
|
|
268
219
|
}
|
|
269
220
|
};
|
|
270
221
|
}
|
|
271
|
-
function
|
|
272
|
-
return class extends
|
|
222
|
+
function Z(o, n, r) {
|
|
223
|
+
return class extends h {
|
|
273
224
|
getId() {
|
|
274
225
|
return o;
|
|
275
226
|
}
|
|
@@ -291,21 +242,21 @@ function st(o, n, r) {
|
|
|
291
242
|
const t = e.closest(r);
|
|
292
243
|
if (!t)
|
|
293
244
|
return;
|
|
294
|
-
const
|
|
295
|
-
if (!
|
|
245
|
+
const s = t.querySelectorAll(`[esd-extension-block-id="${n}"] a.es-button`);
|
|
246
|
+
if (!s.length)
|
|
296
247
|
return;
|
|
297
|
-
const
|
|
298
|
-
if (!
|
|
248
|
+
const i = this.api.getValues()[R];
|
|
249
|
+
if (!i)
|
|
299
250
|
return;
|
|
300
|
-
const
|
|
301
|
-
return
|
|
302
|
-
|
|
303
|
-
}),
|
|
251
|
+
const c = i.bold ? "bold" : "normal", u = i.italic ? "italic" : "normal", l = this.api.getDocumentModifier();
|
|
252
|
+
return s.forEach((d) => {
|
|
253
|
+
l.modifyHtml(d).setStyle("font-weight", c).setStyle("font-style", u);
|
|
254
|
+
}), l;
|
|
304
255
|
}
|
|
305
256
|
};
|
|
306
257
|
}
|
|
307
|
-
function
|
|
308
|
-
return class extends
|
|
258
|
+
function tt(o, n, r) {
|
|
259
|
+
return class extends F {
|
|
309
260
|
getId() {
|
|
310
261
|
return o;
|
|
311
262
|
}
|
|
@@ -315,8 +266,8 @@ function it(o, n, r) {
|
|
|
315
266
|
}
|
|
316
267
|
};
|
|
317
268
|
}
|
|
318
|
-
function
|
|
319
|
-
return class extends
|
|
269
|
+
function et(o, n, r) {
|
|
270
|
+
return class extends m {
|
|
320
271
|
getId() {
|
|
321
272
|
return o;
|
|
322
273
|
}
|
|
@@ -330,8 +281,8 @@ function lt(o, n, r) {
|
|
|
330
281
|
}
|
|
331
282
|
};
|
|
332
283
|
}
|
|
333
|
-
function
|
|
334
|
-
return class extends
|
|
284
|
+
function nt(o, n, r) {
|
|
285
|
+
return class extends y {
|
|
335
286
|
getId() {
|
|
336
287
|
return o;
|
|
337
288
|
}
|
|
@@ -346,26 +297,25 @@ function ct(o, n, r) {
|
|
|
346
297
|
};
|
|
347
298
|
}
|
|
348
299
|
export {
|
|
349
|
-
w as
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
Y as createTextStyleControl
|
|
300
|
+
w as createButtonAlignControl,
|
|
301
|
+
H as createButtonBorderControl,
|
|
302
|
+
V as createButtonBorderRadiusControl,
|
|
303
|
+
G as createButtonColorControl,
|
|
304
|
+
tt as createButtonFitToContainerControl,
|
|
305
|
+
W as createButtonFontFamilyControl,
|
|
306
|
+
X as createButtonMarginsControl,
|
|
307
|
+
j as createButtonPaddingsControl,
|
|
308
|
+
J as createButtonTextControl,
|
|
309
|
+
Q as createButtonTextSizeControl,
|
|
310
|
+
Z as createButtonTextStyleAndFontColorControl,
|
|
311
|
+
nt as createImageMarginsControl,
|
|
312
|
+
et as createImageSizeControl,
|
|
313
|
+
U as createPaddingsControl,
|
|
314
|
+
z as createTextAlignControl,
|
|
315
|
+
L as createTextBackgroundColorControl,
|
|
316
|
+
v as createTextColorControl,
|
|
317
|
+
K as createTextFontFamilyControl,
|
|
318
|
+
Y as createTextLineSpacingControl,
|
|
319
|
+
P as createTextSizeControl,
|
|
320
|
+
D as createTextStyleControl
|
|
371
321
|
};
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* These IDs are returned by the getId() method of each control
|
|
4
4
|
*/
|
|
5
5
|
export declare enum RecommendationControlId {
|
|
6
|
-
BLOCK_BACKGROUND = "recommendation-block-background-color-control",
|
|
7
6
|
BUTTON_ALIGN = "recommendation-block-button-align-control",
|
|
8
7
|
BUTTON_BORDER = "recommendation-block-button-border-control",
|
|
9
8
|
BUTTON_BORDER_RADIUS = "recommendation-block-button-border-radius-control",
|
|
@@ -20,7 +20,6 @@ export { ButtonControls } from './button';
|
|
|
20
20
|
export { ImageControls } from './image';
|
|
21
21
|
export { CustomAttributeControls } from './customAttribute';
|
|
22
22
|
export { SpacingControl, SPACING_CONTROL_ID } from './spacing';
|
|
23
|
-
export { BlockBackgroundColorControl } from './blockBackground';
|
|
24
23
|
export { CardBackgroundColorControl, CARD_BACKGROUND_COLOR_CONTROL_ID } from './cardBackground';
|
|
25
24
|
export { RecommendationCardCompositionControl, COMPOSITION_CONTROL_BLOCK_ID } from './cardComposition';
|
|
26
25
|
export { SyncInfoMessageControl, SYNC_INFO_MESSAGE_CONTROL_ID } from './syncInfoMessage';
|
|
@@ -115,42 +115,6 @@ export declare function createTextBackgroundColorControl(controlId: string, targ
|
|
|
115
115
|
isVisible(_node: ImmutableHtmlNode): boolean;
|
|
116
116
|
};
|
|
117
117
|
};
|
|
118
|
-
/**
|
|
119
|
-
* Factory for a background-color control that paints a whole extension block (SD-145082).
|
|
120
|
-
*
|
|
121
|
-
* Base is `ButtonBackgroundColorBuiltInControl` because its `GENERAL.BACKGROUND_COLOR` form key
|
|
122
|
-
* round-trips through `getValues()`; the block-text base (`TextBlockBackgroundBuiltInControl`, the
|
|
123
|
-
* built-in this replaces) reports `textBlockBackgroundColor`, which our read path never sees. That
|
|
124
|
-
* borrowed base targets the block's Buy buttons, so `getTargetNodes` here is a GUARD that keeps it
|
|
125
|
-
* off the buttons — not the write path.
|
|
126
|
-
*
|
|
127
|
-
* The write is entirely ours (`getAdditionalModifications`): Stripo's built-in emits a stylesheet
|
|
128
|
-
* rule that inline styles from regeneration outrank (SD-143023), so it would silently no-op on the
|
|
129
|
-
* next edit. We write inline `background-color` + `bgcolor` on the block `<td>` instead — surviving
|
|
130
|
-
* regeneration and reaching Outlook, matching the migrator's convention.
|
|
131
|
-
*/
|
|
132
|
-
export declare function createBlockBackgroundColorControl(controlId: string, blockRootSelector?: string): {
|
|
133
|
-
new (): {
|
|
134
|
-
getId(): string;
|
|
135
|
-
/** The parent control renders its own generic title; restore the block-level wording. */
|
|
136
|
-
getLabels(): {
|
|
137
|
-
title: string;
|
|
138
|
-
};
|
|
139
|
-
/** Guard: redirect the borrowed button parent onto the block `<td>` so it never paints the Buy buttons. */
|
|
140
|
-
getTargetNodes(root: ImmutableHtmlNode): ImmutableHtmlNode[];
|
|
141
|
-
/**
|
|
142
|
-
* Writes the picked background onto the block as an inline style plus a `bgcolor`
|
|
143
|
-
* attribute. This is the whole mechanism, not a mirror: the parent control's own
|
|
144
|
-
* write never reaches the block element (verified at runtime). `bgcolor` is the
|
|
145
|
-
* channel Outlook honours on a `<td>`, and matches what the migrator emits.
|
|
146
|
-
*/
|
|
147
|
-
getAdditionalModifications(root: ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
148
|
-
getParentControlId(): string;
|
|
149
|
-
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
150
|
-
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
151
|
-
isVisible(_node: ImmutableHtmlNode): boolean;
|
|
152
|
-
};
|
|
153
|
-
};
|
|
154
118
|
/**
|
|
155
119
|
* Factory function to create paddings controls for different block elements
|
|
156
120
|
* When targetBlockId and containerSelector are not provided, applies directly to root
|
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
import { productPairs as
|
|
2
|
-
import { DefaultConfigValues as
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { productPairs as N } from "../extensions/Blocks/Items/enums/productEnums.js";
|
|
2
|
+
import { DefaultConfigValues as O } from "../extensions/Blocks/Items/enums/settingsEnums.js";
|
|
3
|
+
import { preserveTextStyles as C } from "../extensions/Blocks/Recommendation/utils/preserveTextStyles.js";
|
|
4
|
+
function V(L) {
|
|
5
|
+
const H = L.replaceAll("{%", "<!--{%").replaceAll("%}", "%}-->"), g = new DOMParser().parseFromString(H, "text/html"), m = N.PAIRS_FOR_EXTENSION;
|
|
5
6
|
Object.entries(m).forEach(([r, f]) => {
|
|
6
7
|
g.querySelectorAll(".ins-product-td").forEach((c) => {
|
|
7
|
-
const A = c.getAttribute("data-number") || "1",
|
|
8
|
-
c.querySelectorAll(`[product-attr="${r}"]`).forEach((
|
|
8
|
+
const A = c.getAttribute("data-number") || "1", y = c.getAttribute("data-type") || "CART_ITEMS";
|
|
9
|
+
c.querySelectorAll(`[product-attr="${r}"]`).forEach((t) => {
|
|
9
10
|
var F, I, w;
|
|
10
|
-
const
|
|
11
|
+
const T = t.getAttribute("data-type") || y, u = t.getAttribute("data-number") || A, d = f[T];
|
|
11
12
|
if (d)
|
|
12
13
|
switch (r) {
|
|
13
14
|
case "imageSrc": {
|
|
14
|
-
let
|
|
15
|
-
if (
|
|
15
|
+
let e = null, i = null;
|
|
16
|
+
if (t.tagName === "IMG" ? (e = t, i = e.closest("a")) : (e = t.querySelector("img"), i = t.querySelector("a") || t.closest("a")), !e)
|
|
16
17
|
break;
|
|
17
18
|
const a = d.DEFAULT, s = d.ATTR;
|
|
18
|
-
if (a &&
|
|
19
|
-
const o =
|
|
19
|
+
if (a && e.src) {
|
|
20
|
+
const o = e.src;
|
|
20
21
|
a.some((h) => {
|
|
21
|
-
const l = h.split("/").pop() || "",
|
|
22
|
-
return o.includes(h) || o.includes(l) ||
|
|
23
|
-
}) && (
|
|
22
|
+
const l = h.split("/").pop() || "", $ = o.split("/").pop() || "";
|
|
23
|
+
return o.includes(h) || o.includes(l) || $ === l;
|
|
24
|
+
}) && (e.src = `{{${s}_${u}}}`);
|
|
24
25
|
}
|
|
25
|
-
const n = (I = (F = m.name) == null ? void 0 : F[
|
|
26
|
-
if (n &&
|
|
27
|
-
const o = (w = m.itemLink) == null ? void 0 : w[
|
|
26
|
+
const n = (I = (F = m.name) == null ? void 0 : F[T]) == null ? void 0 : I.ATTR;
|
|
27
|
+
if (n && e.setAttribute("alt", `{{${n}_${u}}}`), i) {
|
|
28
|
+
const o = (w = m.itemLink) == null ? void 0 : w[T];
|
|
28
29
|
if (o) {
|
|
29
30
|
const E = o.HREF, h = o.DEFAULT_HREF || "#!", l = i.href;
|
|
30
31
|
(l === "#" || l === "" || l.endsWith("#!") || l.endsWith(h) || l === `${window.location.href}${h}` || !l || l === window.location.href) && (i.href = `{{${E}_${u}}}`);
|
|
@@ -33,9 +34,9 @@ function W(M) {
|
|
|
33
34
|
break;
|
|
34
35
|
}
|
|
35
36
|
case "name": {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
const n =
|
|
37
|
+
const e = d, i = e.ATTR, a = e.DEFAULT_HREF || "#!", s = e.HREF;
|
|
38
|
+
t.textContent && (t.innerHTML = C(t, `{{${i}_${u}}}`));
|
|
39
|
+
const n = t.closest("a") || (t.tagName === "A" ? t : null);
|
|
39
40
|
if (n && s) {
|
|
40
41
|
const o = n.href, E = `${window.location.href}${a}`;
|
|
41
42
|
(o === E || o.endsWith(a)) && (n.href = `{{${s}_${u}}}`);
|
|
@@ -44,23 +45,23 @@ function W(M) {
|
|
|
44
45
|
}
|
|
45
46
|
case "price":
|
|
46
47
|
case "originalPrice": {
|
|
47
|
-
const
|
|
48
|
+
const e = d, i = t.getAttribute("data-formated"), a = t.getAttribute("data-single_price"), s = i === "true", n = a === "true", o = t.getAttribute("data-curency") || "before";
|
|
48
49
|
let E;
|
|
49
|
-
n ? E = s ?
|
|
50
|
-
const h =
|
|
50
|
+
n ? E = s ? e.SINGLE_PRICE_FORMATTED : e.SINGLE_PRICE : E = s ? e.PRICE_FORMATTED : e.PRICE;
|
|
51
|
+
const h = e.CURRENCY;
|
|
51
52
|
let l = `{{${E}_${u}}}`;
|
|
52
|
-
const
|
|
53
|
-
let
|
|
54
|
-
|
|
53
|
+
const $ = (t.getAttribute("data-currency_symbol") || "").trim(), q = $ !== "" && $ !== O.productPriceCurrencySymbolControlValue;
|
|
54
|
+
let b = "";
|
|
55
|
+
q ? b = $ : h && (b = `{{${h}_${u}}}`), b && (l = o === "after" ? `${l} ${b}` : `${b} ${l}`), t.innerHTML = C(t, l);
|
|
55
56
|
break;
|
|
56
57
|
}
|
|
57
58
|
case "quantity": {
|
|
58
|
-
const
|
|
59
|
-
|
|
59
|
+
const e = d, i = e.ATTR, a = e.DEFAULT;
|
|
60
|
+
t.textContent && t.textContent.trim() === a && (t.innerHTML = C(t, `{{${i}_${u}}}`));
|
|
60
61
|
break;
|
|
61
62
|
}
|
|
62
63
|
case "button": {
|
|
63
|
-
const
|
|
64
|
+
const e = d, i = e.HREF, a = e.DEFAULT_HREF || "#!", s = t.tagName === "A" ? t : t.querySelector("a");
|
|
64
65
|
if (s) {
|
|
65
66
|
const n = s.href || "", o = `${window.location.href}${a}`;
|
|
66
67
|
(n === "" || n === "#" || n === o || n.endsWith(a) || n.endsWith("#!") || n === window.location.href) && (s.href = `{{${i}_${u}}}`);
|
|
@@ -68,7 +69,7 @@ function W(M) {
|
|
|
68
69
|
break;
|
|
69
70
|
}
|
|
70
71
|
case "itemLink": {
|
|
71
|
-
const
|
|
72
|
+
const e = d, i = e.HREF, a = e.DEFAULT_HREF || "#!", s = t;
|
|
72
73
|
if (s.href) {
|
|
73
74
|
const n = s.href, o = `${window.location.href}${a}`;
|
|
74
75
|
(n === o || n.endsWith(a)) && (s.href = `{{${i}_${u}}}`);
|
|
@@ -77,8 +78,8 @@ function W(M) {
|
|
|
77
78
|
}
|
|
78
79
|
default: {
|
|
79
80
|
if ("ATTR" in d) {
|
|
80
|
-
const
|
|
81
|
-
|
|
81
|
+
const e = d.ATTR;
|
|
82
|
+
t.textContent && (t.innerHTML = C(t, `{{${e}_${u}}}`));
|
|
82
83
|
}
|
|
83
84
|
break;
|
|
84
85
|
}
|
|
@@ -86,11 +87,11 @@ function W(M) {
|
|
|
86
87
|
});
|
|
87
88
|
});
|
|
88
89
|
});
|
|
89
|
-
const
|
|
90
|
-
` : "", D = g.querySelectorAll(".ins-product-td"),
|
|
90
|
+
const k = H.match(/<!DOCTYPE[^>]*>/i), P = k ? `${k[0]}
|
|
91
|
+
` : "", D = g.querySelectorAll(".ins-product-td"), M = [];
|
|
91
92
|
D.forEach((r) => {
|
|
92
93
|
const f = r.getAttribute("data-type") || "CART_ITEMS", p = r.getAttribute("data-number") || "1", c = r.getAttribute("data-nodup"), A = r.outerHTML;
|
|
93
|
-
|
|
94
|
+
M.push({
|
|
94
95
|
element: r,
|
|
95
96
|
outerHtml: A,
|
|
96
97
|
type: f,
|
|
@@ -99,7 +100,7 @@ function W(M) {
|
|
|
99
100
|
});
|
|
100
101
|
});
|
|
101
102
|
let _ = P + g.documentElement.outerHTML;
|
|
102
|
-
|
|
103
|
+
M.reverse().forEach(({ outerHtml: r, type: f, number: p }) => {
|
|
103
104
|
let c = "";
|
|
104
105
|
switch (f) {
|
|
105
106
|
case "CART_ITEMS":
|
|
@@ -113,21 +114,21 @@ function W(M) {
|
|
|
113
114
|
break;
|
|
114
115
|
}
|
|
115
116
|
if (c) {
|
|
116
|
-
const
|
|
117
|
-
_ = _.replace(r,
|
|
117
|
+
const y = parseInt(p) - 1, T = `${`{% if ${c} > ${y} %}`}${r}{% endif %}`;
|
|
118
|
+
_ = _.replace(r, T);
|
|
118
119
|
}
|
|
119
120
|
});
|
|
120
|
-
const
|
|
121
|
-
return
|
|
121
|
+
const x = g.querySelectorAll('[product-attr="originalPrice"][data-type="CART_ITEMS"]'), R = [];
|
|
122
|
+
return x.forEach((r) => {
|
|
122
123
|
const f = r.getAttribute("data-number"), p = r.getAttribute("data-type");
|
|
123
124
|
if (!f || p !== "CART_ITEMS")
|
|
124
125
|
return;
|
|
125
126
|
const c = r.closest(".product-original-price-class");
|
|
126
127
|
if (c) {
|
|
127
128
|
const A = c.outerHTML;
|
|
128
|
-
|
|
129
|
+
R.some((S) => S.tdOuterHtml === A) || R.push({ tdOuterHtml: A, number: f });
|
|
129
130
|
}
|
|
130
|
-
}),
|
|
131
|
+
}), R.reverse().forEach(({ tdOuterHtml: r, number: f }) => {
|
|
131
132
|
const p = `{% if ins_apr_price_${f} != ins_apr_originalprice_${f} %}`;
|
|
132
133
|
if (!_.includes(p) && !r.includes("{% if")) {
|
|
133
134
|
const A = `${p}${r}{% endif %}`;
|
|
@@ -136,5 +137,5 @@ function W(M) {
|
|
|
136
137
|
}), _.replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}").replaceAll("<!--{%", "{%").replaceAll("%}-->", "%}");
|
|
137
138
|
}
|
|
138
139
|
export {
|
|
139
|
-
|
|
140
|
+
V as pairProductVariables
|
|
140
141
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@useinsider/guido",
|
|
3
|
-
"version": "3.12.0-beta.
|
|
3
|
+
"version": "3.12.0-beta.841bb6a",
|
|
4
4
|
"description": "Guido is a Vue + TypeScript wrapper for Email Plugin. Easily embed the email editor in your Vue applications.",
|
|
5
5
|
"main": "./dist/guido.umd.cjs",
|
|
6
6
|
"module": "./dist/library.js",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { createBlockBackgroundColorControl as o } from "../../../controlFactories.js";
|
|
2
|
-
import { RecommendationControlId as r } from "../../constants/controlIds.js";
|
|
3
|
-
import { BLOCK_ROOT_SELECTOR as t } from "../../constants/selectors.js";
|
|
4
|
-
const c = o(
|
|
5
|
-
r.BLOCK_BACKGROUND,
|
|
6
|
-
t
|
|
7
|
-
);
|
|
8
|
-
export {
|
|
9
|
-
c as BlockBackgroundColorControl
|
|
10
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare const BlockBackgroundColorControl: {
|
|
2
|
-
new (): {
|
|
3
|
-
getId(): string;
|
|
4
|
-
getLabels(): {
|
|
5
|
-
title: string;
|
|
6
|
-
};
|
|
7
|
-
getTargetNodes(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode[];
|
|
8
|
-
getAdditionalModifications(root: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): import("@stripoinc/ui-editor-extensions").TemplateModifier<import("@stripoinc/ui-editor-extensions").HtmlNodeModifier, import("@stripoinc/ui-editor-extensions").CssNodeModifier> | undefined;
|
|
9
|
-
getParentControlId(): string;
|
|
10
|
-
api: import("@stripoinc/ui-editor-extensions").ControlApi;
|
|
11
|
-
getModificationDescription(): import("@stripoinc/ui-editor-extensions").ModificationDescription | undefined;
|
|
12
|
-
isVisible(_node: import("@stripoinc/ui-editor-extensions").ImmutableHtmlNode): boolean;
|
|
13
|
-
};
|
|
14
|
-
};
|