@redocly/theme 0.56.0-next.2 → 0.56.0-next.4
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/CatalogCardView/CatalogCard.js +4 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntity.d.ts +1 -3
- package/lib/components/Catalog/CatalogEntity/CatalogEntity.js +4 -11
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.js +7 -1
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.js +4 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.js +3 -3
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty.js +7 -2
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.d.ts +6 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.js +19 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.d.ts +1 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.js +11 -8
- 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/CatalogEntity/CatalogEntitySchema.d.ts +6 -0
- package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +55 -0
- package/lib/components/Catalog/CatalogEntityIcon.d.ts +2 -1
- package/lib/components/Catalog/CatalogEntityIcon.js +22 -23
- package/lib/components/Catalog/CatalogEntityTypeIcon.d.ts +2 -1
- package/lib/components/Catalog/CatalogEntityTypeIcon.js +11 -23
- package/lib/components/Catalog/CatalogEntityTypeTag.d.ts +7 -0
- package/lib/components/Catalog/CatalogEntityTypeTag.js +36 -0
- package/lib/components/Catalog/CatalogPageDescription.js +2 -2
- package/lib/components/Catalog/CatalogTableView/CatalogEntityCell.d.ts +6 -4
- package/lib/components/Catalog/CatalogTableView/CatalogEntityCell.js +2 -14
- package/lib/components/Catalog/CatalogTableView/CatalogEntityRelationCell.d.ts +3 -0
- package/lib/components/Catalog/CatalogTableView/CatalogEntityRelationCell.js +11 -0
- package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.d.ts +1 -1
- package/lib/components/Catalog/CatalogTableView/CatalogTableView.d.ts +1 -2
- package/lib/components/Catalog/CatalogTableView/CatalogTableView.js +3 -26
- package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.d.ts +0 -2
- package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.js +5 -26
- package/lib/components/Catalog/CatalogTagsWithTooltip.d.ts +1 -1
- package/lib/components/Catalog/CatalogTagsWithTooltip.js +5 -6
- package/lib/components/Catalog/variables.js +36 -7
- package/lib/components/Menu/variables.js +2 -0
- package/lib/components/Tag/Tag.d.ts +2 -1
- package/lib/components/Tag/Tag.js +3 -3
- package/lib/components/Tag/variables.js +14 -0
- 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/l10n.d.ts +1 -1
- 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/icons/MoleculesIcon/MoleculesIcon.d.ts +9 -0
- package/lib/icons/MoleculesIcon/MoleculesIcon.js +22 -0
- package/lib/icons/NetworkIcon/NetworkIcon.d.ts +9 -0
- package/lib/icons/NetworkIcon/NetworkIcon.js +23 -0
- package/lib/icons/NotesIcon/NotesIcon.d.ts +9 -0
- package/lib/icons/NotesIcon/NotesIcon.js +26 -0
- package/lib/markdoc/components/Tabs/TabList.js +2 -0
- package/package.json +2 -2
- package/src/components/Catalog/CatalogCardView/CatalogCard.tsx +6 -3
- package/src/components/Catalog/CatalogEntity/CatalogEntity.tsx +7 -15
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.tsx +7 -1
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.tsx +4 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.tsx +2 -3
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty.tsx +10 -3
- package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.tsx +36 -0
- package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.tsx +19 -22
- 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/CatalogEntity/CatalogEntitySchema.tsx +52 -0
- package/src/components/Catalog/CatalogEntityIcon.tsx +33 -27
- package/src/components/Catalog/CatalogEntityTypeIcon.tsx +23 -28
- package/src/components/Catalog/CatalogEntityTypeTag.tsx +43 -0
- package/src/components/Catalog/CatalogPageDescription.tsx +4 -3
- package/src/components/Catalog/CatalogTableView/CatalogEntityCell.tsx +7 -20
- package/src/components/Catalog/CatalogTableView/CatalogEntityRelationCell.tsx +19 -0
- package/src/components/Catalog/CatalogTableView/CatalogTableHeaderCell.tsx +4 -2
- package/src/components/Catalog/CatalogTableView/CatalogTableView.tsx +3 -31
- package/src/components/Catalog/CatalogTableView/CatalogTableViewRow.tsx +5 -31
- package/src/components/Catalog/CatalogTagsWithTooltip.tsx +10 -19
- package/src/components/Catalog/variables.ts +36 -7
- package/src/components/Menu/variables.ts +2 -0
- package/src/components/Tag/Tag.tsx +11 -2
- package/src/components/Tag/variables.ts +14 -0
- 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/l10n.ts +4 -0
- 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/icons/MoleculesIcon/MoleculesIcon.tsx +23 -0
- package/src/icons/NetworkIcon/NetworkIcon.tsx +31 -0
- package/src/icons/NotesIcon/NotesIcon.tsx +43 -0
- package/src/markdoc/components/Tabs/TabList.tsx +1 -0
|
@@ -181,6 +181,20 @@ export const tag = css`
|
|
|
181
181
|
--tag-close-button-bg-color-hover: var(--color-sky-2); // @presenter Color
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
+
.tag-raspberry {
|
|
185
|
+
--tag-color: var(--color-raspberry-7); // @presenter Color
|
|
186
|
+
--tag-bg-color: transparent; // @presenter Color
|
|
187
|
+
--tag-border-color: var(--color-raspberry-3); // @presenter Color
|
|
188
|
+
--tag-close-button-bg-color-hover: var(--color-raspberry-1); // @presenter Color
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.tag-carrot {
|
|
192
|
+
--tag-color: var(--color-carrot-8); // @presenter Color
|
|
193
|
+
--tag-bg-color: transparent; // @presenter Color
|
|
194
|
+
--tag-border-color: var(--color-carrot-6); // @presenter Color
|
|
195
|
+
--tag-close-button-bg-color-hover: var(--color-carrot-3); // @presenter Color
|
|
196
|
+
}
|
|
197
|
+
|
|
184
198
|
/**
|
|
185
199
|
* @tokens Tag http
|
|
186
200
|
*/
|
|
@@ -1 +1,59 @@
|
|
|
1
|
+
import type { EntityRelationType } from '../types/catalog';
|
|
2
|
+
|
|
1
3
|
export const CATALOG_TAG_MAX_LENGTH = 15;
|
|
4
|
+
|
|
5
|
+
export const ENTITY_RELATION_TYPES = [
|
|
6
|
+
'partOf',
|
|
7
|
+
'hasParts',
|
|
8
|
+
'creates',
|
|
9
|
+
'createdBy',
|
|
10
|
+
'owns',
|
|
11
|
+
'ownedBy',
|
|
12
|
+
'implements',
|
|
13
|
+
'implementedBy',
|
|
14
|
+
'dependsOn',
|
|
15
|
+
'dependencyOf',
|
|
16
|
+
'uses',
|
|
17
|
+
'usedBy',
|
|
18
|
+
'produces',
|
|
19
|
+
'consumes',
|
|
20
|
+
'linksTo',
|
|
21
|
+
'supersedes',
|
|
22
|
+
'supersededBy',
|
|
23
|
+
'compatibleWith',
|
|
24
|
+
'extends',
|
|
25
|
+
'extendedBy',
|
|
26
|
+
'relatesTo',
|
|
27
|
+
'hasMember',
|
|
28
|
+
'memberOf',
|
|
29
|
+
'triggers',
|
|
30
|
+
'triggeredBy',
|
|
31
|
+
] as const;
|
|
32
|
+
|
|
33
|
+
export const reverseRelationMap: Record<EntityRelationType, EntityRelationType> = {
|
|
34
|
+
partOf: 'hasParts',
|
|
35
|
+
hasParts: 'partOf',
|
|
36
|
+
creates: 'createdBy',
|
|
37
|
+
createdBy: 'creates',
|
|
38
|
+
owns: 'ownedBy',
|
|
39
|
+
ownedBy: 'owns',
|
|
40
|
+
implements: 'implementedBy',
|
|
41
|
+
implementedBy: 'implements',
|
|
42
|
+
dependsOn: 'dependencyOf',
|
|
43
|
+
dependencyOf: 'dependsOn',
|
|
44
|
+
uses: 'usedBy',
|
|
45
|
+
usedBy: 'uses',
|
|
46
|
+
produces: 'consumes',
|
|
47
|
+
consumes: 'produces',
|
|
48
|
+
linksTo: 'linksTo',
|
|
49
|
+
supersedes: 'supersededBy',
|
|
50
|
+
supersededBy: 'supersedes',
|
|
51
|
+
compatibleWith: 'compatibleWith',
|
|
52
|
+
extends: 'extendedBy',
|
|
53
|
+
extendedBy: 'extends',
|
|
54
|
+
relatesTo: 'relatesTo',
|
|
55
|
+
hasMember: 'memberOf',
|
|
56
|
+
memberOf: 'hasMember',
|
|
57
|
+
triggers: 'triggeredBy',
|
|
58
|
+
triggeredBy: 'triggers',
|
|
59
|
+
} as const;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '
|
|
3
|
-
export * from '
|
|
4
|
-
export * from '
|
|
5
|
-
export * from '
|
|
1
|
+
export * from './common';
|
|
2
|
+
export * from './environments';
|
|
3
|
+
export * from './code-walkthrough';
|
|
4
|
+
export * from './search';
|
|
5
|
+
export * from './catalog';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createContext } from 'react';
|
|
2
2
|
|
|
3
|
-
import type { WalkthroughControlsState } from '
|
|
3
|
+
import type { WalkthroughControlsState } from '../../hooks/code-walkthrough/use-code-walkthrough-controls';
|
|
4
4
|
|
|
5
5
|
export const CodeWalkthroughControlsStateContext = createContext<WalkthroughControlsState>({
|
|
6
6
|
activeFilters: [],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createContext } from 'react';
|
|
2
2
|
|
|
3
|
-
import type { WalkthroughStepsState } from '
|
|
3
|
+
import type { WalkthroughStepsState } from '../../types/code-walkthrough';
|
|
4
4
|
|
|
5
5
|
export const CodeWalkthroughStepsContext = createContext<WalkthroughStepsState>({
|
|
6
6
|
markers: {},
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createContext } from 'react';
|
|
2
2
|
|
|
3
3
|
import type { JSX } from 'react';
|
|
4
|
-
import type { ThemeHooks } from '
|
|
5
|
-
import type { LinkProps } from '
|
|
6
|
-
import type { UiAccessibleConfig } from '
|
|
4
|
+
import type { ThemeHooks } from '../types/hooks';
|
|
5
|
+
import type { LinkProps } from '../../components/Link/Link';
|
|
6
|
+
import type { UiAccessibleConfig } from '../../config';
|
|
7
7
|
|
|
8
8
|
export interface ThemeDataTransferObject {
|
|
9
9
|
hooks: ThemeHooks;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '
|
|
3
|
-
export * from '
|
|
1
|
+
export * from './ThemeDataContext';
|
|
2
|
+
export * from './CodeWalkthrough/CodeWalkthroughControlsContext';
|
|
3
|
+
export * from './CodeWalkthrough/CodeWalkthroughStepsContext';
|
package/src/core/hoc/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from '
|
|
1
|
+
export * from './typedMemo';
|
|
@@ -1,28 +1,28 @@
|
|
|
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 '
|
|
1
|
+
export * from './use-theme-config';
|
|
2
|
+
export * from './use-theme-hooks';
|
|
3
|
+
export * from './use-mobile-menu';
|
|
4
|
+
export * from './use-controlled-state';
|
|
5
|
+
export * from './search/use-recent-searches';
|
|
6
|
+
export * from './search/use-suggested-pages';
|
|
7
|
+
export * from './search/use-search-filter';
|
|
8
|
+
export * from '../menu/__mocks__/use-mobile-menu-items';
|
|
9
|
+
export * from '../menu/use-collapse';
|
|
10
|
+
export * from '../use-active-heading';
|
|
11
|
+
export * from '../use-control';
|
|
12
|
+
export * from '../use-dialog-hotkeys';
|
|
13
|
+
export * from '../use-full-height';
|
|
14
|
+
export * from '../use-modal-scroll-lock';
|
|
15
|
+
export * from '../use-mount';
|
|
16
|
+
export * from '../use-outside-click';
|
|
17
|
+
export * from '../use-unmount';
|
|
18
|
+
export * from '../use-color-switcher';
|
|
19
|
+
export * from '../menu/use-nested-menu';
|
|
20
|
+
export * from '../menu/use-menu-item-expanded';
|
|
21
|
+
export * from '../menu/use-mobile-menu-levels';
|
|
22
|
+
export * from '../feedback/use-report-dialog';
|
|
23
|
+
export * from '../use-product-picker';
|
|
24
|
+
export * from '../search/use-search-dialog';
|
|
25
|
+
export * from '../use-language-picker';
|
|
26
|
+
export * from './use-element-size';
|
|
27
|
+
export * from './use-time-ago';
|
|
28
|
+
export * from './use-input-key-commands';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { UseCatalogEntitiesProps } from '
|
|
1
|
+
import type { UseCatalogEntitiesProps } from '../../types/catalog';
|
|
2
2
|
|
|
3
3
|
export function useCatalogEntities({ entitiesTypes, excludedEntities }: UseCatalogEntitiesProps) {
|
|
4
4
|
const initialTypesWithoutAll = entitiesTypes.filter((type) => type !== 'all');
|
|
@@ -6,11 +6,9 @@ import type {
|
|
|
6
6
|
CodeWalkthroughConditionsObject,
|
|
7
7
|
} from '@redocly/config';
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
} from '@redocly/theme/core/contexts';
|
|
13
|
-
import { useThemeHooks } from '@redocly/theme/core/hooks';
|
|
9
|
+
import { CodeWalkthroughControlsStateContext } from '../../contexts/CodeWalkthrough/CodeWalkthroughControlsContext';
|
|
10
|
+
import { CodeWalkthroughStepsContext } from '../../contexts/CodeWalkthrough/CodeWalkthroughStepsContext';
|
|
11
|
+
import { useThemeHooks } from '../use-theme-hooks';
|
|
14
12
|
|
|
15
13
|
const ACTIVE_FILE_MOCK = {
|
|
16
14
|
content: [],
|
|
@@ -12,12 +12,10 @@ import type {
|
|
|
12
12
|
CodeWalkthroughControlsState,
|
|
13
13
|
} from '@redocly/config';
|
|
14
14
|
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
replaceInputsWithValue,
|
|
20
|
-
} from '@redocly/theme/core/utils';
|
|
15
|
+
import { downloadCodeWalkthrough } from '../../utils/download-code-walkthrough';
|
|
16
|
+
import { matchCodeWalkthroughConditions } from '../../utils/match-code-walkthrough-conditions';
|
|
17
|
+
import { getCodeWalkthroughFileText } from '../../utils/get-code-walkthrough-file-text';
|
|
18
|
+
import { replaceInputsWithValue } from '../../utils/replace-inputs-with-value';
|
|
21
19
|
|
|
22
20
|
export type ActiveFilter = {
|
|
23
21
|
id: string;
|
|
@@ -2,10 +2,11 @@ import { useCallback, useEffect, useRef, useState, useMemo } from 'react';
|
|
|
2
2
|
import { useLocation, useNavigate } from 'react-router-dom';
|
|
3
3
|
|
|
4
4
|
import type { CodeWalkthroughStepAttr } from '@redocly/config';
|
|
5
|
-
import type { ActiveStep,
|
|
5
|
+
import type { ActiveStep, WalkthroughStepsState } from '../../types/code-walkthrough';
|
|
6
|
+
import type { MarkerArea } from '../../types/marker';
|
|
6
7
|
|
|
7
|
-
import { getAdjacentValues, insertAt, isBrowser, removeElement } from '
|
|
8
|
-
import { ACTIVE_STEP_QUERY_PARAM } from '
|
|
8
|
+
import { getAdjacentValues, insertAt, isBrowser, removeElement } from '../../utils/js-utils';
|
|
9
|
+
import { ACTIVE_STEP_QUERY_PARAM } from '../../constants/code-walkthrough';
|
|
9
10
|
|
|
10
11
|
type CodeWalkthroughStep = CodeWalkthroughStepAttr & {
|
|
11
12
|
compRef?: HTMLElement;
|
|
@@ -3,13 +3,13 @@ import type {
|
|
|
3
3
|
CodeWalkthroughStepAttr,
|
|
4
4
|
CodeWalkthroughAttr,
|
|
5
5
|
} from '@redocly/config';
|
|
6
|
-
import type { WalkthroughStepsState } from '
|
|
6
|
+
import type { WalkthroughStepsState } from '../../types/code-walkthrough';
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
|
-
useCodeWalkthroughSteps,
|
|
10
9
|
useCodeWalkthroughControls,
|
|
11
10
|
type WalkthroughControlsState,
|
|
12
|
-
} from '
|
|
11
|
+
} from './use-code-walkthrough-controls';
|
|
12
|
+
import { useCodeWalkthroughSteps } from './use-code-walkthrough-steps';
|
|
13
13
|
|
|
14
14
|
export type WalkthroughState = {
|
|
15
15
|
stepsState: WalkthroughStepsState;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
|
|
3
3
|
import type { CodeWalkthroughFile } from '@redocly/config';
|
|
4
|
-
import type { IconProps } from '
|
|
4
|
+
import type { IconProps } from '../../../icons/types';
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
findClosestCommonDirectory,
|
|
10
|
-
} from '@redocly/theme/core/utils';
|
|
6
|
+
import { findClosestCommonDirectory } from '../../utils/find-closest-common-directory';
|
|
7
|
+
import { getFileIconByExt } from '../../utils/get-file-icon';
|
|
8
|
+
import { removeLeadingSlash } from '../../utils/urls';
|
|
11
9
|
|
|
12
10
|
export type RenderableFile = CodeWalkthroughFile & {
|
|
13
11
|
FileIcon: React.FunctionComponent<IconProps>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
|
|
3
|
-
import type { ReportDialogProps } from '
|
|
3
|
+
import type { ReportDialogProps } from '../../../components/Feedback/ReportDialog';
|
|
4
4
|
|
|
5
|
-
import { useThemeHooks
|
|
5
|
+
import { useThemeHooks } from '../use-theme-hooks';
|
|
6
|
+
import { useThemeConfig } from '../use-theme-config';
|
|
6
7
|
|
|
7
8
|
export type ReportButtonProps = {
|
|
8
9
|
onClick: () => void;
|
package/src/core/hooks/index.ts
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
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 '
|
|
36
|
-
export * from '
|
|
37
|
-
export * from '
|
|
38
|
-
export * from '
|
|
39
|
-
export * from '
|
|
40
|
-
export * from '
|
|
41
|
-
export * from '
|
|
42
|
-
export * from '
|
|
1
|
+
export * from './use-theme-config';
|
|
2
|
+
export * from './use-control';
|
|
3
|
+
export * from './use-mount';
|
|
4
|
+
export * from './use-unmount';
|
|
5
|
+
export * from './use-active-heading';
|
|
6
|
+
export * from './use-active-section-id';
|
|
7
|
+
export * from './use-dialog-hotkeys';
|
|
8
|
+
export * from './use-full-height';
|
|
9
|
+
export * from './use-navbar-height';
|
|
10
|
+
export * from './use-outside-click';
|
|
11
|
+
export * from './use-theme-hooks';
|
|
12
|
+
export * from './use-mobile-menu';
|
|
13
|
+
export * from './use-modal-scroll-lock';
|
|
14
|
+
export * from './use-color-switcher';
|
|
15
|
+
export * from './search/use-recent-searches';
|
|
16
|
+
export * from './search/use-suggested-pages';
|
|
17
|
+
export * from './menu/use-nested-menu';
|
|
18
|
+
export * from './menu/use-menu-item-expanded';
|
|
19
|
+
export * from './menu/use-mobile-menu-items';
|
|
20
|
+
export * from './menu/use-mobile-menu-levels';
|
|
21
|
+
export * from './menu/use-collapse';
|
|
22
|
+
export * from './feedback/use-report-dialog';
|
|
23
|
+
export * from './use-tabs';
|
|
24
|
+
export * from './use-focus-trap';
|
|
25
|
+
export * from './use-language-picker';
|
|
26
|
+
export * from './use-product-picker';
|
|
27
|
+
export * from './search/use-search-dialog';
|
|
28
|
+
export * from './search/use-search-filter';
|
|
29
|
+
export * from './use-controlled-state';
|
|
30
|
+
export * from './use-codeblock-tabs-controls';
|
|
31
|
+
export * from './code-walkthrough/use-code-walkthrough';
|
|
32
|
+
export * from './code-walkthrough/use-code-walkthrough-steps';
|
|
33
|
+
export * from './code-walkthrough/use-code-walkthrough-controls';
|
|
34
|
+
export * from './code-walkthrough/use-code-panel';
|
|
35
|
+
export * from './code-walkthrough/use-renderable-files';
|
|
36
|
+
export * from './use-element-size';
|
|
37
|
+
export * from './use-time-ago';
|
|
38
|
+
export * from './use-input-key-commands';
|
|
39
|
+
export * from './catalog/useCatalogEntities';
|
|
40
|
+
export * from './use-active-page-version';
|
|
41
|
+
export * from './use-page-versions';
|
|
42
|
+
export * from './use-user-teams';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
2
|
|
|
3
3
|
import type { Dispatch, SetStateAction } from 'react';
|
|
4
|
-
import type { ItemState } from '
|
|
4
|
+
import type { ItemState } from '../../types/sidebar';
|
|
5
5
|
|
|
6
6
|
function isItemExpanded(item: ItemState) {
|
|
7
7
|
return (
|
|
@@ -2,13 +2,10 @@ import { useLocation } from 'react-router-dom';
|
|
|
2
2
|
|
|
3
3
|
import type { ResolvedNavItem } from '@redocly/config';
|
|
4
4
|
|
|
5
|
-
import { useThemeHooks
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
buildVersionSection,
|
|
10
|
-
mapNavbarItems,
|
|
11
|
-
} from '@redocly/theme/core/utils';
|
|
5
|
+
import { useThemeHooks } from '../use-theme-hooks';
|
|
6
|
+
import { useThemeConfig } from '../use-theme-config';
|
|
7
|
+
import { MobileMenuType } from '../../constants/common';
|
|
8
|
+
import { buildLanguagesGroup, buildVersionSection, mapNavbarItems } from '../../utils/menu';
|
|
12
9
|
|
|
13
10
|
const MENU_SEPARATOR: ResolvedNavItem = {
|
|
14
11
|
type: 'separator',
|
|
@@ -3,8 +3,9 @@ import { useLocation } from 'react-router-dom';
|
|
|
3
3
|
|
|
4
4
|
import type { ResolvedNavItem } from '@redocly/config';
|
|
5
5
|
|
|
6
|
-
import { useThemeHooks
|
|
7
|
-
import {
|
|
6
|
+
import { useThemeHooks } from '../use-theme-hooks';
|
|
7
|
+
import { useThemeConfig } from '../use-theme-config';
|
|
8
|
+
import { MobileMenuType } from '../../constants/common';
|
|
8
9
|
|
|
9
10
|
export const useMobileMenuLevels = () => {
|
|
10
11
|
const { useTranslate, useCurrentProduct, usePageVersions, useSidebarItems } = useThemeHooks();
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { useNavigate, useLocation } from 'react-router-dom';
|
|
2
2
|
import { useCallback, useEffect, useState } from 'react';
|
|
3
3
|
|
|
4
|
-
import type { MenuItemProps } from '
|
|
4
|
+
import type { MenuItemProps } from '../../types/sidebar';
|
|
5
5
|
|
|
6
|
-
import { useMenuItemExpanded
|
|
7
|
-
import {
|
|
6
|
+
import { useMenuItemExpanded } from './use-menu-item-expanded';
|
|
7
|
+
import { useCollapse } from './use-collapse';
|
|
8
|
+
import { loadAndNavigate } from '../../utils/load-and-navigate';
|
|
9
|
+
import { withoutPathPrefix } from '../../utils/urls';
|
|
8
10
|
|
|
9
11
|
type NestedMenuProps = MenuItemProps & {
|
|
10
12
|
labelRef?: React.RefObject<HTMLElement | null>;
|
|
@@ -2,7 +2,8 @@ import { useEffect, useCallback, useState } from 'react';
|
|
|
2
2
|
import { useLocation } from 'react-router-dom';
|
|
3
3
|
import hotkeys from 'hotkeys-js';
|
|
4
4
|
|
|
5
|
-
import { useThemeHooks
|
|
5
|
+
import { useThemeHooks } from '../use-theme-hooks';
|
|
6
|
+
import { useThemeConfig } from '../use-theme-config';
|
|
6
7
|
|
|
7
8
|
export function useSearchDialog() {
|
|
8
9
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -3,7 +3,7 @@ import throttle from 'lodash.throttle';
|
|
|
3
3
|
|
|
4
4
|
import type { Location } from 'react-router-dom';
|
|
5
5
|
|
|
6
|
-
import { useNavbarHeight } from '
|
|
6
|
+
import { useNavbarHeight } from './use-navbar-height';
|
|
7
7
|
|
|
8
8
|
export type UseActiveSectionIdReturnType = string;
|
|
9
9
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffect, useState, useCallback, useMemo } from 'react';
|
|
2
2
|
|
|
3
|
-
import type { FileTabs } from '
|
|
3
|
+
import type { FileTabs } from '../../components/CodeBlock/CodeBlock';
|
|
4
4
|
|
|
5
5
|
type CodeBlockTabsProps = {
|
|
6
6
|
tabs: FileTabs;
|
|
@@ -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>>(
|