@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
@@ -1 +1 @@
1
- {"version":3,"file":"ng-doc-app-components-kind-icon.mjs","sources":["../../../../libs/app/components/kind-icon/kind-icon.component.ts","../../../../libs/app/components/kind-icon/ng-doc-app-components-kind-icon.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, HostBinding, Input } from '@angular/core';\n\n@Component({\n selector: 'ng-doc-kind-icon',\n template: '{{kind[0]}}',\n styleUrls: ['./kind-icon.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: true,\n})\nexport class NgDocKindIconComponent {\n @Input()\n @HostBinding('attr.data-ng-doc-kind')\n kind: string = '';\n\n @Input()\n @HostBinding('attr.data-ng-doc-type')\n type: 'declaration' | 'type' = 'declaration';\n\n @Input()\n @HostBinding('attr.data-ng-doc-size')\n size: 'small' | 'medium' = 'small';\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MASa,sBAAsB,CAAA;AAPnC,IAAA,WAAA,GAAA;QAUE,IAAA,CAAA,IAAI,GAAW,EAAE;QAIjB,IAAA,CAAA,IAAI,GAA2B,aAAa;QAI5C,IAAA,CAAA,IAAI,GAAuB,OAAO;AACnC,IAAA;8GAZY,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAtB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,sBAAsB,8QALvB,aAAa,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,ixFAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAKZ,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAPlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,kBAAkB,YAClB,aAAa,EAAA,eAAA,EAEN,uBAAuB,CAAC,MAAM,cACnC,IAAI,EAAA,MAAA,EAAA,CAAA,ixFAAA,CAAA,EAAA;;sBAGf;;sBACA,WAAW;uBAAC,uBAAuB;;sBAGnC;;sBACA,WAAW;uBAAC,uBAAuB;;sBAGnC;;sBACA,WAAW;uBAAC,uBAAuB;;;ACnBtC;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-doc-app-components-kind-icon.mjs","sources":["../../../../libs/app/components/kind-icon/kind-icon.component.ts","../../../../libs/app/components/kind-icon/ng-doc-app-components-kind-icon.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, input, Signal } from '@angular/core';\n\n/**\n * Words the kind chips show for declaration kinds whose name is not already a readable word.\n * Other kinds (and value types) are shown as they are.\n */\nexport const NG_DOC_KIND_LABELS: Readonly<Record<string, string>> = {\n TypeAlias: 'Type alias',\n};\n\n/**\n * The label a kind chip shows for a kind.\n * @param kind - Declaration kind (for example `Class` or `TypeAlias`) or value type (`string`).\n * @returns The word to show, for example \"Type alias\".\n */\nexport function ngDocKindLabel(kind: string): string {\n return NG_DOC_KIND_LABELS[kind] ?? kind;\n}\n\n/**\n * A word chip for a declaration kind (`Class`, `Component`, `Type alias`, ...) or a value type\n * (`string`, `boolean`, ...), coloured by the kind.\n */\n@Component({\n selector: 'ng-doc-kind-icon',\n template: '{{ label() }}',\n styleUrls: ['./kind-icon.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.data-ng-doc-kind]': 'kind()',\n '[attr.data-ng-doc-type]': 'type()',\n '[attr.data-ng-doc-size]': 'size()',\n },\n})\nexport class NgDocKindIconComponent {\n /** Declaration kind or value type. */\n readonly kind = input<string>('');\n\n /** Whether `kind` is a declaration kind or a value type; it selects the colours. */\n readonly type = input<'declaration' | 'type'>('declaration');\n\n /** `small` is the compact chip; `medium` the regular one. */\n readonly size = input<'small' | 'medium'>('small');\n\n /** The word the chip shows. */\n protected readonly label: Signal<string> = computed(() => ngDocKindLabel(this.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yBAAyB,EAAE,QAAQ;AACnC,wBAAA,yBAAyB,EAAE,QAAQ;AACpC,qBAAA,EAAA,MAAA,EAAA,CAAA,s+FAAA,CAAA,EAAA;;;AChCH;;AAEG;;;;"}
@@ -1,20 +1,23 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Input, ChangeDetectionStrategy, Component } from '@angular/core';
2
+ import { input, ChangeDetectionStrategy, Component } from '@angular/core';
3
3
  import { RouterLink } from '@angular/router';
4
4
 
5
+ /**
6
+ * Router link to a path of the application.
7
+ */
5
8
  class NgDocLinkComponent {
6
9
  constructor() {
7
- this.path = '';
10
+ /** The path to link to. */
11
+ this.path = input('', /* @ts-ignore */
12
+ ...(ngDevMode ? [{ debugName: "path" }] : /* istanbul ignore next */ []));
8
13
  }
9
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocLinkComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
10
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: NgDocLinkComponent, isStandalone: true, selector: "ng-doc-link", inputs: { path: "path" }, ngImport: i0, template: "<a [routerLink]=\"[path]\">\n\t<ng-content></ng-content>\n</a>\n", styles: [""], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
14
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocLinkComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
15
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.2.1", type: NgDocLinkComponent, isStandalone: true, selector: "ng-doc-link", inputs: { path: { classPropertyName: "path", publicName: "path", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<a [routerLink]=\"[path()]\">\n <ng-content></ng-content>\n</a>\n", styles: [""], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
11
16
  }
12
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocLinkComponent, decorators: [{
17
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocLinkComponent, decorators: [{
13
18
  type: Component,
14
- args: [{ selector: 'ng-doc-link', changeDetection: ChangeDetectionStrategy.OnPush, imports: [RouterLink], template: "<a [routerLink]=\"[path]\">\n\t<ng-content></ng-content>\n</a>\n" }]
15
- }], propDecorators: { path: [{
16
- type: Input
17
- }] } });
19
+ args: [{ selector: 'ng-doc-link', changeDetection: ChangeDetectionStrategy.OnPush, imports: [RouterLink], template: "<a [routerLink]=\"[path()]\">\n <ng-content></ng-content>\n</a>\n" }]
20
+ }], propDecorators: { path: [{ type: i0.Input, args: [{ isSignal: true, alias: "path", required: false }] }] } });
18
21
 
