@ng-doc/app 22.1.0 → 22.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/LICENSE +21 -0
  2. package/fesm2022/ng-doc-app-classes-content-controller.mjs +22 -4
  3. package/fesm2022/ng-doc-app-classes-content-controller.mjs.map +1 -1
  4. package/fesm2022/ng-doc-app-classes-default-search-engine.mjs +36 -12
  5. package/fesm2022/ng-doc-app-classes-default-search-engine.mjs.map +1 -1
  6. package/fesm2022/ng-doc-app-classes-root-page.mjs.map +1 -1
  7. package/fesm2022/ng-doc-app-components-api-list.mjs +7 -5
  8. package/fesm2022/ng-doc-app-components-api-list.mjs.map +1 -1
  9. package/fesm2022/ng-doc-app-components-breadcrumb.mjs +5 -3
  10. package/fesm2022/ng-doc-app-components-breadcrumb.mjs.map +1 -1
  11. package/fesm2022/ng-doc-app-components-code.mjs +6 -4
  12. package/fesm2022/ng-doc-app-components-code.mjs.map +1 -1
  13. package/fesm2022/ng-doc-app-components-command-palette.mjs +35 -27
  14. package/fesm2022/ng-doc-app-components-command-palette.mjs.map +1 -1
  15. package/fesm2022/ng-doc-app-components-copy-button.mjs +6 -4
  16. package/fesm2022/ng-doc-app-components-copy-button.mjs.map +1 -1
  17. package/fesm2022/ng-doc-app-components-demo-displayer.mjs +19 -4
  18. package/fesm2022/ng-doc-app-components-demo-displayer.mjs.map +1 -1
  19. package/fesm2022/ng-doc-app-components-demo-frame.mjs +195 -12
  20. package/fesm2022/ng-doc-app-components-demo-frame.mjs.map +1 -1
  21. package/fesm2022/ng-doc-app-components-demo-pane.mjs +2 -2
  22. package/fesm2022/ng-doc-app-components-demo-pane.mjs.map +1 -1
  23. package/fesm2022/ng-doc-app-components-demo.mjs +49 -12
  24. package/fesm2022/ng-doc-app-components-demo.mjs.map +1 -1
  25. package/fesm2022/ng-doc-app-components-fullscreen-button.mjs +5 -3
  26. package/fesm2022/ng-doc-app-components-fullscreen-button.mjs.map +1 -1
  27. package/fesm2022/ng-doc-app-components-fullscreen-toggle.mjs +4 -2
  28. package/fesm2022/ng-doc-app-components-fullscreen-toggle.mjs.map +1 -1
  29. package/fesm2022/ng-doc-app-components-heading-anchor.mjs +5 -3
  30. package/fesm2022/ng-doc-app-components-heading-anchor.mjs.map +1 -1
  31. package/fesm2022/ng-doc-app-components-image-viewer.mjs +5 -3
  32. package/fesm2022/ng-doc-app-components-image-viewer.mjs.map +1 -1
  33. package/fesm2022/ng-doc-app-components-navbar.mjs +4 -2
  34. package/fesm2022/ng-doc-app-components-navbar.mjs.map +1 -1
  35. package/fesm2022/ng-doc-app-components-page-navigation.mjs +5 -3
  36. package/fesm2022/ng-doc-app-components-page-navigation.mjs.map +1 -1
  37. package/fesm2022/ng-doc-app-components-page-wrapper.mjs +2 -2
  38. package/fesm2022/ng-doc-app-components-page-wrapper.mjs.map +1 -1
  39. package/fesm2022/ng-doc-app-components-page.mjs +83 -16
  40. package/fesm2022/ng-doc-app-components-page.mjs.map +1 -1
  41. package/fesm2022/ng-doc-app-components-playground.mjs +743 -108
  42. package/fesm2022/ng-doc-app-components-playground.mjs.map +1 -1
  43. package/fesm2022/ng-doc-app-components-root.mjs +51 -4
  44. package/fesm2022/ng-doc-app-components-root.mjs.map +1 -1
  45. package/fesm2022/ng-doc-app-components-search-result.mjs +8 -6
  46. package/fesm2022/ng-doc-app-components-search-result.mjs.map +1 -1
  47. package/fesm2022/ng-doc-app-components-search.mjs +7 -5
  48. package/fesm2022/ng-doc-app-components-search.mjs.map +1 -1
  49. package/fesm2022/ng-doc-app-components-sidebar.mjs +4 -3
  50. package/fesm2022/ng-doc-app-components-sidebar.mjs.map +1 -1
  51. package/fesm2022/ng-doc-app-components-theme-toggle.mjs +7 -5
  52. package/fesm2022/ng-doc-app-components-theme-toggle.mjs.map +1 -1
  53. package/fesm2022/ng-doc-app-components-toc.mjs +4 -2
  54. package/fesm2022/ng-doc-app-components-toc.mjs.map +1 -1
  55. package/fesm2022/ng-doc-app-constants.mjs +11 -1
  56. package/fesm2022/ng-doc-app-constants.mjs.map +1 -1
  57. package/fesm2022/ng-doc-app-demo-app.mjs +618 -15
  58. package/fesm2022/ng-doc-app-demo-app.mjs.map +1 -1
  59. package/fesm2022/ng-doc-app-helpers.mjs +125 -6
  60. package/fesm2022/ng-doc-app-helpers.mjs.map +1 -1
  61. package/fesm2022/ng-doc-app-providers-ng-doc-app.mjs +29 -18
  62. package/fesm2022/ng-doc-app-providers-ng-doc-app.mjs.map +1 -1
  63. package/fesm2022/ng-doc-app-providers-texts.mjs +53 -0
  64. package/fesm2022/ng-doc-app-providers-texts.mjs.map +1 -0
  65. package/fesm2022/ng-doc-app-providers.mjs +1 -0
  66. package/fesm2022/ng-doc-app-providers.mjs.map +1 -1
  67. package/fesm2022/ng-doc-app-services-content-scroll-intent.mjs +27 -2
  68. package/fesm2022/ng-doc-app-services-content-scroll-intent.mjs.map +1 -1
  69. package/fesm2022/ng-doc-app-services-highlighter.mjs +8 -5
  70. package/fesm2022/ng-doc-app-services-highlighter.mjs.map +1 -1
  71. package/fesm2022/ng-doc-app-services-shortcuts.mjs +38 -4
  72. package/fesm2022/ng-doc-app-services-shortcuts.mjs.map +1 -1
  73. package/fesm2022/ng-doc-app-texts-ar.mjs +238 -0
  74. package/fesm2022/ng-doc-app-texts-ar.mjs.map +1 -0
  75. package/fesm2022/ng-doc-app-texts-de.mjs +205 -0
  76. package/fesm2022/ng-doc-app-texts-de.mjs.map +1 -0
  77. package/fesm2022/ng-doc-app-texts-es.mjs +205 -0
  78. package/fesm2022/ng-doc-app-texts-es.mjs.map +1 -0
  79. package/fesm2022/ng-doc-app-texts-fr.mjs +205 -0
  80. package/fesm2022/ng-doc-app-texts-fr.mjs.map +1 -0
  81. package/fesm2022/ng-doc-app-texts-hi.mjs +219 -0
  82. package/fesm2022/ng-doc-app-texts-hi.mjs.map +1 -0
  83. package/fesm2022/ng-doc-app-texts-ja.mjs +205 -0
  84. package/fesm2022/ng-doc-app-texts-ja.mjs.map +1 -0
  85. package/fesm2022/ng-doc-app-texts-ko.mjs +205 -0
  86. package/fesm2022/ng-doc-app-texts-ko.mjs.map +1 -0
  87. package/fesm2022/ng-doc-app-texts-pt-br.mjs +205 -0
  88. package/fesm2022/ng-doc-app-texts-pt-br.mjs.map +1 -0
  89. package/fesm2022/ng-doc-app-texts-ru.mjs +231 -0
  90. package/fesm2022/ng-doc-app-texts-ru.mjs.map +1 -0
  91. package/fesm2022/ng-doc-app-texts-uk.mjs +231 -0
  92. package/fesm2022/ng-doc-app-texts-uk.mjs.map +1 -0
  93. package/fesm2022/ng-doc-app-texts-zh.mjs +205 -0
  94. package/fesm2022/ng-doc-app-texts-zh.mjs.map +1 -0
  95. package/fesm2022/ng-doc-app-tokens.mjs +214 -1
  96. package/fesm2022/ng-doc-app-tokens.mjs.map +1 -1
  97. package/fesm2022/ng-doc-app-type-controls-json-control.mjs +90 -0
  98. package/fesm2022/ng-doc-app-type-controls-json-control.mjs.map +1 -0
  99. package/fesm2022/ng-doc-app-type-controls-list-control.mjs +792 -0
  100. package/fesm2022/ng-doc-app-type-controls-list-control.mjs.map +1 -0
  101. package/fesm2022/ng-doc-app-type-controls-type-alias-control.mjs +5 -3
  102. package/fesm2022/ng-doc-app-type-controls-type-alias-control.mjs.map +1 -1
  103. package/fesm2022/ng-doc-app-type-controls.mjs +2 -0
  104. package/fesm2022/ng-doc-app-type-controls.mjs.map +1 -1
  105. package/package.json +59 -3
  106. package/styles/global.css +1 -0
  107. package/styles/main.css +1 -0
  108. package/types/ng-doc-app-classes-default-search-engine.d.ts +11 -0
  109. package/types/ng-doc-app-classes-root-page.d.ts +5 -0
  110. package/types/ng-doc-app-components-api-list.d.ts +3 -1
  111. package/types/ng-doc-app-components-breadcrumb.d.ts +2 -1
  112. package/types/ng-doc-app-components-code.d.ts +2 -0
  113. package/types/ng-doc-app-components-command-palette.d.ts +3 -1
  114. package/types/ng-doc-app-components-copy-button.d.ts +3 -1
  115. package/types/ng-doc-app-components-demo-displayer.d.ts +13 -1
  116. package/types/ng-doc-app-components-demo-frame.d.ts +62 -3
  117. package/types/ng-doc-app-components-demo.d.ts +27 -8
  118. package/types/ng-doc-app-components-fullscreen-button.d.ts +2 -0
  119. package/types/ng-doc-app-components-fullscreen-toggle.d.ts +2 -0
  120. package/types/ng-doc-app-components-heading-anchor.d.ts +2 -0
  121. package/types/ng-doc-app-components-image-viewer.d.ts +2 -0
  122. package/types/ng-doc-app-components-navbar.d.ts +2 -0
  123. package/types/ng-doc-app-components-page-navigation.d.ts +2 -1
  124. package/types/ng-doc-app-components-page.d.ts +10 -1
  125. package/types/ng-doc-app-components-playground.d.ts +241 -44
  126. package/types/ng-doc-app-components-root.d.ts +18 -0
  127. package/types/ng-doc-app-components-search-result.d.ts +2 -0
  128. package/types/ng-doc-app-components-search.d.ts +2 -0
  129. package/types/ng-doc-app-components-sidebar.d.ts +2 -1
  130. package/types/ng-doc-app-components-theme-toggle.d.ts +4 -1
  131. package/types/ng-doc-app-components-toc.d.ts +2 -1
  132. package/types/ng-doc-app-constants.d.ts +11 -1
  133. package/types/ng-doc-app-demo-app.d.ts +211 -3
  134. package/types/ng-doc-app-helpers.d.ts +56 -3
  135. package/types/ng-doc-app-interfaces.d.ts +621 -3
  136. package/types/ng-doc-app-providers-ng-doc-app.d.ts +6 -0
  137. package/types/ng-doc-app-providers-texts.d.ts +28 -0
  138. package/types/ng-doc-app-providers.d.ts +1 -0
  139. package/types/ng-doc-app-services-content-scroll-intent.d.ts +11 -1
  140. package/types/ng-doc-app-services-highlighter.d.ts +3 -1
  141. package/types/ng-doc-app-services-shortcuts.d.ts +16 -0
  142. package/types/ng-doc-app-texts-ar.d.ts +13 -0
  143. package/types/ng-doc-app-texts-de.d.ts +12 -0
  144. package/types/ng-doc-app-texts-es.d.ts +12 -0
  145. package/types/ng-doc-app-texts-fr.d.ts +12 -0
  146. package/types/ng-doc-app-texts-hi.d.ts +12 -0
  147. package/types/ng-doc-app-texts-ja.d.ts +12 -0
  148. package/types/ng-doc-app-texts-ko.d.ts +12 -0
  149. package/types/ng-doc-app-texts-pt-br.d.ts +12 -0
  150. package/types/ng-doc-app-texts-ru.d.ts +12 -0
  151. package/types/ng-doc-app-texts-uk.d.ts +12 -0
  152. package/types/ng-doc-app-texts-zh.d.ts +12 -0
  153. package/types/ng-doc-app-tokens.d.ts +21 -2
  154. package/types/ng-doc-app-type-controls-json-control.d.ts +38 -0
  155. package/types/ng-doc-app-type-controls-list-control.d.ts +313 -0
  156. package/types/ng-doc-app-type-controls-type-alias-control.d.ts +2 -1
  157. package/types/ng-doc-app-type-controls.d.ts +2 -0
