@ng-doc/app 22.0.0-beta.2 → 22.0.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 (203) hide show
  1. package/README.md +20 -29
  2. package/fesm2022/ng-doc-app-classes-content-anchor-controller.mjs +363 -0
  3. package/fesm2022/ng-doc-app-classes-content-anchor-controller.mjs.map +1 -0
  4. package/fesm2022/ng-doc-app-classes-content-controller.mjs +299 -0
  5. package/fesm2022/ng-doc-app-classes-content-controller.mjs.map +1 -0
  6. package/fesm2022/ng-doc-app-classes-default-search-engine.mjs +51 -35
  7. package/fesm2022/ng-doc-app-classes-default-search-engine.mjs.map +1 -1
  8. package/fesm2022/ng-doc-app-classes-root-page.mjs.map +1 -1
  9. package/fesm2022/ng-doc-app-classes-search-engine.mjs.map +1 -1
  10. package/fesm2022/ng-doc-app-classes.mjs +2 -0
  11. package/fesm2022/ng-doc-app-classes.mjs.map +1 -1
  12. package/fesm2022/ng-doc-app-components-api-list.mjs +173 -69
  13. package/fesm2022/ng-doc-app-components-api-list.mjs.map +1 -1
  14. package/fesm2022/ng-doc-app-components-breadcrumb.mjs +13 -10
  15. package/fesm2022/ng-doc-app-components-breadcrumb.mjs.map +1 -1
  16. package/fesm2022/ng-doc-app-components-code.mjs +152 -25
  17. package/fesm2022/ng-doc-app-components-code.mjs.map +1 -1
  18. package/fesm2022/ng-doc-app-components-command-palette.mjs +498 -0
  19. package/fesm2022/ng-doc-app-components-command-palette.mjs.map +1 -0
  20. package/fesm2022/ng-doc-app-components-copy-button.mjs +38 -21
  21. package/fesm2022/ng-doc-app-components-copy-button.mjs.map +1 -1
  22. package/fesm2022/ng-doc-app-components-demo-displayer.mjs +36 -29
  23. package/fesm2022/ng-doc-app-components-demo-displayer.mjs.map +1 -1
  24. package/fesm2022/ng-doc-app-components-demo-pane.mjs +39 -36
  25. package/fesm2022/ng-doc-app-components-demo-pane.mjs.map +1 -1
  26. package/fesm2022/ng-doc-app-components-demo.mjs +129 -44
  27. package/fesm2022/ng-doc-app-components-demo.mjs.map +1 -1
  28. package/fesm2022/ng-doc-app-components-fullscreen-button.mjs +12 -9
  29. package/fesm2022/ng-doc-app-components-fullscreen-button.mjs.map +1 -1
  30. package/fesm2022/ng-doc-app-components-fullscreen-toggle.mjs +79 -0
  31. package/fesm2022/ng-doc-app-components-fullscreen-toggle.mjs.map +1 -0
  32. package/fesm2022/ng-doc-app-components-heading-anchor.mjs +54 -21
  33. package/fesm2022/ng-doc-app-components-heading-anchor.mjs.map +1 -1
  34. package/fesm2022/ng-doc-app-components-image-viewer.mjs +183 -89
  35. package/fesm2022/ng-doc-app-components-image-viewer.mjs.map +1 -1
  36. package/fesm2022/ng-doc-app-components-kind-icon.mjs +42 -25
  37. package/fesm2022/ng-doc-app-components-kind-icon.mjs.map +1 -1
  38. package/fesm2022/ng-doc-app-components-link.mjs +12 -9
  39. package/fesm2022/ng-doc-app-components-link.mjs.map +1 -1
  40. package/fesm2022/ng-doc-app-components-members.mjs +30 -0
  41. package/fesm2022/ng-doc-app-components-members.mjs.map +1 -0
  42. package/fesm2022/ng-doc-app-components-mermaid-viewer.mjs +61 -20
  43. package/fesm2022/ng-doc-app-components-mermaid-viewer.mjs.map +1 -1
  44. package/fesm2022/ng-doc-app-components-navbar.mjs +39 -49
  45. package/fesm2022/ng-doc-app-components-navbar.mjs.map +1 -1
  46. package/fesm2022/ng-doc-app-components-page-header.mjs +73 -10
  47. package/fesm2022/ng-doc-app-components-page-header.mjs.map +1 -1
  48. package/fesm2022/ng-doc-app-components-page-link.mjs +123 -31
  49. package/fesm2022/ng-doc-app-components-page-link.mjs.map +1 -1
  50. package/fesm2022/ng-doc-app-components-page-navigation.mjs +17 -19
  51. package/fesm2022/ng-doc-app-components-page-navigation.mjs.map +1 -1
  52. package/fesm2022/ng-doc-app-components-page-wrapper.mjs +56 -35
  53. package/fesm2022/ng-doc-app-components-page-wrapper.mjs.map +1 -1
  54. package/fesm2022/ng-doc-app-components-page.mjs +168 -24
  55. package/fesm2022/ng-doc-app-components-page.mjs.map +1 -1
  56. package/fesm2022/ng-doc-app-components-playground.mjs +392 -263
  57. package/fesm2022/ng-doc-app-components-playground.mjs.map +1 -1
  58. package/fesm2022/ng-doc-app-components-root.mjs +48 -31
  59. package/fesm2022/ng-doc-app-components-root.mjs.map +1 -1
  60. package/fesm2022/ng-doc-app-components-search-result.mjs +22 -21
  61. package/fesm2022/ng-doc-app-components-search-result.mjs.map +1 -1
  62. package/fesm2022/ng-doc-app-components-search.mjs +64 -33
  63. package/fesm2022/ng-doc-app-components-search.mjs.map +1 -1
  64. package/fesm2022/ng-doc-app-components-sidebar.mjs +86 -61
  65. package/fesm2022/ng-doc-app-components-sidebar.mjs.map +1 -1
  66. package/fesm2022/ng-doc-app-components-tabs.mjs +18 -12
  67. package/fesm2022/ng-doc-app-components-tabs.mjs.map +1 -1
  68. package/fesm2022/ng-doc-app-components-theme-toggle.mjs +33 -21
  69. package/fesm2022/ng-doc-app-components-theme-toggle.mjs.map +1 -1
  70. package/fesm2022/ng-doc-app-components-toc.mjs +267 -90
  71. package/fesm2022/ng-doc-app-components-toc.mjs.map +1 -1
  72. package/fesm2022/ng-doc-app-components.mjs +3 -1
  73. package/fesm2022/ng-doc-app-components.mjs.map +1 -1
  74. package/fesm2022/ng-doc-app-defaults-default-processors.mjs +2 -1
  75. package/fesm2022/ng-doc-app-defaults-default-processors.mjs.map +1 -1
  76. package/fesm2022/ng-doc-app-directives-code-highlighter.mjs +11 -5
  77. package/fesm2022/ng-doc-app-directives-code-highlighter.mjs.map +1 -1
  78. package/fesm2022/ng-doc-app-directives-members-filter.mjs +276 -0
  79. package/fesm2022/ng-doc-app-directives-members-filter.mjs.map +1 -0
  80. package/fesm2022/ng-doc-app-directives-route-active.mjs +34 -30
  81. package/fesm2022/ng-doc-app-directives-route-active.mjs.map +1 -1
  82. package/fesm2022/ng-doc-app-directives.mjs +1 -0
  83. package/fesm2022/ng-doc-app-directives.mjs.map +1 -1
  84. package/fesm2022/ng-doc-app-helpers.mjs +285 -1
  85. package/fesm2022/ng-doc-app-helpers.mjs.map +1 -1
  86. package/fesm2022/ng-doc-app-pipes-decode-uri-component.mjs +6 -4
  87. package/fesm2022/ng-doc-app-pipes-decode-uri-component.mjs.map +1 -1
  88. package/fesm2022/ng-doc-app-pipes-extract-value.mjs +6 -4
  89. package/fesm2022/ng-doc-app-pipes-extract-value.mjs.map +1 -1
  90. package/fesm2022/ng-doc-app-pipes-filter-by-text.mjs +7 -4
  91. package/fesm2022/ng-doc-app-pipes-filter-by-text.mjs.map +1 -1
  92. package/fesm2022/ng-doc-app-pipes-sanitize-html.mjs +8 -5
  93. package/fesm2022/ng-doc-app-pipes-sanitize-html.mjs.map +1 -1
  94. package/fesm2022/ng-doc-app-processors-page-processor.mjs +86 -23
  95. package/fesm2022/ng-doc-app-processors-page-processor.mjs.map +1 -1
  96. package/fesm2022/ng-doc-app-processors-processors-tooltip.mjs +26 -25
  97. package/fesm2022/ng-doc-app-processors-processors-tooltip.mjs.map +1 -1
  98. package/fesm2022/ng-doc-app-processors-processors.mjs +12 -1
  99. package/fesm2022/ng-doc-app-processors-processors.mjs.map +1 -1
  100. package/fesm2022/ng-doc-app-providers-ng-doc-app.mjs +31 -2
  101. package/fesm2022/ng-doc-app-providers-ng-doc-app.mjs.map +1 -1
  102. package/fesm2022/ng-doc-app-services-content-scroll-intent.mjs +122 -0
  103. package/fesm2022/ng-doc-app-services-content-scroll-intent.mjs.map +1 -0
  104. package/fesm2022/ng-doc-app-services-content-state.mjs +57 -0
  105. package/fesm2022/ng-doc-app-services-content-state.mjs.map +1 -0
  106. package/fesm2022/ng-doc-app-services-fullscreen-route.mjs +74 -0
  107. package/fesm2022/ng-doc-app-services-fullscreen-route.mjs.map +1 -0
  108. package/fesm2022/ng-doc-app-services-highlighter.mjs +83 -14
  109. package/fesm2022/ng-doc-app-services-highlighter.mjs.map +1 -1
  110. package/fesm2022/ng-doc-app-services-route-preloader.mjs +360 -0
  111. package/fesm2022/ng-doc-app-services-route-preloader.mjs.map +1 -0
  112. package/fesm2022/ng-doc-app-services-shortcuts.mjs +214 -0
  113. package/fesm2022/ng-doc-app-services-shortcuts.mjs.map +1 -0
  114. package/fesm2022/ng-doc-app-services-sidebar.mjs +59 -25
  115. package/fesm2022/ng-doc-app-services-sidebar.mjs.map +1 -1
  116. package/fesm2022/ng-doc-app-services-store.mjs +8 -8
  117. package/fesm2022/ng-doc-app-services-store.mjs.map +1 -1
  118. package/fesm2022/ng-doc-app-services-theme.mjs +32 -12
  119. package/fesm2022/ng-doc-app-services-theme.mjs.map +1 -1
  120. package/fesm2022/ng-doc-app-services.mjs +143 -0
  121. package/fesm2022/ng-doc-app-services.mjs.map +1 -1
  122. package/fesm2022/ng-doc-app-tokens.mjs +7 -28
  123. package/fesm2022/ng-doc-app-tokens.mjs.map +1 -1
  124. package/fesm2022/ng-doc-app-type-controls-boolean-control.mjs +18 -9
  125. package/fesm2022/ng-doc-app-type-controls-boolean-control.mjs.map +1 -1
  126. package/fesm2022/ng-doc-app-type-controls-number-control.mjs +12 -9
  127. package/fesm2022/ng-doc-app-type-controls-number-control.mjs.map +1 -1
  128. package/fesm2022/ng-doc-app-type-controls-string-control.mjs +12 -9
  129. package/fesm2022/ng-doc-app-type-controls-string-control.mjs.map +1 -1
  130. package/fesm2022/ng-doc-app-type-controls-type-alias-control.mjs +22 -16
  131. package/fesm2022/ng-doc-app-type-controls-type-alias-control.mjs.map +1 -1
  132. package/package.json +69 -28
  133. package/styles/global.css +1125 -201
  134. package/styles/main.css +1125 -201
  135. package/styles/themes/dark.css +78 -56
  136. package/types/ng-doc-app-classes-content-anchor-controller.d.ts +54 -0
  137. package/types/ng-doc-app-classes-content-controller.d.ts +94 -0
  138. package/types/ng-doc-app-classes-default-search-engine.d.ts +9 -1
  139. package/types/ng-doc-app-classes-root-page.d.ts +6 -1
  140. package/types/ng-doc-app-classes-search-engine.d.ts +5 -0
  141. package/types/ng-doc-app-classes.d.ts +2 -0
  142. package/types/ng-doc-app-components-api-list.d.ts +69 -20
  143. package/types/ng-doc-app-components-breadcrumb.d.ts +8 -3
  144. package/types/ng-doc-app-components-code.d.ts +46 -12
  145. package/types/ng-doc-app-components-command-palette.d.ts +147 -0
  146. package/types/ng-doc-app-components-copy-button.d.ts +18 -6
  147. package/types/ng-doc-app-components-demo-displayer.d.ts +23 -10
  148. package/types/ng-doc-app-components-demo-pane.d.ts +19 -15
  149. package/types/ng-doc-app-components-demo.d.ts +62 -15
  150. package/types/ng-doc-app-components-fullscreen-button.d.ts +4 -2
  151. package/types/ng-doc-app-components-fullscreen-toggle.d.ts +24 -0
  152. package/types/ng-doc-app-components-heading-anchor.d.ts +26 -7
  153. package/types/ng-doc-app-components-image-viewer.d.ts +71 -7
  154. package/types/ng-doc-app-components-kind-icon.d.ts +28 -7
  155. package/types/ng-doc-app-components-link.d.ts +6 -2
  156. package/types/ng-doc-app-components-members.d.ts +13 -0
  157. package/types/ng-doc-app-components-mermaid-viewer.d.ts +21 -6
  158. package/types/ng-doc-app-components-navbar.d.ts +25 -15
  159. package/types/ng-doc-app-components-page-header.d.ts +28 -4
  160. package/types/ng-doc-app-components-page-link.d.ts +34 -15
  161. package/types/ng-doc-app-components-page-navigation.d.ts +10 -5
  162. package/types/ng-doc-app-components-page-wrapper.d.ts +35 -11
  163. package/types/ng-doc-app-components-page.d.ts +57 -6
  164. package/types/ng-doc-app-components-playground.d.ts +146 -78
  165. package/types/ng-doc-app-components-root.d.ts +28 -7
  166. package/types/ng-doc-app-components-search-result.d.ts +14 -6
  167. package/types/ng-doc-app-components-search.d.ts +19 -7
  168. package/types/ng-doc-app-components-tabs.d.ts +13 -4
  169. package/types/ng-doc-app-components-theme-toggle.d.ts +18 -5
  170. package/types/ng-doc-app-components-toc.d.ts +76 -29
  171. package/types/ng-doc-app-components.d.ts +3 -1
  172. package/types/ng-doc-app-directives-code-highlighter.d.ts +8 -4
  173. package/types/ng-doc-app-directives-members-filter.d.ts +61 -0
  174. package/types/ng-doc-app-directives-route-active.d.ts +21 -7
  175. package/types/ng-doc-app-directives.d.ts +1 -0
  176. package/types/ng-doc-app-helpers.d.ts +124 -3
  177. package/types/ng-doc-app-interfaces.d.ts +48 -28
  178. package/types/ng-doc-app-pipes-decode-uri-component.d.ts +3 -0
  179. package/types/ng-doc-app-pipes-extract-value.d.ts +3 -0
  180. package/types/ng-doc-app-pipes-filter-by-text.d.ts +4 -0
  181. package/types/ng-doc-app-pipes-sanitize-html.d.ts +4 -2
  182. package/types/ng-doc-app-processors-page-processor.d.ts +39 -10
  183. package/types/ng-doc-app-processors-processors-tooltip.d.ts +11 -10
  184. package/types/ng-doc-app-processors-processors.d.ts +5 -1
  185. package/types/ng-doc-app-providers-ng-doc-app.d.ts +17 -0
  186. package/types/ng-doc-app-services-content-scroll-intent.d.ts +52 -0
  187. package/types/ng-doc-app-services-content-state.d.ts +40 -0
  188. package/types/ng-doc-app-services-fullscreen-route.d.ts +35 -0
  189. package/types/ng-doc-app-services-highlighter.d.ts +40 -5
  190. package/types/ng-doc-app-services-route-preloader.d.ts +109 -0
  191. package/types/ng-doc-app-services-shortcuts.d.ts +96 -0
  192. package/types/ng-doc-app-services-sidebar.d.ts +24 -4
  193. package/types/ng-doc-app-services-store.d.ts +24 -1
  194. package/types/ng-doc-app-services-theme.d.ts +19 -3
  195. package/types/ng-doc-app-services.d.ts +77 -0
  196. package/types/ng-doc-app-tokens.d.ts +10 -30
  197. package/types/ng-doc-app-type-controls-boolean-control.d.ts +11 -6
  198. package/types/ng-doc-app-type-controls-number-control.d.ts +5 -3
  199. package/types/ng-doc-app-type-controls-string-control.d.ts +5 -3
  200. package/types/ng-doc-app-type-controls-type-alias-control.d.ts +13 -6
  201. package/fesm2022/ng-doc-app-components-search-dialog.mjs +0 -78
  202. package/fesm2022/ng-doc-app-components-search-dialog.mjs.map +0 -1
  203. package/types/ng-doc-app-components-search-dialog.d.ts +0 -28
