@ng-doc/app 22.0.0-beta.2 → 22.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) 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-frame.mjs +96 -0
  25. package/fesm2022/ng-doc-app-components-demo-frame.mjs.map +1 -0
  26. package/fesm2022/ng-doc-app-components-demo-pane.mjs +39 -36
  27. package/fesm2022/ng-doc-app-components-demo-pane.mjs.map +1 -1
  28. package/fesm2022/ng-doc-app-components-demo.mjs +175 -44
  29. package/fesm2022/ng-doc-app-components-demo.mjs.map +1 -1
  30. package/fesm2022/ng-doc-app-components-fullscreen-button.mjs +12 -9
  31. package/fesm2022/ng-doc-app-components-fullscreen-button.mjs.map +1 -1
  32. package/fesm2022/ng-doc-app-components-fullscreen-toggle.mjs +79 -0
  33. package/fesm2022/ng-doc-app-components-fullscreen-toggle.mjs.map +1 -0
  34. package/fesm2022/ng-doc-app-components-heading-anchor.mjs +54 -21
  35. package/fesm2022/ng-doc-app-components-heading-anchor.mjs.map +1 -1
  36. package/fesm2022/ng-doc-app-components-image-viewer.mjs +183 -89
  37. package/fesm2022/ng-doc-app-components-image-viewer.mjs.map +1 -1
  38. package/fesm2022/ng-doc-app-components-kind-icon.mjs +42 -25
  39. package/fesm2022/ng-doc-app-components-kind-icon.mjs.map +1 -1
  40. package/fesm2022/ng-doc-app-components-link.mjs +12 -9
  41. package/fesm2022/ng-doc-app-components-link.mjs.map +1 -1
  42. package/fesm2022/ng-doc-app-components-members.mjs +30 -0
  43. package/fesm2022/ng-doc-app-components-members.mjs.map +1 -0
  44. package/fesm2022/ng-doc-app-components-mermaid-viewer.mjs +61 -20
  45. package/fesm2022/ng-doc-app-components-mermaid-viewer.mjs.map +1 -1
  46. package/fesm2022/ng-doc-app-components-navbar.mjs +39 -49
  47. package/fesm2022/ng-doc-app-components-navbar.mjs.map +1 -1
  48. package/fesm2022/ng-doc-app-components-page-header.mjs +73 -10
  49. package/fesm2022/ng-doc-app-components-page-header.mjs.map +1 -1
  50. package/fesm2022/ng-doc-app-components-page-link.mjs +123 -31
  51. package/fesm2022/ng-doc-app-components-page-link.mjs.map +1 -1
  52. package/fesm2022/ng-doc-app-components-page-navigation.mjs +17 -19
  53. package/fesm2022/ng-doc-app-components-page-navigation.mjs.map +1 -1
  54. package/fesm2022/ng-doc-app-components-page-wrapper.mjs +56 -35
  55. package/fesm2022/ng-doc-app-components-page-wrapper.mjs.map +1 -1
  56. package/fesm2022/ng-doc-app-components-page.mjs +168 -24
  57. package/fesm2022/ng-doc-app-components-page.mjs.map +1 -1
  58. package/fesm2022/ng-doc-app-components-playground.mjs +477 -286
  59. package/fesm2022/ng-doc-app-components-playground.mjs.map +1 -1
  60. package/fesm2022/ng-doc-app-components-root.mjs +48 -31
  61. package/fesm2022/ng-doc-app-components-root.mjs.map +1 -1
  62. package/fesm2022/ng-doc-app-components-search-result.mjs +22 -21
  63. package/fesm2022/ng-doc-app-components-search-result.mjs.map +1 -1
  64. package/fesm2022/ng-doc-app-components-search.mjs +64 -33
  65. package/fesm2022/ng-doc-app-components-search.mjs.map +1 -1
  66. package/fesm2022/ng-doc-app-components-sidebar.mjs +86 -61
  67. package/fesm2022/ng-doc-app-components-sidebar.mjs.map +1 -1
  68. package/fesm2022/ng-doc-app-components-tabs.mjs +35 -11
  69. package/fesm2022/ng-doc-app-components-tabs.mjs.map +1 -1
  70. package/fesm2022/ng-doc-app-components-theme-toggle.mjs +33 -21
  71. package/fesm2022/ng-doc-app-components-theme-toggle.mjs.map +1 -1
  72. package/fesm2022/ng-doc-app-components-toc.mjs +267 -90
  73. package/fesm2022/ng-doc-app-components-toc.mjs.map +1 -1
  74. package/fesm2022/ng-doc-app-components.mjs +4 -1
  75. package/fesm2022/ng-doc-app-components.mjs.map +1 -1
  76. package/fesm2022/ng-doc-app-defaults-default-processors.mjs +2 -1
  77. package/fesm2022/ng-doc-app-defaults-default-processors.mjs.map +1 -1
  78. package/fesm2022/ng-doc-app-demo-app.mjs +176 -0
  79. package/fesm2022/ng-doc-app-demo-app.mjs.map +1 -0
  80. package/fesm2022/ng-doc-app-directives-code-highlighter.mjs +11 -5
  81. package/fesm2022/ng-doc-app-directives-code-highlighter.mjs.map +1 -1
  82. package/fesm2022/ng-doc-app-directives-members-filter.mjs +276 -0
  83. package/fesm2022/ng-doc-app-directives-members-filter.mjs.map +1 -0
  84. package/fesm2022/ng-doc-app-directives-route-active.mjs +34 -30
  85. package/fesm2022/ng-doc-app-directives-route-active.mjs.map +1 -1
  86. package/fesm2022/ng-doc-app-directives.mjs +1 -0
  87. package/fesm2022/ng-doc-app-directives.mjs.map +1 -1
  88. package/fesm2022/ng-doc-app-helpers.mjs +307 -2
  89. package/fesm2022/ng-doc-app-helpers.mjs.map +1 -1
  90. package/fesm2022/ng-doc-app-pipes-decode-uri-component.mjs +6 -4
  91. package/fesm2022/ng-doc-app-pipes-decode-uri-component.mjs.map +1 -1
  92. package/fesm2022/ng-doc-app-pipes-extract-value.mjs +6 -4
  93. package/fesm2022/ng-doc-app-pipes-extract-value.mjs.map +1 -1
  94. package/fesm2022/ng-doc-app-pipes-filter-by-text.mjs +7 -4
  95. package/fesm2022/ng-doc-app-pipes-filter-by-text.mjs.map +1 -1
  96. package/fesm2022/ng-doc-app-pipes-sanitize-html.mjs +8 -5
  97. package/fesm2022/ng-doc-app-pipes-sanitize-html.mjs.map +1 -1
  98. package/fesm2022/ng-doc-app-processors-page-processor.mjs +86 -23
  99. package/fesm2022/ng-doc-app-processors-page-processor.mjs.map +1 -1
  100. package/fesm2022/ng-doc-app-processors-processors-tooltip.mjs +26 -25
  101. package/fesm2022/ng-doc-app-processors-processors-tooltip.mjs.map +1 -1
  102. package/fesm2022/ng-doc-app-processors-processors.mjs +42 -10
  103. package/fesm2022/ng-doc-app-processors-processors.mjs.map +1 -1
  104. package/fesm2022/ng-doc-app-providers-ng-doc-app.mjs +31 -2
  105. package/fesm2022/ng-doc-app-providers-ng-doc-app.mjs.map +1 -1
  106. package/fesm2022/ng-doc-app-providers-title.mjs +129 -0
  107. package/fesm2022/ng-doc-app-providers-title.mjs.map +1 -0
  108. package/fesm2022/ng-doc-app-providers.mjs +1 -0
  109. package/fesm2022/ng-doc-app-providers.mjs.map +1 -1
  110. package/fesm2022/ng-doc-app-services-content-scroll-intent.mjs +122 -0
  111. package/fesm2022/ng-doc-app-services-content-scroll-intent.mjs.map +1 -0
  112. package/fesm2022/ng-doc-app-services-content-state.mjs +57 -0
  113. package/fesm2022/ng-doc-app-services-content-state.mjs.map +1 -0
  114. package/fesm2022/ng-doc-app-services-fullscreen-route.mjs +74 -0
  115. package/fesm2022/ng-doc-app-services-fullscreen-route.mjs.map +1 -0
  116. package/fesm2022/ng-doc-app-services-highlighter.mjs +90 -17
  117. package/fesm2022/ng-doc-app-services-highlighter.mjs.map +1 -1
  118. package/fesm2022/ng-doc-app-services-route-preloader.mjs +384 -0
  119. package/fesm2022/ng-doc-app-services-route-preloader.mjs.map +1 -0
  120. package/fesm2022/ng-doc-app-services-shortcuts.mjs +214 -0
  121. package/fesm2022/ng-doc-app-services-shortcuts.mjs.map +1 -0
  122. package/fesm2022/ng-doc-app-services-sidebar.mjs +59 -25
  123. package/fesm2022/ng-doc-app-services-sidebar.mjs.map +1 -1
  124. package/fesm2022/ng-doc-app-services-store.mjs +8 -8
  125. package/fesm2022/ng-doc-app-services-store.mjs.map +1 -1
  126. package/fesm2022/ng-doc-app-services-theme.mjs +32 -12
  127. package/fesm2022/ng-doc-app-services-theme.mjs.map +1 -1
  128. package/fesm2022/ng-doc-app-services.mjs +143 -0
  129. package/fesm2022/ng-doc-app-services.mjs.map +1 -1
  130. package/fesm2022/ng-doc-app-tokens.mjs +7 -28
  131. package/fesm2022/ng-doc-app-tokens.mjs.map +1 -1
  132. package/fesm2022/ng-doc-app-type-controls-boolean-control.mjs +18 -9
  133. package/fesm2022/ng-doc-app-type-controls-boolean-control.mjs.map +1 -1
  134. package/fesm2022/ng-doc-app-type-controls-number-control.mjs +12 -9
  135. package/fesm2022/ng-doc-app-type-controls-number-control.mjs.map +1 -1
  136. package/fesm2022/ng-doc-app-type-controls-string-control.mjs +12 -9
  137. package/fesm2022/ng-doc-app-type-controls-string-control.mjs.map +1 -1
  138. package/fesm2022/ng-doc-app-type-controls-type-alias-control.mjs +59 -18
  139. package/fesm2022/ng-doc-app-type-controls-type-alias-control.mjs.map +1 -1
  140. package/package.json +82 -28
  141. package/styles/global.css +1128 -201
  142. package/styles/main.css +1128 -201
  143. package/styles/themes/dark.css +88 -56
  144. package/types/ng-doc-app-classes-content-anchor-controller.d.ts +54 -0
  145. package/types/ng-doc-app-classes-content-controller.d.ts +94 -0
  146. package/types/ng-doc-app-classes-default-search-engine.d.ts +9 -1
  147. package/types/ng-doc-app-classes-root-page.d.ts +14 -1
  148. package/types/ng-doc-app-classes-search-engine.d.ts +5 -0
  149. package/types/ng-doc-app-classes.d.ts +2 -0
  150. package/types/ng-doc-app-components-api-list.d.ts +69 -20
  151. package/types/ng-doc-app-components-breadcrumb.d.ts +8 -3
  152. package/types/ng-doc-app-components-code.d.ts +46 -12
  153. package/types/ng-doc-app-components-command-palette.d.ts +147 -0
  154. package/types/ng-doc-app-components-copy-button.d.ts +18 -6
  155. package/types/ng-doc-app-components-demo-displayer.d.ts +23 -10
  156. package/types/ng-doc-app-components-demo-frame.d.ts +48 -0
  157. package/types/ng-doc-app-components-demo-pane.d.ts +19 -15
  158. package/types/ng-doc-app-components-demo.d.ts +80 -15
  159. package/types/ng-doc-app-components-fullscreen-button.d.ts +4 -2
  160. package/types/ng-doc-app-components-fullscreen-toggle.d.ts +24 -0
  161. package/types/ng-doc-app-components-heading-anchor.d.ts +26 -7
  162. package/types/ng-doc-app-components-image-viewer.d.ts +71 -7
  163. package/types/ng-doc-app-components-kind-icon.d.ts +28 -7
  164. package/types/ng-doc-app-components-link.d.ts +6 -2
  165. package/types/ng-doc-app-components-members.d.ts +13 -0
  166. package/types/ng-doc-app-components-mermaid-viewer.d.ts +21 -6
  167. package/types/ng-doc-app-components-navbar.d.ts +25 -15
  168. package/types/ng-doc-app-components-page-header.d.ts +28 -4
  169. package/types/ng-doc-app-components-page-link.d.ts +34 -15
  170. package/types/ng-doc-app-components-page-navigation.d.ts +10 -5
  171. package/types/ng-doc-app-components-page-wrapper.d.ts +35 -11
  172. package/types/ng-doc-app-components-page.d.ts +57 -6
  173. package/types/ng-doc-app-components-playground.d.ts +167 -78
  174. package/types/ng-doc-app-components-root.d.ts +28 -7
  175. package/types/ng-doc-app-components-search-result.d.ts +14 -6
  176. package/types/ng-doc-app-components-search.d.ts +19 -7
  177. package/types/ng-doc-app-components-tabs.d.ts +24 -5
  178. package/types/ng-doc-app-components-theme-toggle.d.ts +18 -5
  179. package/types/ng-doc-app-components-toc.d.ts +76 -29
  180. package/types/ng-doc-app-components.d.ts +4 -1
  181. package/types/ng-doc-app-demo-app.d.ts +89 -0
  182. package/types/ng-doc-app-directives-code-highlighter.d.ts +8 -4
  183. package/types/ng-doc-app-directives-members-filter.d.ts +61 -0
  184. package/types/ng-doc-app-directives-route-active.d.ts +21 -7
  185. package/types/ng-doc-app-directives.d.ts +1 -0
  186. package/types/ng-doc-app-helpers.d.ts +142 -3
  187. package/types/ng-doc-app-interfaces.d.ts +62 -31
  188. package/types/ng-doc-app-pipes-decode-uri-component.d.ts +3 -0
  189. package/types/ng-doc-app-pipes-extract-value.d.ts +3 -0
  190. package/types/ng-doc-app-pipes-filter-by-text.d.ts +4 -0
  191. package/types/ng-doc-app-pipes-sanitize-html.d.ts +4 -2
  192. package/types/ng-doc-app-processors-page-processor.d.ts +39 -10
  193. package/types/ng-doc-app-processors-processors-tooltip.d.ts +11 -10
  194. package/types/ng-doc-app-processors-processors.d.ts +10 -1
  195. package/types/ng-doc-app-providers-ng-doc-app.d.ts +18 -1
  196. package/types/ng-doc-app-providers-title.d.ts +59 -0
  197. package/types/ng-doc-app-providers.d.ts +1 -0
  198. package/types/ng-doc-app-services-content-scroll-intent.d.ts +52 -0
  199. package/types/ng-doc-app-services-content-state.d.ts +40 -0
  200. package/types/ng-doc-app-services-fullscreen-route.d.ts +35 -0
  201. package/types/ng-doc-app-services-highlighter.d.ts +47 -5
  202. package/types/ng-doc-app-services-route-preloader.d.ts +121 -0
  203. package/types/ng-doc-app-services-shortcuts.d.ts +96 -0
  204. package/types/ng-doc-app-services-sidebar.d.ts +24 -4
  205. package/types/ng-doc-app-services-store.d.ts +24 -1
  206. package/types/ng-doc-app-services-theme.d.ts +19 -3
  207. package/types/ng-doc-app-services.d.ts +77 -0
  208. package/types/ng-doc-app-tokens.d.ts +10 -30
  209. package/types/ng-doc-app-type-controls-boolean-control.d.ts +11 -6
  210. package/types/ng-doc-app-type-controls-number-control.d.ts +5 -3
  211. package/types/ng-doc-app-type-controls-string-control.d.ts +5 -3
  212. package/types/ng-doc-app-type-controls-type-alias-control.d.ts +35 -6
  213. package/fesm2022/ng-doc-app-components-search-dialog.mjs +0 -78
  214. package/fesm2022/ng-doc-app-components-search-dialog.mjs.map +0 -1
  215. package/types/ng-doc-app-components-search-dialog.d.ts +0 -28
