@brillout/docpress 0.8.13 → 0.8.15

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 (50) hide show
  1. package/Layout.tsx +279 -171
  2. package/MenuModal.tsx +55 -56
  3. package/{Links.tsx → NavSecondaryContent.tsx} +6 -8
  4. package/components/HorizontalLine.tsx +4 -3
  5. package/config/resolveHeadingsData.ts +7 -10
  6. package/css/code/block.css +5 -5
  7. package/css/code/inline.css +1 -1
  8. package/css/colorize-on-hover.css +20 -9
  9. package/dist/Layout.d.ts +10 -6
  10. package/dist/Layout.js +181 -102
  11. package/dist/MenuModal.d.ts +5 -1
  12. package/dist/MenuModal.js +44 -60
  13. package/dist/{Links.d.ts → NavSecondaryContent.d.ts} +3 -2
  14. package/dist/{Links.js → NavSecondaryContent.js} +5 -6
  15. package/dist/components/HorizontalLine.d.ts +1 -1
  16. package/dist/components/HorizontalLine.js +3 -2
  17. package/dist/config/resolveHeadingsData.d.ts +3 -4
  18. package/dist/config/resolveHeadingsData.js +5 -8
  19. package/dist/config/resolvePageContext.d.ts +2 -3
  20. package/dist/docsearch/SearchLink.js +2 -3
  21. package/dist/navigation/Collapsible.d.ts +10 -0
  22. package/dist/navigation/Collapsible.js +35 -0
  23. package/dist/navigation/Navigation.d.ts +0 -3
  24. package/dist/navigation/Navigation.js +106 -55
  25. package/dist/renderer/determineNavItemsColumnLayout.d.ts +3 -0
  26. package/dist/renderer/{determineColumnEntries.js → determineNavItemsColumnLayout.js} +34 -28
  27. package/dist/renderer/usePageContext.d.ts +2 -2
  28. package/dist/renderer/usePageContext.js +2 -4
  29. package/dist/utils/Style.d.ts +5 -0
  30. package/dist/utils/Style.js +6 -0
  31. package/dist/utils/cls.d.ts +3 -0
  32. package/dist/utils/cls.js +5 -0
  33. package/dist/utils/throttle.d.ts +1 -0
  34. package/dist/utils/throttle.js +14 -0
  35. package/docsearch/SearchLink.tsx +4 -13
  36. package/global.d.ts +1 -1
  37. package/initKeyBindings.ts +1 -6
  38. package/navigation/Collapsible.css +11 -0
  39. package/navigation/Collapsible.tsx +64 -0
  40. package/navigation/Navigation.css +12 -6
  41. package/navigation/Navigation.tsx +191 -80
  42. package/package.json +1 -1
  43. package/renderer/{determineColumnEntries.ts → determineNavItemsColumnLayout.ts} +35 -29
  44. package/renderer/initOnNavigation.ts +37 -0
  45. package/renderer/onRenderClient.tsx +2 -0
  46. package/renderer/usePageContext.tsx +2 -5
  47. package/utils/Style.tsx +7 -0
  48. package/utils/cls.ts +8 -0
  49. package/utils/throttle.ts +10 -0
  50. package/dist/renderer/determineColumnEntries.d.ts +0 -3
@@ -0,0 +1,7 @@
1
+ export { Style }
2
+
3
+ import React from 'react'
4
+
5
+ function Style({ children }: { children: string }) {
6
+ return <style dangerouslySetInnerHTML={{ __html: children }} />
7
+ }
package/utils/cls.ts ADDED
@@ -0,0 +1,8 @@
1
+ export { cls }
2
+
3
+ type Class = string | boolean | undefined
4
+
5
+ function cls(className: Class | Class[]): string {
6
+ const classNames = Array.isArray(className) ? className : [className]
7
+ return classNames.filter(Boolean).join(' ')
8
+ }
@@ -0,0 +1,10 @@
1
+ export function throttle<T extends (...args: any[]) => void>(func: T, limit: number): T {
2
+ let inThrottle: boolean
3
+ return function (this: any, ...args: Parameters<T>) {
4
+ if (!inThrottle) {
5
+ func.apply(this, args)
6
+ inThrottle = true
7
+ setTimeout(() => (inThrottle = false), limit)
8
+ }
9
+ } as T
10
+ }
@@ -1,3 +0,0 @@
1
- export { determineColumnEntries };
2
- import { type NavItemAll } from '../navigation/Navigation';
3
- declare function determineColumnEntries(navItems: NavItemAll[]): undefined;