@@ -0,0 +1,109 @@
1
+ import { PreloadingStrategy, Route, UrlTree } from '@angular/router';
2
+ import { Observable } from 'rxjs';
3
+ import * as i0 from '@angular/core';
4
+
5
+ /**
6
+ * The router preloading strategy of NgDoc: it loads a lazy route only when the reader is about
7
+ * to open one of its pages, as `NgDocRoutePreloader` decides, instead of every route at once.
8
+ *
9
+ * Set it as the router's preloading strategy to preload pages on intent:
10
+ *
11
+ * ```ts
12
+ * provideRouter(routes, withPreloading(NgDocPreloadingStrategy));
13
+ * ```
14
+ */
15
+ declare class NgDocPreloadingStrategy implements PreloadingStrategy {
16
+ private readonly preloader;
17
+ constructor();
18
+ /**
19
+ * Loads a lazy route when it leads to a page that is being preloaded.
20
+ * @param route - A lazy route that the router has not loaded yet.
21
+ * @param load - Loads the route.
22
+ * @returns The load, or an observable of `null` when the route is not loaded now.
23
+ */
24
+ preload(route: Route, load: () => Observable<unknown>): Observable<unknown>;
25
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgDocPreloadingStrategy, never>;
26
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
27
+ }
28
+
29
+ /**
30
+ * Preloads the pages that the reader is about to open, so that opening them shows them at once.
31
+ *
32
+ * It preloads a page when the reader points at, focuses or touches a link to it, anywhere in the
33
+ * document: the sidebar, the previous and next page links, links in the page content, search
34
+ * results and the table of contents. It also preloads the previous and next pages of a guide once
35
+ * the browser is idle after the guide has rendered. A preload loads the code of the page's route
36
+ * and its content, once per page. Nothing is preloaded on the server, when the reader asked the
37
+ * browser to save data, or on a 2G connection.
38
+ *
39
+ * The router loads the code through its preloading strategy, so preloading works only when the
40
+ * application sets `NgDocPreloadingStrategy` as that strategy:
41
+ *
42
+ * ```ts
43
+ * provideRouter(routes, withPreloading(NgDocPreloadingStrategy));
44
+ * ```
45
+ */
46
+ declare class NgDocRoutePreloader {
47
+ private readonly document;
48
+ private readonly injector;
49
+ private readonly ngZone;
50
+ private readonly router;
51
+ private readonly locationStrategy;
52
+ private readonly browser;
53
+ /** The path segments under which the documentation's routes live (`routePrefix`). */
54
+ private readonly prefix;
55
+ /** The pages that were asked for, by path, so each page is preloaded once. */
56
+ private readonly requested;
57
+ /** The paths, as URL segments, whose routes are being loaded. */
58
+ private readonly loading;
59
+ private enabled;
60
+ private destroyed;
61
+ private lastAnchor?;
62
+ private cancelIdle?;
63
+ private readonly intent;
64
+ constructor();
65
+ /**
66
+ * Turns preloading on and starts listening for links the reader is about to open. Called by
67
+ * `NgDocPreloadingStrategy` when the router creates it; does nothing on the server.
68
+ * @internal
69
+ */
70
+ enable(): void;
71
+ /**
72
+ * Preloads the code and the content of the page at a URL of the application. A page is
73
+ * preloaded once; the current page is not preloaded.
74
+ * @param url - The URL, relative to the application's base, for example `/docs/get-started`.
75
+ * @returns Whether a preload started.
76
+ */
77
+ preload(url: string | UrlTree): boolean;
78
+ /**
79
+ * Preloads pages once the browser is idle. A later call replaces the pages of an earlier one
80
+ * that has not run yet.
81
+ * @param urls - The URLs of the pages; missing ones are skipped.
82
+ */
83
+ preloadWhenIdle(urls: ReadonlyArray<string | undefined>): void;
84
+ /**
85
+ * Whether the router should load a lazy route now: the route leads to a page that is being
86
+ * preloaded.
87
+ * @param route - A lazy route that the router has not loaded yet.
88
+ * @returns Whether to load it.
89
+ * @internal
90
+ */
91
+ shouldPreload(route: Route): boolean;
92
+ private loaded;
93
+ private active;
94
+ private currentUrl;
95
+ /**
96
+ * Returns the application URL of a link, or `undefined` for a link that leaves the
97
+ * application, opens elsewhere, downloads a file or points into the current page.
98
+ * @param anchor - The link.
99
+ * @returns The URL relative to the application's base, with its query.
100
+ */
101
+ private linkUrl;
102
+ /** The base path of the application, ending with a slash. */
103
+ private basePath;
104
+ private destroy;
105
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgDocRoutePreloader, never>;
106
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
107
+ }
108
+
109
+ export { NgDocPreloadingStrategy, NgDocRoutePreloader };
@@ -0,0 +1,96 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, Signal } from '@angular/core';
3
+
4
+ /**
5
+ * A keyboard shortcut registered with the NgDocShortcutsService.
6
+ */
7
+ interface NgDocShortcut {
8
+ /**
9
+ * The key that runs the shortcut, compared with the key of the keyboard event without regard to
10
+ * case, for example '/', '[' or 'f'.
11
+ */
12
+ key: string;
13
+ /**
14
+ * Whether the shortcut is a chord with the Command key (macOS) or the Control key (elsewhere).
15
+ * Chords always work: in text fields too, and when single-key shortcuts are turned off. Other
16
+ * shortcuts are single keys: they run only while single-key shortcuts are on, never while the
17
+ * reader types in a field, and never with Command, Control or Alt held.
18
+ */
19
+ chord?: boolean;
20
+ /**
21
+ * Runs the shortcut. The default action of the keyboard event is prevented before it runs. The
22
+ * event is missing when the shortcut runs from the search palette.
23
+ */
24
+ handler: (event?: KeyboardEvent) => void;
25
+ }
26
+ /**
27
+ * Whether single-key shortcuts are on for readers who have not turned them on or off themselves.
28
+ * The default is true. Set it with the shortcuts option of provideNgDocApp.
29
+ */
30
+ declare const NG_DOC_SHORTCUTS: InjectionToken<boolean>;
31
+ /**
32
+ * The local storage key that keeps a reader's choice to turn single-key shortcuts on ("1") or off
33
+ * ("0").
34
+ */
35
+ declare const NG_DOC_STORE_SHORTCUTS_KEY: string;
36
+
37
+ /**
38
+ * Keyboard shortcuts of the documentation.
39
+ *
40
+ * Single-key shortcuts (slash opens the search, the square brackets open the previous and next
41
+ * page, F focuses the filter of the page, L copies the link to the page and T switches between
42
+ * the light and the dark theme) are on by default. Readers turn them all off with one switch, and
43
+ * the choice is saved in the browser. A site turns them off by default with the shortcuts option
44
+ * of provideNgDocApp. They never run while the reader types in a field or holds Command, Control
45
+ * or Alt. Chords such as Command+K (Control+K) always work.
46
+ */
47
+ declare class NgDocShortcutsService {
48
+ private readonly document;
49
+ private readonly injector;
50
+ private readonly ngZone;
51
+ private readonly browser;
52
+ private readonly appDefault;
53
+ private readonly userChoice;
54
+ private readonly shortcuts;
55
+ private themeToggle?;
56
+ /**
57
+ * Whether single-key shortcuts are on: the reader's saved choice, or the site's default.
58
+ * Components hide the hints of single-key shortcuts while it is false.
59
+ */
60
+ readonly enabled: Signal<boolean>;
61
+ constructor();
62
+ /**
63
+ * Turns single-key shortcuts on or off for this reader and saves the choice in the browser.
64
+ * @param enabled - Whether single-key shortcuts should run.
65
+ */
66
+ setEnabled(enabled: boolean): void;
67
+ /** Turns single-key shortcuts off when they are on, and on when they are off. */
68
+ toggle(): void;
69
+ /**
70
+ * Registers a shortcut. When several shortcuts use the same key, the one registered last runs,
71
+ * so a page can take over a key while it is shown and give it back when it is destroyed.
72
+ * @param shortcut - The shortcut to register.
73
+ * @returns A function that removes the shortcut.
74
+ */
75
+ register(shortcut: NgDocShortcut): () => void;
76
+ /**
77
+ * Runs the single-key shortcut registered for a key, as if the reader pressed it, even while
78
+ * single-key shortcuts are off. The search palette uses it for its actions.
79
+ * @param key - The key of the shortcut, for example 't'.
80
+ * @returns Whether a shortcut is registered for the key.
81
+ */
82
+ run(key: string): boolean;
83
+ private onKeydown;
84
+ private find;
85
+ private acceptsSingleKey;
86
+ private readChoice;
87
+ private registerDefaults;
88
+ private toggleDarkTheme;
89
+ private copyLink;
90
+ private click;
91
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgDocShortcutsService, never>;
92
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
93
+ }
94
+
95
+ export { NG_DOC_SHORTCUTS, NG_DOC_STORE_SHORTCUTS_KEY, NgDocShortcutsService };
96
+ export type { NgDocShortcut };
@@ -1,21 +1,40 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Signal } from '@angular/core';
1
3
  import { Router } from '@angular/router';
