@useinsider/guido 2.2.0-beta.8abc7b6 → 2.2.0-beta.953ff70
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/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +14 -15
- package/dist/composables/useHtmlValidator.js +104 -114
- package/dist/composables/useRecommendation.js +21 -54
- package/dist/config/compiler/recommendationCompilerRules.js +39 -45
- package/dist/config/migrator/itemsBlockMigrator.js +97 -101
- package/dist/config/migrator/recommendationMigrator.js +2 -2
- package/dist/enums/extensions/recommendationBlock.js +1 -1
- package/dist/enums/recommendation.js +15 -16
- package/dist/extensions/Blocks/Recommendation/block.js +9 -133
- package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +187 -0
- package/dist/extensions/Blocks/Recommendation/constants.js +13 -0
- package/dist/extensions/Blocks/Recommendation/control.js +336 -0
- package/dist/extensions/Blocks/Recommendation/controls/cardBackgroundColorControl.js +68 -0
- package/dist/extensions/Blocks/Recommendation/controls/index.js +245 -0
- package/dist/extensions/Blocks/Recommendation/controls/nameTextTrimControl.js +74 -0
- package/dist/extensions/Blocks/Recommendation/controls/{omnibusDiscount/textAfter.js → omnibusDiscountTextAfterControl.js} +14 -16
- package/dist/extensions/Blocks/Recommendation/controls/{omnibusDiscount/textBefore.js → omnibusDiscountTextBeforeControl.js} +14 -16
- package/dist/extensions/Blocks/Recommendation/controls/{omnibusPrice/textAfter.js → omnibusPriceTextAfterControl.js} +14 -16
- package/dist/extensions/Blocks/Recommendation/controls/{omnibusPrice/textBefore.js → omnibusPriceTextBeforeControl.js} +12 -14
- package/dist/extensions/Blocks/Recommendation/controls/spacingControl.js +188 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +17 -40
- package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +3 -19
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +4 -13
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +10 -21
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +207 -254
- package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +181 -0
- package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +189 -0
- package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +209 -0
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +9 -9
- package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +15 -26
- package/dist/extensions/Blocks/controlFactories.js +93 -125
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +186 -242
- package/dist/services/recommendationApi.js +8 -11
- package/dist/services/templateLibraryApi.js +13 -16
- package/dist/src/components/wrappers/WpDrawer.vue.d.ts +1 -1
- package/dist/src/composables/useRecommendation.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +0 -67
- package/dist/src/extensions/Blocks/Recommendation/{controls/cardComposition/index.d.ts → cardCompositionControl.d.ts} +3 -23
- package/dist/src/extensions/Blocks/Recommendation/{constants/controlIds.d.ts → constants.d.ts} +24 -0
- package/dist/src/extensions/Blocks/Recommendation/control.d.ts +38 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +589 -21
- package/dist/src/extensions/Blocks/Recommendation/controls/nameTextTrimControl.d.ts +16 -0
- package/dist/src/extensions/Blocks/Recommendation/extension.d.ts +0 -9
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +468 -138
- package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +16 -0
- package/dist/src/extensions/Blocks/Recommendation/templates/{grid/migration.d.ts → migrationTemplate.d.ts} +4 -11
- package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +52 -0
- package/dist/static/styles/customEditorStyle.css.js +11 -35
- package/dist/utils/pairProductVariables.js +56 -57
- package/dist/utils/templatePreparation.js +14 -15
- package/package.json +1 -1
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +0 -121
- package/dist/extensions/Blocks/Recommendation/constants/blockIds.js +0 -4
- package/dist/extensions/Blocks/Recommendation/constants/controlIds.js +0 -4
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +0 -66
- package/dist/extensions/Blocks/Recommendation/constants/layout.js +0 -22
- package/dist/extensions/Blocks/Recommendation/constants/selectors.js +0 -21
- package/dist/extensions/Blocks/Recommendation/controls/button/index.js +0 -64
- package/dist/extensions/Blocks/Recommendation/controls/cardBackground/index.js +0 -80
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +0 -232
- package/dist/extensions/Blocks/Recommendation/controls/image/index.js +0 -19
- package/dist/extensions/Blocks/Recommendation/controls/layout/index.js +0 -92
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +0 -102
- package/dist/extensions/Blocks/Recommendation/controls/main/currency.js +0 -209
- package/dist/extensions/Blocks/Recommendation/controls/main/filters.js +0 -52
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +0 -250
- package/dist/extensions/Blocks/Recommendation/controls/main/locale.js +0 -70
- package/dist/extensions/Blocks/Recommendation/controls/main/productLayout.js +0 -160
- package/dist/extensions/Blocks/Recommendation/controls/main/shuffle.js +0 -67
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +0 -307
- package/dist/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.js +0 -21
- package/dist/extensions/Blocks/Recommendation/controls/name/index.js +0 -46
- package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +0 -108
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/index.js +0 -44
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.js +0 -48
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/index.js +0 -48
- package/dist/extensions/Blocks/Recommendation/controls/price/index.js +0 -44
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +0 -222
- package/dist/extensions/Blocks/Recommendation/services/configService.js +0 -240
- package/dist/extensions/Blocks/Recommendation/templates/grid/elementRenderer.js +0 -228
- package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +0 -251
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +0 -66
- package/dist/extensions/Blocks/Recommendation/templates/index.js +0 -12
- package/dist/extensions/Blocks/Recommendation/templates/list/elementRenderer.js +0 -169
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +0 -73
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +0 -134
- package/dist/extensions/Blocks/Recommendation/types/nodeConfig.js +0 -6
- package/dist/extensions/Blocks/Recommendation/utils/priceFormatter.js +0 -29
- package/dist/extensions/Blocks/Recommendation/utils/tagName.js +0 -46
- package/dist/src/config/compiler/utils/recommendationCompilerUtils.d.ts +0 -17
- package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +0 -13
- package/dist/src/extensions/Blocks/Recommendation/constants/defaultConfig.d.ts +0 -49
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +0 -13
- package/dist/src/extensions/Blocks/Recommendation/constants/layout.d.ts +0 -41
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +0 -35
- package/dist/src/extensions/Blocks/Recommendation/controls/button/index.d.ts +0 -143
- package/dist/src/extensions/Blocks/Recommendation/controls/cardBackground/index.d.ts +0 -31
- package/dist/src/extensions/Blocks/Recommendation/controls/image/index.d.ts +0 -35
- package/dist/src/extensions/Blocks/Recommendation/controls/layout/index.d.ts +0 -37
- package/dist/src/extensions/Blocks/Recommendation/controls/main/algorithm.d.ts +0 -29
- package/dist/src/extensions/Blocks/Recommendation/controls/main/currency.d.ts +0 -52
- package/dist/src/extensions/Blocks/Recommendation/controls/main/filters.d.ts +0 -22
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +0 -79
- package/dist/src/extensions/Blocks/Recommendation/controls/main/locale.d.ts +0 -24
- package/dist/src/extensions/Blocks/Recommendation/controls/main/productLayout.d.ts +0 -60
- package/dist/src/extensions/Blocks/Recommendation/controls/main/shuffle.d.ts +0 -23
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.d.ts +0 -221
- package/dist/src/extensions/Blocks/Recommendation/controls/mobileLayout/cssRules.d.ts +0 -29
- package/dist/src/extensions/Blocks/Recommendation/controls/name/index.d.ts +0 -97
- package/dist/src/extensions/Blocks/Recommendation/controls/name/textTrim.d.ts +0 -34
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/index.d.ts +0 -95
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/index.d.ts +0 -100
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.d.ts +0 -15
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.d.ts +0 -15
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/index.d.ts +0 -100
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.d.ts +0 -15
- package/dist/src/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.d.ts +0 -15
- package/dist/src/extensions/Blocks/Recommendation/controls/price/index.d.ts +0 -95
- package/dist/src/extensions/Blocks/Recommendation/controls/spacing/index.d.ts +0 -83
- package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +0 -151
- package/dist/src/extensions/Blocks/Recommendation/services/index.d.ts +0 -6
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/elementRenderer.d.ts +0 -20
- package/dist/src/extensions/Blocks/Recommendation/templates/grid/template.d.ts +0 -33
- package/dist/src/extensions/Blocks/Recommendation/templates/index.d.ts +0 -41
- package/dist/src/extensions/Blocks/Recommendation/templates/list/elementRenderer.d.ts +0 -8
- package/dist/src/extensions/Blocks/Recommendation/templates/list/migration.d.ts +0 -25
- package/dist/src/extensions/Blocks/Recommendation/templates/list/template.d.ts +0 -18
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +0 -66
- package/dist/src/extensions/Blocks/Recommendation/types/index.d.ts +0 -7
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +0 -166
- package/dist/src/extensions/Blocks/Recommendation/utils/priceFormatter.d.ts +0 -33
- package/dist/src/extensions/Blocks/Recommendation/utils/stylePreserver.d.ts +0 -113
- package/dist/src/extensions/Blocks/Recommendation/utils/tagName.d.ts +0 -77
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
var C = Object.defineProperty;
|
|
2
|
+
var g = (i, r, e) => r in i ? C(i, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[r] = e;
|
|
3
|
+
var S = (i, r, e) => g(i, typeof r != "symbol" ? r + "" : r, e);
|
|
4
|
+
import { ModificationDescription as l } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
|
+
import { CommonControl as m } from "../../common-control.js";
|
|
6
|
+
import { useDebounceFn as d } from "../../../../node_modules/@vueuse/shared/index.js";
|
|
7
|
+
const _ = "recommendation-spacing-control", c = {
|
|
8
|
+
COLUMN_SPACING: "columnSpacing",
|
|
9
|
+
ROW_SPACING: "rowSpacing"
|
|
10
|
+
}, N = {
|
|
11
|
+
COLUMN_SPACING: "data-column-spacing",
|
|
12
|
+
ROW_SPACING: "data-row-spacing"
|
|
13
|
+
}, n = {
|
|
14
|
+
COLUMN_SPACING: 10,
|
|
15
|
+
// 5px on each side = 10px total
|
|
16
|
+
ROW_SPACING: 20
|
|
17
|
+
}, p = {
|
|
18
|
+
MIN_SPACING: 0,
|
|
19
|
+
MAX_SPACING: 50,
|
|
20
|
+
STEP: 5
|
|
21
|
+
};
|
|
22
|
+
class G extends m {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
|
+
/**
|
|
26
|
+
* Debounced version of _onColumnSpacingChange
|
|
27
|
+
* Prevents excessive DOM updates when user rapidly adjusts the counter
|
|
28
|
+
*/
|
|
29
|
+
S(this, "_debouncedOnColumnSpacingChange", d((e) => {
|
|
30
|
+
this._onColumnSpacingChange(e);
|
|
31
|
+
}, 300));
|
|
32
|
+
/**
|
|
33
|
+
* Debounced version of _onRowSpacingChange
|
|
34
|
+
* Prevents excessive DOM updates when user rapidly adjusts the counter
|
|
35
|
+
*/
|
|
36
|
+
S(this, "_debouncedOnRowSpacingChange", d((e) => {
|
|
37
|
+
this._onRowSpacingChange(e);
|
|
38
|
+
}, 300));
|
|
39
|
+
}
|
|
40
|
+
getId() {
|
|
41
|
+
return _;
|
|
42
|
+
}
|
|
43
|
+
getTemplate() {
|
|
44
|
+
return `
|
|
45
|
+
<div class="spacing-control-container">
|
|
46
|
+
${this._GuTwoColumns([
|
|
47
|
+
this._GuLabel({ text: "Column Spacing (px)" }),
|
|
48
|
+
this._GuCounter({
|
|
49
|
+
name: c.COLUMN_SPACING,
|
|
50
|
+
minValue: p.MIN_SPACING,
|
|
51
|
+
maxValue: p.MAX_SPACING,
|
|
52
|
+
step: p.STEP
|
|
53
|
+
}),
|
|
54
|
+
this._GuLabel({ text: "Row Spacing (px)" }),
|
|
55
|
+
this._GuCounter({
|
|
56
|
+
name: c.ROW_SPACING,
|
|
57
|
+
minValue: p.MIN_SPACING,
|
|
58
|
+
maxValue: p.MAX_SPACING,
|
|
59
|
+
step: p.STEP
|
|
60
|
+
})
|
|
61
|
+
])}
|
|
62
|
+
</div>
|
|
63
|
+
`;
|
|
64
|
+
}
|
|
65
|
+
onRender() {
|
|
66
|
+
this._setFormValues(), this._listenToFormUpdates();
|
|
67
|
+
}
|
|
68
|
+
onTemplateNodeUpdated(e) {
|
|
69
|
+
super.onTemplateNodeUpdated(e), this._setFormValues();
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Reads spacing values from data attributes or returns defaults
|
|
73
|
+
*/
|
|
74
|
+
_setFormValues() {
|
|
75
|
+
const e = this._getStoredColumnSpacing(), t = this._getStoredRowSpacing();
|
|
76
|
+
this.api.updateValues({
|
|
77
|
+
[c.COLUMN_SPACING]: e,
|
|
78
|
+
[c.ROW_SPACING]: t
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Gets stored column spacing from the first product card wrapper's parent element's padding
|
|
83
|
+
* Reads the actual padding value instead of relying on data attributes
|
|
84
|
+
*
|
|
85
|
+
* The padding is applied as "0 {halfSpacing}px" on the parent TD element,
|
|
86
|
+
* so we need to extract the horizontal padding value and multiply by 2 to get total spacing.
|
|
87
|
+
*/
|
|
88
|
+
_getStoredColumnSpacing() {
|
|
89
|
+
if (!this.currentNode)
|
|
90
|
+
return n.COLUMN_SPACING;
|
|
91
|
+
const e = this.currentNode.querySelector(".product-card-wrapper");
|
|
92
|
+
if (!e || !("parent" in e) || typeof e.parent != "function")
|
|
93
|
+
return n.COLUMN_SPACING;
|
|
94
|
+
const t = e.parent();
|
|
95
|
+
if (!t || !("getStyle" in t))
|
|
96
|
+
return n.COLUMN_SPACING;
|
|
97
|
+
const o = t.getStyle("padding");
|
|
98
|
+
if (!o)
|
|
99
|
+
return n.COLUMN_SPACING;
|
|
100
|
+
const u = o.trim().split(/\s+/);
|
|
101
|
+
if (u.length < 2)
|
|
102
|
+
return n.COLUMN_SPACING;
|
|
103
|
+
const [, a] = u, s = parseFloat(a);
|
|
104
|
+
return Number.isNaN(s) ? n.COLUMN_SPACING : s * 2;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Gets stored row spacing from the first spacer element's height style
|
|
108
|
+
* Reads the actual height value instead of relying on data attributes
|
|
109
|
+
*/
|
|
110
|
+
_getStoredRowSpacing() {
|
|
111
|
+
if (!this.currentNode)
|
|
112
|
+
return n.ROW_SPACING;
|
|
113
|
+
const e = this.currentNode.querySelector(".spacer");
|
|
114
|
+
if (!e || !("getStyle" in e))
|
|
115
|
+
return n.ROW_SPACING;
|
|
116
|
+
const t = e.getStyle("height");
|
|
117
|
+
if (!t)
|
|
118
|
+
return n.ROW_SPACING;
|
|
119
|
+
const o = parseFloat(t);
|
|
120
|
+
return Number.isNaN(o) ? n.ROW_SPACING : o;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Handles column spacing changes
|
|
124
|
+
* Applies horizontal padding to all product card wrappers
|
|
125
|
+
*/
|
|
126
|
+
_onColumnSpacingChange(e) {
|
|
127
|
+
if (!this.currentNode)
|
|
128
|
+
return;
|
|
129
|
+
const t = Array.from(
|
|
130
|
+
this.currentNode.querySelectorAll(".product-card-wrapper")
|
|
131
|
+
);
|
|
132
|
+
if (!t)
|
|
133
|
+
return;
|
|
134
|
+
const o = this.api.getDocumentModifier(), a = `0 ${e / 2}px`;
|
|
135
|
+
console.debug("padding", a), t.forEach((s) => {
|
|
136
|
+
"parent" in s && s.parent() && o.modifyHtml(s.parent()).setStyle("padding", a);
|
|
137
|
+
}), o.apply(new l(`Update column spacing to ${e}px`));
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Handles row spacing changes
|
|
141
|
+
* Applies height to all spacer elements between product rows
|
|
142
|
+
*/
|
|
143
|
+
_onRowSpacingChange(e) {
|
|
144
|
+
if (!this.currentNode)
|
|
145
|
+
return;
|
|
146
|
+
this._storeRowSpacing(e);
|
|
147
|
+
const t = Array.from(
|
|
148
|
+
this.currentNode.querySelectorAll(".spacer")
|
|
149
|
+
);
|
|
150
|
+
if (console.debug("spacerCells", t), console.debug("spacing", e), !t.length)
|
|
151
|
+
return;
|
|
152
|
+
const o = this.api.getDocumentModifier(), u = `${e}px`;
|
|
153
|
+
t.forEach((a) => {
|
|
154
|
+
o.modifyHtml(a).setStyle("height", u);
|
|
155
|
+
}), o.apply(new l(`Update row spacing to ${e}px`));
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Stores column spacing value in block data attribute
|
|
159
|
+
*/
|
|
160
|
+
_storeColumnSpacing(e) {
|
|
161
|
+
if (!this.currentNode)
|
|
162
|
+
return;
|
|
163
|
+
const t = this.currentNode.querySelector(".ins-recommendation-v3-block-v2");
|
|
164
|
+
t && this.api.getDocumentModifier().modifyHtml(t).setAttribute(N.COLUMN_SPACING, e.toString()).apply(new l("Store column spacing"));
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Stores row spacing value in block data attribute
|
|
168
|
+
*/
|
|
169
|
+
_storeRowSpacing(e) {
|
|
170
|
+
if (!this.currentNode)
|
|
171
|
+
return;
|
|
172
|
+
const t = this.currentNode.querySelector(".ins-recommendation-v3-block-v2");
|
|
173
|
+
t && this.api.getDocumentModifier().modifyHtml(t).setAttribute(N.ROW_SPACING, e.toString()).apply(new l("Store row spacing"));
|
|
174
|
+
}
|
|
175
|
+
_listenToFormUpdates() {
|
|
176
|
+
this.api.onValueChanged(c.COLUMN_SPACING, (e) => {
|
|
177
|
+
const t = parseInt(e);
|
|
178
|
+
Number.isNaN(t) || this._debouncedOnColumnSpacingChange(t);
|
|
179
|
+
}), this.api.onValueChanged(c.ROW_SPACING, (e) => {
|
|
180
|
+
const t = parseInt(e);
|
|
181
|
+
Number.isNaN(t) || this._debouncedOnRowSpacingChange(t);
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
export {
|
|
186
|
+
_ as SPACING_CONTROL_ID,
|
|
187
|
+
G as SpacingControl
|
|
188
|
+
};
|
|
@@ -1,42 +1,19 @@
|
|
|
1
|
-
import { ExtensionBuilder as
|
|
2
|
-
import { RecommendationBlock as
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
import R from "./recommendation.css.js";
|
|
18
|
-
import { SettingsPanel as y } from "./settingsPanel.js";
|
|
19
|
-
const B = [
|
|
20
|
-
i,
|
|
21
|
-
e,
|
|
22
|
-
l,
|
|
23
|
-
s,
|
|
24
|
-
a,
|
|
25
|
-
p,
|
|
26
|
-
c
|
|
27
|
-
], P = [
|
|
28
|
-
n,
|
|
29
|
-
d,
|
|
30
|
-
f,
|
|
31
|
-
C,
|
|
32
|
-
u
|
|
33
|
-
], b = [
|
|
34
|
-
...P,
|
|
35
|
-
...B.flatMap((o) => Object.values(o))
|
|
36
|
-
], F = b.reduce(
|
|
37
|
-
(o, t) => o.addControl(t),
|
|
38
|
-
new r().addBlock(m).withSettingsPanelRegistry(y)
|
|
39
|
-
).addStyles(R).withIconsRegistry(g).build();
|
|
1
|
+
import { ExtensionBuilder as o } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { RecommendationBlock as t } from "./block.js";
|
|
3
|
+
import { RecommendationCardCompositionControl as n } from "./cardCompositionControl.js";
|
|
4
|
+
import { RecommendationBlockControl as r } from "./control.js";
|
|
5
|
+
import { ButtonAlignControl as l, ButtonBorderControl as d, ButtonBorderRadiusControl as C, ButtonColorControl as i, ButtonFitToContentControl as a, ButtonFontFamilyControl as e, ButtonMarginsControl as m, ButtonPaddingsControl as s, ButtonTextControl as c, ButtonTextSizeControl as u, ButtonTextStyleAndFontColorControl as P, ImageMarginsControl as g, ImageSizeControl as B, NameAlignControl as O, NameBackgroundControl as f, NameColorControl as b, NameFontFamilyControl as p, NamePaddingsControl as y, NameSizeControl as S, NameStyleControl as F, OldPriceAlignControl as x, OldPriceBackgroundControl as T, OldPriceColorControl as k, OldPriceFontFamilyControl as A, OldPricePaddingsControl as D, OldPriceSizeControl as N, OldPriceStyleControl as R, OmnibusPriceAlignControl as z, OmnibusPriceBackgroundControl as I, OmnibusPriceColorControl as w, OmnibusPriceFontFamilyControl as h, OmnibusPricePaddingsControl as M, OmnibusPriceSizeControl as E, OmnibusPriceStyleControl as j, OmnibusDiscountAlignControl as q, OmnibusDiscountBackgroundControl as v, OmnibusDiscountColorControl as G, OmnibusDiscountFontFamilyControl as H, OmnibusDiscountPaddingsControl as J, OmnibusDiscountSizeControl as K, OmnibusDiscountStyleControl as L, PriceAlignControl as Q, PriceBackgroundControl as U, PriceColorControl as V, PriceFontFamilyControl as W, PricePaddingsControl as X, PriceSizeControl as Y, PriceStyleControl as Z } from "./controls/index.js";
|
|
6
|
+
import { RecommendationIconsRegistry as _ } from "./iconsRegistry.js";
|
|
7
|
+
import $ from "./recommendation.css.js";
|
|
8
|
+
import { SettingsPanel as oo } from "./settingsPanel.js";
|
|
9
|
+
import { CardBackgroundColorControl as to } from "./controls/cardBackgroundColorControl.js";
|
|
10
|
+
import { SpacingControl as no } from "./controls/spacingControl.js";
|
|
11
|
+
import { NameTextTrimControl as ro } from "./controls/nameTextTrimControl.js";
|
|
12
|
+
import { OmnibusPriceTextBeforeControl as lo } from "./controls/omnibusPriceTextBeforeControl.js";
|
|
13
|
+
import { OmnibusPriceTextAfterControl as Co } from "./controls/omnibusPriceTextAfterControl.js";
|
|
14
|
+
import { OmnibusDiscountTextBeforeControl as io } from "./controls/omnibusDiscountTextBeforeControl.js";
|
|
15
|
+
import { OmnibusDiscountTextAfterControl as ao } from "./controls/omnibusDiscountTextAfterControl.js";
|
|
16
|
+
const xo = new o().addBlock(t).withSettingsPanelRegistry(oo).addControl(r).addControl(to).addControl(no).addControl(l).addControl(d).addControl(C).addControl(i).addControl(a).addControl(e).addControl(m).addControl(s).addControl(c).addControl(u).addControl(P).addControl(g).addControl(B).addControl(O).addControl(f).addControl(b).addControl(p).addControl(y).addControl(S).addControl(F).addControl(ro).addControl(x).addControl(T).addControl(k).addControl(A).addControl(D).addControl(N).addControl(R).addControl(z).addControl(I).addControl(w).addControl(h).addControl(M).addControl(E).addControl(j).addControl(lo).addControl(Co).addControl(q).addControl(v).addControl(G).addControl(H).addControl(J).addControl(K).addControl(L).addControl(io).addControl(ao).addControl(Q).addControl(U).addControl(V).addControl(W).addControl(X).addControl(Y).addControl(Z).addControl(n).addStyles($).withIconsRegistry(_).build();
|
|
40
17
|
export {
|
|
41
|
-
|
|
18
|
+
xo as default
|
|
42
19
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IconsRegistry as
|
|
2
|
-
class
|
|
1
|
+
import { IconsRegistry as o } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
class n extends o {
|
|
3
3
|
registerIconsSvg(C) {
|
|
4
4
|
C["recommendation-icon"] = `
|
|
5
5
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
|
|
@@ -43,25 +43,9 @@ class o extends r {
|
|
|
43
43
|
3.40029 12.0082 3.25285 11.7656 3.15234C11.365 2.98638 11.0001 2.64849 11 2.21484V2Z"
|
|
44
44
|
fill="currentColor"/>
|
|
45
45
|
</svg>
|
|
46
|
-
`, C["grid-orientation"] = `
|
|
47
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="currentColor">
|
|
48
|
-
<rect x="1" y="1" width="7" height="7" rx="1" stroke="currentColor" stroke-width="2" fill="none"/>
|
|
49
|
-
<rect x="12" y="1" width="7" height="7" rx="1" stroke="currentColor" stroke-width="2" fill="none"/>
|
|
50
|
-
<rect x="1" y="12" width="7" height="7" rx="1" stroke="currentColor" stroke-width="2" fill="none"/>
|
|
51
|
-
<rect x="12" y="12" width="7" height="7" rx="1" stroke="currentColor" stroke-width="2" fill="none"/>
|
|
52
|
-
</svg>
|
|
53
|
-
`, C["list-orientation"] = `
|
|
54
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="currentColor">
|
|
55
|
-
<circle cx="3" cy="4" r="1" stroke="currentColor" stroke-width="1"/>
|
|
56
|
-
<rect x="7" y="3" width="11" height="2" rx="1"/>
|
|
57
|
-
<circle cx="3" cy="10" r="1" stroke="currentColor" stroke-width="1"/>
|
|
58
|
-
<rect x="7" y="9" width="11" height="2" rx="1"/>
|
|
59
|
-
<circle cx="3" cy="16" r="1" stroke="currentColor" stroke-width="1"/>
|
|
60
|
-
<rect x="7" y="15" width="11" height="2" rx="1"/>
|
|
61
|
-
</svg>
|
|
62
46
|
`;
|
|
63
47
|
}
|
|
64
48
|
}
|
|
65
49
|
export {
|
|
66
|
-
|
|
50
|
+
n as RecommendationIconsRegistry
|
|
67
51
|
};
|
|
@@ -1,27 +1,18 @@
|
|
|
1
1
|
const n = `/* Utils */
|
|
2
2
|
.es-180w { width: 180px; }
|
|
3
3
|
|
|
4
|
-
/* Recommendation Controls
|
|
5
|
-
.recommendation-controls-container >
|
|
6
|
-
|
|
4
|
+
/* Recommendation Controls */
|
|
5
|
+
.recommendation-controls-container > .container {
|
|
6
|
+
padding: 16px;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
.recommendation-controls-container >
|
|
9
|
+
.recommendation-controls-container > .container:first-child {
|
|
10
10
|
padding-top: 0;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
.recommendation-controls-container > div:last-child {
|
|
14
|
-
border-bottom: none;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
13
|
.container:has(.recommendation-controls-container) {
|
|
18
14
|
padding: 0
|
|
19
15
|
}
|
|
20
|
-
|
|
21
|
-
/* Hide drag icon for list layout (ordering disabled) */
|
|
22
|
-
ue-orderable.orderable-disabled .droppable-icon {
|
|
23
|
-
display: none;
|
|
24
|
-
}
|
|
25
16
|
`;
|
|
26
17
|
export {
|
|
27
18
|
n as default
|
|
@@ -1,27 +1,17 @@
|
|
|
1
1
|
import { SettingsPanelRegistry as S, SettingsPanelTab as I, SettingsTab as T, ContainerControls as E, TextControls as C } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
2
|
import { BLOCK_ID as R } from "./block.js";
|
|
3
|
-
import {
|
|
4
|
-
import { RecommendationControlId as _ } from "./constants
|
|
5
|
-
import { CONTROL_BLOCK_ID as
|
|
6
|
-
import "./
|
|
7
|
-
import "./controls/
|
|
8
|
-
|
|
9
|
-
import "./controls/oldPrice/index.js";
|
|
10
|
-
import "./controls/omnibusPrice/index.js";
|
|
11
|
-
import "./controls/omnibusDiscount/index.js";
|
|
12
|
-
import "./controls/button/index.js";
|
|
13
|
-
import "./controls/image/index.js";
|
|
14
|
-
import { SPACING_CONTROL_ID as U } from "./controls/spacing/index.js";
|
|
15
|
-
import { CARD_BACKGROUND_COLOR_CONTROL_ID as B } from "./controls/cardBackground/index.js";
|
|
16
|
-
import { LAYOUT_CONTROL_ID as D } from "./controls/layout/index.js";
|
|
17
|
-
import { COMPOSITION_CONTROL_BLOCK_ID as A } from "./controls/cardComposition/index.js";
|
|
18
|
-
class s extends S {
|
|
3
|
+
import { COMPOSITION_CONTROL_BLOCK_ID as L } from "./cardCompositionControl.js";
|
|
4
|
+
import { RecommendationBlockId as N, RecommendationControlId as _ } from "./constants.js";
|
|
5
|
+
import { CONTROL_BLOCK_ID as U } from "./control.js";
|
|
6
|
+
import { CARD_BACKGROUND_COLOR_CONTROL_ID as B } from "./controls/cardBackgroundColorControl.js";
|
|
7
|
+
import { SPACING_CONTROL_ID as D } from "./controls/spacingControl.js";
|
|
8
|
+
class m extends S {
|
|
19
9
|
registerBlockControls(O) {
|
|
20
10
|
O[R] = [
|
|
21
11
|
new I(
|
|
22
12
|
T.SETTINGS,
|
|
23
13
|
[
|
|
24
|
-
|
|
14
|
+
U,
|
|
25
15
|
E.EXTERNAL_INDENTS
|
|
26
16
|
]
|
|
27
17
|
),
|
|
@@ -30,14 +20,13 @@ class s extends S {
|
|
|
30
20
|
[
|
|
31
21
|
C.TEXT_BLOCK_BACKGROUND_COLOR,
|
|
32
22
|
B,
|
|
33
|
-
D
|
|
34
|
-
U
|
|
23
|
+
D
|
|
35
24
|
]
|
|
36
25
|
),
|
|
37
26
|
new I(
|
|
38
27
|
"Card Composition",
|
|
39
28
|
[
|
|
40
|
-
|
|
29
|
+
L
|
|
41
30
|
]
|
|
42
31
|
).withLabel("Card Composition")
|
|
43
32
|
], O[N.NAME] = [
|
|
@@ -169,5 +158,5 @@ class s extends S {
|
|
|
169
158
|
}
|
|
170
159
|
}
|
|
171
160
|
export {
|
|
172
|
-
|
|
161
|
+
m as SettingsPanel
|
|
173
162
|
};
|