@ng-doc/app 22.1.0 → 22.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 (157) hide show
  1. package/LICENSE +21 -0
  2. package/fesm2022/ng-doc-app-classes-content-controller.mjs +22 -4
  3. package/fesm2022/ng-doc-app-classes-content-controller.mjs.map +1 -1
  4. package/fesm2022/ng-doc-app-classes-default-search-engine.mjs +36 -12
  5. package/fesm2022/ng-doc-app-classes-default-search-engine.mjs.map +1 -1
  6. package/fesm2022/ng-doc-app-classes-root-page.mjs.map +1 -1
  7. package/fesm2022/ng-doc-app-components-api-list.mjs +7 -5
  8. package/fesm2022/ng-doc-app-components-api-list.mjs.map +1 -1
  9. package/fesm2022/ng-doc-app-components-breadcrumb.mjs +5 -3
  10. package/fesm2022/ng-doc-app-components-breadcrumb.mjs.map +1 -1
  11. package/fesm2022/ng-doc-app-components-code.mjs +6 -4
  12. package/fesm2022/ng-doc-app-components-code.mjs.map +1 -1
  13. package/fesm2022/ng-doc-app-components-command-palette.mjs +35 -27
  14. package/fesm2022/ng-doc-app-components-command-palette.mjs.map +1 -1
  15. package/fesm2022/ng-doc-app-components-copy-button.mjs +6 -4
  16. package/fesm2022/ng-doc-app-components-copy-button.mjs.map +1 -1
  17. package/fesm2022/ng-doc-app-components-demo-displayer.mjs +19 -4
  18. package/fesm2022/ng-doc-app-components-demo-displayer.mjs.map +1 -1
  19. package/fesm2022/ng-doc-app-components-demo-frame.mjs +195 -12
  20. package/fesm2022/ng-doc-app-components-demo-frame.mjs.map +1 -1
  21. package/fesm2022/ng-doc-app-components-demo-pane.mjs +2 -2
  22. package/fesm2022/ng-doc-app-components-demo-pane.mjs.map +1 -1
  23. package/fesm2022/ng-doc-app-components-demo.mjs +49 -12
  24. package/fesm2022/ng-doc-app-components-demo.mjs.map +1 -1
  25. package/fesm2022/ng-doc-app-components-fullscreen-button.mjs +5 -3
  26. package/fesm2022/ng-doc-app-components-fullscreen-button.mjs.map +1 -1
  27. package/fesm2022/ng-doc-app-components-fullscreen-toggle.mjs +4 -2
  28. package/fesm2022/ng-doc-app-components-fullscreen-toggle.mjs.map +1 -1
  29. package/fesm2022/ng-doc-app-components-heading-anchor.mjs +5 -3
  30. package/fesm2022/ng-doc-app-components-heading-anchor.mjs.map +1 -1
  31. package/fesm2022/ng-doc-app-components-image-viewer.mjs +5 -3
  32. package/fesm2022/ng-doc-app-components-image-viewer.mjs.map +1 -1
  33. package/fesm2022/ng-doc-app-components-navbar.mjs +4 -2
  34. package/fesm2022/ng-doc-app-components-navbar.mjs.map +1 -1
  35. package/fesm2022/ng-doc-app-components-page-navigation.mjs +5 -3
  36. package/fesm2022/ng-doc-app-components-page-navigation.mjs.map +1 -1
  37. package/fesm2022/ng-doc-app-components-page-wrapper.mjs +2 -2
  38. package/fesm2022/ng-doc-app-components-page-wrapper.mjs.map +1 -1
  39. package/fesm2022/ng-doc-app-components-page.mjs +83 -16
  40. package/fesm2022/ng-doc-app-components-page.mjs.map +1 -1
  41. package/fesm2022/ng-doc-app-components-playground.mjs +743 -108
  42. package/fesm2022/ng-doc-app-components-playground.mjs.map +1 -1
  43. package/fesm2022/ng-doc-app-components-root.mjs +51 -4
  44. package/fesm2022/ng-doc-app-components-root.mjs.map +1 -1
  45. package/fesm2022/ng-doc-app-components-search-result.mjs +8 -6
  46. package/fesm2022/ng-doc-app-components-search-result.mjs.map +1 -1
  47. package/fesm2022/ng-doc-app-components-search.mjs +7 -5
  48. package/fesm2022/ng-doc-app-components-search.mjs.map +1 -1
  49. package/fesm2022/ng-doc-app-components-sidebar.mjs +4 -3
  50. package/fesm2022/ng-doc-app-components-sidebar.mjs.map +1 -1
  51. package/fesm2022/ng-doc-app-components-theme-toggle.mjs +7 -5
  52. package/fesm2022/ng-doc-app-components-theme-toggle.mjs.map +1 -1
  53. package/fesm2022/ng-doc-app-components-toc.mjs +4 -2
  54. package/fesm2022/ng-doc-app-components-toc.mjs.map +1 -1
  55. package/fesm2022/ng-doc-app-constants.mjs +11 -1
  56. package/fesm2022/ng-doc-app-constants.mjs.map +1 -1
  57. package/fesm2022/ng-doc-app-demo-app.mjs +618 -15
  58. package/fesm2022/ng-doc-app-demo-app.mjs.map +1 -1
  59. package/fesm2022/ng-doc-app-helpers.mjs +125 -6
  60. package/fesm2022/ng-doc-app-helpers.mjs.map +1 -1
  61. package/fesm2022/ng-doc-app-providers-ng-doc-app.mjs +29 -18
  62. package/fesm2022/ng-doc-app-providers-ng-doc-app.mjs.map +1 -1
  63. package/fesm2022/ng-doc-app-providers-texts.mjs +53 -0
  64. package/fesm2022/ng-doc-app-providers-texts.mjs.map +1 -0
  65. package/fesm2022/ng-doc-app-providers.mjs +1 -0
  66. package/fesm2022/ng-doc-app-providers.mjs.map +1 -1
  67. package/fesm2022/ng-doc-app-services-content-scroll-intent.mjs +27 -2
  68. package/fesm2022/ng-doc-app-services-content-scroll-intent.mjs.map +1 -1
  69. package/fesm2022/ng-doc-app-services-highlighter.mjs +8 -5
  70. package/fesm2022/ng-doc-app-services-highlighter.mjs.map +1 -1
  71. package/fesm2022/ng-doc-app-services-shortcuts.mjs +38 -4
  72. package/fesm2022/ng-doc-app-services-shortcuts.mjs.map +1 -1
  73. package/fesm2022/ng-doc-app-texts-ar.mjs +238 -0
  74. package/fesm2022/ng-doc-app-texts-ar.mjs.map +1 -0
  75. package/fesm2022/ng-doc-app-texts-de.mjs +205 -0
  76. package/fesm2022/ng-doc-app-texts-de.mjs.map +1 -0
  77. package/fesm2022/ng-doc-app-texts-es.mjs +205 -0
  78. package/fesm2022/ng-doc-app-texts-es.mjs.map +1 -0
  79. package/fesm2022/ng-doc-app-texts-fr.mjs +205 -0
  80. package/fesm2022/ng-doc-app-texts-fr.mjs.map +1 -0
  81. package/fesm2022/ng-doc-app-texts-hi.mjs +219 -0
  82. package/fesm2022/ng-doc-app-texts-hi.mjs.map +1 -0
  83. package/fesm2022/ng-doc-app-texts-ja.mjs +205 -0
  84. package/fesm2022/ng-doc-app-texts-ja.mjs.map +1 -0
  85. package/fesm2022/ng-doc-app-texts-ko.mjs +205 -0
  86. package/fesm2022/ng-doc-app-texts-ko.mjs.map +1 -0
  87. package/fesm2022/ng-doc-app-texts-pt-br.mjs +205 -0
  88. package/fesm2022/ng-doc-app-texts-pt-br.mjs.map +1 -0
  89. package/fesm2022/ng-doc-app-texts-ru.mjs +231 -0
  90. package/fesm2022/ng-doc-app-texts-ru.mjs.map +1 -0
  91. package/fesm2022/ng-doc-app-texts-uk.mjs +231 -0
  92. package/fesm2022/ng-doc-app-texts-uk.mjs.map +1 -0
  93. package/fesm2022/ng-doc-app-texts-zh.mjs +205 -0
  94. package/fesm2022/ng-doc-app-texts-zh.mjs.map +1 -0
  95. package/fesm2022/ng-doc-app-tokens.mjs +214 -1
  96. package/fesm2022/ng-doc-app-tokens.mjs.map +1 -1
  97. package/fesm2022/ng-doc-app-type-controls-json-control.mjs +90 -0
  98. package/fesm2022/ng-doc-app-type-controls-json-control.mjs.map +1 -0
  99. package/fesm2022/ng-doc-app-type-controls-list-control.mjs +792 -0
  100. package/fesm2022/ng-doc-app-type-controls-list-control.mjs.map +1 -0
  101. package/fesm2022/ng-doc-app-type-controls-type-alias-control.mjs +5 -3
  102. package/fesm2022/ng-doc-app-type-controls-type-alias-control.mjs.map +1 -1
  103. package/fesm2022/ng-doc-app-type-controls.mjs +2 -0
  104. package/fesm2022/ng-doc-app-type-controls.mjs.map +1 -1
  105. package/package.json +59 -3
  106. package/styles/global.css +1 -0
  107. package/styles/main.css +1 -0
  108. package/types/ng-doc-app-classes-default-search-engine.d.ts +11 -0
  109. package/types/ng-doc-app-classes-root-page.d.ts +5 -0
  110. package/types/ng-doc-app-components-api-list.d.ts +3 -1
  111. package/types/ng-doc-app-components-breadcrumb.d.ts +2 -1
  112. package/types/ng-doc-app-components-code.d.ts +2 -0
  113. package/types/ng-doc-app-components-command-palette.d.ts +3 -1
  114. package/types/ng-doc-app-components-copy-button.d.ts +3 -1
  115. package/types/ng-doc-app-components-demo-displayer.d.ts +13 -1
  116. package/types/ng-doc-app-components-demo-frame.d.ts +62 -3
  117. package/types/ng-doc-app-components-demo.d.ts +27 -8
  118. package/types/ng-doc-app-components-fullscreen-button.d.ts +2 -0
  119. package/types/ng-doc-app-components-fullscreen-toggle.d.ts +2 -0
  120. package/types/ng-doc-app-components-heading-anchor.d.ts +2 -0
  121. package/types/ng-doc-app-components-image-viewer.d.ts +2 -0
  122. package/types/ng-doc-app-components-navbar.d.ts +2 -0
  123. package/types/ng-doc-app-components-page-navigation.d.ts +2 -1
  124. package/types/ng-doc-app-components-page.d.ts +10 -1
  125. package/types/ng-doc-app-components-playground.d.ts +241 -44
  126. package/types/ng-doc-app-components-root.d.ts +18 -0
  127. package/types/ng-doc-app-components-search-result.d.ts +2 -0
  128. package/types/ng-doc-app-components-search.d.ts +2 -0
  129. package/types/ng-doc-app-components-sidebar.d.ts +2 -1
  130. package/types/ng-doc-app-components-theme-toggle.d.ts +4 -1
  131. package/types/ng-doc-app-components-toc.d.ts +2 -1
  132. package/types/ng-doc-app-constants.d.ts +11 -1
  133. package/types/ng-doc-app-demo-app.d.ts +211 -3
  134. package/types/ng-doc-app-helpers.d.ts +56 -3
  135. package/types/ng-doc-app-interfaces.d.ts +621 -3
  136. package/types/ng-doc-app-providers-ng-doc-app.d.ts +6 -0
  137. package/types/ng-doc-app-providers-texts.d.ts +28 -0
  138. package/types/ng-doc-app-providers.d.ts +1 -0
  139. package/types/ng-doc-app-services-content-scroll-intent.d.ts +11 -1
  140. package/types/ng-doc-app-services-highlighter.d.ts +3 -1
  141. package/types/ng-doc-app-services-shortcuts.d.ts +16 -0
  142. package/types/ng-doc-app-texts-ar.d.ts +13 -0
  143. package/types/ng-doc-app-texts-de.d.ts +12 -0
  144. package/types/ng-doc-app-texts-es.d.ts +12 -0
  145. package/types/ng-doc-app-texts-fr.d.ts +12 -0
  146. package/types/ng-doc-app-texts-hi.d.ts +12 -0
  147. package/types/ng-doc-app-texts-ja.d.ts +12 -0
  148. package/types/ng-doc-app-texts-ko.d.ts +12 -0
  149. package/types/ng-doc-app-texts-pt-br.d.ts +12 -0
  150. package/types/ng-doc-app-texts-ru.d.ts +12 -0
  151. package/types/ng-doc-app-texts-uk.d.ts +12 -0
  152. package/types/ng-doc-app-texts-zh.d.ts +12 -0
  153. package/types/ng-doc-app-tokens.d.ts +21 -2
  154. package/types/ng-doc-app-type-controls-json-control.d.ts +38 -0
  155. package/types/ng-doc-app-type-controls-list-control.d.ts +313 -0
  156. package/types/ng-doc-app-type-controls-type-alias-control.d.ts +2 -1
  157. package/types/ng-doc-app-type-controls.d.ts +2 -0
