ublo-lib 1.36.31 → 1.37.0

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 (64) hide show
  1. package/es/common/components/cross-selling-editor/cross-selling-editor.d.ts +3 -1
  2. package/es/common/components/cross-selling-editor/cross-selling-editor.d.ts.map +1 -1
  3. package/es/common/components/cross-selling-editor/cross-selling-editor.js +4 -2
  4. package/es/common/components/cross-selling-editor/editor.d.ts +3 -1
  5. package/es/common/components/cross-selling-editor/editor.d.ts.map +1 -1
  6. package/es/common/components/cross-selling-editor/editor.js +2 -2
  7. package/es/common/components/cross-selling-editor/esf/index.d.ts +3 -0
  8. package/es/common/components/cross-selling-editor/esf/index.d.ts.map +1 -0
  9. package/es/common/components/cross-selling-editor/esf/index.js +2 -0
  10. package/es/common/components/cross-selling-editor/esf/special-rule-form.d.ts +12 -0
  11. package/es/common/components/cross-selling-editor/esf/special-rule-form.d.ts.map +1 -0
  12. package/es/common/components/cross-selling-editor/esf/special-rule-form.js +27 -0
  13. package/es/common/components/cross-selling-editor/esf/special-rule-form.module.css +4 -0
  14. package/es/common/components/cross-selling-editor/esf/step-1.d.ts +12 -0
  15. package/es/common/components/cross-selling-editor/esf/step-1.d.ts.map +1 -0
  16. package/es/common/components/cross-selling-editor/esf/step-1.js +78 -0
  17. package/es/common/components/cross-selling-editor/esf/step-1.module.css +35 -0
  18. package/es/common/components/cross-selling-editor/esf/step-2.d.ts +12 -0
  19. package/es/common/components/cross-selling-editor/esf/step-2.d.ts.map +1 -0
  20. package/es/common/components/cross-selling-editor/esf/step-2.js +157 -0
  21. package/es/common/components/cross-selling-editor/esf/step-2.module.css +72 -0
  22. package/es/common/components/cross-selling-editor/hooks/use-custom-offers.d.ts.map +1 -1
  23. package/es/common/components/cross-selling-editor/hooks/use-custom-offers.js +3 -0
  24. package/es/common/components/cross-selling-editor/hooks/use-fetch.d.ts +12 -0
  25. package/es/common/components/cross-selling-editor/hooks/use-fetch.d.ts.map +1 -0
  26. package/es/common/components/cross-selling-editor/hooks/use-fetch.js +35 -0
  27. package/es/common/components/cross-selling-editor/hooks/use-tunnel-offers.d.ts.map +1 -1
  28. package/es/common/components/cross-selling-editor/hooks/use-tunnel-offers.js +2 -0
  29. package/es/common/components/cross-selling-editor/override.d.ts +2 -1
  30. package/es/common/components/cross-selling-editor/override.d.ts.map +1 -1
  31. package/es/common/components/cross-selling-editor/override.js +12 -6
  32. package/es/common/components/cross-selling-editor/overrides-list.d.ts.map +1 -1
  33. package/es/common/components/cross-selling-editor/overrides-list.js +9 -6
  34. package/es/common/components/cross-selling-editor/overrides-list.module.css +24 -8
  35. package/es/common/components/cross-selling-editor/rules.d.ts +3 -2
  36. package/es/common/components/cross-selling-editor/rules.d.ts.map +1 -1
  37. package/es/common/components/cross-selling-editor/rules.js +18 -7
  38. package/es/common/components/cross-selling-editor/services/api.d.ts +7 -0
  39. package/es/common/components/cross-selling-editor/services/api.d.ts.map +1 -1
  40. package/es/common/components/cross-selling-editor/services/api.js +101 -3
  41. package/es/common/components/cross-selling-editor/services/utils.d.ts +7 -4
  42. package/es/common/components/cross-selling-editor/services/utils.d.ts.map +1 -1
  43. package/es/common/components/cross-selling-editor/services/utils.js +51 -11
  44. package/es/common/components/cross-selling-editor/tester/index.d.ts +3 -0
  45. package/es/common/components/cross-selling-editor/tester/index.d.ts.map +1 -0
  46. package/es/common/components/cross-selling-editor/tester/index.js +2 -0
  47. package/es/common/components/cross-selling-editor/tester/tester.d.ts +11 -0
  48. package/es/common/components/cross-selling-editor/tester/tester.d.ts.map +1 -0
  49. package/es/common/components/cross-selling-editor/{tester.js → tester/tester.js} +72 -27
  50. package/es/common/components/cross-selling-editor/{tester.module.css → tester/tester.module.css} +1 -0
  51. package/es/common/components/cross-selling-editor/{tester-tunnel-offer.d.ts → tester/tunnel-offer.d.ts} +4 -3
  52. package/es/common/components/cross-selling-editor/tester/tunnel-offer.d.ts.map +1 -0
  53. package/es/common/components/cross-selling-editor/tester/tunnel-offer.js +54 -0
  54. package/es/common/components/cross-selling-editor/{tester-tunnel-offer.module.css → tester/tunnel-offer.module.css} +16 -3
  55. package/es/common/components/cross-selling-editor/types.d.ts +65 -0
  56. package/es/common/components/cross-selling-editor/types.d.ts.map +1 -1
  57. package/es/lbm/components/instant-search/services/api.d.ts +0 -1
  58. package/es/lbm/components/instant-search/services/api.d.ts.map +1 -1
  59. package/es/lbm/components/instant-search/services/api.js +1 -12
  60. package/package.json +1 -1
  61. package/es/common/components/cross-selling-editor/tester-tunnel-offer.d.ts.map +0 -1
  62. package/es/common/components/cross-selling-editor/tester-tunnel-offer.js +0 -21
  63. package/es/common/components/cross-selling-editor/tester.d.ts +0 -10
  64. package/es/common/components/cross-selling-editor/tester.d.ts.map +0 -1
