diff --git a/config/ssrTemplate.js b/config/ssrTemplate.js index 37923ae8cc43f..afaf56352808e 100644 --- a/config/ssrTemplate.js +++ b/config/ssrTemplate.js @@ -13,10 +13,10 @@ module.exports = { <%~ metaAttribute %> <% }); %> <% it.stylesheets.forEach((stylesheet) => { %> - + <% }); %> <% it.scripts.forEach((script) => { %> - + <% }); %> > @@ -25,7 +25,7 @@ module.exports = { <%~ it.appHtml %> <% it.scripts.forEach((script) => { %> - + <% }); %> <%~ it.postBodyTags %> diff --git a/docusaurus.config.js b/docusaurus.config.js index 010d7b24170ae..92701cb023f17 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -77,7 +77,7 @@ const config = { sidebarPath: require.resolve('./sidebarsCommunity.json'), }), ], - process.env.NODE_ENV === 'development' ? null : customDocusaurusPlugin, + // process.env.NODE_ENV === 'development' ? null : customDocusaurusPlugin, [ '@docusaurus/plugin-pwa', { @@ -202,26 +202,37 @@ const config = { }), ], ], - themes: [ - [ - '@easyops-cn/docusaurus-search-local', - { - hashed: true, - language: ['en', 'zh'], - highlightSearchTermsOnTargetPage: true, - // indexPages: true, - indexDocs: true, - docsRouteBasePath: '/', - indexBlog: false, - explicitSearchResultPath: true, - searchBarShortcut: true, - searchBarShortcutHint: true, - }, - ], - ], + // themes: [ + // [ + // '@easyops-cn/docusaurus-search-local', + // { + // hashed: true, + // language: ['en', 'zh'], + // highlightSearchTermsOnTargetPage: true, + // // indexPages: true, + // indexDocs: true, + // docsRouteBasePath: '/', + // indexBlog: false, + // explicitSearchResultPath: true, + // searchBarShortcut: true, + // searchBarShortcutHint: true, + // }, + // ], + // ], themeConfig: /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ ({ + algolia: { + appId: 'UUKF60R98F', + apiKey: '1b34939eb7c1508a11571110b04cbc2e', + indexName: 'apache-doris', + contextualSearch: true, + searchParameters: { + facetFilters: ['docusaurus_tag', 'language', 'lang', 'version', 'type'], + }, + maxResultsPerGroup: 7, + debug: true, + }, matomo: { matomoUrl: 'https://analytics.apache.org/', siteId: '43', @@ -316,7 +327,8 @@ const config = { // to: '/docs/install/source-install/compilation-with-docker', type: 'doc', docId: 'install/source-install/compilation-with-docker', - activeBaseRegex: 'summary|install/cluster-deployment|install/source-install|db-connect|table-design|data-operate|query|lakehouse|compute-storage-decoupled|admin-manual|practical-guide|sql-manual', + activeBaseRegex: + 'summary|install/cluster-deployment|install/source-install|db-connect|table-design|data-operate|query|lakehouse|compute-storage-decoupled|admin-manual|practical-guide|sql-manual', }, { label: '性能测试', @@ -379,7 +391,8 @@ const config = { // to: '/docs/install/source-install/compilation-with-docker', type: 'doc', docId: 'install/source-install/compilation-with-docker', - activeBaseRegex: 'summary|install/cluster-deployment|install/source-install|db-connect|table-design|data-operate|query|lakehouse|compute-storage-decoupled|admin-manual|practical-guide|sql-manual' + activeBaseRegex: + 'summary|install/cluster-deployment|install/source-install|db-connect|table-design|data-operate|query|lakehouse|compute-storage-decoupled|admin-manual|practical-guide|sql-manual', }, { label: 'Benchmark', diff --git a/package.json b/package.json index 7afcd67caf91b..5393125cb87d2 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "name": "doris-website", - "version": "2.0.0", + "version": "3.0.0", "private": true, "scripts": { "docusaurus": "docusaurus", "start": "docusaurus start", "start:zh-CN": "docusaurus start --locale zh-CN", - "build": "NODE_OPTIONS=--max_old_space_size=8192 PWA_SERVICE_WORKER_URL=https://doris.apache.org/sw.js docusaurus build", + "build": "NODE_OPTIONS=--max_old_space_size=12288 PWA_SERVICE_WORKER_URL=https://doris.apache.org/sw.js docusaurus build", "build:version": "docusaurus set-versions && docusaurus build", "swizzle": "docusaurus swizzle", "deploy": "docusaurus deploy", @@ -23,7 +23,6 @@ "@docusaurus/plugin-client-redirects": "^2.4.1", "@docusaurus/plugin-pwa": "^2.4.1", "@docusaurus/preset-classic": "^2.4.1", - "@easyops-cn/docusaurus-search-local": "^0.30.2", "@mdx-js/react": "^1.6.22", "antd": "^5.12.2", "autoprefixer": "^10.4.16", diff --git a/src/scss/custom.scss b/src/scss/custom.scss index 32e6d8cdb4fce..a4d7adc69acc9 100644 --- a/src/scss/custom.scss +++ b/src/scss/custom.scss @@ -18,14 +18,12 @@ @import './components/search'; @import './common'; - @layer utilities { .transition-slide { @apply inline-block transform transition-transform duration-300 hover:translate-x-1 group-hover:translate-x-1; } } - .button-primary { display: flex; height: 52px; @@ -34,16 +32,16 @@ align-items: center; gap: 4px; border-radius: 4px; - background: var(--b-1, #444FD9); + background: var(--b-1, #444fd9); color: white; } :root { - --font-family-base: "SF Pro Display", "SF Pro Icons", "Helvetica Neue", Helvetica, Arial, sans-serif; + --font-family-base: 'SF Pro Display', 'SF Pro Icons', 'Helvetica Neue', Helvetica, Arial, sans-serif; } .markdown :where(p, h1, h2, h3, h4, h5, h6, li, blockquote) { font-family: var(--font-family-base); - color: #2a2f34 + color: #2a2f34; } // body, .markdown { // font-family: var(--font-family-base); @@ -53,4 +51,58 @@ .navbar__link { font-family: var(--font-family-base); font-weight: 400 !important; -} \ No newline at end of file +} + +.DocSearch { + /* --docsearch-primary-color: var(--ifm-color-primary); */ + /* --docsearch-text-color: var(--ifm-font-color-base); */ + --docsearch-muted-color: var(--ifm-color-secondary-darkest); + --docsearch-container-background: rgba(94, 100, 112, 0.7); + /* 弹窗 */ + --docsearch-modal-background: var(--ifm-color-secondary-lighter); + /* 搜索框 */ + --docsearch-searchbox-background: var(--ifm-color-secondary); + --docsearch-searchbox-focus-background: var(--ifm-color-white); + /* 条目 */ + --docsearch-hit-color: var(--ifm-font-color-base); + --docsearch-hit-active-color: var(--ifm-color-white); + --docsearch-hit-background: var(--ifm-color-white); + /* 页脚 */ + --docsearch-footer-background: var(--ifm-color-white); + &.DocSearch-Button { + border-radius: 8px; + background-color: #f7f9fe; + height: 40px; + padding: 0 16px; + width: 247px; + color: #4c576c; + font-size: 14px; + font-weight: normal; + &:hover { + box-shadow: none; + background: #f7f9fe; + } + .DocSearch-Button-Placeholder { + color: #8592a6; + font-size: 12px; + font-weight: normal; + } + .DocSearch-Button-Keys { + min-width: auto; + background-color: #fff; + border-radius: 2px; + .DocSearch-Button-Key { + margin-right: 0; + box-shadow: none; + background: transparent; + border-radius: 0; + top: 1px; + width: 14px; + } + } + .DocSearch-Search-Icon { + width: 14px; + stroke-width: 1.5; + } + } +} diff --git a/src/theme/SearchBar/EmptyTemplate.js b/src/theme/SearchBar/EmptyTemplate.js deleted file mode 100644 index 0c67ba65f422a..0000000000000 --- a/src/theme/SearchBar/EmptyTemplate.js +++ /dev/null @@ -1,12 +0,0 @@ -import { translate } from "@docusaurus/Translate"; -import { iconNoResults } from "./icons"; -import styles from "./SearchBar.module.css"; -export function EmptyTemplate() { - if (process.env.NODE_ENV === "production") { - return `${iconNoResults}${translate({ - id: "theme.SearchBar.noResultsText", - message: "No results", - })}`; - } - return `⚠️ The search index is only available when you run docusaurus build!`; -} diff --git a/src/theme/SearchBar/SearchBar.jsx b/src/theme/SearchBar/SearchBar.jsx deleted file mode 100644 index 14154b5a238b0..0000000000000 --- a/src/theme/SearchBar/SearchBar.jsx +++ /dev/null @@ -1,281 +0,0 @@ -import React, { useCallback, useEffect, useRef, useState } from 'react'; -import clsx from 'clsx'; -import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; -import ExecutionEnvironment from '@docusaurus/ExecutionEnvironment'; -import { useHistory, useLocation } from '@docusaurus/router'; -import { translate } from '@docusaurus/Translate'; -import { ReactContextError, useDocsPreferredVersion } from '@docusaurus/theme-common'; -import { useActivePlugin } from '@docusaurus/plugin-content-docs/client'; -import { fetchIndexes } from './fetchIndexes'; -import { SearchSourceFactory } from '../../utils/SearchSourceFactory'; -import { SuggestionTemplate } from './SuggestionTemplate'; -import { EmptyTemplate } from './EmptyTemplate'; -import { - searchResultLimits, - Mark, - searchBarShortcut, - searchBarShortcutHint, - docsPluginIdForPreferredVersion, - indexDocs, -} from '../../utils/proxiedGenerated'; -import LoadingRing from '../LoadingRing/LoadingRing'; -import styles from './SearchBar.module.css'; -async function fetchAutoCompleteJS() { - const autoCompleteModule = await import('@easyops-cn/autocomplete.js'); - const autoComplete = autoCompleteModule.default; - if (autoComplete.noConflict) { - // For webpack v5 since docusaurus v2.0.0-alpha.75 - autoComplete.noConflict(); - } else if (autoCompleteModule.noConflict) { - // For webpack v4 before docusaurus v2.0.0-alpha.74 - autoCompleteModule.noConflict(); - } - return autoComplete; -} -const SEARCH_PARAM_HIGHLIGHT = '_highlight'; -export default function SearchBar({ handleSearchBarToggle }) { - const { - siteConfig: { baseUrl }, - } = useDocusaurusContext(); - // It returns undefined for non-docs pages - const activePlugin = useActivePlugin(); - let versionUrl = baseUrl; - // For non-docs pages while using plugin-content-docs with custom ids, - // this will throw an error of: - // > Docusaurus plugin global data not found for "docusaurus-plugin-content-docs" plugin with id "default". - // It seems that we can not get the correct id for non-docs pages. - try { - // The try-catch is a hack because useDocsPreferredVersion just throws an - // exception when versions are not used. - // The same hack is used in SearchPage.tsx - // eslint-disable-next-line react-hooks/rules-of-hooks - const { preferredVersion } = useDocsPreferredVersion(activePlugin?.pluginId ?? docsPluginIdForPreferredVersion); - if (preferredVersion && !preferredVersion.isLast) { - versionUrl = preferredVersion.path + '/'; - } - } catch (e) { - if (indexDocs) { - if (e instanceof ReactContextError) { - /* ignore, happens when website doesn't use versions */ - } else { - throw e; - } - } - } - const history = useHistory(); - const location = useLocation(); - const searchBarRef = useRef(null); - const indexState = useRef('empty'); // empty, loaded, done - // Should the input be focused after the index is loaded? - const focusAfterIndexLoaded = useRef(false); - const [loading, setLoading] = useState(false); - const [inputChanged, setInputChanged] = useState(false); - const [inputValue, setInputValue] = useState(''); - const search = useRef(null); - const loadIndex = useCallback(async () => { - if (indexState.current !== 'empty') { - // Do not load the index (again) if its already loaded or in the process of being loaded. - return; - } - indexState.current = 'loading'; - setLoading(true); - const [{ wrappedIndexes, zhDictionary }, autoComplete] = await Promise.all([ - fetchIndexes(versionUrl), - fetchAutoCompleteJS(), - ]); - search.current = autoComplete( - searchBarRef.current, - { - hint: false, - autoselect: true, - openOnFocus: true, - cssClasses: { - root: styles.searchBar, - noPrefix: true, - dropdownMenu: styles.dropdownMenu, - input: styles.input, - hint: styles.hint, - suggestions: styles.suggestions, - suggestion: styles.suggestion, - cursor: styles.cursor, - dataset: styles.dataset, - empty: styles.empty, - }, - }, - [ - { - source: SearchSourceFactory(wrappedIndexes, zhDictionary, searchResultLimits), - templates: { - suggestion: SuggestionTemplate, - empty: EmptyTemplate, - footer: ({ query, isEmpty }) => { - if (isEmpty) { - return; - } - const a = document.createElement('a'); - const url = `${baseUrl}search?q=${encodeURIComponent(query)}`; - a.href = url; - a.textContent = translate({ - id: 'theme.SearchBar.seeAll', - message: 'See all results', - }); - a.addEventListener('click', e => { - if (!e.ctrlKey && !e.metaKey) { - e.preventDefault(); - search.current.autocomplete.close(); - history.push(url); - } - }); - const div = document.createElement('div'); - div.className = styles.hitFooter; - div.appendChild(a); - return div; - }, - }, - }, - ], - ) - .on('autocomplete:selected', function (event, { document: { u, h }, tokens }) { - searchBarRef.current?.blur(); - let url = u; - if (Mark && tokens.length > 0) { - const params = new URLSearchParams(); - for (const token of tokens) { - params.append(SEARCH_PARAM_HIGHLIGHT, token); - } - url += `?${params.toString()}`; - } - if (h) { - url += h; - } - history.push(url); - }) - .on('autocomplete:closed', () => { - searchBarRef.current?.blur(); - }); - indexState.current = 'done'; - setLoading(false); - if (focusAfterIndexLoaded.current) { - const input = searchBarRef.current; - if (input.value) { - search.current.autocomplete.open(); - } - input.focus(); - } - }, [baseUrl, versionUrl, history]); - useEffect(() => { - if (!Mark) { - return; - } - const keywords = ExecutionEnvironment.canUseDOM - ? new URLSearchParams(location.search).getAll(SEARCH_PARAM_HIGHLIGHT) - : []; - // A workaround to fix an issue of highlighting in code blocks. - // See https://github.com/easyops-cn/docusaurus-search-local/issues/92 - // Code blocks will be re-rendered after this `useEffect` ran. - // So we make the marking run after a macro task. - setTimeout(() => { - const root = document.querySelector('article'); - if (!root) { - return; - } - const mark = new Mark(root); - mark.unmark(); - if (keywords.length !== 0) { - mark.mark(keywords); - } - // Apply any keywords to the search input so that we can clear marks in case we loaded a page with a highlight in the url - setInputValue(keywords.join(' ')); - search.current?.autocomplete.setVal(keywords.join(' ')); - }); - }, [location.search, location.pathname]); - const [focused, setFocused] = useState(false); - const onInputFocus = useCallback(() => { - focusAfterIndexLoaded.current = true; - loadIndex(); - setFocused(true); - handleSearchBarToggle?.(true); - }, [handleSearchBarToggle, loadIndex]); - const onInputBlur = useCallback(() => { - setFocused(false); - handleSearchBarToggle?.(false); - }, [handleSearchBarToggle]); - const onInputMouseEnter = useCallback(() => { - loadIndex(); - }, [loadIndex]); - const onInputChange = useCallback(event => { - setInputValue(event.target.value); - if (event.target.value) { - setInputChanged(true); - } - }, []); - // Implement hint icons for the search shortcuts on mac and the rest operating systems. - const isMac = ExecutionEnvironment.canUseDOM - ? /mac/i.test(navigator.userAgentData?.platform ?? navigator.platform) - : false; - useEffect(() => { - if (!searchBarShortcut) { - return; - } - // Add shortcuts command/ctrl + K - const handleShortcut = event => { - if ((isMac ? event.metaKey : event.ctrlKey) && event.code === 'KeyK') { - event.preventDefault(); - searchBarRef.current?.focus(); - onInputFocus(); - } - }; - document.addEventListener('keydown', handleShortcut); - return () => { - document.removeEventListener('keydown', handleShortcut); - }; - }, [isMac, onInputFocus]); - const onClearSearch = useCallback(() => { - const params = new URLSearchParams(location.search); - params.delete(SEARCH_PARAM_HIGHLIGHT); - const paramsStr = params.toString(); - const searchUrl = location.pathname + (paramsStr != '' ? `?${paramsStr}` : '') + location.hash; - if (searchUrl != location.pathname + location.search + location.hash) { - history.push(searchUrl); - } - // We always clear these here because in case no match was selected the above history push wont happen - setInputValue(''); - search.current?.autocomplete.setVal(''); - }, [location.pathname, location.search, location.hash, history]); - return ( -
- - - {searchBarShortcut && - (inputValue !== '' ? ( - - ) : ( -
- {isMac ? '⌘' : 'ctrl'} - K -
- ))} -
- ); -} diff --git a/src/theme/SearchBar/SearchBar.module.css b/src/theme/SearchBar/SearchBar.module.css deleted file mode 100644 index 606cbd6291b41..0000000000000 --- a/src/theme/SearchBar/SearchBar.module.css +++ /dev/null @@ -1,261 +0,0 @@ -.searchBar .dropdownMenu { - left: auto !important; - right: 0 !important; - - background: var(--search-local-modal-background, #f5f6f7); - border-radius: 6px; - box-shadow: var(--search-local-modal-shadow, inset 1px 1px 0 0 hsla(0, 0%, 100%, 0.5), 0 3px 8px 0 #555a64); - margin-top: 8px; - width: var(--search-local-modal-width, 560px); - position: relative; - padding: var(--search-local-spacing, 12px); -} - -.navbarSearchInput { - border: none !important; - background-color: #f7f9fe !important; - background-image: url('/static/images/search-icon.svg'); - height: 2.5rem !important; - background-position: 0.625rem center !important; - padding-left: 2.25rem !important; - color: #4c576c !important; - width: 15.43rem !important; - border-radius: 0.5rem; -} - -@media (max-width: 996px) { - :global(.navbar__search-input):not(:focus) { - width: 2rem; - } - - .searchBar .dropdownMenu { - width: 100%; - } -} - -html[data-theme='dark'] .searchBar .dropdownMenu { - background: var(--search-local-modal-background, var(--ifm-background-color)); - box-shadow: var(--search-local-modal-shadow, inset 1px 1px 0 0 #2c2e40, 0 3px 8px 0 #000309); -} - -.searchBar .dropdownMenu .suggestion { - cursor: pointer; - background: var(--search-local-hit-background, #fff); - border-radius: 4px; - box-shadow: var(--search-local-hit-shadow, 0 1px 3px 0 #d4d9e1); - padding: 0 var(--search-local-spacing, 12px); - width: 100%; - - align-items: center; - color: var(--search-local-hit-color, #444950); - display: flex; - flex-direction: row; - height: var(--search-local-hit-height, 56px); -} - -html[data-theme='dark'] .dropdownMenu .suggestion { - background: var(--search-local-hit-background, var(--ifm-color-emphasis-100)); - box-shadow: var(--search-local-hit-shadow, none); - color: var(--search-local-hit-color, var(--ifm-font-color-base)); -} - -.searchBar .dropdownMenu .suggestion:not(:last-child) { - margin-bottom: 4px; -} - -.searchBar .dropdownMenu .suggestion.cursor { - background-color: var(--search-local-highlight-color, var(--ifm-color-primary)); -} - -.hitTree, -.hitIcon, -.hitPath, -.noResultsIcon, -.hitFooter a { - color: var(--search-local-muted-color, #969faf); -} - -html[data-theme='dark'] .hitTree, -html[data-theme='dark'] .hitIcon, -html[data-theme='dark'] .hitPath, -html[data-theme='dark'] .noResultsIcon { - color: var(--search-local-muted-color, var(--ifm-color-secondary-darkest)); -} - -.hitTree { - display: flex; - align-items: center; -} - -.hitTree>svg { - height: var(--search-local-hit-height, 56px); - opacity: 0.5; - strokeWidth: var(--search-local-icon-strokeWidth, 1.4); - width: 24px; -} - -.hitIcon { - strokeWidth: var(--search-local-icon-strokeWidth, 1.4); - - height: 20px; - width: 20px; -} - -.hitWrapper { - flex: 1 1 auto; - display: flex; - flex-direction: column; - font-weight: 500; - justify-content: center; - margin: 0 8px; - overflow-x: hidden; - width: 80%; -} - -.hitWrapper mark { - background: none; - color: var(--search-local-highlight-color, var(--ifm-color-primary)); -} - -.hitTitle { - font-size: 0.9em; -} - -.hitPath { - font-size: 0.75em; -} - -.hitPath, -.hitTitle { - white-space: nowrap; - overflow-x: hidden; - text-overflow: ellipsis; -} - -.hitAction { - height: 20px; - width: 20px; -} - -.hideAction>svg { - display: none; -} - -.noResults { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - padding: var(--search-local-spacing, 12px) 0; -} - -.noResultsIcon { - margin-bottom: var(--search-local-spacing, 12px); -} - -.hitFooter { - text-align: center; - margin-top: var(--search-local-spacing, 12px); - font-size: 0.85em; -} - -.hitFooter a { - text-decoration: underline; -} - -.cursor .hideAction>svg { - display: block; -} - -.suggestion.cursor, -.suggestion.cursor mark, -.suggestion.cursor .hitTree, -.suggestion.cursor .hitIcon, -.suggestion.cursor .hitPath { - color: var(--search-local-hit-active-color, var(--ifm-color-white)) !important; -} - -.suggestion.cursor mark { - text-decoration: underline; -} - -.searchBarContainer { - margin-left: 16px; -} - -.searchBarContainer .searchBarLoadingRing { - display: none; - position: absolute; - left: 10px; - top: 10px; -} - -.searchBarContainer .searchClearButton { - position: absolute; - right: 0.8rem; - top: 50%; - transform: translate(0, -50%); - padding: 0; - background: none; - border: none; - line-height: 1rem; - color: #4c576c; - font-size: 14px; -} - -:global(.navbar__search) { - position: relative; -} - -.searchIndexLoading :global(.navbar__search-input) { - background-image: none; -} - -.searchBarContainer.searchIndexLoading .searchBarLoadingRing { - display: inline-block; -} - -.searchHintContainer { - position: absolute; - right: 10px; - top: 50%; - transform: translateY(-50%); - display: flex !important; - align-items: center; - justify-content: center; - pointer-events: none; - border: 1px solid #edf2fa; - padding: 5px 7px; - background-color: #ffffff; - gap: 2px; -} - -.searchHint { - color: #8592a6; - background-color: #ffffff; - border: none; - border-radius: none; - box-shadow: none; - font-size: 12px; - padding: 0; -} - -@media (max-width: 576px) { - - .searchBarContainer:not(.focused) .searchClearButton, - .searchHintContainer { - display: none !important; - } -} - -.input {} - -.hint {} - -.suggestions {} - -.dataset {} - -.empty {} - -/**/ \ No newline at end of file diff --git a/src/theme/SearchBar/SuggestionTemplate.js b/src/theme/SearchBar/SuggestionTemplate.js deleted file mode 100644 index d11f8c76357d4..0000000000000 --- a/src/theme/SearchBar/SuggestionTemplate.js +++ /dev/null @@ -1,49 +0,0 @@ -import { concatDocumentPath } from "../../utils/concatDocumentPath"; -import { getStemmedPositions } from "../../utils/getStemmedPositions"; -import { highlight } from "../../utils/highlight"; -import { highlightStemmed } from "../../utils/highlightStemmed"; -import { explicitSearchResultPath } from "../../utils/proxiedGenerated"; -import { iconAction, iconContent, iconHeading, iconTitle, iconTreeInter, iconTreeLast, } from "./icons"; -import styles from "./SearchBar.module.css"; -export function SuggestionTemplate({ document, type, page, metadata, tokens, isInterOfTree, isLastOfTree, }) { - const isTitle = type === 0; - const isHeading = type === 1; - const tree = []; - if (isInterOfTree) { - tree.push(iconTreeInter); - } - else if (isLastOfTree) { - tree.push(iconTreeLast); - } - const treeWrapper = tree.map((item) => `${item}`); - const icon = `${isTitle ? iconTitle : isHeading ? iconHeading : iconContent}`; - const wrapped = [ - `${highlightStemmed(document.t, getStemmedPositions(metadata, "t"), tokens)}`, - ]; - const needsExplicitHitPath = !isInterOfTree && !isLastOfTree && explicitSearchResultPath; - if (needsExplicitHitPath) { - const pathItems = page - ? (page.b ?? []) - .concat(page.t) - .concat(!document.s || document.s === page.t ? [] : document.s) - : document.b; - wrapped.push(`${concatDocumentPath(pathItems ?? [])}`); - } - else if (!isTitle) { - wrapped.push(`${highlight(page.t || - // Todo(weareoutman): This is for EasyOps only. - // istanbul ignore next - (document.u.startsWith("/docs/api-reference/") - ? "API Reference" - : ""), tokens)}`); - } - const action = `${iconAction}`; - return [ - ...treeWrapper, - icon, - ``, - ...wrapped, - "", - action, - ].join(""); -} diff --git a/src/theme/SearchBar/fetchIndexes.js b/src/theme/SearchBar/fetchIndexes.js deleted file mode 100644 index 4a9f974043ae8..0000000000000 --- a/src/theme/SearchBar/fetchIndexes.js +++ /dev/null @@ -1,30 +0,0 @@ -import lunr from 'lunr'; -import { searchIndexUrl } from '../../utils/proxiedGenerated'; -export async function fetchIndexes(baseUrl) { - if (process.env.NODE_ENV === 'production') { - // const json = await (await fetch(`${baseUrl}${searchIndexUrl}`)).json(); - const json = await (await fetch(`https://cdnd.selectdb.com${baseUrl}${searchIndexUrl}`)).json(); - const wrappedIndexes = json.map(({ documents, index }, type) => ({ - type: type, - documents, - index: lunr.Index.load(index), - })); - const zhDictionary = json.reduce((acc, item) => { - for (const tuple of item.index.invertedIndex) { - if (/\p{Unified_Ideograph}/u.test(tuple[0][0])) { - acc.add(tuple[0]); - } - } - return acc; - }, new Set()); - return { - wrappedIndexes, - zhDictionary: Array.from(zhDictionary), - }; - } - // The index does not exist in development, therefore load a dummy index here. - return { - wrappedIndexes: [], - zhDictionary: [], - }; -} diff --git a/src/theme/SearchBar/icons.js b/src/theme/SearchBar/icons.js deleted file mode 100644 index 9812a54eb45e7..0000000000000 --- a/src/theme/SearchBar/icons.js +++ /dev/null @@ -1,14 +0,0 @@ -export const iconTitle = - ''; -export const iconHeading = - ''; -export const iconContent = - ''; -export const iconAction = - ''; -export const iconNoResults = - ''; -export const iconTreeInter = - ''; -export const iconTreeLast = - ''; diff --git a/src/theme/SearchBar/index.js b/src/theme/SearchBar/index.js deleted file mode 100644 index 369df710bfdef..0000000000000 --- a/src/theme/SearchBar/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import "../../utils/proxiedGenerated"; -import SearchBar from "./SearchBar"; -export default SearchBar; diff --git a/src/theme/SearchPage/index.js b/src/theme/SearchPage/index.js new file mode 100644 index 0000000000000..8bf1caf4386cb --- /dev/null +++ b/src/theme/SearchPage/index.js @@ -0,0 +1,389 @@ +/* eslint-disable jsx-a11y/no-autofocus */ +import React, { useEffect, useReducer, useRef, useState } from 'react'; +import clsx from 'clsx'; +import algoliaSearchHelper from 'algoliasearch-helper'; +import algoliaSearch from 'algoliasearch/lite'; +import ExecutionEnvironment from '@docusaurus/ExecutionEnvironment'; +import Head from '@docusaurus/Head'; +import Link from '@docusaurus/Link'; +import { useAllDocsData } from '@docusaurus/plugin-content-docs/client'; +import { HtmlClassNameProvider, useEvent, usePluralForm, useSearchQueryString } from '@docusaurus/theme-common'; +import { useTitleFormatter } from '@docusaurus/theme-common/internal'; +import Translate, { translate } from '@docusaurus/Translate'; +import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; +import { useAlgoliaThemeConfig, useSearchResultUrlProcessor } from '@docusaurus/theme-search-algolia/client'; +import Layout from '@theme/Layout'; +import styles from './styles.module.css'; +// Very simple pluralization: probably good enough for now +function useDocumentsFoundPlural() { + const { selectMessage } = usePluralForm(); + return count => + selectMessage( + count, + translate( + { + id: 'theme.SearchPage.documentsFound.plurals', + description: + 'Pluralized label for "{count} documents found". Use as much plural forms (separated by "|") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)', + message: 'One document found|{count} documents found', + }, + { count }, + ), + ); +} +function useDocsSearchVersionsHelpers() { + const allDocsData = useAllDocsData(); + // State of the version select menus / algolia facet filters + // docsPluginId -> versionName map + const [searchVersions, setSearchVersions] = useState(() => + Object.entries(allDocsData).reduce( + (acc, [pluginId, pluginData]) => ({ + ...acc, + [pluginId]: pluginData.versions[0].name === 'current' ? '3.0' : pluginData.versions[0].name, + }), + {}, + ), + ); + // Set the value of a single select menu + const setSearchVersion = (pluginId, searchVersion) => setSearchVersions(s => ({ ...s, [pluginId]: searchVersion })); + const versioningEnabled = Object.values(allDocsData).some(docsData => docsData.versions.length > 1); + return { + allDocsData, + versioningEnabled, + searchVersions, + setSearchVersion, + }; +} +// We want to display one select per versioned docs plugin instance +function SearchVersionSelectList({ docsSearchVersionsHelpers }) { + const versionedPluginEntries = Object.entries(docsSearchVersionsHelpers.allDocsData) + // Do not show a version select for unversioned docs plugin instances + .filter(([, docsData]) => docsData.versions.length > 1); + + return ( +
+ {versionedPluginEntries.map(([pluginId, docsData]) => { + const labelPrefix = versionedPluginEntries.length > 1 ? `${pluginId}: ` : ''; + return ( + + ); + })} +
+ ); +} +function SearchPageContent() { + const { + i18n: { currentLocale }, + } = useDocusaurusContext(); + const { + algolia: { appId, apiKey, indexName }, + } = useAlgoliaThemeConfig(); + const processSearchResultUrl = useSearchResultUrlProcessor(); + const documentsFoundPlural = useDocumentsFoundPlural(); + const docsSearchVersionsHelpers = useDocsSearchVersionsHelpers(); + const [searchQuery, setSearchQuery] = useSearchQueryString(); + const initialSearchResultState = { + items: [], + query: null, + totalResults: null, + totalPages: null, + lastPage: null, + hasMore: null, + loading: null, + }; + const [searchResultState, searchResultStateDispatcher] = useReducer((prevState, data) => { + switch (data.type) { + case 'reset': { + return initialSearchResultState; + } + case 'loading': { + return { ...prevState, loading: true }; + } + case 'update': { + if (searchQuery !== data.value.query) { + return prevState; + } + return { + ...data.value, + items: data.value.lastPage === 0 ? data.value.items : prevState.items.concat(data.value.items), + }; + } + case 'advance': { + const hasMore = prevState.totalPages > prevState.lastPage + 1; + return { + ...prevState, + lastPage: hasMore ? prevState.lastPage + 1 : prevState.lastPage, + hasMore, + }; + } + default: + return prevState; + } + }, initialSearchResultState); + const algoliaClient = algoliaSearch(appId, apiKey); + const algoliaHelper = algoliaSearchHelper(algoliaClient, indexName, { + hitsPerPage: 15, + advancedSyntax: true, + disjunctiveFacets: ['language', 'docusaurus_tag'], + }); + algoliaHelper.on('result', ({ results: { query, hits, page, nbHits, nbPages } }) => { + if (query === '' || !Array.isArray(hits)) { + searchResultStateDispatcher({ type: 'reset' }); + return; + } + const sanitizeValue = value => value.replace(/algolia-docsearch-suggestion--highlight/g, 'search-result-match'); + const items = hits.map(({ url, _highlightResult: { hierarchy }, _snippetResult: snippet = {} }) => { + const titles = Object.keys(hierarchy).map(key => sanitizeValue(hierarchy[key].value)); + return { + title: titles.pop(), + url: processSearchResultUrl(url), + summary: snippet.content ? `${sanitizeValue(snippet.content.value)}...` : '', + breadcrumbs: titles, + }; + }); + searchResultStateDispatcher({ + type: 'update', + value: { + items, + query, + totalResults: nbHits, + totalPages: nbPages, + lastPage: page, + hasMore: nbPages > page + 1, + loading: false, + }, + }); + }); + const [loaderRef, setLoaderRef] = useState(null); + const prevY = useRef(0); + const observer = useRef( + ExecutionEnvironment.canUseIntersectionObserver && + new IntersectionObserver( + entries => { + const { + isIntersecting, + boundingClientRect: { y: currentY }, + } = entries[0]; + if (isIntersecting && prevY.current > currentY) { + searchResultStateDispatcher({ type: 'advance' }); + } + prevY.current = currentY; + }, + { threshold: 1 }, + ), + ); + const getTitle = () => + searchQuery + ? translate( + { + id: 'theme.SearchPage.existingResultsTitle', + message: 'Search results for "{query}"', + description: 'The search page title for non-empty query', + }, + { + query: searchQuery, + }, + ) + : translate({ + id: 'theme.SearchPage.emptyResultsTitle', + message: 'Search the documentation', + description: 'The search page title for empty query', + }); + const makeSearch = useEvent((page = 0) => { + algoliaHelper.addDisjunctiveFacetRefinement('docusaurus_tag', 'default'); + algoliaHelper.addDisjunctiveFacetRefinement('language', currentLocale); + Object.entries(docsSearchVersionsHelpers.searchVersions).forEach(([pluginId, searchVersion]) => { + algoliaHelper.addDisjunctiveFacetRefinement('docusaurus_tag', `docs-${pluginId}-${searchVersion}`); + }); + algoliaHelper.setQuery(searchQuery).setPage(page).search(); + }); + useEffect(() => { + if (!loaderRef) { + return undefined; + } + const currentObserver = observer.current; + if (currentObserver) { + currentObserver.observe(loaderRef); + return () => currentObserver.unobserve(loaderRef); + } + return () => true; + }, [loaderRef]); + useEffect(() => { + searchResultStateDispatcher({ type: 'reset' }); + if (searchQuery) { + searchResultStateDispatcher({ type: 'loading' }); + setTimeout(() => { + makeSearch(); + }, 300); + } + }, [searchQuery, docsSearchVersionsHelpers.searchVersions, makeSearch]); + useEffect(() => { + if (!searchResultState.lastPage || searchResultState.lastPage === 0) { + return; + } + makeSearch(searchResultState.lastPage); + }, [makeSearch, searchResultState.lastPage]); + return ( + + + {useTitleFormatter(getTitle())} + {/* + We should not index search pages + See https://github.com/facebook/docusaurus/pull/3233 + */} + + + +
+

{getTitle()}

+ +
e.preventDefault()}> +
+ setSearchQuery(e.target.value)} + value={searchQuery} + autoComplete="off" + autoFocus + /> +
+ + {docsSearchVersionsHelpers.versioningEnabled && ( + + )} + + +
+
+ {!!searchResultState.totalResults && documentsFoundPlural(searchResultState.totalResults)} +
+ + +
+ + {searchResultState.items.length > 0 ? ( +
+ {searchResultState.items.map(({ title, url, summary, breadcrumbs }, i) => ( +
+

+ +

+ + {breadcrumbs.length > 0 && ( + + )} + + {summary && ( +

+ )} +

+ ))} +
+ ) : ( + [ + searchQuery && !searchResultState.loading && ( +

+ + No results were found + +

+ ), + !!searchResultState.loading &&
, + ] + )} + + {searchResultState.hasMore && ( +
+ + Fetching new results... + +
+ )} +
+ + ); +} +export default function SearchPage() { + return ( + + + + ); +} diff --git a/src/theme/SearchPage/styles.module.css b/src/theme/SearchPage/styles.module.css new file mode 100644 index 0000000000000..57de7498db663 --- /dev/null +++ b/src/theme/SearchPage/styles.module.css @@ -0,0 +1,112 @@ +.searchQueryInput, +.searchVersionInput { + border-radius: var(--ifm-global-radius); + border: 2px solid var(--ifm-toc-border-color); + font: var(--ifm-font-size-base) var(--ifm-font-family-base); + padding: 0.8rem; + width: 100%; + background: var(--docsearch-searchbox-focus-background); + color: var(--docsearch-text-color); + margin-bottom: 0.5rem; + transition: border var(--ifm-transition-fast) ease; +} + +.searchQueryInput:focus, +.searchVersionInput:focus { + border-color: var(--docsearch-primary-color); + outline: none; +} + +.searchQueryInput::placeholder { + color: var(--docsearch-muted-color); +} + +.searchResultsColumn { + font-size: 0.9rem; + font-weight: bold; +} + +.algoliaLogo { + max-width: 150px; +} + +.algoliaLogoPathFill { + fill: var(--ifm-font-color-base); +} + +.searchResultItem { + padding: 1rem 0; + border-bottom: 1px solid var(--ifm-toc-border-color); +} + +.searchResultItemHeading { + font-weight: 400; + margin-bottom: 0; +} + +.searchResultItemPath { + font-size: 0.8rem; + color: var(--ifm-color-content-secondary); + --ifm-breadcrumb-separator-size-multiplier: 1; +} + +.searchResultItemSummary { + margin: 0.5rem 0 0; + font-style: italic; +} + +@media only screen and (max-width: 996px) { + .searchQueryColumn { + max-width: 60% !important; + } + + .searchVersionColumn { + max-width: 40% !important; + } + + .searchResultsColumn { + max-width: 60% !important; + } + + .searchLogoColumn { + max-width: 40% !important; + padding-left: 0 !important; + } +} + +@media screen and (max-width: 576px) { + .searchQueryColumn { + max-width: 100% !important; + } + + .searchVersionColumn { + max-width: 100% !important; + padding-left: var(--ifm-spacing-horizontal) !important; + } +} + +.loadingSpinner { + width: 3rem; + height: 3rem; + border: 0.4em solid #eee; + border-top-color: var(--ifm-color-primary); + border-radius: 50%; + animation: loading-spin 1s linear infinite; + margin: 0 auto; +} + +@keyframes loading-spin { + 100% { + transform: rotate(360deg); + } +} + +.loader { + margin-top: 2rem; +} + +:global(.search-result-match) { + color: var(--docsearch-hit-color); + background: rgb(255 215 142 / 25%); + padding: 0.09em 0; +} diff --git a/yarn.lock b/yarn.lock index daa19a3a4ed25..03e37a6556198 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1519,7 +1519,7 @@ utility-types "^3.10.0" webpack "^5.73.0" -"@docusaurus/plugin-content-docs@2.4.3", "@docusaurus/plugin-content-docs@^2.0.0-rc.1": +"@docusaurus/plugin-content-docs@2.4.3": version "2.4.3" resolved "https://registry.npmmirror.com/@docusaurus/plugin-content-docs/-/plugin-content-docs-2.4.3.tgz#aa224c0512351e81807adf778ca59fd9cd136973" integrity sha512-N7Po2LSH6UejQhzTCsvuX5NOzlC+HiXOVvofnEPj0WhMu1etpLEXE6a4aTxrtg95lQ5kf0xUIdjX9sh3d3G76A== @@ -1655,7 +1655,7 @@ "@docusaurus/theme-search-algolia" "2.4.3" "@docusaurus/types" "2.4.3" -"@docusaurus/react-loadable@5.5.2": +"@docusaurus/react-loadable@5.5.2", "react-loadable@npm:@docusaurus/react-loadable@5.5.2": version "5.5.2" resolved "https://registry.npmmirror.com/@docusaurus/react-loadable/-/react-loadable-5.5.2.tgz#81aae0db81ecafbdaee3651f12804580868fa6ce" integrity sha512-A3dYjdBGuy0IGT+wyLIGIKLRE+sAk1iNk0f1HjNDysO7u8lhL4N3VEm+FAubmJbAztn94F7MxBTPmnixbiyFdQ== @@ -1738,7 +1738,7 @@ tslib "^2.4.0" utility-types "^3.10.0" -"@docusaurus/theme-translations@2.4.3", "@docusaurus/theme-translations@^2.0.0-rc.1": +"@docusaurus/theme-translations@2.4.3": version "2.4.3" resolved "https://registry.npmmirror.com/@docusaurus/theme-translations/-/theme-translations-2.4.3.tgz#91ac73fc49b8c652b7a54e88b679af57d6ac6102" integrity sha512-H4D+lbZbjbKNS/Zw1Lel64PioUAIT3cLYYJLUf3KkuO/oc9e0QCVhIYVtUI2SfBCF2NNdlyhBDQEEMygsCedIg== @@ -1760,14 +1760,14 @@ webpack "^5.73.0" webpack-merge "^5.8.0" -"@docusaurus/utils-common@2.4.3", "@docusaurus/utils-common@^2.0.0-rc.1": +"@docusaurus/utils-common@2.4.3": version "2.4.3" resolved "https://registry.npmmirror.com/@docusaurus/utils-common/-/utils-common-2.4.3.tgz#30656c39ef1ce7e002af7ba39ea08330f58efcfb" integrity sha512-/jascp4GbLQCPVmcGkPzEQjNaAk3ADVfMtudk49Ggb+131B1WDD6HqlSmDf8MxGdy7Dja2gc+StHf01kiWoTDQ== dependencies: tslib "^2.4.0" -"@docusaurus/utils-validation@2.4.3", "@docusaurus/utils-validation@^2.0.0-rc.1": +"@docusaurus/utils-validation@2.4.3": version "2.4.3" resolved "https://registry.npmmirror.com/@docusaurus/utils-validation/-/utils-validation-2.4.3.tgz#8122c394feef3e96c73f6433987837ec206a63fb" integrity sha512-G2+Vt3WR5E/9drAobP+hhZQMaswRwDlp6qOMi7o7ZypB+VO7N//DZWhZEwhcRGepMDJGQEwtPv7UxtYwPL9PBw== @@ -1778,7 +1778,7 @@ js-yaml "^4.1.0" tslib "^2.4.0" -"@docusaurus/utils@2.4.3", "@docusaurus/utils@^2.0.0-rc.1": +"@docusaurus/utils@2.4.3": version "2.4.3" resolved "https://registry.npmmirror.com/@docusaurus/utils/-/utils-2.4.3.tgz#52b000d989380a2125831b84e3a7327bef471e89" integrity sha512-fKcXsjrD86Smxv8Pt0TBFqYieZZCPh4cbf9oszUq/AMhZn3ujwpKaVYZACPX8mmjtYx0JOgNx52CREBfiGQB4A== @@ -1800,58 +1800,6 @@ url-loader "^4.1.1" webpack "^5.73.0" -"@easyops-cn/autocomplete.js@^0.38.1": - version "0.38.1" - resolved "https://registry.npmmirror.com/@easyops-cn/autocomplete.js/-/autocomplete.js-0.38.1.tgz#46dff5795a9a032fa9b9250fdf63ca6c61c07629" - integrity sha512-drg76jS6syilOUmVNkyo1c7ZEBPcPuK+aJA7AksM5ZIIbV57DMHCywiCr+uHyv8BE5jUTU98j/H7gVrkHrWW3Q== - dependencies: - cssesc "^3.0.0" - immediate "^3.2.3" - -"@easyops-cn/docusaurus-search-local@^0.30.2": - version "0.30.2" - resolved "https://registry.npmmirror.com/@easyops-cn/docusaurus-search-local/-/docusaurus-search-local-0.30.2.tgz#41d0813ff4ece58fe38d8ace35f0187036c95d92" - integrity sha512-q2tYUuNjUbsSxv3vB04ItP/jp0teWswXtsLxNF6JgaDOHkNXEjQFmbaOoBLyIcPCawefxC0m/iZibzr1JAVGew== - dependencies: - "@docusaurus/plugin-content-docs" "^2.0.0-rc.1" - "@docusaurus/theme-translations" "^2.0.0-rc.1" - "@docusaurus/utils" "^2.0.0-rc.1" - "@docusaurus/utils-common" "^2.0.0-rc.1" - "@docusaurus/utils-validation" "^2.0.0-rc.1" - "@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" - -"@emnapi/core@^1.1.0": - version "1.2.0" - resolved "https://registry.npmmirror.com/@emnapi/core/-/core-1.2.0.tgz#7b738e5033738132bf6af0b8fae7b05249bdcbd7" - integrity sha512-E7Vgw78I93we4ZWdYCb4DGAwRROGkMIXk7/y87UmANR+J6qsWusmC3gLt0H+O0KOt5e6O38U8oJamgbudrES/w== - dependencies: - "@emnapi/wasi-threads" "1.0.1" - tslib "^2.4.0" - -"@emnapi/runtime@^1.1.0": - version "1.2.0" - resolved "https://registry.npmmirror.com/@emnapi/runtime/-/runtime-1.2.0.tgz#71d018546c3a91f3b51106530edbc056b9f2f2e3" - integrity sha512-bV21/9LQmcQeCPEg3BDFtvwL6cwiTMksYNWQQ4KOxCZikEGalWtenoZ0wCiukJINlGCIi2KXx01g4FoH/LxpzQ== - dependencies: - tslib "^2.4.0" - -"@emnapi/wasi-threads@1.0.1": - version "1.0.1" - resolved "https://registry.npmmirror.com/@emnapi/wasi-threads/-/wasi-threads-1.0.1.tgz#d7ae71fd2166b1c916c6cd2d0df2ef565a2e1a5b" - integrity sha512-iIBu7mwkq4UQGeMEM8bLwNK962nXdhodeScX4slfQnRhEMMzvYivHhutCIk8uojvmASXXPC2WNEjwxFWk72Oqw== - dependencies: - tslib "^2.4.0" - "@emotion/hash@^0.8.0": version "0.8.0" resolved "https://registry.npmmirror.com/@emotion/hash/-/hash-0.8.0.tgz#bbbff68978fefdbe68ccb533bc8cbe1d1afb5413" @@ -1985,107 +1933,6 @@ resolved "https://registry.npmmirror.com/@mdx-js/util/-/util-1.6.22.tgz#219dfd89ae5b97a8801f015323ffa4b62f45718b" integrity sha512-H1rQc1ZOHANWBvPcW+JpGwr+juXSxM8Q8YCkm3GhZd8REu1fHR3z99CErO1p9pkcfcxZnMdIZdIsXkOHY0NilA== -"@napi-rs/wasm-runtime@^0.2.3": - version "0.2.4" - resolved "https://registry.npmmirror.com/@napi-rs/wasm-runtime/-/wasm-runtime-0.2.4.tgz#d27788176f250d86e498081e3c5ff48a17606918" - integrity sha512-9zESzOO5aDByvhIAsOy9TbpZ0Ur2AJbUI7UT73kcUTS2mxAMHOBaa1st/jAymNoCtvrit99kkzT1FZuXVcgfIQ== - dependencies: - "@emnapi/core" "^1.1.0" - "@emnapi/runtime" "^1.1.0" - "@tybys/wasm-util" "^0.9.0" - -"@node-rs/jieba-android-arm-eabi@1.10.3": - version "1.10.3" - resolved "https://registry.npmmirror.com/@node-rs/jieba-android-arm-eabi/-/jieba-android-arm-eabi-1.10.3.tgz#821af26a4953b3fbdf2f80a4d08a9d9114b40bea" - integrity sha512-fuqVtaYlUKZg3cqagYFxj1DSa7ZHKXLle4iGH2kbQWg7Kw6cf7aCYBHIUZuH5sliK10M/CWccZ+SGRUwcSGfbg== - -"@node-rs/jieba-android-arm64@1.10.3": - version "1.10.3" - resolved "https://registry.npmmirror.com/@node-rs/jieba-android-arm64/-/jieba-android-arm64-1.10.3.tgz#e5c285fb8de71739dfa3a83d894adcadb799c404" - integrity sha512-iuZZZq5yD9lT+AgaXpFe19gtAsIecUODRLLaBFbavjgjLk5cumv38ytWjS36s/eqptwI15MQfysSYOlWtMEG5g== - -"@node-rs/jieba-darwin-arm64@1.10.3": - version "1.10.3" - resolved "https://registry.npmmirror.com/@node-rs/jieba-darwin-arm64/-/jieba-darwin-arm64-1.10.3.tgz#67df85df39ff60dcc3e084f6e36e5182779b69ad" - integrity sha512-dwPhkav1tEARskwPz91UUXL2NXy4h0lJYTuJzpGgwXxm552zBM2JJ41kjah1364j+EOq5At3NQvf5r5rH89phQ== - -"@node-rs/jieba-darwin-x64@1.10.3": - version "1.10.3" - resolved "https://registry.npmmirror.com/@node-rs/jieba-darwin-x64/-/jieba-darwin-x64-1.10.3.tgz#ffdc8a63335294d7c68d3aebec870ec0824ebe98" - integrity sha512-kjxvV6G1baQo/2I3mELv5qGv4Q0rhd5srwXhypSxMWZFtSpNwCDsLcIOR5bvMBci6QVFfZOs6WD6DKiWVz0SlA== - -"@node-rs/jieba-freebsd-x64@1.10.3": - version "1.10.3" - resolved "https://registry.npmmirror.com/@node-rs/jieba-freebsd-x64/-/jieba-freebsd-x64-1.10.3.tgz#188349a9074b200af4a3e8a0ea169f45efd6c162" - integrity sha512-QYTsn+zlWRil+MuBeLfTK5Md4GluOf2lHnFqjrOZW2oMgNOvxB3qoLV4TUf70S/E2XHeP6PUdjCKItX8C7GQPg== - -"@node-rs/jieba-linux-arm-gnueabihf@1.10.3": - version "1.10.3" - resolved "https://registry.npmmirror.com/@node-rs/jieba-linux-arm-gnueabihf/-/jieba-linux-arm-gnueabihf-1.10.3.tgz#e1831b7b08a32904b12860555978c50222a97b54" - integrity sha512-UFB43kDOvqmbRl99e3GPwaTuwJZaAvgLaMTvBkmxww4MpQH6G1k31RLzMW/S21uSQso2lj6W/Mm59gaJk2FiyA== - -"@node-rs/jieba-linux-arm64-gnu@1.10.3": - version "1.10.3" - resolved "https://registry.npmmirror.com/@node-rs/jieba-linux-arm64-gnu/-/jieba-linux-arm64-gnu-1.10.3.tgz#326712eb7418f9796b113af93afe59ab64c37add" - integrity sha512-bu++yWi10wZtnS5uLcwxzxKmHVT77NgQMK8JiQr1TWCl3Y1Th7CnEHQtxfVB489edDK8l644h1/4zSTe5fRnOQ== - -"@node-rs/jieba-linux-arm64-musl@1.10.3": - version "1.10.3" - resolved "https://registry.npmmirror.com/@node-rs/jieba-linux-arm64-musl/-/jieba-linux-arm64-musl-1.10.3.tgz#6a3149d5abbe09f7c7748da219d5c39522b36c8a" - integrity sha512-pJh+SzrK1HaKakhdFM+ew9vXwpZqMxy9u0U7J4GT+3GvOwnAZ+KjeaHebIfgOz7ZHvp/T4YBNf8oWW4zwj3AJw== - -"@node-rs/jieba-linux-x64-gnu@1.10.3": - version "1.10.3" - resolved "https://registry.npmmirror.com/@node-rs/jieba-linux-x64-gnu/-/jieba-linux-x64-gnu-1.10.3.tgz#5d75fbc62a36cbb79137284abe4f432da06c2c80" - integrity sha512-GF5cfvu/0wXO2fVX/XV3WYH/xEGWzMBvfqLhGiA1OA1xHIufnA1T7uU3ZXkyoNi5Bzf6dmxnwtE4CJL0nvhwjQ== - -"@node-rs/jieba-linux-x64-musl@1.10.3": - version "1.10.3" - resolved "https://registry.npmmirror.com/@node-rs/jieba-linux-x64-musl/-/jieba-linux-x64-musl-1.10.3.tgz#fce3aa9c394dbc51b4b3e92d29b385b4c4f23aec" - integrity sha512-h45HMVU/hgzQ0saXNsK9fKlGdah1i1cXZULpB5vQRlRL2ZIaGp+ULtWTogS7vkoo2K8s2l4tqakWMg9eUjIJ2A== - -"@node-rs/jieba-wasm32-wasi@1.10.3": - version "1.10.3" - resolved "https://registry.npmmirror.com/@node-rs/jieba-wasm32-wasi/-/jieba-wasm32-wasi-1.10.3.tgz#b852eb2c9b8c81c5514ed8bb76d74c1cdf66fe76" - integrity sha512-vuoQ62vVoedNGcBmIi4UWdtNBOZG8B+vDYfjx3FD6rNg6g/RgwbVjYXbOVMOQwX06Ob9CfrutICXdUGHgoxzEQ== - dependencies: - "@napi-rs/wasm-runtime" "^0.2.3" - -"@node-rs/jieba-win32-arm64-msvc@1.10.3": - version "1.10.3" - resolved "https://registry.npmmirror.com/@node-rs/jieba-win32-arm64-msvc/-/jieba-win32-arm64-msvc-1.10.3.tgz#eefce48df8ec0496a0e45593d0b5f8981bb32b80" - integrity sha512-B8t4dh56TZnMLBoYWDkopf1ed37Ru/iU1qiIeBkbZWXGmNBChNZUOd//eaPOFjx8m9Sfc8bkj3FBRWt/kTAhmw== - -"@node-rs/jieba-win32-ia32-msvc@1.10.3": - version "1.10.3" - resolved "https://registry.npmmirror.com/@node-rs/jieba-win32-ia32-msvc/-/jieba-win32-ia32-msvc-1.10.3.tgz#edfb74e880a32f66a6810502957b62f9b042b487" - integrity sha512-SKuPGZJ5T+X4jOn1S8LklOSZ6HC7UBiw0hwi2z9uqX6WgElquLjGi/xfZ2gPqffeR/5K/PUu7aqYUUPL1XonVQ== - -"@node-rs/jieba-win32-x64-msvc@1.10.3": - version "1.10.3" - resolved "https://registry.npmmirror.com/@node-rs/jieba-win32-x64-msvc/-/jieba-win32-x64-msvc-1.10.3.tgz#285a24134d9c367b11d73060bdc37c351c3e60b5" - integrity sha512-j9I4+a/tf2hsLu8Sr0NhcLBVNBBQctO2mzcjemMpRa1SlEeODyic9RIyP8Ljz3YTN6MYqKh1KA9iR1xvxjxYFg== - -"@node-rs/jieba@^1.6.0": - version "1.10.3" - resolved "https://registry.npmmirror.com/@node-rs/jieba/-/jieba-1.10.3.tgz#05756df55c99f2c4f68c5e41d258edec21a97395" - integrity sha512-SG0CWHmhIveH6upJURgymDKLertEPYbOc5NSFIpbZWW1W2MpqgumVteQO+5YBlkmpR6jMNDPWNQyQwkB6HoeNg== - optionalDependencies: - "@node-rs/jieba-android-arm-eabi" "1.10.3" - "@node-rs/jieba-android-arm64" "1.10.3" - "@node-rs/jieba-darwin-arm64" "1.10.3" - "@node-rs/jieba-darwin-x64" "1.10.3" - "@node-rs/jieba-freebsd-x64" "1.10.3" - "@node-rs/jieba-linux-arm-gnueabihf" "1.10.3" - "@node-rs/jieba-linux-arm64-gnu" "1.10.3" - "@node-rs/jieba-linux-arm64-musl" "1.10.3" - "@node-rs/jieba-linux-x64-gnu" "1.10.3" - "@node-rs/jieba-linux-x64-musl" "1.10.3" - "@node-rs/jieba-wasm32-wasi" "1.10.3" - "@node-rs/jieba-win32-arm64-msvc" "1.10.3" - "@node-rs/jieba-win32-ia32-msvc" "1.10.3" - "@node-rs/jieba-win32-x64-msvc" "1.10.3" - "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.npmmirror.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -2405,13 +2252,6 @@ resolved "https://registry.npmmirror.com/@tsconfig/docusaurus/-/docusaurus-1.0.7.tgz#a3ee3c8109b3fec091e3d61a61834e563aeee3c3" integrity sha512-ffTXxGIP/IRMCjuzHd6M4/HdIrw1bMfC7Bv8hMkTadnePkpe0lG0oDSdbRpSDZb2rQMAgpbWiR10BvxvNYwYrg== -"@tybys/wasm-util@^0.9.0": - version "0.9.0" - resolved "https://registry.npmmirror.com/@tybys/wasm-util/-/wasm-util-0.9.0.tgz#3e75eb00604c8d6db470bf18c37b7d984a0e3355" - integrity sha512-6+7nlbMVX/PVDCwaIQ8nTOPveOcFLSt8GcXdx8hD0bt39uWxYT88uXzqTd4fTvqta7oeUJqudepapKNt2DYJFw== - dependencies: - tslib "^2.4.0" - "@types/body-parser@*": version "1.19.5" resolved "https://registry.npmmirror.com/@types/body-parser/-/body-parser-1.19.5.tgz#04ce9a3b677dc8bd681a17da1ab9835dc9d3ede4" @@ -3500,7 +3340,7 @@ character-reference-invalid@^1.0.0: resolved "https://registry.npmmirror.com/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz#083329cda0eae272ab3dbbf37e9a382c13af1560" integrity sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg== -cheerio@1.0.0-rc.3, cheerio@^1.0.0-rc.12, cheerio@^1.0.0-rc.3: +cheerio@1.0.0-rc.3, cheerio@^1.0.0-rc.12: version "1.0.0-rc.3" resolved "https://registry.npmmirror.com/cheerio/-/cheerio-1.0.0-rc.3.tgz#094636d425b2e9c0f4eb91a46c05630c9a1a8bf6" integrity sha512-0td5ijfUPuubwLUu0OBoe98gZj8C/AA+RW3v67GPlGOrvxWjZmBXiBCRU+I8VEiNyJzjth40POfHiz2RB3gImA== @@ -4080,7 +3920,7 @@ debug@2.6.9, debug@^2.6.0: dependencies: ms "2.0.0" -debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.2.0, debug@^4.3.1: +debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1: version "4.3.6" resolved "https://registry.npmmirror.com/debug/-/debug-4.3.6.tgz#2ab2c38fbaffebf8aa95fdfe6d88438c7a13c52b" integrity sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg== @@ -4926,7 +4766,7 @@ fs-constants@^1.0.0: resolved "https://registry.npmmirror.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== -fs-extra@^10.0.0, fs-extra@^10.1.0: +fs-extra@^10.1.0: version "10.1.0" resolved "https://registry.npmmirror.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf" integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ== @@ -5160,7 +5000,7 @@ got@^9.6.0: to-readable-stream "^1.0.0" url-parse-lax "^3.0.0" -graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.11, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9: +graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.11, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9: version "4.2.11" resolved "https://registry.npmmirror.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== @@ -5509,11 +5349,6 @@ image-size@^1.0.1: dependencies: queue "6.0.2" -immediate@^3.2.3: - version "3.3.0" - resolved "https://registry.npmmirror.com/immediate/-/immediate-3.3.0.tgz#1aef225517836bcdf7f2a2de2600c79ff0269266" - integrity sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q== - immer@^9.0.7: version "9.0.21" resolved "https://registry.npmmirror.com/immer/-/immer-9.0.21.tgz#1e025ea31a40f24fb064f1fef23e931496330176" @@ -6089,13 +5924,6 @@ kind-of@^6.0.0, kind-of@^6.0.2: resolved "https://registry.npmmirror.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== -klaw-sync@^6.0.0: - version "6.0.0" - resolved "https://registry.npmmirror.com/klaw-sync/-/klaw-sync-6.0.0.tgz#1fd2cfd56ebb6250181114f0a581167099c2b28c" - integrity sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ== - dependencies: - graceful-fs "^4.1.11" - kleur@^3.0.3: version "3.0.3" resolved "https://registry.npmmirror.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" @@ -6253,16 +6081,6 @@ lru-cache@^5.1.1: dependencies: yallist "^3.0.2" -lunr-languages@^1.4.0: - version "1.14.0" - resolved "https://registry.npmmirror.com/lunr-languages/-/lunr-languages-1.14.0.tgz#6e97635f434631729dd0e5654daedd291cd6f2d0" - integrity sha512-hWUAb2KqM3L7J5bcrngszzISY4BxrXn/Xhbb9TTCJYEGqlR1nG67/M14sp09+PTIRklobrn57IAxcdcO/ZFyNA== - -lunr@^2.3.9: - version "2.3.9" - resolved "https://registry.npmmirror.com/lunr/-/lunr-2.3.9.tgz#18b123142832337dd6e964df1a5a7707b25d35e1" - integrity sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow== - magic-string@^0.25.0, magic-string@^0.25.7: version "0.25.9" resolved "https://registry.npmmirror.com/magic-string/-/magic-string-0.25.9.tgz#de7f9faf91ef8a1c91d02c2e5314c8277dbcdd1c" @@ -6277,11 +6095,6 @@ make-dir@^3.0.0, make-dir@^3.0.2, make-dir@^3.1.0: dependencies: semver "^6.0.0" -mark.js@^8.11.1: - version "8.11.1" - resolved "https://registry.npmmirror.com/mark.js/-/mark.js-8.11.1.tgz#180f1f9ebef8b0e638e4166ad52db879beb2ffc5" - integrity sha512-1I+1qpDt4idfgLQG+BNWmrqku+7/2bi5nLf4YwF8y8zXvmfiTBY3PV3ZibfrjBueCByROpuBjLLFCajqkgYoLQ== - markdown-escapes@^1.0.0: version "1.0.4" resolved "https://registry.npmmirror.com/markdown-escapes/-/markdown-escapes-1.0.4.tgz#c95415ef451499d7602b91095f3c8e8975f78535" @@ -7914,14 +7727,6 @@ react-loadable-ssr-addon-v5-slorber@^1.0.1: dependencies: "@babel/runtime" "^7.10.3" -"react-loadable@npm:@docusaurus/react-loadable@5.5.2": - version "5.5.2" - resolved "https://registry.npmmirror.com/@docusaurus/react-loadable/-/react-loadable-5.5.2.tgz#81aae0db81ecafbdaee3651f12804580868fa6ce" - integrity sha512-A3dYjdBGuy0IGT+wyLIGIKLRE+sAk1iNk0f1HjNDysO7u8lhL4N3VEm+FAubmJbAztn94F7MxBTPmnixbiyFdQ== - dependencies: - "@types/react" "*" - prop-types "^15.6.2" - react-router-config@^5.1.1: version "5.1.1" resolved "https://registry.npmmirror.com/react-router-config/-/react-router-config-5.1.1.tgz#0f4263d1a80c6b2dc7b9c1902c9526478194a988" @@ -8753,16 +8558,7 @@ string-convert@^0.2.0: resolved "https://registry.npmmirror.com/string-convert/-/string-convert-0.2.1.tgz#6982cc3049fbb4cd85f8b24568b9d9bf39eeff97" integrity sha512-u/1tdPl4yQnPBjnVrmdLo9gtuLvELKsAoRapekWggdiQNvvvum+jYF329d84NAa660KQw7pB2n36KrIKVoXa3A== -"string-width-cjs@npm:string-width@^4.2.0": - version "4.2.3" - resolved "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2: +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2: version "4.2.3" resolved "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -8849,14 +8645,7 @@ stringify-object@^3.3.0: is-obj "^1.0.1" is-regexp "^1.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": - version "6.0.1" - resolved "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -9975,16 +9764,7 @@ workbox-window@6.6.1, workbox-window@^6.5.3: "@types/trusted-types" "^2.0.2" workbox-core "6.6.1" -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": - version "7.0.0" - resolved "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==