@@ -1,10 +1,11 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { OnInit, Signal, ViewContainerRef, InputSignal, ChangeDetectorRef, AfterViewInit, WritableSignal, OnChanges, OnDestroy, Injector, DestroyRef, SimpleChanges } from '@angular/core';
2
+ import { OnInit, Signal, ViewContainerRef, InputSignal, ChangeDetectorRef, OnChanges, OnDestroy, Injector, DestroyRef, SimpleChanges, AfterViewInit, WritableSignal, InjectionToken } from '@angular/core';
3
3
  import { NgDocPlaygroundConfig, NgDocPlaygroundProperties, NgDocPlaygroundOptions, NgDocPlaygroundProperty, NgDocPlaygroundContent } from '@ng-doc/core/interfaces';
4
4
  import { Constructor } from '@ng-doc/core/types';
5
5
  import { Observable } from 'rxjs';
6
6
  import { FormGroup, FormControl } from '@angular/forms';
7
- import { NgDocProvidedTypeControl, NgDocTypeControlProviderOptions } from '@ng-doc/app/interfaces';
7
+ import { ɵNgDocPlaygroundFrameMessage as _NgDocPlaygroundFrameMessage } from '@ng-doc/app/demo-app';
8
+ import { NgDocPlaygroundTexts, NgDocProvidedTypeControl, NgDocTypeControlProviderOptions } from '@ng-doc/app/interfaces';
8
9
 
