diff --git a/docusaurus.config.js b/docusaurus.config.js index d7dfceb..c54dc06 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -48,6 +48,16 @@ const config = { plugins: [ 'docusaurus-plugin-sass', + // https://github.com/praveenn77/docusaurus-lunr-search + [ + '@easyops-cn/docusaurus-search-local', + /** @type {import("@easyops-cn/docusaurus-search-local").PluginOptions} */ + { + hashed: true, + searchBarPosition: 'left', + }, + ], + // Node reference docs [ '@docusaurus/plugin-content-docs', diff --git a/package-lock.json b/package-lock.json index d7bdde5..45eea98 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "@docusaurus/core": "^3.1.0", "@docusaurus/preset-classic": "^3.1.0", + "@easyops-cn/docusaurus-search-local": "^0.40.1", "@mdx-js/react": "^3.0.0", "clsx": "^2.1.0", "docusaurus-plugin-sass": "^0.2.5", @@ -2779,6 +2780,72 @@ "node": ">=14.14" } }, + "node_modules/@easyops-cn/autocomplete.js": { + "version": "0.38.1", + "resolved": "https://registry.npmjs.org/@easyops-cn/autocomplete.js/-/autocomplete.js-0.38.1.tgz", + "integrity": "sha512-drg76jS6syilOUmVNkyo1c7ZEBPcPuK+aJA7AksM5ZIIbV57DMHCywiCr+uHyv8BE5jUTU98j/H7gVrkHrWW3Q==", + "dependencies": { + "cssesc": "^3.0.0", + "immediate": "^3.2.3" + } + }, + "node_modules/@easyops-cn/docusaurus-search-local": { + "version": "0.40.1", + "resolved": "https://registry.npmjs.org/@easyops-cn/docusaurus-search-local/-/docusaurus-search-local-0.40.1.tgz", + "integrity": "sha512-4HMFZMpKKdd5qq1nFB8cvrAkgzZ1kNxphVciI64YHtmDYGIthVGZVG6+Ci7AAhzCR+ixLJkYwtVekvuMLjr2ZQ==", + "dependencies": { + "@docusaurus/plugin-content-docs": "^2 || ^3", + "@docusaurus/theme-translations": "^2 || ^3", + "@docusaurus/utils": "^2 || ^3", + "@docusaurus/utils-common": "^2 || ^3", + "@docusaurus/utils-validation": "^2 || ^3", + "@easyops-cn/autocomplete.js": "^0.38.1", + "@node-rs/jieba": "^1.6.0", + "cheerio": "^1.0.0-rc.3", + "clsx": "^1.1.1", + "debug": "^4.2.0", + "fs-extra": "^10.0.0", + "klaw-sync": "^6.0.0", + "lunr": "^2.3.9", + "lunr-languages": "^1.4.0", + "mark.js": "^8.11.1", + "tslib": "^2.4.0" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "@docusaurus/theme-common": "^2 || ^3", + "react": "^16.14.0 || ^17 || ^18", + "react-dom": "^16.14.0 || 17 || ^18" + } + }, + "node_modules/@easyops-cn/docusaurus-search-local/node_modules/clsx": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz", + "integrity": "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==", + "engines": { + "node": ">=6" + } + }, + "node_modules/@emnapi/core": { + "version": "0.45.0", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-0.45.0.tgz", + "integrity": "sha512-DPWjcUDQkCeEM4VnljEOEcXdAD7pp8zSZsgOujk/LGIwCXWbXJngin+MO4zbH429lzeC3WbYLGjE2MaUOwzpyw==", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/runtime": { + "version": "0.45.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-0.45.0.tgz", + "integrity": "sha512-Txumi3td7J4A/xTTwlssKieHKTGl3j4A1tglBx72auZ49YK7ePY6XZricgIg9mnZT4xPfA+UPCUdnhRuEFDL+w==", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@hapi/hoek": { "version": "9.3.0", "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz", @@ -2925,6 +2992,247 @@ "react": ">=16" } }, + "node_modules/@node-rs/jieba": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@node-rs/jieba/-/jieba-1.9.1.tgz", + "integrity": "sha512-s4OCTREbuKWc1wEIsrAOS37eP0aPMzYtng5rS8FpoJ3Pcxel8oz9nFMEb6WMubN/3iKQxCYuC8VmyQN7gJCP+Q==", + "engines": { + "node": ">= 10" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "optionalDependencies": { + "@node-rs/jieba-android-arm-eabi": "1.9.1", + "@node-rs/jieba-android-arm64": "1.9.1", + "@node-rs/jieba-darwin-arm64": "1.9.1", + "@node-rs/jieba-darwin-x64": "1.9.1", + "@node-rs/jieba-freebsd-x64": "1.9.1", + "@node-rs/jieba-linux-arm-gnueabihf": "1.9.1", + "@node-rs/jieba-linux-arm64-gnu": "1.9.1", + "@node-rs/jieba-linux-arm64-musl": "1.9.1", + "@node-rs/jieba-linux-x64-gnu": "1.9.1", + "@node-rs/jieba-linux-x64-musl": "1.9.1", + "@node-rs/jieba-wasm32-wasi": "1.9.1", + "@node-rs/jieba-win32-arm64-msvc": "1.9.1", + "@node-rs/jieba-win32-ia32-msvc": "1.9.1", + "@node-rs/jieba-win32-x64-msvc": "1.9.1" + } + }, + "node_modules/@node-rs/jieba-android-arm-eabi": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@node-rs/jieba-android-arm-eabi/-/jieba-android-arm-eabi-1.9.1.tgz", + "integrity": "sha512-lCfZaEZ2ovXkKJugxfuZYxWvWST/SXjSwSeSNET42wWAyQOrrDBz7JIGoshTBIOcZaa7eSoLKZakW+0RdMlOpQ==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@node-rs/jieba-android-arm64": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@node-rs/jieba-android-arm64/-/jieba-android-arm64-1.9.1.tgz", + "integrity": "sha512-HCu8bPeoBsRrV1rbt8n/zh4ljcIPpmPEP2BzCu9Dl23hpuxwYOYxJv8wJWF56kyjxY/gHVRKmK6jtvJYou0c8w==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@node-rs/jieba-darwin-arm64": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@node-rs/jieba-darwin-arm64/-/jieba-darwin-arm64-1.9.1.tgz", + "integrity": "sha512-mCjfVsi8lCvkgFIMvRRjv2zy4Yr6hKbRXUXKk5H6RxX5fRD4/hlvWq2EAsCazgsIZofA/7+DKdfZZeRNsI2yuQ==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@node-rs/jieba-darwin-x64": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@node-rs/jieba-darwin-x64/-/jieba-darwin-x64-1.9.1.tgz", + "integrity": "sha512-udEU2pxt37xmwNbtQ/EJLLI0Hhcakv0pNytP2bss6qnTyr2S+IUv3r6OzSC3t5MaGfDcULsOsBqH9LpDX4QCdg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@node-rs/jieba-freebsd-x64": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@node-rs/jieba-freebsd-x64/-/jieba-freebsd-x64-1.9.1.tgz", + "integrity": "sha512-feL7TTCYitorytsX8tKckdlhWrb1dzFLTF+oeUOHtBLU23f7CXoMJ1lQPICLovoKpOAwNEi4m1+1dDuxmX8rew==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@node-rs/jieba-linux-arm-gnueabihf": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@node-rs/jieba-linux-arm-gnueabihf/-/jieba-linux-arm-gnueabihf-1.9.1.tgz", + "integrity": "sha512-oa01n9Zlu2Cf4jQ6xWYY/bRKRwH0oSqnInTR5XBBPVeY0KAXAzHBwbvjcurTtI/P9cd/dd1ONztqw1QS5odCEQ==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@node-rs/jieba-linux-arm64-gnu": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@node-rs/jieba-linux-arm64-gnu/-/jieba-linux-arm64-gnu-1.9.1.tgz", + "integrity": "sha512-5R2PIWu51sAkeSNF7VbUAl9QxwKUHwnTRb5hlYk7WuqrBSSVj/y8fUdJrlAC+FxlXobv2dIhCfnOUdNgJJZcrA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@node-rs/jieba-linux-arm64-musl": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@node-rs/jieba-linux-arm64-musl/-/jieba-linux-arm64-musl-1.9.1.tgz", + "integrity": "sha512-8oCaifABQHPU58nQDJql5XxIS0mwOui+dZ6i3c5BaqgtZF33sq1jPf4nfzLi/IN8ISbcwi/EcUxPMryNOBfHAA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@node-rs/jieba-linux-x64-gnu": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@node-rs/jieba-linux-x64-gnu/-/jieba-linux-x64-gnu-1.9.1.tgz", + "integrity": "sha512-pUCs0tMrREZv1qmvF8lwcfXM7Jpzp5gBkUDt+C8c6bC5KF/1PtpSG4bvw/O2fixzmnTq3zFCMyvM2AREX6OVmg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@node-rs/jieba-linux-x64-musl": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@node-rs/jieba-linux-x64-musl/-/jieba-linux-x64-musl-1.9.1.tgz", + "integrity": "sha512-wIImcaWbkHwqATv1/e3lhl4jny9IO2QQC0xmJAO5syZwzDAlJGDbGUi1fh7+6CVEm0h0E6C1n9yfGSenpd3Iag==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@node-rs/jieba-wasm32-wasi": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@node-rs/jieba-wasm32-wasi/-/jieba-wasm32-wasi-1.9.1.tgz", + "integrity": "sha512-vxM1GqztFJC1icSDddwpoG2nFL2I5fk8G7s8oYT/WnBZrrZSCM2ao73MQvq/3qx19pbGe5fkfh04ioLRyRWSpg==", + "cpu": [ + "wasm32" + ], + "optional": true, + "dependencies": { + "@emnapi/core": "^0.45.0", + "@emnapi/runtime": "^0.45.0", + "@tybys/wasm-util": "^0.8.1", + "memfs-browser": "^4.6.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@node-rs/jieba-win32-arm64-msvc": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@node-rs/jieba-win32-arm64-msvc/-/jieba-win32-arm64-msvc-1.9.1.tgz", + "integrity": "sha512-gi/FU/wPYFZCSFKH0q99eD5UkQmsZqrhNVmKtr/1wN6a0NZ3eaHRDNQltC4Kz2QQCLEqbuZxDCQdfQYUyQZlUA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@node-rs/jieba-win32-ia32-msvc": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@node-rs/jieba-win32-ia32-msvc/-/jieba-win32-ia32-msvc-1.9.1.tgz", + "integrity": "sha512-PQFQbFrUoeQVpg8u18u3isaTTNj/FUur2hn6/Vc9qAHuVZEUivjY4epnMGMCXerOvJ+jagNsneMesgzVx5aFLQ==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@node-rs/jieba-win32-x64-msvc": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@node-rs/jieba-win32-x64-msvc/-/jieba-win32-x64-msvc-1.9.1.tgz", + "integrity": "sha512-O/7GJ9snJu6xMr3NK8g1pkBC7wTi9ASb1TB3xVazDSJP5AMKrOzjRVg02clITe970/GUhnil9xQTqfruHIJ71w==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "license": "MIT", @@ -3303,6 +3611,15 @@ "integrity": "sha512-12HWfYmgUl4M2o76/TFufGtI68wl2k/b8qPrIrG7ci9YJLrpAtadpy897Bz5v29Mlkr7a1Hq4KHdQTKtU+2rhQ==", "dev": true }, + "node_modules/@tybys/wasm-util": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.8.1.tgz", + "integrity": "sha512-GSsTwyBl4pIzsxAY5wroZdyQKyhXk0d8PCRZtrSZ2WEB1cBdrp2EgGBwHOGCZtIIPun/DL3+AykCv+J6fyRH4Q==", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@types/acorn": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/@types/acorn/-/acorn-4.0.6.tgz", @@ -5899,6 +6216,13 @@ "version": "3.1.3", "license": "MIT" }, + "node_modules/fast-diff": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", + "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", + "optional": true, + "peer": true + }, "node_modules/fast-glob": { "version": "3.3.1", "license": "MIT", @@ -6227,6 +6551,19 @@ "node": ">= 0.6" } }, + "node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/fs-monkey": { "version": "1.0.4", "license": "Unlicense" @@ -6958,6 +7295,15 @@ "node": ">=10.17.0" } }, + "node_modules/hyperdyperid": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/hyperdyperid/-/hyperdyperid-1.2.0.tgz", + "integrity": "sha512-Y93lCzHYgGWdrJ66yIktxiaGULYc6oGiABxhcO5AufBeOyoIdZF7bIfLaOrbM0iGIOXQQgxxRrFEnb+Y6w1n4A==", + "optional": true, + "engines": { + "node": ">=10.18" + } + }, "node_modules/iconv-lite": { "version": "0.4.24", "license": "MIT", @@ -6999,6 +7345,11 @@ "node": ">=16.x" } }, + "node_modules/immediate": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.3.0.tgz", + "integrity": "sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q==" + }, "node_modules/immer": { "version": "9.0.21", "license": "MIT", @@ -7453,6 +7804,37 @@ "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==" }, + "node_modules/json-joy": { + "version": "9.9.1", + "resolved": "https://registry.npmjs.org/json-joy/-/json-joy-9.9.1.tgz", + "integrity": "sha512-/d7th2nbQRBQ/nqTkBe6KjjvDciSwn9UICmndwk3Ed/Bk9AqkTRm4PnLVfXG4DKbT0rEY0nKnwE7NqZlqKE6kg==", + "optional": true, + "dependencies": { + "arg": "^5.0.2", + "hyperdyperid": "^1.2.0" + }, + "bin": { + "jj": "bin/jj.js", + "json-pack": "bin/json-pack.js", + "json-pack-test": "bin/json-pack-test.js", + "json-patch": "bin/json-patch.js", + "json-patch-test": "bin/json-patch-test.js", + "json-pointer": "bin/json-pointer.js", + "json-pointer-test": "bin/json-pointer-test.js", + "json-unpack": "bin/json-unpack.js" + }, + "engines": { + "node": ">=10.0" + }, + "funding": { + "url": "https://github.com/sponsors/streamich" + }, + "peerDependencies": { + "quill-delta": "^5", + "rxjs": "7", + "tslib": "2" + } + }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "license": "MIT" @@ -7496,6 +7878,14 @@ "node": ">=0.10.0" } }, + "node_modules/klaw-sync": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", + "integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==", + "dependencies": { + "graceful-fs": "^4.1.11" + } + }, "node_modules/kleur": { "version": "3.0.3", "license": "MIT", @@ -7591,6 +7981,13 @@ "version": "4.17.21", "license": "MIT" }, + "node_modules/lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==", + "optional": true, + "peer": true + }, "node_modules/lodash.debounce": { "version": "4.0.8", "license": "MIT" @@ -7607,6 +8004,13 @@ "version": "4.6.0", "license": "MIT" }, + "node_modules/lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==", + "optional": true, + "peer": true + }, "node_modules/lodash.memoize": { "version": "4.1.2", "license": "MIT" @@ -7667,6 +8071,21 @@ "yallist": "^3.0.2" } }, + "node_modules/lunr": { + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", + "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==" + }, + "node_modules/lunr-languages": { + "version": "1.14.0", + "resolved": "https://registry.npmjs.org/lunr-languages/-/lunr-languages-1.14.0.tgz", + "integrity": "sha512-hWUAb2KqM3L7J5bcrngszzISY4BxrXn/Xhbb9TTCJYEGqlR1nG67/M14sp09+PTIRklobrn57IAxcdcO/ZFyNA==" + }, + "node_modules/mark.js": { + "version": "8.11.1", + "resolved": "https://registry.npmjs.org/mark.js/-/mark.js-8.11.1.tgz", + "integrity": "sha512-1I+1qpDt4idfgLQG+BNWmrqku+7/2bi5nLf4YwF8y8zXvmfiTBY3PV3ZibfrjBueCByROpuBjLLFCajqkgYoLQ==" + }, "node_modules/markdown-extensions": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/markdown-extensions/-/markdown-extensions-2.0.0.tgz", @@ -8086,6 +8505,35 @@ "node": ">= 4.0.0" } }, + "node_modules/memfs-browser": { + "version": "4.6.10002", + "resolved": "https://registry.npmjs.org/memfs-browser/-/memfs-browser-4.6.10002.tgz", + "integrity": "sha512-j0ezX5freL+s8r1qLV3wuAfZ3A/ArILvRJyqXCoKLEEf6ulFOHTpfz/0HSqYj2CS5ChlKfn5Ml36iM/EaueAjQ==", + "optional": true, + "dependencies": { + "memfs": "4.6.0" + } + }, + "node_modules/memfs-browser/node_modules/memfs": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/memfs/-/memfs-4.6.0.tgz", + "integrity": "sha512-I6mhA1//KEZfKRQT9LujyW6lRbX7RkC24xKododIDO3AGShcaFAMKElv1yFGWX8fD4UaSiwasr3NeQ5TdtHY1A==", + "optional": true, + "dependencies": { + "json-joy": "^9.2.0", + "thingies": "^1.11.1" + }, + "engines": { + "node": ">= 4.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/streamich" + }, + "peerDependencies": { + "tslib": "2" + } + }, "node_modules/memoize-one": { "version": "5.2.1", "license": "MIT" @@ -11163,6 +11611,21 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/quill-delta": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/quill-delta/-/quill-delta-5.1.0.tgz", + "integrity": "sha512-X74oCeRI4/p0ucjb5Ma8adTXd9Scumz367kkMK5V/IatcX6A0vlgLgKbzXWy5nZmCGeNJm2oQX0d2Eqj+ZIlCA==", + "optional": true, + "peer": true, + "dependencies": { + "fast-diff": "^1.3.0", + "lodash.clonedeep": "^4.5.0", + "lodash.isequal": "^4.5.0" + }, + "engines": { + "node": ">= 12.0.0" + } + }, "node_modules/randombytes": { "version": "2.1.0", "license": "MIT", @@ -11962,6 +12425,16 @@ "queue-microtask": "^1.2.2" } }, + "node_modules/rxjs": { + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", + "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", + "optional": true, + "peer": true, + "dependencies": { + "tslib": "^2.1.0" + } + }, "node_modules/safe-buffer": { "version": "5.2.1", "funding": [ @@ -12907,6 +13380,18 @@ "version": "0.2.0", "license": "MIT" }, + "node_modules/thingies": { + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/thingies/-/thingies-1.16.0.tgz", + "integrity": "sha512-J23AVs11hSQxuJxvfQyMIaS9z1QpDxOCvMkL3ZxZl8/jmkgmnNGWrlyNxVz6Jbh0U6DuGmHqq6f7zUROfg/ncg==", + "optional": true, + "engines": { + "node": ">=10.18" + }, + "peerDependencies": { + "tslib": "^2" + } + }, "node_modules/thunky": { "version": "1.1.0", "license": "MIT" diff --git a/package.json b/package.json index 5e72763..313b700 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "@mdx-js/react": "^3.0.0", "clsx": "^2.1.0", "docusaurus-plugin-sass": "^0.2.5", + "@easyops-cn/docusaurus-search-local": "^0.40.1", "prism-react-renderer": "^2.3.1", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/src/css/navbar.scss b/src/css/navbar.scss index 34b45f7..d8dc372 100644 --- a/src/css/navbar.scss +++ b/src/css/navbar.scss @@ -35,6 +35,19 @@ &__items { align-items: stretch; + + &:last-child > *:last-child { + // Hack to center search input + display: flex; + + @media (max-width: 996px) { + & { + position: relative; + right: 0; + padding-right: var(--ifm-navbar-padding-horizontal) + } + } + } } &__item { @@ -42,6 +55,7 @@ calc(var(--ifm-navbar-padding-vertical) + 5px); font-size: 16px; font-weight: var(--doc-font-semibold); + order: 1; &:not(.is-download-button) { -webkit-font-smoothing: antialiased; @@ -77,6 +91,12 @@ &:hover { background-color: var(--doc-color-noodl-orange-140); } + + @media (max-width: 996px) { + & { + display: none; + } + } } &.is-discord { @@ -100,6 +120,14 @@ width: 36px; background-image: url('../../static/img/discord.svg'); } + + @media (max-width: 996px) { + & { + padding: 0; + } + } } } } + + diff --git a/src/css/searchbar.scss b/src/css/searchbar.scss index e5ee4e5..de5fc15 100644 --- a/src/css/searchbar.scss +++ b/src/css/searchbar.scss @@ -20,34 +20,55 @@ ); } -.DocSearch { - padding: 0 !important; +.search-bar-outer { + margin-bottom: 80px; - main & { - margin-bottom: 80px; + .navbar__search { + margin-left: 0; + + & > :last-child { + // give keyboard shortcut some extra spacing + padding-right: 20px; + } } - .navbar & { - display: none; + span { + width: 100%; } -} -.navbar__items--right :last-child { - display: none !important; -} + & .navbar__search-input { + height: auto !important; + border-radius: 2px !important; + border: 1px solid var(--doc-color-noodl-black-light) !important; + width: 100% !important; + background-color: var(--doc-color-noodl-black-darker) !important; + font-size: 20px; + padding: 20px 100px 20px 40px !important; -.DocSearch-Button { - height: auto !important; - border-radius: 2px !important; - border: 1px solid var(--doc-color-noodl-black-light) !important; - width: 100% !important; - padding: 20px 24px !important; + @media (max-width: 576px) { + & { + padding: 20px 40px !important; + } + } + } } -.search-bar-outer > :first-child { - padding: 0; -} +.navbar { + &__search { + align-self: center; + + input { + background-color: var(--doc-color-logic-node); + color: var(--doc-color-noodl-white-85) + } -.DocSearch-Hit[aria-selected='true'] a { - background-color: var(--doc-color-noodl-blue-80) !important; + > div > span > span { + // the results box + right: auto !important; + } + + @media (min-width: 996px) { + margin-top: -4px; + } + } } diff --git a/src/theme/DocSidebar/Desktop/Content/index.js b/src/theme/DocSidebar/Desktop/Content/index.js deleted file mode 100644 index d37771e..0000000 --- a/src/theme/DocSidebar/Desktop/Content/index.js +++ /dev/null @@ -1,15 +0,0 @@ -import React from 'react' -import Content from '@theme-original/DocSidebar/Desktop/Content' -import SearchBar from '@theme-original/SearchBar' - -export default function ContentWrapper(props) { - return ( - <> -
- -
- - - - ) -}