@useinsider/guido 3.2.0-beta.caa22bf → 3.2.0-beta.ccaf9f5
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 +0 -92
- package/dist/@types/config/schemas.js +94 -150
- package/dist/components/Guido.vue.js +1 -1
- package/dist/components/Guido.vue2.js +75 -75
- package/dist/composables/useCortexBlueprintBridge.js +38 -0
- package/dist/composables/useEmailTemplateApplier.js +41 -0
- package/dist/composables/useRecommendation.js +26 -46
- package/dist/composables/useSave.js +18 -21
- package/dist/composables/useStripo.js +16 -14
- package/dist/config/compiler/recommendationCompilerRules.js +27 -27
- package/dist/config/migrator/index.js +9 -9
- package/dist/config/migrator/radioButtonMigrator.js +44 -64
- package/dist/config/migrator/recommendationMigrator.js +290 -74
- package/dist/enums/displayConditions.js +80 -0
- package/dist/enums/extensions/recommendationBlock.js +1 -2
- package/dist/extensions/Blocks/RadioButton/template.js +1 -1
- package/dist/extensions/Blocks/Recommendation/block.js +32 -35
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +5 -5
- package/dist/extensions/Blocks/Recommendation/controls/main/algorithm.js +24 -25
- package/dist/extensions/Blocks/Recommendation/controls/main/utils.js +181 -228
- package/dist/extensions/Blocks/Recommendation/services/configService.js +29 -65
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +90 -130
- package/dist/extensions/Blocks/Recommendation/templates/grid/migration.js +251 -0
- package/dist/extensions/Blocks/Recommendation/templates/grid/template.js +8 -8
- package/dist/extensions/Blocks/Recommendation/templates/utils.js +1 -1
- package/dist/extensions/Blocks/Recommendation/utils/preserveTextStyles.js +22 -13
- package/dist/guido.css +1 -1
- package/dist/node_modules/valibot/dist/index.js +235 -450
- package/dist/src/@types/config/defaults.d.ts +1 -5
- package/dist/src/@types/config/index.d.ts +3 -3
- package/dist/src/@types/config/schemas.d.ts +0 -213
- package/dist/src/@types/config/types.d.ts +1 -9
- package/dist/src/components/wrappers/WpModal.vue.d.ts +1 -1
- package/dist/src/composables/useConfig.d.ts +0 -56
- package/dist/src/composables/useCortexBlueprintBridge.d.ts +17 -0
- package/dist/src/composables/useEmailTemplateApplier.d.ts +21 -0
- package/dist/src/composables/useRecommendation.d.ts +1 -10
- package/dist/src/config/migrator/index.d.ts +1 -2
- package/dist/src/config/migrator/recommendationMigrator.d.ts +1 -13
- package/dist/src/enums/displayConditions.d.ts +2 -0
- package/dist/src/extensions/Blocks/RadioButton/template.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/services/configService.d.ts +0 -10
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +0 -34
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +1 -1
- package/dist/src/extensions/Blocks/Recommendation/utils/preserveTextStyles.d.ts +3 -0
- package/dist/src/library.d.ts +1 -1
- package/dist/src/stores/config.d.ts +0 -504
- package/dist/utils/templatePreparation.js +32 -72
- package/package.json +1 -5
- package/dist/composables/validators/useCouponBlockValidator.js +0 -24
- package/dist/config/migrator/recommendation/compositionMapper.js +0 -98
- package/dist/config/migrator/recommendation/extractors.js +0 -27
- package/dist/config/migrator/recommendation/htmlBuilder.js +0 -496
- package/dist/config/migrator/recommendation/parseLegacyConfig.js +0 -33
- package/dist/config/migrator/recommendation/settingsMapper.js +0 -70
- package/dist/config/migrator/recommendation/themeMapper.js +0 -93
- package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMap.js +0 -21
- package/dist/src/composables/useRecommendation.test.d.ts +0 -1
- package/dist/src/composables/validators/useCouponBlockValidator.d.ts +0 -3
- package/dist/src/config/migrator/recommendation/compositionMapper.d.ts +0 -2
- package/dist/src/config/migrator/recommendation/compositionMapper.test.d.ts +0 -1
- package/dist/src/config/migrator/recommendation/extractors.d.ts +0 -7
- package/dist/src/config/migrator/recommendation/extractors.test.d.ts +0 -1
- package/dist/src/config/migrator/recommendation/htmlBuilder.d.ts +0 -11
- package/dist/src/config/migrator/recommendation/parseLegacyConfig.d.ts +0 -15
- package/dist/src/config/migrator/recommendation/parseLegacyConfig.test.d.ts +0 -1
- package/dist/src/config/migrator/recommendation/settingsMapper.d.ts +0 -7
- package/dist/src/config/migrator/recommendation/settingsMapper.test.d.ts +0 -1
- package/dist/src/config/migrator/recommendation/themeMapper.d.ts +0 -5
- package/dist/src/config/migrator/recommendation/themeMapper.test.d.ts +0 -1
- package/dist/src/config/migrator/recommendation/types.d.ts +0 -205
- package/dist/src/config/migrator/recommendationMigrator.test.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/utils.test.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/services/configService.test.d.ts +0 -1
- package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.d.ts +0 -21
- package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMap.test.d.ts +0 -1
- package/dist/src/utils/htmlEscape.d.ts +0 -5
- package/dist/src/utils/htmlEscape.test.d.ts +0 -1
- package/dist/utils/htmlEscape.js +0 -13
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var a = (s,
|
|
1
|
+
var l = Object.defineProperty;
|
|
2
|
+
var c = (s, i, t) => i in s ? l(s, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[i] = t;
|
|
3
|
+
var a = (s, i, t) => c(s, typeof i != "symbol" ? i + "" : i, t);
|
|
4
4
|
import { UEAttr as h } from "../../../../../node_modules/@stripoinc/ui-editor-extensions/dist/esm/index.js";
|
|
5
5
|
import { CommonControl as d } from "../../../common-control.js";
|
|
6
6
|
import { RecommendationConfigService as n } from "../../services/configService.js";
|
|
7
7
|
import { useRecommendationExtensionStore as m } from "../../store/recommendation.js";
|
|
8
|
-
|
|
9
|
-
const u = "recommendation-algorithm-control", i = {
|
|
8
|
+
const g = "recommendation-algorithm-control", e = {
|
|
10
9
|
ALGORITHM: "strategy",
|
|
11
10
|
PRODUCT_IDS: "productIds"
|
|
12
11
|
};
|
|
13
|
-
class
|
|
12
|
+
class T extends d {
|
|
14
13
|
constructor() {
|
|
15
14
|
super(...arguments);
|
|
16
15
|
// Store is used ONLY for API-fetched data (algorithms list), not for config
|
|
17
16
|
a(this, "store", m());
|
|
18
17
|
}
|
|
19
18
|
getId() {
|
|
20
|
-
return
|
|
19
|
+
return g;
|
|
21
20
|
}
|
|
22
21
|
getTemplate() {
|
|
23
22
|
return `
|
|
@@ -25,13 +24,13 @@ class R extends d {
|
|
|
25
24
|
${this._GuTwoColumns([
|
|
26
25
|
this._GuLabel({ text: this.api.translate("Recommendation Algorithm") }),
|
|
27
26
|
this._GuSelect({
|
|
28
|
-
name:
|
|
27
|
+
name: e.ALGORITHM,
|
|
29
28
|
placeholder: this.api.translate("Select Recommendation Algorithm"),
|
|
30
29
|
options: this.store.getActivePredictiveAlgorithms
|
|
31
30
|
}),
|
|
32
|
-
this._GuLabel({ text: this.api.translate("Product Ids"), name: `${
|
|
31
|
+
this._GuLabel({ text: this.api.translate("Product Ids"), name: `${e.PRODUCT_IDS}_label` }),
|
|
33
32
|
this._GuTextInput({
|
|
34
|
-
name:
|
|
33
|
+
name: e.PRODUCT_IDS,
|
|
35
34
|
placeholder: this.api.translate("Enter Product Ids"),
|
|
36
35
|
className: "es-180w"
|
|
37
36
|
})
|
|
@@ -46,19 +45,19 @@ class R extends d {
|
|
|
46
45
|
super.onTemplateNodeUpdated(t), this._initializeSelectItems(), this._setFormValues();
|
|
47
46
|
}
|
|
48
47
|
_setFormValues() {
|
|
49
|
-
const t = n.getConfig(this.currentNode)
|
|
50
|
-
this._setProductIdsVisibility(
|
|
51
|
-
[
|
|
52
|
-
[
|
|
48
|
+
const t = n.getConfig(this.currentNode);
|
|
49
|
+
this._setProductIdsVisibility(t.strategy), this.api.updateValues({
|
|
50
|
+
[e.ALGORITHM]: t.strategy,
|
|
51
|
+
[e.PRODUCT_IDS]: t.productIds.join(",")
|
|
53
52
|
});
|
|
54
53
|
}
|
|
55
54
|
_initializeSelectItems() {
|
|
56
|
-
var
|
|
57
|
-
const t = (
|
|
55
|
+
var o;
|
|
56
|
+
const t = (o = this.store) == null ? void 0 : o.getActivePredictiveAlgorithms;
|
|
58
57
|
if (t != null && t.length)
|
|
59
58
|
try {
|
|
60
59
|
this.api.setUIEAttribute(
|
|
61
|
-
|
|
60
|
+
e.ALGORITHM,
|
|
62
61
|
h.SELECTPICKER.items,
|
|
63
62
|
t
|
|
64
63
|
);
|
|
@@ -68,7 +67,7 @@ class R extends d {
|
|
|
68
67
|
}
|
|
69
68
|
_setProductIdsVisibility(t) {
|
|
70
69
|
const r = (t ?? n.getConfig(this.currentNode).strategy) === "manualMerchandising";
|
|
71
|
-
this.api.setVisibility(
|
|
70
|
+
this.api.setVisibility(e.PRODUCT_IDS, r), this.api.setVisibility(`${e.PRODUCT_IDS}_label`, r);
|
|
72
71
|
}
|
|
73
72
|
_onAlgorithmChange(t) {
|
|
74
73
|
!this.currentNode || n.getConfig(this.currentNode).strategy === t || (n.updateConfig(
|
|
@@ -81,23 +80,23 @@ class R extends d {
|
|
|
81
80
|
_onProductIdsChange(t) {
|
|
82
81
|
if (!this.currentNode)
|
|
83
82
|
return;
|
|
84
|
-
const
|
|
83
|
+
const o = t.split(",").map((r) => r.trim()).filter(Boolean);
|
|
85
84
|
n.updateConfig(
|
|
86
85
|
this.api,
|
|
87
86
|
this.currentNode,
|
|
88
|
-
{ productIds:
|
|
87
|
+
{ productIds: o },
|
|
89
88
|
"Updated product IDs"
|
|
90
|
-
), this.store.patchCurrentBlockConfig({ productIds:
|
|
89
|
+
), this.store.patchCurrentBlockConfig({ productIds: o });
|
|
91
90
|
}
|
|
92
91
|
_listenToFormUpdates() {
|
|
93
|
-
this.api.onValueChanged(
|
|
92
|
+
this.api.onValueChanged(e.ALGORITHM, (t) => {
|
|
94
93
|
this._onAlgorithmChange(t);
|
|
95
|
-
}), this.api.onValueChanged(
|
|
94
|
+
}), this.api.onValueChanged(e.PRODUCT_IDS, (t) => {
|
|
96
95
|
this._onProductIdsChange(t);
|
|
97
96
|
});
|
|
98
97
|
}
|
|
99
98
|
}
|
|
100
99
|
export {
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
g as ALGORITHM_CONTROL_ID,
|
|
101
|
+
T as AlgorithmControl
|
|
103
102
|
};
|