@useinsider/guido 1.0.3-beta.63e6005 → 1.0.3-beta.671eb65
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/generic.d.ts +6 -1
- package/dist/components/Guido.vue.js +7 -7
- package/dist/components/Guido.vue2.js +69 -67
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue.d.ts +19 -0
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue.js +28 -0
- package/dist/components/organisms/extensions/recommendation/FilterItem.vue2.js +38 -0
- package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.d.ts +2 -0
- package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue.js +17 -0
- package/dist/components/organisms/extensions/recommendation/FilterSelectionDrawer.vue2.js +37 -0
- package/dist/components/organisms/extensions/recommendation/Filters.vue.d.ts +2 -0
- package/dist/components/organisms/extensions/recommendation/Filters.vue.js +20 -0
- package/dist/components/organisms/extensions/recommendation/Filters.vue2.js +44 -0
- package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue.d.ts +16 -0
- package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue.js +17 -0
- package/dist/components/organisms/extensions/recommendation/LogicAdapter.vue2.js +27 -0
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue.js +1 -1
- package/dist/components/organisms/unsubscribe/UnsubscribeTypeSelection.vue2.js +12 -13
- package/dist/composables/useStripo.js +25 -21
- package/dist/config/compiler/unsubscribeCompilerRules.js +39 -26
- package/dist/config/migrator/couponBlockMigrator.d.ts +1 -0
- package/dist/config/migrator/couponBlockMigrator.js +67 -0
- package/dist/config/migrator/index.js +7 -6
- package/dist/config/migrator/unsubscribeMigrator.js +61 -49
- package/dist/enums/extensions/recommendationBlock.d.ts +16 -0
- package/dist/enums/extensions/recommendationBlock.js +80 -0
- package/dist/enums/unsubscribe.d.ts +4 -0
- package/dist/enums/unsubscribe.js +15 -11
- package/dist/extensions/Blocks/Checkbox/block.d.ts +1 -0
- package/dist/extensions/Blocks/Checkbox/block.js +15 -24
- package/dist/extensions/Blocks/Checkbox/control.js +55 -67
- package/dist/extensions/Blocks/Checkbox/extension.js +5 -16
- package/dist/extensions/Blocks/Checkbox/iconsRegistry.d.ts +4 -0
- package/dist/extensions/Blocks/Checkbox/iconsRegistry.js +18 -0
- package/dist/extensions/Blocks/Checkbox/settingsPanel.js +12 -25
- package/dist/extensions/Blocks/Checkbox/template.js +5 -16
- package/dist/extensions/Blocks/CouponBlock/block.d.ts +12 -0
- package/dist/extensions/Blocks/CouponBlock/block.js +33 -0
- package/dist/extensions/Blocks/CouponBlock/extension.d.ts +2 -0
- package/dist/extensions/Blocks/CouponBlock/extension.js +8 -0
- package/dist/extensions/Blocks/CouponBlock/iconsRegistry.d.ts +4 -0
- package/dist/extensions/Blocks/CouponBlock/iconsRegistry.js +33 -0
- package/dist/extensions/Blocks/CouponBlock/settingsPanel.d.ts +4 -0
- package/dist/extensions/Blocks/CouponBlock/settingsPanel.js +24 -0
- package/dist/extensions/Blocks/CouponBlock/template.d.ts +3 -0
- package/dist/extensions/Blocks/CouponBlock/template.js +18 -0
- package/dist/extensions/Blocks/RadioButton/block.d.ts +1 -0
- package/dist/extensions/Blocks/RadioButton/block.js +13 -22
- package/dist/extensions/Blocks/RadioButton/control.js +40 -52
- package/dist/extensions/Blocks/RadioButton/extension.js +4 -15
- package/dist/extensions/Blocks/RadioButton/iconsRegistry.d.ts +4 -0
- package/dist/extensions/Blocks/RadioButton/iconsRegistry.js +14 -0
- package/dist/extensions/Blocks/RadioButton/settingsPanel.js +13 -26
- package/dist/extensions/Blocks/RadioButton/template.js +13 -24
- package/dist/extensions/Blocks/Recommendation/block.d.ts +10 -0
- package/dist/extensions/Blocks/Recommendation/block.js +27 -0
- package/dist/extensions/Blocks/Recommendation/control.d.ts +29 -0
- package/dist/extensions/Blocks/Recommendation/control.js +277 -0
- package/dist/extensions/Blocks/Recommendation/extension.d.ts +2 -0
- package/dist/extensions/Blocks/Recommendation/extension.js +10 -0
- package/dist/extensions/Blocks/Recommendation/iconsRegistry.d.ts +4 -0
- package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +51 -0
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +19 -0
- package/dist/extensions/Blocks/Recommendation/settingsPanel.d.ts +4 -0
- package/dist/extensions/Blocks/Recommendation/settingsPanel.js +32 -0
- package/dist/extensions/Blocks/Recommendation/store/recommendation.d.ts +555 -0
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +266 -0
- package/dist/extensions/Blocks/Recommendation/template.d.ts +6 -0
- package/dist/extensions/Blocks/Recommendation/template.js +200 -0
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.d.ts +7 -0
- package/dist/extensions/Blocks/Recommendation/utils/filterUtil.js +28 -0
- package/dist/extensions/Blocks/Unsubscribe/block.d.ts +1 -0
- package/dist/extensions/Blocks/Unsubscribe/block.js +28 -41
- package/dist/extensions/Blocks/Unsubscribe/control.js +43 -56
- package/dist/extensions/Blocks/Unsubscribe/elements/preview.js +12 -24
- package/dist/extensions/Blocks/Unsubscribe/extension.js +10 -21
- package/dist/extensions/Blocks/Unsubscribe/iconsRegistry.d.ts +4 -0
- package/dist/extensions/Blocks/Unsubscribe/iconsRegistry.js +21 -0
- package/dist/extensions/Blocks/Unsubscribe/settingsPanel.js +27 -24
- package/dist/extensions/Blocks/Unsubscribe/tagRegistry.js +6 -18
- package/dist/extensions/Blocks/Unsubscribe/template.js +9 -20
- package/dist/extensions/Blocks/_Boilerplate/block.d.ts +1 -0
- package/dist/extensions/Blocks/_Boilerplate/iconsRegistry.d.ts +4 -0
- package/dist/extensions/Blocks/common-control.d.ts +66 -0
- package/dist/extensions/Blocks/common-control.js +102 -0
- package/dist/extensions/DynamicContent/dynamic-content.js +31 -45
- package/dist/extensions/DynamicContent/extension.js +6 -18
- package/dist/guido.css +1 -1
- package/dist/mock/api/recommendation.d.ts +2 -0
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js +659 -0
- package/dist/services/recommendationApi.d.ts +6 -0
- package/dist/services/recommendationApi.js +43 -0
- package/dist/stores/config.d.ts +96 -0
- package/dist/stores/config.js +17 -0
- package/dist/stores/editor.d.ts +21 -0
- package/dist/stores/editor.js +2 -1
- package/dist/stores/unsubscribe.d.ts +72 -2
- package/dist/stores/unsubscribe.js +43 -42
- package/dist/utils/genericUtil.d.ts +1 -0
- package/dist/utils/genericUtil.js +8 -7
- package/dist/utils/templatePreparation.js +17 -16
- package/package.json +3 -3
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/Extension.js +0 -75
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ExtensionBuilder.js +0 -77
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/blocks/Block.js +0 -123
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/AiAssistantValueType.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockName.js +0 -12
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js +0 -119
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/Popover.js +0 -12
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js +0 -7
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementsAttributes.js +0 -25
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/Control.js +0 -24
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelRegistry.js +0 -11
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelTab.js +0 -33
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/modifications/ModificationDescription.js +0 -22
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElement.js +0 -40
- package/dist/node_modules/@stripoinc/ui-editor-extensions/dist/ui-elements/UIElementTagRegistry.js +0 -5
|
@@ -1,52 +1,45 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { useHttp as
|
|
5
|
-
import "../../../
|
|
6
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js";
|
|
10
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js";
|
|
11
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js";
|
|
12
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js";
|
|
13
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/Popover.js";
|
|
14
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js";
|
|
15
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js";
|
|
16
|
-
import { UEAttr as e } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementsAttributes.js";
|
|
17
|
-
import { UIElementType as r } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js";
|
|
18
|
-
import { Control as c } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/controls/Control.js";
|
|
19
|
-
import { ModificationDescription as d } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/modifications/ModificationDescription.js";
|
|
20
|
-
const l = "ui-elements-radio-button", n = "select", { get: L } = m();
|
|
21
|
-
class R extends c {
|
|
1
|
+
var d = Object.defineProperty;
|
|
2
|
+
var l = (r, n, t) => n in r ? d(r, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[n] = t;
|
|
3
|
+
var o = (r, n, t) => l(r, typeof n != "symbol" ? n + "" : n, t);
|
|
4
|
+
import { useHttp as L } from "../../../composables/useHttp.js";
|
|
5
|
+
import { DEFAULT_UNSUBSCRIBE_GROUP as E } from "../../../enums/unsubscribe.js";
|
|
6
|
+
import { Control as p, UIElementType as i, UEAttr as e, ModificationDescription as h } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
7
|
+
const m = "ui-elements-radio-button", a = "select", { get: $ } = L();
|
|
8
|
+
class _ extends p {
|
|
22
9
|
constructor() {
|
|
23
10
|
super(...arguments);
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
11
|
+
o(this, "currentNode");
|
|
12
|
+
o(this, "selectedUnsubGroup");
|
|
13
|
+
o(this, "unsubList", []);
|
|
27
14
|
}
|
|
28
15
|
getId() {
|
|
29
|
-
return
|
|
16
|
+
return m;
|
|
30
17
|
}
|
|
31
18
|
_setFormValues() {
|
|
32
|
-
this.
|
|
33
|
-
|
|
34
|
-
|
|
19
|
+
if (this.currentNode && "getAttribute" in this.currentNode) {
|
|
20
|
+
const t = this.currentNode.getAttribute("id");
|
|
21
|
+
if (t) {
|
|
22
|
+
const s = t === E.sendGridId ? t : Number(t);
|
|
23
|
+
s && (this.selectedUnsubGroup = s, this.api.updateValues({
|
|
24
|
+
[a]: this.selectedUnsubGroup
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
35
28
|
}
|
|
36
29
|
_getLabel(t, s = `${Math.random()}`) {
|
|
37
30
|
return `
|
|
38
|
-
<${
|
|
31
|
+
<${i.LABEL}
|
|
39
32
|
${e.LABEL.text}="${t}"
|
|
40
33
|
${e.LABEL.name}="${s}">
|
|
41
|
-
</${
|
|
34
|
+
</${i.LABEL}>
|
|
42
35
|
`;
|
|
43
36
|
}
|
|
44
37
|
_getSelectItem(t, s) {
|
|
45
38
|
return `
|
|
46
|
-
<${
|
|
39
|
+
<${i.SELECT_ITEM}
|
|
47
40
|
${e.SELECT_ITEM.text}="${t}"
|
|
48
41
|
${e.SELECT_ITEM.value}="${s}">
|
|
49
|
-
</${
|
|
42
|
+
</${i.SELECT_ITEM}>`;
|
|
50
43
|
}
|
|
51
44
|
_getSelect() {
|
|
52
45
|
return this.unsubList.map((t) => this._getSelectItem(t.name, t.sendGridId)).join("");
|
|
@@ -55,50 +48,45 @@ class R extends c {
|
|
|
55
48
|
return `
|
|
56
49
|
<div class="checkbox-controls-container">
|
|
57
50
|
<div class="checkbox-select-container container two-columns stretch">
|
|
58
|
-
<${
|
|
51
|
+
<${i.LABEL}
|
|
59
52
|
${e.LABEL.text}="${this.api.translate("Unsubscribe Group")}"
|
|
60
53
|
${e.LABEL.name}="${Math.random()}">
|
|
61
|
-
</${
|
|
54
|
+
</${i.LABEL}>
|
|
62
55
|
|
|
63
|
-
<${
|
|
64
|
-
${e.SELECTPICKER.name}="${
|
|
56
|
+
<${i.SELECTPICKER}
|
|
57
|
+
${e.SELECTPICKER.name}="${a}"
|
|
65
58
|
${e.SELECTPICKER.placeholder}="${this.api.translate("Select Unsubscribe Group")}">
|
|
66
59
|
${this._getSelect()}
|
|
67
|
-
</${
|
|
60
|
+
</${i.SELECTPICKER}>
|
|
68
61
|
</div>
|
|
69
62
|
</div>
|
|
70
63
|
`;
|
|
71
64
|
}
|
|
72
65
|
_onSelectChange(t) {
|
|
73
|
-
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", t.toString()).apply(new
|
|
66
|
+
this.currentNode && this.api.getDocumentModifier().modifyHtml(this.currentNode).setAttribute("id", t.toString()).apply(new h(`Updated text to ${t}`));
|
|
74
67
|
}
|
|
75
68
|
_listenToFormUpdates() {
|
|
76
|
-
this.api.onValueChanged(
|
|
69
|
+
this.api.onValueChanged(a, (t) => this._onSelectChange(t));
|
|
77
70
|
}
|
|
78
71
|
onTemplateNodeUpdated(t) {
|
|
79
|
-
|
|
80
|
-
const s = Number(t.getAttribute("id"));
|
|
81
|
-
s && (this.selectedUnsubGroup = s, this.api.updateValues({
|
|
82
|
-
[n]: this.selectedUnsubGroup
|
|
83
|
-
}));
|
|
84
|
-
}
|
|
72
|
+
this.currentNode = t;
|
|
85
73
|
}
|
|
86
74
|
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
87
75
|
async onRender() {
|
|
88
|
-
const t = await
|
|
76
|
+
const t = await $(
|
|
89
77
|
"/unsubscribe-groups/unsubscribe-list"
|
|
90
|
-
), s = t.data.map((u) => ({
|
|
78
|
+
), s = [E, ...t.data], c = s.map((u) => ({
|
|
91
79
|
[e.SELECT_ITEM.text]: u.name,
|
|
92
80
|
[e.SELECT_ITEM.value]: u.sendGridId
|
|
93
81
|
}));
|
|
94
|
-
this.unsubList =
|
|
95
|
-
|
|
82
|
+
this.unsubList = s, this.api.setUIEAttribute(
|
|
83
|
+
a,
|
|
96
84
|
e.SELECTPICKER.items,
|
|
97
|
-
|
|
85
|
+
c
|
|
98
86
|
), this._setFormValues(), this._listenToFormUpdates();
|
|
99
87
|
}
|
|
100
88
|
}
|
|
101
89
|
export {
|
|
102
|
-
|
|
103
|
-
|
|
90
|
+
m as CONTROL_BLOCK_ID,
|
|
91
|
+
_ as RadioButtonControl
|
|
104
92
|
};
|
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/
|
|
2
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js";
|
|
3
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockName.js";
|
|
4
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js";
|
|
5
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js";
|
|
6
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js";
|
|
7
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js";
|
|
8
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js";
|
|
9
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/Popover.js";
|
|
10
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js";
|
|
11
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js";
|
|
12
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js";
|
|
13
|
-
import { ExtensionBuilder as o } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/ExtensionBuilder.js";
|
|
1
|
+
import { ExtensionBuilder as o } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
14
2
|
import { RadioButtonCustomBlock as t } from "./block.js";
|
|
15
3
|
import { RadioButtonControl as i } from "./control.js";
|
|
4
|
+
import { RadioButtonIconsRegistry as n } from "./iconsRegistry.js";
|
|
16
5
|
import { RadioButtonBlockSettingsPanel as r } from "./settingsPanel.js";
|
|
17
|
-
const
|
|
6
|
+
const l = new o().addBlock(t).withSettingsPanelRegistry(r).addControl(i).withIconsRegistry(n).build();
|
|
18
7
|
export {
|
|
19
|
-
|
|
8
|
+
l as default
|
|
20
9
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IconsRegistry as i } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
class s extends i {
|
|
3
|
+
registerIconsSvg(t) {
|
|
4
|
+
t["radio-button-icon"] = `
|
|
5
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
6
|
+
<circle cx="10" cy="10" r="9" stroke="#666666" fill="#FFFFFF" stroke-width="2"/>
|
|
7
|
+
<circle cx="10" cy="10" r="3" fill="#666666"/>
|
|
8
|
+
</svg>
|
|
9
|
+
`;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
s as RadioButtonIconsRegistry
|
|
14
|
+
};
|
|
@@ -1,39 +1,26 @@
|
|
|
1
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/
|
|
2
|
-
import "
|
|
3
|
-
import "
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js";
|
|
9
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/Popover.js";
|
|
10
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js";
|
|
11
|
-
import { SettingsTab as o } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js";
|
|
12
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js";
|
|
13
|
-
import { SettingsPanelRegistry as e } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelRegistry.js";
|
|
14
|
-
import { SettingsPanelTab as r } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/controls/SettingsPanelTab.js";
|
|
15
|
-
import { BLOCK_ID as p } from "./block.js";
|
|
16
|
-
import { CONTROL_BLOCK_ID as n } from "./control.js";
|
|
17
|
-
class K extends e {
|
|
18
|
-
registerBlockControls(i) {
|
|
19
|
-
i[p] = [
|
|
20
|
-
new r(
|
|
1
|
+
import { SettingsPanelRegistry as r, SettingsPanelTab as t, SettingsTab as o, ContainerControls as e, TextControls as s } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { BLOCK_ID as T } from "./block.js";
|
|
3
|
+
import { CONTROL_BLOCK_ID as i } from "./control.js";
|
|
4
|
+
class a extends r {
|
|
5
|
+
registerBlockControls(n) {
|
|
6
|
+
n[T] = [
|
|
7
|
+
new t(
|
|
21
8
|
o.SETTINGS,
|
|
22
9
|
[
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
10
|
+
i,
|
|
11
|
+
e.EXTERNAL_INDENTS,
|
|
12
|
+
e.DISPLAY_CONDITIONS
|
|
26
13
|
]
|
|
27
14
|
),
|
|
28
|
-
new
|
|
15
|
+
new t(
|
|
29
16
|
o.STYLES,
|
|
30
17
|
[
|
|
31
|
-
|
|
18
|
+
s.TEXT_BLOCK_BACKGROUND_COLOR
|
|
32
19
|
]
|
|
33
20
|
)
|
|
34
21
|
];
|
|
35
22
|
}
|
|
36
23
|
}
|
|
37
24
|
export {
|
|
38
|
-
|
|
25
|
+
a as RadioButtonBlockSettingsPanel
|
|
39
26
|
};
|
|
@@ -1,21 +1,10 @@
|
|
|
1
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/
|
|
2
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockCompositionType.js";
|
|
3
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockName.js";
|
|
4
|
-
import { BlockType as t } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BlockType.js";
|
|
5
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/BuiltInControlTypes.js";
|
|
6
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/ContextActionType.js";
|
|
7
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/EditorStatePropertyType.js";
|
|
8
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/PanelPosition.js";
|
|
9
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/Popover.js";
|
|
10
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/PreviewDeviceMode.js";
|
|
11
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/SettingsTab.js";
|
|
12
|
-
import "../../../node_modules/@stripoinc/ui-editor-extensions/dist/constants/UIElementType.js";
|
|
1
|
+
import { BlockType as t } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
13
2
|
const e = {
|
|
14
3
|
TITLE: "This is a title text",
|
|
15
4
|
DESCRIPTION: "This is a description text",
|
|
16
5
|
YES: "Yes",
|
|
17
6
|
NO: "No"
|
|
18
|
-
},
|
|
7
|
+
}, d = `
|
|
19
8
|
<td align="left" class="radio-button-v2 esd-block-radio es-p10t es-p10b es-p30r es-p30l">
|
|
20
9
|
<table cellpadding="0" cellspacing="0" role="presentation" width="100%">
|
|
21
10
|
<tbody>
|
|
@@ -23,12 +12,12 @@ const e = {
|
|
|
23
12
|
<td align="left" width="70%" style="vertical-align: top;">
|
|
24
13
|
<table cellpadding="0" cellspacing="0" role="presentation" width="100%">
|
|
25
14
|
<tbody>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
15
|
+
<${t.BLOCK_TEXT}>
|
|
16
|
+
{-{-TITLE-}-}
|
|
17
|
+
</${t.BLOCK_TEXT}>
|
|
18
|
+
<${t.BLOCK_TEXT}>
|
|
19
|
+
{-{-DESCRIPTION-}-}
|
|
20
|
+
</${t.BLOCK_TEXT}>
|
|
32
21
|
</tbody>
|
|
33
22
|
</table>
|
|
34
23
|
</td>
|
|
@@ -86,7 +75,7 @@ const e = {
|
|
|
86
75
|
</tbody>
|
|
87
76
|
</table>
|
|
88
77
|
</td>
|
|
89
|
-
`,
|
|
78
|
+
`, l = `
|
|
90
79
|
<td
|
|
91
80
|
align="left"
|
|
92
81
|
esd-extension-block-id="radio-button-block"
|
|
@@ -151,10 +140,10 @@ const e = {
|
|
|
151
140
|
</table>
|
|
152
141
|
</td>
|
|
153
142
|
`;
|
|
154
|
-
function
|
|
155
|
-
return
|
|
143
|
+
function a() {
|
|
144
|
+
return d.replace("{-{-TITLE-}-}", `<p path="1">${e.TITLE}</p>`).replace("{-{-DESCRIPTION-}-}", `<p path="1">${e.DESCRIPTION}</p>`).replace("{-{-YES-}-}", `<p path="1">${e.YES}</p>`).replace("{-{-NO-}-}", `<p path="1">${e.NO}</p>`);
|
|
156
145
|
}
|
|
157
146
|
export {
|
|
158
|
-
|
|
159
|
-
|
|
147
|
+
l as default,
|
|
148
|
+
a as getDefaultTemplate
|
|
160
149
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Block, BlockCompositionType } from '@stripoinc/ui-editor-extensions';
|
|
2
|
+
export declare const BLOCK_ID = "recommendation-block";
|
|
3
|
+
export declare class RecommendationBlock extends Block {
|
|
4
|
+
getId(): string;
|
|
5
|
+
getIcon(): string;
|
|
6
|
+
getBlockCompositionType(): BlockCompositionType;
|
|
7
|
+
getName(): string;
|
|
8
|
+
getDescription(): string;
|
|
9
|
+
getTemplate(): string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Block as e, BlockCompositionType as t } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
2
|
+
import { getDefaultTemplate as o } from "./template.js";
|
|
3
|
+
const n = "recommendation-block";
|
|
4
|
+
class c extends e {
|
|
5
|
+
getId() {
|
|
6
|
+
return n;
|
|
7
|
+
}
|
|
8
|
+
getIcon() {
|
|
9
|
+
return "recommendation-icon";
|
|
10
|
+
}
|
|
11
|
+
getBlockCompositionType() {
|
|
12
|
+
return t.CONTAINER;
|
|
13
|
+
}
|
|
14
|
+
getName() {
|
|
15
|
+
return this.api.translate("Recommendation Block");
|
|
16
|
+
}
|
|
17
|
+
getDescription() {
|
|
18
|
+
return this.api.translate("Recommendation Block Title Description");
|
|
19
|
+
}
|
|
20
|
+
getTemplate() {
|
|
21
|
+
return o();
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
n as BLOCK_ID,
|
|
26
|
+
c as RecommendationBlock
|
|
27
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { CommonControl } from '../common-control';
|
|
2
|
+
export declare const CONTROL_BLOCK_ID = "ui-elements-recommendation-block";
|
|
3
|
+
export declare class RecommendationBlockControl extends CommonControl {
|
|
4
|
+
private store;
|
|
5
|
+
private storeUnsubscription;
|
|
6
|
+
private addFilterListener;
|
|
7
|
+
private addFilterButton;
|
|
8
|
+
getId(): string;
|
|
9
|
+
getTemplate(): string;
|
|
10
|
+
onRender(): Promise<void>;
|
|
11
|
+
onDestroy(): void;
|
|
12
|
+
_setFormValues(): void;
|
|
13
|
+
_initializeSelectItems(): void;
|
|
14
|
+
_getAlgorithms(): string;
|
|
15
|
+
_getLanguages(): string;
|
|
16
|
+
_getCurrency(): string;
|
|
17
|
+
_getProductLayout(): string;
|
|
18
|
+
_getFilterStatus(): string;
|
|
19
|
+
_getShuffleProducts(): string;
|
|
20
|
+
_getResponsive(): string;
|
|
21
|
+
_onFilterChange(value: boolean): void;
|
|
22
|
+
_onFilterSelectClick(): void;
|
|
23
|
+
_onDataChange(item: string, value: string | number | string[]): void;
|
|
24
|
+
_onCurrencyConfigChange(item: string, value: string | number): void;
|
|
25
|
+
_onCurrencyChange(value: string): void;
|
|
26
|
+
_setProductIdsVisibility(): void;
|
|
27
|
+
_listenToFormUpdates(): void;
|
|
28
|
+
_listenStateUpdates(): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
var _ = Object.defineProperty;
|
|
2
|
+
var R = (o, n, e) => n in o ? _(o, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[n] = e;
|
|
3
|
+
var r = (o, n, e) => R(o, typeof n != "symbol" ? n + "" : n, e);
|
|
4
|
+
import { currencyDecimalCounts as c, currencyOperators as a, currencyLocationMaps as l } from "../../../enums/extensions/recommendationBlock.js";
|
|
5
|
+
import { UEAttr as d } from "../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
6
|
+
import { CommonControl as m } from "../common-control.js";
|
|
7
|
+
import { useRecommendationExtensionStore as S } from "./store/recommendation.js";
|
|
8
|
+
const g = "ui-elements-recommendation-block", t = {
|
|
9
|
+
ALGORITHM: "strategy",
|
|
10
|
+
PRODUCT_IDS: "productIds",
|
|
11
|
+
LOCALE: "language",
|
|
12
|
+
CURRENCY: "value",
|
|
13
|
+
CURRENCY_LOCATION: "alignment",
|
|
14
|
+
CURRENCY_SYMBOL: "symbol",
|
|
15
|
+
CURRENCY_THOUSAND_SEPARATOR: "thousandSeparator",
|
|
16
|
+
CURRENCY_DECIMAL_SEPARATOR: "decimalSeparator",
|
|
17
|
+
CURRENCY_DECIMAL_COUNT: "decimalCount",
|
|
18
|
+
FILTERS: "filterStatus",
|
|
19
|
+
PRODUCT_COUNT: "size",
|
|
20
|
+
PRODUCT_IN_ROW: "cardsInRow",
|
|
21
|
+
SHUFFLE_PRODUCTS: "shuffleProducts",
|
|
22
|
+
RESPONSIVE: "unresponsive"
|
|
23
|
+
};
|
|
24
|
+
class p extends m {
|
|
25
|
+
constructor() {
|
|
26
|
+
super(...arguments);
|
|
27
|
+
r(this, "store", S());
|
|
28
|
+
r(this, "storeUnsubscription", () => {
|
|
29
|
+
});
|
|
30
|
+
r(this, "addFilterListener", () => {
|
|
31
|
+
});
|
|
32
|
+
r(this, "addFilterButton", null);
|
|
33
|
+
}
|
|
34
|
+
getId() {
|
|
35
|
+
return g;
|
|
36
|
+
}
|
|
37
|
+
getTemplate() {
|
|
38
|
+
return `
|
|
39
|
+
<div class="recommendation-controls-container">
|
|
40
|
+
${this._getAlgorithms()}
|
|
41
|
+
${this._getLanguages()}
|
|
42
|
+
${this._getCurrency()}
|
|
43
|
+
${this._getFilterStatus()}
|
|
44
|
+
${this._getProductLayout()}
|
|
45
|
+
${this._getShuffleProducts()}
|
|
46
|
+
${this._getResponsive()}
|
|
47
|
+
</div>
|
|
48
|
+
`;
|
|
49
|
+
}
|
|
50
|
+
async onRender() {
|
|
51
|
+
await Promise.all([
|
|
52
|
+
this.store.fetchRecommendationFilters(),
|
|
53
|
+
this.store.fetchRecommendationCreateData(),
|
|
54
|
+
this.store.fetchRecommendationProducts()
|
|
55
|
+
// TODO: We need to change the location. It's just for testing
|
|
56
|
+
]), this._listenStateUpdates(), this._initializeSelectItems(), this._setFormValues(), this._listenToFormUpdates();
|
|
57
|
+
}
|
|
58
|
+
onDestroy() {
|
|
59
|
+
var e;
|
|
60
|
+
(e = this.addFilterButton) == null || e.removeEventListener("click", this.addFilterListener), this.storeUnsubscription();
|
|
61
|
+
}
|
|
62
|
+
_setFormValues() {
|
|
63
|
+
const e = this.store.recommendationConfigs;
|
|
64
|
+
this._setProductIdsVisibility(), this.api.updateValues({
|
|
65
|
+
[t.ALGORITHM]: e.strategy,
|
|
66
|
+
[t.PRODUCT_IDS]: e.productIds.join(","),
|
|
67
|
+
[t.CURRENCY]: e.currencySettings.value,
|
|
68
|
+
[t.LOCALE]: e.language,
|
|
69
|
+
[t.CURRENCY_LOCATION]: e.currencySettings.alignment,
|
|
70
|
+
[t.CURRENCY_SYMBOL]: e.currencySettings.symbol,
|
|
71
|
+
[t.CURRENCY_THOUSAND_SEPARATOR]: e.currencySettings.thousandSeparator,
|
|
72
|
+
[t.CURRENCY_DECIMAL_SEPARATOR]: e.currencySettings.decimalSeparator,
|
|
73
|
+
[t.CURRENCY_DECIMAL_COUNT]: e.currencySettings.decimalCount,
|
|
74
|
+
[t.PRODUCT_COUNT]: e.size,
|
|
75
|
+
[t.PRODUCT_IN_ROW]: e.cardsInRow,
|
|
76
|
+
[t.SHUFFLE_PRODUCTS]: e.shuffleProducts,
|
|
77
|
+
[t.RESPONSIVE]: !e.unresponsive
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
_initializeSelectItems() {
|
|
81
|
+
const { store: e } = this, s = e.getActivePredictiveAlgorithms, i = e.getLanguages, C = {
|
|
82
|
+
[t.ALGORITHM]: s,
|
|
83
|
+
[t.LOCALE]: i,
|
|
84
|
+
[t.CURRENCY]: e.currencyList,
|
|
85
|
+
[t.CURRENCY_LOCATION]: l,
|
|
86
|
+
[t.CURRENCY_SYMBOL]: e.getCurrencySymbolList,
|
|
87
|
+
[t.CURRENCY_THOUSAND_SEPARATOR]: a,
|
|
88
|
+
[t.CURRENCY_DECIMAL_SEPARATOR]: a,
|
|
89
|
+
[t.CURRENCY_DECIMAL_COUNT]: c,
|
|
90
|
+
[t.PRODUCT_COUNT]: Number(e.recommendationConfigs.size),
|
|
91
|
+
[t.PRODUCT_IN_ROW]: e.recommendationConfigs.cardsInRow,
|
|
92
|
+
[t.SHUFFLE_PRODUCTS]: e.recommendationConfigs.shuffleProducts,
|
|
93
|
+
[t.RESPONSIVE]: !e.recommendationConfigs.unresponsive
|
|
94
|
+
};
|
|
95
|
+
Object.entries(C).forEach(([u, h]) => {
|
|
96
|
+
this.api.setUIEAttribute(u, d.SELECTPICKER.items, h);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
_getAlgorithms() {
|
|
100
|
+
return `
|
|
101
|
+
${this._GuTwoColumns([
|
|
102
|
+
this._GuLabel({ text: "Recommendation Algorithm" }),
|
|
103
|
+
this._GuSelect({
|
|
104
|
+
name: t.ALGORITHM,
|
|
105
|
+
placeholder: "Select Recommendation Algorithm",
|
|
106
|
+
options: this.store.getActivePredictiveAlgorithms
|
|
107
|
+
}),
|
|
108
|
+
this._GuLabel({ text: "Product Ids", name: `${t.PRODUCT_IDS}_label` }),
|
|
109
|
+
this._GuTextInput({
|
|
110
|
+
name: t.PRODUCT_IDS,
|
|
111
|
+
placeholder: "Enter Product Ids",
|
|
112
|
+
className: "es-180w"
|
|
113
|
+
})
|
|
114
|
+
])}
|
|
115
|
+
`;
|
|
116
|
+
}
|
|
117
|
+
_getLanguages() {
|
|
118
|
+
return `
|
|
119
|
+
${this._GuTwoColumns([
|
|
120
|
+
this._GuLabel({ text: "Recommendation Locale" }),
|
|
121
|
+
this._GuSelect({
|
|
122
|
+
name: t.LOCALE,
|
|
123
|
+
placeholder: "Select Recommendation Locale",
|
|
124
|
+
options: this.store.getLanguages
|
|
125
|
+
})
|
|
126
|
+
])}
|
|
127
|
+
`;
|
|
128
|
+
}
|
|
129
|
+
_getCurrency() {
|
|
130
|
+
return `
|
|
131
|
+
${this._GuTwoColumns([
|
|
132
|
+
this._GuLabel({ text: "Currency" }),
|
|
133
|
+
this._GuSelect({
|
|
134
|
+
name: t.CURRENCY,
|
|
135
|
+
placeholder: "Select Currency",
|
|
136
|
+
options: this.store.currencyList
|
|
137
|
+
}),
|
|
138
|
+
this._GuLabel({ text: "Currency Location" }),
|
|
139
|
+
this._GuSelect({
|
|
140
|
+
name: t.CURRENCY_LOCATION,
|
|
141
|
+
placeholder: "Select Currency Location",
|
|
142
|
+
options: l
|
|
143
|
+
}),
|
|
144
|
+
this._GuLabel({ text: "Currency Symbol" }),
|
|
145
|
+
this._GuSelect({
|
|
146
|
+
name: t.CURRENCY_SYMBOL,
|
|
147
|
+
placeholder: "Select Currency Symbol",
|
|
148
|
+
options: this.store.getCurrencySymbolList
|
|
149
|
+
}),
|
|
150
|
+
this._GuLabel({ text: "Thousand Separator" }),
|
|
151
|
+
this._GuSelect({
|
|
152
|
+
name: t.CURRENCY_THOUSAND_SEPARATOR,
|
|
153
|
+
placeholder: "Select Thousand Separator",
|
|
154
|
+
options: a
|
|
155
|
+
}),
|
|
156
|
+
this._GuLabel({ text: "Decimal Separator" }),
|
|
157
|
+
this._GuSelect({
|
|
158
|
+
name: t.CURRENCY_DECIMAL_SEPARATOR,
|
|
159
|
+
placeholder: "Select Decimal Separator",
|
|
160
|
+
options: a
|
|
161
|
+
}),
|
|
162
|
+
this._GuLabel({ text: "Decimal Count" }),
|
|
163
|
+
this._GuSelect({
|
|
164
|
+
name: t.CURRENCY_DECIMAL_COUNT,
|
|
165
|
+
placeholder: "Select Decimal Count",
|
|
166
|
+
options: c
|
|
167
|
+
})
|
|
168
|
+
])}
|
|
169
|
+
`;
|
|
170
|
+
}
|
|
171
|
+
_getProductLayout() {
|
|
172
|
+
return `
|
|
173
|
+
${this._GuTwoColumns([
|
|
174
|
+
this._GuLabel({ text: "Number of Products" }),
|
|
175
|
+
this._GuCounter({ name: t.PRODUCT_COUNT, maxValue: 9 }),
|
|
176
|
+
this._GuLabel({ text: "Products in One Row" }),
|
|
177
|
+
this._GuCounter({ name: t.PRODUCT_IN_ROW, maxValue: 4 })
|
|
178
|
+
])}
|
|
179
|
+
`;
|
|
180
|
+
}
|
|
181
|
+
_getFilterStatus() {
|
|
182
|
+
return `
|
|
183
|
+
${this._GuTwoColumns([
|
|
184
|
+
this._GuLabel({ text: "Filters" }),
|
|
185
|
+
this._GuButton({
|
|
186
|
+
name: t.FILTERS,
|
|
187
|
+
label: "Add Filter",
|
|
188
|
+
id: "guido__btn-add-filter"
|
|
189
|
+
})
|
|
190
|
+
])}
|
|
191
|
+
`;
|
|
192
|
+
}
|
|
193
|
+
_getShuffleProducts() {
|
|
194
|
+
return `
|
|
195
|
+
${this._GuTwoColumns([
|
|
196
|
+
this._GuLabel({ text: "Shuffle Recommended Products" }),
|
|
197
|
+
this._GuToggle(t.SHUFFLE_PRODUCTS)
|
|
198
|
+
])}
|
|
199
|
+
`;
|
|
200
|
+
}
|
|
201
|
+
_getResponsive() {
|
|
202
|
+
return `
|
|
203
|
+
${this._GuTwoColumns([
|
|
204
|
+
this._GuLabel({ text: "Responsive Block" }),
|
|
205
|
+
this._GuToggle(t.RESPONSIVE)
|
|
206
|
+
])}
|
|
207
|
+
`;
|
|
208
|
+
}
|
|
209
|
+
_onFilterChange(e) {
|
|
210
|
+
this.currentNode && this.store.$patch({
|
|
211
|
+
filterStatus: e,
|
|
212
|
+
filterSelectionDrawerStatus: e
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
_onFilterSelectClick() {
|
|
216
|
+
this.store.$patch({
|
|
217
|
+
filterSelectionDrawerStatus: !0
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
_onDataChange(e, s) {
|
|
221
|
+
this.currentNode && this.store.$patch({
|
|
222
|
+
recommendationConfigs: {
|
|
223
|
+
[e]: s
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
_onCurrencyConfigChange(e, s) {
|
|
228
|
+
this.currentNode && this.store.$patch({
|
|
229
|
+
recommendationConfigs: {
|
|
230
|
+
currencySettings: {
|
|
231
|
+
[e]: s
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
_onCurrencyChange(e) {
|
|
237
|
+
const [, s] = e.split(".");
|
|
238
|
+
this.store.$patch({
|
|
239
|
+
recommendationConfigs: {
|
|
240
|
+
currencySettings: {
|
|
241
|
+
name: s,
|
|
242
|
+
value: s
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
_setProductIdsVisibility() {
|
|
248
|
+
const { recommendationConfigs: e } = this.store, s = e.strategy === "manualMerchandising";
|
|
249
|
+
this.api.setVisibility(t.PRODUCT_IDS, s), this.api.setVisibility(`${t.PRODUCT_IDS}_label`, s);
|
|
250
|
+
}
|
|
251
|
+
_listenToFormUpdates() {
|
|
252
|
+
var s;
|
|
253
|
+
this.api.onValueChanged(t.ALGORITHM, (i) => {
|
|
254
|
+
this._onDataChange(t.ALGORITHM, i), this._setProductIdsVisibility();
|
|
255
|
+
}), this.api.onValueChanged(t.PRODUCT_IDS, (i) => this._onDataChange(t.PRODUCT_IDS, i.split(",") || [])), this.api.onValueChanged(t.LOCALE, (i) => this._onDataChange(t.LOCALE, i)), this.api.onValueChanged(t.CURRENCY, (i) => this._onCurrencyChange(i)), [
|
|
256
|
+
t.CURRENCY_LOCATION,
|
|
257
|
+
t.CURRENCY_SYMBOL,
|
|
258
|
+
t.CURRENCY_THOUSAND_SEPARATOR,
|
|
259
|
+
t.CURRENCY_DECIMAL_SEPARATOR,
|
|
260
|
+
t.CURRENCY_DECIMAL_COUNT
|
|
261
|
+
].forEach((i) => {
|
|
262
|
+
this.api.onValueChanged(i, (C) => this._onCurrencyConfigChange(i, C));
|
|
263
|
+
}), this.api.onValueChanged(t.PRODUCT_COUNT, (i) => this._onDataChange(t.PRODUCT_COUNT, i.toString())), this.api.onValueChanged(t.PRODUCT_IN_ROW, (i) => this._onDataChange(t.PRODUCT_IN_ROW, i)), this.api.onValueChanged(t.SHUFFLE_PRODUCTS, (i) => this._onDataChange(t.SHUFFLE_PRODUCTS, i)), this.api.onValueChanged(t.RESPONSIVE, (i) => this._onDataChange(t.RESPONSIVE, i)), this.addFilterListener = this._onFilterSelectClick.bind(this), this.addFilterButton = this.getContainer().querySelector("#guido__btn-add-filter"), (s = this.addFilterButton) == null || s.addEventListener("click", this.addFilterListener);
|
|
264
|
+
}
|
|
265
|
+
_listenStateUpdates() {
|
|
266
|
+
this.storeUnsubscription = this.store.$subscribe((e) => {
|
|
267
|
+
if ("payload" in e) {
|
|
268
|
+
const s = e.payload.recommendationConfigs;
|
|
269
|
+
s && (this.api.updateValues(s), this.store.fetchRecommendationProducts());
|
|
270
|
+
}
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
export {
|
|
275
|
+
g as CONTROL_BLOCK_ID,
|
|
276
|
+
p as RecommendationBlockControl
|
|
277
|
+
};
|