rspress-plugin-api-extractor 0.1.2 → 0.2.0

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 (109) hide show
  1. package/README.md +2 -2
  2. package/api-extracted-package.js +426 -0
  3. package/build-program.js +120 -0
  4. package/build-stages.js +664 -0
  5. package/category-resolver.js +50 -0
  6. package/code-post-processor.js +38 -0
  7. package/config-helpers.js +106 -0
  8. package/config-utils.js +258 -0
  9. package/content-hash.js +79 -0
  10. package/errors.js +29 -0
  11. package/formatter.js +69 -0
  12. package/hide-cut-transformer.js +96 -0
  13. package/index.d.ts +901 -831
  14. package/index.js +4 -6128
  15. package/layers/ConfigServiceLive.js +377 -0
  16. package/layers/ObservabilityLive.js +136 -0
  17. package/layers/PathDerivationServiceLive.js +16 -0
  18. package/layers/SnapshotServiceLive.js +94 -0
  19. package/layers/TypeRegistryServiceLive.js +46 -0
  20. package/llms-processing.js +270 -0
  21. package/llms-program.js +262 -0
  22. package/loader.js +186 -0
  23. package/markdown/cross-linker.js +156 -0
  24. package/markdown/helpers.js +364 -0
  25. package/markdown/index.js +11 -0
  26. package/markdown/page-generators/class-page.js +357 -0
  27. package/markdown/page-generators/enum-page.js +152 -0
  28. package/markdown/page-generators/function-page.js +127 -0
  29. package/markdown/page-generators/index-pages.js +27 -0
  30. package/markdown/page-generators/interface-page.js +307 -0
  31. package/markdown/page-generators/namespace-page.js +280 -0
  32. package/markdown/page-generators/type-alias-page.js +110 -0
  33. package/markdown/page-generators/variable-page.js +110 -0
  34. package/markdown/shiki-utils.js +48 -0
  35. package/migrations/001_create_snapshots.js +25 -0
  36. package/model-loader.js +95 -0
  37. package/multi-entry-resolver.js +70 -0
  38. package/og-resolver.js +271 -0
  39. package/package.json +63 -73
  40. package/path-derivation.js +48 -0
  41. package/plugin.js +218 -0
  42. package/prettier-formatter.js +73 -0
  43. package/public/tsconfig/rspress.json +44 -0
  44. package/remark-api-codeblocks.js +130 -0
  45. package/remark-with-api.js +172 -0
  46. package/route-collisions.js +52 -0
  47. package/runtime/components/ApiExample/index.js +29 -25
  48. package/runtime/components/ApiLlmsPackageActions/index.js +252 -323
  49. package/runtime/components/ApiLlmsViewOptions/index.js +269 -340
  50. package/runtime/components/ApiMember/index.js +49 -47
  51. package/runtime/components/ApiSignature/index.js +32 -28
  52. package/runtime/components/EnumMembersTable/{index_module.css → index.css} +18 -19
  53. package/runtime/components/EnumMembersTable/index.js +36 -67
  54. package/runtime/components/EnumMembersTable/index.module.js +9 -6
  55. package/runtime/components/ExampleBlock/{index_module.css → index.css} +2 -3
  56. package/runtime/components/ExampleBlock/index.js +23 -28
  57. package/runtime/components/ExampleBlock/index.module.js +8 -5
  58. package/runtime/components/MarkdownContent/index.js +26 -18
  59. package/runtime/components/MarkdownText/index.js +28 -22
  60. package/runtime/components/MemberSignature/{index_module.css → index.css} +5 -6
  61. package/runtime/components/MemberSignature/index.js +46 -46
  62. package/runtime/components/MemberSignature/index.module.js +9 -6
  63. package/runtime/components/ParametersTable/{index_module.css → index.css} +19 -20
  64. package/runtime/components/ParametersTable/index.js +36 -67
  65. package/runtime/components/ParametersTable/index.module.js +9 -6
  66. package/runtime/components/SignatureBlock/{index_module.css → index.css} +5 -6
  67. package/runtime/components/SignatureBlock/index.js +30 -29
  68. package/runtime/components/SignatureBlock/index.module.js +9 -6
  69. package/runtime/components/SignatureCode/{index_module.css → index.css} +9 -10
  70. package/runtime/components/SignatureCode/index.js +40 -32
  71. package/runtime/components/SignatureCode/index.module.js +9 -6
  72. package/runtime/components/SignatureToolbar/{index_module.css → index.css} +18 -20
  73. package/runtime/components/SignatureToolbar/index.js +48 -51
  74. package/runtime/components/SignatureToolbar/index.module.js +13 -10
  75. package/runtime/components/buttons/ButtonGroup.js +13 -6
  76. package/runtime/components/buttons/CopyCodeButton.js +40 -38
  77. package/runtime/components/buttons/WrapSignatureButton.js +20 -16
  78. package/runtime/components/buttons/{index_module.css → index.css} +5 -6
  79. package/runtime/components/buttons/index.module.js +8 -5
  80. package/runtime/components/icons/CheckIcon/index.js +20 -17
  81. package/runtime/components/icons/CopyIcon/index.js +20 -17
  82. package/runtime/components/icons/UnwrapIcon/index.js +22 -18
  83. package/runtime/components/icons/WrapIcon/index.js +20 -17
  84. package/runtime/components/shared/_twoslash.css +3 -10
  85. package/runtime/components/shared/variables.css +0 -3
  86. package/runtime/hooks/useWrapToggle.js +32 -9
  87. package/runtime/index.d.ts +513 -173
  88. package/runtime/index.js +11 -9
  89. package/runtime/utils/decode-hast.js +31 -16
  90. package/runtime/utils/hast-renderer.js +21 -7
  91. package/schemas/config.js +199 -0
  92. package/schemas/index.js +5 -0
  93. package/schemas/opengraph.js +26 -0
  94. package/schemas/performance.js +19 -0
  95. package/serve.js +133 -0
  96. package/services/ConfigService.js +7 -0
  97. package/services/PathDerivationService.js +7 -0
  98. package/services/SnapshotService.js +7 -0
  99. package/services/TypeRegistryService.js +7 -0
  100. package/shiki-transformer.js +758 -0
  101. package/tsconfig-parser.js +127 -0
  102. package/tsdoc-metadata.json +11 -11
  103. package/twoslash-patterns.js +87 -0
  104. package/twoslash-transformer.js +316 -0
  105. package/type-reference-extractor.js +201 -0
  106. package/typescript-config.js +168 -0
  107. package/vfs-registry.js +121 -0
  108. package/0~llms-program.js +0 -344
  109. package/runtime/components/ApiLlmsPackageActions/index.module.js +0 -2
