@docusaurus/theme-common 2.0.0-beta.1ec2c95e3 → 2.0.0-beta.21

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 (251) hide show
  1. package/Details.d.ts +14 -0
  2. package/lib/components/Collapsible/index.d.ts +64 -0
  3. package/lib/components/Collapsible/index.d.ts.map +1 -0
  4. package/lib/components/Collapsible/index.js +150 -0
  5. package/lib/components/Collapsible/index.js.map +1 -0
  6. package/lib/components/Details/index.d.ts +17 -0
  7. package/lib/components/Details/index.d.ts.map +1 -0
  8. package/lib/components/Details/index.js +76 -0
  9. package/lib/components/Details/index.js.map +1 -0
  10. package/lib/components/Details/styles.module.css +62 -0
  11. package/lib/contexts/announcementBar.d.ts +22 -0
  12. package/lib/contexts/announcementBar.d.ts.map +1 -0
  13. package/lib/{utils/announcementBarUtils.js → contexts/announcementBar.js} +30 -31
  14. package/lib/contexts/announcementBar.js.map +1 -0
  15. package/lib/contexts/colorMode.d.ts +27 -0
  16. package/lib/contexts/colorMode.d.ts.map +1 -0
  17. package/lib/contexts/colorMode.js +132 -0
  18. package/lib/contexts/colorMode.js.map +1 -0
  19. package/lib/contexts/docSidebarItemsExpandedState.d.ts +31 -0
  20. package/lib/contexts/docSidebarItemsExpandedState.d.ts.map +1 -0
  21. package/lib/contexts/docSidebarItemsExpandedState.js +28 -0
  22. package/lib/contexts/docSidebarItemsExpandedState.js.map +1 -0
  23. package/lib/contexts/docsPreferredVersion.d.ts +31 -0
  24. package/lib/contexts/docsPreferredVersion.d.ts.map +1 -0
  25. package/lib/contexts/docsPreferredVersion.js +130 -0
  26. package/lib/contexts/docsPreferredVersion.js.map +1 -0
  27. package/lib/contexts/docsSidebar.d.ts +26 -0
  28. package/lib/contexts/docsSidebar.d.ts.map +1 -0
  29. package/lib/contexts/docsSidebar.js +30 -0
  30. package/lib/contexts/docsSidebar.js.map +1 -0
  31. package/lib/contexts/docsVersion.d.ts +20 -0
  32. package/lib/contexts/docsVersion.d.ts.map +1 -0
  33. package/lib/contexts/docsVersion.js +26 -0
  34. package/lib/contexts/docsVersion.js.map +1 -0
  35. package/lib/contexts/navbarMobileSidebar.d.ts +31 -0
  36. package/lib/contexts/navbarMobileSidebar.d.ts.map +1 -0
  37. package/lib/contexts/navbarMobileSidebar.js +56 -0
  38. package/lib/contexts/navbarMobileSidebar.js.map +1 -0
  39. package/lib/contexts/navbarSecondaryMenu/content.d.ts +37 -0
  40. package/lib/contexts/navbarSecondaryMenu/content.d.ts.map +1 -0
  41. package/lib/contexts/navbarSecondaryMenu/content.js +56 -0
  42. package/lib/contexts/navbarSecondaryMenu/content.js.map +1 -0
  43. package/lib/contexts/navbarSecondaryMenu/display.d.ts +24 -0
  44. package/lib/contexts/navbarSecondaryMenu/display.d.ts.map +1 -0
  45. package/lib/contexts/navbarSecondaryMenu/display.js +62 -0
  46. package/lib/contexts/navbarSecondaryMenu/display.js.map +1 -0
  47. package/lib/contexts/tabGroupChoice.d.ts +21 -0
  48. package/lib/contexts/tabGroupChoice.d.ts.map +1 -0
  49. package/lib/contexts/tabGroupChoice.js +49 -0
  50. package/lib/contexts/tabGroupChoice.js.map +1 -0
  51. package/lib/{utils/usePrevious.d.ts → hooks/styles.css} +4 -1
  52. package/lib/hooks/useBackToTopButton.d.ts +27 -0
  53. package/lib/hooks/useBackToTopButton.d.ts.map +1 -0
  54. package/lib/hooks/useBackToTopButton.js +50 -0
  55. package/lib/hooks/useBackToTopButton.js.map +1 -0
  56. package/lib/hooks/useCodeWordWrap.d.ts +14 -0
  57. package/lib/hooks/useCodeWordWrap.d.ts.map +1 -0
  58. package/lib/hooks/useCodeWordWrap.js +41 -0
  59. package/lib/hooks/useCodeWordWrap.js.map +1 -0
  60. package/lib/hooks/useHideableNavbar.d.ts +17 -0
  61. package/lib/hooks/useHideableNavbar.d.ts.map +1 -0
  62. package/lib/hooks/useHideableNavbar.js +60 -0
  63. package/lib/hooks/useHideableNavbar.js.map +1 -0
  64. package/lib/hooks/useKeyboardNavigation.d.ts +20 -0
  65. package/lib/hooks/useKeyboardNavigation.d.ts.map +1 -0
  66. package/lib/hooks/useKeyboardNavigation.js +39 -0
  67. package/lib/hooks/useKeyboardNavigation.js.map +1 -0
  68. package/lib/hooks/useLockBodyScroll.d.ts +12 -0
  69. package/lib/hooks/useLockBodyScroll.d.ts.map +1 -0
  70. package/lib/hooks/useLockBodyScroll.js +20 -0
  71. package/lib/hooks/useLockBodyScroll.js.map +1 -0
  72. package/lib/hooks/usePrismTheme.d.ts +13 -0
  73. package/lib/hooks/usePrismTheme.d.ts.map +1 -0
  74. package/lib/hooks/usePrismTheme.js +21 -0
  75. package/lib/hooks/usePrismTheme.js.map +1 -0
  76. package/lib/hooks/useSearchPage.d.ts +25 -0
  77. package/lib/hooks/useSearchPage.d.ts.map +1 -0
  78. package/lib/hooks/useSearchPage.js +43 -0
  79. package/lib/hooks/useSearchPage.js.map +1 -0
  80. package/lib/hooks/useSkipToContent.d.ts +25 -0
  81. package/lib/hooks/useSkipToContent.d.ts.map +1 -0
  82. package/lib/hooks/useSkipToContent.js +35 -0
  83. package/lib/hooks/useSkipToContent.js.map +1 -0
  84. package/lib/hooks/useTOCHighlight.d.ts +25 -0
  85. package/lib/hooks/useTOCHighlight.d.ts.map +1 -0
  86. package/lib/hooks/useTOCHighlight.js +130 -0
  87. package/lib/hooks/useTOCHighlight.js.map +1 -0
  88. package/lib/hooks/useWindowSize.d.ts +28 -0
  89. package/lib/hooks/useWindowSize.d.ts.map +1 -0
  90. package/lib/hooks/useWindowSize.js +59 -0
  91. package/lib/hooks/useWindowSize.js.map +1 -0
  92. package/lib/index.d.ts +38 -10
  93. package/lib/index.d.ts.map +1 -0
  94. package/lib/index.js +38 -9
  95. package/lib/index.js.map +1 -0
  96. package/lib/utils/ThemeClassNames.d.ts +47 -12
  97. package/lib/utils/ThemeClassNames.d.ts.map +1 -0
  98. package/lib/utils/ThemeClassNames.js +45 -4
  99. package/lib/utils/ThemeClassNames.js.map +1 -0
  100. package/lib/utils/codeBlockUtils.d.ts +63 -0
  101. package/lib/utils/codeBlockUtils.d.ts.map +1 -0
  102. package/lib/utils/codeBlockUtils.js +159 -3
  103. package/lib/utils/codeBlockUtils.js.map +1 -0
  104. package/lib/utils/docsUtils.d.ts +91 -0
  105. package/lib/utils/docsUtils.d.ts.map +1 -0
  106. package/lib/utils/docsUtils.js +217 -1
  107. package/lib/utils/docsUtils.js.map +1 -0
  108. package/lib/utils/footerUtils.d.ts +13 -0
  109. package/lib/utils/footerUtils.d.ts.map +1 -0
  110. package/lib/utils/footerUtils.js +14 -0
  111. package/lib/utils/footerUtils.js.map +1 -0
  112. package/lib/utils/generalUtils.d.ts +11 -1
  113. package/lib/utils/generalUtils.d.ts.map +1 -0
  114. package/lib/utils/generalUtils.js +9 -5
  115. package/lib/utils/generalUtils.js.map +1 -0
  116. package/lib/utils/historyUtils.d.ts +17 -0
  117. package/lib/utils/historyUtils.d.ts.map +1 -0
  118. package/lib/utils/historyUtils.js +38 -0
  119. package/lib/utils/historyUtils.js.map +1 -0
  120. package/lib/utils/jsUtils.d.ts +23 -0
  121. package/lib/utils/jsUtils.d.ts.map +1 -0
  122. package/lib/utils/jsUtils.js +29 -0
  123. package/lib/utils/jsUtils.js.map +1 -0
  124. package/lib/utils/metadataUtils.d.ts +38 -0
  125. package/lib/utils/metadataUtils.d.ts.map +1 -0
  126. package/lib/utils/metadataUtils.js +70 -0
  127. package/lib/utils/metadataUtils.js.map +1 -0
  128. package/lib/utils/navbarUtils.d.ts +21 -0
  129. package/lib/utils/navbarUtils.d.ts.map +1 -0
  130. package/lib/utils/navbarUtils.js +36 -0
  131. package/lib/utils/navbarUtils.js.map +1 -0
  132. package/lib/utils/reactUtils.d.ts +42 -0
  133. package/lib/utils/reactUtils.d.ts.map +1 -0
  134. package/lib/utils/reactUtils.js +64 -0
  135. package/lib/utils/reactUtils.js.map +1 -0
  136. package/lib/utils/regexpUtils.d.ts +12 -0
  137. package/lib/utils/regexpUtils.d.ts.map +1 -0
  138. package/lib/utils/regexpUtils.js +18 -0
  139. package/lib/utils/regexpUtils.js.map +1 -0
  140. package/lib/utils/routesUtils.d.ts +26 -0
  141. package/lib/utils/routesUtils.d.ts.map +1 -0
  142. package/lib/utils/routesUtils.js +54 -0
  143. package/lib/utils/routesUtils.js.map +1 -0
  144. package/lib/utils/scrollUtils.d.ts +83 -0
  145. package/lib/utils/scrollUtils.d.ts.map +1 -0
  146. package/lib/utils/scrollUtils.js +200 -0
  147. package/lib/utils/scrollUtils.js.map +1 -0
  148. package/lib/utils/searchUtils.d.ts +13 -0
  149. package/lib/utils/searchUtils.d.ts.map +1 -0
  150. package/lib/utils/searchUtils.js +37 -0
  151. package/lib/utils/searchUtils.js.map +1 -0
  152. package/lib/utils/storageUtils.d.ts +15 -7
  153. package/lib/utils/storageUtils.d.ts.map +1 -0
  154. package/lib/utils/storageUtils.js +55 -22
  155. package/lib/utils/storageUtils.js.map +1 -0
  156. package/lib/utils/tagsUtils.d.ts +18 -0
  157. package/lib/utils/tagsUtils.d.ts.map +1 -0
  158. package/lib/utils/tagsUtils.js +36 -0
  159. package/lib/utils/tagsUtils.js.map +1 -0
  160. package/lib/utils/tocUtils.d.ts +36 -0
  161. package/lib/utils/tocUtils.d.ts.map +1 -0
  162. package/lib/utils/tocUtils.js +84 -0
  163. package/lib/utils/tocUtils.js.map +1 -0
  164. package/lib/utils/useAlternatePageUtils.d.ts +21 -1
  165. package/lib/utils/useAlternatePageUtils.d.ts.map +1 -0
  166. package/lib/utils/useAlternatePageUtils.js +9 -4
  167. package/lib/utils/useAlternatePageUtils.js.map +1 -0
  168. package/lib/utils/useLocalPathname.d.ts +13 -0
  169. package/lib/utils/useLocalPathname.d.ts.map +1 -0
  170. package/lib/utils/useLocalPathname.js +19 -0
  171. package/lib/utils/useLocalPathname.js.map +1 -0
  172. package/lib/utils/useLocationChange.d.ts +9 -6
  173. package/lib/utils/useLocationChange.d.ts.map +1 -0
  174. package/lib/utils/useLocationChange.js +17 -11
  175. package/lib/utils/useLocationChange.js.map +1 -0
  176. package/lib/utils/usePluralForm.d.ts +12 -0
  177. package/lib/utils/usePluralForm.d.ts.map +1 -0
  178. package/lib/utils/usePluralForm.js +36 -37
  179. package/lib/utils/usePluralForm.js.map +1 -0
  180. package/lib/utils/useThemeConfig.d.ts +56 -25
  181. package/lib/utils/useThemeConfig.d.ts.map +1 -0
  182. package/lib/utils/useThemeConfig.js +4 -0
  183. package/lib/utils/useThemeConfig.js.map +1 -0
  184. package/package.json +28 -13
  185. package/src/components/Collapsible/index.tsx +263 -0
  186. package/src/components/Details/index.tsx +109 -0
  187. package/src/components/Details/styles.module.css +62 -0
  188. package/src/{utils/announcementBarUtils.tsx → contexts/announcementBar.tsx} +43 -39
  189. package/src/contexts/colorMode.tsx +198 -0
  190. package/src/contexts/docSidebarItemsExpandedState.tsx +55 -0
  191. package/src/contexts/docsPreferredVersion.tsx +251 -0
  192. package/src/contexts/docsSidebar.tsx +50 -0
  193. package/src/contexts/docsVersion.tsx +36 -0
  194. package/src/contexts/navbarMobileSidebar.tsx +99 -0
  195. package/src/contexts/navbarSecondaryMenu/content.tsx +110 -0
  196. package/src/contexts/navbarSecondaryMenu/display.tsx +102 -0
  197. package/src/contexts/tabGroupChoice.tsx +85 -0
  198. package/{lib/utils/pathUtils.d.ts → src/hooks/styles.css} +4 -1
  199. package/src/hooks/useBackToTopButton.ts +73 -0
  200. package/src/hooks/useCodeWordWrap.ts +56 -0
  201. package/src/hooks/useHideableNavbar.ts +75 -0
  202. package/src/hooks/useKeyboardNavigation.ts +45 -0
  203. package/src/hooks/useLockBodyScroll.ts +21 -0
  204. package/src/hooks/usePrismTheme.ts +24 -0
  205. package/src/hooks/useSearchPage.ts +79 -0
  206. package/src/hooks/useSkipToContent.ts +58 -0
  207. package/src/hooks/useTOCHighlight.ts +189 -0
  208. package/src/hooks/useWindowSize.ts +72 -0
  209. package/src/index.ts +130 -19
  210. package/src/types.d.ts +0 -2
  211. package/src/utils/ThemeClassNames.ts +51 -5
  212. package/src/utils/codeBlockUtils.ts +241 -2
  213. package/src/utils/docsUtils.tsx +334 -0
  214. package/src/utils/footerUtils.ts +18 -0
  215. package/src/utils/generalUtils.ts +9 -5
  216. package/src/utils/historyUtils.ts +45 -0
  217. package/src/utils/jsUtils.ts +36 -0
  218. package/src/utils/metadataUtils.tsx +115 -0
  219. package/src/utils/navbarUtils.tsx +45 -0
  220. package/src/utils/reactUtils.tsx +76 -0
  221. package/src/utils/regexpUtils.ts +24 -0
  222. package/src/utils/routesUtils.ts +75 -0
  223. package/src/utils/scrollUtils.tsx +304 -0
  224. package/src/utils/searchUtils.ts +51 -0
  225. package/src/utils/storageUtils.ts +56 -23
  226. package/src/utils/tagsUtils.ts +50 -0
  227. package/src/utils/tocUtils.ts +119 -0
  228. package/src/utils/useAlternatePageUtils.ts +19 -6
  229. package/src/utils/useLocalPathname.ts +22 -0
  230. package/src/utils/useLocationChange.ts +24 -20
  231. package/src/utils/usePluralForm.ts +50 -38
  232. package/src/utils/useThemeConfig.ts +55 -27
  233. package/lib/.tsbuildinfo +0 -1
  234. package/lib/utils/announcementBarUtils.d.ts +0 -17
  235. package/lib/utils/docsPreferredVersion/DocsPreferredVersionProvider.d.ts +0 -21
  236. package/lib/utils/docsPreferredVersion/DocsPreferredVersionProvider.js +0 -94
  237. package/lib/utils/docsPreferredVersion/DocsPreferredVersionStorage.d.ts +0 -13
  238. package/lib/utils/docsPreferredVersion/DocsPreferredVersionStorage.js +0 -20
  239. package/lib/utils/docsPreferredVersion/useDocsPreferredVersion.d.ts +0 -5
  240. package/lib/utils/docsPreferredVersion/useDocsPreferredVersion.js +0 -41
  241. package/lib/utils/pathUtils.js +0 -13
  242. package/lib/utils/usePrevious.js +0 -14
  243. package/src/utils/__tests__/codeBlockUtils.test.ts +0 -54
  244. package/src/utils/__tests__/pathUtils.test.ts +0 -32
  245. package/src/utils/docsPreferredVersion/DocsPreferredVersionProvider.tsx +0 -165
  246. package/src/utils/docsPreferredVersion/DocsPreferredVersionStorage.ts +0 -34
  247. package/src/utils/docsPreferredVersion/useDocsPreferredVersion.ts +0 -66
  248. package/src/utils/docsUtils.ts +0 -11
  249. package/src/utils/pathUtils.ts +0 -17
  250. package/src/utils/usePrevious.ts +0 -18
  251. package/tsconfig.json +0 -10
