@useinsider/guido 3.23.0-beta.86bed27 → 3.23.0-beta.9f6bfbf
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 +1 -0
- package/dist/@types/config/schemas.js +17 -15
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +58 -56
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue.js +11 -11
- package/dist/components/organisms/unsubscribe/UnsubscribePageSelection.vue2.js +9 -9
- package/dist/composables/useModuleRepair.js +14 -12
- package/dist/config/compiler/utils/recommendationCompilerUtils.js +22 -22
- package/dist/config/migrator/index.js +16 -15
- package/dist/config/migrator/itemsPriceFormatMigrator.js +20 -0
- package/dist/config/migrator/recommendation/compositionMapper.js +56 -49
- package/dist/config/migrator/recommendation/extractors.js +100 -40
- package/dist/config/migrator/recommendation/htmlBuilder.js +285 -207
- package/dist/config/migrator/recommendation/settingsMapper.js +37 -36
- package/dist/config/migrator/recommendation/themeMapper.js +53 -41
- package/dist/config/migrator/recommendationMigrator.js +68 -61
- package/dist/extensions/Blocks/Items/block.js +115 -77
- package/dist/extensions/Blocks/Items/constants/currency.js +59 -14
- package/dist/extensions/Blocks/Items/controls/button/link.js +14 -17
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +14 -17
- package/dist/extensions/Blocks/Items/controls/image/link.js +14 -17
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +9 -10
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +40 -30
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +63 -53
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +31 -31
- package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +15 -16
- package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +25 -26
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +42 -32
- package/dist/extensions/Blocks/Items/controls/priceFormat.js +145 -0
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +160 -144
- package/dist/extensions/Blocks/Items/enums/controlEnums.js +1 -1
- package/dist/extensions/Blocks/Items/extension.js +9 -8
- package/dist/extensions/Blocks/Items/items.css.js +19 -0
- package/dist/extensions/Blocks/Items/settingsPanel.js +34 -25
- package/dist/extensions/Blocks/Items/template.js +250 -212
- package/dist/extensions/Blocks/Items/utils/priceFormatOps.js +185 -0
- package/dist/extensions/Blocks/Recommendation/block.js +33 -24
- package/dist/extensions/Blocks/Recommendation/controls/cardBackground/index.js +3 -3
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +27 -26
- package/dist/extensions/Blocks/Recommendation/controls/customAttribute/textTrim.js +13 -13
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +165 -175
- package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +5 -5
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textAfter.js +8 -8
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.js +15 -15
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.js +12 -12
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.js +10 -10
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +1 -1
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +23 -22
- package/dist/extensions/Blocks/Recommendation/templates/list/template.js +19 -18
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +82 -91
- package/dist/extensions/Blocks/Recommendation/utils/inlinePriceOrder.js +12 -0
- package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMap.js +3 -2
- package/dist/extensions/Blocks/Recommendation/utils/priceFormatter.js +1 -0
- package/dist/extensions/Blocks/common-control.js +62 -55
- package/dist/guido.css +1 -1
- package/dist/package.json.js +2 -2
- package/dist/src/@types/config/schemas.d.ts +4 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/config/migrator/index.d.ts +4 -1
- package/dist/src/config/migrator/itemsPriceFormatMigrator.d.ts +1 -0
- package/dist/src/config/migrator/recommendation/compositionMapper.d.ts +3 -1
- package/dist/src/config/migrator/recommendation/extractors.d.ts +35 -6
- package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +3 -1
- package/dist/src/config/migrator/recommendation/themeMapper.d.ts +3 -1
- package/dist/src/config/migrator/recommendation/types.d.ts +11 -1
- package/dist/src/extensions/Blocks/Items/block.d.ts +6 -9
- package/dist/src/extensions/Blocks/Items/constants/currency.d.ts +32 -0
- package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/priceFormat.d.ts +23 -0
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/enums/controlEnums.d.ts +1 -0
- package/dist/src/extensions/Blocks/Items/template.d.ts +4 -1
- package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +3 -0
- package/dist/src/extensions/Blocks/Items/utils/priceFormatOps.d.ts +61 -0
- package/dist/src/extensions/Blocks/Recommendation/block.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +5 -10
- package/dist/src/extensions/Blocks/Recommendation/templates/utils.d.ts +1 -13
- package/dist/src/extensions/Blocks/Recommendation/utils/inlinePriceOrder.d.ts +9 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.d.ts +2 -19
- package/dist/src/extensions/Blocks/Recommendation/utils/priceFormatter.d.ts +12 -0
- package/dist/src/extensions/Blocks/common-control.d.ts +2 -0
- package/dist/src/stores/config.d.ts +20 -0
- package/dist/src/stores/unsubscribe.d.ts +10 -0
- package/dist/src/utils/itemsCurrencyRepair.d.ts +5 -1
- package/dist/stores/unsubscribe.js +33 -29
- package/dist/utils/itemsCurrencyRepair.js +29 -24
- package/dist/utils/pairProductVariables.js +119 -99
- package/package.json +2 -2
|
@@ -3,9 +3,10 @@ function r(e) {
|
|
|
3
3
|
return e;
|
|
4
4
|
switch (e) {
|
|
5
5
|
case "viewedTogether":
|
|
6
|
-
return "similarViewed";
|
|
7
6
|
case "purchasedTogether":
|
|
8
|
-
|
|
7
|
+
case "similarViewed":
|
|
8
|
+
case "similarBought":
|
|
9
|
+
return "mostPopular";
|
|
9
10
|
case "trending":
|
|
10
11
|
return "trendingProducts";
|
|
11
12
|
case "mostValuable":
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
1
|
+
var u = Object.defineProperty;
|
|
2
|
+
var c = (l, E, e) => E in l ? u(l, E, { enumerable: !0, configurable: !0, writable: !0, value: e }) : l[E] = e;
|
|
3
|
+
var i = (l, E, e) => c(l, typeof E != "symbol" ? E + "" : E, e);
|
|
4
4
|
import { Control as I, UIElementType as n, UEAttr as $ } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
5
|
class _ extends I {
|
|
6
6
|
constructor() {
|
|
7
7
|
super(...arguments);
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
i(this, "currentNode");
|
|
9
|
+
i(this, "lastBlockInstanceId", null);
|
|
10
|
+
// Set until the control handles the node Stripo hands a freshly rendered panel.
|
|
11
|
+
i(this, "isAwaitingPanelNode", !1);
|
|
10
12
|
}
|
|
11
13
|
getContainer() {
|
|
12
14
|
var e;
|
|
@@ -18,6 +20,11 @@ class _ extends I {
|
|
|
18
20
|
onDestroy() {
|
|
19
21
|
this.lastBlockInstanceId = null;
|
|
20
22
|
}
|
|
23
|
+
// Stripo renders a panel before it hands that panel its node, so a node still held is the last
|
|
24
|
+
// panel's and may be disposed. Controls Stripo renders call this first in onRender.
|
|
25
|
+
forgetLastPanelNode() {
|
|
26
|
+
this.currentNode = void 0, this.isAwaitingPanelNode = !0;
|
|
27
|
+
}
|
|
21
28
|
/**
|
|
22
29
|
* Gets the Items block container element from the current node.
|
|
23
30
|
* @returns The container element or null if not found
|
|
@@ -44,18 +51,18 @@ class _ extends I {
|
|
|
44
51
|
* @returns true if block instance changed, false otherwise
|
|
45
52
|
*/
|
|
46
53
|
handleBlockInstanceChange(e) {
|
|
47
|
-
const t = this.getBlockInstanceId();
|
|
48
|
-
if (!t)
|
|
49
|
-
return !1;
|
|
50
|
-
const
|
|
51
|
-
return e(),
|
|
54
|
+
const t = this.getBlockInstanceId(), o = this.isAwaitingPanelNode;
|
|
55
|
+
if (this.isAwaitingPanelNode = !1, !t)
|
|
56
|
+
return o && e(), !1;
|
|
57
|
+
const a = t !== this.lastBlockInstanceId;
|
|
58
|
+
return e(), a && (this.lastBlockInstanceId = t), a;
|
|
52
59
|
}
|
|
53
|
-
_GuLabel({ text: e, name: t = "", hint:
|
|
60
|
+
_GuLabel({ text: e, name: t = "", hint: o }) {
|
|
54
61
|
return `
|
|
55
62
|
<${n.LABEL}
|
|
56
63
|
${$.LABEL.text}="${e}"
|
|
57
64
|
${$.LABEL.name}="${t || `${e} Label`}"
|
|
58
|
-
${
|
|
65
|
+
${o ? `${$.LABEL.hint}="${o}"` : ""}>
|
|
59
66
|
</${n.LABEL}>
|
|
60
67
|
`;
|
|
61
68
|
}
|
|
@@ -73,7 +80,7 @@ class _ extends I {
|
|
|
73
80
|
* Use in getTemplate() — the icon is registered in a hidden store so Stripo initializes it.
|
|
74
81
|
* Pair with _setInfoMessageValue() in onRender() to set the text content.
|
|
75
82
|
*/
|
|
76
|
-
_GuOnPageMessage({ name: e, icon: t = "not-found", type:
|
|
83
|
+
_GuOnPageMessage({ name: e, icon: t = "not-found", type: o = "info" }) {
|
|
77
84
|
return `
|
|
78
85
|
<div data-info-message="${e}" style="display: none; padding: 16px 16px 0;">
|
|
79
86
|
<div class="icon-store" style="display: none;">
|
|
@@ -81,7 +88,7 @@ class _ extends I {
|
|
|
81
88
|
${this._GuIcon({ src: t, className: "icon" })}
|
|
82
89
|
</div>
|
|
83
90
|
</div>
|
|
84
|
-
${this._GuMessage({ name: e, type:
|
|
91
|
+
${this._GuMessage({ name: e, type: o })}
|
|
85
92
|
</div>
|
|
86
93
|
`;
|
|
87
94
|
}
|
|
@@ -91,21 +98,21 @@ class _ extends I {
|
|
|
91
98
|
* and combines it with the text in Stripo's alert-message layout.
|
|
92
99
|
*/
|
|
93
100
|
_setInfoMessageValue(e, t) {
|
|
94
|
-
const
|
|
101
|
+
const o = this.getContainer(), a = o.querySelector(`[data-icon-key="${e}"]`), s = a == null ? void 0 : a.querySelector("ue-icon-component"), r = (s == null ? void 0 : s.outerHTML) ?? "";
|
|
95
102
|
this.api.setUIEAttribute(
|
|
96
103
|
e,
|
|
97
104
|
"value",
|
|
98
105
|
`
|
|
99
106
|
<div class="service-element alert-message-main" style="align-items: start;">
|
|
100
|
-
${
|
|
107
|
+
${r}
|
|
101
108
|
<div class="service-element alert-message-text">
|
|
102
109
|
${t}
|
|
103
110
|
</div>
|
|
104
111
|
</div>
|
|
105
112
|
`
|
|
106
113
|
);
|
|
107
|
-
const
|
|
108
|
-
|
|
114
|
+
const T = o.querySelector(`[data-info-message="${e}"]`);
|
|
115
|
+
T && (T.style.display = "");
|
|
109
116
|
}
|
|
110
117
|
_GuToggle(e) {
|
|
111
118
|
return `
|
|
@@ -124,66 +131,66 @@ class _ extends I {
|
|
|
124
131
|
_GuSelect({
|
|
125
132
|
name: e,
|
|
126
133
|
placeholder: t,
|
|
127
|
-
options:
|
|
128
|
-
className:
|
|
129
|
-
searchable:
|
|
134
|
+
options: o,
|
|
135
|
+
className: a = "es-180w",
|
|
136
|
+
searchable: s = !1
|
|
130
137
|
}) {
|
|
131
138
|
return `
|
|
132
139
|
<${n.SELECTPICKER}
|
|
133
|
-
class="${
|
|
140
|
+
class="${a}"
|
|
134
141
|
${$.SELECTPICKER.name}="${e}"
|
|
135
|
-
${
|
|
142
|
+
${s ? `${$.SELECTPICKER.searchable}="true"` : ""}
|
|
136
143
|
${$.SELECTPICKER.placeholder}="${t}">
|
|
137
|
-
${
|
|
144
|
+
${o.map((r) => this._GuSelectItem(r)).join("")}
|
|
138
145
|
</${n.SELECTPICKER}>
|
|
139
146
|
`;
|
|
140
147
|
}
|
|
141
|
-
_GuTextInput({ name: e, placeholder: t, className:
|
|
148
|
+
_GuTextInput({ name: e, placeholder: t, className: o = "", disabled: a = !1 }) {
|
|
142
149
|
return `
|
|
143
150
|
<${n.TEXT}
|
|
144
|
-
class=${
|
|
151
|
+
class=${o}
|
|
145
152
|
${$.TEXT.name}="${e}"
|
|
146
153
|
placeholder="${t || e}"
|
|
147
|
-
${
|
|
154
|
+
${a ? `${$.TEXT.disabled}="true"` : ""}>
|
|
148
155
|
</${n.TEXT}>
|
|
149
156
|
`;
|
|
150
157
|
}
|
|
151
|
-
_GuCounter({ name: e, maxValue: t, minValue:
|
|
158
|
+
_GuCounter({ name: e, maxValue: t, minValue: o = 1, step: a = 1 }) {
|
|
152
159
|
return `
|
|
153
160
|
<${n.COUNTER}
|
|
154
161
|
${$.COUNTER.name}="${e}"
|
|
155
|
-
${$.COUNTER.minValue}="${
|
|
162
|
+
${$.COUNTER.minValue}="${o}"
|
|
156
163
|
${$.COUNTER.maxValue}="${t}"
|
|
157
|
-
${$.COUNTER.step}="${
|
|
164
|
+
${$.COUNTER.step}="${a}">
|
|
158
165
|
</${n.COUNTER}>
|
|
159
166
|
`;
|
|
160
167
|
}
|
|
161
|
-
_GuRadioButtonItem({ text: e, value: t, icon:
|
|
168
|
+
_GuRadioButtonItem({ text: e, value: t, icon: o }) {
|
|
162
169
|
return `
|
|
163
170
|
<${n.RADIO_ITEM}
|
|
164
171
|
${$.RADIO_ITEM.value}="${t}"
|
|
165
172
|
${e ? `${$.RADIO_ITEM.text}="${e}"` : ""}
|
|
166
|
-
${
|
|
173
|
+
${o ? `${$.RADIO_ITEM.icon}="${o}"` : ""}>
|
|
167
174
|
</${n.RADIO_ITEM}>
|
|
168
175
|
`;
|
|
169
176
|
}
|
|
170
|
-
_GuRadioButton({ name: e, buttons: t, id:
|
|
177
|
+
_GuRadioButton({ name: e, buttons: t, id: o = "" }) {
|
|
171
178
|
return `
|
|
172
179
|
<${n.RADIO_BUTTONS}
|
|
173
|
-
${
|
|
180
|
+
${o ? `id="${o}"` : ""}
|
|
174
181
|
${$.RADIO_BUTTONS.name}="${e}">
|
|
175
|
-
${t.map((
|
|
182
|
+
${t.map((a) => this._GuRadioButtonItem(a)).join("")}
|
|
176
183
|
</${n.RADIO_BUTTONS}>
|
|
177
184
|
`;
|
|
178
185
|
}
|
|
179
|
-
_GuButton({ name: e, label: t, id:
|
|
186
|
+
_GuButton({ name: e, label: t, id: o = "", className: a = "", icon: s = "", disabled: r = !1 }) {
|
|
180
187
|
return `
|
|
181
188
|
<${n.BUTTON}
|
|
182
189
|
${$.BUTTON.name}="${e}"
|
|
183
|
-
${
|
|
184
|
-
${
|
|
185
|
-
${
|
|
186
|
-
${
|
|
190
|
+
${o ? `id="${o}"` : ""}
|
|
191
|
+
${a ? `class="${a}"` : ""}
|
|
192
|
+
${s ? `${$.BUTTON.icon}="${s}"` : ""}
|
|
193
|
+
${r ? `${$.BUTTON.disabled}="true"` : ""}
|
|
187
194
|
${$.BUTTON.caption}="${t}">
|
|
188
195
|
</${n.BUTTON}>
|
|
189
196
|
`;
|
|
@@ -201,10 +208,10 @@ class _ extends I {
|
|
|
201
208
|
* @param param0
|
|
202
209
|
* @returns It returns a button with an icon.
|
|
203
210
|
*/
|
|
204
|
-
_GuIconButton({ name: e, icon: t, className:
|
|
211
|
+
_GuIconButton({ name: e, icon: t, className: o = "" }) {
|
|
205
212
|
return `
|
|
206
213
|
<${n.BUTTON}
|
|
207
|
-
class="${
|
|
214
|
+
class="${o}"
|
|
208
215
|
${$.BUTTON.name}="${e}"
|
|
209
216
|
${$.BUTTON.icon}="${t}">
|
|
210
217
|
</${n.BUTTON}>
|
|
@@ -232,19 +239,19 @@ class _ extends I {
|
|
|
232
239
|
* @returns HTML string for the orderable control
|
|
233
240
|
*/
|
|
234
241
|
_GuOrderable(e, t) {
|
|
235
|
-
let
|
|
236
|
-
t.forEach((
|
|
237
|
-
const
|
|
238
|
-
|
|
239
|
-
<${n.ORDERABLE_ITEM} ${
|
|
240
|
-
${
|
|
242
|
+
let o = "";
|
|
243
|
+
t.forEach((s) => {
|
|
244
|
+
const r = $.ORDERABLE_ITEM && "name" in $.ORDERABLE_ITEM ? $.ORDERABLE_ITEM.name : "name";
|
|
245
|
+
o += `
|
|
246
|
+
<${n.ORDERABLE_ITEM} ${r}="${s.key}">
|
|
247
|
+
${s.content}
|
|
241
248
|
</${n.ORDERABLE_ITEM}>
|
|
242
249
|
`;
|
|
243
250
|
});
|
|
244
|
-
const
|
|
251
|
+
const a = $.ORDERABLE && "name" in $.ORDERABLE ? $.ORDERABLE.name : "name";
|
|
245
252
|
return `
|
|
246
|
-
<${n.ORDERABLE} ${
|
|
247
|
-
${
|
|
253
|
+
<${n.ORDERABLE} ${a}="${e}">
|
|
254
|
+
${o}
|
|
248
255
|
</${n.ORDERABLE}>
|
|
249
256
|
`;
|
|
250
257
|
}
|
|
@@ -285,16 +292,16 @@ class _ extends I {
|
|
|
285
292
|
`;
|
|
286
293
|
}
|
|
287
294
|
_GuRadioButtons(e, t) {
|
|
288
|
-
const
|
|
295
|
+
const o = t.map((a) => `
|
|
289
296
|
<${n.RADIO_ITEM}
|
|
290
|
-
${$.RADIO_ITEM.text}="${
|
|
291
|
-
${$.RADIO_ITEM.value}="${
|
|
297
|
+
${$.RADIO_ITEM.text}="${a.text}"
|
|
298
|
+
${$.RADIO_ITEM.value}="${a.value}">
|
|
292
299
|
</${n.RADIO_ITEM}>
|
|
293
300
|
`).join("");
|
|
294
301
|
return `
|
|
295
302
|
<${n.RADIO_BUTTONS}
|
|
296
303
|
${$.RADIO_BUTTONS.name}="${e}">
|
|
297
|
-
${
|
|
304
|
+
${o}
|
|
298
305
|
</${n.RADIO_BUTTONS}>
|
|
299
306
|
`;
|
|
300
307
|
}
|
package/dist/guido.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-b8f24f34] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-baf7a5dd]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-
|
|
1
|
+
@charset "UTF-8";.auth-error-modal[data-v-b4d7ae51]{position:relative;z-index:145}.gap-16[data-v-5553d071],.gap-16[data-v-0e1b0c54]{gap:16px}[data-v-b8f24f34] .in-button-v2__wrapper{line-height:0}[data-v-22226124] .in-segments-wrapper__button_selected,[data-v-22226124] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb;color:#0010ac;border-color:#0010ac}[data-v-2cb418af] .in-progress-wrapper__progress p span:last-child{display:none!important}[data-v-2cb418af] .in-progress-description-status{display:none!important}.view-options-wrapper[data-v-87033101]{position:relative;display:inline-block}.new-tag[data-v-87033101]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-87033101] .guido__view-option-selection-desktop svg,[data-v-87033101] .guido__view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-87033101] .in-segments-wrapper__button_selected,[data-v-87033101] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-87033101] .in-tooltip-wrapper-v2__icon{cursor:pointer}.editor-toolbar[data-v-173c3a40]{gap:4px}.version-history-item[data-v-ee4b9c3f]{flex-basis:200px}.version-history[data-v-fad98586]{gap:8px}.version-history__toolbar[data-v-fad98586]{gap:4px}.view-options-wrapper[data-v-6ebabfe4]{position:relative;display:inline-block}.new-tag[data-v-6ebabfe4]{position:absolute;top:-8px;right:-16px;z-index:10}[data-v-6ebabfe4] .guido__verion-history-view-option-selection-desktop svg,[data-v-6ebabfe4] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-6ebabfe4] .in-segments-wrapper__button_selected,[data-v-6ebabfe4] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}[data-v-6ebabfe4] .in-tooltip-wrapper-v2__icon{cursor:pointer}.auto-save-toggle[data-v-2c964af4]{position:relative}.auto-save-toggle__info-box[data-v-2c964af4]{position:absolute;top:100%;left:0;z-index:10;width:280px}.editor-actions[data-v-baf7a5dd]{gap:4px}.header-wrapper[data-v-d11dd577]{min-width:1000px}.guido-loading__wrapper[data-v-07c4b2d8]{height:100%;top:75px!important;bottom:0!important}.validation-error-list[data-v-e48cebe9]{gap:16px}.validation-error-row[data-v-e48cebe9]{gap:8px;padding:24px;border:1px solid #E1E1E1;border-radius:8px}.validation-error-row__icon[data-v-e48cebe9]{flex-shrink:0;font-size:24px;line-height:0}.validation-error-row__text[data-v-e48cebe9]{font-size:13px;line-height:16px;color:#292929;word-break:break-word}.guido-editor__wrapper[data-v-49dc1b30]{--ribbon-offset: 0px;position:relative;width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__container[data-v-49dc1b30]{width:100%;height:calc(100vh - 128px - var(--ribbon-offset))}.guido-editor__no-header[data-v-49dc1b30]{height:calc(100vh - 75px - var(--ribbon-offset))}[data-v-293f1c47] .in-breadcrumb-wrapper__links{cursor:pointer}.templates-wrapper[data-v-eaf8e461]{gap:16px;grid-template-columns:repeat(3,1fr)}.templates-wrapper .template-wrapper[data-v-eaf8e461]{cursor:pointer}.templates-wrapper .template-wrapper .template-container[data-v-eaf8e461]{height:274px;padding:2px;transition:none}.templates-wrapper .template-wrapper .template-container.selected[data-v-eaf8e461]{padding:1px}.templates-wrapper .template-wrapper .template-container .thumbnail[data-v-eaf8e461]{object-fit:cover;transform:scale(1)}[data-v-b9a93c6e] .guido__verion-history-view-option-selection-desktop svg,[data-v-b9a93c6e] .guido__verion-history-view-option-selection-mobile svg{margin:0 0 0 2px}[data-v-b9a93c6e] .in-segments-wrapper__button_selected,[data-v-b9a93c6e] .in-segments-wrapper__button_selected:hover{background-color:#dae1fb}.error-list[data-v-c3fd5d4b]{gap:16px}.desktop-browser-header[data-v-d86c5af5]{height:79px;min-height:79px}.desktop-browser-header__left[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:378px}.desktop-browser-header__center[data-v-d86c5af5]{height:79px;background-repeat:repeat-x;background-size:auto 100%;background-position:left top}.desktop-browser-header__right[data-v-d86c5af5]{-webkit-user-drag:none;height:79px;width:112px}.desktop-preview[data-v-cf946232]{min-width:602px;height:70vh;min-height:583px;border-radius:10px}.desktop-preview iframe[data-v-cf946232]{min-height:504px}.iframe-wrapper[data-v-f255b2bb]{width:258px}.iframe-scaled[data-v-f255b2bb]{width:320px;height:124.0310077519%;transform:scale(.80625);transform-origin:top left}.cropped-text[data-v-eb3d05d7]{width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-preview-wrapper__phone[data-v-3f472f96]{width:282px}.mobile-preview-wrapper__phone img[data-v-3f472f96]{object-fit:cover;border-radius:44px}.mobile-preview-wrapper__content[data-v-3f472f96]{width:258px;height:450px;left:12px}[data-v-6bcaca8a] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-f16f20f8] .vueperslides__bullets{pointer-events:none!important}[data-v-f16f20f8] .vueperslides__parallax-wrapper{padding-bottom:110px!important}[data-v-bb3cca55] .vueperslides__bullets{pointer-events:none!important}[data-v-bb3cca55] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-19d8cb42] .vueperslides__bullets,[data-v-ec2027ff] .vueperslides__bullets,[data-v-b09e80c4] .vueperslides__bullets{pointer-events:none!important}[data-v-b09e80c4] .vueperslides__parallax-wrapper{height:110px!important;padding-bottom:110px!important}[data-v-9bdef600] .vueperslides__parallax-wrapper{padding-bottom:110px!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd]{width:100%;max-width:none}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-skeleton{width:100%!important}.assign-strategy-drawer-content .assign-strategy-select[data-v-6ce48dfd] .in-dropdown-box__container{width:413px}.assign-strategy-drawer .spaced-dot-sep{background-image:linear-gradient(90deg,#91949f 20%,#fff0 0);background-position:center bottom;background-repeat:repeat-x;background-size:5px 1px}.assign-strategy-drawer .spaced-dot-sep--top{background-position:center top}.assign-strategy-drawer .spaced-dot-sep--fc-n:first-child{background:none}.legacy-strategy-updated-modal[data-v-da2225a1]{position:relative;z-index:145}
|
package/dist/package.json.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const o = "3.23.0-beta.
|
|
1
|
+
const o = "3.23.0-beta.9f6bfbf", s = { stripo: { version: "2.81.1" } }, t = {
|
|
2
2
|
version: o,
|
|
3
3
|
guido: s
|
|
4
4
|
};
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
t as default,
|
|
7
7
|
s as guido,
|
|
8
8
|
o as version
|
|
9
9
|
};
|
|
@@ -414,6 +414,8 @@ export declare const FeaturesSchema: v.ObjectSchema<{
|
|
|
414
414
|
/** Allow persisting a template that still has validation errors (drawer "Save and Continue" soft-save). Host sets false for transactional + unsubscribe. */
|
|
415
415
|
readonly allowSaveWithErrors: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
416
416
|
readonly reusableRecommendationStrategy: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
417
|
+
/** Items block: Recommendation-style price formatting (root currency-* attrs, raw price tags). Released dark. */
|
|
418
|
+
readonly itemsPriceFormatting: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
417
419
|
}, undefined>;
|
|
418
420
|
/**
|
|
419
421
|
* Default block types available in Stripo
|
|
@@ -832,6 +834,8 @@ export declare const GuidoConfigSchema: v.ObjectSchema<{
|
|
|
832
834
|
/** Allow persisting a template that still has validation errors (drawer "Save and Continue" soft-save). Host sets false for transactional + unsubscribe. */
|
|
833
835
|
readonly allowSaveWithErrors: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
834
836
|
readonly reusableRecommendationStrategy: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
837
|
+
/** Items block: Recommendation-style price formatting (root currency-* attrs, raw price tags). Released dark. */
|
|
838
|
+
readonly itemsPriceFormatting: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
835
839
|
}, undefined>, {}>;
|
|
836
840
|
/** Block configuration */
|
|
837
841
|
readonly blocks: v.OptionalSchema<v.ObjectSchema<{
|
|
@@ -104,6 +104,7 @@ export declare const useConfig: () => {
|
|
|
104
104
|
linkTrackingIds: boolean;
|
|
105
105
|
allowSaveWithErrors: boolean;
|
|
106
106
|
reusableRecommendationStrategy: boolean;
|
|
107
|
+
itemsPriceFormatting: boolean;
|
|
107
108
|
};
|
|
108
109
|
blocks: {
|
|
109
110
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -243,6 +244,7 @@ export declare const useConfig: () => {
|
|
|
243
244
|
linkTrackingIds: boolean;
|
|
244
245
|
allowSaveWithErrors: boolean;
|
|
245
246
|
reusableRecommendationStrategy: boolean;
|
|
247
|
+
itemsPriceFormatting: boolean;
|
|
246
248
|
} | null>;
|
|
247
249
|
blocks: import("vue").ComputedRef<{
|
|
248
250
|
excludeDefaults: ("amp-accordion" | "amp-carousel" | "amp-form-controls" | "banner-block" | "button-block" | "html-block" | "image-block" | "menu-block" | "social-block" | "spacer-block" | "text-block" | "timer-block" | "video-block")[];
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import type { LegacyRecommendationConfig } from '@@/Types/config';
|
|
2
2
|
import { type PartnerScopeMigrationOptions } from './recommendationPartnerMigrator';
|
|
3
|
-
export
|
|
3
|
+
export interface MigrationFeatureFlags {
|
|
4
|
+
itemsPriceFormatting?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const migrate: (html: string, recommendationConfigs?: Record<string, LegacyRecommendationConfig>, partnerScope?: PartnerScopeMigrationOptions, features?: MigrationFeatureFlags) => Promise<string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function migrateItemsPriceFormat(html: string): string;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import { type LegacyVariable, type MappedComposition } from './types';
|
|
2
|
-
export declare function mapComposition(variables: LegacyVariable[] | undefined
|
|
2
|
+
export declare function mapComposition(variables: LegacyVariable[] | undefined, { oldPriceFirst }?: {
|
|
3
|
+
oldPriceFirst?: boolean;
|
|
4
|
+
}): MappedComposition;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { LegacyPaddingViewport, LegacyVariable } from './types';
|
|
1
2
|
export declare function extractTitleText(block: Element): string;
|
|
2
3
|
/**
|
|
3
4
|
* Fallback for legacy configs that carry no `p_recommendation_title` variable:
|
|
@@ -7,6 +8,31 @@ export declare function extractTitleText(block: Element): string;
|
|
|
7
8
|
* @returns True when the legacy block renders a visible title
|
|
8
9
|
*/
|
|
9
10
|
export declare function hasVisibleTitle(block: Element): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* A rendered title container with no text showed the user no title, whatever the config's `hidden` flag says.
|
|
13
|
+
* @param block - The legacy recommendation block element
|
|
14
|
+
* @returns True when the legacy block renders an empty title container
|
|
15
|
+
*/
|
|
16
|
+
export declare function hasEmptyTitle(block: Element): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Reads which price the legacy card renders first. Prices sharing a `positionIdx` are ordered by this.
|
|
19
|
+
* @param block - The legacy recommendation block element
|
|
20
|
+
* @returns True only when both prices render and the original price comes first
|
|
21
|
+
*/
|
|
22
|
+
export declare function isOldPriceFirst(block: Element): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Reads the legacy "Move to next line" state from the rendered card, for blocks whose config does not carry it.
|
|
25
|
+
* @param block - The legacy recommendation block element
|
|
26
|
+
* @returns True only when both prices render in separate rows and neither row is laid out inline (`table-cell`)
|
|
27
|
+
*/
|
|
28
|
+
export declare function isPriceOnNextLine(block: Element): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Legacy keeps the text color and the name's trim toggle in the rendered `<p>`, not in the config theme.
|
|
31
|
+
* @param variables - The legacy composition variables
|
|
32
|
+
* @param block - The legacy recommendation block element
|
|
33
|
+
* @returns The variables, with `textColor` / `textTrimming` filled from the rendered HTML where the theme lacks them
|
|
34
|
+
*/
|
|
35
|
+
export declare function withRenderedTextTheme(variables: LegacyVariable[] | undefined, block: Element): LegacyVariable[] | undefined;
|
|
10
36
|
/**
|
|
11
37
|
* Card background lives on either the block (`bgcolor`/`style`) or per-card
|
|
12
38
|
* cells (`.product-card`). Returns empty string when no background is set —
|
|
@@ -14,13 +40,16 @@ export declare function hasVisibleTitle(block: Element): boolean;
|
|
|
14
40
|
*/
|
|
15
41
|
export declare function extractCardBgColor(block: Element): string;
|
|
16
42
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
43
|
+
* `currencySettings` for a block whose legacy config has none: the code and symbol come from the block,
|
|
44
|
+
* the formatting from the legacy editor's defaults, which it rendered without reading the block's attributes.
|
|
45
|
+
*/
|
|
46
|
+
export declare function extractCurrencyFromBlock(block: Element): Record<string, string | number>;
|
|
47
|
+
/**
|
|
48
|
+
* Block padding as the legacy product row renders it, for configs whose theme has no `blockPadding`.
|
|
49
|
+
* @param block - The legacy recommendation block element
|
|
50
|
+
* @returns The row's `es-p{n}{side}` padding, or undefined when the block has no product row
|
|
22
51
|
*/
|
|
23
|
-
export declare function
|
|
52
|
+
export declare function extractRenderedBlockPadding(block: Element): LegacyPaddingViewport | undefined;
|
|
24
53
|
/**
|
|
25
54
|
* True when a PM has manually opted the legacy block out of content
|
|
26
55
|
* regeneration by adding the `ins-skip-compile` class. Detected before rebuild
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MappedComposition } from './types';
|
|
1
|
+
import type { MappedBlockPadding, MappedComposition } from './types';
|
|
2
2
|
import type { RecommendationNodeConfig } from '@@/Extensions/Blocks/Recommendation/types/nodeConfig';
|
|
3
3
|
export declare function buildBlockHtml(params: {
|
|
4
4
|
nodeConfig: RecommendationNodeConfig;
|
|
@@ -16,4 +16,6 @@ export declare function buildBlockHtml(params: {
|
|
|
16
16
|
preserveInnerHtml?: string;
|
|
17
17
|
/** Adds the `ins-skip-compile` opt-out class to the migrated block. */
|
|
18
18
|
skipCompile?: boolean;
|
|
19
|
+
/** Legacy desktop block padding; without it the block keeps the default `es-p20`. */
|
|
20
|
+
blockPadding?: MappedBlockPadding;
|
|
19
21
|
}): string;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type { LegacyButtonTheme, LegacyImageTheme, LegacyTextTheme, MappedButtonStyle, MappedImageStyle, MappedTextStyle } from './types';
|
|
1
|
+
import type { LegacyButtonTheme, LegacyImageTheme, LegacyPaddingViewport, LegacyTextTheme, MappedBlockPadding, MappedButtonStyle, MappedImageStyle, MappedTextStyle } from './types';
|
|
2
2
|
export declare function mapTextTheme(theme: LegacyTextTheme | undefined): MappedTextStyle;
|
|
3
3
|
export declare function mapButtonTheme(theme: LegacyButtonTheme | undefined): MappedButtonStyle;
|
|
4
4
|
export declare function mapImageTheme(theme: LegacyImageTheme | undefined): MappedImageStyle;
|
|
5
|
+
/** Stripo `es-p{n}{side}` classes where a step class exists, inline `padding-{side}` otherwise; 0 needs neither. */
|
|
6
|
+
export declare function mapBlockPadding(padding: LegacyPaddingViewport | undefined): MappedBlockPadding | undefined;
|
|
5
7
|
export declare function appendStyle(existing: string | undefined, addition: string | undefined): string;
|
|
@@ -30,7 +30,9 @@ export interface LegacyPadding {
|
|
|
30
30
|
/** Border-radius shape — observed in two flavours: shorthand or per-corner. */
|
|
31
31
|
export interface LegacyBorderRadius {
|
|
32
32
|
/** Single shorthand value (e.g. `radius: 4`). */
|
|
33
|
-
radius?: number;
|
|
33
|
+
radius?: number | string;
|
|
34
|
+
/** Shorthand the legacy button theme stores under `theme.borderRadius` (e.g. `borderRadius: "4"`). */
|
|
35
|
+
borderRadius?: number | string;
|
|
34
36
|
/** Per-corner: top-left / top-right / bottom-right / bottom-left (in px). */
|
|
35
37
|
lt?: number;
|
|
36
38
|
rt?: number;
|
|
@@ -96,6 +98,7 @@ export interface LegacyButtonTheme {
|
|
|
96
98
|
color?: LegacySides<string>;
|
|
97
99
|
};
|
|
98
100
|
buttonBorderRadius?: LegacyBorderRadius;
|
|
101
|
+
borderRadius?: LegacyBorderRadius;
|
|
99
102
|
buttonAlign?: {
|
|
100
103
|
align?: string;
|
|
101
104
|
};
|
|
@@ -167,6 +170,13 @@ export interface MappedTextStyle {
|
|
|
167
170
|
/** True if `textTrimming: true` in theme. */
|
|
168
171
|
textTrimming: boolean;
|
|
169
172
|
}
|
|
173
|
+
/** Resolved block wrapper padding. */
|
|
174
|
+
export interface MappedBlockPadding {
|
|
175
|
+
/** Space-separated `es-p{n}{side}` classes. */
|
|
176
|
+
classes: string;
|
|
177
|
+
/** Inline `padding-{side}` declarations for values without a step class. */
|
|
178
|
+
style: string;
|
|
179
|
+
}
|
|
170
180
|
/** Resolved button styles. */
|
|
171
181
|
export interface MappedButtonStyle {
|
|
172
182
|
/** Inline CSS for outer `<td>` (external padding). */
|
|
@@ -71,15 +71,12 @@ export declare class ItemsBlock extends Block {
|
|
|
71
71
|
*/
|
|
72
72
|
private _resolveInstanceId;
|
|
73
73
|
/**
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
* Config is the source of truth — never derive from visible text.
|
|
77
|
-
*
|
|
78
|
-
* Authority split lives in `currencyAttrTargets` (SD-147588) — position only when a location
|
|
79
|
-
* is recorded, symbol only when customized — so this heal and the module-drop repair can't drift.
|
|
80
|
-
*
|
|
81
|
-
* Returns true only when an attr actually changed, so the caller can skip an empty apply that
|
|
82
|
-
* would otherwise re-trigger onDocumentChanged and loop.
|
|
74
|
+
* Single self-heal slot: the flag only decides whether a legacy root is converted; a root
|
|
75
|
+
* already in the new format is reconciled from config regardless. Returns whether anything was queued.
|
|
83
76
|
*/
|
|
84
77
|
private _reconcileCurrencyDomAttributes;
|
|
78
|
+
/** Legacy `<p>` contract via `currencyAttrTargets`: position when recorded, symbol only when custom. */
|
|
79
|
+
private _reconcileLegacyCurrencyAttributes;
|
|
80
|
+
private _priceParagraphs;
|
|
81
|
+
private _isPriceFormattingEnabled;
|
|
85
82
|
}
|
|
@@ -41,3 +41,35 @@ export declare function currencyAttrTargets(config: {
|
|
|
41
41
|
priceCurrencyLocation?: string;
|
|
42
42
|
priceCurrencySymbol?: string;
|
|
43
43
|
}): CurrencyAttrTargets;
|
|
44
|
+
export declare const ITEMS_PRICE_FORMAT_ATTR: {
|
|
45
|
+
readonly SYMBOL: "currency-symbol";
|
|
46
|
+
readonly ALIGNMENT: "currency-alignment";
|
|
47
|
+
readonly THOUSAND_SEPARATOR: "currency-thousand-separator";
|
|
48
|
+
readonly DECIMAL_SEPARATOR: "currency-decimal-separator";
|
|
49
|
+
readonly DECIMAL_COUNT: "currency-decimal-count";
|
|
50
|
+
readonly SINGLE_PRICE: "data-single_price";
|
|
51
|
+
};
|
|
52
|
+
/** Price `<p>` attrs of the legacy model; a new-format block carries none of them. */
|
|
53
|
+
export declare const LEGACY_PRICE_PARAGRAPH_ATTRS: readonly ["data-formated", "data-single_price", "data-curency", "data-currency_symbol"];
|
|
54
|
+
export declare const PRICE_FORMAT_CONFIG_KEYS: readonly ["priceThousandSeparator", "priceDecimalSeparator", "priceDecimalCount"];
|
|
55
|
+
export interface ItemsPriceFormat {
|
|
56
|
+
thousandSeparator: string;
|
|
57
|
+
decimalSeparator: string;
|
|
58
|
+
decimalCount: number;
|
|
59
|
+
}
|
|
60
|
+
/** en-US, the shape the legacy pre-formatted price tags produced. */
|
|
61
|
+
export declare const DEFAULT_ITEMS_PRICE_FORMAT: ItemsPriceFormat;
|
|
62
|
+
export interface PriceFormatConfigSlice {
|
|
63
|
+
priceThousandSeparator?: string;
|
|
64
|
+
priceDecimalSeparator?: string;
|
|
65
|
+
priceDecimalCount?: number;
|
|
66
|
+
}
|
|
67
|
+
export declare function normalizeDecimalCount(value: unknown): number;
|
|
68
|
+
/** Config → format, defaulting each missing key independently. */
|
|
69
|
+
export declare function priceFormatFromConfig(config: PriceFormatConfigSlice | null | undefined): ItemsPriceFormat;
|
|
70
|
+
export declare function isNewPriceFormatConfig(config: PriceFormatConfigSlice | null | undefined): boolean;
|
|
71
|
+
export interface AttributeReader {
|
|
72
|
+
getAttribute(name: string): string | null | undefined;
|
|
73
|
+
}
|
|
74
|
+
/** The export/control switch: a root carrying `currency-decimal-count` is in the new format. */
|
|
75
|
+
export declare function isNewPriceFormatRoot(root: AttributeReader | null | undefined): boolean;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ControlApi, ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
2
|
+
import { CommonControl } from '../../common-control';
|
|
3
|
+
import { ItemsBlockControlId } from '../enums/controlEnums';
|
|
4
|
+
import { type ItemsBlockConfig } from '../utils/nodeConfigUtils';
|
|
5
|
+
export declare const CONTROL_BLOCK_ID = ItemsBlockControlId.PRICE_FORMAT;
|
|
6
|
+
export declare function isNewPriceFormatBlock(currentNode: ImmutableHtmlNode | undefined): boolean;
|
|
7
|
+
/** One apply: the config patch, the root attrs the export reads, and both price texts re-rendered. */
|
|
8
|
+
export declare function applyPriceFormatChange(currentNode: ImmutableHtmlNode | undefined, api: ControlApi, patch: Partial<ItemsBlockConfig>, description: string): void;
|
|
9
|
+
export declare class ItemsBlockPriceFormatControl extends CommonControl {
|
|
10
|
+
private lastWritten;
|
|
11
|
+
getId(): string;
|
|
12
|
+
getTemplate(): string;
|
|
13
|
+
onRender(): void;
|
|
14
|
+
onTemplateNodeUpdated(node: ImmutableHtmlNode): void;
|
|
15
|
+
onDestroy(): void;
|
|
16
|
+
_onThousandSeparatorChange(value: string): void;
|
|
17
|
+
_onDecimalSeparatorChange(value: string): void;
|
|
18
|
+
_onDecimalCountChange(value: string): void;
|
|
19
|
+
private _currentFormat;
|
|
20
|
+
private _write;
|
|
21
|
+
private _formValues;
|
|
22
|
+
private _getSelectRow;
|
|
23
|
+
}
|
|
@@ -35,6 +35,7 @@ export declare class ItemsBlockControl extends CommonControl {
|
|
|
35
35
|
_reFillTemplate(itemsType?: ProductType): void;
|
|
36
36
|
_recalculateTrimming(): void;
|
|
37
37
|
private _getParagraphFromBlock;
|
|
38
|
+
private _replacePriceText;
|
|
38
39
|
private _escapeRegex;
|
|
39
40
|
private _removeCurrencySymbol;
|
|
40
41
|
private _replacePriceNumber;
|
|
@@ -46,6 +46,7 @@ export declare enum ItemsBlockControlId {
|
|
|
46
46
|
PRICE_CURRENCY_SYMBOL = "items-block-price-currency-symbol-control",
|
|
47
47
|
PRICE_CURRENCY_LOCATION = "items-block-price-currency-location-control",
|
|
48
48
|
PRICE_ORIENTATION = "items-block-price-orientation-control",
|
|
49
|
+
PRICE_FORMAT = "items-block-price-format-control",
|
|
49
50
|
NAME_ALIGN = "items-block-name-align-control",
|
|
50
51
|
NAME_COLOR = "items-block-name-color-control",
|
|
51
52
|
NAME_SIZE = "items-block-name-size-control",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ItemsPriceFormat } from './constants/currency';
|
|
1
2
|
import { type ItemsBlockConfig } from './utils/nodeConfigUtils';
|
|
2
3
|
declare const migrationTemplate = "ADD YOUR MIGRATION HERE";
|
|
3
4
|
type ProductType = 'CART_ITEMS' | 'BROWSED_ITEMS' | 'PURCHASED_ITEMS';
|
|
@@ -36,6 +37,8 @@ type TemplateParameters = {
|
|
|
36
37
|
quantityStyles?: string;
|
|
37
38
|
/** Price orientation within the card ('vertical' = stacked, 'horizontal' = side-by-side) */
|
|
38
39
|
priceOrientation?: PriceOrientationType;
|
|
40
|
+
/** New price model (itemsPriceFormatting): root attrs + raw dummy amounts; absent = legacy output. */
|
|
41
|
+
priceFormat?: ItemsPriceFormat;
|
|
39
42
|
};
|
|
40
43
|
/**
|
|
41
44
|
* Applies price orientation styles to the generated HTML template.
|
|
@@ -67,5 +70,5 @@ export declare const applyPriceOrientationStyles: (html: string, layoutOrientati
|
|
|
67
70
|
* @param params.formattedPrice - Whether to use formatted price display
|
|
68
71
|
* @returns HTML template string for the Items Block
|
|
69
72
|
*/
|
|
70
|
-
export declare function getDefaultTemplate({ orientation, itemsType, itemId, currencySymbol, currencyLocation, migrate, formattedPrice, configBlockAttributes, nodeConfig, nameStyles, buttonStyles, priceStyles, originalPriceStyles, quantityStyles, priceOrientation, }: TemplateParameters): string;
|
|
73
|
+
export declare function getDefaultTemplate({ orientation, itemsType, itemId, currencySymbol, currencyLocation, migrate, formattedPrice, configBlockAttributes, nodeConfig, nameStyles, buttonStyles, priceStyles, originalPriceStyles, quantityStyles, priceOrientation, priceFormat, }: TemplateParameters): string;
|
|
71
74
|
export default migrationTemplate;
|
|
@@ -18,6 +18,9 @@ export interface ItemsBlockConfig {
|
|
|
18
18
|
priceCurrencySymbol: string;
|
|
19
19
|
priceCurrencyLocation: string;
|
|
20
20
|
priceOrientation: 'vertical' | 'horizontal';
|
|
21
|
+
priceThousandSeparator?: string;
|
|
22
|
+
priceDecimalSeparator?: string;
|
|
23
|
+
priceDecimalCount?: number;
|
|
21
24
|
quantityControlEnabled: boolean;
|
|
22
25
|
buttonLink: string;
|
|
23
26
|
imageLink: string;
|