From 3967007595fb7641f740ce71436369e4ba9dc15f Mon Sep 17 00:00:00 2001 From: yujonglee Date: Fri, 26 Jul 2024 21:06:53 +0900 Subject: [PATCH] update to latest --- docs/my-website/docusaurus.config.js | 8 +++ docs/my-website/package.json | 4 +- .../my-website/src/theme/SearchBar/Canary.jsx | 59 ------------------- docs/my-website/src/theme/SearchBar/index.jsx | 29 --------- docs/my-website/yarn.lock | 22 +++---- 5 files changed, 18 insertions(+), 104 deletions(-) delete mode 100644 docs/my-website/src/theme/SearchBar/Canary.jsx delete mode 100644 docs/my-website/src/theme/SearchBar/index.jsx diff --git a/docs/my-website/docusaurus.config.js b/docs/my-website/docusaurus.config.js index 4fb1c51c2..7974f613c 100644 --- a/docs/my-website/docusaurus.config.js +++ b/docs/my-website/docusaurus.config.js @@ -35,6 +35,14 @@ const config = { "--canary-color-primary-c": 0.1, "--canary-color-primary-h": 270, }, + pagefind: { + ranking: { + pageLength: 0.9, + termFrequency: 1.0, + termSimilarity: 1.0, + termSaturation: 1.5, + } + } }, ], [ diff --git a/docs/my-website/package.json b/docs/my-website/package.json index 734da6b79..7628a862f 100644 --- a/docs/my-website/package.json +++ b/docs/my-website/package.json @@ -18,8 +18,8 @@ "@docusaurus/plugin-google-gtag": "^2.4.1", "@docusaurus/plugin-ideal-image": "^2.4.1", "@docusaurus/preset-classic": "2.4.1", - "@getcanary/docusaurus-pagefind": "^0.0.7", - "@getcanary/web": "^0.0.47", + "@getcanary/docusaurus-pagefind": "^0.0.11", + "@getcanary/web": "^0.0.53", "@mdx-js/react": "^1.6.22", "clsx": "^1.2.1", "docusaurus": "^1.14.7", diff --git a/docs/my-website/src/theme/SearchBar/Canary.jsx b/docs/my-website/src/theme/SearchBar/Canary.jsx deleted file mode 100644 index 10bd1f7b7..000000000 --- a/docs/my-website/src/theme/SearchBar/Canary.jsx +++ /dev/null @@ -1,59 +0,0 @@ -import React from "react"; - -export default function Canary({ path }) { - const [loaded, setLoaded] = React.useState(false); - - React.useEffect(() => { - Promise.all([ - import("@getcanary/web/components/canary-root"), - import("@getcanary/web/components/canary-provider-pagefind"), - import("@getcanary/web/components/canary-modal"), - import("@getcanary/web/components/canary-trigger-searchbar"), - import("@getcanary/web/components/canary-content"), - import("@getcanary/web/components/canary-search"), - import("@getcanary/web/components/canary-search-input"), - import("@getcanary/web/components/canary-search-results-group"), - import("@getcanary/web/components/canary-callout-calendly"), - import("@getcanary/web/components/canary-callout-discord"), - ]) - .then(() => setLoaded(true)) - .catch((e) => - console.error("Maybe you forgot to install '@getcanary/web'?", e), - ); - }, []); - - if (!loaded) { - return null; - } - - return ( - - - - - - - - - - - - - - - - ); -} diff --git a/docs/my-website/src/theme/SearchBar/index.jsx b/docs/my-website/src/theme/SearchBar/index.jsx deleted file mode 100644 index da018f108..000000000 --- a/docs/my-website/src/theme/SearchBar/index.jsx +++ /dev/null @@ -1,29 +0,0 @@ -import React from "react"; - -import useDocusaurusContext from "@docusaurus/useDocusaurusContext"; -import { usePluginData } from "@docusaurus/useGlobalData"; - -import Canary from "./Canary"; - -export default function Index() { - const { siteConfig } = useDocusaurusContext(); - const { options } = usePluginData("docusaurus-plugin-pagefind-canary"); - - const [path, setPath] = React.useState(""); - - React.useEffect(() => { - setPath(`${siteConfig.baseUrl}pagefind/pagefind.js`); - }, [siteConfig]); - - React.useEffect(() => { - for (const [k, v] of Object.entries(options?.styles ?? {})) { - document.body.style.setProperty(k, v); - } - }, [options]); - - if (!path) { - return null; - } - - return ; -} diff --git a/docs/my-website/yarn.lock b/docs/my-website/yarn.lock index 15f2825fd..c00d4c511 100644 --- a/docs/my-website/yarn.lock +++ b/docs/my-website/yarn.lock @@ -1961,19 +1961,19 @@ resolved "https://registry.yarnpkg.com/@floating-ui/utils/-/utils-0.2.5.tgz#105c37d9d9620ce69b7f692a20c821bf1ad2cbf9" integrity sha512-sTcG+QZ6fdEUObICavU+aB3Mp8HY4n14wYHdxK4fXjPmv3PXZZeY5RaguJmGyeH/CJQhX3fqKUtS4qc1LoHwhQ== -"@getcanary/docusaurus-pagefind@^0.0.7": - version "0.0.7" - resolved "https://registry.yarnpkg.com/@getcanary/docusaurus-pagefind/-/docusaurus-pagefind-0.0.7.tgz#8a086891a456f5e333d43216bd5cf991718de106" - integrity sha512-1VDAF3/xfigsR6Tj6sQKt/OcCzETIIhhVSbhicBlxbhYY98j8jk3EyE9uxWgGg+lYz+Q+/Xmq+7tvsqBlKreeg== +"@getcanary/docusaurus-pagefind@^0.0.11": + version "0.0.11" + resolved "https://registry.yarnpkg.com/@getcanary/docusaurus-pagefind/-/docusaurus-pagefind-0.0.11.tgz#c4938b4f3d0f99c4d46d9b11a8800934f2bd7009" + integrity sha512-CN6nI8I5mdvE4Lt0+T95HNQdH8x6P4b2/T2YWbtjP0EB4TZl78lpuWXB3RZwiY7cY+C+aRL4Jo52SAqrBW2eqQ== dependencies: cli-progress "^3.12.0" micromatch "^4.0.7" pagefind "^1.1.0" -"@getcanary/web@^0.0.47": - version "0.0.47" - resolved "https://registry.yarnpkg.com/@getcanary/web/-/web-0.0.47.tgz#b2e8f843b65094208da2c92b8cf14ac91b0e1d95" - integrity sha512-ITNbhXZAcOffvDVCJWkCkQvXxSprA1OTOHn7AJa/efq09nQZIrI/YaluGhVf51g2jkUV0ixBmMnshWy0g5VG6w== +"@getcanary/web@^0.0.53": + version "0.0.53" + resolved "https://registry.yarnpkg.com/@getcanary/web/-/web-0.0.53.tgz#f842b054465bca484e5f0df184e12248106a1234" + integrity sha512-/vlzQJlF5J6smAFnND+pu91IN26w3sbLh8IA0YaKC/MQJr8ubh74vEgLS5WrwwjBUCEXYweQdPIOz2cbA/64Zw== dependencies: "@floating-ui/dom" "^1.6.8" "@lit-labs/observers" "^2.0.2" @@ -1982,7 +1982,6 @@ highlight.js "^11.10.0" lit "^3.1.4" marked "^13.0.2" - p-debounce "^4.0.0" "@hapi/hoek@^9.0.0": version "9.3.0" @@ -8949,11 +8948,6 @@ p-cancelable@^1.0.0: resolved "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz" integrity sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw== -p-debounce@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/p-debounce/-/p-debounce-4.0.0.tgz#348e3f44489baa9435cc7d807f17b3bb2fb16b24" - integrity sha512-4Ispi9I9qYGO4lueiLDhe4q4iK5ERK8reLsuzH6BPaXn53EGaua8H66PXIFGrW897hwjXp+pVLrm/DLxN0RF0A== - p-event@^1.0.0: version "1.3.0" resolved "https://registry.npmjs.org/p-event/-/p-event-1.3.0.tgz"