@useinsider/guido 3.18.1-beta.8d3bf29 → 3.18.1

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.
Files changed (40) hide show
  1. package/dist/@types/config/schemas.js +1 -3
  2. package/dist/components/Guido.vue.js +4 -4
  3. package/dist/components/Guido.vue2.js +53 -55
  4. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue.js +7 -7
  5. package/dist/components/organisms/extensions/recommendation/AssignStrategyDrawer.vue2.js +57 -82
  6. package/dist/components/organisms/onboarding/OnboardingWrapper.vue2.js +24 -28
  7. package/dist/composables/useCustomInterfaceAppearance.js +42 -46
  8. package/dist/enums/extensions/recommendationBlock.js +1 -2
  9. package/dist/extensions/Blocks/Recommendation/controls/main/index.js +69 -70
  10. package/dist/extensions/Blocks/Recommendation/controls/main/strategy.js +28 -67
  11. package/dist/extensions/Blocks/Recommendation/store/recommendation.js +56 -98
  12. package/dist/guido.css +1 -1
  13. package/dist/services/recommendationApi.js +52 -61
  14. package/dist/src/@types/config/schemas.d.ts +0 -4
  15. package/dist/src/composables/useConfig.d.ts +0 -2
  16. package/dist/src/enums/extensions/recommendationBlock.d.ts +0 -1
  17. package/dist/src/extensions/Blocks/Recommendation/controls/main/strategy.d.ts +0 -2
  18. package/dist/src/extensions/Blocks/Recommendation/store/recommendation.d.ts +1 -54
  19. package/dist/src/services/recommendationApi.d.ts +1 -2
  20. package/dist/src/stores/config.d.ts +0 -160
  21. package/dist/src/stores/onboarding.d.ts +10 -808
  22. package/dist/static/styles/components/recommendation-strategy.css.js +5 -70
  23. package/dist/stores/config.js +59 -66
  24. package/dist/stores/onboarding.js +36 -46
  25. package/package.json +1 -1
  26. package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.js +0 -18
  27. package/dist/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue2.js +0 -25
  28. package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.js +0 -21
  29. package/dist/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue2.js +0 -46
  30. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.js +0 -21
  31. package/dist/components/organisms/onboarding/RecommendationStrategyOnboarding.vue2.js +0 -46
  32. package/dist/composables/useLegacyStrategyConversion.js +0 -54
  33. package/dist/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js +0 -58
  34. package/dist/src/components/organisms/extensions/recommendation/LegacyStrategyUpdatedModal.vue.d.ts +0 -2
  35. package/dist/src/components/organisms/onboarding/RecommendationLegacyStrategyOnboarding.vue.d.ts +0 -2
  36. package/dist/src/components/organisms/onboarding/RecommendationStrategyOnboarding.vue.d.ts +0 -2
  37. package/dist/src/composables/useLegacyStrategyConversion.d.ts +0 -3
  38. package/dist/src/extensions/Blocks/Recommendation/utils/legacyStrategyMigration.d.ts +0 -39
  39. package/dist/static/assets/icons/filled-arrow-rising.svg.js +0 -5
  40. package/dist/static/assets/icons/line-info.svg.js +0 -5
