@redocly/realm 0.136.0-next.8 → 0.136.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (194) hide show
  1. package/CHANGELOG.md +221 -0
  2. package/dist/client/App.js +1 -1
  3. package/dist/client/ScriptLoader.js +1 -1
  4. package/dist/client/TestProvider.js +1 -1
  5. package/dist/client/app/Link.js +1 -1
  6. package/dist/client/app/Sidebar/useBreadcrumbs.js +1 -1
  7. package/dist/client/app/Sidebar/useSidebarItems.js +1 -1
  8. package/dist/client/app/Sidebar/utils.d.ts +1 -1
  9. package/dist/client/app/hooks/catalog/useCatalogClassic.js +1 -1
  10. package/dist/client/app/hooks/catalog/useCatalogFilter.js +1 -1
  11. package/dist/client/app/hooks/catalog/useCatalogSearch.js +1 -1
  12. package/dist/client/app/hooks/catalog/useCatalogSort.js +1 -1
  13. package/dist/client/app/hooks/products/useCurrentProduct.js +1 -1
  14. package/dist/client/app/hooks/useAutoScroll.js +1 -1
  15. package/dist/client/app/hooks/useBanner.js +1 -1
  16. package/dist/client/app/hooks/useL10nConfig.js +1 -1
  17. package/dist/client/app/hooks/useLoginUrl.js +1 -1
  18. package/dist/client/app/hooks/usePageTimeTracker.js +1 -1
  19. package/dist/client/app/hooks/useRouteChangeTracker.js +1 -1
  20. package/dist/client/app/markdoc/custom-components/openapi/replay-openapi.js +1 -1
  21. package/dist/client/app/pages/DevLogin/DevLogin.js +1 -1
  22. package/dist/client/app/search/useSearch.d.ts +1 -0
  23. package/dist/client/app/search/useSearch.js +1 -1
  24. package/dist/client/app/seo/hooks/useHreflangLinks.js +1 -1
  25. package/dist/client/app/useMobileMenu.js +1 -1
  26. package/dist/client/app/usePreloadHistory.d.ts +1 -1
  27. package/dist/client/app/usePreloadHistory.js +1 -1
  28. package/dist/client/app/utils/loadAndNavigate.d.ts +1 -1
  29. package/dist/client/browser-entry.js +2 -2
  30. package/dist/client/providers/hooks.d.ts +1 -1
  31. package/dist/client/providers/hooks.js +1 -1
  32. package/dist/client/providers/page-data/hooks.js +1 -1
  33. package/dist/client/providers/post-message/PostMessageProvider.js +1 -1
  34. package/dist/constants/api.d.ts +2 -0
  35. package/dist/constants/api.js +1 -1
  36. package/dist/server/api-routes/helpers/enhance-context.js +1 -1
  37. package/dist/server/api-routes/run-api-routes-worker.js +1 -1
  38. package/dist/server/config/env-config.d.ts +0 -2
  39. package/dist/server/config/env-schema.d.ts +0 -5
  40. package/dist/server/config/env-schemas/feature-flags.d.ts +0 -4
  41. package/dist/server/config/env-schemas/feature-flags.js +1 -1
  42. package/dist/server/constants/common.d.ts +2 -0
  43. package/dist/server/constants/common.js +1 -1
  44. package/dist/server/constants/plugins/search.d.ts +1 -1
  45. package/dist/server/constants/plugins/search.js +1 -1
  46. package/dist/server/esbuild/esbuild.js +1 -1
  47. package/dist/server/esbuild/plugins/themes-resolver.js +4 -2
  48. package/dist/server/plugins/catalog-entities/database/repositories/catalog-entities-repository.js +1 -1
  49. package/dist/server/plugins/dev-onboarding/template/App.js +1 -1
  50. package/dist/server/plugins/dev-onboarding/template/AppsList.js +1 -1
  51. package/dist/server/plugins/dev-onboarding/template/components/ApiKeyItem.js +1 -1
  52. package/dist/server/plugins/dev-onboarding/template/components/ApiLogDetails.js +1 -1
  53. package/dist/server/plugins/dev-onboarding/template/components/ApiLogs.js +1 -1
  54. package/dist/server/plugins/dev-onboarding/template/components/CreateApiKey.js +1 -1
  55. package/dist/server/plugins/dev-onboarding/template/components/DeleteAppDialog.js +1 -1
  56. package/dist/server/plugins/dev-onboarding/template/components/EditApis.js +1 -1
  57. package/dist/server/plugins/dev-onboarding/template/components/EditAppDescriptionDialog.js +1 -1
  58. package/dist/server/plugins/dev-onboarding/template/components/EditAppDialog.js +1 -1
  59. package/dist/server/plugins/dev-onboarding/template/components/EditCallbackUrlDialog.js +1 -1
  60. package/dist/server/plugins/dev-onboarding/template/components/RevokeAPIKey.js +1 -1
  61. package/dist/server/plugins/dev-onboarding/template/components/RollAPIKey.js +1 -1
  62. package/dist/server/plugins/dev-onboarding/template/components/UpdateApiKey.js +1 -1
  63. package/dist/server/plugins/dev-onboarding/template/index.js +1 -1
  64. package/dist/server/plugins/mcp/audit/audit-log.d.ts +36 -0
  65. package/dist/server/plugins/mcp/audit/audit-log.js +1 -0
  66. package/dist/server/plugins/mcp/audit/constants.d.ts +6 -0
  67. package/dist/server/plugins/mcp/audit/constants.js +1 -0
  68. package/dist/server/plugins/mcp/audit/secret-patterns.d.ts +2 -0
  69. package/dist/server/plugins/mcp/audit/secret-patterns.js +1 -0
  70. package/dist/server/plugins/mcp/codemode/build-tool-list.d.ts +12 -0
  71. package/dist/server/plugins/mcp/codemode/build-tool-list.js +2 -0
  72. package/dist/server/plugins/mcp/codemode/capabilities/fetch/index.js +4 -4
  73. package/dist/server/plugins/mcp/codemode/capabilities/types.d.ts +2 -1
  74. package/dist/server/plugins/mcp/codemode/capabilities/utils.d.ts +1 -1
  75. package/dist/server/plugins/mcp/codemode/capabilities/utils.js +3 -3
  76. package/dist/server/plugins/mcp/codemode/code-audit.d.ts +12 -0
  77. package/dist/server/plugins/mcp/codemode/code-audit.js +1 -0
  78. package/dist/server/plugins/mcp/codemode/code-execution-audit.d.ts +17 -0
  79. package/dist/server/plugins/mcp/codemode/code-execution-audit.js +1 -0
  80. package/dist/server/plugins/mcp/codemode/code-execution-telemetry.d.ts +11 -0
  81. package/dist/server/plugins/mcp/codemode/code-execution-telemetry.js +1 -0
  82. package/dist/server/plugins/mcp/codemode/constants.js +1 -1
  83. package/dist/server/plugins/mcp/codemode/prompts.d.ts +6 -3
  84. package/dist/server/plugins/mcp/codemode/prompts.js +7 -4
  85. package/dist/server/plugins/mcp/codemode/sandbox/create-sandbox-setup.js +1 -1
  86. package/dist/server/plugins/mcp/codemode/sandbox/polyfills/fetch-shim.d.ts +6 -0
  87. package/dist/server/plugins/mcp/codemode/sandbox/polyfills/fetch-shim.js +54 -0
  88. package/dist/server/plugins/mcp/codemode/sandbox/polyfills/form-data.d.ts +3 -0
  89. package/dist/server/plugins/mcp/codemode/sandbox/polyfills/form-data.js +17 -0
  90. package/dist/server/plugins/mcp/codemode/sandbox/polyfills/index.d.ts +3 -0
  91. package/dist/server/plugins/mcp/codemode/sandbox/polyfills/index.js +2 -0
  92. package/dist/server/plugins/mcp/codemode/sandbox/polyfills/url-search-params.d.ts +3 -0
  93. package/dist/server/plugins/mcp/codemode/sandbox/polyfills/url-search-params.js +64 -0
  94. package/dist/server/plugins/mcp/codemode/sandbox/polyfills/url.d.ts +3 -0
  95. package/dist/server/plugins/mcp/codemode/sandbox/polyfills/url.js +239 -0
  96. package/dist/server/plugins/mcp/codemode/tools/describe-tools.d.ts +2 -3
  97. package/dist/server/plugins/mcp/codemode/tools/describe-tools.js +1 -1
  98. package/dist/server/plugins/mcp/codemode/tools/execute-schema.d.ts +1 -1
  99. package/dist/server/plugins/mcp/codemode/tools/execute.js +1 -1
  100. package/dist/server/plugins/mcp/codemode/tools/manage-credentials.d.ts +19 -0
  101. package/dist/server/plugins/mcp/codemode/tools/manage-credentials.js +2 -0
  102. package/dist/server/plugins/mcp/codemode/tools/tool-errors.d.ts +4 -0
  103. package/dist/server/plugins/mcp/codemode/tools/tool-errors.js +1 -0
  104. package/dist/server/plugins/mcp/constants.d.ts +2 -1
  105. package/dist/server/plugins/mcp/constants.js +1 -1
  106. package/dist/server/plugins/mcp/docs-mcp/tool-schemas.js +1 -1
  107. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/get-endpoint-info.js +1 -1
  108. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/get-endpoints.js +1 -1
  109. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/get-full-api-description.js +1 -1
  110. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/get-security-schemes.js +1 -1
  111. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/list-apis.js +1 -1
  112. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/load-api-description.d.ts +5 -1
  113. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/load-api-description.js +1 -1
  114. package/dist/server/plugins/mcp/docs-mcp/tools/openapi/types.d.ts +2 -0
  115. package/dist/server/plugins/mcp/docs-mcp/utils.js +1 -1
  116. package/dist/server/plugins/mcp/gateway-mcp/elicitation.d.ts +38 -17
  117. package/dist/server/plugins/mcp/gateway-mcp/elicitation.js +3 -2
  118. package/dist/server/plugins/mcp/gateway-mcp/fetch/fetch-audit.d.ts +24 -0
  119. package/dist/server/plugins/mcp/gateway-mcp/fetch/fetch-audit.js +1 -0
  120. package/dist/server/plugins/mcp/gateway-mcp/fetch/fetch-bridge.js +1 -1
  121. package/dist/server/plugins/mcp/gateway-mcp/fetch/fetch-telemetry.d.ts +2 -1
  122. package/dist/server/plugins/mcp/gateway-mcp/fetch/fetch-telemetry.js +1 -1
  123. package/dist/server/plugins/mcp/gateway-mcp/fetch/normalize-path.d.ts +6 -0
  124. package/dist/server/plugins/mcp/gateway-mcp/fetch/normalize-path.js +1 -0
  125. package/dist/server/plugins/mcp/gateway-mcp/rate-limit/apply-edge-rate-limit.js +1 -1
  126. package/dist/server/plugins/mcp/gateway-mcp/rate-limit/edge-limiter.d.ts +2 -2
  127. package/dist/server/plugins/mcp/gateway-mcp/rate-limit/edge-limiter.js +1 -1
  128. package/dist/server/plugins/mcp/gateway-mcp/rate-limit/rate-limit-telemetry.d.ts +8 -0
  129. package/dist/server/plugins/mcp/gateway-mcp/rate-limit/rate-limit-telemetry.js +1 -0
  130. package/dist/server/plugins/mcp/gateway-mcp/rate-limit/window-counter.d.ts +2 -2
  131. package/dist/server/plugins/mcp/gateway-mcp/rate-limit/window-counter.js +1 -1
  132. package/dist/server/plugins/mcp/gateway-mcp/secret-store.d.ts +3 -0
  133. package/dist/server/plugins/mcp/gateway-mcp/secret-store.js +1 -1
  134. package/dist/server/plugins/mcp/gateway-mcp/upstream-auth.d.ts +2 -1
  135. package/dist/server/plugins/mcp/gateway-mcp/upstream-auth.js +1 -1
  136. package/dist/server/plugins/mcp/handlers/docs-mcp-handler.js +1 -1
  137. package/dist/server/plugins/mcp/handlers/errors.js +1 -1
  138. package/dist/server/plugins/mcp/handlers/mcp-credentials-handler.js +47 -24
  139. package/dist/server/plugins/mcp/servers/docs-server.d.ts +2 -3
  140. package/dist/server/plugins/mcp/servers/docs-server.js +1 -1
  141. package/dist/server/plugins/mcp/servers/mcp-server.d.ts +11 -14
  142. package/dist/server/plugins/mcp/servers/mcp-server.js +3 -1
  143. package/dist/server/plugins/mcp/types.d.ts +6 -6
  144. package/dist/server/plugins/mcp/utils/json-schema-validator.d.ts +9 -0
  145. package/dist/server/plugins/mcp/utils/json-schema-validator.js +1 -0
  146. package/dist/server/plugins/mcp/utils/mode.js +1 -1
  147. package/dist/server/plugins/mcp/workers/execute-mcp-tool.js +1 -1
  148. package/dist/server/plugins/mcp/workers/mcp-tool-telemetry.d.ts +20 -1
  149. package/dist/server/plugins/mcp/workers/mcp-tool-telemetry.js +1 -1
  150. package/dist/server/plugins/scorecard-classic/template/ApiDetailsPage.js +1 -1
  151. package/dist/server/plugins/scorecard-classic/template/RuleDetailsPage.js +1 -1
  152. package/dist/server/plugins/scorecard-classic/template/index.js +1 -1
  153. package/dist/server/plugins/scorecard-classic/template/utils.d.ts +1 -1
  154. package/dist/server/plugins/scorecard-classic/template/views.js +1 -1
  155. package/dist/server/plugins/search/engines/flexsearch/index.js +1 -1
  156. package/dist/server/plugins/search/engines/flexsearch/search-index.js +1 -1
  157. package/dist/server/plugins/search/engines/typesense/index.js +1 -1
  158. package/dist/server/ssr/render.js +1 -1
  159. package/dist/server/tools/notifiers/formatter.d.ts +1 -0
  160. package/dist/server/tools/notifiers/formatter.js +3 -3
  161. package/dist/server/tools/notifiers/logger.d.ts +1 -0
  162. package/dist/server/tools/notifiers/logger.js +2 -2
  163. package/dist/server/tools/notifiers/reporter.js +6 -6
  164. package/dist/server/types/plugin-hooks.d.ts +1 -1
  165. package/dist/server/types/plugins/common.d.ts +1 -1
  166. package/dist/server/utils/llmstxt/agent-feedback-llms-footer.js +1 -1
  167. package/dist/server/web-server/auth.js +3 -3
  168. package/dist/server/web-server/middleware/telemetry-middleware.js +1 -1
  169. package/dist/server/web-server/routes/ask-ai.d.ts +11 -0
  170. package/dist/server/web-server/routes/ask-ai.js +1 -1
  171. package/dist/server/web-server/routes/catalog/bff-catalog-related-entities.js +1 -1
  172. package/dist/server/web-server/routes/catalog/bff-catalog-revisions.js +1 -1
  173. package/dist/server/web-server/routes/catalog/bff-catalog.js +1 -1
  174. package/dist/server/web-server/routes/catalog/catalog-relations.js +1 -1
  175. package/dist/server/web-server/routes/catalog/catalog.js +1 -1
  176. package/dist/server/web-server/routes/dynamic-route.js +1 -1
  177. package/dist/server/web-server/routes/index.js +1 -1
  178. package/dist/server/web-server/routes/mcp-routes/a2a.js +1 -1
  179. package/dist/server/web-server/routes/mcp-routes/agent-card.js +1 -1
  180. package/dist/server/web-server/routes/mcp-routes/mcp-server-card.js +1 -1
  181. package/dist/server/web-server/routes/page-data.js +1 -1
  182. package/dist/server/web-server/routes/search.js +1 -1
  183. package/dist/server/web-server/routes/skills/skill-markdown.js +1 -1
  184. package/dist/server/web-server/routes/skills/skills-index.js +1 -1
  185. package/dist/types/api.d.ts +3 -0
  186. package/dist/utils/url/parse-preview-url.d.ts +22 -0
  187. package/dist/utils/url/parse-preview-url.js +1 -0
  188. package/package.json +21 -22
  189. package/dist/server/plugins/mcp/codemode/sandbox/polyfills.d.ts +0 -2
  190. package/dist/server/plugins/mcp/codemode/sandbox/polyfills.js +0 -99
  191. package/dist/server/plugins/mcp/handlers/sse-keepalive.d.ts +0 -15
  192. package/dist/server/plugins/mcp/handlers/sse-keepalive.js +0 -3
  193. package/dist/server/plugins/mcp/servers/session-manager.d.ts +0 -15
  194. package/dist/server/plugins/mcp/servers/session-manager.js +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,219 @@
1
1
  # @redocly/realm
2
2
 
