@docusaurus/theme-common 2.0.0-beta.ff31de0ff → 2.0.0-rc.1

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 (269) hide show
  1. package/lib/components/Collapsible/index.d.ts +64 -0
  2. package/lib/components/Collapsible/index.d.ts.map +1 -0
  3. package/lib/components/Collapsible/index.js +150 -0
  4. package/lib/components/Collapsible/index.js.map +1 -0
  5. package/lib/components/Details/index.d.ts +17 -0
  6. package/lib/components/Details/index.d.ts.map +1 -0
  7. package/lib/components/Details/index.js +76 -0
  8. package/lib/components/Details/index.js.map +1 -0
  9. package/lib/components/Details/styles.module.css +62 -0
  10. package/lib/contexts/announcementBar.d.ts +22 -0
  11. package/lib/contexts/announcementBar.d.ts.map +1 -0
  12. package/lib/contexts/announcementBar.js +72 -0
  13. package/lib/contexts/announcementBar.js.map +1 -0
  14. package/lib/contexts/blogPost.d.ts +33 -0
  15. package/lib/contexts/blogPost.d.ts.map +1 -0
  16. package/lib/contexts/blogPost.js +46 -0
  17. package/lib/contexts/blogPost.js.map +1 -0
  18. package/lib/contexts/colorMode.d.ts +27 -0
  19. package/lib/contexts/colorMode.d.ts.map +1 -0
  20. package/lib/contexts/colorMode.js +132 -0
  21. package/lib/contexts/colorMode.js.map +1 -0
  22. package/lib/contexts/doc.d.ts +30 -0
  23. package/lib/contexts/doc.d.ts.map +1 -0
  24. package/lib/contexts/doc.js +48 -0
  25. package/lib/contexts/doc.js.map +1 -0
  26. package/lib/contexts/docSidebarItemsExpandedState.d.ts +31 -0
  27. package/lib/contexts/docSidebarItemsExpandedState.d.ts.map +1 -0
  28. package/lib/contexts/docSidebarItemsExpandedState.js +28 -0
  29. package/lib/contexts/docSidebarItemsExpandedState.js.map +1 -0
  30. package/lib/contexts/docsPreferredVersion.d.ts +30 -0
  31. package/lib/contexts/docsPreferredVersion.d.ts.map +1 -0
  32. package/lib/contexts/docsPreferredVersion.js +130 -0
  33. package/lib/contexts/docsPreferredVersion.js.map +1 -0
  34. package/lib/contexts/docsSidebar.d.ts +26 -0
  35. package/lib/contexts/docsSidebar.d.ts.map +1 -0
  36. package/lib/contexts/docsSidebar.js +30 -0
  37. package/lib/contexts/docsSidebar.js.map +1 -0
  38. package/lib/contexts/docsVersion.d.ts +20 -0
  39. package/lib/contexts/docsVersion.d.ts.map +1 -0
  40. package/lib/contexts/docsVersion.js +26 -0
  41. package/lib/contexts/docsVersion.js.map +1 -0
  42. package/lib/contexts/navbarMobileSidebar.d.ts +31 -0
  43. package/lib/contexts/navbarMobileSidebar.d.ts.map +1 -0
  44. package/lib/contexts/navbarMobileSidebar.js +56 -0
  45. package/lib/contexts/navbarMobileSidebar.js.map +1 -0
  46. package/lib/contexts/navbarSecondaryMenu/content.d.ts +37 -0
  47. package/lib/contexts/navbarSecondaryMenu/content.d.ts.map +1 -0
  48. package/lib/contexts/navbarSecondaryMenu/content.js +50 -0
  49. package/lib/contexts/navbarSecondaryMenu/content.js.map +1 -0
  50. package/lib/contexts/navbarSecondaryMenu/display.d.ts +24 -0
  51. package/lib/contexts/navbarSecondaryMenu/display.d.ts.map +1 -0
  52. package/lib/contexts/navbarSecondaryMenu/display.js +62 -0
  53. package/lib/contexts/navbarSecondaryMenu/display.js.map +1 -0
  54. package/lib/contexts/tabGroupChoice.d.ts +21 -0
  55. package/lib/contexts/tabGroupChoice.d.ts.map +1 -0
  56. package/lib/contexts/tabGroupChoice.js +49 -0
  57. package/lib/contexts/tabGroupChoice.js.map +1 -0
  58. package/lib/{utils/useChangeRoute.d.ts → hooks/styles.css} +4 -1
  59. package/lib/hooks/useBackToTopButton.d.ts +27 -0
  60. package/lib/hooks/useBackToTopButton.d.ts.map +1 -0
  61. package/lib/hooks/useBackToTopButton.js +50 -0
  62. package/lib/hooks/useBackToTopButton.js.map +1 -0
  63. package/lib/hooks/useCodeWordWrap.d.ts +14 -0
  64. package/lib/hooks/useCodeWordWrap.d.ts.map +1 -0
  65. package/lib/hooks/useCodeWordWrap.js +67 -0
  66. package/lib/hooks/useCodeWordWrap.js.map +1 -0
  67. package/lib/hooks/useHideableNavbar.d.ts +17 -0
  68. package/lib/hooks/useHideableNavbar.d.ts.map +1 -0
  69. package/lib/hooks/useHideableNavbar.js +60 -0
  70. package/lib/hooks/useHideableNavbar.js.map +1 -0
  71. package/lib/hooks/useKeyboardNavigation.d.ts +20 -0
  72. package/lib/hooks/useKeyboardNavigation.d.ts.map +1 -0
  73. package/lib/hooks/useKeyboardNavigation.js +39 -0
  74. package/lib/hooks/useKeyboardNavigation.js.map +1 -0
  75. package/lib/hooks/useLockBodyScroll.d.ts +12 -0
  76. package/lib/hooks/useLockBodyScroll.d.ts.map +1 -0
  77. package/lib/hooks/useLockBodyScroll.js +20 -0
  78. package/lib/hooks/useLockBodyScroll.js.map +1 -0
  79. package/lib/hooks/useMutationObserver.d.ts +4 -0
  80. package/lib/hooks/useMutationObserver.d.ts.map +1 -0
  81. package/lib/hooks/useMutationObserver.js +29 -0
  82. package/lib/hooks/useMutationObserver.js.map +1 -0
  83. package/lib/hooks/usePrismTheme.d.ts +13 -0
  84. package/lib/hooks/usePrismTheme.d.ts.map +1 -0
  85. package/lib/hooks/usePrismTheme.js +21 -0
  86. package/lib/hooks/usePrismTheme.js.map +1 -0
  87. package/lib/hooks/useSearchPage.d.ts +25 -0
  88. package/lib/hooks/useSearchPage.d.ts.map +1 -0
  89. package/lib/hooks/useSearchPage.js +43 -0
  90. package/lib/hooks/useSearchPage.js.map +1 -0
  91. package/lib/hooks/useSkipToContent.d.ts +25 -0
  92. package/lib/hooks/useSkipToContent.d.ts.map +1 -0
  93. package/lib/hooks/useSkipToContent.js +35 -0
  94. package/lib/hooks/useSkipToContent.js.map +1 -0
  95. package/lib/hooks/useTOCHighlight.d.ts +25 -0
  96. package/lib/hooks/useTOCHighlight.d.ts.map +1 -0
  97. package/lib/hooks/useTOCHighlight.js +130 -0
  98. package/lib/hooks/useTOCHighlight.js.map +1 -0
  99. package/lib/hooks/useWindowSize.d.ts +28 -0
  100. package/lib/hooks/useWindowSize.d.ts.map +1 -0
  101. package/lib/hooks/useWindowSize.js +59 -0
  102. package/lib/hooks/useWindowSize.js.map +1 -0
  103. package/lib/index.d.ts +16 -11
  104. package/lib/index.d.ts.map +1 -0
  105. package/lib/index.js +23 -10
  106. package/lib/index.js.map +1 -0
  107. package/lib/internal.d.ts +41 -0
  108. package/lib/internal.d.ts.map +1 -0
  109. package/lib/internal.js +52 -0
  110. package/lib/internal.js.map +1 -0
  111. package/lib/utils/ThemeClassNames.d.ts +49 -12
  112. package/lib/utils/ThemeClassNames.d.ts.map +1 -0
  113. package/lib/utils/ThemeClassNames.js +47 -4
  114. package/lib/utils/ThemeClassNames.js.map +1 -0
  115. package/lib/utils/codeBlockUtils.d.ts +63 -0
  116. package/lib/utils/codeBlockUtils.d.ts.map +1 -0
  117. package/lib/utils/codeBlockUtils.js +159 -3
  118. package/lib/utils/codeBlockUtils.js.map +1 -0
  119. package/lib/utils/docsUtils.d.ts +91 -0
  120. package/lib/utils/docsUtils.d.ts.map +1 -0
  121. package/lib/utils/docsUtils.js +217 -1
  122. package/lib/utils/docsUtils.js.map +1 -0
  123. package/lib/utils/footerUtils.d.ts +13 -0
  124. package/lib/utils/footerUtils.d.ts.map +1 -0
  125. package/lib/utils/footerUtils.js +14 -0
  126. package/lib/utils/footerUtils.js.map +1 -0
  127. package/lib/utils/generalUtils.d.ts +11 -1
  128. package/lib/utils/generalUtils.d.ts.map +1 -0
  129. package/lib/utils/generalUtils.js +9 -5
  130. package/lib/utils/generalUtils.js.map +1 -0
  131. package/lib/utils/historyUtils.d.ts +17 -0
  132. package/lib/utils/historyUtils.d.ts.map +1 -0
  133. package/lib/utils/historyUtils.js +38 -0
  134. package/lib/utils/historyUtils.js.map +1 -0
  135. package/lib/utils/jsUtils.d.ts +23 -0
  136. package/lib/utils/jsUtils.d.ts.map +1 -0
  137. package/lib/utils/jsUtils.js +29 -0
  138. package/lib/utils/jsUtils.js.map +1 -0
  139. package/lib/utils/metadataUtils.d.ts +38 -0
  140. package/lib/utils/metadataUtils.d.ts.map +1 -0
  141. package/lib/utils/metadataUtils.js +70 -0
  142. package/lib/utils/metadataUtils.js.map +1 -0
  143. package/lib/utils/navbarUtils.d.ts +21 -0
  144. package/lib/utils/navbarUtils.d.ts.map +1 -0
  145. package/lib/utils/navbarUtils.js +36 -0
  146. package/lib/utils/navbarUtils.js.map +1 -0
  147. package/lib/utils/reactUtils.d.ts +69 -0
  148. package/lib/utils/reactUtils.d.ts.map +1 -0
  149. package/lib/utils/reactUtils.js +98 -0
  150. package/lib/utils/reactUtils.js.map +1 -0
  151. package/lib/utils/regexpUtils.d.ts +12 -0
  152. package/lib/utils/regexpUtils.d.ts.map +1 -0
  153. package/lib/utils/regexpUtils.js +18 -0
  154. package/lib/utils/regexpUtils.js.map +1 -0
  155. package/lib/utils/routesUtils.d.ts +26 -0
  156. package/lib/utils/routesUtils.d.ts.map +1 -0
  157. package/lib/utils/routesUtils.js +54 -0
  158. package/lib/utils/routesUtils.js.map +1 -0
  159. package/lib/utils/scrollUtils.d.ts +83 -0
  160. package/lib/utils/scrollUtils.d.ts.map +1 -0
  161. package/lib/utils/scrollUtils.js +200 -0
  162. package/lib/utils/scrollUtils.js.map +1 -0
  163. package/lib/utils/searchUtils.d.ts +13 -0
  164. package/lib/utils/searchUtils.d.ts.map +1 -0
  165. package/lib/utils/searchUtils.js +37 -0
  166. package/lib/utils/searchUtils.js.map +1 -0
  167. package/lib/utils/storageUtils.d.ts +15 -7
  168. package/lib/utils/storageUtils.d.ts.map +1 -0
  169. package/lib/utils/storageUtils.js +58 -25
  170. package/lib/utils/storageUtils.js.map +1 -0
  171. package/lib/utils/tagsUtils.d.ts +18 -0
  172. package/lib/utils/tagsUtils.d.ts.map +1 -0
  173. package/lib/utils/tagsUtils.js +36 -0
  174. package/lib/utils/tagsUtils.js.map +1 -0
  175. package/lib/utils/tocUtils.d.ts +36 -0
  176. package/lib/utils/tocUtils.d.ts.map +1 -0
  177. package/lib/utils/tocUtils.js +84 -0
  178. package/lib/utils/tocUtils.js.map +1 -0
  179. package/lib/utils/useAlternatePageUtils.d.ts +21 -1
  180. package/lib/utils/useAlternatePageUtils.d.ts.map +1 -0
  181. package/lib/utils/useAlternatePageUtils.js +9 -4
  182. package/lib/utils/useAlternatePageUtils.js.map +1 -0
  183. package/lib/utils/useLocalPathname.d.ts +13 -0
  184. package/lib/utils/useLocalPathname.d.ts.map +1 -0
  185. package/lib/utils/useLocalPathname.js +19 -0
  186. package/lib/utils/useLocalPathname.js.map +1 -0
  187. package/lib/utils/useLocationChange.d.ts +17 -0
  188. package/lib/utils/useLocationChange.d.ts.map +1 -0
  189. package/lib/utils/useLocationChange.js +31 -0
  190. package/lib/utils/useLocationChange.js.map +1 -0
  191. package/lib/utils/usePluralForm.d.ts +12 -0
  192. package/lib/utils/usePluralForm.d.ts.map +1 -0
  193. package/lib/utils/usePluralForm.js +36 -37
  194. package/lib/utils/usePluralForm.js.map +1 -0
  195. package/lib/utils/useThemeConfig.d.ts +56 -27
  196. package/lib/utils/useThemeConfig.d.ts.map +1 -0
  197. package/lib/utils/useThemeConfig.js +4 -0
  198. package/lib/utils/useThemeConfig.js.map +1 -0
  199. package/package.json +35 -13
  200. package/src/components/Collapsible/index.tsx +263 -0
  201. package/src/components/Details/index.tsx +109 -0
  202. package/src/components/Details/styles.module.css +62 -0
  203. package/src/contexts/announcementBar.tsx +119 -0
  204. package/src/contexts/blogPost.tsx +80 -0
  205. package/src/contexts/colorMode.tsx +198 -0
  206. package/src/contexts/doc.tsx +71 -0
  207. package/src/contexts/docSidebarItemsExpandedState.tsx +55 -0
  208. package/src/contexts/docsPreferredVersion.tsx +251 -0
  209. package/src/contexts/docsSidebar.tsx +50 -0
  210. package/src/contexts/docsVersion.tsx +36 -0
  211. package/src/contexts/navbarMobileSidebar.tsx +99 -0
  212. package/src/contexts/navbarSecondaryMenu/content.tsx +100 -0
  213. package/src/contexts/navbarSecondaryMenu/display.tsx +102 -0
  214. package/src/contexts/tabGroupChoice.tsx +85 -0
  215. package/{lib/utils/pathUtils.d.ts → src/hooks/styles.css} +4 -1
  216. package/src/hooks/useBackToTopButton.ts +73 -0
  217. package/src/hooks/useCodeWordWrap.ts +105 -0
  218. package/src/hooks/useHideableNavbar.ts +75 -0
  219. package/src/hooks/useKeyboardNavigation.ts +45 -0
  220. package/src/hooks/useLockBodyScroll.ts +21 -0
  221. package/src/hooks/useMutationObserver.ts +38 -0
  222. package/src/hooks/usePrismTheme.ts +24 -0
  223. package/src/hooks/useSearchPage.ts +79 -0
  224. package/src/hooks/useSkipToContent.ts +58 -0
  225. package/src/hooks/useTOCHighlight.ts +189 -0
  226. package/src/hooks/useWindowSize.ts +72 -0
  227. package/src/index.ts +55 -23
  228. package/src/internal.ts +122 -0
  229. package/src/types.d.ts +0 -2
  230. package/src/utils/ThemeClassNames.ts +54 -5
  231. package/src/utils/codeBlockUtils.ts +241 -2
  232. package/src/utils/docsUtils.tsx +334 -0
  233. package/src/utils/footerUtils.ts +18 -0
  234. package/src/utils/generalUtils.ts +9 -5
  235. package/src/utils/historyUtils.ts +45 -0
  236. package/src/utils/jsUtils.ts +36 -0
  237. package/src/utils/metadataUtils.tsx +115 -0
  238. package/src/utils/navbarUtils.tsx +45 -0
  239. package/src/utils/reactUtils.tsx +129 -0
  240. package/src/utils/regexpUtils.ts +24 -0
  241. package/src/utils/routesUtils.ts +75 -0
  242. package/src/utils/scrollUtils.tsx +304 -0
  243. package/src/utils/searchUtils.ts +51 -0
  244. package/src/utils/storageUtils.ts +59 -26
  245. package/src/utils/tagsUtils.ts +50 -0
  246. package/src/utils/tocUtils.ts +119 -0
  247. package/src/utils/useAlternatePageUtils.ts +28 -7
  248. package/src/utils/useLocalPathname.ts +22 -0
  249. package/src/utils/useLocationChange.ts +41 -0
  250. package/src/utils/usePluralForm.ts +53 -39
  251. package/src/utils/useThemeConfig.ts +55 -29
  252. package/lib/.tsbuildinfo +0 -4115
  253. package/lib/utils/docsPreferredVersion/DocsPreferredVersionProvider.d.ts +0 -21
  254. package/lib/utils/docsPreferredVersion/DocsPreferredVersionProvider.js +0 -94
  255. package/lib/utils/docsPreferredVersion/DocsPreferredVersionStorage.d.ts +0 -13
  256. package/lib/utils/docsPreferredVersion/DocsPreferredVersionStorage.js +0 -20
  257. package/lib/utils/docsPreferredVersion/useDocsPreferredVersion.d.ts +0 -5
  258. package/lib/utils/docsPreferredVersion/useDocsPreferredVersion.js +0 -41
  259. package/lib/utils/pathUtils.js +0 -13
  260. package/lib/utils/useChangeRoute.js +0 -18
  261. package/src/utils/__tests__/codeBlockUtils.test.ts +0 -54
  262. package/src/utils/__tests__/pathUtils.test.ts +0 -32
  263. package/src/utils/docsPreferredVersion/DocsPreferredVersionProvider.tsx +0 -165
  264. package/src/utils/docsPreferredVersion/DocsPreferredVersionStorage.ts +0 -34
  265. package/src/utils/docsPreferredVersion/useDocsPreferredVersion.ts +0 -66
  266. package/src/utils/docsUtils.ts +0 -11
  267. package/src/utils/pathUtils.ts +0 -17
  268. package/src/utils/useChangeRoute.ts +0 -21
  269. package/tsconfig.json +0 -10