@@ -1 +1 @@
1
- {"version":3,"file":"ng-doc-app-demo-app.mjs","sources":["../../../../libs/app/demo-app/demo-message.ts","../../../../libs/app/demo-app/demo-app.component.ts","../../../../libs/app/demo-app/demo-host.component.ts","../../../../libs/app/demo-app/demo-application.ts","../../../../libs/app/demo-app/ng-doc-app-demo-app.ts"],"sourcesContent":["/**\n * The `source` of every message the demo application sends to the page that embeds it.\n * @internal\n */\nexport const ɵNG_DOC_DEMO_MESSAGE_SOURCE = 'ng-doc-demo';\n\n/**\n * The message an isolated demo sends to the page that shows it in an iframe whenever the height\n * of its content changes, so that the iframe takes that height.\n * @internal\n */\nexport interface ɵNgDocDemoSizeMessage {\n readonly source: typeof ɵNG_DOC_DEMO_MESSAGE_SOURCE;\n readonly version: 1;\n readonly type: 'size';\n /** The height of the demo's content, in CSS pixels, rounded up. */\n readonly height: number;\n}\n\n/**\n * Whether a message is a size message of the demo application.\n * @param value - The data of a `message` event.\n * @internal\n */\nexport function ɵisNgDocDemoSizeMessage(value: unknown): value is ɵNgDocDemoSizeMessage {\n const message = value as Partial<ɵNgDocDemoSizeMessage> | null;\n return (\n typeof message === 'object' &&\n message !== null &&\n message.source === ɵNG_DOC_DEMO_MESSAGE_SOURCE &&\n message.version === 1 &&\n message.type === 'size' &&\n typeof message.height === 'number' &&\n Number.isFinite(message.height) &&\n message.height >= 0\n );\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n DOCUMENT,\n ElementRef,\n inject,\n PLATFORM_ID,\n} from '@angular/core';\nimport { RouterOutlet } from '@angular/router';\nimport { NG_DOC_STORE_THEME_KEY } from '@ng-doc/app/constants';\n\nimport { ɵNG_DOC_DEMO_MESSAGE_SOURCE, ɵNgDocDemoSizeMessage } from './demo-message';\n\n/**\n * The root of the demo application, which shows one demo per page with only Angular and that\n * demo loaded. In an iframe it reports the height of its content to the page that embeds it (a\n * `ResizeObserver` on its border box), and it follows the theme the reader picks on the\n * documentation site, which stores it in `localStorage`.\n */\n@Component({\n selector: 'ng-doc-demo-app',\n imports: [RouterOutlet],\n template: '<router-outlet />',\n // `flow-root`: the margins of the demo stay inside the measured box.\n styles: ':host { display: flow-root; }',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgDocDemoAppComponent {\n constructor() {\n if (!isPlatformBrowser(inject(PLATFORM_ID))) return;\n const document = inject(DOCUMENT);\n const window = document.defaultView;\n const destroyRef = inject(DestroyRef);\n\n if (!window) return;\n if (window.parent !== window) {\n const host: HTMLElement = inject(ElementRef).nativeElement;\n let reported = -1;\n const observer = new ResizeObserver(() => {\n const height = Math.ceil(host.getBoundingClientRect().height);\n\n if (height === reported) return;\n reported = height;\n const message: ɵNgDocDemoSizeMessage = {\n source: ɵNG_DOC_DEMO_MESSAGE_SOURCE,\n version: 1,\n type: 'size',\n height,\n };\n // Only a page of the same origin may receive it: the demo pages are part of the site.\n window.parent.postMessage(message, window.location.origin);\n });\n\n observer.observe(host, { box: 'border-box' });\n destroyRef.onDestroy(() => observer.disconnect());\n }\n\n // The documentation page and the demo page share the origin, so a theme the reader picks\n // reaches this page as a storage event. An empty id is the light theme, as in the restore\n // script that applies the stored theme before the application starts.\n const onStorage = (event: StorageEvent) => {\n if (event.key !== NG_DOC_STORE_THEME_KEY || event.newValue === null) return;\n if (event.newValue) {\n document.documentElement.setAttribute('data-theme', event.newValue);\n } else {\n document.documentElement.removeAttribute('data-theme');\n }\n };\n\n window.addEventListener('storage', onStorage);\n destroyRef.onDestroy(() => window.removeEventListener('storage', onStorage));\n }\n}\n","import { NgComponentOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, inject, Type } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\n\n/**\n * Shows the demo of a demo page: the component in the route's `ngDocDemo` data, with the inputs\n * of the `inputs` query parameter (the JSON of the `inputs` option of the `demo` action).\n *\n * The demo application hydrates its server-rendered page, but not the demo: a demo is the user's\n * component and need not be hydration-safe, and the server renders it without the inputs of the\n * query, which only the browser has. So the host skips hydration, as documentation pages do for\n * their content, and the browser renders the demo again.\n */\n@Component({\n selector: 'ng-doc-demo-host',\n imports: [NgComponentOutlet],\n template: `\n @if (demo) {\n <ng-container *ngComponentOutlet=\"demo; inputs: inputs\" />\n } @else {\n <p role=\"alert\">This demo does not exist.</p>\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { ngSkipHydration: 'true' },\n})\nexport class NgDocDemoHostComponent {\n private readonly route = inject(ActivatedRoute);\n\n /** The demo component, or undefined on the page of a demo that does not exist. */\n protected readonly demo: Type<unknown> | undefined = this.route.snapshot.data['ngDocDemo'];\n\n /** The inputs of the demo. */\n protected readonly inputs: Record<string, unknown> = demoInputs(\n this.route.snapshot.queryParamMap.get('inputs'),\n );\n}\n\n/**\n * The inputs of the `inputs` query parameter: a JSON object, or none.\n * @param value - The parameter.\n */\nfunction demoInputs(value: string | null): Record<string, unknown> {\n if (!value) return {};\n try {\n const parsed: unknown = JSON.parse(value);\n\n return parsed && typeof parsed === 'object' && !Array.isArray(parsed)\n ? (parsed as Record<string, unknown>)\n : {};\n } catch {\n return {};\n }\n}\n","import {\n ApplicationConfig,\n EnvironmentProviders,\n Provider,\n provideZoneChangeDetection,\n provideZonelessChangeDetection,\n} from '@angular/core';\nimport { provideClientHydration, withNoIncrementalHydration } from '@angular/platform-browser';\nimport { provideRouter, Routes } from '@angular/router';\nimport type { NgDocDemoProvidersImport } from '@ng-doc/core/interfaces';\n\nimport { NgDocDemoHostComponent } from './demo-host.component';\n\n/**\n * How the demo application starts.\n * @internal\n */\nexport interface ɵNgDocDemoApplicationOptions {\n /** Change detection with zone.js, when the application's polyfills load it. */\n readonly zone?: boolean;\n /**\n * Hydration of the server-rendered page: always on the server, which then writes the hydration\n * data, and in the browser only for a page the server rendered (a page without it, such as the\n * page of a demo that failed to prerender or the development server's, has nothing to hydrate).\n */\n readonly hydration?: boolean;\n /** Providers added after the others, for example server rendering. */\n readonly providers?: Array<Provider | EnvironmentProviders>;\n}\n\n/**\n * The configuration of the demo application: change detection, the router with the demo pages\n * (and a page for unknown demos), hydration, and the providers of `demoProviders`. The generated entries of\n * the demo application bootstrap `NgDocDemoAppComponent` with it, in the browser and on the server.\n * @param routes - The generated demo routes.\n * @param demoProviders - The generated import of the `demoProviders` module, if any.\n * @param options - How the application starts.\n * @internal\n */\nexport async function ɵngDocDemoApplicationConfig(\n routes: Routes,\n demoProviders: NgDocDemoProvidersImport | undefined,\n options: ɵNgDocDemoApplicationOptions = {},\n): Promise<ApplicationConfig> {\n const providers = demoProviders ? (await demoProviders()).default : [];\n\n return {\n providers: [\n options.zone ? provideZoneChangeDetection() : provideZonelessChangeDetection(),\n ...(options.hydration ? [provideClientHydration(withNoIncrementalHydration())] : []),\n provideRouter([...routes, { path: '**', component: NgDocDemoHostComponent }]),\n ...providers,\n ...(options.providers ?? []),\n ],\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAAA;;;AAGG;AACI,MAAM,2BAA2B,GAAG;AAe3C;;;;AAIG;AACG,SAAU,uBAAuB,CAAC,KAAc,EAAA;IACpD,MAAM,OAAO,GAAG,KAA8C;AAC9D,IAAA,QACE,OAAO,OAAO,KAAK,QAAQ;AAC3B,QAAA,OAAO,KAAK,IAAI;QAChB,OAAO,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BAAsB,CAAC,0BAA0B,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC;AACpF,YAAA,aAAa,CAAC,CAAC,GAAG,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,sBAAsB,EAAE,CAAC,CAAC;AAC7E,YAAA,GAAG,SAAS;AACZ,YAAA,IAAI,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC;AAC7B,SAAA;KACF;AACH;;ACvDA;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-doc-app-demo-app.mjs","sources":["../../../../libs/app/demo-app/demo-message.ts","../../../../libs/app/demo-app/demo-theme.ts","../../../../libs/app/demo-app/demo-app.component.ts","../../../../libs/app/demo-app/demo-host.component.ts","../../../../libs/app/demo-app/demo-application.ts","../../../../libs/app/demo-app/playground-value.ts","../../../../libs/app/demo-app/playground-fragment.ts","../../../../libs/app/demo-app/playground-message.ts","../../../../libs/app/demo-app/ng-doc-app-demo-app.ts"],"sourcesContent":["/**\n * The `source` of every message the demo application sends to the page that embeds it.\n * @internal\n */\nexport const ɵNG_DOC_DEMO_MESSAGE_SOURCE = 'ng-doc-demo';\n\n/**\n * The message an isolated demo sends to the page that shows it in an iframe whenever the height\n * of its content changes, so that the iframe takes that height.\n * @internal\n */\nexport interface ɵNgDocDemoSizeMessage {\n readonly source: typeof ɵNG_DOC_DEMO_MESSAGE_SOURCE;\n readonly version: 1;\n readonly type: 'size';\n /** The height of the demo's content, in CSS pixels, rounded up. */\n readonly height: number;\n}\n\n/**\n * Whether a message is a size message of the demo application.\n * @param value - The data of a `message` event.\n * @internal\n */\nexport function ɵisNgDocDemoSizeMessage(value: unknown): value is ɵNgDocDemoSizeMessage {\n const message = value as Partial<ɵNgDocDemoSizeMessage> | null;\n return (\n typeof message === 'object' &&\n message !== null &&\n message.source === ɵNG_DOC_DEMO_MESSAGE_SOURCE &&\n message.version === 1 &&\n message.type === 'size' &&\n typeof message.height === 'number' &&\n Number.isFinite(message.height) &&\n message.height >= 0\n );\n}\n\n/**\n * The message an isolated demo sends to the page that shows it in an iframe whenever the background\n * of its page changes, such as when its theme changes, so that the page can paint the canvas\n * around the iframe in it.\n * @internal\n */\nexport interface ɵNgDocDemoBackgroundMessage {\n readonly source: typeof ɵNG_DOC_DEMO_MESSAGE_SOURCE;\n readonly version: 1;\n readonly type: 'background';\n /** The computed background color of the demo's page, such as `rgb(24, 24, 27)`. */\n readonly color: string;\n /** The color of the dots of the demo canvas in the demo's theme, if the theme sets one. */\n readonly dots?: string;\n /** The color scheme of the demo's page (`dark`, for example), if it sets one. */\n readonly scheme?: string;\n}\n\n/**\n * Whether a message is a background message of the demo application.\n * @param value - The data of a `message` event.\n * @internal\n */\nexport function ɵisNgDocDemoBackgroundMessage(\n value: unknown,\n): value is ɵNgDocDemoBackgroundMessage {\n const message = value as Partial<ɵNgDocDemoBackgroundMessage> | null;\n return (\n typeof message === 'object' &&\n message !== null &&\n message.source === ɵNG_DOC_DEMO_MESSAGE_SOURCE &&\n message.version === 1 &&\n message.type === 'background' &&\n typeof message.color === 'string' &&\n message.color.length > 0 &&\n message.color.length <= 200 &&\n (message.dots === undefined ||\n (typeof message.dots === 'string' && message.dots.length <= 200)) &&\n (message.scheme === undefined ||\n (typeof message.scheme === 'string' && message.scheme.length <= 50))\n );\n}\n","/** The fragment parameter that sets the theme of a demo page; an input name never starts with `~`. */\nconst THEME = '~theme';\n\n/**\n * The theme that the URL fragment of a demo page sets, or `undefined` when it sets none and the\n * page follows the theme of the site.\n * @param fragment - The fragment, with or without the leading `#`.\n * @internal\n */\nexport function ɵdemoThemeFromFragment(fragment: string): string | undefined {\n for (const parameter of fragment.replace(/^#/, '').split('&')) {\n if (!parameter.startsWith(`${THEME}=`)) continue;\n try {\n return decodeURIComponent(parameter.slice(THEME.length + 1)) || undefined;\n } catch {\n return undefined;\n }\n }\n return undefined;\n}\n\n/**\n * A fragment (without `#`) with the theme parameter set, after the other parameters, or without it\n * when there is no theme. `undefined` when nothing is left.\n * @param fragment - The fragment without the theme, or none.\n * @param theme - The theme of the demo page, or none to follow the site.\n * @internal\n */\nexport function ɵwithDemoTheme(\n fragment: string | undefined,\n theme: string | undefined,\n): string | undefined {\n const parameters = (fragment ?? '')\n .split('&')\n .filter((parameter) => parameter && !parameter.startsWith(`${THEME}=`));\n\n if (theme) parameters.push(`${THEME}=${encodeURIComponent(theme)}`);\n return parameters.length ? parameters.join('&') : undefined;\n}\n\n/**\n * Whether a parameter of a fragment is the theme of the demo page, which the state of a\n * playground leaves to the demo application.\n * @param name - The decoded name of the parameter.\n * @internal\n */\nexport function ɵisDemoThemeParameter(name: string): boolean {\n return name === THEME;\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n DOCUMENT,\n ElementRef,\n inject,\n PLATFORM_ID,\n ViewEncapsulation,\n} from '@angular/core';\nimport { RouterOutlet } from '@angular/router';\nimport { NG_DOC_STORE_THEME_KEY } from '@ng-doc/app/constants';\n\nimport {\n ɵNG_DOC_DEMO_MESSAGE_SOURCE,\n ɵNgDocDemoBackgroundMessage,\n ɵNgDocDemoSizeMessage,\n} from './demo-message';\nimport { ɵdemoThemeFromFragment } from './demo-theme';\n\n/**\n * The root of the demo application, which shows one demo per page with only Angular and that\n * demo loaded. In an iframe it reports the height of its content to the page that embeds it (a\n * `ResizeObserver` on its border box), and it follows the theme the reader picks on the\n * documentation site, which stores it in `localStorage`, unless its URL fragment sets a theme\n * (`~theme=dark`, the `theme` option of a demo or a playground, or the theme button beside it).\n * In an iframe its page is transparent, so the canvas of the documentation page shows through, and\n * it reports its theme's background, dots and color scheme whenever they change, so that the\n * embedding page can paint the canvas in the demo's own theme.\n */\n@Component({\n selector: 'ng-doc-demo-app',\n imports: [RouterOutlet],\n template: '<router-outlet />',\n // `flow-root`: the margins of the demo stay inside the measured box.\n styles: `\n ng-doc-demo-app {\n display: flow-root;\n }\n\n /* A demo is centered, as it is in the canvas of the documentation page (.ng-doc-demo). */\n ng-doc-demo-host,\n ng-doc-playground-host {\n display: flex;\n justify-content: center;\n min-width: 0;\n }\n\n html.ng-doc-demo-embedded,\n html.ng-doc-demo-embedded body {\n background-color: transparent;\n }\n `,\n // The rules above reach the document, its body and the routed hosts, outside this component.\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class NgDocDemoAppComponent {\n constructor() {\n if (!isPlatformBrowser(inject(PLATFORM_ID))) return;\n const document = inject(DOCUMENT);\n const window = document.defaultView;\n const destroyRef = inject(DestroyRef);\n\n if (!window) return;\n const embedded = window.parent !== window;\n let reportedBackground = '';\n // The page's background: the body's, or the document's when the body has none. Reported only\n // when it changes, and once the page has one (its styles may still be loading).\n const reportBackground = () => {\n if (!embedded) return;\n // The theme's background and dots, from its variables: the page itself is transparent in\n // an iframe, so its computed background is not the theme's.\n const style = window.getComputedStyle(document.documentElement);\n const color = style.getPropertyValue('--ng-doc-background').trim();\n const dots = style.getPropertyValue('--ng-doc-base-5').trim();\n // A transparent iframe shows its page only while the iframe element has the page's color\n // scheme; otherwise the browser paints an opaque backdrop behind it.\n const scheme = style.colorScheme && style.colorScheme !== 'normal' ? style.colorScheme : '';\n const key = `${color}|${dots}|${scheme}`;\n\n if (!color || key === reportedBackground) return;\n reportedBackground = key;\n const message: ɵNgDocDemoBackgroundMessage = {\n source: ɵNG_DOC_DEMO_MESSAGE_SOURCE,\n version: 1,\n type: 'background',\n color,\n ...(dots ? { dots } : {}),\n ...(scheme ? { scheme } : {}),\n };\n\n window.parent.postMessage(message, window.location.origin);\n };\n\n if (embedded) {\n // The page is transparent in an iframe, so the canvas of the documentation page, dots and\n // all, shows through around and behind the demo.\n document.documentElement.classList.add('ng-doc-demo-embedded');\n const host: HTMLElement = inject(ElementRef).nativeElement;\n let reported = -1;\n const observer = new ResizeObserver(() => {\n const height = Math.ceil(host.getBoundingClientRect().height);\n\n // Styles that load after the first report change the background too.\n reportBackground();\n if (height === reported) return;\n reported = height;\n const message: ɵNgDocDemoSizeMessage = {\n source: ɵNG_DOC_DEMO_MESSAGE_SOURCE,\n version: 1,\n type: 'size',\n height,\n };\n // Only a page of the same origin may receive it: the demo pages are part of the site.\n window.parent.postMessage(message, window.location.origin);\n });\n\n observer.observe(host, { box: 'border-box' });\n destroyRef.onDestroy(() => observer.disconnect());\n }\n\n // An empty id is the light theme, as in the restore script that applies the stored theme\n // before the application starts; so is `light`, which the `theme` option uses.\n const apply = (theme: string | null) => {\n if (theme && theme !== 'light') {\n document.documentElement.setAttribute('data-theme', theme);\n } else {\n document.documentElement.removeAttribute('data-theme');\n }\n reportBackground();\n };\n const pinned = () => ɵdemoThemeFromFragment(window.location.hash);\n const site = () => {\n try {\n return window.localStorage.getItem(NG_DOC_STORE_THEME_KEY);\n } catch {\n return null;\n }\n };\n // The documentation page and the demo page share the origin, so a theme the reader picks\n // reaches this page as a storage event; a theme of the fragment wins over it.\n const onStorage = (event: StorageEvent) => {\n if (event.key !== NG_DOC_STORE_THEME_KEY || event.newValue === null || pinned()) return;\n apply(event.newValue);\n };\n // The documentation page changes the fragment with `location.replace`, without a reload.\n const onHashChange = () => apply(pinned() ?? site());\n\n // The `auto` theme follows the system's color scheme.\n const scheme = window.matchMedia?.('(prefers-color-scheme: dark)');\n\n if (pinned()) apply(pinned()!);\n reportBackground();\n window.addEventListener('storage', onStorage);\n window.addEventListener('hashchange', onHashChange);\n scheme?.addEventListener?.('change', reportBackground);\n destroyRef.onDestroy(() => {\n window.removeEventListener('storage', onStorage);\n window.removeEventListener('hashchange', onHashChange);\n scheme?.removeEventListener?.('change', reportBackground);\n });\n }\n}\n","import { NgComponentOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, inject, Type } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\n\n/**\n * Shows the demo of a demo page: the component in the route's `ngDocDemo` data, with the inputs\n * of the `inputs` query parameter (the JSON of the `inputs` option of the `demo` action).\n *\n * The demo application hydrates its server-rendered page, but not the demo: a demo is the user's\n * component and need not be hydration-safe, and the server renders it without the inputs of the\n * query, which only the browser has. So the host skips hydration, as documentation pages do for\n * their content, and the browser renders the demo again.\n */\n@Component({\n selector: 'ng-doc-demo-host',\n imports: [NgComponentOutlet],\n template: `\n @if (demo) {\n <ng-container *ngComponentOutlet=\"demo; inputs: inputs\" />\n } @else {\n <p role=\"alert\">This demo does not exist.</p>\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { ngSkipHydration: 'true' },\n})\nexport class NgDocDemoHostComponent {\n private readonly route = inject(ActivatedRoute);\n\n /** The demo component, or undefined on the page of a demo that does not exist. */\n protected readonly demo: Type<unknown> | undefined = this.route.snapshot.data['ngDocDemo'];\n\n /** The inputs of the demo. */\n protected readonly inputs: Record<string, unknown> = demoInputs(\n this.route.snapshot.queryParamMap.get('inputs'),\n );\n}\n\n/**\n * The inputs of the `inputs` query parameter: a JSON object, or none.\n * @param value - The parameter.\n */\nfunction demoInputs(value: string | null): Record<string, unknown> {\n if (!value) return {};\n try {\n const parsed: unknown = JSON.parse(value);\n\n return parsed && typeof parsed === 'object' && !Array.isArray(parsed)\n ? (parsed as Record<string, unknown>)\n : {};\n } catch {\n return {};\n }\n}\n","import {\n ApplicationConfig,\n EnvironmentProviders,\n Provider,\n provideZoneChangeDetection,\n provideZonelessChangeDetection,\n} from '@angular/core';\nimport { provideClientHydration, withNoIncrementalHydration } from '@angular/platform-browser';\nimport { provideRouter, Routes } from '@angular/router';\nimport type { NgDocDemoProvidersImport } from '@ng-doc/core/interfaces';\n\nimport { NgDocDemoHostComponent } from './demo-host.component';\n\n/**\n * How the demo application starts.\n * @internal\n */\nexport interface ɵNgDocDemoApplicationOptions {\n /** Change detection with zone.js, when the application's polyfills load it. */\n readonly zone?: boolean;\n /**\n * Hydration of the server-rendered page: always on the server, which then writes the hydration\n * data, and in the browser only for a page the server rendered (a page without it, such as the\n * page of a demo that failed to prerender or the development server's, has nothing to hydrate).\n */\n readonly hydration?: boolean;\n /** Providers added after the others, for example server rendering. */\n readonly providers?: Array<Provider | EnvironmentProviders>;\n}\n\n/**\n * The configuration of the demo application: change detection, the router with the demo pages\n * (and a page for unknown demos), hydration, and the providers of `demoProviders`. The generated entries of\n * the demo application bootstrap `NgDocDemoAppComponent` with it, in the browser and on the server.\n * @param routes - The generated demo routes.\n * @param demoProviders - The generated import of the `demoProviders` module, if any.\n * @param options - How the application starts.\n * @internal\n */\nexport async function ɵngDocDemoApplicationConfig(\n routes: Routes,\n demoProviders: NgDocDemoProvidersImport | undefined,\n options: ɵNgDocDemoApplicationOptions = {},\n): Promise<ApplicationConfig> {\n const providers = demoProviders ? (await demoProviders()).default : [];\n\n return {\n providers: [\n options.zone ? provideZoneChangeDetection() : provideZonelessChangeDetection(),\n ...(options.hydration ? [provideClientHydration(withNoIncrementalHydration())] : []),\n provideRouter([...routes, { path: '**', component: NgDocDemoHostComponent }]),\n ...providers,\n ...(options.providers ?? []),\n ],\n };\n}\n","/**\n * A value as it crosses from a documentation page to the frame of an isolated playground: JSON\n * that both `postMessage` and a URL carry unchanged.\n * @internal\n */\nexport type ɵNgDocPlaygroundEncodedValue =\n | string\n | number\n | boolean\n | null\n | ɵNgDocPlaygroundEncodedValue[]\n | { [key: string]: ɵNgDocPlaygroundEncodedValue };\n\n/**\n * The result of encoding a value: the encoded value, or the path of the first part that can't be\n * encoded and why.\n * @internal\n */\nexport type ɵNgDocPlaygroundEncoding =\n | { readonly ok: true; readonly value: ɵNgDocPlaygroundEncodedValue }\n | { readonly ok: false; readonly path: string; readonly reason: string };\n\n/** The key of a tagged value: a value JSON has no form for (`undefined`, `NaN`, a `Date`, …). */\nconst TAG = '$ngdoc';\n\n/** Deeper values are refused: a playground input never needs them, and a cycle would recurse. */\nconst MAX_DEPTH = 32;\n\n/**\n * The longest encoded state an \"Open in a new tab\" URL carries; a longer one is left out.\n * @internal\n */\nexport const ɵNG_DOC_PLAYGROUND_STATE_URL_LIMIT = 8192;\n\n/**\n * Encodes a value for the frame of an isolated playground. Only plain data is accepted:\n * strings, numbers (`NaN`, the infinities and `-0` included), booleans, `null`, `undefined`, `Date`s,\n * arrays and plain objects (prototype `Object.prototype` or `null`, own enumerable data\n * properties). Anything else (a function, a symbol, a `bigint`, a class instance such as a\n * `TemplateRef`, a `Map` or a signal, a getter, a cycle) is refused rather than sent changed: a\n * structured clone would turn a class instance into a plain object without its behaviour, and\n * the demo would then run with a value that isn't the one the inspector shows.\n * @param value - The value of a playground input.\n * @internal\n */\nexport function ɵencodePlaygroundValue(value: unknown): ɵNgDocPlaygroundEncoding {\n try {\n return { ok: true, value: encode(value, '', 0, new Set()) };\n } catch (error) {\n if (error instanceof Unencodable) return { ok: false, path: error.path, reason: error.reason };\n throw error;\n }\n}\n\n/**\n * Decodes a value that {@link ɵencodePlaygroundValue} encoded. Throws on anything it can't have\n * produced, so a malformed message or URL never reaches the demo half-decoded.\n * @param value - An encoded value.\n * @internal\n */\nexport function ɵdecodePlaygroundValue(value: unknown): unknown {\n return decode(value, '', 0);\n}\n\n/**\n * The encoded values of an \"Open in a new tab\" URL: base64url of their JSON, or `undefined`\n * when it would be longer than {@link ɵNG_DOC_PLAYGROUND_STATE_URL_LIMIT}.\n * @param values - Encoded values, by input name.\n * @internal\n */\nexport function ɵplaygroundStateToUrl(\n values: Record<string, ɵNgDocPlaygroundEncodedValue>,\n): string | undefined {\n const bytes = new TextEncoder().encode(JSON.stringify(values));\n let binary = '';\n\n for (const byte of bytes) binary += String.fromCharCode(byte);\n const text = btoa(binary).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, '');\n\n return text.length > ɵNG_DOC_PLAYGROUND_STATE_URL_LIMIT ? undefined : text;\n}\n\n/**\n * The encoded values of an \"Open in a new tab\" URL, or `undefined` when the parameter isn't one\n * that {@link ɵplaygroundStateToUrl} wrote.\n * @param text - The `state` query parameter.\n * @internal\n */\nexport function ɵplaygroundStateFromUrl(\n text: string,\n): Record<string, ɵNgDocPlaygroundEncodedValue> | undefined {\n if (!/^[A-Za-z0-9_-]*$/.test(text) || text.length > ɵNG_DOC_PLAYGROUND_STATE_URL_LIMIT) {\n return undefined;\n }\n try {\n const binary = atob(text.replace(/-/g, '+').replace(/_/g, '/'));\n const bytes = Uint8Array.from(binary, (character) => character.charCodeAt(0));\n const parsed: unknown = JSON.parse(new TextDecoder('utf-8', { fatal: true }).decode(bytes));\n\n if (!isPlainObject(parsed)) return undefined;\n // Every value must decode; the decoded form is computed again where it is used.\n for (const value of Object.values(parsed)) decode(value, '', 0);\n return parsed as Record<string, ɵNgDocPlaygroundEncodedValue>;\n } catch {\n return undefined;\n }\n}\n\nclass Unencodable extends Error {\n constructor(\n readonly path: string,\n readonly reason: string,\n ) {\n super(`${path || 'value'}: ${reason}`);\n }\n}\n\n/**\n *\n * @param value\n */\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n if (typeof value !== 'object' || value === null || Array.isArray(value)) return false;\n const prototype: unknown = Object.getPrototypeOf(value);\n\n return prototype === Object.prototype || prototype === null;\n}\n\n/**\n *\n * @param path\n * @param key\n */\nfunction child(path: string, key: string | number): string {\n if (typeof key === 'number') return `${path}[${key}]`;\n return /^[A-Za-z_$][\\w$]*$/.test(key)\n ? path\n ? `${path}.${key}`\n : key\n : `${path}[${JSON.stringify(key)}]`;\n}\n\n/**\n *\n * @param tag\n * @param value\n */\nfunction tagged(tag: string, value?: ɵNgDocPlaygroundEncodedValue): ɵNgDocPlaygroundEncodedValue {\n return value === undefined ? { [TAG]: tag } : { [TAG]: tag, value };\n}\n\n/**\n *\n * @param value\n * @param path\n * @param depth\n * @param ancestors\n */\nfunction encode(\n value: unknown,\n path: string,\n depth: number,\n ancestors: Set<object>,\n): ɵNgDocPlaygroundEncodedValue {\n switch (typeof value) {\n case 'string':\n case 'boolean':\n return value;\n case 'number':\n // JSON writes -0 as 0, so -0 is tagged like the numbers JSON has no form for.\n return Number.isFinite(value) && !Object.is(value, -0)\n ? value\n : tagged('number', Object.is(value, -0) ? '-0' : String(value));\n case 'undefined':\n return tagged('undefined');\n case 'function':\n throw new Unencodable(path, 'a function');\n case 'symbol':\n throw new Unencodable(path, 'a symbol');\n case 'bigint':\n throw new Unencodable(path, 'a bigint');\n }\n if (value === null) return null;\n if (depth >= MAX_DEPTH) throw new Unencodable(path, `nested deeper than ${MAX_DEPTH} levels`);\n if (value instanceof Date) {\n const time = value.getTime();\n\n return tagged('date', Number.isNaN(time) ? 'Invalid Date' : value.toISOString());\n }\n const object = value as object;\n\n if (ancestors.has(object)) throw new Unencodable(path, 'a cyclic reference');\n ancestors.add(object);\n try {\n if (Array.isArray(object)) {\n // A hole reads as `undefined`, as the code view prints it.\n return Array.from(object, (item: unknown, index: number) =>\n encode(item, child(path, index), depth + 1, ancestors),\n );\n }\n if (!isPlainObject(object)) {\n const name = (object as { constructor?: { name?: unknown } }).constructor?.name;\n\n throw new Unencodable(\n path,\n typeof name === 'string' && name ? `an instance of ${name}` : 'not a plain object',\n );\n }\n if (Object.getOwnPropertySymbols(object).length) {\n throw new Unencodable(path, 'an object with symbol keys');\n }\n const entries: Array<[string, ɵNgDocPlaygroundEncodedValue]> = [];\n\n for (const key of Object.keys(object)) {\n const descriptor = Object.getOwnPropertyDescriptor(object, key);\n\n if (descriptor && !('value' in descriptor)) {\n throw new Unencodable(child(path, key), 'a getter');\n }\n entries.push([key, encode(descriptor?.value, child(path, key), depth + 1, ancestors)]);\n }\n const encoded = Object.fromEntries(entries);\n\n // An object of the user's that has the tag's key is wrapped, so it never reads as a tag.\n return Object.prototype.hasOwnProperty.call(object, TAG) ? tagged('object', encoded) : encoded;\n } finally {\n ancestors.delete(object);\n }\n}\n\n/**\n *\n * @param value\n * @param path\n * @param depth\n */\nfunction decode(value: unknown, path: string, depth: number): unknown {\n if (value === null || typeof value === 'string' || typeof value === 'boolean') return value;\n if (typeof value === 'number') {\n if (!Number.isFinite(value)) throw new Error(`${path || 'value'}: not a finite number`);\n return value;\n }\n if (depth >= MAX_DEPTH) throw new Error(`${path || 'value'}: nested too deep`);\n if (Array.isArray(value)) {\n return value.map((item: unknown, index: number) => decode(item, child(path, index), depth + 1));\n }\n if (!isPlainObject(value)) throw new Error(`${path || 'value'}: not an encoded value`);\n if (Object.prototype.hasOwnProperty.call(value, TAG)) {\n const keys = Object.keys(value).sort().join(',');\n const tag = value[TAG];\n const content = value['value'];\n\n if (tag === 'undefined' && keys === TAG) return undefined;\n if (tag === 'number' && keys === `${TAG},value`) {\n if (content === 'NaN') return Number.NaN;\n if (content === 'Infinity') return Number.POSITIVE_INFINITY;\n if (content === '-Infinity') return Number.NEGATIVE_INFINITY;\n if (content === '-0') return -0;\n }\n if (tag === 'date' && keys === `${TAG},value` && typeof content === 'string') {\n const date = new Date(content === 'Invalid Date' ? Number.NaN : content);\n\n if (content === 'Invalid Date' || !Number.isNaN(date.getTime())) return date;\n }\n if (tag === 'object' && keys === `${TAG},value` && isPlainObject(content)) {\n return decodeObject(content, path, depth);\n }\n throw new Error(`${path || 'value'}: not an encoded value`);\n }\n return decodeObject(value, path, depth);\n}\n\n/**\n *\n * @param value\n * @param path\n * @param depth\n */\nfunction decodeObject(\n value: Record<string, unknown>,\n path: string,\n depth: number,\n): Record<string, unknown> {\n return Object.fromEntries(\n Object.keys(value).map((key) => [key, decode(value[key], child(path, key), depth + 1)]),\n );\n}\n","import { ɵisDemoThemeParameter } from './demo-theme';\nimport {\n ɵdecodePlaygroundValue,\n ɵencodePlaygroundValue,\n ɵNG_DOC_PLAYGROUND_STATE_URL_LIMIT,\n ɵNgDocPlaygroundEncodedValue,\n ɵplaygroundStateFromUrl,\n ɵplaygroundStateToUrl,\n} from './playground-value';\n\n/**\n * The state of an isolated playground that its documentation page passes to the frame.\n * @internal\n */\nexport interface ɵNgDocPlaygroundState {\n /** The names of the target's inputs, in order: a pipe's parameters are positional. */\n readonly inputs: readonly string[];\n /** The value of each input, by name. */\n readonly properties: Readonly<Record<string, unknown>>;\n /** The content slots that are shown. */\n readonly content: readonly string[];\n /** Whether the frame creates the target again for this state. */\n readonly recreate: boolean;\n /**\n * The `data` option of the playground action, which the template of the target reads; the\n * frame has the configuration's own `data`.\n */\n readonly data?: Readonly<Record<string, unknown>>;\n}\n\n/**\n * A state written as a URL fragment, or why it can't be: the input whose value can't be encoded,\n * or an empty `path` when the fragment would be too long.\n * @internal\n */\nexport type ɵNgDocPlaygroundFragment =\n | { readonly ok: true; readonly fragment: string }\n | { readonly ok: false; readonly path: string; readonly reason: string };\n\n/** Fragment parameters of the playground itself; an input name never starts with `~`. */\nconst INPUTS = '~inputs';\nconst CONTENT = '~content';\nconst RECREATE = '~recreate';\nconst VALUES = '~v';\nconst DATA = '~data';\n\n/** The text JSON gives a number, which a readable string value must not look like. */\nconst NUMBER = /^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$/;\n\n/**\n * Writes a state as a URL fragment (without `#`). A string, a finite number or a boolean is its\n * own readable parameter (`label=Save&size=2&disabled=true`; a string that would read as another\n * type is quoted as JSON). Every other value goes into one `~v` parameter, encoded by\n * {@link ɵencodePlaygroundValue}. The frame reads the fragment with\n * {@link ɵplaygroundStateFromFragment}, and the same fragment opens the page in a new tab.\n * @param state - The state of the playground.\n * @internal\n */\nexport function ɵplaygroundStateToFragment(state: ɵNgDocPlaygroundState): ɵNgDocPlaygroundFragment {\n const parameters: string[] = [`${INPUTS}=${state.inputs.map(encodeURIComponent).join(',')}`];\n const encoded: Record<string, ɵNgDocPlaygroundEncodedValue> = {};\n\n for (const [name, value] of Object.entries(state.properties)) {\n const readable = readableText(value);\n\n if (readable !== undefined) {\n parameters.push(`${encodeURIComponent(name)}=${encodeURIComponent(readable)}`);\n continue;\n }\n const result = ɵencodePlaygroundValue(value);\n\n if (!result.ok) {\n return {\n ok: false,\n path: result.path ? `${name}.${result.path}` : name,\n reason: result.reason,\n };\n }\n encoded[name] = result.value;\n }\n if (Object.keys(encoded).length) {\n const text = ɵplaygroundStateToUrl(encoded);\n\n if (text === undefined) return tooLong();\n parameters.push(`${VALUES}=${text}`);\n }\n if (state.content.length) {\n parameters.push(`${CONTENT}=${state.content.map(encodeURIComponent).join(',')}`);\n }\n if (state.recreate) parameters.push(`${RECREATE}=1`);\n if (state.data && Object.keys(state.data).length) {\n const data: Record<string, ɵNgDocPlaygroundEncodedValue> = {};\n\n for (const [name, value] of Object.entries(state.data)) {\n const result = ɵencodePlaygroundValue(value);\n\n if (!result.ok) {\n return {\n ok: false,\n path: ['data', name, result.path].filter(Boolean).join('.'),\n reason: result.reason,\n };\n }\n data[name] = result.value;\n }\n const text = ɵplaygroundStateToUrl(data);\n\n if (text === undefined) return tooLong();\n parameters.push(`${DATA}=${text}`);\n }\n const fragment = parameters.join('&');\n\n return fragment.length > ɵNG_DOC_PLAYGROUND_STATE_URL_LIMIT ? tooLong() : { ok: true, fragment };\n}\n\n/**\n * Reads a state that {@link ɵplaygroundStateToFragment} wrote. Throws on a fragment it can't\n * have written, so a malformed URL never reaches the target half-read.\n * @param fragment - The fragment, with or without the leading `#`.\n * @internal\n */\nexport function ɵplaygroundStateFromFragment(fragment: string): ɵNgDocPlaygroundState {\n const text = fragment.replace(/^#/, '');\n const properties: Record<string, unknown> = {};\n let inputs: string[] | undefined;\n let content: string[] = [];\n let recreate = false;\n let data: Record<string, unknown> | undefined;\n\n if (text.length > ɵNG_DOC_PLAYGROUND_STATE_URL_LIMIT) throw new Error('The state is too long.');\n for (const parameter of text ? text.split('&') : []) {\n const separator = parameter.indexOf('=');\n\n if (separator < 1) throw new Error(`Malformed parameter: ${parameter}`);\n const name = decodeURIComponent(parameter.slice(0, separator));\n const value = parameter.slice(separator + 1);\n\n if (name === INPUTS) inputs = list(value);\n else if (name === CONTENT) content = list(value);\n else if (name === RECREATE) recreate = value === '1';\n else if (name === VALUES) {\n const values = ɵplaygroundStateFromUrl(value);\n\n if (!values) throw new Error('Malformed encoded values.');\n for (const [key, item] of Object.entries(values))\n properties[key] = ɵdecodePlaygroundValue(item);\n } else if (name === DATA) {\n const values = ɵplaygroundStateFromUrl(value);\n\n if (!values) throw new Error('Malformed data.');\n data = {};\n for (const [key, item] of Object.entries(values)) data[key] = ɵdecodePlaygroundValue(item);\n } else if (ɵisDemoThemeParameter(name)) {\n // The demo application applies the theme; it is not part of the playground's state.\n } else if (name.startsWith('~')) {\n throw new Error(`Unknown parameter: ${name}`);\n } else {\n properties[name] = readValue(decodeURIComponent(value));\n }\n }\n if (!inputs) throw new Error('The state names no inputs.');\n return { inputs, properties, content, recreate, ...(data ? { data } : {}) };\n}\n\n/**\n *\n */\nfunction tooLong(): ɵNgDocPlaygroundFragment {\n return { ok: false, path: '', reason: 'the values are too long for the URL of the frame' };\n}\n\n/**\n *\n * @param value\n */\nfunction list(value: string): string[] {\n return value ? value.split(',').map(decodeURIComponent) : [];\n}\n\n/**\n * The readable text of a value, or `undefined` when it goes into the encoded parameter.\n * @param value\n */\nfunction readableText(value: unknown): string | undefined {\n if (typeof value === 'boolean') return String(value);\n if (typeof value === 'number') {\n return Number.isFinite(value) && !Object.is(value, -0) ? JSON.stringify(value) : undefined;\n }\n if (typeof value !== 'string') return undefined;\n return value === 'true' || value === 'false' || NUMBER.test(value) || value.startsWith('\"')\n ? JSON.stringify(value)\n : value;\n}\n\n/**\n *\n * @param text\n */\nfunction readValue(text: string): unknown {\n if (text === 'true') return true;\n if (text === 'false') return false;\n if (NUMBER.test(text)) return Number(text);\n if (text.startsWith('\"')) {\n const parsed: unknown = JSON.parse(text);\n\n if (typeof parsed !== 'string') throw new Error(`Malformed string: ${text}`);\n return parsed;\n }\n return text;\n}\n","import { ɵNG_DOC_DEMO_MESSAGE_SOURCE } from './demo-message';\nimport { ɵdecodePlaygroundValue, ɵNgDocPlaygroundEncodedValue } from './playground-value';\n\n/**\n * The message the frame of an isolated playground sends once its target exists: the target's\n * default input values, encoded, and the inputs whose default can't be encoded.\n * @internal\n */\nexport interface ɵNgDocPlaygroundReadyMessage {\n readonly source: typeof ɵNG_DOC_DEMO_MESSAGE_SOURCE;\n readonly version: 1;\n readonly type: 'playground-ready';\n readonly defaults: Readonly<Record<string, ɵNgDocPlaygroundEncodedValue>>;\n readonly uncloneable: readonly string[];\n}\n\n/**\n * The message the frame of an isolated playground sends once it has applied the state of its URL\n * fragment.\n * @internal\n */\nexport interface ɵNgDocPlaygroundAppliedMessage {\n readonly source: typeof ɵNG_DOC_DEMO_MESSAGE_SOURCE;\n readonly version: 1;\n readonly type: 'playground-applied';\n /** The URL fragment of the state it applied, without `#`. */\n readonly fragment: string;\n}\n\n/**\n * The message the frame of an isolated playground sends when its target throws while it is\n * created or while it takes a state, or when its URL fragment is malformed.\n * @internal\n */\nexport interface ɵNgDocPlaygroundErrorMessage {\n readonly source: typeof ɵNG_DOC_DEMO_MESSAGE_SOURCE;\n readonly version: 1;\n readonly type: 'playground-error';\n readonly phase: 'create' | 'apply';\n readonly message: string;\n}\n\n/**\n * A message from the frame of an isolated playground to its documentation page.\n * @internal\n */\nexport type ɵNgDocPlaygroundFrameMessage =\n | ɵNgDocPlaygroundReadyMessage\n | ɵNgDocPlaygroundAppliedMessage\n | ɵNgDocPlaygroundErrorMessage;\n\ntype Fields = Record<string, unknown>;\n\n/**\n *\n * @param value\n * @param type\n */\nfunction header(value: unknown, type: string): value is Fields {\n const message = value as Fields | null;\n return (\n typeof message === 'object' &&\n message !== null &&\n message['source'] === ɵNG_DOC_DEMO_MESSAGE_SOURCE &&\n message['version'] === 1 &&\n message['type'] === type\n );\n}\n\n/**\n *\n * @param value\n */\nfunction isRecord(value: unknown): value is Fields {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/**\n * Whether every value of a record decodes: a malformed value is a malformed message.\n * @param value\n */\nfunction isEncodedRecord(value: unknown): value is Record<string, ɵNgDocPlaygroundEncodedValue> {\n if (!isRecord(value)) return false;\n try {\n for (const item of Object.values(value)) ɵdecodePlaygroundValue(item);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Whether a message comes from the frame of an isolated playground, and is one it sends.\n * @param value - The data of a `message` event.\n * @internal\n */\nexport function ɵisNgDocPlaygroundFrameMessage(\n value: unknown,\n): value is ɵNgDocPlaygroundFrameMessage {\n if (header(value, 'playground-ready')) {\n const uncloneable = value['uncloneable'];\n\n return (\n isEncodedRecord(value['defaults']) &&\n Array.isArray(uncloneable) &&\n uncloneable.every((name) => typeof name === 'string')\n );\n }\n if (header(value, 'playground-applied')) return typeof value['fragment'] === 'string';\n if (header(value, 'playground-error')) {\n return (\n (value['phase'] === 'create' || value['phase'] === 'apply') &&\n typeof value['message'] === 'string'\n );\n }\n return false;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAAA;;;AAGG;AACI,MAAM,2BAA2B,GAAG;AAe3C;;;;AAIG;AACG,SAAU,uBAAuB,CAAC,KAAc,EAAA;IACpD,MAAM,OAAO,GAAG,KAA8C;AAC9D,IAAA,QACE,OAAO,OAAO,KAAK,QAAQ;AAC3B,QAAA,OAAO,KAAK,IAAI;QAChB,OAAO,CAAC,MAAM,KAAK,2BAA2B;QAC9C,OAAO,CAAC,OAAO,KAAK,CAAC;QACrB,OAAO,CAAC,IAAI,KAAK,MAAM;AACvB,QAAA,OAAO,OAAO,CAAC,MAAM,KAAK,QAAQ;AAClC,QAAA,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC;AAC/B,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC;AAEvB;AAoBA;;;;AAIG;AACG,SAAU,6BAA6B,CAC3C,KAAc,EAAA;IAEd,MAAM,OAAO,GAAG,KAAoD;AACpE,IAAA,QACE,OAAO,OAAO,KAAK,QAAQ;AAC3B,QAAA,OAAO,KAAK,IAAI;QAChB,OAAO,CAAC,MAAM,KAAK,2BAA2B;QAC9C,OAAO,CAAC,OAAO,KAAK,CAAC;QACrB,OAAO,CAAC,IAAI,KAAK,YAAY;AAC7B,QAAA,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ;AACjC,QAAA,OAAO,CAAC,KAAK,CAAC,MAAM,GAA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ONTENT_UPDATE_EVENT } from '@ng-doc/app/constants';
2
3
  import { NgDocContentState } from '@ng-doc/app/services/content-state';
3
4
  import { asArray } from '@ng-doc/core/helpers/as-array';
4
5
  import { objectKeys } from '@ng-doc/core/helpers/object-keys';
@@ -19,6 +20,116 @@ function asBoolean(value) {
19
20
  return !!value;
20
21
  }
21
22
 
23
+ /**
24
+ * The newest payload of every content module an update changed, by id. A browser keeps the module
25
+ * it imported first for as long as the page lives, so a later load of the same source (a page
26
+ * opened after the update, a link preload) takes the payload from here instead.
27
+ */
28
+ const updated = new Map();
29
+ const listeners = new Set();
30
+ const listening = new WeakSet();
31
+ /**
32
+ * Applies the content updates of the Vite development host in this window. Every NgDoc content
33
+ * controller calls it in the browser; it listens once per window. Nothing dispatches the event
34
+ * outside the development host, so it is inert in production builds, and Angular's production
35
+ * mode (`ngDevMode` false) skips it altogether.
36
+ * @param view - The window, if any (none on the server).
37
+ * @internal
38
+ */
39
+ function ɵlistenNgDocContentUpdates(view) {
40
+ if ((typeof ngDevMode !== 'undefined' && !ngDevMode) || !view || listening.has(view))
41
+ return;
42
+ listening.add(view);
43
+ view.addEventListener(_NG_DOC_CONTENT_UPDATE_EVENT, (event) => {
44
+ const detail = event.detail;
45
+ const payloads = contentPayloads(detail);
46
+ // Anything this runtime cannot read is left to the client, which reloads the page.
47
+ if (!payloads)
48
+ return;
49
+ event.preventDefault();
50
+ for (const payload of payloads)
51
+ updated.set(payload.id, payload);
52
+ const change = {
53
+ ids: new Set(payloads.map((payload) => payload.id)),
54
+ search: detail.search === true,
55
+ };
56
+ for (const listener of [...listeners]) {
57
+ try {
58
+ listener(change);
59
+ }
60
+ catch (error) {
61
+ // One failing consumer must not keep the others on stale content.
62
+ reportError(view, error);
63
+ }
64
+ }
65
+ });
66
+ }
67
+ /**
68
+ * Calls `listener` with every content update applied in this window.
69
+ * @param listener - The listener.
70
+ * @returns A function that stops it.
71
+ * @internal
72
+ */
73
+ function ɵwatchNgDocContentUpdates(listener) {
74
+ listeners.add(listener);
75
+ return () => listeners.delete(listener);
76
+ }
77
+ /**
78
+ * The newest payload an update delivered for a content module.
79
+ * @param id - The content module id.
80
+ * @returns The payload, or `undefined` when no update changed the module.
81
+ * @internal
82
+ */
83
+ function ɵupdatedNgDocContent(id) {
84
+ return updated.get(id);
85
+ }
86
+ /**
87
+ * Loads a content source: its newest updated payload, if an update delivered one, or the source.
88
+ * @param source - The content source.
89
+ * @param signal - Aborts the load.
90
+ * @returns The payload.
91
+ * @internal
92
+ */
93
+ function ɵloadNgDocContent(source, signal) {
94
+ const payload = updated.get(source.id);
95
+ return payload ? Promise.resolve(payload) : source.load(signal);
96
+ }
97
+ /**
98
+ * The payloads of an update, or `undefined` when it is not one this runtime can apply.
99
+ * @param detail - The event detail.
100
+ */
101
+ function contentPayloads(detail) {
102
+ if (typeof detail !== 'object' || detail === null)
103
+ return undefined;
104
+ const { payloads, search } = detail;
105
+ if (!Array.isArray(payloads) || typeof search !== 'boolean')
106
+ return undefined;
107
+ return payloads.every(isContentModule) ? payloads : undefined;
108
+ }
109
+ /**
110
+ * Whether a value is a content module payload.
111
+ * @param value - The value.
112
+ */
113
+ function isContentModule(value) {
114
+ if (typeof value !== 'object' || value === null)
115
+ return false;
116
+ const payload = value;
117
+ return (payload.schemaVersion === 1 &&
118
+ typeof payload.id === 'string' &&
119
+ typeof payload.revision === 'string' &&
120
+ typeof payload.html === 'string');
121
+ }
122
+ /**
123
+ * Reports a listener's error without stopping the update.
124
+ * @param view - The window.
125
+ * @param error - The error.
126
+ */
127
+ function reportError(view, error) {
128
+ view.setTimeout(() => {
129
+ throw error;
130
+ });
131
+ }
132
+
22
133
  /** The key of the resolver that `ɵwithNgDocContent` adds to a generated page route. */
23
134
  const RESOLVE_KEY = 'ɵngDocContent';
24
135
  /** The loads started for each content source, so a source loads once however often it is asked. */
@@ -49,11 +160,18 @@ const ɵNG_DOC_CONTENT_WAIT = new InjectionToken('ɵNG_DOC_CONTENT_WAIT', {
49
160
  */
50
161
  function ɵpreloadNgDocContent(source) {
51
162
  const existing = preloads.get(source);
52
- if (existing)
163
+ const update = ɵupdatedNgDocContent(source.id);
164
+ // A development content update replaces whatever was loaded before it.
165
+ if (existing && (!update || existing.payload === update))
53
166
  return existing.promise;
167
+ if (update) {
168
+ const entry = { promise: Promise.resolve(update), payload: update };
169
+ preloads.set(source, entry);
170
+ return entry.promise;
171
+ }
54
172
  // Preloads are shared between navigations, so no navigation may abort them.
55
173
  const promise = Promise.resolve()
56
- .then(() => source.load(new AbortController().signal))
174
+ .then(() => ɵloadNgDocContent(source, new AbortController().signal))
57
175
  .then((payload) => {
58
176
  if (preloads.get(source) === entry)
59
177
  entry.payload = payload;
@@ -68,13 +186,14 @@ function ɵpreloadNgDocContent(source) {
68
186
  return promise;
69
187
  }
70
188
  /**
71
- * Returns the payload of a source that `ɵpreloadNgDocContent` has loaded, without waiting.
189
+ * Returns the payload of a source that `ɵpreloadNgDocContent` has loaded, or that a development
190
+ * content update delivered, without waiting.
72
191
  * @param source - The content source.
73
192
  * @returns The payload, or `undefined` when the source has not finished loading.
74
193
  * @internal
75
194
  */
76
195
  function ɵpeekNgDocContent(source) {
77
- return preloads.get(source)?.payload;
196
+ return ɵupdatedNgDocContent(source.id) ?? preloads.get(source)?.payload;
78
197
  }
79
198
  /**
80
199
  * Returns the load of a source that `ɵpreloadNgDocContent` started and that has not finished,
@@ -85,7 +204,7 @@ function ɵpeekNgDocContent(source) {
85
204
  */
86
205
  function ɵpendingNgDocContent(source) {
87
206
  const entry = preloads.get(source);
88
- return entry && !entry.payload ? entry.promise : undefined;
207
+ return entry && !entry.payload && !ɵupdatedNgDocContent(source.id) ? entry.promise : undefined;
89
208
  }
90
209
  /**
91
210
  * Drops the preloaded payload of a source, for a source that reports a new revision.
@@ -414,5 +533,5 @@ function resolvePlaygroundOption(option, isManual) {
414
533
  * Generated bundle index. Do not edit.
415
534
  */
416
535
 
417
- export { asBoolean, createComponent, formatHtml, generateToc, isDarkOsTheme, isExternalLink, isPlaygroundProperty, resolvePlaygroundOption, withNgDocContentReady, ɵNG_DOC_ASYNC_CONTENT_ATTRIBUTE, ɵNG_DOC_CONTENT_WAIT, ɵcaptureNgDocHydrationSnapshots, ɵforgetNgDocContent, ɵngDocPageUrl, ɵngDocRouteContentSources, ɵngDocRouteUrl, ɵpeekNgDocContent, ɵpendingNgDocContent, ɵpreloadNgDocContent, ɵrestoreNgDocHydrationSnapshot, ɵwithNgDocContent };
536
+ export { asBoolean, createComponent, formatHtml, generateToc, isDarkOsTheme, isExternalLink, isPlaygroundProperty, resolvePlaygroundOption, withNgDocContentReady, ɵNG_DOC_ASYNC_CONTENT_ATTRIBUTE, ɵNG_DOC_CONTENT_WAIT, ɵcaptureNgDocHydrationSnapshots, ɵforgetNgDocContent, ɵlistenNgDocContentUpdates, ɵloadNgDocContent, ɵngDocPageUrl, ɵngDocRouteContentSources, ɵngDocRouteUrl, ɵpeekNgDocContent, ɵpendingNgDocContent, ɵpreloadNgDocContent, ɵrestoreNgDocHydrationSnapshot, ɵupdatedNgDocContent, ɵwatchNgDocContentUpdates, ɵwithNgDocContent };
418
537
  //# sourceMappingURL=ng-doc-app-helpers.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ng-doc-app-helpers.mjs","sources":["../../../../libs/app/helpers/as-boolean.ts","../../../../libs/app/helpers/content-preload.ts","../../../../libs/app/helpers/content-ready.ts","../../../../libs/app/helpers/create-component.ts","../../../../libs/app/helpers/format-html.ts","../../../../libs/app/helpers/generate-toc.ts","../../../../libs/app/helpers/hydration-snapshot.ts","../../../../libs/app/helpers/is-dark-os-theme.ts","../../../../libs/app/helpers/is-external-link.ts","../../../../libs/app/helpers/is-playground-property.ts","../../../../libs/app/helpers/page-url.ts","../../../../libs/app/helpers/playground-option.ts","../../../../libs/app/helpers/ng-doc-app-helpers.ts"],"sourcesContent":["/**\n *\n * @param value\n */\nexport function asBoolean(value: unknown): boolean {\n if (typeof value === 'string') {\n return value.toLowerCase() === 'true'\n ? true\n : value.toLowerCase() === 'false'\n ? false\n : !!value;\n }\n return !!value;\n}\n","import { inject, InjectionToken } from '@angular/core';\nimport type { ActivatedRouteSnapshot, ResolveFn, Route } from '@angular/router';\nimport type { NgDocContentModule, NgDocContentSource } from '@ng-doc/core/interfaces';\n\n/** The key of the resolver that `ɵwithNgDocContent` adds to a generated page route. */\nconst RESOLVE_KEY = 'ɵngDocContent';\n\ninterface PreloadEntry {\n readonly promise: Promise<NgDocContentModule>;\n payload?: NgDocContentModule;\n}\n\n/** The loads started for each content source, so a source loads once however often it is asked. */\nconst preloads = new WeakMap<NgDocContentSource, PreloadEntry>();\n\n/**\n * The content source of each resolver made by `ɵwithNgDocContent`. The router copies route\n * objects when it loads them, but it keeps their `resolve` maps and functions, so the source is\n * found through the resolver.\n */\nconst routeSources = new WeakMap<ResolveFn<unknown>, NgDocContentSource>();\n\n/** The wait of each navigation, by its root snapshot. */\nconst navigationWaits = new WeakMap<ActivatedRouteSnapshot, Promise<void>>();\n\n/**\n * How long the router waits for the content of a page before it shows the page anyway, in\n * milliseconds. A stalled load must not freeze navigation: after this, the page opens and its\n * content renders when it arrives, as without the wait.\n * @internal\n */\nexport const ɵNG_DOC_CONTENT_WAIT = new InjectionToken<number>('ɵNG_DOC_CONTENT_WAIT', {\n factory: () => 8000,\n});\n\n/**\n * Loads a content source once and keeps its payload, so a page that renders it later shows it in\n * its first render. A failed load is forgotten, so the next request tries again.\n * @param source - The content source.\n * @returns The loaded payload.\n * @internal\n */\nexport function ɵpreloadNgDocContent(source: NgDocContentSource): Promise<NgDocContentModule> {\n const existing = preloads.get(source);\n\n if (existing) return existing.promise;\n\n // Preloads are shared between navigations, so no navigation may abort them.\n const promise = Promise.resolve()\n .then(() => source.load(new AbortController().signal))\n .then(\n (payload: NgDocContentModule) => {\n if (preloads.get(source) === entry) entry.payload = payload;\n return payload;\n },\n (error: unknown) => {\n if (preloads.get(source) === entry) preloads.delete(source);\n throw error;\n },\n );\n const entry: PreloadEntry = { promise };\n\n preloads.set(source, entry);\n\n return promise;\n}\n\n/**\n * Returns the payload of a source that `ɵpreloadNgDocContent` has loaded, without waiting.\n * @param source - The content source.\n * @returns The payload, or `undefined` when the source has not finished loading.\n * @internal\n */\nexport function ɵpeekNgDocContent(source: NgDocContentSource): NgDocContentModule | undefined {\n return preloads.get(source)?.payload;\n}\n\n/**\n * Returns the load of a source that `ɵpreloadNgDocContent` started and that has not finished,\n * so a page that opens before it finishes waits for the same load instead of starting another.\n * @param source - The content source.\n * @returns The pending load, or `undefined`.\n * @internal\n */\nexport function ɵpendingNgDocContent(\n source: NgDocContentSource,\n): Promise<NgDocContentModule> | undefined {\n const entry = preloads.get(source);\n\n return entry && !entry.payload ? entry.promise : undefined;\n}\n\n/**\n * Drops the preloaded payload of a source, for a source that reports a new revision.\n * @param source - The content source.\n * @internal\n */\nexport function ɵforgetNgDocContent(source: NgDocContentSource): void {\n preloads.delete(source);\n}\n\n/**\n * Makes the router wait for the content of a generated page before it shows the page. Without\n * it, the router removes the previous page as soon as the page's code has loaded, and an empty\n * page shows until its content arrives.\n *\n * The resolver loads the content of every route of the navigation that has some, all at once,\n * because the router runs the resolvers of nested routes one after another. A load that fails\n * still lets the navigation finish: the page shows the error. A load that takes longer than\n * `ɵNG_DOC_CONTENT_WAIT` lets it finish too: the page then renders its content when it arrives.\n * @param route - The route of the page.\n * @param source - The content source of the route's component.\n * @returns A copy of the route with the resolver added.\n * @internal\n */\nexport function ɵwithNgDocContent(route: Route, source: NgDocContentSource): Route {\n const resolver: ResolveFn<boolean> = async (snapshot: ActivatedRouteSnapshot) => {\n // The resolvers of one navigation share its root snapshot, and with it one wait: nested\n // resolvers run one after another, and each must not start a wait of its own.\n let wait = navigationWaits.get(snapshot.root);\n\n if (!wait) {\n const sources = new Set<NgDocContentSource>();\n const add = (item: ActivatedRouteSnapshot): void => {\n ɵngDocRouteContentSources(item.routeConfig).forEach((found) => sources.add(found));\n };\n\n snapshot.pathFromRoot.forEach(add);\n for (let child = snapshot.firstChild; child; child = child.firstChild) add(child);\n wait = waitFor([...sources], inject(ɵNG_DOC_CONTENT_WAIT));\n navigationWaits.set(snapshot.root, wait);\n }\n await wait;\n\n return true;\n };\n\n routeSources.set(resolver, source);\n\n return { ...route, resolve: { ...route.resolve, [RESOLVE_KEY]: resolver } };\n}\n\n/**\n * Waits until the sources have loaded or failed, or for at most `limit` milliseconds.\n * @param sources - The content sources.\n * @param limit - The longest wait, in milliseconds.\n * @returns A promise that settles when the wait is over; it never rejects.\n */\nasync function waitFor(sources: NgDocContentSource[], limit: number): Promise<void> {\n let timer: ReturnType<typeof setTimeout> | undefined;\n\n try {\n await Promise.race([\n Promise.all(sources.map((item) => ɵpreloadNgDocContent(item).catch(() => undefined))),\n // The timer is cleared as soon as the content is in, so it never keeps a server render or\n // a zone application from becoming stable.\n new Promise<void>((resolve) => (timer = setTimeout(resolve, limit))),\n ]);\n } finally {\n clearTimeout(timer);\n }\n}\n\n/**\n * Returns the content sources that `ɵwithNgDocContent` attached to a route.\n * @param route - The route, as declared or as the router copied it.\n * @returns The content sources of the route.\n * @internal\n */\nexport function ɵngDocRouteContentSources(route: Route | null | undefined): NgDocContentSource[] {\n return Object.values(route?.resolve ?? {})\n .map((resolver: unknown) => routeSources.get(resolver as ResolveFn<unknown>))\n .filter((source): source is NgDocContentSource => source !== undefined);\n}\n","import { ApplicationRef } from '@angular/core';\nimport { NgDocContentState } from '@ng-doc/app/services/content-state';\n\nexport type NgDocBootstrap<\n TArguments extends unknown[],\n TApplication extends ApplicationRef = ApplicationRef,\n> = (...arguments_: TArguments) => Promise<TApplication>;\n\n/** Waits for content loading and processing before returning an SSR application. */\nexport function withNgDocContentReady<\n TArguments extends unknown[],\n TApplication extends ApplicationRef = ApplicationRef,\n>(bootstrap: NgDocBootstrap<TArguments, TApplication>): NgDocBootstrap<TArguments, TApplication> {\n return async (...arguments_: TArguments): Promise<TApplication> => {\n let application: TApplication | undefined;\n try {\n application = await bootstrap(...arguments_);\n await application.whenStable();\n application.injector.get(NgDocContentState).throwIfFailed();\n return application;\n } catch (error) {\n try {\n application?.destroy();\n } catch {\n // Preserve the load, processing, stability, or bootstrap failure.\n }\n throw error;\n }\n };\n}\n","import { Type, ViewContainerRef } from '@angular/core';\n\n/**\n *\n * @param viewContainer\n * @param component\n * @param inputs\n */\nexport function createComponent<T>(\n viewContainer: ViewContainerRef,\n component: Type<T>,\n inputs?: object,\n): void {\n viewContainer.clear();\n\n const componentRef = viewContainer.createComponent(component);\n\n if (inputs) {\n Object.entries(inputs).forEach(([key, value]) => {\n componentRef.setInput(key, value);\n });\n }\n}\n","/**\n *\n * @param html\n */\nexport async function formatHtml(html: string): Promise<string> {\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\tconst formatter = await import('esthetic');\n\n\treturn formatter.default.html(html.trim(), {\n\t\twrap: 50,\n\t\tmarkup: {\n\t\t\tforceIndent: true,\n\t\t},\n\t});\n}\n","import { NgDocTocItem } from '@ng-doc/app/interfaces';\nimport { asArray } from '@ng-doc/core/helpers/as-array';\nimport { NgDocHeading } from '@ng-doc/core/types';\n\n/**\n * Generate table of contents, only for headings with id\n * @param container\n * @param headings\n */\nexport function generateToc(container: HTMLElement): NgDocTocItem[] {\n const headings: NgDocHeading[] = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];\n\n const headingElements: HTMLHeadingElement[] = Array.from(\n container.querySelectorAll<HTMLHeadingElement>(headings.join(', ')),\n )\n // Only the open tab of a tab group is on the page, so the headings inside tabs would come and\n // go with it; they stay out of the table of contents.\n .filter((heading: HTMLHeadingElement) => heading.id && !heading.closest('ng-doc-tabs'));\n\n const levels: number[] = asArray(new Set(headingElements.map(levelFromTagName).sort()));\n\n return headingElements.reduce((map: NgDocTocItem[], heading: HTMLHeadingElement) => {\n const headingLevel: number = levelFromTagName(heading);\n const isHeadingLink = heading.getAttribute('headingLink') === 'true';\n\n if (isHeadingLink) {\n map.push({\n title: heading.textContent?.trim() ?? '',\n element: heading,\n path: heading.getAttribute('href') ?? '',\n hash: heading.id,\n level: levels.indexOf(headingLevel) + 1,\n });\n }\n\n return map;\n }, []);\n}\n\n/**\n *\n * @param heading\n */\nfunction levelFromTagName(heading: HTMLHeadingElement): number {\n return Number(heading.tagName.toLowerCase().replace(/[a-z]*/g, '') || 1);\n}\n","/**\n * The host attribute with which a component tells that its content loads asynchronously. The\n * server renders it, so only such hosts are copied: a page with inline content costs nothing.\n * @internal\n */\nexport const ɵNG_DOC_ASYNC_CONTENT_ATTRIBUTE = 'data-ng-doc-async-content';\n\n/** The NgDoc hosts that skip hydration and whose content loads asynchronously. */\nconst SKIPPED_ASYNC_HOSTS = ['ng-doc-page', 'ng-doc-page-header']\n .map((tag: string) => `${tag}[ngskiphydration][${ɵNG_DOC_ASYNC_CONTENT_ATTRIBUTE}]`)\n .join(', ');\n/** The class of the element that holds a server-rendered copy. */\nconst SNAPSHOT_CLASS = 'ng-doc-hydration-snapshot';\n/** The host attribute that hides the host's own content while the copy is shown. */\nconst SNAPSHOT_ATTRIBUTE = 'data-ng-doc-hydration-snapshot';\n\nconst snapshots = new WeakMap<Element, DocumentFragment>();\n\n/**\n * Copies the server-rendered content of the NgDoc hosts that skip hydration and load their\n * content asynchronously.\n *\n * Angular empties such a host when it creates its component in the browser, and the page would\n * stay blank until the content arrives, so the component shows this copy until its own content\n * renders (`ɵrestoreNgDocHydrationSnapshot`). Call it in the browser before the application\n * renders.\n * @param document - The document that holds the server-rendered application.\n * @internal\n */\nexport function ɵcaptureNgDocHydrationSnapshots(document: Document): void {\n for (const host of Array.from(document.querySelectorAll(SKIPPED_ASYNC_HOSTS))) {\n if (!host.childNodes.length || snapshots.has(host)) continue;\n\n const copy = document.createDocumentFragment();\n\n host.childNodes.forEach((node: ChildNode) => copy.appendChild(node.cloneNode(true)));\n snapshots.set(host, copy);\n }\n}\n\n/**\n * Shows the server-rendered copy of a host's content, taken by\n * `ɵcaptureNgDocHydrationSnapshots`, in place of the host's own content until the returned\n * function is called. Each copy is shown once; without one, nothing changes. The copy is inert\n * and the host is busy while it is shown.\n * @param host - The host element of the component.\n * @returns A function that removes the copy and shows the host's own content; later calls do\n * nothing.\n * @internal\n */\nexport function ɵrestoreNgDocHydrationSnapshot(host: Element): () => void {\n const copy = snapshots.get(host);\n\n if (!copy) return () => undefined;\n\n snapshots.delete(host);\n\n let wrapper: HTMLElement | undefined = host.ownerDocument.createElement('div');\n\n wrapper.className = SNAPSHOT_CLASS;\n // The copied nodes lay out as the host's own children did. Inline, because the wrapper has no\n // encapsulation attribute for a component style to match.\n wrapper.style.display = 'contents';\n // A static copy: its demos, buttons and links do nothing until the real content replaces it.\n wrapper.setAttribute('inert', '');\n wrapper.appendChild(copy);\n host.insertBefore(wrapper, host.firstChild);\n host.setAttribute(SNAPSHOT_ATTRIBUTE, '');\n host.setAttribute('aria-busy', 'true');\n\n return () => {\n if (!wrapper) return;\n wrapper.remove();\n wrapper = undefined;\n host.removeAttribute(SNAPSHOT_ATTRIBUTE);\n host.removeAttribute('aria-busy');\n };\n}\n","/**\n * Check if the OS theme is dark\n */\nexport function isDarkOsTheme(): boolean {\n\treturn window.matchMedia('(prefers-color-scheme: dark)').matches;\n}\n","/**\n *\n * @param url\n */\nexport function isExternalLink(url: string): boolean {\n\tconst anchorElement: HTMLAnchorElement = document.createElement('a');\n\n\tanchorElement.href = url;\n\n\treturn anchorElement.host !== window.location.host;\n}\n","import { objectKeys } from '@ng-doc/core/helpers/object-keys';\nimport { NgDocPlaygroundProperty } from '@ng-doc/core/interfaces';\n\n/**\n *\n * @param obj\n */\nexport function isPlaygroundProperty(obj: Record<string, any>): obj is NgDocPlaygroundProperty {\n return objectKeys(obj).includes('type');\n}\n","import type { LocationStrategy } from '@angular/common';\n\n/**\n * Returns the current route as an absolute URL in path form: the route's path, query and fragment\n * on the document's origin.\n *\n * With `PathLocationStrategy`, the default, it is the document's own URL. With\n * `HashLocationStrategy` the route lives in the document's fragment (`/#/docs/page#section`), so\n * `location.hash` and links resolved against `location.href` see the wrong part of the URL. This\n * URL carries the route's own fragment, and relative links resolve against the route.\n * @param locationStrategy - The location strategy of the application.\n * @param documentUrl - The URL of the document, `location.href`.\n * @returns The URL of the route.\n * @internal\n */\nexport function ɵngDocRouteUrl(locationStrategy: LocationStrategy, documentUrl: string): URL {\n // A path that starts with `//` would be read as another host.\n return new URL(locationStrategy.path(true).replace(/^\\/*/, '/'), documentUrl);\n}\n\n/**\n * Returns the absolute URL of the current page, without its query, as the reader shares it: the\n * route in the form the location strategy shows it (`/docs/page` or `/#/docs/page`).\n * @param locationStrategy - The location strategy of the application.\n * @param location - The location of the document.\n * @param fragment - The fragment to link to, without `#`.\n * @returns The URL of the page.\n * @internal\n */\nexport function ɵngDocPageUrl(\n locationStrategy: LocationStrategy,\n location: Pick<Location, 'href' | 'origin' | 'pathname'>,\n fragment?: string,\n): string {\n const route = ɵngDocRouteUrl(locationStrategy, location.href);\n // `path()` includes the base href and `prepareExternalUrl()` adds it, so it is removed in\n // between; the round trip gives back the document's own path with `PathLocationStrategy`.\n const base = new URL(locationStrategy.getBaseHref() || '/', route).pathname.replace(/\\/+$/, '');\n const path =\n base && (route.pathname === base || route.pathname.startsWith(`${base}/`))\n ? route.pathname.slice(base.length) || '/'\n : route.pathname;\n const external = locationStrategy.prepareExternalUrl(fragment ? `${path}#${fragment}` : path);\n\n if (external.startsWith('#')) {\n // The route is the document's fragment: it follows the document's path, without its query.\n return `${location.origin}${location.pathname}${external}`;\n }\n\n if (external.startsWith('/') && !external.startsWith('//')) {\n return `${location.origin}${external}`;\n }\n\n return new URL(external, location.href).href;\n}\n","import { extractValueOrThrow } from '@ng-doc/core/helpers/extract-value';\nimport { NgDocPlaygroundOption } from '@ng-doc/core/interfaces';\n\n/** An option of a playground property, resolved to the value it sets and the text it shows. */\nexport interface NgDocResolvedPlaygroundOption {\n /** The text shown for the option. */\n label: string;\n /** The value the option sets. */\n value: unknown;\n}\n\n/**\n * Resolves an option of a playground property. A named option (an enum member) carries its\n * value; a plain value from the playground's `controls` is the value itself; any other option is\n * the source text of a union member, such as `'small'`, and is evaluated; it throws when that\n * text can't be evaluated.\n * @param option - The option.\n * @param isManual - Whether the options come from the playground's `controls`.\n * @returns The value of the option and the text that shows it.\n */\nexport function resolvePlaygroundOption(\n option: string | NgDocPlaygroundOption,\n isManual?: boolean,\n): NgDocResolvedPlaygroundOption {\n if (typeof option !== 'string') {\n return { label: option.label, value: option.value };\n }\n\n const value: unknown = isManual ? option : extractValueOrThrow(option);\n\n return { label: String(value), value };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;;;AAGG;AACG,SAAU,SAAS,CAAC,KAAc,EAAA;AACtC,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC7B,QAAA,OAAO,KAAK,CAAC,WAAW,EAAE,KAAK;AAC7B,cAAE;AACF,cAAE,KAAK,CAAC,WAAW,EAAE,KAAK;AACxB,kBAAE;AACF,kBAAE,CAAC,CAAC,KAAK;IACf;IACA,OAAO,CAAC,CAAC,KAAK;AAChB;;ACTA;AACA,MAAM,WAAW,GAAG,eAAe;AAOnC;AACA,MAAM,QAAQ,GAAG,IAAI,OAAO,EAAoC;AAEhE;;;;AAIG;AACH,MAAM,YAAY,GAAG,IAAI,OAAO,EAA0C;AAE1E;AACA,MAAM,eAAe,GAAG,IAAI,OAAO,EAAyC;AAE5E;;;;;AAKG;MACU,oBAAoB,GAAG,IAAI,cAAc,CAAS,sBAAsB,EAAE;AACrF,IAAA,OAAO,EAAE,MAAM,IAAI;AACpB,CAAA;AAED;;;;;;AAMG;AACG,SAAU,oBAAoB,CAAC,MAA0B,EAAA;IAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC;AAErC,IAAA,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAC,OAAO;;AAGrC,IAAA,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO;AAC5B,SAAA,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A,EAAI,QAAQ,CAAA,CAAE,GAAG,IAAI,CAAC;AAE7F,IAAA,IAAI,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;;QAE5B,OAAO,CAAA,EAAG,QAAQ,CAAC,MAAM,CAAA,EAAG,QAAQ,CAAC,QAAQ,CAAA,EAAG,QAAQ,CAAA,CAAE;IAC5D;AAEA,IAAA,IAAI,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;AAC1D,QAAA,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAA,EAAG,QAAQ,EAAE;IACxC;IAEA,OAAO,IAAI,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI;AAC9C;;AC3CA;;;;;;;;AAQG;AACG,SAAU,uBAAuB,CACrC,MAAsC,EACtC,QAAkB,EAAA;AAElB,IAAA,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AAC9B,QAAA,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE;IACrD;AAEA,IAAA,MAAM,KAAK,GAAY,QAAQ,GAAG,MAAM,GAAG,mBAAmB,CAAC,MAAM,CAAC;IAEtE,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE;AACxC;;AC/BA;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-doc-app-helpers.mjs","sources":["../../../../libs/app/helpers/as-boolean.ts","../../../../libs/app/helpers/content-updates.ts","../../../../libs/app/helpers/content-preload.ts","../../../../libs/app/helpers/content-ready.ts","../../../../libs/app/helpers/create-component.ts","../../../../libs/app/helpers/format-html.ts","../../../../libs/app/helpers/generate-toc.ts","../../../../libs/app/helpers/hydration-snapshot.ts","../../../../libs/app/helpers/is-dark-os-theme.ts","../../../../libs/app/helpers/is-external-link.ts","../../../../libs/app/helpers/is-playground-property.ts","../../../../libs/app/helpers/page-url.ts","../../../../libs/app/helpers/playground-option.ts","../../../../libs/app/helpers/ng-doc-app-helpers.ts"],"sourcesContent":["/**\n *\n * @param value\n */\nexport function asBoolean(value: unknown): boolean {\n if (typeof value === 'string') {\n return value.toLowerCase() === 'true'\n ? true\n : value.toLowerCase() === 'false'\n ? false\n : !!value;\n }\n return !!value;\n}\n","import { ɵNG_DOC_CONTENT_UPDATE_EVENT } from '@ng-doc/app/constants';\nimport type { NgDocContentModule, NgDocContentSource } from '@ng-doc/core/interfaces';\n\n/**\n * The detail of an `ɵNG_DOC_CONTENT_UPDATE_EVENT` (`@ng-doc/app/constants`).\n * @internal\n */\nexport interface ɵNgDocContentUpdate {\n /** The new payload of every changed content module the page may have loaded. */\n readonly payloads: readonly unknown[];\n /** Whether the search index changed too. */\n readonly search: boolean;\n}\n\n/**\n * What an update tells the code that shows content.\n * @internal\n */\nexport interface ɵNgDocContentChange {\n /** The ids of the content modules that changed. */\n readonly ids: ReadonlySet<string>;\n /** Whether the search index changed. */\n readonly search: boolean;\n}\n\n/**\n * The newest payload of every content module an update changed, by id. A browser keeps the module\n * it imported first for as long as the page lives, so a later load of the same source (a page\n * opened after the update, a link preload) takes the payload from here instead.\n */\nconst updated = new Map<string, NgDocContentModule>();\nconst listeners = new Set<(change: ɵNgDocContentChange) => void>();\nconst listening = new WeakSet<object>();\n\n/**\n * Applies the content updates of the Vite development host in this window. Every NgDoc content\n * controller calls it in the browser; it listens once per window. Nothing dispatches the event\n * outside the development host, so it is inert in production builds, and Angular's production\n * mode (`ngDevMode` false) skips it altogether.\n * @param view - The window, if any (none on the server).\n * @internal\n */\nexport function ɵlistenNgDocContentUpdates(view: Window | null | undefined): void {\n if ((typeof ngDevMode !== 'undefined' && !ngDevMode) || !view || listening.has(view)) return;\n listening.add(view);\n view.addEventListener(ɵNG_DOC_CONTENT_UPDATE_EVENT, (event: Event) => {\n const detail = (event as CustomEvent<unknown>).detail;\n const payloads = contentPayloads(detail);\n\n // Anything this runtime cannot read is left to the client, which reloads the page.\n if (!payloads) return;\n event.preventDefault();\n for (const payload of payloads) updated.set(payload.id, payload);\n const change: ɵNgDocContentChange = {\n ids: new Set(payloads.map((payload) => payload.id)),\n search: (detail as ɵNgDocContentUpdate).search === true,\n };\n for (const listener of [...listeners]) {\n try {\n listener(change);\n } catch (error) {\n // One failing consumer must not keep the others on stale content.\n reportError(view, error);\n }\n }\n });\n}\n\n/**\n * Calls `listener` with every content update applied in this window.\n * @param listener - The listener.\n * @returns A function that stops it.\n * @internal\n */\nexport function ɵwatchNgDocContentUpdates(\n listener: (change: ɵNgDocContentChange) => void,\n): () => void {\n listeners.add(listener);\n\n return () => listeners.delete(listener);\n}\n\n/**\n * The newest payload an update delivered for a content module.\n * @param id - The content module id.\n * @returns The payload, or `undefined` when no update changed the module.\n * @internal\n */\nexport function ɵupdatedNgDocContent(id: string): NgDocContentModule | undefined {\n return updated.get(id);\n}\n\n/**\n * Loads a content source: its newest updated payload, if an update delivered one, or the source.\n * @param source - The content source.\n * @param signal - Aborts the load.\n * @returns The payload.\n * @internal\n */\nexport function ɵloadNgDocContent(\n source: NgDocContentSource,\n signal: AbortSignal,\n): Promise<NgDocContentModule> {\n const payload = updated.get(source.id);\n\n return payload ? Promise.resolve(payload) : source.load(signal);\n}\n\n/**\n * The payloads of an update, or `undefined` when it is not one this runtime can apply.\n * @param detail - The event detail.\n */\nfunction contentPayloads(detail: unknown): NgDocContentModule[] | undefined {\n if (typeof detail !== 'object' || detail === null) return undefined;\n const { payloads, search } = detail as Partial<ɵNgDocContentUpdate>;\n\n if (!Array.isArray(payloads) || typeof search !== 'boolean') return undefined;\n\n return payloads.every(isContentModule) ? (payloads as NgDocContentModule[]) : undefined;\n}\n\n/**\n * Whether a value is a content module payload.\n * @param value - The value.\n */\nfunction isContentModule(value: unknown): value is NgDocContentModule {\n if (typeof value !== 'object' || value === null) return false;\n const payload = value as Partial<NgDocContentModule>;\n\n return (\n payload.schemaVersion === 1 &&\n typeof payload.id === 'string' &&\n typeof payload.revision === 'string' &&\n typeof payload.html === 'string'\n );\n}\n\n/**\n * Reports a listener's error without stopping the update.\n * @param view - The window.\n * @param error - The error.\n */\nfunction reportError(view: Window, error: unknown): void {\n view.setTimeout(() => {\n throw error;\n });\n}\n","import { inject, InjectionToken } from '@angular/core';\nimport type { ActivatedRouteSnapshot, ResolveFn, Route } from '@angular/router';\nimport type { NgDocContentModule, NgDocContentSource } from '@ng-doc/core/interfaces';\n\nimport { ɵloadNgDocContent, ɵupdatedNgDocContent } from './content-updates';\n\n/** The key of the resolver that `ɵwithNgDocContent` adds to a generated page route. */\nconst RESOLVE_KEY = 'ɵngDocContent';\n\ninterface PreloadEntry {\n readonly promise: Promise<NgDocContentModule>;\n payload?: NgDocContentModule;\n}\n\n/** The loads started for each content source, so a source loads once however often it is asked. */\nconst preloads = new WeakMap<NgDocContentSource, PreloadEntry>();\n\n/**\n * The content source of each resolver made by `ɵwithNgDocContent`. The router copies route\n * objects when it loads them, but it keeps their `resolve` maps and functions, so the source is\n * found through the resolver.\n */\nconst routeSources = new WeakMap<ResolveFn<unknown>, NgDocContentSource>();\n\n/** The wait of each navigation, by its root snapshot. */\nconst navigationWaits = new WeakMap<ActivatedRouteSnapshot, Promise<void>>();\n\n/**\n * How long the router waits for the content of a page before it shows the page anyway, in\n * milliseconds. A stalled load must not freeze navigation: after this, the page opens and its\n * content renders when it arrives, as without the wait.\n * @internal\n */\nexport const ɵNG_DOC_CONTENT_WAIT = new InjectionToken<number>('ɵNG_DOC_CONTENT_WAIT', {\n factory: () => 8000,\n});\n\n/**\n * Loads a content source once and keeps its payload, so a page that renders it later shows it in\n * its first render. A failed load is forgotten, so the next request tries again.\n * @param source - The content source.\n * @returns The loaded payload.\n * @internal\n */\nexport function ɵpreloadNgDocContent(source: NgDocContentSource): Promise<NgDocContentModule> {\n const existing = preloads.get(source);\n const update = ɵupdatedNgDocContent(source.id);\n\n // A development content update replaces whatever was loaded before it.\n if (existing && (!update || existing.payload === update)) return existing.promise;\n if (update) {\n const entry: PreloadEntry = { promise: Promise.resolve(update), payload: update };\n\n preloads.set(source, entry);\n\n return entry.promise;\n }\n\n // Preloads are shared between navigations, so no navigation may abort them.\n const promise = Promise.resolve()\n .then(() => ɵloadNgDocContent(source, new AbortController().signal))\n .then(\n (payload: NgDocContentModule) => {\n if (preloads.get(source) === entry) entry.payload = payload;\n return payload;\n },\n (error: unknown) => {\n if (preloads.get(source) === entry) preloads.delete(source);\n throw error;\n },\n );\n const entry: PreloadEntry = { promise };\n\n preloads.set(source, entry);\n\n return promise;\n}\n\n/**\n * Returns the payload of a source that `ɵpreloadNgDocContent` has loaded, or that a development\n * content update delivered, without waiting.\n * @param source - The content source.\n * @returns The payload, or `undefined` when the source has not finished loading.\n * @internal\n */\nexport function ɵpeekNgDocContent(source: NgDocContentSource): NgDocContentModule | undefined {\n return ɵupdatedNgDocContent(source.id) ?? preloads.get(source)?.payload;\n}\n\n/**\n * Returns the load of a source that `ɵpreloadNgDocContent` started and that has not finished,\n * so a page that opens before it finishes waits for the same load instead of starting another.\n * @param source - The content source.\n * @returns The pending load, or `undefined`.\n * @internal\n */\nexport function ɵpendingNgDocContent(\n source: NgDocContentSource,\n): Promise<NgDocContentModule> | undefined {\n const entry = preloads.get(source);\n\n return entry && !entry.payload && !ɵupdatedNgDocContent(source.id) ? entry.promise : undefined;\n}\n\n/**\n * Drops the preloaded payload of a source, for a source that reports a new revision.\n * @param source - The content source.\n * @internal\n */\nexport function ɵforgetNgDocContent(source: NgDocContentSource): void {\n preloads.delete(source);\n}\n\n/**\n * Makes the router wait for the content of a generated page before it shows the page. Without\n * it, the router removes the previous page as soon as the page's code has loaded, and an empty\n * page shows until its content arrives.\n *\n * The resolver loads the content of every route of the navigation that has some, all at once,\n * because the router runs the resolvers of nested routes one after another. A load that fails\n * still lets the navigation finish: the page shows the error. A load that takes longer than\n * `ɵNG_DOC_CONTENT_WAIT` lets it finish too: the page then renders its content when it arrives.\n * @param route - The route of the page.\n * @param source - The content source of the route's component.\n * @returns A copy of the route with the resolver added.\n * @internal\n */\nexport function ɵwithNgDocContent(route: Route, source: NgDocContentSource): Route {\n const resolver: ResolveFn<boolean> = async (snapshot: ActivatedRouteSnapshot) => {\n // The resolvers of one navigation share its root snapshot, and with it one wait: nested\n // resolvers run one after another, and each must not start a wait of its own.\n let wait = navigationWaits.get(snapshot.root);\n\n if (!wait) {\n const sources = new Set<NgDocContentSource>();\n const add = (item: ActivatedRouteSnapshot): void => {\n ɵngDocRouteContentSources(item.routeConfig).forEach((found) => sources.add(found));\n };\n\n snapshot.pathFromRoot.forEach(add);\n for (let child = snapshot.firstChild; child; child = child.firstChild) add(child);\n wait = waitFor([...sources], inject(ɵNG_DOC_CONTENT_WAIT));\n navigationWaits.set(snapshot.root, wait);\n }\n await wait;\n\n return true;\n };\n\n routeSources.set(resolver, source);\n\n return { ...route, resolve: { ...route.resolve, [RESOLVE_KEY]: resolver } };\n}\n\n/**\n * Waits until the sources have loaded or failed, or for at most `limit` milliseconds.\n * @param sources - The content sources.\n * @param limit - The longest wait, in milliseconds.\n * @returns A promise that settles when the wait is over; it never rejects.\n */\nasync function waitFor(sources: NgDocContentSource[], limit: number): Promise<void> {\n let timer: ReturnType<typeof setTimeout> | undefined;\n\n try {\n await Promise.race([\n Promise.all(sources.map((item) => ɵpreloadNgDocContent(item).catch(() => undefined))),\n // The timer is cleared as soon as the content is in, so it never keeps a server render or\n // a zone application from becoming stable.\n new Promise<void>((resolve) => (timer = setTimeout(resolve, limit))),\n ]);\n } finally {\n clearTimeout(timer);\n }\n}\n\n/**\n * Returns the content sources that `ɵwithNgDocContent` attached to a route.\n * @param route - The route, as declared or as the router copied it.\n * @returns The content sources of the route.\n * @internal\n */\nexport function ɵngDocRouteContentSources(route: Route | null | undefined): NgDocContentSource[] {\n return Object.values(route?.resolve ?? {})\n .map((resolver: unknown) => routeSources.get(resolver as ResolveFn<unknown>))\n .filter((source): source is NgDocContentSource => source !== undefined);\n}\n","import { ApplicationRef } from '@angular/core';\nimport { NgDocContentState } from '@ng-doc/app/services/content-state';\n\nexport type NgDocBootstrap<\n TArguments extends unknown[],\n TApplication extends ApplicationRef = ApplicationRef,\n> = (...arguments_: TArguments) => Promise<TApplication>;\n\n/** Waits for content loading and processing before returning an SSR application. */\nexport function withNgDocContentReady<\n TArguments extends unknown[],\n TApplication extends ApplicationRef = ApplicationRef,\n>(bootstrap: NgDocBootstrap<TArguments, TApplication>): NgDocBootstrap<TArguments, TApplication> {\n return async (...arguments_: TArguments): Promise<TApplication> => {\n let application: TApplication | undefined;\n try {\n application = await bootstrap(...arguments_);\n await application.whenStable();\n application.injector.get(NgDocContentState).throwIfFailed();\n return application;\n } catch (error) {\n try {\n application?.destroy();\n } catch {\n // Preserve the load, processing, stability, or bootstrap failure.\n }\n throw error;\n }\n };\n}\n","import { Type, ViewContainerRef } from '@angular/core';\n\n/**\n *\n * @param viewContainer\n * @param component\n * @param inputs\n */\nexport function createComponent<T>(\n viewContainer: ViewContainerRef,\n component: Type<T>,\n inputs?: object,\n): void {\n viewContainer.clear();\n\n const componentRef = viewContainer.createComponent(component);\n\n if (inputs) {\n Object.entries(inputs).forEach(([key, value]) => {\n componentRef.setInput(key, value);\n });\n }\n}\n","/**\n *\n * @param html\n */\nexport async function formatHtml(html: string): Promise<string> {\n\t// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n\t// @ts-ignore\n\tconst formatter = await import('esthetic');\n\n\treturn formatter.default.html(html.trim(), {\n\t\twrap: 50,\n\t\tmarkup: {\n\t\t\tforceIndent: true,\n\t\t},\n\t});\n}\n","import { NgDocTocItem } from '@ng-doc/app/interfaces';\nimport { asArray } from '@ng-doc/core/helpers/as-array';\nimport { NgDocHeading } from '@ng-doc/core/types';\n\n/**\n * Generate table of contents, only for headings with id\n * @param container\n * @param headings\n */\nexport function generateToc(container: HTMLElement): NgDocTocItem[] {\n const headings: NgDocHeading[] = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];\n\n const headingElements: HTMLHeadingElement[] = Array.from(\n container.querySelectorAll<HTMLHeadingElement>(headings.join(', ')),\n )\n // Only the open tab of a tab group is on the page, so the headings inside tabs would come and\n // go with it; they stay out of the table of contents.\n .filter((heading: HTMLHeadingElement) => heading.id && !heading.closest('ng-doc-tabs'));\n\n const levels: number[] = asArray(new Set(headingElements.map(levelFromTagName).sort()));\n\n return headingElements.reduce((map: NgDocTocItem[], heading: HTMLHeadingElement) => {\n const headingLevel: number = levelFromTagName(heading);\n const isHeadingLink = heading.getAttribute('headingLink') === 'true';\n\n if (isHeadingLink) {\n map.push({\n title: heading.textContent?.trim() ?? '',\n element: heading,\n path: heading.getAttribute('href') ?? '',\n hash: heading.id,\n level: levels.indexOf(headingLevel) + 1,\n });\n }\n\n return map;\n }, []);\n}\n\n/**\n *\n * @param heading\n */\nfunction levelFromTagName(heading: HTMLHeadingElement): number {\n return Number(heading.tagName.toLowerCase().replace(/[a-z]*/g, '') || 1);\n}\n","/**\n * The host attribute with which a component tells that its content loads asynchronously. The\n * server renders it, so only such hosts are copied: a page with inline content costs nothing.\n * @internal\n */\nexport const ɵNG_DOC_ASYNC_CONTENT_ATTRIBUTE = 'data-ng-doc-async-content';\n\n/** The NgDoc hosts that skip hydration and whose content loads asynchronously. */\nconst SKIPPED_ASYNC_HOSTS = ['ng-doc-page', 'ng-doc-page-header']\n .map((tag: string) => `${tag}[ngskiphydration][${ɵNG_DOC_ASYNC_CONTENT_ATTRIBUTE}]`)\n .join(', ');\n/** The class of the element that holds a server-rendered copy. */\nconst SNAPSHOT_CLASS = 'ng-doc-hydration-snapshot';\n/** The host attribute that hides the host's own content while the copy is shown. */\nconst SNAPSHOT_ATTRIBUTE = 'data-ng-doc-hydration-snapshot';\n\nconst snapshots = new WeakMap<Element, DocumentFragment>();\n\n/**\n * Copies the server-rendered content of the NgDoc hosts that skip hydration and load their\n * content asynchronously.\n *\n * Angular empties such a host when it creates its component in the browser, and the page would\n * stay blank until the content arrives, so the component shows this copy until its own content\n * renders (`ɵrestoreNgDocHydrationSnapshot`). Call it in the browser before the application\n * renders.\n * @param document - The document that holds the server-rendered application.\n * @internal\n */\nexport function ɵcaptureNgDocHydrationSnapshots(document: Document): void {\n for (const host of Array.from(document.querySelectorAll(SKIPPED_ASYNC_HOSTS))) {\n if (!host.childNodes.length || snapshots.has(host)) continue;\n\n const copy = document.createDocumentFragment();\n\n host.childNodes.forEach((node: ChildNode) => copy.appendChild(node.cloneNode(true)));\n snapshots.set(host, copy);\n }\n}\n\n/**\n * Shows the server-rendered copy of a host's content, taken by\n * `ɵcaptureNgDocHydrationSnapshots`, in place of the host's own content until the returned\n * function is called. Each copy is shown once; without one, nothing changes. The copy is inert\n * and the host is busy while it is shown.\n * @param host - The host element of the component.\n * @returns A function that removes the copy and shows the host's own content; later calls do\n * nothing.\n * @internal\n */\nexport function ɵrestoreNgDocHydrationSnapshot(host: Element): () => void {\n const copy = snapshots.get(host);\n\n if (!copy) return () => undefined;\n\n snapshots.delete(host);\n\n let wrapper: HTMLElement | undefined = host.ownerDocument.createElement('div');\n\n wrapper.className = SNAPSHOT_CLASS;\n // The copied nodes lay out as the host's own children did. Inline, because the wrapper has no\n // encapsulation attribute for a component style to match.\n wrapper.style.display = 'contents';\n // A static copy: its demos, buttons and links do nothing until the real content replaces it.\n wrapper.setAttribute('inert', '');\n wrapper.appendChild(copy);\n host.insertBefore(wrapper, host.firstChild);\n host.setAttribute(SNAPSHOT_ATTRIBUTE, '');\n host.setAttribute('aria-busy', 'true');\n\n return () => {\n if (!wrapper) return;\n wrapper.remove();\n wrapper = undefined;\n host.removeAttribute(SNAPSHOT_ATTRIBUTE);\n host.removeAttribute('aria-busy');\n };\n}\n","/**\n * Check if the OS theme is dark\n */\nexport function isDarkOsTheme(): boolean {\n\treturn window.matchMedia('(prefers-color-scheme: dark)').matches;\n}\n","/**\n *\n * @param url\n */\nexport function isExternalLink(url: string): boolean {\n\tconst anchorElement: HTMLAnchorElement = document.createElement('a');\n\n\tanchorElement.href = url;\n\n\treturn anchorElement.host !== window.location.host;\n}\n","import { objectKeys } from '@ng-doc/core/helpers/object-keys';\nimport { NgDocPlaygroundProperty } from '@ng-doc/core/interfaces';\n\n/**\n *\n * @param obj\n */\nexport function isPlaygroundProperty(obj: Record<string, any>): obj is NgDocPlaygroundProperty {\n return objectKeys(obj).includes('type');\n}\n","import type { LocationStrategy } from '@angular/common';\n\n/**\n * Returns the current route as an absolute URL in path form: the route's path, query and fragment\n * on the document's origin.\n *\n * With `PathLocationStrategy`, the default, it is the document's own URL. With\n * `HashLocationStrategy` the route lives in the document's fragment (`/#/docs/page#section`), so\n * `location.hash` and links resolved against `location.href` see the wrong part of the URL. This\n * URL carries the route's own fragment, and relative links resolve against the route.\n * @param locationStrategy - The location strategy of the application.\n * @param documentUrl - The URL of the document, `location.href`.\n * @returns The URL of the route.\n * @internal\n */\nexport function ɵngDocRouteUrl(locationStrategy: LocationStrategy, documentUrl: string): URL {\n // A path that starts with `//` would be read as another host.\n return new URL(locationStrategy.path(true).replace(/^\\/*/, '/'), documentUrl);\n}\n\n/**\n * Returns the absolute URL of the current page, without its query, as the reader shares it: the\n * route in the form the location strategy shows it (`/docs/page` or `/#/docs/page`).\n * @param locationStrategy - The location strategy of the application.\n * @param location - The location of the document.\n * @param fragment - The fragment to link to, without `#`.\n * @returns The URL of the page.\n * @internal\n */\nexport function ɵngDocPageUrl(\n locationStrategy: LocationStrategy,\n location: Pick<Location, 'href' | 'origin' | 'pathname'>,\n fragment?: string,\n): string {\n const route = ɵngDocRouteUrl(locationStrategy, location.href);\n // `path()` includes the base href and `prepareExternalUrl()` adds it, so it is removed in\n // between; the round trip gives back the document's own path with `PathLocationStrategy`.\n const base = new URL(locationStrategy.getBaseHref() || '/', route).pathname.replace(/\\/+$/, '');\n const path =\n base && (route.pathname === base || route.pathname.startsWith(`${base}/`))\n ? route.pathname.slice(base.length) || '/'\n : route.pathname;\n const external = locationStrategy.prepareExternalUrl(fragment ? `${path}#${fragment}` : path);\n\n if (external.startsWith('#')) {\n // The route is the document's fragment: it follows the document's path, without its query.\n return `${location.origin}${location.pathname}${external}`;\n }\n\n if (external.startsWith('/') && !external.startsWith('//')) {\n return `${location.origin}${external}`;\n }\n\n return new URL(external, location.href).href;\n}\n","import { extractValueOrThrow } from '@ng-doc/core/helpers/extract-value';\nimport { NgDocPlaygroundOption } from '@ng-doc/core/interfaces';\n\n/** An option of a playground property, resolved to the value it sets and the text it shows. */\nexport interface NgDocResolvedPlaygroundOption {\n /** The text shown for the option. */\n label: string;\n /** The value the option sets. */\n value: unknown;\n}\n\n/**\n * Resolves an option of a playground property. A named option (an enum member) carries its\n * value; a plain value from the playground's `controls` is the value itself; any other option is\n * the source text of a union member, such as `'small'`, and is evaluated; it throws when that\n * text can't be evaluated.\n * @param option - The option.\n * @param isManual - Whether the options come from the playground's `controls`.\n * @returns The value of the option and the text that shows it.\n */\nexport function resolvePlaygroundOption(\n option: string | NgDocPlaygroundOption,\n isManual?: boolean,\n): NgDocResolvedPlaygroundOption {\n if (typeof option !== 'string') {\n return { label: option.label, value: option.value };\n }\n\n const value: unknown = isManual ? option : extractValueOrThrow(option);\n\n return { label: String(value), value };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["ɵNG_DOC_CONTENT_UPDATE_EVENT"],"mappings":";;;;;;;AAAA;;;AAGG;AACG,SAAU,SAAS,CAAC,KAAc,EAAA;AACtC,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC7B,QAAA,OAAO,KAAK,CAAC,WAAW,EAAE,KAAK;AAC7B,cAAE;AACF,cAAE,KAAK,CAAC,WAAW,EAAE,KAAK;AACxB,kBAAE;AACF,kBAAE,CAAC,CAAC,KAAK;IACf;IACA,OAAO,CAAC,CAAC,KAAK;AAChB;;ACYA;;;;AAIG;AACH,MAAM,OAAO,GAAG,IAAI,GAAG,EAA8B;AACrD,MAAM,SAAS,GAAG,IAAI,GAAG,EAAyC;AAClE,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C,MAAM,CAAA,EAAG,QAAQ,CAAC,QAAQ,CAAA,EAAG,QAAQ,CAAA,CAAE;IAC5D;AAEA,IAAA,IAAI,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;AAC1D,QAAA,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAA,EAAG,QAAQ,EAAE;IACxC;IAEA,OAAO,IAAI,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI;AAC9C;;AC3CA;;;;;;;;AAQG;AACG,SAAU,uBAAuB,CACrC,MAAsC,EACtC,QAAkB,EAAA;AAElB,IAAA,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;AAC9B,QAAA,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE;IACrD;AAEA,IAAA,MAAM,KAAK,GAAY,QAAQ,GAAG,MAAM,GAAG,mBAAmB,CAAC,MAAM,CAAC;IAEtE,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE;AACxC;;AC/BA;;AAEG;;;;"}
@@ -1,6 +1,7 @@
1
- import { isPlatformBrowser, ViewportScroller } from '@angular/common';
2
- import { provideAppInitializer, inject, PLATFORM_ID, DOCUMENT } from '@angular/core';
1
+ import { isPlatformBrowser } from '@angular/common';
2
+ import { provideEnvironmentInitializer, inject, PLATFORM_ID, DOCUMENT, PendingTasks } from '@angular/core';
3
3
  import { ɵcaptureNgDocHydrationSnapshots as _captureNgDocHydrationSnapshots } from '@ng-doc/app/helpers';
4
+ import { NgDocApiListIndexService } from '@ng-doc/app/services';
4
5
  import { NgDocContentScrollIntent } from '@ng-doc/app/services/content-scroll-intent';
5
6
  import { NgDocHighlighterService } from '@ng-doc/app/services/highlighter';
6
7
  import { NG_DOC_SHORTCUTS, NgDocShortcutsService } from '@ng-doc/app/services/shortcuts';
@@ -9,6 +10,12 @@ import { provideNgDocUiKitConfig } from '@ng-doc/ui-kit';
9
10
 
10
11
  /**
11
12
  * Provides the NgDoc application configuration.
13
+ *
14
+ * Add it to the application's providers, or to the `providers` of the route that holds the
15
+ * documentation, together with the other NgDoc providers: then NgDoc starts only when the reader
16
+ * opens the documentation, and its code stays out of the application's initial bundle. It starts
17
+ * with environment initializers, which run where it is provided. The server render waits until
18
+ * the code highlighter of playgrounds has loaded.
12
19
  * @param config - The optional application configuration.
13
20
  */
14
21
  function provideNgDocApp(config) {
@@ -18,33 +25,37 @@ function provideNgDocApp(config) {
18
25
  provide: NG_DOC_CONTENT_SCROLL_POSITION_RESTORATION,
19
26
  useValue: config?.contentScrollPositionRestoration ?? 'disabled',
20
27
  },
28
+ { provide: NG_DOC_SHORTCUTS, useValue: config?.shortcuts ?? true },
29
+ /* --- Services --- */
30
+ // Provided where the configuration is, so that they read the NgDoc providers of a lazy route
31
+ // (the generated context, the shortcuts option): an instance in the root injector could not
32
+ // see them. In the root injector this is the instance `providedIn: 'root'` gives.
33
+ NgDocHighlighterService,
34
+ NgDocShortcutsService,
35
+ NgDocApiListIndexService,
21
36
  ...(config?.contentAnchorScrolling || config?.contentScrollPositionRestoration === 'enabled'
22
37
  ? [
23
- provideAppInitializer(() => {
38
+ provideEnvironmentInitializer(() => {
24
39
  inject(NgDocContentScrollIntent).start();
25
40
  }),
26
41
  ]
27
42
  : []),
28
43
  /* --- Hydration --- */
29
- // Before the application renders: the pages and headers that skip hydration show their
30
- // server-rendered content until their own is rendered, instead of a blank page.
31
- provideAppInitializer(() => {
44
+ // Before the documentation renders: the pages and headers that skip hydration show their
45
+ // server-rendered content until their own is rendered, instead of a blank page. A lazy route
46
+ // creates its injector before it creates its components, so this also runs in time when the
47
+ // documentation is the first route the browser hydrates.
48
+ provideEnvironmentInitializer(() => {
32
49
  if (isPlatformBrowser(inject(PLATFORM_ID)))
33
50
  _captureNgDocHydrationSnapshots(inject(DOCUMENT));
34
51
  }),
35
- /* --- Keyboard shortcuts --- */
36
- { provide: NG_DOC_SHORTCUTS, useValue: config?.shortcuts ?? true },
37
- // Created at start-up so the built-in shortcuts work on every page.
38
- provideAppInitializer(() => {
39
- inject(NgDocShortcutsService);
40
- }),
41
- /* --- Viewport Scroller --- */
42
- provideAppInitializer(() => {
43
- inject(ViewportScroller).setOffset([0, 120]);
44
- }),
45
52
  /* --- Shiki --- */
46
- provideAppInitializer(async () => {
47
- await inject(NgDocHighlighterService).initialize(config?.shiki);
53
+ // Started with the documentation instead of blocking the application's start: the playgrounds
54
+ // highlight their code once it is ready, and the application stays unstable until then, so the
55
+ // server renders the highlighted code.
56
+ provideEnvironmentInitializer(() => {
57
+ const highlighter = inject(NgDocHighlighterService);
58
+ inject(PendingTasks).run(() => highlighter.initialize(config?.shiki));
48
59
  }),
49
60
  /* --- UiKit --- */
50
61
  ...provideNgDocUiKitConfig(config?.uiKit),