2
4
  import { NgDocScrollService } from '@ng-doc/ui-kit/services/scroll';
3
5
  import { BehaviorSubject, Observable } from 'rxjs';
4
- import * as i0 from '@angular/core';
5
6
 
7
+ /**
8
+ * The widest viewport, in CSS pixels, at which the sidebar is an overlay that the navbar's menu
9
+ * button opens. It matches the `max-width: 900px` media query of `ng-doc-sidenav`.
10
+ */
11
+ declare const NG_DOC_SIDEBAR_COLLAPSE_WIDTH = 900;
6
12
  /**
7
13
  * Service for sidebar, it can be used to hide/show sidebar or to check if sidebar is collapsable.
14
+ *
15
+ * On wide screens the sidebar is always shown. At `NG_DOC_SIDEBAR_COLLAPSE_WIDTH` and below it is
16
+ * an overlay: `show()` opens it and blocks page scrolling, `hide()` closes it, and a navigation
17
+ * or a resize to a wide screen ends the overlay.
8
18
  */
9
19
  declare class NgDocSidebarService {
10
- protected readonly expanded: BehaviorSubject<boolean>;
11
20
  protected readonly document: Document;
12
21
  protected readonly window: Window;
13
22
  protected readonly router: Router;
14
23
  protected readonly scroll: NgDocScrollService;
24
+ protected readonly expanded: BehaviorSubject<boolean>;
25
+ /**
26
+ * Whether the sidebar is shown, as a signal. It follows the same state as `isExpanded()`.
27
+ */
28
+ readonly expandedState: Signal<boolean>;
29
+ private readonly ngZone;
15
30
  constructor();
31
+ /**
32
+ * Whether the viewport is narrow enough for the sidebar to be an overlay.
33
+ */
16
34
  get isMobile(): boolean;
17
35
  /**
18
36
  * Indicates if sidebar is visible, based on the show/hide methods.
37
+ * Read `expandedState` for the same value as a signal.
19
38
  */
20
39
  isExpanded(): Observable<boolean>;
21
40
  /**
@@ -30,8 +49,9 @@ declare class NgDocSidebarService {
30
49
  * Toggle sidebar visibility.
31
50
  */
32
51
  toggle(): void;
52
+ private syncWithViewport;
33
53
  static ɵfac: i0.ɵɵFactoryDeclaration<NgDocSidebarService, never>;
34
- static ɵprov: i0.ɵɵInjectableDeclaration<NgDocSidebarService>;
54
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
35
55
  }
