@ng-doc/app 22.0.0 → 22.1.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 (50) hide show
  1. package/fesm2022/ng-doc-app-classes-root-page.mjs.map +1 -1
  2. package/fesm2022/ng-doc-app-components-demo-frame.mjs +96 -0
  3. package/fesm2022/ng-doc-app-components-demo-frame.mjs.map +1 -0
  4. package/fesm2022/ng-doc-app-components-demo-pane.mjs +1 -1
  5. package/fesm2022/ng-doc-app-components-demo-pane.mjs.map +1 -1
  6. package/fesm2022/ng-doc-app-components-demo.mjs +54 -8
  7. package/fesm2022/ng-doc-app-components-demo.mjs.map +1 -1
  8. package/fesm2022/ng-doc-app-components-playground.mjs +109 -47
  9. package/fesm2022/ng-doc-app-components-playground.mjs.map +1 -1
  10. package/fesm2022/ng-doc-app-components-tabs.mjs +21 -3
  11. package/fesm2022/ng-doc-app-components-tabs.mjs.map +1 -1
  12. package/fesm2022/ng-doc-app-components.mjs +1 -0
  13. package/fesm2022/ng-doc-app-components.mjs.map +1 -1
  14. package/fesm2022/ng-doc-app-demo-app.mjs +176 -0
  15. package/fesm2022/ng-doc-app-demo-app.mjs.map +1 -0
  16. package/fesm2022/ng-doc-app-helpers.mjs +23 -2
  17. package/fesm2022/ng-doc-app-helpers.mjs.map +1 -1
  18. package/fesm2022/ng-doc-app-processors-processors.mjs +30 -9
  19. package/fesm2022/ng-doc-app-processors-processors.mjs.map +1 -1
  20. package/fesm2022/ng-doc-app-providers-ng-doc-app.mjs.map +1 -1
  21. package/fesm2022/ng-doc-app-providers-title.mjs +129 -0
  22. package/fesm2022/ng-doc-app-providers-title.mjs.map +1 -0
  23. package/fesm2022/ng-doc-app-providers.mjs +1 -0
  24. package/fesm2022/ng-doc-app-providers.mjs.map +1 -1
  25. package/fesm2022/ng-doc-app-services-highlighter.mjs +17 -13
  26. package/fesm2022/ng-doc-app-services-highlighter.mjs.map +1 -1
  27. package/fesm2022/ng-doc-app-services-route-preloader.mjs +34 -10
  28. package/fesm2022/ng-doc-app-services-route-preloader.mjs.map +1 -1
  29. package/fesm2022/ng-doc-app-type-controls-type-alias-control.mjs +43 -8
  30. package/fesm2022/ng-doc-app-type-controls-type-alias-control.mjs.map +1 -1
  31. package/package.json +17 -4
  32. package/styles/global.css +3 -0
  33. package/styles/main.css +3 -0
  34. package/styles/themes/dark.css +10 -0
  35. package/types/ng-doc-app-classes-root-page.d.ts +8 -0
  36. package/types/ng-doc-app-components-demo-frame.d.ts +48 -0
  37. package/types/ng-doc-app-components-demo.d.ts +20 -2
  38. package/types/ng-doc-app-components-playground.d.ts +24 -3
  39. package/types/ng-doc-app-components-tabs.d.ts +13 -3
  40. package/types/ng-doc-app-components.d.ts +1 -0
  41. package/types/ng-doc-app-demo-app.d.ts +89 -0
  42. package/types/ng-doc-app-helpers.d.ts +21 -3
  43. package/types/ng-doc-app-interfaces.d.ts +15 -4
  44. package/types/ng-doc-app-processors-processors.d.ts +5 -0
  45. package/types/ng-doc-app-providers-ng-doc-app.d.ts +1 -1
  46. package/types/ng-doc-app-providers-title.d.ts +59 -0
  47. package/types/ng-doc-app-providers.d.ts +1 -0
  48. package/types/ng-doc-app-services-highlighter.d.ts +12 -5
  49. package/types/ng-doc-app-services-route-preloader.d.ts +13 -1
  50. package/types/ng-doc-app-type-controls-type-alias-control.d.ts +26 -4
@@ -1,7 +1,7 @@
1
1
  import * as _ng_doc_app_tokens from '@ng-doc/app/tokens';
2
2
  import * as i0 from '@angular/core';
3
3
  import { OnDestroy, Signal } from '@angular/core';
4
- import { ThemeInput } from 'shiki';
4
+ import { ThemeInput, LanguageInput } from 'shiki/core';
5
5
 
6
6
  /** Shiki configuration of the code highlighter. */
