@useinsider/guido 1.0.3-beta.d1ff593 → 1.0.3-beta.d574817
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 +144 -3
- package/dist/components/Guido.vue.js +11 -9
- package/dist/components/Guido.vue2.js +76 -70
- package/dist/components/organisms/header/LeftSlot.vue.js +1 -1
- package/dist/components/organisms/header/LeftSlot.vue2.js +16 -15
- package/dist/components/organisms/header/RightSlot.vue.js +11 -11
- package/dist/components/organisms/header/RightSlot.vue2.js +23 -22
- package/dist/components/organisms/onboarding/NewVersionPopup.vue.js +9 -9
- package/dist/components/organisms/onboarding/NewVersionPopup.vue2.js +30 -17
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue.js +12 -10
- package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +19 -18
- package/dist/composables/useBlocksConfig.js +49 -0
- package/dist/composables/useGuidoActions.js +19 -9
- package/dist/composables/useStripo.js +49 -58
- package/dist/config/compiler/unsubscribeCompilerRules.js +33 -28
- package/dist/config/migrator/recommendationMigrator.js +188 -98
- package/dist/enums/date.js +6 -0
- package/dist/enums/defaults.js +16 -8
- package/dist/enums/onboarding.js +2 -1
- package/dist/enums/unsubscribe.js +27 -25
- package/dist/extensions/Blocks/Checkbox/extension.js +2 -2
- package/dist/extensions/Blocks/CouponBlock/extension.js +2 -2
- package/dist/extensions/Blocks/Recommendation/block.js +1 -1
- package/dist/extensions/Blocks/Recommendation/cardCompositionControl.js +66 -298
- package/dist/extensions/Blocks/Recommendation/constants.js +5 -0
- package/dist/extensions/Blocks/Recommendation/control.js +5 -4
- package/dist/extensions/Blocks/Recommendation/controls/button/align.js +7 -6
- package/dist/extensions/Blocks/Recommendation/controls/button/border.js +7 -6
- package/dist/extensions/Blocks/Recommendation/controls/button/borderRadius.js +7 -6
- package/dist/extensions/Blocks/Recommendation/controls/button/color.js +5 -4
- package/dist/extensions/Blocks/Recommendation/controls/button/fitToContent.js +5 -4
- package/dist/extensions/Blocks/Recommendation/controls/button/fontFamily.js +5 -4
- package/dist/extensions/Blocks/Recommendation/controls/button/margins.js +5 -4
- package/dist/extensions/Blocks/Recommendation/controls/button/paddings.js +5 -4
- package/dist/extensions/Blocks/Recommendation/controls/button/text.js +5 -4
- package/dist/extensions/Blocks/Recommendation/controls/button/textSize.js +5 -4
- package/dist/extensions/Blocks/Recommendation/controls/button/textStyleAndFontColor.js +5 -4
- 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 +5 -4
- package/dist/extensions/Blocks/Recommendation/controls/name/background.js +7 -6
- package/dist/extensions/Blocks/Recommendation/controls/name/color.js +5 -4
- package/dist/extensions/Blocks/Recommendation/controls/name/fontFamily.js +5 -4
- package/dist/extensions/Blocks/Recommendation/controls/name/paddings.js +5 -4
- package/dist/extensions/Blocks/Recommendation/controls/name/size.js +7 -6
- package/dist/extensions/Blocks/Recommendation/controls/name/style.js +7 -6
- 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 +37 -21
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +90 -45
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +1 -1
- package/dist/extensions/Blocks/Recommendation/templates/blockTemplate.js +160 -0
- package/dist/extensions/Blocks/Recommendation/templates/migrationTemplate.js +152 -0
- package/dist/extensions/Blocks/Recommendation/templates/templateUtils.js +180 -0
- package/dist/extensions/DynamicContent/dynamic-content-modal.js +25 -19
- package/dist/extensions/DynamicContent/dynamic-content.js +128 -33
- package/dist/guido.css +1 -1
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +198 -176
- package/dist/package.json.js +1 -1
- package/dist/services/stripoApi.js +1 -1
- package/dist/src/@types/generic.d.ts +42 -6
- package/dist/src/components/Guido.vue.d.ts +4 -2
- package/dist/src/components/organisms/onboarding/NewVersionPopup.vue.d.ts +3 -1
- package/dist/src/components/organisms/onboarding/OnboardingWrapper.vue.d.ts +3 -1
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/composables/useBlocksConfig.d.ts +11 -0
- package/dist/src/composables/useGuidoActions.d.ts +9 -0
- package/dist/src/enums/date.d.ts +4 -0
- package/dist/src/enums/onboarding.d.ts +1 -0
- package/dist/src/extensions/Blocks/Recommendation/cardCompositionControl.d.ts +5 -42
- package/dist/src/extensions/Blocks/Recommendation/constants.d.ts +51 -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/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/store/recommendation.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/templates/blockTemplate.d.ts +16 -0
- package/dist/src/extensions/Blocks/Recommendation/{template.d.ts → templates/migrationTemplate.d.ts} +7 -34
- package/dist/src/extensions/Blocks/Recommendation/templates/templateUtils.d.ts +44 -0
- package/dist/src/extensions/DynamicContent/dynamic-content-modal.d.ts +9 -2
- package/dist/src/extensions/DynamicContent/dynamic-content.d.ts +52 -2
- package/dist/src/stores/config.d.ts +10 -2
- package/dist/src/stores/dynamic-content.d.ts +3 -3
- package/dist/src/stores/editor.d.ts +1 -1
- package/dist/src/stores/onboarding.d.ts +1 -1
- package/dist/src/stores/preview.d.ts +1 -1
- package/dist/src/stores/recommendation.d.ts +1 -1
- package/dist/src/stores/save-as-template.d.ts +1 -1
- package/dist/src/stores/toaster.d.ts +1 -1
- package/dist/src/stores/unsubscribe.d.ts +1 -1
- package/dist/src/stores/version-history.d.ts +1 -1
- package/dist/src/utils/dateUtil.d.ts +21 -0
- package/dist/src/utils/environmentUtil.d.ts +5 -0
- package/dist/src/utils/genericUtil.d.ts +1 -0
- package/dist/static/styles/components/narrow-panel.css.js +10 -0
- package/dist/static/styles/customEditorStyle.css.js +5 -0
- package/dist/stores/config.js +5 -5
- package/dist/stores/dynamic-content.js +2 -2
- package/dist/stores/editor.js +1 -1
- package/dist/stores/onboarding.js +27 -27
- package/dist/stores/preview.js +1 -1
- package/dist/stores/recommendation.js +3 -3
- package/dist/stores/save-as-template.js +2 -2
- package/dist/stores/toaster.js +1 -1
- package/dist/stores/unsubscribe.js +1 -1
- package/dist/stores/version-history.js +4 -4
- package/dist/utils/dateUtil.js +24 -3
- package/dist/utils/environmentUtil.js +4 -0
- package/dist/utils/genericUtil.js +20 -9
- package/package.json +2 -2
- package/dist/extensions/Blocks/Recommendation/template.js +0 -314
|
@@ -1,335 +1,103 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { ModificationDescription as
|
|
5
|
-
import { CommonControl as
|
|
6
|
-
const
|
|
7
|
-
{ key: "productImage", label: "Product Image" },
|
|
8
|
-
{ key: "productName", label: "Product Name" },
|
|
9
|
-
{ key: "productPrice", label: "Product Price" },
|
|
10
|
-
{ key: "productOriginalPrice", label: "Product Original Price" },
|
|
11
|
-
{ key: "productButton", label: "Product Button" }
|
|
1
|
+
var m = Object.defineProperty;
|
|
2
|
+
var y = (n, o, i) => o in n ? m(n, o, { enumerable: !0, configurable: !0, writable: !0, value: i }) : n[o] = i;
|
|
3
|
+
var a = (n, o, i) => y(n, typeof o != "symbol" ? o + "" : o, i);
|
|
4
|
+
import { ModificationDescription as u } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
|
+
import { CommonControl as b } from "../common-control.js";
|
|
6
|
+
const h = "ui-elements-recommendation-card-composition", s = [
|
|
7
|
+
{ key: "productImage", label: "Product Image", visible: !0 },
|
|
8
|
+
{ key: "productName", label: "Product Name", visible: !0 },
|
|
9
|
+
{ key: "productPrice", label: "Product Price", visible: !0 },
|
|
10
|
+
{ key: "productOriginalPrice", label: "Product Original Price", visible: !0 },
|
|
11
|
+
{ key: "productButton", label: "Product Button", visible: !0 }
|
|
12
12
|
];
|
|
13
|
-
class
|
|
13
|
+
class g extends b {
|
|
14
14
|
constructor() {
|
|
15
15
|
super(...arguments);
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
a(this, "currentComposition", []);
|
|
17
|
+
a(this, "currentVisibility", {});
|
|
18
18
|
}
|
|
19
19
|
getId() {
|
|
20
|
-
return
|
|
20
|
+
return h;
|
|
21
21
|
}
|
|
22
22
|
getTemplate() {
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return console.debug("orderable", this._GuOrderable("cardComposition", t)), `
|
|
32
|
-
<div class="container">
|
|
33
|
-
${this._GuLabel({ text: "Card Element Order" })}
|
|
34
|
-
${this._GuOrderable("cardComposition", t)}
|
|
35
|
-
</div>
|
|
36
|
-
`;
|
|
37
|
-
}
|
|
38
|
-
_getTextColor(t, e) {
|
|
39
|
-
return `
|
|
40
|
-
${this._GuTwoColumns([
|
|
41
|
-
this._GuLabel({ text: t }),
|
|
42
|
-
this._GuColorPicker(e)
|
|
43
|
-
])}
|
|
44
|
-
`;
|
|
45
|
-
}
|
|
46
|
-
_getFontFamily(t, e) {
|
|
47
|
-
return `
|
|
48
|
-
${this._GuTwoColumns([
|
|
49
|
-
this._GuLabel({ text: t }),
|
|
50
|
-
this._GuFontFamily(e, "Select Font")
|
|
51
|
-
])}
|
|
52
|
-
`;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Generate styling controls for Product Name element
|
|
56
|
-
*/
|
|
57
|
-
_getProductNameStylingControls() {
|
|
58
|
-
return `
|
|
59
|
-
${this._getTextColor("Text Color", "productName.color")}
|
|
60
|
-
|
|
61
|
-
<div class="control-group" style="padding: 10px 0;">
|
|
62
|
-
${this._GuLabel({ text: "Text Alignment" })}
|
|
63
|
-
${this._GuRadioButtons("productName.textAlign", [
|
|
64
|
-
{ text: "Left", value: "left" },
|
|
65
|
-
{ text: "Center", value: "center" },
|
|
66
|
-
{ text: "Right", value: "right" },
|
|
67
|
-
{ text: "Justify", value: "justify" }
|
|
68
|
-
])}
|
|
69
|
-
</div>
|
|
70
|
-
|
|
71
|
-
${this._getFontFamily("Font Family", "productName.fontFamily")}
|
|
72
|
-
|
|
73
|
-
<div class="control-group" style="padding: 10px 0;">
|
|
74
|
-
${this._GuLabel({ text: "Font Size (px)" })}
|
|
75
|
-
${this._GuCounter({ name: "productName.fontSize", minValue: 8, maxValue: 72, step: 1 })}
|
|
76
|
-
</div>
|
|
77
|
-
|
|
78
|
-
<div class="control-group" style="padding: 10px 0;">
|
|
79
|
-
${this._GuLabel({ text: "Text Style" })}
|
|
80
|
-
<div style="display: flex; flex-direction: column; gap: 8px; margin-top: 8px;">
|
|
81
|
-
${this._GuCheckbox("productName.fontWeight", "Bold")}
|
|
82
|
-
${this._GuCheckbox("productName.fontStyle", "Italic")}
|
|
83
|
-
${this._GuCheckbox("productName.textDecoration", "Underline")}
|
|
23
|
+
const i = s.map((e) => ({
|
|
24
|
+
key: e.key,
|
|
25
|
+
label: e.label,
|
|
26
|
+
content: `
|
|
27
|
+
<div style="display: flex; align-items: center; justify-content: space-between;
|
|
28
|
+
padding: 8px; gap: 8px;">
|
|
29
|
+
<span style="flex: 1;">${e.label}</span>
|
|
30
|
+
${this._GuToggle(`visibility_${e.key}`)}
|
|
84
31
|
</div>
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Generate styling controls for Product Price element
|
|
90
|
-
*/
|
|
91
|
-
_getProductPriceStylingControls() {
|
|
32
|
+
`
|
|
33
|
+
}));
|
|
92
34
|
return `
|
|
93
|
-
<div class="
|
|
94
|
-
${this._GuLabel({ text: "
|
|
95
|
-
${this.
|
|
96
|
-
</div>
|
|
97
|
-
|
|
98
|
-
<div class="control-group" style="padding: 10px 0;">
|
|
99
|
-
${this._GuLabel({ text: "Text Alignment" })}
|
|
100
|
-
${this._GuRadioButtons("productPrice.textAlign", [
|
|
101
|
-
{ text: "Left", value: "left" },
|
|
102
|
-
{ text: "Center", value: "center" },
|
|
103
|
-
{ text: "Right", value: "right" }
|
|
104
|
-
])}
|
|
105
|
-
</div>
|
|
106
|
-
|
|
107
|
-
<div class="control-group" style="padding: 10px 0;">
|
|
108
|
-
${this._GuLabel({ text: "Font Size (px)" })}
|
|
109
|
-
${this._GuCounter({ name: "productPrice.fontSize", minValue: 8, maxValue: 48, step: 1 })}
|
|
110
|
-
</div>
|
|
111
|
-
|
|
112
|
-
<div class="control-group" style="padding: 10px 0;">
|
|
113
|
-
${this._GuCheckbox("productPrice.fontWeight", "Bold")}
|
|
114
|
-
</div>
|
|
115
|
-
`;
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Generate styling controls for Product Original Price element
|
|
119
|
-
*/
|
|
120
|
-
_getProductOriginalPriceStylingControls() {
|
|
121
|
-
return `
|
|
122
|
-
<div class="control-group" style="padding: 10px 0;">
|
|
123
|
-
${this._GuLabel({ text: "Text Color" })}
|
|
124
|
-
${this._GuColorPicker("productOriginalPrice.color")}
|
|
125
|
-
</div>
|
|
126
|
-
|
|
127
|
-
<div class="control-group" style="padding: 10px 0;">
|
|
128
|
-
${this._GuLabel({ text: "Font Size (px)" })}
|
|
129
|
-
${this._GuCounter({ name: "productOriginalPrice.fontSize", minValue: 8, maxValue: 48, step: 1 })}
|
|
130
|
-
</div>
|
|
131
|
-
`;
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Generate styling controls for Product Button element
|
|
135
|
-
*/
|
|
136
|
-
_getProductButtonStylingControls() {
|
|
137
|
-
return `
|
|
138
|
-
<div class="control-group" style="padding: 10px 0;">
|
|
139
|
-
${this._GuLabel({ text: "Button Text Color" })}
|
|
140
|
-
${this._GuColorPicker("productButton.color")}
|
|
141
|
-
</div>
|
|
142
|
-
|
|
143
|
-
<div class="control-group" style="padding: 10px 0;">
|
|
144
|
-
${this._GuLabel({ text: "Font Size (px)" })}
|
|
145
|
-
${this._GuCounter({ name: "productButton.fontSize", minValue: 10, maxValue: 32, step: 1 })}
|
|
146
|
-
</div>
|
|
147
|
-
|
|
148
|
-
<div class="control-group" style="padding: 10px 0;">
|
|
149
|
-
${this._GuCheckbox("productButton.fontWeight", "Bold")}
|
|
35
|
+
<div class="container">
|
|
36
|
+
${this._GuLabel({ text: "Card Element Order & Visibility" })}
|
|
37
|
+
${this._GuOrderable("cardComposition", i)}
|
|
150
38
|
</div>
|
|
151
39
|
`;
|
|
152
40
|
}
|
|
153
41
|
onRender() {
|
|
154
|
-
this._initializeComposition(), this.
|
|
155
|
-
this.currentComposition =
|
|
156
|
-
}),
|
|
157
|
-
this.
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}), this.api.onValueChanged("productName.fontFamily", (t) => {
|
|
161
|
-
this._updateElementStyling("productName", "fontFamily", t), this._applyStylingToElement("productName");
|
|
162
|
-
}), this.api.onValueChanged("productName.fontSize", (t) => {
|
|
163
|
-
this._updateElementStyling("productName", "fontSize", t), this._applyStylingToElement("productName");
|
|
164
|
-
}), this.api.onValueChanged("productName.fontWeight", (t) => {
|
|
165
|
-
this._updateElementStyling("productName", "fontWeight", t), this._applyStylingToElement("productName");
|
|
166
|
-
}), this.api.onValueChanged("productName.fontStyle", (t) => {
|
|
167
|
-
this._updateElementStyling("productName", "fontStyle", t), this._applyStylingToElement("productName");
|
|
168
|
-
}), this.api.onValueChanged("productName.textDecoration", (t) => {
|
|
169
|
-
this._updateElementStyling("productName", "textDecoration", t), this._applyStylingToElement("productName");
|
|
170
|
-
}), this.api.onValueChanged("productPrice.color", (t) => {
|
|
171
|
-
this._updateElementStyling("productPrice", "color", t), this._applyStylingToElement("productPrice");
|
|
172
|
-
}), this.api.onValueChanged("productPrice.textAlign", (t) => {
|
|
173
|
-
this._updateElementStyling("productPrice", "textAlign", t), this._applyStylingToElement("productPrice");
|
|
174
|
-
}), this.api.onValueChanged("productPrice.fontSize", (t) => {
|
|
175
|
-
this._updateElementStyling("productPrice", "fontSize", t), this._applyStylingToElement("productPrice");
|
|
176
|
-
}), this.api.onValueChanged("productPrice.fontWeight", (t) => {
|
|
177
|
-
this._updateElementStyling("productPrice", "fontWeight", t), this._applyStylingToElement("productPrice");
|
|
178
|
-
}), this.api.onValueChanged("productOriginalPrice.color", (t) => {
|
|
179
|
-
this._updateElementStyling("productOriginalPrice", "color", t), this._applyStylingToElement("productOriginalPrice");
|
|
180
|
-
}), this.api.onValueChanged("productOriginalPrice.fontSize", (t) => {
|
|
181
|
-
this._updateElementStyling("productOriginalPrice", "fontSize", t), this._applyStylingToElement("productOriginalPrice");
|
|
182
|
-
}), this.api.onValueChanged("productButton.color", (t) => {
|
|
183
|
-
this._updateElementStyling("productButton", "color", t), this._applyStylingToElement("productButton");
|
|
184
|
-
}), this.api.onValueChanged("productButton.fontSize", (t) => {
|
|
185
|
-
this._updateElementStyling("productButton", "fontSize", t), this._applyStylingToElement("productButton");
|
|
186
|
-
}), this.api.onValueChanged("productButton.fontWeight", (t) => {
|
|
187
|
-
this._updateElementStyling("productButton", "fontWeight", t), this._applyStylingToElement("productButton");
|
|
42
|
+
this._initializeComposition(), this.api.onValueChanged("cardComposition", (i) => {
|
|
43
|
+
this.currentComposition = i, this._applyCompositionToBlock(i);
|
|
44
|
+
}), s.forEach((i) => {
|
|
45
|
+
this.api.onValueChanged(`visibility_${i.key}`, (e) => {
|
|
46
|
+
this.currentVisibility[i.key] = e, this._applyVisibilityToBlock();
|
|
47
|
+
});
|
|
188
48
|
});
|
|
189
49
|
}
|
|
190
|
-
onTemplateNodeUpdated(
|
|
191
|
-
super.onTemplateNodeUpdated(
|
|
50
|
+
onTemplateNodeUpdated(i) {
|
|
51
|
+
super.onTemplateNodeUpdated(i), this._initializeComposition();
|
|
192
52
|
}
|
|
193
53
|
/**
|
|
194
|
-
* Initialize the composition order from the block or use defaults
|
|
54
|
+
* Initialize the composition order and visibility from the block or use defaults
|
|
195
55
|
*/
|
|
196
56
|
_initializeComposition() {
|
|
197
|
-
var
|
|
198
|
-
const
|
|
199
|
-
let e = null;
|
|
200
|
-
if (
|
|
201
|
-
const
|
|
202
|
-
|
|
57
|
+
var p;
|
|
58
|
+
const i = (p = this.currentNode) == null ? void 0 : p.querySelector(".ins-recommendation-v3-block-v2");
|
|
59
|
+
let e = null, l = null;
|
|
60
|
+
if (i && "getAttribute" in i && (e = i.getAttribute("data-card-composition"), l = i.getAttribute("data-card-visibility")), e) {
|
|
61
|
+
const t = e.split(",").filter(Boolean), r = s.map((c) => c.key);
|
|
62
|
+
t.every((c) => r.includes(c)) && t.length > 0 ? this.currentComposition = t : this.currentComposition = r;
|
|
203
63
|
} else
|
|
204
|
-
this.currentComposition =
|
|
205
|
-
|
|
206
|
-
cardComposition: this.currentComposition
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Apply the reordered composition to the block's HTML structure
|
|
211
|
-
*/
|
|
212
|
-
_applyCompositionToBlock(t) {
|
|
213
|
-
if (!this.currentNode)
|
|
214
|
-
return;
|
|
215
|
-
const e = this.currentNode.querySelector(".ins-recommendation-v3-block-v2");
|
|
216
|
-
e && this.api.getDocumentModifier().modifyHtml(e).setAttribute("data-card-composition", t.join(",")).apply(new p("Stored card composition order")), console.debug("Card composition updated:", t);
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* Initialize styling from stored block attributes
|
|
220
|
-
*/
|
|
221
|
-
_initializeStyling() {
|
|
222
|
-
var i;
|
|
223
|
-
const t = (i = this.currentNode) == null ? void 0 : i.querySelector(".ins-recommendation-v3-block-v2");
|
|
224
|
-
if (!t || !("getAttribute" in t)) {
|
|
225
|
-
this._loadDefaultStyling();
|
|
226
|
-
return;
|
|
227
|
-
}
|
|
228
|
-
const e = t.getAttribute("data-card-styling");
|
|
229
|
-
if (e)
|
|
64
|
+
this.currentComposition = s.map((t) => t.key);
|
|
65
|
+
if (l)
|
|
230
66
|
try {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
67
|
+
const t = JSON.parse(l);
|
|
68
|
+
this.currentVisibility = t;
|
|
69
|
+
} catch {
|
|
70
|
+
this.currentVisibility = s.reduce((t, r) => (t[r.key] = r.visible, t), {});
|
|
234
71
|
}
|
|
235
72
|
else
|
|
236
|
-
this.
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
this.
|
|
243
|
-
productName: {
|
|
244
|
-
color: "#333333",
|
|
245
|
-
textAlign: "center",
|
|
246
|
-
fontSize: 16,
|
|
247
|
-
fontWeight: !0
|
|
248
|
-
},
|
|
249
|
-
productPrice: {
|
|
250
|
-
color: "#333333",
|
|
251
|
-
textAlign: "center",
|
|
252
|
-
fontSize: 16,
|
|
253
|
-
fontWeight: !0
|
|
254
|
-
},
|
|
255
|
-
productOriginalPrice: {
|
|
256
|
-
color: "#999999",
|
|
257
|
-
fontSize: 14
|
|
258
|
-
},
|
|
259
|
-
productButton: {
|
|
260
|
-
color: "#333333",
|
|
261
|
-
fontSize: 16
|
|
262
|
-
}
|
|
263
|
-
}, this._populateControlsWithStyling();
|
|
264
|
-
}
|
|
265
|
-
/**
|
|
266
|
-
* Populate control values with current styling
|
|
267
|
-
*/
|
|
268
|
-
_populateControlsWithStyling() {
|
|
269
|
-
const t = {};
|
|
270
|
-
if (this.currentStyling.productName) {
|
|
271
|
-
const e = this.currentStyling.productName;
|
|
272
|
-
e.color && (t["productName.color"] = e.color), e.textAlign && (t["productName.textAlign"] = e.textAlign), e.fontFamily && (t["productName.fontFamily"] = e.fontFamily), e.fontSize && (t["productName.fontSize"] = e.fontSize), e.fontWeight !== void 0 && (t["productName.fontWeight"] = e.fontWeight), e.fontStyle !== void 0 && (t["productName.fontStyle"] = e.fontStyle), e.textDecoration !== void 0 && (t["productName.textDecoration"] = e.textDecoration);
|
|
273
|
-
}
|
|
274
|
-
if (this.currentStyling.productPrice) {
|
|
275
|
-
const e = this.currentStyling.productPrice;
|
|
276
|
-
e.color && (t["productPrice.color"] = e.color), e.textAlign && (t["productPrice.textAlign"] = e.textAlign), e.fontSize && (t["productPrice.fontSize"] = e.fontSize), e.fontWeight !== void 0 && (t["productPrice.fontWeight"] = e.fontWeight);
|
|
277
|
-
}
|
|
278
|
-
if (this.currentStyling.productOriginalPrice) {
|
|
279
|
-
const e = this.currentStyling.productOriginalPrice;
|
|
280
|
-
e.color && (t["productOriginalPrice.color"] = e.color), e.fontSize && (t["productOriginalPrice.fontSize"] = e.fontSize);
|
|
281
|
-
}
|
|
282
|
-
if (this.currentStyling.productButton) {
|
|
283
|
-
const e = this.currentStyling.productButton;
|
|
284
|
-
e.color && (t["productButton.color"] = e.color), e.fontSize && (t["productButton.fontSize"] = e.fontSize), e.fontWeight !== void 0 && (t["productButton.fontWeight"] = e.fontWeight);
|
|
285
|
-
}
|
|
286
|
-
this.api.updateValues(t);
|
|
287
|
-
}
|
|
288
|
-
/**
|
|
289
|
-
* Update styling object for a specific element and property
|
|
290
|
-
*/
|
|
291
|
-
_updateElementStyling(t, e, i) {
|
|
292
|
-
this.currentStyling[t] || (this.currentStyling[t] = {});
|
|
293
|
-
const o = this.currentStyling[t];
|
|
294
|
-
o && (e === "color" && typeof i == "string" ? o.color = i : e === "textAlign" && typeof i == "string" ? o.textAlign = i : e === "fontFamily" && typeof i == "string" ? o.fontFamily = i : e === "fontSize" && typeof i == "number" ? o.fontSize = i : e === "fontWeight" && typeof i == "boolean" ? o.fontWeight = i : e === "fontStyle" && typeof i == "boolean" ? o.fontStyle = i : e === "textDecoration" && typeof i == "boolean" && (o.textDecoration = i)), this._persistStyling();
|
|
73
|
+
this.currentVisibility = s.reduce((t, r) => (t[r.key] = r.visible, t), {});
|
|
74
|
+
const d = {
|
|
75
|
+
cardComposition: this.currentComposition
|
|
76
|
+
};
|
|
77
|
+
s.forEach((t) => {
|
|
78
|
+
d[`visibility_${t.key}`] = this.currentVisibility[t.key] ?? !0;
|
|
79
|
+
}), this.api.updateValues(d);
|
|
295
80
|
}
|
|
296
81
|
/**
|
|
297
|
-
*
|
|
82
|
+
* Apply the reordered composition to the block's HTML structure
|
|
298
83
|
*/
|
|
299
|
-
|
|
84
|
+
_applyCompositionToBlock(i) {
|
|
300
85
|
if (!this.currentNode)
|
|
301
86
|
return;
|
|
302
|
-
const
|
|
303
|
-
|
|
87
|
+
const e = this.currentNode.querySelector(".ins-recommendation-v3-block-v2");
|
|
88
|
+
e && this.api.getDocumentModifier().modifyHtml(e).setAttribute("data-card-composition", i.join(",")).apply(new u("Stored card composition order"));
|
|
304
89
|
}
|
|
305
90
|
/**
|
|
306
|
-
* Apply
|
|
91
|
+
* Apply visibility changes to the block's HTML structure
|
|
307
92
|
*/
|
|
308
|
-
|
|
93
|
+
_applyVisibilityToBlock() {
|
|
309
94
|
if (!this.currentNode)
|
|
310
95
|
return;
|
|
311
|
-
const
|
|
312
|
-
|
|
313
|
-
return;
|
|
314
|
-
const o = {
|
|
315
|
-
productName: ".product-name-cell",
|
|
316
|
-
productPrice: ".price-cell .current-price",
|
|
317
|
-
productOriginalPrice: ".price-cell .old-price",
|
|
318
|
-
productButton: ".buy-button"
|
|
319
|
-
}[t];
|
|
320
|
-
if (!o)
|
|
321
|
-
return;
|
|
322
|
-
this.currentNode.querySelectorAll(o).forEach((a) => {
|
|
323
|
-
if (!a || !("style" in a))
|
|
324
|
-
return;
|
|
325
|
-
const n = [];
|
|
326
|
-
e.color && n.push(`color: ${e.color}`), e.textAlign && n.push(`text-align: ${e.textAlign}`), e.fontFamily && n.push(`font-family: ${e.fontFamily}`), e.fontSize && n.push(`font-size: ${e.fontSize}px`), e.fontWeight ? n.push("font-weight: bold") : e.fontWeight === !1 && n.push("font-weight: normal"), e.fontStyle ? n.push("font-style: italic") : e.fontStyle === !1 && n.push("font-style: normal"), e.textDecoration ? n.push("text-decoration: underline") : e.textDecoration === !1 && n.push("text-decoration: none");
|
|
327
|
-
const g = [...(("getAttribute" in a ? a.getAttribute("style") : null) || "").split(";").map((r) => r.trim()).filter((r) => r && !r.startsWith("color:") && !r.startsWith("text-align:") && !r.startsWith("font-family:") && !r.startsWith("font-size:") && !r.startsWith("font-weight:") && !r.startsWith("font-style:") && !r.startsWith("text-decoration:")), ...n].join("; ");
|
|
328
|
-
this.api.getDocumentModifier().modifyHtml(a).setAttribute("style", g).apply(new p(`Applied ${t} styling`));
|
|
329
|
-
});
|
|
96
|
+
const i = this.currentNode.querySelector(".ins-recommendation-v3-block-v2");
|
|
97
|
+
i && this.api.getDocumentModifier().modifyHtml(i).setAttribute("data-card-visibility", JSON.stringify(this.currentVisibility)).apply(new u("Stored card visibility settings"));
|
|
330
98
|
}
|
|
331
99
|
}
|
|
332
100
|
export {
|
|
333
|
-
|
|
334
|
-
|
|
101
|
+
h as COMPOSITION_CONTROL_BLOCK_ID,
|
|
102
|
+
g as RecommendationCardCompositionControl
|
|
335
103
|
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var o = /* @__PURE__ */ ((c) => (c.BUTTON = "recommendation-block-button", c.NAME = "recommendation-block-name", c.PRICE = "recommendation-block-price", c.OLD_PRICE = "recommendation-block-old-price", c.IMAGE = "recommendation-block-image", c))(o || {}), r = /* @__PURE__ */ ((c) => (c.BUTTON_ALIGN = "recommendation-block-button-align-control", c.BUTTON_BORDER = "recommendation-block-button-border-control", c.BUTTON_BORDER_RADIUS = "recommendation-block-button-border-radius-control", c.BUTTON_COLOR = "recommendation-block-button-color-control", c.BUTTON_FIT_TO_CONTENT = "recommendation-block-button-fit-to-content-control", c.BUTTON_FONT_FAMILY = "recommendation-block-button-font-family-control", c.BUTTON_MARGINS = "recommendation-block-button-margins-control", c.BUTTON_PADDINGS = "recommendation-block-button-paddings-control", c.BUTTON_TEXT = "recommendation-block-button-text-control", c.BUTTON_TEXT_SIZE = "recommendation-block-button-text-size-control", c.BUTTON_TEXT_STYLE_AND_FONT_COLOR = "recommendation-block-button-text-style-and-font-color-control", c.NAME_ALIGN = "recommendation-block-name-align-control", c.NAME_BACKGROUND = "recommendation-block-name-background-control", c.NAME_COLOR = "recommendation-block-name-color-control", c.NAME_FONT_FAMILY = "recommendation-block-name-font-family-control", c.NAME_PADDINGS = "recommendation-block-name-paddings-control", c.NAME_SIZE = "recommendation-block-name-size-control", c.NAME_STYLE = "recommendation-block-name-style-control", c.PRICE_ALIGN = "recommendation-block-price-align-control", c.PRICE_BACKGROUND = "recommendation-block-price-background-control", c.PRICE_COLOR = "recommendation-block-price-color-control", c.PRICE_FONT_FAMILY = "recommendation-block-price-font-family-control", c.PRICE_PADDINGS = "recommendation-block-price-paddings-control", c.PRICE_SIZE = "recommendation-block-price-size-control", c.PRICE_STYLE = "recommendation-block-price-style-control", c.OLD_PRICE_ALIGN = "recommendation-block-old-price-align-control", c.OLD_PRICE_BACKGROUND = "recommendation-block-old-price-background-control", c.OLD_PRICE_COLOR = "recommendation-block-old-price-color-control", c.OLD_PRICE_FONT_FAMILY = "recommendation-block-old-price-font-family-control", c.OLD_PRICE_PADDINGS = "recommendation-block-old-price-paddings-control", c.OLD_PRICE_SIZE = "recommendation-block-old-price-size-control", c.OLD_PRICE_STYLE = "recommendation-block-old-price-style-control", c.IMAGE_SIZE = "recommendation-block-image-size-control", c.IMAGE_MARGINS = "recommendation-block-image-margins-control", c))(r || {});
|
|
2
|
+
export {
|
|
3
|
+
o as RecommendationBlockId,
|
|
4
|
+
r as RecommendationControlId
|
|
5
|
+
};
|
|
@@ -5,7 +5,8 @@ import { currencyDecimalCounts as l, currencyOperators as c, currencyLocationMap
|
|
|
5
5
|
import { UEAttr as m, ModificationDescription as S } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
6
6
|
import { CommonControl as g } from "../common-control.js";
|
|
7
7
|
import { useRecommendationExtensionStore as O } from "./store/recommendation.js";
|
|
8
|
-
import {
|
|
8
|
+
import { prepareProductRows as p } from "./templates/blockTemplate.js";
|
|
9
|
+
import { DEFAULT_CARD_COMPOSITION as C, getDefaultProducts as E } from "./templates/templateUtils.js";
|
|
9
10
|
import { useDebounceFn as U } from "../../../node_modules/@vueuse/shared/index.js";
|
|
10
11
|
const L = "ui-elements-recommendation-block", t = {
|
|
11
12
|
ALGORITHM: "strategy",
|
|
@@ -23,7 +24,7 @@ const L = "ui-elements-recommendation-block", t = {
|
|
|
23
24
|
SHUFFLE_PRODUCTS: "shuffleProducts",
|
|
24
25
|
RESPONSIVE: "unresponsive"
|
|
25
26
|
};
|
|
26
|
-
class
|
|
27
|
+
class b extends g {
|
|
27
28
|
constructor() {
|
|
28
29
|
super(...arguments);
|
|
29
30
|
r(this, "store", O());
|
|
@@ -249,7 +250,7 @@ class y extends g {
|
|
|
249
250
|
console.error("Could not find container table for product rows");
|
|
250
251
|
return;
|
|
251
252
|
}
|
|
252
|
-
const o = this.store.recommendationProducts.length > 0 ? this.store.recommendationProducts :
|
|
253
|
+
const o = this.store.recommendationProducts.length > 0 ? this.store.recommendationProducts : E(), { cardsInRow: i } = this.store.recommendationConfigs, a = this._getCardComposition(), u = p(o, i, a);
|
|
253
254
|
this.api.getDocumentModifier().modifyHtml(e).setInnerHtml(u).apply(new S("Updated product"));
|
|
254
255
|
}
|
|
255
256
|
_onCurrencyConfigChange(e, o) {
|
|
@@ -301,5 +302,5 @@ class y extends g {
|
|
|
301
302
|
}
|
|
302
303
|
export {
|
|
303
304
|
L as CONTROL_BLOCK_ID,
|
|
304
|
-
|
|
305
|
+
b as RecommendationBlockControl
|
|
305
306
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { ButtonAlignBuiltInControl as
|
|
2
|
-
|
|
1
|
+
import { ButtonAlignBuiltInControl as t } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { RecommendationControlId as e, RecommendationBlockId as n } from "../../constants.js";
|
|
3
|
+
class c extends t {
|
|
3
4
|
getId() {
|
|
4
|
-
return
|
|
5
|
+
return e.BUTTON_ALIGN;
|
|
5
6
|
}
|
|
6
|
-
getTargetNodes(
|
|
7
|
-
return
|
|
7
|
+
getTargetNodes(o) {
|
|
8
|
+
return o.closest(".ins-recommendation-product-container").querySelectorAll(`[esd-extension-block-id="${n.BUTTON}"]`);
|
|
8
9
|
}
|
|
9
10
|
}
|
|
10
11
|
export {
|
|
11
|
-
|
|
12
|
+
c as ButtonAlignControl
|
|
12
13
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { ButtonBorderBuiltInControl as
|
|
2
|
-
|
|
1
|
+
import { ButtonBorderBuiltInControl as t } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { RecommendationControlId as e, RecommendationBlockId as n } from "../../constants.js";
|
|
3
|
+
class s extends t {
|
|
3
4
|
getId() {
|
|
4
|
-
return
|
|
5
|
+
return e.BUTTON_BORDER;
|
|
5
6
|
}
|
|
6
|
-
getTargetNodes(
|
|
7
|
-
return
|
|
7
|
+
getTargetNodes(o) {
|
|
8
|
+
return o.closest(".ins-recommendation-product-container").querySelectorAll(`[esd-extension-block-id="${n.BUTTON}"]`);
|
|
8
9
|
}
|
|
9
10
|
}
|
|
10
11
|
export {
|
|
11
|
-
|
|
12
|
+
s as ButtonBorderControl
|
|
12
13
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { ButtonBorderRadiusBuiltInControl as
|
|
2
|
-
|
|
1
|
+
import { ButtonBorderRadiusBuiltInControl as t } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { RecommendationControlId as e, RecommendationBlockId as n } from "../../constants.js";
|
|
3
|
+
class i extends t {
|
|
3
4
|
getId() {
|
|
4
|
-
return
|
|
5
|
+
return e.BUTTON_BORDER_RADIUS;
|
|
5
6
|
}
|
|
6
|
-
getTargetNodes(
|
|
7
|
-
return
|
|
7
|
+
getTargetNodes(o) {
|
|
8
|
+
return o.closest(".ins-recommendation-product-container").querySelectorAll(`[esd-extension-block-id="${n.BUTTON}"]`);
|
|
8
9
|
}
|
|
9
10
|
}
|
|
10
11
|
export {
|
|
11
|
-
|
|
12
|
+
i as ButtonBorderRadiusControl
|
|
12
13
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { ButtonColorBuiltInControl as t } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
-
|
|
2
|
+
import { RecommendationControlId as e, RecommendationBlockId as n } from "../../constants.js";
|
|
3
|
+
class c extends t {
|
|
3
4
|
getId() {
|
|
4
|
-
return
|
|
5
|
+
return e.BUTTON_COLOR;
|
|
5
6
|
}
|
|
6
7
|
getTargetNodes(o) {
|
|
7
|
-
return o.closest(".ins-recommendation-product-container").querySelectorAll(
|
|
8
|
+
return o.closest(".ins-recommendation-product-container").querySelectorAll(`[esd-extension-block-id="${n.BUTTON}"]`);
|
|
8
9
|
}
|
|
9
10
|
}
|
|
10
11
|
export {
|
|
11
|
-
|
|
12
|
+
c as ButtonColorControl
|
|
12
13
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { ButtonFitToContainerBuiltInControl as o } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
-
|
|
2
|
+
import { RecommendationControlId as e, RecommendationBlockId as n } from "../../constants.js";
|
|
3
|
+
class s extends o {
|
|
3
4
|
getId() {
|
|
4
|
-
return
|
|
5
|
+
return e.BUTTON_FIT_TO_CONTENT;
|
|
5
6
|
}
|
|
6
7
|
getTargetNodes(t) {
|
|
7
|
-
return t.closest(".ins-recommendation-product-container").querySelectorAll(
|
|
8
|
+
return t.closest(".ins-recommendation-product-container").querySelectorAll(`[esd-extension-block-id="${n.BUTTON}"]`);
|
|
8
9
|
}
|
|
9
10
|
}
|
|
10
11
|
export {
|
|
11
|
-
|
|
12
|
+
s as ButtonFitToContentControl
|
|
12
13
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { ButtonFontFamilyBuiltInControl as o } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
-
|
|
2
|
+
import { RecommendationControlId as e, RecommendationBlockId as n } from "../../constants.js";
|
|
3
|
+
class s extends o {
|
|
3
4
|
getId() {
|
|
4
|
-
return
|
|
5
|
+
return e.BUTTON_FONT_FAMILY;
|
|
5
6
|
}
|
|
6
7
|
getTargetNodes(t) {
|
|
7
|
-
return t.closest(".ins-recommendation-product-container").querySelectorAll(
|
|
8
|
+
return t.closest(".ins-recommendation-product-container").querySelectorAll(`[esd-extension-block-id="${n.BUTTON}"]`);
|
|
8
9
|
}
|
|
9
10
|
}
|
|
10
11
|
export {
|
|
11
|
-
|
|
12
|
+
s as ButtonFontFamilyControl
|
|
12
13
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { ButtonMarginsBuiltInControl as o } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
-
|
|
2
|
+
import { RecommendationControlId as e, RecommendationBlockId as n } from "../../constants.js";
|
|
3
|
+
class m extends o {
|
|
3
4
|
getId() {
|
|
4
|
-
return
|
|
5
|
+
return e.BUTTON_MARGINS;
|
|
5
6
|
}
|
|
6
7
|
getTargetNodes(t) {
|
|
7
|
-
return t.closest(".ins-recommendation-product-container").querySelectorAll(
|
|
8
|
+
return t.closest(".ins-recommendation-product-container").querySelectorAll(`[esd-extension-block-id="${n.BUTTON}"]`);
|
|
8
9
|
}
|
|
9
10
|
}
|
|
10
11
|
export {
|
|
11
|
-
|
|
12
|
+
m as ButtonMarginsControl
|
|
12
13
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { ButtonPaddingsBuiltInControl as o } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
-
|
|
2
|
+
import { RecommendationControlId as e, RecommendationBlockId as n } from "../../constants.js";
|
|
3
|
+
class i extends o {
|
|
3
4
|
getId() {
|
|
4
|
-
return
|
|
5
|
+
return e.BUTTON_PADDINGS;
|
|
5
6
|
}
|
|
6
7
|
getTargetNodes(t) {
|
|
7
|
-
return t.closest(".ins-recommendation-product-container").querySelectorAll(
|
|
8
|
+
return t.closest(".ins-recommendation-product-container").querySelectorAll(`[esd-extension-block-id="${n.BUTTON}"]`);
|
|
8
9
|
}
|
|
9
10
|
}
|
|
10
11
|
export {
|
|
11
|
-
|
|
12
|
+
i as ButtonPaddingsControl
|
|
12
13
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { ButtonTextBuiltInControl as o } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
-
|
|
2
|
+
import { RecommendationControlId as e, RecommendationBlockId as n } from "../../constants.js";
|
|
3
|
+
class c extends o {
|
|
3
4
|
getId() {
|
|
4
|
-
return
|
|
5
|
+
return e.BUTTON_TEXT;
|
|
5
6
|
}
|
|
6
7
|
getTargetNodes(t) {
|
|
7
|
-
return t.closest(".ins-recommendation-product-container").querySelectorAll(
|
|
8
|
+
return t.closest(".ins-recommendation-product-container").querySelectorAll(`[esd-extension-block-id="${n.BUTTON}"]`);
|
|
8
9
|
}
|
|
9
10
|
}
|
|
10
11
|
export {
|
|
11
|
-
|
|
12
|
+
c as ButtonTextControl
|
|
12
13
|
};
|