@redocly/theme 0.56.0-next.2 → 0.56.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 (175) hide show
  1. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.d.ts +1 -0
  2. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.js +9 -0
  3. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.js +31 -6
  4. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.d.ts +0 -1
  5. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.d.ts +2 -1
  6. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.js +11 -5
  7. package/lib/components/Catalog/CatalogEntityIcon.js +6 -0
  8. package/lib/components/Catalog/CatalogTableView/CatalogEntityCell.d.ts +6 -4
  9. package/lib/components/Catalog/CatalogTableView/CatalogEntityRelationCell.d.ts +3 -0
  10. package/lib/components/Catalog/CatalogTableView/CatalogEntityRelationCell.js +11 -0
  11. package/lib/components/Catalog/CatalogTableView/CatalogTableView.js +4 -0
  12. package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.js +4 -0
  13. package/lib/components/Catalog/CatalogTagsWithTooltip.js +2 -3
  14. package/lib/components/Catalog/variables.js +2 -2
  15. package/lib/components/Tags/CounterTag.d.ts +1 -1
  16. package/lib/components/Tags/HttpTag.d.ts +1 -1
  17. package/lib/core/constants/catalog.d.ts +3 -0
  18. package/lib/core/constants/catalog.js +55 -1
  19. package/lib/core/constants/index.d.ts +5 -5
  20. package/lib/core/constants/index.js +5 -5
  21. package/lib/core/constants/search.d.ts +1 -1
  22. package/lib/core/contexts/CodeWalkthrough/CodeWalkthroughControlsContext.d.ts +1 -1
  23. package/lib/core/contexts/CodeWalkthrough/CodeWalkthroughStepsContext.d.ts +1 -1
  24. package/lib/core/contexts/ThemeDataContext.d.ts +1 -1
  25. package/lib/core/contexts/index.d.ts +3 -3
  26. package/lib/core/contexts/index.js +3 -3
  27. package/lib/core/hoc/index.d.ts +1 -1
  28. package/lib/core/hoc/index.js +1 -1
  29. package/lib/core/hooks/__mocks__/index.d.ts +28 -28
  30. package/lib/core/hooks/__mocks__/index.js +28 -28
  31. package/lib/core/hooks/catalog/useCatalogEntities.d.ts +1 -1
  32. package/lib/core/hooks/catalog/useCatalogTableViewRow.js +2 -2
  33. package/lib/core/hooks/code-walkthrough/use-code-panel.js +6 -5
  34. package/lib/core/hooks/code-walkthrough/use-code-walkthrough-controls.js +8 -5
  35. package/lib/core/hooks/code-walkthrough/use-code-walkthrough-steps.d.ts +1 -1
  36. package/lib/core/hooks/code-walkthrough/use-code-walkthrough-steps.js +9 -9
  37. package/lib/core/hooks/code-walkthrough/use-code-walkthrough.d.ts +2 -2
  38. package/lib/core/hooks/code-walkthrough/use-code-walkthrough.js +4 -3
  39. package/lib/core/hooks/code-walkthrough/use-renderable-files.js +6 -4
  40. package/lib/core/hooks/feedback/use-report-dialog.js +4 -3
  41. package/lib/core/hooks/index.d.ts +42 -42
  42. package/lib/core/hooks/index.js +42 -42
  43. package/lib/core/hooks/menu/use-menu-item-expanded.d.ts +1 -1
  44. package/lib/core/hooks/menu/use-mobile-menu-items.d.ts +1 -1
  45. package/lib/core/hooks/menu/use-mobile-menu-items.js +13 -12
  46. package/lib/core/hooks/menu/use-mobile-menu-levels.d.ts +1 -1
  47. package/lib/core/hooks/menu/use-mobile-menu-levels.js +8 -7
  48. package/lib/core/hooks/menu/use-nested-menu.d.ts +1 -1
  49. package/lib/core/hooks/menu/use-nested-menu.js +8 -6
  50. package/lib/core/hooks/search/use-recent-searches.js +3 -3
  51. package/lib/core/hooks/search/use-search-dialog.js +4 -3
  52. package/lib/core/hooks/search/use-search-filter.d.ts +1 -1
  53. package/lib/core/hooks/search/use-suggested-pages.js +2 -2
  54. package/lib/core/hooks/use-active-page-version.js +2 -2
  55. package/lib/core/hooks/use-active-section-id.js +2 -2
  56. package/lib/core/hooks/use-color-switcher.js +4 -3
  57. package/lib/core/hooks/use-input-key-commands.js +2 -2
  58. package/lib/core/hooks/use-language-picker.d.ts +1 -1
  59. package/lib/core/hooks/use-language-picker.js +4 -4
  60. package/lib/core/hooks/use-mobile-menu.js +2 -2
  61. package/lib/core/hooks/use-navbar-height.js +3 -3
  62. package/lib/core/hooks/use-page-versions.js +2 -2
  63. package/lib/core/hooks/use-product-picker.js +2 -2
  64. package/lib/core/hooks/use-theme-config.js +2 -2
  65. package/lib/core/hooks/use-theme-hooks.d.ts +1 -1
  66. package/lib/core/hooks/use-theme-hooks.js +2 -2
  67. package/lib/core/hooks/use-time-ago.js +2 -2
  68. package/lib/core/hooks/use-user-teams.js +2 -2
  69. package/lib/core/index.d.ts +7 -7
  70. package/lib/core/index.js +7 -7
  71. package/lib/core/openapi/index.d.ts +18 -0
  72. package/lib/core/openapi/index.js +48 -0
  73. package/lib/core/styles/global.js +1 -1
  74. package/lib/core/styles/index.d.ts +2 -2
  75. package/lib/core/styles/index.js +2 -2
  76. package/lib/core/templates/Markdown.d.ts +1 -1
  77. package/lib/core/templates/Markdown.js +8 -6
  78. package/lib/core/types/catalog.d.ts +6 -2
  79. package/lib/core/types/code-walkthrough.d.ts +1 -1
  80. package/lib/core/types/feedback.d.ts +1 -1
  81. package/lib/core/types/filter.d.ts +1 -1
  82. package/lib/core/types/hooks.d.ts +11 -3
  83. package/lib/core/types/index.d.ts +18 -18
  84. package/lib/core/types/index.js +18 -18
  85. package/lib/core/types/search.d.ts +1 -1
  86. package/lib/core/types/sidebar.d.ts +1 -1
  87. package/lib/core/utils/download-code-walkthrough.js +6 -4
  88. package/lib/core/utils/get-code-walkthrough-file-text.js +4 -3
  89. package/lib/core/utils/index.d.ts +35 -35
  90. package/lib/core/utils/index.js +35 -35
  91. package/lib/core/utils/load-and-navigate.js +2 -2
  92. package/lib/core/utils/match-code-walkthrough-conditions.js +3 -3
  93. package/lib/core/utils/menu.d.ts +3 -2
  94. package/lib/core/utils/menu.js +12 -12
  95. package/lib/core/utils/toc.d.ts +1 -1
  96. package/lib/core/utils/type-guards.d.ts +1 -1
  97. package/lib/core/utils/type-guards.js +5 -5
  98. package/lib/core/utils/urls.d.ts +1 -1
  99. package/lib/core/utils/urls.js +2 -2
  100. package/lib/markdoc/components/Tabs/TabList.js +2 -0
  101. package/package.json +1 -1
  102. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.tsx +15 -0
  103. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.tsx +8 -2
  104. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +0 -1
  105. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx +16 -3
  106. package/src/components/Catalog/CatalogEntityIcon.tsx +6 -0
  107. package/src/components/Catalog/CatalogTableView/CatalogEntityCell.tsx +5 -4
  108. package/src/components/Catalog/CatalogTableView/CatalogEntityRelationCell.tsx +19 -0
  109. package/src/components/Catalog/CatalogTableView/CatalogTableView.tsx +4 -0
  110. package/src/components/Catalog/CatalogTableView/CatalogTableViewRow.tsx +4 -0
  111. package/src/components/Catalog/CatalogTagsWithTooltip.tsx +7 -15
  112. package/src/components/Catalog/variables.ts +2 -2
  113. package/src/core/constants/catalog.ts +58 -0
  114. package/src/core/constants/index.ts +5 -5
  115. package/src/core/constants/search.ts +1 -1
  116. package/src/core/contexts/CodeWalkthrough/CodeWalkthroughControlsContext.tsx +1 -1
  117. package/src/core/contexts/CodeWalkthrough/CodeWalkthroughStepsContext.tsx +1 -1
  118. package/src/core/contexts/ThemeDataContext.tsx +3 -3
  119. package/src/core/contexts/index.ts +3 -3
  120. package/src/core/hoc/index.ts +1 -1
  121. package/src/core/hooks/__mocks__/index.ts +28 -28
  122. package/src/core/hooks/catalog/useCatalogEntities.ts +1 -1
  123. package/src/core/hooks/catalog/useCatalogTableViewRow.ts +1 -1
  124. package/src/core/hooks/code-walkthrough/use-code-panel.ts +3 -5
  125. package/src/core/hooks/code-walkthrough/use-code-walkthrough-controls.ts +4 -6
  126. package/src/core/hooks/code-walkthrough/use-code-walkthrough-steps.ts +4 -3
  127. package/src/core/hooks/code-walkthrough/use-code-walkthrough.ts +3 -3
  128. package/src/core/hooks/code-walkthrough/use-renderable-files.ts +4 -6
  129. package/src/core/hooks/feedback/use-report-dialog.ts +3 -2
  130. package/src/core/hooks/index.ts +42 -42
  131. package/src/core/hooks/menu/use-menu-item-expanded.ts +1 -1
  132. package/src/core/hooks/menu/use-mobile-menu-items.ts +4 -7
  133. package/src/core/hooks/menu/use-mobile-menu-levels.ts +3 -2
  134. package/src/core/hooks/menu/use-nested-menu.ts +5 -3
  135. package/src/core/hooks/search/use-recent-searches.ts +1 -1
  136. package/src/core/hooks/search/use-search-dialog.ts +2 -1
  137. package/src/core/hooks/search/use-search-filter.ts +1 -1
  138. package/src/core/hooks/search/use-suggested-pages.ts +1 -1
  139. package/src/core/hooks/use-active-page-version.ts +1 -1
  140. package/src/core/hooks/use-active-section-id.ts +1 -1
  141. package/src/core/hooks/use-codeblock-tabs-controls.ts +1 -1
  142. package/src/core/hooks/use-color-switcher.ts +2 -1
  143. package/src/core/hooks/use-input-key-commands.ts +1 -1
  144. package/src/core/hooks/use-language-picker.ts +3 -3
  145. package/src/core/hooks/use-mobile-menu.ts +1 -1
  146. package/src/core/hooks/use-navbar-height.ts +1 -1
  147. package/src/core/hooks/use-page-versions.ts +1 -1
  148. package/src/core/hooks/use-product-picker.ts +1 -1
  149. package/src/core/hooks/use-theme-config.ts +2 -2
  150. package/src/core/hooks/use-theme-hooks.ts +2 -2
  151. package/src/core/hooks/use-time-ago.ts +3 -2
  152. package/src/core/hooks/use-user-teams.ts +1 -1
  153. package/src/core/index.ts +7 -7
  154. package/src/core/openapi/index.ts +31 -0
  155. package/src/core/styles/global.ts +2 -1
  156. package/src/core/styles/index.ts +2 -2
  157. package/src/core/templates/Markdown.tsx +8 -4
  158. package/src/core/types/catalog.ts +15 -2
  159. package/src/core/types/code-walkthrough.ts +1 -1
  160. package/src/core/types/feedback.ts +6 -6
  161. package/src/core/types/filter.ts +1 -1
  162. package/src/core/types/hooks.ts +17 -16
  163. package/src/core/types/index.ts +18 -18
  164. package/src/core/types/search.ts +1 -1
  165. package/src/core/types/sidebar.ts +1 -1
  166. package/src/core/utils/download-code-walkthrough.ts +3 -5
  167. package/src/core/utils/get-code-walkthrough-file-text.ts +2 -1
  168. package/src/core/utils/index.ts +35 -35
  169. package/src/core/utils/load-and-navigate.ts +1 -1
  170. package/src/core/utils/match-code-walkthrough-conditions.ts +1 -1
  171. package/src/core/utils/menu.ts +4 -3
  172. package/src/core/utils/toc.ts +1 -1
  173. package/src/core/utils/type-guards.ts +2 -2
  174. package/src/core/utils/urls.ts +2 -2
  175. package/src/markdoc/components/Tabs/TabList.tsx +1 -0