@@ -46,7 +46,6 @@ html.rp-dark {
46
46
  color: var(--twoslash-popup-color);
47
47
  border: 1px solid var(--twoslash-border-color);
48
48
  z-index: 1000;
49
- -webkit-user-select: none;
50
49
  user-select: none;
51
50
  text-align: left;
52
51
  box-shadow: var(--twoslash-popup-shadow);
@@ -68,7 +67,6 @@ html.rp-dark {
68
67
  transform: translateY(1.1em);
69
68
 
70
69
  &:hover {
71
- -webkit-user-select: auto;
72
70
  user-select: auto;
73
71
  }
74
72
  }
@@ -185,11 +183,11 @@ html.rp-dark {
185
183
  }
186
184
 
187
185
  & .twoslash-error {
188
- background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%206%203%27%20enable-background%3D%27new%200%200%206%203%27%20height%3D%273%27%20width%3D%276%27%3E%3Cg%20fill%3D%27%23c94824%27%3E%3Cpolygon%20points%3D%275.5%2C0%202.5%2C3%201.1%2C3%204.1%2C0%27%2F%3E%3Cpolygon%20points%3D%274%2C0%206%2C2%206%2C0.6%205.4%2C0%27%2F%3E%3Cpolygon%20points%3D%270%2C2%201%2C3%202.4%2C3%200%2C0.6%27%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") 0 100% repeat-x;
186
+ background: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%206%203'%20enable-background%3D'new%200%200%206%203'%20height%3D'3'%20width%3D'6'%3E%3Cg%20fill%3D'%23c94824'%3E%3Cpolygon%20points%3D'5.5%2C0%202.5%2C3%201.1%2C3%204.1%2C0'%2F%3E%3Cpolygon%20points%3D'4%2C0%206%2C2%206%2C0.6%205.4%2C0'%2F%3E%3Cpolygon%20points%3D'0%2C2%201%2C3%202.4%2C3%200%2C0.6'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") 0 100% repeat-x;
189
187
  padding-bottom: 2px;
190
188
 
191
189
  &.twoslash-error-level-warning {
192
- background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%206%203%27%20enable-background%3D%27new%200%200%206%203%27%20height%3D%273%27%20width%3D%276%27%3E%3Cg%20fill%3D%27%23c37d0d%27%3E%3Cpolygon%20points%3D%275.5%2C0%202.5%2C3%201.1%2C3%204.1%2C0%27%2F%3E%3Cpolygon%20points%3D%274%2C0%206%2C2%206%2C0.6%205.4%2C0%27%2F%3E%3Cpolygon%20points%3D%270%2C2%201%2C3%202.4%2C3%200%2C0.6%27%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") 0 100% repeat-x;
190
+ background: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%206%203'%20enable-background%3D'new%200%200%206%203'%20height%3D'3'%20width%3D'6'%3E%3Cg%20fill%3D'%23c37d0d'%3E%3Cpolygon%20points%3D'5.5%2C0%202.5%2C3%201.1%2C3%204.1%2C0'%2F%3E%3Cpolygon%20points%3D'4%2C0%206%2C2%206%2C0.6%205.4%2C0'%2F%3E%3Cpolygon%20points%3D'0%2C2%201%2C3%202.4%2C3%200%2C0.6'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") 0 100% repeat-x;
193
191
  padding-bottom: 2px;
194
192
  }
195
193
  }
@@ -198,7 +196,6 @@ html.rp-dark {
198
196
  position: relative;
199
197
 
200
198
  & .twoslash-completion-list {
201
- -webkit-user-select: none;
202
199
  user-select: none;
203
200
  z-index: 1000;
204
201
  box-shadow: var(--twoslash-popup-shadow);
@@ -217,7 +214,6 @@ html.rp-dark {
217
214
  transform: translate(0, 1.2em);
218
215
 
219
216
  &:hover {
220
- -webkit-user-select: auto;
221
217
  user-select: auto;
222
218
  }
223
219
 
@@ -426,9 +422,7 @@ html.rp-dark {
426
422
  .api-type-link {
427
423
  color: inherit;
428
424
  text-underline-offset: 2px;
429
- -webkit-text-decoration: underline dotted;
430
- text-decoration: underline dotted;
431
- text-decoration-thickness: 1px;
425
+ text-decoration: underline 1px dotted;
432
426
  transition: all .2s;
433
427
 
434
428
  &:hover {
@@ -444,4 +438,3 @@ html.rp-dark .api-type-link {
444
438
  text-decoration-color: #fffc;
445
439
  }
446
440
  }
447
-
@@ -41,7 +41,6 @@
41
41
  background-color: var(--api-shiki-light-bg, inherit);
42
42
  font-style: var(--api-shiki-light-font-style, inherit);
43
43
  font-weight: var(--api-shiki-light-font-weight, inherit);
44
- -webkit-text-decoration: var(--api-shiki-light-text-decoration, inherit);
45
44
  text-decoration: var(--api-shiki-light-text-decoration, inherit);
46
45
  }
47
46
 
@@ -50,7 +49,6 @@ html.rp-dark .api-doc-code .shiki, html.rp-dark .api-doc-code .shiki span {
50
49
  background-color: var(--api-shiki-dark-bg, inherit);
51
50
  font-style: var(--api-shiki-dark-font-style, inherit);
52
51
  font-weight: var(--api-shiki-dark-font-weight, inherit);
53
- -webkit-text-decoration: var(--api-shiki-dark-text-decoration, inherit);
54
52
  text-decoration: var(--api-shiki-dark-text-decoration, inherit);
55
53
  }
56
54
 
@@ -82,4 +80,3 @@ html.rp-dark .rp-social-links__item:hover {
82
80
  html.rp-dark .rp-social-links__item:active {
83
81
  background-color: var(--api-color-active-bg);
84
82
  }
85
-
@@ -1,12 +1,35 @@
1
1
  import { useState } from "react";
2
+
3
+ //#region src/runtime/hooks/useWrapToggle.ts
4
+ /* v8 ignore start -- React hook, requires React test environment */
5
+ /**
6
+ * Hook for managing code/signature wrapping state
7
+ * Provides a boolean state and toggle function
8
+ *
9
+ * @returns Object with wrapped state and toggleWrap function
10
+ *
11
+ * @example
12
+ * ```tsx
13
+ * const { wrapped, toggleWrap } = useWrapToggle();
14
+ *
15
+ * return (
16
+ * <div>
17
+ * <button onClick={toggleWrap}>Toggle Wrap</button>
18
+ * <pre className={wrapped ? 'wrapped' : ''}>...</pre>
19
+ * </div>
20
+ * );
21
+ * ```
22
+ */
2
23
  function useWrapToggle() {
3
- const [wrapped, setWrapped] = useState(false);
4
- const toggleWrap = ()=>{
5
- setWrapped(!wrapped);
6
- };
7
- return {
8
- wrapped,
9
- toggleWrap
10
- };
24
+ const [wrapped, setWrapped] = useState(false);
25
+ const toggleWrap = () => {
26
+ setWrapped(!wrapped);
27
+ };
28
+ return {
29
+ wrapped,
30
+ toggleWrap
31
+ };
11
32
  }
12
- export { useWrapToggle };
33
+
34
+ //#endregion
35
+ export { useWrapToggle };