36
56
 
37
- export { NgDocSidebarService };
57
+ export { NG_DOC_SIDEBAR_COLLAPSE_WIDTH, NgDocSidebarService };
@@ -1,13 +1,36 @@
1
1
  import * as i0 from '@angular/core';
2
2
 
3
+ /**
4
+ * Reads and writes NgDoc settings (for example the theme) in the browser's local storage.
5
+ */
3
6
  declare class NgDocStoreService {
4
7
  protected readonly localStorage: Storage;
8
+ /**
9
+ * Stores a string value.
10
+ * @param key - Storage key.
11
+ * @param data - The value to store.
12
+ */
5
13
  set(key: string, data: string): void;
14
+ /**
15
+ * Stores a value after serializing it.
16
+ * @param key - Storage key.
17
+ * @param data - The value to store.
18
+ * @param serialize - Converts the value to a string.
19
+ */
6
20
  set<T>(key: string, data: T, serialize: (v: T) => string): void;
21
+ /**
22
+ * Returns the stored string, or `null` when the key is not set.
23
+ * @param key - Storage key.
24
+ */
7
25
  get(key: string): string | null;
26
+ /**
27
+ * Returns the stored value, deserialized.
28
+ * @param key - Storage key.
29
+ * @param deserialize - Converts the stored string (or `null`) to the value.
30
+ */
8
31
  get<T>(key: string, deserialize: (v: string | null) => T): T;
9
32
  static ɵfac: i0.ɵɵFactoryDeclaration<NgDocStoreService, never>;
10
- static ɵprov: i0.ɵɵInjectableDeclaration<NgDocStoreService>;
33
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
11
34
  }