3
+ ## 0.136.0
4
+
5
+ ### Minor Changes
6
+
7
+ - a749e28ae3: Added support for agent skills placed under the `@skills` folder.
8
+ - 94b73e18ac: Added `numbered-list` and `numbered-item` Markdoc tags to render step-by-step guides with numbered, icon, or bulleted lists and deep-linkable item headlines.
9
+ - f7bb0ce633: Added support for automatic access token refresh for the MCP server.
10
+ MCP clients keep long-running sessions alive without repeated browser logins.
11
+ - 9284703074: Improved GraphQL exploration in the MCP docs server.
12
+ Added schema-wide search across nested fields and descriptions, directive visibility in listings and SDL, and referenced-type previews in single-type lookups.
13
+ - 56e4931831: Allowed the `redocly` special value in the `access.idps` config option to offer the standard Redocly login (email/password and Social Login providers) alongside specific identity providers.
14
+ - 807da14929: Added support for the 2026-07-28 MCP protocol revision, including secure upstream API credential prompts for clients on the new revision.
15
+ Existing MCP clients keep working unchanged.
16
+ - 78b5d26796: Added `manageApiCredentials` tool to update or remove stored API credentials.
17
+ Prevented the credentials prompt from repeating after rejected calls.
18
+ - 8c1feb665f: Added team-based access control for the MCP server using the `rbac.features.mcp` configuration.
19
+ Users can restrict access per team, similar to how `rbac.features.aiSearch` controls AI search access.
20
+ - 339a474844: Added `locale` and `translate` options to the `renderForLlms` tag render context.
21
+ Custom Markdoc tags can localize their content in `llms.txt` and AI search output at build time.
22
+ - dcf7072cff: Added customizable `ReplayGate` and `ReplayTopBarActions` components to tailor authentication and the top bar in the `Try It` feature.
23
+ Both components receive the current API's ID, so their behavior can vary per API in a multi-API catalog.
24
+ - d0133f4af1: Migrated from the `react-router-dom` to `react-router` version `8.x`.
25
+ Projects that have `react-router-dom` in `package.json` must migrate to `react-router`.
26
+ - a749e28ae3: Added support for Agent-to-Agent card and MCP server card.
27
+
28
+ ### Patch Changes
29
+
30
+ - 0ca40bb3a4: Fixed an issue where API docs pages with large, deeply-nested schemas might have stopped responding after users clicked **Expand all**.
31
+ - ee1f316d32: Fixed an issue where mock server requests in hosted projects failed with a 500 error due to restricted API access.
32
+ - 5b0ce5ffa6: Fixed editor-to-Webview navigation for API operations rendered as anchors on a single page.
33
+ - 8a7207311b: Improved credential handling and rate limiting in the experimental gateway MCP.
34
+ - 0e5563a12c: Fixed rate limit enforcement for the experimental MCP gateway to work correctly across server instances.
35
+ - 17dd03b596: Hardened access control of `llms.txt` on the homepage Markdown page.
36
+ - 9310f9f2f6: Fixed an issue in the Typesense search engine where search requests failed with a 500 error.
37
+ The issue occurred when the query matched an API reference parameter whose search highlight did not include a deep link.
38
+ - e0f5887673: Fixed credential handling in the gateway MCP for clients without URL-mode elicitation.
39
+ Instructions provide correct links, credential errors are flagged, and credential pages display link validity duration.
40
+ - b6c997c11b: Fixed fetch capability in an experimental gateway MCP.
41
+ - 7c05ebc08b: Fixed endpoint details returned by the Docs MCP server to correctly display documentation for individual endpoints.
42
+ - 807da14929: Fixed intermittent `Session not found` errors from the MCP server.
43
+ - 696e667395: Fixed an issue on iOS devices where the on-screen keyboard caused the search and AI Assistant's inputs to overflow the screen making the send button inaccessible.
44
+ - 12eed09e5b: Fixed an issue in API docs where documented array items were not displayed in a nested indexed row.
45
+ - 14597a56ac: Fixed the built-in Docs MCP OAuth flow for public sites so they no longer advertise an authorization server or force a login.
46
+ - 17dd03b596: Improved response time on sites with many pages that use the `llms.txt` feature.
47
+ - 83d149073d: Fixed incorrect rendering of array items with primitive values in API docs.
48
+ - 6e91bb8a54: Fixed SSO logout to require re-authentication with the identity provider, preventing automatic login immediately after logout.
49
+ Session expiry continues to re-authenticate silently.
50
+ - bf820c76a6: Fixed an issue where the search modal could render taller than the browser window on short screens, causing it to be cut off.
51
+ - 330a3197c9: Fixed security vulnerabilities `CVE-2026-67214` and `CVE-2026-67213` by upgrading `nanoid` to version `5.1.16`.
52
+ - 53d6f71332: Fixed an issue in API docs where links to schema definitions inside operations were displayed as regular text instead of links.
53
+ - 5201784bec: Fixed security vulnerabilities `CVE-2026-69207` by upgrading `hono` to version `4.12.34`.
54
+ - 42547a5a76: Improved rendering of schema property examples.
55
+ Object and array example values are displayed as pretty-printed JSON with syntax highlighting and a copy button.
56
+ - 330a3197c9: Fixed security vulnerability `GHSA-5p4m-2wfm-xmqj` by upgrading `js-yaml` to version `4.3.1`.
57
+ - 40452890e1: Updated `@redocly/openapi-core` to version `2.45.0`.
58
+ - d226033959: Fixed an issue where deep links to callbacks navigated users to the operation instead.
59
+ - 931df5a101: Fixed an issue where API docs callbacks failed to render when expanded.
60
+ - 16d0c11a8a: Fixed an issue where some pages containing curation keywords were missing from search results.
61
+ - 16d0c11a8a: Fixed an issue where some queries returned multiple search results for the same page.
62
+ - 16d0c11a8a: Fixed an issue where the **Show more** command would display even though only one search result existed.
63
+ - 1ba0268431: Fixed an issue where callbacks and other collapsible panels in API docs could not be expanded.
64
+ - 8e9a1f74be: Fixed an issue where multiple adjacent separators in the sidebar rendered only the last separator.
65
+ - Updated dependencies [0ca40bb3a4]
66
+ - Updated dependencies [425dcb52e7]
67
+ - Updated dependencies [94b73e18ac]
68
+ - Updated dependencies [b6c997c11b]
69
+ - Updated dependencies [eeb60efed5]
70
+ - Updated dependencies [696e667395]
71
+ - Updated dependencies [12eed09e5b]
72
+ - Updated dependencies [339a474844]
73
+ - Updated dependencies [dcf7072cff]
74
+ - Updated dependencies [83d149073d]
75
+ - Updated dependencies [bf820c76a6]
76
+ - Updated dependencies [d0133f4af1]
77
+ - Updated dependencies [53d6f71332]
78
+ - Updated dependencies [42547a5a76]
79
+ - Updated dependencies [330a3197c9]
80
+ - Updated dependencies [40452890e1]
81
+ - Updated dependencies [d226033959]
82
+ - Updated dependencies [931df5a101]
83
+ - Updated dependencies [16d0c11a8a]
84
+ - Updated dependencies [16d0c11a8a]
85
+ - Updated dependencies [16d0c11a8a]
86
+ - Updated dependencies [1ba0268431]
87
+ - Updated dependencies [8e9a1f74be]
88
+ - Updated dependencies [a749e28ae3]
89
+ - @redocly/openapi-docs@3.24.0
90
+ - @redocly/api-docs@0.1.0
91
+ - @redocly/theme@0.68.0
92
+ - @redocly/realm-asyncapi-sdk@0.14.0
93
+ - @redocly/asyncapi-docs@1.13.0
94
+ - @redocly/graphql-docs@1.13.0
95
+ - @redocly/portal-plugin-mock-server@0.21.0
96
+ - @redocly/portal-legacy-ui@0.19.0
97
+
98
+ ## 0.136.0-next.15
99
+
100
+ ### Patch Changes
101
+
102
+ - 1f5d5014e53: Fixed an issue where sidebar items configured with `separatorLine: true` drew their line above the item instead of below it.
103
+ - e0f58876734: Fixed credential handling in the gateway MCP for clients without URL-mode elicitation.
104
+ Instructions provide correct links, credential errors are flagged, and credential pages display link validity duration.
105
+ - Updated dependencies [1f5d5014e53]
106
+ - @redocly/theme@0.68.0-next.9
107
+ - @redocly/api-docs@0.1.0-next.7
108
+ - @redocly/asyncapi-docs@1.13.0-next.13
109
+ - @redocly/graphql-docs@1.13.0-next.13
110
+ - @redocly/openapi-docs@3.24.0-next.13
111
+ - @redocly/portal-plugin-mock-server@0.21.0-next.13
112
+
113
+ ## 0.136.0-next.14
114
+
115
+ ### Patch Changes
116
+
117
+ - c6e9480ee86: Added auditing to the experimental gateway MCP.
118
+ - 7c05ebc08b6: Fixed endpoint details returned by the Docs MCP server to correctly display documentation for individual endpoints.
119
+ - 330a3197c9e: Fixed security vulnerabilities `CVE-2026-67214` and `CVE-2026-67213` by upgrading `nanoid` to version `5.1.16`.
120
+ - 330a3197c9e: Fixed security vulnerability `GHSA-5p4m-2wfm-xmqj` by upgrading `js-yaml` to version `4.3.1`.
121
+ - Updated dependencies [c6e9480ee86]
122
+ - Updated dependencies [330a3197c9e]
123
+ - @redocly/realm-asyncapi-sdk@0.14.0-next.4
124
+ - @redocly/api-docs@0.1.0-next.6
125
+ - @redocly/openapi-docs@3.24.0-next.12
126
+ - @redocly/theme@0.68.0-next.8
127
+ - @redocly/portal-plugin-mock-server@0.21.0-next.12
128
+ - @redocly/asyncapi-docs@1.13.0-next.12
129
+ - @redocly/graphql-docs@1.13.0-next.12
130
+
131
+ ## 0.136.0-next.13
132
+
133
+ ### Patch Changes
134
+
135
+ - 16d0c11a8a7: Fixed an issue where some pages containing curation keywords were missing from search results.
136
+ - 16d0c11a8a7: Fixed an issue where some queries returned multiple search results for the same page.
137
+ - 16d0c11a8a7: Fixed an issue where the **Show more** command would display even though only one search result existed.
138
+ - Updated dependencies [16d0c11a8a7]
139
+ - Updated dependencies [16d0c11a8a7]
140
+ - Updated dependencies [16d0c11a8a7]
141
+ - @redocly/theme@0.68.0-next.8
142
+ - @redocly/api-docs@0.1.0-next.5
143
+ - @redocly/asyncapi-docs@1.13.0-next.11
144
+ - @redocly/graphql-docs@1.13.0-next.11
145
+ - @redocly/openapi-docs@3.24.0-next.11
146
+ - @redocly/portal-plugin-mock-server@0.21.0-next.11
147
+
148
+ ## 0.136.0-next.12
149
+
150
+ ### Patch Changes
151
+
152
+ - 931df5a101b: Fixed an issue where API docs callbacks failed to render when expanded.
153
+
154
+ Fixed an issue where deep links to callbacks navigated users to the operation instead.
155
+
156
+ - Updated dependencies [931df5a101b]
157
+ - @redocly/api-docs@0.1.0-next.4
158
+
159
+ ## 0.136.0-next.11
160
+
161
+ ### Patch Changes
162
+
163
+ - 8d13293a7b7: Fixed security vulnerability `GHSA-qwww-vcr4-c8h2` by changing `react-router-dom` to `react-router` version `^8.3.0`.
164
+ - 78b5d267967: Added `manageApiCredentials` tool to update or remove stored API credentials. Prevented the credentials prompt from repeating after rejected calls.
165
+ - 40452890e12: Updated `@redocly/openapi-core` to version `2.45.0`.
166
+ - Updated dependencies [8d13293a7b7]
167
+ - Updated dependencies [40452890e12]
168
+ - @redocly/theme@0.68.0-next.7
169
+ - @redocly/graphql-docs@1.13.0-next.10
170
+ - @redocly/openapi-docs@3.24.0-next.10
171
+ - @redocly/asyncapi-docs@1.13.0-next.10
172
+ - @redocly/portal-legacy-ui@0.19.0-next.0
173
+ - @redocly/api-docs@0.1.0-next.3
174
+ - @redocly/portal-plugin-mock-server@0.21.0-next.10
175
+
176
+ ## 0.136.0-next.10
177
+
178
+ ### Patch Changes
179
+
180
+ - 644ad7258df: Updated `@redocly/openapi-core` to version `2.44.2`.
181
+ - 0e5563a12cf: Fixed rate limit enforcement for the experimental gateway to work correctly across server instances.
182
+ - 53d6f713324: Fixed an issue in API docs where links to schema definitions inside operations were displayed as regular text instead of links.
183
+ - Updated dependencies [644ad7258df]
184
+ - Updated dependencies [53d6f713324]
185
+ - @redocly/api-docs@0.1.0-next.2
186
+ - @redocly/openapi-docs@3.24.0-next.9
187
+ - @redocly/realm-asyncapi-sdk@0.14.0-next.3
188
+ - @redocly/theme@0.68.0-next.6
189
+ - @redocly/portal-plugin-mock-server@0.21.0-next.9
190
+ - @redocly/asyncapi-docs@1.13.0-next.9
191
+ - @redocly/graphql-docs@1.13.0-next.9
192
+
193
+ ## 0.136.0-next.9
194
+
195
+ ### Patch Changes
196
+
197
+ - 8a7207311bf: Improved credential handling and rate limiting in the experimental gateway MCP.
198
+ - 9310f9f2f61: Fixed an issue in the Typesense search engine where search requests failed with a 500 error when the query matched an API reference parameter whose search highlight did not include a deep link.
199
+ - 807da14929c: Updated the project MCP server to the official MCP TypeScript SDK v2.
200
+
201
+ Added support for the 2026-07-28 MCP protocol revision, including secure upstream API credential prompts for clients on the new revision.
202
+ Existing MCP clients keep working unchanged.
203
+
204
+ - 807da14929c: Fixed intermittent `Session not found` errors from the MCP server.
205
+ - 5201784becc: Fixed security vulnerabilities `CVE-2026-69207` by upgrading `hono` to version `4.12.34`.
206
+ - Updated dependencies [425dcb52e77]
207
+ - Updated dependencies [eeb60efed5a]
208
+ - Updated dependencies [f585e1a2be9]
209
+ - @redocly/api-docs@0.1.0-next.1
210
+ - @redocly/realm-asyncapi-sdk@0.14.0-next.2
211
+ - @redocly/theme@0.68.0-next.5
212
+ - @redocly/openapi-docs@3.24.0-next.8
213
+ - @redocly/asyncapi-docs@1.13.0-next.8
214
+ - @redocly/graphql-docs@1.13.0-next.8
215
+ - @redocly/portal-plugin-mock-server@0.21.0-next.8
216
+
3
217
  ## 0.136.0-next.8
4
218
 
5
219
  ### Patch Changes
@@ -164,6 +378,13 @@
164
378
  - @redocly/graphql-docs@1.13.0-next.0
165
379
  - @redocly/portal-plugin-mock-server@0.21.0-next.0
166
380
 
381
+ ## 0.135.2
382
+
383
+ ### Patch Changes
384
+
385
+ - c6f35a51db4: Hardened access control of `llms.txt` on the homepage Markdown page.
386
+ - c6f35a51db4: Improved response time on sites with many pages that use the `llms.txt` feature.
387
+
167
388
  ## 0.135.1
168
389
 
169
390
  ### Patch Changes
