From e3e76140abb264f625efc73b4c8668f8c0163028 Mon Sep 17 00:00:00 2001 From: s-pace Date: Tue, 18 Aug 2020 15:45:06 +0200 Subject: [PATCH 01/18] deps: upgrade to docsearch v3 --- package.json | 2 +- yarn.lock | 287 ++++++++++++++++++++++++++++----------------------- 2 files changed, 156 insertions(+), 133 deletions(-) diff --git a/package.json b/package.json index 83099094..690e0181 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "version": "0.1.0", "author": "Kyle Mathews ", "dependencies": { + "@docsearch/react": "^1.0.0-alpha.27", "@emotion/core": "^10.0.22", "@emotion/styled": "^10.0.23", "@mdx-js/mdx": "^1.5.2", @@ -12,7 +13,6 @@ "@openfonts/luckiest-guy_latin": "^1.44.1", "@pauliescanlon/gatsby-mdx-routes": "^0.0.4", "@popperjs/core": "^2.2.2", - "docsearch.js": "^2.6.3", "emotion": "^10.0.27", "gatsby": "^2.18.13", "gatsby-dynamical-navigation": "^0.4.1", diff --git a/yarn.lock b/yarn.lock index 03bc8640..cf93cb5f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,110 @@ # yarn lockfile v1 +"@algolia/cache-browser-local-storage@4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@algolia/cache-browser-local-storage/-/cache-browser-local-storage-4.4.0.tgz#f58055bdf798d7b31b6d5f86e465cb0fc7dd6694" + integrity sha512-2AiKgN7DpFypkRCRkpqH7waXXyFdcnsPWzmN8sLHrB/FfXqgmsQb3pGft+9YHZIDQ0vAnfgMxSGgMhMGW+0Qnw== + dependencies: + "@algolia/cache-common" "4.4.0" + +"@algolia/cache-common@4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@algolia/cache-common/-/cache-common-4.4.0.tgz#bfe84790230f5d2de495238b29e9397c5ed2b26e" + integrity sha512-PrIgoMnXaDWUfwOekahro543pgcJfgRu/nd/ZQS5ffem3+Ow725eZY6HDpPaQ1k3cvLii9JH6V2sNJConjqUKA== + +"@algolia/cache-in-memory@4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@algolia/cache-in-memory/-/cache-in-memory-4.4.0.tgz#54a089094c2afa5b9cacab4b60a5f1ba29013a7c" + integrity sha512-9+XlUB0baDU/Dp9URRHPp6Q37YmTO0QmgPWt9+n+wqZrRL0jR3Jezr4jCT7RemqGMxBiR+YpnqaUv0orpb0ptw== + dependencies: + "@algolia/cache-common" "4.4.0" + +"@algolia/client-account@4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@algolia/client-account/-/client-account-4.4.0.tgz#7dbeff83e1c85d853b3ad224674a924e02b94d1b" + integrity sha512-Kynu3cMEs0clTLf674rtrCF+FWR/JwlQxKlIWsPzvLBRmNXdvYej9YBcNaOr4OTQFCCZn9JVE8ib91Z7J4IL1Q== + dependencies: + "@algolia/client-common" "4.4.0" + "@algolia/client-search" "4.4.0" + "@algolia/transporter" "4.4.0" + +"@algolia/client-analytics@4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@algolia/client-analytics/-/client-analytics-4.4.0.tgz#50dde68b067c615fc91434c98db9b5ca429be33d" + integrity sha512-GQyjQimKAc9sZbafxln9Wk7j4pEYiORv28MZkZ+0Bjt7WNXIeO7OgOOECVpQHm9buyV6hCKpNtJcbb5/syRzdQ== + dependencies: + "@algolia/client-common" "4.4.0" + "@algolia/client-search" "4.4.0" + "@algolia/requester-common" "4.4.0" + "@algolia/transporter" "4.4.0" + +"@algolia/client-common@4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@algolia/client-common/-/client-common-4.4.0.tgz#b9fa987bc7a148f9756da59ada51fe2494a4aa9a" + integrity sha512-a3yr6UhzjWPHDG/8iGp9UvrDOm1aeHVWJIf0Nj/cIvqX5tNCEIo4IMe59ovApkDgLOIpt/cLsyhn9/FiPXRhJA== + dependencies: + "@algolia/requester-common" "4.4.0" + "@algolia/transporter" "4.4.0" + +"@algolia/client-recommendation@4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@algolia/client-recommendation/-/client-recommendation-4.4.0.tgz#82410f7a346ed8518b8dcd28bc47571e850ab74f" + integrity sha512-sBszbQH46rko6w2fdEG77ma8+fAg0SDkLZGxWhv4trgcnYGUBFl2dcpEPt/6koto9b4XYlf+eh+qi6iGvYqRPg== + dependencies: + "@algolia/client-common" "4.4.0" + "@algolia/requester-common" "4.4.0" + "@algolia/transporter" "4.4.0" + +"@algolia/client-search@4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@algolia/client-search/-/client-search-4.4.0.tgz#c1e107206f3ae719cd3a9877889eea5e5cbcdc62" + integrity sha512-jqWcxCUyPPHnHreoMb2PnN9iHTP+V/nL62R84XuTRDE3VgTnhm4ZnqyuRdzZQqaz+gNy5znav64TmQ9FN9WW5g== + dependencies: + "@algolia/client-common" "4.4.0" + "@algolia/requester-common" "4.4.0" + "@algolia/transporter" "4.4.0" + +"@algolia/logger-common@4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@algolia/logger-common/-/logger-common-4.4.0.tgz#8115d95d5f6227f0127d33130a9c4622cde64f6f" + integrity sha512-2vjmSENLaKNuF+ytRDysfWxxgFG95WXCHwHbueThdPMCK3hskkwqJ0Y/pugKfzl+54mZxegb4BYfgcCeuaHVUw== + +"@algolia/logger-console@4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@algolia/logger-console/-/logger-console-4.4.0.tgz#1e0eaaf0879f152f9a1fa333c4cd8cb55e071552" + integrity sha512-st/GUWyKvr6YM72OOfF+RmpdVGda3BPXbQ+chpntUq1WyVkyZXGjSmH1IcBVlua27GzxabwOUYON39cF3x10/g== + dependencies: + "@algolia/logger-common" "4.4.0" + +"@algolia/requester-browser-xhr@4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@algolia/requester-browser-xhr/-/requester-browser-xhr-4.4.0.tgz#f5877397ed92d2d64d08846ea969aeb559a5efb6" + integrity sha512-V3a4hXlNch355GnWaT1f5QfXhROpsjT6sd0Znq29gAhwLqfBExhLW6Khdkv5pENC0Qy7ClVhdXFrBL9QCQer1g== + dependencies: + "@algolia/requester-common" "4.4.0" + +"@algolia/requester-common@4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@algolia/requester-common/-/requester-common-4.4.0.tgz#0e977939aae32ff81a6d27480a71771a65db6051" + integrity sha512-jPinHlFJEFokxQ5b3JWyjQKKn+FMy0hH99PApzOgQAYOSiFRXiPEZp6LeIexDeLLu7Y3eRt/3nHvjPKa6PmRRw== + +"@algolia/requester-node-http@4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@algolia/requester-node-http/-/requester-node-http-4.4.0.tgz#6ffba93d54eeadf64cb1be67fae5c4e3f7c8f390" + integrity sha512-b7HC9C/GHxiV4+0GpCRTtjscvwarPr3dGm4CAhb6AkNjgjRcFUNr1NfsF75w3WVmzmt79/7QZihddztDdVMGjw== + dependencies: + "@algolia/requester-common" "4.4.0" + +"@algolia/transporter@4.4.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@algolia/transporter/-/transporter-4.4.0.tgz#6ec79aac43bc515c8e4f6d6e27dc8d8cd7112f7e" + integrity sha512-Xxzq91DEEeKIzT3DU46n4LEyTGAKZNtSHc2H9wvIY5MYwhZwEribmXXZ6k8W1FvBvzggv3juu0SP+xwGoR7F0w== + dependencies: + "@algolia/cache-common" "4.4.0" + "@algolia/logger-common" "4.4.0" + "@algolia/requester-common" "4.4.0" + "@babel/code-frame@7.5.5": version "7.5.5" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.5.5.tgz#bc0782f6d69f7b7d49531219699b988f669a8f9d" @@ -879,6 +983,21 @@ lodash "^4.17.13" to-fast-properties "^2.0.0" +"@docsearch/css@^1.0.0-alpha.27": + version "1.0.0-alpha.27" + resolved "https://registry.yarnpkg.com/@docsearch/css/-/css-1.0.0-alpha.27.tgz#7f50985869ebab10ffb901b94ed7545269a3393c" + integrity sha512-Kw6R/gAHMZW2tKZO2a0gd3I8Yf6bJgTk3Dp+L0ZFrvEHEh8v3yQKvoxVify3ML9YVyvCxxAPQQuF9u3JNUwvXw== + +"@docsearch/react@^1.0.0-alpha.27": + version "1.0.0-alpha.27" + resolved "https://registry.yarnpkg.com/@docsearch/react/-/react-1.0.0-alpha.27.tgz#eae61d648ddc3667c5dee82c4cd9d47bf35a3c85" + integrity sha512-jcgUHZsrNNRsaVsplqKhXWheh4VzRTCdhsPuVhJMRvfsFUqXEPo/7kVt5xIybtOj9u+/FVdeSO+APJEE2rakYA== + dependencies: + "@docsearch/css" "^1.0.0-alpha.27" + "@francoischalifour/autocomplete-core" "^1.0.0-alpha.27" + "@francoischalifour/autocomplete-preset-algolia" "^1.0.0-alpha.27" + algoliasearch "^4.0.0" + "@emotion/babel-plugin-jsx-pragmatic@^0.1.5": version "0.1.5" resolved "https://registry.yarnpkg.com/@emotion/babel-plugin-jsx-pragmatic/-/babel-plugin-jsx-pragmatic-0.1.5.tgz#27debfe9c27c4d83574d509787ae553bf8a34d7e" @@ -998,6 +1117,16 @@ resolved "https://registry.yarnpkg.com/@emotion/weak-memoize/-/weak-memoize-0.2.5.tgz#8eed982e2ee6f7f4e44c253e12962980791efd46" integrity sha512-6U71C2Wp7r5XtFtQzYrW5iKFT67OixrSxjI4MptCHzdSVlgabczzqLe0ZSgnub/5Kp4hSbpDB1tMytZY9pwxxA== +"@francoischalifour/autocomplete-core@^1.0.0-alpha.27": + version "1.0.0-alpha.27" + resolved "https://registry.yarnpkg.com/@francoischalifour/autocomplete-core/-/autocomplete-core-1.0.0-alpha.27.tgz#bd85058bf0ef02e9f9a57c7973c705edc2a25c41" + integrity sha512-kpKbtrjMt9l1HIFFmmH0u88633/1oBD+mEjKg1EIRJ1zQCeOBxlQvIXZ3X6GEoud79QjLVoc8HD4HN1OMRt+OA== + +"@francoischalifour/autocomplete-preset-algolia@^1.0.0-alpha.27": + version "1.0.0-alpha.27" + resolved "https://registry.yarnpkg.com/@francoischalifour/autocomplete-preset-algolia/-/autocomplete-preset-algolia-1.0.0-alpha.27.tgz#29de9939274887363f6e3f41078b2ee3e9c56493" + integrity sha512-Mp4lhlLd8vuLOCXtuw8UTUaJXGRrXYL7AN/ZmhaMwqyL9e9XSqLlcv82EWP0NAMcoz/I1E1C709h4jnbnN4llw== + "@hapi/address@2.x.x": version "2.1.4" resolved "https://registry.yarnpkg.com/@hapi/address/-/address-2.1.4.tgz#5d67ed43f3fd41a69d4b9ff7b56e7c0d1d0a81e5" @@ -1907,11 +2036,6 @@ resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ== -abbrev@1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" - integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== - accepts@^1.3.7, accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.7: version "1.3.7" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" @@ -1955,11 +2079,6 @@ after@0.8.2: resolved "https://registry.yarnpkg.com/after/-/after-0.8.2.tgz#fedb394f9f0e02aa9768e702bda23b505fae7e1f" integrity sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8= -agentkeepalive@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-2.2.0.tgz#c5d1bd4b129008f1163f236f86e5faea2026e2ef" - integrity sha1-xdG9SxKQCPEWPyNvhuX66iAm4u8= - aggregate-error@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.0.1.tgz#db2fe7246e536f40d9b5442a39e117d7dd6a24e0" @@ -1988,26 +2107,25 @@ ajv@^6.1.0, ajv@^6.10.0, ajv@^6.10.2, ajv@^6.12.0, ajv@^6.5.5: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -algoliasearch@^3.24.5: - version "3.35.1" - resolved "https://registry.yarnpkg.com/algoliasearch/-/algoliasearch-3.35.1.tgz#297d15f534a3507cab2f5dfb996019cac7568f0c" - integrity sha512-K4yKVhaHkXfJ/xcUnil04xiSrB8B8yHZoFEhWNpXg23eiCnqvTZw1tn/SqvdsANlYHLJlKl0qi3I/Q2Sqo7LwQ== - dependencies: - agentkeepalive "^2.2.0" - debug "^2.6.9" - envify "^4.0.0" - es6-promise "^4.1.0" - events "^1.1.0" - foreach "^2.0.5" - global "^4.3.2" - inherits "^2.0.1" - isarray "^2.0.1" - load-script "^1.0.0" - object-keys "^1.0.11" - querystring-es3 "^0.2.1" - reduce "^1.0.1" - semver "^5.1.0" - tunnel-agent "^0.6.0" +algoliasearch@^4.0.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/algoliasearch/-/algoliasearch-4.4.0.tgz#25c356d8bdcf7e3f941633f61e1ac111ddcba404" + integrity sha512-Ag3wxe/nSodNl/1KbHibtkh7TNLptKE300/wnGVtszRjXivaWD6333nUpCumrYObHym/fHMHyLcmQYezXbAIWQ== + dependencies: + "@algolia/cache-browser-local-storage" "4.4.0" + "@algolia/cache-common" "4.4.0" + "@algolia/cache-in-memory" "4.4.0" + "@algolia/client-account" "4.4.0" + "@algolia/client-analytics" "4.4.0" + "@algolia/client-common" "4.4.0" + "@algolia/client-recommendation" "4.4.0" + "@algolia/client-search" "4.4.0" + "@algolia/logger-common" "4.4.0" + "@algolia/logger-console" "4.4.0" + "@algolia/requester-browser-xhr" "4.4.0" + "@algolia/requester-common" "4.4.0" + "@algolia/requester-node-http" "4.4.0" + "@algolia/transporter" "4.4.0" alphanum-sort@^1.0.0: version "1.0.2" @@ -2349,13 +2467,6 @@ auto-bind@^4.0.0: resolved "https://registry.yarnpkg.com/auto-bind/-/auto-bind-4.0.0.tgz#e3589fc6c2da8f7ca43ba9f84fa52a744fc997fb" integrity sha512-Hdw8qdNiqdJ8LqT0iK0sVzkFbzg6fhnQqqfWhBDxcHZvU75+B+ayzTy8x+k5Ix0Y92XOhOUlx74ps+bA6BeYMQ== -autocomplete.js@0.36.0: - version "0.36.0" - resolved "https://registry.yarnpkg.com/autocomplete.js/-/autocomplete.js-0.36.0.tgz#94fe775fe64b6cd42e622d076dc7fd26bedd837b" - integrity sha512-jEwUXnVMeCHHutUt10i/8ZiRaCb0Wo+ZyKxeGsYwBDtw6EJHqEeDrq4UwZRD8YBSvp3g6klP678il2eeiVXN2Q== - dependencies: - immediate "^3.2.3" - autoprefixer@^9.7.4: version "9.7.6" resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-9.7.6.tgz#63ac5bbc0ce7934e6997207d5bb00d68fa8293a4" @@ -4562,19 +4673,6 @@ dns-txt@^2.0.2: dependencies: buffer-indexof "^1.0.0" -docsearch.js@^2.6.3: - version "2.6.3" - resolved "https://registry.yarnpkg.com/docsearch.js/-/docsearch.js-2.6.3.tgz#57cb4600d3b6553c677e7cbbe6a734593e38625d" - integrity sha512-GN+MBozuyz664ycpZY0ecdQE0ND/LSgJKhTLA0/v3arIS3S1Rpf2OJz6A35ReMsm91V5apcmzr5/kM84cvUg+A== - dependencies: - algoliasearch "^3.24.5" - autocomplete.js "0.36.0" - hogan.js "^3.0.2" - request "^2.87.0" - stack-utils "^1.0.1" - to-factory "^1.0.0" - zepto "^1.2.0" - doctrine@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" @@ -4891,14 +4989,6 @@ entities@^2.0.0: resolved "https://registry.yarnpkg.com/entities/-/entities-2.0.0.tgz#68d6084cab1b079767540d80e56a39b423e4abf4" integrity sha512-D9f7V0JSRwIxlRI2mjMqufDrRDnx8p+eEOz7aUM9SuvF8gsBzra0/6tbjl1m8eQHrZlYj6PxqE00hZ1SAIKPLw== -envify@^4.0.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/envify/-/envify-4.1.0.tgz#f39ad3db9d6801b4e6b478b61028d3f0b6819f7e" - integrity sha512-IKRVVoAYr4pIx4yIWNsz9mOsboxlNXiu7TNBnem/K/uTHdkyzXWDzHCK7UTolqBbgaBz0tQHsD3YNls0uIIjiw== - dependencies: - esprima "^4.0.0" - through "~2.3.4" - envinfo@^7.5.0: version "7.5.0" resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.5.0.tgz#91410bb6db262fb4f1409bd506e9ff57e91023f4" @@ -4956,11 +5046,6 @@ es-to-primitive@^1.2.1: is-date-object "^1.0.1" is-symbol "^1.0.2" -es6-promise@^4.1.0: - version "4.2.8" - resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" - integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w== - es6-promisify@^6.0.0: version "6.1.0" resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-6.1.0.tgz#32e3e7e796f924a6723f09ded24e71100ea57472" @@ -5234,11 +5319,6 @@ eventemitter3@^4.0.0: resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.0.tgz#d65176163887ee59f386d64c82610b696a4a74eb" integrity sha512-qerSRB0p+UDEssxTtm6EDKcE7W4OaoisfIMl4CngyEhjpYglocpNg6UEqCvemdGhosAsg4sO2dXJOdyBifPGCg== -events@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/events/-/events-1.1.1.tgz#9ebdb7635ad099c70dcc4c2a1f5004288e8bd924" - integrity sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ= - events@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/events/-/events-3.1.0.tgz#84279af1b34cb75aa88bf5ff291f6d0bd9b31a59" @@ -5867,11 +5947,6 @@ for-in@^1.0.2: resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= -foreach@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" - integrity sha1-C+4AUBiusmDQo6865ljdATbsG5k= - forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" @@ -6806,7 +6881,7 @@ global-prefix@^3.0.0: kind-of "^6.0.2" which "^1.3.1" -global@^4.3.0, global@^4.3.2: +global@^4.3.0: version "4.4.0" resolved "https://registry.yarnpkg.com/global/-/global-4.4.0.tgz#3e7b105179006a323ed71aafca3e9c57a5cc6406" integrity sha512-wv/LAoHdRE3BeTGz53FAamhGlPLhlssK45usmGFThIi4XqnBmjKQ16u+RNbP7WvigRZDxUsM0J3gcQ5yicaL0w== @@ -7270,14 +7345,6 @@ hmac-drbg@^1.0.0: minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.1" -hogan.js@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/hogan.js/-/hogan.js-3.0.2.tgz#4cd9e1abd4294146e7679e41d7898732b02c7bfd" - integrity sha1-TNnhq9QpQUbnZ55B14mHMrAse/0= - dependencies: - mkdirp "0.3.0" - nopt "1.0.10" - hoist-non-react-statics@^3.3.0: version "3.3.2" resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45" @@ -7548,11 +7615,6 @@ imagemin@^6.1.0: pify "^4.0.1" replace-ext "^1.0.0" -immediate@^3.2.3: - version "3.2.3" - resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.2.3.tgz#d140fa8f614659bd6541233097ddaac25cdd991c" - integrity sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw= - immer@1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/immer/-/immer-1.10.0.tgz#bad67605ba9c810275d91e1c2a47d4582e98286d" @@ -8410,11 +8472,6 @@ isarray@2.0.1: resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.1.tgz#a37d94ed9cda2d59865c9f76fe596ee1f338741e" integrity sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4= -isarray@^2.0.1: - version "2.0.5" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" - integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== - isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" @@ -8744,11 +8801,6 @@ load-json-file@^2.0.0: pify "^2.0.0" strip-bom "^3.0.0" -load-script@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/load-script/-/load-script-1.0.0.tgz#0491939e0bee5643ee494a7e3da3d2bac70c6ca4" - integrity sha1-BJGTngvuVkPuSUp+PaPSuscMbKQ= - loader-fs-cache@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/loader-fs-cache/-/loader-fs-cache-1.0.3.tgz#f08657646d607078be2f0a032f8bd69dd6f277d9" @@ -9503,11 +9555,6 @@ mkdirp-classic@^0.5.2: resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.2.tgz#54c441ce4c96cd7790e10b41a87aa51068ecab2b" integrity sha512-ejdnDQcR75gwknmMw/tx02AuRs8jCtqFoFqDZMjiNxsu85sRIJVXDKHuLYvUUPRBUtV2FpSZa9bL1BUa3BdR2g== -mkdirp@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.3.0.tgz#1bbf5ab1ba827af23575143490426455f481fe1e" - integrity sha1-G79asbqCevI1dRQ0kEJkVfSB/h4= - mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@~0.5.1: version "0.5.5" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" @@ -9754,13 +9801,6 @@ noop-logger@^0.1.1: resolved "https://registry.yarnpkg.com/noop-logger/-/noop-logger-0.1.1.tgz#94a2b1633c4f1317553007d8966fd0e841b6a4c2" integrity sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI= -nopt@1.0.10: - version "1.0.10" - resolved "https://registry.yarnpkg.com/nopt/-/nopt-1.0.10.tgz#6ddd21bd2a31417b92727dd585f8a6f37608ebee" - integrity sha1-bd0hvSoxQXuScn3Vhfim83YI6+4= - dependencies: - abbrev "1" - normalize-package-data@^2.3.2, normalize-package-data@^2.3.4: version "2.5.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" @@ -9921,7 +9961,7 @@ object-is@^1.0.1: define-properties "^1.1.3" es-abstract "^1.17.5" -object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.1.0, object-keys@^1.1.1: +object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== @@ -11382,7 +11422,7 @@ query-string@^6.11.1: split-on-first "^1.0.0" strict-uri-encode "^2.0.0" -querystring-es3@^0.2.0, querystring-es3@^0.2.1: +querystring-es3@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" integrity sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM= @@ -11723,13 +11763,6 @@ redent@^1.0.0: indent-string "^2.1.0" strip-indent "^1.0.1" -reduce@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/reduce/-/reduce-1.0.2.tgz#0cd680ad3ffe0b060e57a5c68bdfce37168d361b" - integrity sha512-xX7Fxke/oHO5IfZSk77lvPa/7bjMh9BuCk4OOoX5XTXrM7s0Z+MkPfSDfz0q7r91BhhGSs8gii/VEN/7zhCPpQ== - dependencies: - object-keys "^1.1.0" - redux-thunk@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.3.0.tgz#51c2c19a185ed5187aaa9a2d08b666d0d6467622" @@ -12000,7 +12033,7 @@ replace-ext@1.0.0, replace-ext@^1.0.0: resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.0.tgz#de63128373fcbf7c3ccfa4de5a480c45a67958eb" integrity sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs= -request@^2.83.0, request@^2.87.0: +request@^2.83.0: version "2.88.2" resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3" integrity sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw== @@ -12338,7 +12371,7 @@ semver-truncate@^1.1.2: dependencies: semver "^5.3.0" -"semver@2 || 3 || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.1: +"semver@2 || 3 || 4 || 5", semver@^5.0.3, semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.5.1, semver@^5.6.0, semver@^5.7.1: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== @@ -12928,7 +12961,7 @@ stack-trace@^0.0.10: resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0" integrity sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA= -stack-utils@1.0.2, stack-utils@^1.0.1: +stack-utils@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.2.tgz#33eba3897788558bebfc2db059dc158ec36cebb8" integrity sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA== @@ -13518,7 +13551,7 @@ through2@^2.0.0, through2@^2.0.1: readable-stream "~2.3.6" xtend "~4.0.1" -through@^2.3.6, through@^2.3.8, through@~2.3.4: +through@^2.3.6, through@^2.3.8: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= @@ -13590,11 +13623,6 @@ to-buffer@^1.1.1: resolved "https://registry.yarnpkg.com/to-buffer/-/to-buffer-1.1.1.tgz#493bd48f62d7c43fcded313a03dcadb2e1213a80" integrity sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg== -to-factory@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/to-factory/-/to-factory-1.0.0.tgz#8738af8bd97120ad1d4047972ada5563bf9479b1" - integrity sha1-hzivi9lxIK0dQEeXKtpVY7+UebE= - to-fast-properties@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" @@ -14980,11 +15008,6 @@ yurnalist@^1.1.2: strip-ansi "^5.2.0" strip-bom "^4.0.0" -zepto@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/zepto/-/zepto-1.2.0.tgz#e127bd9e66fd846be5eab48c1394882f7c0e4f98" - integrity sha1-4Se9nmb9hGvl6rSME5SIL3wOT5g= - zwitch@^1.0.0: version "1.0.5" resolved "https://registry.yarnpkg.com/zwitch/-/zwitch-1.0.5.tgz#d11d7381ffed16b742f6af7b3f223d5cd9fe9920" From 4e12083ef582db49f54b54497709c27ee0d9127f Mon Sep 17 00:00:00 2001 From: s-pace Date: Mon, 24 Aug 2020 15:44:06 +0200 Subject: [PATCH 02/18] feat: integrate DocSearch v3 --- src/components/Docsearch.js | 155 ++++++++++++++++++++--------------- src/components/Navigation.js | 4 +- src/components/Search.js | 97 ++++++++++++++++++++++ 3 files changed, 186 insertions(+), 70 deletions(-) create mode 100644 src/components/Search.js diff --git a/src/components/Docsearch.js b/src/components/Docsearch.js index edabbf92..9ec3b40b 100644 --- a/src/components/Docsearch.js +++ b/src/components/Docsearch.js @@ -1,77 +1,96 @@ -import React, { useEffect } from 'react'; -import styled from '@emotion/styled'; -import { css } from '@emotion/core'; -import 'docsearch.js/dist/cdn/docsearch.css'; -import { media } from './Framework'; +import React, { Fragment } from 'react'; +import { Global, css } from '@emotion/core'; +import { DocSearch } from '@docsearch/react'; -const canUseDOM = !!( - typeof window !== 'undefined' && - window.document && - window.document.createElement -); - -const DocsearchContainer = styled.div` - padding-bottom: 10px; - display: none; - transition: box-shadow 0.4s ease-out; - flex-direction: column; - align-items: stretch; - padding: 10px; - - ${props => - props.scrolled && - css` - box-shadow: 0 10px 15px -4px rgba(100, 0, 0, 0.3); - `} - - ${media.lg} { - display: flex; - } +const DocSearch = () => { + return ( + + { - useEffect(() => { - if (canUseDOM) { - import('docsearch.js').then( - docsearch => - document.querySelector('.algolia-autocomplete') == null && - docsearch.default({ - apiKey: 'd5fa05c4e33e776fbf2b8021cbc15b37', - indexName: 'popper', - inputSelector: `.docsearch-input-${name}`, - algoliaOptions: { facetFilters: ['tags:v2'] }, - }) - ); - } - }, [name]); + @media (max-width: 750px) { + .DocSearch-Button-KeySeparator, + .DocSearch-Button-Key { + display: flex; + } - return ( - - + - + ); }; + +export default DocSearch; diff --git a/src/components/Navigation.js b/src/components/Navigation.js index ea511acc..5a6f8078 100644 --- a/src/components/Navigation.js +++ b/src/components/Navigation.js @@ -6,7 +6,7 @@ import { MdxRoutes } from '@pauliescanlon/gatsby-mdx-routes'; import { createTree } from '../utils/createTree'; import processRoutes from '../utils/processRoutes'; import { media } from './Framework'; -import Docsearch from './Docsearch'; +import Search from './Search'; import popperText from '../images/popper-text.svg'; import { Menu } from 'react-feather'; @@ -251,7 +251,7 @@ export default function Navigation({ description, lang, meta, path }) { Close Menu - + {createTree(processRoutes(routes, path)).map((route, index) => ( diff --git a/src/components/Search.js b/src/components/Search.js new file mode 100644 index 00000000..abdcc850 --- /dev/null +++ b/src/components/Search.js @@ -0,0 +1,97 @@ +import React, { Fragment } from 'react'; +import { Global, css } from '@emotion/core'; +import { DocSearch } from '@docsearch/react'; +import '@docsearch/react/style'; + +const Search = () => { + return ( + + + + + ); +}; + +export default Search; From 1edb1aadf8bd8c7e4d2599c03e565dc9368e3011 Mon Sep 17 00:00:00 2001 From: s-pace Date: Mon, 24 Aug 2020 16:56:18 +0200 Subject: [PATCH 03/18] refactor: remove unused import --- gatsby-browser.js | 1 + src/components/Docsearch.js | 2 +- src/components/Search.js | 60 +++++++++++++++++++++---------------- 3 files changed, 36 insertions(+), 27 deletions(-) create mode 100644 gatsby-browser.js diff --git a/gatsby-browser.js b/gatsby-browser.js new file mode 100644 index 00000000..3825b36c --- /dev/null +++ b/gatsby-browser.js @@ -0,0 +1 @@ +import('@docsearch/react/style'); diff --git a/src/components/Docsearch.js b/src/components/Docsearch.js index 9ec3b40b..4814f278 100644 --- a/src/components/Docsearch.js +++ b/src/components/Docsearch.js @@ -1,4 +1,4 @@ -import React, { Fragment } from 'react'; +import { Fragment } from 'react'; import { Global, css } from '@emotion/core'; import { DocSearch } from '@docsearch/react'; diff --git a/src/components/Search.js b/src/components/Search.js index abdcc850..16b7ab9e 100644 --- a/src/components/Search.js +++ b/src/components/Search.js @@ -1,18 +1,21 @@ -import React, { Fragment } from 'react'; +import React, { Fragment, useState, useEffect } from 'react'; import { Global, css } from '@emotion/core'; import { DocSearch } from '@docsearch/react'; -import '@docsearch/react/style'; const Search = () => { + const [facetFilters, setFaceFilters] = useState([]); + + useEffect(() => { + setFaceFilters([ + `tags:${window.location.pathname.includes('v1') ? 'v1' : 'v2'}`, + ]); + }); + return ( { --docsearch-logo-color: rgb(255, 255, 255); --docsearch-muted-color: rgb(127, 132, 151); - .DocSearch-Button { - margin: 10px 10px; - height: 39px; - } - - .DocSearch-Button-Placeholder { - width: 100%; - text-align: left; - } .DocSearch-Button { --docsearch-searchbox-background: rgb(235, 237, 240); --docsearch-searchbox-focus-background: #fff; @@ -67,16 +61,32 @@ const Search = () => { --docsearch-key-shadow: inset 0 -2px 0 0 rgb(205, 205, 230), inset 0 0 1px 1px #fff, 0 1px 2px 1px rgba(30, 35, 90, 0.4); } + } - @media (max-width: 750px) { - .DocSearch-Button-KeySeparator, - .DocSearch-Button-Key { - display: flex; - } + .DocSearch-Button { + margin: 10px 10px; + height: 39px; + } + + .DocSearch-Button-Placeholder { + width: 100%; + text-align: left; + } - .DocSearch-Button-Placeholder { - display: flex; - } + .DocSearch-Modal { + a { + border-bottom-style: none; + } + } + + @media (max-width: 750px) { + .DocSearch-Button-KeySeparator, + .DocSearch-Button-Key { + display: flex; + } + + .DocSearch-Button-Placeholder { + display: flex; } } `} @@ -85,9 +95,7 @@ const Search = () => { apiKey="d5fa05c4e33e776fbf2b8021cbc15b37" indexName="popper" searchParameters={{ - facetFilters: [ - `tags:${document.location.pathname.includes('v1') ? 'v1' : 'v2'}`, - ], + facetFilters, }} /> From 9b9442d249a7c0337c5b68f0cd4f364207231015 Mon Sep 17 00:00:00 2001 From: s-pace Date: Mon, 24 Aug 2020 17:46:35 +0200 Subject: [PATCH 04/18] refactor: remove shadowing component --- src/components/Docsearch.js | 96 ------------------------------------- 1 file changed, 96 deletions(-) delete mode 100644 src/components/Docsearch.js diff --git a/src/components/Docsearch.js b/src/components/Docsearch.js deleted file mode 100644 index 4814f278..00000000 --- a/src/components/Docsearch.js +++ /dev/null @@ -1,96 +0,0 @@ -import { Fragment } from 'react'; -import { Global, css } from '@emotion/core'; -import { DocSearch } from '@docsearch/react'; - -const DocSearch = () => { - return ( - - - - - ); -}; - -export default DocSearch; From 4337ff61467e1a1acf3054b5d38626a309075c41 Mon Sep 17 00:00:00 2001 From: s-pace Date: Mon, 24 Aug 2020 18:29:58 +0200 Subject: [PATCH 05/18] refactor: removing filtering on version --- src/components/Search.js | 160 ++++++++++++++++++--------------------- 1 file changed, 72 insertions(+), 88 deletions(-) diff --git a/src/components/Search.js b/src/components/Search.js index 16b7ab9e..cf5b6cdf 100644 --- a/src/components/Search.js +++ b/src/components/Search.js @@ -2,104 +2,88 @@ import React, { Fragment, useState, useEffect } from 'react'; import { Global, css } from '@emotion/core'; import { DocSearch } from '@docsearch/react'; -const Search = () => { - const [facetFilters, setFaceFilters] = useState([]); +const Search = () => ( + + { - setFaceFilters([ - `tags:${window.location.pathname.includes('v1') ? 'v1' : 'v2'}`, - ]); - }); - - return ( - - - - - ); -}; + } + `} + /> + + +); export default Search; From af4f0b677187f2d549939906322556a928aee363 Mon Sep 17 00:00:00 2001 From: Sylvain Pace Date: Tue, 25 Aug 2020 09:52:09 +0200 Subject: [PATCH 06/18] Update src/components/Search.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: François Chalifour --- src/components/Search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Search.js b/src/components/Search.js index cf5b6cdf..999dd43c 100644 --- a/src/components/Search.js +++ b/src/components/Search.js @@ -55,7 +55,7 @@ const Search = () => ( } .DocSearch-Button { - margin: 10px 10px; + margin: 10px; height: 39px; } From 387157ab988f8eb1a3198e0fb68d6feac39df334 Mon Sep 17 00:00:00 2001 From: s-pace Date: Tue, 25 Aug 2020 09:54:04 +0200 Subject: [PATCH 07/18] style(search): extend search Icon --- src/components/Search.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/Search.js b/src/components/Search.js index 999dd43c..c85e7851 100644 --- a/src/components/Search.js +++ b/src/components/Search.js @@ -64,6 +64,10 @@ const Search = () => ( text-align: left; } + .DocSearch-Search-Icon { + width: 28px; + } + .DocSearch-Modal { a { border-bottom-style: none; From 8da678d59b243b5574de2e51e472d8cdf0ea77ea Mon Sep 17 00:00:00 2001 From: s-pace Date: Tue, 25 Aug 2020 10:09:03 +0200 Subject: [PATCH 08/18] refactor(search): remove duplicate --- src/components/Search.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/components/Search.js b/src/components/Search.js index c85e7851..f37beb5f 100644 --- a/src/components/Search.js +++ b/src/components/Search.js @@ -32,11 +32,7 @@ const Search = () => ( --docsearch-muted-color: rgb(127, 132, 151); --docsearch-key-shadow: inset 0 -2px 0 0 rgb(40, 45, 85), inset 0 0 1px 1px rgb(81, 87, 125), 0 2px 2px 0 rgba(3, 4, 9, 0.3); - --docsearch-footer-background: #2f263c; - --docsearch-footer-shadow: inset 0 1px 0 0 rgba(73, 76, 106, 0.5), 0 -4px 8px 0 rgba(0, 0, 0, 0.2); - --docsearch-logo-color: rgb(255, 255, 255); - --docsearch-muted-color: rgb(127, 132, 151); .DocSearch-Button { --docsearch-searchbox-background: rgb(235, 237, 240); From 9e1a9e1a9030d52787963f6b35e5212ac5419ed9 Mon Sep 17 00:00:00 2001 From: s-pace Date: Tue, 25 Aug 2020 11:19:12 +0200 Subject: [PATCH 09/18] style(search): override default styling on key controls --- src/components/Search.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/components/Search.js b/src/components/Search.js index f37beb5f..05a8e4fd 100644 --- a/src/components/Search.js +++ b/src/components/Search.js @@ -30,9 +30,6 @@ const Search = () => ( 0 -4px 8px 0 rgba(0, 0, 0, 0.2); --docsearch-logo-color: #fff; --docsearch-muted-color: rgb(127, 132, 151); - --docsearch-key-shadow: inset 0 -2px 0 0 rgb(40, 45, 85), - inset 0 0 1px 1px rgb(81, 87, 125), 0 2px 2px 0 rgba(3, 4, 9, 0.3); - 0 -4px 8px 0 rgba(0, 0, 0, 0.2); .DocSearch-Button { --docsearch-searchbox-background: rgb(235, 237, 240); From 65f64602b0e6b3c97ac60b232e278fc620c2dddc Mon Sep 17 00:00:00 2001 From: s-pace Date: Tue, 25 Aug 2020 11:30:12 +0200 Subject: [PATCH 10/18] style(search): keep constrast consistent within search button --- src/components/Search.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/components/Search.js b/src/components/Search.js index 05a8e4fd..cac72fb4 100644 --- a/src/components/Search.js +++ b/src/components/Search.js @@ -50,6 +50,16 @@ const Search = () => ( .DocSearch-Button { margin: 10px; height: 39px; + + &:hover .DocSearch-Search-Icon, + &:active .DocSearch-Search-Icon, + &:focus .DocSearch-Search-Icon { + color: var(--docsearch-text-color); + } + .DocSearch-Search-Icon { + width: 28px; + color: var(--docsearch-muted-color); + } } .DocSearch-Button-Placeholder { @@ -57,10 +67,6 @@ const Search = () => ( text-align: left; } - .DocSearch-Search-Icon { - width: 28px; - } - .DocSearch-Modal { a { border-bottom-style: none; From 3d5de3aceb96ef5bba09ef79f435183cf1ebeb36 Mon Sep 17 00:00:00 2001 From: s-pace Date: Tue, 25 Aug 2020 11:39:28 +0200 Subject: [PATCH 11/18] feat(search): preload page data when hits are hovered --- src/components/Search.js | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/src/components/Search.js b/src/components/Search.js index cac72fb4..6169dfed 100644 --- a/src/components/Search.js +++ b/src/components/Search.js @@ -1,6 +1,11 @@ -import React, { Fragment, useState, useEffect } from 'react'; +import { Fragment } from 'react'; import { Global, css } from '@emotion/core'; import { DocSearch } from '@docsearch/react'; +import { Link, navigate } from 'gatsby'; + +const Hit = ({ hit, children }) => { + return {children}; +}; const Search = () => ( @@ -85,7 +90,29 @@ const Search = () => ( } `} /> - + { + return items.map(item => { + // We transform the absolute URL into a relative URL to + // leverage Gatsby's preloading. + const a = document.createElement('a'); + a.href = item.url; + + return { + ...item, + url: `${a.pathname}${a.hash}`, + }; + }); + }} + /> ); From 9242d820dfd6525a5f55f3a6f0afe80e1b97e2c4 Mon Sep 17 00:00:00 2001 From: s-pace Date: Tue, 25 Aug 2020 11:54:22 +0200 Subject: [PATCH 12/18] style(search): override default styling on li --- src/components/Search.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/Search.js b/src/components/Search.js index 6169dfed..b258e8dd 100644 --- a/src/components/Search.js +++ b/src/components/Search.js @@ -78,6 +78,10 @@ const Search = () => ( } } + .DocSearch-Modal li { + margin-bottom: 0; + } + @media (max-width: 750px) { .DocSearch-Button-KeySeparator, .DocSearch-Button-Key { From 4ce39b104ea29eeb78832ef453ee61ca4f29c428 Mon Sep 17 00:00:00 2001 From: s-pace Date: Tue, 25 Aug 2020 16:25:48 +0200 Subject: [PATCH 13/18] style(search): fix contrast on commands keys --- src/components/Search.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Search.js b/src/components/Search.js index b258e8dd..a15d4816 100644 --- a/src/components/Search.js +++ b/src/components/Search.js @@ -25,11 +25,11 @@ const Search = () => ( --docsearch-hit-background: rgb(9, 10, 17); --docsearch-key-gradient: linear-gradient( -26.5deg, - rgb(114 86 111) 0%, + var(--docsearch-modal-background) 0%, rgb(65 46 80) 100% ); --docsearch-key-shadow: inset 0 -2px 0 0 rgb(81 31 82), - inset 0 0 1px 1px rgb(125 81 111), 0 2px 2px 0 rgba(3, 4, 9, 0.3); + inset 0 0 1px 1px rgb(125 81 111), 0 2px 2px 0 rgba(3, 4, 9, 0.5); --docsearch-footer-background: #2f263c; --docsearch-footer-shadow: inset 0 1px 0 0 rgba(73, 76, 106, 0.5), 0 -4px 8px 0 rgba(0, 0, 0, 0.2); From 9625f82fa35fa5f99f7ad17a70815ad93704da0e Mon Sep 17 00:00:00 2001 From: s-pace Date: Tue, 25 Aug 2020 16:27:42 +0200 Subject: [PATCH 14/18] style(search): refactor rules --- src/components/Search.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/Search.js b/src/components/Search.js index a15d4816..8b684fa9 100644 --- a/src/components/Search.js +++ b/src/components/Search.js @@ -76,10 +76,9 @@ const Search = () => ( a { border-bottom-style: none; } - } - - .DocSearch-Modal li { - margin-bottom: 0; + li { + margin-bottom: 0; + } } @media (max-width: 750px) { From 7345e92f72591449e317342ea35904402887b4a9 Mon Sep 17 00:00:00 2001 From: s-pace Date: Tue, 25 Aug 2020 16:29:10 +0200 Subject: [PATCH 15/18] style(search): center vertically center commands keys, should be removed if francoischalifour/autocomplete#75 is deployed --- src/components/Search.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/Search.js b/src/components/Search.js index 8b684fa9..7c6aa559 100644 --- a/src/components/Search.js +++ b/src/components/Search.js @@ -79,6 +79,9 @@ const Search = () => ( li { margin-bottom: 0; } + .DocSearch-Commands-Key { + padding-bottom: 1px; + } } @media (max-width: 750px) { From e57c4689a5e9bcab92b699d8a10d7c05b7f07a9c Mon Sep 17 00:00:00 2001 From: s-pace Date: Tue, 25 Aug 2020 16:43:50 +0200 Subject: [PATCH 16/18] Revert "style(search): keep constrast consistent within search button" This reverts commit 65f64602b0e6b3c97ac60b232e278fc620c2dddc. --- src/components/Search.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/components/Search.js b/src/components/Search.js index 7c6aa559..8682c0f4 100644 --- a/src/components/Search.js +++ b/src/components/Search.js @@ -55,16 +55,6 @@ const Search = () => ( .DocSearch-Button { margin: 10px; height: 39px; - - &:hover .DocSearch-Search-Icon, - &:active .DocSearch-Search-Icon, - &:focus .DocSearch-Search-Icon { - color: var(--docsearch-text-color); - } - .DocSearch-Search-Icon { - width: 28px; - color: var(--docsearch-muted-color); - } } .DocSearch-Button-Placeholder { @@ -72,6 +62,10 @@ const Search = () => ( text-align: left; } + .DocSearch-Search-Icon { + width: 28px; + } + .DocSearch-Modal { a { border-bottom-style: none; From 1211cbc497b15a5b554a66fc540d89a9ec7dbe8a Mon Sep 17 00:00:00 2001 From: s-pace Date: Tue, 25 Aug 2020 16:50:35 +0200 Subject: [PATCH 17/18] style(search): increase contrast on search button --- src/components/Search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Search.js b/src/components/Search.js index 8682c0f4..3e0a0f09 100644 --- a/src/components/Search.js +++ b/src/components/Search.js @@ -40,7 +40,7 @@ const Search = () => ( --docsearch-searchbox-background: rgb(235, 237, 240); --docsearch-searchbox-focus-background: #fff; --docsearch-text-color: rgb(28, 30, 33); - --docsearch-muted-color: rgb(150, 159, 175); + --docsearch-muted-color: rgb(117 124 138); --docsearch-key-gradient: linear-gradient( -225deg, rgb(213, 219, 228) 0%, From e7869df3e62af8e47c466547aa1e8e3264756d37 Mon Sep 17 00:00:00 2001 From: s-pace Date: Tue, 25 Aug 2020 17:06:40 +0200 Subject: [PATCH 18/18] style(search): refine searchbox shadow --- src/components/Search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Search.js b/src/components/Search.js index 3e0a0f09..0acae890 100644 --- a/src/components/Search.js +++ b/src/components/Search.js @@ -46,7 +46,7 @@ const Search = () => ( rgb(213, 219, 228) 0%, rgb(248, 248, 248) 100% ); - --docsearch-searchbox-shadow: 0 0 0 4px rgba(0, 0, 0, 0.3); + --docsearch-searchbox-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3); --docsearch-key-shadow: inset 0 -2px 0 0 rgb(205, 205, 230), inset 0 0 1px 1px #fff, 0 1px 2px 1px rgba(30, 35, 90, 0.4); }