@@ -1,54 +0,0 @@
1
- import { useRecommendation as f } from "./useRecommendation.js";
2
- import { useToaster as p } from "./useToaster.js";
3
- import { useTranslations as S } from "./useTranslations.js";
4
- import { ToasterTypeOptions as C } from "../enums/toaster.js";
5
- import "../extensions/Blocks/Recommendation/constants/selectors.js";
6
- import { CURRENT_CONFIG_VERSION as I } from "../extensions/Blocks/Recommendation/constants/defaultConfig.js";
7
- import { useRecommendationExtensionStore as L } from "../extensions/Blocks/Recommendation/store/recommendation.js";
8
- import { buildLegacyMigrationPayload as v } from "../extensions/Blocks/Recommendation/utils/legacyStrategyMigration.js";
9
- import { commitBlockChangeOutsidePanel as R } from "../extensions/Blocks/Recommendation/utils/nodeConfigWriter.js";
10
- import { useConfigStore as b } from "../stores/config.js";
11
- const F = () => {
12
- const t = L(), n = b(), { buildCampaignUrl: c } = f(), { showToaster: s } = p(), m = S();
13
- return { convertLegacyStrategy: async () => {
14
- const o = t.currentRecommendationId;
15
- if (o === null || !t.isLegacyStrategyBlock || t.legacyConversionLoading)
16
- return "";
17
- const { strategy: g, productIds: d, filters: y } = t.recommendationConfigs, l = v({
18
- blockId: o,
19
- url: c(String(o)),
20
- campaignId: n.campaignId,
21
- variationId: n.variationId,
22
- strategy: g,
23
- productIds: d,
24
- filters: y,
25
- attributes: t.getFilterList
26
- });
27
- let e;
28
- try {
29
- e = await t.convertLegacyStrategy(l);
30
- } catch (r) {
31
- return console.error("[useLegacyStrategyConversion] migration failed", r), s({
32
- type: C.Error,
33
- message: m("email-editor.legacy-strategy-update-failed")
34
- }), "";
35
- }
36
- const a = t.currentRecommendationId === o;
37
- if (a)
38
- try {
39
- await t.fetchRecommendationProducts();
40
- } catch (r) {
41
- console.error("[useLegacyStrategyConversion] product refetch failed", r);
42
- }
43
- const i = t.blockStates[o], { size: u } = i.recommendationConfigs;
44
- return R(
45
- o,
46
- { strategyId: e, size: u, configVersion: I },
47
- i.recommendationProducts,
48
- "Converted legacy recommendation strategy"
49
- ), a && t.openLegacyStrategyUpdatedModal(), e;
50
- } };
51
- };
52
- export {
53
- F as useLegacyStrategyConversion
54
- };
@@ -1,58 +0,0 @@
1
- import { OP_ANY_OF as u } from "../../../../enums/extensions/recommendationBlock.js";
2
- import "../constants/selectors.js";
3
- import { CURRENT_CONFIG_VERSION as d } from "../constants/defaultConfig.js";
4
- import { parseTagList as m } from "./filterUtil.js";
5
- import { sanitizeProductIds as l } from "./productIds.js";
6
- const I = "String", N = "manualMerchandising";
7
- function _({ strategyId: t, nodeConfigVersion: e }) {
8
- return !t && e < d;
9
- }
10
- const c = (t) => t === "|" ? "or" : "and", b = (t, e) => {
11
- var r;
12
- return {
13
- conditionLogic: c(t.innerGroupOperator),
14
- attribute: {
15
- attributeName: t.attribute,
16
- attributeType: ((r = e.find((o) => o.value === t.attribute)) == null ? void 0 : r.type) || I
17
- },
18
- operator: { operator: t.operator === u ? "=" : t.operator },
19
- value: t.operator === u ? m(t.value).join(u) : t.value
20
- };
21
- };
22
- function f(t, e) {
23
- const r = /* @__PURE__ */ new Map();
24
- return t.filter((o) => o.isValid).forEach((o) => {
25
- r.set(o.filterGroup, [...r.get(o.filterGroup) ?? [], o]);
26
- }), [...r.keys()].sort((o, i) => o - i).map((o) => {
27
- const i = [...r.get(o) ?? []].sort((n, a) => n.filterNumber - a.filterNumber);
28
- return {
29
- groupLogic: c(i[0].outerGroupOperator),
30
- conditionList: i.map((n) => b(n, e))
31
- };
32
- });
33
- }
34
- function A({
35
- blockId: t,
36
- url: e,
37
- campaignId: r,
38
- variationId: o,
39
- strategy: i,
40
- productIds: n,
41
- filters: a,
42
- attributes: g
43
- }) {
44
- const p = f(a, g), s = i === N ? l(n).split(",").filter(Boolean) : [];
45
- return {
46
- campaignId: Number.parseInt(r) || 0,
47
- variationId: Number.parseInt(o) || 0,
48
- blockId: String(t),
49
- url: e,
50
- ...p.length ? { filters: p } : {},
51
- ...s.length ? { productIds: s } : {}
52
- };
53
- }
54
- export {
55
- A as buildLegacyMigrationPayload,
56
- _ as isLegacyStrategyConfig,
57
- f as toMigrationFilterGroups
58
- };
@@ -1,2 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue/types/v3-component-options.js").ComponentOptionsMixin, import("vue/types/v3-component-options.js").ComponentOptionsMixin, {}, string, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
2
- export default _default;
@@ -1,3 +0,0 @@
1
- export declare const useLegacyStrategyConversion: () => {
2
- convertLegacyStrategy: () => Promise<string>;
3
- };
@@ -1,39 +0,0 @@
1
- import type { Filter, RrsMigrationFilterGroup, RrsMigrationPayload } from '@@/Types/recommendation';
2
- type FilterAttribute = {
3
- value: string;
4
- type: string;
5
- };
6
- /**
7
- * A block authored before reusable strategies: it still carries a plain feed
8
- * configuration (compiled into a feed URL string) instead of a strategy id.
9
- * Blocks created under RRS stamp `CURRENT_CONFIG_VERSION`, so the version is
10
- * what separates "never converted" from "not assigned yet".
11
- */
12
- export declare function isLegacyStrategyConfig({ strategyId, nodeConfigVersion }: {
13
- strategyId: string;
14
- nodeConfigVersion: number;
15
- }): boolean;
16
- /**
17
- * Groups the block's valid filters the way the feed URL groups them, in the
18
- * shape the migration endpoint validates. The URL's filter DSL states no
19
- * attribute type and cannot express a mixed-operator group, which is exactly
20
- * what this override exists to supply.
21
- */
22
- export declare function toMigrationFilterGroups(filters: Filter[], attributes: FilterAttribute[]): RrsMigrationFilterGroup[];
23
- interface MigrationInputs {
24
- blockId: number;
25
- url: string;
26
- campaignId: string;
27
- variationId: string;
28
- strategy: string;
29
- productIds: string[];
30
- filters: Filter[];
31
- attributes: FilterAttribute[];
32
- }
33
- /**
34
- * The server names and de-duplicates the strategy, so nothing here derives a
35
- * name; `campaignId`/`variationId` only feed that name and fall back to 0 for
36
- * templates and modules, which carry no numeric campaign.
37
- */
38
- export declare function buildLegacyMigrationPayload({ blockId, url, campaignId, variationId, strategy, productIds, filters, attributes, }: MigrationInputs): RrsMigrationPayload;
39
- export {};
@@ -1,5 +0,0 @@
1
- const C = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12.9403 5.51003L17.6328 11.0273C17.8845 11.3769 18.0068 11.8382 17.9997 12.2963L18 12.3333C18 13.2538 17.4627 14 16.8 14H15V15C15 15.5523 14.5523 16 14 16H10C9.44772 16 9 15.5523 9 15V14H7.2C6.53726 14 6 13.2538 6 12.3333L6.00029 12.2963C5.9932 11.8382 6.11551 11.3769 6.36722 11.0273L11.0597 5.51003C11.3182 5.15101 11.6615 4.98153 12 5.00159C12.3386 4.98153 12.6818 5.15101 12.9403 5.51003Z"/><path d="M10 18C9.44772 18 9 18.4477 9 19C9 19.5523 9.44772 20 10 20H14C14.5523 20 15 19.5523 15 19C15 18.4477 14.5523 18 14 18H10Z"/></svg>
2
- `;
3
- export {
4
- C as default
5
- };
@@ -1,5 +0,0 @@
1
- const C = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 4C14.1217 4 16.1566 4.84285 17.6569 6.34315C19.1571 7.84344 20 9.87827 20 12C20 14.1217 19.1571 16.1566 17.6569 17.6569C16.1566 19.1571 14.1217 20 12 20C9.87827 20 7.84344 19.1571 6.34315 17.6569C4.84285 16.1566 4 14.1217 4 12C4 9.87827 4.84285 7.84344 6.34315 6.34315C7.84344 4.84285 9.87827 4 12 4ZM12 5.6C10.3026 5.6 8.67475 6.27428 7.47452 7.47452C6.27428 8.67475 5.6 10.3026 5.6 12C5.6 13.6974 6.27428 15.3253 7.47452 16.5255C8.67475 17.7257 10.3026 18.4 12 18.4C13.6974 18.4 15.3253 17.7257 16.5255 16.5255C17.7257 15.3253 18.4 13.6974 18.4 12C18.4 10.3026 17.7257 8.67475 16.5255 7.47452C15.3253 6.27428 13.6974 5.6 12 5.6ZM11.496 10.448C11.928 10.448 12.264 10.552 12.496 10.768C12.736 10.976 12.848 11.248 12.848 11.584V11.688L12.824 11.944C12.816 12.064 12.8 12.176 12.776 12.28L12.736 12.432L12.288 14.024L12.248 14.152C12.1976 14.376 12.1629 14.6032 12.144 14.832C12.144 15.04 12.192 15.184 12.288 15.264C12.384 15.344 12.544 15.376 12.776 15.376C12.888 15.376 13.016 15.36 13.152 15.32L13.392 15.24L13.448 15.216L13.328 15.712L12.848 15.896L12.584 15.992L12.464 16.032C12.248 16.112 12 16.144 11.72 16.144C11.28 16.144 10.944 16.04 10.696 15.824C10.5803 15.7241 10.488 15.5998 10.4258 15.4602C10.3636 15.3205 10.3329 15.1689 10.336 15.016C10.3355 14.787 10.3624 14.5587 10.416 14.336L10.448 14.176L10.896 12.576L10.936 12.424L11 12.144C11.024 12.008 11.04 11.88 11.04 11.768C11.04 11.56 11 11.424 10.912 11.344C10.832 11.264 10.672 11.224 10.432 11.224C10.312 11.224 10.192 11.24 10.072 11.272L9.856 11.352L9.76 11.376L9.88 10.888L10.168 10.776C10.36 10.696 10.544 10.632 10.728 10.576C11 10.496 11.256 10.448 11.496 10.448ZM12.496 7.536C12.792 7.536 13.04 7.632 13.248 7.832C13.464 8.024 13.568 8.264 13.568 8.544C13.568 8.816 13.464 9.056 13.248 9.248C13.04 9.44 12.792 9.544 12.496 9.544C12.2 9.544 11.944 9.44 11.736 9.248C11.52 9.056 11.416 8.816 11.416 8.544C11.416 8.264 11.52 8.024 11.736 7.824C11.944 7.632 12.2 7.536 12.496 7.536Z"/></svg>
2
- `;
3
- export {
4
- C as default
5
- };