@seekora-ai/ui-sdk-react 0.2.16 → 0.2.17
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/docsearch/components/Footer.d.ts.map +1 -1
- package/dist/docsearch/components/Footer.js +11 -1
- package/dist/docsearch/hooks/useDocSearch.d.ts.map +1 -1
- package/dist/docsearch/hooks/useDocSearch.js +25 -12
- package/dist/index.umd.js +1 -1
- package/dist/src/index.esm.js +36 -13
- package/dist/src/index.esm.js.map +1 -1
- package/dist/src/index.js +36 -13
- package/dist/src/index.js.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Footer.d.ts","sourceRoot":"","sources":["../../../src/docsearch/components/Footer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEtD,UAAU,WAAW;IACnB,YAAY,CAAC,EAAE,qBAAqB,CAAC;CACtC;
|
|
1
|
+
{"version":3,"file":"Footer.d.ts","sourceRoot":"","sources":["../../../src/docsearch/components/Footer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEtD,UAAU,WAAW;IACnB,YAAY,CAAC,EAAE,qBAAqB,CAAC;CACtC;AAeD,wBAAgB,MAAM,CAAC,EAAE,YAAiB,EAAE,EAAE,WAAW,qBAmCxD"}
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
function SeekoraLogo() {
|
|
3
|
+
return (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 563 636", width: "20", height: "22", "aria-hidden": "true" },
|
|
4
|
+
React.createElement("path", { fill: "#03d1ff", d: "M243.44,231.23l-99.23,98.52-9.41,9.41c-14.83,14.83-38.57,13.17-51.4-1.5-2.39-2.73-4.39-5.89-5.89-9.49-.05-.16-.13-.32-.18-.47-1.55-3.68-2.95-7.41-4.29-11.2-7.39-21.24-11.33-44.04-11.25-67.81h.24c-.05-.6-.05-1.24-.08-1.87-.08-2.13-.11-4.29-.11-6.44,0-126.81,102.78-229.59,229.6-229.59,30.84,0,60.29,6.07,87.16,17.14-10.18,10.36-15.22,25.4-12.23,40.7,1.42,7.05,4.39,13.41,8.55,18.75,1.26,1.68,2.68,3.26,4.18,4.73-.58-.34-1.16-.68-1.76-1-25.29-14.62-54.64-22.95-85.9-22.95-95.13,0-172.22,77.12-172.22,172.22,0,1.95.03,3.87.11,5.78v.05c.39,11.94,2,23.59,4.73,34.79l.82-.82,23.14-23.16,47.14-47.14,20.09-20.06c11.31-11.31,27.69-15.57,42.99-11.2.05.03.13.03.18.05.24.05.45.11.68.18,9.47,2.87,17.46,8.73,22.95,16.49,3.6,5.02,6.15,10.83,7.39,17.06l5.94,30.21,1.5,7.57.11.63,1.97-2.05,69.62-72.57,15.28-15.93,33.68-35.15,5.47-5.68,11.31-11.78,23.32-24.32,4.23-4.39,7.94-8.28-6.07,1.18-12.46,2.45-2.18.42-16.36,3.23-.03.03-18.64,3.68c-11.86,2.34-23.4-5.39-25.77-17.25-2.08-10.52,3.73-20.75,13.33-24.64,1.26-.5,2.58-.89,3.97-1.16l45.54-8.99,34.44-6.81,14.99-2.92,23.06-4.58c.58-.11,1.16-.21,1.71-.26.5-.05,1-.11,1.5-.13,1-.05,2-.03,3,.05,4.47.39,8.78,2.18,12.3,5.18,3.76,3.21,6.28,7.52,7.26,12.25.13.68.24,1.37.31,2.05.11,1.05.13,2.1.11,3.16l-1.05,28.08-.66,18.64-.24,6.68-2.26,62.63-.03,1.1c-.39,11.83-10.12,21.14-21.9,21.14-.26,0-.53-.03-.79-.03-5.13-.18-9.75-2.1-13.36-5.15-4.97-4.18-8.05-10.54-7.76-17.54l.11-2.76.42-11.86.58-16.33.58-16.3-235.99,252.7-24.03-127.37Z" }),
|
|
5
|
+
React.createElement("path", { fill: "#4d66fe", d: "M11.11,572.49c-1.27-6.46.68-13.13,5.22-17.89l105.47-110.63,15.28-15.93,33.68-35.15,5.47-5.68,34.63-36.1,8.23-8.57,11.91,57.94.63,1.42h0c10.78,4,22.09,6.94,33.76,8.73v57.87c-27.58-3.1-53.69-11.12-77.43-23.14L21.34,623.95l-10.23-51.46Z" }),
|
|
6
|
+
React.createElement("path", { fill: "#4d66fe", d: "M325.32,330.56v136.38c-10.31,1.44-20.85,2.17-31.56,2.17-1.56,0-3.13,0-4.69-.08v-101.86l36.25-36.61Z" }),
|
|
7
|
+
React.createElement("polygon", { fill: "#4d66fe", points: "381.47 451.71 381.47 385.94 381.55 270.05 345.17 308.07 345.17 463.34 381.47 451.71" }),
|
|
8
|
+
React.createElement("polygon", { fill: "#4d66fe", points: "437.61 418.26 437.65 321.78 437.69 213.67 401.32 251.68 401.32 442.32 437.61 418.26" }),
|
|
9
|
+
React.createElement("path", { fill: "#4d66fe", d: "M493.87,157.13l-.08,108.11v86.38c-9.91,17.8-22.14,34.13-36.29,48.56v-205l36.37-38.05Z" })));
|
|
10
|
+
}
|
|
2
11
|
export function Footer({ translations = {} }) {
|
|
3
12
|
return (React.createElement("footer", { className: "seekora-docsearch-footer" },
|
|
4
13
|
React.createElement("div", { className: "seekora-docsearch-footer-commands" },
|
|
@@ -19,5 +28,6 @@ export function Footer({ translations = {} }) {
|
|
|
19
28
|
React.createElement("div", { className: "seekora-docsearch-footer-logo" },
|
|
20
29
|
React.createElement("span", { className: "seekora-docsearch-footer-logo-text" }, translations.searchByText || 'Search by'),
|
|
21
30
|
React.createElement("a", { href: "https://seekora.ai", target: "_blank", rel: "noopener noreferrer", className: "seekora-docsearch-footer-logo-link" },
|
|
22
|
-
React.createElement(
|
|
31
|
+
React.createElement(SeekoraLogo, null),
|
|
32
|
+
React.createElement("span", { className: "seekora-docsearch-logo", style: { fontWeight: 600 } }, "Seekora")))));
|
|
23
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDocSearch.d.ts","sourceRoot":"","sources":["../../../src/docsearch/hooks/useDocSearch.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAGV,YAAY,EACZ,mBAAmB,EACnB,YAAY,EACb,MAAM,UAAU,CAAC;AA0DlB,UAAU,mBAAmB;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qBAAqB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,mBAAmB,EAAE,KAAK,mBAAmB,EAAE,CAAC;CACnG;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB;;
|
|
1
|
+
{"version":3,"file":"useDocSearch.d.ts","sourceRoot":"","sources":["../../../src/docsearch/hooks/useDocSearch.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAGV,YAAY,EACZ,mBAAmB,EACnB,YAAY,EACb,MAAM,UAAU,CAAC;AA0DlB,UAAU,mBAAmB;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qBAAqB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,mBAAmB,EAAE,KAAK,mBAAmB,EAAE,CAAC;CACnG;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB;;sBAoJ7C,MAAM;gBAHe,MAAM;8BAlCrB,MAAM;;;8BA+CuB,MAAM;;2BASX,YAAY,GAAG,mBAAmB,GAAG,IAAI;wBAvO7D;QAAE,MAAM,EAAE,YAAY,CAAC;QAAC,KAAK,EAAE,mBAAmB,EAAE,CAAA;KAAE,EAAE;;;;;;;;EAgQ7E"}
|
|
@@ -58,18 +58,31 @@ export function useDocSearch(options) {
|
|
|
58
58
|
const abortControllersRef = useRef(new Map());
|
|
59
59
|
const debounceTimerRef = useRef(null);
|
|
60
60
|
const defaultTransform = (data, sourceId) => {
|
|
61
|
-
const items = data.data?.suggestions || data.data?.results || data.suggestions || data.results || data.hits || [];
|
|
62
|
-
return items.map((item) =>
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
61
|
+
const items = data.data?.suggestions || data.data?.results || data.data?.hits || data.suggestions || data.results || data.hits || [];
|
|
62
|
+
return items.map((item) => {
|
|
63
|
+
const doc = item.document || item;
|
|
64
|
+
// Build hierarchy from nested object or flat dot-notation keys
|
|
65
|
+
const hierarchy = doc.hierarchy || {
|
|
66
|
+
lvl0: doc['hierarchy.lvl0'],
|
|
67
|
+
lvl1: doc['hierarchy.lvl1'],
|
|
68
|
+
lvl2: doc['hierarchy.lvl2'],
|
|
69
|
+
lvl3: doc['hierarchy.lvl3'],
|
|
70
|
+
lvl4: doc['hierarchy.lvl4'],
|
|
71
|
+
lvl5: doc['hierarchy.lvl5'],
|
|
72
|
+
};
|
|
73
|
+
return {
|
|
74
|
+
url: doc.url || doc.route || item.url || '',
|
|
75
|
+
title: (doc.title || '').replace?.(/<\/?mark>/g, '') || '',
|
|
76
|
+
content: (doc.content || doc.description || '').replace?.(/<\/?mark>/g, '')?.substring?.(0, 100) || '',
|
|
77
|
+
description: doc.description || doc.content?.substring?.(0, 100) || '',
|
|
78
|
+
category: doc.category || hierarchy?.lvl0 || '',
|
|
79
|
+
hierarchy,
|
|
80
|
+
route: doc.route,
|
|
81
|
+
parentTitle: doc.parent_title || doc.parentTitle,
|
|
82
|
+
anchor: doc.anchor || item.anchor,
|
|
83
|
+
_source: sourceId,
|
|
84
|
+
};
|
|
85
|
+
});
|
|
73
86
|
};
|
|
74
87
|
const transformPublicSearchResults = useCallback((data, sourceId) => {
|
|
75
88
|
const results = data?.data?.results || [];
|