@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.
Files changed (227) hide show
  1. package/lib/components/Catalog/CatalogCardView/CatalogCard.js +4 -2
  2. package/lib/components/Catalog/CatalogEntity/CatalogEntity.d.ts +1 -3
  3. package/lib/components/Catalog/CatalogEntity/CatalogEntity.js +4 -11
  4. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.js +7 -1
  5. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.js +4 -0
  6. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.js +3 -3
  7. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty.js +7 -2
  8. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.d.ts +6 -0
  9. package/lib/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.js +19 -0
  10. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.d.ts +1 -0
  11. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.js +11 -8
  12. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.js +31 -6
  13. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.d.ts +0 -1
  14. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.d.ts +2 -1
  15. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.js +11 -5
  16. package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.d.ts +6 -0
  17. package/lib/components/Catalog/CatalogEntity/CatalogEntitySchema.js +55 -0
  18. package/lib/components/Catalog/CatalogEntityIcon.d.ts +2 -1
  19. package/lib/components/Catalog/CatalogEntityIcon.js +22 -23
  20. package/lib/components/Catalog/CatalogEntityTypeIcon.d.ts +2 -1
  21. package/lib/components/Catalog/CatalogEntityTypeIcon.js +11 -23
  22. package/lib/components/Catalog/CatalogEntityTypeTag.d.ts +7 -0
  23. package/lib/components/Catalog/CatalogEntityTypeTag.js +36 -0
  24. package/lib/components/Catalog/CatalogPageDescription.js +2 -2
  25. package/lib/components/Catalog/CatalogTableView/CatalogEntityCell.d.ts +6 -4
  26. package/lib/components/Catalog/CatalogTableView/CatalogEntityCell.js +2 -14
  27. package/lib/components/Catalog/CatalogTableView/CatalogEntityRelationCell.d.ts +3 -0
  28. package/lib/components/Catalog/CatalogTableView/CatalogEntityRelationCell.js +11 -0
  29. package/lib/components/Catalog/CatalogTableView/CatalogTableHeaderCell.d.ts +1 -1
  30. package/lib/components/Catalog/CatalogTableView/CatalogTableView.d.ts +1 -2
  31. package/lib/components/Catalog/CatalogTableView/CatalogTableView.js +3 -26
  32. package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.d.ts +0 -2
  33. package/lib/components/Catalog/CatalogTableView/CatalogTableViewRow.js +5 -26
  34. package/lib/components/Catalog/CatalogTagsWithTooltip.d.ts +1 -1
  35. package/lib/components/Catalog/CatalogTagsWithTooltip.js +5 -6
  36. package/lib/components/Catalog/variables.js +36 -7
  37. package/lib/components/Menu/variables.js +2 -0
  38. package/lib/components/Tag/Tag.d.ts +2 -1
  39. package/lib/components/Tag/Tag.js +3 -3
  40. package/lib/components/Tag/variables.js +14 -0
  41. package/lib/components/Tags/CounterTag.d.ts +1 -1
  42. package/lib/components/Tags/HttpTag.d.ts +1 -1
  43. package/lib/core/constants/catalog.d.ts +3 -0
  44. package/lib/core/constants/catalog.js +55 -1
  45. package/lib/core/constants/index.d.ts +5 -5
  46. package/lib/core/constants/index.js +5 -5
  47. package/lib/core/constants/search.d.ts +1 -1
  48. package/lib/core/contexts/CodeWalkthrough/CodeWalkthroughControlsContext.d.ts +1 -1
  49. package/lib/core/contexts/CodeWalkthrough/CodeWalkthroughStepsContext.d.ts +1 -1
  50. package/lib/core/contexts/ThemeDataContext.d.ts +1 -1
  51. package/lib/core/contexts/index.d.ts +3 -3
  52. package/lib/core/contexts/index.js +3 -3
  53. package/lib/core/hoc/index.d.ts +1 -1
  54. package/lib/core/hoc/index.js +1 -1
  55. package/lib/core/hooks/__mocks__/index.d.ts +28 -28
  56. package/lib/core/hooks/__mocks__/index.js +28 -28
  57. package/lib/core/hooks/catalog/useCatalogEntities.d.ts +1 -1
  58. package/lib/core/hooks/catalog/useCatalogTableViewRow.js +2 -2
  59. package/lib/core/hooks/code-walkthrough/use-code-panel.js +6 -5
  60. package/lib/core/hooks/code-walkthrough/use-code-walkthrough-controls.js +8 -5
  61. package/lib/core/hooks/code-walkthrough/use-code-walkthrough-steps.d.ts +1 -1
  62. package/lib/core/hooks/code-walkthrough/use-code-walkthrough-steps.js +9 -9
  63. package/lib/core/hooks/code-walkthrough/use-code-walkthrough.d.ts +2 -2
  64. package/lib/core/hooks/code-walkthrough/use-code-walkthrough.js +4 -3
  65. package/lib/core/hooks/code-walkthrough/use-renderable-files.js +6 -4
  66. package/lib/core/hooks/feedback/use-report-dialog.js +4 -3
  67. package/lib/core/hooks/index.d.ts +42 -42
  68. package/lib/core/hooks/index.js +42 -42
  69. package/lib/core/hooks/menu/use-menu-item-expanded.d.ts +1 -1
  70. package/lib/core/hooks/menu/use-mobile-menu-items.d.ts +1 -1
  71. package/lib/core/hooks/menu/use-mobile-menu-items.js +13 -12
  72. package/lib/core/hooks/menu/use-mobile-menu-levels.d.ts +1 -1
  73. package/lib/core/hooks/menu/use-mobile-menu-levels.js +8 -7
  74. package/lib/core/hooks/menu/use-nested-menu.d.ts +1 -1
  75. package/lib/core/hooks/menu/use-nested-menu.js +8 -6
  76. package/lib/core/hooks/search/use-recent-searches.js +3 -3
  77. package/lib/core/hooks/search/use-search-dialog.js +4 -3
  78. package/lib/core/hooks/search/use-search-filter.d.ts +1 -1
  79. package/lib/core/hooks/search/use-suggested-pages.js +2 -2
  80. package/lib/core/hooks/use-active-page-version.js +2 -2
  81. package/lib/core/hooks/use-active-section-id.js +2 -2
  82. package/lib/core/hooks/use-color-switcher.js +4 -3
  83. package/lib/core/hooks/use-input-key-commands.js +2 -2
  84. package/lib/core/hooks/use-language-picker.d.ts +1 -1
  85. package/lib/core/hooks/use-language-picker.js +4 -4
  86. package/lib/core/hooks/use-mobile-menu.js +2 -2
  87. package/lib/core/hooks/use-navbar-height.js +3 -3
  88. package/lib/core/hooks/use-page-versions.js +2 -2
  89. package/lib/core/hooks/use-product-picker.js +2 -2
  90. package/lib/core/hooks/use-theme-config.js +2 -2
  91. package/lib/core/hooks/use-theme-hooks.d.ts +1 -1
  92. package/lib/core/hooks/use-theme-hooks.js +2 -2
  93. package/lib/core/hooks/use-time-ago.js +2 -2
  94. package/lib/core/hooks/use-user-teams.js +2 -2
  95. package/lib/core/index.d.ts +7 -7
  96. package/lib/core/index.js +7 -7
  97. package/lib/core/openapi/index.d.ts +18 -0
  98. package/lib/core/openapi/index.js +48 -0
  99. package/lib/core/styles/global.js +1 -1
  100. package/lib/core/styles/index.d.ts +2 -2
  101. package/lib/core/styles/index.js +2 -2
  102. package/lib/core/templates/Markdown.d.ts +1 -1
  103. package/lib/core/templates/Markdown.js +8 -6
  104. package/lib/core/types/catalog.d.ts +6 -2
  105. package/lib/core/types/code-walkthrough.d.ts +1 -1
  106. package/lib/core/types/feedback.d.ts +1 -1
  107. package/lib/core/types/filter.d.ts +1 -1
  108. package/lib/core/types/hooks.d.ts +11 -3
  109. package/lib/core/types/index.d.ts +18 -18
  110. package/lib/core/types/index.js +18 -18
  111. package/lib/core/types/l10n.d.ts +1 -1
  112. package/lib/core/types/search.d.ts +1 -1
  113. package/lib/core/types/sidebar.d.ts +1 -1
  114. package/lib/core/utils/download-code-walkthrough.js +6 -4
  115. package/lib/core/utils/get-code-walkthrough-file-text.js +4 -3
  116. package/lib/core/utils/index.d.ts +35 -35
  117. package/lib/core/utils/index.js +35 -35
  118. package/lib/core/utils/load-and-navigate.js +2 -2
  119. package/lib/core/utils/match-code-walkthrough-conditions.js +3 -3
  120. package/lib/core/utils/menu.d.ts +3 -2
  121. package/lib/core/utils/menu.js +12 -12
  122. package/lib/core/utils/toc.d.ts +1 -1
  123. package/lib/core/utils/type-guards.d.ts +1 -1
  124. package/lib/core/utils/type-guards.js +5 -5
  125. package/lib/core/utils/urls.d.ts +1 -1
  126. package/lib/core/utils/urls.js +2 -2
  127. package/lib/icons/MoleculesIcon/MoleculesIcon.d.ts +9 -0
  128. package/lib/icons/MoleculesIcon/MoleculesIcon.js +22 -0
  129. package/lib/icons/NetworkIcon/NetworkIcon.d.ts +9 -0
  130. package/lib/icons/NetworkIcon/NetworkIcon.js +23 -0
  131. package/lib/icons/NotesIcon/NotesIcon.d.ts +9 -0
  132. package/lib/icons/NotesIcon/NotesIcon.js +26 -0
  133. package/lib/markdoc/components/Tabs/TabList.js +2 -0
  134. package/package.json +2 -2
  135. package/src/components/Catalog/CatalogCardView/CatalogCard.tsx +6 -3
  136. package/src/components/Catalog/CatalogEntity/CatalogEntity.tsx +7 -15
  137. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityProperties.tsx +7 -1
  138. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard.tsx +4 -0
  139. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty.tsx +2 -3
  140. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/EntityTypeProperty.tsx +10 -3
  141. package/src/components/Catalog/CatalogEntity/CatalogEntityProperties/FormatProperty.tsx +36 -0
  142. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityDefaultRelations.tsx +19 -22
  143. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.tsx +8 -2
  144. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable.tsx +0 -1
  145. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityTeamRelations.tsx +16 -3
  146. package/src/components/Catalog/CatalogEntity/CatalogEntitySchema.tsx +52 -0
  147. package/src/components/Catalog/CatalogEntityIcon.tsx +33 -27
  148. package/src/components/Catalog/CatalogEntityTypeIcon.tsx +23 -28
  149. package/src/components/Catalog/CatalogEntityTypeTag.tsx +43 -0
  150. package/src/components/Catalog/CatalogPageDescription.tsx +4 -3
  151. package/src/components/Catalog/CatalogTableView/CatalogEntityCell.tsx +7 -20
  152. package/src/components/Catalog/CatalogTableView/CatalogEntityRelationCell.tsx +19 -0
  153. package/src/components/Catalog/CatalogTableView/CatalogTableHeaderCell.tsx +4 -2
  154. package/src/components/Catalog/CatalogTableView/CatalogTableView.tsx +3 -31
  155. package/src/components/Catalog/CatalogTableView/CatalogTableViewRow.tsx +5 -31
  156. package/src/components/Catalog/CatalogTagsWithTooltip.tsx +10 -19
  157. package/src/components/Catalog/variables.ts +36 -7
  158. package/src/components/Menu/variables.ts +2 -0
  159. package/src/components/Tag/Tag.tsx +11 -2
  160. package/src/components/Tag/variables.ts +14 -0
  161. package/src/core/constants/catalog.ts +58 -0
  162. package/src/core/constants/index.ts +5 -5
  163. package/src/core/constants/search.ts +1 -1
  164. package/src/core/contexts/CodeWalkthrough/CodeWalkthroughControlsContext.tsx +1 -1
  165. package/src/core/contexts/CodeWalkthrough/CodeWalkthroughStepsContext.tsx +1 -1
  166. package/src/core/contexts/ThemeDataContext.tsx +3 -3
  167. package/src/core/contexts/index.ts +3 -3
  168. package/src/core/hoc/index.ts +1 -1
  169. package/src/core/hooks/__mocks__/index.ts +28 -28
  170. package/src/core/hooks/catalog/useCatalogEntities.ts +1 -1
  171. package/src/core/hooks/catalog/useCatalogTableViewRow.ts +1 -1
  172. package/src/core/hooks/code-walkthrough/use-code-panel.ts +3 -5
  173. package/src/core/hooks/code-walkthrough/use-code-walkthrough-controls.ts +4 -6
  174. package/src/core/hooks/code-walkthrough/use-code-walkthrough-steps.ts +4 -3
  175. package/src/core/hooks/code-walkthrough/use-code-walkthrough.ts +3 -3
  176. package/src/core/hooks/code-walkthrough/use-renderable-files.ts +4 -6
  177. package/src/core/hooks/feedback/use-report-dialog.ts +3 -2
  178. package/src/core/hooks/index.ts +42 -42
  179. package/src/core/hooks/menu/use-menu-item-expanded.ts +1 -1
  180. package/src/core/hooks/menu/use-mobile-menu-items.ts +4 -7
  181. package/src/core/hooks/menu/use-mobile-menu-levels.ts +3 -2
  182. package/src/core/hooks/menu/use-nested-menu.ts +5 -3
  183. package/src/core/hooks/search/use-recent-searches.ts +1 -1
  184. package/src/core/hooks/search/use-search-dialog.ts +2 -1
  185. package/src/core/hooks/search/use-search-filter.ts +1 -1
  186. package/src/core/hooks/search/use-suggested-pages.ts +1 -1
  187. package/src/core/hooks/use-active-page-version.ts +1 -1
  188. package/src/core/hooks/use-active-section-id.ts +1 -1
  189. package/src/core/hooks/use-codeblock-tabs-controls.ts +1 -1
  190. package/src/core/hooks/use-color-switcher.ts +2 -1
  191. package/src/core/hooks/use-input-key-commands.ts +1 -1
  192. package/src/core/hooks/use-language-picker.ts +3 -3
  193. package/src/core/hooks/use-mobile-menu.ts +1 -1
  194. package/src/core/hooks/use-navbar-height.ts +1 -1
  195. package/src/core/hooks/use-page-versions.ts +1 -1
  196. package/src/core/hooks/use-product-picker.ts +1 -1
  197. package/src/core/hooks/use-theme-config.ts +2 -2
  198. package/src/core/hooks/use-theme-hooks.ts +2 -2
  199. package/src/core/hooks/use-time-ago.ts +3 -2
  200. package/src/core/hooks/use-user-teams.ts +1 -1
  201. package/src/core/index.ts +7 -7
  202. package/src/core/openapi/index.ts +31 -0
  203. package/src/core/styles/global.ts +2 -1
  204. package/src/core/styles/index.ts +2 -2
  205. package/src/core/templates/Markdown.tsx +8 -4
  206. package/src/core/types/catalog.ts +15 -2
  207. package/src/core/types/code-walkthrough.ts +1 -1
  208. package/src/core/types/feedback.ts +6 -6
  209. package/src/core/types/filter.ts +1 -1
  210. package/src/core/types/hooks.ts +17 -16
  211. package/src/core/types/index.ts +18 -18
  212. package/src/core/types/l10n.ts +4 -0
  213. package/src/core/types/search.ts +1 -1
  214. package/src/core/types/sidebar.ts +1 -1
  215. package/src/core/utils/download-code-walkthrough.ts +3 -5
  216. package/src/core/utils/get-code-walkthrough-file-text.ts +2 -1
  217. package/src/core/utils/index.ts +35 -35
  218. package/src/core/utils/load-and-navigate.ts +1 -1
  219. package/src/core/utils/match-code-walkthrough-conditions.ts +1 -1
  220. package/src/core/utils/menu.ts +4 -3
  221. package/src/core/utils/toc.ts +1 -1
  222. package/src/core/utils/type-guards.ts +2 -2
  223. package/src/core/utils/urls.ts +2 -2
  224. package/src/icons/MoleculesIcon/MoleculesIcon.tsx +23 -0
  225. package/src/icons/NetworkIcon/NetworkIcon.tsx +31 -0
  226. package/src/icons/NotesIcon/NotesIcon.tsx +43 -0
  227. 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 '@redocly/theme/core/constants/common';