9
10
  /**
10
11
  * Base class of the playground classes the builder generates, one per playground and selector.
@@ -47,13 +48,103 @@ interface NgDocPlaygroundForm {
47
48
  content: FormGroup<Record<string, FormControl<boolean>>>;
48
49
  }
49
50
 
51
+ /**
52
+ * The iframe an isolated playground shows a target in: the URL of the target's page in the demo
53
+ * application, the fragment with the current state, and the iframe's accessible title.
54
+ * @internal
55
+ */
56
+ interface ɵNgDocPlaygroundFrame {
57
+ readonly url: string;
58
+ readonly fragment: string;
59
+ readonly title: string;
60
+ }
61
+ /**
62
+ * One demo of a playground: it creates the generated playground class of its selector (or pipe),
63
+ * passes it the form's values and shows the code of the current state. In an isolated playground
64
+ * the class runs on a page of the demo application in an iframe, which gets the values from its
65
+ * URL fragment, and reports the target's defaults back for the code view.
66
+ */
67
+ declare class NgDocPlaygroundDemoComponent<T extends NgDocPlaygroundProperties = NgDocPlaygroundProperties> implements OnChanges, OnDestroy {
68
+ /** The name of the playground in the page configuration. */
69
+ readonly id: InputSignal<string>;
70
+ /** The name of the pipe, when the target is a pipe. */
71
+ readonly pipeName: InputSignal<string>;
72
+ /** The selector of the target this demo renders. */
73
+ readonly selector: InputSignal<string>;
74
+ /** The playground configuration, extended by the action's options. */
75
+ readonly configuration: InputSignal<NgDocPlaygroundConfig | undefined>;
76
+ /** The inputs of the target. */
77
+ readonly properties: InputSignal<T | undefined>;
78
+ /** Whether the demo is created again each time a value changes. */
79
+ readonly recreateDemo: InputSignal<boolean>;
80
+ /** The values of the inputs and content slots. */
81
+ readonly form: InputSignal<FormGroup<NgDocPlaygroundForm> | undefined>;
82
+ /** Whether the code of the demo is shown. */
83
+ readonly expanded: InputSignal<boolean>;
84
+ /** The iframe of an isolated playground; without it, the class is created in the page. */
85
+ readonly frame: InputSignal<ɵNgDocPlaygroundFrame | undefined>;
86
+ /** The defaults of the target's inputs that the iframe reported, for the code view. */
87
+ readonly frameDefaults: InputSignal<Record<string, unknown> | undefined>;
88
+ /** The messages of the iframe of an isolated playground. */
89
+ readonly frameMessage: _angular_core.OutputEmitterRef<_NgDocPlaygroundFrameMessage>;
90
+ /** The iframe's page loaded but did not report the target in time. */
91
+ readonly frameSilent: _angular_core.OutputEmitterRef<void>;
92
+ /** The theme of the iframe, which the theme button beside the demo changes. */
93
+ readonly frameTheme: _angular_core.ModelSignal<string | undefined>;
94
+ /** The `theme` option of the playground, which the theme button offers too. */
95
+ readonly configuredTheme: InputSignal<string | undefined>;
96
+ /** The iframe of an isolated playground, while it is shown. */
97
+ private readonly frameComponent;
98
+ /**
99
+ * The background of the canvas while the iframe shows a theme of its own: the background its
100
+ * page reported, so the whole canvas reads in that theme.
101
+ */
102
+ protected readonly canvasBackground: Signal<string | undefined>;
103
+ /** The dots of the canvas while the iframe shows a theme of its own, in that theme's color. */
104
+ protected readonly canvasDots: Signal<string | undefined>;
105
+ /** The iframe's page with the current state, which the toolbar opens in a new tab. */
106
+ protected readonly frameUrl: Signal<string | undefined>;
107
+ /** Where the playground class is created. */
108
+ readonly demoOutlet: Signal<ViewContainerRef | undefined>;
109
+ /** The generated playground class of this demo's selector or pipe. */
110
+ playgroundDemo?: typeof NgDocBasePlayground;
111
+ protected readonly code: _angular_core.WritableSignal<string>;
112
+ protected readonly injector: Injector;
113
+ protected readonly destroyRef: DestroyRef;
114
+ private readonly pendingTasks;
115
+ private demoRef?;
116
+ private readonly unsubscribe$;
117
+ ngOnChanges({ form, id, frame }: SimpleChanges): Promise<void>;
118
+ private updateDemo;
119
+ private createDemo;
120
+ private updateCodeView;
121
+ private getActiveContent;
122
+ private getActiveInputs;
123
+ private getPipeActiveInputs;
124
+ ngOnDestroy(): void;
125
+ /**
126
+ * The default of an input: from the class in the page, or as the iframe reported it.
127
+ * @param key
128
+ */
129
+ private defaultValue;
130
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgDocPlaygroundDemoComponent<any>, never>;
131
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgDocPlaygroundDemoComponent<any>, "ng-doc-playground-demo", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "pipeName": { "alias": "pipeName"; "required": false; "isSignal": true; }; "selector": { "alias": "selector"; "required": false; "isSignal": true; }; "configuration": { "alias": "configuration"; "required": false; "isSignal": true; }; "properties": { "alias": "properties"; "required": false; "isSignal": true; }; "recreateDemo": { "alias": "recreateDemo"; "required": false; "isSignal": true; }; "form": { "alias": "form"; "required": false; "isSignal": true; }; "expanded": { "alias": "expanded"; "required": false; "isSignal": true; }; "frame": { "alias": "frame"; "required": false; "isSignal": true; }; "frameDefaults": { "alias": "frameDefaults"; "required": false; "isSignal": true; }; "frameTheme": { "alias": "frameTheme"; "required": false; "isSignal": true; }; "configuredTheme": { "alias": "configuredTheme"; "required": false; "isSignal": true; }; }, { "frameMessage": "frameMessage"; "frameSilent": "frameSilent"; "frameTheme": "frameThemeChange"; }, never, never, true, never>;
132
+ }
133
+
50
134
  /**
51
135
  * A playground: an inspector with a control per input and content slot of its target, and a demo
52
136
  * per selector (or the pipe) rendered with the chosen values.
137
+ *
138
+ * An isolated playground (the `isolated` option, or `isolatedPlaygrounds`) shows each demo in an
139
+ * iframe of its page in the demo application, which the Vite engine builds. The inspector stays
140
+ * here and passes the values in the iframe's URL fragment; the page reports the target's defaults
141
+ * back. When a value can't be put in the URL, the playground renders its demos in the page
142
+ * instead, with a note that names the input.
53
143
  */