12
35
 
13
36
  export { NgDocStoreService };
@@ -1,27 +1,43 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Signal } from '@angular/core';
1
3
  import { NgDocStoreService } from '@ng-doc/app/services/store';
2
4
  import { Subject, Observable } from 'rxjs';
3
- import * as i0 from '@angular/core';
4
5
 
5
6
  /**
6
7
  * Service for managing themes.
8
+ *
9
+ * The theme is the `data-theme` attribute of the document element: `auto`, `dark`, the id of a
10
+ * custom theme, or no attribute for the light theme.
7
11
  */
8
12
  declare class NgDocThemeService {
9
13
  protected readonly document: Document;
10
14
  protected readonly store: NgDocStoreService;
11
15
  protected readonly change$: Subject<string | null>;
12
16
  protected readonly documentElement: HTMLElement;
17
+ private readonly themeState;
18
+ /**
19
+ * The current theme as a signal: the theme id, or `null` for the light theme.
20
+ *
21
+ * It starts with the document's `data-theme` attribute and follows every `set()` call.
22
+ */
23
+ readonly theme: Signal<string | null>;
13
24
  /**
14
- * Returns the current theme.
25
+ * Returns the current theme: the document's `data-theme` attribute, or `null` without one.
15
26
  */
16
27
  get currentTheme(): string | null;
28
+ /**
29
+ * Emits the theme after every `set()` call. Read `theme` for the current value as a
30
+ * signal.
31
+ */
17
32
  themeChanges(): Observable<string | null>;
18
33
  /**
19
34
  * Sets the theme by id.
20
35
  * @param id - Theme id. If not provided, the theme will be removed.
21
36
  */
22
37
  set(id?: string): void;
38
+ private readTheme;
23
39
  static ɵfac: i0.ɵɵFactoryDeclaration<NgDocThemeService, never>;
24
- static ɵprov: i0.ɵɵInjectableDeclaration<NgDocThemeService>;
40
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
25
41
  }
