@redocly/theme 0.69.0-next.7 → 0.69.0-next.9

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 (45) hide show
  1. package/lib/components/Accordion/Accordion.js +5 -1
  2. package/lib/components/Admonition/Admonition.d.ts +1 -1
  3. package/lib/components/Admonition/Admonition.js +1 -1
  4. package/lib/components/Admonition/variables.dark.js +2 -2
  5. package/lib/components/Admonition/variables.js +9 -9
  6. package/lib/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.js +5 -3
  7. package/lib/components/Catalog/CatalogViewModeToggle.d.ts +1 -1
  8. package/lib/components/Catalog/CatalogViewModeToggle.js +2 -43
  9. package/lib/components/Filter/FilterInput.js +4 -2
  10. package/lib/components/JsonViewer/Helpers.js +12 -42
  11. package/lib/components/Panel/Panel.js +5 -1
  12. package/lib/components/Search/FilterFields/SearchFilterFieldSelect.js +22 -32
  13. package/lib/components/Search/SearchItem.js +5 -3
  14. package/lib/components/Search/variables.js +1 -0
  15. package/lib/components/Select/Select.js +10 -5
  16. package/lib/components/Sidebar/Sidebar.js +2 -38
  17. package/lib/core/hooks/code-walkthrough/use-code-walkthrough-controls.js +5 -17
  18. package/lib/core/hooks/code-walkthrough/use-code-walkthrough-steps.js +1 -0
  19. package/lib/core/hooks/menu/use-menu-item-expanded.js +1 -0
  20. package/lib/core/hooks/use-local-state.js +1 -0
  21. package/lib/core/hooks/use-mobile-menu.js +10 -2
  22. package/lib/core/types/l10n.d.ts +1 -1
  23. package/lib/markdoc/tags/admonition.js +1 -1
  24. package/package.json +3 -3
  25. package/src/components/Accordion/Accordion.tsx +7 -3
  26. package/src/components/Admonition/Admonition.tsx +2 -2
  27. package/src/components/Admonition/variables.dark.ts +2 -2
  28. package/src/components/Admonition/variables.ts +9 -9
  29. package/src/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelations.tsx +6 -4
  30. package/src/components/Catalog/CatalogViewModeToggle.tsx +2 -17
  31. package/src/components/Filter/FilterInput.tsx +5 -3
  32. package/src/components/JsonViewer/Helpers.tsx +13 -9
  33. package/src/components/Panel/Panel.tsx +7 -3
  34. package/src/components/Search/FilterFields/SearchFilterFieldSelect.tsx +32 -40
  35. package/src/components/Search/SearchItem.tsx +6 -1
  36. package/src/components/Search/variables.ts +1 -0
  37. package/src/components/Select/Select.tsx +12 -6
  38. package/src/components/Sidebar/Sidebar.tsx +2 -6
  39. package/src/core/hooks/code-walkthrough/use-code-walkthrough-controls.ts +6 -20
  40. package/src/core/hooks/code-walkthrough/use-code-walkthrough-steps.ts +1 -0
  41. package/src/core/hooks/menu/use-menu-item-expanded.ts +1 -0
  42. package/src/core/hooks/use-local-state.ts +1 -0
  43. package/src/core/hooks/use-mobile-menu.ts +11 -3
  44. package/src/core/types/l10n.ts +4 -0
  45. package/src/markdoc/tags/admonition.ts +1 -1
@@ -1,4 +1,4 @@
1
- import { useEffect, useState } from 'react';
1
+ import { useState } from 'react';
2
2
  import { useLocation } from 'react-router';
3
3
 
4
4
  import { useModalScrollLock } from './use-modal-scroll-lock';
@@ -6,11 +6,19 @@ import { useModalScrollLock } from './use-modal-scroll-lock';
6
6
  export function useMobileMenu(initialState = false) {
7
7
  const location = useLocation();
8
8
  const [isOpen, setIsOpen] = useState(initialState);
9
+ const locationKey = `${location.pathname}${location.hash}`;
10
+ const [prevLocationKey, setPrevLocationKey] = useState(locationKey);
9
11
 
10
- useEffect(() => setIsOpen(false), [location.pathname, location.hash]);
12
+ if (isOpen && prevLocationKey !== locationKey) {
13
+ setPrevLocationKey(locationKey);
14
+ setIsOpen(false);
15
+ }
11
16
  useModalScrollLock(isOpen);
12
17
 
13
- const openMobileMenu = () => setIsOpen(true);
18
+ const openMobileMenu = () => {
19
+ setPrevLocationKey(locationKey);
20
+ setIsOpen(true);
21
+ };
14
22
  const closeMobileMenu = () => setIsOpen(false);
15
23
 
16
24
  return { isOpen, openMobileMenu, closeMobileMenu };
@@ -134,6 +134,10 @@ export type TranslationKey =
134
134
  | 'page.forbidden.description'
135
135
  | 'page.notFound.title'
136
136
  | 'page.notFound.description'
137
+ | 'page.apiNotFound.title'
138
+ | 'page.apiNotFound.description'
139
+ | 'page.apiNotFound.hint'
140
+ | 'page.apiNotFound.backButton'
137
141
  | 'page.mcpNotAllowed.title'
138
142
  | 'page.mcpNotAllowed.description'
139
143
  | 'page.mcpNotAllowed.publicNote'
@@ -7,7 +7,7 @@ export const admonition: MarkdocSchemaWrapper = {
7
7
  type: String,
8
8
  required: true,
9
9
  default: 'info',
10
- matches: ['warning', 'info', 'danger', 'success', 'default'],
10
+ matches: ['warning', 'info', 'danger', 'success', 'idea'],
11
11
  },
12
12
  name: { type: String },
13
13
  },