diff --git a/dev/vite.config.mts b/dev/vite.config.mts index 18709be..c202805 100644 --- a/dev/vite.config.mts +++ b/dev/vite.config.mts @@ -148,6 +148,13 @@ export default defineConfig({ sidebar: { "/": createDevSidebar("./src/routes", ["es", "fr", "router", "v1"]), }, + search: { + docsearch: { + appId: "QAS0JNC31U", + indexName: "SolidBase Docs", + apiKey: "768424fdd93c7150a7a017eb556fa8a3", + }, + }, }, }), solidStart(solidBase.startConfig()), diff --git a/docs/vite.config.mts b/docs/vite.config.mts index 8abf125..ca93667 100644 --- a/docs/vite.config.mts +++ b/docs/vite.config.mts @@ -124,6 +124,13 @@ export default defineConfig({ "/guide": createFilesystemSidebar("./src/routes/guide"), "/reference": createFilesystemSidebar("./src/routes/reference"), }, + search: { + docsearch: { + appId: "QAS0JNC31U", + indexName: "SolidBase Docs", + apiKey: "768424fdd93c7150a7a017eb556fa8a3", + }, + }, }, }), solidStart(solidBase.startConfig()), diff --git a/package.json b/package.json index 93756af..868abee 100644 --- a/package.json +++ b/package.json @@ -153,6 +153,7 @@ "@alloc/quick-lru": "^5.2.0", "@bprogress/core": "^1.3.4", "@docsearch/css": "^3.9.0", + "@docsearch/js": "^4.6.3", "@expressive-code/core": "^0.41.7", "@expressive-code/plugin-collapsible-sections": "^0.41.7", "@expressive-code/plugin-frames": "^0.41.7", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4952895..1fff205 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,6 +17,9 @@ importers: '@docsearch/css': specifier: ^3.9.0 version: 3.9.0 + '@docsearch/js': + specifier: ^4.6.3 + version: 4.6.3 '@expressive-code/core': specifier: ^0.41.7 version: 0.41.7 @@ -353,10 +356,6 @@ packages: resolution: {integrity: sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw==} engines: {node: '>=6.9.0'} - '@babel/helper-annotate-as-pure@7.27.3': - resolution: {integrity: sha512-fXSwMQqitTGeHLBC08Eq5yXz2m37E4pJX1qAU1+2cNedz/ifv/bVXft90VeSav5nFO61EcNgwr0aJxbyPaWBPg==} - engines: {node: '>=6.9.0'} - '@babel/helper-compilation-targets@7.27.2': resolution: {integrity: sha512-2+1thGUUWWjLTYTHZWK1n8Yga0ijBz1XAhUXcKy81rd5g6yh7hGqMp45v7cadSbEHc9G3OTv45SyneRN3ps4DQ==} engines: {node: '>=6.9.0'} @@ -365,20 +364,10 @@ packages: resolution: {integrity: sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA==} engines: {node: '>=6.9.0'} - '@babel/helper-create-class-features-plugin@7.28.6': - resolution: {integrity: sha512-dTOdvsjnG3xNT9Y0AUg1wAl38y+4Rl4sf9caSQZOXdNqVn+H+HbbJ4IyyHaIqNR6SW9oJpA/RuRjsjCw2IdIow==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - '@babel/helper-globals@7.28.0': resolution: {integrity: sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw==} engines: {node: '>=6.9.0'} - '@babel/helper-member-expression-to-functions@7.28.5': - resolution: {integrity: sha512-cwM7SBRZcPCLgl8a7cY0soT1SptSzAlMH39vwiRpOQkJlh53r5hdHwLSCZpQdVLT39sZt+CRpNwYG4Y2v77atg==} - engines: {node: '>=6.9.0'} - '@babel/helper-module-imports@7.18.6': resolution: {integrity: sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==} engines: {node: '>=6.9.0'} @@ -403,24 +392,10 @@ packages: peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-optimise-call-expression@7.27.1': - resolution: {integrity: sha512-URMGH08NzYFhubNSGJrpUEphGKQwMQYBySzat5cAByY1/YgIRkULnIy3tAMeszlL/so2HbeilYloUmSpd7GdVw==} - engines: {node: '>=6.9.0'} - '@babel/helper-plugin-utils@7.28.6': resolution: {integrity: sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug==} engines: {node: '>=6.9.0'} - '@babel/helper-replace-supers@7.28.6': - resolution: {integrity: sha512-mq8e+laIk94/yFec3DxSjCRD2Z0TAjhVbEJY3UQrlwVo15Lmt7C2wAUbK4bjnTs4APkwsYLTahXRraQXhb1WCg==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0 - - '@babel/helper-skip-transparent-expression-wrappers@7.27.1': - resolution: {integrity: sha512-Tub4ZKEXqbPjXgWLl2+3JpQAYBJ8+ikpQ2Ocj/q/r0LwE3UhENh7EUabyHjz2kCEsrRY83ew2DQdHluuiDQFzg==} - engines: {node: '>=6.9.0'} - '@babel/helper-string-parser@7.27.1': resolution: {integrity: sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==} engines: {node: '>=6.9.0'} @@ -461,30 +436,6 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-typescript@7.28.6': - resolution: {integrity: sha512-+nDNmQye7nlnuuHDboPbGm00Vqg3oO8niRRL27/4LYHUsHYh0zJ1xWOz0uRwNFmM1Avzk8wZbc6rdiYhomzv/A==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-modules-commonjs@7.28.6': - resolution: {integrity: sha512-jppVbf8IV9iWWwWTQIxJMAJCWBuuKx71475wHwYytrRGQ2CWiDvYlADQno3tcYpS/T2UUWFQp3nVtYfK/YBQrA==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/plugin-transform-typescript@7.28.6': - resolution: {integrity: sha512-0YWL2RFxOqEm9Efk5PvreamxPME8OyY0wM5wh5lHjF+VtVhdneCWGzZeSqzOfiobVqQaNCd2z0tQvnI9DaPWPw==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - - '@babel/preset-typescript@7.28.5': - resolution: {integrity: sha512-+bQy5WOI2V6LJZpPVxY+yp66XdZ2yifu0Mc1aP5CQKgjn4QM5IN2i5fAZ4xKop47pr8rpVhiAeu+nDQa12C8+g==} - engines: {node: '>=6.9.0'} - peerDependencies: - '@babel/core': ^7.0.0-0 - '@babel/template@7.27.2': resolution: {integrity: sha512-LPDZ85aEJyYSd18/DkjNh4/y1ntkE5KwUHWTiqgRxruuZL2F1yuHligVHLvcHY2vMHXttKFpJn6LwfI7cw7ODw==} engines: {node: '>=6.9.0'} @@ -617,6 +568,9 @@ packages: '@docsearch/css@3.9.0': resolution: {integrity: sha512-cQbnVbq0rrBwNAKegIac/t6a8nWoUAn8frnkLFW6YARaRmAQr5/Eoe6Ln2fqkUCZ40KpdrKbpSAmgrkviOxuWA==} + '@docsearch/js@4.6.3': + resolution: {integrity: sha512-qUIX2b4Apew3tv4F0qhmgShsl/Lfw4m6mqv/5/5dWNxwTcDdLMp2s3YwZ+NMGh3IKCg0pBaXm7Q5VdyU5Rj+cQ==} + '@emnapi/core@1.9.1': resolution: {integrity: sha512-mukuNALVsoix/w1BJwFzwXBN/dHeejQtuVzcDsfOEsdpCumXb/E9j8w11h5S54tT1xhifGfbbSm/ICrObRb3KA==} @@ -1466,20 +1420,6 @@ packages: '@swc/helpers@0.5.19': resolution: {integrity: sha512-QamiFeIK3txNjgUTNppE6MiG3p7TdninpZu0E0PbqVh1a9FNLT2FRhisaa4NcaX52XVhA5l7Pk58Ft7Sqi/2sA==} - '@tanstack/directive-functions-plugin@1.134.5': - resolution: {integrity: sha512-J3oawV8uBRBbPoLgMdyHt+LxzTNuWRKNJJuCLWsm/yq6v0IQSvIVCgfD2+liIiSnDPxGZ8ExduPXy8IzS70eXw==} - engines: {node: '>=12'} - peerDependencies: - vite: '>=6.0.0 || >=7.0.0' - - '@tanstack/router-utils@1.133.19': - resolution: {integrity: sha512-WEp5D2gPxvlLDRXwD/fV7RXjYtqaqJNXKB/L6OyZEbT+9BG/Ib2d7oG9GSUZNNMGPGYAlhBUOi3xutySsk6rxA==} - engines: {node: '>=12'} - - '@tanstack/server-functions-plugin@1.134.5': - resolution: {integrity: sha512-2sWxq70T+dOEUlE3sHlXjEPhaFZfdPYlWTSkHchWXrFGw2YOAa+hzD6L9wHMjGDQezYd03ue8tQlHG+9Jzbzgw==} - engines: {node: '>=12'} - '@tybys/wasm-util@0.10.1': resolution: {integrity: sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==} @@ -1553,6 +1493,7 @@ packages: '@ungap/structured-clone@1.3.0': resolution: {integrity: sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==} + deprecated: Potential CWE-502 - Update to 1.3.1 or higher '@vercel/og@0.6.8': resolution: {integrity: sha512-e4kQK9mP8ntpo3dACWirGod/hHv4qO5JMj9a/0a2AZto7b4persj5YP7t1Er372gTtYFTYxNhMx34jRvHooglw==} @@ -1612,9 +1553,6 @@ packages: resolution: {integrity: sha512-LElXdjswlqjWrPpJFg1Fx4wpkOCxj1TDHlSV4PlaRxHGWko024xICaa97ZkMfs6DRKlCguiAI+rbXv5GWwXIkg==} hasBin: true - babel-dead-code-elimination@1.0.12: - resolution: {integrity: sha512-GERT7L2TiYcYDtYk1IpD+ASAYXjKbLTDPhBtYj7X1NuRMDTMtAx9kyBenub1Ev41lo91OHCKdmP+egTDmfQ7Ig==} - babel-plugin-jsx-dom-expressions@0.40.5: resolution: {integrity: sha512-8TFKemVLDYezqqv4mWz+PhRrkryTzivTGu0twyLrOkVZ0P63COx2Y04eVsUjFlwSOXui1z3P3Pn209dokWnirg==} peerDependencies: @@ -2802,6 +2740,10 @@ packages: resolution: {integrity: sha512-OwrZRZAfhHww0WEnKHDY8OM0U/Qs8OTfIDWhUD4BLpNJUfXK4cGmjiagGze086m+mhI+V2nD0gfbHEnJjb9STA==} engines: {node: '>=10'} + seroval@1.5.5: + resolution: {integrity: sha512-bSjOuPcwPKLSJNhr9+bZxA20nQxVle5J5MNsYRVE6cIg7KpRLXGupymePavu0jrxlPiPsr4xGZSB8yUY2sH2sw==} + engines: {node: '>=10'} + shebang-command@2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} engines: {node: '>=8'} @@ -2910,9 +2852,6 @@ packages: tiny-inflate@1.0.3: resolution: {integrity: sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw==} - tiny-invariant@1.3.3: - resolution: {integrity: sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==} - tinybench@2.9.0: resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} @@ -3509,10 +3448,6 @@ snapshots: '@jridgewell/trace-mapping': 0.3.31 jsesc: 3.1.0 - '@babel/helper-annotate-as-pure@7.27.3': - dependencies: - '@babel/types': 7.29.0 - '@babel/helper-compilation-targets@7.27.2': dependencies: '@babel/compat-data': 7.27.3 @@ -3529,28 +3464,8 @@ snapshots: lru-cache: 5.1.1 semver: 6.3.1 - '@babel/helper-create-class-features-plugin@7.28.6(@babel/core@7.29.0)': - dependencies: - '@babel/core': 7.29.0 - '@babel/helper-annotate-as-pure': 7.27.3 - '@babel/helper-member-expression-to-functions': 7.28.5 - '@babel/helper-optimise-call-expression': 7.27.1 - '@babel/helper-replace-supers': 7.28.6(@babel/core@7.29.0) - '@babel/helper-skip-transparent-expression-wrappers': 7.27.1 - '@babel/traverse': 7.29.0 - semver: 6.3.1 - transitivePeerDependencies: - - supports-color - '@babel/helper-globals@7.28.0': {} - '@babel/helper-member-expression-to-functions@7.28.5': - dependencies: - '@babel/traverse': 7.29.0 - '@babel/types': 7.29.0 - transitivePeerDependencies: - - supports-color - '@babel/helper-module-imports@7.18.6': dependencies: '@babel/types': 7.29.0 @@ -3587,28 +3502,8 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/helper-optimise-call-expression@7.27.1': - dependencies: - '@babel/types': 7.29.0 - '@babel/helper-plugin-utils@7.28.6': {} - '@babel/helper-replace-supers@7.28.6(@babel/core@7.29.0)': - dependencies: - '@babel/core': 7.29.0 - '@babel/helper-member-expression-to-functions': 7.28.5 - '@babel/helper-optimise-call-expression': 7.27.1 - '@babel/traverse': 7.29.0 - transitivePeerDependencies: - - supports-color - - '@babel/helper-skip-transparent-expression-wrappers@7.27.1': - dependencies: - '@babel/traverse': 7.29.0 - '@babel/types': 7.29.0 - transitivePeerDependencies: - - supports-color - '@babel/helper-string-parser@7.27.1': {} '@babel/helper-validator-identifier@7.27.1': {} @@ -3640,41 +3535,6 @@ snapshots: '@babel/core': 7.29.0 '@babel/helper-plugin-utils': 7.28.6 - '@babel/plugin-syntax-typescript@7.28.6(@babel/core@7.29.0)': - dependencies: - '@babel/core': 7.29.0 - '@babel/helper-plugin-utils': 7.28.6 - - '@babel/plugin-transform-modules-commonjs@7.28.6(@babel/core@7.29.0)': - dependencies: - '@babel/core': 7.29.0 - '@babel/helper-module-transforms': 7.28.6(@babel/core@7.29.0) - '@babel/helper-plugin-utils': 7.28.6 - transitivePeerDependencies: - - supports-color - - '@babel/plugin-transform-typescript@7.28.6(@babel/core@7.29.0)': - dependencies: - '@babel/core': 7.29.0 - '@babel/helper-annotate-as-pure': 7.27.3 - '@babel/helper-create-class-features-plugin': 7.28.6(@babel/core@7.29.0) - '@babel/helper-plugin-utils': 7.28.6 - '@babel/helper-skip-transparent-expression-wrappers': 7.27.1 - '@babel/plugin-syntax-typescript': 7.28.6(@babel/core@7.29.0) - transitivePeerDependencies: - - supports-color - - '@babel/preset-typescript@7.28.5(@babel/core@7.29.0)': - dependencies: - '@babel/core': 7.29.0 - '@babel/helper-plugin-utils': 7.28.6 - '@babel/helper-validator-option': 7.27.1 - '@babel/plugin-syntax-jsx': 7.28.6(@babel/core@7.29.0) - '@babel/plugin-transform-modules-commonjs': 7.28.6(@babel/core@7.29.0) - '@babel/plugin-transform-typescript': 7.28.6(@babel/core@7.29.0) - transitivePeerDependencies: - - supports-color - '@babel/template@7.27.2': dependencies: '@babel/code-frame': 7.27.1 @@ -3795,6 +3655,8 @@ snapshots: '@docsearch/css@3.9.0': {} + '@docsearch/js@4.6.3': {} + '@emnapi/core@1.9.1': dependencies: '@emnapi/wasi-threads': 1.2.0 @@ -4498,7 +4360,6 @@ snapshots: '@babel/traverse': 7.29.0 '@babel/types': 7.29.0 '@solidjs/meta': 0.29.4(solid-js@1.9.11) - '@tanstack/server-functions-plugin': 1.134.5(vite@8.0.0(@types/node@25.5.0)(esbuild@0.27.4)(tsx@4.21.0)(yaml@2.8.2)) '@types/babel__traverse': 7.28.0 '@types/micromatch': 4.0.10 cookie-es: 2.0.0 @@ -4513,8 +4374,8 @@ snapshots: path-to-regexp: 8.3.0 pathe: 2.0.3 radix3: 1.1.2 - seroval: 1.5.1 - seroval-plugins: 1.5.1(seroval@1.5.1) + seroval: 1.5.5 + seroval-plugins: 1.5.1(seroval@1.5.5) shiki: 1.29.2 solid-js: 1.9.11 source-map-js: 1.2.1 @@ -4533,7 +4394,6 @@ snapshots: '@babel/traverse': 7.29.0 '@babel/types': 7.29.0 '@solidjs/meta': 0.29.4(solid-js@1.9.11) - '@tanstack/server-functions-plugin': 1.134.5(vite@8.0.1(@types/node@25.5.0)(esbuild@0.25.12)(tsx@4.21.0)(yaml@2.8.2)) '@types/babel__traverse': 7.28.0 '@types/micromatch': 4.0.10 cookie-es: 2.0.0 @@ -4548,8 +4408,8 @@ snapshots: path-to-regexp: 8.3.0 pathe: 2.0.3 radix3: 1.1.2 - seroval: 1.5.1 - seroval-plugins: 1.5.1(seroval@1.5.1) + seroval: 1.5.5 + seroval-plugins: 1.5.1(seroval@1.5.5) shiki: 1.29.2 solid-js: 1.9.11 source-map-js: 1.2.1 @@ -4568,79 +4428,6 @@ snapshots: dependencies: tslib: 2.8.1 - '@tanstack/directive-functions-plugin@1.134.5(vite@8.0.0(@types/node@25.5.0)(esbuild@0.27.4)(tsx@4.21.0)(yaml@2.8.2))': - dependencies: - '@babel/code-frame': 7.27.1 - '@babel/core': 7.29.0 - '@babel/traverse': 7.29.0 - '@babel/types': 7.29.0 - '@tanstack/router-utils': 1.133.19 - babel-dead-code-elimination: 1.0.12 - pathe: 2.0.3 - tiny-invariant: 1.3.3 - vite: 8.0.0(@types/node@25.5.0)(esbuild@0.27.4)(tsx@4.21.0)(yaml@2.8.2) - transitivePeerDependencies: - - supports-color - - '@tanstack/directive-functions-plugin@1.134.5(vite@8.0.1(@types/node@25.5.0)(esbuild@0.25.12)(tsx@4.21.0)(yaml@2.8.2))': - dependencies: - '@babel/code-frame': 7.27.1 - '@babel/core': 7.29.0 - '@babel/traverse': 7.29.0 - '@babel/types': 7.29.0 - '@tanstack/router-utils': 1.133.19 - babel-dead-code-elimination: 1.0.12 - pathe: 2.0.3 - tiny-invariant: 1.3.3 - vite: 8.0.1(@types/node@25.5.0)(esbuild@0.25.12)(tsx@4.21.0)(yaml@2.8.2) - transitivePeerDependencies: - - supports-color - - '@tanstack/router-utils@1.133.19': - dependencies: - '@babel/core': 7.29.0 - '@babel/generator': 7.29.1 - '@babel/parser': 7.29.2 - '@babel/preset-typescript': 7.28.5(@babel/core@7.29.0) - ansis: 4.2.0 - diff: 8.0.3 - pathe: 2.0.3 - tinyglobby: 0.2.15 - transitivePeerDependencies: - - supports-color - - '@tanstack/server-functions-plugin@1.134.5(vite@8.0.0(@types/node@25.5.0)(esbuild@0.27.4)(tsx@4.21.0)(yaml@2.8.2))': - dependencies: - '@babel/code-frame': 7.27.1 - '@babel/core': 7.29.0 - '@babel/plugin-syntax-jsx': 7.28.6(@babel/core@7.29.0) - '@babel/plugin-syntax-typescript': 7.28.6(@babel/core@7.29.0) - '@babel/template': 7.28.6 - '@babel/traverse': 7.29.0 - '@babel/types': 7.29.0 - '@tanstack/directive-functions-plugin': 1.134.5(vite@8.0.0(@types/node@25.5.0)(esbuild@0.27.4)(tsx@4.21.0)(yaml@2.8.2)) - babel-dead-code-elimination: 1.0.12 - tiny-invariant: 1.3.3 - transitivePeerDependencies: - - supports-color - - vite - - '@tanstack/server-functions-plugin@1.134.5(vite@8.0.1(@types/node@25.5.0)(esbuild@0.25.12)(tsx@4.21.0)(yaml@2.8.2))': - dependencies: - '@babel/code-frame': 7.27.1 - '@babel/core': 7.29.0 - '@babel/plugin-syntax-jsx': 7.28.6(@babel/core@7.29.0) - '@babel/plugin-syntax-typescript': 7.28.6(@babel/core@7.29.0) - '@babel/template': 7.28.6 - '@babel/traverse': 7.29.0 - '@babel/types': 7.29.0 - '@tanstack/directive-functions-plugin': 1.134.5(vite@8.0.1(@types/node@25.5.0)(esbuild@0.25.12)(tsx@4.21.0)(yaml@2.8.2)) - babel-dead-code-elimination: 1.0.12 - tiny-invariant: 1.3.3 - transitivePeerDependencies: - - supports-color - - vite - '@tybys/wasm-util@0.10.1': dependencies: tslib: 2.8.1 @@ -4790,15 +4577,6 @@ snapshots: astring@1.9.0: {} - babel-dead-code-elimination@1.0.12: - dependencies: - '@babel/core': 7.29.0 - '@babel/parser': 7.29.2 - '@babel/traverse': 7.29.0 - '@babel/types': 7.29.0 - transitivePeerDependencies: - - supports-color - babel-plugin-jsx-dom-expressions@0.40.5(@babel/core@7.29.0): dependencies: '@babel/core': 7.29.0 @@ -6470,8 +6248,14 @@ snapshots: dependencies: seroval: 1.5.1 + seroval-plugins@1.5.1(seroval@1.5.5): + dependencies: + seroval: 1.5.5 + seroval@1.5.1: {} + seroval@1.5.5: {} + shebang-command@2.0.0: dependencies: shebang-regex: 3.0.0 @@ -6585,8 +6369,6 @@ snapshots: tiny-inflate@1.0.3: {} - tiny-invariant@1.3.3: {} - tinybench@2.9.0: {} tinyexec@1.0.4: {} diff --git a/src/default-theme/components/Header.tsx b/src/default-theme/components/Header.tsx index f062003..1a61652 100644 --- a/src/default-theme/components/Header.tsx +++ b/src/default-theme/components/Header.tsx @@ -18,6 +18,7 @@ import { } from "../context.jsx"; import { useRouteConfig } from "../utils.js"; import styles from "./Header.module.css"; +import DocSearch from "./vendor/DocSearch.jsx"; export default function Header() { const [tocRef, setTocRef] = createSignal(); @@ -108,12 +109,18 @@ export default function Header() { )}
+ + {(docsearch) => } +
+ + {(docsearch) => } + {(nav) => ( diff --git a/src/default-theme/components/vendor/DocSearch.module.css b/src/default-theme/components/vendor/DocSearch.module.css new file mode 100644 index 0000000..73126df --- /dev/null +++ b/src/default-theme/components/vendor/DocSearch.module.css @@ -0,0 +1,247 @@ +.docsearch, +:global(.DocSearch) { + --docsearch-primary-color: var(--sb-active-link-color); + --docsearch-highlight-color: var(--sb-active-link-color); + + --docsearch-text-color: var(--sb-heading-color); + --docsearch-muted-color: var(--sb-text-color); + --docsearch-logo-color: var(--sb-text-color); + + --docsearch-spacing: 12px; + --docsearch-icon-stroke-width: 1.4; + + --docsearch-container-background: color-mix( + in srgb, + var(--sb-background-color) 70%, + transparent + ); + + --docsearch-modal-width: 560px; + --docsearch-modal-height: 600px; + --docsearch-modal-background: color-mix( + in hsl, + var(--sb-background-color) 95%, + var(--sb-tint-color-opposite) + ); + --docsearch-modal-shadow: none; + + --docsearch-searchbox-height: 56px; + --docsearch-searchbox-background: var(--sb-code-background-color); + --docsearch-searchbox-focus-background: var(--sb-background-color); + --docsearch-searchbox-shadow: none; + + --docsearch-hit-height: 56px; + --docsearch-hit-color: var(--sb-text-color); + --docsearch-hit-active-color: ; + --docsearch-hit-background: var(--sb-background-color); + --docsearch-hit-shadow: none; + + --docsearch-key-gradient: transparent; + --docsearch-key-shadow: none; + --docsearch-key-pressed-shadow: none; + + --docsearch-footer-height: 44px; + --docsearch-footer-background: var(--docsearch-modal-background); + --docsearch-footer-shadow: none; +} + +:global(.DocSearch-Button) { + display: flex; + justify-content: center; + align-items: center; + margin: 0; + padding: 0; + width: 32px; + height: 40px; + background: transparent; + transition: border-color 0.25s; +} + +:global(.DocSearch-Button):hover { + background: transparent; +} + +:global(.DocSearch-Button):focus { + outline: 1px dotted; +} + +:global(.DocSearch-Button):focus:not(:focus-visible) { + outline: none; +} + +@media (min-width: 768px) { + :global(.DocSearch-Button):global(.DocSearch-Button) { + justify-content: flex-start; + border: 1px solid transparent; + border-radius: 8px; + padding: 0 10px 0 12px; + width: 100%; + height: 40px; + } + + :global(.DocSearch-Button):hover { + background: color-mix(in hsl, var(--sb-text-color) 7.5%, transparent); + } +} + +:global(.DocSearch-Button) :global(.DocSearch-Button-Container) { + display: flex; + align-items: center; +} + +:global(.DocSearch-Button) :global(.DocSearch-Search-Icon) { + position: relative; + width: 16px; + height: 16px; + color: var(--sb-heading-color); + fill: currentColor; + transition: color 0.5s; +} + +:global(.DocSearch-Button):hover :global(.DocSearch-Search-Icon) { + color: var(--sb-heading-color); +} + +@media (min-width: 768px) { + :global(.DocSearch-Button) :global(.DocSearch-Search-Icon) { + top: 1px; + margin-right: 8px; + width: 14px; + height: 14px; + color: var(--sb-text-color); + } +} + +:global(.DocSearch-Button) :global(.DocSearch-Button-Placeholder) { + display: none; + margin-top: 2px; + padding: 0 16px 0 0; + font-size: 13px; + font-weight: 500; + color: var(--sb-text-color); + transition: color 0.5s; +} + +:global(.DocSearch-Button):hover :global(.DocSearch-Button-Placeholder) { + color: var(--sb-heading-color); +} + +@media (min-width: 768px) { + :global(.DocSearch-Button) :global(.DocSearch-Button-Placeholder) { + display: inline-block; + } +} + +:global(.DocSearch-Button) :global(.DocSearch-Button-Keys) { + direction: ltr; + display: none; + min-width: auto; +} + +@media (min-width: 768px) { + :global(.DocSearch-Button) :global(.DocSearch-Button-Keys) { + display: flex; + align-items: center; + } +} + +:global(.DocSearch-Button) :global(.DocSearch-Button-Key) { + font-family: var(--sb-font-text); + display: block; + margin: 2px 0 0 0; + border: 1px solid + color-mix(in srgb, var(--sb-decoration-color) 12%, transparent); + border-right: none; + border-radius: 4px 0 0 4px; + padding-left: 6px; + min-width: 0; + width: auto; + height: 22px; + line-height: 22px; + font-size: 12px; + font-weight: 500; + transition: + color 0.5s, + border-color 0.5s; +} + +:global(.DocSearch-Button) + :global(.DocSearch-Button-Key) + + :global(.DocSearch-Button-Key) { + border-right: 1px solid + color-mix(in srgb, var(--sb-decoration-color) 12%, transparent); + border-left: none; + border-radius: 0 4px 4px 0; + padding-left: 2px; + padding-right: 6px; +} +:global(.DocSearch-Button) :global(.DocSearch-Button-Key):first-child { + font-size: 1px; + letter-spacing: -12px; + color: transparent; +} + +:global(.DocSearch-Button) :global(.DocSearch-Button-Key):first-child:after { + content: "⌘"; + font-size: 12px; + letter-spacing: normal; + color: var(--docsearch-muted-color); +} + +:global(.DocSearch-Button) :global(.DocSearch-Button-Key):first-child > * { + display: none; +} + +:global(.DocSearch-Footer) { + border-top: 1px solid + color-mix(in srgb, var(--sb-decoration-color) 12%, transparent); +} + +[data-theme*="dark"] :global(.DocSearch-Footer) { + border-top-color: color-mix( + in srgb, + var(--sb-decoration-color) 32%, + transparent + ); +} + +:global(.DocSearch-Form) { + background-color: var(--sb-background-color); +} + +:global(.DocSearch-Screen-Icon) > svg { + margin: auto; +} + +:global(.DocSearch-Actions) { + display: flex; + gap: 0.25rem; + + > button { + background: none; + border: none; + border-radius: var(--sb-border-radius); + + &:hover, + &:focus { + background-color: var(--docsearch-hit-background); + } + } +} + +:global(.DocSearch-Hit)[aria-selected="true"] a { + background-color: color-mix(in hsl, var(--sb-text-color) 7.5%, transparent); +} + +:global(.DocSearch-Hit)[aria-selected="true"] mark { + color: var(--docsearch-highlight-color); +} + +:global(.DocSearch-Modal):not(:has(:global(.DocSearch-Dropdown))) + :global(.DocSearch-SearchBar) { + padding: var(--docsearch-spacing); +} + +:global(.DocSearch-HitsFooter):empty { + display: none; +} diff --git a/src/default-theme/components/vendor/DocSearch.tsx b/src/default-theme/components/vendor/DocSearch.tsx new file mode 100644 index 0000000..aaff041 --- /dev/null +++ b/src/default-theme/components/vendor/DocSearch.tsx @@ -0,0 +1,24 @@ +import docsearch, { type DocSearchProps } from "@docsearch/js"; +import { createEffect, createSignal } from "solid-js"; + +import "@docsearch/css/dist/style.css"; +import styles from "./DocSearch.module.css"; + +export default function DocSearch(props: { + docsearch: Omit; +}) { + const [ref, setRef] = createSignal(); + + createEffect(() => { + if (!ref()) return; + try { + //@ts-expect-error: docsearch not callable? + docsearch({ + container: ref(), + ...props.docsearch, + }); + } catch {} + }); + + return
; +} diff --git a/src/default-theme/default-components.ts b/src/default-theme/default-components.ts index c5783a6..2f90014 100644 --- a/src/default-theme/default-components.ts +++ b/src/default-theme/default-components.ts @@ -11,10 +11,12 @@ import ProjectSelector from "./components/ProjectSelector.jsx"; import TableOfContents from "./components/TableOfContents.jsx"; import ThemeSelector from "./components/ThemeSelector.jsx"; import VersionSelector from "./components/VersionSelector.jsx"; +import DocSearch from "./components/vendor/DocSearch.jsx"; export const defaultThemeComponents = { Article, Badges, + DocSearch, Footer, Header, LastUpdated, diff --git a/src/default-theme/index.ts b/src/default-theme/index.ts index b15fab8..ac31462 100644 --- a/src/default-theme/index.ts +++ b/src/default-theme/index.ts @@ -1,5 +1,6 @@ import { createRequire } from "node:module"; import { fileURLToPath, pathToFileURL } from "node:url"; +import type { DocSearchProps } from "@docsearch/js"; import type { Component, JSX } from "solid-js"; import { defineTheme, type ThemeDefinition } from "../config/index.js"; import type { SidebarConfig } from "../config/sidebar.js"; @@ -146,13 +147,15 @@ const defaultTheme: ThemeDefinition = defineTheme({ }); export default defaultTheme; -export type SearchConfig = {}; +export interface SearchConfig { + docsearch?: Omit; +} -export type NavItem = { +export interface NavItem { text: string; link: string; activeMatch?: string; -}; +} export interface SocialLink { type: "discord" | "github" | "opencollective" | "custom";