@@ -1,13 +1,13 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import Input from "dt-design-system/es/input";
4
4
  import Popover from "dt-design-system/es/popover";
5
5
  import Button from "dt-design-system/es/button";
6
6
  import * as Icons from "dt-design-system/es/icons";
7
- import TesterTunnelOffer from "./tester-tunnel-offer";
8
- import * as Utils from "./services/utils";
7
+ import TesterTunnelOffer from "./tunnel-offer";
8
+ import * as Utils from "../services/utils";
9
9
  import styles from "./tester.module.css";
10
- export default function Tester({ container, config, tunnelOffers, durations, }) {
10
+ export default function Tester({ container, config, durations, tunnelOffersOrder, displayedTunnelOffers, }) {
11
11
  const ref = React.useRef(null);
12
12
  const [stayFrom, setStayFrom] = React.useState("");
13
13
  const [stayTo, setStayTo] = React.useState("");
@@ -15,6 +15,7 @@ export default function Tester({ container, config, tunnelOffers, durations, })
15
15
  const [merchants, setMerchants] = React.useState([]);
16
16
  const [skiPassDurations, setSkiPassDurations] = React.useState([]);
17
17
  const [durationTags, setDurationTags] = React.useState([]);
18
+ const [esfRules, setEsfRules] = React.useState([]);
18
19
  const updateStayFrom = (value) => {
19
20
  setStayFrom(value);
20
21
  const stayToIsUndefined = !stayTo;
@@ -36,6 +37,28 @@ export default function Tester({ container, config, tunnelOffers, durations, })
36
37
  setStayFrom(newValue);
37
38
  }
38
39
  };
40
+ const esfOffersContent = (config.ESF?.overrides || []).reduce((acc, override) => {
41
+ const isMatching = esfRules?.includes(override.name);
42
+ if (isMatching) {
43
+ const { kinds, activities, levels, meetings } = override.triggers.esf?.rules || {};
44
+ const config = {
45
+ kinds: kinds ? [kinds] : undefined,
46
+ activities: activities?.split(",").filter(Boolean),
47
+ levels: levels?.split(",").filter(Boolean),
48
+ meetings: meetings?.split(",").filter(Boolean),
49
+ };
50
+ return [...acc, config];
51
+ }
52
+ return acc;
53
+ }, []);
54
+ const allEsfOverridesNames = config.ESF?.overrides?.map(({ name }) => name) || [];
55
+ const firstActiveEsfRule = esfRules?.reduce((acc, rule) => {
56
+ if (!acc)
57
+ return rule;
58
+ const accIndex = allEsfOverridesNames.indexOf(acc);
59
+ const ruleIndex = allEsfOverridesNames.indexOf(rule);
60
+ return ruleIndex < accIndex ? rule : acc;
61
+ }, undefined);
39
62
  const stay = Utils.getStayFromCart({ stayFrom, stayTo });
40
63
  const cartContent = {
41
64
  items: cartOffers,
@@ -43,8 +66,9 @@ export default function Tester({ container, config, tunnelOffers, durations, })
43
66
  merchants,
44
67
  skiPassDurations,
45
68
  durationTags,
69
+ esfOffersContent,
46
70
  };
47
- const sortedOffers = Utils.getSortedOffers(container, cartContent, config);
71
+ const sortedOffers = Utils.getSortedOffers(container, cartContent, config, firstActiveEsfRule);
48
72
  const activeOverrides = Object.keys(cartOffers).reduce((acc, key) => {
49
73
  const name = Utils.tunnelOffers[key];
50
74
  const override = Utils.getActiveOverride(key, cartContent, config);
@@ -53,7 +77,11 @@ export default function Tester({ container, config, tunnelOffers, durations, })
53
77
  return acc;
54
78
  return { ...acc, [name]: [...(acc[name] || []), override.name] };
55
79
  }, {});
56
- const activeOverridesKeys = Object.keys(activeOverrides);
80
+ const activeEsfRules = esfRules?.length
81
+ ? { "Produit esf": [firstActiveEsfRule] }
82
+ : {};
83
+ const allOverrides = { ...activeOverrides, ...activeEsfRules };
84
+ const activeOverridesKeys = Object.keys(allOverrides);
57
85
  const hasActiveOverride = activeOverridesKeys.length > 0;
58
86
  const updateCartOffers = (kind) => (value) => {
59
87
  setCartOffers((prev) => ({ ...prev, [kind]: value }));
@@ -61,32 +89,49 @@ export default function Tester({ container, config, tunnelOffers, durations, })
61
89
  const refreshCartContent = () => {
62
90
  const container = ref.current;
63
91
  if (container) {
64
- const merchantInputs = Array.from(container.querySelectorAll("[data-kind='merchant']"));
65
- const skiPassDurationInputs = Array.from(container.querySelectorAll("[data-kind='skiPassDuration']"));
66
- const durationTagsSelect = Array.from(container.querySelectorAll("[data-kind='durationTags']"));
67
- const merchants = merchantInputs
68
- .map((input) => input.value)
69
- .filter(Boolean);
70
- const skiPassDurations = skiPassDurationInputs
71
- .map((input) => Number(input.value))
72
- .filter(Boolean);
73
- const durationTags = durationTagsSelect
74
- .map((select) => select.value)
75
- .filter(Boolean);
76
- setMerchants(merchants);
77
- setSkiPassDurations(skiPassDurations);
78
- setDurationTags(durationTags);
92
+ const states = Array.from(container.querySelectorAll("[data-item-state]"));
93
+ let cartContent = {};
94
+ states.forEach((stateItem) => {
95
+ const state = stateItem.getAttribute("data-item-state");
96
+ if (!state)
97
+ return;
98
+ const parsedState = JSON.parse(state);
99
+ Object.keys(parsedState).forEach((key) => {
100
+ const values = parsedState[key];
101
+ for (const subKey in values) {
102
+ cartContent = {
103
+ ...cartContent,
104
+ [key]: [...(cartContent[key] || []), values[subKey]],
105
+ };
106
+ }
107
+ });
108
+ });
109
+ setMerchants(cartContent?.merchants);
110
+ setSkiPassDurations(cartContent?.skiPassDurations);
111
+ setDurationTags(cartContent?.durationTags);
112
+ setEsfRules(cartContent?.esfRules);
79
113
  }
80
114
  };
81
- const tunnelOptions = Object.keys(tunnelOffers).map((key) => {
82
- const label = tunnelOffers[key];
115
+ const tunnelOptions = Object.keys(Utils.tunnelOffers)
116
+ .map((key) => {
117
+ const label = Utils.tunnelOffers[key];
83
118
  return { key, value: key, label };
119
+ })
120
+ .filter(({ value }) => {
121
+ if (!displayedTunnelOffers)
122
+ return true;
123
+ return displayedTunnelOffers.includes(value);
124
+ })
125
+ .sort((a, b) => {
126
+ if (!tunnelOffersOrder)
127
+ return 0;
128
+ return (tunnelOffersOrder.indexOf(a.value) - tunnelOffersOrder.indexOf(b.value));
84
129
  });
85
130
  return (_jsx("div", { className: styles.tester, children: _jsxs("div", { className: styles.content, children: [_jsxs("div", { className: styles.title, children: ["Pr\u00E9visualisation", _jsxs(Popover, { className: styles.popover, trigger: _jsx(Button, { variant: "transparent", children: _jsx(Icons.Info, {}) }), children: ["Vous pouvez tester les r\u00E8gles de suggestions en modifiant le contenu du panier ci-dessous.", _jsx("br", {}), "Les suggestions de produits s'afficheront dessous en temps r\u00E9el."] })] }), _jsxs("div", { className: styles.header, children: [_jsx("div", { className: styles.headerTitle, children: "Simulez un contenu de panier" }), _jsxs("div", { className: styles.stay, children: [_jsx(Input, { className: styles.input, type: "date", label: "Date de d\u00E9but de s\u00E9jour", value: stayFrom || "", onValueChange: updateStayFrom, compact: true }), _jsx(Input, { className: styles.input, type: "date", label: "Date de fin de s\u00E9jour", value: stayTo || "", onValueChange: updateStayTo, compact: true })] }), _jsx("div", { ref: ref, className: styles.tunnelOffers, children: tunnelOptions.map(({ key, value, label }) => {
86
- return (_jsx(TesterTunnelOffer, { kind: key, value: value, label: label, cartOffers: cartOffers, updateCartOffers: updateCartOffers, refreshCartContent: refreshCartContent, durations: durations }, key.concat(label)));
87
- }) })] }), _jsxs("div", { className: styles.activeOverrides, children: [_jsxs("span", { className: styles.activeOverridesTitle, children: ["Surcharge(s) active(s) :", " "] }), hasActiveOverride ? (activeOverridesKeys.map((key) => {
88
- const values = activeOverrides[key];
89
- return (_jsxs(_Fragment, { children: [_jsxs("span", { className: styles.activeOverride, children: [key, " (", values.join(", "), ")"] }, key), " "] }));
131
+ return (_jsx(TesterTunnelOffer, { kind: key, value: value, label: label, cartOffers: cartOffers, updateCartOffers: updateCartOffers, refreshCartContent: refreshCartContent, durations: durations, config: config }, key.concat(label)));
132
+ }) })] }), _jsxs("div", { className: styles.activeOverrides, children: [_jsxs("span", { className: styles.activeOverridesTitle, children: ["Surcharges et r\u00E8gles actives :", " "] }), hasActiveOverride ? (activeOverridesKeys.map((key) => {
133
+ const values = allOverrides[key];
134
+ return (_jsxs(React.Fragment, { children: [_jsxs("span", { className: styles.activeOverride, children: [key, " (", values.join(", "), ")"] }), " "] }, key));
90
135
  })) : (_jsx("span", { className: styles.noActiveOverride, children: "Aucune" }))] }), _jsx("div", { className: styles.offers, "data-custom-offers": "", children: sortedOffers.map(({ title, weight, elementHTML }) => {
91
136
  return (_jsxs("div", { className: styles.offer, "data-custom-offer": "", children: [_jsx("div", { className: styles.offerContent, dangerouslySetInnerHTML: { __html: elementHTML } }), _jsxs("div", { className: styles.offerWeight, children: ["Priorit\u00E9 : ", _jsx("b", { children: weight })] })] }, title));
92
137
  }) })] }) }));
@@ -82,6 +82,7 @@
82
82
  display: grid;
83
83
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
84
84
  gap: 12px;
85
+ padding: 0;
85
86
  }
86
87
 
87
88
  .offer {
@@ -1,4 +1,4 @@
1
- import type { Durations } from "./types";
1
+ import type { Config, Durations } from "../types";
2
2
  type Props = {
3
3
  kind: string;
4
4
  value: string;
@@ -7,7 +7,8 @@ type Props = {
7
7
  updateCartOffers: (kind: string) => (value: number) => void;
8
8
  refreshCartContent: () => void;
9
9
  durations?: Durations;
10
+ config: Config;
10
11
  };
11
- export default function TesterTunnelOffer({ kind, value, label, cartOffers, updateCartOffers, refreshCartContent, durations, }: Props): import("react/jsx-runtime").JSX.Element;
12
+ export default function TesterTunnelOffer({ kind, value, label, cartOffers, updateCartOffers, refreshCartContent, durations, config, }: Props): import("react/jsx-runtime").JSX.Element;
12
13
  export {};
13
- //# sourceMappingURL=tester-tunnel-offer.d.ts.map
14
+ //# sourceMappingURL=tunnel-offer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tunnel-offer.d.ts","sourceRoot":"","sources":["../../../../../src/common/components/cross-selling-editor/tester/tunnel-offer.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAIlD,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEnC,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5D,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EACxC,IAAI,EACJ,KAAK,EACL,KAAK,EACL,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,SAAS,EACT,MAAM,GACP,EAAE,KAAK,2CA6HP"}
@@ -0,0 +1,54 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import NumberPicker from "dt-design-system/es/number-picker";
4
+ import Input from "dt-design-system/es/input";
5
+ import Select from "dt-design-system/es/select";
6
+ import Popover from "dt-design-system/es/popover";
7
+ import Button from "dt-design-system/es/button";
8
+ import * as Icons from "dt-design-system/es/icons";
9
+ import * as Utils from "../services/utils";
10
+ import styles from "./tunnel-offer.module.css";
11
+ import Checkbox from "dt-design-system/es/checkbox";
12
+ export default function TesterTunnelOffer({ kind, value, label, cartOffers, updateCartOffers, refreshCartContent, durations, config, }) {
13
+ const [state, setState] = React.useState({});
14
+ const overrideAllowed = Utils.allowedOverrides.includes(kind);
15
+ const isSkiPasses = kind === "LIFT";
16
+ const isEsf = kind === "ESF";
17
+ const itemValue = cartOffers[value] || 0;
18
+ const items = [...new Array(itemValue)];
19
+ const esfOverrides = config.ESF?.overrides || [];
20
+ const updateAppliedEsfRules = (name) => (checked) => {
21
+ const currentValues = state.esfRules || [];
22
+ if (!checked) {
23
+ const newValues = currentValues.filter((value) => value !== name);
24
+ const newState = { ...state, esfRules: newValues };
25
+ setState(newState);
26
+ }
27
+ else {
28
+ const newState = { ...state, esfRules: [...currentValues, name] };
29
+ setState(newState);
30
+ }
31
+ window.requestAnimationFrame(refreshCartContent);
32
+ };
33
+ return (_jsxs("div", { className: styles.item, "data-item-state": JSON.stringify(state), children: [overrideAllowed && items.length > 0 && (_jsxs(Popover, { className: styles.popover, trigger: _jsx(Button, { children: _jsx(Icons.Settings, {}) }), children: [isEsf && (_jsxs(_Fragment, { children: [_jsx("div", { className: styles.esfRulesTitle, children: "R\u00E8gle(s) \u00E0 appliquer" }), !esfOverrides.length && "Aucune de règle spéciale", esfOverrides.map((override) => {
34
+ const { id, name } = override;
35
+ return (_jsx(Checkbox, { label: name, checked: state.esfRules?.includes(name) || false, onCheckedChange: updateAppliedEsfRules(name) }, id));
36
+ })] })), overrideAllowed &&
37
+ items.map((_, index) => {
38
+ const number = index + 1;
39
+ const updateState = (key) => (value) => {
40
+ const currentValues = state[key] || {};
41
+ const newValues = { ...currentValues, [index]: value };
42
+ const newState = { ...state, [key]: newValues };
43
+ setState(newState);
44
+ window.requestAnimationFrame(refreshCartContent);
45
+ };
46
+ if (isEsf) {
47
+ return null;
48
+ }
49
+ if (isSkiPasses) {
50
+ return (_jsxs(React.Fragment, { children: [_jsx(Input, { type: "number", className: styles.input, label: `Durée du forfait n°${number}`, placeholder: "En jour(s) (Optionnel)", min: 0, max: 40, value: state.skiPassDurations?.[index] || 0, onValueChange: updateState("skiPassDurations"), compact: true }), durations && (_jsx(Select, { className: styles.input, label: durations?.title + ` n°${number}`, placeholder: " ", options: durations?.tags, value: state.durationTags?.[index] || "", onValueChange: updateState("durationTags"), compact: true }))] }, index));
51
+ }
52
+ return (_jsx(Input, { className: styles.input, label: `Marchand n°${number}`, placeholder: "Code (Optionnel)", value: state.merchants?.[index] || "", onValueChange: updateState("merchants"), compact: true }, index));
53
+ })] })), _jsx(NumberPicker, { label: label, value: itemValue, onChange: updateCartOffers(value), min: 0, max: 10 })] }, label));
54
+ }
@@ -1,10 +1,10 @@
1
1
  .item {
2
2
  display: flex;
3
- flex-direction: column;
4
- gap: 6px;
3
+ gap: 9px;
5
4
  padding: 10px;
6
5
  background-color: var(--ds-grey-000, #fff);
7
- border-radius: var(--ds-radius-100, 4px);
6
+ border: 1px solid var(--ds-grey-200, #ededed);
7
+ border-radius: var(--ds-radius-200, 8px);
8
8
  }
9
9
 
10
10
  .input > label {
@@ -16,3 +16,16 @@
16
16
  .input > label > div {
17
17
  flex: 1 1 auto;
18
18
  }
19
+
20
+ .popover {
21
+ display: flex;
22
+ flex-direction: column;
23
+ gap: 6px;
24
+ }
25
+
26
+ .esfRulesTitle {
27
+ margin-bottom: 10px;
28
+ font-size: 14px;
29
+ text-align: center;
30
+ font-weight: 700;
31
+ }
@@ -7,6 +7,17 @@ type Triggers = {
7
7
  skiPassDuration?: number;
8
8
  skiPassDurationOperator?: Operator;
9
9
  durationTag?: string;
10
+ esf?: {
11
+ season?: string;
12
+ rules?: {
13
+ levels?: string;
14
+ activities?: string;
15
+ kinds?: string;
16
+ meetings?: string;
17
+ products?: string;
18
+ };
19
+ products?: string;
20
+ };
10
21
  };
11
22
  export type Override = {
12
23
  id?: number;
@@ -26,5 +37,59 @@ export type Durations = {
26
37
  title: string;
27
38
  tags: string[];
28
39
  };
40
+ export type EsfWelcome = {
41
+ availableSeasons: string[];
42
+ } | null;
43
+ export type EsfAge = {
44
+ ages: string[];
45
+ };
46
+ export type EsfAges = {
47
+ choices: EsfAge[];
48
+ };
49
+ export type EsfKind = {
50
+ code: string;
51
+ name: string;
52
+ };
53
+ export type EsfKinds = {
54
+ choices: EsfKind[];
55
+ };
56
+ export type EsfActivity = {
57
+ code: string;
58
+ name: string;
59
+ };
60
+ export type EsfActivities = {
61
+ choices: EsfActivity[];
62
+ };
63
+ export type EsfLevel = {
64
+ code: string;
65
+ name: string;
66
+ };
67
+ export type EsfLevels = {
68
+ choices: EsfLevel[];
69
+ };
70
+ export type EsfMeeting = {
71
+ code: string;
72
+ name: string;
73
+ };
74
+ export type EsfMeetings = {
75
+ choices: EsfMeeting[];
76
+ };
77
+ export type EsfProduct = {
78
+ code: string;
79
+ name: string;
80
+ price: number;
81
+ };
82
+ export type EsfProducts = {
83
+ choices: {
84
+ start: string;
85
+ products: EsfProduct[];
86
+ }[];
87
+ };
88
+ export type EsfOffersContent = {
89
+ kinds?: string[];
90
+ activities?: string[];
91
+ levels?: string[];
92
+ meetings?: string[];
93
+ };
29
94
  export {};
30
95
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/common/components/cross-selling-editor/types.ts"],"names":[],"mappings":"AAAA,KAAK,QAAQ,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,CAAC;AAE9C,KAAK,QAAQ,GAAG;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uBAAuB,CAAC,EAAE,QAAQ,CAAC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM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QAAQ,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,EAAE,QAAQ,EAAE,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,UAAU,EAAE,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,UAAU,EAAE,CAAC;KACxB,EAAE,CAAC;CACL,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC"}
@@ -15,5 +15,4 @@ export type GoogleSearchResult = {
15
15
  };
16
16
  export declare function fetchOTResults(query: string, lang: string): Promise<GoogleSearchResult[]>;
17
17
  export declare function fetchEvaluation(site: string, lang: string, facet: number, groupLimit?: number, queryBy?: string, queryByWeights?: string, semantic?: boolean): Promise<any>;
18
- export declare function indexPerType(type: string, entries: any[]): Promise<any>;
19
18
  //# sourceMappingURL=api.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../src/lbm/components/instant-search/services/api.ts"],"names":[],"mappings":"AAkCA,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,UAAU,GAAE,MAAW,EACvB,OAAO,GAAE,MAA8B,EACvC,cAAc,CAAC,EAAE,MAAM,EACvB,QAAQ,CAAC,EAAE,OAAO,gBAenB;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE;QACR,SAAS,EAAE;YACT,GAAG,EAAE,MAAM,CAAC;SACb,EAAE,CAAC;QACJ,aAAa,EAAE;YACb,GAAG,EAAE,MAAM,CAAC;SACb,EAAE,CAAC;KACL,CAAC;CACH,CAAC;AAEF,wBAAsB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,iCAW/D;AAED,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,UAAU,GAAE,MAAW,EACvB,OAAO,GAAE,MAA8B,EACvC,cAAc,CAAC,EAAE,MAAM,EACvB,QAAQ,CAAC,EAAE,OAAO,gBAanB;AAED,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,gBAe9D"}
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../src/lbm/components/instant-search/services/api.ts"],"names":[],"mappings":"AAkCA,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,UAAU,GAAE,MAAW,EACvB,OAAO,GAAE,MAA8B,EACvC,cAAc,CAAC,EAAE,MAAM,EACvB,QAAQ,CAAC,EAAE,OAAO,gBAenB;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE;QACR,SAAS,EAAE;YACT,GAAG,EAAE,MAAM,CAAC;SACb,EAAE,CAAC;QACJ,aAAa,EAAE;YACb,GAAG,EAAE,MAAM,CAAC;SACb,EAAE,CAAC;KACL,CAAC;CACH,CAAC;AAEF,wBAAsB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,iCAW/D;AAED,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,UAAU,GAAE,MAAW,EACvB,OAAO,GAAE,MAA8B,EACvC,cAAc,CAAC,EAAE,MAAM,EACvB,QAAQ,CAAC,EAAE,OAAO,gBAanB"}
@@ -1,7 +1,7 @@
1
1
  import * as Fetcher from "../../../../common/utils/fetcher";
2
2
  import getConfig from "next/config";
3
3
  const { publicRuntimeConfig } = getConfig();
4
- const { searchApi: api, googleSites, site } = publicRuntimeConfig;
4
+ const { searchApi: api, googleSites } = publicRuntimeConfig;
5
5
  const QUERY_ITEMS = [
6
6
  "title",
7
7
  "text",
@@ -42,14 +42,3 @@ export function fetchEvaluation(site, lang, facet, groupLimit = 40, queryBy = QU
42
42
  ...searchParams(facet, groupLimit, queryBy, queryByWeights, semantic),
43
43
  }, { site, lang }, undefined, undefined);
44
44
  }
45
- export async function indexPerType(type, entries) {
46
- const endpoint = `${api}/api/ublo-search/index/lbm/per-type`;
47
- return Fetcher.post(endpoint, {
48
- site,
49
- type,
50
- lang: "fr",
51
- index: entries,
52
- }, {}, {
53
- Authorization: "VerUfemboy45",
54
- });
55
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ublo-lib",
3
- "version": "1.36.31",
3
+ "version": "1.37.0",
4
4
  "peerDependencies": {
5
5
  "dt-design-system": "^3.9.9",
6
6
  "leaflet": "^1.9.1",
@@ -1 +0,0 @@
1
- {"version":3,"file":"tester-tunnel-offer.d.ts","sourceRoot":"","sources":["../../../../src/common/components/cross-selling-editor/tester-tunnel-offer.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5D,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EACxC,IAAI,EACJ,KAAK,EACL,KAAK,EACL,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,SAAS,GACV,EAAE,KAAK,2CA6DP"}
@@ -1,21 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import * as React from "react";
3
- import NumberPicker from "dt-design-system/es/number-picker";
4
- import Input from "dt-design-system/es/input";
5
- import Select from "dt-design-system/es/select";
6
- import * as Utils from "./services/utils";
7
- import styles from "./tester-tunnel-offer.module.css";
8
- export default function TesterTunnelOffer({ kind, value, label, cartOffers, updateCartOffers, refreshCartContent, durations, }) {
9
- const overrideAllowed = Utils.allowedOverrides.includes(kind);
10
- const isSkiPasses = kind === "LIFT";
11
- const itemValue = cartOffers[value] || 0;
12
- const items = [...new Array(itemValue)];
13
- return (_jsxs("div", { className: styles.item, children: [_jsx(NumberPicker, { label: label, value: itemValue, onChange: updateCartOffers(value), min: 0, max: 10 }), overrideAllowed &&
14
- items.map((_, index) => {
15
- const number = index + 1;
16
- if (isSkiPasses) {
17
- return (_jsxs(React.Fragment, { children: [_jsx(Input, { type: "number", className: styles.input, "data-kind": "skiPassDuration", label: `Durée du forfait n°${number}`, placeholder: "En jour(s) (Optionnel)", min: 0, max: 40, onChange: refreshCartContent, compact: true }), durations && (_jsx(Select, { className: styles.input, label: durations?.title + ` n°${number}`, placeholder: " ", "data-kind": "durationTags", options: durations?.tags, onChange: refreshCartContent, compact: true }))] }, index));
18
- }
19
- return (_jsx(Input, { className: styles.input, "data-kind": "merchant", label: `Marchand n°${number}`, placeholder: "Code (Optionnel)", onChange: refreshCartContent, compact: true }, index));
20
- })] }, label));
21
- }
@@ -1,10 +0,0 @@
1
- import type { Config, Durations } from "./types";
2
- type Props = {
3
- container: HTMLElement;
4
- config: Config;
5
- tunnelOffers: Record<string, string>;
6
- durations?: Durations;
7
- };
8
- export default function Tester({ container, config, tunnelOffers, durations, }: Props): import("react/jsx-runtime").JSX.Element;
9
- export {};
10
- //# sourceMappingURL=tester.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tester.d.ts","sourceRoot":"","sources":["../../../../src/common/components/cross-selling-editor/tester.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEjD,KAAK,KAAK,GAAG;IACX,SAAS,EAAE,WAAW,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC7B,SAAS,EACT,MAAM,EACN,YAAY,EACZ,SAAS,GACV,EAAE,KAAK,2CA2LP"}