@useinsider/guido 3.12.0-beta.40db55d → 3.12.0-beta.840207a
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 +2 -14
- package/dist/@types/config/schemas.js +13 -8
- package/dist/components/Guido.vue.js +6 -6
- package/dist/components/Guido.vue2.js +50 -49
- package/dist/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue.js +36 -0
- package/dist/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue2.js +244 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue.js +18 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue2.js +42 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue.js +20 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue2.js +18 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue.js +20 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue2.js +60 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue.js +19 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue2.js +19 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue.js +22 -0
- package/dist/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue2.js +29 -0
- package/dist/components/organisms/header/ViewOptions.vue.js +3 -3
- package/dist/components/organisms/header/version-history/ViewOptions.vue.js +1 -1
- package/dist/composables/useRecommendation.js +82 -51
- package/dist/composables/useStrategyFilters.js +16 -0
- package/dist/config/migrator/recommendationMigrator.js +7 -4
- package/dist/enums/date.js +4 -3
- package/dist/enums/extensions/filteringV2.js +8 -0
- package/dist/enums/extensions/recommendationBlock.js +28 -22
- package/dist/enums/extensions/strategyDetail.js +148 -0
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +12 -11
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +123 -109
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +146 -0
- package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +1 -1
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +256 -102
- package/dist/extensions/Blocks/Recommendation/utils/strategyHumanizer.js +97 -0
- package/dist/extensions/Blocks/Recommendation/utils/strategySummary.js +10 -0
- package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +24 -12
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +72 -29
- package/dist/src/@types/config/schemas.d.ts +10 -0
- package/dist/src/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue.d.ts +2 -0
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue.d.ts +43 -0
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue.d.ts +29 -0
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/HumanizerCondition.vue.d.ts +40 -0
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue.d.ts +38 -0
- package/dist/src/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue.d.ts +51 -0
- package/dist/src/composables/useConfig.d.ts +2 -0
- package/dist/src/composables/useRecommendation.d.ts +2 -0
- package/dist/src/composables/useStrategyFilters.d.ts +24 -0
- package/dist/src/enums/extensions/filteringV2.d.ts +72 -0
- package/dist/src/enums/extensions/recommendationBlock.d.ts +10 -0
- package/dist/src/enums/extensions/strategyDetail.d.ts +90 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +3 -1
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +61 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +606 -1
- package/dist/src/extensions/Blocks/Recommendation/types/nodeConfig.d.ts +7 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/strategyHumanizer.d.ts +50 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/strategySummary.d.ts +34 -0
- package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +3 -1
- package/dist/src/services/recommendationApi.d.ts +7 -1
- package/dist/src/stores/config.d.ts +18 -0
- package/dist/src/utils/genericUtil.d.ts +9 -0
- package/dist/static/styles/base.css.js +15 -0
- package/dist/utils/dateUtil.js +23 -10
- package/dist/utils/genericUtil.js +10 -1
- package/dist/utils/templatePreparation.js +62 -58
- package/package.json +5 -10
package/dist/components/organisms/extensions/recommendation/strategy-detail/CampaignTable.vue2.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { defineComponent as d, computed as o } from "vue";
|
|
2
|
+
import { useTranslations as p } from "../../../../../composables/useTranslations.js";
|
|
3
|
+
import { InNoData as c, InDataTableV2 as l } from "@useinsider/design-system-vue";
|
|
4
|
+
const g = /* @__PURE__ */ d({
|
|
5
|
+
__name: "CampaignTable",
|
|
6
|
+
props: {
|
|
7
|
+
campaigns: { default: () => [] },
|
|
8
|
+
loading: { type: Boolean, default: !1 }
|
|
9
|
+
},
|
|
10
|
+
setup(i) {
|
|
11
|
+
const s = i, a = p(), m = o(() => s.campaigns.length > 0), n = (t) => (t.variants ?? []).map((e) => typeof e == "string" ? e : e == null ? void 0 : e.name).filter(Boolean).join(", "), r = o(() => [
|
|
12
|
+
{
|
|
13
|
+
headerName: a("discovery-strategy.status"),
|
|
14
|
+
field: "status",
|
|
15
|
+
type: "status",
|
|
16
|
+
status: (t) => t.status.toLowerCase(),
|
|
17
|
+
text: (t) => t.status,
|
|
18
|
+
width: 130,
|
|
19
|
+
minWidth: 130
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
headerName: a("discovery-strategy.campaign-and-variant"),
|
|
23
|
+
field: "name",
|
|
24
|
+
text: (t) => t.name,
|
|
25
|
+
description: (t) => n(t),
|
|
26
|
+
width: 280,
|
|
27
|
+
minWidth: 200
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
headerName: a("discovery-strategy.channel"),
|
|
31
|
+
field: "channel",
|
|
32
|
+
text: (t) => t.channel,
|
|
33
|
+
width: 220,
|
|
34
|
+
minWidth: 150
|
|
35
|
+
}
|
|
36
|
+
]);
|
|
37
|
+
return { __sfc: !0, trans: a, props: s, hasCampaigns: m, getVariantsText: n, columnOptions: r, InDataTableV2: l, InNoData: c };
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
export {
|
|
41
|
+
g as default
|
|
42
|
+
};
|
package/dist/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import o from "./FilterHumanizer.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import n from "../../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var l = function() {
|
|
5
|
+
var e = this, r = e._self._c, t = e._self._setupProxy;
|
|
6
|
+
return r("div", { staticClass: "filter-humanizer" }, [t.hasAnyFilter ? e._l(t.filterQuery, function(s, i) {
|
|
7
|
+
return r(t.HumanizerGroup, { key: i, staticClass: "group", attrs: { "condition-list": s.conditionList || [], filters: t.filterQuery, "group-index": String(i), "group-logic": s.groupLogic || "" } });
|
|
8
|
+
}) : [r("p", { staticClass: "px-5 t-c-3" }, [e._v(" " + e._s(t.trans("discovery-strategy.no-filters")) + " ")])], t.canToggle ? r("div", { staticClass: "mt-4 px-5" }, [r(t.InButtonV2, { attrs: { id: "strategy-filters-toggle", styling: "text", type: "primary", "label-text": t.isCollapsed ? t.trans("product-catalog.show-more") : t.trans("product-catalog.show-less"), "left-icon": t.isCollapsed ? "line-chevron-down" : "line-chevron-up" }, on: { click: t.toggleMore } })], 1) : e._e()], 2);
|
|
9
|
+
}, a = [], c = /* @__PURE__ */ n(
|
|
10
|
+
o,
|
|
11
|
+
l,
|
|
12
|
+
a,
|
|
13
|
+
!1,
|
|
14
|
+
null,
|
|
15
|
+
"3ecb7de4"
|
|
16
|
+
);
|
|
17
|
+
const d = c.exports;
|
|
18
|
+
export {
|
|
19
|
+
d as default
|
|
20
|
+
};
|
package/dist/components/organisms/extensions/recommendation/strategy-detail/FilterHumanizer.vue2.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defineComponent as a } from "vue";
|
|
2
|
+
import { useStrategyFilters as p } from "../../../../../composables/useStrategyFilters.js";
|
|
3
|
+
import { useTranslations as f } from "../../../../../composables/useTranslations.js";
|
|
4
|
+
import { InButtonV2 as l } from "@useinsider/design-system-vue";
|
|
5
|
+
import u from "./HumanizerGroup.vue.js";
|
|
6
|
+
const F = /* @__PURE__ */ a({
|
|
7
|
+
__name: "FilterHumanizer",
|
|
8
|
+
props: {
|
|
9
|
+
filters: { default: "{}" }
|
|
10
|
+
},
|
|
11
|
+
setup(t) {
|
|
12
|
+
const r = t, e = f(), { filterQuery: o, hasAnyFilter: s, canToggle: n, isCollapsed: i, toggleMore: m } = p(() => r.filters);
|
|
13
|
+
return { __sfc: !0, trans: e, props: r, filterQuery: o, hasAnyFilter: s, canToggle: n, isCollapsed: i, toggleMore: m, InButtonV2: l, HumanizerGroup: u };
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
export {
|
|
17
|
+
F as default
|
|
18
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import a from "./HumanizerCondition.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import e from "../../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var o = function() {
|
|
5
|
+
var t = this, s = t._self._c, i = t._self._setupProxy;
|
|
6
|
+
return s("div", { class: { "pb-0 pt-1": t.isLast, "py-1": !t.isLast } }, [s("div", { staticClass: "d-f a-i-b j-c-s-b" }, [s("div", { staticClass: "attribute-type" }, [t._v(" " + t._s(i.headingText) + " ")]), s("div", { staticClass: "spaced-dot-sep f-g-1 h-1-s mx-2 w-7-s" }), s(i.InTooltipV2, { attrs: { id: `strategy-condition-${i.conditionId}-${t.index}`, "static-position": "top right", "dynamic-position": !1, text: i.tooltipText }, scopedSlots: t._u([{ key: "triggerElement", fn: function() {
|
|
7
|
+
return [s("div", { staticClass: "d-f condition-data" }, [s("div", { staticClass: "attribute" }, [t._v(" " + t._s(i.capitalizeFirstLetter(i.attributeText)) + " ")]), s("div", { staticClass: "operator f-w-600" }, [t._v(" " + t._s(i.displayOperator) + " ")]), i.totalValueLength < i.MAX_CHARACTER_SIZE ? s("div", { staticClass: "value f-w-600" }, [t._v(" " + t._s(i.suitableValue) + " ")]) : t._e()])];
|
|
8
|
+
}, proxy: !0 }]) })], 1), t.isLast ? t._e() : s("div", { staticClass: "pt-2" }, [s(i.InStatusText, { attrs: { id: `strategy-condition-logic-${i.conditionId}-${t.index}`, size: "small", status: "draft", text: t.condition.conditionLogic || "" } })], 1)]);
|
|
9
|
+
}, n = [], r = /* @__PURE__ */ e(
|
|
10
|
+
a,
|
|
11
|
+
o,
|
|
12
|
+
n,
|
|
13
|
+
!1,
|
|
14
|
+
null,
|
|
15
|
+
"ef803818"
|
|
16
|
+
);
|
|
17
|
+
const p = r.exports;
|
|
18
|
+
export {
|
|
19
|
+
p as default
|
|
20
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { defineComponent as V, computed as e } from "vue";
|
|
2
|
+
import { useTranslations as R } from "../../../../../composables/useTranslations.js";
|
|
3
|
+
import { TimeAbbreviations as T } from "../../../../../enums/extensions/filteringV2.js";
|
|
4
|
+
import { Operators as L, DataTypes as _, MultiSelectDataTypes as $, OperatorNames as u, OperatorAbbreviations as b } from "../../../../../enums/extensions/strategyDetail.js";
|
|
5
|
+
import { capitalizeFirstLetter as s, getSuitableValue as D } from "../../../../../extensions/Blocks/Recommendation/utils/strategyHumanizer.js";
|
|
6
|
+
import { InTooltipV2 as U, InStatusText as F } from "@useinsider/design-system-vue";
|
|
7
|
+
const B = /* @__PURE__ */ V({
|
|
8
|
+
__name: "HumanizerCondition",
|
|
9
|
+
props: {
|
|
10
|
+
condition: null,
|
|
11
|
+
index: null,
|
|
12
|
+
isLast: { type: Boolean, default: !1 }
|
|
13
|
+
},
|
|
14
|
+
setup(g) {
|
|
15
|
+
const n = g, c = 40, d = "_dynamic", i = R(), l = e(() => n.condition.type || ""), p = e(() => {
|
|
16
|
+
var t;
|
|
17
|
+
return ((t = n.condition.attribute) == null ? void 0 : t.text) || "";
|
|
18
|
+
}), r = e(() => {
|
|
19
|
+
var t;
|
|
20
|
+
return ((t = n.condition.attribute) == null ? void 0 : t.attributeType) || "";
|
|
21
|
+
}), o = e(() => n.condition.selectedOperator || ""), x = e(() => n.condition.id ?? n.index), f = e(() => {
|
|
22
|
+
const { value: t } = n.condition;
|
|
23
|
+
return Array.isArray(t) ? t.join(",") : t || "";
|
|
24
|
+
}), O = e(() => [
|
|
25
|
+
{ text: s(i("journey-builder.weeks")), value: T.WEEK },
|
|
26
|
+
{ text: s(i("settings.day-s")), value: T.DAY },
|
|
27
|
+
{ text: s(i("settings.hour-s")), value: T.HOUR }
|
|
28
|
+
]), a = e(() => {
|
|
29
|
+
let t = o.value;
|
|
30
|
+
l.value === "dynamicFilter" && !t.includes(d) && (t = `${t}${d}`);
|
|
31
|
+
const m = (L[r.value] || []).find((h) => h.value === t);
|
|
32
|
+
return m ? i(m.text) : "";
|
|
33
|
+
}), y = () => r.value === _.DATE, A = () => {
|
|
34
|
+
if (!$.includes(r.value) || [u.CONTAINS, u.NOT_CONTAINS].includes(o.value))
|
|
35
|
+
return !1;
|
|
36
|
+
const t = [u.IS_EXACTLY, u.IS_NOT_EXACTLY].includes(o.value);
|
|
37
|
+
return !((n.condition.isHierarchyCategory || r.value === _.STRING) && t);
|
|
38
|
+
}, I = () => [
|
|
39
|
+
b.OPERATOR.IN,
|
|
40
|
+
b.OPERATOR.NOT_IN
|
|
41
|
+
].includes(o.value), v = e(() => D({
|
|
42
|
+
condition: n.condition,
|
|
43
|
+
selectedOperator: o.value,
|
|
44
|
+
filterValue: f.value,
|
|
45
|
+
timeUnit: n.condition.timeUnit ?? "",
|
|
46
|
+
inBetweenValues: n.condition.inBetweenValues ?? [],
|
|
47
|
+
timeUnitOptions: O.value,
|
|
48
|
+
isDateAttribute: y,
|
|
49
|
+
isMultiSelect: A,
|
|
50
|
+
isInOrNotInOperator: I,
|
|
51
|
+
trans: i
|
|
52
|
+
})), N = e(() => v.value.length + a.value.length), S = e(() => a.value.length > c ? `${a.value.substring(0, c)}...` : a.value), C = e(
|
|
53
|
+
() => `${s(p.value)} ${a.value} ${v.value}`
|
|
54
|
+
), E = e(() => l.value ? i(`discovery-strategy.${l.value.toLowerCase()}-humanized`) : s(p.value));
|
|
55
|
+
return { __sfc: !0, MAX_CHARACTER_SIZE: c, DYNAMIC_FILTER_SUFFIX: d, trans: i, props: n, filterType: l, attributeText: p, attributeType: r, selectedOperator: o, conditionId: x, filterValue: f, timeUnitOptions: O, operatorTranslated: a, isDateAttribute: y, isMultiSelect: A, isInOrNotInOperator: I, suitableValue: v, totalValueLength: N, displayOperator: S, tooltipText: C, headingText: E, capitalizeFirstLetter: s, InStatusText: F, InTooltipV2: U };
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
export {
|
|
59
|
+
B as default
|
|
60
|
+
};
|
package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import e from "./HumanizerGroup.vue2.js";
|
|
2
|
+
import o from "../../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
3
|
+
var a = function() {
|
|
4
|
+
var t = this, s = t._self._c, r = t._self._setupProxy;
|
|
5
|
+
return s("div", [s("div", { staticClass: "py-3 b-c-5 px-5" }, t._l(t.conditionList, function(n, i) {
|
|
6
|
+
return s(r.HumanizerCondition, { key: `${n.id}-${t.groupIndex}-${i}`, staticClass: "condition", attrs: { condition: n, index: i, "is-last": t.conditionList.length - 1 === i } });
|
|
7
|
+
}), 1), r.isLastGroup ? t._e() : s("div", { staticClass: "my-3 d-f j-c-c" }, [s(r.InStatusText, { attrs: { id: `strategy-filter-group-${t.groupIndex}`, size: "small", status: "draft", text: t.groupLogic } })], 1)]);
|
|
8
|
+
}, c = [], u = /* @__PURE__ */ o(
|
|
9
|
+
e,
|
|
10
|
+
a,
|
|
11
|
+
c,
|
|
12
|
+
!1,
|
|
13
|
+
null,
|
|
14
|
+
null
|
|
15
|
+
);
|
|
16
|
+
const p = u.exports;
|
|
17
|
+
export {
|
|
18
|
+
p as default
|
|
19
|
+
};
|
package/dist/components/organisms/extensions/recommendation/strategy-detail/HumanizerGroup.vue2.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defineComponent as n, computed as r } from "vue";
|
|
2
|
+
import { InStatusText as u } from "@useinsider/design-system-vue";
|
|
3
|
+
import i from "./HumanizerCondition.vue.js";
|
|
4
|
+
const l = /* @__PURE__ */ n({
|
|
5
|
+
__name: "HumanizerGroup",
|
|
6
|
+
props: {
|
|
7
|
+
filters: null,
|
|
8
|
+
conditionList: null,
|
|
9
|
+
groupIndex: null,
|
|
10
|
+
groupLogic: { default: "" }
|
|
11
|
+
},
|
|
12
|
+
setup(t) {
|
|
13
|
+
const o = t, e = r(() => Object.keys(o.filters).length === Number(o.groupIndex));
|
|
14
|
+
return { __sfc: !0, props: o, isLastGroup: e, InStatusText: u, HumanizerCondition: i };
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
export {
|
|
18
|
+
l as default
|
|
19
|
+
};
|
package/dist/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import a from "./InfoDisplayValue.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import e from "../../../../../_virtual/_plugin-vue2_normalizer.js";
|
|
4
|
+
var n = function() {
|
|
5
|
+
var s = this, t = s._self._c, i = s._self._setupProxy;
|
|
6
|
+
return t("div", { staticClass: "d-f a-i-b l-h-2 mt-2" }, [t("div", { staticClass: "t-c-3 w-s-n-w" }, [s._v(" " + s._s(i.trans(s.title)) + " ")]), t("div", { staticClass: "spaced-dot-sep f-g-1 h-1-s mx-2 w-7-s" }), t("div", { staticClass: "d-f a-i-c" }, [t("div", [s._v(s._s(i.displayValues))]), i.showMore ? t("div", { staticClass: "d-f a-i-c" }, [t("div", { staticClass: "mx-1" }, [s._v(" ... ")]), t(i.InTooltipV2, { attrs: { id: `strategy-detail-show-more-${s.index}`, "static-position": "top right", "dynamic-position": !1, text: i.hiddenDisplayValues, "with-icon": !1 }, scopedSlots: s._u([{ key: "triggerElement", fn: function() {
|
|
7
|
+
return [t("span", { staticClass: "f-w-600" }, [s._v("+" + s._s(i.hiddenValues.length))])];
|
|
8
|
+
}, proxy: !0 }], null, !1, 3725664940) })], 1) : s._e(), s.icon ? t("div", { staticClass: "ml-2" }, [t(i.InTooltipV2, { staticClass: "d-f a-i-c", attrs: { id: `strategy-detail-icon-action-${s.index}`, "static-position": "top right", "dynamic-position": !1, "icon-status": !1, status: !s.disabled, text: i.trans(i.iconTooltipText) }, scopedSlots: s._u([{ key: "triggerElement", fn: function() {
|
|
9
|
+
return [t(i.InIcons, { staticClass: "d-f a-i-c", class: { "i-c-7": !s.disabled, "i-c-2": s.disabled }, attrs: { size: "24", name: s.icon }, on: { click: i.clickOnIcon } })];
|
|
10
|
+
}, proxy: !0 }], null, !1, 4084358903) })], 1) : s._e()])]);
|
|
11
|
+
}, o = [], l = /* @__PURE__ */ e(
|
|
12
|
+
a,
|
|
13
|
+
n,
|
|
14
|
+
o,
|
|
15
|
+
!1,
|
|
16
|
+
null,
|
|
17
|
+
"6e572ff5"
|
|
18
|
+
);
|
|
19
|
+
const p = l.exports;
|
|
20
|
+
export {
|
|
21
|
+
p as default
|
|
22
|
+
};
|
package/dist/components/organisms/extensions/recommendation/strategy-detail/InfoDisplayValue.vue2.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { defineComponent as _, computed as o, ref as v } from "vue";
|
|
2
|
+
import { useTranslations as I } from "../../../../../composables/useTranslations.js";
|
|
3
|
+
import { InTooltipV2 as V, InIcons as k } from "@useinsider/design-system-vue";
|
|
4
|
+
const h = /* @__PURE__ */ _({
|
|
5
|
+
__name: "InfoDisplayValue",
|
|
6
|
+
props: {
|
|
7
|
+
index: null,
|
|
8
|
+
title: null,
|
|
9
|
+
value: null,
|
|
10
|
+
translateValue: { type: Boolean, default: !1 },
|
|
11
|
+
icon: { default: "" },
|
|
12
|
+
iconTooltip: { default: "" },
|
|
13
|
+
iconTooltipAfterClicked: { default: "" },
|
|
14
|
+
disabled: { type: Boolean, default: !1 }
|
|
15
|
+
},
|
|
16
|
+
emits: ["iconClick"],
|
|
17
|
+
setup(d, { emit: c }) {
|
|
18
|
+
const e = d, l = 3, u = 2e3, r = I(), t = o(() => String(e.value ?? "").split(",").map((n) => n.trim())), i = (n) => e.translateValue ? r(n) : n, f = o(() => t.value.length > l), m = o(() => t.value.slice(0, l).map(i).join(", ")), p = o(() => t.value.slice(l).map(i)), T = o(() => p.value.join(", ")), a = v(e.iconTooltip);
|
|
19
|
+
let s;
|
|
20
|
+
return { __sfc: !0, MAX_INLINE_VALUES: l, TOOLTIP_REVERT_DELAY_MS: u, trans: r, props: e, emit: c, values: t, render: i, showMore: f, displayValues: m, hiddenValues: p, hiddenDisplayValues: T, iconTooltipText: a, revertTimer: s, clickOnIcon: () => {
|
|
21
|
+
e.iconTooltipAfterClicked && (a.value = e.iconTooltipAfterClicked, clearTimeout(s), s = setTimeout(() => {
|
|
22
|
+
a.value = e.iconTooltip;
|
|
23
|
+
}, u)), c("iconClick");
|
|
24
|
+
}, InIcons: k, InTooltipV2: V };
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
export {
|
|
28
|
+
h as default
|
|
29
|
+
};
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import { getRecommendationFeedSourceMaps as
|
|
2
|
-
import { MinDeviceViewport as
|
|
3
|
-
import { useRecommendationExtensionStore as
|
|
4
|
-
import { generateCompleteFilterQuery as
|
|
5
|
-
import { getPartnerRecommendationParams as
|
|
6
|
-
import { useConfigStore as
|
|
7
|
-
const
|
|
8
|
-
|
|
1
|
+
import { getRecommendationFeedSourceMaps as E, URLS as S } from "../enums/extensions/recommendationBlock.js";
|
|
2
|
+
import { MinDeviceViewport as A, DefaultPadding as U } from "../enums/recommendation.js";
|
|
3
|
+
import { useRecommendationExtensionStore as g } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
4
|
+
import { generateCompleteFilterQuery as _ } from "../extensions/Blocks/Recommendation/utils/filterUtil.js";
|
|
5
|
+
import { getPartnerRecommendationParams as b } from "../extensions/Blocks/Recommendation/utils/partnerCustomizations.js";
|
|
6
|
+
import { useConfigStore as D } from "../stores/config.js";
|
|
7
|
+
const M = () => {
|
|
8
|
+
const f = ({
|
|
9
9
|
mobileLeftPadding: a,
|
|
10
|
-
mobileRightPadding:
|
|
11
|
-
cardsInRow:
|
|
12
|
-
unresponsive:
|
|
10
|
+
mobileRightPadding: c,
|
|
11
|
+
cardsInRow: s,
|
|
12
|
+
unresponsive: r
|
|
13
13
|
}) => {
|
|
14
|
-
const
|
|
15
|
-
return (
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
if (!o)
|
|
14
|
+
const n = r ? s : 1, e = a + c + (n - 1) * U;
|
|
15
|
+
return (A - e) / n;
|
|
16
|
+
}, I = (a) => {
|
|
17
|
+
const c = g(), s = Number(a), r = c.blockStates[s];
|
|
18
|
+
if (!r)
|
|
20
19
|
return {
|
|
21
20
|
textTrimming: !1,
|
|
22
21
|
orientation: "vertical",
|
|
@@ -29,49 +28,81 @@ const k = () => ({
|
|
|
29
28
|
discountBeforeTextValue: "",
|
|
30
29
|
discountAfterTextValue: ""
|
|
31
30
|
};
|
|
32
|
-
const { recommendationConfigs:
|
|
31
|
+
const { recommendationConfigs: n } = r, e = n.orientation === "grid" ? "vertical" : "horizontal";
|
|
33
32
|
return {
|
|
34
|
-
textTrimming:
|
|
33
|
+
textTrimming: n.textTrimming,
|
|
35
34
|
orientation: e,
|
|
36
35
|
mobileLeftPadding: 0,
|
|
37
36
|
mobileRightPadding: 0,
|
|
38
|
-
cardsInRow:
|
|
39
|
-
unresponsive:
|
|
37
|
+
cardsInRow: n.cardsInRow,
|
|
38
|
+
unresponsive: n.unresponsive,
|
|
40
39
|
priceBeforeTextValue: "",
|
|
41
40
|
priceAfterTextValue: "",
|
|
42
41
|
discountBeforeTextValue: "",
|
|
43
42
|
discountAfterTextValue: ""
|
|
44
43
|
};
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
44
|
+
}, p = {
|
|
45
|
+
LOCALE: "{locale}",
|
|
46
|
+
CURRENCY: "{currency}",
|
|
47
|
+
CAMPAIGN_ID: "{campaignId}",
|
|
48
|
+
STRATEGY_ID: "{strategyId}",
|
|
49
|
+
CLIENT_ID: "{clientId}",
|
|
50
|
+
USER_ID: "{userId}",
|
|
51
|
+
ITEM_ID: "{itemId}"
|
|
52
|
+
}, y = (a, c) => Object.entries(p).reduce(
|
|
53
|
+
(s, [r, n]) => s.replaceAll(
|
|
54
|
+
n,
|
|
55
|
+
c[r]
|
|
56
|
+
),
|
|
57
|
+
a
|
|
58
|
+
);
|
|
59
|
+
return {
|
|
60
|
+
calculateCardWidth: f,
|
|
61
|
+
getRecommendationCampaignData: I,
|
|
62
|
+
buildCampaignUrl: (a, c) => {
|
|
63
|
+
var m;
|
|
64
|
+
const s = g(), r = D(), n = Number(a);
|
|
65
|
+
let e;
|
|
66
|
+
if (c)
|
|
67
|
+
e = c;
|
|
68
|
+
else {
|
|
69
|
+
const o = s.blockStates[n];
|
|
70
|
+
if (!o)
|
|
71
|
+
return "";
|
|
72
|
+
const { recommendationConfigs: i } = o;
|
|
73
|
+
e = {
|
|
74
|
+
strategy: i.strategy,
|
|
75
|
+
strategyId: i.strategyId,
|
|
76
|
+
language: i.language,
|
|
77
|
+
currencyCode: i.currencySettings.value,
|
|
78
|
+
size: i.size,
|
|
79
|
+
productIds: i.productIds,
|
|
80
|
+
filters: i.filters,
|
|
81
|
+
shuffleProducts: i.shuffleProducts
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
const d = e.strategyId ? s.strategyUrlTemplates[e.strategyId] : "";
|
|
85
|
+
if (d) {
|
|
86
|
+
const o = y(d, {
|
|
87
|
+
LOCALE: e.language,
|
|
88
|
+
CURRENCY: e.currencyCode,
|
|
89
|
+
CAMPAIGN_ID: r.variationId,
|
|
90
|
+
STRATEGY_ID: e.strategyId,
|
|
91
|
+
CLIENT_ID: "6KcLM9TwheVB1mgK",
|
|
92
|
+
USER_ID: "{user_id}",
|
|
93
|
+
ITEM_ID: "{itemId}"
|
|
94
|
+
});
|
|
95
|
+
return s.recommendationCampaignUrls[a] = o, o;
|
|
96
|
+
}
|
|
97
|
+
const C = ((m = E().find((o) => o.key === e.strategy)) == null ? void 0 : m.path) || "", t = new URLSearchParams();
|
|
98
|
+
t.set("locale", e.language), t.set("currency", e.currencyCode), t.set("partnerName", r.partnerName), t.set("size", e.size), t.set("details", "true"), t.set("campaignId", r.variationId), e.strategy === "manualMerchandising" ? t.set("productId", e.productIds.join(",")) : e.strategy === "similarViewed" && t.set("productId", "{itemId}"), e.strategy === "userBased" && t.set("userId", "{user_id}");
|
|
99
|
+
const R = e.filters.filter((o) => o.isValid), l = _(R);
|
|
100
|
+
l && t.set("filter", l), e.shuffleProducts && t.set("shuffle", "true"), Object.entries(b(r.partnerName, e.strategy)).forEach(([o, i]) => t.set(o, i));
|
|
101
|
+
const T = decodeURIComponent(t.toString()), u = `${S.RECOMMENDATION_API_URL}/v2/${C}?${T}`;
|
|
102
|
+
return s.recommendationCampaignUrls[a] = u, u;
|
|
66
103
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
const g = e.filters.filter((i) => i.isValid), d = h(g);
|
|
70
|
-
d && t.set("filter", d), e.shuffleProducts && t.set("shuffle", "true"), Object.entries(y(o.partnerName, e.strategy)).forEach(([i, n]) => t.set(i, n));
|
|
71
|
-
const p = decodeURIComponent(t.toString()), u = `${R.RECOMMENDATION_API_URL}/v2/${f}?${p}`;
|
|
72
|
-
return c.recommendationCampaignUrls[a] = u, u;
|
|
73
|
-
}
|
|
74
|
-
});
|
|
104
|
+
};
|
|
105
|
+
};
|
|
75
106
|
export {
|
|
76
|
-
|
|
107
|
+
M as useRecommendation
|
|
77
108
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { parseJsonField as i } from "../utils/genericUtil.js";
|
|
2
|
+
import { ref as n, computed as e } from "vue";
|
|
3
|
+
const r = 2;
|
|
4
|
+
function m(u) {
|
|
5
|
+
const l = n(r), t = n(!0), s = e(
|
|
6
|
+
() => i(u(), {})
|
|
7
|
+
), o = e(() => Object.keys(s.value).length), c = e(() => o.value > 0), a = e(() => o.value > r);
|
|
8
|
+
return { filterQuery: e(() => Object.fromEntries(
|
|
9
|
+
Object.entries(s.value).slice(0, l.value)
|
|
10
|
+
)), hasAnyFilter: c, canToggle: a, isCollapsed: t, toggleMore: () => {
|
|
11
|
+
t.value = !t.value, l.value = t.value ? r : o.value;
|
|
12
|
+
} };
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
m as useStrategyFilters
|
|
16
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BlockId as f } from "../../enums/block.js";
|
|
2
|
-
import { useTemplateStore as
|
|
3
|
-
import { mapComposition as
|
|
2
|
+
import { useTemplateStore as y } from "../../stores/template.js";
|
|
3
|
+
import { mapComposition as b } from "./recommendation/compositionMapper.js";
|
|
4
4
|
import { extractCurrencyFromBlock as v, extractTitleText as C, extractCardBgColor as M, isPartnerManagedBlock as S } from "./recommendation/extractors.js";
|
|
5
5
|
import { buildBlockHtml as w } from "./recommendation/htmlBuilder.js";
|
|
6
6
|
import { parseRecommendationId as x, parseLegacyConfig as R } from "./recommendation/parseLegacyConfig.js";
|
|
@@ -20,8 +20,11 @@ function B(i, t, a) {
|
|
|
20
20
|
), !1;
|
|
21
21
|
const n = a[String(o)] ?? {
|
|
22
22
|
currencySettings: v(t)
|
|
23
|
-
}, c = T(n, r, o), e =
|
|
23
|
+
}, c = T(n, r, o), e = b((d = r.composition) == null ? void 0 : d.variables), l = C(t), g = M(t), p = {
|
|
24
24
|
...c,
|
|
25
|
+
// Legacy blocks predate RRS and carry no strategy reference. Migrated
|
|
26
|
+
// blocks keep running on their algorithm until a strategy is assigned.
|
|
27
|
+
strategyId: "",
|
|
25
28
|
composition: e.composition,
|
|
26
29
|
visibility: e.visibility,
|
|
27
30
|
textTrimming: e.anyTextTrimming
|
|
@@ -56,7 +59,7 @@ function B(i, t, a) {
|
|
|
56
59
|
function q(i, t = {}) {
|
|
57
60
|
const a = new DOMParser(), o = a.parseFromString(i, "text/html"), r = Array.from(o.querySelectorAll(h));
|
|
58
61
|
try {
|
|
59
|
-
|
|
62
|
+
y().$patch((e) => {
|
|
60
63
|
e.migrations = {
|
|
61
64
|
...e.migrations,
|
|
62
65
|
[f.Recommendation]: r.length
|
package/dist/enums/date.js
CHANGED
|
@@ -2,10 +2,15 @@ import { useTranslations as r } from "../../composables/useTranslations.js";
|
|
|
2
2
|
const l = {
|
|
3
3
|
RECOMMENDATION_API_URL: "https://recommendationv2.api.useinsider.com",
|
|
4
4
|
// Relative path → same-origin as the embedding inone dashboard.
|
|
5
|
-
PRODUCT_ATTRIBUTES_PATH: "/product-attributes/get-attributes"
|
|
5
|
+
PRODUCT_ATTRIBUTES_PATH: "/product-attributes/get-attributes",
|
|
6
|
+
// Reusable Recommendation Strategies (RRS), also same-origin on inone.
|
|
7
|
+
RECOMMENDATION_STRATEGIES_PATH: "/api/recommendation-strategies",
|
|
8
|
+
STRATEGY_RECOMMENDATION_URL_PATH: "/api/recommendation-strategies/strategy-recommendation-url"
|
|
6
9
|
}, c = {
|
|
7
|
-
CLIENT_ID: "clientId"
|
|
8
|
-
|
|
10
|
+
CLIENT_ID: "clientId",
|
|
11
|
+
STRATEGY_ID: "strategy_id",
|
|
12
|
+
FILTERS: "filters"
|
|
13
|
+
}, d = "[sr_strategies.status][=][active]*[sr_strategies.suitable_channels][~][EMAIL]", m = () => {
|
|
9
14
|
const e = r();
|
|
10
15
|
return [
|
|
11
16
|
{
|
|
@@ -69,14 +74,14 @@ const l = {
|
|
|
69
74
|
path: "top-sellers"
|
|
70
75
|
}
|
|
71
76
|
];
|
|
72
|
-
},
|
|
77
|
+
}, p = ["discount", "omnibus_price", "omnibus_discount", "price", "original_price"], v = [
|
|
73
78
|
{ text: "before the amount", value: "0" },
|
|
74
79
|
{ text: "after the amount", value: "1" }
|
|
75
|
-
],
|
|
80
|
+
], h = [
|
|
76
81
|
{ text: "dot(.)", value: "." },
|
|
77
82
|
{ text: "comma(,)", value: "," },
|
|
78
83
|
{ text: "space( )", value: " " }
|
|
79
|
-
],
|
|
84
|
+
], x = [
|
|
80
85
|
{ text: "0", value: "0" },
|
|
81
86
|
{ text: "1", value: "1" },
|
|
82
87
|
{ text: "2", value: "2" },
|
|
@@ -88,54 +93,55 @@ const l = {
|
|
|
88
93
|
{ text: "contains", value: "~" },
|
|
89
94
|
{ text: "does not contain", value: "!~" },
|
|
90
95
|
{ text: "any of", value: a }
|
|
91
|
-
],
|
|
96
|
+
], s = [
|
|
92
97
|
{ text: "is exactly", value: "=" },
|
|
93
98
|
{ text: "is not exactly", value: "!==" },
|
|
94
99
|
{ text: "contains", value: "~" },
|
|
95
100
|
{ text: "does not contain", value: "!~" },
|
|
96
101
|
{ text: "any of", value: a }
|
|
97
|
-
],
|
|
102
|
+
], n = [
|
|
98
103
|
{ text: "is equal to", value: "=" },
|
|
99
104
|
{ text: "is greater than", value: ">" },
|
|
100
105
|
{ text: "is less than", value: "<" }
|
|
101
|
-
],
|
|
106
|
+
], o = [
|
|
102
107
|
{ text: "is equal to", value: "=" },
|
|
103
108
|
{ text: "after", value: ">" },
|
|
104
109
|
{ text: "before", value: "<" }
|
|
105
110
|
], i = [
|
|
106
111
|
{ text: "true", value: "==" },
|
|
107
112
|
{ text: "false", value: "!=" }
|
|
108
|
-
],
|
|
113
|
+
], g = (e) => {
|
|
109
114
|
if (!e)
|
|
110
115
|
return t;
|
|
111
116
|
switch (e) {
|
|
112
117
|
case "Boolean":
|
|
113
118
|
return i;
|
|
114
119
|
case "Date":
|
|
115
|
-
return s;
|
|
116
|
-
case "Number":
|
|
117
120
|
return o;
|
|
121
|
+
case "Number":
|
|
122
|
+
return n;
|
|
118
123
|
case "String":
|
|
119
124
|
return t;
|
|
120
125
|
case "Strings":
|
|
121
|
-
return
|
|
126
|
+
return s;
|
|
122
127
|
default:
|
|
123
128
|
return t;
|
|
124
129
|
}
|
|
125
130
|
};
|
|
126
131
|
export {
|
|
127
132
|
a as OP_ANY_OF,
|
|
128
|
-
|
|
133
|
+
p as PriceAttributes,
|
|
129
134
|
c as QUERY_PARAMS,
|
|
135
|
+
d as RRS_EMAIL_ACTIVE_FILTER,
|
|
130
136
|
l as URLS,
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
+
x as currencyDecimalCounts,
|
|
138
|
+
v as currencyLocationMaps,
|
|
139
|
+
h as currencyOperators,
|
|
140
|
+
g as getOperatorOptions,
|
|
141
|
+
m as getRecommendationFeedSourceMaps,
|
|
142
|
+
s as operatorOptionsForArrayOfStrings,
|
|
137
143
|
i as operatorOptionsForBooleans,
|
|
138
|
-
|
|
139
|
-
|
|
144
|
+
o as operatorOptionsForDates,
|
|
145
|
+
n as operatorOptionsForNumbers,
|
|
140
146
|
t as operatorOptionsForStrings
|
|
141
147
|
};
|