@@ -1,6 +1,7 @@
1
1
  import { useState } from 'react';
2
2
 
3
- import { useThemeConfig, useThemeHooks } from '@redocly/theme/core/hooks';
3
+ import { useThemeConfig } from './use-theme-config';
4
+ import { useThemeHooks } from './use-theme-hooks';
4
5
 
5
6
  export const useColorSwitcher = () => {
6
7
  const themeSettings = useThemeConfig();
@@ -1,6 +1,6 @@
1
1
  import { useCallback, useMemo } from 'react';
2
2
 
3
- import { getUserAgent } from '@redocly/theme/core/utils';
3
+ import { getUserAgent } from '../utils/get-user-agent';
4
4
 
5
5
  type Action = 'selectAll' | 'escape' | 'clear' | 'enter' | 'paste';
6
6
  type ActionHandlers = {
@@ -1,9 +1,9 @@
1
1
  import { useNavigate } from 'react-router-dom';
2
2
 
3
- import type { L10nConfig } from '@redocly/theme/core/types';
3
+ import type { L10nConfig } from '../types/hooks';
4
4
 
5
- import { useThemeHooks } from '@redocly/theme/core/hooks';
6
- import { getPathnameForLocale, withPathPrefix, withoutPathPrefix } from '@redocly/theme/core/utils';
5
+ import { useThemeHooks } from './use-theme-hooks';
6
+ import { getPathnameForLocale, withPathPrefix, withoutPathPrefix } from '../utils/urls';
7
7
 
8
8
  export function useLanguagePicker(): {
9
9
  currentLocale: L10nConfig['locales'][number] | undefined;
@@ -1,7 +1,7 @@
1
1
  import { useEffect, useState } from 'react';
2
2
  import { useLocation } from 'react-router-dom';
3
3
 
4
- import { useModalScrollLock } from '@redocly/theme/core/hooks';
4
+ import { useModalScrollLock } from './use-modal-scroll-lock';
5
5
 
6
6
  export function useMobileMenu(initialState = false) {
7
7
  const location = useLocation();
@@ -2,7 +2,7 @@ import { useEffect, useState } from 'react';
2
2
 
3
3
  import type { Location } from 'react-router-dom';
4
4
 
5
- import { getNavbarElement } from '@redocly/theme/core/utils';
5
+ import { getNavbarElement } from '../utils/get-navbar-element';
6
6
 
7
7
  export type UseNavbarHeightReturnType = number;
8
8
 
@@ -1,4 +1,4 @@
1
- import { useThemeHooks } from '@redocly/theme/core/hooks';
1
+ import { useThemeHooks } from './use-theme-hooks';
2
2
 
3
3
  export type PageVersion = {
4
4
  active: boolean;
@@ -1,6 +1,6 @@
1
1
  import { useNavigate } from 'react-router-dom';
2
2
 
3
- import { useThemeHooks } from '@redocly/theme/core/hooks';
3
+ import { useThemeHooks } from './use-theme-hooks';
4
4
 
5
5
  export function useProductPicker() {
6
6
  const { useCurrentProduct, useProducts, useTelemetry, useLoadAndNavigate } = useThemeHooks();
@@ -1,8 +1,8 @@
1
1
  import { useContext } from 'react';
2
2
 
3
- import type { UiAccessibleConfig } from '@redocly/theme/config';
3
+ import type { UiAccessibleConfig } from '../../config';
4
4
 
5
- import { ThemeDataContext } from '@redocly/theme/core/contexts';
5
+ import { ThemeDataContext } from '../contexts/ThemeDataContext';
6
6
 
7
7
  // TODO: rename and additionally export as alias for backward compatibility
8
8
  export function useThemeConfig<T extends Record<string, unknown>>(
@@ -1,8 +1,8 @@
1
1
  import { useContext } from 'react';
2
2
 
3
- import type { ThemeHooks } from '@redocly/theme/core/types';
3
+ import type { ThemeHooks } from '../types/hooks';
4
4
 
5
- import { ThemeDataContext } from '@redocly/theme/core/contexts';
5
+ import { ThemeDataContext } from '../contexts/ThemeDataContext';
6
6
 
7
7
  const fallbacks = {
8
8
  useTranslate: () => ({
@@ -1,8 +1,9 @@
1
1
  import { useCallback } from 'react';
2
2
 
3
- import type { Plural, TranslationKey } from '@redocly/theme/core/types';
3
+ import type { Plural } from '../types/common';
4
+ import type { TranslationKey } from '../types/l10n';
4
5
 
5
- import { useThemeHooks } from '@redocly/theme/core/hooks';
6
+ import { useThemeHooks } from './use-theme-hooks';
6
7
 
7
8
  const timeUnits = ['second', 'minute', 'hour', 'day', 'week', 'month', 'year'] as const;
8
9
  const timeUnitConversions = [
@@ -1,4 +1,4 @@
1
- import { useThemeHooks } from '@redocly/theme/core/hooks';
1
+ import { useThemeHooks } from './use-theme-hooks';
2
2
 
3
3
  export function useUserTeams() {
4
4
  const { useUserTeams } = useThemeHooks();
package/src/core/index.ts CHANGED
@@ -1,7 +1,7 @@
1
- export * from '@redocly/theme/core/constants';
2
- export * from '@redocly/theme/core/contexts';
3
- export * from '@redocly/theme/core/hoc';
4
- export * from '@redocly/theme/core/hooks';
5
- export * from '@redocly/theme/core/types';
6
- export * from '@redocly/theme/core/utils';
7
- export * from '@redocly/theme/core/styles';
1
+ export * from './constants';
2
+ export * from './contexts';
3
+ export * from './hoc';
4
+ export * from './hooks';
5
+ export * from './types';
6
+ export * from './utils';
7
+ export * from './styles';
@@ -0,0 +1,31 @@
1
+ // This file is intended to provide selective imports from @redocly/theme/core
2
+ // to reduce bundle size by exporting only functionality used in the @redocly/openapi-docs package.
3
+ //
4
+ // This selective import approach will help with tree shaking and reduce
5
+ // the overall bundle size by avoiding importing the entire theme package
6
+ // when only specific functionality is needed.
7
+ export { IS_BROWSER } from '../utils/dom';
8
+ export {
9
+ addLeadingSlash,
10
+ removeLeadingSlash,
11
+ getPathPrefix,
12
+ combineUrls,
13
+ addTrailingSlash,
14
+ withPathPrefix,
15
+ } from '../utils/urls';
16
+ export { typedMemo } from '../hoc/typedMemo';
17
+ export { useMount } from '../hooks/use-mount';
18
+ export { GlobalStyle } from '../styles/global';
19
+ export { breakpoints } from '../utils/media-css';
20
+ export { isPrimitive } from '../utils/args-typecheck';
21
+ export type { UserClaims } from '../types/user-claims';
22
+ export { useFocusTrap } from '../hooks/use-focus-trap';
23
+ export type { TFunction, TOptions } from '../types/l10n';
24
+ export { useThemeHooks } from '../hooks/use-theme-hooks';
25
+ export { useOutsideClick } from '../hooks/use-outside-click';
26
+ export type { SelectOption, SelectProps } from '../types/select';
27
+ export { useActiveSectionId } from '../hooks/use-active-section-id';
28
+ export { useModalScrollLock } from '../hooks/use-modal-scroll-lock';
29
+ export { SecurityVariablesEnvSuffix } from '../constants/environments';
30
+ export { isUndefined, isString, isNotNull, isObject } from '../utils/type-guards';
31
+ export { ThemeDataContext, type ThemeDataTransferObject } from '../contexts/ThemeDataContext';
@@ -1,6 +1,5 @@
1
1
  import { createGlobalStyle, css } from 'styled-components';
2
2
 
3
- import { darkMode } from '@redocly/theme/core/styles/dark';
4
3
  import { languagePicker } from '@redocly/theme/components/LanguagePicker/variables';
5
4
  import { scorecard } from '@redocly/theme/components/Scorecard/variables';
6
5
  import { feedback } from '@redocly/theme/components/Feedback/variables';
@@ -40,6 +39,8 @@ import { cards } from '@redocly/theme/markdoc/components/Cards/variables';
40
39
  import { codeWalkthrough } from '@redocly/theme/markdoc/components/CodeWalkthrough/variables';
41
40
  import { skipContent } from '@redocly/theme/components/SkipContent/variables';
42
41
 
42
+ import { darkMode } from './dark';
43
+
43
44
  const themeColors = css`
44
45
  /* === Palette === */
45
46
  /**
@@ -1,2 +1,2 @@
1
- export * from '@redocly/theme/core/styles/global';
2
- export * from '@redocly/theme/core/styles/dark';
1
+ export * from './global';
2
+ export * from './dark';
@@ -1,17 +1,21 @@
1
1
  import * as React from 'react';
2
2
  import { useLocation } from 'react-router-dom';
3
3
 
4
- import type { UiAccessibleConfig } from '@redocly/theme/config';
5
- import type { MdHeading, FeedbackProps } from '@redocly/theme/core/types';
4
+ import type { UiAccessibleConfig } from '../../config';
5
+ import type { FeedbackProps } from '../types/feedback';
6
+ import type { MdHeading } from '../types/markdown';
6
7
 
7
- import { useThemeConfig, useThemeHooks } from '@redocly/theme/core/hooks';
8
8
  import { DocumentationLayout } from '@redocly/theme/layouts/DocumentationLayout';
9
9
  import { Markdown } from '@redocly/theme/components/Markdown/Markdown';
10
10
  import { TableOfContent } from '@redocly/theme/components/TableOfContent/TableOfContent';
11
11
  import { Feedback } from '@redocly/theme/components/Feedback/Feedback';
12
- import { IS_BROWSER, onDocumentReady, extendDetailsBehaviour } from '@redocly/theme/core/utils';
13
12
  import { CodeWalkthroughLayout } from '@redocly/theme/layouts/CodeWalkthroughLayout';
14
13
 
14
+ import { IS_BROWSER, onDocumentReady } from '../utils/dom';
15
+ import { extendDetailsBehaviour } from '../utils/details';
16
+ import { useThemeHooks } from '../hooks/use-theme-hooks';
17
+ import { useThemeConfig } from '../hooks/use-theme-config';
18
+
15
19
  export type MarkdownTemplateProps = {
16
20
  pageProps: {
17
21
  frontmatter?: UiAccessibleConfig;
@@ -3,6 +3,8 @@ import { CatalogEntityConfig, LayoutVariant } from '@redocly/config';
3
3
 
4
4
  import type { CatalogFilterConfig } from '@redocly/theme/config';
5
5
 
6
+ import { ENTITY_RELATION_TYPES } from '../constants/catalog';
7
+
6
8
  export type SortOption = 'title' | '-title' | 'type' | '-type';
7
9
 
8
10
  export type UseCatalogResponse = {
@@ -103,7 +105,14 @@ export type UseCatalogEntitiesResponse = {
103
105
  setEntitiesCounter: (counter: number) => void;
104
106
  };
105
107
 
106
- export type EntityType = 'service' | 'domain' | 'team' | 'user' | 'api-description';
108
+ export type EntityType =
109
+ | 'service'
110
+ | 'domain'
111
+ | 'team'
112
+ | 'user'
113
+ | 'api-description'
114
+ | 'data-schema'
115
+ | 'api-operation';
107
116
 
108
117
  export type CatalogViewMode = 'cards' | 'table';
109
118
 
@@ -121,6 +130,8 @@ export type BffCatalogRelatedEntity = {
121
130
  title: string;
122
131
  summary?: string | null;
123
132
  readonly source: 'api' | 'file';
133
+ relationRole: 'source' | 'target';
134
+ relationType: EntityRelationType;
124
135
  sourceFile?: string | null;
125
136
  metadata?: Record<string, any>;
126
137
  readonly createdAt: string | null;
@@ -137,7 +148,7 @@ export type BffCatalogEntity = {
137
148
  readonly source: 'api' | 'file';
138
149
  domains?: Array<BffCatalogRelatedEntity>;
139
150
  owners?: Array<BffCatalogRelatedEntity>;
140
- summary?: string;
151
+ summary?: string | null;
141
152
  tags?: Array<string>;
142
153
  metadata?: Record<string, any>;
143
154
  git?: Array<string>;
@@ -178,3 +189,5 @@ export type Page = {
178
189
  limit: number;
179
190
  total: number;
180
191
  };
192
+
193
+ export type EntityRelationType = (typeof ENTITY_RELATION_TYPES)[number];
@@ -1,4 +1,4 @@
1
- import type { MarkerArea } from '@redocly/theme/core/types';
1
+ import type { MarkerArea } from './marker';
2
2
 
3
3
  export type ActiveStep = string | null;
4
4
 
@@ -1,9 +1,9 @@
1
- import type { FEEDBACK_TYPES } from '@redocly/theme/core/constants';
2
- import type { SentimentProps } from '@redocly/theme/components/Feedback/Sentiment';
3
- import type { CommentProps } from '@redocly/theme/components/Feedback/Comment';
4
- import type { MoodProps } from '@redocly/theme/components/Feedback/Mood';
5
- import type { ScaleProps } from '@redocly/theme/components/Feedback/Scale';
6
- import type { RatingProps } from '@redocly/theme/components/Feedback/Rating';
1
+ import type { FEEDBACK_TYPES } from '../constants/common';
2
+ import type { SentimentProps } from '../../components/Feedback/Sentiment';
3
+ import type { CommentProps } from '../../components/Feedback/Comment';
4
+ import type { MoodProps } from '../../components/Feedback/Mood';
5
+ import type { ScaleProps } from '../../components/Feedback/Scale';
6
+ import type { RatingProps } from '../../components/Feedback/Rating';
7
7
 
8
8
  export type SubmitFeedbackParams = {
9
9
  type: string;
@@ -1,4 +1,4 @@
1
- import type { ResolvedFilter } from '@redocly/theme/core/types';
1
+ import type { ResolvedFilter } from './catalog';
2
2
  import type { RedoclyConfig } from '@redocly/config';
3
3
 
4
4
  export type FilterProps = {
@@ -9,34 +9,35 @@ import type { Callback, TFunction as TFunc } from 'i18next';
9
9
  import type { To, Location, NavigateFunction } from 'react-router-dom';
10
10
  import type { CatalogConfig, ProductUiConfig } from '@redocly/theme/config';
11
11
  import type {
12
- UserMenuData,
13
12
  UseCatalogResponse,
14
- ItemState,
15
- SearchItemData,
16
- SubmitFeedbackParams,
17
- TFunction,
18
- BreadcrumbItem,
19
- DrilldownMenuItemDetails,
20
- SearchFacet,
21
- SearchFilterItem,
22
- SearchFacetQuery,
23
- AiSearchConversationItem,
24
13
  CatalogApiResults,
25
14
  CatalogApiParams,
26
15
  FilteredCatalog,
27
16
  UseCatalogSortResponse,
28
17
  UseCatalogSearchResponse,
29
- EventType,
30
- SendEventParams,
31
- } from '@redocly/theme/core/types';
18
+ } from './catalog';
19
+ import type { UserMenuData } from './user-menu';
20
+ import type { ItemState } from './sidebar';
21
+ import type {
22
+ SearchItemData,
23
+ SearchFacet,
24
+ SearchFilterItem,
25
+ SearchFacetQuery,
26
+ AiSearchConversationItem,
27
+ } from './search';
28
+ import type { EventType, SendEventParams } from './telemetry';
29
+ import type { SubmitFeedbackParams } from './feedback';
30
+ import type { TFunction } from './l10n';
31
+ import type { BreadcrumbItem } from './breadcrumb';
32
+ import type { DrilldownMenuItemDetails } from './sidebar';
32
33
 
33
34
  import {
34
35
  BffCatalogEntity,
35
36
  BffCatalogEntityList,
36
37
  BffCatalogRelatedEntity,
37
38
  BffCatalogRelatedEntityList,
38
- } from '@redocly/theme/core/types';
39
- import { AiSearchError } from '@redocly/theme/core/constants';
39
+ } from './catalog';
40
+ import { AiSearchError } from '../constants/search';
40
41
 
41
42
  export type ThemeHooks = {
42
43
  useTranslate: () => { translate: TFunction };
@@ -1,18 +1,18 @@
1
- export * from '@redocly/theme/core/types/breadcrumb';
2
- export * from '@redocly/theme/core/types/catalog';
3
- export * from '@redocly/theme/core/types/l10n';
4
- export * from '@redocly/theme/core/types/feedback';
5
- export * from '@redocly/theme/core/types/hooks';
6
- export * from '@redocly/theme/core/types/markdown';
7
- export * from '@redocly/theme/core/types/navbar';
8
- export * from '@redocly/theme/core/types/search';
9
- export * from '@redocly/theme/core/types/select';
10
- export * from '@redocly/theme/core/types/sidebar';
11
- export * from '@redocly/theme/core/types/filter';
12
- export * from '@redocly/theme/core/types/user-menu';
13
- export * from '@redocly/theme/core/types/user-claims';
14
- export * from '@redocly/theme/core/types/common';
15
- export * from '@redocly/theme/core/types/open-api-server';
16
- export * from '@redocly/theme/core/types/marker';
17
- export * from '@redocly/theme/core/types/code-walkthrough';
18
- export * from '@redocly/theme/core/types/telemetry';
1
+ export * from './breadcrumb';
2
+ export * from './catalog';
3
+ export * from './l10n';
4
+ export * from './feedback';
5
+ export * from './hooks';
6
+ export * from './markdown';
7
+ export * from './navbar';
8
+ export * from './search';
9
+ export * from './select';
10
+ export * from './sidebar';
11
+ export * from './filter';
12
+ export * from './user-menu';
13
+ export * from './user-claims';
14
+ export * from './common';
15
+ export * from './open-api-server';
16
+ export * from './marker';
17
+ export * from './code-walkthrough';
18
+ export * from './telemetry';
@@ -1,6 +1,6 @@
1
1
  import type { ItemBadge, REDOCLY_ROUTE_RBAC } from '@redocly/config';
2
2
  import type { ProductConfig } from '@redocly/theme/config';
3
- import type { AiSearchConversationRole } from '@redocly/theme/core/constants';
3
+ import type { AiSearchConversationRole } from '../constants/search';
4
4
 
5
5
  export type OperationParameter = {
6
6
  name: string | string[];
@@ -5,7 +5,7 @@ import type {
5
5
  RbacScopeItems,
6
6
  ItemBadge,
7
7
  } from '@redocly/config';
8
- import type { MenuItemType } from '@redocly/theme/core/constants';
8
+ import type { MenuItemType } from '../constants/common';
9
9
  export type { MenuStyle } from '@redocly/config';
10
10
 
11
11
  export type SidebarNavItem = {
@@ -3,11 +3,9 @@ import JSZip from 'jszip';
3
3
 
4
4
  import type { CodeWalkthroughFile } from '@redocly/config';
5
5
 
6
- import {
7
- findClosestCommonDirectory,
8
- getCodeWalkthroughFileText,
9
- removeLeadingSlash,
10
- } from '@redocly/theme/core/utils';
6
+ import { removeLeadingSlash } from './urls';
7
+ import { findClosestCommonDirectory } from './find-closest-common-directory';
8
+ import { getCodeWalkthroughFileText } from './get-code-walkthrough-file-text';
11
9
 
12
10
  // https://github.com/Stuk/jszip/issues/196#issuecomment-69503828
13
11
  JSZip.support.nodebuffer = false;
@@ -1,6 +1,7 @@
1
1
  import type { CodeWalkthroughFile, CodeWalkthroughNode } from '@redocly/config';
2
2
 
3
- import { matchCodeWalkthroughConditions, replaceInputsWithValue } from '@redocly/theme/core/utils';
3
+ import { matchCodeWalkthroughConditions } from './match-code-walkthrough-conditions';
4
+ import { replaceInputsWithValue } from './replace-inputs-with-value';
4
5
 
5
6
  export function getCodeWalkthroughFileText(
6
7
  file: CodeWalkthroughFile,
@@ -1,35 +1,35 @@
1
- export * from '@redocly/theme/core/utils/clipboard-service';
2
- export * from '@redocly/theme/core/utils/css-variables';
3
- export * from '@redocly/theme/core/utils/add-line-numbers';
4
- export * from '@redocly/theme/core/utils/media-css';
5
- export * from '@redocly/theme/core/utils/theme-helpers';
6
- export * from '@redocly/theme/core/utils/class-names';
7
- export * from '@redocly/theme/core/utils/args-typecheck';
8
- export * from '@redocly/theme/core/utils/color';
9
- export * from '@redocly/theme/core/utils/urls';
10
- export * from '@redocly/theme/core/utils/js-utils';
11
- export * from '@redocly/theme/core/utils/tags-parser';
12
- export * from '@redocly/theme/core/utils/text-transform';
13
- export * from '@redocly/theme/core/utils/dom';
14
- export * from '@redocly/theme/core/utils/markdoc';
15
- export * from '@redocly/theme/core/utils/attribute-parser';
16
- export * from '@redocly/theme/core/utils/type-guards';
17
- export * from '@redocly/theme/core/utils/dom';
18
- export * from '@redocly/theme/core/utils/toc';
19
- export * from '@redocly/theme/core/utils/menu';
20
- export * from '@redocly/theme/core/utils/load-and-navigate';
21
- export * from '@redocly/theme/core/utils/get-scorecard-color-variable';
22
- export * from '@redocly/theme/core/utils/change-text-casing';
23
- export * from '@redocly/theme/core/utils/format-date-without-timezone';
24
- export * from '@redocly/theme/core/utils/details';
25
- export * from '@redocly/theme/core/utils/get-navbar-element';
26
- export * from '@redocly/theme/core/utils/with-load-progress';
27
- export * from '@redocly/theme/core/utils/text-trimmer';
28
- export * from '@redocly/theme/core/utils/get-code-walkthrough-file-text';
29
- export * from '@redocly/theme/core/utils/download-code-walkthrough';
30
- export * from '@redocly/theme/core/utils/get-file-icon';
31
- export * from '@redocly/theme/core/utils/match-code-walkthrough-conditions';
32
- export * from '@redocly/theme/core/utils/replace-inputs-with-value';
33
- export * from '@redocly/theme/core/utils/find-closest-common-directory';
34
- export * from '@redocly/theme/core/utils/get-user-agent';
35
- export * from '@redocly/theme/core/utils/parse-style-string';
1
+ export * from './clipboard-service';
2
+ export * from './css-variables';
3
+ export * from './add-line-numbers';
4
+ export * from './media-css';
5
+ export * from './theme-helpers';
6
+ export * from './class-names';
7
+ export * from './args-typecheck';
8
+ export * from './color';
9
+ export * from './urls';
10
+ export * from './js-utils';
11
+ export * from './tags-parser';
12
+ export * from './text-transform';
13
+ export * from './dom';
14
+ export * from './markdoc';
15
+ export * from './attribute-parser';
16
+ export * from './type-guards';
17
+ export * from './dom';
18
+ export * from './toc';
19
+ export * from './menu';
20
+ export * from './load-and-navigate';
21
+ export * from './get-scorecard-color-variable';
22
+ export * from './change-text-casing';
23
+ export * from './format-date-without-timezone';
24
+ export * from './details';
25
+ export * from './get-navbar-element';
26
+ export * from './with-load-progress';
27
+ export * from './text-trimmer';
28
+ export * from './get-code-walkthrough-file-text';
29
+ export * from './download-code-walkthrough';
30
+ export * from './get-file-icon';
31
+ export * from './match-code-walkthrough-conditions';
32
+ export * from './replace-inputs-with-value';
33
+ export * from './find-closest-common-directory';
34
+ export * from './get-user-agent';
35
+ export * from './parse-style-string';
@@ -1,6 +1,6 @@
1
1
  import type { NavigateFunction, NavigateOptions } from 'react-router-dom';
2
2
 
3
- import { withLoadProgress } from '@redocly/theme/core/utils';
3
+ import { withLoadProgress } from './with-load-progress';
4
4
 
5
5
  export type HistoryOrigin = 'pm' | 'browser';
6
6
 
@@ -1,6 +1,6 @@
1
1
  import type { CodeWalkthroughConditionsObject } from '@redocly/config';
2
2
 
3
- import { isObject } from '@redocly/theme/core/utils';
3
+ import { isObject } from './type-guards';
4
4
 
5
5
  export function matchCodeWalkthroughConditions(
6
6
  conditions: CodeWalkthroughConditionsObject = {},
@@ -1,9 +1,10 @@
1
1
  import type { ResolvedNavItem, Version } from '@redocly/config';
2
2
  import type { Location } from 'react-router-dom';
3
3
 
4
- import { getPathnameForLocale, withoutPathPrefix, withPathPrefix } from '@redocly/theme/core/utils';
5
- import { type Locale, type TFunction, type ItemState } from '@redocly/theme/core/types';
6
- import { MenuItemType } from '@redocly/theme/core/constants';
4
+ import { type Locale, type TFunction } from '../types/l10n';
5
+ import { type ItemState } from '../types/sidebar';
6
+ import { MenuItemType } from '../constants/common';
7
+ import { getPathnameForLocale, withoutPathPrefix, withPathPrefix } from './urls';
7
8
 
8
9
  const TRANSLATION_KEYS = {
9
10
  version: 'mobileMenu.version',
@@ -1,4 +1,4 @@
1
- import type { MdHeading } from '@redocly/theme/core/types';
1
+ import type { MdHeading } from '../types/markdown';
2
2
 
3
3
  export function getDisplayedHeadings(
4
4
  headings: Array<MdHeading | null> | null | undefined,
@@ -16,9 +16,9 @@ export function isNotNull<T>(value: T): value is NonNullable<T> {
16
16
  return !isNull(value);
17
17
  }
18
18
 
19
- export const isObject = (item: unknown): item is object => {
19
+ export function isObject(item: unknown): item is object {
20
20
  return isNotNull(item) && typeof item === 'object';
21
- };
21
+ }
22
22
 
23
23
  export const isNavLinkItem = (item: ResolvedNavItem): item is ResolvedNavLinkItem => {
24
24
  return item.link !== undefined;
@@ -1,6 +1,6 @@
1
- import type { Locale } from '@redocly/theme/core/types';
1
+ import type { Locale } from '../types/l10n';
2
2
 
3
- import { DEFAULT_LOCALE_PLACEHOLDER } from '@redocly/theme/core/constants';
3
+ import { DEFAULT_LOCALE_PLACEHOLDER } from '../constants/common';
4
4
 
5
5
  export function combineUrls(baseURL: string, ...relativeURLs: (string | undefined)[]) {
6
6
  let res = baseURL;
@@ -67,6 +67,7 @@ export function TabList({
67
67
  }}
68
68
  onKeyDown={(event) => handleKeyboard(event, index)}
69
69
  onClick={() => {
70
+ child.props.onClick?.();
70
71
  onTabClick(label);
71
72
  }}
72
73
  />