@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.
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.d.ts +1 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.js +9 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.js +31 -6
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.d.ts +0 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.d.ts +2 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.js +11 -5
- package/lib/components/Catalog/CatalogEntityIcon.js +6 -0
- package/lib/components/Catalog/CatalogTableView/CatalogEntityCell.d.ts +6 -4
- package/lib/components/Catalog/CatalogTableView/CatalogEntityRelationCell.d.ts +3 -0
- package/lib/components/Catalog/CatalogTableView/CatalogEntityRelationCell.js +11 -0
- package/lib/components/Catalog/CatalogTableView/CatalogTableView.js +4 -0
- package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.js +4 -0
- package/lib/components/Catalog/CatalogTagsWithTooltip.js +2 -3
- package/lib/components/Catalog/variables.js +2 -2
- package/lib/components/Tags/CounterTag.d.ts +1 -1
- package/lib/components/Tags/HttpTag.d.ts +1 -1
- package/lib/core/constants/catalog.d.ts +3 -0
- package/lib/core/constants/catalog.js +55 -1
- package/lib/core/constants/index.d.ts +5 -5
- package/lib/core/constants/index.js +5 -5
- package/lib/core/constants/search.d.ts +1 -1
- package/lib/core/contexts/CodeWalkthrough/CodeWalkthroughControlsContext.d.ts +1 -1
- package/lib/core/contexts/CodeWalkthrough/CodeWalkthroughStepsContext.d.ts +1 -1
- package/lib/core/contexts/ThemeDataContext.d.ts +1 -1
- package/lib/core/contexts/index.d.ts +3 -3
- package/lib/core/contexts/index.js +3 -3
- package/lib/core/hoc/index.d.ts +1 -1
- package/lib/core/hoc/index.js +1 -1
- package/lib/core/hooks/__mocks__/index.d.ts +28 -28
- package/lib/core/hooks/__mocks__/index.js +28 -28
- package/lib/core/hooks/catalog/useCatalogEntities.d.ts +1 -1
- package/lib/core/hooks/catalog/useCatalogTableViewRow.js +2 -2
- package/lib/core/hooks/code-walkthrough/use-code-panel.js +6 -5
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough-controls.js +8 -5
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough-steps.d.ts +1 -1
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough-steps.js +9 -9
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough.d.ts +2 -2
- package/lib/core/hooks/code-walkthrough/use-code-walkthrough.js +4 -3
- package/lib/core/hooks/code-walkthrough/use-renderable-files.js +6 -4
- package/lib/core/hooks/feedback/use-report-dialog.js +4 -3
- package/lib/core/hooks/index.d.ts +42 -42
- package/lib/core/hooks/index.js +42 -42
- package/lib/core/hooks/menu/use-menu-item-expanded.d.ts +1 -1
- package/lib/core/hooks/menu/use-mobile-menu-items.d.ts +1 -1
- package/lib/core/hooks/menu/use-mobile-menu-items.js +13 -12
- package/lib/core/hooks/menu/use-mobile-menu-levels.d.ts +1 -1
- package/lib/core/hooks/menu/use-mobile-menu-levels.js +8 -7
- package/lib/core/hooks/menu/use-nested-menu.d.ts +1 -1
- package/lib/core/hooks/menu/use-nested-menu.js +8 -6
- package/lib/core/hooks/search/use-recent-searches.js +3 -3
- package/lib/core/hooks/search/use-search-dialog.js +4 -3
- package/lib/core/hooks/search/use-search-filter.d.ts +1 -1
- package/lib/core/hooks/search/use-suggested-pages.js +2 -2
- package/lib/core/hooks/use-active-page-version.js +2 -2
- package/lib/core/hooks/use-active-section-id.js +2 -2
- package/lib/core/hooks/use-color-switcher.js +4 -3
- package/lib/core/hooks/use-input-key-commands.js +2 -2
- package/lib/core/hooks/use-language-picker.d.ts +1 -1
- package/lib/core/hooks/use-language-picker.js +4 -4
- package/lib/core/hooks/use-mobile-menu.js +2 -2
- package/lib/core/hooks/use-navbar-height.js +3 -3
- package/lib/core/hooks/use-page-versions.js +2 -2
- package/lib/core/hooks/use-product-picker.js +2 -2
- package/lib/core/hooks/use-theme-config.js +2 -2
- package/lib/core/hooks/use-theme-hooks.d.ts +1 -1
- package/lib/core/hooks/use-theme-hooks.js +2 -2
- package/lib/core/hooks/use-time-ago.js +2 -2
- package/lib/core/hooks/use-user-teams.js +2 -2
- package/lib/core/index.d.ts +7 -7
- package/lib/core/index.js +7 -7
- package/lib/core/openapi/index.d.ts +18 -0
- package/lib/core/openapi/index.js +48 -0
- package/lib/core/styles/global.js +1 -1
- package/lib/core/styles/index.d.ts +2 -2
- package/lib/core/styles/index.js +2 -2
- package/lib/core/templates/Markdown.d.ts +1 -1
- package/lib/core/templates/Markdown.js +8 -6
- package/lib/core/types/catalog.d.ts +6 -2
- package/lib/core/types/code-walkthrough.d.ts +1 -1
- package/lib/core/types/feedback.d.ts +1 -1
- package/lib/core/types/filter.d.ts +1 -1
- package/lib/core/types/hooks.d.ts +11 -3
- package/lib/core/types/index.d.ts +18 -18
- package/lib/core/types/index.js +18 -18
- package/lib/core/types/search.d.ts +1 -1
- package/lib/core/types/sidebar.d.ts +1 -1
- package/lib/core/utils/download-code-walkthrough.js +6 -4
- package/lib/core/utils/get-code-walkthrough-file-text.js +4 -3
- package/lib/core/utils/index.d.ts +35 -35
- package/lib/core/utils/index.js +35 -35
- package/lib/core/utils/load-and-navigate.js +2 -2
- package/lib/core/utils/match-code-walkthrough-conditions.js +3 -3
- package/lib/core/utils/menu.d.ts +3 -2
- package/lib/core/utils/menu.js +12 -12
- package/lib/core/utils/toc.d.ts +1 -1
- package/lib/core/utils/type-guards.d.ts +1 -1
- package/lib/core/utils/type-guards.js +5 -5
- package/lib/core/utils/urls.d.ts +1 -1
- package/lib/core/utils/urls.js +2 -2
- package/lib/markdoc/components/Tabs/TabList.js +2 -0
- package/package.json +1 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.tsx +15 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.tsx +8 -2
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +0 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx +16 -3
- package/src/components/Catalog/CatalogEntityIcon.tsx +6 -0
- package/src/components/Catalog/CatalogTableView/CatalogEntityCell.tsx +5 -4
- package/src/components/Catalog/CatalogTableView/CatalogEntityRelationCell.tsx +19 -0
- package/src/components/Catalog/CatalogTableView/CatalogTableView.tsx +4 -0
- package/src/components/Catalog/CatalogTableView/CatalogTableViewRow.tsx +4 -0
- package/src/components/Catalog/CatalogTagsWithTooltip.tsx +7 -15
- package/src/components/Catalog/variables.ts +2 -2
- package/src/core/constants/catalog.ts +58 -0
- package/src/core/constants/index.ts +5 -5
- package/src/core/constants/search.ts +1 -1
- package/src/core/contexts/CodeWalkthrough/CodeWalkthroughControlsContext.tsx +1 -1
- package/src/core/contexts/CodeWalkthrough/CodeWalkthroughStepsContext.tsx +1 -1
- package/src/core/contexts/ThemeDataContext.tsx +3 -3
- package/src/core/contexts/index.ts +3 -3
- package/src/core/hoc/index.ts +1 -1
- package/src/core/hooks/__mocks__/index.ts +28 -28
- package/src/core/hooks/catalog/useCatalogEntities.ts +1 -1
- package/src/core/hooks/catalog/useCatalogTableViewRow.ts +1 -1
- package/src/core/hooks/code-walkthrough/use-code-panel.ts +3 -5
- package/src/core/hooks/code-walkthrough/use-code-walkthrough-controls.ts +4 -6
- package/src/core/hooks/code-walkthrough/use-code-walkthrough-steps.ts +4 -3
- package/src/core/hooks/code-walkthrough/use-code-walkthrough.ts +3 -3
- package/src/core/hooks/code-walkthrough/use-renderable-files.ts +4 -6
- package/src/core/hooks/feedback/use-report-dialog.ts +3 -2
- package/src/core/hooks/index.ts +42 -42
- package/src/core/hooks/menu/use-menu-item-expanded.ts +1 -1
- package/src/core/hooks/menu/use-mobile-menu-items.ts +4 -7
- package/src/core/hooks/menu/use-mobile-menu-levels.ts +3 -2
- package/src/core/hooks/menu/use-nested-menu.ts +5 -3
- package/src/core/hooks/search/use-recent-searches.ts +1 -1
- package/src/core/hooks/search/use-search-dialog.ts +2 -1
- package/src/core/hooks/search/use-search-filter.ts +1 -1
- package/src/core/hooks/search/use-suggested-pages.ts +1 -1
- package/src/core/hooks/use-active-page-version.ts +1 -1
- package/src/core/hooks/use-active-section-id.ts +1 -1
- package/src/core/hooks/use-codeblock-tabs-controls.ts +1 -1
- package/src/core/hooks/use-color-switcher.ts +2 -1
- package/src/core/hooks/use-input-key-commands.ts +1 -1
- package/src/core/hooks/use-language-picker.ts +3 -3
- package/src/core/hooks/use-mobile-menu.ts +1 -1
- package/src/core/hooks/use-navbar-height.ts +1 -1
- package/src/core/hooks/use-page-versions.ts +1 -1
- package/src/core/hooks/use-product-picker.ts +1 -1
- package/src/core/hooks/use-theme-config.ts +2 -2
- package/src/core/hooks/use-theme-hooks.ts +2 -2
- package/src/core/hooks/use-time-ago.ts +3 -2
- package/src/core/hooks/use-user-teams.ts +1 -1
- package/src/core/index.ts +7 -7
- package/src/core/openapi/index.ts +31 -0
- package/src/core/styles/global.ts +2 -1
- package/src/core/styles/index.ts +2 -2
- package/src/core/templates/Markdown.tsx +8 -4
- package/src/core/types/catalog.ts +15 -2
- package/src/core/types/code-walkthrough.ts +1 -1
- package/src/core/types/feedback.ts +6 -6
- package/src/core/types/filter.ts +1 -1
- package/src/core/types/hooks.ts +17 -16
- package/src/core/types/index.ts +18 -18
- package/src/core/types/search.ts +1 -1
- package/src/core/types/sidebar.ts +1 -1
- package/src/core/utils/download-code-walkthrough.ts +3 -5
- package/src/core/utils/get-code-walkthrough-file-text.ts +2 -1
- package/src/core/utils/index.ts +35 -35
- package/src/core/utils/load-and-navigate.ts +1 -1
- package/src/core/utils/match-code-walkthrough-conditions.ts +1 -1
- package/src/core/utils/menu.ts +4 -3
- package/src/core/utils/toc.ts +1 -1
- package/src/core/utils/type-guards.ts +2 -2
- package/src/core/utils/urls.ts +2 -2
- package/src/markdoc/components/Tabs/TabList.tsx +1 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
|
|
3
|
-
import { useThemeConfig
|
|
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,9 +1,9 @@
|
|
|
1
1
|
import { useNavigate } from 'react-router-dom';
|
|
2
2
|
|
|
3
|
-
import type { L10nConfig } from '
|
|
3
|
+
import type { L10nConfig } from '../types/hooks';
|
|
4
4
|
|
|
5
|
-
import { useThemeHooks } from '
|
|
6
|
-
import { getPathnameForLocale, withPathPrefix, withoutPathPrefix } from '
|
|
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 '
|
|
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 '
|
|
5
|
+
import { getNavbarElement } from '../utils/get-navbar-element';
|
|
6
6
|
|
|
7
7
|
export type UseNavbarHeightReturnType = number;
|
|
8
8
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useNavigate } from 'react-router-dom';
|
|
2
2
|
|
|
3
|
-
import { useThemeHooks } from '
|
|
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 '
|
|
3
|
+
import type { UiAccessibleConfig } from '../../config';
|
|
4
4
|
|
|
5
|
-
import { ThemeDataContext } from '
|
|
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 '
|
|
3
|
+
import type { ThemeHooks } from '../types/hooks';
|
|
4
4
|
|
|
5
|
-
import { ThemeDataContext } from '
|
|
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
|
|
3
|
+
import type { Plural } from '../types/common';
|
|
4
|
+
import type { TranslationKey } from '../types/l10n';
|
|
4
5
|
|
|
5
|
-
import { useThemeHooks } from '
|
|
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 = [
|
package/src/core/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '
|
|
3
|
-
export * from '
|
|
4
|
-
export * from '
|
|
5
|
-
export * from '
|
|
6
|
-
export * from '
|
|
7
|
-
export * from '
|
|
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
|
/**
|
package/src/core/styles/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '
|
|
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 '
|
|
5
|
-
import type {
|
|
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 =
|
|
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,9 +1,9 @@
|
|
|
1
|
-
import type { FEEDBACK_TYPES } from '
|
|
2
|
-
import type { SentimentProps } from '
|
|
3
|
-
import type { CommentProps } from '
|
|
4
|
-
import type { MoodProps } from '
|
|
5
|
-
import type { ScaleProps } from '
|
|
6
|
-
import type { RatingProps } from '
|
|
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;
|
package/src/core/types/filter.ts
CHANGED
package/src/core/types/hooks.ts
CHANGED
|
@@ -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
|
-
|
|
30
|
-
|
|
31
|
-
} from '
|
|
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 '
|
|
39
|
-
import { AiSearchError } from '
|
|
39
|
+
} from './catalog';
|
|
40
|
+
import { AiSearchError } from '../constants/search';
|
|
40
41
|
|
|
41
42
|
export type ThemeHooks = {
|
|
42
43
|
useTranslate: () => { translate: TFunction };
|
package/src/core/types/index.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '
|
|
3
|
-
export * from '
|
|
4
|
-
export * from '
|
|
5
|
-
export * from '
|
|
6
|
-
export * from '
|
|
7
|
-
export * from '
|
|
8
|
-
export * from '
|
|
9
|
-
export * from '
|
|
10
|
-
export * from '
|
|
11
|
-
export * from '
|
|
12
|
-
export * from '
|
|
13
|
-
export * from '
|
|
14
|
-
export * from '
|
|
15
|
-
export * from '
|
|
16
|
-
export * from '
|
|
17
|
-
export * from '
|
|
18
|
-
export * from '
|
|
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';
|
package/src/core/types/search.ts
CHANGED
|
@@ -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 '
|
|
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 '
|
|
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
|
-
|
|
8
|
-
|
|
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
|
|
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,
|
package/src/core/utils/index.ts
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '
|
|
3
|
-
export * from '
|
|
4
|
-
export * from '
|
|
5
|
-
export * from '
|
|
6
|
-
export * from '
|
|
7
|
-
export * from '
|
|
8
|
-
export * from '
|
|
9
|
-
export * from '
|
|
10
|
-
export * from '
|
|
11
|
-
export * from '
|
|
12
|
-
export * from '
|
|
13
|
-
export * from '
|
|
14
|
-
export * from '
|
|
15
|
-
export * from '
|
|
16
|
-
export * from '
|
|
17
|
-
export * from '
|
|
18
|
-
export * from '
|
|
19
|
-
export * from '
|
|
20
|
-
export * from '
|
|
21
|
-
export * from '
|
|
22
|
-
export * from '
|
|
23
|
-
export * from '
|
|
24
|
-
export * from '
|
|
25
|
-
export * from '
|
|
26
|
-
export * from '
|
|
27
|
-
export * from '
|
|
28
|
-
export * from '
|
|
29
|
-
export * from '
|
|
30
|
-
export * from '
|
|
31
|
-
export * from '
|
|
32
|
-
export * from '
|
|
33
|
-
export * from '
|
|
34
|
-
export * from '
|
|
35
|
-
export * from '
|
|
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 { CodeWalkthroughConditionsObject } from '@redocly/config';
|
|
2
2
|
|
|
3
|
-
import { isObject } from '
|
|
3
|
+
import { isObject } from './type-guards';
|
|
4
4
|
|
|
5
5
|
export function matchCodeWalkthroughConditions(
|
|
6
6
|
conditions: CodeWalkthroughConditionsObject = {},
|
package/src/core/utils/menu.ts
CHANGED
|
@@ -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 {
|
|
5
|
-
import { type
|
|
6
|
-
import { MenuItemType } from '
|
|
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',
|
package/src/core/utils/toc.ts
CHANGED
|
@@ -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
|
|
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;
|
package/src/core/utils/urls.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Locale } from '
|
|
1
|
+
import type { Locale } from '../types/l10n';
|
|
2
2
|
|
|
3
|
-
import { DEFAULT_LOCALE_PLACEHOLDER } from '
|
|
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;
|