package/lib/index.js CHANGED
@@ -4,16 +4,29 @@
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
- export { useThemeConfig } from './utils/useThemeConfig';
7
+ /*
8
+ * APIs to document
9
+ */
10
+ export { useThemeConfig, } from './utils/useThemeConfig';
8
11
  export { createStorageSlot, listStorageKeys } from './utils/storageUtils';
9
- export { useAlternatePageUtils } from './utils/useAlternatePageUtils';
10
- export { parseCodeBlockTitle } from './utils/codeBlockUtils';
11
- export { docVersionSearchTag, DEFAULT_SEARCH_TAG } from './utils/searchUtils';
12
- export { isDocsPluginEnabled } from './utils/docsUtils';
13
- export { isSamePath } from './utils/pathUtils';
14
- export { useTitleFormatter } from './utils/generalUtils';
12
+ export { useContextualSearchFilters } from './utils/searchUtils';
13
+ export { useCurrentSidebarCategory } from './utils/docsUtils';
15
14
  export { usePluralForm } from './utils/usePluralForm';
16
- export { useChangeRoute } from './utils/useChangeRoute';
17
- export { useDocsPreferredVersion, useDocsPreferredVersionByPluginId, } from './utils/docsPreferredVersion/useDocsPreferredVersion';
18
- export { DocsPreferredVersionContextProvider } from './utils/docsPreferredVersion/DocsPreferredVersionProvider';
15
+ export { useCollapsible, Collapsible } from './components/Collapsible';
19
16
  export { ThemeClassNames } from './utils/ThemeClassNames';
