Skip to content

Commit 8cbb15b

Browse files
committed
Merge remote-tracking branch 'origin/feat/llms-all' into feat/llms-all
2 parents 7c5c6f5 + 84eab6e commit 8cbb15b

File tree

25 files changed

+842
-560
lines changed

25 files changed

+842
-560
lines changed

apify-docs-theme/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@apify/docs-theme",
3-
"version": "1.0.189",
3+
"version": "1.0.190",
44
"description": "",
55
"main": "./src/index.js",
66
"files": [
@@ -29,6 +29,7 @@
2929
"docusaurus-gtm-plugin": "^0.0.2",
3030
"postcss-preset-env": "^10.1.3",
3131
"prism-react-renderer": "^2.4.1",
32+
"react-hotkeys-hook": "^5.1.0",
3233
"remark-parse": "^11.0.0",
3334
"remark-stringify": "^11.0.0",
3435
"unified": "^11.0.5",

apify-docs-theme/src/theme/SearchBar/index.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import RouterLink from '@docusaurus/Link';
44
// import { useHistory, useLocation } from '@docusaurus/router';
55
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
66
import clsx from 'clsx';
7-
// import React, { useCallback } from 'react';
87
import React, { useEffect, useState } from 'react';
8+
import { useHotkeys } from 'react-hotkeys-hook';
99

1010
// import { ApifySearch } from '@apify/docs-search-modal';
1111
import { ControlKeyIcon, SearchIcon } from '@apify/docs-search-modal/dist/utils/icons';
@@ -82,6 +82,7 @@ export function Link(props) {
8282

8383
export default function SearchBar({ onClick }) {
8484
const [variant, setVariant] = useState(null);
85+
const [opened, setOpened] = useState(false);
8586
const { siteConfig } = useDocusaurusContext();
8687
const { inkeepApiKey } = siteConfig.customFields;
8788

@@ -98,9 +99,18 @@ export default function SearchBar({ onClick }) {
9899
}, []);
99100

100101
onClick = () => {
102+
if (opened) {
103+
return;
104+
}
105+
106+
setOpened(true);
107+
101108
if (variant === 'kapa') {
102109
if (window.Kapa && typeof window.Kapa.open === 'function') {
103110
window.Kapa.open();
111+
window.Kapa('onModalClose', () => {
112+
setOpened(false);
113+
});
104114
} else {
105115
console.error('Kapa.ai widget is not available.');
106116
}
@@ -178,11 +188,13 @@ export default function SearchBar({ onClick }) {
178188
},
179189
],
180190
},
191+
defaultView: 'chat',
181192
};
182193
const modal = window.Inkeep.ModalSearchAndChat(config);
183194

184195
function handleOpenChange(newOpen) {
185196
modal.update({ modalSettings: { isOpen: newOpen } });
197+
setOpened(newOpen);
186198
}
187199

188200
modal.update({ modalSettings: { isOpen: true } });
@@ -200,6 +212,10 @@ export default function SearchBar({ onClick }) {
200212
}
201213
}, []);
202214

215+
useHotkeys('mod+k, /', () => {
216+
onClick();
217+
}, { preventDefault: true });
218+
203219
return (
204220
<BrowserOnly>
205221
{() => (

eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export default [
2020
'@typescript-eslint/no-explicit-any': 'off',
2121
'no-param-reassign': 'off',
2222
'no-void': 'off',
23+
indent: 'off',
2324
'no-console': 'off',
2425
'import/no-extraneous-dependencies': 'off',
2526
'import/extensions': 'off',

package-lock.json

Lines changed: 43 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"@types/react": "^18.2.8",
5151
"babel-plugin-styled-components": "^2.1.4",
5252
"cross-env": "^7.0.3",
53-
"eslint": "^9.24.0",
53+
"eslint": "^9.32.0",
5454
"eslint-plugin-json": "^4.0.1",
5555
"eslint-plugin-markdown": "^5.1.0",
5656
"eslint-plugin-react": "^7.37.5",
@@ -63,8 +63,8 @@
6363
"patch-package": "^8.0.0",
6464
"path-browserify": "^1.0.1",
6565
"rimraf": "^6.0.0",
66-
"typescript": "5.8.3",
67-
"typescript-eslint": "^8.29.1"
66+
"typescript": "5.9.2",
67+
"typescript-eslint": "^8.38.0"
6868
},
6969
"dependencies": {
7070
"@apify/ui-library": "^1.0.0",

0 commit comments

Comments
 (0)