@redocly/theme 0.70.0-next.1 → 0.70.0-next.3

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 (97) hide show
  1. package/lib/components/CodeBlock/CodeBlockControls.js +3 -5
  2. package/lib/components/Consent/Consent.d.ts +2 -0
  3. package/lib/components/Consent/Consent.js +17 -0
  4. package/lib/components/Consent/ConsentBanner.d.ts +2 -0
  5. package/lib/components/Consent/ConsentBanner.js +120 -0
  6. package/lib/components/Consent/ConsentDialog.d.ts +2 -0
  7. package/lib/components/Consent/ConsentDialog.js +128 -0
  8. package/lib/components/Consent/ConsentSettingsLink.d.ts +2 -0
  9. package/lib/components/Consent/ConsentSettingsLink.js +35 -0
  10. package/lib/components/Consent/variables.d.ts +1 -0
  11. package/lib/components/Consent/variables.js +31 -0
  12. package/lib/components/Footer/Footer.js +4 -1
  13. package/lib/components/JsonViewer/Helpers.d.ts +10 -2
  14. package/lib/components/JsonViewer/Helpers.js +29 -33
  15. package/lib/components/JsonViewer/JsonViewer.js +15 -18
  16. package/lib/components/Markdown/styles/base-table.js +14 -1
  17. package/lib/components/Markdown/variables.js +1 -0
  18. package/lib/components/Product/utils.js +1 -1
  19. package/lib/components/Search/SearchAiConversationInput.js +10 -6
  20. package/lib/components/Search/SearchAiDialog.js +8 -1
  21. package/lib/components/Search/SearchAiMessage.js +1 -1
  22. package/lib/components/Search/SearchAiResponse.js +1 -0
  23. package/lib/components/Search/SearchItem.js +9 -1
  24. package/lib/core/constants/consent.d.ts +2 -0
  25. package/lib/core/constants/consent.js +30 -0
  26. package/lib/core/constants/index.d.ts +1 -0
  27. package/lib/core/constants/index.js +1 -0
  28. package/lib/core/constants/search.d.ts +1 -1
  29. package/lib/core/constants/search.js +1 -1
  30. package/lib/core/hooks/index.d.ts +2 -0
  31. package/lib/core/hooks/index.js +2 -0
  32. package/lib/core/hooks/use-consent-dialog.d.ts +12 -0
  33. package/lib/core/hooks/use-consent-dialog.js +36 -0
  34. package/lib/core/hooks/use-consent-telemetry.d.ts +1 -0
  35. package/lib/core/hooks/use-consent-telemetry.js +42 -0
  36. package/lib/core/hooks/use-dialog-hotkeys.js +4 -2
  37. package/lib/core/hooks/use-theme-hooks.js +14 -0
  38. package/lib/core/styles/global.js +42 -40
  39. package/lib/core/types/consent.d.ts +54 -0
  40. package/lib/core/types/consent.js +3 -0
  41. package/lib/core/types/hooks.d.ts +2 -0
  42. package/lib/core/types/index.d.ts +1 -0
  43. package/lib/core/types/l10n.d.ts +1 -1
  44. package/lib/core/types/search.d.ts +2 -0
  45. package/lib/core/utils/consent-settings-link-placement.d.ts +3 -0
  46. package/lib/core/utils/consent-settings-link-placement.js +15 -0
  47. package/lib/core/utils/index.d.ts +1 -0
  48. package/lib/core/utils/index.js +1 -0
  49. package/lib/core/utils/mcp.js +1 -1
  50. package/lib/core/utils/menu.js +6 -5
  51. package/lib/core/utils/urls.js +3 -1
  52. package/lib/icons/ExpandCollapseIcon/ExpandCollapseIcon.d.ts +29 -0
  53. package/lib/icons/ExpandCollapseIcon/ExpandCollapseIcon.js +81 -0
  54. package/lib/index.d.ts +1 -0
  55. package/lib/index.js +1 -0
  56. package/package.json +3 -3
  57. package/src/components/CodeBlock/CodeBlockControls.tsx +4 -7
  58. package/src/components/Consent/Consent.tsx +18 -0
  59. package/src/components/Consent/ConsentBanner.tsx +110 -0
  60. package/src/components/Consent/ConsentDialog.tsx +210 -0
  61. package/src/components/Consent/ConsentSettingsLink.tsx +44 -0
  62. package/src/components/Consent/variables.ts +28 -0
  63. package/src/components/Footer/Footer.tsx +2 -0
  64. package/src/components/JsonViewer/Helpers.tsx +46 -51
  65. package/src/components/JsonViewer/JsonViewer.tsx +23 -25
  66. package/src/components/Markdown/styles/base-table.ts +14 -1
  67. package/src/components/Markdown/variables.ts +1 -0
  68. package/src/components/Product/utils.ts +1 -1
  69. package/src/components/Search/SearchAiConversationInput.tsx +13 -7
  70. package/src/components/Search/SearchAiDialog.tsx +16 -1
  71. package/src/components/Search/SearchAiMessage.tsx +1 -1
  72. package/src/components/Search/SearchAiResponse.tsx +1 -0
  73. package/src/components/Search/SearchItem.tsx +14 -0
  74. package/src/core/constants/consent.ts +29 -0
  75. package/src/core/constants/index.ts +1 -0
  76. package/src/core/constants/search.ts +1 -1
  77. package/src/core/hooks/__mocks__/use-theme-hooks.ts +15 -0
  78. package/src/core/hooks/code-walkthrough/__mocks__/MockIntersectionObserver.ts +1 -2
  79. package/src/core/hooks/code-walkthrough/__mocks__/mock-intersection-observer.ts +1 -2
  80. package/src/core/hooks/index.ts +2 -0
  81. package/src/core/hooks/use-consent-dialog.ts +51 -0
  82. package/src/core/hooks/use-consent-telemetry.ts +56 -0
  83. package/src/core/hooks/use-dialog-hotkeys.ts +11 -5
  84. package/src/core/hooks/use-theme-hooks.ts +14 -0
  85. package/src/core/styles/global.ts +2 -0
  86. package/src/core/types/consent.ts +51 -0
  87. package/src/core/types/hooks.ts +2 -0
  88. package/src/core/types/index.ts +1 -0
  89. package/src/core/types/l10n.ts +25 -1
  90. package/src/core/types/search.ts +2 -0
  91. package/src/core/utils/consent-settings-link-placement.ts +18 -0
  92. package/src/core/utils/index.ts +1 -0
  93. package/src/core/utils/mcp.ts +1 -1
  94. package/src/core/utils/menu.ts +5 -6
  95. package/src/core/utils/urls.ts +3 -1
  96. package/src/icons/ExpandCollapseIcon/ExpandCollapseIcon.tsx +56 -0
  97. package/src/index.ts +1 -0
@@ -1,5 +1,5 @@
1
1
  import type { TOptions } from 'i18next';