17
+ export { useIsomorphicLayoutEffect, useEvent, usePrevious, composeProviders, ReactContextError, } from './utils/reactUtils';
18
+ export { PageMetadata, HtmlClassNameProvider } from './utils/metadataUtils';
19
+ export { useColorMode } from './contexts/colorMode';
20
+ export { NavbarSecondaryMenuFiller, } from './contexts/navbarSecondaryMenu/content';
21
+ export { useWindowSize } from './hooks/useWindowSize';
22
+ /*
23
+ * APIs kept undocumented, on purpose
24
+ * Note: we still guarantee retro-compatibility on those
25
+ */
26
+ export { translateTagsPageTitle, listTagsByLetters, } from './utils/tagsUtils';
27
+ export { isMultiColumnFooterLinks } from './utils/footerUtils';
28
+ export { isRegexpStringMatch } from './utils/regexpUtils';
29
+ export { duplicates, uniq } from './utils/jsUtils';
30
+ export { usePrismTheme } from './hooks/usePrismTheme';
31
+ export { useDocsPreferredVersion } from './contexts/docsPreferredVersion';
32
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AAEH,OAAO,EACL,cAAc,GAYf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAC,iBAAiB,EAAE,eAAe,EAAC,MAAM,sBAAsB,CAAC;AAExE,OAAO,EAAC,0BAA0B,EAAC,MAAM,qBAAqB,CAAC;AAE/D,OAAO,EAAC,yBAAyB,EAAC,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EAAC,cAAc,EAAE,WAAW,EAAC,MAAM,0BAA0B,CAAC;AAErE,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAC;AAExD,OAAO,EACL,yBAAyB,EACzB,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAC,YAAY,EAAE,qBAAqB,EAAC,MAAM,uBAAuB,CAAC;AAE1E,OAAO,EAAC,YAAY,EAAiB,MAAM,sBAAsB,CAAC;AAElE,OAAO,EACL,yBAAyB,GAE1B,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAC;AAEpD;;;GAGG;AAEH,OAAO,EACL,sBAAsB,EACtB,iBAAiB,GAElB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAC,wBAAwB,EAAC,MAAM,qBAAqB,CAAC;AAE7D,OAAO,EAAC,mBAAmB,EAAC,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAC,UAAU,EAAE,IAAI,EAAC,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EAAC,uBAAuB,EAAC,MAAM,iCAAiC,CAAC"}
@@ -0,0 +1,41 @@
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
+ export * from './index';
8
+ export { DocSidebarItemsExpandedStateProvider, useDocSidebarItemsExpandedState, } from './contexts/docSidebarItemsExpandedState';
9
+ export { DocsVersionProvider, useDocsVersion } from './contexts/docsVersion';
10
+ export { DocsSidebarProvider, useDocsSidebar } from './contexts/docsSidebar';
11
+ export { DocProvider, useDoc, type DocContextValue } from './contexts/doc';
12
+ export { BlogPostProvider, useBlogPost, type BlogPostContextValue, } from './contexts/blogPost';
13
+ export { useDocsPreferredVersionByPluginId, DocsPreferredVersionContextProvider, } from './contexts/docsPreferredVersion';
14
+ export { AnnouncementBarProvider, useAnnouncementBar, } from './contexts/announcementBar';
15
+ export { useTabGroupChoice, TabGroupChoiceProvider, } from './contexts/tabGroupChoice';
16
+ export { useNavbarMobileSidebar } from './contexts/navbarMobileSidebar';
17
+ export { useNavbarSecondaryMenu } from './contexts/navbarSecondaryMenu/display';
18
+ export { ColorModeProvider } from './contexts/colorMode';
19
+ export { useAlternatePageUtils } from './utils/useAlternatePageUtils';
20
+ export { parseCodeBlockTitle, parseLanguage, parseLines, containsLineNumbers, } from './utils/codeBlockUtils';
21
+ export { docVersionSearchTag, DEFAULT_SEARCH_TAG } from './utils/searchUtils';
22
+ export { isDocsPluginEnabled, useDocById, findSidebarCategory, findFirstCategoryLink, isActiveSidebarItem, useSidebarBreadcrumbs, useDocsVersionCandidates, useLayoutDoc, useLayoutDocsSidebar, useDocRouteMetadata, } from './utils/docsUtils';
23
+ export { useTitleFormatter } from './utils/generalUtils';
24
+ export { useLocationChange } from './utils/useLocationChange';
25
+ export { useLocalPathname } from './utils/useLocalPathname';
26
+ export { useHistoryPopHandler } from './utils/historyUtils';
27
+ export { useFilteredAndTreeifiedTOC, useTreeifiedTOC, type TOCTreeNode, } from './utils/tocUtils';
28
+ export { ScrollControllerProvider, useScrollController, useScrollPosition, useScrollPositionBlocker, useSmoothScrollTo, } from './utils/scrollUtils';
29
+ export { useHomePageRoute, isSamePath } from './utils/routesUtils';
30
+ export { PluginHtmlClassNameProvider } from './utils/metadataUtils';
31
+ export { splitNavbarItems, NavbarProvider } from './utils/navbarUtils';
32
+ export { useTOCHighlight, type TOCHighlightConfig, } from './hooks/useTOCHighlight';
33
+ export { useHideableNavbar } from './hooks/useHideableNavbar';
34
+ export { useKeyboardNavigation, keyboardFocusedClassName, } from './hooks/useKeyboardNavigation';
35
+ export { useLockBodyScroll } from './hooks/useLockBodyScroll';
36
+ export { useSearchPage } from './hooks/useSearchPage';
37
+ export { useCodeWordWrap } from './hooks/useCodeWordWrap';
38
+ export { useSkipToContent } from './hooks/useSkipToContent';
39
+ export { getPrismCssVariables } from './utils/codeBlockUtils';
40
+ export { useBackToTopButton } from './hooks/useBackToTopButton';
41
+ //# sourceMappingURL=internal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAaH,cAAc,SAAS,CAAC;AAExB,OAAO,EACL,oCAAoC,EACpC,+BAA+B,GAChC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAC,mBAAmB,EAAE,cAAc,EAAC,MAAM,wBAAwB,CAAC;AAC3E,OAAO,EAAC,mBAAmB,EAAE,cAAc,EAAC,MAAM,wBAAwB,CAAC;AAE3E,OAAO,EAAC,WAAW,EAAE,MAAM,EAAE,KAAK,eAAe,EAAC,MAAM,gBAAgB,CAAC;AACzE,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,KAAK,oBAAoB,GAC1B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,iCAAiC,EACjC,mCAAmC,GACpC,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACL,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAC,sBAAsB,EAAC,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAC,sBAAsB,EAAC,MAAM,wCAAwC,CAAC;AAE9E,OAAO,EAAC,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAC,qBAAqB,EAAC,MAAM,+BAA+B,CAAC;AAEpE,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,UAAU,EACV,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAC,mBAAmB,EAAE,kBAAkB,EAAC,MAAM,qBAAqB,CAAC;AAE5E,OAAO,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BAAkB,EAAC,MAAM,4BAA4B,CAAC"}
@@ -0,0 +1,52 @@
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
+ // This re-export permits to handle some level of retro-compatibility. Users
8
+ // might swizzle unsafe components and expose these internal imports. When we
9
+ // move an API from internal to public, former internal imports should keep
10
+ // working, so that the change doesn't become breaking.
11
+ //
12
+ // Important: this line is removed from build output with the
13
+ // "removeThemeInternalReexport" script for CI checks. This ensures that none of
14
+ // our internal code relies on this re-export and that we don't forget to
15
+ // migrate theme internal imports to public imports.
16
+ //
17
+ // eslint-disable-next-line no-restricted-syntax
18
+ export * from './index';
19
+ export { DocSidebarItemsExpandedStateProvider, useDocSidebarItemsExpandedState, } from './contexts/docSidebarItemsExpandedState';
20
+ export { DocsVersionProvider, useDocsVersion } from './contexts/docsVersion';
21
+ export { DocsSidebarProvider, useDocsSidebar } from './contexts/docsSidebar';
22
+ export { DocProvider, useDoc } from './contexts/doc';
23
+ export { BlogPostProvider, useBlogPost, } from './contexts/blogPost';
24
+ export { useDocsPreferredVersionByPluginId, DocsPreferredVersionContextProvider, } from './contexts/docsPreferredVersion';
25
+ export { AnnouncementBarProvider, useAnnouncementBar, } from './contexts/announcementBar';
26
+ export { useTabGroupChoice, TabGroupChoiceProvider, } from './contexts/tabGroupChoice';
27
+ export { useNavbarMobileSidebar } from './contexts/navbarMobileSidebar';
28
+ export { useNavbarSecondaryMenu } from './contexts/navbarSecondaryMenu/display';
29
+ export { ColorModeProvider } from './contexts/colorMode';
30
+ export { useAlternatePageUtils } from './utils/useAlternatePageUtils';
31
+ export { parseCodeBlockTitle, parseLanguage, parseLines, containsLineNumbers, } from './utils/codeBlockUtils';
32
+ export { docVersionSearchTag, DEFAULT_SEARCH_TAG } from './utils/searchUtils';
33
+ export { isDocsPluginEnabled, useDocById, findSidebarCategory, findFirstCategoryLink, isActiveSidebarItem, useSidebarBreadcrumbs, useDocsVersionCandidates, useLayoutDoc, useLayoutDocsSidebar, useDocRouteMetadata, } from './utils/docsUtils';
34
+ export { useTitleFormatter } from './utils/generalUtils';
35
+ export { useLocationChange } from './utils/useLocationChange';
36
+ export { useLocalPathname } from './utils/useLocalPathname';
37
+ export { useHistoryPopHandler } from './utils/historyUtils';
38
+ export { useFilteredAndTreeifiedTOC, useTreeifiedTOC, } from './utils/tocUtils';
39
+ export { ScrollControllerProvider, useScrollController, useScrollPosition, useScrollPositionBlocker, useSmoothScrollTo, } from './utils/scrollUtils';
40
+ export { useHomePageRoute, isSamePath } from './utils/routesUtils';
41
+ export { PluginHtmlClassNameProvider } from './utils/metadataUtils';
42
+ export { splitNavbarItems, NavbarProvider } from './utils/navbarUtils';
43
+ export { useTOCHighlight, } from './hooks/useTOCHighlight';
44
+ export { useHideableNavbar } from './hooks/useHideableNavbar';
45
+ export { useKeyboardNavigation, keyboardFocusedClassName, } from './hooks/useKeyboardNavigation';
46
+ export { useLockBodyScroll } from './hooks/useLockBodyScroll';
47
+ export { useSearchPage } from './hooks/useSearchPage';
48
+ export { useCodeWordWrap } from './hooks/useCodeWordWrap';
49
+ export { useSkipToContent } from './hooks/useSkipToContent';
50
+ export { getPrismCssVariables } from './utils/codeBlockUtils';
51
+ export { useBackToTopButton } from './hooks/useBackToTopButton';
52
+ //# sourceMappingURL=internal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,4EAA4E;AAC5E,6EAA6E;AAC7E,2EAA2E;AAC3E,uDAAuD;AACvD,EAAE;AACF,6DAA6D;AAC7D,gFAAgF;AAChF,yEAAyE;AACzE,oDAAoD;AACpD,EAAE;AACF,gDAAgD;AAChD,cAAc,SAAS,CAAC;AAExB,OAAO,EACL,oCAAoC,EACpC,+BAA+B,GAChC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAC,mBAAmB,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C1B,eAAe,GAEhB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,iBAAiB,EACjB,wBAAwB,EACxB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAC,gBAAgB,EAAE,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAEjE,OAAO,EAAC,2BAA2B,EAAC,MAAM,uBAAuB,CAAC;AAElE,OAAO,EAAC,gBAAgB,EAAE,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAErE,OAAO,EACL,eAAe,GAEhB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAC,iBAAiB,EAAC,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EACL,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAC,iBAAiB,EAAC,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAC,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAC,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAC,kBAAkB,EAAC,MAAM,4BAA4B,CAAC"}
@@ -4,19 +4,56 @@
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
+ /**
8
+ * These class names are used to style page layouts in Docusaurus, meant to be
9
+ * targeted by user-provided custom CSS selectors.
10
+ */
7
11
  export declare const ThemeClassNames: {
8
- page: {
9
- blogListPage: string;
10
- blogPostPage: string;
11
- blogTagsListPage: string;
12
- blogTagsPostPage: string;
13
- docPage: string;
14
- mdxPage: string;
12
+ readonly page: {
13
+ readonly blogListPage: "blog-list-page";
14
+ readonly blogPostPage: "blog-post-page";
15
+ readonly blogTagsListPage: "blog-tags-list-page";
16
+ readonly blogTagPostListPage: "blog-tags-post-list-page";
17
+ readonly docsDocPage: "docs-doc-page";
18
+ readonly docsTagsListPage: "docs-tags-list-page";
19
+ readonly docsTagDocListPage: "docs-tags-doc-list-page";
20
+ readonly mdxPage: "mdx-page";
21
+ };
22
+ readonly wrapper: {
23
+ readonly main: "main-wrapper";
24
+ readonly blogPages: "blog-wrapper";
25
+ readonly docsPages: "docs-wrapper";
26
+ readonly mdxPages: "mdx-wrapper";
27
+ };
28
+ readonly common: {
29
+ readonly editThisPage: "theme-edit-this-page";
30
+ readonly lastUpdated: "theme-last-updated";
31
+ readonly backToTopButton: "theme-back-to-top-button";
32
+ readonly codeBlock: "theme-code-block";
33
+ readonly admonition: "theme-admonition";
34
+ readonly admonitionType: (type: 'note' | 'tip' | 'danger' | 'info' | 'caution') => string;
15
35
  };
16
- wrapper: {
17
- main: string;
18
- blogPages: string;
19
- docPages: string;
20
- mdxPages: string;
36
+ readonly layout: {};
37
+ /**
38
+ * Follows the naming convention "theme-{blog,doc,version,page}?-<suffix>"
39
+ */
40
+ readonly docs: {
41
+ readonly docVersionBanner: "theme-doc-version-banner";
42
+ readonly docVersionBadge: "theme-doc-version-badge";
43
+ readonly docBreadcrumbs: "theme-doc-breadcrumbs";
44
+ readonly docMarkdown: "theme-doc-markdown";
45
+ readonly docTocMobile: "theme-doc-toc-mobile";
46
+ readonly docTocDesktop: "theme-doc-toc-desktop";
47
+ readonly docFooter: "theme-doc-footer";
48
+ readonly docFooterTagsRow: "theme-doc-footer-tags-row";
49
+ readonly docFooterEditMetaRow: "theme-doc-footer-edit-meta-row";
50
+ readonly docSidebarContainer: "theme-doc-sidebar-container";
51
+ readonly docSidebarMenu: "theme-doc-sidebar-menu";
52
+ readonly docSidebarItemCategory: "theme-doc-sidebar-item-category";
53
+ readonly docSidebarItemLink: "theme-doc-sidebar-item-link";
54
+ readonly docSidebarItemCategoryLevel: (level: number) => `theme-doc-sidebar-item-category-level-${number}`;
55
+ readonly docSidebarItemLinkLevel: (level: number) => `theme-doc-sidebar-item-link-level-${number}`;
21
56
  };
57
+ readonly blog: {};
22
58
  };
59
+ //# sourceMappingURL=ThemeClassNames.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThemeClassNames.d.ts","sourceRoot":"","sources":["../../src/utils/ThemeClassNames.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;wCAyBD,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS;;;IAOvE;;OAEG;;;;;;;;;;;;;;;sDAeoC,MAAM;kDAEV,MAAM;;;CAOjC,CAAC"}
@@ -4,20 +4,63 @@
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
- // These class names are used to style page layouts in Docusaurus
7
+ // Please do not modify the classnames! This is a breaking change, and annoying
8
+ // for users!
9
+ /**
10
+ * These class names are used to style page layouts in Docusaurus, meant to be
11
+ * targeted by user-provided custom CSS selectors.
12
+ */
8
13
  export const ThemeClassNames = {
9
14
  page: {
10
15
  blogListPage: 'blog-list-page',
11
16
  blogPostPage: 'blog-post-page',
12
17
  blogTagsListPage: 'blog-tags-list-page',
13
- blogTagsPostPage: 'blog-tags-post-page',
14
- docPage: 'doc-page',
18
+ blogTagPostListPage: 'blog-tags-post-list-page',
19
+ docsDocPage: 'docs-doc-page',
20
+ docsTagsListPage: 'docs-tags-list-page',
21
+ docsTagDocListPage: 'docs-tags-doc-list-page',
15
22
  mdxPage: 'mdx-page',
16
23
  },
17
24
  wrapper: {
18
25
  main: 'main-wrapper',
19
26
  blogPages: 'blog-wrapper',
20
- docPages: 'docs-wrapper',
27
+ docsPages: 'docs-wrapper',
21
28
  mdxPages: 'mdx-wrapper',
22
29
  },
30
+ common: {
31
+ editThisPage: 'theme-edit-this-page',
32
+ lastUpdated: 'theme-last-updated',
33
+ backToTopButton: 'theme-back-to-top-button',
34
+ codeBlock: 'theme-code-block',
35
+ admonition: 'theme-admonition',
36
+ admonitionType: (type) => `theme-admonition-${type}`,
37
+ },
38
+ layout: {
39
+ // TODO add other stable classNames here
40
+ },
41
+ /**
42
+ * Follows the naming convention "theme-{blog,doc,version,page}?-<suffix>"
43
+ */
44
+ docs: {
45
+ docVersionBanner: 'theme-doc-version-banner',
46
+ docVersionBadge: 'theme-doc-version-badge',
47
+ docBreadcrumbs: 'theme-doc-breadcrumbs',
48
+ docMarkdown: 'theme-doc-markdown',
49
+ docTocMobile: 'theme-doc-toc-mobile',
50
+ docTocDesktop: 'theme-doc-toc-desktop',
51
+ docFooter: 'theme-doc-footer',
52
+ docFooterTagsRow: 'theme-doc-footer-tags-row',
53
+ docFooterEditMetaRow: 'theme-doc-footer-edit-meta-row',
54
+ docSidebarContainer: 'theme-doc-sidebar-container',
55
+ docSidebarMenu: 'theme-doc-sidebar-menu',
56
+ docSidebarItemCategory: 'theme-doc-sidebar-item-category',
57
+ docSidebarItemLink: 'theme-doc-sidebar-item-link',
58
+ docSidebarItemCategoryLevel: (level) => `theme-doc-sidebar-item-category-level-${level}`,
59
+ docSidebarItemLinkLevel: (level) => `theme-doc-sidebar-item-link-level-${level}`,
60
+ // TODO add other stable classNames here
61
+ },
62
+ blog: {
63
+ // TODO add other stable classNames here
64
+ },
23
65
  };
66
+ //# sourceMappingURL=ThemeClassNames.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThemeClassNames.js","sourceRoot":"","sources":["../../src/utils/ThemeClassNames.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,+EAA+E;AAC/E,aAAa;AAEb;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE;QACJ,YAAY,EAAE,gBAAgB;QAC9B,YAAY,EAAE,gBAAgB;QAC9B,gBAAgB,EAAE,qBAAqB;QACvC,mBAAmB,EAAE,0BAA0B;QAE/C,WAAW,EAAE,eAAe;QAC5B,gBAAgB,EAAE,qBAAqB;QACvC,kBAAkB,EAAE,yBAAyB;QAE7C,OAAO,EAAE,UAAU;KACpB;IACD,OAAO,EAAE;QACP,IAAI,EAAE,cAAc;QACpB,SAAS,EAAE,cAAc;QACzB,SAAS,EAAE,cAAc;QACzB,QAAQ,EAAE,aAAa;KACxB;IACD,MAAM,EAAE;QACN,YAAY,EAAE,sBAAsB;QACpC,WAAW,EAAE,oBAAoB;QACjC,eAAe,EAAE,0BAA0B;QAC3C,SAAS,EAAE,kBAAkB;QAC7B,UAAU,EAAE,kBAAkB;QAC9B,cAAc,EAAE,CAAC,IAAoD,EAAE,EAAE,CACvE,oBAAoB,IAAI,EAAE;KAC7B;IACD,MAAM,EAAE;IACN,wCAAwC;KACzC;IAED;;OAEG;IACH,IAAI,EAAE;QACJ,gBAAgB,EAAE,0BAA0B;QAC5C,eAAe,EAAE,yBAAyB;QAC1C,cAAc,EAAE,uBAAuB;QACvC,WAAW,EAAE,oBAAoB;QACjC,YAAY,EAAE,sBAAsB;QACpC,aAAa,EAAE,uBAAuB;QACtC,SAAS,EAAE,kBAAkB;QAC7B,gBAAgB,EAAE,2BAA2B;QAC7C,oBAAoB,EAAE,gCAAgC;QACtD,mBAAmB,EAAE,6BAA6B;QAClD,cAAc,EAAE,wBAAwB;QACxC,sBAAsB,EAAE,iCAAiC;QACzD,kBAAkB,EAAE,6BAA6B;QACjD,2BAA2B,EAAE,CAAC,KAAa,EAAE,EAAE,CAC7C,yCAAyC,KAAK,EAAW;QAC3D,uBAAuB,EAAE,CAAC,KAAa,EAAE,EAAE,CACzC,qCAAqC,KAAK,EAAW;QACvD,wCAAwC;KACzC;IACD,IAAI,EAAE;IACJ,wCAAwC;KACzC;CACO,CAAC"}
@@ -4,4 +4,67 @@
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 type { CSSProperties } from 'react';
8
+ import type { PrismTheme } from 'prism-react-renderer';
9
+ export declare type MagicCommentConfig = {
10
+ className: string;
11
+ line?: string;
12
+ block?: {
13
+ start: string;
14
+ end: string;
15
+ };
16
+ };
7
17
  export declare function parseCodeBlockTitle(metastring?: string): string;
18
+ export declare function containsLineNumbers(metastring?: string): boolean;
19
+ /**
20
+ * Gets the language name from the class name (set by MDX).
21
+ * e.g. `"language-javascript"` => `"javascript"`.
22
+ * Returns undefined if there is no language class name.
23
+ */
24
+ export declare function parseLanguage(className: string): string | undefined;
25
+ /**
26
+ * Parses the code content, strips away any magic comments, and returns the
27
+ * clean content and the highlighted lines marked by the comments or metastring.
28
+ *
29
+ * If the metastring contains a range, the `content` will be returned as-is
30
+ * without any parsing. The returned `lineClassNames` will be a map from that
31
+ * number range to the first magic comment config entry (which _should_ be for
32
+ * line highlight directives.)
33
+ *
34
+ * @param content The raw code with magic comments. Trailing newline will be
35
+ * trimmed upfront.
36
+ * @param options Options for parsing behavior.
37
+ */
38
+ export declare function parseLines(content: string, options: {
39
+ /**
40
+ * The full metastring, as received from MDX. Line ranges declared here
41
+ * start at 1.
42
+ */
43
+ metastring: string | undefined;
44
+ /**
45
+ * Language of the code block, used to determine which kinds of magic
46
+ * comment styles to enable.
47
+ */
48
+ language: string | undefined;
49
+ /**
50
+ * Magic comment types that we should try to parse. Each entry would
51
+ * correspond to one class name to apply to each line.
52
+ */
53
+ magicComments: MagicCommentConfig[];
54
+ }): {
55
+ /**
56
+ * The highlighted lines, 0-indexed. e.g. `{ 0: ["highlight", "sample"] }`
57
+ * means the 1st line should have `highlight` and `sample` as class names.
58
+ */
59
+ lineClassNames: {
60
+ [lineIndex: number]: string[];
61
+ };
62
+ /**
63
+ * If there's number range declared in the metastring, the code block is
64
+ * returned as-is (no parsing); otherwise, this is the clean code with all
65
+ * magic comments stripped away.
66
+ */
67
+ code: string;
68
+ };
69
+ export declare function getPrismCssVariables(prismTheme: PrismTheme): CSSProperties;
70
+ //# sourceMappingURL=codeBlockUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codeBlockUtils.d.ts","sourceRoot":"","sources":["../../src/utils/codeBlockUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AAEzC,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,sBAAsB,CAAC;AAgBrD,oBAAY,kBAAkB,GAAG;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAC,CAAC;CACtC,CAAC;AAiEF,wBAAgB,mBAAmB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED,wBAAgB,mBAAmB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAEhE;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAKnE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;IACP;;;OAGG;IACH,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B;;;OAGG;IACH,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B;;;OAGG;IACH,aAAa,EAAE,kBAAkB,EAAE,CAAC;CACrC,GACA;IACD;;;OAGG;IACH,cAAc,EAAE;QAAC,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;KAAC,CAAC;IAChD;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;CACd,CA4EA;AAED,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,UAAU,GAAG,aAAa,CAc1E"}
@@ -4,8 +4,164 @@
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
- const codeBlockTitleRegex = /title=(["'])(.*?)\1/;
7
+ import rangeParser from 'parse-numeric-range';
8
+ const codeBlockTitleRegex = /title=(?<quote>["'])(?<title>.*?)\1/;
9
+ const metastringLinesRangeRegex = /\{(?<range>[\d,-]+)\}/;
10
+ // Supported types of highlight comments
11
+ const commentPatterns = {
12
+ js: { start: '\\/\\/', end: '' },
13
+ jsBlock: { start: '\\/\\*', end: '\\*\\/' },
14
+ jsx: { start: '\\{\\s*\\/\\*', end: '\\*\\/\\s*\\}' },
15
+ bash: { start: '#', end: '' },
16
+ html: { start: '<!--', end: '-->' },
17
+ };
18
+ function getCommentPattern(languages, magicCommentDirectives) {
19
+ // To be more reliable, the opening and closing comment must match
20
+ const commentPattern = languages
21
+ .map((lang) => {
22
+ const { start, end } = commentPatterns[lang];
23
+ return `(?:${start}\\s*(${magicCommentDirectives
24
+ .flatMap((d) => [d.line, d.block?.start, d.block?.end].filter(Boolean))
25
+ .join('|')})\\s*${end})`;
26
+ })
27
+ .join('|');
28
+ // White space is allowed, but otherwise it should be on it's own line
29
+ return new RegExp(`^\\s*(?:${commentPattern})\\s*$`);
30
+ }
31
+ /**
32
+ * Select comment styles based on language
33
+ */
34
+ function getAllMagicCommentDirectiveStyles(lang, magicCommentDirectives) {
35
+ switch (lang) {
36
+ case 'js':
37
+ case 'javascript':
38
+ case 'ts':
39
+ case 'typescript':
40
+ return getCommentPattern(['js', 'jsBlock'], magicCommentDirectives);
41
+ case 'jsx':
42
+ case 'tsx':
43
+ return getCommentPattern(['js', 'jsBlock', 'jsx'], magicCommentDirectives);
44
+ case 'html':
45
+ return getCommentPattern(['js', 'jsBlock', 'html'], magicCommentDirectives);
46
+ case 'python':
47
+ case 'py':
48
+ case 'bash':
49
+ return getCommentPattern(['bash'], magicCommentDirectives);
50
+ case 'markdown':
51
+ case 'md':
52
+ // Text uses HTML, front matter uses bash
53
+ return getCommentPattern(['html', 'jsx', 'bash'], magicCommentDirectives);
54
+ default:
55
+ // All comment types
56
+ return getCommentPattern(Object.keys(commentPatterns), magicCommentDirectives);
57
+ }
58
+ }
8
59
  export function parseCodeBlockTitle(metastring) {
9
- var _a, _b;
10
- return (_b = (_a = metastring === null || metastring === void 0 ? void 0 : metastring.match(codeBlockTitleRegex)) === null || _a === void 0 ? void 0 : _a[2]) !== null && _b !== void 0 ? _b : '';
60
+ return metastring?.match(codeBlockTitleRegex)?.groups.title ?? '';
61
+ }
62
+ export function containsLineNumbers(metastring) {
63
+ return Boolean(metastring?.includes('showLineNumbers'));
64
+ }
65
+ /**
66
+ * Gets the language name from the class name (set by MDX).
67
+ * e.g. `"language-javascript"` => `"javascript"`.
68
+ * Returns undefined if there is no language class name.
69
+ */
70
+ export function parseLanguage(className) {
71
+ const languageClassName = className
72
+ .split(' ')
73
+ .find((str) => str.startsWith('language-'));
74
+ return languageClassName?.replace(/language-/, '');
75
+ }
76
+ /**
77
+ * Parses the code content, strips away any magic comments, and returns the
78
+ * clean content and the highlighted lines marked by the comments or metastring.
79
+ *
80
+ * If the metastring contains a range, the `content` will be returned as-is
81
+ * without any parsing. The returned `lineClassNames` will be a map from that
82
+ * number range to the first magic comment config entry (which _should_ be for
83
+ * line highlight directives.)
84
+ *
85
+ * @param content The raw code with magic comments. Trailing newline will be
86
+ * trimmed upfront.
87
+ * @param options Options for parsing behavior.
88
+ */
89
+ export function parseLines(content, options) {
90
+ let code = content.replace(/\n$/, '');
91
+ const { language, magicComments, metastring } = options;
92
+ // Highlighted lines specified in props: don't parse the content
93
+ if (metastring && metastringLinesRangeRegex.test(metastring)) {
94
+ const linesRange = metastring.match(metastringLinesRangeRegex).groups
95
+ .range;
96
+ if (magicComments.length === 0) {
97
+ throw new Error(`A highlight range has been given in code block's metastring (\`\`\` ${metastring}), but no magic comment config is available. Docusaurus applies the first magic comment entry's className for metastring ranges.`);
98
+ }
99
+ const metastringRangeClassName = magicComments[0].className;
100
+ const lines = rangeParser(linesRange)
101
+ .filter((n) => n > 0)
102
+ .map((n) => [n - 1, [metastringRangeClassName]]);
103
+ return { lineClassNames: Object.fromEntries(lines), code };
104
+ }
105
+ if (language === undefined) {
106
+ return { lineClassNames: {}, code };
107
+ }
108
+ const directiveRegex = getAllMagicCommentDirectiveStyles(language, magicComments);
109
+ // Go through line by line
110
+ const lines = code.split('\n');
111
+ const blocks = Object.fromEntries(magicComments.map((d) => [d.className, { start: 0, range: '' }]));
112
+ const lineToClassName = Object.fromEntries(magicComments
113
+ .filter((d) => d.line)
114
+ .map(({ className, line }) => [line, className]));
115
+ const blockStartToClassName = Object.fromEntries(magicComments
116
+ .filter((d) => d.block)
117
+ .map(({ className, block }) => [block.start, className]));
118
+ const blockEndToClassName = Object.fromEntries(magicComments
119
+ .filter((d) => d.block)
120
+ .map(({ className, block }) => [block.end, className]));
121
+ for (let lineNumber = 0; lineNumber < lines.length;) {
122
+ const line = lines[lineNumber];
123
+ const match = line.match(directiveRegex);
124
+ if (!match) {
125
+ // Lines without directives are unchanged
126
+ lineNumber += 1;
127
+ continue;
128
+ }
129
+ const directive = match
130
+ .slice(1)
131
+ .find((item) => item !== undefined);
132
+ if (lineToClassName[directive]) {
133
+ blocks[lineToClassName[directive]].range += `${lineNumber},`;
134
+ }
135
+ else if (blockStartToClassName[directive]) {
136
+ blocks[blockStartToClassName[directive]].start = lineNumber;
137
+ }
138
+ else if (blockEndToClassName[directive]) {
139
+ blocks[blockEndToClassName[directive]].range += `${blocks[blockEndToClassName[directive]].start}-${lineNumber - 1},`;
140
+ }
141
+ lines.splice(lineNumber, 1);
142
+ }
143
+ code = lines.join('\n');
144
+ const lineClassNames = {};
145
+ Object.entries(blocks).forEach(([className, { range }]) => {
146
+ rangeParser(range).forEach((l) => {
147
+ lineClassNames[l] ??= [];
148
+ lineClassNames[l].push(className);
149
+ });
150
+ });
151
+ return { lineClassNames, code };
152
+ }
153
+ export function getPrismCssVariables(prismTheme) {
154
+ const mapping = {
155
+ color: '--prism-color',
156
+ backgroundColor: '--prism-background-color',
157
+ };
158
+ const properties = {};
159
+ Object.entries(prismTheme.plain).forEach(([key, value]) => {
160
+ const varName = mapping[key];
161
+ if (varName && typeof value === 'string') {
162
+ properties[varName] = value;
163
+ }
164
+ });
165
+ return properties;
11
166
  }
167
+ //# sourceMappingURL=codeBlockUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codeBlockUtils.js","sourceRoot":"","sources":["../../src/utils/codeBlockUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,WAAW,MAAM,qBAAqB,CAAC;AAG9C,MAAM,mBAAmB,GAAG,qCAAqC,CAAC;AAClE,MAAM,yBAAyB,GAAG,uBAAuB,CAAC;AAE1D,wCAAwC;AACxC,MAAM,eAAe,GAAG;IACtB,EAAE,EAAE,EAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,EAAC;IAC9B,OAAO,EAAE,EAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAC;IACzC,GAAG,EAAE,EAAC,KAAK,EAAE,eAAe,EAAE,GAAG,EAAE,eAAe,EAAC;IACnD,IAAI,EAAE,EAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAC;IAC3B,IAAI,EAAE,EAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAC;CAClC,CAAC;AAUF,SAAS,iBAAiB,CACxB,SAAwB,EACxB,sBAA4C;IAE5C,kEAAkE;IAClE,MAAM,cAAc,GAAG,SAAS;SAC7B,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACZ,MAAM,EAAC,KAAK,EAAE,GAAG,EAAC,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;QAC3C,OAAO,MAAM,KAAK,QAAQ,sBAAsB;aAC7C,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;aACtE,IAAI,CAA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