@@ -4,6 +4,222 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import { useAllDocsData } from '@theme/hooks/useDocs';
7
+ import { useMemo } from 'react';
8
+ import { matchPath, useLocation } from '@docusaurus/router';
9
+ import renderRoutes from '@docusaurus/renderRoutes';
10
+ import { useAllDocsData, useActivePlugin, useActiveDocContext, useLatestVersion, } from '@docusaurus/plugin-content-docs/client';
11
+ import { useDocsPreferredVersion } from '../contexts/docsPreferredVersion';
12
+ import { useDocsVersion } from '../contexts/docsVersion';
13
+ import { useDocsSidebar } from '../contexts/docsSidebar';
14
+ import { uniq } from './jsUtils';
15
+ import { isSamePath } from './routesUtils';
8
16
  // TODO not ideal, see also "useDocs"
9
17
  export const isDocsPluginEnabled = !!useAllDocsData;
18
+ export function useDocById(id) {
19
+ const version = useDocsVersion();
20
+ if (!id) {
21
+ return undefined;
22
+ }
23
+ const doc = version.docs[id];
24
+ if (!doc) {
25
+ throw new Error(`no version doc found by id=${id}`);
26
+ }
27
+ return doc;
28
+ }
29
+ /**
30
+ * Pure function, similar to `Array#find`, but works on the sidebar tree.
31
+ */
32
+ export function findSidebarCategory(sidebar, predicate) {
33
+ for (const item of sidebar) {
34
+ if (item.type === 'category') {
35
+ if (predicate(item)) {
36
+ return item;
37
+ }
38
+ const subItem = findSidebarCategory(item.items, predicate);
39
+ if (subItem) {
40
+ return subItem;
41
+ }
42
+ }
43
+ }
44
+ return undefined;
45
+ }
46
+ /**
47
+ * Best effort to assign a link to a sidebar category. If the category doesn't
48
+ * have a link itself, we link to the first sub item with a link.
49
+ */
50
+ export function findFirstCategoryLink(item) {
51
+ if (item.href) {
52
+ return item.href;
53
+ }
54
+ for (const subItem of item.items) {
55
+ if (subItem.type === 'link') {
56
+ return subItem.href;
57
+ }
58
+ else if (subItem.type === 'category') {
59
+ const categoryLink = findFirstCategoryLink(subItem);
60
+ if (categoryLink) {
61
+ return categoryLink;
62
+ }
63
+ }
64
+ // Could be "html" items
65
+ }
66
+ return undefined;
67
+ }
68
+ /**
69
+ * Gets the category associated with the current location. Should only be used
70
+ * on category index pages.
71
+ */
72
+ export function useCurrentSidebarCategory() {
73
+ const { pathname } = useLocation();
74
+ const sidebar = useDocsSidebar();
75
+ if (!sidebar) {
76
+ throw new Error('Unexpected: cant find current sidebar in context');
77
+ }
78
+ const category = findSidebarCategory(sidebar.items, (item) => isSamePath(item.href, pathname));
79
+ if (!category) {
80
+ throw new Error(`${pathname} is not associated with a category. useCurrentSidebarCategory() should only be used on category index pages.`);
81
+ }
82
+ return category;
83
+ }
84
+ const isActive = (testedPath, activePath) => typeof testedPath !== 'undefined' && isSamePath(testedPath, activePath);
85
+ const containsActiveSidebarItem = (items, activePath) => items.some((subItem) => isActiveSidebarItem(subItem, activePath));
86
+ /**
87
+ * Checks if a sidebar item should be active, based on the active path.
88
+ */
89
+ export function isActiveSidebarItem(item, activePath) {
90
+ if (item.type === 'link') {
91
+ return isActive(item.href, activePath);
92
+ }
93
+ if (item.type === 'category') {
94
+ return (isActive(item.href, activePath) ||
95
+ containsActiveSidebarItem(item.items, activePath));
96
+ }
97
+ return false;
98
+ }
99
+ /**
100
+ * Gets the breadcrumbs of the current doc page, based on its sidebar location.
101
+ * Returns `null` if there's no sidebar or breadcrumbs are disabled.
102
+ */
103
+ export function useSidebarBreadcrumbs() {
104
+ const sidebar = useDocsSidebar();
105
+ const { pathname } = useLocation();
106
+ const breadcrumbsOption = useActivePlugin()?.pluginData.breadcrumbs;
107
+ if (breadcrumbsOption === false || !sidebar) {
108
+ return null;
109
+ }
110
+ const breadcrumbs = [];
111
+ function extract(items) {
112
+ for (const item of items) {
113
+ if ((item.type === 'category' &&
114
+ (isSamePath(item.href, pathname) || extract(item.items))) ||
115
+ (item.type === 'link' && isSamePath(item.href, pathname))) {
116
+ breadcrumbs.push(item);
117
+ return true;
118
+ }
119
+ }
120
+ return false;
121
+ }
122
+ extract(sidebar.items);
123
+ return breadcrumbs.reverse();
124
+ }
125
+ /**
126
+ * "Version candidates" are mostly useful for the layout components, which must
127
+ * be able to work on all pages. For example, if a user has `{ type: "doc",
128
+ * docId: "intro" }` as a navbar item, which version does that refer to? We
129
+ * believe that it could refer to at most three version candidates:
130
+ *
131
+ * 1. The **active version**, the one that the user is currently browsing. See
132
+ * {@link useActiveDocContext}.
133
+ * 2. The **preferred version**, the one that the user last visited. See
134
+ * {@link useDocsPreferredVersion}.
135
+ * 3. The **latest version**, the "default". See {@link useLatestVersion}.
136
+ *
137
+ * @param docsPluginId The plugin ID to get versions from.
138
+ * @returns An array of 1~3 versions with priorities defined above, guaranteed
139
+ * to be unique and non-sparse. Will be memoized, hence stable for deps array.
140
+ */
141
+ export function useDocsVersionCandidates(docsPluginId) {
142
+ const { activeVersion } = useActiveDocContext(docsPluginId);
143
+ const { preferredVersion } = useDocsPreferredVersion(docsPluginId);
144
+ const latestVersion = useLatestVersion(docsPluginId);
145
+ return useMemo(() => uniq([activeVersion, preferredVersion, latestVersion].filter(Boolean)), [activeVersion, preferredVersion, latestVersion]);
146
+ }
147
+ /**
148
+ * The layout components, like navbar items, must be able to work on all pages,
149
+ * even on non-doc ones where there's no version context, so a sidebar ID could
150
+ * be ambiguous. This hook would always return a sidebar to be linked to. See
151
+ * also {@link useDocsVersionCandidates} for how this selection is done.
152
+ *
153
+ * @throws This hook throws if a sidebar with said ID is not found.
154
+ */
155
+ export function useLayoutDocsSidebar(sidebarId, docsPluginId) {
156
+ const versions = useDocsVersionCandidates(docsPluginId);
157
+ return useMemo(() => {
158
+ const allSidebars = versions.flatMap((version) => version.sidebars ? Object.entries(version.sidebars) : []);
159
+ const sidebarEntry = allSidebars.find((sidebar) => sidebar[0] === sidebarId);
160
+ if (!sidebarEntry) {
161
+ throw new Error(`Can't find any sidebar with id "${sidebarId}" in version${versions.length > 1 ? 's' : ''} ${versions.map((version) => version.name).join(', ')}".
162
+ Available sidebar ids are:
163
+ - ${Object.keys(allSidebars).join('\n- ')}`);
164
+ }
165
+ return sidebarEntry[1];
166
+ }, [sidebarId, versions]);
167
+ }
168
+ /**
169
+ * The layout components, like navbar items, must be able to work on all pages,
170
+ * even on non-doc ones where there's no version context, so a doc ID could be
171
+ * ambiguous. This hook would always return a doc to be linked to. See also
172
+ * {@link useDocsVersionCandidates} for how this selection is done.
173
+ *
174
+ * @throws This hook throws if a doc with said ID is not found.
175
+ */
176
+ export function useLayoutDoc(docId, docsPluginId) {
177
+ const versions = useDocsVersionCandidates(docsPluginId);
178
+ return useMemo(() => {
179
+ const allDocs = versions.flatMap((version) => version.docs);
180
+ const doc = allDocs.find((versionDoc) => versionDoc.id === docId);
181
+ if (!doc) {
182
+ const isDraft = versions
183
+ .flatMap((version) => version.draftIds)
184
+ .includes(docId);
185
+ // Drafts should be silently filtered instead of throwing
186
+ if (isDraft) {
187
+ return null;
188
+ }
189
+ throw new Error(`DocNavbarItem: couldn't find any doc with id "${docId}" in version${versions.length > 1 ? 's' : ''} ${versions.map((version) => version.name).join(', ')}".
190
+ Available doc ids are:
191
+ - ${uniq(allDocs.map((versionDoc) => versionDoc.id)).join('\n- ')}`);
192
+ }
193
+ return doc;
194
+ }, [docId, versions]);
195
+ }
196
+ // TODO later read version/route directly from context
197
+ /**
198
+ * The docs plugin creates nested routes, with the top-level route providing the
199
+ * version metadata, and the subroutes creating individual doc pages. This hook
200
+ * will match the current location against all known sub-routes.
201
+ *
202
+ * @param props The props received by `@theme/DocPage`
203
+ * @returns The data of the relevant document at the current location, or `null`
204
+ * if no document associated with the current location can be found.
205
+ */
206
+ export function useDocRouteMetadata({ route, versionMetadata, }) {
207
+ const location = useLocation();
208
+ const docRoutes = route.routes;
209
+ const currentDocRoute = docRoutes.find((docRoute) => matchPath(location.pathname, docRoute));
210
+ if (!currentDocRoute) {
211
+ return null;
212
+ }
213
+ // For now, the sidebarName is added as route config: not ideal!
214
+ const sidebarName = currentDocRoute.sidebar;
215
+ const sidebarItems = sidebarName
216
+ ? versionMetadata.docsSidebars[sidebarName]
217
+ : undefined;
218
+ const docElement = renderRoutes(docRoutes, { versionMetadata });
219
+ return {
220
+ docElement,
221
+ sidebarName,
222
+ sidebarItems,
223
+ };
224
+ }
225
+ //# sourceMappingURL=docsUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"docsUtils.js","sourceRoot":"","sources":["../../src/utils/docsUtils.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAC,SAAS,EAAE,WAAW,EAAC,MAAM,oBAAoB,CAAC;AAC1D,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,EACL,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,gBAAgB,GAIjB,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAAC,uBAAuB,EAAC,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AASzC,qCAAqC;AACrC,MAAM,CAAC,MAAM,mBAAmB,GAAY,CAAC,CAAC,cAAc,CAAC;AAU7D,MAAM,UAAU,UAAU,CAAC,EAAsB;IAC/C,MAAM,OAAO,GAAG,cAAc,EAAE,CAAC;IACjC,IAAI,CAAC,EAAE,EAAE;QACP,OAAO,SAAS,CAAC;KAClB;IACD,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC7B,IAAI,C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G,eAAe,CAAC,OAAiB,CAAC;IAEtD,MAAM,YAAY,GAAG,WAAW;QAC9B,CAAC,CAAC,eAAe,CAAC,YAAY,CAAC,WAAW,CAAC;QAC3C,CAAC,CAAC,SAAS,CAAC;IAEd,MAAM,UAAU,GAAG,YAAY,CAAC,SAAS,EAAE,EAAC,eAAe,EAAC,CAAC,CAAC;IAE9D,OAAO;QACL,UAAU;QACV,WAAW;QACX,YAAY;KACb,CAAC;AACJ,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import type { MultiColumnFooter, SimpleFooter } from './useThemeConfig';
8
+ /**
9
+ * A rough duck-typing about whether the `footer.links` is intended to be multi-
10
+ * column.
11
+ */
12
+ export declare function isMultiColumnFooterLinks(links: MultiColumnFooter['links'] | SimpleFooter['links']): links is MultiColumnFooter['links'];
13
+ //# sourceMappingURL=footerUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"footerUtils.d.ts","sourceRoot":"","sources":["../../src/utils/footerUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAC,iBAAiB,EAAE,YAAY,EAAC,MAAM,kBAAkB,CAAC;AAEtE;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC,GAAG,YAAY,CAAC,OAAO,CAAC,GACxD,KAAK,IAAI,iBAAiB,CAAC,OAAO,CAAC,CAErC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ /**
8
+ * A rough duck-typing about whether the `footer.links` is intended to be multi-
9
+ * column.
10
+ */
11
+ export function isMultiColumnFooterLinks(links) {
12
+ return 'title' in links[0];
13
+ }
14
+ //# sourceMappingURL=footerUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"footerUtils.js","sourceRoot":"","sources":["../../src/utils/footerUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CACtC,KAAyD;IAEzD,OAAO,OAAO,IAAI,KAAK,CAAC,CAAC,CAAE,CAAC;AAC9B,CAAC"}
@@ -1 +1,11 @@
1
- export declare const useTitleFormatter: (title?: string | undefined) => string;
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ /**
8
+ * Formats the page's title based on relevant site config and other contexts.
9
+ */
10
+ export declare function useTitleFormatter(title?: string | undefined): string;
11
+ //# sourceMappingURL=generalUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generalUtils.d.ts","sourceRoot":"","sources":["../../src/utils/generalUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAMpE"}
@@ -5,10 +5,14 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
8
- export const useTitleFormatter = (title) => {
9
- const { siteConfig = {} } = useDocusaurusContext();
10
- const { title: siteTitle, titleDelimiter = '|' } = siteConfig;
11
- return title && title.trim().length
8
+ /**
9
+ * Formats the page's title based on relevant site config and other contexts.
10
+ */
11
+ export function useTitleFormatter(title) {
12
+ const { siteConfig } = useDocusaurusContext();
13
+ const { title: siteTitle, titleDelimiter } = siteConfig;
14
+ return title?.trim().length
12
15
  ? `${title.trim()} ${titleDelimiter} ${siteTitle}`
13
16
  : siteTitle;
14
- };
17
+ }
18
+ //# sourceMappingURL=generalUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generalUtils.js","sourceRoot":"","sources":["../../src/utils/generalUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,oBAAoB,MAAM,kCAAkC,CAAC;AAEpE;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAA0B;IAC1D,MAAM,EAAC,UAAU,EAAC,GAAG,oBAAoB,EAAE,CAAC;IAC5C,MAAM,EAAC,KAAK,EAAE,SAAS,EAAE,cAAc,EAAC,GAAG,UAAU,CAAC;IACtD,OAAO,KAAK,EAAE,IAAI,EAAE,CAAC,MAAM;QACzB,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,IAAI,cAAc,IAAI,SAAS,EAAE;QAClD,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import type { Location, Action } from 'history';
8
+ declare type HistoryBlockHandler = (location: Location, action: Action) => void | false;
9
+ /**
10
+ * Permits to register a handler that will be called on history pop navigation
11
+ * (backward/forward). If the handler returns `false`, the backward/forward
12
+ * transition will be blocked. Unfortunately there's no good way to detect the
13
+ * "direction" (backward/forward) of the POP event.
14
+ */
15
+ export declare function useHistoryPopHandler(handler: HistoryBlockHandler): void;
16
+ export {};
17
+ //# sourceMappingURL=historyUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"historyUtils.d.ts","sourceRoot":"","sources":["../../src/utils/historyUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAC,QAAQ,EAAE,MAAM,EAAC,MAAM,SAAS,CAAC;AAE9C,aAAK,mBAAmB,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,GAAG,KAAK,CAAC;AAiBhF;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI,CASvE"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import { useEffect } from 'react';
8
+ import { useHistory } from '@docusaurus/router';
9
+ import { useDynamicCallback } from './reactUtils';
10
+ /**
11
+ * Permits to register a handler that will be called on history actions (pop,
12
+ * push, replace). If the handler returns `false`, the navigation transition
13
+ * will be blocked/cancelled.
14
+ */
15
+ function useHistoryActionHandler(handler) {
16
+ const { block } = useHistory();
17
+ const stableHandler = useDynamicCallback(handler);
18
+ useEffect(
19
+ // See https://github.com/remix-run/history/blob/main/docs/blocking-transitions.md
20
+ () => block((location, action) => stableHandler(location, action)), [block, stableHandler]);
21
+ }
22
+ /**
23
+ * Permits to register a handler that will be called on history pop navigation
24
+ * (backward/forward). If the handler returns `false`, the backward/forward
25
+ * transition will be blocked. Unfortunately there's no good way to detect the
26
+ * "direction" (backward/forward) of the POP event.
27
+ */
28
+ export function useHistoryPopHandler(handler) {
29
+ useHistoryActionHandler((location, action) => {
30
+ if (action === 'POP') {
31
+ // Maybe block navigation if handler returns false
32
+ return handler(location, action);
33
+ }
34
+ // Don't block other navigation actions
35
+ return undefined;
36
+ });
37
+ }
38
+ //# sourceMappingURL=historyUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"historyUtils.js","sourceRoot":"","sources":["../../src/utils/historyUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAChC,OAAO,EAAC,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAC,kBAAkB,EAAC,MAAM,cAAc,CAAC;AAKhD;;;;GAIG;AACH,SAAS,uBAAuB,CAAC,OAA4B;IAC3D,MAAM,EAAC,KAAK,EAAC,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,aAAa,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;IAClD,SAAS;IACP,kFAAkF;IAClF,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,EAClE,CAAC,KAAK,EAAE,aAAa,CAAC,CACvB,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAA4B;IAC/D,uBAAuB,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE;QAC3C,IAAI,MAAM,KAAK,KAAK,EAAE;YACpB,kDAAkD;YAClD,OAAO,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;SAClC;QACD,uCAAuC;QACvC,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ /**
8
+ * Gets the duplicate values in an array.
9
+ * @param arr The array.
10
+ * @param comparator Compares two values and returns `true` if they are equal
11
+ * (duplicated).
12
+ * @returns Value of the elements `v` that have a preceding element `u` where
13
+ * `comparator(u, v) === true`. Values within the returned array are not
14
+ * guaranteed to be unique.
15
+ */
16
+ export declare function duplicates<T>(arr: readonly T[], comparator?: (a: T, b: T) => boolean): T[];
17
+ /**
18
+ * Remove duplicate array items (similar to `_.uniq`)
19
+ * @param arr The array.
20
+ * @returns An array with duplicate elements removed by reference comparison.
21
+ */
22
+ export declare function uniq<T>(arr: T[]): T[];
23
+ //# sourceMappingURL=jsUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsUtils.d.ts","sourceRoot":"","sources":["../../src/utils/jsUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAC1B,GAAG,EAAE,SAAS,CAAC,EAAE,EACjB,UAAU,GAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,OAA2B,GACtD,CAAC,EAAE,CAIL;AAED;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAGrC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ // A replacement of lodash in client code
8
+ /**
9
+ * Gets the duplicate values in an array.
10
+ * @param arr The array.
11
+ * @param comparator Compares two values and returns `true` if they are equal
12
+ * (duplicated).
13
+ * @returns Value of the elements `v` that have a preceding element `u` where
14
+ * `comparator(u, v) === true`. Values within the returned array are not
15
+ * guaranteed to be unique.
16
+ */
17
+ export function duplicates(arr, comparator = (a, b) => a === b) {
18
+ return arr.filter((v, vIndex) => arr.findIndex((u) => comparator(u, v)) !== vIndex);
19
+ }
20
+ /**
21
+ * Remove duplicate array items (similar to `_.uniq`)
22
+ * @param arr The array.
23
+ * @returns An array with duplicate elements removed by reference comparison.
24
+ */
25
+ export function uniq(arr) {
26
+ // Note: had problems with [...new Set()]: https://github.com/facebook/docusaurus/issues/4972#issuecomment-863895061
27
+ return Array.from(new Set(arr));
28
+ }
29
+ //# sourceMappingURL=jsUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsUtils.js","sourceRoot":"","sources":["../../src/utils/jsUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,yCAAyC;AAEzC;;;;;;;;GAQG;AACH,MAAM,UAAU,UAAU,CACxB,GAAiB,EACjB,aAAsC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC;IAEvD,OAAO,GAAG,CAAC,MAAM,CACf,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,MAAM,CACjE,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,IAAI,CAAI,GAAQ;IAC9B,oHAAoH;IACpH,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AAClC,CAAC"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import { type ReactNode } from 'react';
8
+ declare type PageMetadataProps = {
9
+ readonly title?: string;
10
+ readonly description?: string;
11
+ readonly keywords?: readonly string[] | string;
12
+ readonly image?: string;
13
+ readonly children?: ReactNode;
14
+ };
15
+ /**
16
+ * Helper component to manipulate page metadata and override site defaults.
17
+ * Works in the same way as Helmet.
18
+ */
19
+ export declare function PageMetadata({ title, description, keywords, image, children, }: PageMetadataProps): JSX.Element;
20
+ /**
21
+ * Every layer of this provider will append a class name to the HTML element.
22
+ * There's no consumer for this hook: it's side-effect-only. This wrapper is
23
+ * necessary because Helmet does not "merge" classes.
24
+ * @see https://github.com/staylor/react-helmet-async/issues/161
25
+ */
26
+ export declare function HtmlClassNameProvider({ className: classNameProp, children, }: {
27
+ className: string;
28
+ children: ReactNode;
29
+ }): JSX.Element;
30
+ /**
31
+ * A very thin wrapper around `HtmlClassNameProvider` that adds the plugin ID +
32
+ * name to the HTML class name.
33
+ */
34
+ export declare function PluginHtmlClassNameProvider({ children, }: {
35
+ children: ReactNode;
36
+ }): JSX.Element;
37
+ export {};
38
+ //# sourceMappingURL=metadataUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metadataUtils.d.ts","sourceRoot":"","sources":["../../src/utils/metadataUtils.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAc,EAAC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAO5C,aAAK,iBAAiB,GAAG;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAAC;IAC/C,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CAC/B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,WAAW,EACX,QAAQ,EACR,KAAK,EACL,QAAQ,GACT,EAAE,iBAAiB,GAAG,GAAG,CAAC,OAAO,CA6BjC;AAID;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,EAAE,aAAa,EACxB,QAAQ,GACT,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,GAAG,CAAC,OAAO,CAWd;AASD;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,EAC1C,QAAQ,GACT,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,GAAG,CAAC,OAAO,CASd"}
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import React from 'react';
8
+ import clsx from 'clsx';
9
+ import Head from '@docusaurus/Head';
10
+ import useRouteContext from '@docusaurus/useRouteContext';
11
+ import { useBaseUrlUtils } from '@docusaurus/useBaseUrl';
12
+ import { useTitleFormatter } from './generalUtils';
13
+ /**
14
+ * Helper component to manipulate page metadata and override site defaults.
15
+ * Works in the same way as Helmet.
16
+ */
17
+ export function PageMetadata({ title, description, keywords, image, children, }) {
18
+ const pageTitle = useTitleFormatter(title);
19
+ const { withBaseUrl } = useBaseUrlUtils();
20
+ const pageImage = image ? withBaseUrl(image, { absolute: true }) : undefined;
21
+ return (<Head>
22
+ {title && <title>{pageTitle}</title>}
23
+ {title && <meta property="og:title" content={pageTitle}/>}
24
+
25
+ {description && <meta name="description" content={description}/>}
26
+ {description && <meta property="og:description" content={description}/>}
27
+
28
+ {keywords && (<meta name="keywords" content={
29
+ // https://github.com/microsoft/TypeScript/issues/17002
30
+ (Array.isArray(keywords) ? keywords.join(',') : keywords)}/>)}
31
+
32
+ {pageImage && <meta property="og:image" content={pageImage}/>}
33
+ {pageImage && <meta name="twitter:image" content={pageImage}/>}
34
+
35
+ {children}
36
+ </Head>);
37
+ }
38
+ const HtmlClassNameContext = React.createContext(undefined);
39
+ /**
40
+ * Every layer of this provider will append a class name to the HTML element.
41
+ * There's no consumer for this hook: it's side-effect-only. This wrapper is
42
+ * necessary because Helmet does not "merge" classes.
43
+ * @see https://github.com/staylor/react-helmet-async/issues/161
44
+ */
45
+ export function HtmlClassNameProvider({ className: classNameProp, children, }) {
46
+ const classNameContext = React.useContext(HtmlClassNameContext);
47
+ const className = clsx(classNameContext, classNameProp);
48
+ return (<HtmlClassNameContext.Provider value={className}>
49
+ <Head>
50
+ <html className={className}/>
51
+ </Head>
52
+ {children}
53
+ </HtmlClassNameContext.Provider>);
54
+ }
55
+ function pluginNameToClassName(pluginName) {
56
+ return `plugin-${pluginName.replace(/docusaurus-(?:plugin|theme)-(?:content-)?/gi, '')}`;
57
+ }
58
+ /**
59
+ * A very thin wrapper around `HtmlClassNameProvider` that adds the plugin ID +
60
+ * name to the HTML class name.
61
+ */
62
+ export function PluginHtmlClassNameProvider({ children, }) {
63
+ const routeContext = useRouteContext();
64
+ const nameClass = pluginNameToClassName(routeContext.plugin.name);
65
+ const idClass = `plugin-id-${routeContext.plugin.id}`;
66
+ return (<HtmlClassNameProvider className={clsx(nameClass, idClass)}>
67
+ {children}
68
+ </HtmlClassNameProvider>);
69
+ }
70
+ //# sourceMappingURL=metadataUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metadataUtils.js","sourceRoot":"","sources":["../../src/utils/metadataUtils.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAuB,MAAM,OAAO,CAAC;AAC5C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,OAAO,eAAe,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAC,eAAe,EAAC,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAC,iBAAiB,EAAC,MAAM,gBAAgB,CAAC;AAUjD;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,EAC3B,KAAK,EACL,WAAW,EACX,QAAQ,EACR,KAAK,EACL,QAAQ,GACU;IAClB,MAAM,SAAS,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC3C,MAAM,EAAC,WAAW,EAAC,GAAG,eAAe,EAAE,CAAC;IACxC,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAE3E,OAAO,CACL,CAAC,IAAI,CACH;MAAA,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,EAAE,KAAK,CAAC,CACpC;MAAA,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,EAAG,CAE1D;;MAAA,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,EAAG,CACjE;MAAA,CAAC,W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SAAS,qBAAqB,CAAC,UAAkB;IAC/C,OAAO,UAAU,UAAU,CAAC,OAAO,CACjC,6CAA6C,EAC7C,EAAE,CACH,EAAE,CAAC;AACN,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,2BAA2B,CAAC,EAC1C,QAAQ,GAGT;IACC,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;IACvC,MAAM,SAAS,GAAG,qBAAqB,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAClE,MAAM,OAAO,GAAG,aAAa,YAAY,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;IACtD,OAAO,CACL,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CACzD;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,qBAAqB,CAAC,CACzB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import { type ReactNode } from 'react';
8
+ /**
9
+ * Split links by left/right. If position is unspecified, fallback to right.
10
+ */
11
+ export declare function splitNavbarItems<T extends {
12
+ position?: 'left' | 'right';
13
+ }>(items: T[]): [leftItems: T[], rightItems: T[]];
14
+ /**
15
+ * Composes multiple navbar state providers that are mutually dependent and
16
+ * hence can't be re-ordered.
17
+ */
18
+ export declare function NavbarProvider({ children }: {
19
+ children: ReactNode;
20
+ }): JSX.Element;
21
+ //# sourceMappingURL=navbarUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navbarUtils.d.ts","sourceRoot":"","sources":["../../src/utils/navbarUtils.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAc,EAAC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAO5C;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS;IAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CAAC,EACtE,KAAK,EAAE,CAAC,EAAE,GACT,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CASnC;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,EAAC,QAAQ,EAAC,EAAE;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAC,GAAG,GAAG,CAAC,OAAO,CAU7E"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import React from 'react';
8
+ import { NavbarMobileSidebarProvider } from '../contexts/navbarMobileSidebar';
9
+ import { NavbarSecondaryMenuContentProvider } from '../contexts/navbarSecondaryMenu/content';
10
+ import { NavbarSecondaryMenuDisplayProvider } from '../contexts/navbarSecondaryMenu/display';
11
+ const DefaultNavItemPosition = 'right';
12
+ /**
13
+ * Split links by left/right. If position is unspecified, fallback to right.
14
+ */
15
+ export function splitNavbarItems(items) {
16
+ function isLeft(item) {
17
+ return (item.position ?? DefaultNavItemPosition) === 'left';
18
+ }
19
+ const leftItems = items.filter(isLeft);
20
+ const rightItems = items.filter((item) => !isLeft(item));
21
+ return [leftItems, rightItems];
22
+ }
23
+ /**
24
+ * Composes multiple navbar state providers that are mutually dependent and
25
+ * hence can't be re-ordered.
26
+ */
27
+ export function NavbarProvider({ children }) {
28
+ return (<NavbarSecondaryMenuContentProvider>
29
+ <NavbarMobileSidebarProvider>
30
+ <NavbarSecondaryMenuDisplayProvider>
31
+ {children}
32
+ </NavbarSecondaryMenuDisplayProvider>
33
+ </NavbarMobileSidebarProvider>
34
+ </NavbarSecondaryMenuContentProvider>);
35
+ }
36
+ //# sourceMappingURL=navbarUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navbarUtils.js","sourceRoot":"","sources":["../../src/utils/navbarUtils.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAuB,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAC,2BAA2B,EAAC,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAC,kCAAkC,EAAC,MAAM,yCAAyC,CAAC;AAC3F,OAAO,EAAC,kCAAkC,EAAC,MAAM,yCAAyC,CAAC;AAE3F,MAAM,sBAAsB,GAAG,OAAO,CAAC;AAEvC;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,KAAU;IAEV,SAAS,MAAM,CAAC,IAAO;QACrB,OAAO,CAAC,IAAI,CAAC,QAAQ,IAAI,sBAAsB,CAAC,KAAK,MAAM,CAAC;IAC9D,CAAC;IAED,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACvC,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAEzD,OAAO,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;AACjC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,EAAC,QAAQ,EAAwB;IAC9D,OAAO,CACL,CAAC,kCAAkC,CACjC;MAAA,CAAC,2BAA2B,CAC1B;QAAA,CAAC,kCAAkC,CACjC;UAAA,CAAC,QAAQ,CACX;QAAA,EAAE,kCAAkC,CACtC;MAAA,EAAE,2BAA2B,CAC/B;IAAA,EAAE,kCAAkC,CAAC,CACtC,CAAC;AACJ,CAAC"}