26
42
 
27
43
  export { NgDocThemeService };
@@ -1,3 +1,80 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Signal } from '@angular/core';
3
+ import { NgDocApiList } from '@ng-doc/core/interfaces';
4
+ export * from '@ng-doc/app/services/content-scroll-intent';
5
+ export * from '@ng-doc/app/services/content-state';
6
+ export * from '@ng-doc/app/services/fullscreen-route';
1
7
  export * from '@ng-doc/app/services/highlighter';
8
+ export * from '@ng-doc/app/services/route-preloader';
9
+ export * from '@ng-doc/app/services/shortcuts';
2
10
  export * from '@ng-doc/app/services/sidebar';
3
11
  export * from '@ng-doc/app/services/store';
12
+ export * from '@ng-doc/app/services/theme';
13
+
14
+ /**
15
+ * A declaration of an API list, with the scope it belongs to.
16
+ */
17
+ interface NgDocApiListDeclaration {
18
+ /** The name of the declaration. */
19
+ name: string;
20
+ /** The kind of the declaration, for example Class or Function. */
21
+ kind: string;
22
+ /** The scope of the declaration, for example the package name. */
23
+ scope: string;
24
+ /** The route of the declaration page, without the leading slash. */
25
+ route: string;
26
+ /** A one-line description, when the API list data carries one. */
27
+ description?: string;
28
+ /** The declaration header, when the API list data carries it. */
29
+ signature?: string;
30
+ }
31
+ /**
32
+ * The route data key that names the segment of an API entry's list data
33
+ * (assets/ng-doc/SEGMENT/api-list.json). An empty string is the root list.
34
+ */
35
+ declare const NG_DOC_API_LIST_SEGMENT_DATA: string;
36
+ /**
37
+ * Loads the API lists of every API entry once, for the search palette. The data file of an entry
38
+ * is assets/ng-doc/SEGMENT/api-list.json, where the segment is the route of the entry in its API
39
+ * configuration, or the root when it has none.
40
+ *
41
+ * The new engine lists every segment in the generated context (`NgDocContext.apiLists`), so
42
+ * exactly those files are requested, and none when the site has no API entry. Otherwise the
43
+ * entries are found in the router configuration: a route that carries the route data key
44
+ * NG_DOC_API_LIST_SEGMENT_DATA names its segment, and a route that declaration pages live under
45
+ * (ENTRY/classes/SCOPE/NAME and so on) tries its last route segment, with the root as the
46
+ * fallback ("api" tries the root first, as that is the default route of an API entry). When the
47
+ * configuration shows no entry (lazy routes), the root list is loaded. A list that cannot be
48
+ * loaded is skipped quietly, and each file is requested at most once per application.
49
+ */
50
+ declare class NgDocApiListIndexService {
51
+ private readonly http;
52
+ private readonly router;
53
+ private readonly basePath;
54
+ private readonly context;
55
+ private readonly lists;
56
+ private readonly requests;
57
+ private loading?;
58
+ /** Every declaration of the loaded API lists. */
59
+ readonly declarations: Signal<NgDocApiListDeclaration[]>;
60
+ /**
61
+ * Starts loading the API lists of every API entry, once.
62
+ * @returns A promise that settles when every list has loaded or failed.
63
+ */
64
+ load(): Promise<void>;
65
+ /**
66
+ * Records an API list that is already loaded (the API index page loads its own), so the
67
+ * palette does not request it again.
68
+ * @param segment - The segment of the list data, or an empty string for the root list.
69
+ * @param list - The list.
70
+ */
71
+ remember(segment: string, list: NgDocApiList[]): void;
72
+ private loadEntry;
73
+ private request;
74
+ private store;
75
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgDocApiListIndexService, never>;
76
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
77
+ }
78
+
79
+ export { NG_DOC_API_LIST_SEGMENT_DATA, NgDocApiListIndexService };
80
+ export type { NgDocApiListDeclaration };
@@ -1,7 +1,14 @@
1
1
  import { InjectionToken, Provider } from '@angular/core';
