@redocly/theme 0.54.0-next.6 → 0.54.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.
- package/lib/components/Breadcrumbs/Breadcrumbs.js +9 -6
- package/lib/components/Buttons/EditPageButton.js +3 -3
- package/lib/components/CatalogClassic/CatalogClassicActions.js +3 -3
- package/lib/components/CatalogClassic/CatalogClassicCard.js +17 -4
- package/lib/components/CatalogClassic/CatalogClassicInfoBlock.js +3 -3
- package/lib/components/CatalogClassic/CatalogClassicVirtualizedGroups.js +19 -25
- package/lib/components/Feedback/ReportDialog.js +3 -3
- package/lib/components/Filter/FilterCheckboxes.js +3 -3
- package/lib/components/Footer/FooterItem.js +3 -3
- package/lib/components/LanguagePicker/LanguagePicker.js +6 -3
- package/lib/components/Logo/Logo.js +3 -3
- package/lib/components/Menu/MenuItem.js +9 -4
- package/lib/components/Navbar/Navbar.js +5 -5
- package/lib/components/Navbar/NavbarItem.js +3 -3
- package/lib/components/Search/SearchInput.js +3 -3
- package/lib/components/Search/SearchRecent.js +3 -3
- package/lib/components/SidebarActions/SidebarActions.js +5 -7
- package/lib/components/TableOfContent/TableOfContent.js +3 -3
- package/lib/components/UserMenu/LoginButton.js +3 -3
- package/lib/components/UserMenu/LogoutMenuItem.js +3 -3
- package/lib/core/hooks/search/use-search-dialog.js +4 -4
- package/lib/core/hooks/use-color-switcher.js +6 -3
- package/lib/core/hooks/use-product-picker.js +3 -3
- package/lib/core/types/hooks.d.ts +1 -1
- package/lib/core/types/l10n.d.ts +1 -1
- package/lib/core/types/search.d.ts +6 -0
- package/package.json +3 -3
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +9 -6
- package/src/components/Buttons/EditPageButton.tsx +3 -3
- package/src/components/CatalogClassic/CatalogClassicActions.tsx +3 -3
- package/src/components/CatalogClassic/CatalogClassicCard.tsx +19 -4
- package/src/components/CatalogClassic/CatalogClassicInfoBlock.tsx +5 -3
- package/src/components/CatalogClassic/CatalogClassicVirtualizedGroups.tsx +23 -29
- package/src/components/Feedback/ReportDialog.tsx +3 -3
- package/src/components/Filter/FilterCheckboxes.tsx +3 -3
- package/src/components/Footer/FooterItem.tsx +3 -3
- package/src/components/LanguagePicker/LanguagePicker.tsx +6 -3
- package/src/components/Logo/Logo.tsx +3 -3
- package/src/components/Menu/MenuItem.tsx +9 -3
- package/src/components/Navbar/Navbar.tsx +5 -5
- package/src/components/Navbar/NavbarItem.tsx +5 -3
- package/src/components/Search/SearchInput.tsx +3 -3
- package/src/components/Search/SearchRecent.tsx +3 -3
- package/src/components/SidebarActions/SidebarActions.tsx +5 -5
- package/src/components/TableOfContent/TableOfContent.tsx +3 -3
- package/src/components/UserMenu/LoginButton.tsx +3 -3
- package/src/components/UserMenu/LogoutMenuItem.tsx +3 -3
- package/src/core/hooks/search/use-search-dialog.ts +4 -4
- package/src/core/hooks/use-color-switcher.ts +6 -3
- package/src/core/hooks/use-product-picker.ts +3 -3
- package/src/core/types/hooks.ts +1 -40
- package/src/core/types/l10n.ts +3 -1
- package/src/core/types/search.ts +6 -0
|
@@ -4,16 +4,16 @@ exports.useProductPicker = useProductPicker;
|
|
|
4
4
|
const react_router_dom_1 = require("react-router-dom");
|
|
5
5
|
const hooks_1 = require("../../core/hooks");
|
|
6
6
|
function useProductPicker() {
|
|
7
|
-
const { useCurrentProduct, useProducts,
|
|
7
|
+
const { useCurrentProduct, useProducts, useOtelTelemetry, useLoadAndNavigate } = (0, hooks_1.useThemeHooks)();
|
|
8
8
|
const currentProduct = useCurrentProduct();
|
|
9
9
|
const products = useProducts();
|
|
10
|
-
const
|
|
10
|
+
const otelTelemetry = useOtelTelemetry();
|
|
11
11
|
const navigate = (0, react_router_dom_1.useNavigate)();
|
|
12
12
|
const loadAndNavigate = useLoadAndNavigate();
|
|
13
13
|
function setProduct(product) {
|
|
14
14
|
if (!product)
|
|
15
15
|
return;
|
|
16
|
-
|
|
16
|
+
otelTelemetry.send({ type: 'product.picked', payload: { product: product.slug } });
|
|
17
17
|
loadAndNavigate({ navigate, to: product.link });
|
|
18
18
|
}
|
|
19
19
|
return {
|
|
@@ -131,5 +131,5 @@ export type L10nConfig = {
|
|
|
131
131
|
name: string;
|
|
132
132
|
}[];
|
|
133
133
|
};
|
|
134
|
-
type TelemetryEvent =
|
|
134
|
+
type TelemetryEvent = unknown;
|
|
135
135
|
export {};
|
package/lib/core/types/l10n.d.ts
CHANGED
|
@@ -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.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.filter.title' | 'search.filter.reset' | 'search.filter.field.reset' | 'search.ai.welcomeText' | 'search.ai.newConversation' | 'search.ai.backToSearch' | '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.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' | 'toc.header' | 'footer.copyrightText' | 'page.homeButton' | 'page.forbidden.title' | 'page.notFound.title' | 'page.notFound.description' | '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' | 'sidebar.menu.backLabel' | 'sidebar.menu.backToLabel' | 'sidebar.actions.show' | 'sidebar.actions.hide' | 'sidebar.actions.changeLayout' | '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.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' | 'userMenu.login' | 'userMenu.logout' | 'userMenu.devOnboardingLabel' | 'mobileMenu.mainMenu' | 'mobileMenu.previous' | 'mobileMenu.products' | 'mobileMenu.version' | 'navbar.products' | 'page.nextButton' | 'page.previousButton' | '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' | '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.servers.title' | 'openapi.operations' | 'openapi.webhooks' | 'openapi.description' | 'openapi.badges.deprecated' | 'openapi.badges.required' | 'openapi.badges.webhook' | 'openapi.request' | 'openapi.path' | 'openapi.query' | '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.hideExample' | 'openapi.showExample' | 'openapi.expandAll' | 'openapi.collapseAll' | 'openapi.noResponseExample' | 'openapi.noResponseContent' | 'openapi.noRequestPayload' | 'openapi.hidePattern' | 'openapi.showPattern' | 'openapi.authorizationUrl' | 'openapi.tokenUrl' | 'openapi.refreshUrl' | 'openapi.
|
|
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.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.filter.title' | 'search.filter.reset' | 'search.filter.field.reset' | 'search.ai.welcomeText' | 'search.ai.newConversation' | 'search.ai.backToSearch' | '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.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' | 'toc.header' | 'footer.copyrightText' | 'page.homeButton' | 'page.forbidden.title' | 'page.notFound.title' | 'page.notFound.description' | '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' | 'sidebar.menu.backLabel' | 'sidebar.menu.backToLabel' | 'sidebar.actions.show' | 'sidebar.actions.hide' | 'sidebar.actions.changeLayout' | '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.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' | 'userMenu.login' | 'userMenu.logout' | 'userMenu.devOnboardingLabel' | 'mobileMenu.mainMenu' | 'mobileMenu.previous' | 'mobileMenu.products' | 'mobileMenu.version' | 'navbar.products' | 'page.nextButton' | 'page.previousButton' | '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' | '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.servers.title' | 'openapi.operations' | 'openapi.webhooks' | 'openapi.description' | 'openapi.badges.deprecated' | 'openapi.badges.required' | 'openapi.badges.webhook' | 'openapi.request' | 'openapi.path' | 'openapi.query' | '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.hideExample' | 'openapi.showExample' | 'openapi.expandAll' | 'openapi.collapseAll' | 'openapi.viewDetails' | 'openapi.noResponseExample' | 'openapi.noResponseContent' | 'openapi.noRequestPayload' | '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' | 'asyncapi.download.description.title' | 'asyncapi.info.title' | 'graphql.queries' | 'graphql.mutations' | 'graphql.subscriptions' | 'graphql.directives' | 'graphql.objects' | 'graphql.interfaces' | 'graphql.unions' | 'graphql.enums' | 'graphql.inputs' | 'graphql.scalars' | '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.implementedInterfaces' | 'graphql.nonNull' | 'graphql.required' | 'graphql.deprecated' | 'graphql.variables' | 'graphql.querySample' | 'graphql.mutationSample' | 'graphql.subscriptionSample' | 'graphql.responseSample' | 'graphql.locations' | 'graphql.sample' | 'graphql.referenced' | 'graphql.content.fragment' | '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';
|
|
3
3
|
export type Locale = {
|
|
4
4
|
code: string;
|
|
5
5
|
name: string;
|
|
@@ -5,8 +5,13 @@ export type OperationParameter = {
|
|
|
5
5
|
name: string | string[];
|
|
6
6
|
description: string | string[];
|
|
7
7
|
place: string;
|
|
8
|
+
mediaType: string | undefined;
|
|
8
9
|
path?: string[];
|
|
9
10
|
deepLink?: string;
|
|
11
|
+
type: string;
|
|
12
|
+
required: boolean;
|
|
13
|
+
example: string | undefined;
|
|
14
|
+
enum: string[] | undefined;
|
|
10
15
|
};
|
|
11
16
|
export type SearchDocument = {
|
|
12
17
|
id: string;
|
|
@@ -17,6 +22,7 @@ export type SearchDocument = {
|
|
|
17
22
|
httpMethod?: string;
|
|
18
23
|
httpPath?: string | string[];
|
|
19
24
|
deprecated?: boolean;
|
|
25
|
+
security?: string[];
|
|
20
26
|
parameters?: OperationParameter[];
|
|
21
27
|
metadata?: Record<string, any>;
|
|
22
28
|
version?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/theme",
|
|
3
|
-
"version": "0.54.0
|
|
3
|
+
"version": "0.54.0",
|
|
4
4
|
"description": "Shared UI components lib",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"theme",
|
|
@@ -88,8 +88,8 @@
|
|
|
88
88
|
"nprogress": "0.2.0",
|
|
89
89
|
"react-calendar": "5.1.0",
|
|
90
90
|
"react-date-picker": "11.0.0",
|
|
91
|
-
"@redocly/
|
|
92
|
-
"@redocly/
|
|
91
|
+
"@redocly/realm-asyncapi-sdk": "0.0.1",
|
|
92
|
+
"@redocly/config": "0.26.0"
|
|
93
93
|
},
|
|
94
94
|
"scripts": {
|
|
95
95
|
"watch": "tsc -p tsconfig.build.json && (concurrently \"tsc -w -p tsconfig.build.json\" \"tsc-alias -w -p tsconfig.build.json\")",
|
|
@@ -7,8 +7,8 @@ import { useThemeHooks } from '@redocly/theme/core/hooks';
|
|
|
7
7
|
import { Breadcrumb } from '@redocly/theme/components/Breadcrumbs/Breadcrumb';
|
|
8
8
|
|
|
9
9
|
export function Breadcrumbs(props: { className?: string }): JSX.Element | null {
|
|
10
|
-
const { useBreadcrumbs,
|
|
11
|
-
const
|
|
10
|
+
const { useBreadcrumbs, useOtelTelemetry } = useThemeHooks();
|
|
11
|
+
const otelTelemetry = useOtelTelemetry();
|
|
12
12
|
const breadcrumbs = useBreadcrumbs();
|
|
13
13
|
|
|
14
14
|
if (breadcrumbs.length === 0) {
|
|
@@ -26,10 +26,13 @@ export function Breadcrumbs(props: { className?: string }): JSX.Element | null {
|
|
|
26
26
|
label={breadcrumb.label}
|
|
27
27
|
isActive={isLast}
|
|
28
28
|
onClick={() => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
otelTelemetry.send({
|
|
30
|
+
type: 'breadcrumb.clicked',
|
|
31
|
+
payload: {
|
|
32
|
+
link: breadcrumb.link,
|
|
33
|
+
position: idx + 1,
|
|
34
|
+
total_breadcrumbs: breadcrumbs.length,
|
|
35
|
+
},
|
|
33
36
|
});
|
|
34
37
|
}}
|
|
35
38
|
/>
|
|
@@ -12,16 +12,16 @@ export type EditPageButtonProps = {
|
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export function EditPageButton({ to }: EditPageButtonProps): JSX.Element {
|
|
15
|
-
const { useTranslate,
|
|
15
|
+
const { useTranslate, useOtelTelemetry } = useThemeHooks();
|
|
16
16
|
const { translate } = useTranslate();
|
|
17
|
-
const
|
|
17
|
+
const otelTelemetry = useOtelTelemetry();
|
|
18
18
|
|
|
19
19
|
return (
|
|
20
20
|
<EditPageButtonWrapper
|
|
21
21
|
data-component-name="Buttons/EditPageButton"
|
|
22
22
|
target="_blank"
|
|
23
23
|
to={to}
|
|
24
|
-
onClick={() =>
|
|
24
|
+
onClick={() => otelTelemetry.send({ type: 'edit_page_link.clicked' })}
|
|
25
25
|
>
|
|
26
26
|
<ButtonIcon />
|
|
27
27
|
<ButtonText data-translation-key="markdown.editPage.text">
|
|
@@ -29,9 +29,9 @@ export function CatalogClassicActions(props: CatalogClassicActionsProps): JSX.El
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
const { useTranslate,
|
|
32
|
+
const { useTranslate, useOtelTelemetry } = useThemeHooks();
|
|
33
33
|
const { translate } = useTranslate();
|
|
34
|
-
const
|
|
34
|
+
const otelTelemetry = useOtelTelemetry();
|
|
35
35
|
|
|
36
36
|
return (
|
|
37
37
|
<CatalogActionsWrapper data-component-name="CatalogClassic/CatalogClassicActions">
|
|
@@ -42,7 +42,7 @@ export function CatalogClassicActions(props: CatalogClassicActionsProps): JSX.El
|
|
|
42
42
|
iconPosition="left"
|
|
43
43
|
onClick={() => {
|
|
44
44
|
onOpenFilter();
|
|
45
|
-
|
|
45
|
+
otelTelemetry.send({ type: 'catalog_actions_button.clicked' });
|
|
46
46
|
}}
|
|
47
47
|
data-translation-key="catalog.filters.title"
|
|
48
48
|
>
|
|
@@ -16,14 +16,29 @@ export type CatalogClassicCardProps = {
|
|
|
16
16
|
item: CatalogItem;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Strips HTML tags from a plain string.
|
|
21
|
+
*/
|
|
22
|
+
function stripHtmlTags(text: string): string {
|
|
23
|
+
if (!text) return '';
|
|
24
|
+
|
|
25
|
+
// This regex matches:
|
|
26
|
+
// - Opening tags: <tagname> or <tagname attributes>
|
|
27
|
+
// - Closing tags: </tagname>
|
|
28
|
+
// - Self-closing tags: <tagname/> or <tagname attributes/>
|
|
29
|
+
const htmlTagRegex = /<\/?[a-zA-Z][a-zA-Z0-9]*(?:\s[^>]*)?\/?>|<[a-zA-Z][a-zA-Z0-9]*\/>/g;
|
|
30
|
+
|
|
31
|
+
return text.replace(htmlTagRegex, '').trim();
|
|
32
|
+
}
|
|
33
|
+
|
|
19
34
|
export function CatalogClassicCard({ item }: CatalogClassicCardProps): JSX.Element {
|
|
20
|
-
const {
|
|
21
|
-
const
|
|
35
|
+
const { useOtelTelemetry } = useThemeHooks();
|
|
36
|
+
const otelTelemetry = useOtelTelemetry();
|
|
22
37
|
return (
|
|
23
38
|
<Link key={item.docsLink || item.link} to={item.docsLink || item.link}>
|
|
24
39
|
<StyledCard
|
|
25
40
|
data-component-name="CatalogClassic/CatalogClassicCard"
|
|
26
|
-
onClick={() =>
|
|
41
|
+
onClick={() => otelTelemetry.send({ type: 'catalog_item.clicked' })}
|
|
27
42
|
>
|
|
28
43
|
<CardContent>
|
|
29
44
|
<CardTitleWrapper>
|
|
@@ -33,7 +48,7 @@ export function CatalogClassicCard({ item }: CatalogClassicCardProps): JSX.Eleme
|
|
|
33
48
|
</CardTitleWrapper>
|
|
34
49
|
<CardDescription>
|
|
35
50
|
<CatalogClassicHighlight>
|
|
36
|
-
{item.summary ?? item.description ?? ''}
|
|
51
|
+
{stripHtmlTags(item.summary ?? item.description ?? '')}
|
|
37
52
|
</CatalogClassicHighlight>
|
|
38
53
|
</CardDescription>
|
|
39
54
|
</CardContent>
|
|
@@ -46,12 +46,14 @@ function ScorecardBadge(props: {
|
|
|
46
46
|
colorVariable: string;
|
|
47
47
|
}): JSX.Element {
|
|
48
48
|
const { level, slug, colorVariable } = props;
|
|
49
|
-
const {
|
|
50
|
-
const
|
|
49
|
+
const { useOtelTelemetry } = useThemeHooks();
|
|
50
|
+
const otelTelemetry = useOtelTelemetry();
|
|
51
51
|
return (
|
|
52
52
|
<Link to={slug}>
|
|
53
53
|
<Tag
|
|
54
|
-
onClick={() =>
|
|
54
|
+
onClick={() =>
|
|
55
|
+
otelTelemetry.send({ type: 'scorecard_link.clicked', payload: { action: 'click' } })
|
|
56
|
+
}
|
|
55
57
|
withStatusDot
|
|
56
58
|
statusDotColor={`var(${colorVariable})`}
|
|
57
59
|
>
|
|
@@ -12,6 +12,7 @@ const GAP_SIZE = 32;
|
|
|
12
12
|
const ESTIMATED_HEADER_HEIGHT = 43;
|
|
13
13
|
const ESTIMATED_CARD_HEIGHT = 194 + GAP_SIZE;
|
|
14
14
|
const CARD_MIN_WIDTH_VAR = '--catalog-classic-card-min-width';
|
|
15
|
+
const VIRTUALIZATION_THRESHOLD = 20; // Don't virtualize below this number of items
|
|
15
16
|
|
|
16
17
|
export type Group = {
|
|
17
18
|
title: string;
|
|
@@ -40,14 +41,11 @@ export function CatalogClassicVirtualizedGroups({
|
|
|
40
41
|
setIsClient(true);
|
|
41
42
|
}, []);
|
|
42
43
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
44
|
+
const totalItemCount = useMemo(() => {
|
|
45
|
+
return groups.reduce((total, group) => total + group.items.length, 0);
|
|
46
|
+
}, [groups]);
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
50
|
-
}, [filters, filterTerm, size.width]);
|
|
48
|
+
const shouldVirtualize = totalItemCount >= VIRTUALIZATION_THRESHOLD;
|
|
51
49
|
|
|
52
50
|
const columnCount = useMemo(() => {
|
|
53
51
|
if (!size.width) return 4;
|
|
@@ -60,7 +58,7 @@ export function CatalogClassicVirtualizedGroups({
|
|
|
60
58
|
}, [size.width]);
|
|
61
59
|
|
|
62
60
|
const flatRows: VirtualRowData[] = useMemo(() => {
|
|
63
|
-
if (!isClient) {
|
|
61
|
+
if (!shouldVirtualize || !isClient) {
|
|
64
62
|
return groups.flatMap((group) => [
|
|
65
63
|
{
|
|
66
64
|
type: 'header',
|
|
@@ -98,7 +96,7 @@ export function CatalogClassicVirtualizedGroups({
|
|
|
98
96
|
}
|
|
99
97
|
});
|
|
100
98
|
return rows;
|
|
101
|
-
}, [groups, columnCount, isClient]);
|
|
99
|
+
}, [groups, columnCount, isClient, shouldVirtualize]);
|
|
102
100
|
|
|
103
101
|
const virtualizer = useWindowVirtualizer({
|
|
104
102
|
count: flatRows.length,
|
|
@@ -110,6 +108,15 @@ export function CatalogClassicVirtualizedGroups({
|
|
|
110
108
|
overscan: 5,
|
|
111
109
|
});
|
|
112
110
|
|
|
111
|
+
useEffect(() => {
|
|
112
|
+
if (!size.width || !shouldVirtualize) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
virtualizer.measure();
|
|
117
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
118
|
+
}, [filters, filterTerm, size.width, shouldVirtualize]);
|
|
119
|
+
|
|
113
120
|
if (!isClient) {
|
|
114
121
|
return (
|
|
115
122
|
<div ref={parentRef} data-component-name="CatalogClassic/CatalogClassicVirtualizedGroups">
|
|
@@ -124,13 +131,11 @@ export function CatalogClassicVirtualizedGroups({
|
|
|
124
131
|
}
|
|
125
132
|
|
|
126
133
|
return (
|
|
127
|
-
<
|
|
134
|
+
<SSRGridRow key={rowData.key}>
|
|
128
135
|
{rowData.items.map((item) => (
|
|
129
|
-
<
|
|
130
|
-
<CatalogClassicCard item={item} />
|
|
131
|
-
</CardWrapper>
|
|
136
|
+
<CatalogClassicCard key={item.link} item={item} />
|
|
132
137
|
))}
|
|
133
|
-
</
|
|
138
|
+
</SSRGridRow>
|
|
134
139
|
);
|
|
135
140
|
})}
|
|
136
141
|
<LoadingWrapper>
|
|
@@ -194,10 +199,10 @@ const SSRHeaderRow = styled.div`
|
|
|
194
199
|
font-weight: var(--catalog-classic-separator-font-weight);
|
|
195
200
|
`;
|
|
196
201
|
|
|
197
|
-
const
|
|
202
|
+
const SSRGridRow = styled.div`
|
|
198
203
|
width: 100%;
|
|
199
|
-
display:
|
|
200
|
-
|
|
204
|
+
display: grid;
|
|
205
|
+
grid-template-columns: repeat(auto-fill, minmax(var(--catalog-classic-card-min-width), 1fr));
|
|
201
206
|
gap: var(--catalog-classic-cards-group-gap, 32px);
|
|
202
207
|
padding-bottom: var(--catalog-classic-cards-group-gap, 32px);
|
|
203
208
|
`;
|
|
@@ -208,23 +213,12 @@ const HeaderRow = styled(SSRHeaderRow)`
|
|
|
208
213
|
will-change: transform;
|
|
209
214
|
`;
|
|
210
215
|
|
|
211
|
-
const GridRow = styled
|
|
216
|
+
const GridRow = styled(SSRGridRow)`
|
|
212
217
|
position: absolute;
|
|
213
218
|
left: 0;
|
|
214
|
-
width: 100%;
|
|
215
|
-
display: grid;
|
|
216
|
-
grid-template-columns: repeat(auto-fill, minmax(var(--catalog-classic-card-min-width), 1fr));
|
|
217
|
-
gap: var(--catalog-classic-cards-group-gap, 32px);
|
|
218
|
-
padding-bottom: var(--catalog-classic-cards-group-gap, 32px);
|
|
219
219
|
will-change: transform;
|
|
220
220
|
`;
|
|
221
221
|
|
|
222
|
-
const CardWrapper = styled.div`
|
|
223
|
-
flex: 1 0 var(--catalog-classic-card-min-width);
|
|
224
|
-
max-width: 100%;
|
|
225
|
-
min-width: var(--catalog-classic-card-min-width);
|
|
226
|
-
`;
|
|
227
|
-
|
|
228
222
|
const CatalogSeparatorLabel = styled.div`
|
|
229
223
|
margin: var(--catalog-classic-separator-label-margin);
|
|
230
224
|
`;
|
|
@@ -30,9 +30,9 @@ export function ReportDialog({
|
|
|
30
30
|
lang,
|
|
31
31
|
}: ReportDialogProps): JSX.Element {
|
|
32
32
|
const { label } = settings;
|
|
33
|
-
const {
|
|
33
|
+
const { useOtelTelemetry } = useThemeHooks();
|
|
34
34
|
const { pathname } = useLocation();
|
|
35
|
-
const
|
|
35
|
+
const otelTelemetry = useOtelTelemetry();
|
|
36
36
|
|
|
37
37
|
return (
|
|
38
38
|
<Portal>
|
|
@@ -47,7 +47,7 @@ export function ReportDialog({
|
|
|
47
47
|
path: pathname,
|
|
48
48
|
lang,
|
|
49
49
|
});
|
|
50
|
-
|
|
50
|
+
otelTelemetry.send({ type: 'code_snippet.reported' });
|
|
51
51
|
onSubmit();
|
|
52
52
|
}}
|
|
53
53
|
isDialog={true}
|
|
@@ -14,9 +14,9 @@ import { CounterTag } from '@redocly/theme/components/Tags/CounterTag';
|
|
|
14
14
|
import { changeTextCasing } from '@redocly/theme/core/utils';
|
|
15
15
|
|
|
16
16
|
export function FilterCheckboxes({ filter, filterValuesCasing }: FilterProps): JSX.Element {
|
|
17
|
-
const { useTranslate,
|
|
17
|
+
const { useTranslate, useOtelTelemetry } = useThemeHooks();
|
|
18
18
|
const { translate } = useTranslate();
|
|
19
|
-
const
|
|
19
|
+
const otelTelemetry = useOtelTelemetry();
|
|
20
20
|
|
|
21
21
|
return (
|
|
22
22
|
<FilterCheckboxesWrapper data-component-name="Filter/FilterCheckboxes">
|
|
@@ -32,7 +32,7 @@ export function FilterCheckboxes({ filter, filterValuesCasing }: FilterProps): J
|
|
|
32
32
|
role="link"
|
|
33
33
|
onClick={() => {
|
|
34
34
|
filter.toggleOption(value);
|
|
35
|
-
|
|
35
|
+
otelTelemetry.send({ type: 'filter_checkbox.toggled', payload: { id } });
|
|
36
36
|
}}
|
|
37
37
|
>
|
|
38
38
|
<CheckboxIcon checked={filter.selectedOptions.has(value)} />
|
|
@@ -17,8 +17,8 @@ export type FooterItemProps = {
|
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export function FooterItem({ item, iconsOnly, className }: FooterItemProps): JSX.Element | null {
|
|
20
|
-
const { useTranslate,
|
|
21
|
-
const
|
|
20
|
+
const { useTranslate, useOtelTelemetry } = useThemeHooks();
|
|
21
|
+
const otelTelemetry = useOtelTelemetry();
|
|
22
22
|
const { translate } = useTranslate();
|
|
23
23
|
|
|
24
24
|
if (item.type === 'error') {
|
|
@@ -43,7 +43,7 @@ export function FooterItem({ item, iconsOnly, className }: FooterItemProps): JSX
|
|
|
43
43
|
external={item.external}
|
|
44
44
|
target={item.target}
|
|
45
45
|
data-testid={item.label}
|
|
46
|
-
onClick={() =>
|
|
46
|
+
onClick={() => otelTelemetry.send({ type: 'footer_item.clicked' })}
|
|
47
47
|
data-translation-key={item.labelTranslationKey}
|
|
48
48
|
>
|
|
49
49
|
{hasIcon ? (
|
|
@@ -20,8 +20,8 @@ export type LanguagePickerProps = {
|
|
|
20
20
|
|
|
21
21
|
export function LanguagePicker(props: LanguagePickerProps): JSX.Element | null {
|
|
22
22
|
const { currentLocale, locales, setLocale } = useLanguagePicker();
|
|
23
|
-
const {
|
|
24
|
-
const
|
|
23
|
+
const { useOtelTelemetry } = useThemeHooks();
|
|
24
|
+
const otelTelemetry = useOtelTelemetry();
|
|
25
25
|
|
|
26
26
|
if (locales.length < 2 || !currentLocale) {
|
|
27
27
|
return null;
|
|
@@ -40,7 +40,10 @@ export function LanguagePicker(props: LanguagePickerProps): JSX.Element | null {
|
|
|
40
40
|
onAction: () => {
|
|
41
41
|
setLocale(locale.code);
|
|
42
42
|
props.onChangeLanguage(locale.code);
|
|
43
|
-
|
|
43
|
+
otelTelemetry.send({
|
|
44
|
+
type: 'language_picker_locale.changed',
|
|
45
|
+
payload: { locale: locale.code },
|
|
46
|
+
});
|
|
44
47
|
},
|
|
45
48
|
active: locale.code === currentLocale.code,
|
|
46
49
|
suffix: locale.code === currentLocale.code && <CheckmarkIcon />,
|
|
@@ -14,8 +14,8 @@ export type LogoProps = {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
export function Logo({ config, className, ...otherProps }: LogoProps): JSX.Element | null {
|
|
17
|
-
const {
|
|
18
|
-
const
|
|
17
|
+
const { useOtelTelemetry } = useThemeHooks();
|
|
18
|
+
const otelTelemetry = useOtelTelemetry();
|
|
19
19
|
|
|
20
20
|
if (!config?.image && !config?.srcSet) {
|
|
21
21
|
return null;
|
|
@@ -27,7 +27,7 @@ export function Logo({ config, className, ...otherProps }: LogoProps): JSX.Eleme
|
|
|
27
27
|
return (
|
|
28
28
|
<LogoWrapper data-component-name="Logo/Logo" className={className} {...otherProps}>
|
|
29
29
|
{config.link ? (
|
|
30
|
-
<Link to={config.link} onClick={() =>
|
|
30
|
+
<Link to={config.link} onClick={() => otelTelemetry.send({ type: 'logo.clicked' })}>
|
|
31
31
|
{image}
|
|
32
32
|
</Link>
|
|
33
33
|
) : (
|
|
@@ -17,7 +17,7 @@ import { Badge } from '@redocly/theme/components/Badge/Badge';
|
|
|
17
17
|
|
|
18
18
|
export function MenuItem(props: React.PropsWithChildren<MenuItemProps>): JSX.Element {
|
|
19
19
|
const { item, depth, className, onClick } = props;
|
|
20
|
-
const { useTranslate,
|
|
20
|
+
const { useTranslate, useOtelTelemetry } = useThemeHooks();
|
|
21
21
|
const { translate } = useTranslate();
|
|
22
22
|
const type = getMenuItemType(item);
|
|
23
23
|
const nestedMenuRef = useRef<HTMLDivElement>(null);
|
|
@@ -28,7 +28,7 @@ export function MenuItem(props: React.PropsWithChildren<MenuItemProps>): JSX.Ele
|
|
|
28
28
|
labelRef,
|
|
29
29
|
nestedMenuRef,
|
|
30
30
|
});
|
|
31
|
-
const
|
|
31
|
+
const otelTelemetry = useOtelTelemetry();
|
|
32
32
|
const isDrilldown = type === MenuItemType.DrillDown;
|
|
33
33
|
const isSeparator = type === MenuItemType.Separator;
|
|
34
34
|
const isNested = type === MenuItemType.Group;
|
|
@@ -36,7 +36,13 @@ export function MenuItem(props: React.PropsWithChildren<MenuItemProps>): JSX.Ele
|
|
|
36
36
|
const hasHttpTag = !!item.httpVerb || type === MenuItemType.Operation;
|
|
37
37
|
|
|
38
38
|
const handleOnClick = () => {
|
|
39
|
-
|
|
39
|
+
otelTelemetry.send({
|
|
40
|
+
type: 'sidebar.item_clicked',
|
|
41
|
+
payload: {
|
|
42
|
+
label: item.label,
|
|
43
|
+
type: item.type === 'link' || item.type === 'group' ? item.type : undefined,
|
|
44
|
+
},
|
|
45
|
+
});
|
|
40
46
|
onClick?.();
|
|
41
47
|
if (isNested) {
|
|
42
48
|
handleExpand();
|
|
@@ -23,11 +23,11 @@ export type NavbarProps = {
|
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
export function Navbar({ className }: NavbarProps): JSX.Element | null {
|
|
26
|
-
const { isOpen,
|
|
26
|
+
const { isOpen, closeMobileMenu, openMobileMenu } = useMobileMenu(false);
|
|
27
27
|
const themeConfig = useThemeConfig();
|
|
28
|
-
const { useL10n,
|
|
28
|
+
const { useL10n, useOtelTelemetry } = useThemeHooks();
|
|
29
29
|
const { changeLanguage } = useL10n();
|
|
30
|
-
const
|
|
30
|
+
const otelTelemetry = useOtelTelemetry();
|
|
31
31
|
|
|
32
32
|
const menu = themeConfig.navbar?.items;
|
|
33
33
|
|
|
@@ -58,11 +58,11 @@ export function Navbar({ className }: NavbarProps): JSX.Element | null {
|
|
|
58
58
|
isOpen
|
|
59
59
|
? () => {
|
|
60
60
|
closeMobileMenu();
|
|
61
|
-
|
|
61
|
+
otelTelemetry.send({ type: 'mobile_menu_button_close.clicked' });
|
|
62
62
|
}
|
|
63
63
|
: () => {
|
|
64
64
|
openMobileMenu();
|
|
65
|
-
|
|
65
|
+
otelTelemetry.send({ type: 'mobile_menu_button_open.clicked' });
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
icon={isOpen ? <CloseIcon /> : <MenuIcon />}
|
|
@@ -25,10 +25,10 @@ export type NavbarItemProps = {
|
|
|
25
25
|
|
|
26
26
|
export function NavbarItem({ navItem, className }: NavbarItemProps): JSX.Element | null {
|
|
27
27
|
const { pathname } = useLocation();
|
|
28
|
-
const { useTranslate, useL10nConfig,
|
|
28
|
+
const { useTranslate, useL10nConfig, useOtelTelemetry } = useThemeHooks();
|
|
29
29
|
const { translate } = useTranslate();
|
|
30
30
|
const { defaultLocale, currentLocale, locales } = useL10nConfig();
|
|
31
|
-
const
|
|
31
|
+
const otelTelemetry = useOtelTelemetry();
|
|
32
32
|
|
|
33
33
|
if (navItem.type !== 'link' && !navItem.items) return null;
|
|
34
34
|
|
|
@@ -45,7 +45,9 @@ export function NavbarItem({ navItem, className }: NavbarItemProps): JSX.Element
|
|
|
45
45
|
as={item.link ? Link : undefined}
|
|
46
46
|
active={isActive}
|
|
47
47
|
className={className}
|
|
48
|
-
onClick={() =>
|
|
48
|
+
onClick={() =>
|
|
49
|
+
otelTelemetry.send({ type: 'navbar.menu_item_clicked', payload: { type: item.type } })
|
|
50
|
+
}
|
|
49
51
|
external={item.external}
|
|
50
52
|
target={item.target}
|
|
51
53
|
to={item.link}
|
|
@@ -33,9 +33,9 @@ export function SearchInput({
|
|
|
33
33
|
onSubmit,
|
|
34
34
|
className,
|
|
35
35
|
}: SearchInputProps): JSX.Element {
|
|
36
|
-
const {
|
|
36
|
+
const { useOtelTelemetry } = useThemeHooks();
|
|
37
37
|
const { addSearchHistoryItem } = useRecentSearches();
|
|
38
|
-
const
|
|
38
|
+
const otelTelemetry = useOtelTelemetry();
|
|
39
39
|
|
|
40
40
|
const { onKeyDown } = useInputKeyCommands({
|
|
41
41
|
onEnter: (event) => onSubmit?.(event),
|
|
@@ -51,7 +51,7 @@ export function SearchInput({
|
|
|
51
51
|
const handleOnReset = () => {
|
|
52
52
|
onChange('');
|
|
53
53
|
addSearchHistoryItem(value);
|
|
54
|
-
|
|
54
|
+
otelTelemetry.send({ type: 'search_input_reset_button.clicked' });
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
return (
|
|
@@ -16,16 +16,16 @@ export type SearchRecentProps = {
|
|
|
16
16
|
|
|
17
17
|
export function SearchRecent({ onSelect, className }: SearchRecentProps): JSX.Element | null {
|
|
18
18
|
const { items, removeSearchHistoryItem } = useRecentSearches();
|
|
19
|
-
const { useTranslate,
|
|
19
|
+
const { useTranslate, useOtelTelemetry } = useThemeHooks();
|
|
20
20
|
const { translate } = useTranslate();
|
|
21
|
-
const
|
|
21
|
+
const otelTelemetry = useOtelTelemetry();
|
|
22
22
|
|
|
23
23
|
if (!items || !items.length) return null;
|
|
24
24
|
|
|
25
25
|
const handleOnRemove = (e: React.MouseEvent<SVGSVGElement, MouseEvent>, item: string) => {
|
|
26
26
|
e.stopPropagation();
|
|
27
27
|
removeSearchHistoryItem(item);
|
|
28
|
-
|
|
28
|
+
otelTelemetry.send({ type: 'search_recent_remove_button.clicked' });
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
const handleKeyDown = (e: React.KeyboardEvent<HTMLDivElement>, item: string, index: number) => {
|
|
@@ -34,9 +34,9 @@ export const SidebarActions = ({
|
|
|
34
34
|
requestAccessButton,
|
|
35
35
|
className,
|
|
36
36
|
}: SidebarActionsProps) => {
|
|
37
|
-
const {
|
|
37
|
+
const { useOtelTelemetry, useTranslate } = useThemeHooks();
|
|
38
38
|
const { translate } = useTranslate();
|
|
39
|
-
const
|
|
39
|
+
const otelTelemetry = useOtelTelemetry();
|
|
40
40
|
return (
|
|
41
41
|
<ControlsWrap
|
|
42
42
|
className={className}
|
|
@@ -48,9 +48,9 @@ export const SidebarActions = ({
|
|
|
48
48
|
onClick={() => {
|
|
49
49
|
onChangeCollapseSidebarClick();
|
|
50
50
|
if (collapsedSidebar) {
|
|
51
|
-
|
|
51
|
+
otelTelemetry.send({ type: 'sidebar.item_expanded' });
|
|
52
52
|
} else {
|
|
53
|
-
|
|
53
|
+
otelTelemetry.send({ type: 'sidebar.item_collapsed' });
|
|
54
54
|
}
|
|
55
55
|
}}
|
|
56
56
|
title={
|
|
@@ -70,7 +70,7 @@ export const SidebarActions = ({
|
|
|
70
70
|
layout={layout}
|
|
71
71
|
onClick={() => {
|
|
72
72
|
onChangeViewClick();
|
|
73
|
-
|
|
73
|
+
otelTelemetry.send({ type: 'change_layout_button.clicked' });
|
|
74
74
|
}}
|
|
75
75
|
/>
|
|
76
76
|
</ControlsWrapChangeLayoutButtons>
|