@@ -1 +1 @@
1
- import*as t from"react";import{useEffect as c,useMemo as u,useState as g,Suspense as h}from"react";import{Outlet as P,useLocation as S,useNavigate as D}from"react-router-dom";import{withoutPathPrefix as T}from"@redocly/theme/core/utils";import{useThemeConfig as v}from"@redocly/theme/core/hooks";import{InternalServerErrorLayout as L}from"@redocly/theme/layouts/InternalServerErrorLayout";import{RootLayout as C}from"@redocly/theme/layouts/RootLayout";import{PageLayout as y}from"@redocly/theme/layouts/PageLayout";import{components as R}from"@redocly/theme/markdoc/default";import{Sidebar as _}from"./app/Sidebar/Sidebar";import{loadAndNavigate as I}from"./app/utils/loadAndNavigate";import{useActions as N}from"./app/Sidebar/useActions";import{useScrollTracker as O}from"./app/hooks/useScrollTracker";import{useAutoScroll as A}from"./app/hooks/useAutoScroll";import{API_DOCS_TEMPLATE_ID as f}from"../constants/common";import{removeTrailingSlash as k}from"../utils/url/remove-trailing-slash";import{removeLeadingSlash as M}from"../utils/url/remove-leading-slash";import*as b from"./app/markdoc/custom-components/index";import{DefaultStyles as x}from"./styling/default-styles";import{ThemeDataProvider as B}from"./providers/theme/ThemeDataProvider";import{PageDataContext as G}from"./providers/page-data/PageDataContext";import{SeoTags as V}from"./app/seo/SeoTags";import{useRouterForLocalLinks as F,useRunningEnvironmentCheck as w}from"./providers/hooks";import{usePageData as U,usePageDataLoader as j}from"./providers/page-data/hooks";import{ErrorBoundary as q}from"./ErrorBoundary";import{ErrorDetails as E,Loader as z}from"./server-entry";import"@styles";import{useRouteChangeTracker as H}from"./app/hooks/useRouteChangeTracker";import{isInIframe as J}from"./utils";import{useL10n as K}from"./app/l10n";import{PostMessageProvider as Q}from"./providers/post-message/PostMessageProvider";import{ScriptLoader as W}from"./ScriptLoader";import{clientRoutes as X}from"./runtime/generated/routes.js";import{DevModeFloatingBar as Y}from"./app/DevModeFloatingBar";import{usePageTimeTracker as Z}from"./app/hooks/usePageTimeTracker";import{useMarkdocRenderer as $}from"./app/hooks/markdown/useMarkdocRenderer";globalThis.__LOADER.markdocComponents={...b,...R};function Be(){const e=j(),[n,a]=g(e),o=S(),m=D();K();const l=t.useMemo(()=>function(){const{palette:s}=v();return t.createElement(x,{palette:s})},[]);c(()=>{e?a(e):I({navigate:m,to:o.pathname+o.search+o.hash}).then(()=>a(z.loadSync(o.pathname)))},[o,m]),F();const r=w();return r?(console.log(r),t.createElement(E,{error:{message:r,name:""}})):n?t.createElement(q,null,t.createElement(G.Provider,{value:e||n},t.createElement(B,null,t.createElement(l,null),t.createElement(Q,{enabled:process.env.NODE_ENV==="development"||J()},t.createElement(P,null))))):null}function ee(){return A(),null}function d(){H(),Z(),O();const e=U(),n=N(),{layout:a}=n,o=u(()=>({layout:a}),[a]),m=process.env.NODE_ENV!=="production",l=globalThis.SSR_OMIT_SUSPENSE,r=$(e?.props?.ast),p=k(e?.slug||"");c(()=>{document.documentElement.classList.add("ready")},[]);const s=u(()=>[f].includes(e?.templateId??"")?{...e?.props,apiOptions:o}:e?.props,[e?.props,e?.templateId,o]);if(e?.props.pagePropGetterError?.message)return m?t.createElement(E,{error:{...e?.props?.pagePropGetterError}}):t.createElement(L,null);if(!!e?.props?.compilationErrors?.length)return e?.Template?t.createElement(e.Template,{pageProps:e?.props,children:r}):null;const i=()=>t.createElement(C,null,e?.templateId!==f&&t.createElement(ee,null),t.createElement(y,{sidebar:t.createElement(_,{layoutControls:n})},t.createElement(V,{seo:e?.props.seo,slug:p}),e?.Template&&s?t.createElement(e.Template,{pageProps:s,children:r}):null),process.env.NODE_ENV!=="production"&&t.createElement(Y,null),t.createElement(W,null));return l?i():t.createElement(h,null,i())}const Ge=[...X.map(e=>({Component:d,path:M(T(e).substring(1)+"/*")})),{Component:d,path:"*"}];export{Be as App,d as Page,Ge as routes};
1
+ import*as t from"react";import{Outlet as g,useLocation as h,useNavigate as P}from"react-router";import{useEffect as c,useMemo as u,useState as S,Suspense as D}from"react";import{withoutPathPrefix as T}from"@redocly/theme/core/utils";import{useThemeConfig as v}from"@redocly/theme/core/hooks";import{InternalServerErrorLayout as L}from"@redocly/theme/layouts/InternalServerErrorLayout";import{RootLayout as C}from"@redocly/theme/layouts/RootLayout";import{PageLayout as y}from"@redocly/theme/layouts/PageLayout";import{components as R}from"@redocly/theme/markdoc/default";import{Sidebar as _}from"./app/Sidebar/Sidebar";import{loadAndNavigate as I}from"./app/utils/loadAndNavigate";import{useActions as N}from"./app/Sidebar/useActions";import{useScrollTracker as O}from"./app/hooks/useScrollTracker";import{useAutoScroll as A}from"./app/hooks/useAutoScroll";import{API_DOCS_TEMPLATE_ID as f}from"../constants/common";import{removeTrailingSlash as k}from"../utils/url/remove-trailing-slash";import{removeLeadingSlash as M}from"../utils/url/remove-leading-slash";import*as b from"./app/markdoc/custom-components/index";import{DefaultStyles as x}from"./styling/default-styles";import{ThemeDataProvider as B}from"./providers/theme/ThemeDataProvider";import{PageDataContext as G}from"./providers/page-data/PageDataContext";import{SeoTags as V}from"./app/seo/SeoTags";import{useRouterForLocalLinks as F,useRunningEnvironmentCheck as w}from"./providers/hooks";import{usePageData as U,usePageDataLoader as j}from"./providers/page-data/hooks";import{ErrorBoundary as q}from"./ErrorBoundary";import{ErrorDetails as E,Loader as z}from"./server-entry";import"@styles";import{useRouteChangeTracker as H}from"./app/hooks/useRouteChangeTracker";import{isInIframe as J}from"./utils";import{useL10n as K}from"./app/l10n";import{PostMessageProvider as Q}from"./providers/post-message/PostMessageProvider";import{ScriptLoader as W}from"./ScriptLoader";import{clientRoutes as X}from"./runtime/generated/routes.js";import{DevModeFloatingBar as Y}from"./app/DevModeFloatingBar";import{usePageTimeTracker as Z}from"./app/hooks/usePageTimeTracker";import{useMarkdocRenderer as $}from"./app/hooks/markdown/useMarkdocRenderer";globalThis.__LOADER.markdocComponents={...b,...R};function Be(){const e=j(),[n,a]=S(e),o=h(),m=P();K();const l=t.useMemo(()=>function(){const{palette:s}=v();return t.createElement(x,{palette:s})},[]);c(()=>{e?a(e):I({navigate:m,to:o.pathname+o.search+o.hash}).then(()=>a(z.loadSync(o.pathname)))},[o,m]),F();const r=w();return r?(console.log(r),t.createElement(E,{error:{message:r,name:""}})):n?t.createElement(q,null,t.createElement(G.Provider,{value:e||n},t.createElement(B,null,t.createElement(l,null),t.createElement(Q,{enabled:process.env.NODE_ENV==="development"||J()},t.createElement(g,null))))):null}function ee(){return A(),null}function d(){H(),Z(),O();const e=U(),n=N(),{layout:a}=n,o=u(()=>({layout:a}),[a]),m=process.env.NODE_ENV!=="production",l=globalThis.SSR_OMIT_SUSPENSE,r=$(e?.props?.ast),p=k(e?.slug||"");c(()=>{document.documentElement.classList.add("ready")},[]);const s=u(()=>[f].includes(e?.templateId??"")?{...e?.props,apiOptions:o}:e?.props,[e?.props,e?.templateId,o]);if(e?.props.pagePropGetterError?.message)return m?t.createElement(E,{error:{...e?.props?.pagePropGetterError}}):t.createElement(L,null);if(!!e?.props?.compilationErrors?.length)return e?.Template?t.createElement(e.Template,{pageProps:e?.props,children:r}):null;const i=()=>t.createElement(C,null,e?.templateId!==f&&t.createElement(ee,null),t.createElement(y,{sidebar:t.createElement(_,{layoutControls:n})},t.createElement(V,{seo:e?.props.seo,slug:p}),e?.Template&&s?t.createElement(e.Template,{pageProps:s,children:r}):null),process.env.NODE_ENV!=="production"&&t.createElement(Y,null),t.createElement(W,null));return l?i():t.createElement(D,null,i())}const Ge=[...X.map(e=>({Component:d,path:M(T(e).substring(1)+"/*")})),{Component:d,path:"*"}];export{Be as App,d as Page,Ge as routes};
@@ -1 +1 @@
1
- import{useEffect as f}from"react";import{useLocation as m}from"react-router-dom";let i=[],c=[];const s=new Map;let p=null;function E(t,e=!1,n){e?i.push({content:t,attributes:n}):i.push({src:t,attributes:n})}function P(t,e){t&&c.push({src:t,attributes:e})}function x(){return p||Promise.resolve()}function A(){const t=m();return f(()=>{p=new Promise(e=>{y(i).then(()=>{const n=h(c);return c=[],n}).then(()=>{e()}),i=[]})},[t.pathname]),null}function a(t,e){const n=s.get(t);if(n)return n;const o=new Promise((u,d)=>{const r=document.createElement("script");r.src=t,l(r,e),r.addEventListener("load",()=>u()),r.addEventListener("error",()=>d(`Error loading script: ${t}`)),document.body.appendChild(r)});return s.set(t,o),o}function S(t,e){return new Promise(n=>{const o=document.createElement("script");o.textContent=t,l(o,e),document.body.appendChild(o),n()})}async function y(t){for(const e of t)"src"in e?await a(e.src,e.attributes):"content"in e&&await S(e.content,e.attributes)}async function h(t){return Promise.allSettled(t.map(({src:e,attributes:n})=>a(e,n)))}function l(t,e){e&&Object.entries(e).forEach(([n,o])=>{typeof o=="boolean"?o&&t.setAttribute(n,""):t.setAttribute(n,o)})}export{A as ScriptLoader,P as loadScriptFromReactAsync,E as loadScriptFromReactSync,x as waitForContentScripts};
1
+ import{useEffect as f}from"react";import{useLocation as m}from"react-router";let i=[],c=[];const s=new Map;let p=null;function E(t,e=!1,n){e?i.push({content:t,attributes:n}):i.push({src:t,attributes:n})}function P(t,e){t&&c.push({src:t,attributes:e})}function x(){return p||Promise.resolve()}function A(){const t=m();return f(()=>{p=new Promise(e=>{y(i).then(()=>{const n=h(c);return c=[],n}).then(()=>{e()}),i=[]})},[t.pathname]),null}function a(t,e){const n=s.get(t);if(n)return n;const o=new Promise((u,d)=>{const r=document.createElement("script");r.src=t,l(r,e),r.addEventListener("load",()=>u()),r.addEventListener("error",()=>d(`Error loading script: ${t}`)),document.body.appendChild(r)});return s.set(t,o),o}function S(t,e){return new Promise(n=>{const o=document.createElement("script");o.textContent=t,l(o,e),document.body.appendChild(o),n()})}async function y(t){for(const e of t)"src"in e?await a(e.src,e.attributes):"content"in e&&await S(e.content,e.attributes)}async function h(t){return Promise.allSettled(t.map(({src:e,attributes:n})=>a(e,n)))}function l(t,e){e&&Object.entries(e).forEach(([n,o])=>{typeof o=="boolean"?o&&t.setAttribute(n,""):t.setAttribute(n,o)})}export{A as ScriptLoader,P as loadScriptFromReactAsync,E as loadScriptFromReactSync,x as waitForContentScripts};
@@ -1 +1 @@
1
- import e from"react";import{BrowserRouter as o}from"react-router-dom";import{ThemeDataContext as n,SearchSessionProvider as i}from"@redocly/theme/core/contexts";import u from"@redocly/theme/core/templates/Markdown";import{useAnchorPositioning as m,useBreadcrumbs as d,useBanner as l,useCatalogClassic as c,useCurrentProduct as p,useGlobalData as g,useI18n as h,useI18nConfig as f,useL10n as T,useL10nConfig as b,usePageData as C,usePageSharedData as k,usePageVersions as v,usePreloadHistory as P,useProducts as w,useUserMenu as y,useSubmitFeedback as S,useTranslate as D,useTranslationKeys as $,useSidebarSiblingsData as E,usePageProps as I,useUserTeams as L,useMarkdownText as M,useMarkdocRenderer as x,useCodeHighlight as F,useLoadAndNavigate as H,useCatalog as R,useCatalogSort as A,useCatalogSearch as B,useFetchCatalogEntities as G,useFetchCatalogEntitiesRelations as O,useTelemetry as r,useMcpData as U,useFetchCatalogEntityRevisions as K}from"./app/hooks";import{Link as N}from"./app/Link";import{useFacetQuery as Q,useSearch as V,useAiSearch as j}from"./app/search";import{useSidebarItems as q}from"./app/Sidebar/useSidebarItems";import{PageDataContext as z}from"./providers/page-data/PageDataContext";const s={Template:({pageProps:a,children:t})=>e.createElement(u,{pageProps:{...a,metadata:{...a.metadata,markdoc:{tagList:[]}}}},t),templateId:"markdown",isPublic:!0,props:{seo:{title:"Test"},ast:{$$mdtype:"Tag",name:"div",children:[{$$mdtype:"Tag",name:"Heading",attributes:{id:"github-flavored-markdown",level:1},children:["GitHub-flavored markdown"]},{$$mdtype:"Tag",name:"p",attributes:{},children:["These exercises assume you have",{$$mdtype:"Tag",name:"a",attributes:{href:"https://docs.redoc.ly/"},children:["basic markdown knowledge"]},"."]},{$$mdtype:"Tag",name:"Heading",attributes:{id:"create-a-new-plain-markdown-page",level:2},children:["Create a new plain markdown page"]}]},lastModified:new Date("2022-01-01").toISOString()},slug:"",userData:{isAuthenticated:!1,name:"test name",picture:""},sidebar:null,sharedData:{},sharedDataIds:{}},J={useAnchorPositioning:m,useBreadcrumbs:d,useBanner:l,useCatalog:R,useCatalogSort:A,useCatalogSearch:B,useFetchCatalogEntities:G,useFetchCatalogEntitiesRelations:O,useFetchCatalogEntityRevisions:K,useCatalogClassic:c,useCurrentProduct:p,useGlobalData:g,useSearch:V,useAiSearch:j,useFacetQuery:Q,useI18n:h,useI18nConfig:f,useL10n:T,useL10nConfig:b,usePageData:C,usePageSharedData:k,usePageVersions:v,usePreloadHistory:P,useProducts:w,useUserMenu:y,useSidebarItems:q,useSidebarSiblingsData:E,useSubmitFeedback:S,useTranslate:D,useTranslationKeys:$,useUserTeams:L,usePageProps:I,useMarkdownText:M,useMarkdocRenderer:x,useCodeHighlight:F,useLoadAndNavigate:H,useTelemetry:r,useOtelTelemetry:r,useMcpData:U},W={LinkComponent:N},X={hooks:J,components:W,config:{}};function ne({children:a,customPageData:t}){return e.createElement(o,null,e.createElement(i,null,e.createElement(z.Provider,{value:{...s,...t,props:{...s.props,...t?.props}}},e.createElement(n.Provider,{value:X},a))))}export{ne as TestProvider};
1
+ import e from"react";import{BrowserRouter as o}from"react-router";import{ThemeDataContext as n,SearchSessionProvider as i}from"@redocly/theme/core/contexts";import u from"@redocly/theme/core/templates/Markdown";import{useAnchorPositioning as m,useBreadcrumbs as d,useBanner as l,useCatalogClassic as c,useCurrentProduct as p,useGlobalData as g,useI18n as h,useI18nConfig as f,useL10n as T,useL10nConfig as b,usePageData as C,usePageSharedData as k,usePageVersions as v,usePreloadHistory as P,useProducts as w,useUserMenu as y,useSubmitFeedback as S,useTranslate as D,useTranslationKeys as $,useSidebarSiblingsData as E,usePageProps as I,useUserTeams as L,useMarkdownText as M,useMarkdocRenderer as x,useCodeHighlight as F,useLoadAndNavigate as H,useCatalog as R,useCatalogSort as A,useCatalogSearch as B,useFetchCatalogEntities as G,useFetchCatalogEntitiesRelations as O,useTelemetry as r,useMcpData as U,useFetchCatalogEntityRevisions as K}from"./app/hooks";import{Link as N}from"./app/Link";import{useFacetQuery as Q,useSearch as V,useAiSearch as j}from"./app/search";import{useSidebarItems as q}from"./app/Sidebar/useSidebarItems";import{PageDataContext as z}from"./providers/page-data/PageDataContext";const s={Template:({pageProps:a,children:t})=>e.createElement(u,{pageProps:{...a,metadata:{...a.metadata,markdoc:{tagList:[]}}}},t),templateId:"markdown",isPublic:!0,props:{seo:{title:"Test"},ast:{$$mdtype:"Tag",name:"div",children:[{$$mdtype:"Tag",name:"Heading",attributes:{id:"github-flavored-markdown",level:1},children:["GitHub-flavored markdown"]},{$$mdtype:"Tag",name:"p",attributes:{},children:["These exercises assume you have",{$$mdtype:"Tag",name:"a",attributes:{href:"https://docs.redoc.ly/"},children:["basic markdown knowledge"]},"."]},{$$mdtype:"Tag",name:"Heading",attributes:{id:"create-a-new-plain-markdown-page",level:2},children:["Create a new plain markdown page"]}]},lastModified:new Date("2022-01-01").toISOString()},slug:"",userData:{isAuthenticated:!1,name:"test name",picture:""},sidebar:null,sharedData:{},sharedDataIds:{}},J={useAnchorPositioning:m,useBreadcrumbs:d,useBanner:l,useCatalog:R,useCatalogSort:A,useCatalogSearch:B,useFetchCatalogEntities:G,useFetchCatalogEntitiesRelations:O,useFetchCatalogEntityRevisions:K,useCatalogClassic:c,useCurrentProduct:p,useGlobalData:g,useSearch:V,useAiSearch:j,useFacetQuery:Q,useI18n:h,useI18nConfig:f,useL10n:T,useL10nConfig:b,usePageData:C,usePageSharedData:k,usePageVersions:v,usePreloadHistory:P,useProducts:w,useUserMenu:y,useSidebarItems:q,useSidebarSiblingsData:E,useSubmitFeedback:S,useTranslate:D,useTranslationKeys:$,useUserTeams:L,usePageProps:I,useMarkdownText:M,useMarkdocRenderer:x,useCodeHighlight:F,useLoadAndNavigate:H,useTelemetry:r,useOtelTelemetry:r,useMcpData:U},W={LinkComponent:N},X={hooks:J,components:W,config:{}};function ne({children:a,customPageData:t}){return e.createElement(o,null,e.createElement(i,null,e.createElement(z.Provider,{value:{...s,...t,props:{...s.props,...t?.props}}},e.createElement(n.Provider,{value:X},a))))}export{ne as TestProvider};
@@ -1 +1 @@
1
- import*as s from"react";import u from"path";import{Link as U,useNavigate as z,useLocation as F}from"react-router-dom";import{getPathnameForLocale as M,withPathPrefix as W}from"@redocly/theme/core/utils";import{removeTrailingSlash as I}from"../../utils/url/remove-trailing-slash";import{normalizeRouteSlug as h}from"../../utils/path/normalize-route-slug";import{isAbsoluteUrl as V}from"../../utils/url/is-absolute-url";import{isAssetsLink as j}from"../../utils/path/is-assets-link";import{useL10nConfig as q}from"./hooks/index.js";import{loadAndNavigate as B}from"./utils/loadAndNavigate.js";import{isForcedNavigationLinkClick as G}from"../utils/utils.js";async function g(o,t){if(V(o))return;await(typeof window<"u"?window:global).__LOADER.tryLoad(o,void 0,t)}function oe(o){const{to:t,children:l,className:v,style:a,innerRef:i,target:L,external:c,languageInsensitive:w,onClick:m,active:H,rel:y,reloadDocument:k,preventScrollReset:R,relative:P,viewTransition:C,state:E,replace:N,..._}=o,x=L||(c?"_blank":"_self"),A=c||t.match(/^(https?:\/\/|mailto:)/),f=y||(A?"noreferrer":void 0),n={className:v,children:l,target:x,...f&&{rel:f},onClick:m,..._},{defaultLocale:D,locales:S,currentLocale:b}=q(),O=F();let e=t;e.startsWith(".")&&(e=u.resolve(u.dirname(h(O.pathname)),h(t))),e=e.startsWith("#")?e:W(w?e:M(e,D,b,S));const r=e!=="/"?I(e):e,T=z(),d=typeof window<"u"?new URL(r,window.location.origin+window.location.pathname).search:void 0;return typeof t=="string"&&t.match(/^(https?:\/\/|mailto:)/)?s.createElement("a",{...n,ref:i,style:a,href:t,onMouseOver:async()=>g(t,d)}):j(r)?s.createElement("a",{...n,ref:i,style:a,href:r}):s.createElement(U,{...n,ref:i,style:a,to:r,reloadDocument:k,preventScrollReset:R,relative:P,viewTransition:C,state:E,replace:N,onClick:p=>{m?.(),!G(p,n.target)&&(p.preventDefault(),B({navigate:T,to:r}))},onMouseOver:async()=>g(r,d)})}export{oe as Link};
1
+ import*as s from"react";import u from"path";import{Link as U,useNavigate as z,useLocation as F}from"react-router";import{getPathnameForLocale as M,withPathPrefix as W}from"@redocly/theme/core/utils";import{removeTrailingSlash as I}from"../../utils/url/remove-trailing-slash";import{normalizeRouteSlug as h}from"../../utils/path/normalize-route-slug";import{isAbsoluteUrl as V}from"../../utils/url/is-absolute-url";import{isAssetsLink as j}from"../../utils/path/is-assets-link";import{useL10nConfig as q}from"./hooks/index.js";import{loadAndNavigate as B}from"./utils/loadAndNavigate.js";import{isForcedNavigationLinkClick as G}from"../utils/utils.js";async function g(o,t){if(V(o))return;await(typeof window<"u"?window:global).__LOADER.tryLoad(o,void 0,t)}function oe(o){const{to:t,children:l,className:v,style:a,innerRef:i,target:L,external:c,languageInsensitive:w,onClick:m,active:H,rel:y,reloadDocument:k,preventScrollReset:R,relative:P,viewTransition:C,state:E,replace:N,..._}=o,x=L||(c?"_blank":"_self"),A=c||t.match(/^(https?:\/\/|mailto:)/),f=y||(A?"noreferrer":void 0),n={className:v,children:l,target:x,...f&&{rel:f},onClick:m,..._},{defaultLocale:D,locales:S,currentLocale:b}=q(),O=F();let e=t;e.startsWith(".")&&(e=u.resolve(u.dirname(h(O.pathname)),h(t))),e=e.startsWith("#")?e:W(w?e:M(e,D,b,S));const r=e!=="/"?I(e):e,T=z(),d=typeof window<"u"?new URL(r,window.location.origin+window.location.pathname).search:void 0;return typeof t=="string"&&t.match(/^(https?:\/\/|mailto:)/)?s.createElement("a",{...n,ref:i,style:a,href:t,onMouseOver:async()=>g(t,d)}):j(r)?s.createElement("a",{...n,ref:i,style:a,href:r}):s.createElement(U,{...n,ref:i,style:a,to:r,reloadDocument:k,preventScrollReset:R,relative:P,viewTransition:C,state:E,replace:N,onClick:p=>{m?.(),!G(p,n.target)&&(p.preventDefault(),B({navigate:T,to:r}))},onMouseOver:async()=>g(r,d)})}export{oe as Link};
@@ -1 +1 @@
1
- import{useMemo as k}from"react";import{useLocation as T}from"react-router-dom";import{useThemeConfig as y}from"@redocly/theme/core/hooks";import{withoutPathPrefix as K}from"@redocly/theme/core/utils";import{usePageVersions as g,useTranslate as v,usePageSharedData as d}from"../hooks";import{useSidebarItems as x}from"./useSidebarItems";function D(){const a=d("sidebar")?.relatedNavbarItem,n=d("current-catalog-info"),r=y(),{translate:l}=v(),{versions:e=[]}=g()||{},c=e.find(m=>m?.active),{allSidebarItems:i}=x(c),t=T().pathname,o=n?.item,s=n?.catalog,b=r.breadcrumbs?.prefixItems,f=r.breadcrumbs?.hide;return k(()=>{const m=B({allSidebarItems:i,pathname:K(t),catalogItemInfo:o,relatedNavbarItem:a,catalogInfo:s,prefixItems:b,hide:f,translate:l}),p=S(i,m);return{breadcrumbs:m,currentItemSiblings:p}},[t,a,i,o,s,b,f,l])}const B=({allSidebarItems:a=[],pathname:n,catalogItemInfo:r,relatedNavbarItem:l,catalogInfo:e,prefixItems:c,hide:i,translate:u})=>{if(i===!0)return[];const t=h(a);if(t.length===0)return[];if(r){const o=t[t.length-1];o&&o.label!==r.label&&t.unshift({label:r.label,link:r.link})}if(l&&l.label!==t[0].label&&t.unshift(l),e&&t.unshift({label:u(e.labelTranslationKey,e.label),labelTranslationKey:e.labelTranslationKey,link:e.link,icon:e.icon}),c?.length){const o=c.map(s=>({label:u(s.labelTranslationKey,s.label),labelTranslationKey:s.labelTranslationKey,link:s.link,icon:s.icon}));t.unshift(...o)}return t.length===1&&(!t[0]?.link||t[0]?.link===n)?[]:t},S=(a,n)=>{if(n.length===0)return[];const r=(e,c)=>{for(const i of e){if(i.active)return{item:i,parent:c};if(i.items?.length){const u=r(i.items,i);if(u)return u}}},l=r(a);return l?.parent?l.parent.items?.filter(e=>!!(e.link&&e.link!==l.item.link&&e.label)).map(e=>({label:e.label,labelTranslationKey:e.labelTranslationKey,link:e.link,icon:e.icon}))||[]:[]},h=a=>{const n=a.find(({active:l,hasActiveSubItem:e})=>l||e);if(!n?.label)return[];const r={label:n.label,labelTranslationKey:n.labelTranslationKey,link:n.link,icon:n.icon};return n.type==="group"&&n.selectFirstItemOnExpand&&n.items?.[0]?.link&&(r.link=n.items[0].link),n.items?.length||(r.link=void 0),[r,...h(n.items||[])]};export{B as generateBreadcrumbs,S as generateSiblings,D as useBreadcrumbs};
1
+ import{useMemo as k}from"react";import{useLocation as T}from"react-router";import{useThemeConfig as y}from"@redocly/theme/core/hooks";import{withoutPathPrefix as K}from"@redocly/theme/core/utils";import{usePageVersions as g,useTranslate as v,usePageSharedData as d}from"../hooks";import{useSidebarItems as x}from"./useSidebarItems";function D(){const a=d("sidebar")?.relatedNavbarItem,n=d("current-catalog-info"),r=y(),{translate:l}=v(),{versions:e=[]}=g()||{},c=e.find(m=>m?.active),{allSidebarItems:i}=x(c),t=T().pathname,o=n?.item,s=n?.catalog,b=r.breadcrumbs?.prefixItems,f=r.breadcrumbs?.hide;return k(()=>{const m=B({allSidebarItems:i,pathname:K(t),catalogItemInfo:o,relatedNavbarItem:a,catalogInfo:s,prefixItems:b,hide:f,translate:l}),p=S(i,m);return{breadcrumbs:m,currentItemSiblings:p}},[t,a,i,o,s,b,f,l])}const B=({allSidebarItems:a=[],pathname:n,catalogItemInfo:r,relatedNavbarItem:l,catalogInfo:e,prefixItems:c,hide:i,translate:u})=>{if(i===!0)return[];const t=h(a);if(t.length===0)return[];if(r){const o=t[t.length-1];o&&o.label!==r.label&&t.unshift({label:r.label,link:r.link})}if(l&&l.label!==t[0].label&&t.unshift(l),e&&t.unshift({label:u(e.labelTranslationKey,e.label),labelTranslationKey:e.labelTranslationKey,link:e.link,icon:e.icon}),c?.length){const o=c.map(s=>({label:u(s.labelTranslationKey,s.label),labelTranslationKey:s.labelTranslationKey,link:s.link,icon:s.icon}));t.unshift(...o)}return t.length===1&&(!t[0]?.link||t[0]?.link===n)?[]:t},S=(a,n)=>{if(n.length===0)return[];const r=(e,c)=>{for(const i of e){if(i.active)return{item:i,parent:c};if(i.items?.length){const u=r(i.items,i);if(u)return u}}},l=r(a);return l?.parent?l.parent.items?.filter(e=>!!(e.link&&e.link!==l.item.link&&e.label)).map(e=>({label:e.label,labelTranslationKey:e.labelTranslationKey,link:e.link,icon:e.icon}))||[]:[]},h=a=>{const n=a.find(({active:l,hasActiveSubItem:e})=>l||e);if(!n?.label)return[];const r={label:n.label,labelTranslationKey:n.labelTranslationKey,link:n.link,icon:n.icon};return n.type==="group"&&n.selectFirstItemOnExpand&&n.items?.[0]?.link&&(r.link=n.items[0].link),n.items?.length||(r.link=void 0),[r,...h(n.items||[])]};export{B as generateBreadcrumbs,S as generateSiblings,D as useBreadcrumbs};
@@ -1 +1 @@
1
- import{useLocation as _}from"react-router-dom";import{useEffect as k,useMemo as S,useState as b}from"react";import{useActiveSectionId as D}from"@redocly/theme/core/hooks";import{getMenuItemType as v}from"@redocly/theme/core/utils";import{MenuItemType as C}from"@redocly/theme/core/constants";import{CATALOG_BASE_SLUG as T,CATALOG_SLUGS as h}from"../../../constants/catalog-entities";import{usePageSharedData as y,useSidebarItemsData as G,useSidebarConnectedCatalogConfig as E,useSidebarConnectedCatalogEntity as O}from"../../providers/page-data/hooks";import{mapItemsPropsToState as g}from"./utils";import{injectCatalogItems as K}from"../../utils/catalog/inject-catalog-items";import{filterOutVersionedItems as B}from"./helpers/filter-out-versioned-items";const M="catalog.backToAllLabel",P=`${T}/${h.ALL}`;function U(n){const e=G();return S(()=>B(e,n),[e,n])}function J(n){const e=_(),t=D(e,!0),a=O(),p=E(),s=U(n),c=a?K(s,a.key,p?.slug,e.search):s,[u,I]=b(null),r=S(()=>g(c,e,t),[t,e,c]),l=y("current-catalog-info"),L=S(()=>f(r),[c]),[o,m]=b(L),i=o.length>0?o[o.length-1]:void 0,A=i&&g([...i.item.link?[{...i.item,items:[],menuStyle:void 0,separatorLine:!1}]:[],...i.item.items],e,t);k(()=>{if(!u||u!==t){const d=f(r);m(d),I(t)}},[s,e,t,u]);const w=i?{slug:i.previousLink,event:"sidebar_drilldown_back_button.clicked"}:a?{label:"Back to Catalog",labelTranslationKey:M,slug:P,event:"back_to_catalog_button.clicked"}:l?{label:l.catalog.label,labelTranslationKey:l.catalog.labelTranslationKey,slug:l.catalog.link,event:"back_to_catalog_button.clicked"}:void 0;return{currentItems:A||r,allSidebarItems:r,popDrilldownState:()=>{o.length>0&&m(o.slice(0,o.length-1))},pushDrilldownState:d=>{m([...o,d])},backLink:w,versionLabel:a?.version??null}}function f(n,e=[]){for(const t of n){if(!t.active&&!t.hasActiveSubItem)continue;if(v(t)===C.DrillDown&&e.push({item:t}),t.active)return e;if(t.hasActiveSubItem)return f(t.items,e)}return e}export{U as useRawSidebarItems,J as useSidebarItems};
1
+ import{useLocation as _}from"react-router";import{useEffect as k,useMemo as S,useState as b}from"react";import{useActiveSectionId as D}from"@redocly/theme/core/hooks";import{getMenuItemType as v}from"@redocly/theme/core/utils";import{MenuItemType as C}from"@redocly/theme/core/constants";import{CATALOG_BASE_SLUG as T,CATALOG_SLUGS as h}from"../../../constants/catalog-entities";import{usePageSharedData as y,useSidebarItemsData as G,useSidebarConnectedCatalogConfig as E,useSidebarConnectedCatalogEntity as O}from"../../providers/page-data/hooks";import{mapItemsPropsToState as g}from"./utils";import{injectCatalogItems as K}from"../../utils/catalog/inject-catalog-items";import{filterOutVersionedItems as B}from"./helpers/filter-out-versioned-items";const M="catalog.backToAllLabel",P=`${T}/${h.ALL}`;function U(n){const e=G();return S(()=>B(e,n),[e,n])}function J(n){const e=_(),t=D(e,!0),a=O(),p=E(),s=U(n),c=a?K(s,a.key,p?.slug,e.search):s,[u,I]=b(null),r=S(()=>g(c,e,t),[t,e,c]),l=y("current-catalog-info"),L=S(()=>f(r),[c]),[o,m]=b(L),i=o.length>0?o[o.length-1]:void 0,A=i&&g([...i.item.link?[{...i.item,items:[],menuStyle:void 0,separatorLine:!1}]:[],...i.item.items],e,t);k(()=>{if(!u||u!==t){const d=f(r);m(d),I(t)}},[s,e,t,u]);const w=i?{slug:i.previousLink,event:"sidebar_drilldown_back_button.clicked"}:a?{label:"Back to Catalog",labelTranslationKey:M,slug:P,event:"back_to_catalog_button.clicked"}:l?{label:l.catalog.label,labelTranslationKey:l.catalog.labelTranslationKey,slug:l.catalog.link,event:"back_to_catalog_button.clicked"}:void 0;return{currentItems:A||r,allSidebarItems:r,popDrilldownState:()=>{o.length>0&&m(o.slice(0,o.length-1))},pushDrilldownState:d=>{m([...o,d])},backLink:w,versionLabel:a?.version??null}}function f(n,e=[]){for(const t of n){if(!t.active&&!t.hasActiveSubItem)continue;if(v(t)===C.DrillDown&&e.push({item:t}),t.active)return e;if(t.hasActiveSubItem)return f(t.items,e)}return e}export{U as useRawSidebarItems,J as useSidebarItems};
@@ -1,4 +1,4 @@
1
- import type { Location } from 'react-router-dom';
1
+ import type { Location } from 'react-router';
2
2
  import type { SidebarNavItem, ItemState } from '@redocly/theme/core/types';
