@useinsider/guido 2.0.0-beta.739813a → 2.0.0-beta.782343a
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/README.md +2 -0
- package/dist/@types/config/schemas.js +3 -1
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +15 -17
- package/dist/composables/useStripo.js +40 -40
- package/dist/extensions/Blocks/CouponBlock/constants.js +4 -0
- package/dist/extensions/Blocks/CouponBlock/controls/index.js +29 -0
- package/dist/extensions/Blocks/CouponBlock/extension.js +5 -4
- package/dist/extensions/Blocks/CouponBlock/settingsPanel.js +20 -14
- package/dist/extensions/Blocks/CouponBlock/template.js +22 -11
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +13 -4
- 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 +68 -0
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +179 -0
- package/dist/extensions/Blocks/Recommendation/controls/image/index.js +19 -0
- package/dist/extensions/Blocks/Recommendation/{control.js → controls/main/index.js} +101 -67
- 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/omnibusDiscount/textAfter.js +73 -0
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.js +73 -0
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/index.js +48 -0
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.js +73 -0
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.js +73 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/index.js +44 -0
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +183 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +37 -43
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +125 -72
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +20 -20
- package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +91 -69
- package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +54 -17
- package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +66 -62
- package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +25 -0
- package/dist/extensions/Blocks/controlFactories.js +122 -111
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +368 -290
- package/dist/package.json.js +1 -1
- package/dist/services/stripoApi.js +6 -10
- package/dist/src/@types/config/schemas.d.ts +4 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/extensions/Blocks/CouponBlock/constants.d.ts +14 -0
- package/dist/src/extensions/Blocks/CouponBlock/controls/index.d.ts +108 -0
- package/dist/src/extensions/Blocks/CouponBlock/template.d.ts +1 -1
- 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} +19 -11
- 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/cardBackground/index.d.ts +25 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +75 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/image/index.d.ts +35 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +22 -0
- package/dist/src/extensions/Blocks/Recommendation/{control.d.ts → controls/main/index.d.ts} +6 -3
- package/dist/src/extensions/Blocks/Recommendation/controls/name/index.d.ts +97 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/textTrim.d.ts +16 -0
- 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/omnibusDiscount/textAfter.d.ts +15 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.d.ts +15 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/index.d.ts +100 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.d.ts +15 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.d.ts +15 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/index.d.ts +95 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/spacing/index.d.ts +57 -0
- package/dist/src/extensions/Blocks/Recommendation/extension.d.ts +9 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +3 -3
- package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +15 -7
- package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +19 -0
- package/dist/src/extensions/Blocks/controlFactories.d.ts +30 -7
- package/dist/src/stores/config.d.ts +17 -0
- package/dist/static/styles/components/wide-panel.css.js +0 -4
- package/dist/static/styles/customEditorStyle.css.js +13 -0
- package/package.json +3 -3
- package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +0 -103
- package/dist/extensions/Blocks/Recommendation/constants.js +0 -5
- package/dist/extensions/Blocks/Recommendation/controls/button/align.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/border.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/borderRadius.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/color.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/fitToContent.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/fontFamily.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/margins.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/paddings.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/text.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/textSize.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/image/margins.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/image/size.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/name/align.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/name/background.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/name/color.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/name/fontFamily.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/name/paddings.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/name/size.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/name/style.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/align.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/background.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/color.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/paddings.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/size.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/style.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/price/align.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/price/background.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/price/color.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/price/fontFamily.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/price/paddings.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/price/size.js +0 -13
- package/dist/extensions/Blocks/Recommendation/controls/price/style.js +0 -13
- package/dist/src/extensions/Blocks/Recommendation/cardCompositionControl.d.ts +0 -28
- package/dist/src/extensions/Blocks/Recommendation/controls/button/align.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/border.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/borderRadius.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/color.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/fitToContent.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/fontFamily.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/margins.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/paddings.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/text.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/textSize.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/image/margins.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/image/size.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/name/align.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/name/background.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/name/color.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/name/fontFamily.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/name/paddings.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/name/size.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/name/style.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/align.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/background.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/color.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/paddings.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/size.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/style.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/price/align.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/price/background.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/price/color.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/price/fontFamily.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/price/paddings.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/price/size.d.ts +0 -5
- package/dist/src/extensions/Blocks/Recommendation/controls/price/style.d.ts +0 -5
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { ModificationDescription as n } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { CommonControl as m } from "../../../common-control.js";
|
|
3
|
+
import { ATTR_PRODUCT_IMAGE as b, ATTR_PRODUCT_NAME as y, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_OLD_PRICE as h, ATTR_PRODUCT_OMNIBUS_PRICE as C, ATTR_PRODUCT_OMNIBUS_DISCOUNT as f, ATTR_PRODUCT_BUTTON as A } from "../../constants/selectors.js";
|
|
4
|
+
const O = "ui-elements-recommendation-card-composition", l = ".recommendation-attribute-row", R = "tr.recommendation-product-row", c = "data-card-composition", a = "data-attribute-type", d = "data-visibility", s = [
|
|
5
|
+
{ key: b, label: "Product Image", visible: !0 },
|
|
6
|
+
{ key: y, label: "Product Name", visible: !0 },
|
|
7
|
+
{ key: T, label: "Product Price", visible: !0 },
|
|
8
|
+
{ key: h, label: "Product Original Price", visible: !0 },
|
|
9
|
+
{ key: C, label: "Omnibus Price", visible: !1 },
|
|
10
|
+
{ key: f, label: "Omnibus Discount", visible: !1 },
|
|
11
|
+
{ key: A, label: "Product Button", visible: !0 }
|
|
12
|
+
];
|
|
13
|
+
class V extends m {
|
|
14
|
+
getId() {
|
|
15
|
+
return O;
|
|
16
|
+
}
|
|
17
|
+
getTemplate() {
|
|
18
|
+
const t = s.map((i) => ({
|
|
19
|
+
key: i.key,
|
|
20
|
+
label: i.label,
|
|
21
|
+
content: this._createItemContent(i.label, i.key)
|
|
22
|
+
}));
|
|
23
|
+
return `
|
|
24
|
+
<div class="container">
|
|
25
|
+
${this._GuLabel({ text: "Card Element Order & Visibility" })}
|
|
26
|
+
${this._GuOrderable("cardComposition", t)}
|
|
27
|
+
</div>
|
|
28
|
+
`;
|
|
29
|
+
}
|
|
30
|
+
onRender() {
|
|
31
|
+
this._initializeComposition(), this._registerValueChangeListeners();
|
|
32
|
+
}
|
|
33
|
+
onTemplateNodeUpdated(t) {
|
|
34
|
+
super.onTemplateNodeUpdated(t), this._initializeComposition();
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Creates the HTML content for an orderable item with label and toggle
|
|
38
|
+
*/
|
|
39
|
+
_createItemContent(t, i) {
|
|
40
|
+
return `
|
|
41
|
+
<div style="display: flex; align-items: center; justify-content: space-between;
|
|
42
|
+
padding: 8px; gap: 8px;">
|
|
43
|
+
<span style="flex: 1;">${t}</span>
|
|
44
|
+
${this._GuToggle(`visibility_${i}`)}
|
|
45
|
+
</div>
|
|
46
|
+
`;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Registers event listeners for composition and visibility changes
|
|
50
|
+
*/
|
|
51
|
+
_registerValueChangeListeners() {
|
|
52
|
+
this.api.onValueChanged("cardComposition", (t) => {
|
|
53
|
+
this._applyCompositionToBlock(t);
|
|
54
|
+
}), s.forEach((t) => {
|
|
55
|
+
this.api.onValueChanged(`visibility_${t.key}`, (i) => {
|
|
56
|
+
this._applyVisibilityToBlock(t.key, i);
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Initializes composition order and visibility state from the current node
|
|
62
|
+
*/
|
|
63
|
+
_initializeComposition() {
|
|
64
|
+
const t = this._readCompositionFromNode(), i = this._readVisibilityFromRows(), e = {
|
|
65
|
+
cardComposition: t,
|
|
66
|
+
...this._buildVisibilityValues(i)
|
|
67
|
+
};
|
|
68
|
+
this.api.updateValues(e);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Reads composition order from node's data-card-composition attribute
|
|
72
|
+
* Falls back to default order if attribute is not present
|
|
73
|
+
*/
|
|
74
|
+
_readCompositionFromNode() {
|
|
75
|
+
if (!this.currentNode || !("getAttribute" in this.currentNode))
|
|
76
|
+
return s.map((i) => i.key);
|
|
77
|
+
const t = this.currentNode.getAttribute(c);
|
|
78
|
+
return t ? t.split(",").filter(Boolean) : s.map((i) => i.key);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Builds visibility values object from the visibility map
|
|
82
|
+
*/
|
|
83
|
+
_buildVisibilityValues(t) {
|
|
84
|
+
return s.reduce((i, e) => (i[`visibility_${e.key}`] = t[e.key] ?? !0, i), {});
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Read visibility state from individual row elements' data-visibility attributes
|
|
88
|
+
* This ensures toggles reflect the actual DOM state
|
|
89
|
+
*/
|
|
90
|
+
_readVisibilityFromRows() {
|
|
91
|
+
if (!this.currentNode)
|
|
92
|
+
return this._getDefaultVisibilities();
|
|
93
|
+
const t = Array.from(this.currentNode.querySelectorAll(l)), i = this._extractVisibilityFromRows(t);
|
|
94
|
+
return this._mergeWithDefaults(i);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Returns default visibility values for all items
|
|
98
|
+
*/
|
|
99
|
+
_getDefaultVisibilities() {
|
|
100
|
+
return s.reduce((t, i) => (t[i.key] = i.visible, t), {});
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Extracts visibility values from DOM nodes
|
|
104
|
+
*/
|
|
105
|
+
_extractVisibilityFromRows(t) {
|
|
106
|
+
const i = {};
|
|
107
|
+
return t.forEach((e) => {
|
|
108
|
+
if (!("getAttribute" in e))
|
|
109
|
+
return;
|
|
110
|
+
const o = e.getAttribute(a), r = e.getAttribute(d);
|
|
111
|
+
o && r !== null && (i[o] = this._parseVisibilityValue(r));
|
|
112
|
+
}), i;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Parses visibility value from string to boolean
|
|
116
|
+
* Accepts "1", "true" as true, everything else as false
|
|
117
|
+
*/
|
|
118
|
+
_parseVisibilityValue(t) {
|
|
119
|
+
return t === "1" || t === "true";
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Merges extracted visibilities with default values for missing keys
|
|
123
|
+
*/
|
|
124
|
+
_mergeWithDefaults(t) {
|
|
125
|
+
return s.forEach((i) => {
|
|
126
|
+
i.key in t || (t[i.key] = i.visible);
|
|
127
|
+
}), t;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Apply the reordered composition to the block's HTML structure
|
|
131
|
+
* Updates the data-card-composition attribute and reorders product attributes
|
|
132
|
+
*/
|
|
133
|
+
_applyCompositionToBlock(t) {
|
|
134
|
+
this.currentNode && (this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute(c, t.join(",")).apply(new n("Update card composition")), this._reorderProductAttributes(t));
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Reorders attribute rows within each product row based on composition order
|
|
138
|
+
*/
|
|
139
|
+
_reorderProductAttributes(t) {
|
|
140
|
+
if (!this.currentNode)
|
|
141
|
+
return;
|
|
142
|
+
const i = this.currentNode.querySelectorAll(R);
|
|
143
|
+
if (!(i != null && i.length))
|
|
144
|
+
return;
|
|
145
|
+
const e = this.api.getDocumentModifier();
|
|
146
|
+
i.forEach((o) => {
|
|
147
|
+
const r = this._buildCompositionHtml(o, t);
|
|
148
|
+
e.modifyHtml(o).setInnerHtml(r);
|
|
149
|
+
}), e.apply(new n("Reorder product attributes"));
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Builds HTML string with attributes ordered according to composition
|
|
153
|
+
*/
|
|
154
|
+
_buildCompositionHtml(t, i) {
|
|
155
|
+
return i.reduce((e, o) => {
|
|
156
|
+
const r = t.querySelector(`${l}[${a}="${o}"]`);
|
|
157
|
+
return r && "getOuterHTML" in r ? e + r.getOuterHTML() : e;
|
|
158
|
+
}, "");
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Apply visibility changes to the block's HTML structure
|
|
162
|
+
* Updates display style and data-visibility attribute for all matching rows
|
|
163
|
+
*/
|
|
164
|
+
_applyVisibilityToBlock(t, i) {
|
|
165
|
+
if (!this.currentNode)
|
|
166
|
+
return;
|
|
167
|
+
const e = this.currentNode.querySelectorAll(`${l}[${a}="${t}"]`);
|
|
168
|
+
if (!(e != null && e.length))
|
|
169
|
+
return;
|
|
170
|
+
const o = i ? "table-row" : "none", r = i ? "1" : "0", p = `Set ${t} visibility to ${i ? "visible" : "hidden"}`, u = this.api.getDocumentModifier();
|
|
171
|
+
e.forEach((_) => {
|
|
172
|
+
u.modifyHtml(_).setStyle("display", o).setAttribute(d, r);
|
|
173
|
+
}), u.apply(new n(p));
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
export {
|
|
177
|
+
O as COMPOSITION_CONTROL_BLOCK_ID,
|
|
178
|
+
V as RecommendationCardCompositionControl
|
|
179
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createImageMarginsControl as m, createImageSizeControl as n } from "../../../controlFactories.js";
|
|
2
|
+
import { RecommendationBlockId as o } from "../../constants/blockIds.js";
|
|
3
|
+
import { RecommendationControlId as r } from "../../constants/controlIds.js";
|
|
4
|
+
import { CONTAINER_SELECTOR as t } from "../../constants/selectors.js";
|
|
5
|
+
const e = n(
|
|
6
|
+
r.IMAGE_SIZE,
|
|
7
|
+
o.IMAGE,
|
|
8
|
+
t
|
|
9
|
+
), i = m(
|
|
10
|
+
r.IMAGE_MARGINS,
|
|
11
|
+
o.IMAGE,
|
|
12
|
+
t
|
|
13
|
+
), C = {
|
|
14
|
+
size: e,
|
|
15
|
+
margins: i
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
C as ImageControls
|
|
19
|
+
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { currencyDecimalCounts as
|
|
5
|
-
import { UEAttr as
|
|
6
|
-
import { CommonControl as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
1
|
+
var p = Object.defineProperty;
|
|
2
|
+
var S = (a, s, e) => s in a ? p(a, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[s] = e;
|
|
3
|
+
var u = (a, s, e) => S(a, typeof s != "symbol" ? s + "" : s, e);
|
|
4
|
+
import { currencyDecimalCounts as _, currencyOperators as C, currencyLocationMaps as R } from "../../../../../enums/extensions/recommendationBlock.js";
|
|
5
|
+
import { UEAttr as O, ModificationDescription as g } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
6
|
+
import { CommonControl as N } from "../../../common-control.js";
|
|
7
|
+
import { CONTAINER_SELECTOR as E } from "../../constants/selectors.js";
|
|
8
|
+
import { useRecommendationExtensionStore as U } from "../../store/recommendation.js";
|
|
9
|
+
import { prepareProductRows as f } from "../../templates/blockTemplate.js";
|
|
10
|
+
import { DEFAULT_CARD_COMPOSITION as d, getDefaultProducts as L } from "../../templates/templateUtils.js";
|
|
11
|
+
import { useDebounceFn as T } from "../../../../../node_modules/@vueuse/shared/index.js";
|
|
12
|
+
const A = "ui-elements-recommendation-block", t = {
|
|
12
13
|
ALGORITHM: "strategy",
|
|
13
14
|
PRODUCT_IDS: "productIds",
|
|
14
15
|
LOCALE: "language",
|
|
@@ -21,24 +22,23 @@ const L = "ui-elements-recommendation-block", t = {
|
|
|
21
22
|
FILTERS: "filterStatus",
|
|
22
23
|
PRODUCT_COUNT: "size",
|
|
23
24
|
PRODUCT_IN_ROW: "cardsInRow",
|
|
24
|
-
SHUFFLE_PRODUCTS: "shuffleProducts"
|
|
25
|
-
RESPONSIVE: "unresponsive"
|
|
25
|
+
SHUFFLE_PRODUCTS: "shuffleProducts"
|
|
26
26
|
};
|
|
27
|
-
class
|
|
27
|
+
class w extends N {
|
|
28
28
|
constructor() {
|
|
29
29
|
super(...arguments);
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
u(this, "store", U());
|
|
31
|
+
u(this, "storeUnsubscription", () => {
|
|
32
32
|
});
|
|
33
|
-
|
|
33
|
+
u(this, "addFilterListener", () => {
|
|
34
34
|
});
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
u(this, "addFilterButton", null);
|
|
36
|
+
u(this, "_debouncedRegenerateProductRows", T(() => {
|
|
37
37
|
this._regenerateProductRows();
|
|
38
38
|
}, 500));
|
|
39
39
|
}
|
|
40
40
|
getId() {
|
|
41
|
-
return
|
|
41
|
+
return A;
|
|
42
42
|
}
|
|
43
43
|
getTemplate() {
|
|
44
44
|
return `
|
|
@@ -49,17 +49,21 @@ class b extends g {
|
|
|
49
49
|
${this._getFilterStatus()}
|
|
50
50
|
${this._getProductLayout()}
|
|
51
51
|
${this._getShuffleProducts()}
|
|
52
|
-
${this._getResponsive()}
|
|
53
52
|
</div>
|
|
54
53
|
`;
|
|
55
54
|
}
|
|
56
55
|
async onRender() {
|
|
57
|
-
await Promise.
|
|
56
|
+
(await Promise.allSettled([
|
|
58
57
|
this.store.fetchRecommendationFilters(),
|
|
59
58
|
this.store.fetchRecommendationCreateData(),
|
|
60
59
|
this.store.fetchRecommendationProducts()
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
])).forEach((o, i) => {
|
|
61
|
+
o.status === "rejected" && console.warn(`Recommendation block: ${[
|
|
62
|
+
"fetchRecommendationFilters",
|
|
63
|
+
"fetchRecommendationCreateData",
|
|
64
|
+
"fetchRecommendationProducts"
|
|
65
|
+
][i]} failed`, o.reason);
|
|
66
|
+
}), this._listenStateUpdates(), this._initializeSelectItems(), this._setFormValues(), this._listenToFormUpdates();
|
|
63
67
|
}
|
|
64
68
|
onDestroy() {
|
|
65
69
|
var e;
|
|
@@ -79,27 +83,25 @@ class b extends g {
|
|
|
79
83
|
[t.CURRENCY_DECIMAL_COUNT]: e.currencySettings.decimalCount,
|
|
80
84
|
[t.PRODUCT_COUNT]: e.size,
|
|
81
85
|
[t.PRODUCT_IN_ROW]: e.cardsInRow,
|
|
82
|
-
[t.SHUFFLE_PRODUCTS]: e.shuffleProducts
|
|
83
|
-
[t.RESPONSIVE]: !e.unresponsive
|
|
86
|
+
[t.SHUFFLE_PRODUCTS]: e.shuffleProducts
|
|
84
87
|
});
|
|
85
88
|
}
|
|
86
89
|
_initializeSelectItems() {
|
|
87
|
-
const { store: e } = this, o = e.getActivePredictiveAlgorithms, i = e.getLanguages,
|
|
90
|
+
const { store: e } = this, o = e.getActivePredictiveAlgorithms, i = e.getLanguages, n = {
|
|
88
91
|
[t.ALGORITHM]: o,
|
|
89
92
|
[t.LOCALE]: i,
|
|
90
93
|
[t.CURRENCY]: e.currencyList,
|
|
91
|
-
[t.CURRENCY_LOCATION]:
|
|
94
|
+
[t.CURRENCY_LOCATION]: R,
|
|
92
95
|
[t.CURRENCY_SYMBOL]: e.getCurrencySymbolList,
|
|
93
|
-
[t.CURRENCY_THOUSAND_SEPARATOR]:
|
|
94
|
-
[t.CURRENCY_DECIMAL_SEPARATOR]:
|
|
95
|
-
[t.CURRENCY_DECIMAL_COUNT]:
|
|
96
|
+
[t.CURRENCY_THOUSAND_SEPARATOR]: C,
|
|
97
|
+
[t.CURRENCY_DECIMAL_SEPARATOR]: C,
|
|
98
|
+
[t.CURRENCY_DECIMAL_COUNT]: _,
|
|
96
99
|
[t.PRODUCT_COUNT]: Number(e.recommendationConfigs.size),
|
|
97
100
|
[t.PRODUCT_IN_ROW]: e.recommendationConfigs.cardsInRow,
|
|
98
|
-
[t.SHUFFLE_PRODUCTS]: e.recommendationConfigs.shuffleProducts
|
|
99
|
-
[t.RESPONSIVE]: !e.recommendationConfigs.unresponsive
|
|
101
|
+
[t.SHUFFLE_PRODUCTS]: e.recommendationConfigs.shuffleProducts
|
|
100
102
|
};
|
|
101
|
-
Object.entries(
|
|
102
|
-
this.api.setUIEAttribute(
|
|
103
|
+
Object.entries(n).forEach(([r, l]) => {
|
|
104
|
+
this.api.setUIEAttribute(r, O.SELECTPICKER.items, l);
|
|
103
105
|
});
|
|
104
106
|
}
|
|
105
107
|
_getAlgorithms() {
|
|
@@ -145,7 +147,7 @@ class b extends g {
|
|
|
145
147
|
this._GuSelect({
|
|
146
148
|
name: t.CURRENCY_LOCATION,
|
|
147
149
|
placeholder: "Select Currency Location",
|
|
148
|
-
options:
|
|
150
|
+
options: R
|
|
149
151
|
}),
|
|
150
152
|
this._GuLabel({ text: "Currency Symbol" }),
|
|
151
153
|
this._GuSelect({
|
|
@@ -157,19 +159,19 @@ class b extends g {
|
|
|
157
159
|
this._GuSelect({
|
|
158
160
|
name: t.CURRENCY_THOUSAND_SEPARATOR,
|
|
159
161
|
placeholder: "Select Thousand Separator",
|
|
160
|
-
options:
|
|
162
|
+
options: C
|
|
161
163
|
}),
|
|
162
164
|
this._GuLabel({ text: "Decimal Separator" }),
|
|
163
165
|
this._GuSelect({
|
|
164
166
|
name: t.CURRENCY_DECIMAL_SEPARATOR,
|
|
165
167
|
placeholder: "Select Decimal Separator",
|
|
166
|
-
options:
|
|
168
|
+
options: C
|
|
167
169
|
}),
|
|
168
170
|
this._GuLabel({ text: "Decimal Count" }),
|
|
169
171
|
this._GuSelect({
|
|
170
172
|
name: t.CURRENCY_DECIMAL_COUNT,
|
|
171
173
|
placeholder: "Select Decimal Count",
|
|
172
|
-
options:
|
|
174
|
+
options: _
|
|
173
175
|
})
|
|
174
176
|
])}
|
|
175
177
|
`;
|
|
@@ -204,20 +206,6 @@ class b extends g {
|
|
|
204
206
|
])}
|
|
205
207
|
`;
|
|
206
208
|
}
|
|
207
|
-
_getResponsive() {
|
|
208
|
-
return `
|
|
209
|
-
${this._GuTwoColumns([
|
|
210
|
-
this._GuLabel({ text: "Responsive Block" }),
|
|
211
|
-
this._GuToggle(t.RESPONSIVE)
|
|
212
|
-
])}
|
|
213
|
-
`;
|
|
214
|
-
}
|
|
215
|
-
_onFilterChange(e) {
|
|
216
|
-
this.currentNode && this.store.$patch({
|
|
217
|
-
filterStatus: e,
|
|
218
|
-
filterSelectionDrawerStatus: e
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
209
|
_onFilterSelectClick() {
|
|
222
210
|
this.store.$patch({
|
|
223
211
|
filterSelectionDrawerStatus: !0
|
|
@@ -235,23 +223,54 @@ class b extends g {
|
|
|
235
223
|
*/
|
|
236
224
|
_getCardComposition() {
|
|
237
225
|
if (!this.currentNode)
|
|
238
|
-
return
|
|
226
|
+
return d;
|
|
239
227
|
const e = this.currentNode.querySelector(".ins-recommendation-v3-block-v2");
|
|
240
228
|
if (!e || !("getAttribute" in e))
|
|
241
|
-
return
|
|
229
|
+
return d;
|
|
242
230
|
const o = e.getAttribute("data-card-composition");
|
|
243
|
-
return o ? o.split(",").filter(Boolean) :
|
|
231
|
+
return o ? o.split(",").filter(Boolean) : d;
|
|
244
232
|
}
|
|
245
233
|
_regenerateProductRows() {
|
|
246
234
|
if (!this.currentNode || !("querySelector" in this.currentNode))
|
|
247
235
|
return;
|
|
248
|
-
const e = this.currentNode.querySelector(
|
|
249
|
-
if (!e)
|
|
250
|
-
console.error("Could not find container table for product rows");
|
|
236
|
+
const e = this.currentNode.querySelector(E);
|
|
237
|
+
if (!e)
|
|
251
238
|
return;
|
|
239
|
+
const o = this.store.recommendationProducts.length > 0 ? this.store.recommendationProducts : L(), { cardsInRow: i } = this.store.recommendationConfigs, n = this._getCardComposition(), r = f(o, i, n);
|
|
240
|
+
this.api.getDocumentModifier().modifyHtml(e).setInnerHtml(r).apply(new g("Updated product")), this._reapplySpacing();
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Reapply spacing values after product regeneration
|
|
244
|
+
* This ensures spacing persists when products are regenerated
|
|
245
|
+
*/
|
|
246
|
+
_reapplySpacing() {
|
|
247
|
+
if (!this.currentNode)
|
|
248
|
+
return;
|
|
249
|
+
const e = this.currentNode.querySelector(".ins-recommendation-v3-block-v2");
|
|
250
|
+
if (!e || !("getAttribute" in e))
|
|
251
|
+
return;
|
|
252
|
+
const o = e.getAttribute("data-column-spacing"), i = e.getAttribute("data-row-spacing"), n = this.api.getDocumentModifier();
|
|
253
|
+
if (o) {
|
|
254
|
+
const r = parseInt(o);
|
|
255
|
+
if (!Number.isNaN(r)) {
|
|
256
|
+
const h = `0 ${Math.floor(r / 2)}px`;
|
|
257
|
+
Array.from(
|
|
258
|
+
this.currentNode.querySelectorAll(".product-card-wrapper")
|
|
259
|
+
).forEach((c) => {
|
|
260
|
+
"parentNode" in c && c.parentNode && typeof c.parentNode == "object" && "tagName" in c.parentNode && c.parentNode.tagName === "TD" && n.modifyHtml(c.parentNode).setStyle("padding", h);
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
if (i) {
|
|
265
|
+
const r = parseInt(i);
|
|
266
|
+
if (!Number.isNaN(r)) {
|
|
267
|
+
const l = `${r}px`;
|
|
268
|
+
Array.from(this.currentNode.querySelectorAll(".spacer")).forEach((m) => {
|
|
269
|
+
n.modifyHtml(m).setStyle("height", l);
|
|
270
|
+
});
|
|
271
|
+
}
|
|
252
272
|
}
|
|
253
|
-
|
|
254
|
-
this.api.getDocumentModifier().modifyHtml(e).setInnerHtml(u).apply(new S("Updated product"));
|
|
273
|
+
(o || i) && n.apply(new g("Reapply spacing after regeneration"));
|
|
255
274
|
}
|
|
256
275
|
_onCurrencyConfigChange(e, o) {
|
|
257
276
|
this.currentNode && this.store.$patch({
|
|
@@ -280,16 +299,31 @@ class b extends g {
|
|
|
280
299
|
_listenToFormUpdates() {
|
|
281
300
|
var o;
|
|
282
301
|
this.api.onValueChanged(t.ALGORITHM, (i) => {
|
|
283
|
-
|
|
284
|
-
|
|
302
|
+
const n = i;
|
|
303
|
+
this._onDataChange(t.ALGORITHM, n), this._setProductIdsVisibility();
|
|
304
|
+
}), this.api.onValueChanged(t.PRODUCT_IDS, (i) => {
|
|
305
|
+
this._onDataChange(t.PRODUCT_IDS, i.split(",") || []);
|
|
306
|
+
}), this.api.onValueChanged(t.LOCALE, (i) => {
|
|
307
|
+
this._onDataChange(t.LOCALE, i);
|
|
308
|
+
}), this.api.onValueChanged(t.CURRENCY, (i) => {
|
|
309
|
+
this._onCurrencyChange(i);
|
|
310
|
+
}), [
|
|
285
311
|
t.CURRENCY_LOCATION,
|
|
286
312
|
t.CURRENCY_SYMBOL,
|
|
287
313
|
t.CURRENCY_THOUSAND_SEPARATOR,
|
|
288
314
|
t.CURRENCY_DECIMAL_SEPARATOR,
|
|
289
315
|
t.CURRENCY_DECIMAL_COUNT
|
|
290
316
|
].forEach((i) => {
|
|
291
|
-
this.api.onValueChanged(i, (
|
|
292
|
-
|
|
317
|
+
this.api.onValueChanged(i, (n) => {
|
|
318
|
+
this._onCurrencyConfigChange(i, n);
|
|
319
|
+
});
|
|
320
|
+
}), this.api.onValueChanged(t.PRODUCT_COUNT, (i) => {
|
|
321
|
+
this._onDataChange(t.PRODUCT_COUNT, i.toString());
|
|
322
|
+
}), this.api.onValueChanged(t.PRODUCT_IN_ROW, (i) => {
|
|
323
|
+
this._onDataChange(t.PRODUCT_IN_ROW, i);
|
|
324
|
+
}), this.api.onValueChanged(t.SHUFFLE_PRODUCTS, (i) => {
|
|
325
|
+
this._onDataChange(t.SHUFFLE_PRODUCTS, i);
|
|
326
|
+
}), this.addFilterListener = this._onFilterSelectClick.bind(this), this.addFilterButton = this.getContainer().querySelector("#guido__btn-add-filter"), (o = this.addFilterButton) == null || o.addEventListener("click", this.addFilterListener);
|
|
293
327
|
}
|
|
294
328
|
_listenStateUpdates() {
|
|
295
329
|
this.storeUnsubscription = this.store.$subscribe((e) => {
|
|
@@ -301,6 +335,6 @@ class b extends g {
|
|
|
301
335
|
}
|
|
302
336
|
}
|
|
303
337
|
export {
|
|
304
|
-
|
|
305
|
-
|
|
338
|
+
A as CONTROL_BLOCK_ID,
|
|
339
|
+
w as RecommendationBlockControl
|
|
306
340
|
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { createPaddingsControl as n, createTextBackgroundColorControl as e, createTextFontFamilyControl as l, createTextStyleControl as C, createTextSizeControl as c, createTextColorControl as N, createTextAlignControl as a } from "../../../controlFactories.js";
|
|
2
|
+
import { RecommendationBlockId as o } from "../../constants/blockIds.js";
|
|
3
|
+
import { RecommendationControlId as t } from "../../constants/controlIds.js";
|
|
4
|
+
import { CONTAINER_SELECTOR as r } from "../../constants/selectors.js";
|
|
5
|
+
import { NameTextTrimControl as i } from "./textTrim.js";
|
|
6
|
+
const m = a(
|
|
7
|
+
t.NAME_ALIGN,
|
|
8
|
+
o.NAME,
|
|
9
|
+
r
|
|
10
|
+
), A = N(
|
|
11
|
+
t.NAME_COLOR,
|
|
12
|
+
o.NAME,
|
|
13
|
+
r
|
|
14
|
+
), E = c(
|
|
15
|
+
t.NAME_SIZE,
|
|
16
|
+
o.NAME,
|
|
17
|
+
r
|
|
18
|
+
), M = C(
|
|
19
|
+
t.NAME_STYLE,
|
|
20
|
+
o.NAME,
|
|
21
|
+
r
|
|
22
|
+
), s = l(
|
|
23
|
+
t.NAME_FONT_FAMILY,
|
|
24
|
+
o.NAME,
|
|
25
|
+
r
|
|
26
|
+
), d = e(
|
|
27
|
+
t.NAME_BACKGROUND,
|
|
28
|
+
o.NAME,
|
|
29
|
+
r
|
|
30
|
+
), T = n(
|
|
31
|
+
t.NAME_PADDINGS,
|
|
32
|
+
o.NAME,
|
|
33
|
+
r
|
|
34
|
+
), F = {
|
|
35
|
+
align: m,
|
|
36
|
+
color: A,
|
|
37
|
+
size: E,
|
|
38
|
+
style: M,
|
|
39
|
+
fontFamily: s,
|
|
40
|
+
background: d,
|
|
41
|
+
paddings: T,
|
|
42
|
+
textTrim: i
|
|
43
|
+
};
|
|
44
|
+
export {
|
|
45
|
+
F as NameControls
|
|
46
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { ModificationDescription as l } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { CommonControl as c } from "../../../common-control.js";
|
|
3
|
+
import { RecommendationBlockId as a } from "../../constants/blockIds.js";
|
|
4
|
+
import { RecommendationControlId as d } from "../../constants/controlIds.js";
|
|
5
|
+
import { CONTAINER_SELECTOR as m } from "../../constants/selectors.js";
|
|
6
|
+
const s = {
|
|
7
|
+
TEXT_TRIM_ENABLED: "textTrimEnabled"
|
|
8
|
+
}, r = "text-trim-enabled";
|
|
9
|
+
class p extends c {
|
|
10
|
+
getId() {
|
|
11
|
+
return d.NAME_TEXT_TRIM;
|
|
12
|
+
}
|
|
13
|
+
getTemplate() {
|
|
14
|
+
return `
|
|
15
|
+
<div class="name-text-trim-control-container">
|
|
16
|
+
${this._GuTwoColumns([
|
|
17
|
+
this._GuLabel({ text: "Trim Long Text" }),
|
|
18
|
+
this._GuToggle(s.TEXT_TRIM_ENABLED)
|
|
19
|
+
])}
|
|
20
|
+
</div>
|
|
21
|
+
`;
|
|
22
|
+
}
|
|
23
|
+
onRender() {
|
|
24
|
+
this._setFormValues(), this._listenToFormUpdates();
|
|
25
|
+
}
|
|
26
|
+
onTemplateNodeUpdated(t) {
|
|
27
|
+
super.onTemplateNodeUpdated(t), this._setFormValues();
|
|
28
|
+
}
|
|
29
|
+
_setFormValues() {
|
|
30
|
+
const t = this._getCurrentTrimState();
|
|
31
|
+
this.api.updateValues({
|
|
32
|
+
[s.TEXT_TRIM_ENABLED]: t
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
_getCurrentTrimState() {
|
|
36
|
+
if (!this.currentNode || !("hasClass" in this.currentNode))
|
|
37
|
+
return !1;
|
|
38
|
+
if (this.currentNode.hasClass(r))
|
|
39
|
+
return !0;
|
|
40
|
+
const t = this.currentNode.closest(m);
|
|
41
|
+
if (!t)
|
|
42
|
+
return !1;
|
|
43
|
+
const e = t.querySelector(
|
|
44
|
+
`[esd-extension-block-id="${a.NAME}"]`
|
|
45
|
+
);
|
|
46
|
+
return e && "hasClass" in e ? e.hasClass(r) : !1;
|
|
47
|
+
}
|
|
48
|
+
_onTextTrimChange(t) {
|
|
49
|
+
if (!this.currentNode || !("closest" in this.currentNode))
|
|
50
|
+
return;
|
|
51
|
+
const e = this.currentNode.closest(m);
|
|
52
|
+
if (!e || !("querySelectorAll" in e))
|
|
53
|
+
return;
|
|
54
|
+
const i = Array.from(
|
|
55
|
+
e.querySelectorAll(`[esd-extension-block-id="${a.NAME}"]`)
|
|
56
|
+
);
|
|
57
|
+
if (!i.length)
|
|
58
|
+
return;
|
|
59
|
+
const o = this.api.getDocumentModifier();
|
|
60
|
+
i.forEach((n) => {
|
|
61
|
+
t ? o.modifyHtml(n).setClass(r) : o.modifyHtml(n).removeClass(r);
|
|
62
|
+
}), o.apply(
|
|
63
|
+
new l(
|
|
64
|
+
t ? "Enable product name text trimming" : "Disable product name text trimming"
|
|
65
|
+
)
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
_listenToFormUpdates() {
|
|
69
|
+
this.api.onValueChanged(s.TEXT_TRIM_ENABLED, (t) => {
|
|
70
|
+
this._onTextTrimChange(t);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
export {
|
|
75
|
+
p as NameTextTrimControl
|
|
76
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { createPaddingsControl as r, createTextBackgroundColorControl as C, createTextFontFamilyControl as e, createTextStyleControl as l, createTextSizeControl as c, createTextColorControl as _, createTextAlignControl as I } from "../../../controlFactories.js";
|
|
2
|
+
import { RecommendationBlockId as o } from "../../constants/blockIds.js";
|
|
3
|
+
import { RecommendationControlId as t } from "../../constants/controlIds.js";
|
|
4
|
+
import { CONTAINER_SELECTOR as n } from "../../constants/selectors.js";
|
|
5
|
+
const O = I(
|
|
6
|
+
t.OLD_PRICE_ALIGN,
|
|
7
|
+
o.OLD_PRICE,
|
|
8
|
+
n
|
|
9
|
+
), R = _(
|
|
10
|
+
t.OLD_PRICE_COLOR,
|
|
11
|
+
o.OLD_PRICE,
|
|
12
|
+
n
|
|
13
|
+
), a = c(
|
|
14
|
+
t.OLD_PRICE_SIZE,
|
|
15
|
+
o.OLD_PRICE,
|
|
16
|
+
n
|
|
17
|
+
), i = l(
|
|
18
|
+
t.OLD_PRICE_STYLE,
|
|
19
|
+
o.OLD_PRICE,
|
|
20
|
+
n
|
|
21
|
+
), E = e(
|
|
22
|
+
t.OLD_PRICE_FONT_FAMILY,
|
|
23
|
+
o.OLD_PRICE,
|
|
24
|
+
n
|
|
25
|
+
), L = C(
|
|
26
|
+
t.OLD_PRICE_BACKGROUND,
|
|
27
|
+
o.OLD_PRICE,
|
|
28
|
+
n
|
|
29
|
+
), P = r(
|
|
30
|
+
t.OLD_PRICE_PADDINGS,
|
|
31
|
+
o.OLD_PRICE,
|
|
32
|
+
n
|
|
33
|
+
), T = {
|
|
34
|
+
align: O,
|
|
35
|
+
color: R,
|
|
36
|
+
size: a,
|
|
37
|
+
style: i,
|
|
38
|
+
fontFamily: E,
|
|
39
|
+
background: L,
|
|
40
|
+
paddings: P
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
T as OldPriceControls
|
|
44
|
+
};
|