@useinsider/guido 2.1.0-beta.bc18abc → 2.1.0-beta.da327fa
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/composables/useActionsApi.js +15 -13
- package/dist/config/migrator/itemsBlockMigrator.js +140 -123
- package/dist/extensions/Blocks/Items/block.js +19 -28
- package/dist/extensions/Blocks/Items/controls/button/link.js +19 -31
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +124 -85
- package/dist/extensions/Blocks/Items/controls/image/link.js +19 -31
- package/dist/extensions/Blocks/Items/controls/name/trimming.js +28 -40
- package/dist/extensions/Blocks/Items/controls/price/currencyLocation.js +35 -47
- package/dist/extensions/Blocks/Items/controls/price/currencySymbol.js +49 -54
- package/dist/extensions/Blocks/Items/controls/price/formattedPrice.js +42 -51
- package/dist/extensions/Blocks/Items/controls/price/hideDiscount.js +23 -36
- package/dist/extensions/Blocks/Items/controls/price/priceOrientation.js +45 -57
- package/dist/extensions/Blocks/Items/controls/price/singlePrice.js +42 -60
- package/dist/extensions/Blocks/Items/controls/settingsControl.js +189 -196
- package/dist/extensions/Blocks/Items/enums/settingsEnums.js +0 -2
- package/dist/extensions/Blocks/Items/extension.js +8 -9
- package/dist/extensions/Blocks/Items/settingsPanel.js +10 -15
- package/dist/extensions/Blocks/Items/template.js +181 -175
- package/dist/extensions/Blocks/Items/utils/nodeConfigUtils.js +65 -65
- package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +3 -3
- package/dist/extensions/Blocks/common-control.js +91 -92
- package/dist/src/extensions/Blocks/Items/block.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/button/link.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/cardComposition.d.ts +5 -5
- package/dist/src/extensions/Blocks/Items/controls/image/link.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/name/trimming.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/price/currencyLocation.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/price/currencySymbol.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/price/formattedPrice.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/price/hideDiscount.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/price/priceOrientation.d.ts +0 -1
- package/dist/src/extensions/Blocks/Items/controls/price/singlePrice.d.ts +0 -5
- package/dist/src/extensions/Blocks/Items/controls/settingsControl.d.ts +10 -12
- package/dist/src/extensions/Blocks/Items/utils/nodeConfigUtils.d.ts +2 -1
- package/dist/src/extensions/Blocks/common-control.d.ts +4 -5
- package/package.json +1 -1
- package/dist/extensions/Blocks/Items/store/items-block.js +0 -79
- package/dist/src/extensions/Blocks/Items/store/items-block.d.ts +0 -45
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
import { ModificationDescription as b } from "../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
-
import { DefaultConfigValues as
|
|
3
|
-
function
|
|
2
|
+
import { DefaultConfigValues as o, SETTINGS_ENUMS as n, ItemInCartOptions as g } from "../enums/settingsEnums.js";
|
|
3
|
+
function _() {
|
|
4
4
|
return String(Date.now() + Math.floor(Math.random() * 1e3));
|
|
5
5
|
}
|
|
6
|
-
const E = (
|
|
6
|
+
const E = (r) => r.replace(/\$/g, "$$$$");
|
|
7
7
|
function S() {
|
|
8
8
|
return {
|
|
9
9
|
initialized: !0,
|
|
10
|
-
blockInstanceId:
|
|
10
|
+
blockInstanceId: _(),
|
|
11
11
|
source: n.ITEMS_TYPE.CART_ITEMS,
|
|
12
12
|
type: n.ITEMS_TYPE.CART_ITEMS,
|
|
13
|
-
itemsSelectValue:
|
|
13
|
+
itemsSelectValue: o.cartItemsSelectControlValue,
|
|
14
14
|
orientation: n.ORIENTATION.VERTICAL,
|
|
15
|
-
nameTrimming:
|
|
16
|
-
priceHideDiscount:
|
|
17
|
-
priceFormatted:
|
|
15
|
+
nameTrimming: o.productNameTrimmingControlValue === "1",
|
|
16
|
+
priceHideDiscount: o.productPriceHideDiscountControlValue === "1",
|
|
17
|
+
priceFormatted: o.productPriceFormattedControlValue === "1",
|
|
18
18
|
priceSinglePrice: !1,
|
|
19
|
-
priceCurrencySymbol:
|
|
20
|
-
priceCurrencyLocation:
|
|
19
|
+
priceCurrencySymbol: o.productPriceCurrencySymbolControlValue,
|
|
20
|
+
priceCurrencyLocation: o.productPriceCurrencyLocationControlValue,
|
|
21
21
|
priceOrientation: "horizontal",
|
|
22
|
-
quantityControlEnabled:
|
|
23
|
-
buttonLink:
|
|
24
|
-
imageLink:
|
|
22
|
+
quantityControlEnabled: o.productQuantityControlEnabled === "1",
|
|
23
|
+
buttonLink: o.productButtonLinkControlValue,
|
|
24
|
+
imageLink: o.productImageLinkControlValue,
|
|
25
25
|
buttonLabel: "Buy",
|
|
26
26
|
buttonFullWidth: !0,
|
|
27
27
|
// Default to full width (es-fw class)
|
|
28
|
-
imageVisible:
|
|
29
|
-
nameVisible:
|
|
30
|
-
quantityVisible:
|
|
31
|
-
priceVisible:
|
|
32
|
-
originalPriceVisible:
|
|
33
|
-
buttonVisible:
|
|
28
|
+
imageVisible: o.productImageVisible === "1",
|
|
29
|
+
nameVisible: o.productNameVisible === "1",
|
|
30
|
+
quantityVisible: o.productQuantityVisible === "1",
|
|
31
|
+
priceVisible: o.productPriceVisible === "1",
|
|
32
|
+
originalPriceVisible: o.productOriginalPriceVisible === "1",
|
|
33
|
+
buttonVisible: o.productButtonVisible === "1"
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
if (!
|
|
36
|
+
function p(r) {
|
|
37
|
+
if (!r)
|
|
38
38
|
return null;
|
|
39
|
-
const t =
|
|
40
|
-
return t ||
|
|
39
|
+
const t = r.closest(".items-block-v2");
|
|
40
|
+
return t || r.closest(".esd-cart-items-block");
|
|
41
41
|
}
|
|
42
|
-
function m(
|
|
43
|
-
return
|
|
42
|
+
function m(r) {
|
|
43
|
+
return r ? {
|
|
44
44
|
CartItems: n.ITEMS_TYPE.CART_ITEMS,
|
|
45
45
|
BrowsedItems: n.ITEMS_TYPE.BROWSED_ITEMS,
|
|
46
46
|
PurchasedItems: n.ITEMS_TYPE.PURCHASED_ITEMS,
|
|
@@ -48,34 +48,34 @@ function m(o) {
|
|
|
48
48
|
CART_ITEMS: n.ITEMS_TYPE.CART_ITEMS,
|
|
49
49
|
BROWSED_ITEMS: n.ITEMS_TYPE.BROWSED_ITEMS,
|
|
50
50
|
PURCHASED_ITEMS: n.ITEMS_TYPE.PURCHASED_ITEMS
|
|
51
|
-
}[
|
|
51
|
+
}[r] || n.ITEMS_TYPE.CART_ITEMS : n.ITEMS_TYPE.CART_ITEMS;
|
|
52
52
|
}
|
|
53
|
-
function I(
|
|
54
|
-
if (!
|
|
55
|
-
return
|
|
56
|
-
if (
|
|
57
|
-
return
|
|
58
|
-
if (/^\d+$/.test(
|
|
59
|
-
const e = parseInt(
|
|
60
|
-
if (
|
|
61
|
-
return
|
|
53
|
+
function I(r, t) {
|
|
54
|
+
if (!r)
|
|
55
|
+
return o.cartItemsSelectControlValue;
|
|
56
|
+
if (r.includes("{{"))
|
|
57
|
+
return r;
|
|
58
|
+
if (/^\d+$/.test(r)) {
|
|
59
|
+
const e = parseInt(r) - 1, i = g[t];
|
|
60
|
+
if (i && i[e])
|
|
61
|
+
return i[e].value;
|
|
62
62
|
}
|
|
63
|
-
return
|
|
63
|
+
return o.cartItemsSelectControlValue;
|
|
64
64
|
}
|
|
65
|
-
function C(
|
|
66
|
-
const t =
|
|
65
|
+
function C(r) {
|
|
66
|
+
const t = r.querySelector("esd-config-block");
|
|
67
67
|
if (!t)
|
|
68
68
|
return null;
|
|
69
|
-
const e = (c,
|
|
69
|
+
const e = (c, s) => c == null ? s : c === "1" || c === "true", i = (c, s) => c || s, u = t.getAttribute("data-type"), a = m(u), d = t.getAttribute("data-cart_items_select_control_value"), l = I(d, a);
|
|
70
70
|
return {
|
|
71
71
|
initialized: e(t.getAttribute("data-initialized"), !1),
|
|
72
|
-
blockInstanceId:
|
|
72
|
+
blockInstanceId: i(
|
|
73
73
|
t.getAttribute("data-block-instance-id"),
|
|
74
|
-
|
|
74
|
+
_()
|
|
75
75
|
),
|
|
76
|
-
source:
|
|
77
|
-
type:
|
|
78
|
-
itemsSelectValue:
|
|
76
|
+
source: a,
|
|
77
|
+
type: a,
|
|
78
|
+
itemsSelectValue: l,
|
|
79
79
|
orientation: t.getAttribute("data-card_orientation_control_value") || n.ORIENTATION.VERTICAL,
|
|
80
80
|
nameTrimming: e(
|
|
81
81
|
t.getAttribute("data-product_name_control_trim"),
|
|
@@ -93,28 +93,28 @@ function C(o) {
|
|
|
93
93
|
t.getAttribute("data-product_price_control_single_price"),
|
|
94
94
|
!1
|
|
95
95
|
),
|
|
96
|
-
priceCurrencySymbol:
|
|
97
|
-
t.getAttribute("data-
|
|
98
|
-
|
|
96
|
+
priceCurrencySymbol: i(
|
|
97
|
+
t.getAttribute("data-product_price_control_currency_symbol"),
|
|
98
|
+
o.productPriceCurrencySymbolControlValue
|
|
99
99
|
),
|
|
100
|
-
priceCurrencyLocation:
|
|
100
|
+
priceCurrencyLocation: i(
|
|
101
101
|
t.getAttribute("data-product_price_currency_location"),
|
|
102
|
-
|
|
102
|
+
o.productPriceCurrencyLocationControlValue
|
|
103
103
|
),
|
|
104
104
|
priceOrientation: t.getAttribute("data-product_original_price_control_orientation") || "horizontal",
|
|
105
105
|
quantityControlEnabled: e(
|
|
106
106
|
t.getAttribute("data-product_quantity_control_enabled"),
|
|
107
107
|
!0
|
|
108
108
|
),
|
|
109
|
-
buttonLink:
|
|
109
|
+
buttonLink: i(
|
|
110
110
|
t.getAttribute("data-product_button_link"),
|
|
111
|
-
|
|
111
|
+
o.productButtonLinkControlValue
|
|
112
112
|
),
|
|
113
|
-
imageLink:
|
|
113
|
+
imageLink: i(
|
|
114
114
|
t.getAttribute("data-product_image_link"),
|
|
115
|
-
|
|
115
|
+
o.productImageLinkControlValue
|
|
116
116
|
),
|
|
117
|
-
buttonLabel:
|
|
117
|
+
buttonLabel: i(
|
|
118
118
|
t.getAttribute("data-product_button_control_label"),
|
|
119
119
|
"Buy"
|
|
120
120
|
),
|
|
@@ -149,28 +149,28 @@ function C(o) {
|
|
|
149
149
|
)
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
|
-
function y(
|
|
153
|
-
const t =
|
|
152
|
+
function y(r) {
|
|
153
|
+
const t = p(r);
|
|
154
154
|
if (!t)
|
|
155
155
|
return null;
|
|
156
156
|
const e = t.getNodeConfig();
|
|
157
157
|
if (e && e.initialized)
|
|
158
158
|
return e;
|
|
159
|
-
const
|
|
160
|
-
return
|
|
159
|
+
const i = C(t);
|
|
160
|
+
return i || null;
|
|
161
161
|
}
|
|
162
|
-
function A(
|
|
163
|
-
const
|
|
164
|
-
if (!
|
|
162
|
+
function A(r, t, e, i) {
|
|
163
|
+
const u = p(r);
|
|
164
|
+
if (!u)
|
|
165
165
|
return;
|
|
166
|
-
const
|
|
167
|
-
|
|
166
|
+
const d = { ...u.getNodeConfig() || {}, ...e }, l = i ?? t.getDocumentModifier();
|
|
167
|
+
l.modifyHtml(u).setNodeConfig(d), i || l.apply(new b("Update Items block configuration"));
|
|
168
168
|
}
|
|
169
169
|
export {
|
|
170
170
|
E as escapeReplacement,
|
|
171
|
-
|
|
171
|
+
_ as generateBlockInstanceId,
|
|
172
172
|
S as getDefaultItemsBlockConfig,
|
|
173
173
|
y as getItemsBlockConfig,
|
|
174
|
-
|
|
174
|
+
p as getItemsBlockContainer,
|
|
175
175
|
A as setItemsBlockConfig
|
|
176
176
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function a(n) {
|
|
2
|
-
return "getInnerHTML" in n && typeof n.getInnerHTML == "function" ? n.getInnerHTML() : "innerHTML" in n ? n.innerHTML : "";
|
|
2
|
+
return "getInnerHTML" in n && typeof n.getInnerHTML == "function" ? n.getInnerHTML().trim() : "innerHTML" in n ? n.innerHTML : "";
|
|
3
3
|
}
|
|
4
|
-
function
|
|
4
|
+
function m(n, t) {
|
|
5
5
|
if (!n)
|
|
6
6
|
return t;
|
|
7
7
|
const r = a(n);
|
|
@@ -21,5 +21,5 @@ function H(n, t) {
|
|
|
21
21
|
return i.length > 0 ? i.join("") + t + s.join("") : t;
|
|
22
22
|
}
|
|
23
23
|
export {
|
|
24
|
-
|
|
24
|
+
m as preserveTextStyles
|
|
25
25
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var I = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var u = (T, r, e) =>
|
|
4
|
-
import { Control as
|
|
5
|
-
class _ extends
|
|
2
|
+
var O = (T, r, e) => r in T ? I(T, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : T[r] = e;
|
|
3
|
+
var u = (T, r, e) => O(T, typeof r != "symbol" ? r + "" : r, e);
|
|
4
|
+
import { Control as c, UIElementType as n, UEAttr as $ } from "../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
|
+
class _ extends c {
|
|
6
6
|
constructor() {
|
|
7
7
|
super(...arguments);
|
|
8
8
|
u(this, "currentNode");
|
|
@@ -33,101 +33,100 @@ class _ extends O {
|
|
|
33
33
|
const e = this.getItemsBlockContainer();
|
|
34
34
|
if (!e)
|
|
35
35
|
return null;
|
|
36
|
-
const
|
|
37
|
-
return
|
|
36
|
+
const t = e.getNodeConfig();
|
|
37
|
+
return t && typeof t.blockInstanceId == "string" ? t.blockInstanceId : null;
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
|
-
* Handles block instance change detection and
|
|
41
|
-
* This is a helper method for controls that need to
|
|
40
|
+
* Handles block instance change detection and UI updates.
|
|
41
|
+
* This is a helper method for controls that need to update UI when switching between block instances.
|
|
42
42
|
* Uses Stripo V2 nodeConfig API for block instance tracking.
|
|
43
|
-
* @param
|
|
44
|
-
* @param updateUI - Function to call to update the UI (called both on change and when same block)
|
|
43
|
+
* @param updateUI - Function to call to update the UI (called on every update)
|
|
45
44
|
* @returns true if block instance changed, false otherwise
|
|
46
45
|
*/
|
|
47
|
-
handleBlockInstanceChange(e
|
|
48
|
-
const
|
|
49
|
-
if (!
|
|
46
|
+
handleBlockInstanceChange(e) {
|
|
47
|
+
const t = this.getBlockInstanceId();
|
|
48
|
+
if (!t)
|
|
50
49
|
return !1;
|
|
51
|
-
const
|
|
52
|
-
return
|
|
50
|
+
const E = t !== this.lastBlockInstanceId;
|
|
51
|
+
return e(), E && (this.lastBlockInstanceId = t), E;
|
|
53
52
|
}
|
|
54
|
-
_GuLabel({ text: e, name:
|
|
53
|
+
_GuLabel({ text: e, name: t = "" }) {
|
|
55
54
|
return `
|
|
56
|
-
<${
|
|
55
|
+
<${n.LABEL}
|
|
57
56
|
${$.LABEL.text}="${e}"
|
|
58
|
-
${$.LABEL.name}="${
|
|
59
|
-
</${
|
|
57
|
+
${$.LABEL.name}="${t || `${e} Label`}">
|
|
58
|
+
</${n.LABEL}>
|
|
60
59
|
`;
|
|
61
60
|
}
|
|
62
61
|
_GuToggle(e) {
|
|
63
62
|
return `
|
|
64
|
-
<${
|
|
63
|
+
<${n.SWITCHER}
|
|
65
64
|
${$.SWITCHER.name}="${e}">
|
|
66
|
-
</${
|
|
65
|
+
</${n.SWITCHER}>
|
|
67
66
|
`;
|
|
68
67
|
}
|
|
69
|
-
_GuSelectItem({ text: e, value:
|
|
68
|
+
_GuSelectItem({ text: e, value: t }) {
|
|
70
69
|
return `
|
|
71
|
-
<${
|
|
70
|
+
<${n.SELECT_ITEM}
|
|
72
71
|
${$.SELECT_ITEM.text}="${e}"
|
|
73
|
-
${$.SELECT_ITEM.value}="${
|
|
74
|
-
</${
|
|
72
|
+
${$.SELECT_ITEM.value}="${t}">
|
|
73
|
+
</${n.SELECT_ITEM}>`;
|
|
75
74
|
}
|
|
76
|
-
_GuSelect({ name: e, placeholder:
|
|
75
|
+
_GuSelect({ name: e, placeholder: t, options: E, className: o = "es-180w" }) {
|
|
77
76
|
return `
|
|
78
|
-
<${
|
|
77
|
+
<${n.SELECTPICKER}
|
|
79
78
|
class="${o}"
|
|
80
79
|
${$.SELECTPICKER.name}="${e}"
|
|
81
|
-
${$.SELECTPICKER.placeholder}="${
|
|
80
|
+
${$.SELECTPICKER.placeholder}="${t}">
|
|
82
81
|
${E.map((a) => this._GuSelectItem(a)).join("")}
|
|
83
|
-
</${
|
|
82
|
+
</${n.SELECTPICKER}>
|
|
84
83
|
`;
|
|
85
84
|
}
|
|
86
|
-
_GuTextInput({ name: e, placeholder:
|
|
85
|
+
_GuTextInput({ name: e, placeholder: t, className: E = "", disabled: o = !1 }) {
|
|
87
86
|
return `
|
|
88
|
-
<${
|
|
87
|
+
<${n.TEXT}
|
|
89
88
|
class=${E}
|
|
90
89
|
${$.TEXT.name}="${e}"
|
|
91
|
-
placeholder="${
|
|
90
|
+
placeholder="${t || e}"
|
|
92
91
|
${o ? `${$.TEXT.disabled}="true"` : ""}>
|
|
93
|
-
</${
|
|
92
|
+
</${n.TEXT}>
|
|
94
93
|
`;
|
|
95
94
|
}
|
|
96
|
-
_GuCounter({ name: e, maxValue:
|
|
95
|
+
_GuCounter({ name: e, maxValue: t, minValue: E = 1, step: o = 1 }) {
|
|
97
96
|
return `
|
|
98
|
-
<${
|
|
97
|
+
<${n.COUNTER}
|
|
99
98
|
${$.COUNTER.name}="${e}"
|
|
100
99
|
${$.COUNTER.minValue}="${E}"
|
|
101
|
-
${$.COUNTER.maxValue}="${
|
|
100
|
+
${$.COUNTER.maxValue}="${t}"
|
|
102
101
|
${$.COUNTER.step}="${o}">
|
|
103
|
-
</${
|
|
102
|
+
</${n.COUNTER}>
|
|
104
103
|
`;
|
|
105
104
|
}
|
|
106
|
-
_GuRadioButtonItem({ text: e, value:
|
|
105
|
+
_GuRadioButtonItem({ text: e, value: t, icon: E }) {
|
|
107
106
|
return `
|
|
108
|
-
<${
|
|
109
|
-
${$.RADIO_ITEM.value}="${
|
|
107
|
+
<${n.RADIO_ITEM}
|
|
108
|
+
${$.RADIO_ITEM.value}="${t}"
|
|
110
109
|
${e ? `${$.RADIO_ITEM.text}="${e}"` : ""}
|
|
111
110
|
${E ? `${$.RADIO_ITEM.icon}="${E}"` : ""}>
|
|
112
|
-
</${
|
|
111
|
+
</${n.RADIO_ITEM}>
|
|
113
112
|
`;
|
|
114
113
|
}
|
|
115
|
-
_GuRadioButton({ name: e, buttons:
|
|
114
|
+
_GuRadioButton({ name: e, buttons: t, id: E = "" }) {
|
|
116
115
|
return `
|
|
117
|
-
<${
|
|
116
|
+
<${n.RADIO_BUTTONS}
|
|
118
117
|
${E ? `id="${E}"` : ""}
|
|
119
118
|
${$.RADIO_BUTTONS.name}="${e}">
|
|
120
|
-
${
|
|
121
|
-
</${
|
|
119
|
+
${t.map((o) => this._GuRadioButtonItem(o)).join("")}
|
|
120
|
+
</${n.RADIO_BUTTONS}>
|
|
122
121
|
`;
|
|
123
122
|
}
|
|
124
|
-
_GuButton({ name: e, label:
|
|
123
|
+
_GuButton({ name: e, label: t, id: E = "" }) {
|
|
125
124
|
return `
|
|
126
|
-
<${
|
|
125
|
+
<${n.BUTTON}
|
|
127
126
|
${$.BUTTON.name}="${e}"
|
|
128
127
|
${E ? `id="${E}"` : ""}
|
|
129
|
-
${$.BUTTON.caption}="${
|
|
130
|
-
</${
|
|
128
|
+
${$.BUTTON.caption}="${t}"}>
|
|
129
|
+
</${n.BUTTON}>
|
|
131
130
|
`;
|
|
132
131
|
}
|
|
133
132
|
/**
|
|
@@ -135,25 +134,25 @@ class _ extends O {
|
|
|
135
134
|
* @param param0
|
|
136
135
|
* @returns It returns a button with an icon.
|
|
137
136
|
*/
|
|
138
|
-
_GuIconButton({ name: e, icon:
|
|
137
|
+
_GuIconButton({ name: e, icon: t, className: E = "" }) {
|
|
139
138
|
return `
|
|
140
|
-
<${
|
|
139
|
+
<${n.BUTTON}
|
|
141
140
|
class="${E}"
|
|
142
141
|
${$.BUTTON.name}="${e}"
|
|
143
|
-
${$.BUTTON.icon}="${
|
|
144
|
-
</${
|
|
142
|
+
${$.BUTTON.icon}="${t}">
|
|
143
|
+
</${n.BUTTON}>
|
|
145
144
|
`;
|
|
146
145
|
}
|
|
147
|
-
_GuOneColumn(e,
|
|
146
|
+
_GuOneColumn(e, t = "") {
|
|
148
147
|
return `
|
|
149
|
-
<div class="container one-column ${
|
|
148
|
+
<div class="container one-column ${t}">
|
|
150
149
|
${e.join("")}
|
|
151
150
|
</div>
|
|
152
151
|
`;
|
|
153
152
|
}
|
|
154
|
-
_GuTwoColumns(e,
|
|
153
|
+
_GuTwoColumns(e, t = "") {
|
|
155
154
|
return `
|
|
156
|
-
<div class="container two-columns ${
|
|
155
|
+
<div class="container two-columns ${t}">
|
|
157
156
|
${e.join("")}
|
|
158
157
|
</div>
|
|
159
158
|
`;
|
|
@@ -165,79 +164,79 @@ class _ extends O {
|
|
|
165
164
|
* @param itemLabels - Optional array of objects with key and label properties for display
|
|
166
165
|
* @returns HTML string for the orderable control
|
|
167
166
|
*/
|
|
168
|
-
_GuOrderable(e,
|
|
167
|
+
_GuOrderable(e, t) {
|
|
169
168
|
let E = "";
|
|
170
|
-
|
|
169
|
+
t.forEach((a) => {
|
|
171
170
|
const l = $.ORDERABLE_ITEM && "name" in $.ORDERABLE_ITEM ? $.ORDERABLE_ITEM.name : "name";
|
|
172
171
|
E += `
|
|
173
|
-
<${
|
|
172
|
+
<${n.ORDERABLE_ITEM} ${l}="${a.key}">
|
|
174
173
|
${a.content}
|
|
175
|
-
</${
|
|
174
|
+
</${n.ORDERABLE_ITEM}>
|
|
176
175
|
`;
|
|
177
176
|
});
|
|
178
177
|
const o = $.ORDERABLE && "name" in $.ORDERABLE ? $.ORDERABLE.name : "name";
|
|
179
178
|
return `
|
|
180
|
-
<${
|
|
179
|
+
<${n.ORDERABLE} ${o}="${e}">
|
|
181
180
|
${E}
|
|
182
|
-
</${
|
|
181
|
+
</${n.ORDERABLE}>
|
|
183
182
|
`;
|
|
184
183
|
}
|
|
185
|
-
_GuNestedControl(e,
|
|
184
|
+
_GuNestedControl(e, t) {
|
|
186
185
|
return `
|
|
187
|
-
<${
|
|
188
|
-
${
|
|
189
|
-
</${
|
|
186
|
+
<${n.NESTED_CONTROL} ${$.NESTED_CONTROL.controlId}="${e}">
|
|
187
|
+
${t}
|
|
188
|
+
</${n.NESTED_CONTROL}>
|
|
190
189
|
`;
|
|
191
190
|
}
|
|
192
|
-
_GuExpandable(e,
|
|
191
|
+
_GuExpandable(e, t) {
|
|
193
192
|
return `
|
|
194
|
-
<${
|
|
195
|
-
<${
|
|
196
|
-
<${
|
|
197
|
-
</${
|
|
198
|
-
<${
|
|
193
|
+
<${n.EXPANDABLE}>
|
|
194
|
+
<${n.EXPANDABLE_HEADER}>
|
|
195
|
+
<${n.LABEL} ${$.LABEL.text}="${e}"></${n.LABEL}>
|
|
196
|
+
</${n.EXPANDABLE_HEADER}>
|
|
197
|
+
<${n.EXPANDABLE_CONTENT}>
|
|
199
198
|
|
|
200
|
-
${
|
|
199
|
+
${t}
|
|
201
200
|
|
|
202
|
-
</${
|
|
203
|
-
</${
|
|
201
|
+
</${n.EXPANDABLE_CONTENT}>
|
|
202
|
+
</${n.EXPANDABLE}>
|
|
204
203
|
`;
|
|
205
204
|
}
|
|
206
205
|
_GuColorPicker(e) {
|
|
207
206
|
return `
|
|
208
|
-
<${
|
|
207
|
+
<${n.COLOR}
|
|
209
208
|
${$.COLOR.name}="${e}">
|
|
210
|
-
</${
|
|
209
|
+
</${n.COLOR}>
|
|
211
210
|
`;
|
|
212
211
|
}
|
|
213
|
-
_GuFontFamily(e,
|
|
212
|
+
_GuFontFamily(e, t = "Select Font") {
|
|
214
213
|
return `
|
|
215
|
-
<${
|
|
214
|
+
<${n.FONT_FAMILY_SELECT}
|
|
216
215
|
${$.FONT_FAMILY_SELECT.name}="${e}"
|
|
217
|
-
${$.FONT_FAMILY_SELECT.placeholder}="${
|
|
218
|
-
</${
|
|
216
|
+
${$.FONT_FAMILY_SELECT.placeholder}="${t}">
|
|
217
|
+
</${n.FONT_FAMILY_SELECT}>
|
|
219
218
|
`;
|
|
220
219
|
}
|
|
221
|
-
_GuRadioButtons(e,
|
|
222
|
-
const E =
|
|
223
|
-
<${
|
|
220
|
+
_GuRadioButtons(e, t) {
|
|
221
|
+
const E = t.map((o) => `
|
|
222
|
+
<${n.RADIO_ITEM}
|
|
224
223
|
${$.RADIO_ITEM.text}="${o.text}"
|
|
225
224
|
${$.RADIO_ITEM.value}="${o.value}">
|
|
226
|
-
</${
|
|
225
|
+
</${n.RADIO_ITEM}>
|
|
227
226
|
`).join("");
|
|
228
227
|
return `
|
|
229
|
-
<${
|
|
228
|
+
<${n.RADIO_BUTTONS}
|
|
230
229
|
${$.RADIO_BUTTONS.name}="${e}">
|
|
231
230
|
${E}
|
|
232
|
-
</${
|
|
231
|
+
</${n.RADIO_BUTTONS}>
|
|
233
232
|
`;
|
|
234
233
|
}
|
|
235
|
-
_GuCheckbox(e,
|
|
234
|
+
_GuCheckbox(e, t) {
|
|
236
235
|
return `
|
|
237
|
-
<${
|
|
236
|
+
<${n.CHECKBOX}
|
|
238
237
|
${$.CHECKBOX.name}="${e}"
|
|
239
|
-
${$.CHECKBOX.caption}="${
|
|
240
|
-
</${
|
|
238
|
+
${$.CHECKBOX.caption}="${t}">
|
|
239
|
+
</${n.CHECKBOX}>
|
|
241
240
|
`;
|
|
242
241
|
}
|
|
243
242
|
}
|
|
@@ -3,7 +3,6 @@ import { CommonControl } from '../../../common-control';
|
|
|
3
3
|
import { ItemsBlockControlId } from '../../enums/controlEnums';
|
|
4
4
|
export declare const CONTROL_BLOCK_ID = ItemsBlockControlId.BUTTON_LINK;
|
|
5
5
|
export declare class ButtonLinkControl extends CommonControl {
|
|
6
|
-
private store;
|
|
7
6
|
getId(): string;
|
|
8
7
|
getTemplate(): string;
|
|
9
8
|
onRender(): void;
|
|
@@ -2,7 +2,6 @@ import { ImmutableHtmlNode } from '@stripoinc/ui-editor-extensions';
|
|
|
2
2
|
import { CommonControl } from '../../common-control';
|
|
3
3
|
export declare const COMPOSITION_CONTROL_BLOCK_ID = "ui-elements-items-card-composition-block";
|
|
4
4
|
export declare class ItemsBlockCardCompositionControl extends CommonControl {
|
|
5
|
-
private store;
|
|
6
5
|
private visibilityState;
|
|
7
6
|
getId(): string;
|
|
8
7
|
getTemplate(): string;
|
|
@@ -19,10 +18,11 @@ export declare class ItemsBlockCardCompositionControl extends CommonControl {
|
|
|
19
18
|
* If itemsType is not BROWSED_ITEMS, show quantity
|
|
20
19
|
* If itemsType is BROWSED_ITEMS, hide quantity
|
|
21
20
|
* and mark it as '0'
|
|
21
|
+
* @param syncOnly - If true, only sync local state and UI without modifying the document
|
|
22
22
|
*/
|
|
23
|
-
_handleBrowsedItemsQuantity(): void;
|
|
24
|
-
_applyVisibilityStyles(): void;
|
|
25
|
-
_updateVisibilityAttribute(elementName: string, isVisible: boolean): void;
|
|
23
|
+
_handleBrowsedItemsQuantity(syncOnly?: boolean): void;
|
|
24
|
+
_applyVisibilityStyles(modifier?: ReturnType<typeof this.api.getDocumentModifier>): void;
|
|
25
|
+
_updateVisibilityAttribute(elementName: string, isVisible: boolean, modifier?: ReturnType<typeof this.api.getDocumentModifier>): void;
|
|
26
26
|
_listenToFormUpdates(): void;
|
|
27
27
|
_onProductImageChange(value: boolean): void;
|
|
28
28
|
_onProductNameChange(value: boolean): void;
|
|
@@ -37,6 +37,6 @@ export declare class ItemsBlockCardCompositionControl extends CommonControl {
|
|
|
37
37
|
* - When price is hidden, original price cell expands to 100%
|
|
38
38
|
* - When both are visible, they share 50% each
|
|
39
39
|
*/
|
|
40
|
-
_updatePriceCellWidthsForVerticalLayout(): void;
|
|
40
|
+
_updatePriceCellWidthsForVerticalLayout(modifier?: ReturnType<typeof this.api.getDocumentModifier>): void;
|
|
41
41
|
_onProductButtonChange(value: boolean): void;
|
|
42
42
|
}
|
|
@@ -3,7 +3,6 @@ import { CommonControl } from '../../../common-control';
|
|
|
3
3
|
import { ItemsBlockControlId } from '../../enums/controlEnums';
|
|
4
4
|
export declare const CONTROL_BLOCK_ID = ItemsBlockControlId.IMAGE_LINK;
|
|
5
5
|
export declare class ImageLinkControl extends CommonControl {
|
|
6
|
-
private store;
|
|
7
6
|
getId(): string;
|
|
8
7
|
getTemplate(): string;
|
|
9
8
|
onRender(): void;
|
|
@@ -3,7 +3,6 @@ import { CommonControl } from '../../../common-control';
|
|
|
3
3
|
import { ItemsBlockControlId } from '../../enums/controlEnums';
|
|
4
4
|
export declare const CONTROL_BLOCK_ID = ItemsBlockControlId.NAME_TRIMMING;
|
|
5
5
|
export declare class NameTrimmingControl extends CommonControl {
|
|
6
|
-
private store;
|
|
7
6
|
getId(): string;
|
|
8
7
|
getTemplate(): string;
|
|
9
8
|
onRender(): void;
|
|
@@ -3,7 +3,6 @@ import { CommonControl } from '../../../common-control';
|
|
|
3
3
|
import { ItemsBlockControlId } from '../../enums/controlEnums';
|
|
4
4
|
export declare const CONTROL_BLOCK_ID = ItemsBlockControlId.PRICE_CURRENCY_LOCATION;
|
|
5
5
|
export declare class PriceCurrencyLocationControl extends CommonControl {
|
|
6
|
-
private store;
|
|
7
6
|
getId(): string;
|
|
8
7
|
getTemplate(): string;
|
|
9
8
|
onRender(): void;
|
|
@@ -3,7 +3,6 @@ import { CommonControl } from '../../../common-control';
|
|
|
3
3
|
import { ItemsBlockControlId } from '../../enums/controlEnums';
|
|
4
4
|
export declare const CONTROL_BLOCK_ID = ItemsBlockControlId.PRICE_CURRENCY_SYMBOL;
|
|
5
5
|
export declare class PriceCurrencySymbolControl extends CommonControl {
|
|
6
|
-
private store;
|
|
7
6
|
private originalPriceContents;
|
|
8
7
|
getId(): string;
|
|
9
8
|
getTemplate(): string;
|
|
@@ -3,7 +3,6 @@ import { CommonControl } from '../../../common-control';
|
|
|
3
3
|
import { ItemsBlockControlId } from '../../enums/controlEnums';
|
|
4
4
|
export declare const CONTROL_BLOCK_ID = ItemsBlockControlId.PRICE_FORMATTED_PRICE;
|
|
5
5
|
export declare class PriceFormattedPriceControl extends CommonControl {
|
|
6
|
-
private store;
|
|
7
6
|
getId(): string;
|
|
8
7
|
getTemplate(): string;
|
|
9
8
|
onRender(): void;
|
|
@@ -3,7 +3,6 @@ import { CommonControl } from '../../../common-control';
|
|
|
3
3
|
import { ItemsBlockControlId } from '../../enums/controlEnums';
|
|
4
4
|
export declare const CONTROL_BLOCK_ID = ItemsBlockControlId.PRICE_HIDE_DISCOUNT;
|
|
5
5
|
export declare class PriceHideDiscountControl extends CommonControl {
|
|
6
|
-
private store;
|
|
7
6
|
getId(): string;
|
|
8
7
|
getTemplate(): string;
|
|
9
8
|
onRender(): void;
|
|
@@ -3,7 +3,6 @@ import { CommonControl } from '../../../common-control';
|
|
|
3
3
|
import { ItemsBlockControlId } from '../../enums/controlEnums';
|
|
4
4
|
export declare const CONTROL_BLOCK_ID = ItemsBlockControlId.PRICE_ORIENTATION;
|
|
5
5
|
export declare class PriceOrientationControl extends CommonControl {
|
|
6
|
-
private store;
|
|
7
6
|
getId(): string;
|
|
8
7
|
getTemplate(): string;
|
|
9
8
|
onRender(): void;
|