54
144
  declare class NgDocPlaygroundComponent<T extends NgDocPlaygroundProperties = NgDocPlaygroundProperties> implements AfterViewInit {
55
145
  private readonly rootPage;
56
146
  private readonly formBuilder;
147
+ private readonly texts;
57
148
  /** The name of the playground in the page configuration. */
58
149
  readonly id: InputSignal<string>;
59
150
  /** The name of the pipe, when the target is a pipe. */
@@ -77,9 +168,65 @@ declare class NgDocPlaygroundComponent<T extends NgDocPlaygroundProperties = NgD
77
168
  readonly recreateDemo: WritableSignal<boolean>;
78
169
  /** Whether the Recreate setting is fixed on, and hidden, by the `'always'` option. */
79
170
  readonly recreateLocked: Signal<boolean>;
171
+ /**
172
+ * The note that says why the playground renders in the page although it is isolated: the input
173
+ * whose value can't be sent to its iframes, or what failed. Once set, it stays for the rest of
174
+ * the visit.
175
+ */
176
+ readonly fallback: WritableSignal<string | undefined>;
177
+ /** Whether the demos are shown in iframes of their pages in the demo application. */
178
+ readonly isolated: Signal<boolean>;
179
+ /** The note that says why an isolated playground renders in the page. */
180
+ readonly fallbackNote: Signal<string | undefined>;
181
+ /**
182
+ * The theme of the iframes: the `theme` option, until the reader picks another with the theme
183
+ * button beside a demo; `undefined` follows the page.
184
+ */
185
+ readonly frameTheme: WritableSignal<string | undefined>;
186
+ /** The iframe of each target, by selector or pipe name, while the playground is isolated. */
187
+ readonly frames: Signal<Map<string, ɵNgDocPlaygroundFrame> | undefined>;
188
+ private readonly injector;
189
+ private readonly platformLocation;
190
+ private readonly appBaseHref;
191
+ private readonly formValue;
80
192
  private defaultProperties;
81
193
  private defaultContent;
194
+ private viewInitialized;
195
+ /** Every target of the playground, in the order of its page's routes: its selectors, or the pipe. */
196
+ private readonly targets;
197
+ /** The state of the iframes as a URL fragment. */
198
+ private readonly fragment;
199
+ /**
200
+ * An input whose control is declared not cloneable (`cloneable: false` of `provideTypeControl`):
201
+ * the playground renders in the page from the start.
202
+ */
203
+ private readonly uncloneableControl;
204
+ /**
205
+ * A selector of the `selectors` option that is not one of the target's: it has no page, so the
206
+ * playground renders in the page from the start.
207
+ */
208
+ private readonly pagelessSelector;
209
+ constructor();
210
+ /**
211
+ * Takes a message of a demo's iframe: the target's defaults, which create the form, or a
212
+ * failure, which makes the playground render in the page.
213
+ * @param message - The message.
214
+ * @internal
215
+ */
216
+ onFrameMessage(message: _NgDocPlaygroundFrameMessage): void;
217
+ /**
218
+ * Makes the playground render in the page when the page in an iframe loaded but did not report
219
+ * the target, such as a page the build didn't make.
220
+ * @internal
221
+ */
222
+ onFrameSilent(): void;
82
223
  ngAfterViewInit(): void;
224
+ private createForm;
225
+ /**
226
+ * The URL of a target's page in the demo application, under the document's base href.
227
+ * @param slug
228
+ */
229
+ private pageUrl;
83
230
  protected isDefaultState(): boolean;
84
231
  private getPropertiesFormValues;
85
232
  private getContentFormValues;
@@ -90,46 +237,81 @@ declare class NgDocPlaygroundComponent<T extends NgDocPlaygroundProperties = NgD
90
237
  }