2
- import { NgDocContext, NgDocPageProcessor, NgDocPageSkeleton, NgDocTheme, NgDocTypeControl } from '@ng-doc/app/interfaces';
2
+ import { NgDocContext, NgDocPageProcessor, NgDocPageSkeleton, NgDocTypeControl } from '@ng-doc/app/interfaces';
3
3
  import { Mermaid } from 'mermaid';
4
4
 
5
+ /** Enables one delayed anchor replay after asynchronous NgDoc content is processed. */
6
+ declare const NG_DOC_CONTENT_ANCHOR_SCROLLING: InjectionToken<boolean>;
7
+
8
+ type NgDocContentScrollPositionRestoration = 'enabled' | 'top' | 'disabled';
9
+ /** Declares whether delayed NgDoc content may replay a missed saved scroll position. */
10
+ declare const NG_DOC_CONTENT_SCROLL_POSITION_RESTORATION: InjectionToken<NgDocContentScrollPositionRestoration>;
11
+
5
12
  declare const NG_DOC_CONTEXT: InjectionToken<NgDocContext>;
6
13
 
7
14
  declare const NG_DOC_MERMAID: InjectionToken<Mermaid>;
@@ -30,34 +37,7 @@ interface NgDocShikiTheme {
30
37
  }
31
38
  declare const NG_DOC_SHIKI_THEME: InjectionToken<NgDocShikiTheme>;
32
39
 
33
- /**
34
- * Token that can be used to provide custom theme.
35
- * You must compile your theme to CSS and add it to `assets` so that NgDoc can load it dynamically.
36
- *
37
- * You always should provide custom themes in root of your application with `multi: true` parameter.
38
- *
39
- * For example
40
- * ```typescript
41
- * @NgModule({
42
- * declarations: [AppComponent],
43
- * imports: [],
44
- * providers: [
45
- * {provide: NG_DOC_THEME, useValue: {id: 'CustomTheme', path: '/assets/themes/custom.css'}, multi: true}
46
- * ],
47
- * bootstrap: [AppComponent],
48
- * })
49
- * export class AppModule {}
50
- * ```
51
- */
52
- declare const NG_DOC_THEME: InjectionToken<NgDocTheme>;
53
- /**
54
- * Default theme for application if user didn't change it manually.
55
- *
56
- * You can provide this token in the root of you application, to set theme by default.
57
- */
58
- declare const NG_DOC_DEFAULT_THEME_ID: InjectionToken<string>;
59
-
60
40
  declare const NG_DOC_TYPE_CONTROL: InjectionToken<NgDocTypeControl>;
61
41
 
62
- export { NG_DOC_CONTEXT, NG_DOC_DEFAULT_THEME_ID, NG_DOC_MERMAID, NG_DOC_PAGE_CUSTOM_PROCESSOR, NG_DOC_PAGE_PROCESSOR, NG_DOC_PAGE_SKELETON, NG_DOC_ROUTE_PREFIX, NG_DOC_SHIKI_THEME, NG_DOC_THEME, NG_DOC_TYPE_CONTROL, provideMainPageProcessor, providePageProcessor };
63
- export type { NgDocShikiTheme };
42
+ export { NG_DOC_CONTENT_ANCHOR_SCROLLING, NG_DOC_CONTENT_SCROLL_POSITION_RESTORATION, NG_DOC_CONTEXT, NG_DOC_MERMAID, NG_DOC_PAGE_CUSTOM_PROCESSOR, NG_DOC_PAGE_PROCESSOR, NG_DOC_PAGE_SKELETON, NG_DOC_ROUTE_PREFIX, NG_DOC_SHIKI_THEME, NG_DOC_TYPE_CONTROL, provideMainPageProcessor, providePageProcessor };
43
+ export type { NgDocContentScrollPositionRestoration, NgDocShikiTheme };
@@ -1,16 +1,21 @@
1
+ import * as _angular_core from '@angular/core';
1
2
  import { NgDocTypeControl } from '@ng-doc/app/interfaces';
2
3
  import { DIControl } from 'di-controls';