3
3
  export declare function mapItemsPropsToState(items: SidebarNavItem[], location: Location, activeSectionId?: string): ItemState[];
4
4
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- import*as h from"react";import{useLocation as $,useNavigate as R}from"react-router-dom";import{usePageData as V,usePageSharedData as K}from"../../hooks";import{withoutHash as D,getBaseDataAttributes as w}from"@redocly/theme/core/utils";import{telemetry as A}from"../../telemetry/index.js";import{toStringIfDefined as v}from"../../../../utils/string/to-string-if-defined.js";import{findDeepFirst as _}from"../../../../utils/tree/find-deep-first.js";function re(e,o){const r=$(),i=R(),a=V(),t=G(r),s=K("catalog"),[n,p]=h.useState(()=>(e.filters??[]).map(l=>{if(l.type==="date-range"){const[c,u]=t.get(l.property)?.split("--")??[];return!c&&!u?{}:{from:c,to:u}}return new Set(t.getAll(l.property))})),[d,g]=h.useState(()=>t.get("filter")||"");o||(o=[...s]);const S=h.useMemo(()=>L(o??[],e.filters),[o,e.filters]),I=a?.props?.customFields,C=h.useMemo(()=>H(o??[],e,I||{}),[o,e,I]),b=h.useCallback((l,c)=>{p(u=>{const F=u[l]?u[l]:new Set;return F instanceof Set?(F.has(c)?u.forEach((f,m)=>{f instanceof Set&&f.has(c)&&f.delete(c)}):F.add(c),[...u.slice(0,l),F,...u.slice(l+1)]):u}),A.sendCatalogFilterChangedMessage([{...w("catalogFilter","field"),type:"toggle"}]),window.scrollTo(0,0)},[]),P=h.useCallback((l,c)=>{p(u=>{const F=u[l]instanceof Set?new Set(c?[c]:[]):{from:c?.from,to:c?.to},f=S[l];return u.map((m,y)=>y===l?F:S[y].parentFilter===f.property?new Set:m)}),A.sendCatalogFilterChangedMessage([{...w("catalogFilter","field"),type:"select"}]),window.scrollTo(0,0)},[S]),N=()=>{const l=new URLSearchParams(Array.from(t.entries()));d?t.set("filter",d):t.delete("filter"),n.forEach((u,F)=>{const f=e.filters?.[F];if(!f)return;const m=Q(u);Z(f.property,m,l)});const c=l.toString();c!==r.search.substring(1)&&i({search:c})};h.useEffect(()=>{N()},[e.filters,n,d,i,r]);const k=h.useMemo(()=>J(e.filters),[e.filters]);return h.useMemo(()=>{const l=S.map((f,m)=>({...f,toggleOption:y=>b(m,y),selectOption:y=>P(m,y),selectedOptions:n[m]??new Set,isFilterUsed:(n[m]?.size??0)>0||!!n[m]?.from})),c=T(C,l,d),u=l.map((f,m)=>{const y=l.findIndex(O=>O.property===f.parentFilter),j=f.parentFilter?(n[y]?.size??0)>0||!!n[y].from:!0,z=l.filter((O,M)=>M!==m&&!k[m]?.has(M)),B=T(C,z,d),U=L(B.map(O=>({metadata:O})),e.filters);return{...f,parentUsed:j,filteredOptions:U[m].options}});return{groups:e.groupByFirstFilter&&u.length>0?q(u,c):[{title:"APIs",items:c}],filters:u,setFilterTerm:f=>{g(f),A.sendCatalogFilterChangedMessage([{...w("catalogFilter","field"),type:"term"}])},filterTerm:d}},[S,C,d,e.groupByFirstFilter,e.filters,n,b,P,k])}function q(e,o){return e[0].options.map(r=>({title:r.value,items:o.filter(i=>{const a=i?.[e[0].property]||e[0].missingCategoryName||"Others";return Array.isArray(a)?a.includes(r.value):a===r.value})})).filter(r=>r.items.length>0)}function G(e){return h.useMemo(()=>new URLSearchParams(e.search),[e.search])}function H(e,o,r){let i;if(o.separateVersions)i=e.map(a);else{const t={};for(const s of e){if(!s.versionFolderId){const p=s.link||s.fsPath||JSON.stringify(s);t[p]=[s];continue}let n=s.versionFolderId;if(t[n]?.find(p=>p.version===s.version)){const p=s.fsPath?.replace(/\/@.*?\//,"/@version/")??"";n=`${n}-${p}`}t[n]||(t[n]=[]),t[n].push(s)}i=Object.values(t).map(s=>{s.sort((d,g)=>(d.version||"").localeCompare(g.version||""));const n=s.map(a);return{...a(s.find(d=>d.isDefault)||s[s.length-1]),versions:n}})}return i.sort((t,s)=>t.title.localeCompare(s.title)),i;function a(t){const s=t.metadata||{},n=r[t.fsPath||""]||{},p=t.link||_(t.items||[],g=>"link"in g&&!!g.link)?.link,d=t.sidebar?.[0];return{...s,...n,publishedAt:s.publishedAt||s.createdAt,title:v(s?.title)||t.label||"Untitled",description:v(s?.description),link:D(p)??"#",docsLink:D(d?.link),image:v(s?.image),version:t.version,versionFolderId:t.versionFolderId}}}function J(e){if(!e)return[];const o=[];for(let r=0;r<e.length;r++){const i=e[r];if(i.parentFilter){const a=e.findIndex(t=>t.property===i.parentFilter);o[a]=o[a]||new Set,o[a].add(r)}}return o}function L(e,o){return(o??[]).map(r=>{const i=r.options?Object.fromEntries(r.options.map(n=>[n,0])):void 0,a=i??{};let t=0;for(const n of e){const p=Array.isArray(n.metadata?.[r.property])?n.metadata?.[r.property]:[n.metadata?.[r.property]];for(const d of p){const g=E(String(d),r.valuesMapping);if(i){g in i&&(a[g]=a[g]+1);continue}d?a[g]=(a[g]??0)+1:t++}}const s=Object.entries(a).map(([n,p])=>({value:n,count:p}));return i||s.sort((n,p)=>n.value.localeCompare(p.value)),t&&s.push({value:r.missingCategoryNameTranslationKey||r.missingCategoryName||"Others",count:t}),{...r,options:s}})}function T(e,o,r){const i=e.filter(a=>o.every(t=>{if(t.selectedOptions&&!(t.selectedOptions instanceof Set))try{const n=new Date(a[t.property]).toISOString().split("T")[0];return n>=(t.selectedOptions.from??"")&&n<=(t.selectedOptions.to??"Z")}catch{return!0}if(t.selectedOptions.size===0)return!0;const s=E(a?.[t.property]||t.missingCategoryName||"Others",t.valuesMapping);return Array.isArray(s)?s.some(n=>t.selectedOptions.has(n)):t.selectedOptions.has(s)}));return r?(r=r.toLowerCase(),i.filter(a=>Object.values(a).some(t=>Array.isArray(t)?t.some(s=>String(s).toLowerCase().includes(r)):String(t).toLowerCase().includes(r)))):i}function E(e,o){return o?Array.isArray(e)?e.map(r=>o[String(r)]||r):o[String(e)]||e:e}function Z(e,o,r){r.delete(e),o.forEach(i=>{r.append(e,i)})}function Q(e){const o=new Set;return e instanceof Set?e.forEach(r=>o.add(r)):(e.from||e.to)&&o.add(`${e.from||""}--${e.to||""}`),o}export{Z as fillSearchParams,Q as getFilterValues,re as useCatalogClassic};
1
+ import*as h from"react";import{useLocation as $,useNavigate as R}from"react-router";import{usePageData as V,usePageSharedData as K}from"../../hooks";import{withoutHash as D,getBaseDataAttributes as w}from"@redocly/theme/core/utils";import{telemetry as A}from"../../telemetry/index.js";import{toStringIfDefined as v}from"../../../../utils/string/to-string-if-defined.js";import{findDeepFirst as _}from"../../../../utils/tree/find-deep-first.js";function re(e,o){const r=$(),i=R(),a=V(),t=G(r),s=K("catalog"),[n,p]=h.useState(()=>(e.filters??[]).map(l=>{if(l.type==="date-range"){const[c,u]=t.get(l.property)?.split("--")??[];return!c&&!u?{}:{from:c,to:u}}return new Set(t.getAll(l.property))})),[d,g]=h.useState(()=>t.get("filter")||"");o||(o=[...s]);const S=h.useMemo(()=>L(o??[],e.filters),[o,e.filters]),I=a?.props?.customFields,C=h.useMemo(()=>H(o??[],e,I||{}),[o,e,I]),b=h.useCallback((l,c)=>{p(u=>{const F=u[l]?u[l]:new Set;return F instanceof Set?(F.has(c)?u.forEach((f,m)=>{f instanceof Set&&f.has(c)&&f.delete(c)}):F.add(c),[...u.slice(0,l),F,...u.slice(l+1)]):u}),A.sendCatalogFilterChangedMessage([{...w("catalogFilter","field"),type:"toggle"}]),window.scrollTo(0,0)},[]),P=h.useCallback((l,c)=>{p(u=>{const F=u[l]instanceof Set?new Set(c?[c]:[]):{from:c?.from,to:c?.to},f=S[l];return u.map((m,y)=>y===l?F:S[y].parentFilter===f.property?new Set:m)}),A.sendCatalogFilterChangedMessage([{...w("catalogFilter","field"),type:"select"}]),window.scrollTo(0,0)},[S]),N=()=>{const l=new URLSearchParams(Array.from(t.entries()));d?t.set("filter",d):t.delete("filter"),n.forEach((u,F)=>{const f=e.filters?.[F];if(!f)return;const m=Q(u);Z(f.property,m,l)});const c=l.toString();c!==r.search.substring(1)&&i({search:c})};h.useEffect(()=>{N()},[e.filters,n,d,i,r]);const k=h.useMemo(()=>J(e.filters),[e.filters]);return h.useMemo(()=>{const l=S.map((f,m)=>({...f,toggleOption:y=>b(m,y),selectOption:y=>P(m,y),selectedOptions:n[m]??new Set,isFilterUsed:(n[m]?.size??0)>0||!!n[m]?.from})),c=T(C,l,d),u=l.map((f,m)=>{const y=l.findIndex(O=>O.property===f.parentFilter),j=f.parentFilter?(n[y]?.size??0)>0||!!n[y].from:!0,z=l.filter((O,M)=>M!==m&&!k[m]?.has(M)),B=T(C,z,d),U=L(B.map(O=>({metadata:O})),e.filters);return{...f,parentUsed:j,filteredOptions:U[m].options}});return{groups:e.groupByFirstFilter&&u.length>0?q(u,c):[{title:"APIs",items:c}],filters:u,setFilterTerm:f=>{g(f),A.sendCatalogFilterChangedMessage([{...w("catalogFilter","field"),type:"term"}])},filterTerm:d}},[S,C,d,e.groupByFirstFilter,e.filters,n,b,P,k])}function q(e,o){return e[0].options.map(r=>({title:r.value,items:o.filter(i=>{const a=i?.[e[0].property]||e[0].missingCategoryName||"Others";return Array.isArray(a)?a.includes(r.value):a===r.value})})).filter(r=>r.items.length>0)}function G(e){return h.useMemo(()=>new URLSearchParams(e.search),[e.search])}function H(e,o,r){let i;if(o.separateVersions)i=e.map(a);else{const t={};for(const s of e){if(!s.versionFolderId){const p=s.link||s.fsPath||JSON.stringify(s);t[p]=[s];continue}let n=s.versionFolderId;if(t[n]?.find(p=>p.version===s.version)){const p=s.fsPath?.replace(/\/@.*?\//,"/@version/")??"";n=`${n}-${p}`}t[n]||(t[n]=[]),t[n].push(s)}i=Object.values(t).map(s=>{s.sort((d,g)=>(d.version||"").localeCompare(g.version||""));const n=s.map(a);return{...a(s.find(d=>d.isDefault)||s[s.length-1]),versions:n}})}return i.sort((t,s)=>t.title.localeCompare(s.title)),i;function a(t){const s=t.metadata||{},n=r[t.fsPath||""]||{},p=t.link||_(t.items||[],g=>"link"in g&&!!g.link)?.link,d=t.sidebar?.[0];return{...s,...n,publishedAt:s.publishedAt||s.createdAt,title:v(s?.title)||t.label||"Untitled",description:v(s?.description),link:D(p)??"#",docsLink:D(d?.link),image:v(s?.image),version:t.version,versionFolderId:t.versionFolderId}}}function J(e){if(!e)return[];const o=[];for(let r=0;r<e.length;r++){const i=e[r];if(i.parentFilter){const a=e.findIndex(t=>t.property===i.parentFilter);o[a]=o[a]||new Set,o[a].add(r)}}return o}function L(e,o){return(o??[]).map(r=>{const i=r.options?Object.fromEntries(r.options.map(n=>[n,0])):void 0,a=i??{};let t=0;for(const n of e){const p=Array.isArray(n.metadata?.[r.property])?n.metadata?.[r.property]:[n.metadata?.[r.property]];for(const d of p){const g=E(String(d),r.valuesMapping);if(i){g in i&&(a[g]=a[g]+1);continue}d?a[g]=(a[g]??0)+1:t++}}const s=Object.entries(a).map(([n,p])=>({value:n,count:p}));return i||s.sort((n,p)=>n.value.localeCompare(p.value)),t&&s.push({value:r.missingCategoryNameTranslationKey||r.missingCategoryName||"Others",count:t}),{...r,options:s}})}function T(e,o,r){const i=e.filter(a=>o.every(t=>{if(t.selectedOptions&&!(t.selectedOptions instanceof Set))try{const n=new Date(a[t.property]).toISOString().split("T")[0];return n>=(t.selectedOptions.from??"")&&n<=(t.selectedOptions.to??"Z")}catch{return!0}if(t.selectedOptions.size===0)return!0;const s=E(a?.[t.property]||t.missingCategoryName||"Others",t.valuesMapping);return Array.isArray(s)?s.some(n=>t.selectedOptions.has(n)):t.selectedOptions.has(s)}));return r?(r=r.toLowerCase(),i.filter(a=>Object.values(a).some(t=>Array.isArray(t)?t.some(s=>String(s).toLowerCase().includes(r)):String(t).toLowerCase().includes(r)))):i}function E(e,o){return o?Array.isArray(e)?e.map(r=>o[String(r)]||r):o[String(e)]||e:e}function Z(e,o,r){r.delete(e),o.forEach(i=>{r.append(e,i)})}function Q(e){const o=new Set;return e instanceof Set?e.forEach(r=>o.add(r)):(e.from||e.to)&&o.add(`${e.from||""}--${e.to||""}`),o}export{Z as fillSearchParams,Q as getFilterValues,re as useCatalogClassic};
@@ -1 +1 @@
1
- import{useCallback as h,useEffect as w,useMemo as y,useState as P}from"react";import{useSearchParams as Q}from"react-router-dom";import{telemetry as b}from"../../telemetry/index.js";import{parseFilterQuery as g,formatFilterQuery as C,collectFilterOptions as U}from"../../../utils";import{getBaseDataAttributes as I}from"@redocly/theme/core/utils";function O(r){return r instanceof Set?r.size>0:!!(r?.from||r?.to)}function x(r,m){const[u,d]=Q(),o=u.get("filter")||"",[i,f]=P(()=>g(o,r?.filters||[])),p=y(()=>U(r?.filters,m),[r?.filters,m]);w(()=>{const t=r?.filters||[];if(t.length>0&&i.length!==t.length){const e=g(o,t);f(e)}},[r?.filters,i.length,o]);const F=h((t,e)=>{f(l=>l.map((s,c)=>{if(c!==t||!(s instanceof Set))return s;const n=new Set(s);return n.has(e)?n.delete(e):n.add(e),n})),window.scrollTo(0,0)},[]),S=h((t,e)=>{f(l=>l.map((a,s)=>s!==t?a:a instanceof Set?e&&typeof e=="string"?new Set([e]):new Set:{from:typeof e=="object"?e?.from:void 0,to:typeof e=="object"?e?.to:void 0})),b.sendCatalogFilterChangedMessage([{...I("catalogFilter","field"),type:"select"}]),window.scrollTo(0,0)},[]);return w(()=>{const t=new URLSearchParams(u),e=C(i,r?.filters||[]);e?t.set("filter",e):t.delete("filter"),d(t,{replace:!0})},[r?.filters,i,u,d]),y(()=>{const t=p.map((l,a)=>{const s=i[a],c=O(s);return{...l,toggleOption:n=>F(a,n),selectOption:n=>S(a,n),selectedOptions:s??new Set,isFilterUsed:c}});return{filters:t.map(l=>{const a=t.findIndex(n=>n.property===l.parentFilter),s=i[a],c=l.parentFilter?O(s):!0;return{...l,parentUsed:c}}),filterQuery:o}},[p,i,F,S,o])}export{x as useCatalogFilter};
1
+ import{useCallback as h,useEffect as w,useMemo as y,useState as P}from"react";import{useSearchParams as Q}from"react-router";import{telemetry as b}from"../../telemetry/index.js";import{parseFilterQuery as g,formatFilterQuery as C,collectFilterOptions as U}from"../../../utils";import{getBaseDataAttributes as I}from"@redocly/theme/core/utils";function O(r){return r instanceof Set?r.size>0:!!(r?.from||r?.to)}function x(r,m){const[u,d]=Q(),o=u.get("filter")||"",[i,f]=P(()=>g(o,r?.filters||[])),p=y(()=>U(r?.filters,m),[r?.filters,m]);w(()=>{const t=r?.filters||[];if(t.length>0&&i.length!==t.length){const e=g(o,t);f(e)}},[r?.filters,i.length,o]);const F=h((t,e)=>{f(l=>l.map((s,c)=>{if(c!==t||!(s instanceof Set))return s;const n=new Set(s);return n.has(e)?n.delete(e):n.add(e),n})),window.scrollTo(0,0)},[]),S=h((t,e)=>{f(l=>l.map((a,s)=>s!==t?a:a instanceof Set?e&&typeof e=="string"?new Set([e]):new Set:{from:typeof e=="object"?e?.from:void 0,to:typeof e=="object"?e?.to:void 0})),b.sendCatalogFilterChangedMessage([{...I("catalogFilter","field"),type:"select"}]),window.scrollTo(0,0)},[]);return w(()=>{const t=new URLSearchParams(u),e=C(i,r?.filters||[]);e?t.set("filter",e):t.delete("filter"),d(t,{replace:!0})},[r?.filters,i,u,d]),y(()=>{const t=p.map((l,a)=>{const s=i[a],c=O(s);return{...l,toggleOption:n=>F(a,n),selectOption:n=>S(a,n),selectedOptions:s??new Set,isFilterUsed:c}});return{filters:t.map(l=>{const a=t.findIndex(n=>n.property===l.parentFilter),s=i[a],c=l.parentFilter?O(s):!0;return{...l,parentUsed:c}}),filterQuery:o}},[p,i,F,S,o])}export{x as useCatalogFilter};
@@ -1 +1 @@
1
- import{useEffect as o,useMemo as h,useState as n}from"react";import{useSearchParams as m}from"react-router-dom";import{debounce as S}from"../../../../utils/time/debounce";function l(){const[a,s]=m(),c=a.get("search")||"",[r,t]=n(c);o(()=>{const e=new URLSearchParams(a);r?e.set("search",r):e.delete("search"),s(e,{replace:!0})},[r,a,s]);const u=h(()=>S(e=>{t(e)},500),[t]);return{searchQuery:r,setSearchQuery:u}}export{l as useCatalogSearch};
1
+ import{useEffect as o,useMemo as h,useState as n}from"react";import{useSearchParams as m}from"react-router";import{debounce as S}from"../../../../utils/time/debounce";function l(){const[a,s]=m(),c=a.get("search")||"",[r,t]=n(c);o(()=>{const e=new URLSearchParams(a);r?e.set("search",r):e.delete("search"),s(e,{replace:!0})},[r,a,s]);const u=h(()=>S(e=>{t(e)},500),[t]);return{searchQuery:r,setSearchQuery:u}}export{l as useCatalogSearch};
@@ -1 +1 @@
1
- import{useCallback as c,useEffect as m,useState as p}from"react";import{useSearchParams as f}from"react-router-dom";function O(l){const[s,a]=f(),u=s.get("sort")||null,[e,r]=p(u??l??null);m(()=>{const t=new URLSearchParams(s);e?t.set("sort",e):t.delete("sort"),a(t,{replace:!0})},[e,s,a]);const i=c((t,n)=>{const o=n==="desc"?t:`-${t}`;r(e===o?null:o)},[e,r]),S=c((t,n)=>{if(!t||!e)return!1;const o=n==="desc"?t:`-${t}`;return e===o},[e]);return{sortOption:e,setSortOption:r,handleSortClick:i,isColumnSorted:S}}export{O as useCatalogSort};
1
+ import{useCallback as c,useEffect as m,useState as p}from"react";import{useSearchParams as f}from"react-router";function O(l){const[s,a]=f(),u=s.get("sort")||null,[e,r]=p(u??l??null);m(()=>{const t=new URLSearchParams(s);e?t.set("sort",e):t.delete("sort"),a(t,{replace:!0})},[e,s,a]);const i=c((t,n)=>{const o=n==="desc"?t:`-${t}`;r(e===o?null:o)},[e,r]),S=c((t,n)=>{if(!t||!e)return!1;const o=n==="desc"?t:`-${t}`;return e===o},[e]);return{sortOption:e,setSortOption:r,handleSortClick:i,isColumnSorted:S}}export{O as useCatalogSort};
@@ -1 +1 @@
1
- import{useLocation as c}from"react-router-dom";import{getPathnameForLocale as u,withoutPathPrefix as s}from"@redocly/theme/core/utils";import{addTrailingSlash as i}from"../../../../utils/url/add-trailing-slash.js";import{useL10nConfig as m}from"../useL10nConfig";import{useProducts as l}from"./useProducts";const x=()=>{const t=l(),o=c(),{locales:r,defaultLocale:e,currentLocale:n}=m();return t.find(a=>i(u(s(o.pathname),e,n,r)).startsWith(a.slug))};export{x as useCurrentProduct};
1
+ import{useLocation as c}from"react-router";import{getPathnameForLocale as u,withoutPathPrefix as s}from"@redocly/theme/core/utils";import{addTrailingSlash as i}from"../../../../utils/url/add-trailing-slash.js";import{useL10nConfig as m}from"../useL10nConfig";import{useProducts as l}from"./useProducts";const x=()=>{const t=l(),o=c(),{locales:r,defaultLocale:e,currentLocale:n}=m();return t.find(a=>i(u(s(o.pathname),e,n,r)).startsWith(a.slug))};export{x as useCurrentProduct};
@@ -1 +1 @@
1
- import{useLocation as s,useNavigate as p}from"react-router-dom";import{useEffect as u,useRef as l}from"react";import{useActiveSectionId as h}from"@redocly/theme/core/hooks";import{isBrowser as m}from"../../../utils/env/is-browser";import{pathnameMatchesActiveSection as f}from"./utils/pathname-matches-active-section.js";import{usePageData as d}from"./usePageData";let c=!0;function b(){const t=s(),o=p(),e=h(t,!1,!1),r=!!d("props")?.props?.disableAutoScroll,a=l(null);u(()=>{if(r){a.current=e;return}if(e&&c){c=!1,a.current=e;return}const n=a.current!==e,i=f(window.location.pathname,e);m()&&e&&!t.hash&&n&&!i&&o({pathname:t.pathname,search:t.search,hash:`#${e}`},{replace:!0}),a.current=e},[e,r,t.pathname,t.search,t.hash,o])}export{b as useAutoScroll};
1
+ import{useLocation as s,useNavigate as p}from"react-router";import{useEffect as u,useRef as l}from"react";import{useActiveSectionId as h}from"@redocly/theme/core/hooks";import{isBrowser as m}from"../../../utils/env/is-browser";import{pathnameMatchesActiveSection as f}from"./utils/pathname-matches-active-section.js";import{usePageData as d}from"./usePageData";let c=!0;function b(){const t=s(),o=p(),e=h(t,!1,!1),r=!!d("props")?.props?.disableAutoScroll,a=l(null);u(()=>{if(r){a.current=e;return}if(e&&c){c=!1,a.current=e;return}const n=a.current!==e,i=f(window.location.pathname,e);m()&&e&&!t.hash&&n&&!i&&o({pathname:t.pathname,search:t.search,hash:`#${e}`},{replace:!0}),a.current=e},[e,r,t.pathname,t.search,t.hash,o])}export{b as useAutoScroll};
@@ -1 +1 @@
1
- import{useEffect as S,useMemo as c,useState as f}from"react";import{useLocation as A}from"react-router-dom";import{useThemeConfig as w}from"@redocly/theme/core/hooks";import{usePageData as B}from"../../providers/page-data/hooks";import{getBannerForSlug as D,getNextBannerTransition as T,isBannerWithinTimeRange as h}from"./utils/match-banner-target.js";const u="redocly-dismissed-banners",x=2**31-1;function E(){if(typeof window>"u")return new Set;const n=localStorage.getItem(u);if(n){const a=JSON.parse(n);if(Array.isArray(a))return new Set(a)}return new Set}function C(){const{banner:n}=w()||{},t=B()?.props?.frontmatter?.banner,d=A(),[o,g]=f(E()),[s,p]=f(()=>Date.now()),i=d.pathname,m=c(()=>{const r=Array.isArray(n)?n:[],e=Array.isArray(t)?t:[];return[...r,...e]},[n,t]);return S(()=>{const r=T(m,s);if(r===void 0)return;const e=r-Date.now(),y=Math.min(Math.max(0,e),x),l=setTimeout(()=>p(Date.now()),y);return()=>clearTimeout(l)},[m,s]),{banner:c(()=>{const r=(Array.isArray(t)?t:[]).find(e=>!o.has(e.hash)&&h(e,s));if(r)return r;if(!(!n||!Array.isArray(n)||n.length===0))return D(n,i,o,s)},[n,t,i,o,s]),dismissBanner:r=>{const e=new Set(o);e.add(r),g(e),localStorage.setItem(u,JSON.stringify(Array.from(e)))}}}export{u as STORAGE_KEY,E as getDismissedBannersFromStorage,C as useBanner};
1
+ import{useEffect as S,useMemo as c,useState as f}from"react";import{useLocation as A}from"react-router";import{useThemeConfig as w}from"@redocly/theme/core/hooks";import{usePageData as B}from"../../providers/page-data/hooks";import{getBannerForSlug as D,getNextBannerTransition as T,isBannerWithinTimeRange as h}from"./utils/match-banner-target.js";const u="redocly-dismissed-banners",x=2**31-1;function E(){if(typeof window>"u")return new Set;const n=localStorage.getItem(u);if(n){const a=JSON.parse(n);if(Array.isArray(a))return new Set(a)}return new Set}function C(){const{banner:n}=w()||{},t=B()?.props?.frontmatter?.banner,d=A(),[o,g]=f(E()),[s,p]=f(()=>Date.now()),i=d.pathname,m=c(()=>{const r=Array.isArray(n)?n:[],e=Array.isArray(t)?t:[];return[...r,...e]},[n,t]);return S(()=>{const r=T(m,s);if(r===void 0)return;const e=r-Date.now(),y=Math.min(Math.max(0,e),x),l=setTimeout(()=>p(Date.now()),y);return()=>clearTimeout(l)},[m,s]),{banner:c(()=>{const r=(Array.isArray(t)?t:[]).find(e=>!o.has(e.hash)&&h(e,s));if(r)return r;if(!(!n||!Array.isArray(n)||n.length===0))return D(n,i,o,s)},[n,t,i,o,s]),dismissBanner:r=>{const e=new Set(o);e.add(r),g(e),localStorage.setItem(u,JSON.stringify(Array.from(e)))}}}export{u as STORAGE_KEY,E as getDismissedBannersFromStorage,C as useBanner};
@@ -1 +1 @@
1
- import{useMemo as r}from"react";import{useLocation as l}from"react-router-dom";import{getLocaleFromPathname as c,withoutPathPrefix as n}from"@redocly/theme/core/utils";import{DEFAULT_LOCALE_PLACEHOLDER as m}from"../../../constants/common";import{useGlobalData as s}from"../useGlobalData";const E=()=>{const a=l(),{l10n:o}=s(),t=r(()=>o?.locales||[],[o?.locales]),e=o?.defaultLocale||m;return{currentLocale:r(()=>c(n(a.pathname),e,t),[a,t,e]),defaultLocale:e,locales:t}};export{E as useL10nConfig};
1
+ import{useMemo as r}from"react";import{useLocation as l}from"react-router";import{getLocaleFromPathname as c,withoutPathPrefix as n}from"@redocly/theme/core/utils";import{DEFAULT_LOCALE_PLACEHOLDER as m}from"../../../constants/common";import{useGlobalData as s}from"../useGlobalData";const E=()=>{const a=l(),{l10n:o}=s(),t=r(()=>o?.locales||[],[o?.locales]),e=o?.defaultLocale||m;return{currentLocale:r(()=>c(n(a.pathname),e,t),[a,t,e]),defaultLocale:e,locales:t}};export{E as useL10nConfig};
@@ -1 +1 @@
1
- import{useLocation as u}from"react-router-dom";import{useThemeConfig as d}from"@redocly/theme/core/hooks";import{getPathnameForLocale as e}from"@redocly/theme/core/utils";import{DEV_LOGIN_SLUG as i}from"../../../constants/common";import{buildLoginUrl as p}from"../../../utils/auth/build-login-url";import{useL10nConfig as a}from"./useL10nConfig";function F(c={}){const f=d(),{auth:o}=f,{defaultLocale:n,locales:t,currentLocale:r}=a(),m=u().pathname,s=()=>{if(o?.idpsInfo?.length){if(o.idpsInfo.length===1){const l=o.idpsInfo[0];return p(l.idpId,e("",n,r,t),m,c)}return e(i,n,r,t)}};return o?.devLogin?e(i,n,r,t):s()}export{F as useLoginUrl};
1
+ import{useLocation as u}from"react-router";import{useThemeConfig as d}from"@redocly/theme/core/hooks";import{getPathnameForLocale as e}from"@redocly/theme/core/utils";import{DEV_LOGIN_SLUG as i}from"../../../constants/common";import{buildLoginUrl as p}from"../../../utils/auth/build-login-url";import{useL10nConfig as a}from"./useL10nConfig";function F(c={}){const f=d(),{auth:o}=f,{defaultLocale:n,locales:t,currentLocale:r}=a(),m=u().pathname,s=()=>{if(o?.idpsInfo?.length){if(o.idpsInfo.length===1){const l=o.idpsInfo[0];return p(l.idpId,e("",n,r,t),m,c)}return e(i,n,r,t)}};return o?.devLogin?e(i,n,r,t):s()}export{F as useLoginUrl};
@@ -1 +1 @@
1
- import{useEffect as r}from"react";import{useLocation as d}from"react-router-dom";import{telemetry as s}from"../telemetry";const g=()=>{const t=d();r(()=>{const i=()=>{if(!e)return;const a=new Date().getTime()-e;s.sendPageTimeMessage([{id:`${window.origin}${t.pathname}`,object:"page",uri:`${window.origin}${t.pathname}`,durationMs:a}]),e=void 0},n=()=>{if(document.visibilityState==="visible"){e=e||new Date().getTime();return}i()},o=()=>{i()};let e=new Date().getTime();return document.addEventListener("visibilitychange",n),window.addEventListener("beforeunload",o),()=>{i(),window.removeEventListener("beforeunload",o),document.removeEventListener("visibilitychange",n)}},[t.pathname])};export{g as usePageTimeTracker};
1
+ import{useEffect as r}from"react";import{useLocation as d}from"react-router";import{telemetry as s}from"../telemetry";const g=()=>{const t=d();r(()=>{const i=()=>{if(!e)return;const a=new Date().getTime()-e;s.sendPageTimeMessage([{id:`${window.origin}${t.pathname}`,object:"page",uri:`${window.origin}${t.pathname}`,durationMs:a}]),e=void 0},n=()=>{if(document.visibilityState==="visible"){e=e||new Date().getTime();return}i()},o=()=>{i()};let e=new Date().getTime();return document.addEventListener("visibilitychange",n),window.addEventListener("beforeunload",o),()=>{i(),window.removeEventListener("beforeunload",o),document.removeEventListener("visibilitychange",n)}},[t.pathname])};export{g as usePageTimeTracker};
@@ -1 +1 @@
1
- import{useLocation as f,useNavigate as d,useNavigationType as l}from"react-router-dom";import{useEffect as v,useState as P}from"react";import{useThemeConfig as w}from"@redocly/theme/core/hooks";import{normalizeRouteSlug as E}from"../../../utils/path/normalize-route-slug";import{getBaseDataAttributes as M}from"@redocly/theme/core/utils";import{onRouteChange as y}from"../../runtime/generated/browser-plugins.js";import{resolveRouteBySlug as b}from"../utils/resolveRouteBySlug.js";import{usePageData as C}from"./usePageData.js";import{usePostMessage as R}from"../../providers/post-message/use-post-message.js";import{isInIframe as D}from"../../utils/utils.js";import{waitForContentScripts as I}from"../../ScriptLoader.js";import{telemetry as N}from"../telemetry/index.js";const _=()=>{const e=f(),r=d(),a=l(),n=C(),[t,i]=P(),m=w(),{sendMessage:h}=R();v(()=>{if(e?.pathname.endsWith("/")&&e?.pathname!=="/"){r({pathname:E(e.pathname),search:e.search,hash:e.hash},{replace:!0,state:e.state});return}I().then(()=>{if(e.pathname!==t?.pathname||e.search!==t.search){y({location:e,prevLocation:t},m);const o=`${window.origin}${e.pathname+e.search+e.hash}`,s=t?`${window.origin}${t.pathname+t.search+t.hash}`:void 0;N.sendPageViewedMessage([{...M(o,"page",o),referrer:s||document.referrer||void 0}])}});const p=!!t;i(e);const{pathname:c,hash:g,state:u}=e;(process.env.NODE_ENV==="development"||D())&&p&&b(c+g,n?.templateId).then(o=>{const s=a==="POP"?"browser":u?.origin;s&&h({type:"route-updated",origin:s,...o})}).catch(o=>console.log("Resolve route by slug failed with error: ",o.message))},[e,a])};export{_ as useRouteChangeTracker};
1
+ import{useLocation as f,useNavigate as d,useNavigationType as l}from"react-router";import{useEffect as v,useState as P}from"react";import{useThemeConfig as w}from"@redocly/theme/core/hooks";import{normalizeRouteSlug as E}from"../../../utils/path/normalize-route-slug";import{getBaseDataAttributes as M}from"@redocly/theme/core/utils";import{onRouteChange as y}from"../../runtime/generated/browser-plugins.js";import{resolveRouteBySlug as b}from"../utils/resolveRouteBySlug.js";import{usePageData as C}from"./usePageData.js";import{usePostMessage as R}from"../../providers/post-message/use-post-message.js";import{isInIframe as D}from"../../utils/utils.js";import{waitForContentScripts as I}from"../../ScriptLoader.js";import{telemetry as N}from"../telemetry/index.js";const _=()=>{const e=f(),r=d(),a=l(),n=C(),[t,i]=P(),m=w(),{sendMessage:h}=R();v(()=>{if(e?.pathname.endsWith("/")&&e?.pathname!=="/"){r({pathname:E(e.pathname),search:e.search,hash:e.hash},{replace:!0,state:e.state});return}I().then(()=>{if(e.pathname!==t?.pathname||e.search!==t.search){y({location:e,prevLocation:t},m);const o=`${window.origin}${e.pathname+e.search+e.hash}`,s=t?`${window.origin}${t.pathname+t.search+t.hash}`:void 0;N.sendPageViewedMessage([{...M(o,"page",o),referrer:s||document.referrer||void 0}])}});const p=!!t;i(e);const{pathname:c,hash:g,state:u}=e;(process.env.NODE_ENV==="development"||D())&&p&&b(c+g,n?.templateId).then(o=>{const s=a==="POP"?"browser":u?.origin;s&&h({type:"route-updated",origin:s,...o})}).catch(o=>console.log("Resolve route by slug failed with error: ",o.message))},[e,a])};export{_ as useRouteChangeTracker};
@@ -1 +1 @@
1
- import o from"react";import{useLocation as g}from"react-router-dom";import{EmbeddedReplay as k,StoreProvider as I,buildReplayPredefinedEnvValues as P,mergeEnvData as b,useOpenApiDefinition as h,withReplayPrefetch as R,markdocParser as w}from"@redocly/api-docs";import{Admonition as V}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{ErrorMessage as C,OpenApiComponentWrap as D}from"../styled.elements.js";import{useStore as v}from"../../hooks/use-store.js";import{getMockServerDocsConfig as E}from"../../../../templates/openapi-docs/mock-server-config.js";import{buildReplayOperationSourceMap as $}from"../../utils/build-replay-operation-source-map.js";import{findApiItem as x}from"../../utils/find-api-item.js";const q=R(function({descriptionFile:p,operationId:r,pointer:n,exampleKey:a,mimeType:e,requestBody:u,parameters:c,environment:s,environments:i,hideOtherSecuritySchemes:d}){const f=g(),{store:t,baseSlug:S}=v(p),m=h(),O=o.useMemo(()=>{if(!m)return{};const M=E(t?.options?.mockServer,S??""),A=P(m,M);return b(A,i??{})},[m,t?.options?.mockServer,S,i]),y=o.useMemo(()=>t?.items?$(t.items,{pointer:n,sourceId:r},{mimeType:e,exampleKey:a},t.store?.exampleStore??{}):new Map,[t?.items,t?.store?.exampleStore,n,r,e,a]);return!m||!t?null:o.createElement(k,{key:`${f.pathname}-${p}-${r||n}`,activeOperationId:r,fullOpenApi:m,pointer:n,operationSourceMap:y,hideOtherSecuritySchemes:d,predefinedEnvValues:O,allowedEnvironments:s?[s]:void 0,requestValues:{body:u,...c},activeMimeName:e})}),J=l=>{const{descriptionFile:p,operationId:r,pointer:n,options:a}=l,{store:e,error:u,baseSlug:c}=v(p),s=o.useMemo(()=>({...e?.options,...a}),[a,e?.options]),i=o.useMemo(()=>e?.items?.length?x(e.items,{pointer:n,sourceId:r}):void 0,[e?.items,n,r]);if(!e)return o.createElement(C,null,u);if(!i?.content?.meta?.pointer)return o.createElement(V,{type:"danger"},"Cannot find OpenAPI operation by operationId or pointer in ",p);const d=i.content.meta.pointer,f=i.content.meta.sourceId??"";return o.createElement(D,{"data-testid":"replay-openapi"},o.createElement(I,{apiStore:e.store,options:{specType:"openapi",...s,mockServer:E(s.mockServer,c??""),basePath:c,markdownParser:w}},o.createElement(q,{...l,pointer:d,operationId:f})))};export{J as ReplayOpenApi};
1
+ import o from"react";import{useLocation as g}from"react-router";import{EmbeddedReplay as k,StoreProvider as I,buildReplayPredefinedEnvValues as P,mergeEnvData as b,useOpenApiDefinition as h,withReplayPrefetch as R,markdocParser as w}from"@redocly/api-docs";import{Admonition as V}from"@redocly/theme/markdoc/components/Admonition/Admonition";import{ErrorMessage as C,OpenApiComponentWrap as D}from"../styled.elements.js";import{useStore as v}from"../../hooks/use-store.js";import{getMockServerDocsConfig as E}from"../../../../templates/openapi-docs/mock-server-config.js";import{buildReplayOperationSourceMap as $}from"../../utils/build-replay-operation-source-map.js";import{findApiItem as x}from"../../utils/find-api-item.js";const q=R(function({descriptionFile:p,operationId:r,pointer:n,exampleKey:a,mimeType:e,requestBody:u,parameters:c,environment:s,environments:i,hideOtherSecuritySchemes:d}){const f=g(),{store:t,baseSlug:S}=v(p),m=h(),O=o.useMemo(()=>{if(!m)return{};const M=E(t?.options?.mockServer,S??""),A=P(m,M);return b(A,i??{})},[m,t?.options?.mockServer,S,i]),y=o.useMemo(()=>t?.items?$(t.items,{pointer:n,sourceId:r},{mimeType:e,exampleKey:a},t.store?.exampleStore??{}):new Map,[t?.items,t?.store?.exampleStore,n,r,e,a]);return!m||!t?null:o.createElement(k,{key:`${f.pathname}-${p}-${r||n}`,activeOperationId:r,fullOpenApi:m,pointer:n,operationSourceMap:y,hideOtherSecuritySchemes:d,predefinedEnvValues:O,allowedEnvironments:s?[s]:void 0,requestValues:{body:u,...c},activeMimeName:e})}),J=l=>{const{descriptionFile:p,operationId:r,pointer:n,options:a}=l,{store:e,error:u,baseSlug:c}=v(p),s=o.useMemo(()=>({...e?.options,...a}),[a,e?.options]),i=o.useMemo(()=>e?.items?.length?x(e.items,{pointer:n,sourceId:r}):void 0,[e?.items,n,r]);if(!e)return o.createElement(C,null,u);if(!i?.content?.meta?.pointer)return o.createElement(V,{type:"danger"},"Cannot find OpenAPI operation by operationId or pointer in ",p);const d=i.content.meta.pointer,f=i.content.meta.sourceId??"";return o.createElement(D,{"data-testid":"replay-openapi"},o.createElement(I,{apiStore:e.store,options:{specType:"openapi",...s,mockServer:E(s.mockServer,c??""),basePath:c,markdownParser:w}},o.createElement(q,{...l,pointer:d,operationId:f})))};export{J as ReplayOpenApi};
@@ -1 +1 @@
1
- import t,{useEffect as g,useState as s}from"react";import{useNavigate as h}from"react-router-dom";import{Button as y}from"@redocly/theme/components/Button/Button";import{H3 as v}from"@redocly/theme/components/Typography/H3";import{H4 as S}from"@redocly/theme/components/Typography/H4";import{Admonition as w}from"@redocly/theme/components/Admonition/Admonition";import{getBaseDataAttributes as P,getPathnameForLocale as E,withPathPrefix as L}from"@redocly/theme/core/utils";import{ServerRoutes as b}from"../../../../constants/api";import{telemetry as k}from"../../telemetry/index.js";import{buildLoginUrl as O}from"../../../../utils/auth/build-login-url";import{usePageProps as T}from"../../../providers/page-data/hooks";import{Wrapper as C,HeadingSection as R}from"./styled";import{DevLoginForm as A}from"./DevLoginForm";import{useL10nConfig as F}from"../../hooks";async function x(r){try{const{status:o}=await fetch(L(b.AUTHORIZATION),{method:"POST",body:JSON.stringify(r)});return o}catch(o){console.error(o)}}function K(){const{defaultLocale:r,locales:o,currentLocale:c}=F(),l=h(),[a,d]=s({values:{teams:[],email:"example@example.com"}}),[i,u]=s();g(()=>{const e=new URLSearchParams(window.location.search);u(e.get("redirectTo")||void 0)},[]);const n=T(),m=n?.authIdps,p=(n.rbac?.teams||[]).filter(e=>e!=="*"),f=async()=>{await x(a.values)===200&&(l(i||"/"),window.location.reload())};return t.createElement(C,null,t.createElement(R,null,t.createElement(v,{"data-cy":"login-title"},"Dev-mode login"),t.createElement(w,{type:"warning",name:"This is dev mode login simulator."},"Any email works and password is not checked.")),t.createElement(t.Fragment,null,t.createElement(A,{teams:p,formState:a,setFormState:d,onSubmit:f}),Object.keys(m||{}).length>0&&t.createElement(S,null,"Use SSO:"),Object.values(m||{}).map(e=>t.createElement("div",{key:e.idpId},t.createElement(y,{fullWidth:!0,size:"large","data-cy":"idp-login",to:O(e.idpId,E("",r,c,o),i),onClick:()=>k.sendLoginProviderClickedMessage([{...P("loginProvider","button"),provider:e.type}])},e.title||e.type)))))}export{K as default};
1
+ import t,{useEffect as g,useState as s}from"react";import{useNavigate as h}from"react-router";import{Button as y}from"@redocly/theme/components/Button/Button";import{H3 as v}from"@redocly/theme/components/Typography/H3";import{H4 as S}from"@redocly/theme/components/Typography/H4";import{Admonition as w}from"@redocly/theme/components/Admonition/Admonition";import{getBaseDataAttributes as P,getPathnameForLocale as E,withPathPrefix as L}from"@redocly/theme/core/utils";import{ServerRoutes as b}from"../../../../constants/api";import{telemetry as k}from"../../telemetry/index.js";import{buildLoginUrl as O}from"../../../../utils/auth/build-login-url";import{usePageProps as T}from"../../../providers/page-data/hooks";import{Wrapper as C,HeadingSection as R}from"./styled";import{DevLoginForm as A}from"./DevLoginForm";import{useL10nConfig as F}from"../../hooks";async function x(r){try{const{status:o}=await fetch(L(b.AUTHORIZATION),{method:"POST",body:JSON.stringify(r)});return o}catch(o){console.error(o)}}function K(){const{defaultLocale:r,locales:o,currentLocale:c}=F(),l=h(),[a,d]=s({values:{teams:[],email:"example@example.com"}}),[i,u]=s();g(()=>{const e=new URLSearchParams(window.location.search);u(e.get("redirectTo")||void 0)},[]);const n=T(),m=n?.authIdps,p=(n.rbac?.teams||[]).filter(e=>e!=="*"),f=async()=>{await x(a.values)===200&&(l(i||"/"),window.location.reload())};return t.createElement(C,null,t.createElement(R,null,t.createElement(v,{"data-cy":"login-title"},"Dev-mode login"),t.createElement(w,{type:"warning",name:"This is dev mode login simulator."},"Any email works and password is not checked.")),t.createElement(t.Fragment,null,t.createElement(A,{teams:p,formState:a,setFormState:d,onSubmit:f}),Object.keys(m||{}).length>0&&t.createElement(S,null,"Use SSO:"),Object.values(m||{}).map(e=>t.createElement("div",{key:e.idpId},t.createElement(y,{fullWidth:!0,size:"large","data-cy":"idp-login",to:O(e.idpId,E("",r,c,o),i),onClick:()=>k.sendLoginProviderClickedMessage([{...P("loginProvider","button"),provider:e.type}])},e.title||e.type)))))}export{K as default};
@@ -8,6 +8,7 @@ export declare function useSearch(product?: string, disableAutoSearch?: boolean)
8
8
  isSearchLoading: boolean;
9
9
  searchError: string | null;
10
10
  facets: SearchFacet[];
11
+ groupCounts: Record<string, number>;
11
12
  groupField: string;
12
13
  setLoadMore: import("react").Dispatch<import("react").SetStateAction<{
13
14
  groupKey: string;
@@ -1 +1 @@
1
- import{useCallback as b,useEffect as A,useState as E,useRef as w}from"react";import{SEARCH_DEBOUNCE_TIME_MS as Q}from"@redocly/theme/core/constants";import{getBaseDataAttributes as q,withPathPrefix as O}from"@redocly/theme/core/utils";import{ServerRoutes as D}from"../../../constants/api";import{SEARCH_GROUP_FACET_FIELD as v,SEARCH_PRODUCT_FIELD as L,SEARCH_VERSION_FIELD as M}from"../../../constants/common";import{debounce as U}from"../../../utils/time/debounce.js";import{useSearchSession as B}from"@redocly/theme/core/contexts";import{useGlobalData as J,useI18nConfig as H}from"../hooks";import{usePageVersions as K}from"../../providers/page-data/hooks";import{useFacets as $}from"./useFacets";import{telemetry as z}from"../telemetry/index.js";const W=(o,c,r,a,s,u,f,n,l)=>{const{searchSessionId:y}=B(),{currentLocale:F}=H(),m=w(""),d=w(null),p=w(async(e,i)=>{try{u(null);const t=await fetch(O(D.SEARCH),i);if(!t.ok)throw new Error(t.statusText||`Search failed (${t.status})`);if(R(e)){const S=await t.json();a(S.facets),r(S.documents),d.current=null,e.trim().length>1&&z.sendSearchQueryMessage([{...q("searchQuery","search"),query:e,resultCount:Object.keys(S.documents).length.toString(),searchSessionId:y,...n&&{product:n}}]),s(!1)}}catch(t){if(!R(e))return;d.current={query:e,requestParams:i},r({}),s(!1),u(t instanceof Error?t.message:"An unknown error occurred")}}),R=e=>m.current===e,h=b(U(async(e,i,t,S)=>{if(!e.trim().length&&!i.length){r({}),a({}),s(!1),u(null),d.current=null;return}const I={method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({query:e,filter:T(i,S,f),locale:t})};await p.current(e,I)},Q),[f?.version,f?.folderId,n]);return A(()=>{l||(s(!0),h(o,c,F,n),m.current=o)},[l,c,F,n,o,h,s]),{retrySearch:b(async()=>{const e=d.current;e&&(s(!0),m.current=e.query,await p.current(e.query,e.requestParams))},[s])}},X=(o,c,r,a,s,u,f,n,l)=>{const{currentLocale:y}=H();A(()=>{F(r,o,c,y,a,s,n,l)},[a,n,l?.version,l?.folderId]);const F=b(async(m,d,p,R,h,C,e,i)=>{if(h){const{groupKey:t}=h;f(!0);const I={method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({query:d,filter:(()=>{const g=C.find(_=>_.field===v);let P=p;return g&&(p.find(N=>N.field===g.field)||(P=[...p,{field:g.field,values:[t]}])),T(P,e,i)})(),loadMore:h,locale:R})},j=await(await fetch(O(D.SEARCH),I)).json(),k=m[t]||[],x=j.documents[t],G={...m,[t]:[...k,...x]};u(G),f(!1)}},[]);return{}};function le(o,c){const{searchFeatures:r}=J(),[a,s]=E(""),[u,f]=E([]),[n,l]=E({}),[y,F]=E({}),[m,d]=E(),[p,R]=E(!1),[h,C]=E(null),{facets:e}=$(y),{versions:i=[]}=K()||{},t=i.find(I=>I?.active),{retrySearch:S}=W(a,u,l,F,R,C,t,o,c);return X(a,u,n,m,e,l,R,o,t),{query:a,setQuery:s,filter:u,setFilter:f,items:n,isSearchLoading:p,searchError:h,facets:e,groupField:v,setLoadMore:d,retrySearch:S,advancedSearch:r?.advanced?.enabled,askAi:r?.ai?.enabled}}function T(o,c,r){return[...o,...c?[{field:L,values:[c]}]:[],...r?[{field:M,values:[...r.default?["default"]:[r.folderId,r.version]]}]:[]]}export{le as useSearch};
1
+ import{useCallback as P,useEffect as v,useState as S,useRef as _}from"react";import{SEARCH_DEBOUNCE_TIME_MS as L}from"@redocly/theme/core/constants";import{getBaseDataAttributes as M,withPathPrefix as H}from"@redocly/theme/core/utils";import{ServerRoutes as T}from"../../../constants/api";import{SEARCH_GROUP_FACET_FIELD as j,SEARCH_PRODUCT_FIELD as U,SEARCH_VERSION_FIELD as B}from"../../../constants/common";import{debounce as J}from"../../../utils/time/debounce.js";import{useSearchSession as K}from"@redocly/theme/core/contexts";import{useGlobalData as $,useI18nConfig as k}from"../hooks";import{usePageVersions as z}from"../../providers/page-data/hooks";import{useFacets as W}from"./useFacets";import{telemetry as X}from"../telemetry/index.js";const Y=(o,u,r,l,E,s,R,i,n,d)=>{const{searchSessionId:C}=K(),{currentLocale:F}=k(),f=_(""),p=_(null),h=_(async(e,c)=>{try{R(null);const t=await fetch(H(T.SEARCH),c);if(!t.ok)throw new Error(t.statusText||`Search failed (${t.status})`);if(y(e)){const a=await t.json();l(a.facets),r(a.documents),E(a.groupCounts??{}),p.current=null,e.trim().length>1&&X.sendSearchQueryMessage([{...M("searchQuery","search"),query:e,resultCount:Object.keys(a.documents).length.toString(),searchSessionId:C,...n&&{product:n}}]),s(!1)}}catch(t){if(!y(e))return;p.current={query:e,requestParams:c},r({}),s(!1),R(t instanceof Error?t.message:"An unknown error occurred")}}),y=e=>f.current===e,m=P(J(async(e,c,t,a)=>{if(!e.trim().length&&!c.length){r({}),l({}),E({}),s(!1),R(null),p.current=null;return}const g={method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({query:e,filter:x(c,a,i),locale:t})};await h.current(e,g)},L),[i?.version,i?.folderId,n]);return v(()=>{d||(s(!0),m(o,u,F,n),f.current=o)},[d,u,F,n,o,m,s]),{retrySearch:P(async()=>{const e=p.current;e&&(s(!0),f.current=e.query,await h.current(e.query,e.requestParams))},[s])}},Z=(o,u,r,l,E,s,R,i,n,d)=>{const{currentLocale:C}=k();v(()=>{F(r,o,u,C,l,E,n,d)},[l,n,d?.version,d?.folderId]);const F=P(async(f,p,h,y,m,b,e,c)=>{if(m){const{groupKey:t}=m;i(!0);const g={method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({query:p,filter:(()=>{const I=b.find(D=>D.field===j);let O=h;return I&&(h.find(q=>q.field===I.field)||(O=[...h,{field:I.field,values:[t]}])),x(O,e,c)})(),loadMore:m,locale:y})},w=await(await fetch(H(T.SEARCH),g)).json(),G=f[t]||[],N=w.documents[t]??[],Q={...f,[t]:[...G,...N]};s(Q),w.groupCounts&&R(I=>({...I,...w.groupCounts})),i(!1)}},[]);return{}};function ie(o,u){const{searchFeatures:r}=$(),[l,E]=S(""),[s,R]=S([]),[i,n]=S({}),[d,C]=S({}),[F,f]=S({}),[p,h]=S(),[y,m]=S(!1),[b,e]=S(null),{facets:c}=W(d),{versions:t=[]}=z()||{},a=t.find(A=>A?.active),{retrySearch:g}=Y(l,s,n,C,f,m,e,a,o,u);return Z(l,s,i,p,c,n,f,m,o,a),{query:l,setQuery:E,filter:s,setFilter:R,items:i,isSearchLoading:y,searchError:b,facets:c,groupCounts:F,groupField:j,setLoadMore:h,retrySearch:g,advancedSearch:r?.advanced?.enabled,askAi:r?.ai?.enabled}}function x(o,u,r){return[...o,...u?[{field:U,values:[u]}]:[],...r?[{field:B,values:[...r.default?["default"]:[r.folderId,r.version]]}]:[]]}export{ie as useSearch};
@@ -1 +1 @@
1
- import{useMemo as h}from"react";import{useLocation as l}from"react-router-dom";import{combineUrls as i,getPathnameForLocale as m,withPathPrefix as c,withoutPathPrefix as u}from"@redocly/theme/core/utils";import{DEFAULT_LOCALE_PLACEHOLDER as p}from"../../../../constants/common";import{useL10nConfig as L}from"../../hooks/useL10nConfig";function x(e){const n=l(),{locales:o,defaultLocale:t}=L();return h(()=>{if(!e)return{localeAlternates:[]};const f=u(n.pathname),a=o.filter(r=>r.code!==p).map(r=>({hrefLang:r.code.replaceAll("_","-"),href:i(e,c(m(f,t,r.code,o)))}));return a.length>0&&a.push({hrefLang:"x-default",href:i(e,c(m(f,t,t,o)))}),{localeAlternates:a}},[t,o,n.pathname,e])}export{x as useHreflangLinks};
1
+ import{useMemo as h}from"react";import{useLocation as l}from"react-router";import{combineUrls as i,getPathnameForLocale as m,withPathPrefix as c,withoutPathPrefix as u}from"@redocly/theme/core/utils";import{DEFAULT_LOCALE_PLACEHOLDER as p}from"../../../../constants/common";import{useL10nConfig as L}from"../../hooks/useL10nConfig";function x(e){const n=l(),{locales:o,defaultLocale:t}=L();return h(()=>{if(!e)return{localeAlternates:[]};const f=u(n.pathname),a=o.filter(r=>r.code!==p).map(r=>({hrefLang:r.code.replaceAll("_","-"),href:i(e,c(m(f,t,r.code,o)))}));return a.length>0&&a.push({hrefLang:"x-default",href:i(e,c(m(f,t,t,o)))}),{localeAlternates:a}},[t,o,n.pathname,e])}export{x as useHreflangLinks};
@@ -1 +1 @@
1
- import{useEffect as s,useState as a}from"react";import{useLocation as f}from"react-router-dom";function u(t=!1){const o=f(),[n,e]=a(t);return s(()=>e(!1),[o.pathname]),[n,e]}export{u as useMobileMenu};
1
+ import{useEffect as s,useState as a}from"react";import{useLocation as f}from"react-router";function u(t=!1){const o=f(),[n,e]=a(t);return s(()=>e(!1),[o.pathname]),[n,e]}export{u as useMobileMenu};
@@ -1,4 +1,4 @@
1
- import type { To, Location } from 'react-router-dom';
1
+ import type { To, Location } from 'react-router';
2
2
  export declare function usePreloadHistory(): {
3
3
  push: (location: To) => Promise<void>;
4
4
  location: Location;
@@ -1 +1 @@
1
- import{useMemo as s,useCallback as n}from"react";import{useLocation as r,useNavigate as i}from"react-router-dom";function m(){const o=i(),a=n(async e=>{await window.__LOADER.load(e),await o(e)},[o]),t=r();return s(()=>({push:a,location:t}),[t,a])}export{m as usePreloadHistory};
1
+ import{useMemo as s,useCallback as n}from"react";import{useLocation as r,useNavigate as i}from"react-router";function m(){const o=i(),a=n(async e=>{await window.__LOADER.load(e),await o(e)},[o]),t=r();return s(()=>({push:a,location:t}),[t,a])}export{m as usePreloadHistory};
@@ -1,4 +1,4 @@
1
- import type { NavigateFunction, NavigateOptions } from 'react-router-dom';
1
+ import type { NavigateFunction, NavigateOptions } from 'react-router';
2
2
  export type HistoryOrigin = 'pm' | 'browser';
3
3
  export declare function loadAndNavigate({ navigate, to, origin, options, }: {
4
4
  navigate: NavigateFunction;
@@ -1,7 +1,7 @@
1
- import{telemetry as p}from"./app/telemetry/index.js";p.init({otel:{isProd:process.env.NODE_ENV==="production",serviceVersion:`${P}@${process.env.REDOCLY_PORTAL_VERSION}`,version:"1.0.0",collectorTraceUrl:new URL(e(L.OTEL_TRACES),location.origin).toString(),serviceName:"realm-ui",tracerName:"client-telemetry"},disabled:!_});import o from"react";import{hydrateRoot as s}from"react-dom/client";import{RouterProvider as m,createBrowserRouter as d}from"react-router-dom";import{HelmetProvider as f}from"@dr.pogodin/react-helmet";import{StyleSheetManager as E}from"styled-components";import{getLocaleFromPathname as u,withoutPathPrefix as R,withPathPrefix as e}from"@redocly/theme/core/utils";import{ServerRoutes as L}from"../constants/api";import{DEFAULT_LOCALE_PLACEHOLDER as O}from"../constants/common";import{CLIENT_TELEMETRY_ENABLED as _}from"./constants/common.js";import{shouldForwardProp as D}from"../utils/should-forward-prop.js";import"./polyfills";import{PACKAGE_NAME as P,PRODUCT_NAME as h}from"../config/product-gates";import{App as g,routes as A}from"./App";import{Loader as x,useRefresh as N,globalData as t}from"./runtime/loader";import{initL10n as b}from"./app/l10n/initL10n";function v(){return N(),o.createElement(f,{context:{}},o.createElement(E,{shouldForwardProp:D},o.createElement(g,null)))}function T(){t?.removeAttribution&&process.env.REDOCLY_PORTAL_VERSION?console.log(`
1
+ import{telemetry as p}from"./app/telemetry/index.js";p.init({otel:{isProd:process.env.NODE_ENV==="production",serviceVersion:`${P}@${process.env.REDOCLY_PORTAL_VERSION}`,version:"1.0.0",collectorTraceUrl:new URL(e(L.OTEL_TRACES),location.origin).toString(),serviceName:"realm-ui",tracerName:"client-telemetry"},disabled:!_});import o from"react";import{hydrateRoot as s}from"react-dom/client";import{createBrowserRouter as m}from"react-router";import{RouterProvider as d}from"react-router/dom";import{HelmetProvider as f}from"@dr.pogodin/react-helmet";import{StyleSheetManager as E}from"styled-components";import{getLocaleFromPathname as u,withoutPathPrefix as R,withPathPrefix as e}from"@redocly/theme/core/utils";import{ServerRoutes as L}from"../constants/api";import{DEFAULT_LOCALE_PLACEHOLDER as O}from"../constants/common";import{CLIENT_TELEMETRY_ENABLED as _}from"./constants/common.js";import{shouldForwardProp as D}from"../utils/should-forward-prop.js";import"./polyfills";import{PACKAGE_NAME as P,PRODUCT_NAME as h}from"../config/product-gates";import{App as g,routes as A}from"./App";import{Loader as x,useRefresh as N,globalData as t}from"./runtime/loader";import{initL10n as b}from"./app/l10n/initL10n";function v(){return N(),o.createElement(f,{context:{}},o.createElement(E,{shouldForwardProp:D},o.createElement(g,null)))}function T(){t?.removeAttribution&&process.env.REDOCLY_PORTAL_VERSION?console.log(`
2
2
  %c Version: ${process.env.REDOCLY_PORTAL_VERSION} %c
3
3
  `,"background:#ffffff ; padding: 1px; border:1px solid #0044D4; border-radius: 3px; color: #0044D4","background:transparent"):process.env.REDOCLY_PORTAL_VERSION&&console.log(`
4
4
  %c Redocly ${h} %c ${process.env.REDOCLY_PORTAL_VERSION} %c
5
5
 
6
6
  %chttps://redocly.com
7
- `,"background:#0044D4 ; padding: 1px; border-radius: 3px 0 0 3px; color: #fff; border:1px solid #0044D4","background:#ffffff ; padding: 1px; border:1px solid #0044D4; border-radius: 0 3px 3px 0; color: #0044D4","background:transparent","font-size: 10px; font-style: italic;")}async function C(){process.env.NODE_ENV!=="production"&&import("./runtime/ws-client").then(l=>l.listenWs()),await x.load(window.location.pathname,void 0,window.location.search),T();const r=t?.l10n,n=r?.locales||[],i=r?.defaultLocale||O,a=u(R(location.pathname),i,n);await b(r,a);const c=d([{Component:v,path:e("/*"),children:A}]);s(document.getElementById("app_root"),o.createElement(m,{router:c}))}C();
7
+ `,"background:#0044D4 ; padding: 1px; border-radius: 3px 0 0 3px; color: #fff; border:1px solid #0044D4","background:#ffffff ; padding: 1px; border:1px solid #0044D4; border-radius: 0 3px 3px 0; color: #0044D4","background:transparent","font-size: 10px; font-style: italic;")}async function C(){process.env.NODE_ENV!=="production"&&import("./runtime/ws-client").then(l=>l.listenWs()),await x.load(window.location.pathname,void 0,window.location.search),T();const r=t?.l10n,n=r?.locales||[],i=r?.defaultLocale||O,a=u(R(location.pathname),i,n);await b(r,a);const c=m([{Component:v,path:e("/*"),children:A}]);s(document.getElementById("app_root"),o.createElement(d,{router:c}))}C();
@@ -1,7 +1,7 @@
1
1
  export * from './page-data/hooks.js';
2
2
  /**
3
3
  * Catches click events on <a /> elements and if it's a local link,
4
- * uses react-router-dom to navigate
4
+ * uses react-router to navigate
5
5
  * @returns ref used to identify the root object
6
6
  */
7
7
  export declare function useRouterForLocalLinks(): void;
@@ -1 +1 @@
1
- import{useEffect as c,useState as s}from"react";import{useNavigate as l}from"react-router-dom";import{isLocalLink as u}from"../../utils/path/is-local-link.js";import{isJsProtocolLink as a}from"../../utils/path/is-js-protocol-link.js";import{isAssetsLink as m}from"../../utils/path/is-assets-link.js";import{isHostnameOnDomain as f}from"../app/utils/isHostnameOnDomain.js";import{loadAndNavigate as d}from"../app/utils/loadAndNavigate.js";import{isForcedNavigationLinkClick as p}from"../utils/utils.js";export*from"./page-data/hooks.js";function E(){const o=l();c(()=>{const r=t=>{if(t.defaultPrevented)return;const i=t.target;if(i.tagName!=="A"||p(t,i.getAttribute("target")||""))return;const n=i.getAttribute("href");!u(n)||m(n)||a(n)||(t.preventDefault(),d({navigate:o,to:n||""}))};return document.addEventListener("click",r),()=>{document.removeEventListener("click",r)}},[o])}function b(){const[o,r]=s(null);return c(()=>{if(process.env.NODE_ENV==="development"&&typeof window<"u"&&!e("localhost")&&!e("127.0.0.1")&&!e("")&&!e("redocly-local.com")&&!e("editor.redocly.xyz")&&!e("apps.codespaces.githubusercontent.com")&&!e("blueharvest.cloud")&&!e("bhstage.cloud")&&!e("cloud.redocly.com")&&!e("cloud.eu.redocly.com")&&!e("cba.au.redocly.com"))return r("Development mode is only allowed in localhost")},[typeof window]),o}function e(o){return f(window.location.hostname,o)}export{E as useRouterForLocalLinks,b as useRunningEnvironmentCheck};
1
+ import{useEffect as c,useState as s}from"react";import{useNavigate as l}from"react-router";import{isLocalLink as u}from"../../utils/path/is-local-link.js";import{isJsProtocolLink as a}from"../../utils/path/is-js-protocol-link.js";import{isAssetsLink as m}from"../../utils/path/is-assets-link.js";import{isHostnameOnDomain as f}from"../app/utils/isHostnameOnDomain.js";import{loadAndNavigate as d}from"../app/utils/loadAndNavigate.js";import{isForcedNavigationLinkClick as p}from"../utils/utils.js";export*from"./page-data/hooks.js";function E(){const o=l();c(()=>{const r=t=>{if(t.defaultPrevented)return;const i=t.target;if(i.tagName!=="A"||p(t,i.getAttribute("target")||""))return;const n=i.getAttribute("href");!u(n)||m(n)||a(n)||(t.preventDefault(),d({navigate:o,to:n||""}))};return document.addEventListener("click",r),()=>{document.removeEventListener("click",r)}},[o])}function b(){const[o,r]=s(null);return c(()=>{if(process.env.NODE_ENV==="development"&&typeof window<"u"&&!e("localhost")&&!e("127.0.0.1")&&!e("")&&!e("redocly-local.com")&&!e("editor.redocly.xyz")&&!e("apps.codespaces.githubusercontent.com")&&!e("blueharvest.cloud")&&!e("bhstage.cloud")&&!e("cloud.redocly.com")&&!e("cloud.eu.redocly.com")&&!e("cba.au.redocly.com"))return r("Development mode is only allowed in localhost")},[typeof window]),o}function e(o){return f(window.location.hostname,o)}export{E as useRouterForLocalLinks,b as useRunningEnvironmentCheck};