@ng-doc/app 22.0.0 → 22.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/fesm2022/ng-doc-app-classes-root-page.mjs.map +1 -1
  2. package/fesm2022/ng-doc-app-components-demo-frame.mjs +96 -0
  3. package/fesm2022/ng-doc-app-components-demo-frame.mjs.map +1 -0
  4. package/fesm2022/ng-doc-app-components-demo-pane.mjs +1 -1
  5. package/fesm2022/ng-doc-app-components-demo-pane.mjs.map +1 -1
  6. package/fesm2022/ng-doc-app-components-demo.mjs +54 -8
  7. package/fesm2022/ng-doc-app-components-demo.mjs.map +1 -1
  8. package/fesm2022/ng-doc-app-components-playground.mjs +109 -47
  9. package/fesm2022/ng-doc-app-components-playground.mjs.map +1 -1
  10. package/fesm2022/ng-doc-app-components-tabs.mjs +21 -3
  11. package/fesm2022/ng-doc-app-components-tabs.mjs.map +1 -1
  12. package/fesm2022/ng-doc-app-components.mjs +1 -0
  13. package/fesm2022/ng-doc-app-components.mjs.map +1 -1
  14. package/fesm2022/ng-doc-app-demo-app.mjs +176 -0
  15. package/fesm2022/ng-doc-app-demo-app.mjs.map +1 -0
  16. package/fesm2022/ng-doc-app-helpers.mjs +23 -2
  17. package/fesm2022/ng-doc-app-helpers.mjs.map +1 -1
  18. package/fesm2022/ng-doc-app-processors-processors.mjs +30 -9
  19. package/fesm2022/ng-doc-app-processors-processors.mjs.map +1 -1
  20. package/fesm2022/ng-doc-app-providers-ng-doc-app.mjs.map +1 -1
  21. package/fesm2022/ng-doc-app-providers-title.mjs +129 -0
  22. package/fesm2022/ng-doc-app-providers-title.mjs.map +1 -0
  23. package/fesm2022/ng-doc-app-providers.mjs +1 -0
  24. package/fesm2022/ng-doc-app-providers.mjs.map +1 -1
  25. package/fesm2022/ng-doc-app-services-highlighter.mjs +17 -13
  26. package/fesm2022/ng-doc-app-services-highlighter.mjs.map +1 -1
  27. package/fesm2022/ng-doc-app-services-route-preloader.mjs +34 -10
  28. package/fesm2022/ng-doc-app-services-route-preloader.mjs.map +1 -1
  29. package/fesm2022/ng-doc-app-type-controls-type-alias-control.mjs +43 -8
  30. package/fesm2022/ng-doc-app-type-controls-type-alias-control.mjs.map +1 -1
  31. package/package.json +17 -4
  32. package/styles/global.css +3 -0
  33. package/styles/main.css +3 -0
  34. package/styles/themes/dark.css +10 -0
  35. package/types/ng-doc-app-classes-root-page.d.ts +8 -0
  36. package/types/ng-doc-app-components-demo-frame.d.ts +48 -0
  37. package/types/ng-doc-app-components-demo.d.ts +20 -2
  38. package/types/ng-doc-app-components-playground.d.ts +24 -3
  39. package/types/ng-doc-app-components-tabs.d.ts +13 -3
  40. package/types/ng-doc-app-components.d.ts +1 -0
  41. package/types/ng-doc-app-demo-app.d.ts +89 -0
  42. package/types/ng-doc-app-helpers.d.ts +21 -3
  43. package/types/ng-doc-app-interfaces.d.ts +15 -4
  44. package/types/ng-doc-app-processors-processors.d.ts +5 -0
  45. package/types/ng-doc-app-providers-ng-doc-app.d.ts +1 -1
  46. package/types/ng-doc-app-providers-title.d.ts +59 -0
  47. package/types/ng-doc-app-providers.d.ts +1 -0
  48. package/types/ng-doc-app-services-highlighter.d.ts +12 -5
  49. package/types/ng-doc-app-services-route-preloader.d.ts +13 -1
  50. package/types/ng-doc-app-type-controls-type-alias-control.d.ts +26 -4
@@ -1 +1 @@
1
- {"version":3,"file":"ng-doc-app-classes-root-page.mjs","sources":["../../../../libs/app/classes/root-page/root-page.ts","../../../../libs/app/classes/root-page/ng-doc-app-classes-root-page.ts"],"sourcesContent":["import { NgDocDemoAssets } from '@ng-doc/app/interfaces';\nimport type { NgDocContentSource, NgDocPage } from '@ng-doc/core/interfaces';\nimport { NgDocPageType } from '@ng-doc/core/types';\n\n/**\n * Base class for NgDoc page\n */\nexport abstract class NgDocRootPage {\n /**\n * The type of the page\n */\n abstract readonly pageType: NgDocPageType;\n /**\n * Html content of the page\n */\n abstract readonly pageContent: string;\n\n /**\n * Deferred content for generated pages. Legacy pages can continue to provide\n * {@link pageContent} only.\n */\n readonly pageContentSource?: NgDocContentSource;\n\n /**\n * Edit URL that can be used to edit the page source file in the repository\n */\n abstract readonly editSourceFileUrl?: string;\n\n /**\n * View URL that can be used to view the page source file in the repository\n */\n abstract readonly viewSourceFileUrl?: string;\n\n /**\n * The page dependencies file\n */\n readonly page?: NgDocPage;\n\n /**\n * The page demo assets that have code examples of the demo components\n */\n readonly demoAssets?: NgDocDemoAssets;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAIA;;AAEG;MACmB,aAAa,CAAA;AAmClC;;AC1CD;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-doc-app-classes-root-page.mjs","sources":["../../../../libs/app/classes/root-page/root-page.ts","../../../../libs/app/classes/root-page/ng-doc-app-classes-root-page.ts"],"sourcesContent":["import { NgDocDemoAssets } from '@ng-doc/app/interfaces';\nimport type { NgDocContentSource, NgDocPage } from '@ng-doc/core/interfaces';\nimport { NgDocPageType } from '@ng-doc/core/types';\n\n/**\n * Base class for NgDoc page\n */\nexport abstract class NgDocRootPage {\n /**\n * The type of the page\n */\n abstract readonly pageType: NgDocPageType;\n /**\n * Html content of the page\n */\n abstract readonly pageContent: string;\n\n /**\n * Deferred content for generated pages. Legacy pages can continue to provide\n * {@link pageContent} only.\n */\n readonly pageContentSource?: NgDocContentSource;\n\n /**\n * Edit URL that can be used to edit the page source file in the repository\n */\n abstract readonly editSourceFileUrl?: string;\n\n /**\n * View URL that can be used to view the page source file in the repository\n */\n abstract readonly viewSourceFileUrl?: string;\n\n /**\n * The page dependencies file\n */\n readonly page?: NgDocPage;\n\n /**\n * The page demo assets that have code examples of the demo components\n */\n readonly demoAssets?: NgDocDemoAssets;\n\n /**\n * The path of the page's demo pages, relative to the base href, when the Vite engine built them:\n * the demo `X` has its page at `<base href><demoRoute>/X`. Isolated demos show it in an iframe,\n * and the demo toolbar opens it in a new tab.\n */\n readonly demoRoute?: string;\n\n /** Whether the page's demos are isolated unless their `demo` action says otherwise (`isolatedDemos`). */\n readonly isolatedDemos?: boolean;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAIA;;AAEG;MACmB,aAAa,CAAA;AA6ClC;;ACpDD;;AAEG;;;;"}
@@ -0,0 +1,96 @@
1
+ import * as i0 from '@angular/core';
2
+ import { input, signal, computed, inject, viewChild, afterNextRender, DestroyRef, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { DomSanitizer } from '@angular/platform-browser';
4
+ import { ɵisNgDocDemoSizeMessage as _isNgDocDemoSizeMessage } from '@ng-doc/app/demo-app';
5
+
6
+ /** How long a loaded demo page may take to report its size before the frame reports a failure. */
7
+ const READY_TIMEOUT_MS = 10_000;
8
+ /**
9
+ * Shows a demo page of the demo application in an iframe, as tall as the demo's content: the demo
10
+ * page reports its height with `postMessage`, and only messages from this iframe's window and
11
+ * origin are accepted. The iframe is created in the browser after the first render (the server
12
+ * renders a placeholder with a link to the demo page) and loads lazily. Until the demo reports its
13
+ * size, a placeholder tells that it is loading; a demo page that loads without reporting it within
14
+ * 10 seconds is reported as failed, with the link.
15
+ */
16
+ class NgDocDemoFrameComponent {
17
+ constructor() {
18
+ /** The URL of the demo page, relative to the document or absolute on its origin. */
19
+ this.src = input.required(/* @ts-ignore */
20
+ ...(ngDevMode ? [{ debugName: "src" }] : /* istanbul ignore next */ []));
21
+ /** The accessible title of the iframe. */
22
+ this.frameTitle = input.required(/* @ts-ignore */
23
+ ...(ngDevMode ? [{ debugName: "frameTitle" }] : /* istanbul ignore next */ []));
24
+ /** Whether the iframe fills its container instead of taking the demo's height (fullscreen). */
25
+ this.fill = input(false, /* @ts-ignore */
26
+ ...(ngDevMode ? [{ debugName: "fill" }] : /* istanbul ignore next */ []));
27
+ /** The height the demo reported, in pixels. */
28
+ this.height = signal(undefined, /* @ts-ignore */
29
+ ...(ngDevMode ? [{ debugName: "height" }] : /* istanbul ignore next */ []));
30
+ /** `loading` until the demo reports its size, then `ready`; `failed` when it never does. */
31
+ this.state = computed(() => this.height() !== undefined ? 'ready' : this.failed() ? 'failed' : 'loading', /* @ts-ignore */
32
+ ...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
33
+ /** Whether the iframe exists: only in the browser, after the first render. */
34
+ this.created = signal(false, /* @ts-ignore */
35
+ ...(ngDevMode ? [{ debugName: "created" }] : /* istanbul ignore next */ []));
36
+ /** The demo page's URL for the iframe. */
37
+ this.frameSrc = computed(() =>
38
+ // The URL comes from the generated demo route and the demo's name: a page of this site.
39
+ this.sanitizer.bypassSecurityTrustResourceUrl(this.src()), /* @ts-ignore */
40
+ ...(ngDevMode ? [{ debugName: "frameSrc" }] : /* istanbul ignore next */ []));
41
+ this.sanitizer = inject(DomSanitizer);
42
+ this.frame = viewChild('frame', /* @ts-ignore */
43
+ ...(ngDevMode ? [{ debugName: "frame" }] : /* istanbul ignore next */ []));
44
+ this.failed = signal(false, /* @ts-ignore */
45
+ ...(ngDevMode ? [{ debugName: "failed" }] : /* istanbul ignore next */ []));
46
+ afterNextRender(() => this.created.set(true));
47
+ inject(DestroyRef).onDestroy(() => clearTimeout(this.timer));
48
+ }
49
+ /**
50
+ * Waits for the demo's size once its page has loaded.
51
+ * @internal
52
+ */
53
+ onLoad() {
54
+ clearTimeout(this.timer);
55
+ if (this.height() !== undefined)
56
+ return;
57
+ this.timer = setTimeout(() => this.failed.set(this.height() === undefined), READY_TIMEOUT_MS);
58
+ }
59
+ /**
60
+ * Takes the height a demo page reports, from this iframe only.
61
+ * @param event - A message to the window.
62
+ * @internal
63
+ */
64
+ onMessage(event) {
65
+ const frame = this.frame()?.nativeElement;
66
+ if (!frame?.contentWindow ||
67
+ event.source !== frame.contentWindow ||
68
+ event.origin !== new URL(frame.src, frame.baseURI).origin ||
69
+ !_isNgDocDemoSizeMessage(event.data)) {
70
+ return;
71
+ }
72
+ // The first message comes before the demo has rendered, with no height yet.
73
+ if (event.data.height === 0 && this.height() === undefined)
74
+ return;
75
+ clearTimeout(this.timer);
76
+ this.failed.set(false);
77
+ this.height.set(event.data.height);
78
+ }
79
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocDemoFrameComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
80
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: NgDocDemoFrameComponent, isStandalone: true, selector: "ng-doc-demo-frame", inputs: { src: { classPropertyName: "src", publicName: "src", isSignal: true, isRequired: true, transformFunction: null }, frameTitle: { classPropertyName: "frameTitle", publicName: "frameTitle", isSignal: true, isRequired: true, transformFunction: null }, fill: { classPropertyName: "fill", publicName: "fill", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "window:message": "onMessage($event)" }, properties: { "attr.data-ng-doc-state": "state()", "attr.data-ng-doc-fill": "fill()" } }, viewQueries: [{ propertyName: "frame", first: true, predicate: ["frame"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (created()) {\n <iframe\n #frame\n class=\"ng-doc-demo-frame-iframe\"\n loading=\"lazy\"\n [src]=\"frameSrc()\"\n [title]=\"frameTitle()\"\n [style.height.px]=\"fill() ? null : height()\"\n (load)=\"onLoad()\"></iframe>\n}\n@if (state() !== 'ready') {\n <div class=\"ng-doc-demo-frame-status\" role=\"status\" [attr.aria-busy]=\"state() === 'loading'\">\n @if (state() === 'loading') {\n <span class=\"ng-doc-demo-frame-skeleton\" aria-hidden=\"true\"></span>\n <span\n >Loading the demo.\n <a [href]=\"src()\" target=\"_blank\" rel=\"noopener\">Open it in a new tab</a></span\n >\n } @else {\n <span\n >The demo did not load.\n <a [href]=\"src()\" target=\"_blank\" rel=\"noopener\">Open it in a new tab</a></span\n >\n }\n </div>\n}\n", styles: [":host{position:relative;display:block;width:100%}.ng-doc-demo-frame-iframe{display:block;width:100%;border:0;background:transparent;color-scheme:normal}:host(:not([data-ng-doc-state=ready])) .ng-doc-demo-frame-iframe{position:absolute;inset:0;height:100%;opacity:0;pointer-events:none}:host([data-ng-doc-fill=true]){height:100%}:host([data-ng-doc-fill=true]) .ng-doc-demo-frame-iframe{height:100%}.ng-doc-demo-frame-status{display:flex;flex-direction:column;align-items:center;gap:var(--ng-doc-space-3);padding:var(--ng-doc-space-4);font-size:13px;color:var(--ng-doc-text-muted);text-align:center}.ng-doc-demo-frame-skeleton{width:min(240px,100%);height:32px;border-radius:var(--ng-doc-radius-md);background:var(--ng-doc-base-2);animation:ng-doc-demo-frame-pulse 1.2s ease-in-out infinite alternate}@keyframes ng-doc-demo-frame-pulse{0%{opacity:.5}to{opacity:1}}@media(prefers-reduced-motion:reduce){.ng-doc-demo-frame-skeleton{animation:none}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
81
+ }
82
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocDemoFrameComponent, decorators: [{
83
+ type: Component,
84
+ args: [{ selector: 'ng-doc-demo-frame', changeDetection: ChangeDetectionStrategy.OnPush, host: {
85
+ '[attr.data-ng-doc-state]': 'state()',
86
+ '[attr.data-ng-doc-fill]': 'fill()',
87
+ '(window:message)': 'onMessage($event)',
88
+ }, template: "@if (created()) {\n <iframe\n #frame\n class=\"ng-doc-demo-frame-iframe\"\n loading=\"lazy\"\n [src]=\"frameSrc()\"\n [title]=\"frameTitle()\"\n [style.height.px]=\"fill() ? null : height()\"\n (load)=\"onLoad()\"></iframe>\n}\n@if (state() !== 'ready') {\n <div class=\"ng-doc-demo-frame-status\" role=\"status\" [attr.aria-busy]=\"state() === 'loading'\">\n @if (state() === 'loading') {\n <span class=\"ng-doc-demo-frame-skeleton\" aria-hidden=\"true\"></span>\n <span\n >Loading the demo.\n <a [href]=\"src()\" target=\"_blank\" rel=\"noopener\">Open it in a new tab</a></span\n >\n } @else {\n <span\n >The demo did not load.\n <a [href]=\"src()\" target=\"_blank\" rel=\"noopener\">Open it in a new tab</a></span\n >\n }\n </div>\n}\n", styles: [":host{position:relative;display:block;width:100%}.ng-doc-demo-frame-iframe{display:block;width:100%;border:0;background:transparent;color-scheme:normal}:host(:not([data-ng-doc-state=ready])) .ng-doc-demo-frame-iframe{position:absolute;inset:0;height:100%;opacity:0;pointer-events:none}:host([data-ng-doc-fill=true]){height:100%}:host([data-ng-doc-fill=true]) .ng-doc-demo-frame-iframe{height:100%}.ng-doc-demo-frame-status{display:flex;flex-direction:column;align-items:center;gap:var(--ng-doc-space-3);padding:var(--ng-doc-space-4);font-size:13px;color:var(--ng-doc-text-muted);text-align:center}.ng-doc-demo-frame-skeleton{width:min(240px,100%);height:32px;border-radius:var(--ng-doc-radius-md);background:var(--ng-doc-base-2);animation:ng-doc-demo-frame-pulse 1.2s ease-in-out infinite alternate}@keyframes ng-doc-demo-frame-pulse{0%{opacity:.5}to{opacity:1}}@media(prefers-reduced-motion:reduce){.ng-doc-demo-frame-skeleton{animation:none}}\n"] }]
89
+ }], ctorParameters: () => [], propDecorators: { src: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: true }] }], frameTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "frameTitle", required: true }] }], fill: [{ type: i0.Input, args: [{ isSignal: true, alias: "fill", required: false }] }], frame: [{ type: i0.ViewChild, args: ['frame', { isSignal: true }] }] } });
90
+
91
+ /**
92
+ * Generated bundle index. Do not edit.
93
+ */
94
+
95
+ export { NgDocDemoFrameComponent };
96
+ //# sourceMappingURL=ng-doc-app-components-demo-frame.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ng-doc-app-components-demo-frame.mjs","sources":["../../../../libs/app/components/demo-frame/demo-frame.component.ts","../../../../libs/app/components/demo-frame/demo-frame.component.html","../../../../libs/app/components/demo-frame/ng-doc-app-components-demo-frame.ts"],"sourcesContent":["import {\n afterNextRender,\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n ElementRef,\n inject,\n input,\n Signal,\n signal,\n viewChild,\n} from '@angular/core';\nimport { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';\nimport { ɵisNgDocDemoSizeMessage } from '@ng-doc/app/demo-app';\n\n/** How long a loaded demo page may take to report its size before the frame reports a failure. */\nconst READY_TIMEOUT_MS = 10_000;\n\n/**\n * Shows a demo page of the demo application in an iframe, as tall as the demo's content: the demo\n * page reports its height with `postMessage`, and only messages from this iframe's window and\n * origin are accepted. The iframe is created in the browser after the first render (the server\n * renders a placeholder with a link to the demo page) and loads lazily. Until the demo reports its\n * size, a placeholder tells that it is loading; a demo page that loads without reporting it within\n * 10 seconds is reported as failed, with the link.\n */\n@Component({\n selector: 'ng-doc-demo-frame',\n templateUrl: './demo-frame.component.html',\n styleUrls: ['./demo-frame.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[attr.data-ng-doc-state]': 'state()',\n '[attr.data-ng-doc-fill]': 'fill()',\n '(window:message)': 'onMessage($event)',\n },\n})\nexport class NgDocDemoFrameComponent {\n /** The URL of the demo page, relative to the document or absolute on its origin. */\n readonly src = input.required<string>();\n\n /** The accessible title of the iframe. */\n readonly frameTitle = input.required<string>();\n\n /** Whether the iframe fills its container instead of taking the demo's height (fullscreen). */\n readonly fill = input<boolean>(false);\n\n /** The height the demo reported, in pixels. */\n readonly height = signal<number | undefined>(undefined);\n\n /** `loading` until the demo reports its size, then `ready`; `failed` when it never does. */\n readonly state: Signal<'loading' | 'ready' | 'failed'> = computed(() =>\n this.height() !== undefined ? 'ready' : this.failed() ? 'failed' : 'loading',\n );\n\n /** Whether the iframe exists: only in the browser, after the first render. */\n protected readonly created = signal(false);\n\n /** The demo page's URL for the iframe. */\n protected readonly frameSrc: Signal<SafeResourceUrl> = computed(() =>\n // The URL comes from the generated demo route and the demo's name: a page of this site.\n this.sanitizer.bypassSecurityTrustResourceUrl(this.src()),\n );\n\n private readonly sanitizer = inject(DomSanitizer);\n private readonly frame = viewChild<ElementRef<HTMLIFrameElement>>('frame');\n private readonly failed = signal(false);\n private timer?: ReturnType<typeof setTimeout>;\n\n constructor() {\n afterNextRender(() => this.created.set(true));\n inject(DestroyRef).onDestroy(() => clearTimeout(this.timer));\n }\n\n /**\n * Waits for the demo's size once its page has loaded.\n * @internal\n */\n protected onLoad(): void {\n clearTimeout(this.timer);\n if (this.height() !== undefined) return;\n this.timer = setTimeout(() => this.failed.set(this.height() === undefined), READY_TIMEOUT_MS);\n }\n\n /**\n * Takes the height a demo page reports, from this iframe only.\n * @param event - A message to the window.\n * @internal\n */\n protected onMessage(event: MessageEvent): void {\n const frame = this.frame()?.nativeElement;\n\n if (\n !frame?.contentWindow ||\n event.source !== frame.contentWindow ||\n event.origin !== new URL(frame.src, frame.baseURI).origin ||\n !ɵisNgDocDemoSizeMessage(event.data)\n ) {\n return;\n }\n // The first message comes before the demo has rendered, with no height yet.\n if (event.data.height === 0 && this.height() === undefined) return;\n clearTimeout(this.timer);\n this.failed.set(false);\n this.height.set(event.data.height);\n }\n}\n","@if (created()) {\n <iframe\n #frame\n class=\"ng-doc-demo-frame-iframe\"\n loading=\"lazy\"\n [src]=\"frameSrc()\"\n [title]=\"frameTitle()\"\n [style.height.px]=\"fill() ? null : height()\"\n (load)=\"onLoad()\"></iframe>\n}\n@if (state() !== 'ready') {\n <div class=\"ng-doc-demo-frame-status\" role=\"status\" [attr.aria-busy]=\"state() === 'loading'\">\n @if (state() === 'loading') {\n <span class=\"ng-doc-demo-frame-skeleton\" aria-hidden=\"true\"></span>\n <span\n >Loading the demo.\n <a [href]=\"src()\" target=\"_blank\" rel=\"noopener\">Open it in a new tab</a></span\n >\n } @else {\n <span\n >The demo did not load.\n <a [href]=\"src()\" target=\"_blank\" rel=\"noopener\">Open it in a new tab</a></span\n >\n }\n </div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["ɵisNgDocDemoSizeMessage"],"mappings":";;;;;AAgBA;AACA,MAAM,gBAAgB,GA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ACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,mBAAmB,EAAA,eAAA,EAGZ,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,0BAA0B,EAAE,SAAS;AACrC,wBAAA,yBAAyB,EAAE,QAAQ;AACnC,wBAAA,kBAAkB,EAAE,mBAAmB;AACxC,qBAAA,EAAA,QAAA,EAAA,4zBAAA,EAAA,MAAA,EAAA,CAAA,o7BAAA,CAAA,EAAA;6WA8BiE,OAAO,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AElE3E;;AAEG;;;;"}
@@ -39,7 +39,7 @@ class NgDocDemoPaneComponent {
39
39
  ...(ngDevMode ? [{ debugName: "assets" }] : /* istanbul ignore next */ []));