3
- import * as i0 from '@angular/core';
4
4
 
5
+ /** The playground control of `boolean` inputs: a checkbox labelled with the input name. */
5
6
  declare class NgDocBooleanControlComponent extends DIControl<boolean | undefined> implements NgDocTypeControl<boolean | undefined> {
6
- default?: boolean;
7
- name: string;
8
- description: string;
7
+ /** Default value of the input; `undefined` leaves the component's own default. */
8
+ readonly default: _angular_core.InputSignal<boolean | undefined>;
9
+ /** Name of the input. */
10
+ readonly name: _angular_core.InputSignal<string>;
11
+ /** Description of the input, shown in a tooltip. */
12
+ readonly description: _angular_core.InputSignal<string>;
9
13
  constructor();
14
+ /** The value an unchecked box stands for. */
10
15
  get defaultValue(): boolean | undefined;
11
16
  updateModel(obj: boolean | null | undefined): void;
12
- static ɵfac: i0.ɵɵFactoryDeclaration<NgDocBooleanControlComponent, never>;
13
- static ɵcmp: i0.ɵɵComponentDeclaration<NgDocBooleanControlComponent, "ng-doc-boolean-control", never, {}, {}, never, never, true, never>;
17
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgDocBooleanControlComponent, never>;
18
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgDocBooleanControlComponent, "ng-doc-boolean-control", never, { "default": { "alias": "default"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "description": { "alias": "description"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
14
19
  }
15
20
 
16
21
  export { NgDocBooleanControlComponent };
@@ -1,13 +1,15 @@
1
+ import * as i0 from '@angular/core';
1
2
  import { NgDocTypeControl } from '@ng-doc/app/interfaces';
2
3
  import { DIControl } from 'di-controls';
3
- import * as i0 from '@angular/core';
4
4
 
5
+ /** The playground control of `number` inputs. */
5
6
  declare class NgDocNumberControlComponent extends DIControl<number> implements NgDocTypeControl<number> {
6
- default?: number;
7
+ /** Default value of the input; clearing the field returns to it. */
8
+ readonly default: i0.InputSignal<number | undefined>;
7
9
  constructor();
8
10
  changeModel(value: number | null): void;
9
11
  static ɵfac: i0.ɵɵFactoryDeclaration<NgDocNumberControlComponent, never>;
10
- static ɵcmp: i0.ɵɵComponentDeclaration<NgDocNumberControlComponent, "ng-doc-number-control", never, { "default": { "alias": "default"; "required": false; }; }, {}, never, never, true, never>;
12
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgDocNumberControlComponent, "ng-doc-number-control", never, { "default": { "alias": "default"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
11
13
  }
12
14
 
13
15
  export { NgDocNumberControlComponent };
@@ -1,14 +1,16 @@
1
+ import * as i0 from '@angular/core';
1
2
  import { NgDocTypeControl } from '@ng-doc/app/interfaces';
2
3
  import { DIControl } from 'di-controls';
3
- import * as i0 from '@angular/core';
4
4
 
5
+ /** The playground control of `string` inputs. */
5
6
  declare class NgDocStringControlComponent extends DIControl<string> implements NgDocTypeControl<string> {
6
- default?: string;
7
+ /** Default value of the input; clearing the field returns to it. */
8
+ readonly default: i0.InputSignal<string | undefined>;
7
9
  constructor();
8
10
  changeModel(value: string | null): void;
9
11
  writeValue(value: string | null): void;
10
12
  static ɵfac: i0.ɵɵFactoryDeclaration<NgDocStringControlComponent, never>;
11
- static ɵcmp: i0.ɵɵComponentDeclaration<NgDocStringControlComponent, "ng-doc-string-control", never, { "default": { "alias": "default"; "required": false; }; }, {}, never, never, true, never>;
13
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgDocStringControlComponent, "ng-doc-string-control", never, { "default": { "alias": "default"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
12
14
  }
13
15
 
14
16
  export { NgDocStringControlComponent };
@@ -1,16 +1,23 @@
1
+ import * as _angular_core from '@angular/core';
1
2
  import { NgDocTypeControl } from '@ng-doc/app/interfaces';
2
3
  import { DIControl } from 'di-controls';
3
- import * as i0 from '@angular/core';
4
4
 
5
+ /**
6
+ * The playground control of union type aliases: a select that shows the value and whether it is
7
+ * the default. The inspector shows the value type under the input's name.
8
+ */
5
9
  declare class NgDocTypeAliasControlComponent<T> extends DIControl<T> implements NgDocTypeControl<T> {
6
- default?: T;
7
- options?: string[];
8
- isManual?: boolean;
10
+ /** Default value of the input; clearing the selection returns to it. */
11
+ readonly default: _angular_core.InputSignal<T | undefined>;
12
+ /** Values the input accepts: literal source text, or plain values when `isManual` is set. */
13
+ readonly options: _angular_core.InputSignal<string[] | undefined>;
14
+ /** Whether `options` are values the user listed in the playground config. */
15
+ readonly isManual: _angular_core.InputSignal<boolean | undefined>;
9
16
  constructor();
10
17
  typeOf(value: unknown): string;
11
18
  changeModel(value: T | null): void;
12
- static ɵfac: i0.ɵɵFactoryDeclaration<NgDocTypeAliasControlComponent<any>, never>;
13
- static ɵcmp: i0.ɵɵComponentDeclaration<NgDocTypeAliasControlComponent<any>, "ng-doc-type-alias-control", never, { "default": { "alias": "default"; "required": false; }; }, {}, never, never, true, never>;
19
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgDocTypeAliasControlComponent<any>, never>;
20
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgDocTypeAliasControlComponent<any>, "ng-doc-type-alias-control", never, { "default": { "alias": "default"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "isManual": { "alias": "isManual"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
14
21
  }
15
22
 
16
23
  export { NgDocTypeAliasControlComponent };