@useinsider/guido 2.0.0-beta.782343a → 2.0.0-beta.7a88d79
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/@types/config/schemas.js +53 -39
- package/dist/components/organisms/email-preview/amp/AmpToggle.vue.js +2 -2
- package/dist/components/organisms/header/RightSlot.vue2.js +10 -10
- package/dist/composables/useConfig.js +29 -27
- package/dist/composables/useSave.js +13 -11
- package/dist/extensions/Blocks/Items/controls/cardComposition.js +4 -13
- package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +103 -0
- package/dist/extensions/Blocks/Recommendation/constants.js +5 -0
- package/dist/extensions/Blocks/Recommendation/{controls/main/index.js → control.js} +67 -101
- package/dist/extensions/Blocks/Recommendation/controls/button/align.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/border.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/borderRadius.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/color.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/fitToContent.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/fontFamily.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/margins.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/paddings.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/text.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/textSize.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/image/margins.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/image/size.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/align.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/background.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/color.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/fontFamily.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/paddings.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/size.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/name/style.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/align.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/background.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/color.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/paddings.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/size.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/oldPrice/style.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/align.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/background.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/color.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/fontFamily.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/paddings.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/size.js +13 -0
- package/dist/extensions/Blocks/Recommendation/controls/price/style.js +13 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +43 -37
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +72 -125
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +20 -20
- package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +69 -91
- package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +17 -54
- package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +62 -66
- package/dist/extensions/Blocks/Unsubscribe/extension.js +9 -9
- package/dist/extensions/Blocks/common-control.js +6 -7
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +290 -363
- package/dist/package.json.js +1 -1
- package/dist/src/@types/config/index.d.ts +2 -2
- package/dist/src/@types/config/schemas.d.ts +26 -0
- package/dist/src/@types/config/types.d.ts +7 -1
- package/dist/src/composables/useConfig.d.ts +6 -0
- package/dist/src/extensions/Blocks/Recommendation/cardCompositionControl.d.ts +28 -0
- package/dist/src/extensions/Blocks/Recommendation/{constants/controlIds.d.ts → constants.d.ts} +11 -19
- package/dist/src/extensions/Blocks/Recommendation/{controls/main/index.d.ts → control.d.ts} +3 -6
- package/dist/src/extensions/Blocks/Recommendation/controls/button/align.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/border.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/borderRadius.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/color.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/fitToContent.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/fontFamily.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/margins.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/paddings.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/text.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/textSize.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/image/margins.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/image/size.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/align.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/background.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/color.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/fontFamily.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/paddings.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/size.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/name/style.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/align.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/background.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/color.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/fontFamily.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/paddings.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/size.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/oldPrice/style.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/align.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/background.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/color.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/fontFamily.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/paddings.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/size.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/price/style.d.ts +5 -0
- package/dist/src/extensions/Blocks/Recommendation/extension.d.ts +0 -9
- package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +3 -3
- package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +7 -15
- package/dist/src/extensions/Blocks/common-control.d.ts +1 -1
- package/dist/src/stores/config.d.ts +147 -1
- package/dist/static/styles/components/button.css.js +1 -1
- package/dist/static/styles/components/wide-panel.css.js +4 -0
- package/dist/static/styles/customEditorStyle.css.js +0 -13
- package/dist/stores/config.js +7 -0
- package/package.json +3 -3
- 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/selectors.js +0 -11
- package/dist/extensions/Blocks/Recommendation/controls/button/index.js +0 -64
- package/dist/extensions/Blocks/Recommendation/controls/cardBackground/index.js +0 -68
- package/dist/extensions/Blocks/Recommendation/controls/cardComposition/index.js +0 -179
- package/dist/extensions/Blocks/Recommendation/controls/image/index.js +0 -19
- package/dist/extensions/Blocks/Recommendation/controls/name/index.js +0 -46
- package/dist/extensions/Blocks/Recommendation/controls/name/textTrim.js +0 -76
- 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/omnibusDiscount/textAfter.js +0 -73
- package/dist/extensions/Blocks/Recommendation/controls/omnibusDiscount/textBefore.js +0 -73
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/index.js +0 -48
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textAfter.js +0 -73
- package/dist/extensions/Blocks/Recommendation/controls/omnibusPrice/textBefore.js +0 -73
- package/dist/extensions/Blocks/Recommendation/controls/price/index.js +0 -44
- package/dist/extensions/Blocks/Recommendation/controls/spacing/index.js +0 -183
- package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +0 -25
- package/dist/src/extensions/Blocks/Recommendation/constants/blockIds.d.ts +0 -13
- package/dist/src/extensions/Blocks/Recommendation/constants/index.d.ts +0 -11
- package/dist/src/extensions/Blocks/Recommendation/constants/selectors.d.ts +0 -19
- 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 -25
- package/dist/src/extensions/Blocks/Recommendation/controls/cardComposition/index.d.ts +0 -75
- package/dist/src/extensions/Blocks/Recommendation/controls/image/index.d.ts +0 -35
- package/dist/src/extensions/Blocks/Recommendation/controls/index.d.ts +0 -22
- 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 -16
- 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 -57
- package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +0 -19
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import { ModificationDescription as n } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
-
import { CommonControl as m } from "../../../common-control.js";
|
|
3
|
-
import { ATTR_PRODUCT_IMAGE as b, ATTR_PRODUCT_NAME as y, ATTR_PRODUCT_PRICE as T, ATTR_PRODUCT_OLD_PRICE as h, ATTR_PRODUCT_OMNIBUS_PRICE as C, ATTR_PRODUCT_OMNIBUS_DISCOUNT as f, ATTR_PRODUCT_BUTTON as A } from "../../constants/selectors.js";
|
|
4
|
-
const O = "ui-elements-recommendation-card-composition", l = ".recommendation-attribute-row", R = "tr.recommendation-product-row", c = "data-card-composition", a = "data-attribute-type", d = "data-visibility", s = [
|
|
5
|
-
{ key: b, label: "Product Image", visible: !0 },
|
|
6
|
-
{ key: y, label: "Product Name", visible: !0 },
|
|
7
|
-
{ key: T, label: "Product Price", visible: !0 },
|
|
8
|
-
{ key: h, label: "Product Original Price", visible: !0 },
|
|
9
|
-
{ key: C, label: "Omnibus Price", visible: !1 },
|
|
10
|
-
{ key: f, label: "Omnibus Discount", visible: !1 },
|
|
11
|
-
{ key: A, label: "Product Button", visible: !0 }
|
|
12
|
-
];
|
|
13
|
-
class V extends m {
|
|
14
|
-
getId() {
|
|
15
|
-
return O;
|
|
16
|
-
}
|
|
17
|
-
getTemplate() {
|
|
18
|
-
const t = s.map((i) => ({
|
|
19
|
-
key: i.key,
|
|
20
|
-
label: i.label,
|
|
21
|
-
content: this._createItemContent(i.label, i.key)
|
|
22
|
-
}));
|
|
23
|
-
return `
|
|
24
|
-
<div class="container">
|
|
25
|
-
${this._GuLabel({ text: "Card Element Order & Visibility" })}
|
|
26
|
-
${this._GuOrderable("cardComposition", t)}
|
|
27
|
-
</div>
|
|
28
|
-
`;
|
|
29
|
-
}
|
|
30
|
-
onRender() {
|
|
31
|
-
this._initializeComposition(), this._registerValueChangeListeners();
|
|
32
|
-
}
|
|
33
|
-
onTemplateNodeUpdated(t) {
|
|
34
|
-
super.onTemplateNodeUpdated(t), this._initializeComposition();
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Creates the HTML content for an orderable item with label and toggle
|
|
38
|
-
*/
|
|
39
|
-
_createItemContent(t, i) {
|
|
40
|
-
return `
|
|
41
|
-
<div style="display: flex; align-items: center; justify-content: space-between;
|
|
42
|
-
padding: 8px; gap: 8px;">
|
|
43
|
-
<span style="flex: 1;">${t}</span>
|
|
44
|
-
${this._GuToggle(`visibility_${i}`)}
|
|
45
|
-
</div>
|
|
46
|
-
`;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Registers event listeners for composition and visibility changes
|
|
50
|
-
*/
|
|
51
|
-
_registerValueChangeListeners() {
|
|
52
|
-
this.api.onValueChanged("cardComposition", (t) => {
|
|
53
|
-
this._applyCompositionToBlock(t);
|
|
54
|
-
}), s.forEach((t) => {
|
|
55
|
-
this.api.onValueChanged(`visibility_${t.key}`, (i) => {
|
|
56
|
-
this._applyVisibilityToBlock(t.key, i);
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Initializes composition order and visibility state from the current node
|
|
62
|
-
*/
|
|
63
|
-
_initializeComposition() {
|
|
64
|
-
const t = this._readCompositionFromNode(), i = this._readVisibilityFromRows(), e = {
|
|
65
|
-
cardComposition: t,
|
|
66
|
-
...this._buildVisibilityValues(i)
|
|
67
|
-
};
|
|
68
|
-
this.api.updateValues(e);
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Reads composition order from node's data-card-composition attribute
|
|
72
|
-
* Falls back to default order if attribute is not present
|
|
73
|
-
*/
|
|
74
|
-
_readCompositionFromNode() {
|
|
75
|
-
if (!this.currentNode || !("getAttribute" in this.currentNode))
|
|
76
|
-
return s.map((i) => i.key);
|
|
77
|
-
const t = this.currentNode.getAttribute(c);
|
|
78
|
-
return t ? t.split(",").filter(Boolean) : s.map((i) => i.key);
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Builds visibility values object from the visibility map
|
|
82
|
-
*/
|
|
83
|
-
_buildVisibilityValues(t) {
|
|
84
|
-
return s.reduce((i, e) => (i[`visibility_${e.key}`] = t[e.key] ?? !0, i), {});
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Read visibility state from individual row elements' data-visibility attributes
|
|
88
|
-
* This ensures toggles reflect the actual DOM state
|
|
89
|
-
*/
|
|
90
|
-
_readVisibilityFromRows() {
|
|
91
|
-
if (!this.currentNode)
|
|
92
|
-
return this._getDefaultVisibilities();
|
|
93
|
-
const t = Array.from(this.currentNode.querySelectorAll(l)), i = this._extractVisibilityFromRows(t);
|
|
94
|
-
return this._mergeWithDefaults(i);
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Returns default visibility values for all items
|
|
98
|
-
*/
|
|
99
|
-
_getDefaultVisibilities() {
|
|
100
|
-
return s.reduce((t, i) => (t[i.key] = i.visible, t), {});
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Extracts visibility values from DOM nodes
|
|
104
|
-
*/
|
|
105
|
-
_extractVisibilityFromRows(t) {
|
|
106
|
-
const i = {};
|
|
107
|
-
return t.forEach((e) => {
|
|
108
|
-
if (!("getAttribute" in e))
|
|
109
|
-
return;
|
|
110
|
-
const o = e.getAttribute(a), r = e.getAttribute(d);
|
|
111
|
-
o && r !== null && (i[o] = this._parseVisibilityValue(r));
|
|
112
|
-
}), i;
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Parses visibility value from string to boolean
|
|
116
|
-
* Accepts "1", "true" as true, everything else as false
|
|
117
|
-
*/
|
|
118
|
-
_parseVisibilityValue(t) {
|
|
119
|
-
return t === "1" || t === "true";
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Merges extracted visibilities with default values for missing keys
|
|
123
|
-
*/
|
|
124
|
-
_mergeWithDefaults(t) {
|
|
125
|
-
return s.forEach((i) => {
|
|
126
|
-
i.key in t || (t[i.key] = i.visible);
|
|
127
|
-
}), t;
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* Apply the reordered composition to the block's HTML structure
|
|
131
|
-
* Updates the data-card-composition attribute and reorders product attributes
|
|
132
|
-
*/
|
|
133
|
-
_applyCompositionToBlock(t) {
|
|
134
|
-
this.currentNode && (this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute(c, t.join(",")).apply(new n("Update card composition")), this._reorderProductAttributes(t));
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Reorders attribute rows within each product row based on composition order
|
|
138
|
-
*/
|
|
139
|
-
_reorderProductAttributes(t) {
|
|
140
|
-
if (!this.currentNode)
|
|
141
|
-
return;
|
|
142
|
-
const i = this.currentNode.querySelectorAll(R);
|
|
143
|
-
if (!(i != null && i.length))
|
|
144
|
-
return;
|
|
145
|
-
const e = this.api.getDocumentModifier();
|
|
146
|
-
i.forEach((o) => {
|
|
147
|
-
const r = this._buildCompositionHtml(o, t);
|
|
148
|
-
e.modifyHtml(o).setInnerHtml(r);
|
|
149
|
-
}), e.apply(new n("Reorder product attributes"));
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Builds HTML string with attributes ordered according to composition
|
|
153
|
-
*/
|
|
154
|
-
_buildCompositionHtml(t, i) {
|
|
155
|
-
return i.reduce((e, o) => {
|
|
156
|
-
const r = t.querySelector(`${l}[${a}="${o}"]`);
|
|
157
|
-
return r && "getOuterHTML" in r ? e + r.getOuterHTML() : e;
|
|
158
|
-
}, "");
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Apply visibility changes to the block's HTML structure
|
|
162
|
-
* Updates display style and data-visibility attribute for all matching rows
|
|
163
|
-
*/
|
|
164
|
-
_applyVisibilityToBlock(t, i) {
|
|
165
|
-
if (!this.currentNode)
|
|
166
|
-
return;
|
|
167
|
-
const e = this.currentNode.querySelectorAll(`${l}[${a}="${t}"]`);
|
|
168
|
-
if (!(e != null && e.length))
|
|
169
|
-
return;
|
|
170
|
-
const o = i ? "table-row" : "none", r = i ? "1" : "0", p = `Set ${t} visibility to ${i ? "visible" : "hidden"}`, u = this.api.getDocumentModifier();
|
|
171
|
-
e.forEach((_) => {
|
|
172
|
-
u.modifyHtml(_).setStyle("display", o).setAttribute(d, r);
|
|
173
|
-
}), u.apply(new n(p));
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
export {
|
|
177
|
-
O as COMPOSITION_CONTROL_BLOCK_ID,
|
|
178
|
-
V as RecommendationCardCompositionControl
|
|
179
|
-
};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { createImageMarginsControl as m, createImageSizeControl as n } from "../../../controlFactories.js";
|
|
2
|
-
import { RecommendationBlockId as o } from "../../constants/blockIds.js";
|
|
3
|
-
import { RecommendationControlId as r } from "../../constants/controlIds.js";
|
|
4
|
-
import { CONTAINER_SELECTOR as t } from "../../constants/selectors.js";
|
|
5
|
-
const e = n(
|
|
6
|
-
r.IMAGE_SIZE,
|
|
7
|
-
o.IMAGE,
|
|
8
|
-
t
|
|
9
|
-
), i = m(
|
|
10
|
-
r.IMAGE_MARGINS,
|
|
11
|
-
o.IMAGE,
|
|
12
|
-
t
|
|
13
|
-
), C = {
|
|
14
|
-
size: e,
|
|
15
|
-
margins: i
|
|
16
|
-
};
|
|
17
|
-
export {
|
|
18
|
-
C as ImageControls
|
|
19
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { createPaddingsControl as n, createTextBackgroundColorControl as e, createTextFontFamilyControl as l, createTextStyleControl as C, createTextSizeControl as c, createTextColorControl as N, createTextAlignControl as a } from "../../../controlFactories.js";
|
|
2
|
-
import { RecommendationBlockId as o } from "../../constants/blockIds.js";
|
|
3
|
-
import { RecommendationControlId as t } from "../../constants/controlIds.js";
|
|
4
|
-
import { CONTAINER_SELECTOR as r } from "../../constants/selectors.js";
|
|
5
|
-
import { NameTextTrimControl as i } from "./textTrim.js";
|
|
6
|
-
const m = a(
|
|
7
|
-
t.NAME_ALIGN,
|
|
8
|
-
o.NAME,
|
|
9
|
-
r
|
|
10
|
-
), A = N(
|
|
11
|
-
t.NAME_COLOR,
|
|
12
|
-
o.NAME,
|
|
13
|
-
r
|
|
14
|
-
), E = c(
|
|
15
|
-
t.NAME_SIZE,
|
|
16
|
-
o.NAME,
|
|
17
|
-
r
|
|
18
|
-
), M = C(
|
|
19
|
-
t.NAME_STYLE,
|
|
20
|
-
o.NAME,
|
|
21
|
-
r
|
|
22
|
-
), s = l(
|
|
23
|
-
t.NAME_FONT_FAMILY,
|
|
24
|
-
o.NAME,
|
|
25
|
-
r
|
|
26
|
-
), d = e(
|
|
27
|
-
t.NAME_BACKGROUND,
|
|
28
|
-
o.NAME,
|
|
29
|
-
r
|
|
30
|
-
), T = n(
|
|
31
|
-
t.NAME_PADDINGS,
|
|
32
|
-
o.NAME,
|
|
33
|
-
r
|
|
34
|
-
), F = {
|
|
35
|
-
align: m,
|
|
36
|
-
color: A,
|
|
37
|
-
size: E,
|
|
38
|
-
style: M,
|
|
39
|
-
fontFamily: s,
|
|
40
|
-
background: d,
|
|
41
|
-
paddings: T,
|
|
42
|
-
textTrim: i
|
|
43
|
-
};
|
|
44
|
-
export {
|
|
45
|
-
F as NameControls
|
|
46
|
-
};
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { ModificationDescription as l } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
-
import { CommonControl as c } from "../../../common-control.js";
|
|
3
|
-
import { RecommendationBlockId as a } from "../../constants/blockIds.js";
|
|
4
|
-
import { RecommendationControlId as d } from "../../constants/controlIds.js";
|
|
5
|
-
import { CONTAINER_SELECTOR as m } from "../../constants/selectors.js";
|
|
6
|
-
const s = {
|
|
7
|
-
TEXT_TRIM_ENABLED: "textTrimEnabled"
|
|
8
|
-
}, r = "text-trim-enabled";
|
|
9
|
-
class p extends c {
|
|
10
|
-
getId() {
|
|
11
|
-
return d.NAME_TEXT_TRIM;
|
|
12
|
-
}
|
|
13
|
-
getTemplate() {
|
|
14
|
-
return `
|
|
15
|
-
<div class="name-text-trim-control-container">
|
|
16
|
-
${this._GuTwoColumns([
|
|
17
|
-
this._GuLabel({ text: "Trim Long Text" }),
|
|
18
|
-
this._GuToggle(s.TEXT_TRIM_ENABLED)
|
|
19
|
-
])}
|
|
20
|
-
</div>
|
|
21
|
-
`;
|
|
22
|
-
}
|
|
23
|
-
onRender() {
|
|
24
|
-
this._setFormValues(), this._listenToFormUpdates();
|
|
25
|
-
}
|
|
26
|
-
onTemplateNodeUpdated(t) {
|
|
27
|
-
super.onTemplateNodeUpdated(t), this._setFormValues();
|
|
28
|
-
}
|
|
29
|
-
_setFormValues() {
|
|
30
|
-
const t = this._getCurrentTrimState();
|
|
31
|
-
this.api.updateValues({
|
|
32
|
-
[s.TEXT_TRIM_ENABLED]: t
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
_getCurrentTrimState() {
|
|
36
|
-
if (!this.currentNode || !("hasClass" in this.currentNode))
|
|
37
|
-
return !1;
|
|
38
|
-
if (this.currentNode.hasClass(r))
|
|
39
|
-
return !0;
|
|
40
|
-
const t = this.currentNode.closest(m);
|
|
41
|
-
if (!t)
|
|
42
|
-
return !1;
|
|
43
|
-
const e = t.querySelector(
|
|
44
|
-
`[esd-extension-block-id="${a.NAME}"]`
|
|
45
|
-
);
|
|
46
|
-
return e && "hasClass" in e ? e.hasClass(r) : !1;
|
|
47
|
-
}
|
|
48
|
-
_onTextTrimChange(t) {
|
|
49
|
-
if (!this.currentNode || !("closest" in this.currentNode))
|
|
50
|
-
return;
|
|
51
|
-
const e = this.currentNode.closest(m);
|
|
52
|
-
if (!e || !("querySelectorAll" in e))
|
|
53
|
-
return;
|
|
54
|
-
const i = Array.from(
|
|
55
|
-
e.querySelectorAll(`[esd-extension-block-id="${a.NAME}"]`)
|
|
56
|
-
);
|
|
57
|
-
if (!i.length)
|
|
58
|
-
return;
|
|
59
|
-
const o = this.api.getDocumentModifier();
|
|
60
|
-
i.forEach((n) => {
|
|
61
|
-
t ? o.modifyHtml(n).setClass(r) : o.modifyHtml(n).removeClass(r);
|
|
62
|
-
}), o.apply(
|
|
63
|
-
new l(
|
|
64
|
-
t ? "Enable product name text trimming" : "Disable product name text trimming"
|
|
65
|
-
)
|
|
66
|
-
);
|
|
67
|
-
}
|
|
68
|
-
_listenToFormUpdates() {
|
|
69
|
-
this.api.onValueChanged(s.TEXT_TRIM_ENABLED, (t) => {
|
|
70
|
-
this._onTextTrimChange(t);
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
export {
|
|
75
|
-
p as NameTextTrimControl
|
|
76
|
-
};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { createPaddingsControl as r, createTextBackgroundColorControl as C, createTextFontFamilyControl as e, createTextStyleControl as l, createTextSizeControl as c, createTextColorControl as _, createTextAlignControl as I } from "../../../controlFactories.js";
|
|
2
|
-
import { RecommendationBlockId as o } from "../../constants/blockIds.js";
|
|
3
|
-
import { RecommendationControlId as t } from "../../constants/controlIds.js";
|
|
4
|
-
import { CONTAINER_SELECTOR as n } from "../../constants/selectors.js";
|
|
5
|
-
const O = I(
|
|
6
|
-
t.OLD_PRICE_ALIGN,
|
|
7
|
-
o.OLD_PRICE,
|
|
8
|
-
n
|
|
9
|
-
), R = _(
|
|
10
|
-
t.OLD_PRICE_COLOR,
|
|
11
|
-
o.OLD_PRICE,
|
|
12
|
-
n
|
|
13
|
-
), a = c(
|
|
14
|
-
t.OLD_PRICE_SIZE,
|
|
15
|
-
o.OLD_PRICE,
|
|
16
|
-
n
|
|
17
|
-
), i = l(
|
|
18
|
-
t.OLD_PRICE_STYLE,
|
|
19
|
-
o.OLD_PRICE,
|
|
20
|
-
n
|
|
21
|
-
), E = e(
|
|
22
|
-
t.OLD_PRICE_FONT_FAMILY,
|
|
23
|
-
o.OLD_PRICE,
|
|
24
|
-
n
|
|
25
|
-
), L = C(
|
|
26
|
-
t.OLD_PRICE_BACKGROUND,
|
|
27
|
-
o.OLD_PRICE,
|
|
28
|
-
n
|
|
29
|
-
), P = r(
|
|
30
|
-
t.OLD_PRICE_PADDINGS,
|
|
31
|
-
o.OLD_PRICE,
|
|
32
|
-
n
|
|
33
|
-
), T = {
|
|
34
|
-
align: O,
|
|
35
|
-
color: R,
|
|
36
|
-
size: a,
|
|
37
|
-
style: i,
|
|
38
|
-
fontFamily: E,
|
|
39
|
-
background: L,
|
|
40
|
-
paddings: P
|
|
41
|
-
};
|
|
42
|
-
export {
|
|
43
|
-
T as OldPriceControls
|
|
44
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { createPaddingsControl as n, createTextBackgroundColorControl as e, createTextFontFamilyControl as C, createTextStyleControl as O, createTextSizeControl as S, createTextColorControl as I, createTextAlignControl as N } from "../../../controlFactories.js";
|
|
2
|
-
import { RecommendationBlockId as o } from "../../constants/blockIds.js";
|
|
3
|
-
import { RecommendationControlId as t } from "../../constants/controlIds.js";
|
|
4
|
-
import { CONTAINER_SELECTOR as r } from "../../constants/selectors.js";
|
|
5
|
-
import { OmnibusDiscountTextAfterControl as l } from "./textAfter.js";
|
|
6
|
-
import { OmnibusDiscountTextBeforeControl as U } from "./textBefore.js";
|
|
7
|
-
const i = N(
|
|
8
|
-
t.OMNIBUS_DISCOUNT_ALIGN,
|
|
9
|
-
o.OMNIBUS_DISCOUNT,
|
|
10
|
-
r
|
|
11
|
-
), T = I(
|
|
12
|
-
t.OMNIBUS_DISCOUNT_COLOR,
|
|
13
|
-
o.OMNIBUS_DISCOUNT,
|
|
14
|
-
r
|
|
15
|
-
), c = S(
|
|
16
|
-
t.OMNIBUS_DISCOUNT_SIZE,
|
|
17
|
-
o.OMNIBUS_DISCOUNT,
|
|
18
|
-
r
|
|
19
|
-
), _ = O(
|
|
20
|
-
t.OMNIBUS_DISCOUNT_STYLE,
|
|
21
|
-
o.OMNIBUS_DISCOUNT,
|
|
22
|
-
r
|
|
23
|
-
), m = C(
|
|
24
|
-
t.OMNIBUS_DISCOUNT_FONT_FAMILY,
|
|
25
|
-
o.OMNIBUS_DISCOUNT,
|
|
26
|
-
r
|
|
27
|
-
), s = e(
|
|
28
|
-
t.OMNIBUS_DISCOUNT_BACKGROUND,
|
|
29
|
-
o.OMNIBUS_DISCOUNT,
|
|
30
|
-
r
|
|
31
|
-
), B = n(
|
|
32
|
-
t.OMNIBUS_DISCOUNT_PADDINGS,
|
|
33
|
-
o.OMNIBUS_DISCOUNT,
|
|
34
|
-
r
|
|
35
|
-
), g = {
|
|
36
|
-
align: i,
|
|
37
|
-
color: T,
|
|
38
|
-
size: c,
|
|
39
|
-
style: _,
|
|
40
|
-
fontFamily: m,
|
|
41
|
-
background: s,
|
|
42
|
-
paddings: B,
|
|
43
|
-
textBefore: U,
|
|
44
|
-
textAfter: l
|
|
45
|
-
};
|
|
46
|
-
export {
|
|
47
|
-
g as OmnibusDiscountControls
|
|
48
|
-
};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { ModificationDescription as c } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
-
import { CommonControl as a } from "../../../common-control.js";
|
|
3
|
-
import { RecommendationBlockId as l } from "../../constants/blockIds.js";
|
|
4
|
-
import { RecommendationControlId as d } from "../../constants/controlIds.js";
|
|
5
|
-
import { CONTAINER_SELECTOR as T } from "../../constants/selectors.js";
|
|
6
|
-
import { preserveTextStyles as f } from "../../utils/preserveTextStyles.js";
|
|
7
|
-
const i = "data-text-after", u = "", p = ".omnibus-text-after";
|
|
8
|
-
class b extends a {
|
|
9
|
-
getId() {
|
|
10
|
-
return d.OMNIBUS_DISCOUNT_TEXT_AFTER;
|
|
11
|
-
}
|
|
12
|
-
getTemplate() {
|
|
13
|
-
return `
|
|
14
|
-
<div class="omnibus-discount-text-after-control-container">
|
|
15
|
-
${this._GuTwoColumns([
|
|
16
|
-
this._GuLabel({ text: "Text After" }),
|
|
17
|
-
this._GuTextInput({
|
|
18
|
-
name: "omnibusDiscountTextAfter",
|
|
19
|
-
placeholder: "e.g., off!",
|
|
20
|
-
className: "es-180w"
|
|
21
|
-
})
|
|
22
|
-
])}
|
|
23
|
-
</div>
|
|
24
|
-
`;
|
|
25
|
-
}
|
|
26
|
-
onRender() {
|
|
27
|
-
this._setFormValues(), this._listenToFormUpdates();
|
|
28
|
-
}
|
|
29
|
-
onTemplateNodeUpdated(t) {
|
|
30
|
-
super.onTemplateNodeUpdated(t), this._setFormValues();
|
|
31
|
-
}
|
|
32
|
-
_setFormValues() {
|
|
33
|
-
const t = this._getCurrentText();
|
|
34
|
-
this.api.updateValues({
|
|
35
|
-
omnibusDiscountTextAfter: t
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
_getCurrentText() {
|
|
39
|
-
if (!this.currentNode || !("getAttribute" in this.currentNode))
|
|
40
|
-
return u;
|
|
41
|
-
const t = this.currentNode.getAttribute(i);
|
|
42
|
-
return t === null ? u : t;
|
|
43
|
-
}
|
|
44
|
-
_onTextChange(t) {
|
|
45
|
-
if (!this.currentNode || !("closest" in this.currentNode))
|
|
46
|
-
return;
|
|
47
|
-
const e = this.currentNode.closest(T);
|
|
48
|
-
if (!e || !("querySelectorAll" in e))
|
|
49
|
-
return;
|
|
50
|
-
const n = Array.from(
|
|
51
|
-
e.querySelectorAll(`[esd-extension-block-id="${l.OMNIBUS_DISCOUNT}"]`)
|
|
52
|
-
);
|
|
53
|
-
if (!n.length)
|
|
54
|
-
return;
|
|
55
|
-
const o = this.api.getDocumentModifier();
|
|
56
|
-
n.forEach((s) => {
|
|
57
|
-
o.modifyHtml(s).setAttribute(i, t);
|
|
58
|
-
const r = s.querySelector(p);
|
|
59
|
-
if (r) {
|
|
60
|
-
const m = f(r, t);
|
|
61
|
-
o.modifyHtml(r).setInnerHtml(m);
|
|
62
|
-
}
|
|
63
|
-
}), o.apply(new c("Update omnibus discount text after"));
|
|
64
|
-
}
|
|
65
|
-
_listenToFormUpdates() {
|
|
66
|
-
this.api.onValueChanged("omnibusDiscountTextAfter", (t) => {
|
|
67
|
-
this._onTextChange(t);
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
export {
|
|
72
|
-
b as OmnibusDiscountTextAfterControl
|
|
73
|
-
};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { ModificationDescription as c } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
-
import { CommonControl as l } from "../../../common-control.js";
|
|
3
|
-
import { RecommendationBlockId as a } from "../../constants/blockIds.js";
|
|
4
|
-
import { RecommendationControlId as d } from "../../constants/controlIds.js";
|
|
5
|
-
import { CONTAINER_SELECTOR as T } from "../../constants/selectors.js";
|
|
6
|
-
import { preserveTextStyles as f } from "../../utils/preserveTextStyles.js";
|
|
7
|
-
const i = "data-text-before", u = "", p = ".omnibus-text-before";
|
|
8
|
-
class B extends l {
|
|
9
|
-
getId() {
|
|
10
|
-
return d.OMNIBUS_DISCOUNT_TEXT_BEFORE;
|
|
11
|
-
}
|
|
12
|
-
getTemplate() {
|
|
13
|
-
return `
|
|
14
|
-
<div class="omnibus-discount-text-before-control-container">
|
|
15
|
-
${this._GuTwoColumns([
|
|
16
|
-
this._GuLabel({ text: "Text Before" }),
|
|
17
|
-
this._GuTextInput({
|
|
18
|
-
name: "omnibusDiscountTextBefore",
|
|
19
|
-
placeholder: "e.g., Save ",
|
|
20
|
-
className: "es-180w"
|
|
21
|
-
})
|
|
22
|
-
])}
|
|
23
|
-
</div>
|
|
24
|
-
`;
|
|
25
|
-
}
|
|
26
|
-
onRender() {
|
|
27
|
-
this._setFormValues(), this._listenToFormUpdates();
|
|
28
|
-
}
|
|
29
|
-
onTemplateNodeUpdated(e) {
|
|
30
|
-
super.onTemplateNodeUpdated(e), this._setFormValues();
|
|
31
|
-
}
|
|
32
|
-
_setFormValues() {
|
|
33
|
-
const e = this._getCurrentText();
|
|
34
|
-
this.api.updateValues({
|
|
35
|
-
omnibusDiscountTextBefore: e
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
_getCurrentText() {
|
|
39
|
-
if (!this.currentNode || !("getAttribute" in this.currentNode))
|
|
40
|
-
return u;
|
|
41
|
-
const e = this.currentNode.getAttribute(i);
|
|
42
|
-
return e === null ? u : e;
|
|
43
|
-
}
|
|
44
|
-
_onTextChange(e) {
|
|
45
|
-
if (!this.currentNode || !("closest" in this.currentNode))
|
|
46
|
-
return;
|
|
47
|
-
const t = this.currentNode.closest(T);
|
|
48
|
-
if (!t || !("querySelectorAll" in t))
|
|
49
|
-
return;
|
|
50
|
-
const n = Array.from(
|
|
51
|
-
t.querySelectorAll(`[esd-extension-block-id="${a.OMNIBUS_DISCOUNT}"]`)
|
|
52
|
-
);
|
|
53
|
-
if (!n.length)
|
|
54
|
-
return;
|
|
55
|
-
const o = this.api.getDocumentModifier();
|
|
56
|
-
n.forEach((s) => {
|
|
57
|
-
o.modifyHtml(s).setAttribute(i, e);
|
|
58
|
-
const r = s.querySelector(p);
|
|
59
|
-
if (r) {
|
|
60
|
-
const m = f(r, e);
|
|
61
|
-
o.modifyHtml(r).setInnerHtml(m);
|
|
62
|
-
}
|
|
63
|
-
}), o.apply(new c("Update omnibus discount text before"));
|
|
64
|
-
}
|
|
65
|
-
_listenToFormUpdates() {
|
|
66
|
-
this.api.onValueChanged("omnibusDiscountTextBefore", (e) => {
|
|
67
|
-
this._onTextChange(e);
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
export {
|
|
72
|
-
B as OmnibusDiscountTextBeforeControl
|
|
73
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { createPaddingsControl as n, createTextBackgroundColorControl as e, createTextFontFamilyControl as C, createTextStyleControl as I, createTextSizeControl as l, createTextColorControl as i, createTextAlignControl as c } from "../../../controlFactories.js";
|
|
2
|
-
import { RecommendationBlockId as o } from "../../constants/blockIds.js";
|
|
3
|
-
import { RecommendationControlId as t } from "../../constants/controlIds.js";
|
|
4
|
-
import { CONTAINER_SELECTOR as r } from "../../constants/selectors.js";
|
|
5
|
-
import { OmnibusPriceTextAfterControl as O } from "./textAfter.js";
|
|
6
|
-
import { OmnibusPriceTextBeforeControl as _ } from "./textBefore.js";
|
|
7
|
-
const m = c(
|
|
8
|
-
t.OMNIBUS_PRICE_ALIGN,
|
|
9
|
-
o.OMNIBUS_PRICE,
|
|
10
|
-
r
|
|
11
|
-
), S = i(
|
|
12
|
-
t.OMNIBUS_PRICE_COLOR,
|
|
13
|
-
o.OMNIBUS_PRICE,
|
|
14
|
-
r
|
|
15
|
-
), B = l(
|
|
16
|
-
t.OMNIBUS_PRICE_SIZE,
|
|
17
|
-
o.OMNIBUS_PRICE,
|
|
18
|
-
r
|
|
19
|
-
), N = I(
|
|
20
|
-
t.OMNIBUS_PRICE_STYLE,
|
|
21
|
-
o.OMNIBUS_PRICE,
|
|
22
|
-
r
|
|
23
|
-
), P = C(
|
|
24
|
-
t.OMNIBUS_PRICE_FONT_FAMILY,
|
|
25
|
-
o.OMNIBUS_PRICE,
|
|
26
|
-
r
|
|
27
|
-
), R = e(
|
|
28
|
-
t.OMNIBUS_PRICE_BACKGROUND,
|
|
29
|
-
o.OMNIBUS_PRICE,
|
|
30
|
-
r
|
|
31
|
-
), a = n(
|
|
32
|
-
t.OMNIBUS_PRICE_PADDINGS,
|
|
33
|
-
o.OMNIBUS_PRICE,
|
|
34
|
-
r
|
|
35
|
-
), f = {
|
|
36
|
-
align: m,
|
|
37
|
-
color: S,
|
|
38
|
-
size: B,
|
|
39
|
-
style: N,
|
|
40
|
-
fontFamily: P,
|
|
41
|
-
background: R,
|
|
42
|
-
paddings: a,
|
|
43
|
-
textBefore: _,
|
|
44
|
-
textAfter: O
|
|
45
|
-
};
|
|
46
|
-
export {
|
|
47
|
-
f as OmnibusPriceControls
|
|
48
|
-
};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { ModificationDescription as c } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
-
import { CommonControl as a } from "../../../common-control.js";
|
|
3
|
-
import { RecommendationBlockId as l } from "../../constants/blockIds.js";
|
|
4
|
-
import { RecommendationControlId as d } from "../../constants/controlIds.js";
|
|
5
|
-
import { CONTAINER_SELECTOR as T } from "../../constants/selectors.js";
|
|
6
|
-
import { preserveTextStyles as f } from "../../utils/preserveTextStyles.js";
|
|
7
|
-
const s = "data-text-after", m = "", p = ".omnibus-text-after";
|
|
8
|
-
class N extends a {
|
|
9
|
-
getId() {
|
|
10
|
-
return d.OMNIBUS_PRICE_TEXT_AFTER;
|
|
11
|
-
}
|
|
12
|
-
getTemplate() {
|
|
13
|
-
return `
|
|
14
|
-
<div class="omnibus-price-text-after-control-container">
|
|
15
|
-
${this._GuTwoColumns([
|
|
16
|
-
this._GuLabel({ text: "Text After" }),
|
|
17
|
-
this._GuTextInput({
|
|
18
|
-
name: "omnibusPriceTextAfter",
|
|
19
|
-
placeholder: "e.g., (incl. VAT)",
|
|
20
|
-
className: "es-180w"
|
|
21
|
-
})
|
|
22
|
-
])}
|
|
23
|
-
</div>
|
|
24
|
-
`;
|
|
25
|
-
}
|
|
26
|
-
onRender() {
|
|
27
|
-
this._setFormValues(), this._listenToFormUpdates();
|
|
28
|
-
}
|
|
29
|
-
onTemplateNodeUpdated(t) {
|
|
30
|
-
super.onTemplateNodeUpdated(t), this._setFormValues();
|
|
31
|
-
}
|
|
32
|
-
_setFormValues() {
|
|
33
|
-
const t = this._getCurrentText();
|
|
34
|
-
this.api.updateValues({
|
|
35
|
-
omnibusPriceTextAfter: t
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
_getCurrentText() {
|
|
39
|
-
if (!this.currentNode || !("getAttribute" in this.currentNode))
|
|
40
|
-
return m;
|
|
41
|
-
const t = this.currentNode.getAttribute(s);
|
|
42
|
-
return t === null ? m : t;
|
|
43
|
-
}
|
|
44
|
-
_onTextChange(t) {
|
|
45
|
-
if (!this.currentNode || !("closest" in this.currentNode))
|
|
46
|
-
return;
|
|
47
|
-
const e = this.currentNode.closest(T);
|
|
48
|
-
if (!e || !("querySelectorAll" in e))
|
|
49
|
-
return;
|
|
50
|
-
const n = Array.from(
|
|
51
|
-
e.querySelectorAll(`[esd-extension-block-id="${l.OMNIBUS_PRICE}"]`)
|
|
52
|
-
);
|
|
53
|
-
if (!n.length)
|
|
54
|
-
return;
|
|
55
|
-
const r = this.api.getDocumentModifier();
|
|
56
|
-
n.forEach((i) => {
|
|
57
|
-
r.modifyHtml(i).setAttribute(s, t);
|
|
58
|
-
const o = i.querySelector(p);
|
|
59
|
-
if (o) {
|
|
60
|
-
const u = f(o, t);
|
|
61
|
-
r.modifyHtml(o).setInnerHtml(u);
|
|
62
|
-
}
|
|
63
|
-
}), r.apply(new c("Update omnibus price text after"));
|
|
64
|
-
}
|
|
65
|
-
_listenToFormUpdates() {
|
|
66
|
-
this.api.onValueChanged("omnibusPriceTextAfter", (t) => {
|
|
67
|
-
this._onTextChange(t);
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
export {
|
|
72
|
-
N as OmnibusPriceTextAfterControl
|
|
73
|
-
};
|