mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-11-26 10:13:46 +00:00
Compare commits
30 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9d300985bc | |||
| 9f2701c616 | |||
| 0173636ced | |||
| a3d37f341a | |||
| 68e3dace27 | |||
| 7af524a834 | |||
| 3ec61a78cf | |||
| 7f08fb14d1 | |||
| 867da7b94c | |||
| 76e1abd7e1 | |||
| 48fe81b58f | |||
| 596b8c5705 | |||
| 22df281316 | |||
| 5755e6db32 | |||
| bd38317ba5 | |||
| adbc358dd5 | |||
| 21b96e17a7 | |||
| d2be88590f | |||
| 873856ae98 | |||
| 4cbbda7fab | |||
| 63a4a98384 | |||
| 060f1f63ca | |||
| 7cee30ecb8 | |||
| a035d196f0 | |||
| 1ecd2ca65a | |||
| b0f3822342 | |||
| 7e2658a7a2 | |||
| a10eff9e0a | |||
| 13c0ff0803 | |||
| d2c56e5f0e |
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"gitbook": patch
|
||||
---
|
||||
|
||||
Handle optional emoji and icon values when rendering tags.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"gitbook": patch
|
||||
---
|
||||
|
||||
Point agents to the site MCP server from Markdown pages, the page HTML, llms.txt and llms-full.txt.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"gitbook": patch
|
||||
---
|
||||
|
||||
Serve the site AI Catalog as specification version 0.9, with identifiers in its `urn:air:{publisher}:{name}:{kind}` format.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"gitbook": patch
|
||||
---
|
||||
|
||||
Bump `@opennextjs/aws` to 4.2.0 and `@opennextjs/cloudflare` to 1.20.18.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"gitbook": patch
|
||||
---
|
||||
|
||||
Bump @opennextjs/aws to 4.2.1 and @opennextjs/cloudflare to 1.20.19.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"gitbook": patch
|
||||
---
|
||||
|
||||
Retry direct site search on the site's own domain after a network error or timeout.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"gitbook": patch
|
||||
---
|
||||
|
||||
Name a site's MCP server as docs, such as "Acme Docs MCP Server", in AI clients and in the install commands and links, so it is not confused with a product's own MCP server.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"gitbook": patch
|
||||
---
|
||||
|
||||
Reduce the wait after typing in site search to 100 ms.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"gitbook": patch
|
||||
---
|
||||
|
||||
Prevent self-redirect loops and skip redirects targeting hidden adaptive content.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"gitbook": patch
|
||||
---
|
||||
|
||||
Keep published pages available when an integration block needs its connection or settings checked.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"gitbook": patch
|
||||
---
|
||||
|
||||
Keep published site search results visible while visitors refine a query.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"gitbook": patch
|
||||
---
|
||||
|
||||
Apply the default language-aware search scope to legacy search links.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"gitbook": patch
|
||||
---
|
||||
|
||||
Count only MCP tool calls in the MCP request insights event.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"gitbook": patch
|
||||
---
|
||||
|
||||
Answer GET requests to the MCP endpoint with an `Allow: POST` header.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"gitbook": patch
|
||||
---
|
||||
|
||||
Support MCP protocol version 2025-11-25 on published site MCP servers.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"gitbook": patch
|
||||
---
|
||||
|
||||
Keep published revision URLs out of search results.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"gitbook": patch
|
||||
---
|
||||
|
||||
Resolve GitBook links in OpenAPI schema descriptions to the site's published URLs instead of the editor.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"gitbook": patch
|
||||
---
|
||||
|
||||
Render a page's search keywords in its metadata.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"gitbook": patch
|
||||
---
|
||||
|
||||
Send change request and revision links to the site preview, where GitBook members can sign in, when a site turns off public change request previews.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"gitbook": patch
|
||||
---
|
||||
|
||||
Drop description HTML supplied by OpenAPI specs and sanitize example descriptions that could render HTML.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"gitbook": patch
|
||||
---
|
||||
|
||||
Track the displayed position and search request ID when a visitor opens a search result.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"gitbook": patch
|
||||
---
|
||||
|
||||
Include navigation-hidden published spaces in direct browser search lookup and avoid latching on unknown spaces.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"gitbook": patch
|
||||
---
|
||||
|
||||
Load the data of the page actions menu from the menu itself, so it can be cached apart from the page body.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"gitbook": patch
|
||||
---
|
||||
|
||||
Show site revision previews as their site revision pins them, including OpenAPI specs.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"gitbook": patch
|
||||
---
|
||||
|
||||
Update the GitBook API SDK for site revision responses.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"gitbook": patch
|
||||
---
|
||||
|
||||
Fix wide content in Updates blocks overflowing into the page outline.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"gitbook": patch
|
||||
---
|
||||
|
||||
Paginate published Updates pages with more than 50 entries into 20-entry pages.
|
||||
@@ -127,9 +127,9 @@
|
||||
"@gitbook/react-math": "workspace:*",
|
||||
"@gitbook/react-openapi": "workspace:*",
|
||||
"@mermaid-js/mermaid-zenuml": "^0.2.2",
|
||||
"@modelcontextprotocol/sdk": "1.17.5",
|
||||
"@opennextjs/aws": "4.1.16",
|
||||
"@opennextjs/cloudflare": "1.20.17",
|
||||
"@modelcontextprotocol/sdk": "1.26.0",
|
||||
"@opennextjs/aws": "4.2.1",
|
||||
"@opennextjs/cloudflare": "1.20.19",
|
||||
"@panzoom/panzoom": "^4.6.1",
|
||||
"@sindresorhus/fnv1a": "^3.1.0",
|
||||
"@tailwindcss/container-queries": "^0.1.1",
|
||||
@@ -148,7 +148,7 @@
|
||||
"jsontoxml": "^1.0.1",
|
||||
"jwt-decode": "^4.0.0",
|
||||
"leven": "^4.1.0",
|
||||
"mcp-handler": "^1.0.2",
|
||||
"mcp-handler": "^1.1.0",
|
||||
"mdast-util-from-markdown": "^2.0.2",
|
||||
"mdast-util-frontmatter": "^2.0.1",
|
||||
"mdast-util-gfm": "^3.1.0",
|
||||
@@ -190,7 +190,7 @@
|
||||
"url-join": "^5.0.0",
|
||||
"usehooks-ts": "catalog:",
|
||||
"warn-once": "^0.1.1",
|
||||
"zod": "^3",
|
||||
"zod": "^3.25",
|
||||
"zod-to-json-schema": "^3.25.1",
|
||||
"zustand": "^5.0.3",
|
||||
},
|
||||
@@ -357,7 +357,7 @@
|
||||
},
|
||||
"catalog": {
|
||||
"@base-ui/react": "^1.7.0",
|
||||
"@gitbook/api": "0.210.0",
|
||||
"@gitbook/api": "0.214.0",
|
||||
"@scalar/api-client-react": "^1.3.46",
|
||||
"@tsconfig/node20": "^20.1.6",
|
||||
"@tsconfig/strictest": "^2.0.6",
|
||||
@@ -725,7 +725,7 @@
|
||||
|
||||
"@fortawesome/fontawesome-svg-core": ["@fortawesome/fontawesome-svg-core@7.2.0", "", { "dependencies": { "@fortawesome/fontawesome-common-types": "7.2.0" } }, "sha512-6639htZMjEkwskf3J+e6/iar+4cTNM9qhoWuRfj9F3eJD6r7iCzV1SWnQr2Mdv0QT0suuqU8BoJCZUyCtP9R4Q=="],
|
||||
|
||||
"@gitbook/api": ["@gitbook/api@0.210.0", "", { "dependencies": { "event-iterator": "^2.0.0", "eventsource-parser": "^3.0.0" } }, "sha512-qxroJUFDreoJNU7X28Gz+2Nbjg8PCiE4GtJkwscHYfmWHLM29NsVVt3ap8x+bz53j6mg+SaobVjeRsXdA1EbXA=="],
|
||||
"@gitbook/api": ["@gitbook/api@0.214.0", "", { "dependencies": { "event-iterator": "^2.0.0", "eventsource-parser": "^3.0.0" } }, "sha512-rNmnQIgg0mhdknDMc2/3dhoKk+XmCP1P5qTrhazI458WsqkPCSMV2o7B6cJADUzs9svH78y5z7bSRzrrOMmV4g=="],
|
||||
|
||||
"@gitbook/browser-types": ["@gitbook/browser-types@workspace:packages/browser-types"],
|
||||
|
||||
@@ -759,6 +759,8 @@
|
||||
|
||||
"@headlessui/vue": ["@headlessui/vue@1.7.23", "", { "dependencies": { "@tanstack/vue-virtual": "^3.0.0-beta.60" }, "peerDependencies": { "vue": "^3.2.0" } }, "sha512-JzdCNqurrtuu0YW6QaDtR2PIYCKPUWq28csDyMvN4zmGccmE7lz40Is6hc3LA4HFeCI7sekZ/PQMTNmn9I/4Wg=="],
|
||||
|
||||
"@hono/node-server": ["@hono/node-server@1.19.19", "", { "peerDependencies": { "hono": "^4" } }, "sha512-Fy9R7PACOzHU9LDpfnuzVyuVYevKQRcEG2mZhmfc+DRdmayEd3RVfa2XOt2IgGcPNgA77Yk63KBszepcMFK5Ng=="],
|
||||
|
||||
"@hyperjump/browser": ["@hyperjump/browser@1.1.6", "", { "dependencies": { "@hyperjump/json-pointer": "^1.1.0", "@hyperjump/uri": "^1.2.0", "content-type": "^1.0.5", "just-curry-it": "^5.3.0" } }, "sha512-i27uPV7SxK1GOn7TLTRxTorxchYa5ur9JHgtl6TxZ1MHuyb9ROAnXxEeu4q4H1836Xb7lL2PGPsaa5Jl3p+R6g=="],
|
||||
|
||||
"@hyperjump/json-pointer": ["@hyperjump/json-pointer@1.1.0", "", {}, "sha512-tFCKxMKDKK3VEdtUA3EBOS9GmSOS4mbrTjh9v3RnK10BphDMOb6+bxTh++/ae1AyfHyWb6R54O/iaoAtPMZPCg=="],
|
||||
@@ -843,6 +845,8 @@
|
||||
|
||||
"@isaacs/fs-minipass": ["@isaacs/fs-minipass@4.0.1", "", { "dependencies": { "minipass": "^7.0.4" } }, "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w=="],
|
||||
|
||||
"@isaacs/nonrecursive-glob-match": ["@isaacs/nonrecursive-glob-match@1.1.0", "", {}, "sha512-GPm/Dbvk5RLmhRnxXIa7nTpK0xtl4E0wj0MslsuNiJ1FIROU+2+9lgUC/dgF7Ey4QCWhfEsgxilMRMCdHPfDfw=="],
|
||||
|
||||
"@jridgewell/gen-mapping": ["@jridgewell/gen-mapping@0.3.13", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA=="],
|
||||
|
||||
"@jridgewell/resolve-uri": ["@jridgewell/resolve-uri@3.1.2", "", {}, "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw=="],
|
||||
@@ -885,7 +889,7 @@
|
||||
|
||||
"@mermaid-js/parser": ["@mermaid-js/parser@1.2.1", "", { "dependencies": { "@chevrotain/types": "~11.1.2" } }, "sha512-n12NohV3mrUyUL2o93IgG/ifeW9FTyeJn3zDxkhwa8MJ9Fxg3HQMlA3RiGmD/3UnJvheztkjjQAjA2T4LmUcpw=="],
|
||||
|
||||
"@modelcontextprotocol/sdk": ["@modelcontextprotocol/sdk@1.17.5", "", { "dependencies": { "ajv": "^6.12.6", "content-type": "^1.0.5", "cors": "^2.8.5", "cross-spawn": "^7.0.5", "eventsource": "^3.0.2", "eventsource-parser": "^3.0.0", "express": "^5.0.1", "express-rate-limit": "^7.5.0", "pkce-challenge": "^5.0.0", "raw-body": "^3.0.0", "zod": "^3.23.8", "zod-to-json-schema": "^3.24.1" } }, "sha512-QakrKIGniGuRVfWBdMsDea/dx1PNE739QJ7gCM41s9q+qaCYTHCdsIBXQVVXry3mfWAiaM9kT22Hyz53Uw8mfg=="],
|
||||
"@modelcontextprotocol/sdk": ["@modelcontextprotocol/sdk@1.26.0", "", { "dependencies": { "@hono/node-server": "^1.19.9", "ajv": "^8.17.1", "ajv-formats": "^3.0.1", "content-type": "^1.0.5", "cors": "^2.8.5", "cross-spawn": "^7.0.5", "eventsource": "^3.0.2", "eventsource-parser": "^3.0.0", "express": "^5.2.1", "express-rate-limit": "^8.2.1", "hono": "^4.11.4", "jose": "^6.1.3", "json-schema-typed": "^8.0.2", "pkce-challenge": "^5.0.0", "raw-body": "^3.0.0", "zod": "^3.25 || ^4.0", "zod-to-json-schema": "^3.25.1" }, "peerDependencies": { "@cfworker/json-schema": "^4.1.1" }, "optionalPeers": ["@cfworker/json-schema"] }, "sha512-Y5RmPncpiDtTXDbLKswIJzTqu2hyBKxTNsgKqKclDbhIgg1wgtf1fRuvxgTnRfcnxtvvgbIEcqUOzZrJ6iSReg=="],
|
||||
|
||||
"@napi-rs/wasm-runtime": ["@napi-rs/wasm-runtime@1.0.6", "", { "dependencies": { "@emnapi/core": "^1.5.0", "@emnapi/runtime": "^1.5.0", "@tybys/wasm-util": "^0.10.1" } }, "sha512-DXj75ewm11LIWUk198QSKUTxjyRjsBwk09MuMk5DGK+GDUtyPhhEHOGP/Xwwj3DjQXXkivoBirmOnKrLfc0+9g=="],
|
||||
|
||||
@@ -935,9 +939,9 @@
|
||||
|
||||
"@octokit/types": ["@octokit/types@14.1.0", "", { "dependencies": { "@octokit/openapi-types": "^25.1.0" } }, "sha512-1y6DgTy8Jomcpu33N+p5w58l6xyt55Ar2I91RPiIA0xCJBXyUAhXCcmZaDWSANiha7R9a6qJJ2CRomGPZ6f46g=="],
|
||||
|
||||
"@opennextjs/aws": ["@opennextjs/aws@4.1.16", "", { "dependencies": { "@ast-grep/napi": "^0.45.3", "@aws-sdk/client-cloudfront": "3.984.0", "@aws-sdk/client-dynamodb": "3.984.0", "@aws-sdk/client-lambda": "3.984.0", "@aws-sdk/client-s3": "3.984.0", "@aws-sdk/client-sqs": "3.984.0", "@node-minify/core": "^10.5.0", "@node-minify/terser": "^10.5.0", "@tsconfig/node18": "^18.2.7", "aws4fetch": "^1.0.20", "chalk": "^5.6.2", "cookie": "^1.1.1", "esbuild": "0.28.2", "express": "^5.2.1", "path-to-regexp": "^6.3.0", "urlpattern-polyfill": "^10.1.0", "yaml": "^2.9.1" }, "peerDependencies": { "diff": "^9.0.0", "next": ">=15.5.29 <16 || >=16.4.5" }, "optionalPeers": ["diff"], "bin": { "open-next": "dist/index.js" } }, "sha512-eHb6/LCrpr+3DmbmE+/q5GkcrbSs5IRpO/O0kcay7FK5WYDhcML0K5NhO7I9H62z42wscVIi75Hv3ASsXDeEGw=="],
|
||||
"@opennextjs/aws": ["@opennextjs/aws@4.2.1", "", { "dependencies": { "@ast-grep/napi": "^0.45.3", "@aws-sdk/client-cloudfront": "3.984.0", "@aws-sdk/client-dynamodb": "3.984.0", "@aws-sdk/client-lambda": "3.984.0", "@aws-sdk/client-s3": "3.984.0", "@aws-sdk/client-sqs": "3.984.0", "@node-minify/core": "^10.5.0", "@node-minify/terser": "^10.5.0", "@tsconfig/node18": "^18.2.7", "aws4fetch": "^1.0.20", "chalk": "^5.6.2", "cookie": "^1.1.1", "esbuild": "0.28.2", "express": "^5.2.1", "path-to-regexp": "^6.3.0", "urlpattern-polyfill": "^10.1.0", "yaml": "^2.9.1" }, "peerDependencies": { "diff": "^9.0.0", "next": ">=15.5.29 <16 || >=16.4.5" }, "optionalPeers": ["diff"], "bin": { "open-next": "dist/index.js" } }, "sha512-LQAwFWN4/tCxqnosOSIGHQ3SKh43d+sIBy5rwWEw0m6I+Qku7P4FDmfupfZ+MTcdZcs7nG8Rbu0+U6Z6S6ts8g=="],
|
||||
|
||||
"@opennextjs/cloudflare": ["@opennextjs/cloudflare@1.20.17", "", { "dependencies": { "@ast-grep/napi": "^0.45.3", "@dotenvx/dotenvx": "^2.33.0", "@opennextjs/aws": "4.1.16", "ci-info": "^4.2.0", "cloudflare": "^4.4.1", "comment-json": "^4.5.1", "enquirer": "^2.4.1", "glob": "^13.0.6", "resolve.exports": "^2.0.4", "ts-tqdm": "^0.8.6", "yargs": "^18.2.0" }, "peerDependencies": { "next": ">=15.5.29 <16 || >=16.4.5", "rclone.js": "^0.6.6", "wrangler": "^4.148.0" }, "optionalPeers": ["rclone.js"], "bin": { "opennextjs-cloudflare": "dist/cli/index.js" } }, "sha512-jGEC9ue8LLHvOFXp62LjDUSSz7JpD+PQB+Y3r0lU78PtQ84wI16+EMF9TXEDkTek3g3fGWTLTI07pbZt8/gj8w=="],
|
||||
"@opennextjs/cloudflare": ["@opennextjs/cloudflare@1.20.19", "", { "dependencies": { "@ast-grep/napi": "^0.45.3", "@dotenvx/dotenvx": "^2.33.0", "@opennextjs/aws": "4.2.1", "ci-info": "^4.2.0", "cloudflare": "^4.4.1", "comment-json": "^4.5.1", "enquirer": "^2.4.1", "esbuild": "0.28.2", "glob": "^14.0.6", "resolve.exports": "^2.0.4", "ts-tqdm": "^0.8.6", "yargs": "^18.2.0" }, "peerDependencies": { "next": ">=15.5.29 <16 || >=16.4.5", "rclone.js": "^0.6.6", "wrangler": "^4.148.0" }, "optionalPeers": ["rclone.js"], "bin": { "opennextjs-cloudflare": "dist/cli/index.js" } }, "sha512-OnKUZ+Ljaj9E9L/pk5Ove2kCmIUEk4hPmgc+YLE1gIZyg/isir+PKUlRIviV88N550/GA4yugcPN7KEv0es72A=="],
|
||||
|
||||
"@opentelemetry/api": ["@opentelemetry/api@1.9.0", "", {}, "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg=="],
|
||||
|
||||
@@ -1615,7 +1619,7 @@
|
||||
|
||||
"ai": ["ai@4.3.0", "", { "dependencies": { "@ai-sdk/provider": "1.1.0", "@ai-sdk/provider-utils": "2.2.4", "@ai-sdk/react": "1.2.6", "@ai-sdk/ui-utils": "1.2.5", "@opentelemetry/api": "1.9.0", "jsondiffpatch": "0.6.0" }, "peerDependencies": { "react": "^18 || ^19 || ^19.0.0-rc", "zod": "^3.23.8" }, "optionalPeers": ["react"] }, "sha512-PxyQYKhWaU3LiZEpeKRaekVonZIbWdKAwgnqm0CSAxy1MFufmYEC5SM5Mc9uiK2DoHcbAL3d1jyaQ2fSDAJL8w=="],
|
||||
|
||||
"ajv": ["ajv@6.12.6", "", { "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" } }, "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g=="],
|
||||
"ajv": ["ajv@8.20.0", "", { "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2" } }, "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA=="],
|
||||
|
||||
"ajv-draft-04": ["ajv-draft-04@1.0.0", "", { "peerDependencies": { "ajv": "^8.5.0" }, "optionalPeers": ["ajv"] }, "sha512-mv00Te6nmYbRp5DCwclxtt7yV/joXJPGS7nM+97GdxvuttCOfgI3K4U25zboyeX0O+myI8ERluxQe5wljMmVIw=="],
|
||||
|
||||
@@ -1643,8 +1647,6 @@
|
||||
|
||||
"array-differ": ["array-differ@3.0.0", "", {}, "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg=="],
|
||||
|
||||
"array-flatten": ["array-flatten@3.0.0", "", {}, "sha512-zPMVc3ZYlGLNk4mpK1NzP2wg0ml9t7fUgDsayR5Y5rSzxQilzR9FGu/EH2jQOcKSAeAfWeylyW8juy3OkWRvNA=="],
|
||||
|
||||
"array-timsort": ["array-timsort@1.0.3", "", {}, "sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ=="],
|
||||
|
||||
"array-union": ["array-union@2.1.0", "", {}, "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw=="],
|
||||
@@ -1695,7 +1697,7 @@
|
||||
|
||||
"blake3-wasm": ["blake3-wasm@2.1.5", "", {}, "sha512-F1+K8EbfOZE49dtoPtmxUQrpXaBIl3ICvasLh+nJta0xkz+9kF/7uet9fLnwKqhDrmj6g+6K3Tw9yQPUg2ka5g=="],
|
||||
|
||||
"body-parser": ["body-parser@2.0.2", "", { "dependencies": { "bytes": "3.1.2", "content-type": "~1.0.5", "debug": "3.1.0", "destroy": "1.2.0", "http-errors": "2.0.0", "iconv-lite": "0.5.2", "on-finished": "2.4.1", "qs": "6.13.0", "raw-body": "^3.0.0", "type-is": "~1.6.18" } }, "sha512-SNMk0OONlQ01uk8EPeiBvTW7W4ovpL5b1O3t1sjpPgfxOQ6BqQJ6XjxinDPR79Z6HdcD5zBBwr5ssiTlgdNztQ=="],
|
||||
"body-parser": ["body-parser@2.2.1", "", { "dependencies": { "bytes": "^3.1.2", "content-type": "^1.0.5", "debug": "^4.4.3", "http-errors": "^2.0.0", "iconv-lite": "^0.7.0", "on-finished": "^2.4.1", "qs": "^6.14.0", "raw-body": "^3.0.1", "type-is": "^2.0.1" } }, "sha512-nfDwkulwiZYQIGwxdy0RUmowMhKcFVcYXUU7m4QlKYim1rUtg83xm2yjZ40QjDuc291AJjjeSc9b++AWHSgSHw=="],
|
||||
|
||||
"boolbase": ["boolbase@1.0.0", "", {}, "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww=="],
|
||||
|
||||
@@ -1723,8 +1725,6 @@
|
||||
|
||||
"cacheable": ["cacheable@1.8.9", "", { "dependencies": { "hookified": "^1.7.1", "keyv": "^5.3.1" } }, "sha512-FicwAUyWnrtnd4QqYAoRlNs44/a1jTL7XDKqm5gJ90wz1DQPlC7U2Rd1Tydpv+E7WAr4sQHuw8Q8M3nZMAyecQ=="],
|
||||
|
||||
"call-bind": ["call-bind@1.0.7", "", { "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", "function-bind": "^1.1.2", "get-intrinsic": "^1.2.4", "set-function-length": "^1.2.1" } }, "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w=="],
|
||||
|
||||
"call-bind-apply-helpers": ["call-bind-apply-helpers@1.0.2", "", { "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" } }, "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ=="],
|
||||
|
||||
"call-bound": ["call-bound@1.0.4", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "get-intrinsic": "^1.3.0" } }, "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg=="],
|
||||
@@ -1923,8 +1923,6 @@
|
||||
|
||||
"deepmerge": ["deepmerge@4.3.1", "", {}, "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A=="],
|
||||
|
||||
"define-data-property": ["define-data-property@1.1.4", "", { "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", "gopd": "^1.0.1" } }, "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A=="],
|
||||
|
||||
"defu": ["defu@6.1.4", "", {}, "sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg=="],
|
||||
|
||||
"degenerator": ["degenerator@5.0.1", "", { "dependencies": { "ast-types": "^0.13.4", "escodegen": "^2.1.0", "esprima": "^4.0.1" } }, "sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ=="],
|
||||
@@ -2011,7 +2009,7 @@
|
||||
|
||||
"error-stack-parser-es": ["error-stack-parser-es@1.0.5", "", {}, "sha512-5qucVt2XcuGMcEGgWI7i+yZpmpByQ8J1lHhcL7PwqCwu9FPP3VUXzT4ltHe5i2z9dePwEHcDVOAfSnHsOlCXRA=="],
|
||||
|
||||
"es-define-property": ["es-define-property@1.0.0", "", { "dependencies": { "get-intrinsic": "^1.2.4" } }, "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ=="],
|
||||
"es-define-property": ["es-define-property@1.0.1", "", {}, "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g=="],
|
||||
|
||||
"es-errors": ["es-errors@1.3.0", "", {}, "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw=="],
|
||||
|
||||
@@ -2069,9 +2067,9 @@
|
||||
|
||||
"execa": ["execa@3.2.0", "", { "dependencies": { "cross-spawn": "^7.0.0", "get-stream": "^5.0.0", "human-signals": "^1.1.1", "is-stream": "^2.0.0", "merge-stream": "^2.0.0", "npm-run-path": "^4.0.0", "onetime": "^5.1.0", "p-finally": "^2.0.0", "signal-exit": "^3.0.2", "strip-final-newline": "^2.0.0" } }, "sha512-kJJfVbI/lZE1PZYDI5VPxp8zXPO9rtxOkhpZ0jMKha56AI9y2gGVC6bkukStQf0ka5Rh15BA5m7cCCH4jmHqkw=="],
|
||||
|
||||
"express": ["express@5.0.1", "", { "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.0.1", "content-disposition": "^1.0.0", "content-type": "~1.0.4", "cookie": "0.7.1", "cookie-signature": "^1.2.1", "debug": "4.3.6", "depd": "2.0.0", "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", "finalhandler": "^2.0.0", "fresh": "2.0.0", "http-errors": "2.0.0", "merge-descriptors": "^2.0.0", "methods": "~1.1.2", "mime-types": "^3.0.0", "on-finished": "2.4.1", "once": "1.4.0", "parseurl": "~1.3.3", "proxy-addr": "~2.0.7", "qs": "6.13.0", "range-parser": "~1.2.1", "router": "^2.0.0", "safe-buffer": "5.2.1", "send": "^1.1.0", "serve-static": "^2.1.0", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "^2.0.0", "utils-merge": "1.0.1", "vary": "~1.1.2" } }, "sha512-ORF7g6qGnD+YtUG9yx4DFoqCShNMmUKiXuT5oWMHiOvt/4WFbHC6yCwQMTSBMno7AqntNCAzzcnnjowRkTL9eQ=="],
|
||||
"express": ["express@5.2.1", "", { "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.1", "content-disposition": "^1.0.0", "content-type": "^1.0.5", "cookie": "^0.7.1", "cookie-signature": "^1.2.1", "debug": "^4.4.0", "depd": "^2.0.0", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "etag": "^1.8.1", "finalhandler": "^2.1.0", "fresh": "^2.0.0", "http-errors": "^2.0.0", "merge-descriptors": "^2.0.0", "mime-types": "^3.0.0", "on-finished": "^2.4.1", "once": "^1.4.0", "parseurl": "^1.3.3", "proxy-addr": "^2.0.7", "qs": "^6.14.0", "range-parser": "^1.2.1", "router": "^2.2.0", "send": "^1.1.0", "serve-static": "^2.2.0", "statuses": "^2.0.1", "type-is": "^2.0.1", "vary": "^1.1.2" } }, "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw=="],
|
||||
|
||||
"express-rate-limit": ["express-rate-limit@7.5.1", "", { "peerDependencies": { "express": ">= 4.11" } }, "sha512-7iN8iPMDzOMHPUYllBEsQdWVB6fPDMPqwjBaFrgr4Jgr/+okjvzAy+UHlYYL/Vs0OsOrMkwS6PJDkFlJwoxUnw=="],
|
||||
"express-rate-limit": ["express-rate-limit@8.7.5", "", { "dependencies": { "debug": "^4.4.3", "ip-address": "^10.2.0" }, "peerDependencies": { "express": ">= 4.11" } }, "sha512-wi+v38cx2EqD0JnhE/e74o5tFqKWUOAPFJIgyEiqJ8v2MNpoOAA3kI2hXYOI+YM+HE5yqbdAlVxm2GqOIeYOgA=="],
|
||||
|
||||
"ext": ["ext@1.7.0", "", { "dependencies": { "type": "^2.7.2" } }, "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw=="],
|
||||
|
||||
@@ -2085,8 +2083,6 @@
|
||||
|
||||
"fast-glob": ["fast-glob@3.3.3", "", { "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.2", "merge2": "^1.3.0", "micromatch": "^4.0.8" } }, "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg=="],
|
||||
|
||||
"fast-json-stable-stringify": ["fast-json-stable-stringify@2.1.0", "", {}, "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="],
|
||||
|
||||
"fast-redact": ["fast-redact@3.5.0", "", {}, "sha512-dwsoQlS7h9hMeYUq1W++23NDcBLV4KqONnITDV9DjfS3q1SgDGVrBdvvTLUotWtPSD7asWDV9/CmsZPy8Hf70A=="],
|
||||
|
||||
"fast-uri": ["fast-uri@3.0.2", "", {}, "sha512-GR6f0hD7XXyNJa25Tb9BuIdN0tdr+0BMi6/CJPH3wJO1JjNG3n/VsSw38AwRdKZABm8lGbPfakLRkYzx2V9row=="],
|
||||
@@ -2113,7 +2109,7 @@
|
||||
|
||||
"fill-range": ["fill-range@7.1.1", "", { "dependencies": { "to-regex-range": "^5.0.1" } }, "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg=="],
|
||||
|
||||
"finalhandler": ["finalhandler@2.0.0", "", { "dependencies": { "debug": "2.6.9", "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "on-finished": "2.4.1", "parseurl": "~1.3.3", "statuses": "2.0.1", "unpipe": "~1.0.0" } }, "sha512-MX6Zo2adDViYh+GcxxB1dpO43eypOGUOL12rLCOTMQv/DfIbpSJUy4oQIIZhVZkH9e+bZWKMon0XHFEju16tkQ=="],
|
||||
"finalhandler": ["finalhandler@2.1.1", "", { "dependencies": { "debug": "^4.4.0", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "on-finished": "^2.4.1", "parseurl": "^1.3.3", "statuses": "^2.0.1" } }, "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA=="],
|
||||
|
||||
"find-up": ["find-up@4.1.0", "", { "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" } }, "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw=="],
|
||||
|
||||
@@ -2155,7 +2151,7 @@
|
||||
|
||||
"get-east-asian-width": ["get-east-asian-width@1.7.0", "", {}, "sha512-XjH1AECxf0giL2V1aU8vKyRR2ppRUb5c0EvT7zuJTokQ74bNo52zOtghqdWIqrhUD79fo3x0WfKZdOqxF6LG1Q=="],
|
||||
|
||||
"get-intrinsic": ["get-intrinsic@1.2.4", "", { "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2", "has-proto": "^1.0.1", "has-symbols": "^1.0.3", "hasown": "^2.0.0" } }, "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ=="],
|
||||
"get-intrinsic": ["get-intrinsic@1.3.0", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", "math-intrinsics": "^1.1.0" } }, "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ=="],
|
||||
|
||||
"get-own-enumerable-keys": ["get-own-enumerable-keys@1.0.0", "", {}, "sha512-PKsK2FSrQCyxcGHsGrLDcK0lx+0Ke+6e8KFFozA9/fIQLhQzPaRvJFdcz7+Axg3jUH/Mq+NI4xa5u/UT2tQskA=="],
|
||||
|
||||
@@ -2173,7 +2169,7 @@
|
||||
|
||||
"github-slugger": ["github-slugger@2.0.0", "", {}, "sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw=="],
|
||||
|
||||
"glob": ["glob@13.0.6", "", { "dependencies": { "minimatch": "^10.2.2", "minipass": "^7.1.3", "path-scurry": "^2.0.2" } }, "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw=="],
|
||||
"glob": ["glob@14.0.6", "", { "dependencies": { "minimatch": "^11.0.5", "minipass": "^7.1.3", "path-scurry": "^3.0.0" } }, "sha512-OwXjVP2svY5EyLY75Vek96C8qK43gqrt4xsZ+qSILdnaEiJPXkd62mcfUSNx/TQErQRdu5uM5kF67sfONragKw=="],
|
||||
|
||||
"glob-parent": ["glob-parent@5.1.2", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="],
|
||||
|
||||
@@ -2187,7 +2183,7 @@
|
||||
|
||||
"google-font-metadata": ["google-font-metadata@6.0.7", "", { "dependencies": { "@evan/concurrency": "^0.0.3", "@octokit/core": "^6.1.2", "cac": "^6.7.14", "consola": "^3.3.3", "deepmerge": "^4.3.1", "json-stringify-pretty-compact": "^4.0.0", "linkedom": "^0.18.6", "pathe": "^1.1.2", "picocolors": "^1.1.1", "playwright": "^1.49.1", "stylis": "^4.3.4", "zod": "^3.24.1" }, "bin": { "gfm": "dist/cli.mjs" } }, "sha512-Zw+AmoVRZNfQdis1+cYu0Zo6OWk+SQNEDzGKgRjC8nTopghZw2AtfcY6R9MWLR04gsZBkTNYPE8Pahm9i4Z/aA=="],
|
||||
|
||||
"gopd": ["gopd@1.0.1", "", { "dependencies": { "get-intrinsic": "^1.1.3" } }, "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA=="],
|
||||
"gopd": ["gopd@1.2.0", "", {}, "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg=="],
|
||||
|
||||
"graceful-fs": ["graceful-fs@4.2.11", "", {}, "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="],
|
||||
|
||||
@@ -2197,11 +2193,7 @@
|
||||
|
||||
"has-flag": ["has-flag@4.0.0", "", {}, "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="],
|
||||
|
||||
"has-property-descriptors": ["has-property-descriptors@1.0.2", "", { "dependencies": { "es-define-property": "^1.0.0" } }, "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg=="],
|
||||
|
||||
"has-proto": ["has-proto@1.0.3", "", {}, "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q=="],
|
||||
|
||||
"has-symbols": ["has-symbols@1.0.3", "", {}, "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A=="],
|
||||
"has-symbols": ["has-symbols@1.1.0", "", {}, "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ=="],
|
||||
|
||||
"hasown": ["hasown@2.0.2", "", { "dependencies": { "function-bind": "^1.1.2" } }, "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ=="],
|
||||
|
||||
@@ -2245,6 +2237,8 @@
|
||||
|
||||
"highlightjs-vue": ["highlightjs-vue@1.0.0", "", {}, "sha512-PDEfEF102G23vHmPhLyPboFCD+BkMGu+GuJe2d9/eH4FsCwvgBpnc9n0pGE+ffKdph38s6foEZiEjdgHdzp+IA=="],
|
||||
|
||||
"hono": ["hono@4.13.21", "", {}, "sha512-h9UsguqfVk4kjUwLvQpHOmOaJpW10jz9lp8bvKUUa04wJG/fabKFBqXZ06D6LFaeKQZtUZRVeg0gfkTTEsX7Mw=="],
|
||||
|
||||
"hookable": ["hookable@5.5.3", "", {}, "sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ=="],
|
||||
|
||||
"hookified": ["hookified@1.8.1", "", {}, "sha512-GrO2l93P8xCWBSTBX9l2BxI78VU/MAAYag+pG8curS3aBGy0++ZlxrQ7PdUOUVMbn5BwkGb6+eRrnf43ipnFEA=="],
|
||||
@@ -2293,7 +2287,7 @@
|
||||
|
||||
"internmap": ["internmap@1.0.1", "", {}, "sha512-lDB5YccMydFBtasVtxnZ3MRBHuaoE8GKsppq+EchKL2U4nK/DmEpPHNH8MZe5HkMtpSiTSOZwfN0tzYjO/lJEw=="],
|
||||
|
||||
"ip-address": ["ip-address@10.1.0", "", {}, "sha512-XXADHxXmvT9+CRxhXg56LJovE+bmWnEWB78LB83VZTprKTmaC5QfruXocxzTZ2Kl0DNwKuBdlIhjL8LeY8Sf8Q=="],
|
||||
"ip-address": ["ip-address@10.7.6", "", {}, "sha512-00LYkM6byILa9eQIx6qoaXCM40xTLd56AZ4vyaPW3YTyb49VZYPo5xsiAq4tuQ54GH4R7gVdYScJ1B7B77PuTg=="],
|
||||
|
||||
"ipaddr.js": ["ipaddr.js@1.9.1", "", {}, "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="],
|
||||
|
||||
@@ -2363,7 +2357,9 @@
|
||||
|
||||
"json-schema-to-ts": ["json-schema-to-ts@1.6.4", "", { "dependencies": { "@types/json-schema": "^7.0.6", "ts-toolbelt": "^6.15.5" } }, "sha512-pR4yQ9DHz6itqswtHCm26mw45FSNfQ9rEQjosaZErhn5J3J2sIViQiz8rDaezjKAhFGpmsoczYVBgGHzFw/stA=="],
|
||||
|
||||
"json-schema-traverse": ["json-schema-traverse@0.4.1", "", {}, "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="],
|
||||
"json-schema-traverse": ["json-schema-traverse@1.0.0", "", {}, "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="],
|
||||
|
||||
"json-schema-typed": ["json-schema-typed@8.0.2", "", {}, "sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA=="],
|
||||
|
||||
"json-stringify-deterministic": ["json-stringify-deterministic@1.0.12", "", {}, "sha512-q3PN0lbUdv0pmurkBNdJH3pfFvOTL/Zp0lquqpvcjfKzt6Y0j49EPHAmVHCAS4Ceq/Y+PejWTzyiVpoY71+D6g=="],
|
||||
|
||||
@@ -2485,7 +2481,7 @@
|
||||
|
||||
"mathml-tag-names": ["mathml-tag-names@2.1.3", "", {}, "sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg=="],
|
||||
|
||||
"mcp-handler": ["mcp-handler@1.0.2", "", { "dependencies": { "chalk": "^5.3.0", "commander": "^11.1.0", "redis": "^4.6.0" }, "peerDependencies": { "@modelcontextprotocol/sdk": "^1.12.0", "next": ">=13.0.0" }, "optionalPeers": ["next"], "bin": { "mcp-adapter": "dist/cli/index.js", "mcp-handler": "dist/cli/index.js", "create-mcp-route": "dist/cli/index.js" } }, "sha512-dTZR0KZ0rqIORHFUmG4wFMJwp608gtc2x602hxaFQOmb0L2Ahc++Vcc6QoRWr92VTK7DQmEIqrHbhVCjomTplg=="],
|
||||
"mcp-handler": ["mcp-handler@1.1.0", "", { "dependencies": { "chalk": "^5.3.0", "commander": "^11.1.0", "redis": "^4.6.0" }, "peerDependencies": { "@modelcontextprotocol/sdk": "1.26.0", "next": ">=13.0.0" }, "optionalPeers": ["next"], "bin": { "mcp-adapter": "dist/cli/index.js", "mcp-handler": "dist/cli/index.js", "create-mcp-route": "dist/cli/index.js" } }, "sha512-MVCES7g18gcoZy+R/3v5nadkUMzMAWdos8jRl6DyljOKvd2/ZKDmwlCjL6zp4vo+7FeCXOYL1uWinHWlkKAAUg=="],
|
||||
|
||||
"mdast-util-find-and-replace": ["mdast-util-find-and-replace@3.0.1", "", { "dependencies": { "@types/mdast": "^4.0.0", "escape-string-regexp": "^5.0.0", "unist-util-is": "^6.0.0", "unist-util-visit-parents": "^6.0.0" } }, "sha512-SG21kZHGC3XRTSUhtofZkBzZTJNM5ecCi0SK2IMKmSXR8vO3peL+kb1O0z7Zl83jKtutG4k5Wv/W7V3/YHvzPA=="],
|
||||
|
||||
@@ -2529,8 +2525,6 @@
|
||||
|
||||
"mermaid": ["mermaid@11.16.1", "", { "dependencies": { "@braintree/sanitize-url": "^7.1.2", "@iconify/utils": "^3.0.2", "@mermaid-js/parser": "^1.2.0", "@types/d3": "^7.4.3", "@upsetjs/venn.js": "^2.0.0", "cytoscape": "^3.33.3", "cytoscape-cose-bilkent": "^4.1.0", "cytoscape-fcose": "^2.2.0", "d3": "^7.9.0", "d3-sankey": "^0.12.3", "dagre-d3-es": "7.0.14", "dayjs": "^1.11.20", "dompurify": "^3.3.3", "es-toolkit": "^1.45.1", "katex": "^0.16.45", "khroma": "^2.1.0", "marked": "^16.3.0", "roughjs": "^4.6.6", "stylis": "^4.3.6", "ts-dedent": "^2.2.0", "uuid": "^11.1.0 || ^12 || ^13 || ^14.0.0" } }, "sha512-TQsq6u22fAn3rek5VOubrhKPo1g5hwC3FXUN9hiyupTckcYiGuuKGkNQrKYwGJkXUxZdojwRG46gsSCFZMDp4g=="],
|
||||
|
||||
"methods": ["methods@1.1.2", "", {}, "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w=="],
|
||||
|
||||
"micro": ["micro@9.3.5-canary.3", "", { "dependencies": { "arg": "4.1.0", "content-type": "1.0.4", "raw-body": "2.4.1" }, "bin": { "micro": "./bin/micro.js" } }, "sha512-viYIo9PefV+w9dvoIBh1gI44Mvx1BOk67B4BpC2QK77qdY0xZF0Q+vWLt/BII6cLkIc8rLmSIcJaB/OrXXKe1g=="],
|
||||
|
||||
"microdiff": ["microdiff@1.5.0", "", {}, "sha512-Drq+/THMvDdzRYrK0oxJmOKiC24ayUV8ahrt8l3oRK51PWt6gdtrIGrlIH3pT/lFh1z93FbAcidtsHcWbnRz8Q=="],
|
||||
@@ -2603,7 +2597,7 @@
|
||||
|
||||
"miniflare": ["miniflare@4.20260401.0", "", { "dependencies": { "@cspotcode/source-map-support": "0.8.1", "sharp": "^0.34.5", "undici": "7.24.4", "workerd": "1.20260401.1", "ws": "8.18.0", "youch": "4.1.0-beta.10" }, "bin": { "miniflare": "bootstrap.js" } }, "sha512-lngHPzZFN9sxYG/mhzvnWiBMNVAN5MsO/7g32ttJ07rymtiK/ZBalODTKb8Od+BQdlU5DOR4CjVt9NydjnUyYg=="],
|
||||
|
||||
"minimatch": ["minimatch@10.2.6", "", { "dependencies": { "brace-expansion": "^5.0.8" } }, "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A=="],
|
||||
"minimatch": ["minimatch@11.0.9", "", { "dependencies": { "@isaacs/nonrecursive-glob-match": "^1.1.0", "brace-expansion": "^5.0.12" } }, "sha512-KCFkfyjqerNlSstjlhIGNXIKZGA/6O4V4RlhZ+Dsr621SPPw0mzlypE9D9ZOoPiVefHID+j7/XuMMlqfD/F60Q=="],
|
||||
|
||||
"minipass": ["minipass@7.1.3", "", {}, "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A=="],
|
||||
|
||||
@@ -2667,7 +2661,7 @@
|
||||
|
||||
"object-identity": ["object-identity@0.2.1", "", {}, "sha512-itX2N4m0IvaLhFZMi9YkW4nFML6FshKCCpnn6iKJZVIkCNM/ZRaG4t1bzD2ncaW4r6cHJa59XY+7oZAH7tg8tA=="],
|
||||
|
||||
"object-inspect": ["object-inspect@1.13.2", "", {}, "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g=="],
|
||||
"object-inspect": ["object-inspect@1.13.4", "", {}, "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew=="],
|
||||
|
||||
"obliterator": ["obliterator@1.6.1", "", {}, "sha512-9WXswnqINnnhOG/5SLimUlzuU1hFJUc8zkwyD59Sd+dPOMf05PmnYG/d6Q7HZ+KmgkZJa1PxRso6QdM3sTNHig=="],
|
||||
|
||||
@@ -2745,7 +2739,7 @@
|
||||
|
||||
"path-parse": ["path-parse@1.0.7", "", {}, "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="],
|
||||
|
||||
"path-scurry": ["path-scurry@2.0.2", "", { "dependencies": { "lru-cache": "^11.0.0", "minipass": "^7.1.2" } }, "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg=="],
|
||||
"path-scurry": ["path-scurry@3.0.0", "", { "dependencies": { "lru-cache": "^11.0.0", "minipass": "^7.1.2" } }, "sha512-1pTbQqH1wIwMi/eleQ5leFTTCkzFsPcgXNjwOA8YGGW/W4/kHT3dssE7Z6NH+zuqNLOzOB0uaD61yl7cAcVhgg=="],
|
||||
|
||||
"path-to-regexp": ["path-to-regexp@6.3.0", "", {}, "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ=="],
|
||||
|
||||
@@ -2825,7 +2819,7 @@
|
||||
|
||||
"punycode": ["punycode@2.3.1", "", {}, "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg=="],
|
||||
|
||||
"qs": ["qs@6.13.0", "", { "dependencies": { "side-channel": "^1.0.6" } }, "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg=="],
|
||||
"qs": ["qs@6.14.0", "", { "dependencies": { "side-channel": "^1.1.0" } }, "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w=="],
|
||||
|
||||
"quansync": ["quansync@0.2.11", "", {}, "sha512-AifT7QEbW9Nri4tAwR5M/uzpBuqfZf+zwaEM/QkzEjj7NBuFD2rBuy0K3dE+8wltbezDV7JMA0WfnCPYRSYbXA=="],
|
||||
|
||||
@@ -2843,7 +2837,7 @@
|
||||
|
||||
"range-parser": ["range-parser@1.2.1", "", {}, "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg=="],
|
||||
|
||||
"raw-body": ["raw-body@3.0.0", "", { "dependencies": { "bytes": "3.1.2", "http-errors": "2.0.0", "iconv-lite": "0.6.3", "unpipe": "1.0.0" } }, "sha512-RmkhL8CAyCRPXCE28MMH0z2PNWQBNk2Q09ZdxM9IOOXwxwZbN+qbWaatPkdkWIKL2ZVDImrN/pK5HTRz2PcS4g=="],
|
||||
"raw-body": ["raw-body@3.0.2", "", { "dependencies": { "bytes": "~3.1.2", "http-errors": "~2.0.1", "iconv-lite": "~0.7.0", "unpipe": "~1.0.0" } }, "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA=="],
|
||||
|
||||
"react": ["react@19.1.0", "", {}, "sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg=="],
|
||||
|
||||
@@ -2921,7 +2915,7 @@
|
||||
|
||||
"roughjs": ["roughjs@4.6.6", "", { "dependencies": { "hachure-fill": "^0.5.2", "path-data-parser": "^0.1.0", "points-on-curve": "^0.2.0", "points-on-path": "^0.2.1" } }, "sha512-ZUz/69+SYpFN/g/lUlo2FXcIjRkSu3nDarreVdGGndHEBJ6cXPdKguS8JGxwj5HA5xIbVKSmLgr5b3AWxtRfvQ=="],
|
||||
|
||||
"router": ["router@2.0.0", "", { "dependencies": { "array-flatten": "3.0.0", "is-promise": "4.0.0", "methods": "~1.1.2", "parseurl": "~1.3.3", "path-to-regexp": "^8.0.0", "setprototypeof": "1.2.0", "utils-merge": "1.0.1" } }, "sha512-dIM5zVoG8xhC6rnSN8uoAgFARwTE7BQs8YwHEvK0VCmfxQXMaOuA1uiR1IPwsW7JyK5iTt7Od/TC9StasS2NPQ=="],
|
||||
"router": ["router@2.2.0", "", { "dependencies": { "debug": "^4.4.0", "depd": "^2.0.0", "is-promise": "^4.0.0", "parseurl": "^1.3.3", "path-to-regexp": "^8.0.0" } }, "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ=="],
|
||||
|
||||
"rss-parser": ["rss-parser@3.13.0", "", { "dependencies": { "entities": "^2.0.3", "xml2js": "^0.5.0" } }, "sha512-7jWUBV5yGN3rqMMj7CZufl/291QAhvrrGpDNE4k/02ZchL0npisiYYqULF71jCEKoIiHvK/Q2e6IkDwPziT7+w=="],
|
||||
|
||||
@@ -2945,12 +2939,10 @@
|
||||
|
||||
"send": ["send@1.1.0", "", { "dependencies": { "debug": "^4.3.5", "destroy": "^1.2.0", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "etag": "^1.8.1", "fresh": "^0.5.2", "http-errors": "^2.0.0", "mime-types": "^2.1.35", "ms": "^2.1.3", "on-finished": "^2.4.1", "range-parser": "^1.2.1", "statuses": "^2.0.1" } }, "sha512-v67WcEouB5GxbTWL/4NeToqcZiAWEq90N888fczVArY8A79J0L4FD7vj5hm3eUMua5EpoQ59wa/oovY6TLvRUA=="],
|
||||
|
||||
"serve-static": ["serve-static@2.1.0", "", { "dependencies": { "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "parseurl": "^1.3.3", "send": "^1.0.0" } }, "sha512-A3We5UfEjG8Z7VkDv6uItWw6HY2bBSBJT1KtVESn6EOoOr2jAxNhxWCLY3jDE2WcuHXByWju74ck3ZgLwL8xmA=="],
|
||||
"serve-static": ["serve-static@2.2.0", "", { "dependencies": { "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "parseurl": "^1.3.3", "send": "^1.2.0" } }, "sha512-61g9pCh0Vnh7IutZjtLGGpTA355+OPn2TyDv/6ivP2h/AdAVX9azsoxmg2/M6nZeQZNYBEwIcsne1mJd9oQItQ=="],
|
||||
|
||||
"server-only": ["server-only@0.0.1", "", {}, "sha512-qepMx2JxAa5jjfzxG79yPPq+8BuFToHd1hm7kI+Z4zAq1ftQiP7HcxMhDDItrbtwVeLg/cY2JnKnrcFkmiswNA=="],
|
||||
|
||||
"set-function-length": ["set-function-length@1.2.2", "", { "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", "function-bind": "^1.1.2", "get-intrinsic": "^1.2.4", "gopd": "^1.0.1", "has-property-descriptors": "^1.0.2" } }, "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg=="],
|
||||
|
||||
"setprototypeof": ["setprototypeof@1.2.0", "", {}, "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="],
|
||||
|
||||
"sharp": ["sharp@0.35.5", "", { "dependencies": { "@img/colour": "^1.1.0", "detect-libc": "^2.1.2", "semver": "^7.8.5" }, "optionalDependencies": { "@img/sharp-darwin-arm64": "0.35.5", "@img/sharp-darwin-x64": "0.35.5", "@img/sharp-freebsd-wasm32": "0.35.5", "@img/sharp-libvips-darwin-arm64": "1.3.4", "@img/sharp-libvips-darwin-x64": "1.3.4", "@img/sharp-libvips-linux-arm": "1.3.4", "@img/sharp-libvips-linux-arm64": "1.3.4", "@img/sharp-libvips-linux-ppc64": "1.3.4", "@img/sharp-libvips-linux-riscv64": "1.3.4", "@img/sharp-libvips-linux-s390x": "1.3.4", "@img/sharp-libvips-linux-x64": "1.3.4", "@img/sharp-libvips-linuxmusl-arm64": "1.3.4", "@img/sharp-libvips-linuxmusl-x64": "1.3.4", "@img/sharp-linux-arm": "0.35.5", "@img/sharp-linux-arm64": "0.35.5", "@img/sharp-linux-ppc64": "0.35.5", "@img/sharp-linux-riscv64": "0.35.5", "@img/sharp-linux-s390x": "0.35.5", "@img/sharp-linux-x64": "0.35.5", "@img/sharp-linuxmusl-arm64": "0.35.5", "@img/sharp-linuxmusl-x64": "0.35.5", "@img/sharp-webcontainers-wasm32": "0.35.5", "@img/sharp-win32-arm64": "0.35.5", "@img/sharp-win32-ia32": "0.35.5", "@img/sharp-win32-x64": "0.35.5" }, "peerDependencies": { "@types/node": "*" }, "optionalPeers": ["@types/node"] }, "sha512-Ywn4OnzGukp7CDMrp08RQ50YKmuwG47brZgIVPTvBaaAfQlRlygrRqSrxdCiL9M+LlzLBiJ68IR1QqvzHyjC7g=="],
|
||||
@@ -2963,7 +2955,7 @@
|
||||
|
||||
"shiki": ["shiki@3.21.0", "", { "dependencies": { "@shikijs/core": "3.21.0", "@shikijs/engine-javascript": "3.21.0", "@shikijs/engine-oniguruma": "3.21.0", "@shikijs/langs": "3.21.0", "@shikijs/themes": "3.21.0", "@shikijs/types": "3.21.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-N65B/3bqL/TI2crrXr+4UivctrAGEjmsib5rPMMPpFp1xAx/w03v8WZ9RDDFYteXoEgY7qZ4HGgl5KBIu1153w=="],
|
||||
|
||||
"side-channel": ["side-channel@1.0.6", "", { "dependencies": { "call-bind": "^1.0.7", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.4", "object-inspect": "^1.13.1" } }, "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA=="],
|
||||
"side-channel": ["side-channel@1.1.0", "", { "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.3", "side-channel-list": "^1.0.0", "side-channel-map": "^1.0.1", "side-channel-weakmap": "^1.0.2" } }, "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw=="],
|
||||
|
||||
"side-channel-list": ["side-channel-list@1.0.0", "", { "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.3" } }, "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA=="],
|
||||
|
||||
@@ -3137,7 +3129,7 @@
|
||||
|
||||
"type-fest": ["type-fest@5.0.0", "", { "dependencies": { "tagged-tag": "^1.0.0" } }, "sha512-GeJop7+u7BYlQ6yQCAY1nBQiRSHR+6OdCEtd8Bwp9a3NK3+fWAVjOaPKJDteB9f6cIJ0wt4IfnScjLG450EpXA=="],
|
||||
|
||||
"type-is": ["type-is@2.0.0", "", { "dependencies": { "content-type": "^1.0.5", "media-typer": "^1.1.0", "mime-types": "^3.0.0" } }, "sha512-gd0sGezQYCbWSbkZr75mln4YBidWUN60+devscpLF5mtRDUpiaTvKpBNrdaCvel1NdR2k6vclXybU5fBd2i+nw=="],
|
||||
"type-is": ["type-is@2.0.1", "", { "dependencies": { "content-type": "^1.0.5", "media-typer": "^1.1.0", "mime-types": "^3.0.0" } }, "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw=="],
|
||||
|
||||
"typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="],
|
||||
|
||||
@@ -3191,8 +3183,6 @@
|
||||
|
||||
"util-deprecate": ["util-deprecate@1.0.2", "", {}, "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="],
|
||||
|
||||
"utils-merge": ["utils-merge@1.0.1", "", {}, "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA=="],
|
||||
|
||||
"uuid": ["uuid@11.1.0", "", { "bin": { "uuid": "dist/esm/bin/uuid" } }, "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A=="],
|
||||
|
||||
"vary": ["vary@1.1.2", "", {}, "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg=="],
|
||||
@@ -3283,7 +3273,7 @@
|
||||
|
||||
"youch-core": ["youch-core@0.3.3", "", { "dependencies": { "@poppinss/exception": "^1.2.2", "error-stack-parser-es": "^1.0.5" } }, "sha512-ho7XuGjLaJ2hWHoK8yFnsUGy2Y5uDpqSTq1FkHLK4/oqKtyUU1AFbOOxY4IpC9f0fTLjwYbslUz0Po5BpD1wrA=="],
|
||||
|
||||
"zod": ["zod@3.24.2", "", {}, "sha512-lY7CDW43ECgW9u1TcT3IoXHflywfVqDYze4waEz812jR/bZ8FHDsl7pFQoSZTz5N+2NqRXs8GBwnAwo3ZNxqhQ=="],
|
||||
"zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="],
|
||||
|
||||
"zod-to-json-schema": ["zod-to-json-schema@3.25.1", "", { "peerDependencies": { "zod": "^3.25 || ^4" } }, "sha512-pM/SU9d3YAggzi6MtR4h7ruuQlqKtad8e9S0fmxcMi+ueAK5Korys/aWcV9LIIHTVbj01NdzxcnXSN+O74ZIVA=="],
|
||||
|
||||
@@ -3447,9 +3437,7 @@
|
||||
|
||||
"@modelcontextprotocol/sdk/cross-spawn": ["cross-spawn@7.0.6", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="],
|
||||
|
||||
"@modelcontextprotocol/sdk/zod-to-json-schema": ["zod-to-json-schema@3.24.5", "", { "peerDependencies": { "zod": "^3.24.1" } }, "sha512-/AuWwMP+YqiPbsJx5D6TfgRTc4kTLjsh5SOcd4bLsfUg2RcEXrFMJl1DGgdHy2aCfsIA/cr/1JM0xcB2GZji8g=="],
|
||||
|
||||
"@opennextjs/aws/express": ["express@5.2.1", "", { "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.1", "content-disposition": "^1.0.0", "content-type": "^1.0.5", "cookie": "^0.7.1", "cookie-signature": "^1.2.1", "debug": "^4.4.0", "depd": "^2.0.0", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "etag": "^1.8.1", "finalhandler": "^2.1.0", "fresh": "^2.0.0", "http-errors": "^2.0.0", "merge-descriptors": "^2.0.0", "mime-types": "^3.0.0", "on-finished": "^2.4.1", "once": "^1.4.0", "parseurl": "^1.3.3", "proxy-addr": "^2.0.7", "qs": "^6.14.0", "range-parser": "^1.2.1", "router": "^2.2.0", "send": "^1.1.0", "serve-static": "^2.2.0", "statuses": "^2.0.1", "type-is": "^2.0.1", "vary": "^1.1.2" } }, "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw=="],
|
||||
"@modelcontextprotocol/sdk/jose": ["jose@6.2.18", "", {}, "sha512-doV4thUwgkrycJH4yLeqwTGIIZphHl+pk7CPReuMIhYhncmgzdko85MaCG4YQFTxqMFr1/oEH32tZuKKovcDEg=="],
|
||||
|
||||
"@oxc-transform/binding-wasm32-wasi/@napi-rs/wasm-runtime": ["@napi-rs/wasm-runtime@1.1.1", "", { "dependencies": { "@emnapi/core": "^1.7.1", "@emnapi/runtime": "^1.7.1", "@tybys/wasm-util": "^0.10.1" } }, "sha512-p64ah1M1ld8xjWv3qbvFwHiFVWrq1yFvV4f7w+mzaqiR4IlSgkqhcRdHwsGgomwzBH51sRY4NEowLxnaBjcW/A=="],
|
||||
|
||||
@@ -3527,8 +3515,6 @@
|
||||
|
||||
"@scalar/json-schema-validator/@scalar/types": ["@scalar/types@0.26.0", "", { "dependencies": { "@scalar/helpers": "0.16.4", "nanoid": "^5.1.16", "type-fest": "^5.10.0", "zod": "^4.6.7" } }, "sha512-T78Dj1Q+W0E1RsMyPoydfR+L+p9IUIkntBCRYlWaRibM98jAxABRYGQoU/qDHX0PR1IAFdE+d7ZqslypZbJzcg=="],
|
||||
|
||||
"@scalar/json-schema-validator/ajv": ["ajv@8.20.0", "", { "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2" } }, "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA=="],
|
||||
|
||||
"@scalar/oas-utils/@scalar/helpers": ["@scalar/helpers@0.1.1", "", {}, "sha512-eJjuCI5djqU0adTwrHvpDf0xuwNRpwZinCfJ03QjnmIFBM9Ch0u3tn/0EZOhcVNbdEyJ+3yvSVy1dCmmvgtpvQ=="],
|
||||
|
||||
"@scalar/oas-utils/@scalar/json-magic": ["@scalar/json-magic@0.8.1", "", { "dependencies": { "@scalar/helpers": "0.1.1", "xxhash-wasm": "^1.1.0", "yaml": "2.8.0" } }, "sha512-PtG0gJxw+iE9492pqy9V+ZbnfRnycIxTAxknKQCOGRyFYfDvYSs0/uyFCHoQPl7HEZoNNA7q/fr0LBZXMRzv7g=="],
|
||||
@@ -3697,8 +3683,6 @@
|
||||
|
||||
"acorn-walk/acorn": ["acorn@8.12.1", "", { "bin": { "acorn": "bin/acorn" } }, "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg=="],
|
||||
|
||||
"ajv-draft-04/ajv": ["ajv@8.17.1", "", { "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2" } }, "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g=="],
|
||||
|
||||
"ajv-formats/ajv": ["ajv@8.17.1", "", { "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2" } }, "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g=="],
|
||||
|
||||
"anymatch/picomatch": ["picomatch@2.3.1", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="],
|
||||
@@ -3707,18 +3691,10 @@
|
||||
|
||||
"ast-kit/pathe": ["pathe@2.0.3", "", {}, "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w=="],
|
||||
|
||||
"body-parser/debug": ["debug@3.1.0", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g=="],
|
||||
|
||||
"body-parser/iconv-lite": ["iconv-lite@0.5.2", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3" } }, "sha512-kERHXvpSaB4aU3eANwidg79K8FlrN77m8G9V+0vOR3HYaRifrlwMEpT7ZBJqLSEIHnEgJTHcWK82wwLwwKwtag=="],
|
||||
|
||||
"body-parser/type-is": ["type-is@1.6.18", "", { "dependencies": { "media-typer": "0.3.0", "mime-types": "~2.1.24" } }, "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g=="],
|
||||
|
||||
"brace-expansion/balanced-match": ["balanced-match@4.0.4", "", {}, "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA=="],
|
||||
|
||||
"bun-types/@types/node": ["@types/node@20.12.14", "", { "dependencies": { "undici-types": "~5.26.4" } }, "sha512-scnD59RpYD91xngrQQLGkE+6UrHUPzeKZWhhjBSa3HSkwjbQc38+q3RoIVEwxQGRw3M+j5hpNAM+lgV3cVormg=="],
|
||||
|
||||
"call-bound/get-intrinsic": ["get-intrinsic@1.3.0", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", "math-intrinsics": "^1.1.0" } }, "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ=="],
|
||||
|
||||
"cliui/string-width": ["string-width@7.2.0", "", { "dependencies": { "emoji-regex": "^10.3.0", "get-east-asian-width": "^1.0.0", "strip-ansi": "^7.1.0" } }, "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ=="],
|
||||
|
||||
"cliui/strip-ansi": ["strip-ansi@7.1.0", "", { "dependencies": { "ansi-regex": "^6.0.1" } }, "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ=="],
|
||||
@@ -3761,8 +3737,6 @@
|
||||
|
||||
"dom-serializer/entities": ["entities@4.5.0", "", {}, "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw=="],
|
||||
|
||||
"dunder-proto/gopd": ["gopd@1.2.0", "", {}, "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg=="],
|
||||
|
||||
"duplexify/end-of-stream": ["end-of-stream@1.4.4", "", { "dependencies": { "once": "^1.4.0" } }, "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q=="],
|
||||
|
||||
"duplexify/readable-stream": ["readable-stream@3.6.2", "", { "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" } }, "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA=="],
|
||||
@@ -3783,20 +3757,16 @@
|
||||
|
||||
"express/cookie": ["cookie@0.7.1", "", {}, "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w=="],
|
||||
|
||||
"express/debug": ["debug@4.3.6", "", { "dependencies": { "ms": "2.1.2" } }, "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg=="],
|
||||
|
||||
"express/mime-types": ["mime-types@3.0.0", "", { "dependencies": { "mime-db": "^1.53.0" } }, "sha512-XqoSHeCGjVClAmoGFG3lVFqQFRIrTVw2OH3axRqAcfaw+gHWIfnASS92AV+Rl/mk0MupgZTRHQOjxY6YVnzK5w=="],
|
||||
|
||||
"finalhandler/debug": ["debug@2.6.9", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="],
|
||||
|
||||
"finalhandler/encodeurl": ["encodeurl@1.0.2", "", {}, "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w=="],
|
||||
|
||||
"global-prefix/which": ["which@1.3.1", "", { "dependencies": { "isexe": "^2.0.0" }, "bin": { "which": "./bin/which" } }, "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ=="],
|
||||
|
||||
"globby/fast-glob": ["fast-glob@3.3.2", "", { "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.2", "merge2": "^1.3.0", "micromatch": "^4.0.4" } }, "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow=="],
|
||||
|
||||
"globby/ignore": ["ignore@5.3.2", "", {}, "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g=="],
|
||||
|
||||
"google-font-metadata/zod": ["zod@3.24.2", "", {}, "sha512-lY7CDW43ECgW9u1TcT3IoXHflywfVqDYze4waEz812jR/bZ8FHDsl7pFQoSZTz5N+2NqRXs8GBwnAwo3ZNxqhQ=="],
|
||||
|
||||
"htmlparser2/entities": ["entities@6.0.1", "", {}, "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g=="],
|
||||
|
||||
"https-proxy-agent/debug": ["debug@4.4.0", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA=="],
|
||||
@@ -3809,8 +3779,6 @@
|
||||
|
||||
"lowlight/highlight.js": ["highlight.js@11.9.0", "", {}, "sha512-fJ7cW7fQGCYAkgv4CPfwFHrfd/cLS4Hau96JuJ+ZTOWhjnhoeN1ub1tFmALm/+lW5z4WCAuAV9bm05AP0mS6Gw=="],
|
||||
|
||||
"mcp-handler/chalk": ["chalk@5.4.1", "", {}, "sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w=="],
|
||||
|
||||
"mcp-handler/commander": ["commander@11.1.0", "", {}, "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ=="],
|
||||
|
||||
"mdast-util-gfm-footnote/mdast-util-from-markdown": ["mdast-util-from-markdown@2.0.1", "", { "dependencies": { "@types/mdast": "^4.0.0", "@types/unist": "^3.0.0", "decode-named-character-reference": "^1.0.0", "devlop": "^1.0.0", "mdast-util-to-string": "^4.0.0", "micromark": "^4.0.0", "micromark-util-decode-numeric-character-reference": "^2.0.0", "micromark-util-decode-string": "^2.0.0", "micromark-util-normalize-identifier": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0", "unist-util-stringify-position": "^4.0.0" } }, "sha512-aJEUyzZ6TzlsX2s5B4Of7lN7EQtAxvtradMMglCQDyaTFgse6CmtmdJ15ElnVRlCg1vpNyVtbem0PWzlNieZsA=="],
|
||||
@@ -3875,7 +3843,7 @@
|
||||
|
||||
"radix-vue/nanoid": ["nanoid@5.0.7", "", { "bin": { "nanoid": "bin/nanoid.js" } }, "sha512-oLxFY2gd2IqnjcYyOXD8XGCftpGtZP2AbHbOkthDkvRywH5ayNtPVy9YlOPcHckXzbLTCHpkb7FB+yuxKV13pQ=="],
|
||||
|
||||
"raw-body/iconv-lite": ["iconv-lite@0.6.3", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" } }, "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw=="],
|
||||
"raw-body/http-errors": ["http-errors@2.0.1", "", { "dependencies": { "depd": "~2.0.0", "inherits": "~2.0.4", "setprototypeof": "~1.2.0", "statuses": "~2.0.2", "toidentifier": "~1.0.1" } }, "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ=="],
|
||||
|
||||
"read-cache/pify": ["pify@2.3.0", "", {}, "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog=="],
|
||||
|
||||
@@ -3899,17 +3867,11 @@
|
||||
|
||||
"send/fresh": ["fresh@0.5.2", "", {}, "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q=="],
|
||||
|
||||
"serve-static/send": ["send@1.2.0", "", { "dependencies": { "debug": "^4.3.5", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "etag": "^1.8.1", "fresh": "^2.0.0", "http-errors": "^2.0.0", "mime-types": "^3.0.1", "ms": "^2.1.3", "on-finished": "^2.4.1", "range-parser": "^1.2.1", "statuses": "^2.0.1" } }, "sha512-uaW0WwXKpL9blXE2o0bRhoL2EGXIrZxQ2ZQ4mgcfoBxdFmQold+qWsD2jLrfZ0trjKL6vOw0j//eAwcALFjKSw=="],
|
||||
|
||||
"sharp/detect-libc": ["detect-libc@2.1.2", "", {}, "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ=="],
|
||||
|
||||
"side-channel-list/object-inspect": ["object-inspect@1.13.4", "", {}, "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew=="],
|
||||
|
||||
"side-channel-map/get-intrinsic": ["get-intrinsic@1.3.0", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", "math-intrinsics": "^1.1.0" } }, "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ=="],
|
||||
|
||||
"side-channel-map/object-inspect": ["object-inspect@1.13.4", "", {}, "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew=="],
|
||||
|
||||
"side-channel-weakmap/get-intrinsic": ["get-intrinsic@1.3.0", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", "math-intrinsics": "^1.1.0" } }, "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ=="],
|
||||
|
||||
"side-channel-weakmap/object-inspect": ["object-inspect@1.13.4", "", {}, "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew=="],
|
||||
"socks/ip-address": ["ip-address@10.1.0", "", {}, "sha512-XXADHxXmvT9+CRxhXg56LJovE+bmWnEWB78LB83VZTprKTmaC5QfruXocxzTZ2Kl0DNwKuBdlIhjL8LeY8Sf8Q=="],
|
||||
|
||||
"spawndamnit/cross-spawn": ["cross-spawn@7.0.6", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="],
|
||||
|
||||
@@ -3947,8 +3909,6 @@
|
||||
|
||||
"youch/cookie": ["cookie@1.0.2", "", {}, "sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA=="],
|
||||
|
||||
"zod-to-json-schema/zod": ["zod@4.6.7", "", {}, "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg=="],
|
||||
|
||||
"@ampproject/remapping/@jridgewell/gen-mapping/@jridgewell/sourcemap-codec": ["@jridgewell/sourcemap-codec@1.5.0", "", {}, "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ=="],
|
||||
|
||||
"@ampproject/remapping/@jridgewell/trace-mapping/@jridgewell/sourcemap-codec": ["@jridgewell/sourcemap-codec@1.5.0", "", {}, "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ=="],
|
||||
@@ -4059,22 +4019,6 @@
|
||||
|
||||
"@jridgewell/source-map/@jridgewell/trace-mapping/@jridgewell/sourcemap-codec": ["@jridgewell/sourcemap-codec@1.5.0", "", {}, "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ=="],
|
||||
|
||||
"@opennextjs/aws/express/body-parser": ["body-parser@2.2.1", "", { "dependencies": { "bytes": "^3.1.2", "content-type": "^1.0.5", "debug": "^4.4.3", "http-errors": "^2.0.0", "iconv-lite": "^0.7.0", "on-finished": "^2.4.1", "qs": "^6.14.0", "raw-body": "^3.0.1", "type-is": "^2.0.1" } }, "sha512-nfDwkulwiZYQIGwxdy0RUmowMhKcFVcYXUU7m4QlKYim1rUtg83xm2yjZ40QjDuc291AJjjeSc9b++AWHSgSHw=="],
|
||||
|
||||
"@opennextjs/aws/express/cookie": ["cookie@0.7.1", "", {}, "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w=="],
|
||||
|
||||
"@opennextjs/aws/express/finalhandler": ["finalhandler@2.1.1", "", { "dependencies": { "debug": "^4.4.0", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "on-finished": "^2.4.1", "parseurl": "^1.3.3", "statuses": "^2.0.1" } }, "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA=="],
|
||||
|
||||
"@opennextjs/aws/express/mime-types": ["mime-types@3.0.0", "", { "dependencies": { "mime-db": "^1.53.0" } }, "sha512-XqoSHeCGjVClAmoGFG3lVFqQFRIrTVw2OH3axRqAcfaw+gHWIfnASS92AV+Rl/mk0MupgZTRHQOjxY6YVnzK5w=="],
|
||||
|
||||
"@opennextjs/aws/express/qs": ["qs@6.14.0", "", { "dependencies": { "side-channel": "^1.1.0" } }, "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w=="],
|
||||
|
||||
"@opennextjs/aws/express/router": ["router@2.2.0", "", { "dependencies": { "debug": "^4.4.0", "depd": "^2.0.0", "is-promise": "^4.0.0", "parseurl": "^1.3.3", "path-to-regexp": "^8.0.0" } }, "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ=="],
|
||||
|
||||
"@opennextjs/aws/express/serve-static": ["serve-static@2.2.0", "", { "dependencies": { "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "parseurl": "^1.3.3", "send": "^1.2.0" } }, "sha512-61g9pCh0Vnh7IutZjtLGGpTA355+OPn2TyDv/6ivP2h/AdAVX9azsoxmg2/M6nZeQZNYBEwIcsne1mJd9oQItQ=="],
|
||||
|
||||
"@opennextjs/aws/express/type-is": ["type-is@2.0.1", "", { "dependencies": { "content-type": "^1.0.5", "media-typer": "^1.1.0", "mime-types": "^3.0.0" } }, "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw=="],
|
||||
|
||||
"@oxc-transform/binding-wasm32-wasi/@napi-rs/wasm-runtime/@emnapi/core": ["@emnapi/core@1.8.1", "", { "dependencies": { "@emnapi/wasi-threads": "1.1.0", "tslib": "^2.4.0" } }, "sha512-AvT9QFpxK0Zd8J0jopedNm+w/2fIzvtPKPjqyw9jwvBaReTTqPBk9Hixaz7KbjimP+QNz605/XnjFcDAL2pqBg=="],
|
||||
|
||||
"@oxc-transform/binding-wasm32-wasi/@napi-rs/wasm-runtime/@emnapi/runtime": ["@emnapi/runtime@1.8.1", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-mehfKSMWjjNol8659Z8KxEMrdSJDDot5SXMq00dM8BN4o+CLNXQ0xH2V7EchNHV4RmbZLmmPdEaXZc5H2FXmDg=="],
|
||||
@@ -4137,8 +4081,6 @@
|
||||
|
||||
"@scalar/json-schema-validator/@scalar/types/zod": ["zod@4.6.7", "", {}, "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg=="],
|
||||
|
||||
"@scalar/json-schema-validator/ajv/json-schema-traverse": ["json-schema-traverse@1.0.0", "", {}, "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="],
|
||||
|
||||
"@scalar/openapi-parser/@scalar/types/nanoid": ["nanoid@5.1.16", "", { "bin": { "nanoid": "bin/nanoid.js" } }, "sha512-kVrnsrJqMR8+oLJnGEmSWw9BivK5mt7H3FZatVRjrc5wGqFYuBxX1yG7+A7Gi5AefkX6t/oCkizcQgpu0cY1dQ=="],
|
||||
|
||||
"@scalar/openapi-parser/@scalar/types/type-fest": ["type-fest@5.10.0", "", { "dependencies": { "tagged-tag": "^1.0.0" } }, "sha512-NoSdpq/WEiAg5sjmBkmV/hfxv6HJH4NqPNrqjtSO5CwRmpsDfaf4begxW34KdJykH/l1yHtwBWQkCRdoXO8mPA=="],
|
||||
@@ -4271,8 +4213,6 @@
|
||||
|
||||
"@vercel/rust/execa/signal-exit": ["signal-exit@3.0.7", "", {}, "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="],
|
||||
|
||||
"@vercel/static-config/ajv/json-schema-traverse": ["json-schema-traverse@1.0.0", "", {}, "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="],
|
||||
|
||||
"@vue/compiler-core/@babel/parser/@babel/types": ["@babel/types@7.28.2", "", { "dependencies": { "@babel/helper-string-parser": "^7.27.1", "@babel/helper-validator-identifier": "^7.27.1" } }, "sha512-ruv7Ae4J5dUYULmeXw1gmb7rYRz57OWCPM57pHojnLq/3Z1CK2lNSLTCVjxVk1F/TZHwOZZrOWi0ur95BbLxNQ=="],
|
||||
|
||||
"@vue/compiler-sfc/@babel/parser/@babel/types": ["@babel/types@7.28.2", "", { "dependencies": { "@babel/helper-string-parser": "^7.27.1", "@babel/helper-validator-identifier": "^7.27.1" } }, "sha512-ruv7Ae4J5dUYULmeXw1gmb7rYRz57OWCPM57pHojnLq/3Z1CK2lNSLTCVjxVk1F/TZHwOZZrOWi0ur95BbLxNQ=="],
|
||||
@@ -4293,22 +4233,8 @@
|
||||
|
||||
"accepts/mime-types/mime-db": ["mime-db@1.53.0", "", {}, "sha512-oHlN/w+3MQ3rba9rqFr6V/ypF10LSkdwUysQL7GkXoTgIWeV+tcXGA852TBxH+gsh8UWoyhR1hKcoMJTuWflpg=="],
|
||||
|
||||
"ajv-draft-04/ajv/json-schema-traverse": ["json-schema-traverse@1.0.0", "", {}, "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="],
|
||||
|
||||
"ajv-formats/ajv/json-schema-traverse": ["json-schema-traverse@1.0.0", "", {}, "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="],
|
||||
|
||||
"body-parser/debug/ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="],
|
||||
|
||||
"body-parser/type-is/media-typer": ["media-typer@0.3.0", "", {}, "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ=="],
|
||||
|
||||
"bun-types/@types/node/undici-types": ["undici-types@5.26.5", "", {}, "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="],
|
||||
|
||||
"call-bound/get-intrinsic/es-define-property": ["es-define-property@1.0.1", "", {}, "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g=="],
|
||||
|
||||
"call-bound/get-intrinsic/gopd": ["gopd@1.2.0", "", {}, "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg=="],
|
||||
|
||||
"call-bound/get-intrinsic/has-symbols": ["has-symbols@1.1.0", "", {}, "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ=="],
|
||||
|
||||
"cliui/string-width/emoji-regex": ["emoji-regex@10.4.0", "", {}, "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw=="],
|
||||
|
||||
"cliui/string-width/get-east-asian-width": ["get-east-asian-width@1.3.0", "", {}, "sha512-vpeMIQKxczTD/0s2CdEWHcb0eeJe6TFjxb+J5xgX7hScxqrGuyjmv4c1D4A/gelKfyox0gJJwIHF+fLjeaM8kQ=="],
|
||||
@@ -4337,12 +4263,8 @@
|
||||
|
||||
"edge-runtime/pretty-ms/parse-ms": ["parse-ms@2.1.0", "", {}, "sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA=="],
|
||||
|
||||
"express/debug/ms": ["ms@2.1.2", "", {}, "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="],
|
||||
|
||||
"express/mime-types/mime-db": ["mime-db@1.53.0", "", {}, "sha512-oHlN/w+3MQ3rba9rqFr6V/ypF10LSkdwUysQL7GkXoTgIWeV+tcXGA852TBxH+gsh8UWoyhR1hKcoMJTuWflpg=="],
|
||||
|
||||
"finalhandler/debug/ms": ["ms@2.0.0", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="],
|
||||
|
||||
"micro/raw-body/bytes": ["bytes@3.1.0", "", {}, "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg=="],
|
||||
|
||||
"micro/raw-body/http-errors": ["http-errors@1.7.3", "", { "dependencies": { "depd": "~1.1.2", "inherits": "2.0.4", "setprototypeof": "1.1.1", "statuses": ">= 1.5.0 < 2", "toidentifier": "1.0.0" } }, "sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw=="],
|
||||
@@ -4415,6 +4337,8 @@
|
||||
|
||||
"radix-vue/@vueuse/core/@vueuse/metadata": ["@vueuse/metadata@10.11.1", "", {}, "sha512-IGa5FXd003Ug1qAZmyE8wF3sJ81xGLSqTqtQ6jaVfkeZ4i5kS2mwQF61yhVqojRnenVew5PldLyRgvdl4YYuSw=="],
|
||||
|
||||
"raw-body/http-errors/statuses": ["statuses@2.0.2", "", {}, "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw=="],
|
||||
|
||||
"read-yaml-file/js-yaml/argparse": ["argparse@1.0.10", "", { "dependencies": { "sprintf-js": "~1.0.2" } }, "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg=="],
|
||||
|
||||
"remark-gfm/mdast-util-gfm/mdast-util-from-markdown": ["mdast-util-from-markdown@2.0.1", "", { "dependencies": { "@types/mdast": "^4.0.0", "@types/unist": "^3.0.0", "decode-named-character-reference": "^1.0.0", "devlop": "^1.0.0", "mdast-util-to-string": "^4.0.0", "micromark": "^4.0.0", "micromark-util-decode-numeric-character-reference": "^2.0.0", "micromark-util-decode-string": "^2.0.0", "micromark-util-normalize-identifier": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0", "unist-util-stringify-position": "^4.0.0" } }, "sha512-aJEUyzZ6TzlsX2s5B4Of7lN7EQtAxvtradMMglCQDyaTFgse6CmtmdJ15ElnVRlCg1vpNyVtbem0PWzlNieZsA=="],
|
||||
@@ -4427,24 +4351,12 @@
|
||||
|
||||
"rimraf/glob/path-scurry": ["path-scurry@1.11.1", "", { "dependencies": { "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" } }, "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA=="],
|
||||
|
||||
"side-channel-map/get-intrinsic/es-define-property": ["es-define-property@1.0.1", "", {}, "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g=="],
|
||||
|
||||
"side-channel-map/get-intrinsic/gopd": ["gopd@1.2.0", "", {}, "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg=="],
|
||||
|
||||
"side-channel-map/get-intrinsic/has-symbols": ["has-symbols@1.1.0", "", {}, "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ=="],
|
||||
|
||||
"side-channel-weakmap/get-intrinsic/es-define-property": ["es-define-property@1.0.1", "", {}, "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g=="],
|
||||
|
||||
"side-channel-weakmap/get-intrinsic/gopd": ["gopd@1.2.0", "", {}, "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg=="],
|
||||
|
||||
"side-channel-weakmap/get-intrinsic/has-symbols": ["has-symbols@1.1.0", "", {}, "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ=="],
|
||||
"serve-static/send/mime-types": ["mime-types@3.0.2", "", { "dependencies": { "mime-db": "^1.54.0" } }, "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A=="],
|
||||
|
||||
"stylelint-no-unsupported-browser-features/postcss/nanoid": ["nanoid@3.3.11", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w=="],
|
||||
|
||||
"stylelint/postcss/nanoid": ["nanoid@3.3.8", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w=="],
|
||||
|
||||
"table/ajv/json-schema-traverse": ["json-schema-traverse@1.0.0", "", {}, "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="],
|
||||
|
||||
"type-is/mime-types/mime-db": ["mime-db@1.53.0", "", {}, "sha512-oHlN/w+3MQ3rba9rqFr6V/ypF10LSkdwUysQL7GkXoTgIWeV+tcXGA852TBxH+gsh8UWoyhR1hKcoMJTuWflpg=="],
|
||||
|
||||
"wrap-ansi/string-width/emoji-regex": ["emoji-regex@10.4.0", "", {}, "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw=="],
|
||||
@@ -4473,20 +4385,6 @@
|
||||
|
||||
"@headlessui/react/@floating-ui/react/@floating-ui/react-dom/@floating-ui/dom": ["@floating-ui/dom@1.7.5", "", { "dependencies": { "@floating-ui/core": "^1.7.4", "@floating-ui/utils": "^0.2.10" } }, "sha512-N0bD2kIPInNHUHehXhMke1rBGs1dwqvC9O9KYMyyjK7iXt7GAhnro7UlcuYcGdS/yYOlq0MAVgrow8IbWJwyqg=="],
|
||||
|
||||
"@opennextjs/aws/express/body-parser/raw-body": ["raw-body@3.0.2", "", { "dependencies": { "bytes": "~3.1.2", "http-errors": "~2.0.1", "iconv-lite": "~0.7.0", "unpipe": "~1.0.0" } }, "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA=="],
|
||||
|
||||
"@opennextjs/aws/express/mime-types/mime-db": ["mime-db@1.53.0", "", {}, "sha512-oHlN/w+3MQ3rba9rqFr6V/ypF10LSkdwUysQL7GkXoTgIWeV+tcXGA852TBxH+gsh8UWoyhR1hKcoMJTuWflpg=="],
|
||||
|
||||
"@opennextjs/aws/express/qs/side-channel": ["side-channel@1.1.0", "", { "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.3", "side-channel-list": "^1.0.0", "side-channel-map": "^1.0.1", "side-channel-weakmap": "^1.0.2" } }, "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw=="],
|
||||
|
||||
"@opennextjs/aws/express/router/is-promise": ["is-promise@4.0.0", "", {}, "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ=="],
|
||||
|
||||
"@opennextjs/aws/express/router/path-to-regexp": ["path-to-regexp@8.2.0", "", {}, "sha512-TdrF7fW9Rphjq4RjrW0Kp2AW0Ahwu9sRGTkS6bvDi0SCwZlEZYmcfDbEsTz8RVk0EHIS/Vd1bv3JhG+1xZuAyQ=="],
|
||||
|
||||
"@opennextjs/aws/express/serve-static/send": ["send@1.2.0", "", { "dependencies": { "debug": "^4.3.5", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "etag": "^1.8.1", "fresh": "^2.0.0", "http-errors": "^2.0.0", "mime-types": "^3.0.1", "ms": "^2.1.3", "on-finished": "^2.4.1", "range-parser": "^1.2.1", "statuses": "^2.0.1" } }, "sha512-uaW0WwXKpL9blXE2o0bRhoL2EGXIrZxQ2ZQ4mgcfoBxdFmQold+qWsD2jLrfZ0trjKL6vOw0j//eAwcALFjKSw=="],
|
||||
|
||||
"@scalar/api-client/@scalar/openapi-parser/ajv/json-schema-traverse": ["json-schema-traverse@1.0.0", "", {}, "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="],
|
||||
|
||||
"@scalar/components/@scalar/oas-utils/@scalar/workspace-store/@scalar/openapi-upgrader": ["@scalar/openapi-upgrader@0.1.3", "", { "dependencies": { "@scalar/openapi-types": "0.5.0" } }, "sha512-iROhcgy3vge6zsviPtoTLHale0nYt1PLhuMmJweQwJ0U23ZYyYhV5xgHtAd0OBEXuqT6rjYbJFvKOJZmJOwpNQ=="],
|
||||
|
||||
"@scalar/components/@scalar/themes/@scalar/types/@scalar/openapi-types": ["@scalar/openapi-types@0.5.0", "", { "dependencies": { "zod": "4.1.11" } }, "sha512-HJBcLa+/mPP+3TCcQngj/iW5UqynRosOQdEETXjmdy6Ngw8wBjwIcT6C86J5jufJ6sI8++HYnt+e7pAvp5FO6A=="],
|
||||
@@ -4501,8 +4399,6 @@
|
||||
|
||||
"@scalar/import/@scalar/openapi-parser/@scalar/openapi-types/zod": ["zod@4.1.11", "", {}, "sha512-WPsqwxITS2tzx1bzhIKsEs19ABD5vmCVa4xBo2tq/SrV4RNZtfws1EnCWQXM6yh8bD08a1idvkB5MZSBiZsjwg=="],
|
||||
|
||||
"@scalar/import/@scalar/openapi-parser/ajv/json-schema-traverse": ["json-schema-traverse@1.0.0", "", {}, "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="],
|
||||
|
||||
"@scalar/postman-to-openapi/@scalar/oas-utils/@scalar/workspace-store/@scalar/openapi-upgrader": ["@scalar/openapi-upgrader@0.1.3", "", { "dependencies": { "@scalar/openapi-types": "0.5.0" } }, "sha512-iROhcgy3vge6zsviPtoTLHale0nYt1PLhuMmJweQwJ0U23ZYyYhV5xgHtAd0OBEXuqT6rjYbJFvKOJZmJOwpNQ=="],
|
||||
|
||||
"@scalar/use-toasts/vue/@vue/compiler-sfc/@babel/parser": ["@babel/parser@7.28.3", "", { "dependencies": { "@babel/types": "^7.28.2" }, "bin": "./bin/babel-parser.js" }, "sha512-7+Ey1mAgYqFAx2h0RuoxcQT5+MlG3GTV0TQrgr7/ZliKsm/MNDxVVutlWaziMq7wJNAz8MTqz55XLpWvva6StA=="],
|
||||
@@ -4545,6 +4441,8 @@
|
||||
|
||||
"rimraf/glob/path-scurry/lru-cache": ["lru-cache@10.4.3", "", {}, "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ=="],
|
||||
|
||||
"serve-static/send/mime-types/mime-db": ["mime-db@1.54.0", "", {}, "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ=="],
|
||||
|
||||
"yargs/string-width/strip-ansi/ansi-regex": ["ansi-regex@6.4.0", "", {}, "sha512-KzTVk2tCWAHtYrvvvaP8bJKJq2pVinhLcGEQdtLIYPbmNGNyYe8QwNaTUYQp2J7/vIsUKt5QCqAfUkYyG9DkOw=="],
|
||||
|
||||
"@argos-ci/core/sharp/@img/sharp-freebsd-wasm32/@img/sharp-wasm32/@emnapi/runtime": ["@emnapi/runtime@1.11.2", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-kyOl3X0DuTiT1h2ft8r2fYO8JYtU9a9Xis/zBSiGArNaagCOWx90N1k2wxp18czFDH+OgcWGb5ZP/XMt3dcyPA=="],
|
||||
@@ -4555,12 +4453,6 @@
|
||||
|
||||
"@headlessui/react/@floating-ui/react/@floating-ui/react-dom/@floating-ui/dom/@floating-ui/core": ["@floating-ui/core@1.7.4", "", { "dependencies": { "@floating-ui/utils": "^0.2.10" } }, "sha512-C3HlIdsBxszvm5McXlB8PeOEWfBhcGBTZGkGlWc2U0KFY5IwG5OQEuQ8rq52DZmcHDlPLd+YFBK+cZcytwIFWg=="],
|
||||
|
||||
"@opennextjs/aws/express/body-parser/raw-body/http-errors": ["http-errors@2.0.1", "", { "dependencies": { "depd": "~2.0.0", "inherits": "~2.0.4", "setprototypeof": "~1.2.0", "statuses": "~2.0.2", "toidentifier": "~1.0.1" } }, "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ=="],
|
||||
|
||||
"@opennextjs/aws/express/qs/side-channel/object-inspect": ["object-inspect@1.13.4", "", {}, "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew=="],
|
||||
|
||||
"@opennextjs/aws/express/serve-static/send/mime-types": ["mime-types@3.0.2", "", { "dependencies": { "mime-db": "^1.54.0" } }, "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A=="],
|
||||
|
||||
"@scalar/draggable/vue/@vue/compiler-sfc/@babel/parser/@babel/types": ["@babel/types@7.28.2", "", { "dependencies": { "@babel/helper-string-parser": "^7.27.1", "@babel/helper-validator-identifier": "^7.27.1" } }, "sha512-ruv7Ae4J5dUYULmeXw1gmb7rYRz57OWCPM57pHojnLq/3Z1CK2lNSLTCVjxVk1F/TZHwOZZrOWi0ur95BbLxNQ=="],
|
||||
|
||||
"@scalar/draggable/vue/@vue/compiler-sfc/magic-string/@jridgewell/sourcemap-codec": ["@jridgewell/sourcemap-codec@1.5.0", "", {}, "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ=="],
|
||||
@@ -4580,9 +4472,5 @@
|
||||
"@zenuml/core/tailwindcss/chokidar/readdirp/picomatch": ["picomatch@2.3.1", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="],
|
||||
|
||||
"rimraf/glob/minimatch/brace-expansion/balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="],
|
||||
|
||||
"@opennextjs/aws/express/body-parser/raw-body/http-errors/statuses": ["statuses@2.0.2", "", {}, "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw=="],
|
||||
|
||||
"@opennextjs/aws/express/serve-static/send/mime-types/mime-db": ["mime-db@1.54.0", "", {}, "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ=="],
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@
|
||||
"@tsconfig/strictest": "^2.0.6",
|
||||
"@tsconfig/node20": "^20.1.6",
|
||||
"@base-ui/react": "^1.7.0",
|
||||
"@gitbook/api": "0.210.0",
|
||||
"@gitbook/api": "0.214.0",
|
||||
"@scalar/api-client-react": "^1.3.46",
|
||||
"@types/react": "^19.0.0",
|
||||
"@types/react-dom": "^19.0.0",
|
||||
|
||||
@@ -443,11 +443,6 @@ const testCases: TestsCase[] = [
|
||||
contentBaseURL: 'https://help.openloyalty.io',
|
||||
tests: [{ name: 'Home', url: '/', run: waitForCookiesDialog }],
|
||||
},
|
||||
{
|
||||
name: 'retrozia.gitbook.io/retrozia',
|
||||
contentBaseURL: 'https://retrozia.gitbook.io',
|
||||
tests: [{ name: 'Home', url: '/retrozia' }],
|
||||
},
|
||||
{
|
||||
name: 'helpcenter.channable.com',
|
||||
contentBaseURL: 'https://helpcenter.channable.com',
|
||||
|
||||
@@ -442,6 +442,48 @@ const searchTestCases: Test[] = [
|
||||
expect(new URL(page.url()).pathname).toBe(new URL(topResult.href, page.url()).pathname);
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Search - Enter opens the visible result while a new query loads',
|
||||
url: `blocks/lists${getCustomizationURL({
|
||||
ai: {
|
||||
mode: CustomizationAIMode.None,
|
||||
},
|
||||
})}`,
|
||||
screenshot: false,
|
||||
run: async (page) => {
|
||||
await waitForHydration(page);
|
||||
const heldSearch = await holdSearchRequests(page);
|
||||
const searchInput = page.getByTestId('search-input');
|
||||
const searchPopup = page.getByTestId('search-popover');
|
||||
await searchInput.focus();
|
||||
await page.waitForURL(/[?&]q=/);
|
||||
await searchInput.pressSequentially('gitbook');
|
||||
const initialSearch = await heldSearch('gitbook');
|
||||
const { siteSpaceId } = initialSearch.request().postDataJSON().scope;
|
||||
const topResult = searchPageResult(
|
||||
initialSearch,
|
||||
siteSpaceId,
|
||||
'Headings',
|
||||
'blocks/headings'
|
||||
);
|
||||
await initialSearch.fulfill({ json: [topResult] });
|
||||
const firstResult = searchPopup.getByTestId('search-page-result').first();
|
||||
await expect(firstResult).toHaveAttribute('href', topResult.href);
|
||||
|
||||
await searchInput.pressSequentially(' docs');
|
||||
const pendingSearch = await heldSearch('gitbook docs');
|
||||
await expect(searchPopup.locator('output[aria-busy="true"]')).toBeVisible();
|
||||
await expect(firstResult).toHaveAttribute('href', topResult.href);
|
||||
await expect(searchPopup.locator('[data-search-placeholder-row]')).toHaveCount(0);
|
||||
|
||||
await searchInput.press('Enter');
|
||||
await expect(searchPopup).toBeHidden();
|
||||
await expect
|
||||
.poll(() => new URL(page.url()).pathname)
|
||||
.toBe(new URL(topResult.href, page.url()).pathname);
|
||||
await pendingSearch.abort().catch(() => {});
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Search - Enter opens the result under the mouse',
|
||||
url: `blocks/lists${getCustomizationURL({
|
||||
@@ -739,7 +781,7 @@ const searchPassTestCases: Test[] = [
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'Dropped API request: the search falls back to the route after its time limit',
|
||||
name: 'Dropped API request: search uses the site proxy before falling back to the route',
|
||||
url: '',
|
||||
screenshot: false,
|
||||
run: async (page) => {
|
||||
@@ -749,6 +791,18 @@ const searchPassTestCases: Test[] = [
|
||||
await page.route(SEARCH_API_URL, (route) => {
|
||||
apiCalls.push(route.request());
|
||||
});
|
||||
const proxyCalls: Request[] = [];
|
||||
await page.route(
|
||||
/\/~gitbook\/search-direct\/orgs\/[^/]+\/sites\/[^/]+$/,
|
||||
async (route) => {
|
||||
proxyCalls.push(route.request());
|
||||
if (proxyCalls.length === 1) {
|
||||
await route.fulfill({ json: { items: [SEARCH_PASS_RECORD] } });
|
||||
return;
|
||||
}
|
||||
await route.fulfill({ status: 502 });
|
||||
}
|
||||
);
|
||||
const routeSearches = trackRouteSearches(page);
|
||||
await waitForCookiesDialog(page);
|
||||
|
||||
@@ -756,12 +810,24 @@ const searchPassTestCases: Test[] = [
|
||||
await typeSearch(page, 'gitbook');
|
||||
await expect.poll(() => apiCalls.length, { timeout: 30_000 }).toBe(1);
|
||||
await page.clock.fastForward(5_000);
|
||||
await expect.poll(() => routeSearches.length, { timeout: 30_000 }).toBe(1);
|
||||
expect(routeSearches[0]?.headers()['x-gitbook-search-fallback']).toBe('timeout');
|
||||
expect((await routeSearches[0]?.response())?.status()).toBe(200);
|
||||
await expect(
|
||||
page
|
||||
.getByTestId('search-record-result')
|
||||
.filter({ hasText: SEARCH_PASS_RECORD.title })
|
||||
).toBeVisible({ timeout: 30_000 });
|
||||
expect(routeSearches).toHaveLength(0);
|
||||
expect((await proxyCalls[0]?.allHeaders())?.['x-gitbook-search-pass']).toBe(
|
||||
'test-search-pass-1'
|
||||
);
|
||||
|
||||
await typeSearch(page, ' editor');
|
||||
await expect.poll(() => routeSearches.length, { timeout: 30_000 }).toBe(1);
|
||||
expect(routeSearches[0]?.headers()['x-gitbook-search-fallback']).toBe('502');
|
||||
expect((await routeSearches[0]?.response())?.status()).toBe(200);
|
||||
|
||||
await typeSearch(page, ' blocks');
|
||||
await expect.poll(() => routeSearches.length, { timeout: 30_000 }).toBe(2);
|
||||
expect(proxyCalls).toHaveLength(2);
|
||||
expect(apiCalls).toHaveLength(1);
|
||||
},
|
||||
},
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
"@gitbook/react-math": "workspace:*",
|
||||
"@gitbook/react-openapi": "workspace:*",
|
||||
"@mermaid-js/mermaid-zenuml": "^0.2.2",
|
||||
"@modelcontextprotocol/sdk": "1.17.5",
|
||||
"@opennextjs/aws": "4.1.16",
|
||||
"@opennextjs/cloudflare": "1.20.17",
|
||||
"@modelcontextprotocol/sdk": "1.26.0",
|
||||
"@opennextjs/aws": "4.2.1",
|
||||
"@opennextjs/cloudflare": "1.20.19",
|
||||
"@panzoom/panzoom": "^4.6.1",
|
||||
"@sindresorhus/fnv1a": "^3.1.0",
|
||||
"@tailwindcss/container-queries": "^0.1.1",
|
||||
@@ -40,7 +40,7 @@
|
||||
"jsontoxml": "^1.0.1",
|
||||
"jwt-decode": "^4.0.0",
|
||||
"leven": "^4.1.0",
|
||||
"mcp-handler": "^1.0.2",
|
||||
"mcp-handler": "^1.1.0",
|
||||
"mdast-util-from-markdown": "^2.0.2",
|
||||
"mdast-util-frontmatter": "^2.0.1",
|
||||
"mdast-util-gfm": "^3.1.0",
|
||||
@@ -82,7 +82,7 @@
|
||||
"url-join": "^5.0.0",
|
||||
"usehooks-ts": "catalog:",
|
||||
"warn-once": "^0.1.1",
|
||||
"zod": "^3",
|
||||
"zod": "^3.25",
|
||||
"zod-to-json-schema": "^3.25.1",
|
||||
"zustand": "^5.0.3"
|
||||
},
|
||||
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
import type { Metadata, Viewport } from 'next';
|
||||
import { notFound } from 'next/navigation';
|
||||
|
||||
import { type RouteParams, getDynamicSiteContext, getPagePathFromParams } from '@/app/utils';
|
||||
import {
|
||||
SitePage,
|
||||
generateSitePageMetadata,
|
||||
generateSitePageViewport,
|
||||
} from '@/components/SitePage';
|
||||
import { parseUpdatesPageParam } from '@/lib/updates-url';
|
||||
|
||||
type PageProps = {
|
||||
params: Promise<RouteParams & { page: string }>;
|
||||
};
|
||||
|
||||
export default async function Page(props: PageProps) {
|
||||
const params = await props.params;
|
||||
const updatesPage = parseUpdatesPageParam(params.page);
|
||||
if (updatesPage === null) {
|
||||
notFound();
|
||||
}
|
||||
const { context } = await getDynamicSiteContext(params);
|
||||
const pathname = getPagePathFromParams(params);
|
||||
|
||||
return (
|
||||
<SitePage
|
||||
context={context}
|
||||
pageParams={{ pathname }}
|
||||
staticRoute={false}
|
||||
updatesPage={updatesPage}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export async function generateViewport(props: PageProps): Promise<Viewport> {
|
||||
const { context } = await getDynamicSiteContext(await props.params);
|
||||
return generateSitePageViewport(context);
|
||||
}
|
||||
|
||||
export async function generateMetadata(props: PageProps): Promise<Metadata> {
|
||||
const params = await props.params;
|
||||
const updatesPage = parseUpdatesPageParam(params.page);
|
||||
if (updatesPage === null) {
|
||||
notFound();
|
||||
}
|
||||
const { context } = await getDynamicSiteContext(params);
|
||||
const pathname = getPagePathFromParams(params);
|
||||
|
||||
return generateSitePageMetadata({
|
||||
context,
|
||||
pageParams: { pathname },
|
||||
updatesPage,
|
||||
});
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
import type { Metadata } from 'next';
|
||||
import { notFound } from 'next/navigation';
|
||||
|
||||
import { type RouteParams, getPagePathFromParams } from '@/app/utils';
|
||||
import { EmbeddableDocsPage, generateEmbeddableDocsPageMetadata } from '@/components/Embeddable';
|
||||
import { getEmbeddableDynamicContext } from '@/lib/embeddable';
|
||||
import { parseUpdatesPageParam } from '@/lib/updates-url';
|
||||
|
||||
type PageProps = {
|
||||
params: Promise<RouteParams & { page: string }>;
|
||||
};
|
||||
|
||||
export default async function Page(props: PageProps) {
|
||||
const params = await props.params;
|
||||
const updatesPage = parseUpdatesPageParam(params.page);
|
||||
if (updatesPage === null) {
|
||||
notFound();
|
||||
}
|
||||
const { context } = await getEmbeddableDynamicContext(params);
|
||||
const pathname = getPagePathFromParams(params);
|
||||
|
||||
return (
|
||||
<EmbeddableDocsPage
|
||||
context={context}
|
||||
pageParams={{ pathname }}
|
||||
staticRoute={false}
|
||||
updatesPage={updatesPage}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export async function generateMetadata(props: PageProps): Promise<Metadata> {
|
||||
const params = await props.params;
|
||||
const updatesPage = parseUpdatesPageParam(params.page);
|
||||
if (updatesPage === null) {
|
||||
notFound();
|
||||
}
|
||||
const { context } = await getEmbeddableDynamicContext(params);
|
||||
const pathname = getPagePathFromParams(params);
|
||||
return generateEmbeddableDocsPageMetadata({ context, pageParams: { pathname }, updatesPage });
|
||||
}
|
||||
+24
-15
@@ -19,28 +19,37 @@ export async function handleMcpRequest(
|
||||
return new Response('Not Found', { status: 404 });
|
||||
}
|
||||
|
||||
// The server is stateless, so it has no notification stream for a GET to open. `Allow` tells
|
||||
// clients to stop asking, as the Streamable HTTP transport expects.
|
||||
if (rawRequest.method === 'GET') {
|
||||
return new Response('Method Not Allowed', { status: 405, headers: { Allow: 'POST' } });
|
||||
}
|
||||
|
||||
// Next.js request.url is the original URL and not the rewritten one from the middleware
|
||||
const requestURL = new URL(context.linker.toAbsoluteURL(context.linker.toPathInSite(endpoint)));
|
||||
requestURL.search = rawRequest.nextUrl.search;
|
||||
const request = new Request(requestURL, rawRequest);
|
||||
|
||||
trackMcpEvent({
|
||||
organizationId: context.organizationId,
|
||||
siteId: context.site.id,
|
||||
events: [
|
||||
{
|
||||
type: 'mcp_request',
|
||||
location: {
|
||||
displayContext: SiteInsightsDisplayContext.Server,
|
||||
},
|
||||
},
|
||||
],
|
||||
request,
|
||||
});
|
||||
|
||||
const mcpHandler = createMcpHandler(
|
||||
(server) => {
|
||||
registerSiteMcpTools(server, createSiteMcpTools(context, { request }));
|
||||
registerSiteMcpTools(server, createSiteMcpTools(context, { request }), {
|
||||
// Connecting, listing tools and notifications are protocol overhead, several
|
||||
// requests per client session: only tool calls count as usage.
|
||||
onToolCall: () =>
|
||||
trackMcpEvent({
|
||||
organizationId: context.organizationId,
|
||||
siteId: context.site.id,
|
||||
events: [
|
||||
{
|
||||
type: 'mcp_request',
|
||||
location: {
|
||||
displayContext: SiteInsightsDisplayContext.Server,
|
||||
},
|
||||
},
|
||||
],
|
||||
request,
|
||||
}),
|
||||
});
|
||||
},
|
||||
{
|
||||
// The same identity the server card republishes, so the card and the handshake agree.
|
||||
|
||||
+41
-2
@@ -2,7 +2,8 @@ import { type NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
import { SEARCH_FALLBACK_HEADER } from '@/components/Search/search-pass-store';
|
||||
import type { SearchSiteContentRequest } from '@/components/Search/search-types';
|
||||
import { throwIfDataError } from '@/lib/data';
|
||||
import type { SiteURLData } from '@/lib/context';
|
||||
import { type SearchRouteReason, throwIfDataError } from '@/lib/data';
|
||||
import { getLogger } from '@/lib/logger';
|
||||
import { getSiteURLDataFromMiddleware } from '@/lib/middleware';
|
||||
import { transformSitePageResult } from '@/lib/search';
|
||||
@@ -14,7 +15,8 @@ const SEARCH_FALLBACK_REASON =
|
||||
/^(\d{3}|expired|pass_request|network|timeout|invalid|unknown_space)$/;
|
||||
|
||||
export async function POST(request: NextRequest) {
|
||||
const { asEmbeddable, query, scope } = (await request.json()) as SearchSiteContentRequest;
|
||||
const { asEmbeddable, query, scope, searchId } =
|
||||
(await request.json()) as SearchSiteContentRequest;
|
||||
const [context, siteURLData] = await Promise.all([
|
||||
getServerActionBaseContext({ isEmbeddable: asEmbeddable }),
|
||||
getSiteURLDataFromMiddleware(),
|
||||
@@ -40,6 +42,8 @@ export async function POST(request: NextRequest) {
|
||||
siteId: siteURLData.site,
|
||||
query,
|
||||
scope,
|
||||
searchId,
|
||||
routeReason: getSearchRouteReason(siteURLData, fallback),
|
||||
})
|
||||
),
|
||||
throwIfDataError(
|
||||
@@ -88,3 +92,38 @@ export async function POST(request: NextRequest) {
|
||||
|
||||
return NextResponse.json(results);
|
||||
}
|
||||
|
||||
function getSearchRouteReason(
|
||||
siteURLData: SiteURLData,
|
||||
fallback: string | null
|
||||
): SearchRouteReason {
|
||||
if (siteURLData.changeRequest) {
|
||||
return 'change_request';
|
||||
}
|
||||
if (siteURLData.revision) {
|
||||
return 'revision';
|
||||
}
|
||||
if (siteURLData.preview) {
|
||||
return 'preview';
|
||||
}
|
||||
|
||||
switch (fallback) {
|
||||
case null:
|
||||
case 'expired':
|
||||
case 'pass_request':
|
||||
return 'no_pass';
|
||||
case '401':
|
||||
case '403':
|
||||
case '429':
|
||||
case 'network':
|
||||
case 'timeout':
|
||||
case 'invalid':
|
||||
case 'unknown_space':
|
||||
return `fallback:${fallback}`;
|
||||
default:
|
||||
if (/^5\d{2}$/.test(fallback)) {
|
||||
return 'fallback:5xx';
|
||||
}
|
||||
return /^\d{3}$/.test(fallback) ? 'fallback:http' : 'unknown';
|
||||
}
|
||||
}
|
||||
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
import type { Metadata, Viewport } from 'next';
|
||||
import { notFound } from 'next/navigation';
|
||||
|
||||
import { type RouteParams, getPagePathFromParams, getStaticSiteContext } from '@/app/utils';
|
||||
import {
|
||||
SitePage,
|
||||
generateSitePageMetadata,
|
||||
generateSitePageViewport,
|
||||
} from '@/components/SitePage';
|
||||
import { parseUpdatesPageParam } from '@/lib/updates-url';
|
||||
|
||||
export const dynamic = 'force-static';
|
||||
|
||||
type PageProps = {
|
||||
params: Promise<RouteParams & { page: string }>;
|
||||
};
|
||||
|
||||
export default async function Page(props: PageProps) {
|
||||
const params = await props.params;
|
||||
const updatesPage = parseUpdatesPageParam(params.page);
|
||||
if (updatesPage === null) {
|
||||
notFound();
|
||||
}
|
||||
const { context } = await getStaticSiteContext(params);
|
||||
const pathname = getPagePathFromParams(params);
|
||||
|
||||
return (
|
||||
<SitePage
|
||||
context={context}
|
||||
pageParams={{ pathname }}
|
||||
staticRoute
|
||||
updatesPage={updatesPage}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export async function generateViewport(props: PageProps): Promise<Viewport> {
|
||||
const { context } = await getStaticSiteContext(await props.params);
|
||||
return generateSitePageViewport(context);
|
||||
}
|
||||
|
||||
export async function generateMetadata(props: PageProps): Promise<Metadata> {
|
||||
const params = await props.params;
|
||||
const updatesPage = parseUpdatesPageParam(params.page);
|
||||
if (updatesPage === null) {
|
||||
notFound();
|
||||
}
|
||||
const { context } = await getStaticSiteContext(params);
|
||||
const pathname = getPagePathFromParams(params);
|
||||
|
||||
return generateSitePageMetadata({
|
||||
context,
|
||||
pageParams: { pathname },
|
||||
updatesPage,
|
||||
});
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
import type { Metadata } from 'next';
|
||||
import { notFound } from 'next/navigation';
|
||||
|
||||
import { type RouteParams, getPagePathFromParams } from '@/app/utils';
|
||||
import { EmbeddableDocsPage, generateEmbeddableDocsPageMetadata } from '@/components/Embeddable';
|
||||
import { getEmbeddableStaticContext } from '@/lib/embeddable';
|
||||
import { parseUpdatesPageParam } from '@/lib/updates-url';
|
||||
|
||||
export const dynamic = 'force-static';
|
||||
|
||||
type PageProps = {
|
||||
params: Promise<RouteParams & { page: string }>;
|
||||
};
|
||||
|
||||
export default async function Page(props: PageProps) {
|
||||
const params = await props.params;
|
||||
const updatesPage = parseUpdatesPageParam(params.page);
|
||||
if (updatesPage === null) {
|
||||
notFound();
|
||||
}
|
||||
const { context } = await getEmbeddableStaticContext(params);
|
||||
const pathname = getPagePathFromParams(params);
|
||||
|
||||
return (
|
||||
<EmbeddableDocsPage
|
||||
context={context}
|
||||
pageParams={{ pathname }}
|
||||
staticRoute
|
||||
updatesPage={updatesPage}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export async function generateMetadata(props: PageProps): Promise<Metadata> {
|
||||
const params = await props.params;
|
||||
const updatesPage = parseUpdatesPageParam(params.page);
|
||||
if (updatesPage === null) {
|
||||
notFound();
|
||||
}
|
||||
const { context } = await getEmbeddableStaticContext(params);
|
||||
const pathname = getPagePathFromParams(params);
|
||||
return generateEmbeddableDocsPageMetadata({ context, pageParams: { pathname }, updatesPage });
|
||||
}
|
||||
@@ -14,6 +14,11 @@ export async function hasContentBeenUpdated(props: { revisionId: string }) {
|
||||
const context = await getServerActionBaseContext();
|
||||
const siteURLData = await getSiteURLDataFromMiddleware();
|
||||
|
||||
// A site revision never changes what it shows.
|
||||
if (siteURLData.siteRevision) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (siteURLData.changeRequest) {
|
||||
const changeRequest = await getDataOrNull(
|
||||
context.dataFetcher.getChangeRequest({
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { DocumentBlockIntegration, RenderIntegrationUI } from '@gitbook/api';
|
||||
import { Icon } from '@gitbook/icons';
|
||||
import { ContentKitOutput } from '@gitbook/react-contentkit';
|
||||
|
||||
import type { BlockProps } from '../Block';
|
||||
@@ -53,6 +54,7 @@ export async function IntegrationBlock(props: BlockProps<DocumentBlockIntegratio
|
||||
{
|
||||
integrationName: block.data.integration,
|
||||
request: initialInput,
|
||||
allowFailedDependency: true,
|
||||
}
|
||||
);
|
||||
|
||||
@@ -66,12 +68,29 @@ export async function IntegrationBlock(props: BlockProps<DocumentBlockIntegratio
|
||||
// Integration output can render blocks with generated keys.
|
||||
{...getCommentAnchorProps(context, block.key)}
|
||||
{...getCommentMarkerProps(context, 'data-comment-block')}
|
||||
className={tcls(style)}
|
||||
role="note"
|
||||
className={tcls(
|
||||
'flex items-start gap-3 p-4 text-sm',
|
||||
'rounded-corners:rounded-md circular-corners:rounded-xl',
|
||||
'bg-warning border-warning text-neutral-strong',
|
||||
style
|
||||
)}
|
||||
>
|
||||
<pre>
|
||||
Unexpected error with integration {block.data.integration}:{' '}
|
||||
{initialResponse.error.message}
|
||||
</pre>
|
||||
<Icon
|
||||
icon="circle-exclamation"
|
||||
className="mt-0.5 size-4 shrink-0 text-warning-subtle contrast-more:text-warning"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
<div className="wrap-anywhere min-w-0">
|
||||
<p className="font-medium">
|
||||
Could not load the {block.data.integration} integration
|
||||
</p>
|
||||
<p>
|
||||
{initialResponse.error.code === 424
|
||||
? 'Ask an administrator to check its connection and settings.'
|
||||
: initialResponse.error.message}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -11,9 +11,11 @@ export async function fetchSafeIntegrationUI(
|
||||
{
|
||||
integrationName,
|
||||
request,
|
||||
allowFailedDependency = false,
|
||||
}: {
|
||||
integrationName: string;
|
||||
request: RenderIntegrationUI;
|
||||
allowFailedDependency?: boolean;
|
||||
}
|
||||
) {
|
||||
const output = await ignoreDataFetcherErrors(
|
||||
@@ -27,6 +29,7 @@ export async function fetchSafeIntegrationUI(
|
||||
404, // Integration has been uninstalled
|
||||
400, // Integration is rejecting its own request
|
||||
422, // Integration is triggering an invalid request, failing at the validation step
|
||||
...(allowFailedDependency ? [424] : []),
|
||||
502, // Integration is failing in an unexpected way
|
||||
]
|
||||
);
|
||||
|
||||
@@ -0,0 +1,384 @@
|
||||
'use client';
|
||||
|
||||
import { useRouter, useSearchParams } from 'next/navigation';
|
||||
import React from 'react';
|
||||
|
||||
import { useHash, scrollToHash } from '../hooks';
|
||||
import { CONTENT_STYLE_REDUCED, MAIN_CONTENT_ID } from '../layout';
|
||||
import { Button, SkeletonUpdate, SuspenseLoadedHint } from '../primitives';
|
||||
import { UpdatesFilterContext, applyTagFilterAttribute, areTagsEqual } from './UpdatesFilter';
|
||||
import { UpdatesFilterScript } from './UpdatesFilterScript';
|
||||
import {
|
||||
type FilteredUpdatesPageResult,
|
||||
getFilteredUpdatesPage,
|
||||
resolveUpdatesAnchor,
|
||||
} from './UpdatesServerActions';
|
||||
import { tString, useLanguage } from '@/intl/client';
|
||||
import {
|
||||
UPDATES_FILTER_KEY_ATTR,
|
||||
UPDATES_FILTER_SEARCH_PARAM,
|
||||
type UpdatesPageRange,
|
||||
getUpdatesPageRange,
|
||||
normalizeUpdatesFilterTags,
|
||||
updatesFilterStyleKey,
|
||||
} from '@/lib/updates';
|
||||
import {
|
||||
UPDATES_PAGE_SEARCH_PARAM,
|
||||
parseUpdatesPageParam,
|
||||
setUpdatesPageParam,
|
||||
} from '@/lib/updates-url';
|
||||
|
||||
const PENDING_FILTER_ATTR = 'data-updates-pending-filter';
|
||||
export const HIDE_PENDING_UPDATES = '[html[data-updates-pending-filter]_&]:hidden';
|
||||
|
||||
type FilteredPage = Extract<FilteredUpdatesPageResult, { status: 'ok' }>;
|
||||
type UpdatesView =
|
||||
| { status: 'unfiltered'; pagination: UpdatesPageRange }
|
||||
| { status: 'loading'; pagination: UpdatesPageRange | null }
|
||||
| { status: 'error'; pagination: null }
|
||||
| ({ status: 'filtered' } & Omit<FilteredPage, 'status'>);
|
||||
|
||||
type UpdatesSelection = { tags: string[]; page: number };
|
||||
|
||||
const PaginatedUpdatesContext = React.createContext<{
|
||||
view: UpdatesView;
|
||||
goToPage: (page: number) => void;
|
||||
retry: () => void;
|
||||
} | null>(null);
|
||||
|
||||
export function PaginatedUpdatesProvider(props: {
|
||||
pageId: string;
|
||||
revisionId: string;
|
||||
isEmbeddable: boolean;
|
||||
tagSlugs: string[];
|
||||
initialPagination: UpdatesPageRange;
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
const { pageId, revisionId, isEmbeddable, tagSlugs, initialPagination, children } = props;
|
||||
const router = useRouter();
|
||||
const searchParams = useSearchParams();
|
||||
const hash = useHash();
|
||||
const availableTags = React.useMemo(() => new Set(tagSlugs), [tagSlugs]);
|
||||
const styleKey = updatesFilterStyleKey(tagSlugs);
|
||||
const [selectedTags, setSelectedTags] = React.useState<string[]>([]);
|
||||
const [view, setView] = React.useState<UpdatesView>({
|
||||
status: 'unfiltered',
|
||||
pagination: initialPagination,
|
||||
});
|
||||
const selection = React.useRef<UpdatesSelection>({ tags: [], page: initialPagination.page });
|
||||
const hasNewerRevision = React.useRef(false);
|
||||
const requestId = React.useRef(0);
|
||||
|
||||
React.useLayoutEffect(() => {
|
||||
document.documentElement.setAttribute(UPDATES_FILTER_KEY_ATTR, styleKey);
|
||||
return () => {
|
||||
requestId.current++;
|
||||
document.documentElement.removeAttribute(UPDATES_FILTER_KEY_ATTR);
|
||||
document.documentElement.removeAttribute(PENDING_FILTER_ATTR);
|
||||
applyTagFilterAttribute([]);
|
||||
};
|
||||
}, [styleKey]);
|
||||
|
||||
const syncLocation = React.useCallback(
|
||||
(force = false) => {
|
||||
const url = new URL(window.location.href);
|
||||
const { tags, page } = getUpdatesSelection(url, availableTags);
|
||||
const previous = selection.current;
|
||||
const sameTags = areTagsEqual(tags, previous.tags);
|
||||
if (!force && sameTags && page === previous.page) {
|
||||
return;
|
||||
}
|
||||
|
||||
const id = ++requestId.current;
|
||||
selection.current = { tags, page };
|
||||
setSelectedTags(tags);
|
||||
applyTagFilterAttribute(tags);
|
||||
|
||||
if (!tags.length) {
|
||||
if (page !== initialPagination.page) {
|
||||
setView({ status: 'loading', pagination: null });
|
||||
router.replace(relativeURL(url));
|
||||
return;
|
||||
}
|
||||
if (hasNewerRevision.current) {
|
||||
setView({ status: 'loading', pagination: null });
|
||||
window.location.replace(relativeURL(url));
|
||||
return;
|
||||
}
|
||||
setView({ status: 'unfiltered', pagination: initialPagination });
|
||||
return;
|
||||
}
|
||||
|
||||
setView((current) => {
|
||||
let pagination = null;
|
||||
if (sameTags && current.pagination) {
|
||||
pagination = getUpdatesPageRange(page, current.pagination.totalItems);
|
||||
}
|
||||
return { status: 'loading', pagination };
|
||||
});
|
||||
|
||||
async function load() {
|
||||
let result: FilteredUpdatesPageResult = { status: 'error' };
|
||||
try {
|
||||
result = await getFilteredUpdatesPage({ pageId, tags, page, isEmbeddable });
|
||||
} catch {
|
||||
// Network or aborted action leaves the filter selected so the reader can retry.
|
||||
}
|
||||
const currentURL = new URL(window.location.href);
|
||||
const selected = getUpdatesSelection(currentURL, availableTags);
|
||||
if (
|
||||
id !== requestId.current ||
|
||||
currentURL.pathname !== url.pathname ||
|
||||
selected.page !== page ||
|
||||
!areTagsEqual(selected.tags, tags)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (result.status === 'error') {
|
||||
setView({ status: 'error', pagination: null });
|
||||
return;
|
||||
}
|
||||
|
||||
if (result.revisionId !== revisionId) {
|
||||
hasNewerRevision.current = true;
|
||||
}
|
||||
|
||||
if (result.status === 'unfiltered') {
|
||||
const fallback = currentURL;
|
||||
fallback.searchParams.delete(UPDATES_FILTER_SEARCH_PARAM);
|
||||
setUpdatesPageParam(fallback.searchParams, initialPagination.page);
|
||||
window.history.replaceState(null, '', relativeURL(fallback));
|
||||
selection.current = { tags: [], page: initialPagination.page };
|
||||
setSelectedTags([]);
|
||||
applyTagFilterAttribute([]);
|
||||
if (hasNewerRevision.current) {
|
||||
setView({ status: 'loading', pagination: null });
|
||||
window.location.replace(relativeURL(fallback));
|
||||
return;
|
||||
}
|
||||
setView({ status: 'unfiltered', pagination: initialPagination });
|
||||
return;
|
||||
}
|
||||
|
||||
if (result.pagination.isClamped) {
|
||||
const clamped = currentURL;
|
||||
setUpdatesPageParam(clamped.searchParams, result.pagination.page);
|
||||
window.history.replaceState(null, '', relativeURL(clamped));
|
||||
selection.current = { tags, page: result.pagination.page };
|
||||
}
|
||||
setView({
|
||||
status: 'filtered',
|
||||
revisionId: result.revisionId,
|
||||
content: result.content,
|
||||
sections: result.sections,
|
||||
pagination: result.pagination,
|
||||
});
|
||||
}
|
||||
|
||||
void load();
|
||||
},
|
||||
[availableTags, pageId, revisionId, initialPagination, isEmbeddable, router]
|
||||
);
|
||||
|
||||
React.useLayoutEffect(() => {
|
||||
syncLocation();
|
||||
}, [searchParams, syncLocation]);
|
||||
|
||||
React.useEffect(() => {
|
||||
const onPopState = () => syncLocation();
|
||||
window.addEventListener('popstate', onPopState);
|
||||
return () => {
|
||||
window.removeEventListener('popstate', onPopState);
|
||||
};
|
||||
}, [syncLocation]);
|
||||
|
||||
React.useLayoutEffect(() => {
|
||||
if (view.status !== 'loading') {
|
||||
document.documentElement.removeAttribute(PENDING_FILTER_ATTR);
|
||||
}
|
||||
}, [view]);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (
|
||||
view.status === 'loading' ||
|
||||
view.status === 'error' ||
|
||||
(view.status === 'unfiltered' && selection.current.tags.length > 0)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
let active = true;
|
||||
async function resolveHash() {
|
||||
const url = new URL(window.location.href);
|
||||
const anchorHash = url.hash;
|
||||
if (!anchorHash || scrollToHash(anchorHash.slice(1))) {
|
||||
return;
|
||||
}
|
||||
|
||||
let anchor: string;
|
||||
try {
|
||||
anchor = decodeURIComponent(anchorHash.slice(1));
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
|
||||
const id = requestId.current;
|
||||
const { tags } = selection.current;
|
||||
try {
|
||||
const result = await resolveUpdatesAnchor({ pageId, anchor, tags, isEmbeddable });
|
||||
if (
|
||||
!active ||
|
||||
!result.found ||
|
||||
id !== requestId.current ||
|
||||
url.href !== window.location.href
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
setUpdatesPageParam(url.searchParams, result.page);
|
||||
if (result.clearTags) {
|
||||
url.searchParams.delete(UPDATES_FILTER_SEARCH_PARAM);
|
||||
}
|
||||
if (url.href !== window.location.href) {
|
||||
router.replace(relativeURL(url));
|
||||
}
|
||||
} catch {
|
||||
// An unresolved hash should leave the visitor on the current page.
|
||||
}
|
||||
}
|
||||
|
||||
void resolveHash();
|
||||
window.addEventListener('hashchange', resolveHash);
|
||||
return () => {
|
||||
active = false;
|
||||
window.removeEventListener('hashchange', resolveHash);
|
||||
};
|
||||
}, [hash, isEmbeddable, pageId, router, view]);
|
||||
|
||||
function navigate(tags: string[], page: number, history: 'push' | 'replace') {
|
||||
const url = new URL(window.location.href);
|
||||
url.searchParams.delete(UPDATES_FILTER_SEARCH_PARAM);
|
||||
for (const tag of tags) {
|
||||
url.searchParams.append(UPDATES_FILTER_SEARCH_PARAM, tag);
|
||||
}
|
||||
setUpdatesPageParam(url.searchParams, page);
|
||||
url.hash = '';
|
||||
if (tags.length === 0 && (page !== initialPagination.page || hasNewerRevision.current)) {
|
||||
requestId.current++;
|
||||
selection.current = { tags, page };
|
||||
setSelectedTags(tags);
|
||||
applyTagFilterAttribute(tags);
|
||||
setView({ status: 'loading', pagination: null });
|
||||
if (hasNewerRevision.current) {
|
||||
window.location.replace(relativeURL(url));
|
||||
} else {
|
||||
router.replace(relativeURL(url));
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (history === 'push') {
|
||||
window.history.pushState(null, '', relativeURL(url));
|
||||
} else {
|
||||
window.history.replaceState(null, '', relativeURL(url));
|
||||
}
|
||||
syncLocation();
|
||||
const main = document.getElementById(MAIN_CONTENT_ID);
|
||||
if (main) {
|
||||
main.scrollIntoView({ block: 'start', behavior: 'instant' });
|
||||
main.focus({ preventScroll: true });
|
||||
}
|
||||
}
|
||||
|
||||
function toggleTag(tag: string) {
|
||||
const { tags } = selection.current;
|
||||
if (tags.includes(tag)) {
|
||||
navigate(
|
||||
tags.filter((selected) => selected !== tag),
|
||||
1,
|
||||
'replace'
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
navigate(normalizeUpdatesFilterTags([...tags, tag], availableTags), 1, 'replace');
|
||||
}
|
||||
|
||||
return (
|
||||
<UpdatesFilterContext.Provider
|
||||
value={{
|
||||
selectedTags,
|
||||
selectedTagSet: new Set(selectedTags),
|
||||
toggleTag,
|
||||
clearTags: () => navigate([], 1, 'replace'),
|
||||
}}
|
||||
>
|
||||
<PaginatedUpdatesContext.Provider
|
||||
value={{
|
||||
view,
|
||||
goToPage: (page) => navigate(selection.current.tags, page, 'push'),
|
||||
retry: () => syncLocation(true),
|
||||
}}
|
||||
>
|
||||
{tagSlugs.length > 0 && (
|
||||
<UpdatesFilterScript
|
||||
tagSlugs={tagSlugs}
|
||||
filterAttribute={PENDING_FILTER_ATTR}
|
||||
/>
|
||||
)}
|
||||
{children}
|
||||
</PaginatedUpdatesContext.Provider>
|
||||
</UpdatesFilterContext.Provider>
|
||||
);
|
||||
}
|
||||
|
||||
export function usePaginatedUpdates() {
|
||||
return React.useContext(PaginatedUpdatesContext);
|
||||
}
|
||||
|
||||
export function PaginatedUpdatesBody(props: { children: React.ReactNode }) {
|
||||
const updates = usePaginatedUpdates();
|
||||
const language = useLanguage();
|
||||
if (updates?.view.status === 'loading') {
|
||||
return <SkeletonUpdate className={CONTENT_STYLE_REDUCED} />;
|
||||
}
|
||||
if (updates?.view.status === 'error') {
|
||||
return (
|
||||
<div
|
||||
role="alert"
|
||||
className={`${CONTENT_STYLE_REDUCED} flex items-center justify-between gap-4 rounded-lg border border-tint-subtle p-4 text-sm text-tint`}
|
||||
>
|
||||
<span>{tString(language, 'unexpected_error')}</span>
|
||||
<Button
|
||||
variant="secondary"
|
||||
size="small"
|
||||
label={tString(language, 'unexpected_error_retry')}
|
||||
onClick={updates.retry}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
if (updates?.view.status === 'filtered') {
|
||||
return (
|
||||
<div className="contents" data-content-ref-root="">
|
||||
<SuspenseLoadedHint />
|
||||
{updates.view.content}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
return <div className={`contents ${HIDE_PENDING_UPDATES}`}>{props.children}</div>;
|
||||
}
|
||||
|
||||
function getUpdatesSelection(url: URL, availableTags: ReadonlySet<string>): UpdatesSelection {
|
||||
return {
|
||||
tags: normalizeUpdatesFilterTags(
|
||||
url.searchParams.getAll(UPDATES_FILTER_SEARCH_PARAM),
|
||||
availableTags
|
||||
),
|
||||
page: parseUpdatesPageParam(url.searchParams.get(UPDATES_PAGE_SEARCH_PARAM)) ?? 1,
|
||||
};
|
||||
}
|
||||
|
||||
function relativeURL(url: URL): string {
|
||||
return `${url.pathname}${url.search}${url.hash}`;
|
||||
}
|
||||
@@ -75,7 +75,7 @@ export function Update(props: BlockProps<DocumentBlockUpdate>) {
|
||||
{...contextProps}
|
||||
nodes={block.nodes}
|
||||
ancestorBlocks={[...ancestorBlocks, block]}
|
||||
style="flex flex-1 flex-col [&>*+*]:mt-5 [&>*:first-child]:!pt-0"
|
||||
style="flex min-w-0 flex-1 flex-col [&>*+*]:mt-5 [&>*:first-child]:!pt-0"
|
||||
/>
|
||||
</FilteredUpdate>
|
||||
);
|
||||
|
||||
@@ -36,7 +36,7 @@ const emptyUpdatesFilterContext: UpdatesFilterContextValue = {
|
||||
clearTags: () => {},
|
||||
};
|
||||
|
||||
const UpdatesFilterContext = React.createContext<UpdatesFilterContextValue | null>(null);
|
||||
export const UpdatesFilterContext = React.createContext<UpdatesFilterContextValue | null>(null);
|
||||
|
||||
export function UpdatesFilterProvider(props: { tagSlugs: string[]; children: React.ReactNode }) {
|
||||
const { tagSlugs, children } = props;
|
||||
@@ -249,12 +249,12 @@ function TagChip(props: { tag: RevisionTag; onToggle: (tag: string) => void }) {
|
||||
);
|
||||
}
|
||||
|
||||
function areTagsEqual(left: string[], right: string[]): boolean {
|
||||
export function areTagsEqual(left: string[], right: string[]): boolean {
|
||||
return left.length === right.length && left.every((tag, index) => tag === right[index]);
|
||||
}
|
||||
|
||||
/** Mirrors the active filter onto `<html>`, matching what the pre-paint script does on first load. */
|
||||
function applyTagFilterAttribute(tags: string[]) {
|
||||
export function applyTagFilterAttribute(tags: string[]) {
|
||||
if (typeof document === 'undefined') {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -58,12 +58,12 @@ export function applyUpdatesFilterScript(
|
||||
* Inline script that applies the URL's `?tag=` filter to `<html>` before first paint. Rendered only
|
||||
* on pages with filterable updates (see SitePage), not globally.
|
||||
*/
|
||||
export function UpdatesFilterScript(props: { tagSlugs: string[] }) {
|
||||
const { tagSlugs } = props;
|
||||
export function UpdatesFilterScript(props: { tagSlugs: string[]; filterAttribute?: string }) {
|
||||
const { tagSlugs, filterAttribute = UPDATES_TAG_FILTER_ATTR } = props;
|
||||
const inserted = useRef(false);
|
||||
const scriptArgs = serializeUpdatesFilterScriptArgs([
|
||||
UPDATES_FILTER_SEARCH_PARAM,
|
||||
UPDATES_TAG_FILTER_ATTR,
|
||||
filterAttribute,
|
||||
UPDATES_TAG_FILTER_CAP,
|
||||
tagSlugs,
|
||||
UPDATES_FILTER_KEY_ATTR,
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
'use client';
|
||||
|
||||
import { useSearchParams } from 'next/navigation';
|
||||
|
||||
import { Icon } from '@gitbook/icons';
|
||||
|
||||
import { CONTENT_STYLE_REDUCED } from '../layout';
|
||||
import { Button } from '../primitives';
|
||||
import { HIDE_PENDING_UPDATES, usePaginatedUpdates } from './PaginatedUpdates';
|
||||
import { tString } from '@/intl/translate';
|
||||
import type { TranslationLanguage } from '@/intl/translations';
|
||||
import { tcls } from '@/lib/tailwind';
|
||||
import {
|
||||
UPDATES_FILTER_SEARCH_PARAM,
|
||||
UPDATES_MAX_PAGE,
|
||||
setUpdatesPageParam,
|
||||
} from '@/lib/updates-url';
|
||||
|
||||
export function UpdatesPagination(props: { language: TranslationLanguage; baseHref: string }) {
|
||||
const { language, baseHref } = props;
|
||||
const updates = usePaginatedUpdates();
|
||||
const searchParams = useSearchParams();
|
||||
if (!updates?.view.pagination || updates.view.pagination.totalPages <= 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const { view, goToPage } = updates;
|
||||
const { page, totalPages, totalItems, start, end } = updates.view.pagination;
|
||||
const number = new Intl.NumberFormat(language.locale);
|
||||
const previousLabel = tString(language, 'previous_page');
|
||||
const nextLabel = tString(language, 'next_page');
|
||||
|
||||
function buttonProps(targetPage: number, rel: 'prev' | 'next') {
|
||||
if (view.status !== 'unfiltered') {
|
||||
return { onClick: () => goToPage(targetPage) };
|
||||
}
|
||||
const params = new URLSearchParams(searchParams?.toString());
|
||||
params.delete(UPDATES_FILTER_SEARCH_PARAM);
|
||||
setUpdatesPageParam(params, targetPage);
|
||||
const query = params.toString();
|
||||
let href = baseHref;
|
||||
if (query) {
|
||||
href += `?${query}`;
|
||||
}
|
||||
return { href, rel };
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
className={tcls(
|
||||
CONTENT_STYLE_REDUCED,
|
||||
'mt-8 flex items-center justify-between gap-2 border-t border-tint-subtle pt-4',
|
||||
view.status === 'unfiltered' && HIDE_PENDING_UPDATES
|
||||
)}
|
||||
>
|
||||
<div aria-live="polite" className="text-sm text-tint">
|
||||
{tString(
|
||||
language,
|
||||
'updates_pagination_range',
|
||||
number.format(start),
|
||||
number.format(end),
|
||||
number.format(totalItems)
|
||||
)}
|
||||
</div>
|
||||
<nav
|
||||
aria-label={tString(language, 'updates_pagination_navigation')}
|
||||
className="flex justify-end gap-2"
|
||||
>
|
||||
{page > 1 && (
|
||||
<Button
|
||||
variant="blank"
|
||||
size="small"
|
||||
icon="chevron-left"
|
||||
label={previousLabel}
|
||||
{...buttonProps(page - 1, 'prev')}
|
||||
/>
|
||||
)}
|
||||
{page < totalPages && page < UPDATES_MAX_PAGE && (
|
||||
<Button
|
||||
variant="blank"
|
||||
size="small"
|
||||
trailing={<Icon icon="chevron-right" className="size-3" />}
|
||||
label={nextLabel}
|
||||
{...buttonProps(page + 1, 'next')}
|
||||
/>
|
||||
)}
|
||||
</nav>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
'use server';
|
||||
|
||||
import type * as React from 'react';
|
||||
|
||||
import { IconsProvider } from '@gitbook/icons';
|
||||
|
||||
import { PageBodyDocument } from '../PageBody/PageBodyDocument';
|
||||
import { getPageDocument } from '@/lib/data';
|
||||
import { getDocumentSections } from '@/lib/document-sections';
|
||||
import {
|
||||
getContentInlineIconSourceRequests,
|
||||
getCustomizationIconStyle,
|
||||
getInlineIconSources,
|
||||
} from '@/lib/icons/inline';
|
||||
import { getLogger } from '@/lib/logger';
|
||||
import { resolvePageId } from '@/lib/pages';
|
||||
import { fetchServerActionSiteContext, getServerActionBaseContext } from '@/lib/server-actions';
|
||||
import {
|
||||
findUpdateAnchorPage,
|
||||
getDocumentFilterableTags,
|
||||
normalizeUpdatesFilterTags,
|
||||
paginateUpdatesDocument,
|
||||
} from '@/lib/updates';
|
||||
import { UPDATES_MAX_PAGE } from '@/lib/updates-url';
|
||||
|
||||
type UpdatesPageAction = {
|
||||
pageId: string;
|
||||
tags: string[];
|
||||
isEmbeddable: boolean;
|
||||
};
|
||||
|
||||
export type FilteredUpdatesPageResult =
|
||||
| {
|
||||
status: 'ok';
|
||||
revisionId: string;
|
||||
content: React.ReactNode;
|
||||
sections: Awaited<ReturnType<typeof getDocumentSections>>;
|
||||
pagination: NonNullable<ReturnType<typeof paginateUpdatesDocument>['pagination']>;
|
||||
}
|
||||
| {
|
||||
status: 'unfiltered';
|
||||
revisionId: string;
|
||||
}
|
||||
| {
|
||||
status: 'error';
|
||||
};
|
||||
|
||||
export async function getFilteredUpdatesPage(
|
||||
options: UpdatesPageAction & { page: number }
|
||||
): Promise<FilteredUpdatesPageResult> {
|
||||
const logger = getLogger().subLogger('updatesPagination');
|
||||
if (!Number.isInteger(options.page) || options.page < 1 || options.page > UPDATES_MAX_PAGE) {
|
||||
logger.warn('Invalid filtered updates page number');
|
||||
return { status: 'error' };
|
||||
}
|
||||
try {
|
||||
const { context, page, document } = await getUpdatesPageDocument(options);
|
||||
const availableTags = new Set(
|
||||
getDocumentFilterableTags(document, context.revision).map((tag) => tag.slug)
|
||||
);
|
||||
const tags = normalizeUpdatesFilterTags(options.tags, availableTags);
|
||||
if (!tags.length) {
|
||||
logger.info('No selected tags on the current revision', { pageId: page.id });
|
||||
return { status: 'unfiltered', revisionId: context.revisionId };
|
||||
}
|
||||
|
||||
const result = paginateUpdatesDocument(document, context.revision, {
|
||||
page: options.page,
|
||||
tags,
|
||||
});
|
||||
if (!result.pagination) {
|
||||
logger.info('Current revision no longer needs updates pagination', { pageId: page.id });
|
||||
return { status: 'unfiltered', revisionId: context.revisionId };
|
||||
}
|
||||
|
||||
const [sections, iconSources] = await Promise.all([
|
||||
getDocumentSections(context, result.document),
|
||||
getInlineIconSources(
|
||||
getContentInlineIconSourceRequests({
|
||||
iconStyle: getCustomizationIconStyle(context.customization),
|
||||
document: result.document,
|
||||
})
|
||||
),
|
||||
]);
|
||||
logger.info('Rendered filtered updates page', {
|
||||
siteId: context.site.id,
|
||||
pageId: page.id,
|
||||
page: result.pagination.page,
|
||||
totalItems: result.pagination.totalItems,
|
||||
totalPages: result.pagination.totalPages,
|
||||
});
|
||||
return {
|
||||
status: 'ok',
|
||||
revisionId: context.revisionId,
|
||||
content: (
|
||||
<IconsProvider iconSources={iconSources}>
|
||||
<PageBodyDocument context={context} page={page} document={result.document} />
|
||||
</IconsProvider>
|
||||
),
|
||||
sections,
|
||||
pagination: result.pagination,
|
||||
};
|
||||
} catch {
|
||||
logger.warn('Could not render filtered updates page');
|
||||
return { status: 'error' };
|
||||
}
|
||||
}
|
||||
|
||||
export async function resolveUpdatesAnchor(options: UpdatesPageAction & { anchor: string }) {
|
||||
const logger = getLogger().subLogger('updatesPagination');
|
||||
try {
|
||||
const { context, page, document } = await getUpdatesPageDocument(options);
|
||||
const result = findUpdateAnchorPage(document, context.revision, options);
|
||||
logger.info('Resolved updates anchor', {
|
||||
siteId: context.site.id,
|
||||
pageId: page.id,
|
||||
found: result.found,
|
||||
page: result.found && result.page,
|
||||
});
|
||||
if (result.found && result.page <= UPDATES_MAX_PAGE) {
|
||||
return result;
|
||||
}
|
||||
} catch {
|
||||
logger.warn('Could not resolve updates anchor');
|
||||
}
|
||||
return { found: false as const };
|
||||
}
|
||||
|
||||
async function getUpdatesPageDocument({ pageId, isEmbeddable }: UpdatesPageAction) {
|
||||
const context = await fetchServerActionSiteContext(
|
||||
await getServerActionBaseContext({ isEmbeddable })
|
||||
);
|
||||
const target = resolvePageId(context.revision.pages, pageId);
|
||||
if (!target) {
|
||||
throw new Error('Updates page not found');
|
||||
}
|
||||
|
||||
const { page } = target;
|
||||
const document = await getPageDocument(context, page);
|
||||
if (!document) {
|
||||
throw new Error('Updates document not found');
|
||||
}
|
||||
return { context: { ...context, page }, page, document };
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
import type { Metadata } from 'next';
|
||||
|
||||
import { SiteInsightsDisplayContext } from '@gitbook/api';
|
||||
import { IconsProvider } from '@gitbook/icons';
|
||||
|
||||
import { PaginatedUpdatesProvider } from '../DocumentView/PaginatedUpdates';
|
||||
import { HeaderMobileMenu } from '../Header/HeaderMobileMenu';
|
||||
import { SpacesDropdown, TranslationsDropdown } from '../Header/SpacesDropdown';
|
||||
import { PageBody } from '../PageBody';
|
||||
@@ -33,6 +35,7 @@ export const dynamic = 'force-static';
|
||||
type EmbeddableDocsPageProps = {
|
||||
context: GitBookSiteContext;
|
||||
pageParams: PagePathParams;
|
||||
updatesPage?: number;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -41,11 +44,51 @@ type EmbeddableDocsPageProps = {
|
||||
export async function EmbeddableDocsPage(
|
||||
props: EmbeddableDocsPageProps & { staticRoute: boolean }
|
||||
) {
|
||||
const { context, pageParams } = props;
|
||||
const { page, document, ancestors, withPageFeedback } = await getSitePageData({
|
||||
context,
|
||||
pageParams,
|
||||
});
|
||||
const { context } = props;
|
||||
const {
|
||||
page,
|
||||
document,
|
||||
ancestors,
|
||||
withPageFeedback,
|
||||
contentHasUpdates,
|
||||
pagination,
|
||||
pageHref,
|
||||
filterableTags,
|
||||
iconSources,
|
||||
} = await getSitePageData(props);
|
||||
let updatesBaseHref: string | undefined;
|
||||
if (pagination) {
|
||||
updatesBaseHref = pageHref;
|
||||
}
|
||||
let pageBody = (
|
||||
<PageBody
|
||||
context={context}
|
||||
page={page}
|
||||
ancestors={ancestors}
|
||||
document={document}
|
||||
withPageFeedback={withPageFeedback}
|
||||
insightsDisplayContext={SiteInsightsDisplayContext.Embed}
|
||||
staticRoute={props.staticRoute}
|
||||
contentHasUpdates={contentHasUpdates}
|
||||
updatesBaseHref={updatesBaseHref}
|
||||
/>
|
||||
);
|
||||
if (pagination) {
|
||||
pageBody = (
|
||||
<IconsProvider iconSources={iconSources}>
|
||||
<PaginatedUpdatesProvider
|
||||
key={`${context.space.id}/${context.revisionId}/${page.id}/${pagination.page}`}
|
||||
pageId={page.id}
|
||||
revisionId={context.revisionId}
|
||||
isEmbeddable
|
||||
tagSlugs={filterableTags.map((tag) => tag.slug)}
|
||||
initialPagination={pagination}
|
||||
>
|
||||
{pageBody}
|
||||
</PaginatedUpdatesProvider>
|
||||
</IconsProvider>
|
||||
);
|
||||
}
|
||||
|
||||
const variants = categorizeVariants(context);
|
||||
|
||||
@@ -147,15 +190,7 @@ export async function EmbeddableDocsPage(
|
||||
) : null
|
||||
}
|
||||
/>
|
||||
<PageBody
|
||||
context={context}
|
||||
page={page}
|
||||
ancestors={ancestors}
|
||||
document={document}
|
||||
withPageFeedback={withPageFeedback}
|
||||
insightsDisplayContext={SiteInsightsDisplayContext.Embed}
|
||||
staticRoute={props.staticRoute}
|
||||
/>
|
||||
{pageBody}
|
||||
</ScrollContainer>
|
||||
</EmbeddableFrameBody>
|
||||
</EmbeddableFrameMain>
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { SiteInsightsDisplayContext } from '@gitbook/api';
|
||||
|
||||
import { useTrackEvent } from '../Insights';
|
||||
import { LinkContext } from '../primitives';
|
||||
import { useIsVisible } from '../VisibilityContext';
|
||||
@@ -37,9 +39,10 @@ export function EmbeddableSearch(props: EmbeddableSearchProps) {
|
||||
return;
|
||||
}
|
||||
|
||||
trackEvent({
|
||||
type: 'search_open',
|
||||
});
|
||||
trackEvent(
|
||||
{ type: 'search_open' },
|
||||
{ pageId: null, displayContext: SiteInsightsDisplayContext.Embed }
|
||||
);
|
||||
}, [trackEvent, isVisible]);
|
||||
|
||||
const tabsRef = React.useRef<HTMLDivElement>(null);
|
||||
@@ -56,6 +59,7 @@ export function EmbeddableSearch(props: EmbeddableSearchProps) {
|
||||
query,
|
||||
results,
|
||||
resultsId,
|
||||
resultsQuery,
|
||||
resultsRef,
|
||||
searchValue,
|
||||
setQuery,
|
||||
@@ -79,6 +83,7 @@ export function EmbeddableSearch(props: EmbeddableSearchProps) {
|
||||
query={query}
|
||||
results={results}
|
||||
resultsId={resultsId}
|
||||
resultsQuery={resultsQuery}
|
||||
resultsRef={resultsRef}
|
||||
onResultSelect={onResultSelect}
|
||||
onResultHover={onResultHover}
|
||||
|
||||
@@ -15,6 +15,7 @@ import { Button } from '@/components/primitives/Button';
|
||||
import { DropdownMenuItem, useDropdownMenuClose } from '@/components/primitives/DropdownMenu';
|
||||
import { getURLForLLM } from '@/components/utils';
|
||||
import { tString, useLanguage } from '@/intl/client';
|
||||
import { getSiteMcpServerName } from '@/lib/mcp/naming';
|
||||
|
||||
type PageActionType = 'button' | 'dropdown-menu-item';
|
||||
|
||||
@@ -296,7 +297,7 @@ export function ActionOpenMCP(props: {
|
||||
const providerInfo = React.useMemo<{ label: string; icon: IconName; url: string }>(() => {
|
||||
switch (provider) {
|
||||
case 'vscode': {
|
||||
const vscodeConfig = { name: siteTitle, url: mcpURL };
|
||||
const vscodeConfig = { name: getSiteMcpServerName(siteTitle), url: mcpURL };
|
||||
return {
|
||||
label: 'VSCode',
|
||||
icon: 'vscode',
|
||||
@@ -332,7 +333,7 @@ export function ActionCopyMCPCommand(props: {
|
||||
const language = useLanguage();
|
||||
|
||||
const slug =
|
||||
siteTitle
|
||||
getSiteMcpServerName(siteTitle)
|
||||
.toLowerCase()
|
||||
.replace(/[^a-z0-9]+/g, '-')
|
||||
.replace(/^-|-$/g, '') || 'docs';
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
import type { RevisionPageDocument } from '@gitbook/api';
|
||||
|
||||
import { PageActionsDropdown } from './PageActionsDropdown';
|
||||
import { getPageActionsURLs } from './pageActionsURLs';
|
||||
import type { GitBookSiteContext } from '@/lib/context';
|
||||
|
||||
/**
|
||||
* Menu of the page actions. It loads what it shows from the context and the page alone, so it can be
|
||||
* rendered and cached apart from the page body.
|
||||
*/
|
||||
export async function PageActionsMenu(props: {
|
||||
context: GitBookSiteContext;
|
||||
page: RevisionPageDocument;
|
||||
}) {
|
||||
const { context, page } = props;
|
||||
const { linker, revision } = context;
|
||||
|
||||
return (
|
||||
<PageActionsDropdown
|
||||
siteTitle={context.site.title}
|
||||
urls={await getPageActionsURLs(context, page)}
|
||||
actions={context.customization.pageActions}
|
||||
page={{
|
||||
id: page.id,
|
||||
title: page.title,
|
||||
path: page.path,
|
||||
href: linker.toPathForPage({ pages: revision.pages, page }),
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
import { describe, expect, it, mock } from 'bun:test';
|
||||
|
||||
import { CustomizationPageActionType, type RevisionPageDocument } from '@gitbook/api';
|
||||
|
||||
import type { GitBookSiteContext } from '@/lib/context';
|
||||
|
||||
mock.module('server-only', () => ({}));
|
||||
|
||||
const { getPageGitMetadata } = await import('./pageActionsData');
|
||||
|
||||
const page = {
|
||||
id: 'page-1',
|
||||
title: 'Introduction',
|
||||
kind: 'sheet',
|
||||
type: 'document',
|
||||
path: 'readme',
|
||||
slug: 'readme',
|
||||
pages: [],
|
||||
} as RevisionPageDocument;
|
||||
|
||||
const git = {
|
||||
oid: 'abc123',
|
||||
path: 'README.md',
|
||||
};
|
||||
|
||||
function createContext(options: { gitEnabled: boolean; gitSync?: boolean }) {
|
||||
const getRevisionPageByPath = mock(async () => ({
|
||||
data: {
|
||||
...page,
|
||||
git,
|
||||
},
|
||||
}));
|
||||
|
||||
const context = {
|
||||
revisionId: 'revision-1',
|
||||
customization: {
|
||||
pageActions: {
|
||||
items: options.gitEnabled ? [CustomizationPageActionType.Git] : [],
|
||||
},
|
||||
},
|
||||
space: {
|
||||
id: 'space-1',
|
||||
gitSync:
|
||||
options.gitSync === false
|
||||
? undefined
|
||||
: {
|
||||
url: 'https://github.com/gitbook/example/tree/main',
|
||||
},
|
||||
},
|
||||
dataFetcher: { getRevisionPageByPath },
|
||||
} as unknown as GitBookSiteContext;
|
||||
|
||||
return { context, getRevisionPageByPath };
|
||||
}
|
||||
|
||||
describe('getPageGitMetadata', () => {
|
||||
it('fetches the Git metadata for an enabled Edit on Git action', async () => {
|
||||
const { context, getRevisionPageByPath } = createContext({ gitEnabled: true });
|
||||
|
||||
const result = await getPageGitMetadata(context, page);
|
||||
|
||||
expect(getRevisionPageByPath).toHaveBeenCalledWith({
|
||||
spaceId: 'space-1',
|
||||
revisionId: 'revision-1',
|
||||
path: 'readme',
|
||||
metadata: true,
|
||||
cachedMetadata: true,
|
||||
});
|
||||
expect(result).toEqual(git);
|
||||
});
|
||||
|
||||
it('does not fetch Git metadata already on the page', async () => {
|
||||
const { context, getRevisionPageByPath } = createContext({ gitEnabled: true });
|
||||
|
||||
const result = await getPageGitMetadata(context, { ...page, git });
|
||||
|
||||
expect(getRevisionPageByPath).not.toHaveBeenCalled();
|
||||
expect(result).toEqual(git);
|
||||
});
|
||||
|
||||
it('does not fetch Git metadata when the action is disabled', async () => {
|
||||
const { context, getRevisionPageByPath } = createContext({ gitEnabled: false });
|
||||
|
||||
const result = await getPageGitMetadata(context, page);
|
||||
|
||||
expect(getRevisionPageByPath).not.toHaveBeenCalled();
|
||||
expect(result).toBeUndefined();
|
||||
});
|
||||
|
||||
it('does not fetch Git metadata without Git Sync', async () => {
|
||||
const { context, getRevisionPageByPath } = createContext({
|
||||
gitEnabled: true,
|
||||
gitSync: false,
|
||||
});
|
||||
|
||||
const result = await getPageGitMetadata(context, page);
|
||||
|
||||
expect(getRevisionPageByPath).not.toHaveBeenCalled();
|
||||
expect(result).toBeUndefined();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,63 @@
|
||||
import { CustomizationPageActionType, type RevisionPageDocument } from '@gitbook/api';
|
||||
|
||||
import type { GitBookSiteContext } from '@/lib/context';
|
||||
|
||||
const CONFIGURABLE_PAGE_ACTIONS = [
|
||||
CustomizationPageActionType.Assistant,
|
||||
CustomizationPageActionType.ExternalAi,
|
||||
CustomizationPageActionType.Markdown,
|
||||
CustomizationPageActionType.Mcp,
|
||||
CustomizationPageActionType.Pdf,
|
||||
CustomizationPageActionType.Git,
|
||||
];
|
||||
|
||||
/**
|
||||
* Whether a given built-in page action is enabled.
|
||||
*/
|
||||
export function isPageActionEnabled(
|
||||
customization: GitBookSiteContext['customization'],
|
||||
type: CustomizationPageActionType
|
||||
): boolean {
|
||||
const { pageActions } = customization;
|
||||
if (pageActions.items) {
|
||||
return pageActions.items.includes(type);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether any of the configured page actions is enabled. The RSS feed is not part of them: it is
|
||||
* only offered on pages with an updates block.
|
||||
*/
|
||||
export function hasConfiguredPageActions(customization: GitBookSiteContext['customization']) {
|
||||
return CONFIGURABLE_PAGE_ACTIONS.some((type) => isPageActionEnabled(customization, type));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the Git metadata of a page for the Edit on Git action, or nothing when that action is not shown.
|
||||
*/
|
||||
export async function getPageGitMetadata(
|
||||
context: GitBookSiteContext,
|
||||
page: RevisionPageDocument
|
||||
): Promise<RevisionPageDocument['git']> {
|
||||
if (
|
||||
!context.space.gitSync?.url ||
|
||||
!isPageActionEnabled(context.customization, CustomizationPageActionType.Git)
|
||||
) {
|
||||
return undefined;
|
||||
}
|
||||
if (page.git) {
|
||||
return page.git;
|
||||
}
|
||||
|
||||
// Revision trees omit metadata for cache efficiency, so load it only when this action needs the Git path.
|
||||
const response = await context.dataFetcher.getRevisionPageByPath({
|
||||
spaceId: context.space.id,
|
||||
revisionId: context.revisionId,
|
||||
path: page.path,
|
||||
metadata: true,
|
||||
cachedMetadata: true,
|
||||
});
|
||||
const pageWithMetadata = response.data;
|
||||
return pageWithMetadata?.type === 'document' ? pageWithMetadata.git : undefined;
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
import urlJoin from 'url-join';
|
||||
|
||||
import { CustomizationPageActionType, type RevisionPageDocument } from '@gitbook/api';
|
||||
|
||||
import { getPDFURLSearchParams } from '../PDF';
|
||||
import { getPageGitMetadata, isPageActionEnabled } from './pageActionsData';
|
||||
import type { PageActionsDropdownURLs } from './PageActionsDropdown';
|
||||
import type { GitBookSiteContext } from '@/lib/context';
|
||||
import { getPageDocument } from '@/lib/data';
|
||||
import { hasTopLevelBlock } from '@/lib/document';
|
||||
import { hasAdaptiveMcpEndpoint } from '@/lib/mcp/endpoints';
|
||||
import { getPageRSSURL } from '@/routes/rss';
|
||||
|
||||
/**
|
||||
* Return the URLs for the page actions. The page's Git path and RSS feed are loaded here, so the
|
||||
* page actions depend on the context and the page alone.
|
||||
*/
|
||||
export async function getPageActionsURLs(
|
||||
context: GitBookSiteContext,
|
||||
page: RevisionPageDocument
|
||||
): Promise<PageActionsDropdownURLs> {
|
||||
const [document, git] = await Promise.all([
|
||||
getPageDocument(context, page),
|
||||
getPageGitMetadata(context, page),
|
||||
]);
|
||||
// Update blocks can only be at the top level of the document, so we optimize the check.
|
||||
const withRSSFeed = document
|
||||
? hasTopLevelBlock(document, (block) => block.type === 'updates')
|
||||
: false;
|
||||
const pagePath = context.linker.toPathForPage({ pages: context.revision.pages, page });
|
||||
const { gitSync } = context.space;
|
||||
|
||||
return {
|
||||
html: context.linker.toAbsoluteURL(pagePath),
|
||||
// For the markdown URL, we use the page.path to ensure it works for the default page.
|
||||
markdown: `${context.linker.toAbsoluteURL(context.linker.toPathInSpace(page.path))}.md`,
|
||||
rss: withRSSFeed ? getPageRSSURL(context, page) : undefined,
|
||||
editOnGit:
|
||||
gitSync?.url && git
|
||||
? {
|
||||
provider: gitSync.installationProvider,
|
||||
url: urlJoin(gitSync.url, git.path),
|
||||
}
|
||||
: undefined,
|
||||
pdf: isPageActionEnabled(context.customization, CustomizationPageActionType.Pdf)
|
||||
? context.linker.toPathInSpace(
|
||||
`~gitbook/pdf?${getPDFURLSearchParams({
|
||||
page: page.id,
|
||||
only: true,
|
||||
limit: 100,
|
||||
}).toString()}`
|
||||
)
|
||||
: undefined,
|
||||
mcp: getPageActionsMCPURL(context),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the MCP URL to be used in the page actions dropdown.
|
||||
*/
|
||||
function getPageActionsMCPURL(context: GitBookSiteContext) {
|
||||
const useAuthenticatedEndpoint = hasAdaptiveMcpEndpoint(context) && context.isLoggedInVisitor;
|
||||
const endpoint = useAuthenticatedEndpoint ? '~gitbook/mcp/auth' : '~gitbook/mcp';
|
||||
|
||||
return context.linker.toAbsoluteURL(context.linker.toPathInSite(endpoint));
|
||||
}
|
||||
@@ -15,7 +15,7 @@ import { PageFeedbackForm } from '../PageFeedback';
|
||||
import { SideSheet } from '../primitives/SideSheet';
|
||||
import { ThemeToggler } from '../ThemeToggler';
|
||||
import { PageAsideCloseButton } from './PageAsideButton';
|
||||
import { ScrollSectionsList } from './ScrollSectionsList';
|
||||
import { PaginatedScrollSectionsList, ScrollSectionsList } from './ScrollSectionsList';
|
||||
import { ScrollToTopButton } from './ScrollToTopButton';
|
||||
import { getSpaceLanguage, t, tString } from '@/intl/server';
|
||||
import type { GitBookSiteContext } from '@/lib/context';
|
||||
@@ -29,6 +29,7 @@ export async function PageAside(props: {
|
||||
page: RevisionPageDocument;
|
||||
document: JSONDocument | null;
|
||||
filterableTags: RevisionTag[];
|
||||
withUpdatesPagination: boolean;
|
||||
context: GitBookSiteContext;
|
||||
withHeaderOffset: { sectionsHeader: boolean; topHeader: boolean };
|
||||
withFullPageCover: boolean;
|
||||
@@ -142,7 +143,11 @@ export async function PageAside(props: {
|
||||
<div className="flex shrink flex-col overflow-hidden">
|
||||
{document ? (
|
||||
<React.Suspense fallback={null}>
|
||||
<PageAsideSections document={document} context={context} />
|
||||
<PageAsideSections
|
||||
document={document}
|
||||
context={context}
|
||||
withUpdatesPagination={props.withUpdatesPagination}
|
||||
/>
|
||||
</React.Suspense>
|
||||
) : null}
|
||||
<PageAsideActions page={page} withPageFeedback={withPageFeedback} />
|
||||
@@ -157,11 +162,19 @@ export async function PageAside(props: {
|
||||
);
|
||||
}
|
||||
|
||||
async function PageAsideSections(props: { document: JSONDocument; context: GitBookSiteContext }) {
|
||||
async function PageAsideSections(props: {
|
||||
document: JSONDocument;
|
||||
context: GitBookSiteContext;
|
||||
withUpdatesPagination: boolean;
|
||||
}) {
|
||||
const { document, context } = props;
|
||||
|
||||
const sections = await getDocumentSections(context, document);
|
||||
|
||||
if (props.withUpdatesPagination) {
|
||||
return <PaginatedScrollSectionsList sections={sections} />;
|
||||
}
|
||||
|
||||
return sections.length > 1 ? (
|
||||
<div data-gb-page-outline className="overflow-y-auto">
|
||||
<ScrollSectionsList sections={sections} />
|
||||
|
||||
@@ -4,6 +4,10 @@ import React from 'react';
|
||||
import { OpenAPIMethodBadge } from '@gitbook/react-openapi';
|
||||
|
||||
import { HEADER_HEIGHT_DESKTOP } from '../layout';
|
||||
import {
|
||||
HIDE_PENDING_UPDATES,
|
||||
usePaginatedUpdates,
|
||||
} from '@/components/DocumentView/PaginatedUpdates';
|
||||
import { useUpdatesFilter } from '@/components/DocumentView/UpdatesFilter';
|
||||
import { useScrollActiveId } from '@/components/hooks';
|
||||
import { useBodyLoaded } from '@/components/primitives';
|
||||
@@ -21,6 +25,34 @@ const SECTION_INTERSECTING_THRESHOLD = 0.9;
|
||||
*/
|
||||
const ACTIVE_ITEM_OFFSET = 100;
|
||||
|
||||
export function PaginatedScrollSectionsList(props: { sections: DocumentSection[] }) {
|
||||
const updates = usePaginatedUpdates();
|
||||
const view = updates?.view;
|
||||
if (view?.status === 'loading' || view?.status === 'error') {
|
||||
return null;
|
||||
}
|
||||
|
||||
let sections = props.sections;
|
||||
if (view?.status === 'filtered') {
|
||||
sections = view.sections;
|
||||
}
|
||||
if (sections.length <= 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
data-gb-page-outline
|
||||
className={tcls(
|
||||
'overflow-y-auto',
|
||||
view?.status === 'unfiltered' && HIDE_PENDING_UPDATES
|
||||
)}
|
||||
>
|
||||
<ScrollSectionsList sections={sections} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function ScrollSectionsList({ sections }: { sections: DocumentSection[] }) {
|
||||
const { selectedTagSet } = useUpdatesFilter();
|
||||
const ids = React.useMemo(
|
||||
|
||||
@@ -4,7 +4,9 @@ import {
|
||||
SiteInsightsDisplayContext,
|
||||
} from '@gitbook/api';
|
||||
|
||||
import { DocumentView, DocumentViewSkeleton } from '../DocumentView';
|
||||
import { DocumentViewSkeleton } from '../DocumentView';
|
||||
import { PaginatedUpdatesBody } from '../DocumentView/PaginatedUpdates';
|
||||
import { UpdatesPagination } from '../DocumentView/UpdatesPagination';
|
||||
import { CurrentPageProvider } from '../hooks/useCurrentPage';
|
||||
import { TrackPageViewEvent } from '../Insights';
|
||||
import { CONTENT_STYLE } from '../layout';
|
||||
@@ -12,6 +14,7 @@ import { PageFeedbackForm } from '../PageFeedback';
|
||||
import { DateRelative, SuspenseLoadedHint } from '../primitives';
|
||||
import OptionalSuspense from './OptionalSuspense';
|
||||
import { PageBodyBlankslate } from './PageBodyBlankslate';
|
||||
import { PageBodyDocument } from './PageBodyDocument';
|
||||
import { PageCover } from './PageCover';
|
||||
import { PageFooterNavigation } from './PageFooterNavigation';
|
||||
import { PageHeader } from './PageHeader';
|
||||
@@ -20,19 +23,11 @@ import { MAIN_CONTENT_ID } from '@/components/layout';
|
||||
import { getSpaceLanguage } from '@/intl/server';
|
||||
import { t } from '@/intl/translate';
|
||||
import type { GitBookSiteContext } from '@/lib/context';
|
||||
import {
|
||||
hasAPIBlock,
|
||||
hasFullWidthBlock,
|
||||
hasMoreThan,
|
||||
hasTopLevelBlock,
|
||||
isNodeEmpty,
|
||||
} from '@/lib/document';
|
||||
import { hasAPIBlock, hasFullWidthBlock, isNodeEmpty } from '@/lib/document';
|
||||
import type { AncestorRevisionPage } from '@/lib/pages';
|
||||
import { tcls } from '@/lib/tailwind';
|
||||
import { getPageRSSURL } from '@/routes/rss';
|
||||
|
||||
const LINK_PREVIEW_MAX_COUNT = 500;
|
||||
|
||||
export async function PageBody(props: {
|
||||
context: GitBookSiteContext;
|
||||
page: RevisionPageDocument;
|
||||
@@ -41,6 +36,8 @@ export async function PageBody(props: {
|
||||
withPageFeedback: boolean;
|
||||
insightsDisplayContext: SiteInsightsDisplayContext;
|
||||
staticRoute: boolean;
|
||||
contentHasUpdates: boolean;
|
||||
updatesBaseHref?: string | undefined;
|
||||
}) {
|
||||
const {
|
||||
page,
|
||||
@@ -50,26 +47,14 @@ export async function PageBody(props: {
|
||||
withPageFeedback,
|
||||
insightsDisplayContext,
|
||||
staticRoute,
|
||||
contentHasUpdates,
|
||||
updatesBaseHref,
|
||||
} = props;
|
||||
const { customization } = context;
|
||||
|
||||
// Update blocks can only be at the top level of the document, so we optimize the check.
|
||||
const contentHasUpdates = document
|
||||
? hasTopLevelBlock(document, (block) => block.type === 'updates')
|
||||
: false;
|
||||
|
||||
// Comments can only be made on change request previews, so public pages skip their markers.
|
||||
const withCommentAnchors = Boolean(context.changeRequest);
|
||||
|
||||
// Render link previews only if there are less than LINK_PREVIEW_MAX_COUNT links in the document.
|
||||
const withLinkPreviews = document
|
||||
? !hasMoreThan(
|
||||
document,
|
||||
(inline) => inline.object === 'inline' && inline.type === 'link',
|
||||
LINK_PREVIEW_MAX_COUNT
|
||||
)
|
||||
: false;
|
||||
|
||||
// Determine if content should use wide layout (2-column or 1-column instead of 3-column)
|
||||
// This happens when: (1) document has full-width blocks, OR (2) page layout is explicitly set to 'wide'
|
||||
const wideContent = document ? hasFullWidthBlock(document) : false;
|
||||
@@ -92,6 +77,29 @@ export async function PageBody(props: {
|
||||
|
||||
const pageHasToc = page.layout.tableOfContents && hasVisibleTOCItems;
|
||||
|
||||
let content = <PageBodyBlankslate page={page} context={context} />;
|
||||
if (document && !isNodeEmpty(document)) {
|
||||
content = (
|
||||
<OptionalSuspense
|
||||
staticRoute={staticRoute}
|
||||
fallback={<DocumentViewSkeleton document={document} blockStyle="" />}
|
||||
>
|
||||
<SuspenseLoadedHint />
|
||||
<div className="contents" data-content-ref-root="">
|
||||
<PageBodyDocument document={document} context={context} page={page} />
|
||||
</div>
|
||||
</OptionalSuspense>
|
||||
);
|
||||
}
|
||||
if (updatesBaseHref) {
|
||||
content = (
|
||||
<>
|
||||
<PaginatedUpdatesBody>{content}</PaginatedUpdatesBody>
|
||||
<UpdatesPagination language={language} baseHref={updatesBaseHref} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<CurrentPageProvider page={{ spaceId: context.space.id, pageId: page.id }}>
|
||||
{contentHasUpdates ? (
|
||||
@@ -104,10 +112,11 @@ export async function PageBody(props: {
|
||||
) : null}
|
||||
<main
|
||||
id={MAIN_CONTENT_ID}
|
||||
tabIndex={-1}
|
||||
// Comments on the whole page target anywhere in it that isn't a block.
|
||||
{...(withCommentAnchors ? { 'data-comment-page': '' } : {})}
|
||||
className={tcls(
|
||||
'relative min-w-0 flex-1',
|
||||
'relative min-w-0 flex-1 outline-none',
|
||||
'break-anywhere', // Allow words to break if they are too long.
|
||||
'py-8',
|
||||
'layout-wide:no-sidebar:lg:max-xl:pb-20', // Add padding to prevent overlap of minimised trademark
|
||||
@@ -138,32 +147,7 @@ export async function PageBody(props: {
|
||||
hasAPIBlocks={hasAPIBlocks}
|
||||
asEmbeddable={insightsDisplayContext === SiteInsightsDisplayContext.Embed}
|
||||
/>
|
||||
{document && !isNodeEmpty(document) ? (
|
||||
<OptionalSuspense
|
||||
staticRoute={staticRoute}
|
||||
fallback={<DocumentViewSkeleton document={document} blockStyle="" />}
|
||||
>
|
||||
<SuspenseLoadedHint />
|
||||
<div className="contents" data-content-ref-root="">
|
||||
<DocumentView
|
||||
document={document}
|
||||
style="flex flex-col [&>*+*]:mt-5"
|
||||
context={{
|
||||
mode: 'default',
|
||||
contentContext: {
|
||||
...context,
|
||||
page,
|
||||
},
|
||||
withLinkPreviews,
|
||||
withCommentAnchors,
|
||||
isPageBody: true,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</OptionalSuspense>
|
||||
) : (
|
||||
<PageBodyBlankslate page={page} context={context} />
|
||||
)}
|
||||
{content}
|
||||
</div>
|
||||
|
||||
{page.layout.pagination && customization.pagination.enabled ? (
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
import type { JSONDocument, RevisionPageDocument } from '@gitbook/api';
|
||||
|
||||
import { DocumentView } from '../DocumentView';
|
||||
import type { GitBookSiteContext } from '@/lib/context';
|
||||
import { hasMoreThan } from '@/lib/document';
|
||||
|
||||
const LINK_PREVIEW_MAX_COUNT = 500;
|
||||
|
||||
export function PageBodyDocument(props: {
|
||||
context: GitBookSiteContext;
|
||||
page: RevisionPageDocument;
|
||||
document: JSONDocument;
|
||||
}) {
|
||||
const { context, page, document } = props;
|
||||
const withLinkPreviews = !hasMoreThan(
|
||||
document,
|
||||
(inline) => inline.object === 'inline' && inline.type === 'link',
|
||||
LINK_PREVIEW_MAX_COUNT
|
||||
);
|
||||
|
||||
return (
|
||||
<DocumentView
|
||||
document={document}
|
||||
style="flex flex-col [&>*+*]:mt-5"
|
||||
context={{
|
||||
mode: 'default',
|
||||
contentContext: { ...context, page },
|
||||
withLinkPreviews,
|
||||
withCommentAnchors: Boolean(context.changeRequest),
|
||||
isPageBody: true,
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -1,24 +1,19 @@
|
||||
import assertNever from 'assert-never';
|
||||
import urlJoin from 'url-join';
|
||||
|
||||
import {
|
||||
CustomizationPageActionType,
|
||||
type RevisionPage,
|
||||
type RevisionPageDocument,
|
||||
type SiteSection,
|
||||
type SiteSectionGroup,
|
||||
import type {
|
||||
RevisionPage,
|
||||
RevisionPageDocument,
|
||||
SiteSection,
|
||||
SiteSectionGroup,
|
||||
} from '@gitbook/api';
|
||||
import { Icon } from '@gitbook/icons';
|
||||
|
||||
import { SpacesDropdownMenuItems, type VariantSpace } from '../Header/SpacesDropdownMenuItem';
|
||||
import { CONTENT_STYLE, CONTENT_STYLE_REDUCED } from '../layout';
|
||||
import {
|
||||
PageActionsDropdown,
|
||||
type PageActionsDropdownURLs,
|
||||
} from '../PageActions/PageActionsDropdown';
|
||||
import { hasConfiguredPageActions } from '../PageActions/pageActionsData';
|
||||
import { PageActionsMenu } from '../PageActions/PageActionsMenu';
|
||||
import { PageAsideToggleButton } from '../PageAside/PageAsideButton';
|
||||
import { PageIcon } from '../PageIcon';
|
||||
import { getPDFURLSearchParams } from '../PDF';
|
||||
import {
|
||||
findBestTargetURL,
|
||||
getTargetURLForSiteSpace,
|
||||
@@ -27,11 +22,9 @@ import { categorizeVariants } from '../SpaceLayout/categorizeVariants';
|
||||
import { BreadcrumbItemDropdown, type BreadcrumbSibling } from './BreadcrumbItemDropdown';
|
||||
import { PageTags } from './PageTags';
|
||||
import type { GitBookSiteContext, SiteStructureNode } from '@/lib/context';
|
||||
import { hasAdaptiveMcpEndpoint } from '@/lib/mcp/endpoints';
|
||||
import { type AncestorRevisionPage, resolveFirstDocument } from '@/lib/pages';
|
||||
import { getLocalizedTitle } from '@/lib/sites';
|
||||
import { tcls } from '@/lib/tailwind';
|
||||
import { getPageRSSURL } from '@/routes/rss';
|
||||
|
||||
export async function PageHeader(props: {
|
||||
context: GitBookSiteContext;
|
||||
@@ -146,15 +139,8 @@ export async function PageHeader(props: {
|
||||
// Show page actions if *any* of the configured actions are enabled, or if the RSS feed is
|
||||
// available. RSS is contextual (only on update/blog index pages) and is not part of the
|
||||
// configured `items` list, so it is checked separately.
|
||||
const hasConfiguredPageActions = [
|
||||
CustomizationPageActionType.Assistant,
|
||||
CustomizationPageActionType.ExternalAi,
|
||||
CustomizationPageActionType.Markdown,
|
||||
CustomizationPageActionType.Mcp,
|
||||
CustomizationPageActionType.Pdf,
|
||||
CustomizationPageActionType.Git,
|
||||
].some((type) => isPageActionEnabled(context.customization, type));
|
||||
const hasPageActions = pageActionsEnabled && (hasConfiguredPageActions || withRSSFeed);
|
||||
const hasPageActions =
|
||||
pageActionsEnabled && (hasConfiguredPageActions(context.customization) || withRSSFeed);
|
||||
|
||||
if (!page.layout.title && !page.layout.description && !hasPageActions) {
|
||||
return null;
|
||||
@@ -181,19 +167,7 @@ export async function PageHeader(props: {
|
||||
]
|
||||
)}
|
||||
>
|
||||
{hasPageActions ? (
|
||||
<PageActionsDropdown
|
||||
siteTitle={context.site.title}
|
||||
urls={getPageActionsURLs({ context, page, withRSSFeed })}
|
||||
actions={context.customization.pageActions}
|
||||
page={{
|
||||
id: page.id,
|
||||
title: page.title,
|
||||
path: page.path,
|
||||
href: linker.toPathForPage({ pages: revision.pages, page }),
|
||||
}}
|
||||
/>
|
||||
) : null}
|
||||
{hasPageActions ? <PageActionsMenu context={context} page={page} /> : null}
|
||||
<PageAsideToggleButton />
|
||||
</div>
|
||||
);
|
||||
@@ -520,67 +494,3 @@ function BreadcrumbSeparator() {
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the URLs for the page actions.
|
||||
*/
|
||||
function getPageActionsURLs({
|
||||
context,
|
||||
page,
|
||||
withRSSFeed,
|
||||
}: {
|
||||
context: GitBookSiteContext;
|
||||
page: RevisionPageDocument;
|
||||
withRSSFeed: boolean;
|
||||
}): PageActionsDropdownURLs {
|
||||
const pagePath = context.linker.toPathForPage({ pages: context.revision.pages, page });
|
||||
return {
|
||||
html: context.linker.toAbsoluteURL(pagePath),
|
||||
// For the markdown URL, we use the page.path to ensure it works for the default page.
|
||||
markdown: `${context.linker.toAbsoluteURL(context.linker.toPathInSpace(page.path))}.md`,
|
||||
rss: withRSSFeed ? getPageRSSURL(context, page) : undefined,
|
||||
editOnGit:
|
||||
isPageActionEnabled(context.customization, CustomizationPageActionType.Git) &&
|
||||
context.space.gitSync?.url &&
|
||||
page.git
|
||||
? {
|
||||
provider: context.space?.gitSync?.installationProvider,
|
||||
url: urlJoin(context.space.gitSync.url, page.git.path),
|
||||
}
|
||||
: undefined,
|
||||
pdf: isPageActionEnabled(context.customization, CustomizationPageActionType.Pdf)
|
||||
? context.linker.toPathInSpace(
|
||||
`~gitbook/pdf?${getPDFURLSearchParams({
|
||||
page: page.id,
|
||||
only: true,
|
||||
limit: 100,
|
||||
}).toString()}`
|
||||
)
|
||||
: undefined,
|
||||
mcp: getPageActionsMCPURL(context),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether a given built-in page action is enabled.
|
||||
*/
|
||||
function isPageActionEnabled(
|
||||
customization: GitBookSiteContext['customization'],
|
||||
type: CustomizationPageActionType
|
||||
): boolean {
|
||||
const { pageActions } = customization;
|
||||
if (pageActions.items) {
|
||||
return pageActions.items.includes(type);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the MCP URL to be used in the page actions dropdown.
|
||||
*/
|
||||
function getPageActionsMCPURL(context: GitBookSiteContext) {
|
||||
const useAuthenticatedEndpoint = hasAdaptiveMcpEndpoint(context) && context.isLoggedInVisitor;
|
||||
const endpoint = useAuthenticatedEndpoint ? '~gitbook/mcp/auth' : '~gitbook/mcp';
|
||||
|
||||
return context.linker.toAbsoluteURL(context.linker.toPathInSite(endpoint));
|
||||
}
|
||||
|
||||
@@ -63,6 +63,7 @@ export function SearchContainer({
|
||||
query,
|
||||
results,
|
||||
resultsId,
|
||||
resultsQuery,
|
||||
resultsRef,
|
||||
searchValue,
|
||||
setQuery,
|
||||
@@ -178,6 +179,7 @@ export function SearchContainer({
|
||||
query={query}
|
||||
results={results}
|
||||
resultsId={resultsId}
|
||||
resultsQuery={resultsQuery}
|
||||
resultsRef={resultsRef}
|
||||
onResultSelect={onResultSelect}
|
||||
onResultHover={onResultHover}
|
||||
|
||||
@@ -27,6 +27,7 @@ export function SearchFrame(props: {
|
||||
query: string;
|
||||
results: ResultType[];
|
||||
resultsId: string;
|
||||
resultsQuery: string;
|
||||
resultsRef: React.Ref<SearchResultsRef>;
|
||||
onResultSelect?: () => void;
|
||||
/** Select the result under the mouse, so hover and keyboard share one highlight. */
|
||||
@@ -50,6 +51,7 @@ export function SearchFrame(props: {
|
||||
query,
|
||||
results,
|
||||
resultsId,
|
||||
resultsQuery,
|
||||
resultsRef,
|
||||
onResultSelect,
|
||||
onResultHover,
|
||||
@@ -78,7 +80,7 @@ export function SearchFrame(props: {
|
||||
fetching ? 'block animate-fade-in' : 'hidden animate-fade-out-slow'
|
||||
)}
|
||||
style={{
|
||||
animationDelay: fetching ? '2s' : undefined,
|
||||
animationDelay: fetching && results.length === 0 ? '2s' : undefined,
|
||||
}}
|
||||
>
|
||||
<div
|
||||
@@ -118,7 +120,7 @@ export function SearchFrame(props: {
|
||||
) : (
|
||||
<SearchResults
|
||||
ref={resultsRef}
|
||||
query={query}
|
||||
query={resultsQuery}
|
||||
id={resultsId}
|
||||
fetching={fetching}
|
||||
results={results}
|
||||
|
||||
@@ -135,7 +135,7 @@ export const SearchInput = React.forwardRef<HTMLDivElement, SearchInputProps>(
|
||||
}
|
||||
}
|
||||
trailing={
|
||||
!showAsk && value && resultsCount > 0 ? (
|
||||
!showAsk && !fetching && value && resultsCount > 0 ? (
|
||||
<div className="animate-blur-in mr-2 text-sm text-tint-subtle">
|
||||
{t(language, 'search_results_count', resultsCount.toString())}
|
||||
</div>
|
||||
|
||||
@@ -6,7 +6,7 @@ import { useResizeObserver } from '../hooks';
|
||||
import { Tooltip } from '../primitives';
|
||||
import { getPageResultPresentation } from './getPageResultHref';
|
||||
import { HighlightQuery } from './HighlightQuery';
|
||||
import type { ComputedPageResult } from './search-types';
|
||||
import type { ComputedPageResult, SearchResultSource } from './search-types';
|
||||
import { SearchResultItem } from './SearchResultItem';
|
||||
import { tString, useLanguage } from '@/intl/client';
|
||||
import { tcls } from '@/lib/tailwind';
|
||||
@@ -14,13 +14,15 @@ import { tcls } from '@/lib/tailwind';
|
||||
export const SearchPageResultItem = React.forwardRef(function SearchPageResultItem(
|
||||
props: {
|
||||
query: string;
|
||||
item: ComputedPageResult;
|
||||
item: ComputedPageResult & SearchResultSource;
|
||||
position: number;
|
||||
resultsCount: number;
|
||||
active: boolean;
|
||||
style?: React.CSSProperties;
|
||||
},
|
||||
ref: React.Ref<HTMLAnchorElement>
|
||||
) {
|
||||
const { query, item, active, style, ...rest } = props;
|
||||
const { query, item, active, position, resultsCount, style, ...rest } = props;
|
||||
const language = useLanguage();
|
||||
|
||||
const { preview: bestSection, description, href } = getPageResultPresentation(item);
|
||||
@@ -30,7 +32,9 @@ export const SearchPageResultItem = React.forwardRef(function SearchPageResultIt
|
||||
|
||||
const insights = {
|
||||
type: 'search_open_result' as const,
|
||||
query,
|
||||
...item.search,
|
||||
position,
|
||||
resultsCount,
|
||||
result: {
|
||||
pageId: item.pageId,
|
||||
spaceId: item.spaceId,
|
||||
|
||||
@@ -4,24 +4,36 @@ import { Icon } from '@gitbook/icons';
|
||||
|
||||
import { Favicon } from '../utils';
|
||||
import { HighlightQuery } from './HighlightQuery';
|
||||
import type { ComputedRecordResult } from './search-types';
|
||||
import type { ComputedRecordResult, SearchResultSource } from './search-types';
|
||||
import { SearchResultItem } from './SearchResultItem';
|
||||
import { tString, useLanguage } from '@/intl/client';
|
||||
|
||||
export const SearchRecordResultItem = React.forwardRef(function SearchRecordResultItem(
|
||||
props: {
|
||||
query: string;
|
||||
item: ComputedRecordResult;
|
||||
item: ComputedRecordResult & SearchResultSource;
|
||||
position: number;
|
||||
resultsCount: number;
|
||||
active: boolean;
|
||||
style?: React.CSSProperties;
|
||||
},
|
||||
ref: React.Ref<HTMLAnchorElement>
|
||||
) {
|
||||
const { query, item, active, style, ...rest } = props;
|
||||
const { query, item, active, position, resultsCount, style, ...rest } = props;
|
||||
const language = useLanguage();
|
||||
|
||||
const domain = getDomain(item.href);
|
||||
|
||||
const insights = {
|
||||
type: 'search_open_result' as const,
|
||||
...item.search,
|
||||
position,
|
||||
resultsCount,
|
||||
result: {
|
||||
recordId: item.id,
|
||||
},
|
||||
};
|
||||
|
||||
return (
|
||||
<SearchResultItem
|
||||
ref={ref}
|
||||
@@ -36,13 +48,7 @@ export const SearchRecordResultItem = React.forwardRef(function SearchRecordResu
|
||||
fallback={<Icon icon="memo" className="size-4" />}
|
||||
/>
|
||||
}
|
||||
insights={{
|
||||
type: 'search_open_result',
|
||||
query,
|
||||
result: {
|
||||
recordId: item.id,
|
||||
},
|
||||
}}
|
||||
insights={insights}
|
||||
aria-label={tString(language, 'search_page_result_title', item.title)}
|
||||
style={{ ...style }}
|
||||
{...rest}
|
||||
|
||||
@@ -72,7 +72,7 @@ export const SearchResults = React.forwardRef(function SearchResults(
|
||||
|
||||
const language = useLanguage();
|
||||
const { siteSpaceId } = useCurrentContent();
|
||||
const shouldAnimateResults = !query || fetching;
|
||||
const shouldAnimateResults = !query;
|
||||
const previousCursor = React.useRef<number | null>(cursor);
|
||||
const seenResultKeys = React.useRef(new Set<string>());
|
||||
const lastQuery = React.useRef(query);
|
||||
@@ -228,9 +228,8 @@ export const SearchResults = React.forwardRef(function SearchResults(
|
||||
// users should keep their place in it.
|
||||
if (navigatesCurrentWindow(event)) {
|
||||
event.currentTarget.blur();
|
||||
onResultSelect?.();
|
||||
}
|
||||
|
||||
onResultSelect?.();
|
||||
};
|
||||
const resultItemProps = {
|
||||
'aria-posinset': index + 1,
|
||||
@@ -272,6 +271,8 @@ export const SearchResults = React.forwardRef(function SearchResults(
|
||||
}}
|
||||
query={query}
|
||||
item={item}
|
||||
position={index + 1}
|
||||
resultsCount={results.length}
|
||||
active={index === cursor}
|
||||
style={{
|
||||
animationDelay: `${index * 25}ms,${100 + index * 25}ms`,
|
||||
@@ -341,6 +342,8 @@ export const SearchResults = React.forwardRef(function SearchResults(
|
||||
key={itemKey}
|
||||
query={query}
|
||||
item={item}
|
||||
position={index + 1}
|
||||
resultsCount={results.length}
|
||||
active={index === cursor}
|
||||
style={{
|
||||
animationDelay: `${index * 25}ms,${100 + index * 25}ms`,
|
||||
@@ -359,15 +362,11 @@ export const SearchResults = React.forwardRef(function SearchResults(
|
||||
{!fetching && results.length === 0 ? noResults : null}
|
||||
</>
|
||||
)}
|
||||
{fetching ? (
|
||||
{fetching && results.length === 0 ? (
|
||||
<div
|
||||
role="status"
|
||||
aria-busy="true"
|
||||
className={tcls(
|
||||
results.length > 0 ? 'mt-1' : '',
|
||||
'flex flex-col gap-1',
|
||||
'animate-[fadeIn_150ms_ease-out_both,pulse_2.4s_ease-in-out_600ms_infinite] motion-reduce:animate-none'
|
||||
)}
|
||||
className="flex animate-[fadeIn_150ms_ease-out_both,pulse_2.4s_ease-in-out_600ms_infinite] flex-col gap-1 motion-reduce:animate-none"
|
||||
>
|
||||
<SearchResultsPlaceholder />
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, it } from 'bun:test';
|
||||
|
||||
import { computeFilterSiteSpaceIds, filterResultsBySiteSpaces } from './filter';
|
||||
import { computeFilterSiteSpaceIds, getDisplayedSearchResults } from './filter';
|
||||
import type { OrderedComputedResult } from './search-types';
|
||||
|
||||
describe('computeFilterSiteSpaceIds', () => {
|
||||
@@ -36,7 +36,7 @@ describe('computeFilterSiteSpaceIds', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('filterResultsBySiteSpaces', () => {
|
||||
describe('getDisplayedSearchResults', () => {
|
||||
const page = (id: string, siteSpaceId?: string): OrderedComputedResult => ({
|
||||
type: 'page',
|
||||
id,
|
||||
@@ -52,7 +52,7 @@ describe('filterResultsBySiteSpaces', () => {
|
||||
|
||||
it('keeps the server order and drops pages outside the scope', () => {
|
||||
const results = [page('a', 'current'), page('b', 'other'), page('c', 'current'), page('d')];
|
||||
expect(filterResultsBySiteSpaces(results, ['current']).map((result) => result.id)).toEqual([
|
||||
expect(getDisplayedSearchResults(results, ['current']).map((result) => result.id)).toEqual([
|
||||
'a',
|
||||
'c',
|
||||
]);
|
||||
@@ -60,6 +60,24 @@ describe('filterResultsBySiteSpaces', () => {
|
||||
|
||||
it('returns every result when the scope is unrestricted', () => {
|
||||
const results = [page('b', 'other'), page('a', 'current')];
|
||||
expect(filterResultsBySiteSpaces(results, undefined)).toBe(results);
|
||||
expect(getDisplayedSearchResults(results, undefined)).toBe(results);
|
||||
});
|
||||
|
||||
it('caps the displayed list after applying the site space filter', () => {
|
||||
const pages = Array.from({ length: 10 }, (_, index) => page(`page-${index}`, 'current'));
|
||||
const records = Array.from({ length: 11 }, (_, index): OrderedComputedResult => ({
|
||||
type: 'record',
|
||||
id: `record-${index}`,
|
||||
title: `Record ${index}`,
|
||||
description: undefined,
|
||||
href: `/record-${index}`,
|
||||
score: 1,
|
||||
}));
|
||||
const results = [page('hidden', 'other'), ...pages, ...records];
|
||||
|
||||
expect(getDisplayedSearchResults(results, ['current'])).toEqual([
|
||||
...pages,
|
||||
...records.slice(0, 10),
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import type { OrderedComputedResult } from './search-types';
|
||||
import type { SearchScope } from './useSearch';
|
||||
|
||||
// Keep aligned with SiteInsightsSearchResultNumber in the GitBook API schema.
|
||||
const MAX_DISPLAYED_SEARCH_RESULTS = 20;
|
||||
|
||||
/**
|
||||
* Site spaces whose pages may be shown for a UI search scope, or `undefined` for no restriction.
|
||||
*
|
||||
@@ -29,20 +32,20 @@ export function computeFilterSiteSpaceIds(
|
||||
}
|
||||
}
|
||||
|
||||
/** Keep the server's order, dropping pages owned by a site space outside the scope. */
|
||||
export function filterResultsBySiteSpaces(
|
||||
results: OrderedComputedResult[],
|
||||
/** Keep the first results in server order within the selected site spaces. */
|
||||
export function getDisplayedSearchResults<Result extends OrderedComputedResult>(
|
||||
results: Result[],
|
||||
allowedSiteSpaceIds: string[] | undefined
|
||||
): OrderedComputedResult[] {
|
||||
if (!allowedSiteSpaceIds) {
|
||||
return results;
|
||||
}
|
||||
|
||||
const allowed = new Set(allowedSiteSpaceIds);
|
||||
|
||||
return results.filter(
|
||||
(result) =>
|
||||
result.type === 'record' ||
|
||||
(result.siteSpaceId !== undefined && allowed.has(result.siteSpaceId))
|
||||
);
|
||||
): Result[] {
|
||||
const allowed = allowedSiteSpaceIds && new Set(allowedSiteSpaceIds);
|
||||
const matching = allowed
|
||||
? results.filter(
|
||||
(result) =>
|
||||
result.type === 'record' ||
|
||||
(result.siteSpaceId !== undefined && allowed.has(result.siteSpaceId))
|
||||
)
|
||||
: results;
|
||||
return matching.length > MAX_DISPLAYED_SEARCH_RESULTS
|
||||
? matching.slice(0, MAX_DISPLAYED_SEARCH_RESULTS)
|
||||
: matching;
|
||||
}
|
||||
|
||||
@@ -15,8 +15,6 @@ export function computeRemoteSearchScope(
|
||||
}
|
||||
|
||||
switch (scope) {
|
||||
case 'all':
|
||||
return { mode: 'all' };
|
||||
case 'default':
|
||||
return { mode: 'current', siteSpaceId };
|
||||
case 'extended':
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
import { afterEach, describe, expect, it, spyOn } from 'bun:test';
|
||||
|
||||
import { createSearchPassStore } from './search-pass-store';
|
||||
import { SEARCH_FALLBACK_HEADER, createSearchPassStore } from './search-pass-store';
|
||||
import type { DirectSearchProps } from '@/lib/search-results';
|
||||
|
||||
const endpoint = 'https://api.gitbook.com/v1/orgs/org_1/sites/site_1/search';
|
||||
const proxyURL = '/~gitbook/search-direct/orgs/org_1/sites/site_1';
|
||||
const directSearch: DirectSearchProps = {
|
||||
apiURL: 'https://api.gitbook.com',
|
||||
organizationId: 'org_1',
|
||||
siteId: 'site_1',
|
||||
proxyURL,
|
||||
linker: {
|
||||
urlMode: 'url-host',
|
||||
siteHost: 'docs.example.com',
|
||||
@@ -60,6 +62,150 @@ describe('createSearchPassStore', () => {
|
||||
let restore: (() => void) | undefined;
|
||||
afterEach(() => restore?.());
|
||||
|
||||
it('switches to the site proxy after an API network failure', async () => {
|
||||
const fetchSpy = spyOn(globalThis, 'fetch')
|
||||
.mockResolvedValueOnce(Response.json({ token: 'pass-1', expiresIn: 300_000 }))
|
||||
.mockRejectedValueOnce(new TypeError('Failed to fetch'))
|
||||
.mockImplementation(async () => Response.json({ items: [] }));
|
||||
restore = () => fetchSpy.mockRestore();
|
||||
const store = createSearchPassStore(directSearch);
|
||||
await store.requestPass();
|
||||
|
||||
expect(await search(store)).toEqual({ type: 'results', results: [] });
|
||||
expect(await search(store)).toEqual({ type: 'results', results: [] });
|
||||
expect(fetchSpy.mock.calls.map(([url]) => url)).toEqual([
|
||||
directSearch.passURL,
|
||||
endpoint,
|
||||
proxyURL,
|
||||
proxyURL,
|
||||
]);
|
||||
const init = fetchSpy.mock.calls[2]?.[1];
|
||||
expect(init).toMatchObject({ mode: 'same-origin', credentials: 'same-origin' });
|
||||
expect(init?.body).toBe(JSON.stringify({ query: 'tokens', mode: 'all' }));
|
||||
const headers = new Headers(init?.headers);
|
||||
expect(headers.get('x-gitbook-search-pass')).toBe('pass-1');
|
||||
expect(headers.get(SEARCH_FALLBACK_HEADER)).toBe('network');
|
||||
expect(headers.has('authorization')).toBe(false);
|
||||
expect(new Headers(fetchSpy.mock.calls[3]?.[1]?.headers).has(SEARCH_FALLBACK_HEADER)).toBe(
|
||||
false
|
||||
);
|
||||
});
|
||||
|
||||
it('switches to the site proxy after an API timeout', async () => {
|
||||
const originalSetTimeout = globalThis.setTimeout;
|
||||
const timeoutSpy = spyOn(globalThis, 'setTimeout').mockImplementation(((
|
||||
fn: (...args: unknown[]) => void,
|
||||
ms?: number,
|
||||
...args: unknown[]
|
||||
) => {
|
||||
let delay = ms;
|
||||
if (ms === 5_000) {
|
||||
delay = 0;
|
||||
}
|
||||
return originalSetTimeout(fn, delay, ...args);
|
||||
}) as typeof setTimeout);
|
||||
const fetchSpy = spyOn(globalThis, 'fetch')
|
||||
.mockResolvedValueOnce(Response.json({ token: 'pass-1', expiresIn: 300_000 }))
|
||||
.mockImplementationOnce(
|
||||
(_url, init) =>
|
||||
new Promise((_, reject) => {
|
||||
init?.signal?.addEventListener(
|
||||
'abort',
|
||||
() => reject(new DOMException('Aborted', 'AbortError')),
|
||||
{ once: true }
|
||||
);
|
||||
})
|
||||
)
|
||||
.mockResolvedValueOnce(Response.json({ items: [] }));
|
||||
restore = () => {
|
||||
timeoutSpy.mockRestore();
|
||||
fetchSpy.mockRestore();
|
||||
};
|
||||
const store = createSearchPassStore(directSearch);
|
||||
await store.requestPass();
|
||||
|
||||
expect(await search(store)).toEqual({ type: 'results', results: [] });
|
||||
expect(fetchSpy.mock.calls.map(([url]) => url)).toEqual([
|
||||
directSearch.passURL,
|
||||
endpoint,
|
||||
proxyURL,
|
||||
]);
|
||||
expect(new Headers(fetchSpy.mock.calls[2]?.[1]?.headers).get(SEARCH_FALLBACK_HEADER)).toBe(
|
||||
'timeout'
|
||||
);
|
||||
});
|
||||
|
||||
it('refreshes the pass on a 401 from the site proxy', async () => {
|
||||
const fetchSpy = spyOn(globalThis, 'fetch')
|
||||
.mockResolvedValueOnce(Response.json({ token: 'pass-1', expiresIn: 300_000 }))
|
||||
.mockRejectedValueOnce(new TypeError('Failed to fetch'))
|
||||
.mockResolvedValueOnce(new Response(null, { status: 401 }))
|
||||
.mockResolvedValueOnce(Response.json({ token: 'pass-2', expiresIn: 300_000 }))
|
||||
.mockResolvedValueOnce(Response.json({ items: [] }));
|
||||
restore = () => fetchSpy.mockRestore();
|
||||
const store = createSearchPassStore(directSearch);
|
||||
await store.requestPass();
|
||||
|
||||
expect(await search(store)).toEqual({ type: 'route', reason: '401' });
|
||||
await new Promise((resolve) => setTimeout(resolve, 0));
|
||||
expect(await search(store)).toEqual({ type: 'results', results: [] });
|
||||
expect(fetchSpy.mock.calls.map(([url]) => url)).toEqual([
|
||||
directSearch.passURL,
|
||||
endpoint,
|
||||
proxyURL,
|
||||
directSearch.passURL,
|
||||
proxyURL,
|
||||
]);
|
||||
expect(new Headers(fetchSpy.mock.calls[4]?.[1]?.headers).get('x-gitbook-search-pass')).toBe(
|
||||
'pass-2'
|
||||
);
|
||||
});
|
||||
|
||||
it('honors rate-limit headers on a 429 from the site proxy', async () => {
|
||||
const resetAtSeconds = Math.ceil((Date.now() + 30_000) / 1000);
|
||||
const fetchSpy = spyOn(globalThis, 'fetch')
|
||||
.mockResolvedValueOnce(Response.json({ token: 'pass-1', expiresIn: 300_000 }))
|
||||
.mockRejectedValueOnce(new TypeError('Failed to fetch'))
|
||||
.mockResolvedValueOnce(
|
||||
new Response(null, {
|
||||
status: 429,
|
||||
headers: {
|
||||
'x-ratelimit-scope': 'site',
|
||||
'x-ratelimit-reset': String(resetAtSeconds),
|
||||
},
|
||||
})
|
||||
);
|
||||
restore = () => fetchSpy.mockRestore();
|
||||
const store = createSearchPassStore(directSearch);
|
||||
await store.requestPass();
|
||||
|
||||
await expect(search(store)).rejects.toThrow('Search is rate limited');
|
||||
await expect(search(store)).rejects.toThrow('Search is rate limited');
|
||||
expect(fetchSpy.mock.calls.map(([url]) => url)).toEqual([
|
||||
directSearch.passURL,
|
||||
endpoint,
|
||||
proxyURL,
|
||||
]);
|
||||
});
|
||||
|
||||
it('uses the server route after the site proxy also fails', async () => {
|
||||
const fetchSpy = spyOn(globalThis, 'fetch')
|
||||
.mockResolvedValueOnce(Response.json({ token: 'pass-1', expiresIn: 300_000 }))
|
||||
.mockRejectedValueOnce(new TypeError('Failed to fetch'))
|
||||
.mockResolvedValueOnce(new Response(null, { status: 502 }));
|
||||
restore = () => fetchSpy.mockRestore();
|
||||
const store = createSearchPassStore(directSearch);
|
||||
await store.requestPass();
|
||||
|
||||
expect(await search(store)).toEqual({ type: 'route', reason: '502' });
|
||||
expect(await search(store)).toEqual({ type: 'route', reason: '502' });
|
||||
expect(fetchSpy.mock.calls.map(([url]) => url)).toEqual([
|
||||
directSearch.passURL,
|
||||
endpoint,
|
||||
proxyURL,
|
||||
]);
|
||||
});
|
||||
|
||||
it('stays on the route for the rest of the page after a 403', async () => {
|
||||
const { authorizations, fetchSpy } = mockFetch([403]);
|
||||
restore = () => fetchSpy.mockRestore();
|
||||
@@ -87,6 +233,11 @@ describe('createSearchPassStore', () => {
|
||||
await new Promise((resolve) => setTimeout(resolve, 0));
|
||||
expect(await search(store)).toEqual({ type: 'results', results: [] });
|
||||
expect(authorizations).toEqual(sent);
|
||||
|
||||
const refresh = store.requestPass();
|
||||
expect(await search(store)).toEqual({ type: 'route', reason: undefined });
|
||||
await refresh;
|
||||
expect(authorizations).toEqual(sent);
|
||||
}
|
||||
);
|
||||
|
||||
@@ -136,4 +287,47 @@ describe('createSearchPassStore', () => {
|
||||
expect(await search(store)).toEqual({ type: 'results', results: [] });
|
||||
expect(authorizations).toHaveLength(1);
|
||||
});
|
||||
|
||||
it('falls back for an unknown space without latching later searches to the route', async () => {
|
||||
let searchCalls = 0;
|
||||
const fetchSpy = spyOn(globalThis, 'fetch').mockImplementation((async (
|
||||
input: RequestInfo | URL
|
||||
) => {
|
||||
if (String(input) === '/~gitbook/search-pass') {
|
||||
return Response.json({ token: 'pass-1', expiresIn: 300_000 });
|
||||
}
|
||||
searchCalls += 1;
|
||||
if (searchCalls === 1) {
|
||||
return Response.json({
|
||||
items: [
|
||||
{
|
||||
type: 'space',
|
||||
id: 'space_unknown',
|
||||
title: 'Unknown',
|
||||
score: 1,
|
||||
pages: [
|
||||
{
|
||||
id: 'page_1',
|
||||
title: 'Page 1',
|
||||
path: 'page-1',
|
||||
score: 1,
|
||||
rank: 1,
|
||||
ancestors: [],
|
||||
urls: { app: 'https://app.gitbook.com/o/org/s/space' },
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
return Response.json({ items: [] });
|
||||
}) as typeof fetch);
|
||||
restore = () => fetchSpy.mockRestore();
|
||||
const store = createSearchPassStore(directSearch);
|
||||
await store.requestPass();
|
||||
|
||||
expect(await search(store)).toEqual({ type: 'route', reason: 'unknown_space' });
|
||||
expect(await search(store)).toEqual({ type: 'results', results: [] });
|
||||
expect(searchCalls).toBe(2);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -32,6 +32,11 @@ type DirectSearchOutcome =
|
||||
| { type: 'results'; results: OrderedComputedResult[] }
|
||||
| { type: 'route'; reason?: string };
|
||||
|
||||
type SearchAttempt =
|
||||
| { type: 'success'; body: string }
|
||||
| { type: 'http'; response: Response }
|
||||
| { type: 'failure'; reason: 'network' | 'timeout' };
|
||||
|
||||
export type SearchPassStore = ReturnType<typeof createSearchPassStore>;
|
||||
|
||||
/**
|
||||
@@ -39,6 +44,7 @@ export type SearchPassStore = ReturnType<typeof createSearchPassStore>;
|
||||
*/
|
||||
export function createSearchPassStore(directSearch: DirectSearchProps | undefined) {
|
||||
let state: SearchPassState = { status: 'none' };
|
||||
let useProxy = false;
|
||||
let pendingRequest: Promise<void> | null = null;
|
||||
|
||||
const sendPassRequest = async () => {
|
||||
@@ -77,7 +83,9 @@ export function createSearchPassStore(directSearch: DirectSearchProps | undefine
|
||||
(current.status === 'none' && current.reason === '401') ||
|
||||
(current.status === 'ready' && current.replacesRejectedPass),
|
||||
};
|
||||
ReactDOM.preconnect(directSearch.apiURL, { crossOrigin: 'anonymous' });
|
||||
if (!useProxy) {
|
||||
ReactDOM.preconnect(directSearch.apiURL, { crossOrigin: 'anonymous' });
|
||||
}
|
||||
} else if (current.status === 'ready') {
|
||||
state = { status: 'none' };
|
||||
}
|
||||
@@ -124,11 +132,12 @@ export function createSearchPassStore(directSearch: DirectSearchProps | undefine
|
||||
|
||||
const search = async (input: {
|
||||
query: string;
|
||||
searchId?: string;
|
||||
scope: SearchSiteContentScope;
|
||||
signal: AbortSignal;
|
||||
asEmbeddable: boolean;
|
||||
}): Promise<DirectSearchOutcome> => {
|
||||
const { query, scope, signal, asEmbeddable } = input;
|
||||
const { query, searchId, scope, signal, asEmbeddable } = input;
|
||||
if (!directSearch) {
|
||||
return { type: 'route' };
|
||||
}
|
||||
@@ -139,83 +148,150 @@ export function createSearchPassStore(directSearch: DirectSearchProps | undefine
|
||||
return waitForCooldown(state, signal);
|
||||
}
|
||||
if (state.status !== 'ready') {
|
||||
return { type: 'route', reason: state.reason };
|
||||
return { type: 'route', reason: state.reason === '401' ? undefined : state.reason };
|
||||
}
|
||||
if (query.length <= 1) {
|
||||
return { type: 'results', results: [] };
|
||||
}
|
||||
|
||||
const { token, replacesRejectedPass } = state;
|
||||
const { apiURL, organizationId, siteId } = directSearch;
|
||||
// A request dropped on the way to the API never settles, so it gets its own time limit.
|
||||
// The browser targets predate `AbortSignal.any`.
|
||||
const request = new AbortController();
|
||||
if (signal.aborted) {
|
||||
request.abort();
|
||||
let pass = state;
|
||||
const { apiURL, organizationId, siteId, proxyURL } = directSearch;
|
||||
const usingProxy = useProxy;
|
||||
let url = `${apiURL}/v1/orgs/${organizationId}/sites/${siteId}/search`;
|
||||
if (usingProxy) {
|
||||
url = proxyURL;
|
||||
}
|
||||
signal.addEventListener('abort', () => request.abort(), { once: true });
|
||||
const timeout = setTimeout(() => request.abort(), DIRECT_SEARCH_TIMEOUT_MS);
|
||||
let response: Response;
|
||||
try {
|
||||
response = await fetch(`${apiURL}/v1/orgs/${organizationId}/sites/${siteId}/search`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
Authorization: `Bearer ${token}`,
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify(toSearchSiteContentBody(query, scope)),
|
||||
credentials: 'omit',
|
||||
signal: request.signal,
|
||||
});
|
||||
} catch (error) {
|
||||
if (signal.aborted) {
|
||||
throw error;
|
||||
const body = JSON.stringify(toSearchSiteContentBody(query, scope, searchId));
|
||||
let attempt = await sendSearch(url, usingProxy, pass.token, body, signal);
|
||||
|
||||
if (attempt.type === 'failure' && !usingProxy) {
|
||||
const current = state as SearchPassState;
|
||||
// TODO: timeout can mean a slow API rather than a blocked host, so consider not sticking to the proxy for the session.
|
||||
if (current.status === 'ready') {
|
||||
useProxy = true;
|
||||
pass = current;
|
||||
attempt = await sendSearch(
|
||||
proxyURL,
|
||||
true,
|
||||
pass.token,
|
||||
body,
|
||||
signal,
|
||||
attempt.reason
|
||||
);
|
||||
} else if (current.status === 'none') {
|
||||
useProxy = true;
|
||||
return { type: 'route', reason: attempt.reason };
|
||||
}
|
||||
return fallBack(request.signal.aborted ? 'timeout' : 'network');
|
||||
}
|
||||
|
||||
if (response.status === 401) {
|
||||
return replacesRejectedPass ? fallBack('401') : dropPass(token, '401');
|
||||
if (attempt.type === 'failure') {
|
||||
const current = state as SearchPassState;
|
||||
if (current.status === 'route') {
|
||||
return waitForCooldown(current, signal);
|
||||
}
|
||||
return fallBack(attempt.reason);
|
||||
}
|
||||
if (response.status === 429) {
|
||||
state = {
|
||||
status: 'route',
|
||||
reason: '429',
|
||||
cooldownUntil: Date.now() + getRateLimitWaitMs(response),
|
||||
};
|
||||
return waitForCooldown(state, signal);
|
||||
}
|
||||
if (!response.ok) {
|
||||
if (attempt.type === 'http') {
|
||||
const { response } = attempt;
|
||||
if (response.status === 401) {
|
||||
if (pass.replacesRejectedPass) {
|
||||
return fallBack('401');
|
||||
}
|
||||
return dropPass(pass.token, '401');
|
||||
}
|
||||
if (response.status === 429) {
|
||||
state = {
|
||||
status: 'route',
|
||||
reason: '429',
|
||||
cooldownUntil: Date.now() + getRateLimitWaitMs(response),
|
||||
};
|
||||
return waitForCooldown(state, signal);
|
||||
}
|
||||
return fallBack(String(response.status));
|
||||
}
|
||||
|
||||
let results: OrderedComputedResult[] | null;
|
||||
try {
|
||||
const { items } = (await response.json()) as {
|
||||
const { items } = JSON.parse(attempt.body) as {
|
||||
items: (SearchSpaceResult | SearchRecordResult)[];
|
||||
};
|
||||
const linker = createSiteLinker(directSearch.linker);
|
||||
results = computePublishedSearchResults({
|
||||
let linker = createSiteLinker(directSearch.linker);
|
||||
if (asEmbeddable) {
|
||||
linker = getEmbeddableLinker(linker);
|
||||
}
|
||||
const results = computePublishedSearchResults({
|
||||
asEmbeddable,
|
||||
linker: asEmbeddable ? getEmbeddableLinker(linker) : linker,
|
||||
linker,
|
||||
searchResults: items,
|
||||
spaces: directSearch.spaces,
|
||||
});
|
||||
} catch (error) {
|
||||
if (signal.aborted) {
|
||||
throw error;
|
||||
if (!results) {
|
||||
return { type: 'route', reason: 'unknown_space' };
|
||||
}
|
||||
return fallBack(request.signal.aborted ? 'timeout' : 'invalid');
|
||||
} finally {
|
||||
clearTimeout(timeout);
|
||||
return { type: 'results', results };
|
||||
} catch {
|
||||
return fallBack('invalid');
|
||||
}
|
||||
|
||||
return results ? { type: 'results', results } : fallBack('unknown_space');
|
||||
};
|
||||
|
||||
return { requestPass, search };
|
||||
}
|
||||
|
||||
async function sendSearch(
|
||||
url: string,
|
||||
useProxy: boolean,
|
||||
token: string,
|
||||
body: string,
|
||||
signal: AbortSignal,
|
||||
fallbackReason?: 'network' | 'timeout'
|
||||
): Promise<SearchAttempt> {
|
||||
const headers: Record<string, string> = { 'Content-Type': 'application/json' };
|
||||
let mode: RequestMode | undefined;
|
||||
let credentials: RequestCredentials = 'omit';
|
||||
if (useProxy) {
|
||||
mode = 'same-origin';
|
||||
credentials = 'same-origin';
|
||||
headers['x-gitbook-search-pass'] = token;
|
||||
if (fallbackReason) {
|
||||
headers[SEARCH_FALLBACK_HEADER] = fallbackReason;
|
||||
}
|
||||
} else {
|
||||
headers.Authorization = `Bearer ${token}`;
|
||||
}
|
||||
|
||||
const request = new AbortController();
|
||||
const abort = () => request.abort();
|
||||
if (signal.aborted) {
|
||||
abort();
|
||||
}
|
||||
signal.addEventListener('abort', abort, { once: true });
|
||||
const timeout = setTimeout(abort, DIRECT_SEARCH_TIMEOUT_MS);
|
||||
try {
|
||||
const response = await fetch(url, {
|
||||
method: 'POST',
|
||||
headers,
|
||||
body,
|
||||
credentials,
|
||||
mode,
|
||||
signal: request.signal,
|
||||
});
|
||||
if (!response.ok) {
|
||||
return { type: 'http', response };
|
||||
}
|
||||
return { type: 'success', body: await response.text() };
|
||||
} catch (error) {
|
||||
if (signal.aborted) {
|
||||
throw error;
|
||||
}
|
||||
if (request.signal.aborted) {
|
||||
return { type: 'failure', reason: 'timeout' };
|
||||
}
|
||||
return { type: 'failure', reason: 'network' };
|
||||
} finally {
|
||||
clearTimeout(timeout);
|
||||
signal.removeEventListener('abort', abort);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Hold a search until a short rate limit cooldown ends, then send it to the route.
|
||||
* During a longer cooldown the search fails at once, as the route would.
|
||||
|
||||
@@ -132,9 +132,13 @@ export function getDirectSearchProps(context: GitBookSiteContext): DirectSearchP
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const { organizationId, siteId } = context.directSearch;
|
||||
return {
|
||||
...context.directSearch,
|
||||
spaces: getSearchSpaceLookup(context.structure),
|
||||
passURL: context.linker.toPathInSite('~gitbook/search-pass'),
|
||||
proxyURL: context.linker.toPathInSite(
|
||||
`~gitbook/search-direct/orgs/${organizationId}/sites/${siteId}`
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2,6 +2,10 @@ import type { IconName } from '@gitbook/icons';
|
||||
|
||||
export type OrderedComputedResult = ComputedPageResult | ComputedRecordResult;
|
||||
|
||||
export type SearchResultSource = {
|
||||
search: { query: string; searchId: string | undefined };
|
||||
};
|
||||
|
||||
export type BaseComputedResult = {
|
||||
id: string;
|
||||
title: string;
|
||||
@@ -55,6 +59,7 @@ export type SearchSiteContentScope =
|
||||
|
||||
export interface SearchSiteContentRequest {
|
||||
asEmbeddable?: boolean;
|
||||
searchId?: string;
|
||||
query: string;
|
||||
scope: SearchSiteContentScope;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
import { describe, expect, it } from 'bun:test';
|
||||
import { NuqsTestingAdapter } from 'nuqs/adapters/testing';
|
||||
import { createElement } from 'react';
|
||||
import { renderToString } from 'react-dom/server';
|
||||
|
||||
import { shouldKeepSearchState } from './useSearch';
|
||||
import { SearchContextProvider, shouldKeepSearchState, useSearchState } from './useSearch';
|
||||
|
||||
function SearchScopeValue() {
|
||||
return useSearchState()?.scope ?? null;
|
||||
}
|
||||
|
||||
describe('shouldKeepSearchState', () => {
|
||||
it('discards an empty default search state', () => {
|
||||
@@ -23,3 +30,25 @@ describe('shouldKeepSearchState', () => {
|
||||
).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
it.each([
|
||||
['scope=all', 'default'],
|
||||
['global=true', 'default'],
|
||||
['scope=current&global=true', 'current'],
|
||||
['scope=extended&global=true', 'extended'],
|
||||
])('resolves %s to %s for a linked search', (params, scope) => {
|
||||
const search = createElement(
|
||||
SearchContextProvider,
|
||||
{ prewarmURL: '/~gitbook/search' },
|
||||
createElement(SearchScopeValue)
|
||||
);
|
||||
|
||||
expect(
|
||||
renderToString(
|
||||
createElement(NuqsTestingAdapter, {
|
||||
searchParams: `q=setup&${params}`,
|
||||
children: search,
|
||||
})
|
||||
)
|
||||
).toBe(scope);
|
||||
});
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import {
|
||||
type Values,
|
||||
parseAsBoolean,
|
||||
parseAsString,
|
||||
parseAsStringLiteral,
|
||||
useQueryStates,
|
||||
} from 'nuqs';
|
||||
import { type Values, parseAsString, parseAsStringLiteral, useQueryStates } from 'nuqs';
|
||||
import React from 'react';
|
||||
|
||||
import type { LinkProps } from '../primitives';
|
||||
@@ -16,8 +10,6 @@ import { useSearchPrewarm } from './useSearchPrewarm';
|
||||
import type { DirectSearchProps } from '@/lib/search-results';
|
||||
|
||||
export type SearchScope =
|
||||
/** Search all content on the site */
|
||||
| 'all'
|
||||
/** Search the current section's variant + matched/default variant for other sections */
|
||||
| 'default'
|
||||
/** Search all variants of the current section */
|
||||
@@ -41,9 +33,8 @@ export interface SearchState {
|
||||
const keyMap = {
|
||||
q: parseAsString,
|
||||
ask: parseAsString,
|
||||
scope: parseAsStringLiteral(['all', 'default', 'extended', 'current']).withDefault('default'),
|
||||
scope: parseAsStringLiteral(['default', 'extended', 'current']).withDefault('default'),
|
||||
section: parseAsString,
|
||||
global: parseAsBoolean, // Legacy support for global=true
|
||||
};
|
||||
|
||||
export type UpdateSearchState = (
|
||||
@@ -62,11 +53,6 @@ function normalizeRawState(values: Values<typeof keyMap>) {
|
||||
if (values.ask === 'true' && values.q) {
|
||||
return { ...values, q: null, ask: values.q };
|
||||
}
|
||||
// Handle legacy global=true
|
||||
if (values.global === true) {
|
||||
return { ...values, scope: 'all' as const, global: null };
|
||||
}
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
|
||||
@@ -141,7 +141,6 @@ function useSearchKeyboardNavigation(props: {
|
||||
requestKey: string;
|
||||
flush: () => void;
|
||||
resultsRef: React.RefObject<SearchResultsRef | null>;
|
||||
abort: () => void;
|
||||
askCount: number;
|
||||
onAskSelect: (index: number) => void;
|
||||
}) {
|
||||
@@ -154,7 +153,6 @@ function useSearchKeyboardNavigation(props: {
|
||||
requestKey,
|
||||
flush,
|
||||
resultsRef,
|
||||
abort,
|
||||
askCount,
|
||||
onAskSelect,
|
||||
} = props;
|
||||
@@ -190,8 +188,6 @@ function useSearchKeyboardNavigation(props: {
|
||||
}
|
||||
|
||||
if (resultsRef.current?.select()) {
|
||||
// Stop any in-flight search request only when activating a result.
|
||||
abort();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -207,7 +203,6 @@ function useSearchKeyboardNavigation(props: {
|
||||
results.length,
|
||||
onAskSelect,
|
||||
resultsRef,
|
||||
abort,
|
||||
query,
|
||||
fetching,
|
||||
requestKey,
|
||||
@@ -229,13 +224,11 @@ function useSearchKeyboardNavigation(props: {
|
||||
}
|
||||
pendingOpenRef.current = null;
|
||||
if (results.length > 0) {
|
||||
if (resultsRef.current?.selectFirst()) {
|
||||
abort();
|
||||
}
|
||||
resultsRef.current?.selectFirst();
|
||||
} else if (!error && askCount > 0) {
|
||||
onAskSelect(0);
|
||||
}
|
||||
}, [isOpen, requestKey, fetching, error, results, resultsRef, abort, askCount, onAskSelect]);
|
||||
}, [isOpen, requestKey, fetching, error, results, resultsRef, askCount, onAskSelect]);
|
||||
|
||||
return {
|
||||
cursor,
|
||||
@@ -379,9 +372,10 @@ export function useSearchController(
|
||||
const selectedSection = state?.section ? findSearchSection(sections, state.section) : undefined;
|
||||
|
||||
const { consumeImmediate, flushRef, inputHandlers } = useSearchInputIntent();
|
||||
const { results, fetching, error, requestKey, flush, abort } = useSearchResults({
|
||||
const { results, resultsQuery, fetching, error, requestKey, flush, abort } = useSearchResults({
|
||||
asEmbeddable,
|
||||
disabled: options.requestsEnabled === false || !(normalizedQuery || withAI),
|
||||
disabled: options.requestsEnabled === false || showAsk || !(normalizedQuery || withAI),
|
||||
retainPreviousResults: Boolean(state?.open),
|
||||
query: normalizedQuery,
|
||||
siteSpaceId: siteSpace.id,
|
||||
siteSpaceIds,
|
||||
@@ -442,7 +436,6 @@ export function useSearchController(
|
||||
requestKey,
|
||||
flush,
|
||||
resultsRef,
|
||||
abort,
|
||||
askCount,
|
||||
onAskSelect: askInAssistant,
|
||||
});
|
||||
@@ -463,6 +456,7 @@ export function useSearchController(
|
||||
query: normalizedQuery,
|
||||
results,
|
||||
resultsId: searchResultsId,
|
||||
resultsQuery,
|
||||
resultsRef,
|
||||
searchValue,
|
||||
setQuery,
|
||||
|
||||
@@ -8,22 +8,36 @@ import {
|
||||
createRecommendedQuestionResult,
|
||||
getEmptySearchResults,
|
||||
} from './empty-search-results';
|
||||
import { computeFilterSiteSpaceIds, filterResultsBySiteSpaces } from './filter';
|
||||
import { computeFilterSiteSpaceIds, getDisplayedSearchResults } from './filter';
|
||||
import { useRecentSearchQueries } from './recent-queries';
|
||||
import { computeRemoteSearchScope } from './remote-scope';
|
||||
import { SEARCH_FALLBACK_HEADER, type SearchPassStore } from './search-pass-store';
|
||||
import type { OrderedComputedResult, SearchSiteContentScope } from './search-types';
|
||||
import type {
|
||||
OrderedComputedResult,
|
||||
SearchResultSource,
|
||||
SearchSiteContentScope,
|
||||
} from './search-types';
|
||||
import { streamRecommendedQuestions } from './server-actions';
|
||||
import { type SearchScope, useSearchPass } from './useSearch';
|
||||
import { useAI } from '@/components/AI';
|
||||
|
||||
export type ResultType = OrderedComputedResult | RecommendedQuestionResult;
|
||||
export type ResultType = RemoteSearchResult | RecommendedQuestionResult;
|
||||
|
||||
const SEARCH_ID_BYTES = 16;
|
||||
|
||||
type RemoteSearchResult = OrderedComputedResult & SearchResultSource;
|
||||
|
||||
type SearchAnswer = {
|
||||
scopeKey: string;
|
||||
query: string;
|
||||
results: RemoteSearchResult[];
|
||||
};
|
||||
|
||||
type RemoteSearchState =
|
||||
| { status: 'idle' }
|
||||
| { status: 'loading' }
|
||||
| { status: 'ready'; requestKey: string; results: OrderedComputedResult[] }
|
||||
| { status: 'error' };
|
||||
| { status: 'loading'; requestKey: string; answer?: SearchAnswer }
|
||||
| { status: 'ready'; requestKey: string; answer: SearchAnswer }
|
||||
| { status: 'error'; requestKey: string };
|
||||
|
||||
/**
|
||||
* We cache the recommended questions globally to avoid calling the API multiple times
|
||||
@@ -37,6 +51,7 @@ export function useSearchResults(props: {
|
||||
asEmbeddable?: boolean;
|
||||
disabled: boolean;
|
||||
query: string;
|
||||
retainPreviousResults: boolean;
|
||||
siteSpaceId: string;
|
||||
siteSpaceIds: string[];
|
||||
selectedSectionSiteSpaceIds?: string[];
|
||||
@@ -53,6 +68,7 @@ export function useSearchResults(props: {
|
||||
asEmbeddable,
|
||||
disabled,
|
||||
query,
|
||||
retainPreviousResults,
|
||||
siteSpaceId,
|
||||
siteSpaceIds,
|
||||
selectedSectionSiteSpaceIds,
|
||||
@@ -83,8 +99,15 @@ export function useSearchResults(props: {
|
||||
computeRemoteSearchScope(scope, siteSpaceId, siteSpaceIds, selectedSectionSiteSpaceIds),
|
||||
[scope, siteSpaceId, siteSpaceIds, selectedSectionSiteSpaceIds]
|
||||
);
|
||||
// Identifies the answer the UI needs now; an answer for any other key is never shown as current.
|
||||
const requestKey = JSON.stringify([query, remoteScope]);
|
||||
const scopeKey = JSON.stringify([
|
||||
searchURL,
|
||||
asEmbeddable,
|
||||
siteSpaceId,
|
||||
scope,
|
||||
remoteScope,
|
||||
filterSiteSpaceIds,
|
||||
]);
|
||||
const requestKey = JSON.stringify([scopeKey, query]);
|
||||
|
||||
const [remoteState, setRemoteState] = React.useState<RemoteSearchState>({ status: 'idle' });
|
||||
|
||||
@@ -100,6 +123,7 @@ export function useSearchResults(props: {
|
||||
|
||||
React.useEffect(() => {
|
||||
if (disabled) {
|
||||
setRemoteState({ status: 'idle' });
|
||||
return;
|
||||
}
|
||||
if (!query) {
|
||||
@@ -126,7 +150,7 @@ export function useSearchResults(props: {
|
||||
// We currently have a bug where the same question can be returned multiple times.
|
||||
// This is a workaround to avoid that.
|
||||
const questions = new Set<string>();
|
||||
const recommendedQuestions: RecommendedQuestionResult[] = [];
|
||||
let recommendedQuestions: RecommendedQuestionResult[] = [];
|
||||
|
||||
if (suggestions && suggestions.length > 0) {
|
||||
suggestions.forEach((question) => {
|
||||
@@ -153,7 +177,10 @@ export function useSearchResults(props: {
|
||||
}
|
||||
|
||||
questions.add(question);
|
||||
recommendedQuestions.push(createRecommendedQuestionResult(question, question));
|
||||
recommendedQuestions = [
|
||||
...recommendedQuestions,
|
||||
createRecommendedQuestionResult(question, question),
|
||||
];
|
||||
cachedRecommendedQuestions.set(siteSpaceId, recommendedQuestions);
|
||||
|
||||
if (!cancelled) {
|
||||
@@ -168,14 +195,19 @@ export function useSearchResults(props: {
|
||||
clearTimeout(timeout);
|
||||
};
|
||||
}
|
||||
setRemoteState({ status: 'loading' });
|
||||
setRemoteState((state) => {
|
||||
const answer = 'answer' in state ? state.answer : undefined;
|
||||
return answer?.scopeKey === scopeKey
|
||||
? { status: 'loading', requestKey, answer }
|
||||
: { status: 'loading', requestKey };
|
||||
});
|
||||
let cancelled = false;
|
||||
const abortController = new AbortController();
|
||||
const send = async () => {
|
||||
flushRef.current = null;
|
||||
const fetchSearch = (
|
||||
scope: Parameters<typeof fetchSearchResults>[1]
|
||||
): Promise<OrderedComputedResult[]> =>
|
||||
): Promise<RemoteSearchResult[]> =>
|
||||
fetchSearchResults(
|
||||
searchURL,
|
||||
scope,
|
||||
@@ -188,25 +220,29 @@ export function useSearchResults(props: {
|
||||
try {
|
||||
const resultsPromise = fetchSearch(remoteScope);
|
||||
|
||||
const onResults = (results: OrderedComputedResult[]) => {
|
||||
const onResults = (results: RemoteSearchResult[]) => {
|
||||
if (cancelled) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!results) {
|
||||
// Can happen when the route cannot be found and returns the page's html.
|
||||
setRemoteState({ status: 'error' });
|
||||
setRemoteState({ status: 'error', requestKey });
|
||||
return;
|
||||
}
|
||||
|
||||
setRemoteState({ status: 'ready', requestKey, results });
|
||||
setRemoteState({
|
||||
status: 'ready',
|
||||
requestKey,
|
||||
answer: { scopeKey, query, results },
|
||||
});
|
||||
trackEvent({ type: 'search_type_query', query });
|
||||
};
|
||||
const onError = () => {
|
||||
if (cancelled) {
|
||||
return;
|
||||
}
|
||||
setRemoteState({ status: 'error' });
|
||||
setRemoteState({ status: 'error', requestKey });
|
||||
};
|
||||
|
||||
await resultsPromise.then(onResults, onError);
|
||||
@@ -215,10 +251,10 @@ export function useSearchResults(props: {
|
||||
if (cancelled) {
|
||||
return;
|
||||
}
|
||||
setRemoteState({ status: 'error' });
|
||||
setRemoteState({ status: 'error', requestKey });
|
||||
}
|
||||
};
|
||||
const timeout = setTimeout(send, consumeImmediate?.(query) ? 0 : 150);
|
||||
const timeout = setTimeout(send, consumeImmediate?.(query) ? 0 : 100);
|
||||
flushRef.current = () => {
|
||||
clearTimeout(timeout);
|
||||
void send();
|
||||
@@ -241,6 +277,7 @@ export function useSearchResults(props: {
|
||||
query,
|
||||
remoteScope,
|
||||
requestKey,
|
||||
scopeKey,
|
||||
trackEvent,
|
||||
withAI,
|
||||
siteSpaceId,
|
||||
@@ -252,6 +289,16 @@ export function useSearchResults(props: {
|
||||
searchPass,
|
||||
]);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (!retainPreviousResults) {
|
||||
setRemoteState((state) =>
|
||||
state.status === 'loading' && state.answer
|
||||
? { status: 'loading', requestKey: state.requestKey }
|
||||
: state
|
||||
);
|
||||
}
|
||||
}, [retainPreviousResults, requestKey]);
|
||||
|
||||
const flush = React.useCallback(() => {
|
||||
flushRef.current?.();
|
||||
}, []);
|
||||
@@ -262,10 +309,20 @@ export function useSearchResults(props: {
|
||||
setRemoteState((prev) => (prev.status === 'loading' ? { status: 'idle' } : prev));
|
||||
}, []);
|
||||
|
||||
const answer = 'answer' in remoteState ? remoteState.answer : undefined;
|
||||
const visibleAnswer =
|
||||
query &&
|
||||
!disabled &&
|
||||
answer?.scopeKey === scopeKey &&
|
||||
(answer.query === query || retainPreviousResults)
|
||||
? answer
|
||||
: undefined;
|
||||
|
||||
const streamedQuestions = cachedRecommendedQuestions.get(siteSpaceId);
|
||||
const results = React.useMemo<ResultType[]>(() => {
|
||||
if (!query) {
|
||||
const recommendedQuestions =
|
||||
cachedRecommendedQuestions.get(siteSpaceId) ??
|
||||
streamedQuestions ??
|
||||
suggestions?.map((question, index) =>
|
||||
createRecommendedQuestionResult(`recommended-question-${index}`, question)
|
||||
) ??
|
||||
@@ -278,27 +335,32 @@ export function useSearchResults(props: {
|
||||
});
|
||||
}
|
||||
|
||||
return remoteState.status === 'ready' && remoteState.requestKey === requestKey
|
||||
? filterResultsBySiteSpaces(remoteState.results, filterSiteSpaceIds)
|
||||
return visibleAnswer
|
||||
? getDisplayedSearchResults(visibleAnswer.results, filterSiteSpaceIds)
|
||||
: [];
|
||||
}, [
|
||||
remoteState,
|
||||
requestKey,
|
||||
visibleAnswer,
|
||||
query,
|
||||
filterSiteSpaceIds,
|
||||
withAI,
|
||||
siteSpaceId,
|
||||
streamedQuestions,
|
||||
suggestions,
|
||||
recentQueries,
|
||||
]);
|
||||
|
||||
// Between a query change and its loading state, the previous answer must still read as loading.
|
||||
const isOutdated = remoteState.status === 'ready' && remoteState.requestKey !== requestKey;
|
||||
|
||||
return {
|
||||
results,
|
||||
fetching: remoteState.status === 'loading' || (Boolean(query) && isOutdated),
|
||||
error: remoteState.status === 'error',
|
||||
resultsQuery: visibleAnswer?.query ?? query,
|
||||
fetching:
|
||||
Boolean(query) &&
|
||||
!disabled &&
|
||||
(remoteState.status === 'loading' ||
|
||||
(remoteState.status !== 'idle' && remoteState.requestKey !== requestKey)),
|
||||
error:
|
||||
Boolean(query) &&
|
||||
!disabled &&
|
||||
remoteState.status === 'error' &&
|
||||
remoteState.requestKey === requestKey,
|
||||
requestKey,
|
||||
flush,
|
||||
abort,
|
||||
@@ -315,17 +377,21 @@ async function fetchSearchResults(
|
||||
signal: AbortSignal,
|
||||
asEmbeddable: boolean | undefined,
|
||||
searchPass: SearchPassStore | null
|
||||
): Promise<OrderedComputedResult[]> {
|
||||
): Promise<RemoteSearchResult[]> {
|
||||
const directSearchId = generateSearchId();
|
||||
const direct = await searchPass?.search({
|
||||
query,
|
||||
searchId: directSearchId,
|
||||
scope,
|
||||
signal,
|
||||
asEmbeddable: Boolean(asEmbeddable),
|
||||
});
|
||||
if (direct?.type === 'results') {
|
||||
return direct.results;
|
||||
const search = { query, searchId: directSearchId };
|
||||
return direct.results.map((result) => ({ ...result, search }));
|
||||
}
|
||||
|
||||
const searchId = direct ? generateSearchId() : directSearchId;
|
||||
const response = await fetch(searchURL, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
@@ -335,6 +401,7 @@ async function fetchSearchResults(
|
||||
body: JSON.stringify({
|
||||
asEmbeddable,
|
||||
query,
|
||||
searchId,
|
||||
scope,
|
||||
}),
|
||||
signal,
|
||||
@@ -344,5 +411,12 @@ async function fetchSearchResults(
|
||||
throw new Error(`Search request failed: ${response.status}`);
|
||||
}
|
||||
|
||||
return response.json() as Promise<OrderedComputedResult[]>;
|
||||
const results: OrderedComputedResult[] = await response.json();
|
||||
const search = { query, searchId };
|
||||
return results.map((result) => ({ ...result, search }));
|
||||
}
|
||||
|
||||
function generateSearchId() {
|
||||
const bytes = globalThis.crypto?.getRandomValues(new Uint8Array(SEARCH_ID_BYTES));
|
||||
return bytes && Array.from(bytes, (byte) => byte.toString(16).padStart(2, '0')).join('');
|
||||
}
|
||||
|
||||
@@ -17,9 +17,11 @@ export function useSearchResultsCursor(props: {
|
||||
}, [query]);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (fetching && resultCount === 0) {
|
||||
// Nothing is highlighted while results load, so Enter can't open the Ask row instead.
|
||||
setCursor(null);
|
||||
if (fetching) {
|
||||
if (resultCount === 0) {
|
||||
// Nothing is highlighted while results load, so Enter can't open the Ask row instead.
|
||||
setCursor(null);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,17 +1,25 @@
|
||||
import type { GitBookSiteContext } from '@/lib/context';
|
||||
import { getLLMsTxtURL } from '@/lib/llms-directive';
|
||||
import { getAdvertisedMcpEndpoint, getLLMsTxtURL } from '@/lib/llms-directive';
|
||||
|
||||
/**
|
||||
* Agent-facing pointer to the site index and the Markdown versions of pages.
|
||||
* Agent-facing pointer to the site index, the Markdown versions of pages and the MCP server.
|
||||
*/
|
||||
export function LLMsTxtDirective(props: { context: GitBookSiteContext }) {
|
||||
const { context } = props;
|
||||
const mcpEndpoint = getAdvertisedMcpEndpoint(context);
|
||||
|
||||
return (
|
||||
<div className="sr-only">
|
||||
For the complete documentation index, see <a href={getLLMsTxtURL(context)}>llms.txt</a>.
|
||||
Markdown versions of documentation pages are available by appending <code>.md</code> to
|
||||
page URLs.
|
||||
{mcpEndpoint ? (
|
||||
<>
|
||||
{' '}
|
||||
Agents can also search and read this documentation through its{' '}
|
||||
<a href={mcpEndpoint}>MCP server</a>.
|
||||
</>
|
||||
) : null}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
CustomizationHeaderPreset,
|
||||
SiteInsightsDisplayContext,
|
||||
type TranslationLanguage,
|
||||
type RevisionTag,
|
||||
} from '@gitbook/api';
|
||||
import { IconsProvider } from '@gitbook/icons';
|
||||
|
||||
@@ -18,34 +19,43 @@ import {
|
||||
} from './fetch';
|
||||
import { PageClientLayout } from './PageClientLayout';
|
||||
import { getPageFullTitle } from './title';
|
||||
import { PaginatedUpdatesProvider } from '@/components/DocumentView/PaginatedUpdates';
|
||||
import { UpdatesFilterProvider } from '@/components/DocumentView/UpdatesFilter';
|
||||
import { UpdatesFilterScript } from '@/components/DocumentView/UpdatesFilterScript';
|
||||
import { PageAside } from '@/components/PageAside';
|
||||
import { PageBody, PageCover } from '@/components/PageBody';
|
||||
import type { GitBookSiteContext } from '@/lib/context';
|
||||
import { getDataOrNull, getPageDocument } from '@/lib/data';
|
||||
import { hasTopLevelBlock } from '@/lib/document';
|
||||
import {
|
||||
getContentInlineIconSourceRequests,
|
||||
getCustomizationIconStyle,
|
||||
getInlineIconSources,
|
||||
} from '@/lib/icons/inline';
|
||||
import { getResizedImageURL } from '@/lib/images';
|
||||
import { getLogger } from '@/lib/logger';
|
||||
import { getPagePath } from '@/lib/pages';
|
||||
import { resolveContentRef } from '@/lib/references';
|
||||
import { isPageIndexable, isSiteIndexable } from '@/lib/seo';
|
||||
import { getSiteSpacePagePaths, resolveSiteSpaceCustomHomePage } from '@/lib/sites';
|
||||
import { tcls } from '@/lib/tailwind';
|
||||
import {
|
||||
countDocumentUpdates,
|
||||
generateUpdatesFilterCSS,
|
||||
getUpdatesPageRange,
|
||||
paginateUpdatesDocument,
|
||||
UPDATES_PAGINATION_THRESHOLD,
|
||||
getDocumentFilterableTags,
|
||||
updatesFilterStyleHref,
|
||||
} from '@/lib/updates';
|
||||
import { UPDATES_PAGE_SEARCH_PARAM } from '@/lib/updates-url';
|
||||
|
||||
export { getPageFullTitle } from './title';
|
||||
|
||||
export type SitePageProps = {
|
||||
context: GitBookSiteContext;
|
||||
pageParams: PagePathParams;
|
||||
updatesPage?: number;
|
||||
};
|
||||
|
||||
type AlternateLinkSpace = {
|
||||
@@ -85,11 +95,18 @@ export async function SitePage(props: SitePageProps & { staticRoute: boolean })
|
||||
withTopHeader,
|
||||
pageMetaLinks,
|
||||
iconSources,
|
||||
filterableTags,
|
||||
contentHasUpdates,
|
||||
pagination,
|
||||
pageHref,
|
||||
} = await getSitePageData(props);
|
||||
const headerOffset = { sectionsHeader: withSections, topHeader: withTopHeader };
|
||||
const filterableTags = document ? getDocumentFilterableTags(document, context.revision) : [];
|
||||
const filterableTagSlugs = filterableTags.map((tag) => tag.slug);
|
||||
const content = (
|
||||
let updatesBaseHref: string | undefined;
|
||||
if (pagination) {
|
||||
updatesBaseHref = pageHref;
|
||||
}
|
||||
let content = (
|
||||
<>
|
||||
{/* Using `contents` makes the children of this div according to its parent — which keeps them in a single flex row with the TOC by default.
|
||||
If there's a page cover, we use `flex flex-col` to lay out the PageCover above the PageBody + PageAside instead. */}
|
||||
@@ -119,6 +136,7 @@ export async function SitePage(props: SitePageProps & { staticRoute: boolean })
|
||||
page={page}
|
||||
document={document}
|
||||
filterableTags={filterableTags}
|
||||
withUpdatesPagination={Boolean(pagination)}
|
||||
withHeaderOffset={headerOffset}
|
||||
withFullPageCover={withFullPageCover}
|
||||
withPageFeedback={withPageFeedback}
|
||||
@@ -132,6 +150,8 @@ export async function SitePage(props: SitePageProps & { staticRoute: boolean })
|
||||
withPageFeedback={withPageFeedback}
|
||||
insightsDisplayContext={SiteInsightsDisplayContext.Site}
|
||||
staticRoute={props.staticRoute}
|
||||
contentHasUpdates={contentHasUpdates}
|
||||
updatesBaseHref={updatesBaseHref}
|
||||
/>
|
||||
</div>
|
||||
<PageClientLayout pageMetaLinks={pageMetaLinks} />
|
||||
@@ -139,18 +159,34 @@ export async function SitePage(props: SitePageProps & { staticRoute: boolean })
|
||||
</>
|
||||
);
|
||||
|
||||
if (pagination) {
|
||||
content = (
|
||||
<PaginatedUpdatesProvider
|
||||
key={`${context.space.id}/${context.revisionId}/${page.id}/${pagination.page}`}
|
||||
pageId={page.id}
|
||||
revisionId={context.revisionId}
|
||||
isEmbeddable={false}
|
||||
tagSlugs={filterableTagSlugs}
|
||||
initialPagination={pagination}
|
||||
>
|
||||
<UpdatesFilterStyle tagSlugs={filterableTagSlugs} />
|
||||
{content}
|
||||
</PaginatedUpdatesProvider>
|
||||
);
|
||||
} else if (filterableTagSlugs.length > 0) {
|
||||
content = (
|
||||
<UpdatesFilterProvider tagSlugs={filterableTagSlugs}>
|
||||
<UpdatesFilterScript tagSlugs={filterableTagSlugs} />
|
||||
<UpdatesFilterStyle tagSlugs={filterableTagSlugs} />
|
||||
{content}
|
||||
</UpdatesFilterProvider>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<IconsProvider iconSources={iconSources}>
|
||||
<PageContextProvider pageId={page.id} spaceId={context.space.id} title={page.title}>
|
||||
{filterableTagSlugs.length > 0 ? (
|
||||
<UpdatesFilterProvider tagSlugs={filterableTagSlugs}>
|
||||
<UpdatesFilterScript tagSlugs={filterableTagSlugs} />
|
||||
<UpdatesFilterStyle tagSlugs={filterableTagSlugs} />
|
||||
{content}
|
||||
</UpdatesFilterProvider>
|
||||
) : (
|
||||
content
|
||||
)}
|
||||
{content}
|
||||
</PageContextProvider>
|
||||
</IconsProvider>
|
||||
);
|
||||
@@ -204,7 +240,7 @@ export async function generateSitePageMetadata(props: SitePageProps): Promise<Me
|
||||
const { page, ancestors } = pageTarget;
|
||||
const { customization, revision, linker, imageResizer } = context;
|
||||
|
||||
const canonical = (
|
||||
let canonical = (
|
||||
pageMetaLinks?.canonical
|
||||
? new URL(
|
||||
// If the canonical link is an absolute URL, use it as is.
|
||||
@@ -216,6 +252,23 @@ export async function generateSitePageMetadata(props: SitePageProps): Promise<Me
|
||||
linker.toAbsoluteURL(linker.toPathForPage({ pages: revision.pages, page }))
|
||||
).replace(/\/+$/, ''); // Trim trailing slashes in canonical URL to match the redirect behavior
|
||||
|
||||
let title = getPageFullTitle(context, page);
|
||||
if (props.updatesPage) {
|
||||
const document = await getPageDocument(context, page);
|
||||
if (document) {
|
||||
const count = countDocumentUpdates(document);
|
||||
if (count > UPDATES_PAGINATION_THRESHOLD) {
|
||||
const { page: pageNumber } = getUpdatesPageRange(props.updatesPage, count);
|
||||
title = `${title} (Page ${pageNumber})`;
|
||||
if (!pageMetaLinks?.canonical) {
|
||||
const url = new URL(canonical);
|
||||
url.searchParams.set(UPDATES_PAGE_SEARCH_PARAM, String(pageNumber));
|
||||
canonical = url.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const alternates = pageMetaLinks?.alternates.reduce<{
|
||||
languages: Record<string, string>;
|
||||
generic: {
|
||||
@@ -239,8 +292,9 @@ export async function generateSitePageMetadata(props: SitePageProps): Promise<Me
|
||||
);
|
||||
|
||||
return {
|
||||
title: getPageFullTitle(context, page),
|
||||
title,
|
||||
description: page.description ?? '',
|
||||
keywords: page.keywords?.length ? page.keywords : undefined,
|
||||
alternates: {
|
||||
canonical,
|
||||
languages: alternates?.languages,
|
||||
@@ -326,7 +380,44 @@ export async function getSitePageData(props: SitePageProps) {
|
||||
|
||||
const withSections = Boolean(visibleSections && visibleSections.list.length > 0);
|
||||
|
||||
const document = await getPageDocument(context, page);
|
||||
const fullDocument = await getPageDocument(context, page);
|
||||
const pageHref = context.linker.toPathForPagePath({ path: rawPathname });
|
||||
let contentHasUpdates = false;
|
||||
let filterableTags: RevisionTag[] = [];
|
||||
let document = fullDocument;
|
||||
let pagination = null;
|
||||
if (fullDocument) {
|
||||
contentHasUpdates = hasTopLevelBlock(fullDocument, (block) => block.type === 'updates');
|
||||
filterableTags = getDocumentFilterableTags(fullDocument, context.revision);
|
||||
({ document, pagination } = paginateUpdatesDocument(fullDocument, context.revision, {
|
||||
page: props.updatesPage ?? 1,
|
||||
}));
|
||||
}
|
||||
|
||||
if (pagination || props.updatesPage) {
|
||||
const logger = getLogger().subLogger('updatesPagination', {
|
||||
labels: { siteId: context.site.id, pageId: page.id },
|
||||
});
|
||||
if (props.updatesPage && (!pagination || pagination.isClamped)) {
|
||||
const targetPage = pagination?.page ?? 1;
|
||||
logger.info('Redirected out-of-range updates page', {
|
||||
requestedPage: props.updatesPage,
|
||||
targetPage,
|
||||
});
|
||||
if (targetPage > 1) {
|
||||
redirect(`${pageHref}?${UPDATES_PAGE_SEARCH_PARAM}=${targetPage}`);
|
||||
}
|
||||
redirect(pageHref);
|
||||
}
|
||||
if (pagination) {
|
||||
logger.info('Rendered updates page', {
|
||||
page: pagination.page,
|
||||
totalItems: pagination.totalItems,
|
||||
totalPages: pagination.totalPages,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
const iconStyle = getCustomizationIconStyle(customization);
|
||||
const iconSources = await getInlineIconSources(
|
||||
getContentInlineIconSourceRequests({
|
||||
@@ -346,6 +437,10 @@ export async function getSitePageData(props: SitePageProps) {
|
||||
withTopHeader,
|
||||
pageMetaLinks,
|
||||
iconSources,
|
||||
contentHasUpdates,
|
||||
filterableTags,
|
||||
pagination,
|
||||
pageHref,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
import { describe, expect, it, mock } from 'bun:test';
|
||||
|
||||
import { CustomizationPageActionType, type RevisionPageDocument } from '@gitbook/api';
|
||||
import type { RevisionPageDocument, SiteRedirectDestination } from '@gitbook/api';
|
||||
|
||||
import type { GitBookSiteContext } from '@/lib/context';
|
||||
|
||||
mock.module('server-only', () => ({}));
|
||||
|
||||
const {
|
||||
fetchPageData,
|
||||
getLowercasePathnameRedirect,
|
||||
resolveMissingPagePath,
|
||||
resolveSitePageFromURL,
|
||||
} = await import('./fetch');
|
||||
const { getLowercasePathnameRedirect, resolveMissingPagePath, resolveSitePageFromURL } =
|
||||
await import('./fetch');
|
||||
const { normalizeURL } = await import('@/lib/data/urls');
|
||||
const { createLinker } = await import('@/lib/links');
|
||||
|
||||
@@ -25,92 +21,30 @@ const page = {
|
||||
pages: [],
|
||||
} as RevisionPageDocument;
|
||||
|
||||
const git = {
|
||||
oid: 'abc123',
|
||||
path: 'README.md',
|
||||
};
|
||||
|
||||
function createContext(options: { gitEnabled: boolean; gitSync?: boolean }) {
|
||||
const getRevisionPageByPath = mock(async () => ({
|
||||
data: {
|
||||
...page,
|
||||
git,
|
||||
},
|
||||
}));
|
||||
|
||||
const context = {
|
||||
revision: { pages: [page] },
|
||||
revisionId: 'revision-1',
|
||||
customization: {
|
||||
pageActions: {
|
||||
items: options.gitEnabled ? [CustomizationPageActionType.Git] : [],
|
||||
},
|
||||
},
|
||||
space: {
|
||||
id: 'space-1',
|
||||
gitSync:
|
||||
options.gitSync === false
|
||||
? undefined
|
||||
: {
|
||||
url: 'https://github.com/gitbook/example/tree/main',
|
||||
},
|
||||
},
|
||||
dataFetcher: { getRevisionPageByPath },
|
||||
} as unknown as GitBookSiteContext;
|
||||
|
||||
return { context, getRevisionPageByPath };
|
||||
}
|
||||
|
||||
describe('fetchPageData', () => {
|
||||
it('fetches the Git metadata for an enabled Edit on Git action', async () => {
|
||||
const { context, getRevisionPageByPath } = createContext({ gitEnabled: true });
|
||||
|
||||
const result = await fetchPageData(context, { pageId: page.id });
|
||||
|
||||
expect(getRevisionPageByPath).toHaveBeenCalledWith({
|
||||
spaceId: 'space-1',
|
||||
revisionId: 'revision-1',
|
||||
path: 'readme',
|
||||
metadata: true,
|
||||
cachedMetadata: true,
|
||||
});
|
||||
expect(result.pageTarget?.page.git).toEqual(git);
|
||||
expect(result.context.page?.git).toEqual(git);
|
||||
});
|
||||
|
||||
it('does not fetch Git metadata when the action is disabled', async () => {
|
||||
const { context, getRevisionPageByPath } = createContext({ gitEnabled: false });
|
||||
|
||||
const result = await fetchPageData(context, { pageId: page.id });
|
||||
|
||||
expect(getRevisionPageByPath).not.toHaveBeenCalled();
|
||||
expect(result.pageTarget?.page.git).toBeUndefined();
|
||||
});
|
||||
|
||||
it('does not fetch Git metadata without Git Sync', async () => {
|
||||
const { context, getRevisionPageByPath } = createContext({
|
||||
gitEnabled: true,
|
||||
gitSync: false,
|
||||
});
|
||||
|
||||
const result = await fetchPageData(context, { pageId: page.id });
|
||||
|
||||
expect(getRevisionPageByPath).not.toHaveBeenCalled();
|
||||
expect(result.pageTarget?.page.git).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
describe('resolveMissingPagePath', () => {
|
||||
function createRedirectContext(options: {
|
||||
siteRedirect?: { source?: string; target: string; permanent?: boolean };
|
||||
siteRedirect?: {
|
||||
source?: string;
|
||||
target: string;
|
||||
permanent?: boolean;
|
||||
destination?: SiteRedirectDestination;
|
||||
};
|
||||
spaceRedirectPageId?: string;
|
||||
contextId?: string;
|
||||
structure?: GitBookSiteContext['structure'];
|
||||
revisionsBySpace?: Record<string, RevisionPageDocument[]>;
|
||||
}) {
|
||||
const getSiteRedirectBySource = mock(async ({ source }: { source: string }) =>
|
||||
options.siteRedirect && source === (options.siteRedirect.source ?? '/old')
|
||||
? {
|
||||
data: {
|
||||
target: options.siteRedirect.target,
|
||||
redirect: { permanent: options.siteRedirect.permanent ?? false },
|
||||
redirect: {
|
||||
permanent: options.siteRedirect.permanent ?? false,
|
||||
...(options.siteRedirect.destination
|
||||
? { destination: options.siteRedirect.destination }
|
||||
: {}),
|
||||
},
|
||||
},
|
||||
}
|
||||
: { error: { code: 404, message: 'Not found' } }
|
||||
@@ -120,19 +54,35 @@ describe('resolveMissingPagePath', () => {
|
||||
? { data: { id: options.spaceRedirectPageId } }
|
||||
: { error: { code: 404, message: 'Not found' } }
|
||||
);
|
||||
const getRevision = mock(async ({ spaceId }: { spaceId: string }) =>
|
||||
options.revisionsBySpace?.[spaceId]
|
||||
? { data: { pages: options.revisionsBySpace[spaceId] } }
|
||||
: { error: { code: 404, message: 'Not found' } }
|
||||
);
|
||||
|
||||
const defaultSiteSpace = {
|
||||
id: 'site-space-1',
|
||||
space: { id: 'space-1', revision: 'revision-1' },
|
||||
};
|
||||
|
||||
return {
|
||||
organizationId: 'org-1',
|
||||
site: { id: 'site-1' },
|
||||
siteSpace: defaultSiteSpace,
|
||||
structure: options.structure ?? {
|
||||
type: 'siteSpaces',
|
||||
structure: [defaultSiteSpace],
|
||||
},
|
||||
space: { id: 'space-1', revision: 'revision-1' },
|
||||
revisionId: 'revision-1',
|
||||
revision: { pages: [page] },
|
||||
contextId: options.contextId,
|
||||
linker: {
|
||||
toPathInSpace: (path: string) => path,
|
||||
toRelativePathInSite: (path: string) => path,
|
||||
toLinkForContent: (url: string) => new URL(url).pathname,
|
||||
},
|
||||
dataFetcher: { getSiteRedirectBySource, getRevisionPageByPath },
|
||||
dataFetcher: { getSiteRedirectBySource, getRevisionPageByPath, getRevision },
|
||||
} as unknown as GitBookSiteContext;
|
||||
}
|
||||
|
||||
@@ -166,6 +116,224 @@ describe('resolveMissingPagePath', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('ignores a site redirect that targets the current path', async () => {
|
||||
const context = createRedirectContext({
|
||||
siteRedirect: {
|
||||
source: '/release-notes/restricted',
|
||||
target: 'https://docs.example.com/release-notes/restricted',
|
||||
},
|
||||
});
|
||||
|
||||
expect(await resolveMissingPagePath(context, 'release-notes/restricted')).toBeUndefined();
|
||||
});
|
||||
|
||||
it('ignores a site redirect that targets the current path with trailing slash, case, or query differences', async () => {
|
||||
const context = createRedirectContext({
|
||||
siteRedirect: {
|
||||
source: '/release-notes/restricted',
|
||||
target: 'https://docs.example.com/Release-Notes/Restricted/?tab=1#top',
|
||||
},
|
||||
});
|
||||
|
||||
expect(await resolveMissingPagePath(context, 'release-notes/restricted')).toBeUndefined();
|
||||
});
|
||||
|
||||
it('ignores a space-relative redirect that resolves back to the current section path', async () => {
|
||||
const context = {
|
||||
...createRedirectContext({
|
||||
siteRedirect: {
|
||||
source: '/v3/getting-started',
|
||||
target: 'https://docs.example.com/docs/v3/getting-started',
|
||||
},
|
||||
}),
|
||||
linker: createLinker({
|
||||
host: 'docs.example.com',
|
||||
siteBasePath: '/',
|
||||
spaceBasePath: '/docs/',
|
||||
}),
|
||||
} as unknown as GitBookSiteContext;
|
||||
|
||||
expect(await resolveMissingPagePath(context, 'v3/getting-started')).toBeUndefined();
|
||||
});
|
||||
|
||||
it('ignores a site redirect targeting a hidden site space on an adaptive site', async () => {
|
||||
const context = createRedirectContext({
|
||||
contextId: 'adaptive-ctx',
|
||||
siteRedirect: {
|
||||
source: '/getting-started',
|
||||
target: 'https://docs.example.com/docs/v3/getting-started',
|
||||
destination: {
|
||||
kind: 'site-page',
|
||||
siteSpaceId: 'site-space-hidden',
|
||||
pageId: 'page-v3',
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
expect(await resolveMissingPagePath(context, 'getting-started')).toBeUndefined();
|
||||
});
|
||||
|
||||
it('ignores a site redirect targeting a hidden section on an adaptive site', async () => {
|
||||
const context = createRedirectContext({
|
||||
contextId: 'adaptive-ctx',
|
||||
structure: {
|
||||
type: 'sections',
|
||||
structure: [
|
||||
{
|
||||
object: 'site-section',
|
||||
id: 'section-visible',
|
||||
siteSpaces: [
|
||||
{
|
||||
id: 'site-space-1',
|
||||
space: { id: 'space-1', revision: 'revision-1' },
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
} as unknown as GitBookSiteContext['structure'],
|
||||
siteRedirect: {
|
||||
source: '/old-section',
|
||||
target: 'https://docs.example.com/hidden-section',
|
||||
destination: {
|
||||
kind: 'site-section',
|
||||
siteSectionId: 'section-hidden',
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
expect(await resolveMissingPagePath(context, 'old-section')).toBeUndefined();
|
||||
});
|
||||
|
||||
it('ignores a site redirect targeting a hidden page in the current space on an adaptive site', async () => {
|
||||
const context = createRedirectContext({
|
||||
contextId: 'adaptive-ctx',
|
||||
siteRedirect: {
|
||||
source: '/release-notes/restricted.html',
|
||||
target: 'https://docs.example.com/release-notes/restricted',
|
||||
destination: {
|
||||
kind: 'site-page',
|
||||
siteSpaceId: 'site-space-1',
|
||||
pageId: 'hidden-page',
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
expect(
|
||||
await resolveMissingPagePath(context, 'release-notes/restricted.html')
|
||||
).toBeUndefined();
|
||||
});
|
||||
|
||||
it('checks target page visibility in another accessible space on an adaptive site', async () => {
|
||||
const otherSpace = {
|
||||
id: 'site-space-2',
|
||||
space: { id: 'space-2', revision: 'revision-2' },
|
||||
};
|
||||
const structure = {
|
||||
type: 'siteSpaces',
|
||||
structure: [
|
||||
{ id: 'site-space-1', space: { id: 'space-1', revision: 'revision-1' } },
|
||||
otherSpace,
|
||||
],
|
||||
} as unknown as GitBookSiteContext['structure'];
|
||||
|
||||
const hiddenContext = createRedirectContext({
|
||||
contextId: 'adaptive-ctx',
|
||||
structure,
|
||||
revisionsBySpace: { 'space-2': [] },
|
||||
siteRedirect: {
|
||||
source: '/old',
|
||||
target: 'https://docs.example.com/other/secret',
|
||||
destination: {
|
||||
kind: 'site-page',
|
||||
siteSpaceId: 'site-space-2',
|
||||
pageId: 'page-secret',
|
||||
},
|
||||
},
|
||||
});
|
||||
expect(await resolveMissingPagePath(hiddenContext, 'old')).toBeUndefined();
|
||||
|
||||
const visibleContext = createRedirectContext({
|
||||
contextId: 'adaptive-ctx',
|
||||
structure,
|
||||
revisionsBySpace: { 'space-2': [{ ...page, id: 'page-secret', path: 'secret' }] },
|
||||
siteRedirect: {
|
||||
source: '/old',
|
||||
target: 'https://docs.example.com/other/secret',
|
||||
destination: {
|
||||
kind: 'site-page',
|
||||
siteSpaceId: 'site-space-2',
|
||||
pageId: 'page-secret',
|
||||
},
|
||||
},
|
||||
});
|
||||
expect(await resolveMissingPagePath(visibleContext, 'old')).toEqual({
|
||||
type: 'redirect',
|
||||
destination: '/other/secret',
|
||||
permanent: false,
|
||||
});
|
||||
});
|
||||
|
||||
it('ignores a site redirect targeting the reassigned default variant path of the current space', async () => {
|
||||
const context = {
|
||||
...createRedirectContext({
|
||||
contextId: 'adaptive-ctx',
|
||||
siteRedirect: {
|
||||
source: '/guide/missing',
|
||||
target: 'https://docs.example.com/guide/v3/missing',
|
||||
destination: {
|
||||
kind: 'site-space',
|
||||
siteSpaceId: 'site-space-v3',
|
||||
},
|
||||
},
|
||||
structure: {
|
||||
type: 'sections',
|
||||
structure: [
|
||||
{
|
||||
object: 'site-section',
|
||||
id: 'section-guide',
|
||||
siteSpaces: [
|
||||
{
|
||||
id: 'site-space-v3',
|
||||
path: 'v3',
|
||||
default: true,
|
||||
space: { id: 'space-v3', revision: 'revision-1' },
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
} as unknown as GitBookSiteContext['structure'],
|
||||
}),
|
||||
siteSpace: {
|
||||
id: 'site-space-v3',
|
||||
path: 'v3',
|
||||
default: true,
|
||||
space: { id: 'space-v3', revision: 'revision-1' },
|
||||
},
|
||||
linker: createLinker({
|
||||
host: 'docs.example.com',
|
||||
siteBasePath: '/',
|
||||
spaceBasePath: '/guide/',
|
||||
}),
|
||||
} as unknown as GitBookSiteContext;
|
||||
|
||||
expect(await resolveMissingPagePath(context, 'missing')).toBeUndefined();
|
||||
});
|
||||
|
||||
it('keeps a redirect whose current path contains a literal question mark', async () => {
|
||||
const context = createRedirectContext({
|
||||
siteRedirect: {
|
||||
source: '/foo/bar%3Fbaz',
|
||||
target: 'https://docs.example.com/foo/bar',
|
||||
},
|
||||
});
|
||||
|
||||
expect(await resolveMissingPagePath(context, 'foo/bar?baz')).toEqual({
|
||||
type: 'redirect',
|
||||
destination: '/foo/bar',
|
||||
permanent: false,
|
||||
});
|
||||
});
|
||||
|
||||
it('resolves a space redirect to a page', async () => {
|
||||
const context = createRedirectContext({ spaceRedirectPageId: page.id });
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { permanentRedirect, redirect } from 'next/navigation';
|
||||
|
||||
import {
|
||||
CustomizationPageActionType,
|
||||
type RevisionPageDocument,
|
||||
type SiteRedirect,
|
||||
SITE_REDIRECT_SOURCE_PATH_MAX_LENGTH,
|
||||
SITE_REDIRECT_SOURCE_PATH_PATTERN,
|
||||
} from '@gitbook/api';
|
||||
@@ -11,7 +11,12 @@ import { type GitBookSiteContext, fetchSiteContextForSiteSpace } from '@/lib/con
|
||||
import { getDataOrNull } from '@/lib/data';
|
||||
import { type ResolvedPagePath, resolvePageId } from '@/lib/pages';
|
||||
import { withLeadingSlash } from '@/lib/paths';
|
||||
import { findSiteSpaceByUrl, resolveSiteSpacePagePath } from '@/lib/sites';
|
||||
import {
|
||||
findSiteSpaceBy,
|
||||
findSiteSpaceByUrl,
|
||||
getSiteStructureSections,
|
||||
resolveSiteSpacePagePath,
|
||||
} from '@/lib/sites';
|
||||
|
||||
const MAX_PAGE_URL_REDIRECTS = 5;
|
||||
|
||||
@@ -30,34 +35,7 @@ export type PageParams = PagePathParams | PageIdParams;
|
||||
* Optimized to fetch in parallel as much as possible.
|
||||
*/
|
||||
export async function fetchPageData(context: GitBookSiteContext, params: PageParams) {
|
||||
let pageTarget = await resolvePage(context, params);
|
||||
|
||||
// Revision trees omit metadata for cache efficiency, so load it only when this action needs the Git path.
|
||||
if (
|
||||
pageTarget &&
|
||||
!pageTarget.page.git &&
|
||||
context.space.gitSync?.url &&
|
||||
context.customization.pageActions.items.includes(CustomizationPageActionType.Git)
|
||||
) {
|
||||
const response = await context.dataFetcher.getRevisionPageByPath({
|
||||
spaceId: context.space.id,
|
||||
revisionId: context.revisionId,
|
||||
path: pageTarget.page.path,
|
||||
metadata: true,
|
||||
cachedMetadata: true,
|
||||
});
|
||||
const pageWithMetadata = response.data;
|
||||
|
||||
if (pageWithMetadata?.type === 'document' && pageWithMetadata.git) {
|
||||
pageTarget = {
|
||||
...pageTarget,
|
||||
page: {
|
||||
...pageTarget.page,
|
||||
git: pageWithMetadata.git,
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
const pageTarget = await resolvePage(context, params);
|
||||
|
||||
return {
|
||||
context: {
|
||||
@@ -141,6 +119,14 @@ export async function resolveMissingPagePath(
|
||||
.filter((source) => SITE_REDIRECT_SOURCE_PATH_REGEX.test(source))
|
||||
);
|
||||
|
||||
const currentPath = linker.toPathInSpace(redirectPathname);
|
||||
let currentPathWithDefaultVariant: string | null = null;
|
||||
if (context.siteSpace.default && context.siteSpace.path) {
|
||||
currentPathWithDefaultVariant = linker.toPathInSpace(
|
||||
`/${context.siteSpace.path}${redirectPathname}`
|
||||
);
|
||||
}
|
||||
|
||||
for (const source of redirectSources) {
|
||||
// We try to resolve the site redirect
|
||||
const resolvedSiteRedirect =
|
||||
@@ -154,6 +140,18 @@ export async function resolveMissingPagePath(
|
||||
})
|
||||
));
|
||||
if (resolvedSiteRedirect) {
|
||||
const destination = linker.toLinkForContent(resolvedSiteRedirect.target);
|
||||
// Skip self-redirects (including default-variant canonical aliases) and hidden adaptive targets.
|
||||
const targetsCurrentPath =
|
||||
isSameRedirectPath(currentPath, destination) ||
|
||||
(currentPathWithDefaultVariant !== null &&
|
||||
isSameRedirectPath(currentPathWithDefaultVariant, destination));
|
||||
if (
|
||||
targetsCurrentPath ||
|
||||
!(await isRedirectDestinationAccessible(context, resolvedSiteRedirect.redirect))
|
||||
) {
|
||||
break;
|
||||
}
|
||||
const isPublicLiveContext =
|
||||
!shareKey &&
|
||||
!context.changeRequest &&
|
||||
@@ -162,7 +160,7 @@ export async function resolveMissingPagePath(
|
||||
!context.isLoggedInVisitor;
|
||||
return {
|
||||
type: 'redirect',
|
||||
destination: linker.toLinkForContent(resolvedSiteRedirect.target),
|
||||
destination,
|
||||
permanent: Boolean(
|
||||
resolvedSiteRedirect.redirect?.permanent &&
|
||||
!resolvedSiteRedirect.redirect.draft &&
|
||||
@@ -230,6 +228,17 @@ export async function resolveSitePageFromURL(
|
||||
return null;
|
||||
}
|
||||
|
||||
export function isSameRedirectPath(currentPath: string, destination: string): boolean {
|
||||
if (!destination.startsWith('/') || destination.startsWith('//')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const destinationPathname = new URL(destination, 'https://gitbook.invalid').pathname;
|
||||
return (
|
||||
normalizeRedirectPathname(currentPath) === normalizeRedirectPathname(destinationPathname)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Transform a pathname into a candidate source for site redirect matching.
|
||||
* The pathname is already percent-encoded, so each segment is decoded before being encoded
|
||||
@@ -254,6 +263,60 @@ function safeDecodeURIComponent(segment: string): string {
|
||||
}
|
||||
}
|
||||
|
||||
async function isRedirectDestinationAccessible(
|
||||
context: GitBookSiteContext,
|
||||
siteRedirect: SiteRedirect | null
|
||||
): Promise<boolean> {
|
||||
if (!context.contextId || !siteRedirect?.destination) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const { destination } = siteRedirect;
|
||||
switch (destination.kind) {
|
||||
case 'external':
|
||||
return true;
|
||||
case 'site-section':
|
||||
return getSiteStructureSections(context.structure, { ignoreGroups: true }).some(
|
||||
(section) => section.id === destination.siteSectionId
|
||||
);
|
||||
case 'site-space':
|
||||
return Boolean(
|
||||
findSiteSpaceBy(context.structure, (entry) => entry.id === destination.siteSpaceId)
|
||||
);
|
||||
case 'site-page': {
|
||||
const target = findSiteSpaceBy(
|
||||
context.structure,
|
||||
(entry) => entry.id === destination.siteSpaceId
|
||||
);
|
||||
if (!target) {
|
||||
return false;
|
||||
}
|
||||
if (destination.siteSpaceId === context.siteSpace.id) {
|
||||
return Boolean(resolvePageId(context.revision.pages, destination.pageId));
|
||||
}
|
||||
const targetRevision = await getDataOrNull(
|
||||
context.dataFetcher.getRevision({
|
||||
spaceId: target.siteSpace.space.id,
|
||||
revisionId: target.siteSpace.space.revision,
|
||||
})
|
||||
);
|
||||
if (!targetRevision) {
|
||||
return false;
|
||||
}
|
||||
return Boolean(resolvePageId(targetRevision.pages, destination.pageId));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function normalizeRedirectPathname(pathname: string): string {
|
||||
const normalized = pathname
|
||||
.split('/')
|
||||
.filter(Boolean)
|
||||
.map((segment) => safeDecodeURIComponent(segment).toLowerCase())
|
||||
.join('/');
|
||||
return `/${normalized}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the page path from the params.
|
||||
*/
|
||||
|
||||
@@ -36,11 +36,11 @@ export function Tag(props: { tag: RevisionTag; className?: string }) {
|
||||
export function TagIcon(props: { tag: RevisionTag }) {
|
||||
const { tag } = props;
|
||||
|
||||
if ('emoji' in tag) {
|
||||
if ('emoji' in tag && tag.emoji !== undefined) {
|
||||
return <Emoji code={tag.emoji} style="shrink-0" />;
|
||||
}
|
||||
|
||||
if (tag.icon) {
|
||||
if ('icon' in tag && tag.icon) {
|
||||
return <Icon icon={tag.icon as IconName} className={tcls('size-[1em]', 'shrink-0')} />;
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,10 @@ export const activeClasses = {
|
||||
export const Button = React.forwardRef<
|
||||
HTMLButtonElement | HTMLAnchorElement,
|
||||
ButtonProps &
|
||||
React.ButtonHTMLAttributes<HTMLButtonElement> & { target?: React.HTMLAttributeAnchorTarget }
|
||||
React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
||||
target?: React.HTMLAttributeAnchorTarget;
|
||||
rel?: string;
|
||||
}
|
||||
>(
|
||||
(
|
||||
{
|
||||
@@ -164,6 +167,11 @@ export const Button = React.forwardRef<
|
||||
}
|
||||
}
|
||||
|
||||
let trailingElement = null;
|
||||
if (trailing) {
|
||||
trailingElement = <span className="button-trailing-icon ms-auto">{trailing}</span>;
|
||||
}
|
||||
|
||||
const content = (
|
||||
<>
|
||||
{iconElement}
|
||||
@@ -177,6 +185,7 @@ export const Button = React.forwardRef<
|
||||
{children ?? label}
|
||||
</span>
|
||||
)}
|
||||
{trailingElement}
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -207,7 +216,6 @@ export const Button = React.forwardRef<
|
||||
{...rest}
|
||||
>
|
||||
{content}
|
||||
{trailing ? <span className="button-trailing-icon ms-auto">{trailing}</span> : null}
|
||||
</button>
|
||||
);
|
||||
|
||||
|
||||
@@ -46,6 +46,8 @@ export const ar: TranslationLanguage = {
|
||||
on_this_page: 'في هذه الصفحة',
|
||||
next_page: 'التالي',
|
||||
previous_page: 'السابق',
|
||||
updates_pagination_navigation: 'التنقل بين الصفحات',
|
||||
updates_pagination_range: '${1} - ${2} من أصل ${3} تحديثات',
|
||||
toc_back_to_space: 'العودة إلى ${1}',
|
||||
page_last_modified: 'آخر تحديث ${1}',
|
||||
was_this_helpful: 'هل كان هذا مفيدا؟',
|
||||
|
||||
@@ -46,6 +46,8 @@ export const bg: TranslationLanguage = {
|
||||
on_this_page: 'На тази страница',
|
||||
next_page: 'Следваща',
|
||||
previous_page: 'Предишна',
|
||||
updates_pagination_navigation: 'Навигация между страниците',
|
||||
updates_pagination_range: '${1} - ${2} от ${3} актуализации',
|
||||
toc_back_to_space: 'Обратно към ${1}',
|
||||
page_last_modified: 'Последна актуализация ${1}',
|
||||
was_this_helpful: 'Беше ли полезно?',
|
||||
|
||||
@@ -46,6 +46,8 @@ export const cs: TranslationLanguage = {
|
||||
on_this_page: 'Na této stránce',
|
||||
next_page: 'Další',
|
||||
previous_page: 'Předchozí',
|
||||
updates_pagination_navigation: 'Navigace mezi stránkami',
|
||||
updates_pagination_range: '${1} - ${2} z ${3} aktualizací',
|
||||
toc_back_to_space: 'Zpět na ${1}',
|
||||
page_last_modified: 'Poslední aktualizace ${1}',
|
||||
was_this_helpful: 'Bylo to užitečné?',
|
||||
|
||||
@@ -46,6 +46,8 @@ export const da: TranslationLanguage = {
|
||||
on_this_page: 'På denne side',
|
||||
next_page: 'Næste',
|
||||
previous_page: 'Forrige',
|
||||
updates_pagination_navigation: 'Sidenavigation',
|
||||
updates_pagination_range: '${1} - ${2} af ${3} opdateringer',
|
||||
toc_back_to_space: 'Tilbage til ${1}',
|
||||
page_last_modified: 'Sidst opdateret ${1}',
|
||||
was_this_helpful: 'Var dette nyttigt?',
|
||||
|
||||
@@ -47,6 +47,8 @@ export const de: TranslationLanguage = {
|
||||
on_this_page: 'Auf dieser Seite',
|
||||
next_page: 'Nächste',
|
||||
previous_page: 'Vorherige',
|
||||
updates_pagination_navigation: 'Seitennavigation',
|
||||
updates_pagination_range: '${1} - ${2} von ${3} Updates',
|
||||
toc_back_to_space: 'Zurück zu ${1}',
|
||||
page_last_modified: 'Zuletzt aktualisiert ${1}',
|
||||
was_this_helpful: 'War das hilfreich?',
|
||||
|
||||
@@ -46,6 +46,8 @@ export const el: TranslationLanguage = {
|
||||
on_this_page: 'Σε αυτήν τη σελίδα',
|
||||
next_page: 'Επόμενη',
|
||||
previous_page: 'Προηγούμενη',
|
||||
updates_pagination_navigation: 'Πλοήγηση σελίδων',
|
||||
updates_pagination_range: '${1} - ${2} από ${3} ενημερώσεις',
|
||||
toc_back_to_space: 'Επιστροφή σε ${1}',
|
||||
page_last_modified: 'Τελευταία ενημέρωση ${1}',
|
||||
was_this_helpful: 'Ήταν χρήσιμο αυτό;',
|
||||
|
||||
@@ -44,6 +44,8 @@ export const en = {
|
||||
on_this_page: 'On this page',
|
||||
next_page: 'Next',
|
||||
previous_page: 'Previous',
|
||||
updates_pagination_navigation: 'Pagination Navigation',
|
||||
updates_pagination_range: '${1} - ${2} of ${3} updates',
|
||||
toc_back_to_space: 'Back to ${1}',
|
||||
page_last_modified: 'Last updated ${1}',
|
||||
was_this_helpful: 'Was this helpful?',
|
||||
|
||||
@@ -47,6 +47,8 @@ export const es: TranslationLanguage = {
|
||||
on_this_page: 'En esta página',
|
||||
next_page: 'Siguiente',
|
||||
previous_page: 'Anterior',
|
||||
updates_pagination_navigation: 'Navegación entre páginas',
|
||||
updates_pagination_range: '${1} - ${2} de ${3} actualizaciones',
|
||||
toc_back_to_space: 'Volver a ${1}',
|
||||
page_last_modified: 'Última actualización ${1}',
|
||||
was_this_helpful: '¿Te fue útil?',
|
||||
|
||||
@@ -46,6 +46,8 @@ export const et: TranslationLanguage = {
|
||||
on_this_page: 'Sellel lehel',
|
||||
next_page: 'Järgmine',
|
||||
previous_page: 'Eelmine',
|
||||
updates_pagination_navigation: 'Lehekülgede vahel liikumine',
|
||||
updates_pagination_range: '${1} - ${2} / ${3} uuendust',
|
||||
toc_back_to_space: 'Tagasi: ${1}',
|
||||
page_last_modified: 'Viimati uuendatud ${1}',
|
||||
was_this_helpful: 'Kas sellest oli abi?',
|
||||
|
||||
@@ -46,6 +46,8 @@ export const fi: TranslationLanguage = {
|
||||
on_this_page: 'Tällä sivulla',
|
||||
next_page: 'Seuraava',
|
||||
previous_page: 'Edellinen',
|
||||
updates_pagination_navigation: 'Sivujen selaus',
|
||||
updates_pagination_range: '${1} - ${2} / ${3} päivitystä',
|
||||
toc_back_to_space: 'Takaisin: ${1}',
|
||||
page_last_modified: 'Päivitetty viimeksi ${1}',
|
||||
was_this_helpful: 'Oliko tästä apua?',
|
||||
|
||||
@@ -46,6 +46,8 @@ export const fr: TranslationLanguage = {
|
||||
on_this_page: 'Sur cette page',
|
||||
next_page: 'Suivant',
|
||||
previous_page: 'Précédent',
|
||||
updates_pagination_navigation: 'Navigation entre les pages',
|
||||
updates_pagination_range: '${1} - ${2} sur ${3} mises à jour',
|
||||
toc_back_to_space: 'Retour à ${1}',
|
||||
page_last_modified: 'Mis à jour ${1}',
|
||||
was_this_helpful: 'Ce contenu vous a-t-il été utile ?',
|
||||
|
||||
@@ -46,6 +46,8 @@ export const he: TranslationLanguage = {
|
||||
on_this_page: 'בדף הזה',
|
||||
next_page: 'הבא',
|
||||
previous_page: 'הקודם',
|
||||
updates_pagination_navigation: 'ניווט בין עמודים',
|
||||
updates_pagination_range: '${1} - ${2} מתוך ${3} עדכונים',
|
||||
toc_back_to_space: 'חזרה אל ${1}',
|
||||
page_last_modified: 'עודכן לאחרונה ${1}',
|
||||
was_this_helpful: 'האם זה היה מועיל?',
|
||||
|
||||
@@ -46,6 +46,8 @@ export const hi: TranslationLanguage = {
|
||||
on_this_page: 'इस पृष्ठ पर',
|
||||
next_page: 'अगला',
|
||||
previous_page: 'पिछला',
|
||||
updates_pagination_navigation: 'पेज नेविगेशन',
|
||||
updates_pagination_range: '${3} अपडेट में से ${1} - ${2}',
|
||||
toc_back_to_space: '${1} पर वापस जाएँ',
|
||||
page_last_modified: 'अंतिम अपडेट ${1}',
|
||||
was_this_helpful: 'क्या यह उपयोगी था?',
|
||||
|
||||
@@ -46,6 +46,8 @@ export const hr: TranslationLanguage = {
|
||||
on_this_page: 'Na ovoj stranici',
|
||||
next_page: 'Sljedeća',
|
||||
previous_page: 'Prethodna',
|
||||
updates_pagination_navigation: 'Navigacija stranicama',
|
||||
updates_pagination_range: '${1} - ${2} od ${3} ažuriranja',
|
||||
toc_back_to_space: 'Natrag na ${1}',
|
||||
page_last_modified: 'Zadnje ažurirano ${1}',
|
||||
was_this_helpful: 'Je li ovo bilo korisno?',
|
||||
|
||||
@@ -46,6 +46,8 @@ export const hu: TranslationLanguage = {
|
||||
on_this_page: 'Ezen az oldalon',
|
||||
next_page: 'Következő',
|
||||
previous_page: 'Előző',
|
||||
updates_pagination_navigation: 'Lapozás',
|
||||
updates_pagination_range: '${1} - ${2} / ${3} frissítés',
|
||||
toc_back_to_space: 'Vissza ide: ${1}',
|
||||
page_last_modified: 'Utoljára frissítve: ${1}',
|
||||
was_this_helpful: 'Hasznos volt ez?',
|
||||
|
||||
@@ -46,6 +46,8 @@ export const id: TranslationLanguage = {
|
||||
on_this_page: 'Di halaman ini',
|
||||
next_page: 'Berikutnya',
|
||||
previous_page: 'Sebelumnya',
|
||||
updates_pagination_navigation: 'Navigasi halaman',
|
||||
updates_pagination_range: '${1} - ${2} dari ${3} pembaruan',
|
||||
toc_back_to_space: 'Kembali ke ${1}',
|
||||
page_last_modified: 'Terakhir diperbarui ${1}',
|
||||
was_this_helpful: 'Apakah ini membantu?',
|
||||
|
||||
@@ -47,6 +47,8 @@ export const it: TranslationLanguage = {
|
||||
on_this_page: 'In questa pagina',
|
||||
next_page: 'Successivo',
|
||||
previous_page: 'Precedente',
|
||||
updates_pagination_navigation: 'Navigazione tra le pagine',
|
||||
updates_pagination_range: '${1} - ${2} di ${3} aggiornamenti',
|
||||
toc_back_to_space: 'Torna a ${1}',
|
||||
page_last_modified: 'Ultimo aggiornamento ${1}',
|
||||
was_this_helpful: 'È stato utile?',
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user