ublo-lib 1.38.45 → 1.39.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 (58) hide show
  1. package/es/common/components/gesco-contact-form/gesco-contact-form.d.ts +1 -2
  2. package/es/common/components/gesco-contact-form/gesco-contact-form.d.ts.map +1 -1
  3. package/es/common/components/gesco-contact-form/gesco-contact-form.js +7 -7
  4. package/es/market-place/components/instant-search/google-results.d.ts +9 -0
  5. package/es/market-place/components/instant-search/google-results.d.ts.map +1 -0
  6. package/es/market-place/components/instant-search/google-results.js +24 -0
  7. package/es/market-place/components/instant-search/google-results.module.css +109 -0
  8. package/es/market-place/components/instant-search/hooks/use-constant.d.ts +2 -0
  9. package/es/market-place/components/instant-search/hooks/use-constant.d.ts.map +1 -0
  10. package/es/market-place/components/instant-search/hooks/use-constant.js +8 -0
  11. package/es/market-place/components/instant-search/hooks/use-debounced-search.d.ts +7 -0
  12. package/es/market-place/components/instant-search/hooks/use-debounced-search.d.ts.map +1 -0
  13. package/es/market-place/components/instant-search/hooks/use-debounced-search.js +11 -0
  14. package/es/market-place/components/instant-search/hooks/use-google-search.d.ts +7 -0
  15. package/es/market-place/components/instant-search/hooks/use-google-search.d.ts.map +1 -0
  16. package/es/market-place/components/instant-search/hooks/use-google-search.js +7 -0
  17. package/es/market-place/components/instant-search/hooks/use-search.d.ts +17 -0
  18. package/es/market-place/components/instant-search/hooks/use-search.d.ts.map +1 -0
  19. package/es/market-place/components/instant-search/hooks/use-search.js +10 -0
  20. package/es/market-place/components/instant-search/i18n.json +67 -0
  21. package/es/market-place/components/instant-search/images/lodging-placeholder.png +0 -0
  22. package/es/market-place/components/instant-search/images/page-placeholder.png +0 -0
  23. package/es/market-place/components/instant-search/index.d.ts +3 -0
  24. package/es/market-place/components/instant-search/index.d.ts.map +1 -0
  25. package/es/market-place/components/instant-search/index.js +2 -0
  26. package/es/market-place/components/instant-search/instant-search.d.ts +14 -0
  27. package/es/market-place/components/instant-search/instant-search.d.ts.map +1 -0
  28. package/es/market-place/components/instant-search/instant-search.js +66 -0
  29. package/es/market-place/components/instant-search/instant-search.module.css +16 -0
  30. package/es/market-place/components/instant-search/links.d.ts +11 -0
  31. package/es/market-place/components/instant-search/links.d.ts.map +1 -0
  32. package/es/market-place/components/instant-search/links.js +31 -0
  33. package/es/market-place/components/instant-search/links.module.css +97 -0
  34. package/es/market-place/components/instant-search/no-product.d.ts +6 -0
  35. package/es/market-place/components/instant-search/no-product.d.ts.map +1 -0
  36. package/es/market-place/components/instant-search/no-product.js +4 -0
  37. package/es/market-place/components/instant-search/products.d.ts +13 -0
  38. package/es/market-place/components/instant-search/products.d.ts.map +1 -0
  39. package/es/market-place/components/instant-search/products.js +54 -0
  40. package/es/market-place/components/instant-search/products.module.css +169 -0
  41. package/es/market-place/components/instant-search/results.d.ts +20 -0
  42. package/es/market-place/components/instant-search/results.d.ts.map +1 -0
  43. package/es/market-place/components/instant-search/results.js +47 -0
  44. package/es/market-place/components/instant-search/results.module.css +95 -0
  45. package/es/market-place/components/instant-search/search-input.d.ts +15 -0
  46. package/es/market-place/components/instant-search/search-input.d.ts.map +1 -0
  47. package/es/market-place/components/instant-search/search-input.js +56 -0
  48. package/es/market-place/components/instant-search/search-input.module.css +87 -0
  49. package/es/market-place/components/instant-search/services/api.d.ts +17 -0
  50. package/es/market-place/components/instant-search/services/api.d.ts.map +1 -0
  51. package/es/market-place/components/instant-search/services/api.js +24 -0
  52. package/es/market-place/components/instant-search/services/messages.d.ts +2 -0
  53. package/es/market-place/components/instant-search/services/messages.d.ts.map +1 -0
  54. package/es/market-place/components/instant-search/services/messages.js +5 -0
  55. package/es/market-place/components/instant-search/services/utils.d.ts +4 -0
  56. package/es/market-place/components/instant-search/services/utils.d.ts.map +1 -0
  57. package/es/market-place/components/instant-search/services/utils.js +44 -0
  58. package/package.json +2 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/market-place/components/instant-search/services/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,eAAe,EAC1B,iBAAiB,GAAE,OAAe,OAoBnC;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,SAkBxE;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,UAGrC"}
@@ -0,0 +1,44 @@
1
+ export function getHighlight(property, highlight, withExtractQuotes = false) {
2
+ if (!highlight[property]?.snippet)
3
+ return;
4
+ let snippet = highlight[property].snippet;
5
+ if (!withExtractQuotes)
6
+ return snippet;
7
+ const startsWithMaj = /[A-Z]/.test(snippet);
8
+ const endsWithDot = snippet[snippet.length - 1] === ".";
9
+ if (!startsWithMaj) {
10
+ snippet = `...${snippet}`;
11
+ }
12
+ if (!endsWithDot) {
13
+ snippet = `${snippet}...`;
14
+ }
15
+ return snippet;
16
+ }
17
+ export function filterProducts(products, weekNumber) {
18
+ if (weekNumber !== null) {
19
+ return products.filter((product) => {
20
+ const { weeks = [] } = product.document;
21
+ return weeks.length === 0 || weeks.includes(weekNumber);
22
+ });
23
+ }
24
+ return products.reduce((acc, product) => {
25
+ const { image, pageTitle } = product.document;
26
+ const isAlreadyInAcc = acc.some((item) => {
27
+ return (normalizeImage(item.document.image) === normalizeImage(image) &&
28
+ item.document.pageTitle === pageTitle);
29
+ });
30
+ if (isAlreadyInAcc)
31
+ return acc;
32
+ return [...acc, product];
33
+ }, []);
34
+ }
35
+ export function sliceText(text) {
36
+ if (!text)
37
+ return;
38
+ return text?.slice(0, 30) + "...";
39
+ }
40
+ function normalizeImage(image) {
41
+ if (!image)
42
+ return "";
43
+ return image.replace(/(-[0-9]+)?.(jpg|jpeg|png|gif)/, "");
44
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ublo-lib",
3
- "version": "1.38.45",
3
+ "version": "1.39.1",
4
4
  "peerDependencies": {
5
5
  "dt-design-system": "^3.10.8",
6
6
  "leaflet": "^1.9.1",
@@ -50,7 +50,7 @@
50
50
  "scripts": {
51
51
  "clean": "rm -rf es",
52
52
  "build": "yarn clean && tsc",
53
- "postbuild": "cpx 'src/**/*.{json,css,svg}' es",
53
+ "postbuild": "cpx 'src/**/*.{json,css,svg,png}' es",
54
54
  "prepublishOnly": "yarn build",
55
55
  "watch": "yarn clean && tsc --watch & cpx './src/**/*.{json,css,svg}' es -w",
56
56
  "lint": "eslint --ext .ts,.tsx src/"