2
- export * from '@redocly/theme/core/constants/environments';
3
- export * from '@redocly/theme/core/constants/code-walkthrough';
4
- export * from '@redocly/theme/core/constants/search';
5
- export * from '@redocly/theme/core/constants/catalog';
1
+ export * from './common';
2
+ export * from './environments';
3
+ export * from './code-walkthrough';
4
+ export * from './search';
5
+ export * from './catalog';
@@ -1,4 +1,4 @@
1
- import type { AiSearchErrorConfig } from '@redocly/theme/core/types';
1
+ import type { AiSearchErrorConfig } from '../types/search';
2
2
 
3
3
  export enum AiSearchError {
4
4
  Unauthorized = 'ai_search_unauthorized',
@@ -1,6 +1,6 @@
1
1
  import { createContext } from 'react';
2
2
 
3
- import type { WalkthroughControlsState } from '@redocly/theme/core/hooks';
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 '@redocly/theme/core/types';
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 '@redocly/theme/core/types';
5
- import type { LinkProps } from '@redocly/theme/components/Link/Link';
6
- import type { UiAccessibleConfig } from '@redocly/theme/config';
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 '@redocly/theme/core/contexts/ThemeDataContext';
2
- export * from '@redocly/theme/core/contexts/CodeWalkthrough/CodeWalkthroughControlsContext';
3
- export * from '@redocly/theme/core/contexts/CodeWalkthrough/CodeWalkthroughStepsContext';
1
+ export * from './ThemeDataContext';
2
+ export * from './CodeWalkthrough/CodeWalkthroughControlsContext';
3
+ export * from './CodeWalkthrough/CodeWalkthroughStepsContext';
@@ -1 +1 @@
1
- export * from '@redocly/theme/core/hoc/typedMemo';
1
+ export * from './typedMemo';
@@ -1,28 +1,28 @@
1
- export * from '@redocly/theme/core/hooks/__mocks__/use-theme-config';
2
- export * from '@redocly/theme/core/hooks/__mocks__/use-theme-hooks';
3
- export * from '@redocly/theme/core/hooks/__mocks__/use-mobile-menu';
4
- export * from '@redocly/theme/core/hooks/__mocks__/use-controlled-state';
5
- export * from '@redocly/theme/core/hooks/__mocks__/search/use-recent-searches';
6
- export * from '@redocly/theme/core/hooks/__mocks__/search/use-suggested-pages';
7
- export * from '@redocly/theme/core/hooks/__mocks__/search/use-search-filter';
8
- export * from '@redocly/theme/core/hooks/menu/__mocks__/use-mobile-menu-items';
9
- export * from '@redocly/theme/core/hooks/menu/use-collapse';
10
- export * from '@redocly/theme/core/hooks/use-active-heading';
11
- export * from '@redocly/theme/core/hooks/use-control';
12
- export * from '@redocly/theme/core/hooks/use-dialog-hotkeys';
13
- export * from '@redocly/theme/core/hooks/use-full-height';
14
- export * from '@redocly/theme/core/hooks/use-modal-scroll-lock';
15
- export * from '@redocly/theme/core/hooks/use-mount';
16
- export * from '@redocly/theme/core/hooks/use-outside-click';
17
- export * from '@redocly/theme/core/hooks/use-unmount';
18
- export * from '@redocly/theme/core/hooks/use-color-switcher';
19
- export * from '@redocly/theme/core/hooks/menu/use-nested-menu';
20
- export * from '@redocly/theme/core/hooks/menu/use-menu-item-expanded';
21
- export * from '@redocly/theme/core/hooks/menu/use-mobile-menu-levels';
22
- export * from '@redocly/theme/core/hooks/feedback/use-report-dialog';
23
- export * from '@redocly/theme/core/hooks/use-product-picker';
24
- export * from '@redocly/theme/core/hooks/search/use-search-dialog';
25
- export * from '@redocly/theme/core/hooks/use-language-picker';
26
- export * from '@redocly/theme/core/hooks/__mocks__/use-element-size';
27
- export * from '@redocly/theme/core/hooks/__mocks__/use-time-ago';
28
- export * from '@redocly/theme/core/hooks/__mocks__/use-input-key-commands';
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 '@redocly/theme';
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');
@@ -1,6 +1,6 @@
1
1
  import { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config';
2
2
 
3
- import { getPathPrefix } from '../../utils';
3
+ import { getPathPrefix } from '../../utils/urls';
4
4
 
5
5
  type CatalogTableViewRowProps = {
6
6
  entityKey: string;
@@ -6,11 +6,9 @@ import type {
6
6
  CodeWalkthroughConditionsObject,
7
7
  } from '@redocly/config';
8
8
 
9
- import {
10
- CodeWalkthroughControlsStateContext,
11
- CodeWalkthroughStepsContext,
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
- downloadCodeWalkthrough,
17
- matchCodeWalkthroughConditions,
18
- getCodeWalkthroughFileText,
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, MarkerArea, WalkthroughStepsState } from '@redocly/theme/core/types';
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 '@redocly/theme/core/utils';
8
- import { ACTIVE_STEP_QUERY_PARAM } from '@redocly/theme/core/constants';
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 '@redocly/theme/core/types';
6
+ import type { WalkthroughStepsState } from '../../types/code-walkthrough';
7
7
 
8
8
  import {
9
- useCodeWalkthroughSteps,
10
9
  useCodeWalkthroughControls,
11
10
  type WalkthroughControlsState,
12
- } from '@redocly/theme/core/hooks';
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 '@redocly/theme/icons/types';
4
+ import type { IconProps } from '../../../icons/types';
5
5
 
6
- import {
7
- getFileIconByExt,
8
- removeLeadingSlash,
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 '@redocly/theme/components/Feedback/ReportDialog';
3
+ import type { ReportDialogProps } from '../../../components/Feedback/ReportDialog';
4
4
 
5
- import { useThemeHooks, useThemeConfig } from '@redocly/theme/core/hooks';
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;
@@ -1,42 +1,42 @@
1
- export * from '@redocly/theme/core/hooks/use-theme-config';
2
- export * from '@redocly/theme/core/hooks/use-control';
3
- export * from '@redocly/theme/core/hooks/use-mount';
4
- export * from '@redocly/theme/core/hooks/use-unmount';
5
- export * from '@redocly/theme/core/hooks/use-active-heading';
6
- export * from '@redocly/theme/core/hooks/use-active-section-id';
7
- export * from '@redocly/theme/core/hooks/use-dialog-hotkeys';
8
- export * from '@redocly/theme/core/hooks/use-full-height';
9
- export * from '@redocly/theme/core/hooks/use-navbar-height';
10
- export * from '@redocly/theme/core/hooks/use-outside-click';
11
- export * from '@redocly/theme/core/hooks/use-theme-hooks';
12
- export * from '@redocly/theme/core/hooks/use-mobile-menu';
13
- export * from '@redocly/theme/core/hooks/use-modal-scroll-lock';
14
- export * from '@redocly/theme/core/hooks/use-color-switcher';
15
- export * from '@redocly/theme/core/hooks/search/use-recent-searches';
16
- export * from '@redocly/theme/core/hooks/search/use-suggested-pages';
17
- export * from '@redocly/theme/core/hooks/menu/use-nested-menu';
18
- export * from '@redocly/theme/core/hooks/menu/use-menu-item-expanded';
19
- export * from '@redocly/theme/core/hooks/menu/use-mobile-menu-items';
20
- export * from '@redocly/theme/core/hooks/menu/use-mobile-menu-levels';
21
- export * from '@redocly/theme/core/hooks/menu/use-collapse';
22
- export * from '@redocly/theme/core/hooks/feedback/use-report-dialog';
23
- export * from '@redocly/theme/core/hooks/use-tabs';
24
- export * from '@redocly/theme/core/hooks/use-focus-trap';
25
- export * from '@redocly/theme/core/hooks/use-language-picker';
26
- export * from '@redocly/theme/core/hooks/use-product-picker';
27
- export * from '@redocly/theme/core/hooks/search/use-search-dialog';
28
- export * from '@redocly/theme/core/hooks/search/use-search-filter';
29
- export * from '@redocly/theme/core/hooks/use-controlled-state';
30
- export * from '@redocly/theme/core/hooks/use-codeblock-tabs-controls';
31
- export * from '@redocly/theme/core/hooks/code-walkthrough/use-code-walkthrough';
32
- export * from '@redocly/theme/core/hooks/code-walkthrough/use-code-walkthrough-steps';
33
- export * from '@redocly/theme/core/hooks/code-walkthrough/use-code-walkthrough-controls';
34
- export * from '@redocly/theme/core/hooks/code-walkthrough/use-code-panel';
35
- export * from '@redocly/theme/core/hooks/code-walkthrough/use-renderable-files';
36
- export * from '@redocly/theme/core/hooks/use-element-size';
37
- export * from '@redocly/theme/core/hooks/use-time-ago';
38
- export * from '@redocly/theme/core/hooks/use-input-key-commands';
39
- export * from '@redocly/theme/core/hooks/catalog/useCatalogEntities';
40
- export * from '@redocly/theme/core/hooks/use-active-page-version';
41
- export * from '@redocly/theme/core/hooks/use-page-versions';
42
- export * from '@redocly/theme/core/hooks/use-user-teams';
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 '@redocly/theme/core/types';
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, useThemeConfig } from '@redocly/theme/core/hooks';
6
- import { MobileMenuType } from '@redocly/theme/core/constants';
7
- import {
8
- buildLanguagesGroup,
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, useThemeConfig } from '@redocly/theme/core/hooks';
7
- import { MobileMenuType } from '@redocly/theme/core/constants';
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 '@redocly/theme/core/types';
4
+ import type { MenuItemProps } from '../../types/sidebar';
5
5
 
6
- import { useMenuItemExpanded, useCollapse } from '@redocly/theme/core/hooks';
7
- import { loadAndNavigate, withoutPathPrefix } from '@redocly/theme/core/utils';
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>;
@@ -1,6 +1,6 @@
1
1
  import { useCallback, useSyncExternalStore } from 'react';
2
2
 
3
- import { isBrowser } from '@redocly/theme/core/utils';
3
+ import { isBrowser } from '../../utils/js-utils';
4
4
 
5
5
  const RECENT_SEARCHES_KEY = 'recentSearches';
6
6
  const RECENT_SEARCHES_LIMIT = 5;
@@ -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, useThemeConfig } from '@redocly/theme/core/hooks';
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);
@@ -1,6 +1,6 @@
1
1
  import { useCallback, useState } from 'react';
2
2
 
3
- import type { SearchFilterItem } from '@redocly/theme/core/types';
3
+ import type { SearchFilterItem } from '../../types/search';
4
4
 
5
5
  export function useSearchFilter(
6
6
  filter: SearchFilterItem[],
@@ -1,4 +1,4 @@
1
- import { useThemeConfig } from '@redocly/theme/core/hooks';
1
+ import { useThemeConfig } from '../use-theme-config';
2
2
 
3
3
  export const useSuggestedPages = () => {
4
4
  const themeSettings = useThemeConfig();
@@ -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 useActivePageVersion(): string | undefined {
4
4
  const { usePageVersions } = useThemeHooks();
@@ -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 '@redocly/theme/core/hooks';
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 '@redocly/theme/components/CodeBlock/CodeBlock';
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, 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>>(