2
- export type TranslationKey = 'dev.newApp' | 'dev.newApp.text' | 'dev.sidebar.header' | 'dev.sidebar.footer.text' | 'dev.create.app.dialog.appName.placeholder' | 'dev.create.app.dialog.appName.error' | 'dev.create.app.dialog.selectAPIs' | 'dev.create.app.dialog.description' | 'dev.create.app.dialog.description.placeholder' | 'dev.create.app.dialog.create' | 'dev.create.app.dialog.cancel' | 'dev.main.tab.appKeys' | 'dev.main.tab.logs' | 'dev.app.description.title' | 'dev.edit.description.dialog.title' | 'dev.edit.description.dialog.save' | 'dev.edit.description.dialog.cancel' | 'dev.create.app.dialog.callbackUrls' | 'dev.create.app.dialog.callbackUrls.placeholder' | 'dev.create.app.dialog.callbackUrls.hint' | 'dev.app.callbackUrls.title' | 'dev.edit.callbackUrls.dialog.title' | 'dev.edit.callbackUrls.dialog.placeholder' | 'dev.edit.callbackUrls.dialog.hint' | 'dev.edit.callbackUrls.dialog.save' | 'dev.edit.callbackUrls.dialog.cancel' | 'dev.edit.apis.dialog.selectedAPIs' | 'dev.app.key.create' | 'dev.create.key.dialog.title' | 'dev.create.key.dialog.create' | 'dev.create.key.dialog.cancel' | 'dev.app.edit' | 'dev.app.delete' | 'dev.edit.app.dialog.title' | 'dev.edit.app.dialog.save' | 'dev.edit.app.dialog.cancel' | 'dev.delete.app.dialog.title' | 'dev.delete.app.dialog.confirmation' | 'dev.delete.app.dialog.delete' | 'dev.delete.app.dialog.cancel' | 'dev.app.key.roll' | 'dev.roll.key.dialog.title' | 'dev.roll.key.dialog.apiKey' | 'dev.roll.key.dialog.expires' | 'dev.roll.key.dialog.confirmation' | 'dev.roll.key.dialog.cancel' | 'dev.roll.key.dialog.roll' | 'dev.update.key.dialog.title' | 'dev.update.key.dialog.update' | 'dev.update.key.dialog.cancel' | 'dev.app.key.api.name' | 'dev.app.key.api.status' | 'dev.app.key.api.edit' | 'dev.edit.apis.dialog.title' | 'dev.edit.apis.dialog.apiKey' | 'dev.edit.apis.dialog.save' | 'dev.edit.apis.dialog.cancel' | 'dev.select.placeholder' | 'dev.app.overview.status.pending' | 'dev.app.overview.status.approved' | 'dev.app.overview.status.revoked' | 'dev.app.overview.status' | 'dev.app.overview.non-production' | 'dev.app.overview.production' | 'dev.app.overview.clientId' | 'dev.app.overview.apiKey' | 'dev.app.key.revoke' | 'dev.revoke.key.dialog.title' | 'dev.revoke.key.dialog.apiKey' | 'dev.revoke.key.dialog.expires' | 'dev.revoke.key.dialog.confirmation' | 'dev.revoke.key.dialog.revoke' | 'dev.revoke.key.dialog.cancel' | 'dev.app.overview.expires' | 'dev.app.overview.created' | 'dev.app.overview.visibilityToggle.hide' | 'dev.app.overview.visibilityToggle.show' | 'search.loading' | 'search.noResults.title' | 'search.keys.navigate' | 'search.keys.select' | 'search.keys.exit' | 'search.label' | 'search.cancel' | 'search.recent' | 'search.navbar.label' | 'search.suggested' | 'search.showMore' | 'search.error.title' | 'search.error.button' | 'search.filter.title' | 'search.filter.reset' | 'search.filter.field.reset' | 'search.ai.welcomeText' | 'search.ai.newConversation' | 'search.ai.backToSearch' | 'search.ai.back' | 'search.ai.assistant' | 'search.ai.placeholder' | 'search.ai.generatingResponse' | 'search.ai.followUpQuestion' | 'search.ai.suggestionsTitle' | 'search.ai.thinkingText' | 'search.ai.resourcesFound' | 'search.ai.resourcesFound.basedOn' | 'search.ai.resourcesFound.resources' | 'search.ai.feedback.title' | 'search.ai.feedback.detailsPlaceholder' | 'search.ai.feedback.thanks' | 'search.ai.toolCall.executed' | 'search.ai.toolCall.executing' | 'search.ai.toolCall.withArgs' | 'search.ai.button' | 'search.ai.label' | 'search.ai.disclaimer' | 'search.ai.error.description' | 'search.ai.error.description.forbidden' | 'search.ai.error.description.unauthorized' | 'search.ai.error.header' | 'search.ai.error.header.forbidden' | 'search.ai.error.header.unauthorized' | 'search.ai.feedback.more' | 'search.searchItem.deprecated' | 'search.groups.all' | 'search.filter.field.footer' | 'aiAssistant.trigger' | 'toc.header' | 'footer.copyrightText' | 'page.homeButton' | 'page.forbidden.title' | 'page.forbidden.description' | 'page.notFound.title' | 'page.notFound.description' | 'page.apiNotFound.title' | 'page.apiNotFound.description' | 'page.apiNotFound.hint' | 'page.apiNotFound.backButton' | 'page.mcpNotAllowed.title' | 'page.mcpNotAllowed.description' | 'page.mcpNotAllowed.publicNote' | 'page.mcpNotAllowed.publicEndpointHint' | 'page.mcpNotAllowed.mainEndpointHint' | 'page.mcpNotAllowed.snippets.terminal.hint' | 'page.mcpNotAllowed.snippets.claudeCode.headline' | 'page.mcpNotAllowed.snippets.claudeDesktop.headline' | 'page.mcpNotAllowed.snippets.claudeDesktop.instruction' | 'page.mcpNotAllowed.snippets.chatgptApp.headline' | 'page.mcpNotAllowed.snippets.chatgptApp.instruction' | 'page.mcpNotAllowed.snippets.codexCli.headline' | 'page.mcpNotAllowed.snippets.prompt.headline' | 'page.mcpNotAllowed.snippets.prompt.hint' | 'page.mcpNotAllowed.snippets.json.hint' | 'page.mcpNotAllowed.tabs.claude' | 'page.mcpNotAllowed.tabs.chatgpt' | 'page.mcpNotAllowed.tabs.json' | 'page.lastUpdated.timeago' | 'page.lastUpdated.on' | 'catalog.filters.placeholder' | 'catalog.filters.title' | 'catalog.filters.add' | 'catalog.filters.clearAll' | 'catalog.filters.select.addFilter' | 'catalog.filters.select.all' | 'catalog.filters.done' | 'catalog.catalogs.all.title' | 'catalog.catalogs.all.description' | 'catalog.catalogs.all.switcherLabel' | 'catalog.catalogs.service.title' | 'catalog.catalogs.service.description' | 'catalog.catalogs.service.switcherLabel' | 'catalog.catalogs.user.title' | 'catalog.catalogs.user.description' | 'catalog.catalogs.user.switcherLabel' | 'catalog.catalogs.team.title' | 'catalog.catalogs.team.description' | 'catalog.catalogs.team.switcherLabel' | 'catalog.catalogs.domain.title' | 'catalog.catalogs.domain.description' | 'catalog.catalogs.domain.switcherLabel' | 'catalog.catalogs.apiDescription.title' | 'catalog.catalogs.apiDescription.description' | 'catalog.catalogs.apiDescription.switcherLabel' | 'catalog.catalogs.dataSchema.title' | 'catalog.catalogs.dataSchema.description' | 'catalog.catalogs.dataSchema.switcherLabel' | 'catalog.catalogs.apiOperation.title' | 'catalog.catalogs.apiOperation.description' | 'catalog.catalogs.apiOperation.switcherLabel' | 'catalog.entity.metadata.title' | 'catalog.entity.schema.title' | 'catalog.entity.properties.apiDescription.title' | 'catalog.backToAllLabel' | 'catalog.notConnected' | 'catalog.tags.label' | 'catalog.sort' | 'catalog.catalogs.label' | 'catalog.owners.label' | 'catalog.repositories.label' | 'catalog.email.label' | 'catalog.format.label' | 'catalog.entityType.label' | 'catalog.domains.label' | 'catalog.contact.label' | 'catalog.methodAndPath.label' | 'catalog.links.label' | 'catalog.metadata.domains' | 'catalog.metadata.owners' | 'catalog.history.button.label' | 'catalog.history.sidebar.title' | 'catalog.history.sidebar.close' | 'catalog.history.version.label' | 'catalog.filters.close' | 'catalog.history.version.notSpecified' | 'catalog.history.version.default' | 'catalog.history.revisions.limitMessage' | 'catalog.history.revision.current' | 'catalog.history.revisions.showLess' | 'catalog.history.revisions.showMore' | 'sidebar.menu.backLabel' | 'sidebar.menu.backToLabel' | 'sidebar.actions.show' | 'sidebar.actions.hide' | 'sidebar.actions.changeToSingleColumn' | 'sidebar.actions.changeToTwoColumns' | 'sidebar.actions.singleColumn' | 'sidebar.actions.twoColumns' | 'versionPicker.label' | 'versionPicker.unversioned' | 'codeSnippet.copy.buttonText' | 'codeSnippet.copy.tooltipText' | 'codeSnippet.copy.toasterText' | 'markdown.editPage.text' | 'feedback.settings.comment.submitText' | 'feedback.settings.comment.label' | 'feedback.settings.comment.send' | 'feedback.settings.comment.cancel' | 'feedback.settings.comment.maxLength' | 'feedback.settings.comment.satisfiedLabel' | 'feedback.settings.comment.neutralLabel' | 'feedback.settings.comment.dissatisfiedLabel' | 'feedback.settings.submitText' | 'feedback.settings.label' | 'feedback.settings.reasons.label' | 'feedback.submit' | 'feedback.cancel' | 'feedback.settings.comment.likeLabel' | 'feedback.settings.comment.dislikeLabel' | 'feedback.sentiment.thumbUp' | 'feedback.sentiment.thumbDown' | 'feedback.settings.leftScaleLabel' | 'feedback.settings.rightScaleLabel' | 'feedback.settings.optionalEmail.placeholder' | 'feedback.settings.optionalEmail.label' | 'codeSnippet.report.buttonText' | 'codeSnippet.report.tooltipText' | 'codeSnippet.report.label' | 'codeSnippet.expand.tooltipText' | 'codeSnippet.collapse.tooltipText' | 'jsonViewer.showMore' | 'jsonViewer.showLess' | 'userMenu.login' | 'userMenu.logout' | 'userMenu.devOnboardingLabel' | 'mobileMenu.mainMenu' | 'mobileMenu.previous' | 'mobileMenu.products' | 'mobileMenu.version' | 'navbar.products' | 'page.nextButton' | 'page.previousButton' | 'page.actions.copyButtonText' | 'page.actions.copyTitle' | 'page.actions.copyDescription' | 'page.actions.viewAsMdTitle' | 'page.actions.viewAsMdButtonText' | 'page.actions.viewAsMdDescription' | 'page.actions.chatGptTitle' | 'page.actions.chatGptButtonText' | 'page.actions.chatGptDescription' | 'page.actions.claudeTitle' | 'page.actions.claudeButtonText' | 'page.actions.claudeDescription' | 'page.actions.cursorMcpButtonText' | 'page.actions.cursorMcpTitle' | 'page.actions.cursorMcpDescription' | 'page.actions.connectMcp' | 'page.actions.connectMcp.cursor' | 'page.actions.connectMcp.cursorDescription' | 'page.actions.connectMcp.vscode' | 'page.actions.connectMcp.vscodeDescription' | 'page.actions.connectMcp.claudeCode' | 'page.actions.connectMcp.claudeCodeDescription' | 'page.actions.connectMcp.codex' | 'page.actions.connectMcp.codexDescription' | 'page.actions.connectMcp.copyConfig' | 'page.actions.connectMcp.copyConfigDescription' | 'page.actions.connectMcp.moreOptions' | 'page.actions.moreActions' | 'openapi.download.description.title' | 'openapi.info.title' | 'openapi.info.contact.url' | 'openapi.info.contact.name' | 'openapi.info.license' | 'openapi.info.termsOfService' | 'openapi.info.metadata.title' | 'graphql.info.metadata.title' | 'openapi.key' | 'openapi.value' | 'openapi.enum' | 'openapi.items' | 'openapi.default' | 'openapi.variable' | 'openapi.variables' | 'openapi.actions.show' | 'openapi.actions.hide' | 'openapi.actions.more' | 'openapi.languages.title' | 'openapi.languages.moreButton.tooltipText' | 'openapi.servers.title' | 'openapi.operations' | 'openapi.schemas' | 'openapi.webhooks' | 'openapi.description' | 'openapi.badges.deprecated' | 'openapi.badges.required' | 'openapi.badges.webhook' | 'openapi.request' | 'openapi.path' | 'openapi.query' | 'openapi.querystring' | 'openapi.cookie' | 'openapi.header' | 'openapi.body' | 'openapi.responses' | 'openapi.response' | 'openapi.callbacks' | 'openapi.callbackRequest' | 'openapi.callbackResponse' | 'openapi.payload' | 'openapi.discriminator' | 'openapi.contentType' | 'openapi.tryIt' | 'openapi.loading' | 'openapi.example' | 'openapi.examples' | 'openapi.additionalProperties' | 'openapi.patternProperties' | 'openapi.required' | 'openapi.recursive' | 'openapi.complex' | 'openapi.property' | 'openapi.properties' | 'openapi.details' | 'openapi.hideExample' | 'openapi.showExample' | 'openapi.expandAll' | 'openapi.collapseAll' | 'openapi.viewSecurityDetails' | 'openapi.noResponseExample' | 'openapi.discriminator.searchPlaceholder' | 'openapi.discriminator.searchNoResults' | 'openapi.discriminator.defaultMapping' | 'openapi.discriminator.defaultMappingTooltip' | 'openapi.noResponseContent' | 'openapi.noRequestPayload' | 'openapi.noRequestData' | 'openapi.hidePattern' | 'openapi.showPattern' | 'openapi.authorizationUrl' | 'openapi.tokenUrl' | 'openapi.refreshUrl' | 'openapi.showOptionalScopes' | 'openapi.hideOptionalScopes' | 'openapi.security' | 'openapi.httpAuthorizationScheme' | 'openapi.bearerFormat' | 'openapi.parameterName' | 'openapi.flowType' | 'openapi.connectUrl' | 'openapi.requiredScopes' | 'openapi.unsupportedLanguage' | 'openapi.failedToGenerateCodeSample' | 'openapi.schemaCatalogLink.title' | 'openapi.schemaCatalogLink.copyButtonTooltip' | 'openapi.schemaCatalogLink.copiedTooltip' | 'openapi.mcp.title' | 'openapi.mcp.endpoint' | 'openapi.mcp.tools' | 'openapi.mcp.protocolVersion' | 'openapi.mcp.capabilities' | 'openapi.mcp.experimentalCapabilities' | 'openapi.mcp.inputSchema' | 'openapi.mcp.inputExample' | 'openapi.mcp.outputSchema' | 'openapi.mcp.outputExample' | 'openapi.mcp.exampleTitle' | 'openapi.mcp.argumentsExample' | 'asyncapi.download.description.title' | 'asyncapi.info.title' | 'asyncapi.info.contact.url' | 'asyncapi.info.contact.name' | 'asyncapi.info.license' | 'asyncapi.info.termsOfService' | 'asyncapi.key' | 'asyncapi.value' | 'asyncapi.variables' | 'asyncapi.required' | 'asyncapi.requiredScopes' | 'asyncapi.viewSecurityDetails' | 'graphql.download.description.title' | 'graphql.info.title' | 'graphql.info.contact.url' | 'graphql.info.contact.name' | 'graphql.info.license' | 'graphql.info.termsOfService' | 'graphql.overview' | 'graphql.metadata' | 'graphql.key' | 'graphql.value' | 'graphql.queries' | 'graphql.mutations' | 'graphql.subscriptions' | 'graphql.directives' | 'graphql.objects' | 'graphql.interfaces' | 'graphql.unions' | 'graphql.enums' | 'graphql.inputs' | 'graphql.scalars' | 'graphql.actions.show' | 'graphql.actions.hide' | 'graphql.actions.more' | 'graphql.fields' | 'graphql.inputFields' | 'graphql.values' | 'graphql.arguments.label' | 'graphql.arguments.show' | 'graphql.arguments.hide' | 'graphql.arguments.here' | 'graphql.returnTypes.label' | 'graphql.returnTypes.show' | 'graphql.returnTypes.hide' | 'graphql.possibleTypes' | 'graphql.defaultValue' | 'graphql.deprecationReason' | 'graphql.requiredScopes' | 'graphql.viewSecurityDetails' | 'graphql.objectScopes' | 'graphql.fieldScopes' | 'graphql.implementedInterfaces' | 'graphql.implementedBy' | 'graphql.nonNull' | 'graphql.required' | 'asyncapi.badges.deprecated' | 'graphql.badges.deprecated' | 'asyncapi.actions.show' | 'asyncapi.actions.hide' | 'asyncapi.actions.more' | 'asyncapi.payload' | 'asyncapi.parameters' | 'asyncapi.messages' | 'asyncapi.contentType' | 'asyncapi.moreDetails' | 'asyncapi.property' | 'asyncapi.properties' | 'asyncapi.details' | 'asyncapi.reply' | 'asyncapi.servers.title' | 'graphql.variables' | 'graphql.querySample' | 'graphql.mutationSample' | 'graphql.subscriptionSample' | 'graphql.responseSample' | 'graphql.locations' | 'graphql.sample' | 'graphql.referenced' | 'graphql.content.fragment' | 'button.download.tooltipText' | 'button.externalLink.tooltipText' | 'button.email.tooltipText' | 'codeWalkthrough.download' | 'codeWalkthrough.preview' | 'time.justNow' | 'time.past.second' | 'time.past.seconds' | 'time.past.minute' | 'time.past.minutes' | 'time.past.hour' | 'time.past.hours' | 'time.past.day' | 'time.past.days' | 'time.past.week' | 'time.past.weeks' | 'time.past.month' | 'time.past.months' | 'time.past.year' | 'time.past.years' | 'page.internalServerError.title' | 'page.internalServerError.description' | 'page.skipToContent.label' | 'select.noResults' | 'loaders.loading' | 'filter.dateRange.from' | 'filter.dateRange.to' | 'diagram.openFullscreen' | 'diagram.zoomIn' | 'diagram.zoomOut' | 'diagram.reset' | 'diagram.close' | 'diagram.viewer';
2
+ export type TranslationKey = 'dev.newApp' | 'dev.newApp.text' | 'dev.sidebar.header' | 'dev.sidebar.footer.text' | 'dev.create.app.dialog.appName.placeholder' | 'dev.create.app.dialog.appName.error' | 'dev.create.app.dialog.selectAPIs' | 'dev.create.app.dialog.description' | 'dev.create.app.dialog.description.placeholder' | 'dev.create.app.dialog.create' | 'dev.create.app.dialog.cancel' | 'dev.main.tab.appKeys' | 'dev.main.tab.logs' | 'dev.app.description.title' | 'dev.edit.description.dialog.title' | 'dev.edit.description.dialog.save' | 'dev.edit.description.dialog.cancel' | 'dev.create.app.dialog.callbackUrls' | 'dev.create.app.dialog.callbackUrls.placeholder' | 'dev.create.app.dialog.callbackUrls.hint' | 'dev.app.callbackUrls.title' | 'dev.edit.callbackUrls.dialog.title' | 'dev.edit.callbackUrls.dialog.placeholder' | 'dev.edit.callbackUrls.dialog.hint' | 'dev.edit.callbackUrls.dialog.save' | 'dev.edit.callbackUrls.dialog.cancel' | 'dev.edit.apis.dialog.selectedAPIs' | 'dev.app.key.create' | 'dev.create.key.dialog.title' | 'dev.create.key.dialog.create' | 'dev.create.key.dialog.cancel' | 'dev.app.edit' | 'dev.app.delete' | 'dev.edit.app.dialog.title' | 'dev.edit.app.dialog.save' | 'dev.edit.app.dialog.cancel' | 'dev.delete.app.dialog.title' | 'dev.delete.app.dialog.confirmation' | 'dev.delete.app.dialog.delete' | 'dev.delete.app.dialog.cancel' | 'dev.app.key.roll' | 'dev.roll.key.dialog.title' | 'dev.roll.key.dialog.apiKey' | 'dev.roll.key.dialog.expires' | 'dev.roll.key.dialog.confirmation' | 'dev.roll.key.dialog.cancel' | 'dev.roll.key.dialog.roll' | 'dev.update.key.dialog.title' | 'dev.update.key.dialog.update' | 'dev.update.key.dialog.cancel' | 'dev.app.key.api.name' | 'dev.app.key.api.status' | 'dev.app.key.api.edit' | 'dev.edit.apis.dialog.title' | 'dev.edit.apis.dialog.apiKey' | 'dev.edit.apis.dialog.save' | 'dev.edit.apis.dialog.cancel' | 'dev.select.placeholder' | 'dev.app.overview.status.pending' | 'dev.app.overview.status.approved' | 'dev.app.overview.status.revoked' | 'dev.app.overview.status' | 'dev.app.overview.non-production' | 'dev.app.overview.production' | 'dev.app.overview.clientId' | 'dev.app.overview.apiKey' | 'dev.app.key.revoke' | 'dev.revoke.key.dialog.title' | 'dev.revoke.key.dialog.apiKey' | 'dev.revoke.key.dialog.expires' | 'dev.revoke.key.dialog.confirmation' | 'dev.revoke.key.dialog.revoke' | 'dev.revoke.key.dialog.cancel' | 'dev.app.overview.expires' | 'dev.app.overview.created' | 'dev.app.overview.visibilityToggle.hide' | 'dev.app.overview.visibilityToggle.show' | 'search.loading' | 'search.noResults.title' | 'search.keys.navigate' | 'search.keys.select' | 'search.keys.exit' | 'search.label' | 'search.cancel' | 'search.recent' | 'search.navbar.label' | 'search.suggested' | 'search.showMore' | 'search.error.title' | 'search.error.button' | 'search.filter.title' | 'search.filter.reset' | 'search.filter.field.reset' | 'search.ai.welcomeText' | 'search.ai.newConversation' | 'search.ai.backToSearch' | 'search.ai.back' | 'search.ai.assistant' | 'search.ai.placeholder' | 'search.ai.generatingResponse' | 'search.ai.followUpQuestion' | 'search.ai.send' | 'search.ai.suggestionsTitle' | 'search.ai.thinkingText' | 'search.ai.resourcesFound' | 'search.ai.resourcesFound.basedOn' | 'search.ai.resourcesFound.resources' | 'search.ai.feedback.title' | 'search.ai.feedback.detailsPlaceholder' | 'search.ai.feedback.thanks' | 'search.ai.toolCall.executed' | 'search.ai.toolCall.executing' | 'search.ai.toolCall.withArgs' | 'search.ai.button' | 'search.ai.label' | 'search.ai.disclaimer' | 'search.ai.error.description' | 'search.ai.error.description.forbidden' | 'search.ai.error.description.unauthorized' | 'search.ai.error.header' | 'search.ai.error.header.forbidden' | 'search.ai.error.header.unauthorized' | 'search.ai.feedback.more' | 'search.searchItem.deprecated' | 'search.searchItem.enum' | 'search.searchItem.example' | 'search.groups.all' | 'search.filter.field.footer' | 'aiAssistant.trigger' | 'toc.header' | 'footer.copyrightText' | 'page.homeButton' | 'page.forbidden.title' | 'page.forbidden.description' | 'page.notFound.title' | 'page.notFound.description' | 'page.apiNotFound.title' | 'page.apiNotFound.description' | 'page.apiNotFound.hint' | 'page.apiNotFound.backButton' | 'page.mcpNotAllowed.title' | 'page.mcpNotAllowed.description' | 'page.mcpNotAllowed.publicNote' | 'page.mcpNotAllowed.publicEndpointHint' | 'page.mcpNotAllowed.mainEndpointHint' | 'page.mcpNotAllowed.snippets.terminal.hint' | 'page.mcpNotAllowed.snippets.claudeCode.headline' | 'page.mcpNotAllowed.snippets.claudeDesktop.headline' | 'page.mcpNotAllowed.snippets.claudeDesktop.instruction' | 'page.mcpNotAllowed.snippets.chatgptApp.headline' | 'page.mcpNotAllowed.snippets.chatgptApp.instruction' | 'page.mcpNotAllowed.snippets.codexCli.headline' | 'page.mcpNotAllowed.snippets.prompt.headline' | 'page.mcpNotAllowed.snippets.prompt.hint' | 'page.mcpNotAllowed.snippets.json.hint' | 'page.mcpNotAllowed.tabs.claude' | 'page.mcpNotAllowed.tabs.chatgpt' | 'page.mcpNotAllowed.tabs.json' | 'page.lastUpdated.timeago' | 'page.lastUpdated.on' | 'catalog.filters.placeholder' | 'catalog.filters.title' | 'catalog.filters.add' | 'catalog.filters.clearAll' | 'catalog.filters.select.addFilter' | 'catalog.filters.select.all' | 'catalog.filters.done' | 'catalog.catalogs.all.title' | 'catalog.catalogs.all.description' | 'catalog.catalogs.all.switcherLabel' | 'catalog.catalogs.service.title' | 'catalog.catalogs.service.description' | 'catalog.catalogs.service.switcherLabel' | 'catalog.catalogs.user.title' | 'catalog.catalogs.user.description' | 'catalog.catalogs.user.switcherLabel' | 'catalog.catalogs.team.title' | 'catalog.catalogs.team.description' | 'catalog.catalogs.team.switcherLabel' | 'catalog.catalogs.domain.title' | 'catalog.catalogs.domain.description' | 'catalog.catalogs.domain.switcherLabel' | 'catalog.catalogs.apiDescription.title' | 'catalog.catalogs.apiDescription.description' | 'catalog.catalogs.apiDescription.switcherLabel' | 'catalog.catalogs.dataSchema.title' | 'catalog.catalogs.dataSchema.description' | 'catalog.catalogs.dataSchema.switcherLabel' | 'catalog.catalogs.apiOperation.title' | 'catalog.catalogs.apiOperation.description' | 'catalog.catalogs.apiOperation.switcherLabel' | 'catalog.entity.metadata.title' | 'catalog.entity.schema.title' | 'catalog.entity.properties.apiDescription.title' | 'catalog.backToAllLabel' | 'catalog.notConnected' | 'catalog.tags.label' | 'catalog.sort' | 'catalog.catalogs.label' | 'catalog.owners.label' | 'catalog.repositories.label' | 'catalog.email.label' | 'catalog.format.label' | 'catalog.entityType.label' | 'catalog.domains.label' | 'catalog.contact.label' | 'catalog.methodAndPath.label' | 'catalog.links.label' | 'catalog.metadata.domains' | 'catalog.metadata.owners' | 'catalog.history.button.label' | 'catalog.history.sidebar.title' | 'catalog.history.sidebar.close' | 'catalog.history.version.label' | 'catalog.filters.close' | 'catalog.history.version.notSpecified' | 'catalog.history.version.default' | 'catalog.history.revisions.limitMessage' | 'catalog.history.revision.current' | 'catalog.history.revisions.showLess' | 'catalog.history.revisions.showMore' | 'sidebar.menu.backLabel' | 'sidebar.menu.backToLabel' | 'sidebar.actions.show' | 'sidebar.actions.hide' | 'sidebar.actions.changeToSingleColumn' | 'sidebar.actions.changeToTwoColumns' | 'sidebar.actions.singleColumn' | 'sidebar.actions.twoColumns' | 'versionPicker.label' | 'versionPicker.unversioned' | 'codeSnippet.copy.buttonText' | 'codeSnippet.copy.tooltipText' | 'codeSnippet.copy.toasterText' | 'markdown.editPage.text' | 'feedback.settings.comment.submitText' | 'feedback.settings.comment.label' | 'feedback.settings.comment.send' | 'feedback.settings.comment.cancel' | 'feedback.settings.comment.maxLength' | 'feedback.settings.comment.satisfiedLabel' | 'feedback.settings.comment.neutralLabel' | 'feedback.settings.comment.dissatisfiedLabel' | 'feedback.settings.submitText' | 'feedback.settings.label' | 'feedback.settings.reasons.label' | 'feedback.submit' | 'feedback.cancel' | 'feedback.settings.comment.likeLabel' | 'feedback.settings.comment.dislikeLabel' | 'feedback.sentiment.thumbUp' | 'feedback.sentiment.thumbDown' | 'feedback.settings.leftScaleLabel' | 'feedback.settings.rightScaleLabel' | 'feedback.settings.optionalEmail.placeholder' | 'feedback.settings.optionalEmail.label' | 'codeSnippet.report.buttonText' | 'codeSnippet.report.tooltipText' | 'codeSnippet.report.label' | 'codeSnippet.expand.tooltipText' | 'codeSnippet.collapse.tooltipText' | 'jsonViewer.showMore' | 'jsonViewer.showLess' | 'userMenu.login' | 'userMenu.logout' | 'userMenu.devOnboardingLabel' | 'mobileMenu.mainMenu' | 'mobileMenu.previous' | 'mobileMenu.products' | 'mobileMenu.version' | 'navbar.products' | 'page.nextButton' | 'page.previousButton' | 'page.actions.copyButtonText' | 'page.actions.copyTitle' | 'page.actions.copyDescription' | 'page.actions.viewAsMdTitle' | 'page.actions.viewAsMdButtonText' | 'page.actions.viewAsMdDescription' | 'page.actions.chatGptTitle' | 'page.actions.chatGptButtonText' | 'page.actions.chatGptDescription' | 'page.actions.claudeTitle' | 'page.actions.claudeButtonText' | 'page.actions.claudeDescription' | 'page.actions.cursorMcpButtonText' | 'page.actions.cursorMcpTitle' | 'page.actions.cursorMcpDescription' | 'page.actions.connectMcp' | 'page.actions.connectMcp.cursor' | 'page.actions.connectMcp.cursorDescription' | 'page.actions.connectMcp.vscode' | 'page.actions.connectMcp.vscodeDescription' | 'page.actions.connectMcp.claudeCode' | 'page.actions.connectMcp.claudeCodeDescription' | 'page.actions.connectMcp.codex' | 'page.actions.connectMcp.codexDescription' | 'page.actions.connectMcp.copyConfig' | 'page.actions.connectMcp.copyConfigDescription' | 'page.actions.connectMcp.moreOptions' | 'page.actions.moreActions' | 'openapi.download.description.title' | 'openapi.info.title' | 'openapi.info.contact.url' | 'openapi.info.contact.name' | 'openapi.info.license' | 'openapi.info.termsOfService' | 'openapi.info.metadata.title' | 'graphql.info.metadata.title' | 'openapi.key' | 'openapi.value' | 'openapi.enum' | 'openapi.items' | 'openapi.default' | 'openapi.variable' | 'openapi.variables' | 'openapi.actions.show' | 'openapi.actions.hide' | 'openapi.actions.more' | 'openapi.languages.title' | 'openapi.languages.moreButton.tooltipText' | 'openapi.servers.title' | 'openapi.operations' | 'openapi.schemas' | 'openapi.webhooks' | 'openapi.description' | 'openapi.badges.deprecated' | 'openapi.badges.required' | 'openapi.badges.webhook' | 'openapi.request' | 'openapi.path' | 'openapi.query' | 'openapi.querystring' | 'openapi.cookie' | 'openapi.header' | 'openapi.body' | 'openapi.responses' | 'openapi.response' | 'openapi.callbacks' | 'openapi.callbackRequest' | 'openapi.callbackResponse' | 'openapi.payload' | 'openapi.discriminator' | 'openapi.contentType' | 'openapi.tryIt' | 'openapi.loading' | 'openapi.example' | 'openapi.examples' | 'openapi.additionalProperties' | 'openapi.patternProperties' | 'openapi.required' | 'openapi.recursive' | 'openapi.complex' | 'openapi.property' | 'openapi.properties' | 'openapi.details' | 'openapi.hideExample' | 'openapi.showExample' | 'openapi.expandAll' | 'openapi.collapseAll' | 'openapi.viewSecurityDetails' | 'openapi.noResponseExample' | 'openapi.discriminator.searchPlaceholder' | 'openapi.discriminator.searchNoResults' | 'openapi.discriminator.defaultMapping' | 'openapi.discriminator.defaultMappingTooltip' | 'openapi.noResponseContent' | 'openapi.noRequestPayload' | 'openapi.noRequestData' | 'openapi.hidePattern' | 'openapi.showPattern' | 'openapi.authorizationUrl' | 'openapi.tokenUrl' | 'openapi.refreshUrl' | 'openapi.showOptionalScopes' | 'openapi.hideOptionalScopes' | 'openapi.security' | 'openapi.httpAuthorizationScheme' | 'openapi.bearerFormat' | 'openapi.parameterName' | 'openapi.flowType' | 'openapi.connectUrl' | 'openapi.requiredScopes' | 'openapi.unsupportedLanguage' | 'openapi.failedToGenerateCodeSample' | 'openapi.schemaCatalogLink.title' | 'openapi.schemaCatalogLink.copyButtonTooltip' | 'openapi.schemaCatalogLink.copiedTooltip' | 'openapi.mcp.title' | 'openapi.mcp.endpoint' | 'openapi.mcp.tools' | 'openapi.mcp.protocolVersion' | 'openapi.mcp.capabilities' | 'openapi.mcp.experimentalCapabilities' | 'openapi.mcp.inputSchema' | 'openapi.mcp.inputExample' | 'openapi.mcp.outputSchema' | 'openapi.mcp.outputExample' | 'openapi.mcp.exampleTitle' | 'openapi.mcp.argumentsExample' | 'asyncapi.download.description.title' | 'asyncapi.info.title' | 'asyncapi.info.contact.url' | 'asyncapi.info.contact.name' | 'asyncapi.info.license' | 'asyncapi.info.termsOfService' | 'asyncapi.key' | 'asyncapi.value' | 'asyncapi.variables' | 'asyncapi.required' | 'asyncapi.requiredScopes' | 'asyncapi.viewSecurityDetails' | 'graphql.download.description.title' | 'graphql.info.title' | 'graphql.info.contact.url' | 'graphql.info.contact.name' | 'graphql.info.license' | 'graphql.info.termsOfService' | 'graphql.overview' | 'graphql.metadata' | 'graphql.key' | 'graphql.value' | 'graphql.queries' | 'graphql.mutations' | 'graphql.subscriptions' | 'graphql.directives' | 'graphql.objects' | 'graphql.interfaces' | 'graphql.unions' | 'graphql.enums' | 'graphql.inputs' | 'graphql.scalars' | 'graphql.actions.show' | 'graphql.actions.hide' | 'graphql.actions.more' | 'graphql.fields' | 'graphql.inputFields' | 'graphql.values' | 'graphql.arguments.label' | 'graphql.arguments.show' | 'graphql.arguments.hide' | 'graphql.arguments.here' | 'graphql.returnTypes.label' | 'graphql.returnTypes.show' | 'graphql.returnTypes.hide' | 'graphql.possibleTypes' | 'graphql.defaultValue' | 'graphql.deprecationReason' | 'graphql.requiredScopes' | 'graphql.viewSecurityDetails' | 'graphql.objectScopes' | 'graphql.fieldScopes' | 'graphql.implementedInterfaces' | 'graphql.implementedBy' | 'graphql.nonNull' | 'graphql.required' | 'asyncapi.badges.deprecated' | 'graphql.badges.deprecated' | 'asyncapi.actions.show' | 'asyncapi.actions.hide' | 'asyncapi.actions.more' | 'asyncapi.payload' | 'asyncapi.parameters' | 'asyncapi.messages' | 'asyncapi.contentType' | 'asyncapi.moreDetails' | 'asyncapi.property' | 'asyncapi.properties' | 'asyncapi.details' | 'asyncapi.reply' | 'asyncapi.servers.title' | 'graphql.variables' | 'graphql.querySample' | 'graphql.mutationSample' | 'graphql.subscriptionSample' | 'graphql.responseSample' | 'graphql.locations' | 'graphql.sample' | 'graphql.referenced' | 'graphql.content.fragment' | 'button.download.tooltipText' | 'button.externalLink.tooltipText' | 'button.email.tooltipText' | 'codeWalkthrough.download' | 'codeWalkthrough.preview' | 'time.justNow' | 'time.past.second' | 'time.past.seconds' | 'time.past.minute' | 'time.past.minutes' | 'time.past.hour' | 'time.past.hours' | 'time.past.day' | 'time.past.days' | 'time.past.week' | 'time.past.weeks' | 'time.past.month' | 'time.past.months' | 'time.past.year' | 'time.past.years' | 'page.internalServerError.title' | 'page.internalServerError.description' | 'page.skipToContent.label' | 'select.noResults' | 'loaders.loading' | 'filter.dateRange.from' | 'filter.dateRange.to' | 'diagram.openFullscreen' | 'diagram.zoomIn' | 'diagram.zoomOut' | 'diagram.reset' | 'diagram.close' | 'diagram.viewer' | 'consent.title' | 'consent.message' | 'consent.privacyPolicy' | 'consent.customize' | 'consent.rejectAll' | 'consent.acceptAll' | 'consent.acceptAllCookies' | 'consent.savePreferences' | 'consent.dialog.title' | 'consent.dialog.description' | 'consent.dialog.close' | 'consent.alwaysOn' | 'consent.alwaysOff' | 'consent.gpcNotice' | 'consent.category.necessary.title' | 'consent.category.necessary.description' | 'consent.category.analytics.title' | 'consent.category.analytics.description' | 'consent.category.marketing.title' | 'consent.category.marketing.description' | 'consent.settingsLink';
3
3
  export type Locale = {
4
4
  code: string;
5
5
  name: string;
@@ -46,6 +46,8 @@ export type ParameterHighlight = {
46
46
  description: string;
47
47
  place: string;
48
48
  path: string[];
49
+ enum?: string;
50
+ example?: string;
49
51
  };
50
52
  export type SearchItemData = {
51
53
  document: SearchHit;
@@ -0,0 +1,3 @@
1
+ import type { ConsentConfig, RedoclyConfig } from '@redocly/config';
2
+ export type SettingsLinkPlacement = 'footer' | 'none';
3
+ export declare function resolveSettingsLinkPlacement(consent: ConsentConfig | undefined, footer: RedoclyConfig['footer'] | undefined): SettingsLinkPlacement;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveSettingsLinkPlacement = resolveSettingsLinkPlacement;
4
+ function resolveSettingsLinkPlacement(consent, footer) {
5
+ var _a;
6
+ const choice = (_a = consent === null || consent === void 0 ? void 0 : consent.settingsLink) !== null && _a !== void 0 ? _a : 'auto';
7
+ if (choice !== 'auto') {
8
+ return choice;
9
+ }
10
+ const footerShown = Boolean(footer) &&
11
+ !(footer === null || footer === void 0 ? void 0 : footer.hide) &&
12
+ (Boolean(footer === null || footer === void 0 ? void 0 : footer.copyrightText) || (Array.isArray(footer === null || footer === void 0 ? void 0 : footer.items) && footer.items.length > 0));
13
+ return footerShown ? 'footer' : 'none';
14
+ }
15
+ //# sourceMappingURL=consent-settings-link-placement.js.map
@@ -49,3 +49,4 @@ export * from './tooltip-placement';
49
49
  export * from './telemetry/get-base-data-attributes';
50
50
  export * from './telemetry/generate-before-after-context';
51
51
  export * from './RenderWithLink';
52
+ export * from './consent-settings-link-placement';
@@ -65,4 +65,5 @@ __exportStar(require("./tooltip-placement"), exports);
65
65
  __exportStar(require("./telemetry/get-base-data-attributes"), exports);
66
66
  __exportStar(require("./telemetry/generate-before-after-context"), exports);
67
67
  __exportStar(require("./RenderWithLink"), exports);
68
+ __exportStar(require("./consent-settings-link-placement"), exports);
68
69
  //# sourceMappingURL=index.js.map
@@ -38,7 +38,7 @@ function slugifyMcpServerName(name) {
38
38
  return name
39
39
  .toLowerCase()
40
40
  .replace(/[^a-z0-9_-]+/g, '-')
41
- .replace(/^-+|-+$/g, '');
41
+ .replace(/^-+|(?<!-)-+$/g, '');
42
42
  }
43
43
  function generateClaudeCodeCommand(config) {
44
44
  return `claude mcp add --transport http ${slugifyMcpServerName(config.serverName)} ${config.url}`;
@@ -8,17 +8,18 @@ const TRANSLATION_KEYS = {
8
8
  version: 'mobileMenu.version',
9
9
  };
10
10
  const mapNavbarItems = (items, defaultLocale, currentLocale, locales, location) => {
11
- return items.map((navItem) => { var _a; return (Object.assign(Object.assign(Object.assign(Object.assign({}, navItem), (navItem.items && {
11
+ return items.map((navItem) => { var _a; return (Object.assign(Object.assign(Object.assign({}, navItem), (navItem.items && {
12
12
  items: (0, exports.mapNavbarItems)(navItem.items, defaultLocale, currentLocale, locales, location),
13
- })), ('link' in navItem && { link: navItem.link || '/' })), { active: 'link' in navItem &&
14
- (0, exports.isItemActive)(navItem, defaultLocale, currentLocale, locales, location), hasActiveSubItem: !!((_a = navItem.items) === null || _a === void 0 ? void 0 : _a.find((item) => (0, exports.isItemActive)(item, defaultLocale, currentLocale, locales, location))) })); });
13
+ })), { active: (0, exports.isItemActive)(navItem, defaultLocale, currentLocale, locales, location), hasActiveSubItem: !!((_a = navItem.items) === null || _a === void 0 ? void 0 : _a.find((item) => (0, exports.isItemActive)(item, defaultLocale, currentLocale, locales, location))) })); });
15
14
  };
16
15
  exports.mapNavbarItems = mapNavbarItems;
17
16
  const isItemActive = (item, defaultLocale, currentLocale, locales, location) => {
17
+ if (!item.link)
18
+ return false;
18
19
  const pathHash = location.pathname + location.hash;
19
20
  const link = item.languageInsensitive
20
- ? item.link || ''
21
- : (0, urls_1.getPathnameForLocale)(item.link || '/', defaultLocale, currentLocale, locales);
21
+ ? item.link
22
+ : (0, urls_1.getPathnameForLocale)(item.link, defaultLocale, currentLocale, locales);
22
23
  return pathHash === (0, urls_1.withPathPrefix)(link);
23
24
  };
24
25
  exports.isItemActive = isItemActive;
@@ -18,7 +18,9 @@ const common_1 = require("../constants/common");
18
18
  function combineUrls(baseURL, ...relativeURLs) {
19
19
  let res = baseURL;
20
20
  for (let relativeURL of relativeURLs) {
21
- res = relativeURL ? res.replace(/[/\\]+$/, '') + '/' + relativeURL.replace(/^[/\\]+/, '') : res;
21
+ res = relativeURL
22
+ ? res.replace(/(?<![/\\])[/\\]+$/, '') + '/' + relativeURL.replace(/^[/\\]+/, '')
23
+ : res;
22
24
  }
23
25
  return res;
24
26
  }
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import type { IconProps } from '../../icons/types';
3
+ declare const Icon: (props: IconProps) => React.JSX.Element;
4
+ export declare const ExpandCollapseIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components").FastOmit<{
5
+ color?: string;
6
+ size?: string;
7
+ className?: string;
8
+ 'data-component-name'?: string;
9
+ } & React.SVGProps<SVGSVGElement>, "data-component-name" | "size" | keyof React.SVGProps<SVGSVGElement>> & {
10
+ color?: string;
11
+ size?: string;
12
+ className?: string;
13
+ 'data-component-name'?: string;
14
+ } & React.SVGProps<SVGSVGElement>, "$collapse"> & {
15
+ $collapse?: boolean;
16
+ }, "data-component-name"> & Partial<Pick<import("styled-components").FastOmit<import("styled-components").FastOmit<{
17
+ color?: string;
18
+ size?: string;
19
+ className?: string;
20
+ 'data-component-name'?: string;
21
+ } & React.SVGProps<SVGSVGElement>, "data-component-name" | "size" | keyof React.SVGProps<SVGSVGElement>> & {
22
+ color?: string;
23
+ size?: string;
24
+ className?: string;
25
+ 'data-component-name'?: string;
26
+ } & React.SVGProps<SVGSVGElement>, "$collapse"> & {
27
+ $collapse?: boolean;
28
+ }, "data-component-name">>> & string & Omit<typeof Icon, keyof React.Component<any, {}, any>>;
29
+ export {};
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.ExpandCollapseIcon = void 0;
40
+ const react_1 = __importDefault(require("react"));
41
+ const styled_components_1 = __importStar(require("styled-components"));
42
+ const utils_1 = require("../../core/utils");
43
+ const Icon = (props) => (react_1.default.createElement("svg", Object.assign({ viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
44
+ react_1.default.createElement("path", { className: "corner-top", d: "M12.2432 8.70703H11.2461L11.2422 4.75781L7.29297 4.75391V3.75781H12.2432V8.70703Z" }),
45
+ react_1.default.createElement("path", { className: "corner-bottom", d: "M4.75781 11.2422L8.70703 11.2461V12.2432H3.75781V7.29297H4.75391L4.75781 11.2422Z" })));
46
+ exports.ExpandCollapseIcon = (0, styled_components_1.default)(Icon).attrs({
47
+ 'data-component-name': 'icons/ExpandCollapseIcon/ExpandCollapseIcon',
48
+ }) `
49
+ path {
50
+ fill: ${({ color }) => (0, utils_1.getCssColorVariable)(color)};
51
+ transform-box: view-box;
52
+ transition: transform 0.3s ease-in-out;
53
+
54
+ @media (prefers-reduced-motion: reduce) {
55
+ transition: none;
56
+ }
57
+ }
58
+
59
+ .corner-top {
60
+ transform-origin: 10.756px 5.244px;
61
+ }
62
+
63
+ .corner-bottom {
64
+ transform-origin: 5.244px 10.756px;
65
+ }
66
+
67
+ ${({ $collapse }) => $collapse &&
68
+ (0, styled_components_1.css) `
69
+ .corner-top {
70
+ transform: rotate(180deg);
71
+ }
72
+
73
+ .corner-bottom {
74
+ transform: rotate(-180deg);
75
+ }
76
+ `}
77
+
78
+ height: ${({ size }) => size || '16px'};
79
+ width: ${({ size }) => size || '16px'};
80
+ `;
81
+ //# sourceMappingURL=ExpandCollapseIcon.js.map
package/lib/index.d.ts CHANGED
@@ -226,6 +226,7 @@ export * from './icons/LinkIcon/LinkIcon';
226
226
  export * from './icons/LaunchIcon/LaunchIcon';
227
227
  export * from './icons/MinimizeIcon/MinimizeIcon';
228
228
  export * from './icons/MaximizeIcon/MaximizeIcon';
229
+ export * from './icons/ExpandCollapseIcon/ExpandCollapseIcon';
229
230
  export * from './icons/MarkdownFullIcon/MarkdownFullIcon';
230
231
  export * from './icons/DocumentBlankIcon/DocumentBlankIcon';
231
232
  export * from './icons/WarningSquareIcon/WarningSquareIcon';
package/lib/index.js CHANGED
@@ -289,6 +289,7 @@ __exportStar(require("./icons/LinkIcon/LinkIcon"), exports);
289
289
  __exportStar(require("./icons/LaunchIcon/LaunchIcon"), exports);
290
290
  __exportStar(require("./icons/MinimizeIcon/MinimizeIcon"), exports);
291
291
  __exportStar(require("./icons/MaximizeIcon/MaximizeIcon"), exports);
292
+ __exportStar(require("./icons/ExpandCollapseIcon/ExpandCollapseIcon"), exports);
292
293
  __exportStar(require("./icons/MarkdownFullIcon/MarkdownFullIcon"), exports);
293
294
  __exportStar(require("./icons/DocumentBlankIcon/DocumentBlankIcon"), exports);
294
295
  __exportStar(require("./icons/WarningSquareIcon/WarningSquareIcon"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@redocly/theme",
3
- "version": "0.70.0-next.1",
3
+ "version": "0.70.0-next.3",
4
4
  "description": "Shared UI components lib",
5
5
  "keywords": [
6
6
  "theme",
@@ -42,7 +42,7 @@
42
42
  "devDependencies": {
43
43
  "@babel/core": "7.29.7",
44
44
  "@markdoc/markdoc": "0.5.2",
45
- "@redocly/realm-asyncapi-sdk": "0.16.0-next.0",
45
+ "@redocly/realm-asyncapi-sdk": "0.16.0-next.1",
46
46
  "@shikijs/types": "3.21.0",
47
47
  "@testing-library/react": "16.3.0",
48
48
  "@testing-library/user-event": "14.6.1",
@@ -71,7 +71,7 @@
71
71
  "webpack": "5.105.2"
72
72
  },
73
73
  "dependencies": {
74
- "@redocly/config": "0.57.0",
74
+ "@redocly/config": "0.58.0",
75
75
  "@tanstack/react-query": "5.62.3",
76
76
  "@tanstack/react-virtual": "3.13.0",
77
77
  "@xyflow/react": "12.8.3",
@@ -10,8 +10,7 @@ import { Tooltip } from '@redocly/theme/components/Tooltip/Tooltip';
10
10
  import type { ReportButtonProps } from '@redocly/theme/core/hooks';
11
11
  import { useThemeHooks, useThemeConfig } from '@redocly/theme/core/hooks';
12
12
  import { DeselectIcon } from '@redocly/theme/icons/DeselectIcon/DeselectIcon';
13
- import { MaximizeIcon } from '@redocly/theme/icons/MaximizeIcon/MaximizeIcon';
14
- import { MinimizeIcon } from '@redocly/theme/icons/MinimizeIcon/MinimizeIcon';
13
+ import { ExpandCollapseIcon } from '@redocly/theme/icons/ExpandCollapseIcon/ExpandCollapseIcon';
15
14
  import { SelectIcon } from '@redocly/theme/icons/SelectIcon/SelectIcon';
16
15
  import { WarningSquareIcon } from '@redocly/theme/icons/WarningSquareIcon/WarningSquareIcon';
17
16
  import { Button } from '@redocly/theme/components/Button/Button';
@@ -116,16 +115,14 @@ export function CodeBlockControls({
116
115
  variant="text"
117
116
  size="small"
118
117
  data-testid="expand-all"
119
- icon={controlsType === 'icon' ? <MaximizeIcon /> : undefined}
118
+ icon={controlsType === 'icon' ? <ExpandCollapseIcon /> : undefined}
120
119
  aria-label="Expand all"
121
120
  onClick={expand?.onClick}
122
121
  >
123
122
  {controlsType !== 'icon' && (expand?.label || 'Expand all')}
124
123
  </ControlButton>
125
124
  </Tooltip>
126
- ) : null}
127
-
128
- {collapse && !codeSnippet?.collapse?.hide ? (
125
+ ) : collapse && !codeSnippet?.collapse?.hide ? (
129
126
  <Tooltip
130
127
  tip={
131
128
  collapse.props?.tooltip ||
@@ -138,7 +135,7 @@ export function CodeBlockControls({
138
135
  variant="text"
139
136
  size="small"
140
137
  data-testid="collapse-all"
141
- icon={controlsType === 'icon' ? <MinimizeIcon /> : undefined}
138
+ icon={controlsType === 'icon' ? <ExpandCollapseIcon $collapse /> : undefined}
142
139
  onClick={collapse?.onClick}
143
140
  aria-label="Collapse all"
144
141
  >
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+
3
+ import type { JSX } from 'react';
4
+
5
+ import { ConsentBanner } from '@redocly/theme/components/Consent/ConsentBanner';
6
+ import { ConsentDialog } from '@redocly/theme/components/Consent/ConsentDialog';
7
+ import { useConsentTelemetry } from '@redocly/theme/core/hooks';
8
+
9
+ export function Consent(): JSX.Element {
10
+ useConsentTelemetry();
11
+
12
+ return (
13
+ <>
14
+ <ConsentBanner />
15
+ <ConsentDialog />
16
+ </>
17
+ );
18
+ }
@@ -0,0 +1,110 @@
1
+ import React from 'react';
2
+ import styled, { keyframes } from 'styled-components';
3
+
4
+ import type { JSX } from 'react';
5
+
6
+ import { Button } from '@redocly/theme/components/Button/Button';
7
+ import { Link } from '@redocly/theme/components/Link/Link';
8
+ import { useThemeHooks } from '@redocly/theme/core/hooks';
9
+
10
+ export function ConsentBanner(): JSX.Element | null {
11
+ const { useConsent, useTranslate } = useThemeHooks();
12
+ const consent = useConsent();
13
+ const { translate } = useTranslate();
14
+
15
+ if (!consent.enabled || consent.mode !== 'opt-in' || consent.decided || consent.isDialogOpen) {
16
+ return null;
17
+ }
18
+
19
+ const title = translate('consent.title', 'We value your privacy');
20
+
21
+ return (
22
+ <BannerWrapper data-component-name="Consent/ConsentBanner" role="region" aria-label={title}>
23
+ <Title>{title}</Title>
24
+ <Message>
25
+ {translate(
26
+ 'consent.message',
27
+ 'By selecting "Accept all cookies", you agree to the use of cookies to improve site navigation, understand how our site is used, and support our marketing efforts. Select "Customize" to choose which types of cookies you allow.',
28
+ )}{' '}
29
+ {consent.config?.privacyPolicyUrl ? (
30
+ <Link to={consent.config.privacyPolicyUrl} external>
31
+ {translate('consent.privacyPolicy', 'Privacy policy')}
32
+ </Link>
33
+ ) : null}
34
+ </Message>
35
+ <Actions>
36
+ <MainActions>
37
+ <Button variant="outlined" onClick={consent.reject}>
38
+ {translate('consent.rejectAll', 'Reject all')}
39
+ </Button>
40
+ <Button variant="primary" onClick={consent.accept}>
41
+ {translate('consent.acceptAllCookies', 'Accept all cookies')}
42
+ </Button>
43
+ </MainActions>
44
+ <Button variant="text" onClick={consent.openDialog}>
45
+ {translate('consent.customize', 'Customize')}
46
+ </Button>
47
+ </Actions>
48
+ </BannerWrapper>
49
+ );
50
+ }
51
+
52
+ const slideUp = keyframes`
53
+ from {
54
+ opacity: 0;
55
+ transform: translateY(16px);
56
+ }
57
+ to {
58
+ opacity: 1;
59
+ transform: translateY(0);
60
+ }
61
+ `;
62
+
63
+ const BannerWrapper = styled.div`
64
+ position: fixed;
65
+ left: var(--consent-banner-offset);
66
+ bottom: var(--consent-banner-offset);
67
+ z-index: var(--consent-banner-z-index);
68
+ display: flex;
69
+ flex-direction: column;
70
+ gap: var(--consent-banner-gap);
71
+ width: var(--consent-banner-width);
72
+ max-width: calc(100vw - 2 * var(--consent-banner-offset));
73
+ padding: var(--consent-banner-padding);
74
+ border: 1px solid var(--consent-banner-border-color);
75
+ border-radius: var(--consent-banner-border-radius);
76
+ background: var(--consent-banner-bg-color);
77
+ color: var(--consent-banner-text-color);
78
+ box-shadow: var(--consent-banner-box-shadow);
79
+ font-family: var(--font-family-base);
80
+
81
+ @media (prefers-reduced-motion: no-preference) {
82
+ animation: ${slideUp} 240ms ease-out;
83
+ }
84
+ `;
85
+
86
+ const Title = styled.h2`
87
+ margin: 0;
88
+ font-size: var(--consent-banner-title-font-size);
89
+ font-weight: var(--font-weight-bold);
90
+ `;
91
+
92
+ const Message = styled.p`
93
+ margin: 0;
94
+ color: var(--text-color-secondary);
95
+ font-size: var(--consent-banner-font-size);
96
+ `;
97
+
98
+ const Actions = styled.div`
99
+ display: flex;
100
+ flex-wrap: wrap;
101
+ gap: var(--consent-banner-gap);
102
+ align-items: center;
103
+ justify-content: space-between;
104
+ `;
105
+
106
+ const MainActions = styled.div`
107
+ display: flex;
108
+ flex-wrap: wrap;
109
+ gap: var(--consent-banner-gap);
110
+ `;