7
7
  interface NgDocHighlighterConfig {
@@ -9,6 +9,13 @@ interface NgDocHighlighterConfig {
9
9
  * Themes sources.
10
10
  */
11
11
  themes?: ThemeInput[];
12
+ /**
13
+ * Shiki languages to load besides `angular-html`, the language of playground code, and the
14
+ * languages it embeds. A language named like one of them replaces it, so register here the
15
+ * languages of `shiki.langs` in `ng-doc.config.ts` that playground code uses, for example a newer
16
+ * Angular template grammar.
17
+ */
18
+ langs?: LanguageInput[];
12
19
  /**
13
20
  * Has no effect, and is reported in development mode.
14
21
  *
@@ -41,12 +48,12 @@ declare class NgDocHighlighterService implements OnDestroy {
41
48
  readonly ready: Signal<boolean>;
42
49
  /**
43
50
  * Loads Shiki with the built-in themes (`github-light`, `ayu-dark` and NgDoc's `css-variables`)
44
- * and the given ones. Concurrent and repeated calls share one initialization; a failed one can
45
- * be retried.
46
- * @param config - Custom Shiki themes to load.
51
+ * and the given ones, and the given languages. Concurrent and repeated calls share one
52
+ * initialization; a failed one can be retried.
53
+ * @param config - Custom Shiki themes and languages to load.
47
54
  */
48
55
  initialize(config?: NgDocHighlighterConfig): Promise<void>;
49
- /** Disposes the highlighter this service created for custom themes. */
56
+ /** Disposes the highlighter this service created for custom themes or languages. */
50
57
  ngOnDestroy(): void;
51
58
  private static create;
52
59
  /**
@@ -95,11 +95,23 @@ declare class NgDocRoutePreloader {
95
95
  /**
96
96
  * Returns the application URL of a link, or `undefined` for a link that leaves the
97
97
  * application, opens elsewhere, downloads a file or points into the current page.
98
+ *
99
+ * The link is read through the location strategy: with `PathLocationStrategy` the route is the
100
+ * link's path, and with `HashLocationStrategy` (`withHashLocation()`) it is the link's fragment
101
+ * (`#/docs/page`), so a fragment that is not a route (`#usage`) is an anchor on the page.
98
102
  * @param anchor - The link.
99
103
  * @returns The URL relative to the application's base, with its query.
100
104
  */
101
105
  private linkUrl;
102
- /** The base path of the application, ending with a slash. */
106
+ /**
107
+ * Whether the location strategy keeps the route in the document's fragment, as
108
+ * `HashLocationStrategy` does.
109
+ */
110
+ private hashLocation;
111
+ /**
112
+ * The base path of the application's routes, ending with a slash: the base href, which a
113
+ * fragment route carries only when `APP_BASE_HREF` sets one.
114
+ */
103
115
  private basePath;
104
116
  private destroy;
105
117
  static ɵfac: i0.ɵɵFactoryDeclaration<NgDocRoutePreloader, never>;
@@ -1,20 +1,42 @@
1
1
  import * as _angular_core from '@angular/core';
2
+ import { Signal } from '@angular/core';
3
+ import { NgDocResolvedPlaygroundOption } from '@ng-doc/app/helpers';
2
4
  import { NgDocTypeControl } from '@ng-doc/app/interfaces';
5
+ import { NgDocPlaygroundOption } from '@ng-doc/core/interfaces';
3
6
  import { DIControl } from 'di-controls';
4
7
 
5
8
  /**
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.
9
+ * The playground control of union type aliases and enums: a select that shows the value (or the
10
+ * name of an enum member) and whether it is the default. The inspector shows the value type under
11
+ * the input's name.
8
12
  */
9
13
  declare class NgDocTypeAliasControlComponent<T> extends DIControl<T> implements NgDocTypeControl<T> {
10
14
  /** Default value of the input; clearing the selection returns to it. */
11
15
  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>;
16
+ /**
17
+ * Values the input accepts: literal source text, plain values when `isManual` is set, or the
18
+ * names and values of enum members.
19
+ */
20
+ readonly options: _angular_core.InputSignal<(string | NgDocPlaygroundOption)[] | undefined>;
14
21
  /** Whether `options` are values the user listed in the playground config. */
15
22
  readonly isManual: _angular_core.InputSignal<boolean | undefined>;
23
+ /**
24
+ * The options of the select. `undefined` and `null` get no option: clearing the selection
25
+ * returns to the default value instead.
26
+ */
27
+ protected readonly items: Signal<NgDocResolvedPlaygroundOption[]>;
16
28
  constructor();
17
29
  typeOf(value: unknown): string;
30
+ /**
31
+ * The text of a value: the name of its option, such as the name of an enum member.
32
+ * @param value - A value of the input.
33
+ */
34
+ labelOf(value: unknown): string;
35
+ /**
36
+ * Whether the reset button is shown: a value other than the default is selected.
37
+ * @param value - The selected value.
38
+ */
39
+ protected canReset(value: T | null): boolean;
18
40
  changeModel(value: T | null): void;
19
41
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgDocTypeAliasControlComponent<any>, never>;
20
42
  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>;