ublo-lib 1.36.28 → 1.36.29

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.
@@ -1,3 +1,3 @@
1
- declare const useFaq: (selector: string, refresh: string) => void;
1
+ declare const useFaq: (selector: string, refresh: string, path: string) => void;
2
2
  export default useFaq;
3
3
  //# sourceMappingURL=use-faq.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-faq.d.ts","sourceRoot":"","sources":["../../../src/common/hooks/use-faq.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,MAAM,aAAc,MAAM,WAA0B,MAAM,SA4C/D,CAAC;AAEF,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"use-faq.d.ts","sourceRoot":"","sources":["../../../src/common/hooks/use-faq.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,MAAM,aACA,MAAM,WACP,MAAM,QACT,MAAM,SA6Cb,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { useUbloContext } from "ublo/with-ublo";
3
3
  const buildClass = (className) => `${className}--opened`;
4
- const useFaq = (selector = ".faq-block", refresh) => {
4
+ const useFaq = (selector = ".faq-block", refresh, path) => {
5
5
  const [blocks, setBlocks] = React.useState([]);
6
6
  const { cmsMode } = useUbloContext();
7
7
  const clicked = React.useCallback((clickedBlock, blocks) => () => {
@@ -31,7 +31,7 @@ const useFaq = (selector = ".faq-block", refresh) => {
31
31
  setBlocks(blocks);
32
32
  });
33
33
  }
34
- }, [cmsMode, selector, refresh]);
34
+ }, [cmsMode, selector, refresh, path]);
35
35
  React.useEffect(() => {
36
36
  blocks.forEach((block) => init(block, blocks));
37
37
  return () => blocks.forEach(cleanup);
@@ -17,8 +17,9 @@ export default function OTLinks({ products, loading, sendPlausibleGoal, faqsMaxi
17
17
  return (_jsx("div", { className: css.loaderContainer, children: _jsx(Loader, { variant: "overlay" }) }, i));
18
18
  }), !loading &&
19
19
  products.map((product, i) => {
20
- const { htmlTitle, link } = product;
20
+ const { htmlTitle, link, htmlSnippet } = product;
21
21
  const productTitle = htmlTitle.replaceAll("b>", "mark>");
22
- return (_jsxs(Link, { className: css.link, href: link, target: "_blank", onClick: sendPlausibleGoal(link), onMouseDown: createRipple, children: [_jsx(Icons.Globe, { className: css.linkIcon }), _jsx("div", { className: css.linkContent, children: _jsxs("div", { className: css.linkTitleContainer, children: [_jsx("div", { className: css.linkTitle, dangerouslySetInnerHTML: { __html: productTitle } }), _jsx(Icons.ExternalLink, { className: css.linkIcon })] }) })] }, i));
22
+ const productText = htmlSnippet.replaceAll("b>", "mark>");
23
+ return (_jsxs(Link, { className: css.link, href: link, target: "_blank", onClick: sendPlausibleGoal(link), onMouseDown: createRipple, children: [_jsx(Icons.Globe, { className: css.linkIcon }), _jsxs("div", { className: css.linkContent, children: [_jsxs("div", { className: css.linkTitleContainer, children: [_jsx("div", { className: css.linkTitle, dangerouslySetInnerHTML: { __html: productTitle } }), _jsx(Icons.ExternalLink, { className: css.linkIcon })] }), productText && (_jsx("div", { className: css.linkText, dangerouslySetInnerHTML: { __html: productText } }))] })] }, i));
23
24
  })] })] }));
24
25
  }
@@ -64,7 +64,7 @@
64
64
  .linkTitleContainer {
65
65
  display: flex;
66
66
  flex-direction: row;
67
- align-items: flex-start;
67
+ align-items: center;
68
68
  justify-content: space-between;
69
69
  gap: 4px;
70
70
  }
@@ -64,7 +64,7 @@
64
64
  .linkTitleContainer {
65
65
  display: flex;
66
66
  flex-direction: row;
67
- align-items: flex-start;
67
+ align-items: center;
68
68
  justify-content: space-between;
69
69
  gap: 4px;
70
70
  }
@@ -32,7 +32,7 @@ export default function Results({ lang, text, facet, setFacet, results, loading,
32
32
  });
33
33
  React.useEffect(() => {
34
34
  const runEffect = () => {
35
- if (sortedHits.product.length < 4) {
35
+ if (flattenedHits.length < 10) {
36
36
  setGoogleText(text);
37
37
  }
38
38
  else {
@@ -40,7 +40,7 @@ export default function Results({ lang, text, facet, setFacet, results, loading,
40
40
  }
41
41
  };
42
42
  runEffect();
43
- }, [text, sortedHits, setGoogleText]);
43
+ }, [text, flattenedHits, setGoogleText]);
44
44
  const { page: pages, product: products, information, faq: faqs, widget: widgets, document: documents, "msem-widget": msemWidgets, lodging: lodgings, } = sortedHits;
45
45
  const isOtherResultsEmpty = !(pages.length || information.length);
46
46
  const countLabel = message(lang, "results");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ublo-lib",
3
- "version": "1.36.28",
3
+ "version": "1.36.29",
4
4
  "peerDependencies": {
5
5
  "dt-design-system": "^3.9.9",
6
6
  "leaflet": "^1.9.1",