@brillout/docpress 0.1.20 → 0.2.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 (144) hide show
  1. package/bin.js +1 -1
  2. package/{src/css/Inter-Var.ttf → dist/Inter-Var-IOAEQULN.ttf} +0 -0
  3. package/{src/components/Sponsors/companyLogos/ccoli.svg → dist/ccoli-CHW3TQKS.svg} +0 -0
  4. package/{src/icons/changelog.svg → dist/changelog-IPI5F42D.svg} +0 -0
  5. package/{src/navigation/navigation-fullscreen/chevron.svg → dist/chevron-K3WPYLOP.svg} +0 -0
  6. package/{src/components/features/chevron.svg → dist/chevron-R2IYJD62.svg} +0 -0
  7. package/dist/chunk-7HKDCMSZ.js +154 -0
  8. package/dist/chunk-7HKDCMSZ.js.map +1 -0
  9. package/dist/chunk-C3OIVLKV.js +75 -0
  10. package/dist/chunk-C3OIVLKV.js.map +1 -0
  11. package/dist/chunk-G2A5MZJA.js +48 -0
  12. package/dist/chunk-G2A5MZJA.js.map +1 -0
  13. package/dist/chunk-H5CO4N2X.js +174 -0
  14. package/dist/chunk-H5CO4N2X.js.map +1 -0
  15. package/dist/chunk-TTLAZ2T2.js +8 -0
  16. package/dist/chunk-TTLAZ2T2.js.map +1 -0
  17. package/dist/{chunk-ZYYJWJMY.js → chunk-XUTBTIEE.js} +15 -42
  18. package/dist/chunk-XUTBTIEE.js.map +1 -0
  19. package/dist/cli/index.d.ts +1 -0
  20. package/dist/cli/index.js +35 -0
  21. package/dist/cli/index.js.map +1 -0
  22. package/{src/navigation/navigation-fullscreen/close.svg → dist/close-IQXTDOHV.svg} +0 -0
  23. package/{src/utils/Emoji/compass.svg → dist/compass-2RWQU3E4.svg} +0 -0
  24. package/{src → dist}/components/features/FeatureList.css +2 -7
  25. package/dist/components/features/FeatureList.css.map +1 -0
  26. package/dist/components/features/FeatureList.d.ts +13 -0
  27. package/dist/components/features/FeatureList.js +8 -0
  28. package/dist/components/features/FeatureList.js.map +1 -0
  29. package/dist/components/features/initFeatureList.d.ts +3 -0
  30. package/dist/components/features/initFeatureList.js +60 -0
  31. package/dist/components/features/initFeatureList.js.map +1 -0
  32. package/{src/components/Sponsors/companyLogos/contra.svg → dist/contra-WLZBOPBV.svg} +0 -0
  33. package/dist/{devServer-J2XJQJGT.js → devServer-534L4U45.js} +5 -2
  34. package/dist/{devServer-J2XJQJGT.js.map → devServer-534L4U45.js.map} +1 -1
  35. package/{src/icons/discord.svg → dist/discord-JD33TUSF.svg} +0 -0
  36. package/{src/utils/Emoji/engine.png → dist/engine-6Q6VSCVA.png} +0 -0
  37. package/{src/icons/github.svg → dist/github-P5ZSKN2N.svg} +0 -0
  38. package/{src/icons/heart.svg → dist/heart-OINVKOXO.svg} +0 -0
  39. package/dist/index.css +121 -0
  40. package/dist/index.css.map +1 -0
  41. package/dist/index.d.ts +136 -0
  42. package/dist/index.js +459 -26
  43. package/dist/index.js.map +1 -1
  44. package/{src/components/Sponsors/label.svg → dist/label-MP75CTIA.svg} +0 -0
  45. package/{src/utils/Emoji/mechanical-arm.svg → dist/mechanical-arm-TR7IQQMG.svg} +0 -0
  46. package/{src/components/Sponsors/medalBronze.svg → dist/medalBronze-CO4CTUR4.svg} +0 -0
  47. package/{src/components/Sponsors/medalGold.svg → dist/medalGold-UP6A73FL.svg} +0 -0
  48. package/{src/components/Sponsors/medalSilver.svg → dist/medalSilver-FAPGGOBN.svg} +0 -0
  49. package/{src/components/Sponsors/companyLogos/mfqs.svg → dist/mfqs-2EAEE7N6.svg} +0 -0
  50. package/dist/renderer/_default.page.client.css +264 -0
  51. package/dist/renderer/_default.page.client.css.map +1 -0
  52. package/dist/renderer/_default.page.client.d.ts +1 -0
  53. package/dist/renderer/_default.page.client.js +180 -0
  54. package/dist/renderer/_default.page.client.js.map +1 -0
  55. package/dist/renderer/_default.page.server.css +312 -0
  56. package/dist/renderer/_default.page.server.css.map +1 -0
  57. package/dist/renderer/_default.page.server.d.ts +22 -0
  58. package/dist/renderer/_default.page.server.js +591 -0
  59. package/dist/renderer/_default.page.server.js.map +1 -0
  60. package/{src/utils/Emoji/road-fork.svg → dist/road-fork-3WZLW3HB.svg} +0 -0
  61. package/{src/utils/Emoji/shield.svg → dist/shield-CU45RG5C.svg} +0 -0
  62. package/{src/icons/twitter.svg → dist/twitter-I7DXDN3J.svg} +0 -0
  63. package/{src/utils/Emoji/typescript.svg → dist/typescript-ALIPKLRM.svg} +0 -0
  64. package/package.json +12 -9
  65. package/dist/chunk-ZYYJWJMY.js.map +0 -1
  66. package/src/MobileHeader.tsx +0 -68
  67. package/src/PageLayout.css +0 -41
  68. package/src/PageLayout.tsx +0 -37
  69. package/src/algolia/DocSearch.css +0 -29
  70. package/src/algolia/DocSearch.ts +0 -37
  71. package/src/autoScrollNav.ts +0 -22
  72. package/src/cli/devServer.ts +0 -31
  73. package/src/cli/index.ts +0 -29
  74. package/src/components/CodeBlock.tsx +0 -22
  75. package/src/components/DocLink.tsx +0 -108
  76. package/src/components/EditPageNote.tsx +0 -18
  77. package/src/components/HorizontalLine.tsx +0 -20
  78. package/src/components/ImportMeta.tsx +0 -11
  79. package/src/components/Info.tsx +0 -12
  80. package/src/components/Link.tsx +0 -18
  81. package/src/components/Note.tsx +0 -31
  82. package/src/components/P.css +0 -8
  83. package/src/components/P.tsx +0 -8
  84. package/src/components/ReadingRecommendation.tsx +0 -53
  85. package/src/components/RepoLink.tsx +0 -24
  86. package/src/components/Sponsors/companyLogos/ccoli-logo.svg +0 -1
  87. package/src/components/Sponsors/companyLogos/ccoli-text.svg +0 -1
  88. package/src/components/Sponsors/label.draft.svg +0 -108
  89. package/src/components/Sponsors.tsx +0 -242
  90. package/src/components/features/FeatureList.tsx +0 -114
  91. package/src/components/features/initFeatureList.ts +0 -66
  92. package/src/components/index.ts +0 -13
  93. package/src/config/Config.ts +0 -30
  94. package/src/config/getConfig.ts +0 -18
  95. package/src/config/resolveConfig/resolveHeading.ts +0 -0
  96. package/src/config/resolvePageContext.ts +0 -157
  97. package/src/css/button.css +0 -7
  98. package/src/css/code/block.css +0 -36
  99. package/src/css/code/inline.css +0 -27
  100. package/src/css/code.css +0 -20
  101. package/src/css/colorize-on-hover.css +0 -29
  102. package/src/css/font.css +0 -19
  103. package/src/css/heading.css +0 -25
  104. package/src/css/index.css +0 -11
  105. package/src/css/link.css +0 -17
  106. package/src/css/note.css +0 -26
  107. package/src/css/reset.css +0 -12
  108. package/src/css/table.css +0 -14
  109. package/src/css/tooltip.css +0 -11
  110. package/src/headings.ts +0 -200
  111. package/src/index.ts +0 -3
  112. package/src/installSectionUrlHashs.ts +0 -50
  113. package/src/markdownHeadingsVitePlugin.ts +0 -128
  114. package/src/navigation/Navigation-highlight.css +0 -41
  115. package/src/navigation/Navigation-items.css +0 -122
  116. package/src/navigation/Navigation-layout.css +0 -118
  117. package/src/navigation/Navigation.client.old.ts +0 -303
  118. package/src/navigation/Navigation.client.ts +0 -19
  119. package/src/navigation/Navigation.css +0 -12
  120. package/src/navigation/Navigation.tsx +0 -228
  121. package/src/navigation/NavigationHeader.tsx +0 -97
  122. package/src/navigation/navigation-fullscreen/NavigationFullscreenButton.css +0 -32
  123. package/src/navigation/navigation-fullscreen/NavigationFullscreenButton.tsx +0 -44
  124. package/src/navigation/navigation-fullscreen/initNavigationFullscreen.ts +0 -115
  125. package/src/parseEmojis.ts +0 -33
  126. package/src/renderer/_default.page.client.ts +0 -4
  127. package/src/renderer/_default.page.server.tsx +0 -69
  128. package/src/renderer/usePageContext.tsx +0 -25
  129. package/src/types.ts +0 -2
  130. package/src/utils/Emoji/Emoji.ts +0 -216
  131. package/src/utils/Emoji/assets.ts +0 -9
  132. package/src/utils/Emoji/index.ts +0 -1
  133. package/src/utils/Emoji/mountain.svg +0 -1
  134. package/src/utils/assert.ts +0 -39
  135. package/src/utils/client.ts +0 -2
  136. package/src/utils/crawlAllFiles.ts +0 -17
  137. package/src/utils/determineSectionUrlHash.ts +0 -35
  138. package/src/utils/filesystemPathHandling.ts +0 -42
  139. package/src/utils/filter.ts +0 -12
  140. package/src/utils/isBrowser.ts +0 -5
  141. package/src/utils/jsxToTextContent.ts +0 -11
  142. package/src/utils/objectAssign.ts +0 -9
  143. package/src/utils/server.ts +0 -8
  144. package/src/vite.config.ts +0 -44