40
40
  }
41
41
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocDemoPaneComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
42
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: NgDocDemoPaneComponent, isStandalone: true, selector: "ng-doc-demo-pane", inputs: { componentName: { classPropertyName: "componentName", publicName: "componentName", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "options().class ?? \"\"" } }, ngImport: i0, template: "<ng-doc-pane [expanded]=\"options().expanded ?? false\">\n <ng-container *ngTemplateOutlet=\"codeContent\" ngDocPaneBack></ng-container>\n <div class=\"ng-doc-demo-pane-stage\" ngDocPaneFront ngDocFullscreen #stage=\"ngDocFullscreen\">\n <ng-container *ngTemplateOutlet=\"demoTemplate\"></ng-container>\n @if (!options().fullscreenRoute) {\n <ng-doc-fullscreen-toggle class=\"ng-doc-demo-pane-fullscreen\" [target]=\"stage\" />\n }\n </div>\n</ng-doc-pane>\n\n<ng-template #demoTemplate>\n @if (options().fullscreenRoute; as route) {\n <ng-doc-fullscreen-button [route]=\"route\"></ng-doc-fullscreen-button>\n } @else if (demo(); as demo) {\n <ng-container *ngComponentOutlet=\"demo; inputs: options().inputs\"></ng-container>\n }\n</ng-template>\n\n<ng-template #codeContent>\n @if (assets().length === 1) {\n <ng-doc-code [html]=\"assets()[0].code\"></ng-doc-code>\n }\n\n @if (assets().length > 1) {\n <ng-doc-tab-group [openedTab]=\"options().defaultTab\">\n @for (asset of assets(); track asset.title) {\n <ng-doc-tab [id]=\"asset.title\" [label]=\"label\" [content]=\"assetContent\">\n <ng-template #label>\n @if (asset.icon) {\n <ng-doc-icon [customIcon]=\"asset.icon\"></ng-doc-icon>\n }\n {{ asset.title }}\n </ng-template>\n <ng-template #assetContent>\n <ng-doc-code [html]=\"asset.code\"></ng-doc-code>\n </ng-template>\n </ng-doc-tab>\n }\n </ng-doc-tab-group>\n }\n</ng-template>\n", styles: [":host{display:block;height:var(--ng-doc-demo-pane-height);margin:var(--ng-doc-demo-pane-margin);--ng-doc-code-margin: 0;--ng-doc-code-border-radius: 0;--ng-doc-code-border: none;--ng-doc-tab-group-tabs-background: var(--ng-doc-demo-toolbar-background);--ng-doc-tab-group-border: none;--ng-doc-tab-group-border-radius: 0;--ng-doc-pane-border-radius: var(--ng-doc-demo-displayer-border-radius)}:host ng-doc-tab-group,:host ng-doc-code,:host ng-doc-pane{width:100%;height:100%}.ng-doc-demo-pane-stage{background-image:radial-gradient(color-mix(in srgb,var(--ng-doc-base-5) 55%,transparent) 1px,transparent 1px);background-size:16px 16px;position:relative;display:grid;place-items:center;align-self:stretch;width:100%;min-height:100%}.ng-doc-demo-pane-stage[data-ng-doc-fullscreen=true]{overflow:auto;padding:var(--ng-doc-space-16) var(--ng-doc-space-8);background-color:var(--ng-doc-pane-front-background, var(--ng-doc-pane-background, var(--ng-doc-base-1)))}.ng-doc-demo-pane-fullscreen{position:absolute;top:var(--ng-doc-space-2);right:var(--ng-doc-space-2)}\n"], dependencies: [{ kind: "component", type: NgDocPaneComponent, selector: "ng-doc-pane", inputs: ["expanded"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgDocPaneBackDirective, selector: "[ngDocPaneBack]" }, { kind: "directive", type: NgDocPaneFrontDirective, selector: "[ngDocPaneFront]" }, { kind: "component", type: NgDocCodeComponent, selector: "ng-doc-code", inputs: ["html", "copyButton", "name", "icon"] }, { kind: "component", type: NgDocTabGroupComponent, selector: "ng-doc-tab-group", inputs: ["openedTab"] }, { kind: "component", type: NgDocTabComponent, selector: "ng-doc-tab, a[ng-doc-tab]", inputs: ["label", "id", "content"] }, { kind: "component", type: NgDocFullscreenButtonComponent, selector: "ng-doc-fullscreen-button", inputs: ["route"] }, { kind: "directive", type: NgDocFullscreenDirective, selector: "[ngDocFullscreen]", exportAs: ["ngDocFullscreen"] }, { kind: "component", type: NgDocFullscreenToggleComponent, selector: "ng-doc-fullscreen-toggle", inputs: ["target"] }, { kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "component", type: NgDocIconComponent, selector: "ng-doc-icon", inputs: ["icon", "customIcon", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
42
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: NgDocDemoPaneComponent, isStandalone: true, selector: "ng-doc-demo-pane", inputs: { componentName: { classPropertyName: "componentName", publicName: "componentName", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "options().class ?? \"\"" } }, ngImport: i0, template: "<ng-doc-pane [expanded]=\"options().expanded ?? false\">\n <ng-container *ngTemplateOutlet=\"codeContent\" ngDocPaneBack></ng-container>\n <div class=\"ng-doc-demo-pane-stage\" ngDocPaneFront ngDocFullscreen #stage=\"ngDocFullscreen\">\n <ng-container *ngTemplateOutlet=\"demoTemplate\"></ng-container>\n @if (!options().fullscreenRoute) {\n <ng-doc-fullscreen-toggle class=\"ng-doc-demo-pane-fullscreen\" [target]=\"stage\" />\n }\n </div>\n</ng-doc-pane>\n\n<ng-template #demoTemplate>\n @if (options().fullscreenRoute; as route) {\n <ng-doc-fullscreen-button [route]=\"route\"></ng-doc-fullscreen-button>\n } @else if (demo(); as demo) {\n <ng-container *ngComponentOutlet=\"demo; inputs: options().inputs\"></ng-container>\n }\n</ng-template>\n\n<ng-template #codeContent>\n @if (assets().length === 1) {\n <ng-doc-code [html]=\"assets()[0].code\"></ng-doc-code>\n }\n\n @if (assets().length > 1) {\n <ng-doc-tab-group [openedTab]=\"options().defaultTab\">\n @for (asset of assets(); track asset.title) {\n <ng-doc-tab [id]=\"asset.title\" [label]=\"label\" [content]=\"assetContent\">\n <ng-template #label>\n @if (asset.icon) {\n <ng-doc-icon [customIcon]=\"asset.icon\"></ng-doc-icon>\n }\n {{ asset.title }}\n </ng-template>\n <ng-template #assetContent>\n <ng-doc-code [html]=\"asset.code\"></ng-doc-code>\n </ng-template>\n </ng-doc-tab>\n }\n </ng-doc-tab-group>\n }\n</ng-template>\n", styles: [":host{display:block;height:var(--ng-doc-demo-pane-height);margin:var(--ng-doc-demo-pane-margin);--ng-doc-code-margin: 0;--ng-doc-code-border-radius: 0;--ng-doc-code-border: none;--ng-doc-tab-group-tabs-background: var(--ng-doc-demo-toolbar-background);--ng-doc-tab-group-border: none;--ng-doc-tab-group-border-radius: 0;--ng-doc-pane-border-radius: var(--ng-doc-demo-displayer-border-radius)}:host ng-doc-tab-group,:host ng-doc-code,:host ng-doc-pane{width:100%;height:100%}.ng-doc-demo-pane-stage{background-image:radial-gradient(color-mix(in srgb,var(--ng-doc-base-5) 55%,transparent) 1px,transparent 1px);background-size:16px 16px;position:relative;display:grid;place-items:center;align-self:stretch;width:100%;min-height:100%}.ng-doc-demo-pane-stage[data-ng-doc-fullscreen=true]{overflow:auto;padding:var(--ng-doc-space-16) var(--ng-doc-space-8);background-color:var(--ng-doc-pane-front-background, var(--ng-doc-pane-background, var(--ng-doc-base-1)))}.ng-doc-demo-pane-fullscreen{position:absolute;top:var(--ng-doc-space-2);right:var(--ng-doc-space-2)}\n"], dependencies: [{ kind: "component", type: NgDocPaneComponent, selector: "ng-doc-pane", inputs: ["expanded"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgDocPaneBackDirective, selector: "[ngDocPaneBack]" }, { kind: "directive", type: NgDocPaneFrontDirective, selector: "[ngDocPaneFront]" }, { kind: "component", type: NgDocCodeComponent, selector: "ng-doc-code", inputs: ["html", "copyButton", "name", "icon"] }, { kind: "component", type: NgDocTabGroupComponent, selector: "ng-doc-tab-group", inputs: ["appearance", "openedTab"] }, { kind: "component", type: NgDocTabComponent, selector: "ng-doc-tab, a[ng-doc-tab]", inputs: ["label", "id", "content"] }, { kind: "component", type: NgDocFullscreenButtonComponent, selector: "ng-doc-fullscreen-button", inputs: ["route"] }, { kind: "directive", type: NgDocFullscreenDirective, selector: "[ngDocFullscreen]", exportAs: ["ngDocFullscreen"] }, { kind: "component", type: NgDocFullscreenToggleComponent, selector: "ng-doc-fullscreen-toggle", inputs: ["target"] }, { kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "component", type: NgDocIconComponent, selector: "ng-doc-icon", inputs: ["icon", "customIcon", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
43
43
  }
44
44
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocDemoPaneComponent, decorators: [{
45
45
  type: Component,
@@ -1 +1 @@
1
- {"version":3,"file":"ng-doc-app-components-demo-pane.mjs","sources":["../../../../libs/app/components/demo-pane/demo-pane.component.ts","../../../../libs/app/components/demo-pane/demo-pane.component.html","../../../../libs/app/components/demo-pane/ng-doc-app-components-demo-pane.ts"],"sourcesContent":["import { NgComponentOutlet, NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n Signal,\n Type,\n} from '@angular/core';\nimport { NgDocRootPage } from '@ng-doc/app/classes/root-page';\nimport { NgDocCodeComponent } from '@ng-doc/app/components/code';\nimport { NgDocFullscreenButtonComponent } from '@ng-doc/app/components/fullscreen-button';\nimport { NgDocFullscreenToggleComponent } from '@ng-doc/app/components/fullscreen-toggle';\nimport { NgDocDemoAsset } from '@ng-doc/app/interfaces';\nimport { asArray } from '@ng-doc/core/helpers/as-array';\nimport { NgDocDemoPaneActionOptions } from '@ng-doc/core/interfaces';\nimport {\n NgDocFullscreenDirective,\n NgDocIconComponent,\n NgDocPaneBackDirective,\n NgDocPaneComponent,\n NgDocPaneFrontDirective,\n NgDocTabComponent,\n NgDocTabGroupComponent,\n} from '@ng-doc/ui-kit';\n\n/**\n * Renders a demo of the page in front of its source files, which the reader reveals by dragging\n * the pane's resizer. The demo sits on the dot-grid canvas of demos, with a control that shows it\n * fullscreen with the browser Fullscreen API where the browser supports it.\n */\n@Component({\n selector: 'ng-doc-demo-pane',\n templateUrl: './demo-pane.component.html',\n styleUrls: ['./demo-pane.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n NgDocPaneComponent,\n NgTemplateOutlet,\n NgDocPaneBackDirective,\n NgDocPaneFrontDirective,\n NgDocCodeComponent,\n NgDocTabGroupComponent,\n NgDocTabComponent,\n NgDocFullscreenButtonComponent,\n NgDocFullscreenDirective,\n NgDocFullscreenToggleComponent,\n NgComponentOutlet,\n NgDocIconComponent,\n ],\n host: {\n '[class]': 'options().class ?? \"\"',\n },\n})\nexport class NgDocDemoPaneComponent {\n private readonly rootPage = inject(NgDocRootPage);\n\n /** Name of the demo component in the page's `demos`. */\n readonly componentName = input<string | undefined>(undefined);\n\n /** Options of the `demoPane` action. */\n readonly options = input<NgDocDemoPaneActionOptions>({});\n\n /** The demo component. */\n readonly demo: Signal<Type<unknown> | undefined> = computed(() => {\n const name: string | undefined = this.componentName();\n\n return name ? this.rootPage.page?.demos?.[name] : undefined;\n });\n\n /** Source files of the demo, filtered by the `tabs` option. */\n readonly assets: Signal<NgDocDemoAsset[]> = computed(() => {\n const name: string | undefined = this.componentName();\n const tabs: string | string[] | undefined = this.options().tabs;\n\n return name\n ? (this.rootPage.demoAssets?.[name] ?? []).filter(\n (asset: NgDocDemoAsset) => !tabs?.length || asArray(tabs).includes(asset.title),\n )\n : [];\n });\n}\n","<ng-doc-pane [expanded]=\"options().expanded ?? false\">\n <ng-container *ngTemplateOutlet=\"codeContent\" ngDocPaneBack></ng-container>\n <div class=\"ng-doc-demo-pane-stage\" ngDocPaneFront ngDocFullscreen #stage=\"ngDocFullscreen\">\n <ng-container *ngTemplateOutlet=\"demoTemplate\"></ng-container>\n @if (!options().fullscreenRoute) {\n <ng-doc-fullscreen-toggle class=\"ng-doc-demo-pane-fullscreen\" [target]=\"stage\" />\n }\n </div>\n</ng-doc-pane>\n\n<ng-template #demoTemplate>\n @if (options().fullscreenRoute; as route) {\n <ng-doc-fullscreen-button [route]=\"route\"></ng-doc-fullscreen-button>\n } @else if (demo(); as demo) {\n <ng-container *ngComponentOutlet=\"demo; inputs: options().inputs\"></ng-container>\n }\n</ng-template>\n\n<ng-template #codeContent>\n @if (assets().length === 1) {\n <ng-doc-code [html]=\"assets()[0].code\"></ng-doc-code>\n }\n\n @if (assets().length > 1) {\n <ng-doc-tab-group [openedTab]=\"options().defaultTab\">\n @for (asset of assets(); track asset.title) {\n <ng-doc-tab [id]=\"asset.title\" [label]=\"label\" [content]=\"assetContent\">\n <ng-template #label>\n @if (asset.icon) {\n <ng-doc-icon [customIcon]=\"asset.icon\"></ng-doc-icon>\n }\n {{ asset.title }}\n </ng-template>\n <ng-template #assetContent>\n <ng-doc-code [html]=\"asset.code\"></ng-doc-code>\n </ng-template>\n </ng-doc-tab>\n }\n </ng-doc-tab-group>\n }\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AA2BA;;;;AAIG;MAwBU,sBAAsB,CAAA;AAvBnC,IAAA,WAAA,GAAA;AAwBmB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,aAAa,CAAC;;QAGxC,IAAA,CAAA,aAAa,GAAG,KAAK,CAAqB,SAAS;0FAAC;;QAGpD,IAAA,CAAA,OAAO,GAAG,KAAK,CAA6B,EAAE;oFAAC;;AAG/C,QAAA,IAAA,CAAA,IAAI,GAAsC,QAAQ,CAAC,MAAK;AAC/D,YAAA,MAAM,IAAI,GAAuB,IAAI,CAAC,aAAa,EAAE;AAErD,YAAA,OAAO,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI,CAAC,GAAG,SAAS;QAC7D,CAAC;iFAAC;;AAGO,QAAA,IAAA,CAAA,MAAM,GAA6B,QAAQ,CAAC,MAAK;AACxD,YAAA,MAAM,IAAI,GAAuB,IAAI,CAAC,aAAa,EAAE;YACrD,MAAM,IAAI,GAAkC,IAAI,CAAC,OAAO,EAAE,CAAC,IAAI;AAE/D,YAAA,OAAO;AACL,kBAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,GAAG,IAAI,CAAC,IAAI,EAAE,EAAE,MAAM,CAC7C,CAAC,KAAqB,KAAK,CAAC,IAAI,EAAE,MAAM,IAAI,OAAO,CAAC,IA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BAAuB,CAAC,MAAM,EAAA,OAAA,EACtC;wBACP,kBAAkB;wBAClB,gBAAgB;wBAChB,sBAAsB;wBACtB,uBAAuB;wBACvB,kBAAkB;wBAClB,sBAAsB;wBACtB,iBAAiB;wBACjB,8BAA8B;wBAC9B,wBAAwB;wBACxB,8BAA8B;wBAC9B,iBAAiB;wBACjB,kBAAkB;qBACnB,EAAA,IAAA,EACK;AACJ,wBAAA,SAAS,EAAE,uBAAuB;AACnC,qBAAA,EAAA,QAAA,EAAA,ihDAAA,EAAA,MAAA,EAAA,CAAA,qiCAAA,CAAA,EAAA;;;AErDH;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-doc-app-components-demo-pane.mjs","sources":["../../../../libs/app/components/demo-pane/demo-pane.component.ts","../../../../libs/app/components/demo-pane/demo-pane.component.html","../../../../libs/app/components/demo-pane/ng-doc-app-components-demo-pane.ts"],"sourcesContent":["import { NgComponentOutlet, NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n input,\n Signal,\n Type,\n} from '@angular/core';\nimport { NgDocRootPage } from '@ng-doc/app/classes/root-page';\nimport { NgDocCodeComponent } from '@ng-doc/app/components/code';\nimport { NgDocFullscreenButtonComponent } from '@ng-doc/app/components/fullscreen-button';\nimport { NgDocFullscreenToggleComponent } from '@ng-doc/app/components/fullscreen-toggle';\nimport { NgDocDemoAsset } from '@ng-doc/app/interfaces';\nimport { asArray } from '@ng-doc/core/helpers/as-array';\nimport { NgDocDemoPaneActionOptions } from '@ng-doc/core/interfaces';\nimport {\n NgDocFullscreenDirective,\n NgDocIconComponent,\n NgDocPaneBackDirective,\n NgDocPaneComponent,\n NgDocPaneFrontDirective,\n NgDocTabComponent,\n NgDocTabGroupComponent,\n} from '@ng-doc/ui-kit';\n\n/**\n * Renders a demo of the page in front of its source files, which the reader reveals by dragging\n * the pane's resizer. The demo sits on the dot-grid canvas of demos, with a control that shows it\n * fullscreen with the browser Fullscreen API where the browser supports it.\n */\n@Component({\n selector: 'ng-doc-demo-pane',\n templateUrl: './demo-pane.component.html',\n styleUrls: ['./demo-pane.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n NgDocPaneComponent,\n NgTemplateOutlet,\n NgDocPaneBackDirective,\n NgDocPaneFrontDirective,\n NgDocCodeComponent,\n NgDocTabGroupComponent,\n NgDocTabComponent,\n NgDocFullscreenButtonComponent,\n NgDocFullscreenDirective,\n NgDocFullscreenToggleComponent,\n NgComponentOutlet,\n NgDocIconComponent,\n ],\n host: {\n '[class]': 'options().class ?? \"\"',\n },\n})\nexport class NgDocDemoPaneComponent {\n private readonly rootPage = inject(NgDocRootPage);\n\n /** Name of the demo component in the page's `demos`. */\n readonly componentName = input<string | undefined>(undefined);\n\n /** Options of the `demoPane` action. */\n readonly options = input<NgDocDemoPaneActionOptions>({});\n\n /** The demo component. */\n readonly demo: Signal<Type<unknown> | undefined> = computed(() => {\n const name: string | undefined = this.componentName();\n\n return name ? this.rootPage.page?.demos?.[name] : undefined;\n });\n\n /** Source files of the demo, filtered by the `tabs` option. */\n readonly assets: Signal<NgDocDemoAsset[]> = computed(() => {\n const name: string | undefined = this.componentName();\n const tabs: string | string[] | undefined = this.options().tabs;\n\n return name\n ? (this.rootPage.demoAssets?.[name] ?? []).filter(\n (asset: NgDocDemoAsset) => !tabs?.length || asArray(tabs).includes(asset.title),\n )\n : [];\n });\n}\n","<ng-doc-pane [expanded]=\"options().expanded ?? false\">\n <ng-container *ngTemplateOutlet=\"codeContent\" ngDocPaneBack></ng-container>\n <div class=\"ng-doc-demo-pane-stage\" ngDocPaneFront ngDocFullscreen #stage=\"ngDocFullscreen\">\n <ng-container *ngTemplateOutlet=\"demoTemplate\"></ng-container>\n @if (!options().fullscreenRoute) {\n <ng-doc-fullscreen-toggle class=\"ng-doc-demo-pane-fullscreen\" [target]=\"stage\" />\n }\n </div>\n</ng-doc-pane>\n\n<ng-template #demoTemplate>\n @if (options().fullscreenRoute; as route) {\n <ng-doc-fullscreen-button [route]=\"route\"></ng-doc-fullscreen-button>\n } @else if (demo(); as demo) {\n <ng-container *ngComponentOutlet=\"demo; inputs: options().inputs\"></ng-container>\n }\n</ng-template>\n\n<ng-template #codeContent>\n @if (assets().length === 1) {\n <ng-doc-code [html]=\"assets()[0].code\"></ng-doc-code>\n }\n\n @if (assets().length > 1) {\n <ng-doc-tab-group [openedTab]=\"options().defaultTab\">\n @for (asset of assets(); track asset.title) {\n <ng-doc-tab [id]=\"asset.title\" [label]=\"label\" [content]=\"assetContent\">\n <ng-template #label>\n @if (asset.icon) {\n <ng-doc-icon [customIcon]=\"asset.icon\"></ng-doc-icon>\n }\n {{ asset.title }}\n </ng-template>\n <ng-template #assetContent>\n <ng-doc-code [html]=\"asset.code\"></ng-doc-code>\n </ng-template>\n </ng-doc-tab>\n }\n </ng-doc-tab-group>\n }\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AA2BA;;;;AAIG;MAwBU,sBAAsB,CAAA;AAvBnC,IAAA,WAAA,GAAA;AAwBmB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,aAAa,CAAC;;QAGxC,IAAA,CAAA,aAAa,GAAG,KAAK,CAAqB,SAAS;0FAAC;;QAGpD,IAAA,CAAA,OAAO,GAAG,KAAK,CAA6B,EAAE;oFAAC;;AAG/C,QAAA,IAAA,CAAA,IAAI,GAAsC,QAAQ,CAAC,MAAK;AAC/D,YAAA,MAAM,IAAI,GAAuB,IAAI,CAAC,aAAa,EAAE;AAErD,YAAA,OAAO,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,GAAG,IAAI,CAAC,GAAG,SAAS;QAC7D,CAAC;iFAAC;;AAGO,QAAA,IAAA,CAAA,MAAM,GAA6B,QAAQ,CAAC,MAAK;AACxD,YAAA,MAAM,IAAI,GAAuB,IAAI,CAAC,aAAa,EAAE;YACrD,MAAM,IAA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AAA,YAAA,EAAA,MAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAMT,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAvBlC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,kBAAkB,EAAA,eAAA,EAGX,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC;wBACP,kBAAkB;wBAClB,gBAAgB;wBAChB,sBAAsB;wBACtB,uBAAuB;wBACvB,kBAAkB;wBAClB,sBAAsB;wBACtB,iBAAiB;wBACjB,8BAA8B;wBAC9B,wBAAwB;wBACxB,8BAA8B;wBAC9B,iBAAiB;wBACjB,kBAAkB;qBACnB,EAAA,IAAA,EACK;AACJ,wBAAA,SAAS,EAAE,uBAAuB;AACnC,qBAAA,EAAA,QAAA,EAAA,ihDAAA,EAAA,MAAA,EAAA,CAAA,qiCAAA,CAAA,EAAA;;;AErDH;;AAEG;;;;"}
@@ -1,13 +1,14 @@
1
- import { NgComponentOutlet, NgTemplateOutlet } from '@angular/common';
1
+ import { PlatformLocation, APP_BASE_HREF, NgComponentOutlet, NgTemplateOutlet } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
- import { inject, DOCUMENT, input, computed, linkedSignal, signal, viewChildren, untracked, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import { inject, DOCUMENT, input, computed, viewChild, linkedSignal, signal, viewChildren, untracked, ChangeDetectionStrategy, Component } from '@angular/core';
4
4
  import { NgDocRootPage } from '@ng-doc/app/classes/root-page';
5
5
  import { NgDocCodeComponent } from '@ng-doc/app/components/code';
6
6
  import { NgDocCopyButtonComponent } from '@ng-doc/app/components/copy-button';
7
+ import { NgDocDemoFrameComponent } from '@ng-doc/app/components/demo-frame';
7
8
  import { NgDocFullscreenButtonComponent } from '@ng-doc/app/components/fullscreen-button';
8
9
  import { NgDocFullscreenToggleComponent } from '@ng-doc/app/components/fullscreen-toggle';
9
10
  import { asArray } from '@ng-doc/core/helpers/as-array';
10
- import { NgDocFullscreenDirective, NgDocIconComponent, NgDocSelectionComponent, NgDocSelectionHostDirective, NgDocSelectionOriginDirective, NgDocTooltipDirective } from '@ng-doc/ui-kit';
11
+ import { NgDocFullscreenDirective, NgDocButtonIconComponent, NgDocIconComponent, NgDocSelectionComponent, NgDocSelectionHostDirective, NgDocSelectionOriginDirective, NgDocTooltipDirective } from '@ng-doc/ui-kit';
11
12
 
12
13
  /** The preview widths, in the order of their buttons. */
13
14
  const PREVIEW_WIDTHS = [
@@ -22,13 +23,18 @@ let nextId = 0;
22
23
  * shows the stage fullscreen with the browser Fullscreen API; it is hidden where the browser does
23
24
  * not support it.
24
25
  *
25
- * The preview widths set the width of the demo's container; they do not emulate a device, so
26
- * media queries inside the demo do not respond to them.
26
+ * When the Vite engine built demo pages for the page (`NgDocRootPage.demoRoute`), the toolbar
27
+ * opens the demo's page in a new tab, and an isolated demo (the `isolated` option, or
28
+ * `isolatedDemos`) is shown in an iframe of its page: the preview widths are then the width of the
29
+ * iframe's viewport, so media queries inside the demo respond to them. Otherwise the demo renders
30
+ * in the page, and the preview widths set the width of its container only.
27
31
  */
28
32
  class NgDocDemoComponent {
29
33
  constructor() {
30
34
  this.rootPage = inject(NgDocRootPage);
31
35
  this.document = inject(DOCUMENT);
36
+ this.platformLocation = inject(PlatformLocation);
37
+ this.appBaseHref = inject(APP_BASE_HREF, { optional: true });
32
38
  /** Name of the demo component in the page's `demos`. */
33
39
  this.componentName = input(undefined, /* @ts-ignore */
34
40
  ...(ngDevMode ? [{ debugName: "componentName" }] : /* istanbul ignore next */ []));
@@ -41,6 +47,44 @@ class NgDocDemoComponent {
41
47
  return name ? this.rootPage.page?.demos?.[name] : undefined;
42
48
  }, /* @ts-ignore */
43
49
  ...(ngDevMode ? [{ debugName: "demo" }] : /* istanbul ignore next */ []));
50
+ /**
51
+ * The URL of the demo's page, when the page has demo pages and the demo exists: the generated
52
+ * demo route and the demo's name under the base href, with the `inputs` option as a query
53
+ * parameter.
54
+ */
55
+ this.demoUrl = computed(() => {
56
+ const route = this.rootPage.demoRoute;
57
+ const name = this.componentName();
58
+ if (!route || !name || !this.demo())
59
+ return undefined;
60
+ // The demo pages are files under the document's base href, whatever the location strategy.
61
+ const baseHref = (this.appBaseHref ??
62
+ this.platformLocation.getBaseHrefFromDOM() ??
63
+ '/').replace(/^\/+|\/+$/g, '');
64
+ const path = [...baseHref.split('/'), ...route.split('/'), name]
65
+ .filter(Boolean)
66
+ .map((segment) => encodeURIComponent(segment))
67
+ .join('/');
68
+ const inputs = this.options().inputs;
69
+ const query = inputs && Object.keys(inputs).length
70
+ ? `?inputs=${encodeURIComponent(JSON.stringify(inputs))}`
71
+ : '';
72
+ return `/${path}${query}`;
73
+ }, /* @ts-ignore */
74
+ ...(ngDevMode ? [{ debugName: "demoUrl" }] : /* istanbul ignore next */ []));
75
+ /** Whether the demo is shown in an iframe of its page. */
76
+ this.isolated = computed(() => !!this.demoUrl() &&
77
+ !this.options().fullscreenRoute &&
78
+ (this.options().isolated ?? this.rootPage.isolatedDemos ?? false), /* @ts-ignore */
79
+ ...(ngDevMode ? [{ debugName: "isolated" }] : /* istanbul ignore next */ []));
80
+ /** The accessible title of the demo's iframe. */
81
+ this.frameTitle = computed(() => `${this.componentName()} demo`, /* @ts-ignore */
82
+ ...(ngDevMode ? [{ debugName: "frameTitle" }] : /* istanbul ignore next */ []));
83
+ /** Whether the stage is fullscreen. */
84
+ this.fullscreen = computed(() => this.stage()?.active() ?? false, /* @ts-ignore */
85
+ ...(ngDevMode ? [{ debugName: "fullscreen" }] : /* istanbul ignore next */ []));
86
+ this.stage = viewChild(NgDocFullscreenDirective, /* @ts-ignore */
87
+ ...(ngDevMode ? [{ debugName: "stage" }] : /* istanbul ignore next */ []));
44
88
  /** Source files of the demo, filtered by the `tabs` option. */
45
89
  this.assets = computed(() => {
46
90
  const name = this.componentName();
@@ -124,7 +168,7 @@ class NgDocDemoComponent {
124
168
  }
125
169
  }
126
170
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocDemoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
127
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: NgDocDemoComponent, isStandalone: true, selector: "ng-doc-demo", inputs: { componentName: { classPropertyName: "componentName", publicName: "componentName", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "options().class ?? \"\"", "attr.data-ng-doc-container": "options().container ?? true" } }, viewQueries: [{ propertyName: "viewTabs", predicate: ["viewTab"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (options().container ?? true) {\n <div class=\"ng-doc-demo-toolbar\">\n <div class=\"ng-doc-demo-views\" role=\"tablist\" aria-label=\"Demo view\" ngDocSelectionHost>\n <ng-doc-selection [align]=\"null\" />\n @for (item of views(); track item; let i = $index) {\n <button\n type=\"button\"\n class=\"ng-doc-demo-view\"\n role=\"tab\"\n [id]=\"idPrefix + '-tab-' + i\"\n [attr.aria-selected]=\"view() === item\"\n [ngDocSelectionOrigin]=\"view() === item\"\n [attr.aria-controls]=\"idPrefix + '-panel-' + i\"\n [attr.tabindex]=\"view() === item ? 0 : -1\"\n (click)=\"openView(item)\"\n (keydown)=\"onViewKeydown($event)\"\n #viewTab>\n @if (item === 'preview') {\n Preview\n } @else {\n @if (assets()[i - 1].icon; as icon) {\n <ng-doc-icon [customIcon]=\"icon\"></ng-doc-icon>\n }\n {{ item }}\n }\n </button>\n }\n </div>\n\n @if (view() === 'preview' && !options().fullscreenRoute) {\n <span class=\"ng-doc-demo-width-readout\">{{ widthReadout() }}</span>\n <div class=\"ng-doc-demo-widths\" role=\"group\" aria-label=\"Preview width\" ngDocSelectionHost>\n <ng-doc-selection [align]=\"null\" />\n @for (item of previewWidths; track item.width) {\n <button\n type=\"button\"\n class=\"ng-doc-demo-width\"\n [attr.aria-pressed]=\"previewWidth() === item.width\"\n [ngDocSelectionOrigin]=\"previewWidth() === item.width\"\n [attr.aria-label]=\"item.label\"\n [ngDocTooltip]=\"item.label\"\n (click)=\"previewWidth.set(item.width)\">\n @switch (item.width) {\n @case ('full') {\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <rect x=\"2\" y=\"3\" width=\"20\" height=\"14\" rx=\"2\" />\n <path d=\"M8 21h8M12 17v4\" />\n </svg>\n }\n @case ('480') {\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <rect x=\"4\" y=\"2\" width=\"16\" height=\"20\" rx=\"2\" />\n <path d=\"M12 18h.01\" />\n </svg>\n }\n @case ('280') {\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <rect x=\"6\" y=\"2\" width=\"12\" height=\"20\" rx=\"2\" />\n <path d=\"M12 18h.01\" />\n </svg>\n }\n }\n </button>\n }\n </div>\n }\n\n @if (assets().length) {\n <ng-doc-copy-button class=\"ng-doc-demo-copy\" [text]=\"copyText\" label=\"Copy code\">\n <ng-doc-icon icon=\"copy\"></ng-doc-icon>\n </ng-doc-copy-button>\n }\n\n @if (view() === 'preview' && !options().fullscreenRoute) {\n <ng-doc-fullscreen-toggle class=\"ng-doc-demo-fullscreen\" [target]=\"stage\" />\n }\n </div>\n\n <div\n class=\"ng-doc-demo-stage\"\n role=\"tabpanel\"\n [id]=\"idPrefix + '-panel-0'\"\n [attr.aria-labelledby]=\"idPrefix + '-tab-0'\"\n [attr.data-ng-doc-width]=\"previewWidth()\"\n [hidden]=\"view() !== 'preview'\"\n ngDocFullscreen\n #stage=\"ngDocFullscreen\">\n <div class=\"ng-doc-demo-frame\">\n <ng-container *ngTemplateOutlet=\"demoTemplate\"></ng-container>\n </div>\n <!-- The toolbar is not shown in fullscreen, so the stage carries its own way out. -->\n @if (stage.active()) {\n <ng-doc-fullscreen-toggle class=\"ng-doc-demo-fullscreen-exit\" [target]=\"stage\" />\n }\n </div>\n\n @for (asset of assets(); track asset.title; let i = $index) {\n @if (view() === asset.title) {\n <div\n class=\"ng-doc-demo-source\"\n role=\"tabpanel\"\n [id]=\"idPrefix + '-panel-' + (i + 1)\"\n [attr.aria-labelledby]=\"idPrefix + '-tab-' + (i + 1)\">\n <ng-doc-code [html]=\"asset.code\" [copyButton]=\"false\"></ng-doc-code>\n </div>\n }\n }\n} @else {\n <ng-container *ngTemplateOutlet=\"demoTemplate\"></ng-container>\n}\n\n<ng-template #demoTemplate>\n @if (options().fullscreenRoute; as route) {\n <ng-doc-fullscreen-button [route]=\"route\"></ng-doc-fullscreen-button>\n } @else if (demo(); as demo) {\n <ng-container *ngComponentOutlet=\"demo; inputs: options().inputs\"></ng-container>\n }\n</ng-template>\n", styles: [":host{display:block;margin:var(--ng-doc-demo-margin);border:var(--ng-doc-demo-displayer-border);border-radius:var(--ng-doc-demo-displayer-border-radius);background:var(--ng-doc-demo-displayer-background, var(--ng-doc-background));overflow:hidden;min-width:0;--ng-doc-code-margin: 0;--ng-doc-code-border-radius: 0;--ng-doc-code-border: none}:host[data-ng-doc-container=false]{border:none;border-radius:0;background:none;overflow:visible}.ng-doc-demo-toolbar{display:flex;align-items:center;gap:var(--ng-doc-space-2);min-height:48px;padding:var(--ng-doc-space-2);background:var(--ng-doc-demo-toolbar-background);border-bottom:1px solid var(--ng-doc-border-color);font-family:var(--ng-doc-font-family)}.ng-doc-demo-views,.ng-doc-demo-widths{display:inline-flex;flex:none;gap:2px;max-width:100%;padding:3px;border-radius:var(--ng-doc-radius-md);background:var(--ng-doc-base-2);overflow-x:auto;scrollbar-width:none}.ng-doc-demo-views{flex:0 1 auto}.ng-doc-demo-view,.ng-doc-demo-width{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 10px;border:0;border-radius:var(--ng-doc-radius-sm);background:none;font:inherit;font-size:13px;font-weight:500;line-height:18px;color:var(--ng-doc-text-muted);white-space:nowrap;cursor:pointer;--ng-doc-icon-color: currentColor}.ng-doc-demo-view:hover,.ng-doc-demo-width:hover{color:var(--ng-doc-heading-color)}.ng-doc-demo-view:focus-visible,.ng-doc-demo-width:focus-visible{outline:none;box-shadow:var(--ng-doc-focus-ring)}.ng-doc-demo-view[aria-selected=true],.ng-doc-demo-view[aria-pressed=true],.ng-doc-demo-width[aria-selected=true],.ng-doc-demo-width[aria-pressed=true]{color:var(--ng-doc-heading-color)}.ng-doc-demo-views,.ng-doc-demo-widths{position:relative}.ng-doc-demo-views ng-doc-selection,.ng-doc-demo-views ng-doc-selection:not([data-ng-doc-placed])~[aria-selected=true],.ng-doc-demo-views ng-doc-selection:not([data-ng-doc-placed])~[aria-pressed=true],.ng-doc-demo-widths ng-doc-selection,.ng-doc-demo-widths ng-doc-selection:not([data-ng-doc-placed])~[aria-selected=true],.ng-doc-demo-widths ng-doc-selection:not([data-ng-doc-placed])~[aria-pressed=true]{border-radius:var(--ng-doc-radius-sm);background:var(--ng-doc-background);box-shadow:var(--ng-doc-shadow-xs)}.ng-doc-demo-view,.ng-doc-demo-width{position:relative}.ng-doc-demo-width{padding:0 7px}.ng-doc-demo-width svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}:host-context([data-theme=dark]) ng-doc-selection,:host-context([data-theme=dark]) ng-doc-selection:not([data-ng-doc-placed])~[aria-selected=true],:host-context([data-theme=dark]) ng-doc-selection:not([data-ng-doc-placed])~[aria-pressed=true]{box-shadow:var(--ng-doc-shadow-xs),inset 0 0 0 1px var(--ng-doc-base-4)}@media(prefers-color-scheme:dark){:host-context([data-theme=auto]) ng-doc-selection,:host-context([data-theme=auto]) ng-doc-selection:not([data-ng-doc-placed])~[aria-selected=true],:host-context([data-theme=auto]) ng-doc-selection:not([data-ng-doc-placed])~[aria-pressed=true]{box-shadow:var(--ng-doc-shadow-xs),inset 0 0 0 1px var(--ng-doc-base-4)}}.ng-doc-demo-width-readout{margin-left:auto;font-size:12px;font-variant-numeric:tabular-nums;color:var(--ng-doc-text-muted);white-space:nowrap}.ng-doc-demo-copy{margin-left:auto;--ng-doc-icon-color: var(--ng-doc-text-muted)}.ng-doc-demo-width-readout~.ng-doc-demo-copy{margin-left:0}.ng-doc-demo-fullscreen{margin-left:auto}.ng-doc-demo-width-readout~.ng-doc-demo-fullscreen,.ng-doc-demo-copy~.ng-doc-demo-fullscreen{margin-left:0}.ng-doc-demo-stage{background-image:radial-gradient(color-mix(in srgb,var(--ng-doc-base-5) 55%,transparent) 1px,transparent 1px);background-size:16px 16px;position:relative;display:grid;place-items:center;min-height:160px;padding:var(--ng-doc-space-8) var(--ng-doc-space-4);background-color:var(--ng-doc-demo-displayer-background, var(--ng-doc-background))}.ng-doc-demo-stage[hidden]{display:none}.ng-doc-demo-stage[data-ng-doc-fullscreen=true]{overflow:auto;padding:var(--ng-doc-space-16) var(--ng-doc-space-8)}.ng-doc-demo-stage[data-ng-doc-fullscreen=true][data-ng-doc-width=full]>.ng-doc-demo-frame{width:auto;max-width:100%}.ng-doc-demo-fullscreen-exit{position:absolute;top:var(--ng-doc-space-4);right:var(--ng-doc-space-4);border-radius:var(--ng-doc-radius-md);background:var(--ng-doc-background);box-shadow:0 0 0 1px var(--ng-doc-border-color),var(--ng-doc-shadow-sm)}.ng-doc-demo-frame{width:100%;min-width:0;border-radius:var(--ng-doc-radius-md);transition:width var(--ng-doc-transition) var(--ng-doc-easing)}[data-ng-doc-width=\"480\"]>.ng-doc-demo-frame,[data-ng-doc-width=\"280\"]>.ng-doc-demo-frame{padding:var(--ng-doc-space-5);background:var(--ng-doc-background);box-shadow:0 0 0 1px var(--ng-doc-border-color),var(--ng-doc-shadow-sm);overflow:auto}[data-ng-doc-width=\"480\"]>.ng-doc-demo-frame{width:min(480px,100%)}[data-ng-doc-width=\"280\"]>.ng-doc-demo-frame{width:min(280px,100%)}.ng-doc-demo-source{background:var(--ng-doc-code-background)}@media(prefers-reduced-motion:reduce){.ng-doc-demo-frame{transition:none}}@media(max-width:640px){.ng-doc-demo-width-readout,.ng-doc-demo-widths{display:none}.ng-doc-demo-copy{margin-left:auto}}\n"], dependencies: [{ kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: NgDocCodeComponent, selector: "ng-doc-code", inputs: ["html", "copyButton", "name", "icon"] }, { kind: "component", type: NgDocCopyButtonComponent, selector: "ng-doc-copy-button", inputs: ["text", "label"] }, { kind: "component", type: NgDocFullscreenButtonComponent, selector: "ng-doc-fullscreen-button", inputs: ["route"] }, { kind: "directive", type: NgDocFullscreenDirective, selector: "[ngDocFullscreen]", exportAs: ["ngDocFullscreen"] }, { kind: "component", type: NgDocFullscreenToggleComponent, selector: "ng-doc-fullscreen-toggle", inputs: ["target"] }, { kind: "component", type: NgDocIconComponent, selector: "ng-doc-icon", inputs: ["icon", "customIcon", "size"] }, { kind: "component", type: NgDocSelectionComponent, selector: "ng-doc-selection", inputs: ["align"] }, { kind: "directive", type: NgDocSelectionHostDirective, selector: "[ngDocSelectionHost]" }, { kind: "directive", type: NgDocSelectionOriginDirective, selector: "[ngDocSelectionOrigin]", inputs: ["ngDocSelectionOrigin"] }, { kind: "directive", type: NgDocTooltipDirective, selector: "[ngDocTooltip]", inputs: ["ngDocTooltip", "delay", "displayOrigin", "pointerOrigin", "positions", "canOpen", "panelClass", "minHeight", "maxHeight", "height", "minWidth", "maxWidth", "width"], outputs: ["beforeOpen", "afterOpen", "beforeClose", "afterClose"], exportAs: ["ngDocTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
171
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.2.1", type: NgDocDemoComponent, isStandalone: true, selector: "ng-doc-demo", inputs: { componentName: { classPropertyName: "componentName", publicName: "componentName", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "options().class ?? \"\"", "attr.data-ng-doc-container": "options().container ?? true" } }, viewQueries: [{ propertyName: "stage", first: true, predicate: NgDocFullscreenDirective, descendants: true, isSignal: true }, { propertyName: "viewTabs", predicate: ["viewTab"], descendants: true, isSignal: true }], ngImport: i0, template: "@if (options().container ?? true) {\n <div class=\"ng-doc-demo-toolbar\">\n <div class=\"ng-doc-demo-views\" role=\"tablist\" aria-label=\"Demo view\" ngDocSelectionHost>\n <ng-doc-selection [align]=\"null\" />\n @for (item of views(); track item; let i = $index) {\n <button\n type=\"button\"\n class=\"ng-doc-demo-view\"\n role=\"tab\"\n [id]=\"idPrefix + '-tab-' + i\"\n [attr.aria-selected]=\"view() === item\"\n [ngDocSelectionOrigin]=\"view() === item\"\n [attr.aria-controls]=\"idPrefix + '-panel-' + i\"\n [attr.tabindex]=\"view() === item ? 0 : -1\"\n (click)=\"openView(item)\"\n (keydown)=\"onViewKeydown($event)\"\n #viewTab>\n @if (item === 'preview') {\n Preview\n } @else {\n @if (assets()[i - 1].icon; as icon) {\n <ng-doc-icon [customIcon]=\"icon\"></ng-doc-icon>\n }\n {{ item }}\n }\n </button>\n }\n </div>\n\n @if (view() === 'preview' && !options().fullscreenRoute) {\n <span class=\"ng-doc-demo-width-readout\">{{ widthReadout() }}</span>\n <div class=\"ng-doc-demo-widths\" role=\"group\" aria-label=\"Preview width\" ngDocSelectionHost>\n <ng-doc-selection [align]=\"null\" />\n @for (item of previewWidths; track item.width) {\n <button\n type=\"button\"\n class=\"ng-doc-demo-width\"\n [attr.aria-pressed]=\"previewWidth() === item.width\"\n [ngDocSelectionOrigin]=\"previewWidth() === item.width\"\n [attr.aria-label]=\"item.label\"\n [ngDocTooltip]=\"item.label\"\n (click)=\"previewWidth.set(item.width)\">\n @switch (item.width) {\n @case ('full') {\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <rect x=\"2\" y=\"3\" width=\"20\" height=\"14\" rx=\"2\" />\n <path d=\"M8 21h8M12 17v4\" />\n </svg>\n }\n @case ('480') {\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <rect x=\"4\" y=\"2\" width=\"16\" height=\"20\" rx=\"2\" />\n <path d=\"M12 18h.01\" />\n </svg>\n }\n @case ('280') {\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <rect x=\"6\" y=\"2\" width=\"12\" height=\"20\" rx=\"2\" />\n <path d=\"M12 18h.01\" />\n </svg>\n }\n }\n </button>\n }\n </div>\n }\n\n @if (assets().length) {\n <ng-doc-copy-button class=\"ng-doc-demo-copy\" [text]=\"copyText\" label=\"Copy code\">\n <ng-doc-icon icon=\"copy\"></ng-doc-icon>\n </ng-doc-copy-button>\n }\n\n @if (demoUrl(); as url) {\n <a\n class=\"ng-doc-demo-open\"\n ng-doc-button-icon\n [rounded]=\"false\"\n [href]=\"url\"\n target=\"_blank\"\n rel=\"noopener\"\n aria-label=\"Open in a new tab\"\n ngDocTooltip=\"Open in a new tab\">\n <ng-doc-icon icon=\"external-link\"></ng-doc-icon>\n </a>\n }\n\n @if (view() === 'preview' && !options().fullscreenRoute) {\n <ng-doc-fullscreen-toggle class=\"ng-doc-demo-fullscreen\" [target]=\"stage\" />\n }\n </div>\n\n <div\n class=\"ng-doc-demo-stage\"\n role=\"tabpanel\"\n [id]=\"idPrefix + '-panel-0'\"\n [attr.aria-labelledby]=\"idPrefix + '-tab-0'\"\n [attr.data-ng-doc-width]=\"previewWidth()\"\n [attr.data-ng-doc-isolated]=\"isolated()\"\n [hidden]=\"view() !== 'preview'\"\n ngDocFullscreen\n #stage=\"ngDocFullscreen\">\n <div class=\"ng-doc-demo-frame\">\n <ng-container *ngTemplateOutlet=\"demoTemplate\"></ng-container>\n </div>\n <!-- The toolbar is not shown in fullscreen, so the stage carries its own way out. -->\n @if (stage.active()) {\n <ng-doc-fullscreen-toggle class=\"ng-doc-demo-fullscreen-exit\" [target]=\"stage\" />\n }\n </div>\n\n @for (asset of assets(); track asset.title; let i = $index) {\n @if (view() === asset.title) {\n <div\n class=\"ng-doc-demo-source\"\n role=\"tabpanel\"\n [id]=\"idPrefix + '-panel-' + (i + 1)\"\n [attr.aria-labelledby]=\"idPrefix + '-tab-' + (i + 1)\">\n <ng-doc-code [html]=\"asset.code\" [copyButton]=\"false\"></ng-doc-code>\n </div>\n }\n }\n} @else {\n <ng-container *ngTemplateOutlet=\"demoTemplate\"></ng-container>\n}\n\n<ng-template #demoTemplate>\n @if (options().fullscreenRoute; as route) {\n <ng-doc-fullscreen-button [route]=\"route\"></ng-doc-fullscreen-button>\n } @else if (isolated()) {\n <ng-doc-demo-frame [src]=\"demoUrl()!\" [frameTitle]=\"frameTitle()\" [fill]=\"fullscreen()\" />\n } @else if (demo(); as demo) {\n <ng-container *ngComponentOutlet=\"demo; inputs: options().inputs\"></ng-container>\n }\n</ng-template>\n", styles: [":host{display:block;margin:var(--ng-doc-demo-margin);border:var(--ng-doc-demo-displayer-border);border-radius:var(--ng-doc-demo-displayer-border-radius);background:var(--ng-doc-demo-displayer-background, var(--ng-doc-background));overflow:hidden;min-width:0;--ng-doc-code-margin: 0;--ng-doc-code-border-radius: 0;--ng-doc-code-border: none}:host[data-ng-doc-container=false]{border:none;border-radius:0;background:none;overflow:visible}.ng-doc-demo-toolbar{display:flex;align-items:center;gap:var(--ng-doc-space-2);min-height:48px;padding:var(--ng-doc-space-2);background:var(--ng-doc-demo-toolbar-background);border-bottom:1px solid var(--ng-doc-border-color);font-family:var(--ng-doc-font-family)}.ng-doc-demo-views,.ng-doc-demo-widths{display:inline-flex;flex:none;gap:2px;max-width:100%;padding:3px;border-radius:var(--ng-doc-radius-md);background:var(--ng-doc-base-2);overflow-x:auto;scrollbar-width:none}.ng-doc-demo-views{flex:0 1 auto}.ng-doc-demo-view,.ng-doc-demo-width{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 10px;border:0;border-radius:var(--ng-doc-radius-sm);background:none;font:inherit;font-size:13px;font-weight:500;line-height:18px;color:var(--ng-doc-text-muted);white-space:nowrap;cursor:pointer;--ng-doc-icon-color: currentColor}.ng-doc-demo-view:hover,.ng-doc-demo-width:hover{color:var(--ng-doc-heading-color)}.ng-doc-demo-view:focus-visible,.ng-doc-demo-width:focus-visible{outline:none;box-shadow:var(--ng-doc-focus-ring)}.ng-doc-demo-view[aria-selected=true],.ng-doc-demo-view[aria-pressed=true],.ng-doc-demo-width[aria-selected=true],.ng-doc-demo-width[aria-pressed=true]{color:var(--ng-doc-heading-color)}.ng-doc-demo-views,.ng-doc-demo-widths{position:relative}.ng-doc-demo-views ng-doc-selection,.ng-doc-demo-views ng-doc-selection:not([data-ng-doc-placed])~[aria-selected=true],.ng-doc-demo-views ng-doc-selection:not([data-ng-doc-placed])~[aria-pressed=true],.ng-doc-demo-widths ng-doc-selection,.ng-doc-demo-widths ng-doc-selection:not([data-ng-doc-placed])~[aria-selected=true],.ng-doc-demo-widths ng-doc-selection:not([data-ng-doc-placed])~[aria-pressed=true]{border-radius:var(--ng-doc-radius-sm);background:var(--ng-doc-background);box-shadow:var(--ng-doc-shadow-xs)}.ng-doc-demo-view,.ng-doc-demo-width{position:relative}.ng-doc-demo-width{padding:0 7px}.ng-doc-demo-width svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}:host-context([data-theme=dark]) ng-doc-selection,:host-context([data-theme=dark]) ng-doc-selection:not([data-ng-doc-placed])~[aria-selected=true],:host-context([data-theme=dark]) ng-doc-selection:not([data-ng-doc-placed])~[aria-pressed=true]{box-shadow:var(--ng-doc-shadow-xs),inset 0 0 0 1px var(--ng-doc-base-4)}@media(prefers-color-scheme:dark){:host-context([data-theme=auto]) ng-doc-selection,:host-context([data-theme=auto]) ng-doc-selection:not([data-ng-doc-placed])~[aria-selected=true],:host-context([data-theme=auto]) ng-doc-selection:not([data-ng-doc-placed])~[aria-pressed=true]{box-shadow:var(--ng-doc-shadow-xs),inset 0 0 0 1px var(--ng-doc-base-4)}}.ng-doc-demo-width-readout{margin-left:auto;font-size:12px;font-variant-numeric:tabular-nums;color:var(--ng-doc-text-muted);white-space:nowrap}.ng-doc-demo-copy{margin-left:auto;--ng-doc-icon-color: var(--ng-doc-text-muted)}.ng-doc-demo-width-readout~.ng-doc-demo-copy{margin-left:0}.ng-doc-demo-open{margin-left:auto;--ng-doc-icon-color: var(--ng-doc-text-muted)}.ng-doc-demo-width-readout~.ng-doc-demo-open,.ng-doc-demo-copy~.ng-doc-demo-open{margin-left:0}.ng-doc-demo-fullscreen{margin-left:auto}.ng-doc-demo-width-readout~.ng-doc-demo-fullscreen,.ng-doc-demo-copy~.ng-doc-demo-fullscreen,.ng-doc-demo-open~.ng-doc-demo-fullscreen{margin-left:0}.ng-doc-demo-stage{background-image:radial-gradient(color-mix(in srgb,var(--ng-doc-base-5) 55%,transparent) 1px,transparent 1px);background-size:16px 16px;position:relative;display:grid;place-items:center;min-height:160px;padding:var(--ng-doc-space-8) var(--ng-doc-space-4);background-color:var(--ng-doc-demo-displayer-background, var(--ng-doc-background))}.ng-doc-demo-stage[hidden]{display:none}.ng-doc-demo-stage[data-ng-doc-fullscreen=true]{overflow:auto;padding:var(--ng-doc-space-16) var(--ng-doc-space-8)}.ng-doc-demo-stage[data-ng-doc-fullscreen=true][data-ng-doc-width=full]>.ng-doc-demo-frame{width:auto;max-width:100%}.ng-doc-demo-fullscreen-exit{position:absolute;top:var(--ng-doc-space-4);right:var(--ng-doc-space-4);border-radius:var(--ng-doc-radius-md);background:var(--ng-doc-background);box-shadow:0 0 0 1px var(--ng-doc-border-color),var(--ng-doc-shadow-sm)}.ng-doc-demo-frame{width:100%;min-width:0;border-radius:var(--ng-doc-radius-md);transition:width var(--ng-doc-transition) var(--ng-doc-easing)}[data-ng-doc-width=\"480\"]>.ng-doc-demo-frame,[data-ng-doc-width=\"280\"]>.ng-doc-demo-frame{padding:var(--ng-doc-space-5);background:var(--ng-doc-background);box-shadow:0 0 0 1px var(--ng-doc-border-color),var(--ng-doc-shadow-sm);overflow:auto}[data-ng-doc-width=\"480\"]>.ng-doc-demo-frame{width:min(480px,100%)}[data-ng-doc-width=\"280\"]>.ng-doc-demo-frame{width:min(280px,100%)}.ng-doc-demo-stage[data-ng-doc-isolated=true]>.ng-doc-demo-frame{padding:0;overflow:hidden}.ng-doc-demo-stage[data-ng-doc-isolated=true][data-ng-doc-fullscreen=true]{place-items:stretch center;padding:0}.ng-doc-demo-stage[data-ng-doc-isolated=true][data-ng-doc-fullscreen=true]>.ng-doc-demo-frame{height:100%}.ng-doc-demo-stage[data-ng-doc-isolated=true][data-ng-doc-fullscreen=true][data-ng-doc-width=full]>.ng-doc-demo-frame{width:100%}.ng-doc-demo-source{background:var(--ng-doc-code-background)}@media(prefers-reduced-motion:reduce){.ng-doc-demo-frame{transition:none}}@media(max-width:640px){.ng-doc-demo-width-readout,.ng-doc-demo-widths{display:none}.ng-doc-demo-copy,.ng-doc-demo-open{margin-left:auto}.ng-doc-demo-copy~.ng-doc-demo-open{margin-left:0}}\n"], dependencies: [{ kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: NgDocCodeComponent, selector: "ng-doc-code", inputs: ["html", "copyButton", "name", "icon"] }, { kind: "component", type: NgDocButtonIconComponent, selector: "button[ng-doc-button-icon], a[ng-doc-button-icon], button[ng-doc-button-icon-raised], a[ng-doc-button-icon-raised], button[ng-doc-button-icon-transparent], a[ng-doc-button-icon-transparent]", inputs: ["size", "rounded"] }, { kind: "component", type: NgDocCopyButtonComponent, selector: "ng-doc-copy-button", inputs: ["text", "label"] }, { kind: "component", type: NgDocDemoFrameComponent, selector: "ng-doc-demo-frame", inputs: ["src", "frameTitle", "fill"] }, { kind: "component", type: NgDocFullscreenButtonComponent, selector: "ng-doc-fullscreen-button", inputs: ["route"] }, { kind: "directive", type: NgDocFullscreenDirective, selector: "[ngDocFullscreen]", exportAs: ["ngDocFullscreen"] }, { kind: "component", type: NgDocFullscreenToggleComponent, selector: "ng-doc-fullscreen-toggle", inputs: ["target"] }, { kind: "component", type: NgDocIconComponent, selector: "ng-doc-icon", inputs: ["icon", "customIcon", "size"] }, { kind: "component", type: NgDocSelectionComponent, selector: "ng-doc-selection", inputs: ["align"] }, { kind: "directive", type: NgDocSelectionHostDirective, selector: "[ngDocSelectionHost]" }, { kind: "directive", type: NgDocSelectionOriginDirective, selector: "[ngDocSelectionOrigin]", inputs: ["ngDocSelectionOrigin"] }, { kind: "directive", type: NgDocTooltipDirective, selector: "[ngDocTooltip]", inputs: ["ngDocTooltip", "delay", "displayOrigin", "pointerOrigin", "positions", "canOpen", "panelClass", "minHeight", "maxHeight", "height", "minWidth", "maxWidth", "width"], outputs: ["beforeOpen", "afterOpen", "beforeClose", "afterClose"], exportAs: ["ngDocTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
128
172
  }
129
173
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImport: i0, type: NgDocDemoComponent, decorators: [{
130
174
  type: Component,
@@ -132,7 +176,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
132
176
  NgComponentOutlet,
133
177
  NgTemplateOutlet,
134
178
  NgDocCodeComponent,
179
+ NgDocButtonIconComponent,
135
180
  NgDocCopyButtonComponent,
181
+ NgDocDemoFrameComponent,
136
182
  NgDocFullscreenButtonComponent,
137
183
  NgDocFullscreenDirective,
138
184
  NgDocFullscreenToggleComponent,
@@ -144,8 +190,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.1", ngImpor
144
190
  ], host: {
145
191
  '[class]': 'options().class ?? ""',
146
192
  '[attr.data-ng-doc-container]': 'options().container ?? true',
147
- }, template: "@if (options().container ?? true) {\n <div class=\"ng-doc-demo-toolbar\">\n <div class=\"ng-doc-demo-views\" role=\"tablist\" aria-label=\"Demo view\" ngDocSelectionHost>\n <ng-doc-selection [align]=\"null\" />\n @for (item of views(); track item; let i = $index) {\n <button\n type=\"button\"\n class=\"ng-doc-demo-view\"\n role=\"tab\"\n [id]=\"idPrefix + '-tab-' + i\"\n [attr.aria-selected]=\"view() === item\"\n [ngDocSelectionOrigin]=\"view() === item\"\n [attr.aria-controls]=\"idPrefix + '-panel-' + i\"\n [attr.tabindex]=\"view() === item ? 0 : -1\"\n (click)=\"openView(item)\"\n (keydown)=\"onViewKeydown($event)\"\n #viewTab>\n @if (item === 'preview') {\n Preview\n } @else {\n @if (assets()[i - 1].icon; as icon) {\n <ng-doc-icon [customIcon]=\"icon\"></ng-doc-icon>\n }\n {{ item }}\n }\n </button>\n }\n </div>\n\n @if (view() === 'preview' && !options().fullscreenRoute) {\n <span class=\"ng-doc-demo-width-readout\">{{ widthReadout() }}</span>\n <div class=\"ng-doc-demo-widths\" role=\"group\" aria-label=\"Preview width\" ngDocSelectionHost>\n <ng-doc-selection [align]=\"null\" />\n @for (item of previewWidths; track item.width) {\n <button\n type=\"button\"\n class=\"ng-doc-demo-width\"\n [attr.aria-pressed]=\"previewWidth() === item.width\"\n [ngDocSelectionOrigin]=\"previewWidth() === item.width\"\n [attr.aria-label]=\"item.label\"\n [ngDocTooltip]=\"item.label\"\n (click)=\"previewWidth.set(item.width)\">\n @switch (item.width) {\n @case ('full') {\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <rect x=\"2\" y=\"3\" width=\"20\" height=\"14\" rx=\"2\" />\n <path d=\"M8 21h8M12 17v4\" />\n </svg>\n }\n @case ('480') {\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <rect x=\"4\" y=\"2\" width=\"16\" height=\"20\" rx=\"2\" />\n <path d=\"M12 18h.01\" />\n </svg>\n }\n @case ('280') {\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <rect x=\"6\" y=\"2\" width=\"12\" height=\"20\" rx=\"2\" />\n <path d=\"M12 18h.01\" />\n </svg>\n }\n }\n </button>\n }\n </div>\n }\n\n @if (assets().length) {\n <ng-doc-copy-button class=\"ng-doc-demo-copy\" [text]=\"copyText\" label=\"Copy code\">\n <ng-doc-icon icon=\"copy\"></ng-doc-icon>\n </ng-doc-copy-button>\n }\n\n @if (view() === 'preview' && !options().fullscreenRoute) {\n <ng-doc-fullscreen-toggle class=\"ng-doc-demo-fullscreen\" [target]=\"stage\" />\n }\n </div>\n\n <div\n class=\"ng-doc-demo-stage\"\n role=\"tabpanel\"\n [id]=\"idPrefix + '-panel-0'\"\n [attr.aria-labelledby]=\"idPrefix + '-tab-0'\"\n [attr.data-ng-doc-width]=\"previewWidth()\"\n [hidden]=\"view() !== 'preview'\"\n ngDocFullscreen\n #stage=\"ngDocFullscreen\">\n <div class=\"ng-doc-demo-frame\">\n <ng-container *ngTemplateOutlet=\"demoTemplate\"></ng-container>\n </div>\n <!-- The toolbar is not shown in fullscreen, so the stage carries its own way out. -->\n @if (stage.active()) {\n <ng-doc-fullscreen-toggle class=\"ng-doc-demo-fullscreen-exit\" [target]=\"stage\" />\n }\n </div>\n\n @for (asset of assets(); track asset.title; let i = $index) {\n @if (view() === asset.title) {\n <div\n class=\"ng-doc-demo-source\"\n role=\"tabpanel\"\n [id]=\"idPrefix + '-panel-' + (i + 1)\"\n [attr.aria-labelledby]=\"idPrefix + '-tab-' + (i + 1)\">\n <ng-doc-code [html]=\"asset.code\" [copyButton]=\"false\"></ng-doc-code>\n </div>\n }\n }\n} @else {\n <ng-container *ngTemplateOutlet=\"demoTemplate\"></ng-container>\n}\n\n<ng-template #demoTemplate>\n @if (options().fullscreenRoute; as route) {\n <ng-doc-fullscreen-button [route]=\"route\"></ng-doc-fullscreen-button>\n } @else if (demo(); as demo) {\n <ng-container *ngComponentOutlet=\"demo; inputs: options().inputs\"></ng-container>\n }\n</ng-template>\n", styles: [":host{display:block;margin:var(--ng-doc-demo-margin);border:var(--ng-doc-demo-displayer-border);border-radius:var(--ng-doc-demo-displayer-border-radius);background:var(--ng-doc-demo-displayer-background, var(--ng-doc-background));overflow:hidden;min-width:0;--ng-doc-code-margin: 0;--ng-doc-code-border-radius: 0;--ng-doc-code-border: none}:host[data-ng-doc-container=false]{border:none;border-radius:0;background:none;overflow:visible}.ng-doc-demo-toolbar{display:flex;align-items:center;gap:var(--ng-doc-space-2);min-height:48px;padding:var(--ng-doc-space-2);background:var(--ng-doc-demo-toolbar-background);border-bottom:1px solid var(--ng-doc-border-color);font-family:var(--ng-doc-font-family)}.ng-doc-demo-views,.ng-doc-demo-widths{display:inline-flex;flex:none;gap:2px;max-width:100%;padding:3px;border-radius:var(--ng-doc-radius-md);background:var(--ng-doc-base-2);overflow-x:auto;scrollbar-width:none}.ng-doc-demo-views{flex:0 1 auto}.ng-doc-demo-view,.ng-doc-demo-width{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 10px;border:0;border-radius:var(--ng-doc-radius-sm);background:none;font:inherit;font-size:13px;font-weight:500;line-height:18px;color:var(--ng-doc-text-muted);white-space:nowrap;cursor:pointer;--ng-doc-icon-color: currentColor}.ng-doc-demo-view:hover,.ng-doc-demo-width:hover{color:var(--ng-doc-heading-color)}.ng-doc-demo-view:focus-visible,.ng-doc-demo-width:focus-visible{outline:none;box-shadow:var(--ng-doc-focus-ring)}.ng-doc-demo-view[aria-selected=true],.ng-doc-demo-view[aria-pressed=true],.ng-doc-demo-width[aria-selected=true],.ng-doc-demo-width[aria-pressed=true]{color:var(--ng-doc-heading-color)}.ng-doc-demo-views,.ng-doc-demo-widths{position:relative}.ng-doc-demo-views ng-doc-selection,.ng-doc-demo-views ng-doc-selection:not([data-ng-doc-placed])~[aria-selected=true],.ng-doc-demo-views ng-doc-selection:not([data-ng-doc-placed])~[aria-pressed=true],.ng-doc-demo-widths ng-doc-selection,.ng-doc-demo-widths ng-doc-selection:not([data-ng-doc-placed])~[aria-selected=true],.ng-doc-demo-widths ng-doc-selection:not([data-ng-doc-placed])~[aria-pressed=true]{border-radius:var(--ng-doc-radius-sm);background:var(--ng-doc-background);box-shadow:var(--ng-doc-shadow-xs)}.ng-doc-demo-view,.ng-doc-demo-width{position:relative}.ng-doc-demo-width{padding:0 7px}.ng-doc-demo-width svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}:host-context([data-theme=dark]) ng-doc-selection,:host-context([data-theme=dark]) ng-doc-selection:not([data-ng-doc-placed])~[aria-selected=true],:host-context([data-theme=dark]) ng-doc-selection:not([data-ng-doc-placed])~[aria-pressed=true]{box-shadow:var(--ng-doc-shadow-xs),inset 0 0 0 1px var(--ng-doc-base-4)}@media(prefers-color-scheme:dark){:host-context([data-theme=auto]) ng-doc-selection,:host-context([data-theme=auto]) ng-doc-selection:not([data-ng-doc-placed])~[aria-selected=true],:host-context([data-theme=auto]) ng-doc-selection:not([data-ng-doc-placed])~[aria-pressed=true]{box-shadow:var(--ng-doc-shadow-xs),inset 0 0 0 1px var(--ng-doc-base-4)}}.ng-doc-demo-width-readout{margin-left:auto;font-size:12px;font-variant-numeric:tabular-nums;color:var(--ng-doc-text-muted);white-space:nowrap}.ng-doc-demo-copy{margin-left:auto;--ng-doc-icon-color: var(--ng-doc-text-muted)}.ng-doc-demo-width-readout~.ng-doc-demo-copy{margin-left:0}.ng-doc-demo-fullscreen{margin-left:auto}.ng-doc-demo-width-readout~.ng-doc-demo-fullscreen,.ng-doc-demo-copy~.ng-doc-demo-fullscreen{margin-left:0}.ng-doc-demo-stage{background-image:radial-gradient(color-mix(in srgb,var(--ng-doc-base-5) 55%,transparent) 1px,transparent 1px);background-size:16px 16px;position:relative;display:grid;place-items:center;min-height:160px;padding:var(--ng-doc-space-8) var(--ng-doc-space-4);background-color:var(--ng-doc-demo-displayer-background, var(--ng-doc-background))}.ng-doc-demo-stage[hidden]{display:none}.ng-doc-demo-stage[data-ng-doc-fullscreen=true]{overflow:auto;padding:var(--ng-doc-space-16) var(--ng-doc-space-8)}.ng-doc-demo-stage[data-ng-doc-fullscreen=true][data-ng-doc-width=full]>.ng-doc-demo-frame{width:auto;max-width:100%}.ng-doc-demo-fullscreen-exit{position:absolute;top:var(--ng-doc-space-4);right:var(--ng-doc-space-4);border-radius:var(--ng-doc-radius-md);background:var(--ng-doc-background);box-shadow:0 0 0 1px var(--ng-doc-border-color),var(--ng-doc-shadow-sm)}.ng-doc-demo-frame{width:100%;min-width:0;border-radius:var(--ng-doc-radius-md);transition:width var(--ng-doc-transition) var(--ng-doc-easing)}[data-ng-doc-width=\"480\"]>.ng-doc-demo-frame,[data-ng-doc-width=\"280\"]>.ng-doc-demo-frame{padding:var(--ng-doc-space-5);background:var(--ng-doc-background);box-shadow:0 0 0 1px var(--ng-doc-border-color),var(--ng-doc-shadow-sm);overflow:auto}[data-ng-doc-width=\"480\"]>.ng-doc-demo-frame{width:min(480px,100%)}[data-ng-doc-width=\"280\"]>.ng-doc-demo-frame{width:min(280px,100%)}.ng-doc-demo-source{background:var(--ng-doc-code-background)}@media(prefers-reduced-motion:reduce){.ng-doc-demo-frame{transition:none}}@media(max-width:640px){.ng-doc-demo-width-readout,.ng-doc-demo-widths{display:none}.ng-doc-demo-copy{margin-left:auto}}\n"] }]
148
- }], propDecorators: { componentName: [{ type: i0.Input, args: [{ isSignal: true, alias: "componentName", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], viewTabs: [{ type: i0.ViewChildren, args: ['viewTab', { isSignal: true }] }] } });
193
+ }, template: "@if (options().container ?? true) {\n <div class=\"ng-doc-demo-toolbar\">\n <div class=\"ng-doc-demo-views\" role=\"tablist\" aria-label=\"Demo view\" ngDocSelectionHost>\n <ng-doc-selection [align]=\"null\" />\n @for (item of views(); track item; let i = $index) {\n <button\n type=\"button\"\n class=\"ng-doc-demo-view\"\n role=\"tab\"\n [id]=\"idPrefix + '-tab-' + i\"\n [attr.aria-selected]=\"view() === item\"\n [ngDocSelectionOrigin]=\"view() === item\"\n [attr.aria-controls]=\"idPrefix + '-panel-' + i\"\n [attr.tabindex]=\"view() === item ? 0 : -1\"\n (click)=\"openView(item)\"\n (keydown)=\"onViewKeydown($event)\"\n #viewTab>\n @if (item === 'preview') {\n Preview\n } @else {\n @if (assets()[i - 1].icon; as icon) {\n <ng-doc-icon [customIcon]=\"icon\"></ng-doc-icon>\n }\n {{ item }}\n }\n </button>\n }\n </div>\n\n @if (view() === 'preview' && !options().fullscreenRoute) {\n <span class=\"ng-doc-demo-width-readout\">{{ widthReadout() }}</span>\n <div class=\"ng-doc-demo-widths\" role=\"group\" aria-label=\"Preview width\" ngDocSelectionHost>\n <ng-doc-selection [align]=\"null\" />\n @for (item of previewWidths; track item.width) {\n <button\n type=\"button\"\n class=\"ng-doc-demo-width\"\n [attr.aria-pressed]=\"previewWidth() === item.width\"\n [ngDocSelectionOrigin]=\"previewWidth() === item.width\"\n [attr.aria-label]=\"item.label\"\n [ngDocTooltip]=\"item.label\"\n (click)=\"previewWidth.set(item.width)\">\n @switch (item.width) {\n @case ('full') {\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <rect x=\"2\" y=\"3\" width=\"20\" height=\"14\" rx=\"2\" />\n <path d=\"M8 21h8M12 17v4\" />\n </svg>\n }\n @case ('480') {\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <rect x=\"4\" y=\"2\" width=\"16\" height=\"20\" rx=\"2\" />\n <path d=\"M12 18h.01\" />\n </svg>\n }\n @case ('280') {\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <rect x=\"6\" y=\"2\" width=\"12\" height=\"20\" rx=\"2\" />\n <path d=\"M12 18h.01\" />\n </svg>\n }\n }\n </button>\n }\n </div>\n }\n\n @if (assets().length) {\n <ng-doc-copy-button class=\"ng-doc-demo-copy\" [text]=\"copyText\" label=\"Copy code\">\n <ng-doc-icon icon=\"copy\"></ng-doc-icon>\n </ng-doc-copy-button>\n }\n\n @if (demoUrl(); as url) {\n <a\n class=\"ng-doc-demo-open\"\n ng-doc-button-icon\n [rounded]=\"false\"\n [href]=\"url\"\n target=\"_blank\"\n rel=\"noopener\"\n aria-label=\"Open in a new tab\"\n ngDocTooltip=\"Open in a new tab\">\n <ng-doc-icon icon=\"external-link\"></ng-doc-icon>\n </a>\n }\n\n @if (view() === 'preview' && !options().fullscreenRoute) {\n <ng-doc-fullscreen-toggle class=\"ng-doc-demo-fullscreen\" [target]=\"stage\" />\n }\n </div>\n\n <div\n class=\"ng-doc-demo-stage\"\n role=\"tabpanel\"\n [id]=\"idPrefix + '-panel-0'\"\n [attr.aria-labelledby]=\"idPrefix + '-tab-0'\"\n [attr.data-ng-doc-width]=\"previewWidth()\"\n [attr.data-ng-doc-isolated]=\"isolated()\"\n [hidden]=\"view() !== 'preview'\"\n ngDocFullscreen\n #stage=\"ngDocFullscreen\">\n <div class=\"ng-doc-demo-frame\">\n <ng-container *ngTemplateOutlet=\"demoTemplate\"></ng-container>\n </div>\n <!-- The toolbar is not shown in fullscreen, so the stage carries its own way out. -->\n @if (stage.active()) {\n <ng-doc-fullscreen-toggle class=\"ng-doc-demo-fullscreen-exit\" [target]=\"stage\" />\n }\n </div>\n\n @for (asset of assets(); track asset.title; let i = $index) {\n @if (view() === asset.title) {\n <div\n class=\"ng-doc-demo-source\"\n role=\"tabpanel\"\n [id]=\"idPrefix + '-panel-' + (i + 1)\"\n [attr.aria-labelledby]=\"idPrefix + '-tab-' + (i + 1)\">\n <ng-doc-code [html]=\"asset.code\" [copyButton]=\"false\"></ng-doc-code>\n </div>\n }\n }\n} @else {\n <ng-container *ngTemplateOutlet=\"demoTemplate\"></ng-container>\n}\n\n<ng-template #demoTemplate>\n @if (options().fullscreenRoute; as route) {\n <ng-doc-fullscreen-button [route]=\"route\"></ng-doc-fullscreen-button>\n } @else if (isolated()) {\n <ng-doc-demo-frame [src]=\"demoUrl()!\" [frameTitle]=\"frameTitle()\" [fill]=\"fullscreen()\" />\n } @else if (demo(); as demo) {\n <ng-container *ngComponentOutlet=\"demo; inputs: options().inputs\"></ng-container>\n }\n</ng-template>\n", styles: [":host{display:block;margin:var(--ng-doc-demo-margin);border:var(--ng-doc-demo-displayer-border);border-radius:var(--ng-doc-demo-displayer-border-radius);background:var(--ng-doc-demo-displayer-background, var(--ng-doc-background));overflow:hidden;min-width:0;--ng-doc-code-margin: 0;--ng-doc-code-border-radius: 0;--ng-doc-code-border: none}:host[data-ng-doc-container=false]{border:none;border-radius:0;background:none;overflow:visible}.ng-doc-demo-toolbar{display:flex;align-items:center;gap:var(--ng-doc-space-2);min-height:48px;padding:var(--ng-doc-space-2);background:var(--ng-doc-demo-toolbar-background);border-bottom:1px solid var(--ng-doc-border-color);font-family:var(--ng-doc-font-family)}.ng-doc-demo-views,.ng-doc-demo-widths{display:inline-flex;flex:none;gap:2px;max-width:100%;padding:3px;border-radius:var(--ng-doc-radius-md);background:var(--ng-doc-base-2);overflow-x:auto;scrollbar-width:none}.ng-doc-demo-views{flex:0 1 auto}.ng-doc-demo-view,.ng-doc-demo-width{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 10px;border:0;border-radius:var(--ng-doc-radius-sm);background:none;font:inherit;font-size:13px;font-weight:500;line-height:18px;color:var(--ng-doc-text-muted);white-space:nowrap;cursor:pointer;--ng-doc-icon-color: currentColor}.ng-doc-demo-view:hover,.ng-doc-demo-width:hover{color:var(--ng-doc-heading-color)}.ng-doc-demo-view:focus-visible,.ng-doc-demo-width:focus-visible{outline:none;box-shadow:var(--ng-doc-focus-ring)}.ng-doc-demo-view[aria-selected=true],.ng-doc-demo-view[aria-pressed=true],.ng-doc-demo-width[aria-selected=true],.ng-doc-demo-width[aria-pressed=true]{color:var(--ng-doc-heading-color)}.ng-doc-demo-views,.ng-doc-demo-widths{position:relative}.ng-doc-demo-views ng-doc-selection,.ng-doc-demo-views ng-doc-selection:not([data-ng-doc-placed])~[aria-selected=true],.ng-doc-demo-views ng-doc-selection:not([data-ng-doc-placed])~[aria-pressed=true],.ng-doc-demo-widths ng-doc-selection,.ng-doc-demo-widths ng-doc-selection:not([data-ng-doc-placed])~[aria-selected=true],.ng-doc-demo-widths ng-doc-selection:not([data-ng-doc-placed])~[aria-pressed=true]{border-radius:var(--ng-doc-radius-sm);background:var(--ng-doc-background);box-shadow:var(--ng-doc-shadow-xs)}.ng-doc-demo-view,.ng-doc-demo-width{position:relative}.ng-doc-demo-width{padding:0 7px}.ng-doc-demo-width svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}:host-context([data-theme=dark]) ng-doc-selection,:host-context([data-theme=dark]) ng-doc-selection:not([data-ng-doc-placed])~[aria-selected=true],:host-context([data-theme=dark]) ng-doc-selection:not([data-ng-doc-placed])~[aria-pressed=true]{box-shadow:var(--ng-doc-shadow-xs),inset 0 0 0 1px var(--ng-doc-base-4)}@media(prefers-color-scheme:dark){:host-context([data-theme=auto]) ng-doc-selection,:host-context([data-theme=auto]) ng-doc-selection:not([data-ng-doc-placed])~[aria-selected=true],:host-context([data-theme=auto]) ng-doc-selection:not([data-ng-doc-placed])~[aria-pressed=true]{box-shadow:var(--ng-doc-shadow-xs),inset 0 0 0 1px var(--ng-doc-base-4)}}.ng-doc-demo-width-readout{margin-left:auto;font-size:12px;font-variant-numeric:tabular-nums;color:var(--ng-doc-text-muted);white-space:nowrap}.ng-doc-demo-copy{margin-left:auto;--ng-doc-icon-color: var(--ng-doc-text-muted)}.ng-doc-demo-width-readout~.ng-doc-demo-copy{margin-left:0}.ng-doc-demo-open{margin-left:auto;--ng-doc-icon-color: var(--ng-doc-text-muted)}.ng-doc-demo-width-readout~.ng-doc-demo-open,.ng-doc-demo-copy~.ng-doc-demo-open{margin-left:0}.ng-doc-demo-fullscreen{margin-left:auto}.ng-doc-demo-width-readout~.ng-doc-demo-fullscreen,.ng-doc-demo-copy~.ng-doc-demo-fullscreen,.ng-doc-demo-open~.ng-doc-demo-fullscreen{margin-left:0}.ng-doc-demo-stage{background-image:radial-gradient(color-mix(in srgb,var(--ng-doc-base-5) 55%,transparent) 1px,transparent 1px);background-size:16px 16px;position:relative;display:grid;place-items:center;min-height:160px;padding:var(--ng-doc-space-8) var(--ng-doc-space-4);background-color:var(--ng-doc-demo-displayer-background, var(--ng-doc-background))}.ng-doc-demo-stage[hidden]{display:none}.ng-doc-demo-stage[data-ng-doc-fullscreen=true]{overflow:auto;padding:var(--ng-doc-space-16) var(--ng-doc-space-8)}.ng-doc-demo-stage[data-ng-doc-fullscreen=true][data-ng-doc-width=full]>.ng-doc-demo-frame{width:auto;max-width:100%}.ng-doc-demo-fullscreen-exit{position:absolute;top:var(--ng-doc-space-4);right:var(--ng-doc-space-4);border-radius:var(--ng-doc-radius-md);background:var(--ng-doc-background);box-shadow:0 0 0 1px var(--ng-doc-border-color),var(--ng-doc-shadow-sm)}.ng-doc-demo-frame{width:100%;min-width:0;border-radius:var(--ng-doc-radius-md);transition:width var(--ng-doc-transition) var(--ng-doc-easing)}[data-ng-doc-width=\"480\"]>.ng-doc-demo-frame,[data-ng-doc-width=\"280\"]>.ng-doc-demo-frame{padding:var(--ng-doc-space-5);background:var(--ng-doc-background);box-shadow:0 0 0 1px var(--ng-doc-border-color),var(--ng-doc-shadow-sm);overflow:auto}[data-ng-doc-width=\"480\"]>.ng-doc-demo-frame{width:min(480px,100%)}[data-ng-doc-width=\"280\"]>.ng-doc-demo-frame{width:min(280px,100%)}.ng-doc-demo-stage[data-ng-doc-isolated=true]>.ng-doc-demo-frame{padding:0;overflow:hidden}.ng-doc-demo-stage[data-ng-doc-isolated=true][data-ng-doc-fullscreen=true]{place-items:stretch center;padding:0}.ng-doc-demo-stage[data-ng-doc-isolated=true][data-ng-doc-fullscreen=true]>.ng-doc-demo-frame{height:100%}.ng-doc-demo-stage[data-ng-doc-isolated=true][data-ng-doc-fullscreen=true][data-ng-doc-width=full]>.ng-doc-demo-frame{width:100%}.ng-doc-demo-source{background:var(--ng-doc-code-background)}@media(prefers-reduced-motion:reduce){.ng-doc-demo-frame{transition:none}}@media(max-width:640px){.ng-doc-demo-width-readout,.ng-doc-demo-widths{display:none}.ng-doc-demo-copy,.ng-doc-demo-open{margin-left:auto}.ng-doc-demo-copy~.ng-doc-demo-open{margin-left:0}}\n"] }]
194
+ }], propDecorators: { componentName: [{ type: i0.Input, args: [{ isSignal: true, alias: "componentName", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], stage: [{ type: i0.ViewChild, args: [i0.forwardRef(() => NgDocFullscreenDirective), { isSignal: true }] }], viewTabs: [{ type: i0.ViewChildren, args: ['viewTab', { isSignal: true }] }] } });
149
195
 
150
196
  /**
151
197
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"ng-doc-app-components-demo.mjs","sources":["../../../../libs/app/components/demo/demo.component.ts","../../../../libs/app/components/demo/demo.component.html","../../../../libs/app/components/demo/ng-doc-app-components-demo.ts"],"sourcesContent":["import { NgComponentOutlet, NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n DOCUMENT,\n ElementRef,\n inject,\n input,\n linkedSignal,\n Signal,\n signal,\n Type,\n untracked,\n viewChildren,\n} from '@angular/core';\nimport { NgDocRootPage } from '@ng-doc/app/classes/root-page';\nimport { NgDocCodeComponent } from '@ng-doc/app/components/code';\nimport { NgDocCopyButtonComponent } from '@ng-doc/app/components/copy-button';\nimport { NgDocFullscreenButtonComponent } from '@ng-doc/app/components/fullscreen-button';\nimport { NgDocFullscreenToggleComponent } from '@ng-doc/app/components/fullscreen-toggle';\nimport { NgDocDemoAsset } from '@ng-doc/app/interfaces';\nimport { asArray } from '@ng-doc/core/helpers/as-array';\nimport { NgDocDemoActionOptions } from '@ng-doc/core/interfaces';\nimport {\n NgDocFullscreenDirective,\n NgDocIconComponent,\n NgDocSelectionComponent,\n NgDocSelectionHostDirective,\n NgDocSelectionOriginDirective,\n NgDocTooltipDirective,\n} from '@ng-doc/ui-kit';\n\n/** Widths the demo can be previewed at. */\nexport type NgDocDemoPreviewWidth = 'full' | '480' | '280';\n\n/** The preview widths, in the order of their buttons. */\nconst PREVIEW_WIDTHS: ReadonlyArray<{\n readonly width: NgDocDemoPreviewWidth;\n readonly label: string;\n readonly readout: string;\n}> = [\n { width: 'full', label: 'Full width', readout: '100% × auto' },\n { width: '480', label: '480 pixels wide', readout: '480 × auto' },\n { width: '280', label: '280 pixels wide', readout: '280 × auto' },\n];\n\nlet nextId = 0;\n\n/**\n * Renders a demo of the page in a panel: a toolbar with Preview and source tabs, the preview\n * width, copy and fullscreen controls, over the demo on a dot-grid stage. The fullscreen control\n * shows the stage fullscreen with the browser Fullscreen API; it is hidden where the browser does\n * not support it.\n *\n * The preview widths set the width of the demo's container; they do not emulate a device, so\n * media queries inside the demo do not respond to them.\n */\n@Component({\n selector: 'ng-doc-demo',\n templateUrl: './demo.component.html',\n styleUrls: ['./demo.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n NgComponentOutlet,\n NgTemplateOutlet,\n NgDocCodeComponent,\n NgDocCopyButtonComponent,\n NgDocFullscreenButtonComponent,\n NgDocFullscreenDirective,\n NgDocFullscreenToggleComponent,\n NgDocIconComponent,\n NgDocSelectionComponent,\n NgDocSelectionHostDirective,\n NgDocSelectionOriginDirective,\n NgDocTooltipDirective,\n ],\n host: {\n '[class]': 'options().class ?? \"\"',\n '[attr.data-ng-doc-container]': 'options().container ?? true',\n },\n})\nexport class NgDocDemoComponent {\n private readonly rootPage = inject(NgDocRootPage);\n private readonly document = inject(DOCUMENT);\n\n /** Name of the demo component in the page's `demos`. */\n readonly componentName = input<string | undefined>(undefined);\n\n /** Options of the `demo` action. */\n readonly options = input<NgDocDemoActionOptions>({});\n\n /** The demo component. */\n readonly demo: Signal<Type<unknown> | undefined> = computed(() => {\n const name: string | undefined = this.componentName();\n\n return name ? this.rootPage.page?.demos?.[name] : undefined;\n });\n\n /** Source files of the demo, filtered by the `tabs` option. */\n readonly assets: Signal<NgDocDemoAsset[]> = computed(() => {\n const name: string | undefined = this.componentName();\n const tabs: string | string[] | undefined = this.options().tabs;\n\n return name\n ? (this.rootPage.demoAssets?.[name] ?? []).filter(\n (asset: NgDocDemoAsset) => !tabs?.length || asArray(tabs).includes(asset.title),\n )\n : [];\n });\n\n /**\n * The open view: `preview`, or the title of a source file. It starts on the preview, or on the\n * default source file when the `expanded` option is set.\n */\n readonly view = linkedSignal<string>(() => {\n const options: NgDocDemoActionOptions = this.options();\n\n return options.expanded ? this.defaultAsset()?.title ?? 'preview' : 'preview';\n });\n\n /** The width the demo is previewed at. */\n readonly previewWidth = signal<NgDocDemoPreviewWidth>('full');\n\n protected readonly previewWidths = PREVIEW_WIDTHS;\n\n /** Readout of the preview width. */\n protected readonly widthReadout: Signal<string> = computed(\n () =>\n PREVIEW_WIDTHS.find(({ width }) => width === this.previewWidth())?.readout ?? '100% × auto',\n );\n\n /** The views in tab order: the preview, then the source files. */\n protected readonly views: Signal<string[]> = computed(() => [\n 'preview',\n ...this.assets().map((asset: NgDocDemoAsset) => asset.title),\n ]);\n\n /** Prefix of the ids that tie the view tabs to their panels. */\n protected readonly idPrefix: string = `ng-doc-demo-${nextId++}`;\n\n /** Reads the code of the open source file (or the default one) when copy is pressed. */\n protected readonly copyText = (): string => {\n const assets: NgDocDemoAsset[] = this.assets();\n const asset: NgDocDemoAsset | undefined =\n assets.find((item: NgDocDemoAsset) => item.title === this.view()) ?? this.defaultAsset();\n const template: HTMLTemplateElement = this.document.createElement('template');\n\n template.innerHTML = asset?.code ?? '';\n\n return template.content.textContent ?? '';\n };\n\n private readonly viewTabs = viewChildren<ElementRef<HTMLElement>>('viewTab');\n\n /**\n * The source file that opens first: the snippet marked `opened`, then `defaultTab`, then the\n * first file (the order the demo has always used).\n */\n private readonly defaultAsset: Signal<NgDocDemoAsset | undefined> = computed(() => {\n const assets: NgDocDemoAsset[] = this.assets();\n const defaultTab: string | undefined = this.options().defaultTab;\n\n return (\n assets.find((asset: NgDocDemoAsset) => asset.opened) ??\n assets.find((asset: NgDocDemoAsset) => asset.title === defaultTab) ??\n assets[0]\n );\n });\n\n /**\n * Opens a view.\n * @param view - `preview` or the title of a source file.\n */\n openView(view: string): void {\n untracked(() => this.view.set(view));\n }\n\n /**\n * Moves between the view tabs with the keyboard.\n * @param event - The key press on a view tab.\n */\n protected onViewKeydown(event: KeyboardEvent): void {\n const views: string[] = this.views();\n const current: number = Math.max(views.indexOf(this.view()), 0);\n const next: number | undefined = {\n ArrowRight: (current + 1) % views.length,\n ArrowLeft: (current - 1 + views.length) % views.length,\n Home: 0,\n End: views.length - 1,\n }[event.key];\n\n if (next !== undefined) {\n event.preventDefault();\n this.openView(views[next]);\n this.viewTabs()[next]?.nativeElement.focus();\n }\n }\n}\n","@if (options().container ?? true) {\n <div class=\"ng-doc-demo-toolbar\">\n <div class=\"ng-doc-demo-views\" role=\"tablist\" aria-label=\"Demo view\" ngDocSelectionHost>\n <ng-doc-selection [align]=\"null\" />\n @for (item of views(); track item; let i = $index) {\n <button\n type=\"button\"\n class=\"ng-doc-demo-view\"\n role=\"tab\"\n [id]=\"idPrefix + '-tab-' + i\"\n [attr.aria-selected]=\"view() === item\"\n [ngDocSelectionOrigin]=\"view() === item\"\n [attr.aria-controls]=\"idPrefix + '-panel-' + i\"\n [attr.tabindex]=\"view() === item ? 0 : -1\"\n (click)=\"openView(item)\"\n (keydown)=\"onViewKeydown($event)\"\n #viewTab>\n @if (item === 'preview') {\n Preview\n } @else {\n @if (assets()[i - 1].icon; as icon) {\n <ng-doc-icon [customIcon]=\"icon\"></ng-doc-icon>\n }\n {{ item }}\n }\n </button>\n }\n </div>\n\n @if (view() === 'preview' && !options().fullscreenRoute) {\n <span class=\"ng-doc-demo-width-readout\">{{ widthReadout() }}</span>\n <div class=\"ng-doc-demo-widths\" role=\"group\" aria-label=\"Preview width\" ngDocSelectionHost>\n <ng-doc-selection [align]=\"null\" />\n @for (item of previewWidths; track item.width) {\n <button\n type=\"button\"\n class=\"ng-doc-demo-width\"\n [attr.aria-pressed]=\"previewWidth() === item.width\"\n [ngDocSelectionOrigin]=\"previewWidth() === item.width\"\n [attr.aria-label]=\"item.label\"\n [ngDocTooltip]=\"item.label\"\n (click)=\"previewWidth.set(item.width)\">\n @switch (item.width) {\n @case ('full') {\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <rect x=\"2\" y=\"3\" width=\"20\" height=\"14\" rx=\"2\" />\n <path d=\"M8 21h8M12 17v4\" />\n </svg>\n }\n @case ('480') {\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <rect x=\"4\" y=\"2\" width=\"16\" height=\"20\" rx=\"2\" />\n <path d=\"M12 18h.01\" />\n </svg>\n }\n @case ('280') {\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <rect x=\"6\" y=\"2\" width=\"12\" height=\"20\" rx=\"2\" />\n <path d=\"M12 18h.01\" />\n </svg>\n }\n }\n </button>\n }\n </div>\n }\n\n @if (assets().length) {\n <ng-doc-copy-button class=\"ng-doc-demo-copy\" [text]=\"copyText\" label=\"Copy code\">\n <ng-doc-icon icon=\"copy\"></ng-doc-icon>\n </ng-doc-copy-button>\n }\n\n @if (view() === 'preview' && !options().fullscreenRoute) {\n <ng-doc-fullscreen-toggle class=\"ng-doc-demo-fullscreen\" [target]=\"stage\" />\n }\n </div>\n\n <div\n class=\"ng-doc-demo-stage\"\n role=\"tabpanel\"\n [id]=\"idPrefix + '-panel-0'\"\n [attr.aria-labelledby]=\"idPrefix + '-tab-0'\"\n [attr.data-ng-doc-width]=\"previewWidth()\"\n [hidden]=\"view() !== 'preview'\"\n ngDocFullscreen\n #stage=\"ngDocFullscreen\">\n <div class=\"ng-doc-demo-frame\">\n <ng-container *ngTemplateOutlet=\"demoTemplate\"></ng-container>\n </div>\n <!-- The toolbar is not shown in fullscreen, so the stage carries its own way out. -->\n @if (stage.active()) {\n <ng-doc-fullscreen-toggle class=\"ng-doc-demo-fullscreen-exit\" [target]=\"stage\" />\n }\n </div>\n\n @for (asset of assets(); track asset.title; let i = $index) {\n @if (view() === asset.title) {\n <div\n class=\"ng-doc-demo-source\"\n role=\"tabpanel\"\n [id]=\"idPrefix + '-panel-' + (i + 1)\"\n [attr.aria-labelledby]=\"idPrefix + '-tab-' + (i + 1)\">\n <ng-doc-code [html]=\"asset.code\" [copyButton]=\"false\"></ng-doc-code>\n </div>\n }\n }\n} @else {\n <ng-container *ngTemplateOutlet=\"demoTemplate\"></ng-container>\n}\n\n<ng-template #demoTemplate>\n @if (options().fullscreenRoute; as route) {\n <ng-doc-fullscreen-button [route]=\"route\"></ng-doc-fullscreen-button>\n } @else if (demo(); as demo) {\n <ng-container *ngComponentOutlet=\"demo; inputs: options().inputs\"></ng-container>\n }\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAoCA;AACA,MAAM,cAAc,GAIf;IACH,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE;IAC9D,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,YAAY,EAAE;IACjE,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,YAAY,EAAE;CAClE;AAED,IAAI,MAAM,GAAG,CAAC;AAEd;;;;;;;;AAQG;MAyBU,kBAAkB,CAAA;AAxB/B,IAAA,WAAA,GAAA;AA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A,YAAA,EAAA,WAAA,EAAA,aAAA,EAAA,YAAA,CAAA,EAAA,QAAA,EAAA,CAAA,cAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAOZ,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAxB9B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,aAAa,EAAA,eAAA,EAGN,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC;wBACP,iBAAiB;wBACjB,gBAAgB;wBAChB,kBAAkB;wBAClB,wBAAwB;wBACxB,8BAA8B;wBAC9B,wBAAwB;wBACxB,8BAA8B;wBAC9B,kBAAkB;wBAClB,uBAAuB;wBACvB,2BAA2B;wBAC3B,6BAA6B;wBAC7B,qBAAqB;qBACtB,EAAA,IAAA,EACK;AACJ,wBAAA,SAAS,EAAE,uBAAuB;AAClC,wBAAA,8BAA8B,EAAE,6BAA6B;AAC9D,qBAAA,EAAA,QAAA,EAAA,w4IAAA,EAAA,MAAA,EAAA,CAAA,2lKAAA,CAAA,EAAA;iRAyEiE,SAAS,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEzJ7E;;AAEG;;;;"}
1
+ {"version":3,"file":"ng-doc-app-components-demo.mjs","sources":["../../../../libs/app/components/demo/demo.component.ts","../../../../libs/app/components/demo/demo.component.html","../../../../libs/app/components/demo/ng-doc-app-components-demo.ts"],"sourcesContent":["import {\n APP_BASE_HREF,\n NgComponentOutlet,\n NgTemplateOutlet,\n PlatformLocation,\n} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n DOCUMENT,\n ElementRef,\n inject,\n input,\n linkedSignal,\n Signal,\n signal,\n Type,\n untracked,\n viewChild,\n viewChildren,\n} from '@angular/core';\nimport { NgDocRootPage } from '@ng-doc/app/classes/root-page';\nimport { NgDocCodeComponent } from '@ng-doc/app/components/code';\nimport { NgDocCopyButtonComponent } from '@ng-doc/app/components/copy-button';\nimport { NgDocDemoFrameComponent } from '@ng-doc/app/components/demo-frame';\nimport { NgDocFullscreenButtonComponent } from '@ng-doc/app/components/fullscreen-button';\nimport { NgDocFullscreenToggleComponent } from '@ng-doc/app/components/fullscreen-toggle';\nimport { NgDocDemoAsset } from '@ng-doc/app/interfaces';\nimport { asArray } from '@ng-doc/core/helpers/as-array';\nimport { NgDocDemoActionOptions } from '@ng-doc/core/interfaces';\nimport {\n NgDocButtonIconComponent,\n NgDocFullscreenDirective,\n NgDocIconComponent,\n NgDocSelectionComponent,\n NgDocSelectionHostDirective,\n NgDocSelectionOriginDirective,\n NgDocTooltipDirective,\n} from '@ng-doc/ui-kit';\n\n/** Widths the demo can be previewed at. */\nexport type NgDocDemoPreviewWidth = 'full' | '480' | '280';\n\n/** The preview widths, in the order of their buttons. */\nconst PREVIEW_WIDTHS: ReadonlyArray<{\n readonly width: NgDocDemoPreviewWidth;\n readonly label: string;\n readonly readout: string;\n}> = [\n { width: 'full', label: 'Full width', readout: '100% × auto' },\n { width: '480', label: '480 pixels wide', readout: '480 × auto' },\n { width: '280', label: '280 pixels wide', readout: '280 × auto' },\n];\n\nlet nextId = 0;\n\n/**\n * Renders a demo of the page in a panel: a toolbar with Preview and source tabs, the preview\n * width, copy and fullscreen controls, over the demo on a dot-grid stage. The fullscreen control\n * shows the stage fullscreen with the browser Fullscreen API; it is hidden where the browser does\n * not support it.\n *\n * When the Vite engine built demo pages for the page (`NgDocRootPage.demoRoute`), the toolbar\n * opens the demo's page in a new tab, and an isolated demo (the `isolated` option, or\n * `isolatedDemos`) is shown in an iframe of its page: the preview widths are then the width of the\n * iframe's viewport, so media queries inside the demo respond to them. Otherwise the demo renders\n * in the page, and the preview widths set the width of its container only.\n */\n@Component({\n selector: 'ng-doc-demo',\n templateUrl: './demo.component.html',\n styleUrls: ['./demo.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n NgComponentOutlet,\n NgTemplateOutlet,\n NgDocCodeComponent,\n NgDocButtonIconComponent,\n NgDocCopyButtonComponent,\n NgDocDemoFrameComponent,\n NgDocFullscreenButtonComponent,\n NgDocFullscreenDirective,\n NgDocFullscreenToggleComponent,\n NgDocIconComponent,\n NgDocSelectionComponent,\n NgDocSelectionHostDirective,\n NgDocSelectionOriginDirective,\n NgDocTooltipDirective,\n ],\n host: {\n '[class]': 'options().class ?? \"\"',\n '[attr.data-ng-doc-container]': 'options().container ?? true',\n },\n})\nexport class NgDocDemoComponent {\n private readonly rootPage = inject(NgDocRootPage);\n private readonly document = inject(DOCUMENT);\n private readonly platformLocation = inject(PlatformLocation);\n private readonly appBaseHref = inject(APP_BASE_HREF, { optional: true });\n\n /** Name of the demo component in the page's `demos`. */\n readonly componentName = input<string | undefined>(undefined);\n\n /** Options of the `demo` action. */\n readonly options = input<NgDocDemoActionOptions>({});\n\n /** The demo component. */\n readonly demo: Signal<Type<unknown> | undefined> = computed(() => {\n const name: string | undefined = this.componentName();\n\n return name ? this.rootPage.page?.demos?.[name] : undefined;\n });\n\n /**\n * The URL of the demo's page, when the page has demo pages and the demo exists: the generated\n * demo route and the demo's name under the base href, with the `inputs` option as a query\n * parameter.\n */\n readonly demoUrl: Signal<string | undefined> = computed(() => {\n const route: string | undefined = this.rootPage.demoRoute;\n const name: string | undefined = this.componentName();\n\n if (!route || !name || !this.demo()) return undefined;\n // The demo pages are files under the document's base href, whatever the location strategy.\n const baseHref: string = (\n this.appBaseHref ??\n this.platformLocation.getBaseHrefFromDOM() ??\n '/'\n ).replace(/^\\/+|\\/+$/g, '');\n const path: string = [...baseHref.split('/'), ...route.split('/'), name]\n .filter(Boolean)\n .map((segment: string) => encodeURIComponent(segment))\n .join('/');\n const inputs: Record<string, unknown> | undefined = this.options().inputs;\n const query: string =\n inputs && Object.keys(inputs).length\n ? `?inputs=${encodeURIComponent(JSON.stringify(inputs))}`\n : '';\n\n return `/${path}${query}`;\n });\n\n /** Whether the demo is shown in an iframe of its page. */\n readonly isolated: Signal<boolean> = computed(\n () =>\n !!this.demoUrl() &&\n !this.options().fullscreenRoute &&\n (this.options().isolated ?? this.rootPage.isolatedDemos ?? false),\n );\n\n /** The accessible title of the demo's iframe. */\n protected readonly frameTitle: Signal<string> = computed(() => `${this.componentName()} demo`);\n\n /** Whether the stage is fullscreen. */\n protected readonly fullscreen: Signal<boolean> = computed(() => this.stage()?.active() ?? false);\n\n private readonly stage = viewChild(NgDocFullscreenDirective);\n\n /** Source files of the demo, filtered by the `tabs` option. */\n readonly assets: Signal<NgDocDemoAsset[]> = computed(() => {\n const name: string | undefined = this.componentName();\n const tabs: string | string[] | undefined = this.options().tabs;\n\n return name\n ? (this.rootPage.demoAssets?.[name] ?? []).filter(\n (asset: NgDocDemoAsset) => !tabs?.length || asArray(tabs).includes(asset.title),\n )\n : [];\n });\n\n /**\n * The open view: `preview`, or the title of a source file. It starts on the preview, or on the\n * default source file when the `expanded` option is set.\n */\n readonly view = linkedSignal<string>(() => {\n const options: NgDocDemoActionOptions = this.options();\n\n return options.expanded ? this.defaultAsset()?.title ?? 'preview' : 'preview';\n });\n\n /** The width the demo is previewed at. */\n readonly previewWidth = signal<NgDocDemoPreviewWidth>('full');\n\n protected readonly previewWidths = PREVIEW_WIDTHS;\n\n /** Readout of the preview width. */\n protected readonly widthReadout: Signal<string> = computed(\n () =>\n PREVIEW_WIDTHS.find(({ width }) => width === this.previewWidth())?.readout ?? '100% × auto',\n );\n\n /** The views in tab order: the preview, then the source files. */\n protected readonly views: Signal<string[]> = computed(() => [\n 'preview',\n ...this.assets().map((asset: NgDocDemoAsset) => asset.title),\n ]);\n\n /** Prefix of the ids that tie the view tabs to their panels. */\n protected readonly idPrefix: string = `ng-doc-demo-${nextId++}`;\n\n /** Reads the code of the open source file (or the default one) when copy is pressed. */\n protected readonly copyText = (): string => {\n const assets: NgDocDemoAsset[] = this.assets();\n const asset: NgDocDemoAsset | undefined =\n assets.find((item: NgDocDemoAsset) => item.title === this.view()) ?? this.defaultAsset();\n const template: HTMLTemplateElement = this.document.createElement('template');\n\n template.innerHTML = asset?.code ?? '';\n\n return template.content.textContent ?? '';\n };\n\n private readonly viewTabs = viewChildren<ElementRef<HTMLElement>>('viewTab');\n\n /**\n * The source file that opens first: the snippet marked `opened`, then `defaultTab`, then the\n * first file (the order the demo has always used).\n */\n private readonly defaultAsset: Signal<NgDocDemoAsset | undefined> = computed(() => {\n const assets: NgDocDemoAsset[] = this.assets();\n const defaultTab: string | undefined = this.options().defaultTab;\n\n return (\n assets.find((asset: NgDocDemoAsset) => asset.opened) ??\n assets.find((asset: NgDocDemoAsset) => asset.title === defaultTab) ??\n assets[0]\n );\n });\n\n /**\n * Opens a view.\n * @param view - `preview` or the title of a source file.\n */\n openView(view: string): void {\n untracked(() => this.view.set(view));\n }\n\n /**\n * Moves between the view tabs with the keyboard.\n * @param event - The key press on a view tab.\n */\n protected onViewKeydown(event: KeyboardEvent): void {\n const views: string[] = this.views();\n const current: number = Math.max(views.indexOf(this.view()), 0);\n const next: number | undefined = {\n ArrowRight: (current + 1) % views.length,\n ArrowLeft: (current - 1 + views.length) % views.length,\n Home: 0,\n End: views.length - 1,\n }[event.key];\n\n if (next !== undefined) {\n event.preventDefault();\n this.openView(views[next]);\n this.viewTabs()[next]?.nativeElement.focus();\n }\n }\n}\n","@if (options().container ?? true) {\n <div class=\"ng-doc-demo-toolbar\">\n <div class=\"ng-doc-demo-views\" role=\"tablist\" aria-label=\"Demo view\" ngDocSelectionHost>\n <ng-doc-selection [align]=\"null\" />\n @for (item of views(); track item; let i = $index) {\n <button\n type=\"button\"\n class=\"ng-doc-demo-view\"\n role=\"tab\"\n [id]=\"idPrefix + '-tab-' + i\"\n [attr.aria-selected]=\"view() === item\"\n [ngDocSelectionOrigin]=\"view() === item\"\n [attr.aria-controls]=\"idPrefix + '-panel-' + i\"\n [attr.tabindex]=\"view() === item ? 0 : -1\"\n (click)=\"openView(item)\"\n (keydown)=\"onViewKeydown($event)\"\n #viewTab>\n @if (item === 'preview') {\n Preview\n } @else {\n @if (assets()[i - 1].icon; as icon) {\n <ng-doc-icon [customIcon]=\"icon\"></ng-doc-icon>\n }\n {{ item }}\n }\n </button>\n }\n </div>\n\n @if (view() === 'preview' && !options().fullscreenRoute) {\n <span class=\"ng-doc-demo-width-readout\">{{ widthReadout() }}</span>\n <div class=\"ng-doc-demo-widths\" role=\"group\" aria-label=\"Preview width\" ngDocSelectionHost>\n <ng-doc-selection [align]=\"null\" />\n @for (item of previewWidths; track item.width) {\n <button\n type=\"button\"\n class=\"ng-doc-demo-width\"\n [attr.aria-pressed]=\"previewWidth() === item.width\"\n [ngDocSelectionOrigin]=\"previewWidth() === item.width\"\n [attr.aria-label]=\"item.label\"\n [ngDocTooltip]=\"item.label\"\n (click)=\"previewWidth.set(item.width)\">\n @switch (item.width) {\n @case ('full') {\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <rect x=\"2\" y=\"3\" width=\"20\" height=\"14\" rx=\"2\" />\n <path d=\"M8 21h8M12 17v4\" />\n </svg>\n }\n @case ('480') {\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <rect x=\"4\" y=\"2\" width=\"16\" height=\"20\" rx=\"2\" />\n <path d=\"M12 18h.01\" />\n </svg>\n }\n @case ('280') {\n <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <rect x=\"6\" y=\"2\" width=\"12\" height=\"20\" rx=\"2\" />\n <path d=\"M12 18h.01\" />\n </svg>\n }\n }\n </button>\n }\n </div>\n }\n\n @if (assets().length) {\n <ng-doc-copy-button class=\"ng-doc-demo-copy\" [text]=\"copyText\" label=\"Copy code\">\n <ng-doc-icon icon=\"copy\"></ng-doc-icon>\n </ng-doc-copy-button>\n }\n\n @if (demoUrl(); as url) {\n <a\n class=\"ng-doc-demo-open\"\n ng-doc-button-icon\n [rounded]=\"false\"\n [href]=\"url\"\n target=\"_blank\"\n rel=\"noopener\"\n aria-label=\"Open in a new tab\"\n ngDocTooltip=\"Open in a new tab\">\n <ng-doc-icon icon=\"external-link\"></ng-doc-icon>\n </a>\n }\n\n @if (view() === 'preview' && !options().fullscreenRoute) {\n <ng-doc-fullscreen-toggle class=\"ng-doc-demo-fullscreen\" [target]=\"stage\" />\n }\n </div>\n\n <div\n class=\"ng-doc-demo-stage\"\n role=\"tabpanel\"\n [id]=\"idPrefix + '-panel-0'\"\n [attr.aria-labelledby]=\"idPrefix + '-tab-0'\"\n [attr.data-ng-doc-width]=\"previewWidth()\"\n [attr.data-ng-doc-isolated]=\"isolated()\"\n [hidden]=\"view() !== 'preview'\"\n ngDocFullscreen\n #stage=\"ngDocFullscreen\">\n <div class=\"ng-doc-demo-frame\">\n <ng-container *ngTemplateOutlet=\"demoTemplate\"></ng-container>\n </div>\n <!-- The toolbar is not shown in fullscreen, so the stage carries its own way out. -->\n @if (stage.active()) {\n <ng-doc-fullscreen-toggle class=\"ng-doc-demo-fullscreen-exit\" [target]=\"stage\" />\n }\n </div>\n\n @for (asset of assets(); track asset.title; let i = $index) {\n @if (view() === asset.title) {\n <div\n class=\"ng-doc-demo-source\"\n role=\"tabpanel\"\n [id]=\"idPrefix + '-panel-' + (i + 1)\"\n [attr.aria-labelledby]=\"idPrefix + '-tab-' + (i + 1)\">\n <ng-doc-code [html]=\"asset.code\" [copyButton]=\"false\"></ng-doc-code>\n </div>\n }\n }\n} @else {\n <ng-container *ngTemplateOutlet=\"demoTemplate\"></ng-container>\n}\n\n<ng-template #demoTemplate>\n @if (options().fullscreenRoute; as route) {\n <ng-doc-fullscreen-button [route]=\"route\"></ng-doc-fullscreen-button>\n } @else if (isolated()) {\n <ng-doc-demo-frame [src]=\"demoUrl()!\" [frameTitle]=\"frameTitle()\" [fill]=\"fullscreen()\" />\n } @else if (demo(); as demo) {\n <ng-container *ngComponentOutlet=\"demo; inputs: options().inputs\"></ng-container>\n }\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],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