diff --git a/.changeset/curvy-plants-promise.md b/.changeset/curvy-plants-promise.md new file mode 100644 index 000000000..a845151cc --- /dev/null +++ b/.changeset/curvy-plants-promise.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/docsite/docusaurus.config.js b/docsite/docusaurus.config.js index 735db81b7..1098659b0 100644 --- a/docsite/docusaurus.config.js +++ b/docsite/docusaurus.config.js @@ -49,41 +49,6 @@ const config = { title2, }, - plugins: [ - [ - require.resolve("@cmfcmf/docusaurus-search-local"), - /** @type {SearchPluginOptions} */ - ({ - // whether to index docs pages - indexDocs: true, - - // Whether to also index the titles of the parent categories in the sidebar of a doc page. - // 0 disables this feature. - // 1 indexes the direct parent category in the sidebar of a doc page - // 2 indexes up to two nested parent categories of a doc page - // 3... - // - // Do _not_ use Infinity, the value must be a JSON-serializable integer. - indexDocSidebarParentCategories: 0, - - // whether to index blog pages - indexBlog: false, - - // whether to index static pages - // /404.html is never indexed - indexPages: false, - - // language of your documentation, see next section - language: "en", - - // setting this to "none" will prevent the default CSS to be included. The default CSS - // comes from autocomplete-theme-classic, which you can read more about here: - // https://www.algolia.com/doc/ui-libraries/autocomplete/api-reference/autocomplete-theme-classic/ - style: undefined, - }), - ], - ], - presets: [ [ "classic", @@ -120,6 +85,39 @@ const config = { themeConfig: /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ ({ + algolia: { + // ------------ + // + // Docusaurus's Algolia plugin properties + // + appId: "47BE8NTWGA", + apiKey: "db4f13fdceb9b39d4ddb0b3746ecb99e", + indexName: "rnx-kit", + contextualSearch: true, + + // Optional: Specify domains where the navigation should occur through window.location instead on history.push. Useful when our Algolia config crawls multiple documentation sites and we want to navigate with window.location.href to them. + //externalUrlRegex: "external\\.com|domain\\.com", + + // Optional: path for search page that enabled by default (`false` to disable it) + searchPagePath: "search", + + // ---------- + // + // Algolia search parameters + // Reference: https://www.algolia.com/doc/api-reference/search-api-parameters + // + // ** These are all OPTIONAL ** + // + searchParameters: {}, + + // ---------- + // + // Algolia DocSearch API properties + // Reference: https://docsearch.algolia.com/docs/api + // + // ** All properties are OPTIONAL, and should be listed below here ** + // + }, navbar: { title: projectName, logo: { diff --git a/docsite/package.json b/docsite/package.json index a00a3bf47..bf01042aa 100644 --- a/docsite/package.json +++ b/docsite/package.json @@ -15,7 +15,6 @@ "typecheck": "tsc" }, "dependencies": { - "@cmfcmf/docusaurus-search-local": "^0.10.0", "@docusaurus/core": "2.0.0-beta.18", "@docusaurus/preset-classic": "2.0.0-beta.18", "@mdx-js/react": "^1.6.21", diff --git a/docsite/src/css/custom.css b/docsite/src/css/custom.css index 5ef677254..d48a81be8 100644 --- a/docsite/src/css/custom.css +++ b/docsite/src/css/custom.css @@ -53,52 +53,6 @@ --ifm-transition-fast: 100ms; --ifm-transition-slow: 300ms; - - /** Algolia Search vars - * - * All are flagged !important because Docusaurus or the Algolia preset - * (can't tell which) pulls in the Algolia CSS *after* this file, causing - * all of our '--aa-*' var definitions be over-written. - */ - --aa-base-unit: 14 !important; - - --aa-icon-size: 16px !important; - --aa-input-icon-size: 16px !important; - --aa-icon-color-rgb: var(--font-color-base-rgb) !important; - --aa-icon-color-alpha: 1 !important; - --aa-action-icon-size: var(--icon-size) !important; - - --aa-text-color-rgb: var(--font-color-base-rgb) !important; - --aa-text-color-alpha: 1 !important; - --aa-primary-color-rgb: var(--color-primary-rgb) !important; - --aa-primary-color-alpha: 1 !important; - --aa-muted-color-rgb: var(--font-color-base-rgb) !important; - --aa-muted-color-alpha: 0.5 !important; - - --aa-panel-border-color-rgb: var(--font-color-base-rgb) !important; - --aa-panel-border-color-alpha: 1 !important; - --aa-input-border-color-rgb: var(--font-color-base-rgb) !important; - --aa-input-border-color-alpha: 1 !important; - - --aa-background-color-rgb: var(--background-surface-color-rgb) !important; - --aa-background-color-alpha: 1 !important; - --aa-input-background-color-rgb: var( - --background-surface-color-rgb - ) !important; - --aa-input-background-color-alpha: 1 !important; - --aa-selected-color-rgb: var(--hover-overlay-rgb) !important; - --aa-selected-color-alpha: var(--hover-overlay-alpha) !important; - --aa-description-highlight-background-color-rgb: var( - --background-surface-color-rgb - ) !important; - --aa-description-highlight-background-color-alpha: 1 !important; - - --aa-overlay-color-rgb: var(--hover-overlay-rgb) !important; - --aa-overlay-color-alpha: 0.5 !important; - - --aa-search-input-height: 32px !important; - - --aa-panel-shadow: 0 6px 16px -4px rgba(var(--background-surface-color-rgb), 0.25) !important; } /* For readability concerns, you should choose a lighter palette in dark mode. */ @@ -131,46 +85,45 @@ html[data-theme="dark"] { --ifm-footer-background-color: rgb(var(--footer-background-color-rgb)); } -body[data-theme="dark"] { - /** Algolia Search vars - * - * All are flagged !important because Docusaurus or the Algolia preset - * (can't tell which) pulls in the Algolia CSS *after* this file, causing - * all of our '--aa-*' var definitions be over-written. - */ - --aa-icon-color-rgb: var(--font-color-base-rgb) !important; - - --aa-text-color-rgb: var(--font-color-base-rgb) !important; - --aa-text-color-alpha: 1 !important; - --aa-primary-color-rgb: var(--color-primary-rgb) !important; - --aa-primary-color-alpha: 1 !important; - --aa-muted-color-rgb: var(--font-color-base-rgb) !important; - --aa-muted-color-alpha: 0.5 !important; - - --aa-panel-border-color-rgb: var(--font-color-base-rgb) !important; - --aa-panel-border-color-alpha: 1 !important; - --aa-input-border-color-rgb: var(--font-color-base-rgb) !important; - --aa-input-border-color-alpha: 1 !important; - - --aa-background-color-rgb: var(--background-surface-color-rgb) !important; - --aa-background-color-alpha: 1 !important; - --aa-input-background-color-rgb: var( - --background-surface-color-rgb - ) !important; - --aa-input-background-color-alpha: 1 !important; - --aa-selected-color-rgb: var(--hover-overlay-rgb) !important; - --aa-selected-color-alpha: var(--hover-overlay-alpha) !important; - --aa-description-highlight-background-color-rgb: var( - --background-surface-color-rgb - ) !important; - --aa-description-highlight-background-color-alpha: 1 !important; - - --aa-overlay-color-rgb: var(--hover-overlay-rgb) !important; - --aa-overlay-color-alpha: 0.5 !important; - - --aa-panel-shadow: 0 6px 16px -4px rgba(var(--background-surface-color-rgb), 1) !important; +[data-theme='light'] .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); + /* Modal */ + --docsearch-modal-background: var(--ifm-color-secondary-lighter); + /* Search box */ + --docsearch-searchbox-background: var(--ifm-color-secondary); + --docsearch-searchbox-focus-background: var(--ifm-color-white); + /* Hit */ + --docsearch-hit-color: var(--ifm-font-color-base); + --docsearch-hit-active-color: var(--ifm-color-white); + --docsearch-hit-background: var(--ifm-color-white); + /* Footer */ + --docsearch-footer-background: var(--ifm-color-white); } +[data-theme='dark'] .DocSearch { + --docsearch-text-color: var(--ifm-font-color-base); + --docsearch-muted-color: var(--ifm-color-secondary-darkest); + --docsearch-container-background: rgba(47, 55, 69, 0.7); + /* Modal */ + --docsearch-modal-background: var(--ifm-background-color); + /* Search box */ + --docsearch-searchbox-background: var(--ifm-background-color); + --docsearch-searchbox-focus-background: var(--ifm-color-black); + /* Hit */ + --docsearch-hit-color: var(--ifm-font-color-base); + --docsearch-hit-active-color: var(--ifm-color-white); + --docsearch-hit-background: var(--ifm-color-emphasis-100); + /* Footer */ + --docsearch-footer-background: var(--ifm-background-surface-color); + --docsearch-key-gradient: linear-gradient( + -26.5deg, + var(--ifm-color-emphasis-200) 0%, + var(--ifm-color-emphasis-100) 100% + ); +} /* * Icons */ @@ -336,68 +289,3 @@ html[data-theme="dark"] .markdown a:hover { width: 300px; max-width: unset; } - -/* - * Search - */ -.aa-SubmitIcon, -.aa-LoadingIcon, -.aa-ClearIcon { - fill: rgb(var(--font-color-base-rgb)) !important; - width: var(--aa-icon-size) !important; - height: var(--aa-icon-size) !important; -} - -.dsla-search-wrapper { - margin-left: 0 !important; - padding: var(--ifm-navbar-item-padding-vertical) - var(--ifm-navbar-item-padding-horizontal) !important; -} - -.aa-DetachedSearchButton, -.aa-Form { - border: var(--ifm-global-border-width) solid - rgba(var(--aa-input-border-color-rgb), var(--aa-input-border-color-alpha)) !important; - border-radius: var(--ifm-global-radius) !important; - padding: var(--aa-spacing-half) !important; -} - -.aa-Form { - align-items: initial !important; - box-shadow: inherit !important; - height: var(--aa-search-input-height) !important; -} - -.aa-DetachedFormContainer { - border-bottom: none !important; -} - -.aa-DetachedSearchButton:focus { - box-shadow: inherit !important; -} - -.aa-DetachedSearchButtonIcon { - width: initial !important; - padding-right: var(--aa-spacing-half) !important; -} - -.aa-LoadingIndicator, -.aa-SubmitButton { - padding-left: 0 !important; - padding-right: var(--aa-spacing-half) !important; - width: auto !important; -} - -.aa-InputWrapperPrefix, -.aa-Input, -.aa-InputWrapperSuffix { - height: auto !important; -} - -.aa-ClearButton { - padding: 0 !important; -} - -.aa-ItemLink:hover { - color: var(--ifm-font-color-base); -} diff --git a/yarn.lock b/yarn.lock index 2891a148a..d54fe1057 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9,23 +9,6 @@ dependencies: "@algolia/autocomplete-shared" "1.5.2" -"@algolia/autocomplete-core@1.5.3": - version "1.5.3" - resolved "https://registry.yarnpkg.com/@algolia/autocomplete-core/-/autocomplete-core-1.5.3.tgz#5acc772ffc26ed433229e8556e2669bd51b2d529" - integrity sha512-hl0DAT7kU3BItafYLx/O8Z0xPaDnU9PpEPP5n1CgmaUwT/CA3YAIILuk37aA2OyP6R3aCsCyQl4IWQJQzjZ6mA== - dependencies: - "@algolia/autocomplete-shared" "1.5.3" - -"@algolia/autocomplete-js@^1.5.1": - version "1.5.3" - resolved "https://registry.yarnpkg.com/@algolia/autocomplete-js/-/autocomplete-js-1.5.3.tgz#54d8db10edc2869b0b5102e764db1f451b142feb" - integrity sha512-PvwLkrC5R5KuFiIllGqiZUuPd/BDJRB24GmmX7s5qCdst/UlxnwllpcIOv+PMZCMpRwrCJ7yKblEB7KHuUMxfQ== - dependencies: - "@algolia/autocomplete-core" "1.5.3" - "@algolia/autocomplete-preset-algolia" "1.5.3" - "@algolia/autocomplete-shared" "1.5.3" - preact "^10.0.0" - "@algolia/autocomplete-preset-algolia@1.5.2": version "1.5.2" resolved "https://registry.yarnpkg.com/@algolia/autocomplete-preset-algolia/-/autocomplete-preset-algolia-1.5.2.tgz#36c5638cc6dba6ea46a86e5a0314637ca40a77ca" @@ -33,28 +16,11 @@ dependencies: "@algolia/autocomplete-shared" "1.5.2" -"@algolia/autocomplete-preset-algolia@1.5.3": - version "1.5.3" - resolved "https://registry.yarnpkg.com/@algolia/autocomplete-preset-algolia/-/autocomplete-preset-algolia-1.5.3.tgz#3ad8a5fbcd76a15d9d75067ab0e07bc3a679fb35" - integrity sha512-FGf1G3HGhxUQj7N/D82DGmFQ+TgqDM5ZcowzNFzWs/PpHuK8Ng6UJiOnR0cj7ixQ3SAaide0UMNMIXHcECDOXg== - dependencies: - "@algolia/autocomplete-shared" "1.5.3" - "@algolia/autocomplete-shared@1.5.2": version "1.5.2" resolved "https://registry.yarnpkg.com/@algolia/autocomplete-shared/-/autocomplete-shared-1.5.2.tgz#e157f9ad624ab8fd940ff28bd2094cdf199cdd79" integrity sha512-ylQAYv5H0YKMfHgVWX0j0NmL8XBcAeeeVQUmppnnMtzDbDnca6CzhKj3Q8eF9cHCgcdTDdb5K+3aKyGWA0obug== -"@algolia/autocomplete-shared@1.5.3": - version "1.5.3" - resolved "https://registry.yarnpkg.com/@algolia/autocomplete-shared/-/autocomplete-shared-1.5.3.tgz#c4c926ea2896622fc9c5eb033f2bf29aad8f00b0" - integrity sha512-9eQqd9Zu+7SdAxv9H58clcUEKtiKDEW9KLE3sY2e0MlFbRgWV1UrtF1PbXOk/v1cDe+NS/GOXPqrWuf7traDpw== - -"@algolia/autocomplete-theme-classic@^1.5.1": - version "1.5.3" - resolved "https://registry.yarnpkg.com/@algolia/autocomplete-theme-classic/-/autocomplete-theme-classic-1.5.3.tgz#49eb69ebd886bbb8ed51368671622c60d639dbf0" - integrity sha512-nqDcsDl3QR79/dl5aU6f97+B4fE4hzTngv7yolnplOrKKa5KnWJ7e/SrWPQWIgbJ/5JTrbxWVXopB+7erDZm+g== - "@algolia/cache-browser-local-storage@4.13.0": version "4.13.0" resolved "https://registry.yarnpkg.com/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.13.0.tgz#f8aa4fe31104b19d616ea392f9ed5c2ea847d964" @@ -110,7 +76,7 @@ "@algolia/requester-common" "4.13.0" "@algolia/transporter" "4.13.0" -"@algolia/client-search@4.13.0", "@algolia/client-search@^4.12.0": +"@algolia/client-search@4.13.0": version "4.13.0" resolved "https://registry.yarnpkg.com/@algolia/client-search/-/client-search-4.13.0.tgz#2d8ff8e755c4a37ec89968f3f9b358eed005c7f0" integrity sha512-blgCKYbZh1NgJWzeGf+caKE32mo3j54NprOf0LZVCubQb3Kx37tk1Hc8SDs9bCAE8hUvf3cazMPIg7wscSxspA== @@ -1584,20 +1550,6 @@ human-id "^1.0.2" prettier "^1.19.1" -"@cmfcmf/docusaurus-search-local@^0.10.0": - version "0.10.0" - resolved "https://registry.yarnpkg.com/@cmfcmf/docusaurus-search-local/-/docusaurus-search-local-0.10.0.tgz#0a77847641ec490f4663666e5eee07416f5a0c63" - integrity sha512-X6xabJvvbbgrqgkYUUHSER5kswonKRZatNDJmZTsNiCxFKCephbDL1Kui6QLN6jmorPNWSupj7aMSP3HObHnUg== - dependencies: - "@algolia/autocomplete-js" "^1.5.1" - "@algolia/autocomplete-theme-classic" "^1.5.1" - "@algolia/client-search" "^4.12.0" - algoliasearch "^4.12.0" - cheerio "^1.0.0-rc.9" - clsx "^1.1.1" - lunr-languages "^1.4.0" - mark.js "^8.11.1" - "@cnakazawa/watch@^1.0.3": version "1.0.4" resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.4.tgz#f864ae85004d0fcab6f50be9141c4da368d1656a" @@ -4066,7 +4018,7 @@ algoliasearch-helper@^3.7.4: dependencies: "@algolia/events" "^4.0.1" -algoliasearch@^4.0.0, algoliasearch@^4.12.0, algoliasearch@^4.13.0: +algoliasearch@^4.0.0, algoliasearch@^4.13.0: version "4.13.0" resolved "https://registry.yarnpkg.com/algoliasearch/-/algoliasearch-4.13.0.tgz#e36611fda82b1fc548c156ae7929a7f486e4b663" integrity sha512-oHv4faI1Vl2s+YC0YquwkK/TsaJs79g2JFg5FDm2rKN12VItPTAeQ7hyJMHarOPPYuCnNC5kixbtcqvb21wchw== @@ -5134,7 +5086,7 @@ cheerio@^0.22.0: lodash.reject "^4.4.0" lodash.some "^4.4.0" -cheerio@^1.0.0-rc.10, cheerio@^1.0.0-rc.9: +cheerio@^1.0.0-rc.10: version "1.0.0-rc.10" resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-1.0.0-rc.10.tgz#2ba3dcdfcc26e7956fc1f440e61d51c643379f3e" integrity sha512-g0J0q/O6mW8z5zxQ3A8E8J1hUgp4SMOvEoW/x84OwyHKe/Zccz83PVT4y5Crcr530FV6NgmKI1qvGTKVl9XXVw== @@ -9892,11 +9844,6 @@ lru-cache@^6.0.0: dependencies: yallist "^4.0.0" -lunr-languages@^1.4.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/lunr-languages/-/lunr-languages-1.9.0.tgz#7105230807788a112a69910561b7bbd055a0e588" - integrity sha512-Be5vFuc8NAheOIjviCRms3ZqFFBlzns3u9DXpPSZvALetgnydAN0poV71pVLFn0keYy/s4VblMMkqewTLe+KPg== - magic-string@^0.25.7: version "0.25.7" resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.7.tgz#3f497d6fd34c669c6798dcb821f2ef31f5445051" @@ -9987,11 +9934,6 @@ map-obj@^4.0.0: resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-4.3.0.tgz#9304f906e93faae70880da102a9f1df0ea8bb05a" integrity sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ== -mark.js@^8.11.1: - version "8.11.1" - resolved "https://registry.yarnpkg.com/mark.js/-/mark.js-8.11.1.tgz#180f1f9ebef8b0e638e4166ad52db879beb2ffc5" - integrity sha1-GA8fnr74sOY45BZq1S24eb6y/8U= - markdown-escapes@^1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/markdown-escapes/-/markdown-escapes-1.0.4.tgz#c95415ef451499d7602b91095f3c8e8975f78535" @@ -11874,11 +11816,6 @@ postcss@^8.1.10, postcss@^8.3.11, postcss@^8.3.5, postcss@^8.4.12, postcss@^8.4. picocolors "^1.0.0" source-map-js "^1.0.2" -preact@^10.0.0: - version "10.6.6" - resolved "https://registry.yarnpkg.com/preact/-/preact-10.6.6.tgz#f1899bc8dab7c0788b858481532cb3b5d764a520" - integrity sha512-dgxpTFV2vs4vizwKohYKkk7g7rmp1wOOcfd4Tz3IB3Wi+ivZzsn/SpeKJhRENSE+n8sUfsAl4S3HiCVT923ABw== - preferred-pm@^3.0.0: version "3.0.3" resolved "https://registry.yarnpkg.com/preferred-pm/-/preferred-pm-3.0.3.tgz#1b6338000371e3edbce52ef2e4f65eb2e73586d6"