@@ -1,35 +0,0 @@
1
- import { assert } from './assert'
2
-
3
- export { determineSectionUrlHash }
4
- export { determineSectionTitle }
5
-
6
- function determineSectionUrlHash(title: string): string {
7
- const urlHash = title
8
- .toLowerCase()
9
- .split(/[^a-z0-9]+/)
10
- .filter(Boolean)
11
- .join('-')
12
- return urlHash
13
- }
14
-
15
- function determineSectionTitle(urlWithHash: string, titleNormalCase: boolean): string {
16
- assert(urlWithHash.includes('#'), { urlWithHash })
17
- const urlHash = urlWithHash.split('#')[1]
18
- const title = urlHash
19
- .split('-')
20
- .map((word, i) => {
21
- if (i === 0) {
22
- return capitalizeFirstLetter(word)
23
- }
24
- if (!titleNormalCase && word.length >= 4) {
25
- return capitalizeFirstLetter(word)
26
- }
27
- return word
28
- })
29
- .join(' ')
30
- return title
31
- }
32
-
33
- function capitalizeFirstLetter(word: string): string {
34
- return word[0].toUpperCase() + word.slice(1)
35
- }
@@ -1,42 +0,0 @@
1
- export { toPosixPath }
2
- export { assertPosixPath }
3
- export { toSystemPath }
4
-
5
- import assert from 'assert'
6
-
7
- const sepPosix = '/'
8
- const sepWin32 = '\\'
9
-
10
- function toPosixPath(path: string) {
11
- if (isPosix()) {
12
- assertPosixPath(path)
13
- return path
14
- }
15
- if (isWin32()) {
16
- const pathPosix = path.split(sepWin32).join(sepPosix)
17
- assertPosixPath(pathPosix)
18
- return pathPosix
19
- }
20
- assert(false)
21
- }
22
-
23
- function assertPosixPath(path: string) {
24
- assert(path && !path.includes(sepWin32), `Wrongly formatted path: ${path}`)
25
- }
26
-
27
- function toSystemPath(path: string) {
28
- if (isPosix()) {
29
- return toPosixPath(path)
30
- }
31
- if (isWin32()) {
32
- return path.split(sepPosix).join(sepWin32)
33
- }
34
- assert(false)
35
- }
36
-
37
- function isWin32() {
38
- return process.platform === 'win32'
39
- }
40
- function isPosix() {
41
- return !isWin32()
42
- }
@@ -1,12 +0,0 @@
1
- export { filter }
2
-
3
- // https://stackoverflow.com/questions/66341757/typescript-how-to-filter-the-object
4
- function filter<T extends object>(obj: T, predicate: <K extends keyof T>(value: T[K], key: K) => boolean): T {
5
- const result: { [K in keyof T]?: T[K] } = {}
6
- ;(Object.keys(obj) as Array<keyof T>).forEach((name) => {
7
- if (predicate(obj[name], name)) {
8
- result[name] = obj[name]
9
- }
10
- })
11
- return result as T
12
- }
@@ -1,5 +0,0 @@
1
- export { isBrowser }
2
-
3
- function isBrowser() {
4
- return typeof window !== 'undefined'
5
- }
@@ -1,11 +0,0 @@
1
- import { assert } from './assert'
2
-
3
- export { jsxToTextContent }
4
-
5
- // https://stackoverflow.com/questions/34204975/react-is-there-something-similar-to-node-textcontent/60564620#60564620
6
- function jsxToTextContent(node: JSX.Element | string): string {
7
- if (['string', 'number'].includes(typeof node)) return String(node)
8
- if (node instanceof Array) return node.map(jsxToTextContent).join('')
9
- if (typeof node === 'object' && node) return jsxToTextContent(node.props.children)
10
- assert(false)
11
- }
@@ -1,9 +0,0 @@
1
- export { objectAssign }
2
-
3
- // Same as `Object.assign()` but with type inference
4
- function objectAssign<Obj extends Object, ObjAddendum>(
5
- obj: Obj,
6
- objAddendum: ObjAddendum
7
- ): asserts obj is Obj & ObjAddendum {
8
- Object.assign(obj, objAddendum)
9
- }
@@ -1,8 +0,0 @@
1
- export * from './client'
2
- export * from './isBrowser'
3
- export * from './filter'
4
- export * from './determineSectionUrlHash'
5
- export * from './jsxToTextContent'
6
- export * from './objectAssign'
7
- export * from './crawlAllFiles'
8
- export * from './Emoji'
@@ -1,44 +0,0 @@
1
- import mdx from '@mdx-js/rollup'
2
- import react from '@vitejs/plugin-react'
3
- import ssr from 'vite-plugin-ssr/plugin'
4
- import { UserConfig } from 'vite'
5
- import { markdownHeadingsVitePlugin } from './markdownHeadingsVitePlugin'
6
- import rehypePrettyCode from 'rehype-pretty-code'
7
- import remarkGfm from 'remark-gfm'
8
-
9
- const root = process.cwd()
10
- const prettyCode = [rehypePrettyCode, { theme: 'github-light' }]
11
- const rehypePlugins: any = [prettyCode]
12
- const remarkPlugins = [remarkGfm]
13
-
14
- const config: UserConfig = {
15
- root,
16
- plugins: [
17
- react({
18
- jsxRuntime: 'classic'
19
- }),
20
- markdownHeadingsVitePlugin(),
21
- mdx({ rehypePlugins, remarkPlugins }),
22
- ssr({
23
- prerender: {
24
- noExtraDir: true
25
- },
26
- // @ts-ignore until new version is released TODO
27
- extensions: [{
28
- npmPackageName: '@brillout/docpress',
29
- pageFilesSrc: '/src/renderer/*',
30
- }],
31
- includeAssetsImportedByServer: true,
32
- disableAutoFullBuild: true
33
- })
34
- ],
35
- // TODO: remove `react`?
36
- optimizeDeps: { include: ['@mdx-js/react', 'react', 'react-dom'] },
37
- // @ts-ignore
38
- ssr: {
39
- noExternal: ['@brillout/docpress']
40
- },
41
- clearScreen: false
42
- }
43
-
44
- export default config