91
238
 
92
239
  /**
93
- * One demo of a playground: it creates the generated playground class of its selector (or pipe),
94
- * passes it the form's values and shows the code of the current state.
240
+ * What a generated playground class needs from the playground that shows it: the target's inputs
241
+ * (the order of a pipe's parameters) and the place to report the target's default input values.
242
+ * The playground on the documentation page provides it, and so does the page of an isolated
243
+ * playground in the demo application, which shows the class without the rest of the playground.
244
+ * @internal
95
245
  */
96
- declare class NgDocPlaygroundDemoComponent<T extends NgDocPlaygroundProperties = NgDocPlaygroundProperties> implements OnChanges, OnDestroy {
97
- /** The name of the playground in the page configuration. */
98
- readonly id: InputSignal<string>;
99
- /** The name of the pipe, when the target is a pipe. */
100
- readonly pipeName: InputSignal<string>;
101
- /** The selector of the target this demo renders. */
102
- readonly selector: InputSignal<string>;
103
- /** The playground configuration, extended by the action's options. */
104
- readonly configuration: InputSignal<NgDocPlaygroundConfig | undefined>;
105
- /** The inputs of the target. */
106
- readonly properties: InputSignal<T | undefined>;
107
- /** Whether the demo is created again each time a value changes. */
108
- readonly recreateDemo: InputSignal<boolean>;
109
- /** The values of the inputs and content slots. */
110
- readonly form: InputSignal<FormGroup<NgDocPlaygroundForm> | undefined>;
111
- /** Whether the code of the demo is shown. */
112
- readonly expanded: InputSignal<boolean>;
113
- /** Where the playground class is created. */
114
- readonly demoOutlet: Signal<ViewContainerRef | undefined>;
115
- /** The generated playground class of this demo's selector or pipe. */
116
- playgroundDemo?: typeof NgDocBasePlayground;
117
- protected readonly code: _angular_core.WritableSignal<string>;
118
- protected readonly injector: Injector;
119
- protected readonly destroyRef: DestroyRef;
120
- private readonly pendingTasks;
121
- private demoRef?;
122
- private readonly unsubscribe$;
123
- ngOnChanges({ form, id }: SimpleChanges): Promise<void>;
124
- private updateDemo;
125
- private createDemo;
126
- private updateCodeView;
127
- private getActiveContent;
128
- private getActiveInputs;
129
- private getPipeActiveInputs;
130
- ngOnDestroy(): void;
131
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgDocPlaygroundDemoComponent<any>, never>;
132
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgDocPlaygroundDemoComponent<any>, "ng-doc-playground-demo", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; "pipeName": { "alias": "pipeName"; "required": false; "isSignal": true; }; "selector": { "alias": "selector"; "required": false; "isSignal": true; }; "configuration": { "alias": "configuration"; "required": false; "isSignal": true; }; "properties": { "alias": "properties"; "required": false; "isSignal": true; }; "recreateDemo": { "alias": "recreateDemo"; "required": false; "isSignal": true; }; "form": { "alias": "form"; "required": false; "isSignal": true; }; "expanded": { "alias": "expanded"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
246
+ interface ɵNgDocPlaygroundContainer {
247
+ /** The inputs of the target, by name: only the names, in order, are read. */
248
+ readonly properties: Signal<Readonly<Record<string, unknown>> | undefined>;
249
+ /** The default values of the target's inputs, reported by the first class created. */
250
+ readonly defaultValues: WritableSignal<Record<string, unknown> | undefined>;
251
+ }
252
+ /**
253
+ * The playground that shows a generated playground class.
254
+ * @internal
255
+ */
256
+ declare const ɵNG_DOC_PLAYGROUND_CONTAINER: InjectionToken<ɵNgDocPlaygroundContainer>;
257
+
258
+ /**
259
+ * The route data of the page of an isolated playground: the playground's name in the page's
260
+ * `playgrounds`, and the target it shows, a selector or a pipe's name.
261
+ * @internal
262
+ */
263
+ interface ɵNgDocPlaygroundRouteData {
264
+ readonly id: string;
265
+ readonly selector?: string;
266
+ readonly pipeName?: string;
267
+ }
268
+ /**
269
+ * Shows one target of a playground on a page of the demo application, for an isolated playground:
270
+ * the generated playground class of the route's playground and target, without the inspector,
271
+ * which stays on the documentation page. The state comes from the URL fragment, and a new
272
+ * fragment applies a new state without a reload (the documentation page replaces it with
273
+ * `location.replace`). The page tells the documentation page, with `postMessage`, the target's
274
+ * default input values once it exists, each state it applied, and what failed.
275
+ *
276
+ * Like the demo host, it skips hydration: the server renders the target with its defaults, and
277
+ * the browser renders it again with the fragment's state, which only the browser has.
278
+ */
279
+ declare class NgDocPlaygroundHostComponent implements ɵNgDocPlaygroundContainer {
280
+ /** The target's inputs, by name, from the state: a pipe's parameters are positional. */
281
+ readonly properties: _angular_core.WritableSignal<Readonly<Record<string, unknown>> | undefined>;
282
+ /** The default values of the target's inputs, reported by the generated class. */
283
+ readonly defaultValues: _angular_core.WritableSignal<Record<string, unknown> | undefined>;
284
+ /** Whether the route names a playground or a target the page doesn't have. */
285
+ protected readonly missing: boolean;
286
+ protected readonly texts: NgDocPlaygroundTexts;
287
+ private readonly injector;
288
+ private readonly outlet;
289
+ private readonly window;
290
+ private readonly playground?;
291
+ private reference?;
292
+ constructor();
293
+ /**
294
+ * Creates the target with the first state, and reports its defaults once it has rendered.
295
+ * @param state
296
+ */
297
+ private start;
298
+ /**
299
+ * Creates the target and sets the state; reports a failure instead of throwing.
300
+ * @param state
301
+ */
302
+ private create;
303
+ /**
304
+ * Applies a state to the existing target, or creates it again when the state asks to.
305
+ * @param state
306
+ */
307
+ private apply;
308
+ private setState;
309
+ /** The state of the URL fragment; a malformed one is reported and reads as `undefined`. */
310
+ private readState;
311
+ private applied;
312
+ private post;
313
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgDocPlaygroundHostComponent, never>;
314
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgDocPlaygroundHostComponent, "ng-doc-playground-host", never, {}, {}, never, never, true, never>;
133
315
  }
134
316
 
135
317
  interface NgDocPlaygroundPropertyControl {
@@ -143,6 +325,7 @@ interface NgDocPlaygroundPropertyControl {
143
325
  * 640px) the Recreate setting and a control per input and content slot.
144
326
  */
145
327
  declare class NgDocPlaygroundPropertiesComponent<P extends NgDocPlaygroundProperties, C extends Record<string, NgDocPlaygroundContent>> {
328
+ protected readonly texts: NgDocPlaygroundTexts;
146
329
  private readonly injector;
147
330
  /** The form of the playground. */
148
331
  readonly form: _angular_core.InputSignal<FormGroup<NgDocPlaygroundForm>>;
@@ -154,6 +337,11 @@ declare class NgDocPlaygroundPropertiesComponent<P extends NgDocPlaygroundProper
154
337
  readonly dynamicContent: _angular_core.InputSignal<C | undefined>;
155
338
  /** Default values of the inputs; the inspector renders once they are known. */
156
339
  readonly defaultValues: _angular_core.InputSignal<Record<string, unknown> | undefined>;
340
+ /**
341
+ * Whether the demos render before the defaults are known: an isolated playground's iframes
342
+ * report them, so they must render first. The controls render once the defaults are known.
343
+ */
344
+ readonly waitingForDefaults: _angular_core.InputSignal<boolean>;
157
345
  /** Whether the inspector is hidden, leaving the demos only. */
158
346
  readonly hideSidePanel: _angular_core.InputSignal<boolean>;
159
347
  /** Where the inspector goes: right of the demos, or below them at full width. */
@@ -183,9 +371,18 @@ declare class NgDocPlaygroundPropertiesComponent<P extends NgDocPlaygroundProper
183
371
  getFormControl(controlType: keyof NgDocPlaygroundForm, key: string): FormControl;
184
372
  private getTypeControl;
185
373
  private getControlForType;
374
+ /**
375
+ * The control of the values of a union, when every option is a value: the select of a union
376
+ * (`NgDocTypeAlias`) or the multi-select of an array of one (`NgDocTypeAlias[]`). An optional
377
+ * array input without such options has the members of its own union (`undefined` and the array
378
+ * type), and the text of an array type is not a value of an item.
379
+ * @param options - The options of the input.
380
+ * @param isManual - Whether the options come from the playground's `controls`.
381
+ * @param controlType - The type the control is registered for.
382
+ */
186
383
  private getControlForTypeAlias;
187
384
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NgDocPlaygroundPropertiesComponent<any, any>, never>;
188
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgDocPlaygroundPropertiesComponent<any, any>, "ng-doc-playground-properties", never, { "form": { "alias": "form"; "required": true; "isSignal": true; }; "properties": { "alias": "properties"; "required": false; "isSignal": true; }; "ignoreInputs": { "alias": "ignoreInputs"; "required": false; "isSignal": true; }; "dynamicContent": { "alias": "dynamicContent"; "required": false; "isSignal": true; }; "defaultValues": { "alias": "defaultValues"; "required": false; "isSignal": true; }; "hideSidePanel": { "alias": "hideSidePanel"; "required": false; "isSignal": true; }; "inspectorPosition": { "alias": "inspectorPosition"; "required": false; "isSignal": true; }; "recreateDemo": { "alias": "recreateDemo"; "required": false; "isSignal": true; }; "recreateLocked": { "alias": "recreateLocked"; "required": false; "isSignal": true; }; "showResetButton": { "alias": "showResetButton"; "required": false; "isSignal": true; }; }, { "recreateDemo": "recreateDemoChange"; "resetForm": "resetForm"; }, never, ["*"], true, never>;
385
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgDocPlaygroundPropertiesComponent<any, any>, "ng-doc-playground-properties", never, { "form": { "alias": "form"; "required": true; "isSignal": true; }; "properties": { "alias": "properties"; "required": false; "isSignal": true; }; "ignoreInputs": { "alias": "ignoreInputs"; "required": false; "isSignal": true; }; "dynamicContent": { "alias": "dynamicContent"; "required": false; "isSignal": true; }; "defaultValues": { "alias": "defaultValues"; "required": false; "isSignal": true; }; "waitingForDefaults": { "alias": "waitingForDefaults"; "required": false; "isSignal": true; }; "hideSidePanel": { "alias": "hideSidePanel"; "required": false; "isSignal": true; }; "inspectorPosition": { "alias": "inspectorPosition"; "required": false; "isSignal": true; }; "recreateDemo": { "alias": "recreateDemo"; "required": false; "isSignal": true; }; "recreateLocked": { "alias": "recreateLocked"; "required": false; "isSignal": true; }; "showResetButton": { "alias": "showResetButton"; "required": false; "isSignal": true; }; }, { "recreateDemo": "recreateDemoChange"; "resetForm": "resetForm"; }, never, ["*"], true, never>;
189
386
  }
190
387
  /** A titled list of controls in the inspector. */
191
388
  interface NgDocPlaygroundPropertySection {
@@ -228,5 +425,5 @@ declare class NgDocPlaygroundPropertyComponent {
228
425
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<NgDocPlaygroundPropertyComponent, "ng-doc-playground-property", never, { "name": { "alias": "name"; "required": false; "isSignal": true; }; "property": { "alias": "property"; "required": false; "isSignal": true; }; "typeControl": { "alias": "typeControl"; "required": false; "isSignal": true; }; "control": { "alias": "control"; "required": false; "isSignal": true; }; "defaultValue": { "alias": "defaultValue"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
229
426
  }
230
427
 
231
- export { NgDocBasePlayground, NgDocPlaygroundComponent, NgDocPlaygroundDemoComponent, NgDocPlaygroundPropertiesComponent, NgDocPlaygroundPropertyComponent };
232
- export type { NgDocPlaygroundForm, NgDocPlaygroundPropertyControl };
428
+ export { NgDocBasePlayground, NgDocPlaygroundComponent, NgDocPlaygroundDemoComponent, NgDocPlaygroundHostComponent, NgDocPlaygroundPropertiesComponent, NgDocPlaygroundPropertyComponent, ɵNG_DOC_PLAYGROUND_CONTAINER };
429
+ export type { NgDocPlaygroundForm, NgDocPlaygroundPropertyControl, ɵNgDocPlaygroundContainer, ɵNgDocPlaygroundFrame, ɵNgDocPlaygroundRouteData };
@@ -1,4 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
+ import { NgDocNavigationTexts } from '@ng-doc/app/interfaces';
2
3
  import { NgDocFullscreenRouteService } from '@ng-doc/app/services/fullscreen-route';
3
4
  import { NgDocSidebarService } from '@ng-doc/app/services/sidebar';
4
5
  import { NgDocContent, NgDocSidenavComponent } from '@ng-doc/ui-kit';
@@ -45,8 +46,15 @@ declare class NgDocCustomSidebarDirective {
45
46
  *
46
47
  * While a page shows one of its fullscreen routes (`NgDocFullscreenRouteService`), only the page
47
48
  * is shown: the navbar, the sidebar, the footer and the skip link are hidden.
49
+ *
50
+ * While it is shown, the router scrolls anchors below the navbar (the scroll offset of
51
+ * `ViewportScroller`), and the keyboard shortcuts of the documentation work
52
+ * (`NgDocShortcutsService`). When it is destroyed, for example when the reader leaves
53
+ * documentation served under a route, the previous scroll offset comes back and the shortcuts
54
+ * stop. Without navbar content, it renders no header.
48
55
  */
49
56
  declare class NgDocRootComponent {
57
+ protected readonly texts: NgDocNavigationTexts;
50
58
  /**
51
59
  * If `true` then the sidebar will be shown
52
60
  * You can use it for example for landing page to hide sidebar
@@ -64,7 +72,9 @@ declare class NgDocRootComponent {
64
72
  protected readonly sidebarService: NgDocSidebarService;
65
73
  protected readonly fullscreenRoute: NgDocFullscreenRouteService;
66
74
  private readonly document;
75
+ private readonly host;
67
76
  private readonly sidenavQuery;
77
+ constructor();
68
78
  /**
69
79
  * The sidenav that holds the sidebar and the page.
70
80
  */
@@ -74,6 +84,14 @@ declare class NgDocRootComponent {
74
84
  * @param event - The click on the skip link; its navigation to a fragment is cancelled.
75
85
  */
76
86
  skipToContent(event?: Event): void;
87
+ /**
88
+ * Makes the router scroll anchors below the layout's header, and below an application header
89
+ * that the layout makes room for.
90
+ * @returns A function that restores the previous offset, unless it was changed since.
91
+ */
92
+ private setScrollOffset;
93
+ /** The layout's top offset in pixels, read from the margin it gives the page area. */
94
+ private layoutTop;
77
95
  static ɵfac: i0.ɵɵFactoryDeclaration<NgDocRootComponent, never>;
78
96
  static ɵcmp: i0.ɵɵComponentDeclaration<NgDocRootComponent, "ng-doc-root", never, { "sidebar": { "alias": "sidebar"; "required": false; "isSignal": true; }; "footerContent": { "alias": "footerContent"; "required": false; "isSignal": true; }; "noWidthLimit": { "alias": "noWidthLimit"; "required": false; "isSignal": true; }; }, {}, never, ["ng-doc-navbar", "[ngDocCustomNavbar]", "ng-doc-sidebar", "[ngDocCustomSidebar]", "*"], true, never>;
79
97
  }
@@ -1,11 +1,13 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Signal } from '@angular/core';
3
+ import { NgDocSearchTexts } from '@ng-doc/app/interfaces';
3
4
  import { NgDocPageInfo } from '@ng-doc/core/interfaces';
4
5
 
5
6
  /**
6
7
  * A list of pages grouped by their type (guides and API).
7
8
  */
8
9
  declare class NgDocSearchResultComponent {
10
+ protected readonly texts: NgDocSearchTexts;
9
11
  /** The pages to list. */
10
12
  readonly result: i0.InputSignal<NgDocPageInfo[] | null>;
11
13
  /** The pages grouped by their type. */
@@ -1,5 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { NgDocSearchEngine } from '@ng-doc/app/classes';
3
+ import { NgDocSearchTexts } from '@ng-doc/app/interfaces';
3
4
  import { NgDocShortcutsService } from '@ng-doc/app/services/shortcuts';
4
5
  import { NgDocDialogService } from '@ng-doc/ui-kit';
5
6
 
@@ -12,6 +13,7 @@ declare class NgDocSearchComponent {
12
13
  protected readonly dialog: NgDocDialogService;
13
14
  protected readonly searchEngine: NgDocSearchEngine | null;
14
15
  protected readonly shortcuts: NgDocShortcutsService;
16
+ protected readonly texts: NgDocSearchTexts;
15
17
  /** The chord that opens the search, as the reader's platform labels it. */
16
18
  protected readonly chord: i0.WritableSignal<string>;
17
19
  private readonly document;
@@ -1,9 +1,10 @@
1
1
  import * as _ng_doc_app_interfaces from '@ng-doc/app/interfaces';
2
- import { NgDocNavigation } from '@ng-doc/app/interfaces';
2
+ import { NgDocNavigationTexts, NgDocNavigation } from '@ng-doc/app/interfaces';
3
3
  import { Location } from '@angular/common';
4
4
  import * as i0 from '@angular/core';
5
5
 
6
6
  declare class NgDocSidebarComponent {
7
+ protected readonly texts: NgDocNavigationTexts;
7
8
  protected readonly location: Location;
8
9
  protected readonly context: _ng_doc_app_interfaces.NgDocContext;
9
10
  getNavigation(nav?: NgDocNavigation): NgDocNavigation[];
@@ -1,9 +1,11 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Signal } from '@angular/core';
3
+ import { NgDocThemeTexts } from '@ng-doc/app/interfaces';
3
4
  import { NgDocThemeService } from '@ng-doc/app/services/theme';
4
5
 
5
6
  interface ToggleTheme {
6
- name: string;
7
+ /** The text of the theme's name. */
8
+ text: 'auto' | 'light' | 'dark';
7
9
  theme: string | null;
8
10
  }
9
11
  /**
@@ -13,6 +15,7 @@ interface ToggleTheme {
13
15
  */
14
16
  declare class NgDocThemeToggleComponent {
15
17
  protected readonly themeService: NgDocThemeService;
18
+ protected readonly texts: NgDocThemeTexts;
16
19
  /**
17
20
  * The current theme. A custom theme id counts as Auto, because the toggle does not offer it.
18
21
  */
@@ -1,6 +1,6 @@
1
1
  import * as _angular_core from '@angular/core';
2
2
  import { Signal, ElementRef } from '@angular/core';
3
- import { NgDocPageToc, NgDocTocItem } from '@ng-doc/app/interfaces';
3
+ import { NgDocPageToc, NgDocTocTexts, NgDocTocItem } from '@ng-doc/app/interfaces';
4
4
 
5
5
  /**
6
6
  * The "On this page" rail: the headings of the page, the section the reader is in, the reading
@@ -15,6 +15,7 @@ import { NgDocPageToc, NgDocTocItem } from '@ng-doc/app/interfaces';
15
15
  * While the rail exists, the L shortcut runs its Copy link action, so the rail confirms the copy.
16
16
  */
17
17
  declare class NgDocTocComponent implements NgDocPageToc {
18
+ protected readonly texts: NgDocTocTexts;
18
19
  /** The headings of the page. */
19
20
  readonly tableOfContent: _angular_core.InputSignal<NgDocTocItem[]>;
20
21
  /** URL where the reader can edit the page source. Without it, the rail has no Edit action. */
@@ -1,3 +1,13 @@
1
+ /**
2
+ * The window event that the NgDoc development client of the Vite host dispatches when a commit
3
+ * changed only generated content modules (and the search index). Its `detail` holds the new
4
+ * `payloads` of the changed content modules and whether the `search` index changed. A page that
5
+ * applies it calls `preventDefault()`; the client reloads the page when nobody does, so a page
6
+ * without the NgDoc runtime still shows the new content.
7
+ * @internal
8
+ */
9
+ declare const ɵNG_DOC_CONTENT_UPDATE_EVENT = "ng-doc:content-update";
10
+
1
11
  declare const NG_DOC_STORE_THEME_KEY: string;
2
12
 
3
- export { NG_DOC_STORE_THEME_KEY };
13
+ export { NG_DOC_STORE_THEME_KEY, ɵNG_DOC_CONTENT_UPDATE_EVENT };