@@ -1,6 +1,9 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Pipe } from '@angular/core';
3
3
 
4
+ /**
5
+ * Decodes a URI component, and returns the value unchanged when it is not a valid encoding.
6
+ */
4
7
  class NgDocDecodeUriComponentPipe {
5
8
  transform(value) {
6
9
  try {
@@ -10,14 +13,13 @@ class NgDocDecodeUriComponentPipe {
10
13
  return value;
11
14
  }
12
15
  }
13
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocDecodeUriComponentPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
14
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.0.6", ngImport: i0, type: NgDocDecodeUriComponentPipe, isStandalone: true, name: "decodeUriComponent" }); }
16
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocDecodeUriComponentPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
17
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.2.1", ngImport: i0, type: NgDocDecodeUriComponentPipe, isStandalone: true, name: "decodeUriComponent" }); }
15
18
  }
16
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocDecodeUriComponentPipe, decorators: [{
19
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocDecodeUriComponentPipe, decorators: [{
17
20
  type: Pipe,
18
21
  args: [{
19
22
  name: 'decodeUriComponent',
20
- standalone: true,
21
23
  }]
22
24
  }] });
23
25
 
@@ -1 +1 @@
1
- {"version":3,"file":"ng-doc-app-pipes-decode-uri-component.mjs","sources":["../../../../libs/app/pipes/decode-uri-component/decode-uri-component.pipe.ts","../../../../libs/app/pipes/decode-uri-component/ng-doc-app-pipes-decode-uri-component.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'decodeUriComponent',\n standalone: true,\n})\nexport class NgDocDecodeUriComponentPipe implements PipeTransform {\n transform(value: string): string {\n try {\n return decodeURIComponent(value);\n } catch {\n return value;\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAMa,2BAA2B,CAAA;AACtC,IAAA,SAAS,CAAC,KAAa,EAAA;AACrB,QAAA,IAAI;AACF,YAAA,OAAO,kBAAkB,CAAC,KAAK,CAAC;QAClC;AAAE,QAAA,MAAM;AACN,YAAA,OAAO,KAAK;QACd;IACF;8GAPW,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAA3B,2BAA2B,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,oBAAA,EAAA,CAAA,CAAA;;2FAA3B,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAJvC,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,oBAAoB;AAC1B,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACLD;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-doc-app-pipes-decode-uri-component.mjs","sources":["../../../../libs/app/pipes/decode-uri-component/decode-uri-component.pipe.ts","../../../../libs/app/pipes/decode-uri-component/ng-doc-app-pipes-decode-uri-component.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n/**\n * Decodes a URI component, and returns the value unchanged when it is not a valid encoding.\n */\n@Pipe({\n name: 'decodeUriComponent',\n})\nexport class NgDocDecodeUriComponentPipe implements PipeTransform {\n transform(value: string): string {\n try {\n return decodeURIComponent(value);\n } catch {\n return value;\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA;;AAEG;MAIU,2BAA2B,CAAA;AACtC,IAAA,SAAS,CAAC,KAAa,EAAA;AACrB,QAAA,IAAI;AACF,YAAA,OAAO,kBAAkB,CAAC,KAAK,CAAC;QAClC;AAAE,QAAA,MAAM;AACN,YAAA,OAAO,KAAK;QACd;IACF;8GAPW,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAA3B,2BAA2B,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,oBAAA,EAAA,CAAA,CAAA;;2FAA3B,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAHvC,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,oBAAoB;AAC3B,iBAAA;;;ACPD;;AAEG;;;;"}
@@ -2,18 +2,20 @@ import * as i0 from '@angular/core';
2
2
  import { Pipe } from '@angular/core';
3
3
  import { extractValue } from '@ng-doc/core/helpers/extract-value';
4
4
 
5
+ /**
6
+ * Parses the string form of a value (for example a default value of a playground property).
7
+ */
5
8
  class NgDocExtractValuePipe {
6
9
  transform(value) {
7
10
  return extractValue(value);
8
11
  }
9
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocExtractValuePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
10
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.0.6", ngImport: i0, type: NgDocExtractValuePipe, isStandalone: true, name: "ngDocExtractValue" }); }
12
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocExtractValuePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
13
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.2.1", ngImport: i0, type: NgDocExtractValuePipe, isStandalone: true, name: "ngDocExtractValue" }); }
11
14
  }
12
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocExtractValuePipe, decorators: [{
15
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocExtractValuePipe, decorators: [{
13
16
  type: Pipe,
14
17
  args: [{
15
18
  name: 'ngDocExtractValue',
16
- standalone: true,
17
19
  }]
18
20
  }] });
19
21
 
@@ -1 +1 @@
1
- {"version":3,"file":"ng-doc-app-pipes-extract-value.mjs","sources":["../../../../libs/app/pipes/extract-value/extract-value.pipe.ts","../../../../libs/app/pipes/extract-value/ng-doc-app-pipes-extract-value.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\nimport { extractValue } from '@ng-doc/core/helpers/extract-value';\nimport { NgDocExtractedValue } from '@ng-doc/core/types/extracted-value';\n\n@Pipe({\n\tname: 'ngDocExtractValue',\n\tstandalone: true,\n})\nexport class NgDocExtractValuePipe implements PipeTransform {\n\ttransform(value: string): NgDocExtractedValue {\n\t\treturn extractValue(value);\n\t}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAQa,qBAAqB,CAAA;AACjC,IAAA,SAAS,CAAC,KAAa,EAAA;AACtB,QAAA,OAAO,YAAY,CAAC,KAAK,CAAC;IAC3B;8GAHY,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAArB,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,mBAAA,EAAA,CAAA,CAAA;;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAJjC,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACL,oBAAA,IAAI,EAAE,mBAAmB;AACzB,oBAAA,UAAU,EAAE,IAAI;AAChB,iBAAA;;;ACPD;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-doc-app-pipes-extract-value.mjs","sources":["../../../../libs/app/pipes/extract-value/extract-value.pipe.ts","../../../../libs/app/pipes/extract-value/ng-doc-app-pipes-extract-value.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\nimport { extractValue } from '@ng-doc/core/helpers/extract-value';\nimport { NgDocExtractedValue } from '@ng-doc/core/types/extracted-value';\n\n/**\n * Parses the string form of a value (for example a default value of a playground property).\n */\n@Pipe({\n name: 'ngDocExtractValue',\n})\nexport class NgDocExtractValuePipe implements PipeTransform {\n transform(value: string): NgDocExtractedValue {\n return extractValue(value);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAIA;;AAEG;MAIU,qBAAqB,CAAA;AAChC,IAAA,SAAS,CAAC,KAAa,EAAA;AACrB,QAAA,OAAO,YAAY,CAAC,KAAK,CAAC;IAC5B;8GAHW,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAArB,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,mBAAA,EAAA,CAAA,CAAA;;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAHjC,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,mBAAmB;AAC1B,iBAAA;;;ACTD;;AAEG;;;;"}
@@ -1,18 +1,21 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Pipe } from '@angular/core';
3
3
 
4
+ /**
5
+ * Keeps the items that match a search term. By default an item matches when its string form
6
+ * equals the term.
7
+ */
4
8
  class NgDocFilterByTextPipe {
5
9
  transform(items, searchTerm, matcher = (item, s) => String(item) === s) {
6
10
  return items?.filter((item) => matcher(item, searchTerm)) ?? [];
7
11
  }
8
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocFilterByTextPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
9
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.0.6", ngImport: i0, type: NgDocFilterByTextPipe, isStandalone: true, name: "ngDocFilterByText" }); }
12
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocFilterByTextPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
13
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.2.1", ngImport: i0, type: NgDocFilterByTextPipe, isStandalone: true, name: "ngDocFilterByText" }); }
10
14
  }
11
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocFilterByTextPipe, decorators: [{
15
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocFilterByTextPipe, decorators: [{
12
16
  type: Pipe,
13
17
  args: [{
14
18
  name: 'ngDocFilterByText',
15
- standalone: true,
16
19
  }]
17
20
  }] });
18
21
 
@@ -1 +1 @@
1
- {"version":3,"file":"ng-doc-app-pipes-filter-by-text.mjs","sources":["../../../../libs/app/pipes/filter-by-text/filter-by-text.pipe.ts","../../../../libs/app/pipes/filter-by-text/ng-doc-app-pipes-filter-by-text.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n\tname: 'ngDocFilterByText',\n\tstandalone: true,\n})\nexport class NgDocFilterByTextPipe<T> implements PipeTransform {\n\ttransform(\n\t\titems: readonly T[],\n\t\tsearchTerm: string,\n\t\tmatcher: (item: T, searchTerm: string) => boolean = (item: T, s: string) => String(item) === s,\n\t): readonly T[] {\n\t\treturn items?.filter((item: T) => matcher(item, searchTerm)) ?? [];\n\t}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAMa,qBAAqB,CAAA;AACjC,IAAA,SAAS,CACR,KAAmB,EACnB,UAAkB,EAClB,OAAA,GAAoD,CAAC,IAAO,EAAE,CAAS,KAAK,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAA;AAE9F,QAAA,OAAO,KAAK,EAAE,MAAM,CAAC,CAAC,IAAO,KAAK,OAAO,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,IAAI,EAAE;IACnE;8GAPY,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAArB,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,mBAAA,EAAA,CAAA,CAAA;;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAJjC,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACL,oBAAA,IAAI,EAAE,mBAAmB;AACzB,oBAAA,UAAU,EAAE,IAAI;AAChB,iBAAA;;;ACLD;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-doc-app-pipes-filter-by-text.mjs","sources":["../../../../libs/app/pipes/filter-by-text/filter-by-text.pipe.ts","../../../../libs/app/pipes/filter-by-text/ng-doc-app-pipes-filter-by-text.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\n\n/**\n * Keeps the items that match a search term. By default an item matches when its string form\n * equals the term.\n */\n@Pipe({\n name: 'ngDocFilterByText',\n})\nexport class NgDocFilterByTextPipe<T> implements PipeTransform {\n transform(\n items: readonly T[],\n searchTerm: string,\n matcher: (item: T, searchTerm: string) => boolean = (item: T, s: string) => String(item) === s,\n ): readonly T[] {\n return items?.filter((item: T) => matcher(item, searchTerm)) ?? [];\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA;;;AAGG;MAIU,qBAAqB,CAAA;AAChC,IAAA,SAAS,CACP,KAAmB,EACnB,UAAkB,EAClB,OAAA,GAAoD,CAAC,IAAO,EAAE,CAAS,KAAK,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAA;AAE9F,QAAA,OAAO,KAAK,EAAE,MAAM,CAAC,CAAC,IAAO,KAAK,OAAO,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,IAAI,EAAE;IACpE;8GAPW,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAArB,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,mBAAA,EAAA,CAAA,CAAA;;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAHjC,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,mBAAmB;AAC1B,iBAAA;;;ACRD;;AAEG;;;;"}
@@ -2,6 +2,10 @@ import * as i0 from '@angular/core';
2
2
  import { inject, Pipe } from '@angular/core';
3
3
  import { DomSanitizer } from '@angular/platform-browser';
4
4
 
5
+ /**
6
+ * Marks HTML as trusted, so it can be bound to `innerHTML` without sanitization. Use it only for
7
+ * HTML that NgDoc generated.
8
+ */
5
9
  class NgDocSanitizeHtmlPipe {
6
10
  constructor() {
7
11
  this.sanitizer = inject(DomSanitizer);
@@ -9,16 +13,15 @@ class NgDocSanitizeHtmlPipe {
9
13
  transform(value) {
10
14
  return this.sanitizer.bypassSecurityTrustHtml(value);
11
15
  }
12
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocSanitizeHtmlPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
13
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.0.6", ngImport: i0, type: NgDocSanitizeHtmlPipe, isStandalone: true, name: "ngDocSanitizeHtml" }); }
16
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocSanitizeHtmlPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
17
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.2.1", ngImport: i0, type: NgDocSanitizeHtmlPipe, isStandalone: true, name: "ngDocSanitizeHtml" }); }
14
18
  }
15
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocSanitizeHtmlPipe, decorators: [{
19
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocSanitizeHtmlPipe, decorators: [{
16
20
  type: Pipe,
17
21
  args: [{
18
22
  name: 'ngDocSanitizeHtml',
19
- standalone: true,
20
23
  }]
21
- }], ctorParameters: () => [] });
24
+ }] });
22
25
 
23
26
  /**
24
27
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"ng-doc-app-pipes-sanitize-html.mjs","sources":["../../../../libs/app/pipes/sanitize-html/sanitize-html.pipe.ts","../../../../libs/app/pipes/sanitize-html/ng-doc-app-pipes-sanitize-html.ts"],"sourcesContent":["import { inject, Pipe, PipeTransform } from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\n\n@Pipe({\n name: 'ngDocSanitizeHtml',\n standalone: true,\n})\nexport class NgDocSanitizeHtmlPipe implements PipeTransform {\n private readonly sanitizer = inject(DomSanitizer);\n\n /** Inserted by Angular inject() migration for backwards compatibility */\n constructor(...args: unknown[]);\n\n constructor() {}\n\n transform(value: string): SafeHtml {\n return this.sanitizer.bypassSecurityTrustHtml(value);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAOa,qBAAqB,CAAA;AAMhC,IAAA,WAAA,GAAA;AALiB,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC;IAKlC;AAEf,IAAA,SAAS,CAAC,KAAa,EAAA;QACrB,OAAO,IAAI,CAAC,SAAS,CAAC,uBAAuB,CAAC,KAAK,CAAC;IACtD;8GAVW,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAArB,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,mBAAA,EAAA,CAAA,CAAA;;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAJjC,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,mBAAmB;AACzB,oBAAA,UAAU,EAAE,IAAI;AACjB,iBAAA;;;ACND;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-doc-app-pipes-sanitize-html.mjs","sources":["../../../../libs/app/pipes/sanitize-html/sanitize-html.pipe.ts","../../../../libs/app/pipes/sanitize-html/ng-doc-app-pipes-sanitize-html.ts"],"sourcesContent":["import { inject, Pipe, PipeTransform } from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\n\n/**\n * Marks HTML as trusted, so it can be bound to `innerHTML` without sanitization. Use it only for\n * HTML that NgDoc generated.\n */\n@Pipe({\n name: 'ngDocSanitizeHtml',\n})\nexport class NgDocSanitizeHtmlPipe implements PipeTransform {\n private readonly sanitizer = inject(DomSanitizer);\n\n transform(value: string): SafeHtml {\n return this.sanitizer.bypassSecurityTrustHtml(value);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAGA;;;AAGG;MAIU,qBAAqB,CAAA;AAHlC,IAAA,WAAA,GAAA;AAImB,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC;AAKlD,IAAA;AAHC,IAAA,SAAS,CAAC,KAAa,EAAA;QACrB,OAAO,IAAI,CAAC,SAAS,CAAC,uBAAuB,CAAC,KAAK,CAAC;IACtD;8GALW,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA,CAAA;4GAArB,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,mBAAA,EAAA,CAAA,CAAA;;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAHjC,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,mBAAmB;AAC1B,iBAAA;;;ACTD;;AAEG;;;;"}
@@ -1,17 +1,45 @@
1
1
  import * as i0 from '@angular/core';
2
- import { EventEmitter, inject, ElementRef, ViewContainerRef, ApplicationRef, Injector, Renderer2, Output, Input, HostBinding, ChangeDetectionStrategy, Component } from '@angular/core';
2
+ import { input, output, inject, ElementRef, ViewContainerRef, ApplicationRef, Injector, Renderer2, ErrorHandler, effect, untracked, DestroyRef, SecurityContext, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { outputFromObservable } from '@angular/core/rxjs-interop';
4
+ import { DomSanitizer } from '@angular/platform-browser';
3
5
  import { NG_DOC_PAGE_PROCESSOR, NG_DOC_PAGE_CUSTOM_PROCESSOR } from '@ng-doc/app/tokens';
4
6
  import { asArray } from '@ng-doc/core/helpers/as-array';
5
7
  import { objectKeys } from '@ng-doc/core/helpers/object-keys';
8
+ import { Subject } from 'rxjs';
6
9
 
7
10
  /**
8
- * Base processor class to create a processor directive that will be used to replace
9
- * html nodes with an Angular component.
11
+ * Renders HTML into its host element and replaces the nodes that the page processors
12
+ * (`NG_DOC_PAGE_PROCESSOR`, `NG_DOC_PAGE_CUSTOM_PROCESSOR`) select with Angular components.
13
+ *
14
+ * Each change of the HTML or of `contentVersion` destroys the components of the previous pass
15
+ * and schedules a new pass for the next microtask, after the HTML is in the DOM. A pass that a
16
+ * newer change superseded, or that ends after the component is destroyed, emits nothing.
10
17
  */
11
18
  class NgDocPageProcessorComponent {
12
19
  constructor() {
13
- this.html = '';
14
- this.afterRender = new EventEmitter();
20
+ /** The HTML to render and process. */
21
+ this.html = input('', { ...(ngDevMode ? { debugName: "html" } : /* istanbul ignore next */ {}), alias: 'ngDocPageProcessor' });
22
+ /** Version of the HTML. A new version processes the HTML again, even when it is unchanged. */
23
+ this.contentVersion = input(0, /* @ts-ignore */
24
+ ...(ngDevMode ? [{ debugName: "contentVersion" }] : /* istanbul ignore next */ []));
25
+ /**
26
+ * Emits the version of a pass after its components are created and before they render, in the
27
+ * same task, so that a listener can reveal the content they will measure.
28
+ * @internal
29
+ */
30
+ this.beforeRender = output();
31
+ /** Emits after a pass has created its components and rendered them. */
32
+ this.afterRender = output();
33
+ /** Emits the version of each pass that completed. */
34
+ this.contentProcessed = output();
35
+ this.processingErrors = new Subject();
36
+ /**
37
+ * Emits the version and the error of a pass that a processor failed. Without a listener, the
38
+ * error goes to the `ErrorHandler` instead.
39
+ */
40
+ // Built from a subject so the component can tell whether anything listens, which an
41
+ // `output()` does not expose.
42
+ this.processingError = outputFromObservable(this.processingErrors);
15
43
  this.processors = inject(NG_DOC_PAGE_PROCESSOR, { optional: true }) ?? [];
16
44
  this.customProcessors = inject(NG_DOC_PAGE_CUSTOM_PROCESSOR, { optional: true }) ??
17
45
  [];
@@ -20,15 +48,56 @@ class NgDocPageProcessorComponent {
20
48
  this.applicationRef = inject(ApplicationRef);
21
49
  this.injector = inject(Injector);
22
50
  this.renderer = inject(Renderer2);
51
+ this.errorHandler = inject(ErrorHandler);
52
+ this.sanitizer = inject(DomSanitizer);
53
+ this.scheduledVersion = 0;
54
+ this.destroyed = false;
55
+ effect(() => {
56
+ const html = this.html();
57
+ const version = this.contentVersion();
58
+ untracked(() => this.schedule(html, version));
59
+ });
60
+ inject(DestroyRef).onDestroy(() => {
61
+ this.destroyed = true;
62
+ this.scheduledVersion++;
63
+ this.viewContainerRef.clear();
64
+ });
23
65
  }
24
- ngOnChanges({ html }) {
25
- if (html) {
26
- Promise.resolve().then(() => {
66
+ schedule(html, version) {
67
+ const scheduled = ++this.scheduledVersion;
68
+ const unchanged = this.scheduledHtml !== undefined && this.scheduledHtml.value === html;
69
+ this.scheduledHtml = { value: html };
70
+ // Clearing destroys the components of the previous pass, and with them the nodes they
71
+ // replaced in the HTML.
72
+ this.viewContainerRef.clear();
73
+ if (unchanged) {
74
+ // A new version of the same HTML (a retry): the host binding does not write an unchanged
75
+ // value again, so restore the HTML here, sanitized the way the binding sanitizes it.
76
+ this.renderer.setProperty(this.elementRef.nativeElement, 'innerHTML', this.sanitizer.sanitize(SecurityContext.HTML, html) ?? '');
77
+ }
78
+ // A changed HTML is written by the host binding later in this change detection pass, so the
79
+ // processors run once it is done.
80
+ void Promise.resolve().then(() => {
81
+ if (this.destroyed || scheduled !== this.scheduledVersion)
82
+ return;
83
+ try {
27
84
  asArray(this.processors, this.customProcessors).forEach(this.process.bind(this));
85
+ if (this.destroyed || scheduled !== this.scheduledVersion)
86
+ return;
87
+ this.beforeRender.emit(version);
28
88
  this.applicationRef.tick();
29
89
  this.afterRender.emit();
30
- });
31
- }
90
+ this.contentProcessed.emit(version);
91
+ }
92
+ catch (error) {
93
+ if (!this.destroyed && scheduled === this.scheduledVersion) {
94
+ if (this.processingErrors.observed)
95
+ this.processingErrors.next({ version, error });
96
+ else
97
+ this.errorHandler.handleError(error);
98
+ }
99
+ }
100
+ });
32
101
  }
33
102
  process(processor) {
34
103
  Array.from(this.elementRef.nativeElement.querySelectorAll(processor.selector)).forEach((elementNode) => {
@@ -52,26 +121,20 @@ class NgDocPageProcessorComponent {
52
121
  }
53
122
  });
54
123
  }
55
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocPageProcessorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
56
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: NgDocPageProcessorComponent, isStandalone: true, selector: "[ngDocPageProcessor]", inputs: { html: ["ngDocPageProcessor", "html"] }, outputs: { afterRender: "afterRender" }, host: { properties: { "innerHTML": "this.html" } }, usesOnChanges: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
124
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocPageProcessorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
125
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.2.1", type: NgDocPageProcessorComponent, isStandalone: true, selector: "[ngDocPageProcessor]", inputs: { html: { classPropertyName: "html", publicName: "ngDocPageProcessor", isSignal: true, isRequired: false, transformFunction: null }, contentVersion: { classPropertyName: "contentVersion", publicName: "contentVersion", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { beforeRender: "beforeRender", afterRender: "afterRender", contentProcessed: "contentProcessed", processingError: "processingError" }, host: { properties: { "innerHTML": "html()" } }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
57
126
  }
58
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocPageProcessorComponent, decorators: [{
127
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocPageProcessorComponent, decorators: [{
59
128
  type: Component,
60
129
  args: [{
61
130
  selector: '[ngDocPageProcessor]',
62
- standalone: true,
63
131
  template: '<ng-content></ng-content>',
64
132
  changeDetection: ChangeDetectionStrategy.OnPush,
133
+ host: {
134
+ '[innerHTML]': 'html()',
135
+ },
65
136
  }]
66
- }], propDecorators: { html: [{
67
- type: Input,
68
- args: [{ required: true, alias: 'ngDocPageProcessor' }]
69
- }, {
70
- type: HostBinding,
71
- args: ['innerHTML']
72
- }], afterRender: [{
73
- type: Output
74
- }] } });
137
+ }], ctorParameters: () => [], propDecorators: { html: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngDocPageProcessor", required: false }] }], contentVersion: [{ type: i0.Input, args: [{ isSignal: true, alias: "contentVersion", required: false }] }], beforeRender: [{ type: i0.Output, args: ["beforeRender"] }], afterRender: [{ type: i0.Output, args: ["afterRender"] }], contentProcessed: [{ type: i0.Output, args: ["contentProcessed"] }], processingError: [{ type: i0.Output, args: ["processingError"] }] } });
75
138
 
76
139
  /**
77
140
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"ng-doc-app-processors-page-processor.mjs","sources":["../../../../libs/app/processors/page-processor/page-processor.component.ts","../../../../libs/app/processors/page-processor/ng-doc-app-processors-page-processor.ts"],"sourcesContent":["import {\n ApplicationRef,\n ChangeDetectionStrategy,\n Component,\n ComponentRef,\n ElementRef,\n EventEmitter,\n HostBinding,\n inject,\n Injector,\n Input,\n OnChanges,\n Output,\n Renderer2,\n SimpleChanges,\n ViewContainerRef,\n} from '@angular/core';\nimport { SafeHtml } from '@angular/platform-browser';\nimport { NgDocPageProcessor, NgDocProcessorOptions } from '@ng-doc/app/interfaces';\nimport { NG_DOC_PAGE_CUSTOM_PROCESSOR, NG_DOC_PAGE_PROCESSOR } from '@ng-doc/app/tokens';\nimport { asArray } from '@ng-doc/core/helpers/as-array';\nimport { objectKeys } from '@ng-doc/core/helpers/object-keys';\n\n/**\n * Base processor class to create a processor directive that will be used to replace\n * html nodes with an Angular component.\n */\n@Component({\n selector: '[ngDocPageProcessor]',\n standalone: true,\n template: '<ng-content></ng-content>',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgDocPageProcessorComponent implements OnChanges {\n @Input({ required: true, alias: 'ngDocPageProcessor' })\n @HostBinding('innerHTML')\n html: SafeHtml = '';\n\n @Output()\n afterRender: EventEmitter<void> = new EventEmitter<void>();\n\n processors: Array<NgDocPageProcessor<unknown>> =\n inject<Array<NgDocPageProcessor<unknown>>>(NG_DOC_PAGE_PROCESSOR, { optional: true }) ?? [];\n customProcessors: Array<NgDocPageProcessor<unknown>> =\n inject<Array<NgDocPageProcessor<unknown>>>(NG_DOC_PAGE_CUSTOM_PROCESSOR, { optional: true }) ??\n [];\n\n protected readonly elementRef: ElementRef<HTMLElement> = inject(ElementRef);\n protected readonly viewContainerRef: ViewContainerRef = inject(ViewContainerRef);\n protected readonly applicationRef = inject(ApplicationRef);\n protected readonly injector: Injector = inject(Injector);\n protected readonly renderer: Renderer2 = inject(Renderer2);\n\n ngOnChanges({ html }: SimpleChanges): void {\n if (html) {\n Promise.resolve().then(() => {\n asArray(this.processors, this.customProcessors).forEach(this.process.bind(this));\n this.applicationRef.tick();\n this.afterRender.emit();\n });\n }\n }\n\n private process<T>(processor: NgDocPageProcessor<T>): void {\n Array.from(this.elementRef.nativeElement.querySelectorAll(processor.selector)).forEach(\n (elementNode: Element) => {\n // check if element node has a parent node because it can be removed by another processor\n if (elementNode.parentNode) {\n const replaceElement: Element =\n (processor.nodeToReplace && processor.nodeToReplace(elementNode, this.injector)) ??\n elementNode;\n const options: NgDocProcessorOptions<T> = processor.extractOptions(\n elementNode,\n this.elementRef.nativeElement,\n );\n\n // create component\n const componentRef: ComponentRef<T> = this.viewContainerRef.createComponent(\n processor.component,\n {\n projectableNodes: options.content,\n injector: this.injector,\n },\n );\n\n // set component options\n if (options.inputs) {\n objectKeys(options.inputs).forEach(\n (key: keyof T) =>\n options.inputs && componentRef.setInput(key as string, options.inputs[key]),\n );\n }\n\n // replace element node with component node\n replaceElement.parentNode?.replaceChild(\n componentRef.location.nativeElement,\n replaceElement,\n );\n\n componentRef.changeDetectorRef.markForCheck();\n }\n },\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAuBA;;;AAGG;MAOU,2BAA2B,CAAA;AANxC,IAAA,WAAA,GAAA;QASE,IAAA,CAAA,IAAI,GAAa,EAAE;AAGnB,QAAA,IAAA,CAAA,WAAW,GAAuB,IAAI,YAAY,EAAQ;AAE1D,QAAA,IAAA,CAAA,UAAU,GACR,MAAM,CAAqC,qBAAqB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE;QAC7F,IAAA,CAAA,gBAAgB,GACd,MAAM,CAAqC,4BAA4B,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC5F,YAAA,EAAE;AAEe,QAAA,IAAA,CAAA,UAAU,GAA4B,MAAM,CAAC,UAAU,CAAC;AACxD,QAAA,IAAA,CAAA,gBAAgB,GAAqB,MAAM,CAAC,gBAAgB,CAAC;AAC7D,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;AACvC,QAAA,IAAA,CAAA,QAAQ,GAAa,MAAM,CAAC,QAAQ,CAAC;AACrC,QAAA,IAAA,CAAA,QAAQ,GAAc,MAAM,CAAC,SAAS,CAAC;AAqD3D,IAAA;IAnDC,WAAW,CAAC,EAAE,IAAI,EAAiB,EAAA;QACjC,IAAI,IAAI,EAAE;AACR,YAAA,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,MAAK;gBAC1B,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,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YAC/C;AACF,QAAA,CAAC,CACF;IACH;8GAtEW,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAA3B,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,2BAA2B,oPAH5B,2BAA2B,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAG1B,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBANvC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,sBAAsB;AAChC,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,2BAA2B;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAChD,iBAAA;;sBAEE,KAAK;AAAC,gBAAA,IAAA,EAAA,CAAA,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,oBAAoB,EAAE;;sBACrD,WAAW;uBAAC,WAAW;;sBAGvB;;;ACtCH;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-doc-app-processors-page-processor.mjs","sources":["../../../../libs/app/processors/page-processor/page-processor.component.ts","../../../../libs/app/processors/page-processor/ng-doc-app-processors-page-processor.ts"],"sourcesContent":["import {\n ApplicationRef,\n ChangeDetectionStrategy,\n Component,\n ComponentRef,\n DestroyRef,\n effect,\n ElementRef,\n ErrorHandler,\n inject,\n Injector,\n input,\n output,\n OutputRef,\n Renderer2,\n SecurityContext,\n untracked,\n ViewContainerRef,\n} from '@angular/core';\nimport { outputFromObservable } from '@angular/core/rxjs-interop';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport type { NgDocContentRenderFailure } from '@ng-doc/app/classes/content-controller';\nimport type { NgDocPageProcessor, NgDocProcessorOptions } from '@ng-doc/app/interfaces';\nimport { NG_DOC_PAGE_CUSTOM_PROCESSOR, NG_DOC_PAGE_PROCESSOR } from '@ng-doc/app/tokens';\nimport { asArray } from '@ng-doc/core/helpers/as-array';\nimport { objectKeys } from '@ng-doc/core/helpers/object-keys';\nimport { Subject } from 'rxjs';\n\n/**\n * Renders HTML into its host element and replaces the nodes that the page processors\n * (`NG_DOC_PAGE_PROCESSOR`, `NG_DOC_PAGE_CUSTOM_PROCESSOR`) select with Angular components.\n *\n * Each change of the HTML or of `contentVersion` destroys the components of the previous pass\n * and schedules a new pass for the next microtask, after the HTML is in the DOM. A pass that a\n * newer change superseded, or that ends after the component is destroyed, emits nothing.\n */\n@Component({\n selector: '[ngDocPageProcessor]',\n template: '<ng-content></ng-content>',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[innerHTML]': 'html()',\n },\n})\nexport class NgDocPageProcessorComponent {\n /** The HTML to render and process. */\n readonly html = input<SafeHtml>('', { alias: 'ngDocPageProcessor' });\n\n /** Version of the HTML. A new version processes the HTML again, even when it is unchanged. */\n readonly contentVersion = input(0);\n\n /**\n * Emits the version of a pass after its components are created and before they render, in the\n * same task, so that a listener can reveal the content they will measure.\n * @internal\n */\n readonly beforeRender = output<number>();\n\n /** Emits after a pass has created its components and rendered them. */\n readonly afterRender = output<void>();\n\n /** Emits the version of each pass that completed. */\n readonly contentProcessed = output<number>();\n\n private readonly processingErrors = new Subject<NgDocContentRenderFailure>();\n\n /**\n * Emits the version and the error of a pass that a processor failed. Without a listener, the\n * error goes to the `ErrorHandler` instead.\n */\n // Built from a subject so the component can tell whether anything listens, which an\n // `output()` does not expose.\n readonly processingError: OutputRef<NgDocContentRenderFailure> = outputFromObservable(\n this.processingErrors,\n );\n\n processors: Array<NgDocPageProcessor<unknown>> =\n inject<Array<NgDocPageProcessor<unknown>>>(NG_DOC_PAGE_PROCESSOR, { optional: true }) ?? [];\n customProcessors: Array<NgDocPageProcessor<unknown>> =\n inject<Array<NgDocPageProcessor<unknown>>>(NG_DOC_PAGE_CUSTOM_PROCESSOR, { optional: true }) ??\n [];\n\n protected readonly elementRef: ElementRef<HTMLElement> = inject(ElementRef);\n protected readonly viewContainerRef: ViewContainerRef = inject(ViewContainerRef);\n protected readonly applicationRef = inject(ApplicationRef);\n protected readonly injector: Injector = inject(Injector);\n protected readonly renderer: Renderer2 = inject(Renderer2);\n protected readonly errorHandler = inject(ErrorHandler);\n\n private readonly sanitizer = inject(DomSanitizer);\n private scheduledVersion = 0;\n private scheduledHtml?: { readonly value: SafeHtml };\n private destroyed = false;\n\n constructor() {\n effect(() => {\n const html = this.html();\n const version = this.contentVersion();\n\n untracked(() => this.schedule(html, version));\n });\n\n inject(DestroyRef).onDestroy(() => {\n this.destroyed = true;\n this.scheduledVersion++;\n this.viewContainerRef.clear();\n });\n }\n\n private schedule(html: SafeHtml, version: number): void {\n const scheduled = ++this.scheduledVersion;\n const unchanged = this.scheduledHtml !== undefined && this.scheduledHtml.value === html;\n this.scheduledHtml = { value: html };\n // Clearing destroys the components of the previous pass, and with them the nodes they\n // replaced in the HTML.\n this.viewContainerRef.clear();\n if (unchanged) {\n // A new version of the same HTML (a retry): the host binding does not write an unchanged\n // value again, so restore the HTML here, sanitized the way the binding sanitizes it.\n this.renderer.setProperty(\n this.elementRef.nativeElement,\n 'innerHTML',\n this.sanitizer.sanitize(SecurityContext.HTML, html) ?? '',\n );\n }\n // A changed HTML is written by the host binding later in this change detection pass, so the\n // processors run once it is done.\n void Promise.resolve().then(() => {\n if (this.destroyed || scheduled !== this.scheduledVersion) return;\n try {\n asArray(this.processors, this.customProcessors).forEach(this.process.bind(this));\n if (this.destroyed || scheduled !== this.scheduledVersion) return;\n this.beforeRender.emit(version);\n this.applicationRef.tick();\n this.afterRender.emit();\n this.contentProcessed.emit(version);\n } catch (error) {\n if (!this.destroyed && scheduled === this.scheduledVersion) {\n if (this.processingErrors.observed) this.processingErrors.next({ version, error });\n else this.errorHandler.handleError(error);\n }\n }\n });\n }\n\n private process<T>(processor: NgDocPageProcessor<T>): void {\n Array.from(this.elementRef.nativeElement.querySelectorAll(processor.selector)).forEach(\n (elementNode: Element) => {\n // check if element node has a parent node because it can be removed by another processor\n if (elementNode.parentNode) {\n const replaceElement: Element =\n (processor.nodeToReplace && processor.nodeToReplace(elementNode, this.injector)) ??\n elementNode;\n const options: NgDocProcessorOptions<T> = processor.extractOptions(\n elementNode,\n this.elementRef.nativeElement,\n );\n\n // create component\n const componentRef: ComponentRef<T> = this.viewContainerRef.createComponent(\n processor.component,\n {\n projectableNodes: options.content,\n injector: this.injector,\n },\n );\n\n // set component options\n if (options.inputs) {\n objectKeys(options.inputs).forEach(\n (key: keyof T) =>\n options.inputs && componentRef.setInput(key as string, options.inputs[key]),\n );\n }\n\n // replace element node with component node\n replaceElement.parentNode?.replaceChild(\n componentRef.location.nativeElement,\n replaceElement,\n );\n\n componentRef.changeDetectorRef.markForCheck();\n }\n },\n );\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AA4BA;;;;;;;AAOG;MASU,2BAA2B,CAAA;AAkDtC,IAAA,WAAA,GAAA;;QAhDS,IAAA,CAAA,IAAI,GAAG,KAAK,CAAW,EAAE,4EAAI,KAAK,EAAE,oBAAoB,EAAA,CAAG;;QAG3D,IAAA,CAAA,cAAc,GAAG,KAAK,CAAC,CAAC;2FAAC;AAElC;;;;AAIG;QACM,IAAA,CAAA,YAAY,GAAG,MAAM,EAAU;;QAG/B,IAAA,CAAA,WAAW,GAAG,MAAM,EAAQ;;QAG5B,IAAA,CAAA,gBAAgB,GAAG,MAAM,EAAU;AAE3B,QAAA,IAAA,CAAA,gBAAgB,GAAG,IAAI,OAAO,EAA6B;AAE5E;;;AAGG;;;AAGM,QAAA,IAAA,CAAA,eAAe,GAAyC,oBAAoB,CACnF,IAAI,CAAC,gBAAgB,CACtB;AAED,QAAA,IAAA,CAAA,UAA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YAAY,CAAC,iBAAiB,CAAC,YAAY,EAAE;YAC/C;AACF,QAAA,CAAC,CACF;IACH;8GA7IW,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAA3B,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,2BAA2B,ojBAN5B,2BAA2B,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAM1B,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBARvC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,sBAAsB;AAChC,oBAAA,QAAQ,EAAE,2BAA2B;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,IAAI,EAAE;AACJ,wBAAA,aAAa,EAAE,QAAQ;AACxB,qBAAA;AACF,iBAAA;;;AC3CD;;AAEG;;;;"}
@@ -1,49 +1,50 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, ChangeDetectorRef, ElementRef, ViewChild, Input, ChangeDetectionStrategy, Component } from '@angular/core';
2
+ import { input, signal, viewChild, ElementRef, afterNextRender, ChangeDetectionStrategy, Component } from '@angular/core';
3
3
  import { NgDocTooltipDirective } from '@ng-doc/ui-kit';
4
4
 
5
5
  class NgDocTooltipWrapperComponent {
6
6
  constructor() {
7
- this.changeDetectorRef = inject(ChangeDetectorRef);
8
- this.tooltipElement = null;
7
+ this.content = input(/* @ts-ignore */
8
+ ...(ngDevMode ? [undefined, { debugName: "content" }] : /* istanbul ignore next */ []));
9
+ this.tooltipElement = signal(null, /* @ts-ignore */
10
+ ...(ngDevMode ? [{ debugName: "tooltipElement" }] : /* istanbul ignore next */ []));
11
+ this.contentProjection = viewChild.required('contentProjection', { ...(ngDevMode ? { debugName: "contentProjection" } : /* istanbul ignore next */ {}), read: ElementRef });
12
+ // The tooltip points at the projected element, which is only in the DOM after the first
13
+ // render. On the server nothing opens a tooltip, so the wrapper is origin enough there.
14
+ afterNextRender(() => {
15
+ const element = this.contentProjection().nativeElement.querySelector('[ngDocTooltip]');
16
+ this.tooltipElement.set(element instanceof HTMLElement ? element : null);
17
+ });
9
18
  }
10
- ngAfterViewInit() {
11
- if (this.contentProjection) {
12
- const element = this.contentProjection.nativeElement.querySelector('[ngDocTooltip]');
13
- this.tooltipElement = element instanceof HTMLElement ? element : null;
14
- this.changeDetectorRef.detectChanges();
15
- }
16
- }
17
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocTooltipWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
18
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: NgDocTooltipWrapperComponent, isStandalone: true, selector: "ng-doc-tooltip-wrapper", inputs: { content: "content" }, viewQueries: [{ propertyName: "contentProjection", first: true, predicate: ["contentProjection"], descendants: true, read: ElementRef, static: true }], ngImport: i0, template: `
19
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocTooltipWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
20
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.2.1", type: NgDocTooltipWrapperComponent, isStandalone: true, selector: "ng-doc-tooltip-wrapper", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "contentProjection", first: true, predicate: ["contentProjection"], descendants: true, read: ElementRef, isSignal: true }], ngImport: i0, template: `
19
21
  <div
20
22
  class="content-projection"
21
- [ngDocTooltip]="content ?? ''"
22
- [displayOrigin]="tooltipElement ?? contentProjection"
23
- [pointerOrigin]="tooltipElement ?? contentProjection"
23
+ [ngDocTooltip]="content() ?? ''"
24
+ [displayOrigin]="tooltipElement() ?? contentProjection"
25
+ [pointerOrigin]="tooltipElement() ?? contentProjection"
24
26
  #contentProjection>
25
27
  <ng-content></ng-content>
26
28
  </div>
27
29
  `, isInline: true, styles: [".content-projection{display:unset}\n"], dependencies: [{ kind: "directive", type: NgDocTooltipDirective, selector: "[ngDocTooltip]", inputs: ["ngDocTooltip", "delay", "displayOrigin", "pointerOrigin", "positions", "canOpen", "panelClass", "minHeight", "maxHeight", "height", "minWidth", "maxWidth", "width"], outputs: ["beforeOpen", "afterOpen", "beforeClose", "afterClose"], exportAs: ["ngDocTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
28
30
  }
29
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: NgDocTooltipWrapperComponent, decorators: [{
31
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocTooltipWrapperComponent, decorators: [{
30
32
  type: Component,
31
33
  args: [{ selector: 'ng-doc-tooltip-wrapper', template: `
32
34
  <div
33
35
  class="content-projection"
34
- [ngDocTooltip]="content ?? ''"
35
- [displayOrigin]="tooltipElement ?? contentProjection"
36
- [pointerOrigin]="tooltipElement ?? contentProjection"
36
+ [ngDocTooltip]="content() ?? ''"
37
+ [displayOrigin]="tooltipElement() ?? contentProjection"
38
+ [pointerOrigin]="tooltipElement() ?? contentProjection"
37
39
  #contentProjection>
38
40
  <ng-content></ng-content>
39
41
  </div>
40
42
  `, changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgDocTooltipDirective], styles: [".content-projection{display:unset}\n"] }]
41
- }], ctorParameters: () => [], propDecorators: { content: [{
42
- type: Input
43
- }], contentProjection: [{
44
- type: ViewChild,
45
- args: ['contentProjection', { read: ElementRef, static: true }]
46
- }] } });
43
+ }], ctorParameters: () => [], propDecorators: { content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: false }] }], contentProjection: [{ type: i0.ViewChild, args: ['contentProjection', { ...{ read: ElementRef }, isSignal: true }] }] } });
44
+ /**
45
+ * Wraps an element with an `ngDocTooltip` attribute in a component that shows the attribute's
46
+ * value as a tooltip.
47
+ */
47
48
  const tooltipProcessor = {
48
49
  component: NgDocTooltipWrapperComponent,
49
50
  selector: '[ngDocTooltip]',
@@ -1 +1 @@
1
- {"version":3,"file":"ng-doc-app-processors-processors-tooltip.mjs","sources":["../../../../libs/app/processors/processors/tooltip/tooltip.processor.ts","../../../../libs/app/processors/processors/tooltip/ng-doc-app-processors-processors-tooltip.ts"],"sourcesContent":["import {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n inject,\n Input,\n ViewChild,\n} from '@angular/core';\nimport { NgDocPageProcessor } from '@ng-doc/app/interfaces';\nimport { NgDocTooltipDirective } from '@ng-doc/ui-kit';\n\n@Component({\n selector: 'ng-doc-tooltip-wrapper',\n template: `\n <div\n class=\"content-projection\"\n [ngDocTooltip]=\"content ?? ''\"\n [displayOrigin]=\"tooltipElement ?? contentProjection\"\n [pointerOrigin]=\"tooltipElement ?? contentProjection\"\n #contentProjection>\n <ng-content></ng-content>\n </div>\n `,\n styles: [\n `\n .content-projection {\n display: unset;\n }\n `,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgDocTooltipDirective],\n})\nclass NgDocTooltipWrapperComponent implements AfterViewInit {\n private readonly changeDetectorRef = inject(ChangeDetectorRef);\n\n @Input()\n content?: string;\n\n protected tooltipElement: HTMLElement | null = null;\n\n @ViewChild('contentProjection', { read: ElementRef, static: true })\n private contentProjection?: ElementRef<HTMLElement>;\n\n constructor() {}\n\n ngAfterViewInit(): void {\n if (this.contentProjection) {\n const element: Element | null =\n this.contentProjection.nativeElement.querySelector('[ngDocTooltip]');\n\n this.tooltipElement = element instanceof HTMLElement ? element : null;\n\n this.changeDetectorRef.detectChanges();\n }\n }\n}\n\nexport const tooltipProcessor: NgDocPageProcessor<NgDocTooltipWrapperComponent> = {\n component: NgDocTooltipWrapperComponent,\n selector: '[ngDocTooltip]',\n extractOptions: (element: Element) => ({\n inputs: {\n content: element.getAttribute('ngDocTooltip') ?? '',\n },\n content: [[element.cloneNode(true)]],\n }),\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAaA,MAsBM,4BAA4B,CAAA;AAWhC,IAAA,WAAA,GAAA;AAViB,QAAA,IAAA,CAAA,iBAAiB,GAAG,MAAM,CAAC,iBAAiB,CAAC;QAKpD,IAAA,CAAA,cAAc,GAAuB,IAAI;IAKpC;IAEf,eAAe,GAAA;AACb,QAAA,IAAI,IAAI,CAAC,iBAAiB,EAAE;AAC1B,YAAA,MAAM,OAAO,GACX,IAAI,CAAC,iBAAiB,CAAC,aAAa,CAAC,aAAa,CAAC,gBAAgB,CAAC;AAEtE,YAAA,IAAI,CAAC,cAAc,GAAG,OAAO,YAAY,WAAW,GAAG,OAAO,GAAG,IAAI;AAErE,YAAA,IAAI,CAAC,iBAAiB,CAAC,aAAa,EAAE;QACxC;IACF;8GAtBI,4BAA4B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAA5B,4BAA4B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,wBAAA,EAAA,MAAA,EAAA,EAAA,OAAA,EAAA,SAAA,EAAA,EAAA,WAAA,EAAA,CAAA,EAAA,YAAA,EAAA,mBAAA,EAAA,KAAA,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,WAAA,EAAA,IAAA,EAAA,IAAA,EAQQ,UAAU,EAAA,MAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EA5BxC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AAI,CAAC,CAAC,CAAC;KACrC,CAAC;;;ACpEJ;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-doc-app-processors-processors-tooltip.mjs","sources":["../../../../libs/app/processors/processors/tooltip/tooltip.processor.ts","../../../../libs/app/processors/processors/tooltip/ng-doc-app-processors-processors-tooltip.ts"],"sourcesContent":["import {\n afterNextRender,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n input,\n signal,\n viewChild,\n} from '@angular/core';\nimport { NgDocPageProcessor } from '@ng-doc/app/interfaces';\nimport { NgDocTooltipDirective } from '@ng-doc/ui-kit';\n\n@Component({\n selector: 'ng-doc-tooltip-wrapper',\n template: `\n <div\n class=\"content-projection\"\n [ngDocTooltip]=\"content() ?? ''\"\n [displayOrigin]=\"tooltipElement() ?? contentProjection\"\n [pointerOrigin]=\"tooltipElement() ?? contentProjection\"\n #contentProjection>\n <ng-content></ng-content>\n </div>\n `,\n styles: [\n `\n .content-projection {\n display: unset;\n }\n `,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [NgDocTooltipDirective],\n})\nclass NgDocTooltipWrapperComponent {\n readonly content = input<string>();\n\n protected readonly tooltipElement = signal<HTMLElement | null>(null);\n\n private readonly contentProjection = viewChild.required<string, ElementRef<HTMLElement>>(\n 'contentProjection',\n { read: ElementRef },\n );\n\n constructor() {\n // The tooltip points at the projected element, which is only in the DOM after the first\n // render. On the server nothing opens a tooltip, so the wrapper is origin enough there.\n afterNextRender(() => {\n const element = this.contentProjection().nativeElement.querySelector('[ngDocTooltip]');\n\n this.tooltipElement.set(element instanceof HTMLElement ? element : null);\n });\n }\n}\n\n/**\n * Wraps an element with an `ngDocTooltip` attribute in a component that shows the attribute's\n * value as a tooltip.\n */\nexport const tooltipProcessor: NgDocPageProcessor<NgDocTooltipWrapperComponent> = {\n component: NgDocTooltipWrapperComponent,\n selector: '[ngDocTooltip]',\n extractOptions: (element: Element) => ({\n inputs: {\n content: element.getAttribute('ngDocTooltip') ?? '',\n },\n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ACnB,EAAE,IAAI,EAAE,UAAU,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;AAcxB;;;AAGG;AACI,MAAM,gBAAgB,GAAqD;AAChF,IAAA,SAAS,EAAE,4BAA4B;AACvC,IAAA,QAAQ,EAAE,gBAAgB;AAC1B,IAAA,cAAc,EAAE,CAAC,OAAgB,MAAM;AACrC,QAAA,MAAM,EAAE;YACN,OAAO,EAAE,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,IAAI,EAAE;AACpD,SAAA;QACD,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;KACrC,CAAC;;;ACnEJ;;AAEG;;;;"}
@@ -5,6 +5,7 @@ import { NgDocDemoPaneComponent } from '@ng-doc/app/components/demo-pane';
5
5
  import { NgDocHeadingAnchorComponent } from '@ng-doc/app/components/heading-anchor';
6
6
  import { Renderer2 } from '@angular/core';
7
7
  import { NgDocImageViewerComponent } from '@ng-doc/app/components/image-viewer';
8
+ import { NgDocMembersComponent } from '@ng-doc/app/components/members';
8
9
  import { NgDocMermaidViewerComponent } from '@ng-doc/app/components/mermaid-viewer';
9
10
  import { NgDocPlaygroundComponent } from '@ng-doc/app/components/playground';
10
11
  import { isPresent } from '@ng-doc/core/helpers/is-present';
@@ -20,6 +21,7 @@ const blockquoteProcessor = {
20
21
  inputs: {
21
22
  type: element.getAttribute('type') || 'default',
22
23
  icon: element.getAttribute('icon') ?? undefined,
24
+ label: element.getAttribute('label') ?? undefined,
23
25
  },
24
26
  }),
25
27
  };
@@ -98,6 +100,15 @@ const imageProcessor = {
98
100
  }),
99
101
  };
100
102
 
103
+ /** Adds the member filter to the members table of an API page (`<ng-doc-members>`). */
104
+ const membersProcessor = {
105
+ component: NgDocMembersComponent,
106
+ selector: 'ng-doc-members',
107
+ extractOptions: (element) => ({
108
+ content: [Array.from(element.childNodes)],
109
+ }),
110
+ };
111
+
101
112
  const mermaidProcessor = {
102
113
  component: NgDocMermaidViewerComponent,
103
114
  selector: 'pre.mermaid',
@@ -126,6 +137,11 @@ const playgroundProcessor = {
126
137
  }),
127
138
  };
128
139
 
140
+ /**
141
+ * Turns the `<ng-doc-tab group="…" name="…">` elements of a page into tabs: every tab of a group
142
+ * becomes one `NgDocTabsComponent`, where the first tab of the group was. Code groups are made of
143
+ * them, and Markdown can wrap any content in them.
144
+ */
129
145
  const tabsProcessor = {
130
146
  component: NgDocTabsComponent,
131
147
  selector: 'ng-doc-tab',
@@ -136,17 +152,33 @@ const tabsProcessor = {
136
152
  },
137
153
  extractOptions: (element, root) => {
138
154
  const group = element.getAttribute('group') ?? '';
139
- const tabs = Array.from(root.querySelectorAll(`ng-doc-tab[group="${group}"]`));
140
- const mappedTabs = tabs.map((tab) => ({
141
- title: tab.getAttribute('name') ?? '',
142
- content: tab,
143
- icon: tab.getAttribute('icon') || undefined,
144
- active: tab.hasAttribute('active'),
145
- }));
146
- tabs.forEach((tab) => tab.remove());
155
+ const tabs = Array.from(root.querySelectorAll('ng-doc-tab')).filter((tab) => (tab.getAttribute('group') ?? '') === group);
156
+ if (!tabs.includes(element)) {
157
+ tabs.unshift(element);
158
+ }
159
+ // The tabs stay on the page until the component first renders (`NgDocTabsComponent`), so
160
+ // the processors after this one, the page's own included, still reach their content. The
161
+ // page processor skips elements that have left the page, so the other tabs of the group are
162
+ // swapped for copies that hold their content: otherwise each would get tabs of its own.
163
+ const contents = tabs.map((tab) => {
164
+ if (tab === element || !tab.parentNode) {
165
+ return tab;
166
+ }
167
+ const copy = tab.cloneNode(false);
168
+ while (tab.firstChild) {
169
+ copy.appendChild(tab.firstChild);
170
+ }
171
+ tab.parentNode.replaceChild(copy, tab);
172
+ return copy;
173
+ });
147
174
  return {
148
175
  inputs: {
149
- tabs: mappedTabs,
176
+ tabs: tabs.map((tab, index) => ({
177
+ title: tab.getAttribute('name') ?? '',
178
+ content: contents[index],
179
+ icon: tab.getAttribute('icon') || undefined,
180
+ active: tab.hasAttribute('active'),
181
+ })),
150
182
  },
151
183
  };
152
184
  },
@@ -156,5 +188,5 @@ const tabsProcessor = {
156
188
  * Generated bundle index. Do not edit.
157
189
  */
158
190
 
159
- export { blockquoteProcessor, codeProcessor, demoPaneProcessor, demoProcessor, headingAnchorProcessor, iconProcessor, imageProcessor, mermaidProcessor, playgroundProcessor, tabsProcessor };
191
+ export { blockquoteProcessor, codeProcessor, demoPaneProcessor, demoProcessor, headingAnchorProcessor, iconProcessor, imageProcessor, membersProcessor, mermaidProcessor, playgroundProcessor, tabsProcessor };
160
192
  //# sourceMappingURL=ng-doc-app-processors-processors.mjs.map