@useinsider/guido 3.12.0-beta.d2745e7 → 3.12.0-beta.d77b0d2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/config/schemas.js +9 -4
- 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 +38 -0
- package/dist/components/organisms/extensions/recommendation/StrategyDetailDrawer.vue2.js +271 -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/composables/useHtmlValidator.js +68 -60
- package/dist/composables/useHttp.js +61 -52
- package/dist/composables/useRecommendation.js +56 -40
- package/dist/composables/useSave.js +22 -22
- 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 +1024 -0
- package/dist/enums/extensions/recommendationBlock.js +45 -24
- package/dist/enums/extensions/strategyDetail.js +149 -0
- package/dist/extensions/Blocks/Recommendation/constants/defaultConfig.js +12 -11
- package/dist/extensions/Blocks/Recommendation/controls/main/index.js +141 -123
- package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +297 -0
- package/dist/extensions/Blocks/Recommendation/iconsRegistry.js +16 -2
- package/dist/extensions/Blocks/Recommendation/recommendation.css.js +137 -0
- package/dist/extensions/Blocks/Recommendation/store/recommendation.js +549 -165
- package/dist/extensions/Blocks/Recommendation/utils/strategyHumanizer.js +97 -0
- package/dist/extensions/Blocks/Recommendation/utils/strategyNavigation.js +8 -0
- package/dist/extensions/Blocks/Recommendation/utils/strategySummary.js +95 -0
- package/dist/extensions/Blocks/Recommendation/utils/strategyUrl.js +43 -0
- package/dist/extensions/Blocks/Recommendation/validation/requiredFields.js +24 -10
- package/dist/extensions/Blocks/common-control.js +37 -35
- package/dist/guido.css +1 -1
- package/dist/services/recommendationApi.js +127 -33
- package/dist/services/stripoApi.js +18 -18
- 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/useHtmlValidator.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 +33 -0
- package/dist/src/enums/extensions/strategyDetail.d.ts +90 -0
- package/dist/src/extensions/Blocks/Recommendation/controls/main/index.d.ts +10 -4
- package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +118 -0
- package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +958 -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/strategyNavigation.d.ts +10 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/strategySummary.d.ts +34 -0
- package/dist/src/extensions/Blocks/Recommendation/utils/strategyUrl.d.ts +51 -0
- package/dist/src/extensions/Blocks/Recommendation/validation/requiredFields.d.ts +8 -1
- package/dist/src/extensions/Blocks/common-control.d.ts +5 -2
- package/dist/src/mock/api/recommendation-strategies.d.ts +2 -0
- package/dist/src/services/recommendationApi.d.ts +9 -1
- package/dist/src/stores/config.d.ts +18 -0
- package/dist/src/utils/genericUtil.d.ts +9 -0
- package/dist/static/styles/components/base-input.css.js +6 -7
- package/dist/utils/dateUtil.js +23 -10
- package/dist/utils/genericUtil.js +10 -1
- package/dist/utils/templatePreparation.js +70 -57
- package/package.json +1 -1
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { getRecommendationFeedSourceMaps as I, URLS as
|
|
2
|
-
import { MinDeviceViewport as
|
|
3
|
-
import { useRecommendationExtensionStore as
|
|
1
|
+
import { getRecommendationFeedSourceMaps as I, URLS as C } from "../enums/extensions/recommendationBlock.js";
|
|
2
|
+
import { MinDeviceViewport as R, DefaultPadding as b } from "../enums/recommendation.js";
|
|
3
|
+
import { useRecommendationExtensionStore as g } from "../extensions/Blocks/Recommendation/store/recommendation.js";
|
|
4
4
|
import { generateCompleteFilterQuery as h } from "../extensions/Blocks/Recommendation/utils/filterUtil.js";
|
|
5
|
-
import { getPartnerRecommendationParams as
|
|
6
|
-
import {
|
|
7
|
-
|
|
5
|
+
import { getPartnerRecommendationParams as S } from "../extensions/Blocks/Recommendation/utils/partnerCustomizations.js";
|
|
6
|
+
import { resolveStrategyUrl as T, buildStrategyUrlValues as x } from "../extensions/Blocks/Recommendation/utils/strategyUrl.js";
|
|
7
|
+
import { useConfigStore as P } from "../stores/config.js";
|
|
8
|
+
const L = () => ({
|
|
8
9
|
calculateCardWidth: ({
|
|
9
|
-
mobileLeftPadding:
|
|
10
|
-
mobileRightPadding:
|
|
11
|
-
cardsInRow:
|
|
12
|
-
unresponsive:
|
|
10
|
+
mobileLeftPadding: i,
|
|
11
|
+
mobileRightPadding: c,
|
|
12
|
+
cardsInRow: o,
|
|
13
|
+
unresponsive: s
|
|
13
14
|
}) => {
|
|
14
|
-
const
|
|
15
|
-
return (
|
|
15
|
+
const n = s ? o : 1, e = i + c + (n - 1) * b;
|
|
16
|
+
return (R - e) / n;
|
|
16
17
|
},
|
|
17
|
-
getRecommendationCampaignData: (
|
|
18
|
-
const
|
|
19
|
-
if (!
|
|
18
|
+
getRecommendationCampaignData: (i) => {
|
|
19
|
+
const c = g(), o = Number(i), s = c.blockStates[o];
|
|
20
|
+
if (!s)
|
|
20
21
|
return {
|
|
21
22
|
textTrimming: !1,
|
|
22
23
|
orientation: "vertical",
|
|
@@ -29,49 +30,64 @@ const k = () => ({
|
|
|
29
30
|
discountBeforeTextValue: "",
|
|
30
31
|
discountAfterTextValue: ""
|
|
31
32
|
};
|
|
32
|
-
const { recommendationConfigs:
|
|
33
|
+
const { recommendationConfigs: n } = s, e = n.orientation === "grid" ? "vertical" : "horizontal";
|
|
33
34
|
return {
|
|
34
|
-
textTrimming:
|
|
35
|
+
textTrimming: n.textTrimming,
|
|
35
36
|
orientation: e,
|
|
36
37
|
mobileLeftPadding: 0,
|
|
37
38
|
mobileRightPadding: 0,
|
|
38
|
-
cardsInRow:
|
|
39
|
-
unresponsive:
|
|
39
|
+
cardsInRow: n.cardsInRow,
|
|
40
|
+
unresponsive: n.unresponsive,
|
|
40
41
|
priceBeforeTextValue: "",
|
|
41
42
|
priceAfterTextValue: "",
|
|
42
43
|
discountBeforeTextValue: "",
|
|
43
44
|
discountAfterTextValue: ""
|
|
44
45
|
};
|
|
45
46
|
},
|
|
46
|
-
buildCampaignUrl: (
|
|
47
|
+
buildCampaignUrl: (i, c) => {
|
|
47
48
|
var m;
|
|
48
|
-
const
|
|
49
|
+
const o = g(), s = P(), n = Number(i);
|
|
49
50
|
let e;
|
|
50
|
-
if (
|
|
51
|
-
e =
|
|
51
|
+
if (c)
|
|
52
|
+
e = c;
|
|
52
53
|
else {
|
|
53
|
-
const
|
|
54
|
-
if (!
|
|
54
|
+
const r = o.blockStates[n];
|
|
55
|
+
if (!r)
|
|
55
56
|
return "";
|
|
56
|
-
const { recommendationConfigs:
|
|
57
|
+
const { recommendationConfigs: a } = r;
|
|
57
58
|
e = {
|
|
58
|
-
strategy:
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
strategy: a.strategy,
|
|
60
|
+
strategyId: a.strategyId,
|
|
61
|
+
language: a.language,
|
|
62
|
+
currencyCode: a.currencySettings.value,
|
|
63
|
+
size: a.size,
|
|
64
|
+
productIds: a.productIds,
|
|
65
|
+
filters: a.filters,
|
|
66
|
+
shuffleProducts: a.shuffleProducts
|
|
65
67
|
};
|
|
66
68
|
}
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
const d = e.strategyId ? o.strategyUrlTemplates[e.strategyId] : "";
|
|
70
|
+
if (d) {
|
|
71
|
+
const r = T(
|
|
72
|
+
d,
|
|
73
|
+
x({
|
|
74
|
+
language: e.language,
|
|
75
|
+
currencyCode: e.currencyCode,
|
|
76
|
+
size: e.size,
|
|
77
|
+
strategyId: e.strategyId
|
|
78
|
+
}),
|
|
79
|
+
"compile"
|
|
80
|
+
);
|
|
81
|
+
return o.recommendationCampaignUrls[i] = r, r;
|
|
82
|
+
}
|
|
83
|
+
const f = ((m = I().find((r) => r.key === e.strategy)) == null ? void 0 : m.path) || "", t = new URLSearchParams();
|
|
84
|
+
t.set("locale", e.language), t.set("currency", e.currencyCode), t.set("partnerName", s.partnerName), t.set("size", e.size), t.set("details", "true"), t.set("campaignId", s.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}");
|
|
85
|
+
const p = e.filters.filter((r) => r.isValid), l = h(p);
|
|
86
|
+
l && t.set("filter", l), e.shuffleProducts && t.set("shuffle", "true"), Object.entries(S(s.partnerName, e.strategy)).forEach(([r, a]) => t.set(r, a));
|
|
87
|
+
const y = decodeURIComponent(t.toString()), u = `${C.RECOMMENDATION_API_URL}/v2/${f}?${y}`;
|
|
88
|
+
return o.recommendationCampaignUrls[i] = u, u;
|
|
73
89
|
}
|
|
74
90
|
});
|
|
75
91
|
export {
|
|
76
|
-
|
|
92
|
+
L as useRecommendation
|
|
77
93
|
};
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { useActionsApi as
|
|
2
|
-
import { useConfig as
|
|
3
|
-
import { useSaveStart as
|
|
4
|
-
import { useSyncModuleExtractor as
|
|
5
|
-
import { useStripoApi as
|
|
6
|
-
import { useTemplatePreparation as
|
|
7
|
-
import { useHtmlValidator as
|
|
8
|
-
import { useCouponBlockValidator as
|
|
9
|
-
import { useLiquidValidator as
|
|
10
|
-
import { useUnsubscribeBlockValidator as
|
|
11
|
-
const
|
|
12
|
-
const o =
|
|
13
|
-
return { save: async (
|
|
14
|
-
var
|
|
1
|
+
import { useActionsApi as k } from "./useActionsApi.js";
|
|
2
|
+
import { useConfig as w } from "./useConfig.js";
|
|
3
|
+
import { useSaveStart as q, useSaveComplete as B } from "./useGuidoActions.js";
|
|
4
|
+
import { useSyncModuleExtractor as C } from "./useSyncModuleExtractor.js";
|
|
5
|
+
import { useStripoApi as E } from "../services/stripoApi.js";
|
|
6
|
+
import { useTemplatePreparation as L } from "../utils/templatePreparation.js";
|
|
7
|
+
import { useHtmlValidator as P } from "./useHtmlValidator.js";
|
|
8
|
+
import { useCouponBlockValidator as U } from "./validators/useCouponBlockValidator.js";
|
|
9
|
+
import { useLiquidValidator as M } from "./validators/useLiquidValidator.js";
|
|
10
|
+
import { useUnsubscribeBlockValidator as T } from "./validators/useUnsubscribeBlockValidator.js";
|
|
11
|
+
const N = () => {
|
|
12
|
+
const o = q(), s = B(), { validateHtml: r, validateRecommendationBlocks: l, validateRecommendationFilters: n } = P(), { validateLiquidSyntax: d } = M(), { validateCouponBlockTags: c } = U(), { validateUnsubscribeBlockUniqueness: m, validateUnsubscribeBlockHasTemplate: u } = T(), { callbacks: i, isFeatureEnabled: p } = w(), { extractSyncModuleData: v } = C(), { setSyncModuleUnsubscriptionPages: f } = E(), { editorSave: S } = k();
|
|
13
|
+
return { save: async (V = !1, b = !1) => {
|
|
14
|
+
var e;
|
|
15
15
|
o();
|
|
16
|
-
const { prepareTemplateDetails:
|
|
17
|
-
if (!
|
|
16
|
+
const { prepareTemplateDetails: x } = L(), t = await x();
|
|
17
|
+
if (!c(t.compiledHtml) || !m(t.compiledHtml) || !u(t.compiledHtml))
|
|
18
18
|
return;
|
|
19
|
-
if (
|
|
20
|
-
if (!await
|
|
19
|
+
if (p("liquidSyntax")) {
|
|
20
|
+
if (!await d(t.compiledHtml) || !l() || !n())
|
|
21
21
|
return;
|
|
22
22
|
} else if (!await r(t.compiledHtml, t.dynamicContentList, !0))
|
|
23
23
|
return;
|
|
24
|
-
if ((
|
|
24
|
+
if ((e = i.value) != null && e.externalValidation && !await i.value.externalValidation(t) || !await S())
|
|
25
25
|
return;
|
|
26
|
-
const { unsubscribePayload:
|
|
27
|
-
return await
|
|
26
|
+
const { unsubscribePayload: H, stripoModules: y } = v(t.rawHtml);
|
|
27
|
+
return await f(H), t.modules = y, V || s({ ...t, silent: b }), t;
|
|
28
28
|
} };
|
|
29
29
|
};
|
|
30
30
|
export {
|
|
31
|
-
|
|
31
|
+
N as useSave
|
|
32
32
|
};
|
|
@@ -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