update to latest

This commit is contained in:
yujonglee 2024-07-26 21:06:53 +09:00
parent b6bcb7eb3c
commit 3967007595
5 changed files with 18 additions and 104 deletions

View file

@ -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,
}
}
},
],
[

View file

@ -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",

View file

@ -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 (
<canary-root framework="docusaurus">
<canary-provider-pagefind path={path}>
<canary-modal>
<canary-trigger-searchbar slot="trigger"></canary-trigger-searchbar>
<canary-content slot="content">
<canary-search slot="search">
<canary-search-input slot="input"></canary-search-input>
<canary-search-results-group
slot="results"
groups="SDK:*;Proxy:/docs/(simple_proxy|proxy/.*)"
></canary-search-results-group>
<canary-callout-discord
slot="callout"
message="👋 Looking for help?"
url="https://discord.com/invite/wuPM9dRgDw"
keywords="discord,help,support,community"
></canary-callout-discord>
<canary-callout-calendly
slot="callout"
message="🚅 Interested in enterprise features?"
keywords="sso,enterprise,security,audit"
url="https://calendly.com/d/4mp-gd3-k5k/litellm-1-1-onboarding-chat"
></canary-callout-calendly>
</canary-search>
</canary-content>
</canary-modal>
</canary-provider-pagefind>
</canary-root>
);
}

View file

@ -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 <Canary path={path} />;
}

View file

@ -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"