19
22
  /**
20
23
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"ng-doc-app-components-link.mjs","sources":["../../../../libs/app/components/link/link.component.ts","../../../../libs/app/components/link/link.component.html","../../../../libs/app/components/link/ng-doc-app-components-link.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, Input } from '@angular/core';\nimport { RouterLink } from '@angular/router';\n\n@Component({\n selector: 'ng-doc-link',\n templateUrl: './link.component.html',\n styleUrls: ['./link.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [RouterLink],\n})\nexport class NgDocLinkComponent {\n @Input()\n path: string = '';\n}\n","<a [routerLink]=\"[path]\">\n\t<ng-content></ng-content>\n</a>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAUa,kBAAkB,CAAA;AAP/B,IAAA,WAAA,GAAA;QASE,IAAA,CAAA,IAAI,GAAW,EAAE;AAClB,IAAA;8GAHY,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAlB,kBAAkB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECV/B,kEAGA,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDKY,UAAU,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,QAAA,EAAA,aAAA,EAAA,UAAA,EAAA,qBAAA,EAAA,OAAA,EAAA,MAAA,EAAA,YAAA,EAAA,kBAAA,EAAA,oBAAA,EAAA,YAAA,EAAA,YAAA,EAAA,YAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAET,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAP9B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,aAAa,mBAGN,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC,CAAC,UAAU,CAAC,EAAA,QAAA,EAAA,kEAAA,EAAA;;sBAGpB;;;AEXH;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-doc-app-components-link.mjs","sources":["../../../../libs/app/components/link/link.component.ts","../../../../libs/app/components/link/link.component.html","../../../../libs/app/components/link/ng-doc-app-components-link.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { RouterLink } from '@angular/router';\n\n/**\n * Router link to a path of the application.\n */\n@Component({\n selector: 'ng-doc-link',\n templateUrl: './link.component.html',\n styleUrls: ['./link.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [RouterLink],\n})\nexport class NgDocLinkComponent {\n /** The path to link to. */\n readonly path = input<string>('');\n}\n","<a [routerLink]=\"[path()]\">\n <ng-content></ng-content>\n</a>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAGA;;AAEG;MAQU,kBAAkB,CAAA;AAP/B,IAAA,WAAA,GAAA;;QASW,IAAA,CAAA,IAAI,GAAG,KAAK,CAAS,EAAE;iFAAC;AAClC,IAAA;8GAHY,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAlB,kBAAkB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,EAAA,IAAA,EAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECb/B,oEAGA,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDQY,UAAU,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,QAAA,EAAA,aAAA,EAAA,UAAA,EAAA,qBAAA,EAAA,OAAA,EAAA,MAAA,EAAA,YAAA,EAAA,kBAAA,EAAA,oBAAA,EAAA,YAAA,EAAA,YAAA,EAAA,YAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAET,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAP9B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,aAAa,mBAGN,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC,CAAC,UAAU,CAAC,EAAA,QAAA,EAAA,oEAAA,EAAA;;;AEXvB;;AAEG;;;;"}
@@ -0,0 +1,30 @@
1
+ import * as i0 from '@angular/core';
2
+ import { ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import * as i1 from '@ng-doc/app/directives/members-filter';
4
+ import { NgDocMembersFilterDirective } from '@ng-doc/app/directives/members-filter';
5
+
6
+ /**
7
+ * The members table of an API page in the symbol view. The builder renders its tabs, filter and
8
+ * rows as the component's content, and the component adds the member filter to them.
9
+ */
10
+ class NgDocMembersComponent {
11
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocMembersComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
12
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.2.1", type: NgDocMembersComponent, isStandalone: true, selector: "ng-doc-members", host: { classAttribute: "ng-doc-members" }, hostDirectives: [{ directive: i1.NgDocMembersFilterDirective }], ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
13
+ }
14
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocMembersComponent, decorators: [{
15
+ type: Component,
16
+ args: [{
17
+ selector: 'ng-doc-members',
18
+ template: '<ng-content></ng-content>',
19
+ changeDetection: ChangeDetectionStrategy.OnPush,
20
+ hostDirectives: [NgDocMembersFilterDirective],
21
+ host: { class: 'ng-doc-members' },
22
+ }]
23
+ }] });
24
+
25
+ /**
26
+ * Generated bundle index. Do not edit.
27
+ */
28
+
29
+ export { NgDocMembersComponent };
30
+ //# sourceMappingURL=ng-doc-app-components-members.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ng-doc-app-components-members.mjs","sources":["../../../../libs/app/components/members/members.component.ts","../../../../libs/app/components/members/ng-doc-app-components-members.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { NgDocMembersFilterDirective } from '@ng-doc/app/directives/members-filter';\n\n/**\n * The members table of an API page in the symbol view. The builder renders its tabs, filter and\n * rows as the component's content, and the component adds the member filter to them.\n */\n@Component({\n selector: 'ng-doc-members',\n template: '<ng-content></ng-content>',\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [NgDocMembersFilterDirective],\n host: { class: 'ng-doc-members' },\n})\nexport class NgDocMembersComponent {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAGA;;;AAGG;MAQU,qBAAqB,CAAA;8GAArB,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAArB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,qBAAqB,uLALtB,2BAA2B,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAK1B,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAPjC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,QAAQ,EAAE,2BAA2B;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;oBAC/C,cAAc,EAAE,CAAC,2BAA2B,CAAC;AAC7C,oBAAA,IAAI,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE;AAClC,iBAAA;;;ACbD;;AAEG;;;;"}
@@ -1,14 +1,25 @@
1
- import { isPlatformBrowser } from '@angular/common';
1
+ import { DOCUMENT, isPlatformBrowser } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
- import { input, signal, inject, ChangeDetectorRef, PLATFORM_ID, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { input, signal, inject, PLATFORM_ID, effect, untracked, ChangeDetectionStrategy, Component } from '@angular/core';
4
+ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
4
5
  import { NgDocSanitizeHtmlPipe } from '@ng-doc/app/pipes';
5
6
  import { NgDocThemeService } from '@ng-doc/app/services/theme';
6
7
  import { NG_DOC_MERMAID } from '@ng-doc/app/tokens';
7
8
  import { NgDocMagnifierComponent, MagnifierControllerComponent, NgDocSpinnerComponent } from '@ng-doc/ui-kit';
8
9
 
9
10
  let id = 0;
11
+ /** The init directive that renders one graph with Mermaid's dark theme. */
12
+ const DARK_THEME_DIRECTIVE = '%%{init: {"theme": "dark"}}%%\n';
13
+ /**
14
+ * Renders a Mermaid graph in a zoomable, pannable viewer. The graph is rendered in the browser
15
+ * only, again when it changes and when the theme changes.
16
+ *
17
+ * In the dark theme (or `auto` with a dark OS theme) the graph uses Mermaid's dark theme, unless
18
+ * the graph or `provideMermaid` chooses a theme of its own.
19
+ */
10
20
  class NgDocMermaidViewerComponent {
11
21
  constructor() {
22
+ /** Source of the Mermaid graph. */
12
23
  this.graph = input.required(/* @ts-ignore */
13
24
  ...(ngDevMode ? [{ debugName: "graph" }] : /* istanbul ignore next */ []));
14
25
  this.html = signal('', /* @ts-ignore */
@@ -17,45 +28,75 @@ class NgDocMermaidViewerComponent {
17
28
  ...(ngDevMode ? [{ debugName: "pending" }] : /* istanbul ignore next */ []));
18
29
  this.error = signal(null, /* @ts-ignore */
19
30
  ...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
20
- this.changeDetectorRef = inject(ChangeDetectorRef);
21
- this.platform = inject(PLATFORM_ID);
22
31
  this.id = `ng-doc-mermaid-viewer-${id++}`;
32
+ // Renders are asynchronous: only the result of the latest one is shown.
33
+ this.renderId = 0;
34
+ this.document = inject(DOCUMENT);
35
+ this.themeService = inject(NgDocThemeService);
23
36
  const mermaid = inject(NG_DOC_MERMAID, { optional: true });
24
37
  if (!mermaid) {
25
38
  throw new Error('Mermaid is not provided. Make sure that you provided mermaid using "provideMermaid" function.');
26
39
  }
27
40
  this.mermaid = mermaid;
28
- inject(NgDocThemeService)
29
- .themeChanges()
30
- .subscribe(async () => {
31
- const { svg } = await this.mermaid.render(this.id, this.graph());
32
- this.html.set(svg);
33
- });
41
+ if (isPlatformBrowser(inject(PLATFORM_ID))) {
42
+ effect(() => {
43
+ const graph = this.graph();
44
+ untracked(() => void this.render(graph));
45
+ });
46
+ this.themeService
47
+ .themeChanges()
48
+ .pipe(takeUntilDestroyed())
49
+ .subscribe(() => void this.render(untracked(this.graph)));
50
+ }
51
+ }
52
+ /**
53
+ * Adds Mermaid's dark theme to the graph when the page is dark. A graph with front matter or an
54
+ * init directive, and a theme set in `provideMermaid`, are left as they are.
55
+ * @param graph - The graph source.
56
+ * @returns The graph to render.
57
+ */
58
+ themed(graph) {
59
+ const theme = this.themeService.currentTheme;
60
+ const dark = theme === 'dark' ||
61
+ (theme === 'auto' &&
62
+ !!this.document.defaultView?.matchMedia?.('(prefers-color-scheme: dark)').matches);
63
+ const configuredTheme = this.mermaid.mermaidAPI?.getSiteConfig?.().theme;
64
+ const ownTheme = /^\s*---/.test(graph) || /%%\{\s*init/.test(graph);
65
+ return dark && !ownTheme && (!configuredTheme || configuredTheme === 'default')
66
+ ? DARK_THEME_DIRECTIVE + graph
67
+ : graph;
34
68
  }
35
- async ngOnInit() {
36
- if (isPlatformBrowser(this.platform)) {
37
- try {
38
- const { svg } = await this.mermaid.render(this.id, this.graph());
69
+ async render(graph) {
70
+ const renderId = ++this.renderId;
71
+ try {
72
+ const { svg } = await this.mermaid.render(this.id, this.themed(graph));
73
+ if (renderId === this.renderId) {
39
74
  this.html.set(svg);
40
- this.pending.set(false);
75
+ this.error.set(null);
41
76
  }
42
- catch (error) {
77
+ }
78
+ catch (error) {
79
+ if (renderId === this.renderId) {
43
80
  this.error.set(error);
81
+ }
82
+ }
83
+ finally {
84
+ if (renderId === this.renderId) {
44
85
  this.pending.set(false);
45
86
  }
46
87
  }
47
88
  }
48
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocMermaidViewerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
49
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: NgDocMermaidViewerComponent, isStandalone: true, selector: "ng-doc-mermaid-viewer", inputs: { graph: { classPropertyName: "graph", publicName: "graph", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@if (pending()) {\n <div class=\"ng-doc-mermaid-preloader\">\n <ng-doc-spinner></ng-doc-spinner>\n </div>\n} @else if (error()) {\n <div class=\"ng-doc-mermaid-error\">{{ error() }}</div>\n} @else {\n <ng-doc-magnifier #magnifier>\n <div class=\"ng-doc-mermaid-container\" [innerHTML]=\"html() | ngDocSanitizeHtml\"></div>\n </ng-doc-magnifier>\n\n <ng-doc-magnifier-controller [magnifier]=\"magnifier\" />\n}\n", styles: [":host{position:relative;display:block;border:var(--ng-doc-mermaid-viewer-border, 1px solid var(--ng-doc-border-color));margin:var(--ng-doc-mermaid-viewer-margin, var(--ng-doc-page-block-margin));background:var(--ng-doc-mermaid-viewer-background, var(--ng-doc-base-8));border-radius:var(--ng-doc-mermaid-viewer-border-radius, var(--ng-doc-base-gutter));min-height:150px}:host ng-doc-magnifier-controller{position:absolute;bottom:calc(var(--ng-doc-base-gutter) * 2);right:calc(var(--ng-doc-base-gutter) * 2)}:host .ng-doc-mermaid-container{display:flex;justify-content:center;align-items:center;padding:calc(var(--ng-doc-base-gutter) * 2)}:host .ng-doc-mermaid-preloader{display:flex;justify-content:center;align-items:center;width:100%;height:120px}:host .ng-doc-mermaid-error{display:flex;justify-content:center;align-items:center;height:120px;color:var(--ng-doc-alert)}\n"], dependencies: [{ kind: "component", type: NgDocMagnifierComponent, selector: "ng-doc-magnifier" }, { kind: "component", type: MagnifierControllerComponent, selector: "ng-doc-magnifier-controller", inputs: ["magnifier"] }, { kind: "component", type: NgDocSpinnerComponent, selector: "ng-doc-spinner", inputs: ["size"] }, { kind: "pipe", type: NgDocSanitizeHtmlPipe, name: "ngDocSanitizeHtml" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
89
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocMermaidViewerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
90
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: NgDocMermaidViewerComponent, isStandalone: true, selector: "ng-doc-mermaid-viewer", inputs: { graph: { classPropertyName: "graph", publicName: "graph", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@if (pending()) {\n <div class=\"ng-doc-mermaid-preloader\">\n <ng-doc-spinner></ng-doc-spinner>\n </div>\n} @else if (error()) {\n <div class=\"ng-doc-mermaid-error\">{{ error() }}</div>\n} @else {\n <ng-doc-magnifier #magnifier>\n <div class=\"ng-doc-mermaid-container\" [innerHTML]=\"html() | ngDocSanitizeHtml\"></div>\n </ng-doc-magnifier>\n\n <ng-doc-magnifier-controller [magnifier]=\"magnifier\" />\n}\n", styles: [":host{position:relative;display:block;border:var(--ng-doc-mermaid-viewer-border, 1px solid var(--ng-doc-border-color));margin:var(--ng-doc-mermaid-viewer-margin, var(--ng-doc-page-block-margin));background:var(--ng-doc-mermaid-viewer-background, var(--ng-doc-code-background));border-radius:var(--ng-doc-mermaid-viewer-border-radius, var(--ng-doc-radius-lg));overflow:hidden;min-height:150px}:host ng-doc-magnifier-controller{position:absolute;bottom:var(--ng-doc-space-4);right:var(--ng-doc-space-4);opacity:0;transition:opacity var(--ng-doc-transition)}@media(prefers-reduced-motion:reduce){:host ng-doc-magnifier-controller{transition:none}}@media(hover:none){:host ng-doc-magnifier-controller{opacity:1}}:host:hover ng-doc-magnifier-controller,:host:focus-within ng-doc-magnifier-controller{opacity:1}:host .ng-doc-mermaid-container{display:flex;justify-content:center;align-items:center;padding:calc(var(--ng-doc-base-gutter) * 2)}:host .ng-doc-mermaid-preloader{display:flex;justify-content:center;align-items:center;width:100%;height:120px}:host .ng-doc-mermaid-error{display:flex;justify-content:center;align-items:center;height:120px;color:var(--ng-doc-alert)}\n"], dependencies: [{ kind: "component", type: NgDocMagnifierComponent, selector: "ng-doc-magnifier" }, { kind: "component", type: MagnifierControllerComponent, selector: "ng-doc-magnifier-controller", inputs: ["magnifier"] }, { kind: "component", type: NgDocSpinnerComponent, selector: "ng-doc-spinner", inputs: ["size"] }, { kind: "pipe", type: NgDocSanitizeHtmlPipe, name: "ngDocSanitizeHtml" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
50
91
  }
51
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocMermaidViewerComponent, decorators: [{
92
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocMermaidViewerComponent, decorators: [{
52
93
  type: Component,
53
94
  args: [{ selector: 'ng-doc-mermaid-viewer', imports: [
54
95
  NgDocMagnifierComponent,
55
96
  MagnifierControllerComponent,
56
97
  NgDocSanitizeHtmlPipe,
57
98
  NgDocSpinnerComponent,
58
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (pending()) {\n <div class=\"ng-doc-mermaid-preloader\">\n <ng-doc-spinner></ng-doc-spinner>\n </div>\n} @else if (error()) {\n <div class=\"ng-doc-mermaid-error\">{{ error() }}</div>\n} @else {\n <ng-doc-magnifier #magnifier>\n <div class=\"ng-doc-mermaid-container\" [innerHTML]=\"html() | ngDocSanitizeHtml\"></div>\n </ng-doc-magnifier>\n\n <ng-doc-magnifier-controller [magnifier]=\"magnifier\" />\n}\n", styles: [":host{position:relative;display:block;border:var(--ng-doc-mermaid-viewer-border, 1px solid var(--ng-doc-border-color));margin:var(--ng-doc-mermaid-viewer-margin, var(--ng-doc-page-block-margin));background:var(--ng-doc-mermaid-viewer-background, var(--ng-doc-base-8));border-radius:var(--ng-doc-mermaid-viewer-border-radius, var(--ng-doc-base-gutter));min-height:150px}:host ng-doc-magnifier-controller{position:absolute;bottom:calc(var(--ng-doc-base-gutter) * 2);right:calc(var(--ng-doc-base-gutter) * 2)}:host .ng-doc-mermaid-container{display:flex;justify-content:center;align-items:center;padding:calc(var(--ng-doc-base-gutter) * 2)}:host .ng-doc-mermaid-preloader{display:flex;justify-content:center;align-items:center;width:100%;height:120px}:host .ng-doc-mermaid-error{display:flex;justify-content:center;align-items:center;height:120px;color:var(--ng-doc-alert)}\n"] }]
99
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (pending()) {\n <div class=\"ng-doc-mermaid-preloader\">\n <ng-doc-spinner></ng-doc-spinner>\n </div>\n} @else if (error()) {\n <div class=\"ng-doc-mermaid-error\">{{ error() }}</div>\n} @else {\n <ng-doc-magnifier #magnifier>\n <div class=\"ng-doc-mermaid-container\" [innerHTML]=\"html() | ngDocSanitizeHtml\"></div>\n </ng-doc-magnifier>\n\n <ng-doc-magnifier-controller [magnifier]=\"magnifier\" />\n}\n", styles: [":host{position:relative;display:block;border:var(--ng-doc-mermaid-viewer-border, 1px solid var(--ng-doc-border-color));margin:var(--ng-doc-mermaid-viewer-margin, var(--ng-doc-page-block-margin));background:var(--ng-doc-mermaid-viewer-background, var(--ng-doc-code-background));border-radius:var(--ng-doc-mermaid-viewer-border-radius, var(--ng-doc-radius-lg));overflow:hidden;min-height:150px}:host ng-doc-magnifier-controller{position:absolute;bottom:var(--ng-doc-space-4);right:var(--ng-doc-space-4);opacity:0;transition:opacity var(--ng-doc-transition)}@media(prefers-reduced-motion:reduce){:host ng-doc-magnifier-controller{transition:none}}@media(hover:none){:host ng-doc-magnifier-controller{opacity:1}}:host:hover ng-doc-magnifier-controller,:host:focus-within ng-doc-magnifier-controller{opacity:1}:host .ng-doc-mermaid-container{display:flex;justify-content:center;align-items:center;padding:calc(var(--ng-doc-base-gutter) * 2)}:host .ng-doc-mermaid-preloader{display:flex;justify-content:center;align-items:center;width:100%;height:120px}:host .ng-doc-mermaid-error{display:flex;justify-content:center;align-items:center;height:120px;color:var(--ng-doc-alert)}\n"] }]
59
100
  }], ctorParameters: () => [], propDecorators: { graph: [{ type: i0.Input, args: [{ isSignal: true, alias: "graph", required: true }] }] } });
60
101
 
61
102
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ng-doc-app-components-mermaid-viewer.mjs","sources":["../../../../libs/app/components/mermaid-viewer/mermaid-viewer.component.ts","../../../../libs/app/components/mermaid-viewer/mermaid-viewer.component.html","../../../../libs/app/components/mermaid-viewer/ng-doc-app-components-mermaid-viewer.ts"],"sourcesContent":["import { isPlatformBrowser } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n inject,\n input,\n OnInit,\n PLATFORM_ID,\n signal,\n} from '@angular/core';\nimport { NgDocSanitizeHtmlPipe } from '@ng-doc/app/pipes';\nimport { NgDocThemeService } from '@ng-doc/app/services/theme';\nimport { NG_DOC_MERMAID } from '@ng-doc/app/tokens';\nimport {\n MagnifierControllerComponent,\n NgDocMagnifierComponent,\n NgDocSpinnerComponent,\n} from '@ng-doc/ui-kit';\nimport type { Mermaid } from 'mermaid';\n\nlet id = 0;\n\n@Component({\n selector: 'ng-doc-mermaid-viewer',\n imports: [\n NgDocMagnifierComponent,\n MagnifierControllerComponent,\n NgDocSanitizeHtmlPipe,\n NgDocSpinnerComponent,\n ],\n templateUrl: './mermaid-viewer.component.html',\n styleUrl: './mermaid-viewer.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgDocMermaidViewerComponent implements OnInit {\n graph = input.required<string>();\n\n protected readonly html = signal('');\n protected readonly pending = signal(true);\n protected readonly error = signal<Error | null>(null);\n protected readonly mermaid: Mermaid;\n\n protected readonly changeDetectorRef = inject(ChangeDetectorRef);\n protected readonly platform = inject(PLATFORM_ID);\n\n protected readonly id = `ng-doc-mermaid-viewer-${id++}`;\n\n constructor() {\n const mermaid = inject(NG_DOC_MERMAID, { optional: true });\n\n if (!mermaid) {\n throw new Error(\n 'Mermaid is not provided. Make sure that you provided mermaid using \"provideMermaid\" function.',\n );\n }\n\n this.mermaid = mermaid;\n\n inject(NgDocThemeService)\n .themeChanges()\n .subscribe(async () => {\n const { svg } = await this.mermaid.render(this.id, this.graph());\n\n this.html.set(svg);\n });\n }\n\n async ngOnInit(): Promise<void> {\n if (isPlatformBrowser(this.platform)) {\n try {\n const { svg } = await this.mermaid.render(this.id, this.graph());\n\n this.html.set(svg);\n this.pending.set(false);\n } catch (error: unknown) {\n this.error.set(error as Error);\n this.pending.set(false);\n }\n }\n }\n}\n","@if (pending()) {\n <div class=\"ng-doc-mermaid-preloader\">\n <ng-doc-spinner></ng-doc-spinner>\n </div>\n} @else if (error()) {\n <div class=\"ng-doc-mermaid-error\">{{ error() }}</div>\n} @else {\n <ng-doc-magnifier #magnifier>\n <div class=\"ng-doc-mermaid-container\" [innerHTML]=\"html() | ngDocSanitizeHtml\"></div>\n </ng-doc-magnifier>\n\n <ng-doc-magnifier-controller [magnifier]=\"magnifier\" />\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAqBA,IAAI,EAAE,GAAG,CAAC;MAcG,2BAA2B,CAAA;AAatC,IAAA,WAAA,GAAA;QAZA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAC,QAAQ;kFAAU;QAEb,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,EAAE;iFAAC;QACjB,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,I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,EAAA,MAAA,EAAA,CAAA,02BAAA,CAAA,EAAA;;;AEjCjD;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-doc-app-components-mermaid-viewer.mjs","sources":["../../../../libs/app/components/mermaid-viewer/mermaid-viewer.component.ts","../../../../libs/app/components/mermaid-viewer/mermaid-viewer.component.html","../../../../libs/app/components/mermaid-viewer/ng-doc-app-components-mermaid-viewer.ts"],"sourcesContent":["import { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n effect,\n inject,\n input,\n PLATFORM_ID,\n signal,\n untracked,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { NgDocSanitizeHtmlPipe } from '@ng-doc/app/pipes';\nimport { NgDocThemeService } from '@ng-doc/app/services/theme';\nimport { NG_DOC_MERMAID } from '@ng-doc/app/tokens';\nimport {\n MagnifierControllerComponent,\n NgDocMagnifierComponent,\n NgDocSpinnerComponent,\n} from '@ng-doc/ui-kit';\nimport type { Mermaid } from 'mermaid';\n\nlet id = 0;\n\n/** The init directive that renders one graph with Mermaid's dark theme. */\nconst DARK_THEME_DIRECTIVE = '%%{init: {\"theme\": \"dark\"}}%%\\n';\n\n/**\n * Renders a Mermaid graph in a zoomable, pannable viewer. The graph is rendered in the browser\n * only, again when it changes and when the theme changes.\n *\n * In the dark theme (or `auto` with a dark OS theme) the graph uses Mermaid's dark theme, unless\n * the graph or `provideMermaid` chooses a theme of its own.\n */\n@Component({\n selector: 'ng-doc-mermaid-viewer',\n imports: [\n NgDocMagnifierComponent,\n MagnifierControllerComponent,\n NgDocSanitizeHtmlPipe,\n NgDocSpinnerComponent,\n ],\n templateUrl: './mermaid-viewer.component.html',\n styleUrl: './mermaid-viewer.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgDocMermaidViewerComponent {\n /** Source of the Mermaid graph. */\n readonly graph = input.required<string>();\n\n protected readonly html = signal('');\n protected readonly pending = signal(true);\n protected readonly error = signal<Error | null>(null);\n protected readonly mermaid: Mermaid;\n\n protected readonly id = `ng-doc-mermaid-viewer-${id++}`;\n\n // Renders are asynchronous: only the result of the latest one is shown.\n private renderId = 0;\n\n private readonly document = inject(DOCUMENT);\n private readonly themeService = inject(NgDocThemeService);\n\n constructor() {\n const mermaid = inject(NG_DOC_MERMAID, { optional: true });\n\n if (!mermaid) {\n throw new Error(\n 'Mermaid is not provided. Make sure that you provided mermaid using \"provideMermaid\" function.',\n );\n }\n\n this.mermaid = mermaid;\n\n if (isPlatformBrowser(inject(PLATFORM_ID))) {\n effect(() => {\n const graph: string = this.graph();\n\n untracked(() => void this.render(graph));\n });\n\n this.themeService\n .themeChanges()\n .pipe(takeUntilDestroyed())\n .subscribe(() => void this.render(untracked(this.graph)));\n }\n }\n\n /**\n * Adds Mermaid's dark theme to the graph when the page is dark. A graph with front matter or an\n * init directive, and a theme set in `provideMermaid`, are left as they are.\n * @param graph - The graph source.\n * @returns The graph to render.\n */\n private themed(graph: string): string {\n const theme = this.themeService.currentTheme;\n const dark =\n theme === 'dark' ||\n (theme === 'auto' &&\n !!this.document.defaultView?.matchMedia?.('(prefers-color-scheme: dark)').matches);\n const configuredTheme = this.mermaid.mermaidAPI?.getSiteConfig?.().theme;\n const ownTheme = /^\\s*---/.test(graph) || /%%\\{\\s*init/.test(graph);\n\n return dark && !ownTheme && (!configuredTheme || configuredTheme === 'default')\n ? DARK_THEME_DIRECTIVE + graph\n : graph;\n }\n\n private async render(graph: string): Promise<void> {\n const renderId: number = ++this.renderId;\n\n try {\n const { svg } = await this.mermaid.render(this.id, this.themed(graph));\n\n if (renderId === this.renderId) {\n this.html.set(svg);\n this.error.set(null);\n }\n } catch (error: unknown) {\n if (renderId === this.renderId) {\n this.error.set(error as Error);\n }\n } finally {\n if (renderId === this.renderId) {\n this.pending.set(false);\n }\n }\n }\n}\n","@if (pending()) {\n <div class=\"ng-doc-mermaid-preloader\">\n <ng-doc-spinner></ng-doc-spinner>\n </div>\n} @else if (error()) {\n <div class=\"ng-doc-mermaid-error\">{{ error() }}</div>\n} @else {\n <ng-doc-magnifier #magnifier>\n <div class=\"ng-doc-mermaid-container\" [innerHTML]=\"html() | ngDocSanitizeHtml\"></div>\n </ng-doc-magnifier>\n\n <ng-doc-magnifier-controller [magnifier]=\"magnifier\" />\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAsBA,IAAI,EAAE,GAAG,CAAC;AAEV;AACA,MAAM,oBAAoB,GAAG,iCAAiC;AAE9D;;;;;;AAMG;MAaU,2BAA2B,CAAA;AAiBtC,IAAA,WAAA,GAAA;;QAfS,IAAA,CAAA,KAAK,GAAG,KAAK,CAAC,QAAQ;kFAAU;QAEtB,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,EAAE;iFAAC;QACjB,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,IAAI;oFAAC;QACtB,IAAA,CAAA,KAAK,GAAG,MAAM,CAAe,IAAI;kFAAC;AAGlC,QAAA,IAAA,CAAA,EAAE,GAAG,CAAA,sBAAA,EAAyB,EAAE,EAAE,EAAE;;QAG/C,IAAA,CAAA,QAAQ,GAAG,CAAC;AAEH,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAGvD,QAAA,MAAM,OAAO,GAAG,MAAM,CAAC,cAAc,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QAE1D,IAAI,CAAC,OAAO,EAAE;AACZ,YAAA,MAAM,IAAI,KAAK,CACb,+FAA+F,CAChG;QACH;AAEA,QAAA,IAAI,CAAC,OAAO,GAAG,OAAO;QAEtB,IAAI,iBAAiB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE;YAC1C,MAAM,CAAC,MAAK;AACV,gBAAA,MAAM,KAAK,GAAW,IAAI,CAAC,KAA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AA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAOZ,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAZvC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,uBAAuB,EAAA,OAAA,EACxB;wBACP,uBAAuB;wBACvB,4BAA4B;wBAC5B,qBAAqB;wBACrB,qBAAqB;qBACtB,EAAA,eAAA,EAGgB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,yaAAA,EAAA,MAAA,EAAA,CAAA,qpCAAA,CAAA,EAAA;;;AE5CjD;;AAEG;;;;"}
@@ -1,71 +1,61 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, NgZone, ChangeDetectorRef, DestroyRef, afterNextRender, HostBinding, Input, ChangeDetectionStrategy, Component } from '@angular/core';
3
- import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
2
+ import { inject, input, booleanAttribute, viewChild, ElementRef, ChangeDetectionStrategy, Component } from '@angular/core';
4
3
  import { NgDocSearchComponent } from '@ng-doc/app/components/search';
5
- import { NgDocSidebarService } from '@ng-doc/app/services';
6
- import { ngDocZoneOptimize, NgDocButtonIconComponent, NgDocIconComponent } from '@ng-doc/ui-kit';
7
- import { WA_WINDOW } from '@ng-web-apis/common';
8
- import { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
9
- import { combineLatest, fromEvent } from 'rxjs';
10
- import { map, distinctUntilChanged, startWith } from 'rxjs/operators';
4
+ import { NgDocSidebarService } from '@ng-doc/app/services/sidebar';
5
+ import { NgDocButtonIconComponent } from '@ng-doc/ui-kit';
11
6
 
12
7
  /**
13
- * Navbar component for ng-doc application
8
+ * Navbar of the NgDoc application: the header bar above the sidebar and the page.
9
+ *
10
+ * It lays out, from left to right: the menu button (only where the sidebar is an overlay), the
11
+ * content marked with `ngDocNavbarLeft` (for example the logo), the content marked with
12
+ * `ngDocNavbarCenter` (for example the section links, hidden at 1024px and below), the search, and
13
+ * the content marked with `ngDocNavbarRight` (for example the theme toggle).
14
+ * @example
15
+ * ```html
16
+ * <ng-doc-navbar>
17
+ * <a ngDocNavbarLeft routerLink="/">My library</a>
18
+ * <nav ngDocNavbarCenter aria-label="Primary"><a routerLink="/docs">Guides</a></nav>
19
+ * <ng-doc-theme-toggle ngDocNavbarRight />
20
+ * </ng-doc-navbar>
21
+ * ```
14
22
  */
15
23
  class NgDocNavbarComponent {
16
24
  constructor() {
17
- this.window = inject(WA_WINDOW);
18
- this.ngZone = inject(NgZone);
19
- this.changeDetectorRef = inject(ChangeDetectorRef);
20
25
  this.sidebarService = inject(NgDocSidebarService);
21
26
  /**
22
27
  * Show search input
23
28
  */
24
- this.search = true;
29
+ this.search = input(true, { ...(ngDevMode ? { debugName: "search" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
25
30
  /**
26
- * Show hamburger button
31
+ * Show the menu button that opens the sidebar where it is an overlay (900px and below).
27
32
  */
28
- this.hamburger = true;
33
+ this.hamburger = input(true, { ...(ngDevMode ? { debugName: "hamburger" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
29
34
  /**
30
35
  * Use glass effect for navbar
31
36
  */
32
- this.glassEffect = true;
33
- /**
34
- * Indicates if navbar has border
35
- */
36
- this.hasBorder = false;
37
- const destroyRef = inject(DestroyRef);
38
- afterNextRender(() => {
39
- combineLatest([
40
- fromEvent(this.window, 'scroll').pipe(map((e) => (e.target?.scrollingElement?.scrollTop ?? 0) > 0), distinctUntilChanged(), startWith(false), ngDocZoneOptimize(this.ngZone)),
41
- this.sidebarService.isExpanded(),
42
- ])
43
- .pipe(map(([scrolled, isExpanded]) => scrolled || (isExpanded && this.sidebarService.isMobile)), takeUntilDestroyed(destroyRef))
44
- .subscribe((hasShadow) => {
45
- this.hasBorder = hasShadow;
46
- this.changeDetectorRef.markForCheck();
47
- });
48
- });
37
+ this.glassEffect = input(true, { ...(ngDevMode ? { debugName: "glassEffect" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
38
+ this.menuButton = viewChild('menuButton', { ...(ngDevMode ? { debugName: "menuButton" } : /* istanbul ignore next */ {}), read: (ElementRef) });
39
+ }
40
+ /**
41
+ * Closes the sidebar overlay and moves focus back to the menu button that opened it.
42
+ */
43
+ closeSidebar() {
44
+ if (this.sidebarService.expandedState() && this.sidebarService.isMobile) {
45
+ this.sidebarService.hide();
46
+ this.menuButton()?.nativeElement.focus();
47
+ }
49
48
  }
50
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocNavbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
51
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: NgDocNavbarComponent, isStandalone: true, selector: "ng-doc-navbar", inputs: { search: "search", hamburger: "hamburger", glassEffect: "glassEffect" }, host: { properties: { "attr.data-glass-effect": "this.glassEffect", "class.has-border": "this.hasBorder" } }, ngImport: i0, template: "<div class=\"navbar-container\">\n <div class=\"ng-doc-navbar-left\">\n <ng-content select=\"[ngDocNavbarLeft]\"></ng-content>\n </div>\n <div class=\"ng-doc-navbar-right\">\n @if (search) {\n <ng-doc-search></ng-doc-search>\n }\n <ng-content select=\"[ngDocNavbarRight]\"></ng-content>\n <button class=\"ng-doc-menu\" ng-doc-button-icon size=\"large\" (click)=\"sidebarService.toggle()\">\n <ng-doc-icon icon=\"menu\" [size]=\"24\"></ng-doc-icon>\n </button>\n </div>\n</div>\n", styles: [":host:not([data-glass-effect=false]){background:color-mix(in srgb,var(--ng-doc-navbar-background) 60%,transparent);backdrop-filter:blur(20px)}@supports not ((-webkit-backdrop-filter: none) or (backdrop-filter: none)){:host{background-color:var(--ng-doc-navbar-background)}}:host[data-glass-effect=false]{background-color:var(--ng-doc-navbar-background)}:host{position:relative;display:flex;justify-content:center;height:100%;border-bottom:1px solid transparent;transition:var(--ng-doc-transition) border}:host.has-border{border-bottom:var(--ng-doc-navbar-border, );box-shadow:var(--ng-doc-shadow-color) 0 5px 20px -5px}:host .navbar-container{display:flex;height:100%;width:100%;padding:0 var(--ng-doc-navbar-horizontal-padding);z-index:10;max-width:var(--ng-doc-app-max-width)}:host .ng-doc-navbar-left,:host .ng-doc-navbar-right{display:flex;align-items:center}:host .ng-doc-navbar-left{justify-content:flex-start;width:100%;max-width:var(--ng-doc-navbar-left-width)}:host .ng-doc-navbar-right{justify-content:flex-end;margin-left:auto}:host .ng-doc-menu{margin-left:calc(var(--ng-doc-base-gutter) * 2)}@media(min-width:1024px){:host .ng-doc-menu{display:none}}\n"], dependencies: [{ kind: "component", type: NgDocSearchComponent, selector: "ng-doc-search" }, { kind: "component", type: NgDocButtonIconComponent, selector: "button[ng-doc-button-icon], a[ng-doc-button-icon], button[ng-doc-button-icon-raised], a[ng-doc-button-icon-raised], button[ng-doc-button-icon-transparent], a[ng-doc-button-icon-transparent]", inputs: ["size", "rounded"] }, { kind: "component", type: NgDocIconComponent, selector: "ng-doc-icon", inputs: ["icon", "customIcon", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
49
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocNavbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
50
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: NgDocNavbarComponent, isStandalone: true, selector: "ng-doc-navbar", inputs: { search: { classPropertyName: "search", publicName: "search", isSignal: true, isRequired: false, transformFunction: null }, hamburger: { classPropertyName: "hamburger", publicName: "hamburger", isSignal: true, isRequired: false, transformFunction: null }, glassEffect: { classPropertyName: "glassEffect", publicName: "glassEffect", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "document:keydown.escape": "closeSidebar()" }, properties: { "attr.data-glass-effect": "glassEffect()" } }, viewQueries: [{ propertyName: "menuButton", first: true, predicate: ["menuButton"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: "<div class=\"ng-doc-navbar-container\">\n @if (hamburger()) {\n <button\n type=\"button\"\n class=\"ng-doc-menu\"\n ng-doc-button-icon\n size=\"large\"\n [rounded]=\"false\"\n aria-controls=\"ng-doc-sidenav\"\n [attr.aria-expanded]=\"sidebarService.expandedState()\"\n [attr.aria-label]=\"sidebarService.expandedState() ? 'Close navigation' : 'Open navigation'\"\n (click)=\"sidebarService.toggle()\"\n #menuButton>\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n aria-hidden=\"true\">\n <path d=\"M4 7h16M4 12h16M4 17h16\" />\n </svg>\n </button>\n }\n <div class=\"ng-doc-navbar-left\">\n <ng-content select=\"[ngDocNavbarLeft]\"></ng-content>\n </div>\n <div class=\"ng-doc-navbar-center\">\n <ng-content select=\"[ngDocNavbarCenter]\"></ng-content>\n </div>\n <div class=\"ng-doc-navbar-right\">\n @if (search()) {\n <ng-doc-search></ng-doc-search>\n }\n <ng-content select=\"[ngDocNavbarRight]\"></ng-content>\n </div>\n</div>\n", styles: [":host{position:relative;display:flex;justify-content:center;height:100%;background:color-mix(in srgb,var(--ng-doc-navbar-background) 82%,transparent);backdrop-filter:saturate(1.4) blur(12px);border-bottom:var(--ng-doc-navbar-border);--ng-doc-button-color: var(--ng-doc-text-muted);--ng-doc-button-hover-color: var(--ng-doc-heading-color);--ng-doc-button-active-color: var(--ng-doc-heading-color);--ng-doc-button-hover-background: var(--ng-doc-hover-background)}:host[data-glass-effect=false]{background:var(--ng-doc-navbar-background);backdrop-filter:none}@supports not ((-webkit-backdrop-filter: none) or (backdrop-filter: none)){:host{background:var(--ng-doc-navbar-background)}}.ng-doc-navbar-container{display:flex;align-items:center;gap:var(--ng-doc-space-4);width:100%;max-width:var(--ng-doc-app-max-width);height:100%;padding:0 var(--ng-doc-navbar-horizontal-padding)}.ng-doc-navbar-left,.ng-doc-navbar-center,.ng-doc-navbar-right{display:flex;align-items:center;gap:var(--ng-doc-space-4);min-width:0}.ng-doc-navbar-left{flex:none;max-width:var(--ng-doc-navbar-left-width)}.ng-doc-navbar-center{margin-left:auto}.ng-doc-navbar-right ng-doc-search{margin-left:var(--ng-doc-space-6)}@media(max-width:1024px){.ng-doc-navbar-right ng-doc-search{margin-left:0}}.ng-doc-menu{display:none;margin-left:calc(var(--ng-doc-space-2) * -1)}@media(max-width:1024px){.ng-doc-navbar-center{display:none}.ng-doc-navbar-right{margin-left:auto}}@media(max-width:900px){.ng-doc-menu{display:inline-flex}}@media(max-width:640px){.ng-doc-navbar-container{padding:0 var(--ng-doc-space-4)}}\n"], dependencies: [{ kind: "component", type: NgDocSearchComponent, selector: "ng-doc-search" }, { kind: "component", type: NgDocButtonIconComponent, selector: "button[ng-doc-button-icon], a[ng-doc-button-icon], button[ng-doc-button-icon-raised], a[ng-doc-button-icon-raised], button[ng-doc-button-icon-transparent], a[ng-doc-button-icon-transparent]", inputs: ["size", "rounded"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
52
51
  }
53
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocNavbarComponent, decorators: [{
52
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocNavbarComponent, decorators: [{
54
53
  type: Component,
55
- args: [{ selector: 'ng-doc-navbar', changeDetection: ChangeDetectionStrategy.OnPush, imports: [PolymorpheusOutlet, NgDocSearchComponent, NgDocButtonIconComponent, NgDocIconComponent], template: "<div class=\"navbar-container\">\n <div class=\"ng-doc-navbar-left\">\n <ng-content select=\"[ngDocNavbarLeft]\"></ng-content>\n </div>\n <div class=\"ng-doc-navbar-right\">\n @if (search) {\n <ng-doc-search></ng-doc-search>\n }\n <ng-content select=\"[ngDocNavbarRight]\"></ng-content>\n <button class=\"ng-doc-menu\" ng-doc-button-icon size=\"large\" (click)=\"sidebarService.toggle()\">\n <ng-doc-icon icon=\"menu\" [size]=\"24\"></ng-doc-icon>\n </button>\n </div>\n</div>\n", styles: [":host:not([data-glass-effect=false]){background:color-mix(in srgb,var(--ng-doc-navbar-background) 60%,transparent);backdrop-filter:blur(20px)}@supports not ((-webkit-backdrop-filter: none) or (backdrop-filter: none)){:host{background-color:var(--ng-doc-navbar-background)}}:host[data-glass-effect=false]{background-color:var(--ng-doc-navbar-background)}:host{position:relative;display:flex;justify-content:center;height:100%;border-bottom:1px solid transparent;transition:var(--ng-doc-transition) border}:host.has-border{border-bottom:var(--ng-doc-navbar-border, );box-shadow:var(--ng-doc-shadow-color) 0 5px 20px -5px}:host .navbar-container{display:flex;height:100%;width:100%;padding:0 var(--ng-doc-navbar-horizontal-padding);z-index:10;max-width:var(--ng-doc-app-max-width)}:host .ng-doc-navbar-left,:host .ng-doc-navbar-right{display:flex;align-items:center}:host .ng-doc-navbar-left{justify-content:flex-start;width:100%;max-width:var(--ng-doc-navbar-left-width)}:host .ng-doc-navbar-right{justify-content:flex-end;margin-left:auto}:host .ng-doc-menu{margin-left:calc(var(--ng-doc-base-gutter) * 2)}@media(min-width:1024px){:host .ng-doc-menu{display:none}}\n"] }]
56
- }], ctorParameters: () => [], propDecorators: { search: [{
57
- type: Input
58
- }], hamburger: [{
59
- type: Input
60
- }], glassEffect: [{
61
- type: Input
62
- }, {
63
- type: HostBinding,
64
- args: ['attr.data-glass-effect']
65
- }], hasBorder: [{
66
- type: HostBinding,
67
- args: ['class.has-border']
68
- }] } });
54
+ args: [{ selector: 'ng-doc-navbar', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgDocSearchComponent, NgDocButtonIconComponent], host: {
55
+ '[attr.data-glass-effect]': 'glassEffect()',
56
+ '(document:keydown.escape)': 'closeSidebar()',
57
+ }, template: "<div class=\"ng-doc-navbar-container\">\n @if (hamburger()) {\n <button\n type=\"button\"\n class=\"ng-doc-menu\"\n ng-doc-button-icon\n size=\"large\"\n [rounded]=\"false\"\n aria-controls=\"ng-doc-sidenav\"\n [attr.aria-expanded]=\"sidebarService.expandedState()\"\n [attr.aria-label]=\"sidebarService.expandedState() ? 'Close navigation' : 'Open navigation'\"\n (click)=\"sidebarService.toggle()\"\n #menuButton>\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n aria-hidden=\"true\">\n <path d=\"M4 7h16M4 12h16M4 17h16\" />\n </svg>\n </button>\n }\n <div class=\"ng-doc-navbar-left\">\n <ng-content select=\"[ngDocNavbarLeft]\"></ng-content>\n </div>\n <div class=\"ng-doc-navbar-center\">\n <ng-content select=\"[ngDocNavbarCenter]\"></ng-content>\n </div>\n <div class=\"ng-doc-navbar-right\">\n @if (search()) {\n <ng-doc-search></ng-doc-search>\n }\n <ng-content select=\"[ngDocNavbarRight]\"></ng-content>\n </div>\n</div>\n", styles: [":host{position:relative;display:flex;justify-content:center;height:100%;background:color-mix(in srgb,var(--ng-doc-navbar-background) 82%,transparent);backdrop-filter:saturate(1.4) blur(12px);border-bottom:var(--ng-doc-navbar-border);--ng-doc-button-color: var(--ng-doc-text-muted);--ng-doc-button-hover-color: var(--ng-doc-heading-color);--ng-doc-button-active-color: var(--ng-doc-heading-color);--ng-doc-button-hover-background: var(--ng-doc-hover-background)}:host[data-glass-effect=false]{background:var(--ng-doc-navbar-background);backdrop-filter:none}@supports not ((-webkit-backdrop-filter: none) or (backdrop-filter: none)){:host{background:var(--ng-doc-navbar-background)}}.ng-doc-navbar-container{display:flex;align-items:center;gap:var(--ng-doc-space-4);width:100%;max-width:var(--ng-doc-app-max-width);height:100%;padding:0 var(--ng-doc-navbar-horizontal-padding)}.ng-doc-navbar-left,.ng-doc-navbar-center,.ng-doc-navbar-right{display:flex;align-items:center;gap:var(--ng-doc-space-4);min-width:0}.ng-doc-navbar-left{flex:none;max-width:var(--ng-doc-navbar-left-width)}.ng-doc-navbar-center{margin-left:auto}.ng-doc-navbar-right ng-doc-search{margin-left:var(--ng-doc-space-6)}@media(max-width:1024px){.ng-doc-navbar-right ng-doc-search{margin-left:0}}.ng-doc-menu{display:none;margin-left:calc(var(--ng-doc-space-2) * -1)}@media(max-width:1024px){.ng-doc-navbar-center{display:none}.ng-doc-navbar-right{margin-left:auto}}@media(max-width:900px){.ng-doc-menu{display:inline-flex}}@media(max-width:640px){.ng-doc-navbar-container{padding:0 var(--ng-doc-space-4)}}\n"] }]
58
+ }], propDecorators: { search: [{ type: i0.Input, args: [{ isSignal: true, alias: "search", required: false }] }], hamburger: [{ type: i0.Input, args: [{ isSignal: true, alias: "hamburger", required: false }] }], glassEffect: [{ type: i0.Input, args: [{ isSignal: true, alias: "glassEffect", required: false }] }], menuButton: [{ type: i0.ViewChild, args: ['menuButton', { ...{ read: (ElementRef) }, isSignal: true }] }] } });
69
59
 
70
60
  /**
71
61
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"ng-doc-app-components-navbar.mjs","sources":["../../../../libs/app/components/navbar/navbar.component.ts","../../../../libs/app/components/navbar/navbar.component.html","../../../../libs/app/components/navbar/ng-doc-app-components-navbar.ts"],"sourcesContent":["import {\n afterNextRender,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n DestroyRef,\n HostBinding,\n inject,\n Input,\n NgZone,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { NgDocSearchComponent } from '@ng-doc/app/components/search';\nimport { NgDocSidebarService } from '@ng-doc/app/services';\nimport { NgDocButtonIconComponent, NgDocIconComponent, ngDocZoneOptimize } from '@ng-doc/ui-kit';\nimport { WA_WINDOW } from '@ng-web-apis/common';\nimport { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';\nimport { combineLatest, fromEvent } from 'rxjs';\nimport { distinctUntilChanged, map, startWith } from 'rxjs/operators';\n\n/**\n * Navbar component for ng-doc application\n */\n@Component({\n selector: 'ng-doc-navbar',\n templateUrl: './navbar.component.html',\n styleUrls: ['./navbar.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [PolymorpheusOutlet, NgDocSearchComponent, NgDocButtonIconComponent, NgDocIconComponent],\n})\nexport class NgDocNavbarComponent {\n private readonly window = inject<Window>(WA_WINDOW);\n private readonly ngZone = inject(NgZone);\n private readonly changeDetectorRef = inject(ChangeDetectorRef);\n protected readonly sidebarService = inject(NgDocSidebarService);\n\n /**\n * Show search input\n */\n @Input()\n search: boolean = true;\n\n /**\n * Show hamburger button\n */\n @Input()\n hamburger: boolean = true;\n\n /**\n * Use glass effect for navbar\n */\n @Input()\n @HostBinding('attr.data-glass-effect')\n glassEffect: boolean = true;\n\n /**\n * Indicates if navbar has border\n */\n @HostBinding('class.has-border')\n hasBorder: boolean = false;\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n\n afterNextRender(() => {\n combineLatest([\n fromEvent(this.window, 'scroll').pipe(\n map((e: Event) => ((e.target as Document)?.scrollingElement?.scrollTop ?? 0) > 0),\n distinctUntilChanged(),\n startWith(false),\n ngDocZoneOptimize(this.ngZone),\n ),\n this.sidebarService.isExpanded(),\n ])\n .pipe(\n map(\n ([scrolled, isExpanded]: [boolean, boolean]) =>\n scrolled || (isExpanded && this.sidebarService.isMobile),\n ),\n takeUntilDestroyed(destroyRef),\n )\n .subscribe((hasShadow: boolean) => {\n this.hasBorder = hasShadow;\n this.changeDetectorRef.markForCheck();\n });\n });\n }\n}\n","<div class=\"navbar-container\">\n <div class=\"ng-doc-navbar-left\">\n <ng-content select=\"[ngDocNavbarLeft]\"></ng-content>\n </div>\n <div class=\"ng-doc-navbar-right\">\n @if (search) {\n <ng-doc-search></ng-doc-search>\n }\n <ng-content select=\"[ngDocNavbarRight]\"></ng-content>\n <button class=\"ng-doc-menu\" ng-doc-button-icon size=\"large\" (click)=\"sidebarService.toggle()\">\n <ng-doc-icon icon=\"menu\" [size]=\"24\"></ng-doc-icon>\n </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DjC;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-doc-app-components-navbar.mjs","sources":["../../../../libs/app/components/navbar/navbar.component.ts","../../../../libs/app/components/navbar/navbar.component.html","../../../../libs/app/components/navbar/ng-doc-app-components-navbar.ts"],"sourcesContent":["import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n inject,\n input,\n viewChild,\n} from '@angular/core';\nimport { NgDocSearchComponent } from '@ng-doc/app/components/search';\nimport { NgDocSidebarService } from '@ng-doc/app/services/sidebar';\nimport { NgDocButtonIconComponent } from '@ng-doc/ui-kit';\n\n/**\n * Navbar of the NgDoc application: the header bar above the sidebar and the page.\n *\n * It lays out, from left to right: the menu button (only where the sidebar is an overlay), the\n * content marked with `ngDocNavbarLeft` (for example the logo), the content marked with\n * `ngDocNavbarCenter` (for example the section links, hidden at 1024px and below), the search, and\n * the content marked with `ngDocNavbarRight` (for example the theme toggle).\n * @example\n * ```html\n * <ng-doc-navbar>\n * <a ngDocNavbarLeft routerLink=\"/\">My library</a>\n * <nav ngDocNavbarCenter aria-label=\"Primary\"><a routerLink=\"/docs\">Guides</a></nav>\n * <ng-doc-theme-toggle ngDocNavbarRight />\n * </ng-doc-navbar>\n * ```\n */\n@Component({\n selector: 'ng-doc-navbar',\n templateUrl: './navbar.component.html',\n styleUrls: ['./navbar.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgDocSearchComponent, NgDocButtonIconComponent],\n host: {\n '[attr.data-glass-effect]': 'glassEffect()',\n '(document:keydown.escape)': 'closeSidebar()',\n },\n})\nexport class NgDocNavbarComponent {\n protected readonly sidebarService = inject(NgDocSidebarService);\n\n /**\n * Show search input\n */\n readonly search = input<boolean, unknown>(true, { transform: booleanAttribute });\n\n /**\n * Show the menu button that opens the sidebar where it is an overlay (900px and below).\n */\n readonly hamburger = input<boolean, unknown>(true, { transform: booleanAttribute });\n\n /**\n * Use glass effect for navbar\n */\n readonly glassEffect = input<boolean, unknown>(true, { transform: booleanAttribute });\n\n private readonly menuButton = viewChild('menuButton', { read: ElementRef<HTMLButtonElement> });\n\n /**\n * Closes the sidebar overlay and moves focus back to the menu button that opened it.\n */\n protected closeSidebar(): void {\n if (this.sidebarService.expandedState() && this.sidebarService.isMobile) {\n this.sidebarService.hide();\n this.menuButton()?.nativeElement.focus();\n }\n }\n}\n","<div class=\"ng-doc-navbar-container\">\n @if (hamburger()) {\n <button\n type=\"button\"\n class=\"ng-doc-menu\"\n ng-doc-button-icon\n size=\"large\"\n [rounded]=\"false\"\n aria-controls=\"ng-doc-sidenav\"\n [attr.aria-expanded]=\"sidebarService.expandedState()\"\n [attr.aria-label]=\"sidebarService.expandedState() ? 'Close navigation' : 'Open navigation'\"\n (click)=\"sidebarService.toggle()\"\n #menuButton>\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n aria-hidden=\"true\">\n <path d=\"M4 7h16M4 12h16M4 17h16\" />\n </svg>\n </button>\n }\n <div class=\"ng-doc-navbar-left\">\n <ng-content select=\"[ngDocNavbarLeft]\"></ng-content>\n </div>\n <div class=\"ng-doc-navbar-center\">\n <ng-content select=\"[ngDocNavbarCenter]\"></ng-content>\n </div>\n <div class=\"ng-doc-navbar-right\">\n @if (search()) {\n <ng-doc-search></ng-doc-search>\n }\n <ng-content select=\"[ngDocNavbarRight]\"></ng-content>\n </div>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAaA;;;;;;;;;;;;;;;AAeG;MAYU,oBAAoB,CAAA;AAXjC,IAAA,WAAA,GAAA;AAYqB,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,mBAAmB,CAAC;AAE/D;;AAEG;QACM,IAAA,CAAA,MAAM,GAAG,KAAK,CAAmB,IAAI,8EAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AAEhF;;A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 from '@angular/core';
2
- import { Input, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { input, inject, ElementRef, PLATFORM_ID, effect, untracked, DestroyRef, ChangeDetectionStrategy, Component } from '@angular/core';
4
+ import { NgDocContentController } from '@ng-doc/app/classes/content-controller';
5
+ import { ɵrestoreNgDocHydrationSnapshot as _restoreNgDocHydrationSnapshot } from '@ng-doc/app/helpers';
3
6
  import { NgDocSanitizeHtmlPipe } from '@ng-doc/app/pipes';
4
7
  import { NgDocPageProcessorComponent } from '@ng-doc/app/processors';
5
8
 
9
+ /**
10
+ * The header of a documentation page: the rendered header HTML, or the header of an
11
+ * asynchronous content source.
12
+ */
6
13
  class NgDocPageHeaderComponent {
7
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocPageHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
8
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: NgDocPageHeaderComponent, isStandalone: true, selector: "ng-doc-page-header", inputs: { headerContent: "headerContent" }, host: { attributes: { "ngSkipHydration": "true" } }, ngImport: i0, template: "<header\n class=\"ng-doc-page-header ngde\"\n [ngDocPageProcessor]=\"headerContent | ngDocSanitizeHtml\"></header>\n", styles: [""], dependencies: [{ kind: "component", type: NgDocPageProcessorComponent, selector: "[ngDocPageProcessor]", inputs: ["ngDocPageProcessor"], outputs: ["afterRender"] }, { kind: "pipe", type: NgDocSanitizeHtmlPipe, name: "ngDocSanitizeHtml" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
14
+ constructor() {
15
+ /** The rendered header HTML, used when there is no content source. */
16
+ this.headerContent = input.required(/* @ts-ignore */
17
+ ...(ngDevMode ? [{ debugName: "headerContent" }] : /* istanbul ignore next */ []));
18
+ /** The source of the header content, for pages whose content loads asynchronously. */
19
+ this.headerContentSource = input(/* @ts-ignore */
20
+ ...(ngDevMode ? [undefined, { debugName: "headerContentSource" }] : /* istanbul ignore next */ []));
21
+ this.contentController = inject(NgDocContentController);
22
+ this.host = inject(ElementRef).nativeElement;
23
+ this.browser = isPlatformBrowser(inject(PLATFORM_ID));
24
+ // Connects the controller to the current source, before the template renders its content.
25
+ effect(() => {
26
+ const source = this.headerContentSource();
27
+ untracked(() => {
28
+ if (source) {
29
+ // Angular empties this host (it skips hydration) and the header loads asynchronously,
30
+ // so the server-rendered header stays visible until the loaded one renders. The copy
31
+ // is shown once, for the host's first source.
32
+ if (this.browser && !this.snapshot)
33
+ this.snapshot = _restoreNgDocHydrationSnapshot(this.host);
34
+ this.contentController.connect(source);
35
+ }
36
+ else {
37
+ this.releaseSnapshot();
38
+ this.contentController.disconnect();
39
+ }
40
+ });
41
+ });
42
+ // A load that needs no new pass (its header is already rendered) or that failed settles
43
+ // without `revealLoaded`.
44
+ effect(() => {
45
+ if (this.contentController.settled())
46
+ untracked(() => this.releaseSnapshot());
47
+ });
48
+ effect(() => {
49
+ if (this.contentController.error())
50
+ untracked(() => this.releaseSnapshot());
51
+ });
52
+ inject(DestroyRef).onDestroy(() => this.releaseSnapshot());
53
+ }
54
+ /**
55
+ * Shows the loaded header in place of the server-rendered copy when a pass of it is about to
56
+ * render, in the same task. The pass of the empty header before the source has loaded keeps
57
+ * the copy.
58
+ * @param version - The content version of the pass.
59
+ * @internal
60
+ */
61
+ revealLoaded(version) {
62
+ if (version === this.contentController.loadedVersion())
63
+ this.releaseSnapshot();
64
+ }
65
+ releaseSnapshot() {
66
+ const release = this.snapshot;
67
+ this.snapshot = undefined;
68
+ release?.();
69
+ }
70
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocPageHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
71
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: NgDocPageHeaderComponent, isStandalone: true, selector: "ng-doc-page-header", inputs: { headerContent: { classPropertyName: "headerContent", publicName: "headerContent", isSignal: true, isRequired: true, transformFunction: null }, headerContentSource: { classPropertyName: "headerContentSource", publicName: "headerContentSource", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "ngSkipHydration": "true" }, properties: { "attr.data-ng-doc-async-content": "headerContentSource() ? \"\" : null" } }, providers: [NgDocContentController], ngImport: i0, template: "@if (headerContentSource()) {\n @if (contentController.error(); as error) {\n <header class=\"ng-doc-page-header ngde\" role=\"alert\">{{ error.message }}</header>\n } @else {\n <header\n class=\"ng-doc-page-header ngde\"\n [ngDocPageProcessor]=\"contentController.html() | ngDocSanitizeHtml\"\n [contentVersion]=\"contentController.version()\"\n (beforeRender)=\"revealLoaded($event)\"\n (contentProcessed)=\"contentController.processed($event)\"\n (processingError)=\"contentController.processingFailed($event)\"></header>\n }\n} @else {\n <header\n class=\"ng-doc-page-header ngde\"\n [ngDocPageProcessor]=\"headerContent() | ngDocSanitizeHtml\"></header>\n}\n", styles: [":host[data-ng-doc-hydration-snapshot]>:not(.ng-doc-hydration-snapshot){display:none!important}\n"], dependencies: [{ kind: "component", type: NgDocPageProcessorComponent, selector: "[ngDocPageProcessor]", inputs: ["ngDocPageProcessor", "contentVersion"], outputs: ["beforeRender", "afterRender", "contentProcessed", "processingError"] }, { kind: "pipe", type: NgDocSanitizeHtmlPipe, name: "ngDocSanitizeHtml" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
9
72
  }
10
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocPageHeaderComponent, decorators: [{
73
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocPageHeaderComponent, decorators: [{
11
74
  type: Component,
12
- args: [{ selector: 'ng-doc-page-header', imports: [NgDocPageProcessorComponent, NgDocSanitizeHtmlPipe], changeDetection: ChangeDetectionStrategy.OnPush, host: {
75
+ args: [{ selector: 'ng-doc-page-header', imports: [NgDocPageProcessorComponent, NgDocSanitizeHtmlPipe], changeDetection: ChangeDetectionStrategy.OnPush, providers: [NgDocContentController], host: {
13
76
  ngSkipHydration: 'true',
14
- }, template: "<header\n class=\"ng-doc-page-header ngde\"\n [ngDocPageProcessor]=\"headerContent | ngDocSanitizeHtml\"></header>\n" }]
15
- }], propDecorators: { headerContent: [{
16
- type: Input,
17
- args: [{ required: true }]
18
- }] } });
77
+ // Tells the browser that the server-rendered header must be kept until the loaded one
78
+ // renders (ɵNG_DOC_ASYNC_CONTENT_ATTRIBUTE).
79
+ '[attr.data-ng-doc-async-content]': 'headerContentSource() ? "" : null',
80
+ }, template: "@if (headerContentSource()) {\n @if (contentController.error(); as error) {\n <header class=\"ng-doc-page-header ngde\" role=\"alert\">{{ error.message }}</header>\n } @else {\n <header\n class=\"ng-doc-page-header ngde\"\n [ngDocPageProcessor]=\"contentController.html() | ngDocSanitizeHtml\"\n [contentVersion]=\"contentController.version()\"\n (beforeRender)=\"revealLoaded($event)\"\n (contentProcessed)=\"contentController.processed($event)\"\n (processingError)=\"contentController.processingFailed($event)\"></header>\n }\n} @else {\n <header\n class=\"ng-doc-page-header ngde\"\n [ngDocPageProcessor]=\"headerContent() | ngDocSanitizeHtml\"></header>\n}\n", styles: [":host[data-ng-doc-hydration-snapshot]>:not(.ng-doc-hydration-snapshot){display:none!important}\n"] }]
81
+ }], ctorParameters: () => [], propDecorators: { headerContent: [{ type: i0.Input, args: [{ isSignal: true, alias: "headerContent", required: true }] }], headerContentSource: [{ type: i0.Input, args: [{ isSignal: true, alias: "headerContentSource", required: false }] }] } });
19
82
 
20
83
  /**
21
84
  * Generated bundle index. Do not edit.